Agentic ColdBox
The ColdBox CLI has tons of AI features to help build context and skills for any LLM and Agent
Table of Contents
Introduction
ColdBox AI Integration supercharges your development workflow by providing comprehensive AI assistance for both BoxLang and CFML applications. Unlike single-framework solutions, ColdBox AI Integration offers:
Dual-Language Support: First-class support for BoxLang and CFML with automatic detection
Multi-Agent Ecosystem: Works with Claude, GitHub Copilot, Cursor, Codex, Gemini, and OpenCode
30+ MCP Servers: Extensive Model Context Protocol server registry for enhanced AI capabilities
Module Awareness: Automatically integrates guidelines and skills from installed modules
Context Analytics: Built-in tools to visualize and optimize AI context usage
Override System: Flexible customization at core, module, and project levels
Health Diagnostics: Intelligent validation and troubleshooting tools
The system combines four key components:
Guidelines - Framework documentation and best practices (core inlined, others on-demand)
Skills - On-demand coding cookbooks for specific tasks
Agents - AI assistant configurations (Claude, Copilot, etc.)
MCP Servers - Context protocol servers for enhanced AI capabilities
Subagent Pattern Architecture: Core framework guidelines (ColdBox + language) are embedded directly in agent files for immediate access, while module guidelines and all skills are available on-demand. This reduces context from ~62KB to ~8KB while maintaining full capability.
Together, these components ensure AI assistants generate high-quality, idiomatic code that follows ColdBox conventions and leverages the full power of the BoxLang/CFML ecosystem.
To start, make sure you are on the latest coldbox-cli in your CommandBox installation.
System Architecture
Installation
Quick Start
Install ColdBox AI Integration using CommandBox:
The installation wizard will guide you through:
Agent Selection - Choose which AI assistants you use (Claude, Copilot, Cursor, etc.)
Guidelines - Select framework documentation to include
Skills - Choose coding cookbooks for your workflow
MCP Servers - Configure Model Context Protocol servers
After installation, the following structure is created in your project:
Additionally, agent configuration files are created for you (paths defined in AgentRegistry.cfc):
CLAUDE.md- Claude Desktop/Code assistant.github/copilot-instructions.md- GitHub Copilot.cursorrules- Cursor IDEAGENTS.md- Codex & OpenCode (shared file)GEMINI.md- Gemini CLI
Keeping Resources Updated
Keep your AI resources synchronized with installed modules:
Automate updates by adding to your CommandBox scripts in box.json:
Setting Up AI Agents
After installation, configure your AI agents:
Claude Desktop:
Open Claude Desktop settings
Enable the MCP server for your project
Restart Claude Desktop
GitHub Copilot (VS Code):
Agent configuration is automatically in
.github/copilot-instructions.mdReload VS Code window
Copilot will use the instructions automatically
Cursor:
The
.cursorrulesfile is automatically recognizedRestart Cursor IDE
Rules are applied to all AI interactions
Other Agents:
Follow the specific agent's documentation for loading instruction files
Configuration files are generated during
coldbox ai install
Core Concepts
Guidelines vs Skills
ColdBox AI Integration uses a subagent pattern with three tiers of context:
When Loaded
Always embedded in agent files
Requested by name when needed
Requested by name when needed
Scope
Essential framework knowledge
Module-specific documentation
Focused, task-specific
Purpose
Core ColdBox + language conventions
Extended module patterns
Step-by-step implementation guides
Content
"What" and "Why" (fundamentals)
"What" and "Why" (specialized)
"How" and "When" (actionable)
Size
~20KB (ColdBox + language)
1-5KB per guideline
2-10KB per skill
Examples
ColdBox MVC structure, BoxLang syntax
CBSecurity patterns, QB query builder
Creating REST APIs, Writing tests
Core Guidelines (ColdBox framework + language) are always present in agent files, providing immediate access to essential knowledge.
Module Guidelines are inventoried with descriptions, allowing agents to discover and request specific module documentation when needed.
Skills are activated on-demand when working on specific tasks. Both module guidelines and skills use the inventory pattern to reduce context bloat while providing deep expertise exactly when needed.
Context Management
ColdBox AI Integration includes sophisticated context tracking:
Automatic Estimation: Calculates total context size in KB and tokens
Usage Indicators: Color-coded warnings (Low/Moderate/High/Very High)
Model Compatibility: Shows utilization for Claude, GPT-4, GPT-3.5-Turbo, Gemini
Optimization Alerts: Warns when context exceeds recommended thresholds
Use the stats command to monitor context usage:
Context Optimization: The subagent pattern achieves a 58% reduction in base context (from ~62KB to ~33KB) while maintaining full framework knowledge through the inventory system.
Multi-Language Support
ColdBox AI Integration is the only AI system with native BoxLang and CFML support:
Automatic Language Detection:
Server engine detection (BoxLang runtime)
box.jsonconfiguration (languageproperty)TestBox runner settings
Language-Specific Content:
Separate templates for BoxLang and CFML
Syntax-appropriate code examples
Version-specific best practices
Seamless Switching:
Override detection with
--boxlangor--cfmlflagsPer-guideline language targeting
Mixed-language project support
AI Guidelines
Guidelines are instructional documents that teach AI agents about framework conventions, architectural patterns, and best practices. Core framework guidelines (ColdBox + language) are embedded directly in agent files, while module and custom guidelines are available on-demand through an inventory system with descriptions.
Available Guidelines
ColdBox AI Integration includes 46+ built-in guidelines covering the entire ecosystem:
Core Framework (5 - Inlined in Agent Files)
boxlang - BoxLang language features and syntax
cfml - CFML language fundamentals
coldbox - ColdBox framework architecture and conventions
testbox - BDD/TDD testing framework
docbox - Documentation generation
Module Guidelines (41+ - Available On-Demand)
Authentication & Security
cbsecurity - Enterprise security framework
cbauth - Authentication system
cbcsrf - CSRF protection
cbsecurity-passkeys - Passwordless authentication
Database & ORM
qb - Query Builder
quick - Active Record ORM
cborm - ORM integration
cbmigrations / commandbox-migrations - Database migrations
REST & APIs
cbswagger - API documentation
hyper - HTTP client
cbvalidation - Data validation
cors - CORS configuration
Caching & Performance
cachebox - Caching strategies (when not using core)
cbstorages - Storage abstractions
Development Tools
cbdebugger - Debugging tools
route-visualizer - Route inspection
commandbox-cfformat - Code formatting
commandbox-boxlang - BoxLang runtime
Additional Modules (20+)
And many more: cbstreams, cbmailservices, cbmessagebox, cbpaginator, cbwire, mementifier, etc.
View installed guidelines:
Guideline Types
Guidelines are organized into four tiers:
Core - Built into ColdBox CLI, framework-level documentation
Module - Automatically discovered from installed CommandBox modules
Custom - Your project-specific guidelines in
.ai/guidelines/custom/Override - Custom versions replacing core/module guidelines
This hierarchy allows seamless integration from framework to module to project level.
Custom Guidelines
Add project-specific guidelines to tailor AI assistance to your codebase:
Example guideline structure:
Custom guidelines will be automatically included in agent configurations.
Overriding Guidelines
Override core or module guidelines to customize them for your needs:
Overrides take precedence over core/module guidelines, allowing you to adapt standard documentation to your team's conventions.
Module Guidelines
CommandBox module authors can include AI guidelines in their packages:
Directory Structure:
Module Guideline Template:
Keep module guidelines concise (1-3KB). Users can override them if needed.
AI Skills
Skills are on-demand coding cookbooks that provide detailed, step-by-step guidance for specific development tasks. Like module guidelines, skills use an inventory system with descriptions, allowing AI agents to discover and request them when needed. This keeps AI context lean while providing deep expertise exactly when required.
Available Skills
ColdBox AI Integration includes 71+ built-in skills (all available on-demand through the inventory system):
Scaffolding & Creation (12)
creating-applications - New app generation
creating-handlers - Controller creation
creating-models - Model and service creation
creating-views - View templates
creating-layouts - Layout templates
creating-resources - RESTful resources
creating-interceptors - AOP interceptors
creating-modules - Module scaffolding
generating-crud - Complete CRUD generation
generating-migrations - Database migrations
generating-tests - Test case creation
scaffolding-commands - CLI command creation
Testing & Quality (8)
writing-unit-tests - Unit testing patterns
writing-integration-tests - Integration test strategies
writing-bdd-specs - BDD specification style
using-mocks - Test doubles and mocking
testing-handlers - Controller testing
testing-models - Model testing
testing-interceptors - Interceptor testing
test-driven-development - TDD workflow
Configuration & Setup (6)
configuring-environments - Environment management
configuring-datasources - Database configuration
configuring-routes - Routing setup
configuring-wirebox - DI configuration
configuring-caching - Cache configuration
configuring-logging - Logger setup
Database & ORM (10)
using-qb - Query Builder patterns
using-cborm - ORM usage
using-quick - Quick ORM
creating-migrations - Migration authoring
database-seeding - Test data seeding
query-optimization - SQL optimization
using-transactions - Transaction management
database-relationships - Entity relationships
using-scopes - Query scopes
database-testing - Database test strategies
REST APIs (8)
building-rest-apis - RESTful API design
api-authentication - API auth strategies
api-versioning - version management
api-documentation - OpenAPI/Swagger
api-error-handling - Error responses
api-testing - API testing
jwt-authentication - JWT implementation
oauth-integration - OAuth flows
Security (6)
implementing-authentication - Auth systems
implementing-authorization - Permission systems
using-cbsecurity - CBSecurity module
securing-endpoints - Endpoint protection
csrf-protection - CSRF mitigation
input-validation - Request validation
Performance & Optimization (6)
caching-strategies - Cache patterns
async-programming - Async execution
background-jobs - Job queues
performance-monitoring - Performance tracking
query-optimization - Database optimization
memory-management - Memory optimization
Web Development (6+)
handling-forms - Form processing
file-uploads - Upload handling
sending-email - Email delivery
working-with-sessions - Session management
flash-messaging - Flash message patterns
asset-management - Frontend assets
View installed skills:
Custom Skills
Create custom skills for your domain-specific workflows:
Example skill structure following Agent Skills format:
Skills support additional files:
Overriding Skills
Override built-in skills to adapt them to your conventions:
Module Skills
Module authors can bundle skills with their packages:
Directory Structure:
Module Skill Template:
AI Agents
ColdBox AI Integration supports 6 major AI agents with automatic configuration generation.
Supported Agents
Note: Agent configuration paths are centrally managed in
models/AgentRegistry.cfc
Claude
CLAUDE.md
Claude Desktop and Claude Code
GitHub Copilot
.github/copilot-instructions.md
VS Code Copilot integration
Cursor
.cursorrules
Cursor IDE rules
Codex
AGENTS.md (shared)
Codex AI assistant
Gemini
GEMINI.md
Gemini CLI integration
OpenCode
AGENTS.md (shared)
OpenCode assistant
Agent Configuration
Manage agent configurations:
Each agent configuration includes:
All active guidelines (core, module, custom, overrides)
Available skills (with invocation instructions)
MCP server configurations (where supported)
Language-specific context (BoxLang/CFML)
Project metadata and conventions
Multi-Agent Development
ColdBox AI Integration supports multiple agents simultaneously:
Benefits:
Team Flexibility: Developers choose their preferred tools
Consistent Standards: All agents follow same guidelines
Cross-Agent Testing: Verify AI-generated code across multiple assistants
Redundancy: Switch agents if one has issues
MCP Servers
Model Context Protocol (MCP) servers provide extended capabilities to AI agents. ColdBox AI Integration includes the largest collection of MCP servers in any framework tooling.
Built-in MCP Servers
30+ Core MCP Servers organized by category:
Development Tools (10)
@modelcontextprotocol/server-filesystem - File system operations
@modelcontextprotocol/server-github - GitHub integration
@modelcontextprotocol/server-gitlab - GitLab integration
@modelcontextprotocol/server-git - Git operations
@modelcontextprotocol/server-brave-search - Web search
@modelcontextprotocol/server-fetch - HTTP requests
@modelcontextprotocol/server-memory - Persistent memory
@modelcontextprotocol/server-sequential-thinking - Reasoning chains
@modelcontextprotocol/server-everart - Image generation
@modelcontextprotocol/server-slack - Slack integration
Database (5)
@modelcontextprotocol/server-postgres - PostgreSQL
@modelcontextprotocol/server-mysql - MySQL/MariaDB
@modelcontextprotocol/server-sqlite - SQLite
@modelcontextprotocol/server-mssql - SQL Server
@modelcontextprotocol/server-mongodb - MongoDB
Cloud & Infrastructure (7)
@modelcontextprotocol/server-aws-kb-retrieval-server - AWS Knowledge Bases
@modelcontextprotocol/server-cloudflare-ai - Cloudflare AI
@modelcontextprotocol/server-google-drive - Google Drive
@modelcontextprotocol/server-google-maps - Google Maps API
@modelcontextprotocol/server-gdrive - Advanced Drive integration
@modelcontextprotocol/server-kubernetes - K8s cluster management
@modelcontextprotocol/server-docker - Docker operations
Productivity (8)
@modelcontextprotocol/server-puppeteer - Browser automation
@modelcontextprotocol/server-playwright - Browser testing
@modelcontextprotocol/server-sentry - Error tracking
@modelcontextprotocol/server-linear - Project management
@modelcontextprotocol/server-obsidian - Note management
@modelcontextprotocol/server-raycast - Raycast integration
@modelcontextprotocol/server-time - Time operations
@modelcontextprotocol/server-youtube-transcript - YouTube transcripts
View configured MCP servers:
Custom MCP Servers
Add project-specific or third-party MCP servers:
Custom server configuration in .ai/manifest.json:
MCP Configuration
Generate agent-specific MCP configurations:
Example generated .mcp.json:
CLI Commands
ColdBox AI Integration provides comprehensive CLI commands for managing your AI integration.
Setup & Management
Component Management
Guidelines:
Skills:
Agents:
MCP Servers:
Diagnostics & Analytics
Developer Experience
ColdBox AI Integration includes unique developer experience tools not found in other solutions.
Visual Tree Structure
Visualize your AI integration structure:
Output example:
Context Usage Statistics
Analyze AI context consumption:
Output example:
Health Diagnostics
Check integration health and get actionable fixes:
The doctor command validates:
β Installation completeness
β File structure integrity
β Configuration validity
β Module guideline sync
β Agent configuration correctness
β Context size optimization
β οΈ Potential issues and solutions
Module Integration
One of ColdBox AI Integration's most powerful features is automatic module awareness.
Automatic Discovery
Guidelines and skills from CommandBox modules are automatically discovered:
Discovery Process:
Scans installed modules in
/modules/Looks for
.ai/directory at module rootLoads
guidelines/andskills/subdirectoriesIntegrates content into agent configurations
Updates
.ai/manifest.jsonwith module sources
Creating Module Guidelines
Module authors: Include AI guidelines in your packages:
Directory Structure:
Guideline Template: (.ai/guidelines/core.md)
Guidelines Best Practices:
Keep under 3KB when possible
Focus on "what" and "why", not exhaustive "how"
Include practical code examples
Mention gotchas and common mistakes
Reference official docs for deep dives
Creating Module Skills
Module authors: Include AI skills for complex tasks:
Directory Structure:
Skill Template: (.ai/skills/using-your-module/SKILL.md)
Skills Best Practices:
Include YAML frontmatter (name, description, version)
Provide complete, runnable code examples
Cover common patterns and edge cases
Include troubleshooting section
Link to detailed documentation
Keep focused on one main workflow
Size: 2-10KB typical
Best Practices
Managing Context Size
Monitor Usage Regularly:
Optimize When Needed:
Review Custom Content: Are all custom guidelines/skills necessary?
Use Overrides Sparingly: Only override when truly needed
Leverage Skills: Move detailed how-tos from guidelines to skills
Modular Guidelines: Split large guidelines into focused ones
Warning Thresholds:
β Low (< 30%): Optimal, plenty of room for code context
β οΈ Moderate (30-60%): Good, monitor growth
β οΈ High (60-90%): Consider optimization
β Very High (> 90%): Reduce immediately for best AI performance
Project-Specific Customization
Use Custom Guidelines for:
Business domain concepts
Project architecture decisions
Third-party service integrations
Team conventions and standards
Deployment procedures
Use Custom Skills for:
Company-specific workflows
Internal tool usage
Complex deployment procedures
Domain-specific test patterns
Example Structure:
Team Collaboration
Version Control:
Team Workflow:
Agree on Agents: Team decides which agents to support
Share Custom Content: Commit custom guidelines/skills to repo
Individual Setup: Each developer runs
coldbox ai installStay Synced: Run
coldbox ai refreshafter pulling updates
Documentation:
Document custom guidelines/skills in
README.mdExplain project-specific conventions
Note any overrides and why they exist
Last updated
Was this helpful?