name: "Conditional Task Execution Demo"
version: "1.0.0"
dsl_version: "1.0.0"
agents:
analyzer:
description: "Analyzes code and determines build requirements"
model: "claude-sonnet-4-5"
tools:
- Read
- Grep
permissions:
mode: "default"
builder:
description: "Builds the project"
model: "claude-sonnet-4-5"
tools:
- Bash
permissions:
mode: "acceptEdits"
tester:
description: "Runs tests"
model: "claude-sonnet-4-5"
tools:
- Bash
permissions:
mode: "default"
deployer:
description: "Deploys to production"
model: "claude-sonnet-4-5"
tools:
- Bash
permissions:
mode: "plan"
tasks:
analyze_code:
description: "Analyze code structure and dependencies"
agent: "analyzer"
priority: 0
build_project:
description: "Build the project"
agent: "builder"
depends_on:
- "analyze_code"
condition:
type: "task_status"
task: "analyze_code"
status: "completed"
run_tests:
description: "Run test suite"
agent: "tester"
depends_on:
- "build_project"
condition:
type: "task_status"
task: "build_project"
status: "completed"
debug_tests:
description: "Debug failing tests and apply fixes"
agent: "tester"
depends_on:
- "run_tests"
condition:
type: "task_status"
task: "run_tests"
status: "failed"
on_complete:
notify: "Test debugging completed - review fixes"
deploy_production:
description: "Deploy to production environment"
agent: "deployer"
depends_on:
- "run_tests"
condition:
and:
- type: "task_status"
task: "run_tests"
status: "completed"
- type: "state_equals"
key: "environment"
value: "production"
on_complete:
notify: "Production deployment completed"
deploy_staging:
description: "Deploy to staging environment"
agent: "deployer"
depends_on:
- "run_tests"
condition:
and:
- type: "task_status"
task: "run_tests"
status: "completed"
- not:
type: "state_equals"
key: "environment"
value: "production"
on_complete:
notify: "Staging deployment completed"
experimental_feature:
description: "Experimental feature - currently disabled"
agent: "builder"
condition:
type: "never"
send_failure_notification:
description: "Send notification about build/test failures"
agent: "deployer"
depends_on:
- "build_project"
- "run_tests"
condition:
or:
- type: "task_status"
task: "build_project"
status: "failed"
- type: "task_status"
task: "run_tests"
status: "failed"
on_complete:
notify: "Failure notification sent to team"
workflows:
ci_cd_pipeline:
description: "CI/CD pipeline with conditional deployment"
steps:
- stage: "analysis"
agents:
- "analyzer"
tasks:
- analyze_code:
description: "Analyze code structure"
agent: "analyzer"
- stage: "build_and_test"
depends_on:
- "analysis"
agents:
- "builder"
- "tester"
tasks:
- build_project:
description: "Build the project"
agent: "builder"
- run_tests:
description: "Run tests"
agent: "tester"
- stage: "deploy"
depends_on:
- "build_and_test"
agents:
- "deployer"
mode: "parallel"
tasks:
- deploy_production:
description: "Deploy to production"
agent: "deployer"
- deploy_staging:
description: "Deploy to staging"
agent: "deployer"