coldbox-decorators

Extend ColdBox controllers and request contexts with CFML decorator components.

1|Updated Apr 10, 2026
One-click install
npx skills add https://github.com/ColdBox/skills --skill coldbox-decorators
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: coldbox-decorators
Source: https://github.com/ColdBox/skills/tree/main/coldbox/decorators
Command: npx skills add https://github.com/ColdBox/skills --skill coldbox-decorators

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provides a safe, centralized way to extend or override ColdBox framework objects so you can add application-level behavior without modifying framework source code, reducing duplication and enabling consistent request and controller handling across the app.

Core Features & Use Cases

  • Controller Decorator: Override or extend controller-level behavior such as relocate/setNextEvent to enforce SSL, append tracking parameters, or provide global helper methods.
  • Request Context Decorator: Add request-scoped helpers and transformations like auto-trimming inputs, requireValue validation helpers, getCurrentUser accessors, or API detection logic.
  • Use Case: Implement a RequestContextDecorator that auto-trims incoming values and exposes getCurrentUser while a ControllerDecorator enforces SSL redirects and exposes app-level metadata.

Quick Start

Create and register a RequestContextDecorator that trims input values and adds a getCurrentUser helper, then wire a ControllerDecorator to enforce SSL on all relocations.

Frequently Asked Questions about coldbox-decorators

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I extend ColdBox controller behavior without modifying framework source code?

To extend ColdBox controller behavior safely, implement a CFML controller decorator component that extends the framework decorator base class, register its WireBox instantiation path in ColdBox.cfc, and delegate to the original object via getController().

Can I add request-scoped helper methods to ColdBox request context?

Yes, you can add request-scoped helper methods to the ColdBox request context by implementing a RequestContextDecorator that extends the framework base class and registers in ColdBox.cfc, exposing helpers like getCurrentUser or auto-trimming logic.

How do I auto-trim incoming request values in a ColdBox CFML application?

Auto-trimming incoming request values in a ColdBox CFML application is done by creating a RequestContextDecorator that intercepts and transforms incoming values, then registering the decorator path in ColdBox.cfc for consistent global handling.

What's the best way to enforce SSL redirects on all ColdBox relocations?

Enforcing SSL redirects on all ColdBox relocations is best handled by a ControllerDecorator that overrides the relocate or setNextEvent method, ensuring consistent SSL enforcement without duplicating logic across handlers.

Does ColdBox support overriding request context and controller logic at the framework level?

Yes, ColdBox supports overriding request context and controller logic through its decorator pattern, allowing you to create CFML components that extend framework base classes and register via WireBox instantiation paths in ColdBox.cfc.

When should I use a ColdBox decorator instead of modifying handlers directly?

Use a ColdBox decorator when you need centralized, application-level behavior like global input sanitization, SSL enforcement, or shared helper methods, avoiding duplicated logic across individual handlers and keeping framework source unmodified.