$npx -y skills add tody-agent/codymaster --skill cm-skill-chainSkill Chain Engine — compose skills into automated pipelines. One task triggers multi-skill workflows with progress tracking, auto-detection, and step management.
| 1 | # Skill Chain Engine |
| 2 | |
| 3 | > **TRIZ #40 Composite Materials** — Skills compose into pipelines. |
| 4 | > One command → full workflow → automated step progression. |
| 5 | |
| 6 | ## When to Use |
| 7 | |
| 8 | ALWAYS trigger for: chain, pipeline, workflow, multi-step, end-to-end, |
| 9 | "run the whole thing", "full process", "feature pipeline", "bug fix flow", |
| 10 | "from scratch to deploy", "brainstorm to ship", "skill chain", "full pipeline" |
| 11 | |
| 12 | ## Quick Reference |
| 13 | |
| 14 | | Command | Description | |
| 15 | |---------|-------------| |
| 16 | | `cody chain list` | Show all available chains | |
| 17 | | `cody chain info <id>` | Show chain pipeline details | |
| 18 | | `cody chain auto "task"` | Auto-detect best chain & start | |
| 19 | | `cody chain start <id> "task"` | Start specific chain | |
| 20 | | `cody chain status [exec-id]` | Show progress | |
| 21 | | `cody chain advance <exec-id>` | Complete current step, move to next | |
| 22 | | `cody chain skip <exec-id>` | Skip current step | |
| 23 | | `cody chain abort <exec-id>` | Cancel chain | |
| 24 | | `cody chain history` | View past chain runs | |
| 25 | |
| 26 | ## Naming Convention |
| 27 | |
| 28 | Step names use short-form identifiers — the `cm-` prefix is stripped by convention. |
| 29 | Full skill names: `cm-brainstorm-idea`, `cm-planning`, `cm-tdd`, `cm-execution`, `cm-quality-gate`, |
| 30 | `cm-safe-deploy`, `cm-debugging`, `cm-content-factory`, `cm-ads-tracker`, `cm-project-bootstrap`, |
| 31 | `cm-code-review`. All skills now use the `cm-` prefix convention. |
| 32 | |
| 33 | ## Built-in Chains |
| 34 | |
| 35 | ### 🚀 feature-development (up to 3 active steps) |
| 36 | `brainstorm-idea* → planning → tdd → execution → quality-gate → safe-deploy*` |
| 37 | *optional steps — only activated when task context scores them relevant |
| 38 | |
| 39 | ### 🐛 bug-fix (3 steps) |
| 40 | `debugging → tdd → quality-gate` |
| 41 | |
| 42 | ### 📝 content-launch (3 steps) |
| 43 | `content-factory → ads-tracker → cm-cro-methodology` |
| 44 | |
| 45 | ### 🏗️ new-project (up to 3 active steps) |
| 46 | `project-bootstrap → planning → tdd → execution → quality-gate → safe-deploy*` |
| 47 | *optional steps selected by task relevance |
| 48 | |
| 49 | ### 🔍 cm-code-review (3 steps) |
| 50 | `cm-code-review → quality-gate → safe-deploy` |
| 51 | |
| 52 | ## Intelligent Skill Selection (v5.1) |
| 53 | |
| 54 | Chains no longer execute every step blindly. `selectTopSkills()` dynamically selects the **top 3 most relevant steps** for each task: |
| 55 | |
| 56 | ``` |
| 57 | Task: "fix login timeout bug" |
| 58 | → Scores each step by keyword overlap with task description |
| 59 | → Mandatory steps (condition='always', optional=false) always included first |
| 60 | → Optional steps ranked by relevance score, capped at 3 total |
| 61 | → Result: debugging (score 105) → tdd (score 101) → quality-gate (score 100) |
| 62 | ``` |
| 63 | |
| 64 | **Why it matters (SkillsBench research):** |
| 65 | - 2-3 focused skills → **+18.6pp** task performance |
| 66 | - 4+ skills → **+5.9pp** |
| 67 | - Monolithic loading → **-2.9pp** |
| 68 | |
| 69 | If a chain has more than 3 mandatory steps, all mandatory steps run and a performance advisory is logged. |
| 70 | |
| 71 | ## Workflow |
| 72 | |
| 73 | 1. **Start**: Use `chain auto` for auto-detection or `chain start` for specific chains |
| 74 | 2. **Execute**: Work through each skill step, using `@[/skill-name]` to invoke |
| 75 | 3. **Advance**: When step is done, run `chain advance <id> "summary"` |
| 76 | 4. **Repeat**: Continue until all steps complete |
| 77 | 5. **Track**: Use `chain status` to monitor progress anytime |
| 78 | |
| 79 | ## Integration with Other Skills |
| 80 | |
| 81 | - **cm-continuity**: Chain progress persists across sessions via CONTINUITY.md working memory |
| 82 | - **cm-execution**: Each chain step delegates to cm-execution for actual implementation |
| 83 | - **cm-quality-gate**: Automatically runs at end of each development chain |
| 84 | - **Context Bus (v5)**: Every chain automatically maintains `.cm/context-bus.json` — shared state across all steps |
| 85 | |
| 86 | ## Context Bus — Inter-Skill Coordination (v5) |
| 87 | |
| 88 | When `chain start` runs, the context bus is initialized automatically: |
| 89 | |
| 90 | ``` |
| 91 | chain start feature-development "add payment flow" |
| 92 | → Creates .cm/context-bus.json with: |
| 93 | pipeline: "feature-development" |
| 94 | session_id: "<uuid>" |
| 95 | current_step: "brainstorm-idea" |
| 96 | shared_context: {} |
| 97 | resource_state: { skeleton_generated: null, learnings_indexed: null, ... } |
| 98 | ``` |
| 99 | |
| 100 | When `chain advance` runs after each skill completes: |
| 101 | |
| 102 | ``` |
| 103 | chain advance <exec-id> "summary of what was done" |
| 104 | → Updates context-bus.json: |
| 105 | current_step: "planning" ← moved forward |
| 106 | shared_context.brainstorm-idea: { summary, affected_files, output_path } |
| 107 | ``` |
| 108 | |
| 109 | **What downstream skills gain:** |
| 110 | - `cm-planning` can read brainstorm output path → no re-read of full filesystem |
| 111 | - `cm-tdd` can see which files planning created → targeted test generation |
| 112 | - `cm-quality-gate` knows exactly which files changed → focused review |
| 113 | |
| 114 | **Reading the bus:** |
| 115 | ```bash |
| 116 | cm continuity bus # terminal pretty-print |
| 117 | cm_bus_read # MCP tool (Codex Desktop) |
| 118 | cm://pipeline/current # URI resolver (in skill prompts) |
| 119 | ``` |
| 120 | |
| 121 | **Publishing to the bus (inside a skill):** |
| 122 | ```bash |
| 123 | cm_bus_write skill=cm-planning summary="tasks.md created" output_path=openspec/... |
| 124 | ``` |
| 125 | |
| 126 | ## For AI Agents |
| 127 | |
| 128 | When dispatching task |