From coldbox-agent-skills
Use this skill when choosing a ColdBox application layout (flat, boxlang, or modern), scaffolding a new ColdBox project, understanding project directory structure, deciding between app structure options, or migrating from one layout to another. Use when asked about flat layout, boxlang template, modern template, app structure, project skeleton, or web root separation.
How this skill is triggered — by the user, by Claude, or both
Slash command
/coldbox-agent-skills:app-layoutsThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Use this skill when:
Use this skill when:
flat, boxlang, and modern application templatesbox coldbox create app skeleton=<name>| Layout | CFML (Adobe CF / Lucee) | BoxLang |
|---|---|---|
flat | Yes | Yes |
boxlang | No | Yes only |
modern | Yes | Yes |
Default: The ColdBox CLI (
coldbox create app) defaults to theboxlangskeleton. Pass--cfmlorskeleton=flat/skeleton=modernto use another layout.
Template repo: https://github.com/coldbox-templates/flat
The flat layout places all application code directly in the web root. It is the traditional ColdBox structure and the widest-compatibility choice — works with Adobe ColdFusion, Lucee, and BoxLang.
/
├── Application.cfc # App bootstrap
├── index.cfm # Front controller
├── box.json # CommandBox package descriptor
├── server.json # Server configuration
├── pom.xml # Maven Java dependencies (optional)
│
├── config/
│ ├── ColdBox.cfc # Framework settings
│ ├── Router.cfc # URL routing
│ └── WireBox.cfc # DI bindings (optional)
│
├── handlers/ # Event handlers (controllers)
├── models/ # Services, beans, business logic
├── views/ # View templates
├── layouts/ # Layout wrappers
├── interceptors/ # Event interceptors
├── modules_app/ # Internal HMVC modules
│
├── includes/ # Public assets (CSS, JS, images)
│ ├── css/
│ ├── js/
│ └── images/
│
├── tests/
│ ├── Application.cfc
│ ├── runner.cfm
│ └── specs/
│ ├── integration/
│ └── unit/
│
└── lib/ # Framework libraries (managed by CommandBox)
├── coldbox/
└── testbox/
box coldbox create app name=myApp skeleton=flat
Template repo: https://github.com/coldbox-templates/boxlang
The BoxLang layout is the default modern architecture for BoxLang-native applications. It uses the same /app + /public separation as the Modern layout but adds BoxLang-specific assets: .bx class files, a runtime/ configuration directory, a Build.bx build script, Vite frontend tooling, and native BoxLang mappings pre-configured in runtime/config/boxlang.json.
/
├── box.json # CommandBox package descriptor
├── server.json # CommandBox server config (webroot = public/)
├── pom.xml # Maven Java deps (optional)
├── Build.bx # BoxLang build + distribution script
│
├── app/ # Application code (NOT web-accessible)
│ ├── config/
│ │ ├── ColdBox.bx # Framework settings
│ │ ├── Router.bx # URL routing
│ │ ├── WireBox.bx # DI bindings (optional)
│ │ ├── CacheBox.bx # Caching config (optional)
│ │ └── Scheduler.bx # Task scheduling (optional)
│ ├── handlers/ # Event handlers
│ ├── helpers/ # Application helpers (optional)
│ ├── interceptors/ # Event interceptors
│ ├── layouts/ # View layouts
│ ├── logs/ # App logs (optional)
│ ├── models/ # Business logic
│ ├── modules/ # App-specific modules (optional)
│ └── views/ # View templates (.bxm)
│
├── public/ # Web root (CommandBox points here)
│ ├── Application.bx # Web-facing bootstrap
│ ├── index.bxm # Front controller
│ ├── favicon.ico
│ ├── robots.txt
│ └── includes/ # Static assets
│
├── lib/ # Dependencies (managed by CommandBox)
│ ├── coldbox/
│ ├── testbox/
│ ├── modules/ # ColdBox modules
│ └── java/ # Java JARs (managed by Maven)
│
├── resources/ # Non-web resources
│ ├── migrations/ # Database migrations (cbmigrations)
│ ├── docker/ # Docker configuration (optional)
│ ├── seeders/ # Database seeders
│ ├── swagger/ # API docs (cbswagger)
│ └── assets/ # Vite source assets (if using Vite)
│ ├── css/
│ └── js/
│
├── runtime/ # BoxLang runtime overrides
│ ├── boxlang.json # Custom BoxLang configuration
│ ├── global/
│ │ ├── classes/
│ │ └── components/
│ └── logs/
│
└── tests/
├── Application.bx
├── runner.cfm
└── specs/
└── integration/
.bx classes throughoutBuild.bxserver.json aliases (same as Modern)appMapping="/app"runtime/ directory is BoxLang-specific and does not exist in Flat or Modern# Default — this is what `box coldbox create app` uses
box coldbox create app name=myApp
# Explicit
box coldbox create app name=myApp skeleton=boxlang
# With optional features
box coldbox create app name=myApp skeleton=boxlang --vite --docker --migrations
// tests/specs/integration/MainSpec.bx
class extends="coldbox.system.testing.BaseTestCase" appMapping="/app" {
function beforeAll() {
super.beforeAll()
}
function run(){
describe( "Main Handler", function(){
beforeEach( function( currentSpec ){
setup()
})
it( "can render the homepage", function(){
var event = this.get( "main.index" )
expect( event.getRenderedContent() ).notToBeEmpty()
})
})
}
}
Template repo: https://github.com/coldbox-templates/modern
The Modern layout implements a security-first architecture by separating application code from the web root. It is compatible with both Adobe ColdFusion (2021+) and BoxLang. Unlike the BoxLang layout, it uses .cfc files and traditional CFML tag syntax throughout; BoxLang .bx files may be used when running on BoxLang with CFML compat mode.
Note: Lucee is not supported by this template.
/
├── box.json # CommandBox package descriptor
├── server.json # CommandBox server config (webroot = public/)
├── pom.xml # Maven Java deps (optional)
│
├── app/ # Application code (NOT web-accessible)
│ ├── Application.cfc # Contains only `abort;` to block direct access
│ ├── config/
│ │ ├── ColdBox.cfc # Framework settings
│ │ ├── Router.cfc # URL routing
│ │ ├── WireBox.cfc # DI bindings (optional)
│ │ └── CacheBox.cfc # Caching config (optional)
│ ├── handlers/ # Event handlers
│ ├── helpers/ # Application helpers (optional)
│ ├── interceptors/ # Event interceptors
│ ├── layouts/ # View layouts
│ ├── logs/ # App logs
│ ├── models/ # Business logic
│ └── views/ # View templates (.cfm)
│
├── public/ # Web root (CommandBox points here)
│ ├── Application.cfc # Bootstrap that maps to /app
│ ├── index.cfm # Front controller
│ ├── favicon.ico
│ ├── robots.txt
│ └── includes/ # Static assets (CSS, JS, images)
│
├── lib/ # Dependencies (managed by CommandBox)
│ ├── coldbox/
│ ├── testbox/
│ ├── modules/ # ColdBox modules
│ └── java/ # Java JARs (managed by Maven)
│
├── resources/ # Non-web resources
│ ├── database/ # Migrations and seeders
│ └── apidocs/ # API documentation
│
└── tests/
├── Application.cfc
├── runner.cfm
├── index.cfm
└── specs/
└── integration/
cbdebugger, cbswagger) require server.json aliases since lib/ is outside the web rootappMapping="/app" in BaseTestCase/app/ returns 404 by design — this is intentionalapp/Application.cfc only contains abort; as a security barrierbox coldbox create app name=myApp skeleton=modern
server.json Aliases{
"web": {
"webroot": "public",
"rewrites": { "enable": true },
"aliases": {
"/coldbox/system/exceptions": "./lib/coldbox/system/exceptions/",
"/tests": "./tests/"
}
}
}
Add an alias for every module that exposes web assets:
"/cbdebugger": "./lib/modules/cbdebugger"
// tests/specs/integration/MainSpec.cfc
component extends="coldbox.system.testing.BaseTestCase" appMapping="/app" {
function beforeAll(){
super.beforeAll()
}
function run(){
describe( "Main Handler", function(){
beforeEach( function( currentSpec ){
setup()
})
it( "can render the homepage", function(){
var event = this.get( "main.index" )
expect( event.getRenderedContent() ).notToBeEmpty()
})
})
}
}
| Scenario | Recommended Layout |
|---|---|
| Learning ColdBox or rapid prototyping | flat |
| Simple internal tool on traditional hosting | flat |
| BoxLang-native app, CLI + web, or Vite frontend | boxlang |
| Full BoxLang ecosystem (compiled builds, BoxLang OS) | boxlang |
| Production Adobe CF or mixed CF/BoxLang team | modern |
| Enterprise security-first deployment | modern |
| Multi-engine team (Lucee included) | flat (only layout supporting Lucee) |
Are you using BoxLang exclusively?
├── Yes → Do you need Vite, Build.bx, or BoxLang OS runtime?
│ ├── Yes → boxlang
│ └── No → boxlang (still the default) or modern
└── No → Does security or deployment require code outside the web root?
├── Yes → modern
└── No → flat
handlers/, models/, views/, layouts/, interceptors/, config/ into app/public/ with Application.cfc (or .bx) that sets COLDBOX_APP_ROOT_PATH and COLDBOX_APP_MAPPING="/app"index.cfm (or index.bxm) and static assets to public/server.json to set webroot = "public" and add any module aliasesappMapping="/app".cfc files to .bx and replace component with class.cfm/.cfml view/layout files to .bxmColdBox.cfc → ColdBox.bx, Router.cfc → Router.bx, etc.)runtime/ directory with boxlang.json for BoxLang mappingsBuild.bx if you need compiled distribution buildsnpx claudepluginhub coldbox/skillsProvides CDSS development patterns for drug interaction checking, dose validation, clinical scoring (NEWS2, qSOFA), and alert classification integrated into EMR workflows.