coldbox-di

Manage dependency injection and map service identifiers in ColdBox applications.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps developers configure and manage dependency injection inside ColdBox applications, removing confusion around ColdBox-specific injection namespaces, binder configuration, and module-scoped mappings so services are resolved consistently and safely.

Core Features & Use Cases

  • ColdBox-aware Injection DSL: Explains coldbox:, wirebox:, logbox:, cachebox:, model:, provider, and id namespaces for precise property and argument injection.
  • Binder & Module Mapping: Guides creating config/WireBox.cfc binders, overriding auto-scanned models, and declaring module-specific mappings and onLoad behavior.
  • Safe Transient Usage: Shows provider-based injection for request-scoped objects, injecting settings via coldbox:setting, and common anti-patterns to avoid in singletons.

Quick Start

Configure a WireBox binder to map a service implementation and inject that service into a handler using property injection.

Frequently Asked Questions about coldbox-di

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

FAQPage Schema
How do I configure dependency injection in a ColdBox WireBox binder?

Configure dependency injection in a ColdBox WireBox binder by creating a config/WireBox.cfc file to map service identifiers to concrete implementations and define onLoad behavior for consistent service resolution across your application.

What ColdBox injection DSL namespaces are available for property injection?

ColdBox injection DSL namespaces include coldbox:, wirebox:, logbox:, cachebox:, model:, provider, and id for precise property and argument injection in handlers, interceptors, models, and scheduled tasks.

How do I inject ColdBox module settings into a handler or model?

Inject ColdBox module settings into a handler or model using the coldbox:setting injection DSL namespace to safely access configuration values without manually retrieving them from the application cache.

What is the best way to inject transient objects like requestContext in ColdBox singletons?

Use provider-based injection to safely inject transient objects like requestContext into ColdBox singletons, avoiding scope mismatch anti-patterns by deferring resolution until the transient object is actually needed.

Can I declare module-specific WireBox mappings that override auto-scanned models?

Yes, you can declare module-specific WireBox mappings to override auto-scanned models using module-level binders, allowing individual ColdBox modules to define custom service implementations without affecting global application wiring.

Why should I avoid direct injection of request-scoped objects into ColdBox singleton services?

Directly injecting request-scoped objects into ColdBox singleton services creates a scope mismatch that persists stale data across requests, so use provider-based injection instead to resolve the transient object fresh upon each call.