$npx -y skills add tody-agent/codymaster --skill cm-executionUse when executing implementation plans — choose mode: batch execution with checkpoints, subagent-per-task, or parallel dispatch for independent problems.
| 1 | # Execution — Execute Plans at Scale |
| 2 | |
| 3 | ## TL;DR |
| 4 | - **Use when** running an approved plan from cm-planning |
| 5 | - **Modes**: A=batch, B=subagent-per-task, C=parallel, D=RARV, E=TRIZ-parallel |
| 6 | - **Reads**: handoff/plan.json — **Writes**: handoff/exec.json |
| 7 | - **Always**: tests pass before reporting done |
| 8 | - **Next**: cm-code-review |
| 9 | |
| 10 | > **Role: Lead Developer** — You execute implementation plans systematically with quality gates at every checkpoint. |
| 11 | |
| 12 | > **Three modes, one skill.** Choose based on task structure. |
| 13 | |
| 14 | ## Persona Dispatch (Phase 2) |
| 15 | |
| 16 | In Mode B (subagent-per-task) and Mode E (TRIZ-parallel), dispatch the right persona from `agents/` based on the task type: |
| 17 | |
| 18 | | Task signal | Persona | File | |
| 19 | |-------------|---------|------| |
| 20 | | "design", "architecture", "trade-off" | architect | `agents/architect.md` | |
| 21 | | "implement", "fix", "refactor" | engineer | `agents/engineer.md` | |
| 22 | | "review", "audit", "verify" | reviewer | `agents/reviewer.md` | |
| 23 | | "secret", "auth", "input validation", "deploy" | security | `agents/security.md` | |
| 24 | | "scope", "intent", "user story" | pm | `agents/pm.md` | |
| 25 | |
| 26 | When dispatching a subagent, pass `subagent_type: <persona>` (Codex agents) or load the persona file as the system prompt for the inner call. |
| 27 | |
| 28 | ## Step 0: Load Working Memory (MANDATORY) |
| 29 | |
| 30 | Per `_shared/helpers.md#Load-Working-Memory` |
| 31 | |
| 32 | After EACH completed task: Per `_shared/helpers.md#Update-Continuity` |
| 33 | |
| 34 | ### Pre-flight: Skill Coverage Audit |
| 35 | |
| 36 | Before choosing execution mode, scan plan tasks for technology keywords: |
| 37 | |
| 38 | ``` |
| 39 | 1. Extract technologies/frameworks/tools from ALL task descriptions |
| 40 | 2. Cross-reference with cm-skill-index Layer 1 triggers |
| 41 | 3. Check installed external skills: npx skills list |
| 42 | 4. If gap found → trigger Discovery Loop (cm-skill-mastery Part C) |
| 43 | → npx skills find "{keyword}" → review → ask user → install |
| 44 | 5. Log any installations to .cm-skills-log.json |
| 45 | 6. Code Intelligence Context (cm-codeintell): |
| 46 | → IF codegraph available: codegraph_context(task) for each task |
| 47 | → IF modifying shared code: codegraph_impact(symbol, depth=2) |
| 48 | → IF impact > 10 files: WARN "High impact change" |
| 49 | → Inject context into agent prompts → agents skip grep/glob |
| 50 | 7. Only proceed to Mode Selection after all gaps resolved |
| 51 | ``` |
| 52 | |
| 53 | --- |
| 54 | |
| 55 | ## Mode Selection |
| 56 | |
| 57 | ``` |
| 58 | Have a plan with independent tasks? |
| 59 | ├── Need SPEED + QUALITY on 3+ tasks? |
| 60 | │ └── YES → Mode E: TRIZ-Parallel ⚡ (recommended) |
| 61 | ├── Stay in this session? |
| 62 | │ ├── YES → Mode B: Subagent-Driven |
| 63 | │ └── NO → Mode A: Batch Execution |
| 64 | └── Multiple independent failures/problems? |
| 65 | └── YES → Mode C: Parallel Dispatch |
| 66 | ``` |
| 67 | |
| 68 | | Mode | When | Strategy | |
| 69 | |------|------|----------| |
| 70 | | **A: Batch** | Plan with checkpoints | Execute 3 tasks → report → feedback → next batch | |
| 71 | | **B: Subagent** | Plan with independent tasks, same session | Fresh subagent per task + 2-stage review | |
| 72 | | **C: Parallel** | 2+ independent problems | One agent per problem domain | |
| 73 | | **E: TRIZ-Parallel** ⚡ | 3+ independent tasks, need speed + quality | Dependency-aware parallel dispatch with per-agent quality gates | |
| 74 | | **F: Party** | One non-trivial task, want multi-perspective without subagent cost | Single agent rotates Architect → Engineer → Reviewer (→ Security), append-only `.cm/handoff/party.json` | |
| 75 | |
| 76 | --- |
| 77 | |
| 78 | ## Mode A: Batch Execution |
| 79 | |
| 80 | ### Process |
| 81 | 1. **Load plan** from Fission-AI OpenSpec (`openspec/changes/[initiative-name]/tasks.md` and `design.md`) → review critically → raise concerns |
| 82 | 2. **Execute batch** (default: 3 tasks) |
| 83 | - Mark in_progress → follow steps → verify → mark complete |
| 84 | 3. **Report** → show what was done + verification output |
| 85 | 4. **Continue** → apply feedback → next batch |
| 86 | 5. **Complete** → use `cm-code-review` to finish |
| 87 | 6. **Archive** → After all tasks complete, manually move the OpenSpec folder to `openspec/changes/archive/[date]-[name]/` |
| 88 | |
| 89 | ### Rules |
| 90 | - Follow plan steps exactly |
| 91 | - Don't skip verifications |
| 92 | - Between batches: report and wait |
| 93 | - Stop when blocked, don't guess |
| 94 | |
| 95 | --- |
| 96 | |
| 97 | ## Mode B: Subagent-Driven Development |
| 98 | |
| 99 | ### Process |
| 100 | 1. **Read plan** from `openspec/changes/[initiative-name]/tasks.md` → extract ALL tasks with full text |
| 101 | 2. **Per task:** |
| 102 | - Dispatch implementer subagent with full task text |
| 103 | - Answer subagent questions if any |
| 104 | - Subagent implements, tests, commits, self-reviews |
| 105 | - Dispatch spec reviewer → confirm matches spec |
| 106 | - Dispatch code quality reviewer → confirm quality |
| 107 | - If issues → implementer fixes → re-review → repeat |
| 108 | 3. **After all tasks** → final code review → `cm-code-review` |
| 109 | |
| 110 | ### Prompt Template (Implementer) |
| 111 | ```markdown |
| 112 | Implement [TASK_NAME]: |
| 113 | |
| 114 | [Full task text from plan] |
| 115 | |
| 116 | Context: [Where this fits in the project] |
| 117 | |
| 118 | Rules: |
| 119 | - Follow TDD (cm-tdd) |
| 120 | - Commit when done |
| 121 | - Self-review before reporting |
| 122 | - Ask questions if unclear |
| 123 | |
| 124 | Return: Summary of what you did + t |