terminalAgentic 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:

  1. Guidelines - Framework documentation and best practices (core inlined, others on-demand)

  2. Skills - On-demand coding cookbooks for specific tasks

  3. Agents - AI assistant configurations (Claude, Copilot, etc.)

  4. 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.

circle-info

To start, make sure you are on the latest coldbox-cli in your CommandBox installation.

System Architecture

spinner

Installation

Quick Start

Install ColdBox AI Integration using CommandBox:

The installation wizard will guide you through:

  1. Agent Selection - Choose which AI assistants you use (Claude, Copilot, Cursor, etc.)

  2. Guidelines - Select framework documentation to include

  3. Skills - Choose coding cookbooks for your workflow

  4. MCP Servers - Configure Model Context Protocol servers

spinner

After installation, the following structure is created in your project:

spinner

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 IDE

  • AGENTS.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:

  1. Open Claude Desktop settings

  2. Enable the MCP server for your project

  3. Restart Claude Desktop

GitHub Copilot (VS Code):

  1. Agent configuration is automatically in .github/copilot-instructions.md

  2. Reload VS Code window

  3. Copilot will use the instructions automatically

Cursor:

  1. The .cursorrules file is automatically recognized

  2. Restart Cursor IDE

  3. 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:

Aspect
Core Guidelines (Inlined)
Module Guidelines (On-Demand)
Skills (On-Demand)

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.

spinner

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:

spinner

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.json configuration (language property)

  • 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 --boxlang or --cfml flags

  • Per-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:

  1. Core - Built into ColdBox CLI, framework-level documentation

  2. Module - Automatically discovered from installed CommandBox modules

  3. Custom - Your project-specific guidelines in .ai/guidelines/custom/

  4. Override - Custom versions replacing core/module guidelines

This hierarchy allows seamless integration from framework to module to project level.

spinner

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 formatarrow-up-right:

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

Agent
Config File
Description

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

spinner

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:

  1. Scans installed modules in /modules/

  2. Looks for .ai/ directory at module root

  3. Loads guidelines/ and skills/ subdirectories

  4. Integrates content into agent configurations

  5. Updates .ai/manifest.json with module sources

spinner

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:

  1. Review Custom Content: Are all custom guidelines/skills necessary?

  2. Use Overrides Sparingly: Only override when truly needed

  3. Leverage Skills: Move detailed how-tos from guidelines to skills

  4. 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:

  1. Agree on Agents: Team decides which agents to support

  2. Share Custom Content: Commit custom guidelines/skills to repo

  3. Individual Setup: Each developer runs coldbox ai install

  4. Stay Synced: Run coldbox ai refresh after pulling updates

Documentation:

  • Document custom guidelines/skills in README.md

  • Explain project-specific conventions

  • Note any overrides and why they exist

Last updated

Was this helpful?