Command Definition Language

CDL defines single-agent invocation envelopes that wrap ADL agents with execution context, preflight checks, overrides, iteration loops, and postflight actions.

Format YAML + JSON SchemaExtension .command.yamlVersion 2.0.0Status DraftUpdated 2026-03-02

Overview

The Command Definition Language (CDL) is a YAML-based specification for defining executable commands in the UluOps framework. Commands wrap agents with execution context — preflight checks, argument overrides, iteration loops, and postflight actions. CDL is the bridge between atomic agents (ADL) and multi-command workflows (WDL).

text
ADL (Agent Definition)
       |
       | wrapped by
       v
CDL (Command Definition)  <-- YOU ARE HERE
       |
       | orchestrated by
       v
WDL (Workflow Definition)
       |
       | staged by
       v
PDL (Pipeline Definition)

Key Characteristics

AspectDescription
PurposeSingle-agent invocation envelope with execution context
ScopePreflight, overrides, iteration, postflight, tracking
AgentsReferences exactly one ADL agent per command
InvocationCLI (ulu exec command), SDK, or within WDL workflows

Design Principles

💡
Tip
One Command, One PurposeEach command has a single purpose determined by its commandType. Agent-backed commands wrap exactly one agent. Utility commands execute procedural steps directly.
💡
Tip
Thin Wrapper PhilosophyCommands add context but not logic. The agent contains all validation/execution logic; the command provides the invocation envelope.
💡
Tip
Override, Don't ReplaceCommands can override agent defaults (model, threshold, timeout) but cannot fundamentally alter agent behavior.
💡
Tip
Consistent Interface PatternAll commands use the same interface block structure as Agents (ADL) for consistency across the definition language family.
💡
Tip
Agent-Type AgnosticThe agent command type wraps any ADL agent regardless of agentType (validator, executor, analyst, generator, explorer, forecaster). Decision vocabulary and output semantics are determined by the wrapped agent, not the command.

Command Types

CDL defines three command types:

Agentv2.0.0
Wrap any ADL agent with execution context and decision tracking
Agent-determined (Score, Artifacts, Analysis)
Determined by wrapped agent's agentType
  • Code quality validation
  • Prompt scaffolding and generation
  • Security auditing
  • Iterative remediation loops
interfaceinvokes
Utilityv2.0.0
Agent-less procedural commands for direct execution
Procedural Result
COMPLETE / FAILED
  • Git commit workflows
  • Issue resolution checking
  • Environment setup
  • File operations
interface
Customv2.0.0
All-optional escape hatch for advanced use cases
User-defined
User-defined
  • Experimental command patterns
  • Custom tool integrations
  • Non-standard agent wrappers
  • Prototype commands
interface

Schema Structure

Agent Command

The most common type — wraps an ADL agent with full execution context:

yaml
command:
  interface:
    commandType: agent

  invokes:               # Required
    agent: AgentRef        # name@version format

  execution:             # Optional
    model:
      default: Model
      allowed: Model[]
    timeout: number

  preflight:             # Optional
    checks: PreflightCheck[]
    banner:
      template: string

  overrides:             # Optional
    threshold: number
    timeout: number
    temperature: number

  iteration:             # Optional
    max_attempts: number
    exit_threshold: number
    target_agent: AgentRef
    fix_patterns: boolean

  postflight:            # Optional
    steps: PostflightStep[]
    on_success: { message, exit_code }
    on_partial: { message, exit_code }
    on_failure: { message, exit_code }

  output:                # Optional
    schema: string
    format: structured | summary | minimal

Execution Flow:

text
1. PREFLIGHT     -- Display banner, run checks
2. RESOLVE       -- Fetch agent definition, apply overrides
3. EXECUTE       -- Invoke agent, capture result
   (If iteration block: loop until exit_threshold or max_attempts)
4. POSTFLIGHT    -- Persist to tracker, present decision

Utility Command

Agent-less procedural command for direct execution:

yaml
command:
  interface:
    commandType: utility

  # No invokes block -- utility commands have no agent

  execution:             # Optional
    model:
      default: Model
    timeout: number

  preflight:             # Optional
    checks: PreflightCheck[]

  tracking:              # Optional
    enabled: boolean
    variant: custom | none
    custom:
      persistence_tool: string
      field_mappings: object

  postflight:            # Optional
    on_success: { message, exit_code }
    on_failure: { message, exit_code }

  output:                # Optional
    schema: string
    format: summary | minimal

Execution Flow:

text
1. PREFLIGHT     -- Display banner, run checks
2. EXECUTE       -- Follow procedural steps (no agent)
3. POSTFLIGHT    -- Execute steps, present result

Custom Command

All-optional escape hatch for advanced use cases:

yaml
command:
  interface:
    commandType: custom

  invokes:               # Optional
    agent: AgentRef

  execution:             # Optional
    model:
      default: Model
    timeout: number

  preflight:             # Optional
    checks: PreflightCheck[]

  overrides:             # Optional
    threshold: number

  iteration:             # Optional
    max_attempts: number
    exit_threshold: number

  postflight:            # Optional
    on_success: { message, exit_code }
    on_failure: { message, exit_code }

  output:                # Optional
    schema: string
    format: structured | summary | minimal

Field Reference

Interface Block

