Skill for working with artifact contracts — the file-level dependency system that prevents pipeline failures by ensuring tasks produce expected outputs and only start when required inputs exist.
Use this skill when you need to understand or work with the artifact contract system that enforces file-level dependencies between tasks.
Beads task dependencies (bd dep add) ensure tasks start in order, but they don't
verify that a task actually produced its expected output files. This causes two
classes of pipeline failure:
Each task can have these properties stored in Beads notes:
| Property | Format | Meaning |
|---|
PRODUCES:file1, file2 | Comma-separated paths | Files the task MUST create |
REQUIRES:file1, file2 | Comma-separated paths | Files that MUST exist before dispatch |
GATE:path/to/report.json | Single file path | Validation artifact that must exist AND pass |
The orchestrator creates tasks with artifact contracts in Beads notes:
bd update <task-id> --notes "PRODUCES:output/results.json, output/figures/"
bd update <task-id> --notes "REQUIRES:output/data.csv"
bd update <task-id> --notes "GATE:output/validation_report.json"
# Add output contract
bd update bd-42 --notes "PRODUCES:demos/coupled-decisions/output/results.json"
# Add input requirement
bd update bd-43 --notes "REQUIRES:demos/coupled-decisions/output/results.json"
# Add validation gate
bd update bd-44 --notes "GATE:demos/coupled-decisions/output/validation_report.json"
Before dispatching any task, the orchestrator verifies:
REQUIRES files exist on diskGATE file exists AND contains PASS verdictsBefore merging any branch, the orchestrator checks:
PRODUCES from Beads notesPRODUCES file is missing, the merge is deferred and the agent may be retriedThe orchestrator writes each agent's prompt with the artifact contract:
PRODUCES)REQUIRES) — and to report BLOCKED if missingGATE validation check to perform before startingbd show <your-task-id>REQUIRES: — verify each file existsGATE: — verify the file exists and contains passing verdictsbd update <your-task-id> --notes "BLOCKED: Required artifact missing: <path>"
PRODUCES files you need to createPRODUCES files exist:
ls -la path/to/expected/output.json
A GATE file is a JSON validation report. The pre-flight check recognizes these formats:
// Format 1: Top-level verdict
{"verdict": "PASS"}
// Format 2: Per-stage verdicts
{
"stage_1": {"verdict": "PASS"},
"stage_2": {"verdict": "PASS"},
"stage_3": {"verdict": "PASS"}
}
// Format 3: Array of experiment verdicts
{
"experiments": [
{"name": "encoding", "verdict": "PASS"},
{"name": "ablation", "verdict": "PASS"}
]
}
If any verdict is not PASS, the gated task remains blocked.
Task 1: Generate Data
PRODUCES: output/data.csv, output/policies.json
REQUIRES: (none)
Task 2: Run Experiments
PRODUCES: output/results.json
REQUIRES: output/data.csv
Task 3: Validate Results
PRODUCES: output/validation_report.json
REQUIRES: output/results.json
Task 4: Write Paper ← This is the common failure point!
PRODUCES: output/paper.pdf
REQUIRES: output/results.json
GATE: output/validation_report.json
Task 5: Build Webapp
PRODUCES: output/webapp.html
REQUIRES: output/results.json
Without artifact contracts, Task 4 would start as soon as Task 3 closes in Beads —
even if validation_report.json doesn't exist or contains FAIL verdicts.
With artifact contracts, Task 4 is held until the file exists and passes.