dereuromark/cakephp-boost 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

dereuromark/cakephp-boost

Composer 安装命令:

composer require dereuromark/cakephp-boost

包简介

CakePHP Boost - Development tool for AI-assisted coding with CakePHP

README 文档

README

A development tool to enhance AI-assisted coding within CakePHP projects by providing essential context, structure, and introspection capabilities.

Features

Phase 1 - MVP (Current)

  • Documentation Search: Fast, full-text search of CakePHP documentation using SQLite FTS5
  • Schema Introspection: View database schema in human-readable format
  • MCP Server: Model Context Protocol server for AI assistants (Claude Code, Cursor, etc.)
  • Console Commands: Simple CLI interface for indexing and searching documentation
  • Sample Documentation: Pre-loaded with 20+ common CakePHP patterns and examples

Installation

For Development (within this sandbox)

The plugin is already loaded in this project. Just run:

# Index documentation (run once or when updating docs)
bin/cake boost_index --clear

# Search documentation
bin/cake boost_search "your query here"

For External Projects (when published)

composer require dereuromark/cakephp-boost --dev

Then add to your config/plugins.php:

'Boost' => ['onlyCli' => true],

Usage

Indexing Documentation

Index CakePHP Book documentation:

# Index all documentation
bin/cake boost_index

# Clear existing index and re-index
bin/cake boost_index --clear

# Index only specific sources
bin/cake boost_index --source book

Searching Documentation

Basic search:

bin/cake boost_search "belongsToMany"

Natural language queries:

bin/cake boost_search "how to save data"
bin/cake boost_search "how do I validate email fields"
bin/cake boost_search "what is the correct way to use transactions"

Filter by category:

bin/cake boost_search "validation" --category orm
bin/cake boost_search "controller" --category controller

Limit results:

bin/cake boost_search "query" --limit 5

Available Categories

  • orm - Database, models, tables, associations
  • controller - Controllers, components, request/response
  • view - Templates, helpers, rendering
  • validation - Form validation, rules
  • authentication - User authentication
  • authorization - Access control, permissions
  • testing - PHPUnit tests, fixtures
  • middleware - Middleware stack
  • routing - Routes, prefixes
  • email - Mailer, sending emails
  • caching - Cache configuration and usage
  • events - Event system
  • console - CLI commands

MCP Server (AI Integration)

The plugin provides an MCP (Model Context Protocol) server for AI assistants like Claude Code:

# Start the MCP server
php bin/cake boost_mcp_server

Available Tools:

  • search_documentation - Search CakePHP docs with natural language
  • get_database_schema - Get database schema information

Configuration for Claude Code:

Create .claude/mcp_config.json in your project:

{
  "mcpServers": {
    "cakephp-boost": {
      "command": "php",
      "args": ["bin/cake", "boost_mcp_server"]
    }
  }
}

See MCP_SETUP.md for detailed configuration instructions.

How It Works

  1. Indexing: The boost_index command parses CakePHP documentation and stores it in a SQLite database with full-text search (FTS5) enabled
  2. Searching: The boost_search command performs fast full-text queries against the indexed documentation
  3. Results: Returns relevant documentation snippets with titles, URLs, and context

Database

Documentation is stored in: tmp/boost/documentation.db

The database uses SQLite's FTS5 (Full-Text Search) with Porter stemming for intelligent word matching.

Current Limitations (MVP)

  • Sample Data Only: Currently uses pre-defined documentation snippets
  • No Real-Time Updates: Documentation must be manually re-indexed
  • No API Docs: Only CakePHP Book content is indexed (API docs coming in Phase 2)
  • Basic Search: Keyword-based search only (semantic search coming in Phase 2)

Roadmap

Phase 2 - Semantic Search (Planned)

  • Generate embeddings for documentation using OpenAI or local models
  • Vector similarity search for context-aware results
  • Better understanding of natural language queries

Phase 3 - Guidelines & Integration (Planned)

  • CakePHP 5.x coding guidelines
  • Popular plugin guidelines (Tools, Shim, Authentication, etc.)
  • Auto-generated context files for Claude Code

Phase 4 - MCP Server (Optional)

  • Model Context Protocol server for AI assistants
  • Real-time application introspection
  • Database schema access for AI

Examples

Find Association Documentation

$ bin/cake boost_search "belongsToMany"

Found 1 results:

1. Associations - BelongsToMany [book]
   Category: orm
   URL: https://book.cakephp.org/5/en/orm/associations.html#belongstomany
   The belongsToMany association is used when two models are associated through a join table...

Find Validation Examples

$ bin/cake boost_search "validation"

Found 2 results:

1. Form Validation - Custom Validators [book]
   Category: validation
   URL: https://book.cakephp.org/5/en/core-libraries/validation.html#custom-validation-rules
   Create custom validation rules as methods in your Table class...

2. Validation Rules [book]
   Category: validation
   URL: https://book.cakephp.org/5/en/core-libraries/validation.html
   Add validation rules in your Table class validationDefault() method...

Contributing

This is currently an internal plugin in the Sandbox project. Once extracted to a separate repository, contributions will be welcome!

License

MIT License

Credits

Inspired by Laravel Boost

dereuromark/cakephp-boost 适用场景与选型建议

dereuromark/cakephp-boost 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2 次下载、GitHub Stars 达 1, 最近一次更新时间为 2025 年 11 月 11 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「documentation」 「plugin」 「search」 「cakephp」 「boost」 「ai」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 dereuromark/cakephp-boost 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 dereuromark/cakephp-boost 我们能提供哪些服务?
定制开发 / 二次开发

基于 dereuromark/cakephp-boost 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 2
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 19
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-11-11