coldbox-module-developmentlisted
Install: claude install-skill ColdBox/skills
# Module Development
## When to Use This Skill
Use this skill when creating ColdBox modules — reusable, self-contained sub-applications with their own routes, handlers, services, and configuration.
## Language Mode Reference
Examples use **BoxLang (`.bx`)** syntax by default. Adapt for your target language:
| Concept | BoxLang (`.bx`) | CFML (`.cfc`) |
|---------|-----------------|---------------|
| Class declaration | `class [extends="..."] {` | `component [extends="..."] {` |
| DI annotation | `@inject` above `property name="svc";` | `property name="svc" inject="svc";` |
| View templates | `.bxm` suffix | `.cfm` / `.cfml` suffix |
| Tag prefix | `<bx:if>`, `<bx:output>`, `<bx:set>` | `<cfif>`, `<cfoutput>`, `<cfset>` |
> **CFML Compat Mode**: With BoxLang + CFML Compat module, `.bx` and `.cfc` files coexist freely. BoxLang-native classes use `class {}` (`.bx` files); CFML-compat classes use `component {}` (`.cfc` files).
## Core Concepts
ColdBox modules:
- Live in `modules/` (external) or `modules_app/` (internal)
- Have a `ModuleConfig.cfc` for registration and configuration
- Have a `box.json` for package metadata
- Can declare routes, settings, interceptors, and DI bindings
- Can be packaged and distributed on ForgeBox
- Are isolated via their own classloader mappings
## Module Directory Structure
```
modules_app/
myModule/
box.json # Package metadata
ModuleConfig.cfc # Module registration
config/
Router.cfc