Identifies the command. Consistent with ADL interface pattern.

FieldTypeRequiredDescription
namestringYesKebab-case identifier. Pattern: ^[a-z][a-z0-9]*(-[a-z0-9]+)*$
versionstringYesSemantic version. Pattern: ^\d+\.\d+\.\d+$
displayNamestringYesHuman-readable name for UI display (3-50 chars)
commandTypeenumYesCommand type: agent, utility, or custom
descriptionstringYesWhen to use + what it does (20-500 chars)
domainenumYesPrimary domain (software, security, legal, etc.)
subdomainstringNoOptional refinement of domain
tagsstring[]NoSearchable tags for discovery

Invokes Block

Specifies which ADL agent the command wraps.

FieldTypeRequiredDescription
agentAgentRefYesAgent reference in name@version format (e.g., code-validator@>=1.0.0)

Execution Block

Controls runtime behavior — model, timeout, directories.

FieldTypeRequiredDescription
model.defaultModelYesDefault model for invocation (haiku, sonnet, opus)
model.allowedModel[]NoModels users can override to
timeoutnumberNoTimeout in milliseconds (default: 300000)
max_retriesnumberNoNumber of retry attempts on failure (0-5, default: 0)
retry_delaynumberNoDelay between retries in milliseconds (default: 1000)

Preflight Block

Actions executed before the agent runs.

FieldTypeRequiredDescription
checksPreflightCheck[]NoList of preflight checks to run before execution
banner.templatestringNoBanner template to display before execution

Overrides Block

Dynamic modifications to the wrapped agent's configuration.

FieldTypeRequiredDescription
thresholdnumberNoOverride agent's default decision threshold (0-100)
timeoutnumberNoOverride agent's default timeout in milliseconds
temperaturenumberNoOverride model temperature (0.0-1.0)

Arguments Block

Named parameters that configure command behavior at invocation time.

FieldTypeRequiredDescription
examplesstring[]NoExample argument values for documentation (1-5 items)

Iteration Block

Configures the iterative review-fix loop pattern.

FieldTypeRequiredDescription
max_attemptsintegerYesMaximum fix-review iterations before escalation (1-20)
exit_thresholdnumberYesScore >= this value ends the loop (0-100)
target_agentAgentRefNoAgent to re-run each cycle (defaults to invokes.agent)
fix_patternsbooleanNoWhether to include fix pattern guidance (default: true)

Postflight Block

Actions executed after the agent completes.

FieldTypeRequiredDescription
stepsPostflightStep[]NoOrdered list of postflight actions to execute
on_successPostflightActionNoAction when agent succeeds (score >= threshold, or task completed)
on_partialPostflightActionNoAction when agent partially succeeds (CONDITIONAL result)
on_failurePostflightActionNoAction when agent fails (score < threshold, or task failed)

Tracking Block

Integration with the UluOps validation tracker.

FieldTypeRequiredDescription
enabledbooleanNoWhether to include tracking section (default: true)
requiredbooleanNoWhether tracker persistence is mandatory before presenting results (default: true)
variantenumNoTracking implementation: claude-code, sdk, custom, or none (default: claude-code)
customCustomTrackingNoCustom tracking configuration (required when variant is 'custom')

Output Block

Defines the command's structured output format.

FieldTypeRequiredDescription
schemastringYesOutput schema reference (e.g., validator-output-v1.1)
formatenumNoOutput format: structured, summary, or minimal (default: structured)

Composition Rules

Note
Agent commands require interface + invokesAgent commands must include the interface and invokes blocks. Optional blocks: execution, preflight, overrides, inputs, arguments, iteration, postflight, tracking, output. No blocks are forbidden.
Note
Utility commands require interface onlyUtility commands must include the interface block. Optional blocks: execution, preflight, inputs, arguments, postflight, tracking, output. Forbidden blocks: invokes, iteration, overrides.
Note
Custom commands require interface onlyCustom commands must include the interface block. Optional blocks: invokes, execution, preflight, overrides, inputs, arguments, iteration, postflight, tracking, output. No blocks are forbidden.

Revision History

VersionDateChanges
2.0.02026-03-01
  • Collapsed validator/executor/fixer command types into unified agent type
  • Added custom type
  • Unified postflight handlers: on_success/on_partial/on_failure (replacing on_pass/on_fail/on_complete/on_failed/on_warn)
  • Iteration block now optional for agent/custom types
  • Removed forbidden block lists in favor of recommendations
1.3.02026-02-08
  • Added interface.commandType (required enum: validator, executor, utility, fixer)
  • Made invokes conditional
  • Added iteration block for fixer commands
  • New templates: utility-command.md.njk, fixer-command.md.njk
1.2.02026-01-30
  • Added tracking.required field for mandatory persistence before presenting results
  • Added postflight.steps array for ordered post-agent actions
1.1.12026-01-18
  • Added arguments.examples field for custom usage examples in generated documentation
1.1.02026-01-18
  • Added tracking block for configurable metrics collection and persistence
  • Supports claude-code, sdk, custom, and none variants
1.0.12026-01-14
  • Updated agent reference format to name@version syntax
  • Added arg input source type for CLI argument passthrough
1.0.02026-01-13
  • Initial CDL specification
  • Single-agent invocation model with preflight checks, execution config, overrides, and postflight actions