@lvlup-sw/exarchos 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (153) hide show
  1. package/.claude-plugin/marketplace.json +22 -0
  2. package/.claude-plugin/plugin.json +17 -0
  3. package/.mcp.json +17 -0
  4. package/AGENTS.md +59 -0
  5. package/CLAUDE.md.template +62 -0
  6. package/LICENSE +202 -0
  7. package/README.md +258 -0
  8. package/commands/autocompact.md +37 -0
  9. package/commands/checkpoint.md +85 -0
  10. package/commands/cleanup.md +99 -0
  11. package/commands/debug.md +145 -0
  12. package/commands/delegate.md +56 -0
  13. package/commands/ideate.md +82 -0
  14. package/commands/plan.md +150 -0
  15. package/commands/refactor.md +139 -0
  16. package/commands/reload.md +37 -0
  17. package/commands/resume.md +130 -0
  18. package/commands/review.md +51 -0
  19. package/commands/sync-schemas.md +74 -0
  20. package/commands/synthesize.md +122 -0
  21. package/commands/tdd.md +58 -0
  22. package/dist/exarchos-cli.js +8828 -0
  23. package/dist/exarchos-mcp.js +50 -0
  24. package/hooks/hooks.json +53 -0
  25. package/package.json +59 -0
  26. package/rules/coding-standards.md +46 -0
  27. package/rules/mcp-tool-guidance.md +26 -0
  28. package/rules/pr-descriptions.md +12 -0
  29. package/rules/rm-safety.md +9 -0
  30. package/rules/skill-path-resolution.md +10 -0
  31. package/rules/tdd.md +41 -0
  32. package/rules/telemetry-awareness.md +9 -0
  33. package/scripts/assess-refactor-scope.sh +239 -0
  34. package/scripts/check-benchmark-regression.sh +229 -0
  35. package/scripts/check-coderabbit.sh +288 -0
  36. package/scripts/check-coverage-thresholds.sh +194 -0
  37. package/scripts/check-polish-scope.sh +245 -0
  38. package/scripts/check-property-tests.sh +167 -0
  39. package/scripts/check-tdd-compliance.sh +265 -0
  40. package/scripts/coderabbit-review-gate.sh +518 -0
  41. package/scripts/debug-review-gate.sh +201 -0
  42. package/scripts/extract-fix-tasks.sh +179 -0
  43. package/scripts/extract-task.sh +67 -0
  44. package/scripts/generate-traceability.sh +209 -0
  45. package/scripts/investigation-timer.sh +171 -0
  46. package/scripts/needs-schema-sync.sh +174 -0
  47. package/scripts/new-project.sh +103 -0
  48. package/scripts/post-delegation-check.sh +317 -0
  49. package/scripts/pre-synthesis-check.sh +440 -0
  50. package/scripts/reconcile-state.sh +346 -0
  51. package/scripts/reconstruct-stack.sh +432 -0
  52. package/scripts/review-diff.sh +63 -0
  53. package/scripts/review-verdict.sh +169 -0
  54. package/scripts/security-scan.sh +248 -0
  55. package/scripts/select-debug-track.sh +186 -0
  56. package/scripts/setup-worktree.sh +323 -0
  57. package/scripts/spec-coverage-check.sh +230 -0
  58. package/scripts/static-analysis-gate.sh +236 -0
  59. package/scripts/sync-labels.sh +122 -0
  60. package/scripts/validate-companion.sh +161 -0
  61. package/scripts/validate-dotnet-standards.sh +267 -0
  62. package/scripts/validate-installation.sh +101 -0
  63. package/scripts/validate-plugin.sh +223 -0
  64. package/scripts/validate-refactor.sh +234 -0
  65. package/scripts/validate-rm.sh +93 -0
  66. package/scripts/verify-delegation-saga.sh +240 -0
  67. package/scripts/verify-doc-links.sh +211 -0
  68. package/scripts/verify-ideate-artifacts.sh +296 -0
  69. package/scripts/verify-plan-coverage.sh +228 -0
  70. package/scripts/verify-review-triage.sh +219 -0
  71. package/scripts/verify-worktree-baseline.sh +159 -0
  72. package/scripts/verify-worktree.sh +84 -0
  73. package/settings.json +47 -0
  74. package/skills/brainstorming/SKILL.md +127 -0
  75. package/skills/brainstorming/references/design-template.md +65 -0
  76. package/skills/cleanup/SKILL.md +147 -0
  77. package/skills/cleanup/references/merge-verification.md +40 -0
  78. package/skills/debug/SKILL.md +204 -0
  79. package/skills/debug/references/hotfix-track.md +134 -0
  80. package/skills/debug/references/investigation-checklist.md +217 -0
  81. package/skills/debug/references/rca-template.md +150 -0
  82. package/skills/debug/references/state-schema.md +294 -0
  83. package/skills/debug/references/thorough-track.md +194 -0
  84. package/skills/debug/references/triage-questions.md +155 -0
  85. package/skills/debug/references/troubleshooting.md +47 -0
  86. package/skills/delegation/SKILL.md +150 -0
  87. package/skills/delegation/references/adaptive-orchestration.md +31 -0
  88. package/skills/delegation/references/agent-teams-saga.md +248 -0
  89. package/skills/delegation/references/fix-mode.md +74 -0
  90. package/skills/delegation/references/fixer-prompt.md +162 -0
  91. package/skills/delegation/references/implementer-prompt.md +322 -0
  92. package/skills/delegation/references/parallel-strategy.md +124 -0
  93. package/skills/delegation/references/pbt-patterns.md +172 -0
  94. package/skills/delegation/references/pr-fixes-mode.md +154 -0
  95. package/skills/delegation/references/state-management.md +51 -0
  96. package/skills/delegation/references/testing-patterns.md +129 -0
  97. package/skills/delegation/references/troubleshooting.md +33 -0
  98. package/skills/delegation/references/workflow-steps.md +127 -0
  99. package/skills/delegation/references/worktree-enforcement.md +64 -0
  100. package/skills/dotnet-standards/SKILL.md +269 -0
  101. package/skills/dotnet-standards/references/csharp-standards.md +120 -0
  102. package/skills/dotnet-standards/templates/.editorconfig +366 -0
  103. package/skills/dotnet-standards/templates/Directory.Build.props +56 -0
  104. package/skills/dotnet-standards/templates/Directory.Packages.props +69 -0
  105. package/skills/dotnet-standards/templates/global.json +6 -0
  106. package/skills/dotnet-standards/templates/nuget.config +9 -0
  107. package/skills/dotnet-standards/templates/stylecop.json +37 -0
  108. package/skills/git-worktrees/SKILL.md +255 -0
  109. package/skills/implementation-planning/SKILL.md +233 -0
  110. package/skills/implementation-planning/references/plan-document-template.md +42 -0
  111. package/skills/implementation-planning/references/spec-tracing-guide.md +51 -0
  112. package/skills/implementation-planning/references/task-template.md +43 -0
  113. package/skills/implementation-planning/references/testing-strategy-guide.md +88 -0
  114. package/skills/quality-review/SKILL.md +278 -0
  115. package/skills/quality-review/references/code-quality-checklist.md +159 -0
  116. package/skills/quality-review/references/review-report-template.md +65 -0
  117. package/skills/quality-review/references/security-checklist.md +79 -0
  118. package/skills/quality-review/references/typescript-standards.md +24 -0
  119. package/skills/refactor/COMMAND.md +67 -0
  120. package/skills/refactor/SKILL.md +198 -0
  121. package/skills/refactor/phases/auto-chain.md +262 -0
  122. package/skills/refactor/phases/brief.md +176 -0
  123. package/skills/refactor/phases/explore.md +132 -0
  124. package/skills/refactor/phases/overhaul-delegate.md +136 -0
  125. package/skills/refactor/phases/overhaul-plan.md +312 -0
  126. package/skills/refactor/phases/overhaul-review.md +304 -0
  127. package/skills/refactor/phases/polish-implement.md +349 -0
  128. package/skills/refactor/phases/polish-validate.md +218 -0
  129. package/skills/refactor/phases/update-docs.md +234 -0
  130. package/skills/refactor/references/brief-template.md +81 -0
  131. package/skills/refactor/references/doc-update-checklist.md +110 -0
  132. package/skills/refactor/references/explore-checklist.md +73 -0
  133. package/skills/refactor/references/overhaul-track.md +215 -0
  134. package/skills/refactor/references/polish-track.md +170 -0
  135. package/skills/shared/prompts/context-reading.md +58 -0
  136. package/skills/shared/prompts/report-format.md +54 -0
  137. package/skills/shared/prompts/tdd-requirements.md +39 -0
  138. package/skills/shepherd/SKILL.md +264 -0
  139. package/skills/shepherd/references/assess-checklist.md +124 -0
  140. package/skills/shepherd/references/fix-strategies.md +191 -0
  141. package/skills/spec-review/SKILL.md +229 -0
  142. package/skills/spec-review/references/review-checklist.md +60 -0
  143. package/skills/sync-schemas/SKILL.md +114 -0
  144. package/skills/sync-schemas/references/configuration.md +73 -0
  145. package/skills/synthesis/SKILL.md +129 -0
  146. package/skills/synthesis/references/pr-descriptions.md +87 -0
  147. package/skills/synthesis/references/synthesis-steps.md +109 -0
  148. package/skills/synthesis/references/troubleshooting.md +115 -0
  149. package/skills/validate-all-skills.sh +57 -0
  150. package/skills/validate-frontmatter.sh +237 -0
  151. package/skills/workflow-state/SKILL.md +210 -0
  152. package/skills/workflow-state/references/mcp-tool-reference.md +111 -0
  153. package/skills/workflow-state/references/phase-transitions.md +141 -0
@@ -0,0 +1,255 @@
1
+ ---
2
+ name: git-worktrees
3
+ description: "Git worktree management for parallel development in agent team workflows. Use when creating worktrees, validating worktree paths, or setting up isolated development environments. Trigger: \"create worktree\", \"worktree setup\", or during /delegate task dispatch. Do NOT use for branch creation without delegation context."
4
+ metadata:
5
+ author: exarchos
6
+ version: 1.0.0
7
+ mcp-server: exarchos
8
+ category: utility
9
+ phase-affinity: delegate
10
+ ---
11
+
12
+ # Git Worktrees Skill
13
+
14
+ ## Overview
15
+
16
+ Create and manage isolated git worktrees for parallel development tasks.
17
+
18
+ ## Triggers
19
+
20
+ Activate this skill when:
21
+ - Multiple tasks can run in parallel
22
+ - User runs `/exarchos:delegate` with parallelizable tasks
23
+ - Need isolated environment for subagent work
24
+ - User explicitly requests worktree setup
25
+
26
+ ## Worktree Directory Location
27
+
28
+ **Priority Order:**
29
+ 1. `.worktrees/` - If exists and gitignored
30
+ 2. `worktrees/` - If exists and gitignored
31
+ 3. Check `CLAUDE.md` for project conventions
32
+ 4. Ask user if unclear
33
+
34
+ **Safety Check (REQUIRED):**
35
+ ```bash
36
+ # Verify directory is gitignored before creating
37
+ git check-ignore -q .worktrees && echo "Safe" || echo "NOT GITIGNORED"
38
+ ```
39
+
40
+ If not gitignored, add to `.gitignore`:
41
+ ```
42
+ .worktrees/
43
+ ```
44
+
45
+ ## Worktree Lifecycle
46
+
47
+ ### 1. Create Worktree
48
+
49
+ ```bash
50
+ # Create feature branch
51
+ git branch feature/task-name main
52
+
53
+ # Create worktree
54
+ git worktree add .worktrees/task-name feature/task-name
55
+
56
+ # Verify creation
57
+ git worktree list
58
+ ```
59
+
60
+ **Naming Convention:** `.worktrees/<task-id>-<brief-name>`
61
+ - Example: `.worktrees/001-user-auth`
62
+ - Example: `.worktrees/002-api-endpoints`
63
+
64
+ ### 2. Setup Environment
65
+
66
+ **Auto-detect project type and run setup:**
67
+
68
+ | Indicator | Setup Command |
69
+ |-----------|---------------|
70
+ | `package.json` | `npm install` or `pnpm install` |
71
+ | `Cargo.toml` | `cargo build` |
72
+ | `requirements.txt` | `pip install -r requirements.txt` |
73
+ | `*.csproj` | `dotnet restore` |
74
+ | `go.mod` | `go mod download` |
75
+
76
+ **Setup Script:**
77
+ ```bash
78
+ cd .worktrees/task-name
79
+
80
+ # Node.js
81
+ if [ -f "package.json" ]; then
82
+ npm install
83
+ fi
84
+
85
+ # .NET
86
+ if ls *.csproj 1> /dev/null 2>&1; then
87
+ dotnet restore
88
+ fi
89
+
90
+ # Rust
91
+ if [ -f "Cargo.toml" ]; then
92
+ cargo build
93
+ fi
94
+ ```
95
+
96
+ ### 3. Baseline Verification
97
+
98
+ Run baseline tests to ensure the worktree is ready:
99
+
100
+ ```bash
101
+ scripts/verify-worktree-baseline.sh --worktree-path .worktrees/task-name
102
+ ```
103
+
104
+ The script auto-detects project type (Node.js, .NET, Rust) and runs the appropriate test command.
105
+
106
+ **On exit 0:** Baseline tests pass — worktree is ready for implementation.
107
+ **On exit 1:** Baseline tests failed — investigate before proceeding.
108
+ **On exit 2:** Unknown project type — manual verification required.
109
+
110
+ If baseline fails:
111
+ 1. Check if main branch has failing tests
112
+ 2. Report issue to user
113
+ 3. Do not proceed with implementation
114
+
115
+ ### 4. Work in Worktree
116
+
117
+ Subagents work in worktree directory:
118
+ - Full isolation from other tasks
119
+ - Commits go to feature branch
120
+ - Can run tests independently
121
+
122
+ ### 5. Cleanup After Merge
123
+
124
+ ```bash
125
+ # After PR merged, remove worktree
126
+ git worktree remove .worktrees/task-name
127
+
128
+ # Optionally delete branch
129
+ git branch -d feature/task-name
130
+
131
+ # Prune stale worktree refs
132
+ git worktree prune
133
+ ```
134
+
135
+ ## Parallel Worktree Management
136
+
137
+ ### Creating Multiple Worktrees
138
+
139
+ For parallel task groups from implementation plan:
140
+
141
+ ```bash
142
+ # Group 1 tasks
143
+ git worktree add .worktrees/001-types feature/001-types
144
+ git worktree add .worktrees/002-tests feature/002-tests
145
+
146
+ # Group 2 tasks (parallel to Group 1)
147
+ git worktree add .worktrees/003-api feature/003-api
148
+ git worktree add .worktrees/004-handlers feature/004-handlers
149
+ ```
150
+
151
+ ### Tracking Active Worktrees
152
+
153
+ Maintain awareness of active worktrees:
154
+ ```bash
155
+ git worktree list
156
+ ```
157
+
158
+ Report format:
159
+ ```markdown
160
+ ## Active Worktrees
161
+
162
+ | Task | Branch | Status |
163
+ |------|--------|--------|
164
+ | 001-types | feature/001-types | In Progress |
165
+ | 002-tests | feature/002-tests | Complete |
166
+ | 003-api | feature/003-api | In Progress |
167
+ ```
168
+
169
+ ## Worktree Commands Reference
170
+
171
+ | Action | Command |
172
+ |--------|---------|
173
+ | List worktrees | `git worktree list` |
174
+ | Add worktree | `git worktree add <path> <branch>` |
175
+ | Remove worktree | `git worktree remove <path>` |
176
+ | Prune stale refs | `git worktree prune` |
177
+ | Lock (prevent removal) | `git worktree lock <path>` |
178
+ | Unlock | `git worktree unlock <path>` |
179
+
180
+ ## Worktree Validation
181
+
182
+ ### Why Validate?
183
+
184
+ Subagents MUST verify they're in a worktree before making changes. Working in the main project root causes:
185
+ - Merge conflicts between parallel tasks
186
+ - Accidental changes to shared state
187
+ - Build/test interference
188
+
189
+ ### Worktree Verification
190
+
191
+ Run the worktree verification script before any file modifications:
192
+
193
+ ```bash
194
+ scripts/verify-worktree.sh
195
+ ```
196
+
197
+ To check a specific path instead of the current directory:
198
+
199
+ ```bash
200
+ scripts/verify-worktree.sh --cwd /path/to/.worktrees/task-name
201
+ ```
202
+
203
+ **On exit 0:** In a valid worktree — proceed with implementation.
204
+ **On exit 1:** NOT in a worktree — STOP immediately, do not modify files.
205
+
206
+ ### Subagent Instructions
207
+
208
+ Include in all implementer prompts:
209
+
210
+ ```markdown
211
+ ## CRITICAL: Worktree Verification (MANDATORY)
212
+
213
+ Before making ANY file changes, run:
214
+
215
+ scripts/verify-worktree.sh
216
+
217
+ If exit code is non-zero: STOP and report error.
218
+ DO NOT proceed with any modifications outside a worktree.
219
+ ```
220
+
221
+ ## Anti-Patterns
222
+
223
+ | Don't | Do Instead |
224
+ |-------|------------|
225
+ | Create worktrees in tracked directory | Use gitignored `.worktrees/` |
226
+ | Skip baseline test verification | Always verify tests pass first |
227
+ | Leave stale worktrees | Clean up after merge |
228
+ | Forget dependency installation | Run project setup in each worktree |
229
+ | Mix work across worktrees | One task per worktree |
230
+
231
+ ## Integration with Delegation
232
+
233
+ When delegation skill spawns parallel tasks:
234
+ 1. Create worktree for each parallel group
235
+ 2. Set up environment
236
+ 3. Verify baseline tests
237
+ 4. Dispatch subagent with worktree path
238
+ 5. Track progress
239
+ 6. Merge branches in dependency order
240
+ 7. Clean up worktrees
241
+
242
+ ## Completion Criteria
243
+
244
+ For worktree setup:
245
+ - [ ] Directory is gitignored
246
+ - [ ] Worktree created successfully
247
+ - [ ] Environment dependencies installed
248
+ - [ ] Baseline tests pass
249
+ - [ ] Ready for subagent work
250
+
251
+ For worktree cleanup:
252
+ - [ ] Feature branch merged to main
253
+ - [ ] Worktree removed
254
+ - [ ] Branch deleted (if merged)
255
+ - [ ] Stale refs pruned
@@ -0,0 +1,233 @@
1
+ ---
2
+ name: implementation-planning
3
+ description: "Transform design documents into TDD-based implementation plans with granular, parallelizable tasks. Use when the user says 'plan implementation', 'create tasks from design', 'break down the design', or runs /plan. Enforces the Iron Law: no production code without a failing test first. Do NOT use for brainstorming, debugging, or code review. Requires an existing design document as input. Do NOT use if no design document exists — use /ideate first."
4
+ metadata:
5
+ author: exarchos
6
+ version: 1.0.0
7
+ mcp-server: exarchos
8
+ category: workflow
9
+ phase-affinity: plan
10
+ ---
11
+
12
+ # Implementation Planning Skill
13
+
14
+ ## Overview
15
+
16
+ Transform design documents into TDD-based implementation plans with granular, parallelizable tasks. Ensures complete spec coverage through explicit traceability.
17
+
18
+ ## Triggers
19
+
20
+ Activate this skill when:
21
+ - User runs `/plan` command
22
+ - User wants to break down a design into tasks
23
+ - A design document exists and needs implementation steps
24
+ - User says "plan the implementation" or similar
25
+ - Auto-chained from `/exarchos:ideate` after design completion
26
+ - Auto-chained from plan-review with `--revise` flag (gaps found)
27
+
28
+ ## Revision Mode (--revise flag)
29
+
30
+ When invoked with `--revise`, plan-review found gaps. Read `.planReview.gaps` from state, re-read the design, add tasks to address each gap, update the plan file, then clear gaps via `mcp__exarchos__exarchos_workflow` `action: "set"`.
31
+
32
+ ### Revision Loop Guard
33
+
34
+ Max revisions: 3 per plan.
35
+
36
+ After 3 failed revisions:
37
+ 1. Set `planReview.revisionsExhausted = true`
38
+ 2. Output: "Plan revision failed after 3 attempts. Design may be incomplete."
39
+ 3. Escalate: Suggest `/exarchos:ideate --redesign` to revisit design
40
+
41
+ ## The Iron Law
42
+
43
+ > **NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST**
44
+
45
+ Every implementation task MUST:
46
+ 1. Start with writing a failing test
47
+ 2. Specify the expected failure reason
48
+ 3. Only then implement minimum code to pass
49
+
50
+ **Verify TDD compliance** in git history after implementation:
51
+
52
+ ```bash
53
+ scripts/check-tdd-compliance.sh \
54
+ --repo-root . \
55
+ --branch feature/<name> \
56
+ --base-branch main
57
+ ```
58
+
59
+ - **exit 0** — All commits have test files before or alongside implementation
60
+ - **exit 1** — Violations found; commits have implementation without corresponding tests
61
+ - **exit 2** — Usage error; check arguments
62
+
63
+ ## Planning Process
64
+
65
+ ### Step 1: Analyze Design Document
66
+
67
+ Read the design document thoroughly. For each major section, extract:
68
+ - **Problem Statement** — Context (no tasks, but informs scope)
69
+ - **Chosen Approach** — Architectural decisions to implement
70
+ - **Technical Design** — Core implementation requirements
71
+ - **Integration Points** — Integration and glue code tasks
72
+ - **Testing Strategy** — Test coverage requirements
73
+ - **Open Questions** — Decisions to resolve or explicitly defer
74
+
75
+ ### Step 1.5: Spec Tracing (Required)
76
+
77
+ Create a traceability matrix mapping design sections to planned tasks.
78
+ Consult `references/spec-tracing-guide.md` for the methodology and template.
79
+
80
+ **Pre-populate the matrix** using the traceability generator script:
81
+
82
+ ```bash
83
+ scripts/generate-traceability.sh \
84
+ --design-file docs/designs/<feature>.md \
85
+ --plan-file docs/plans/<date>-<feature>.md \
86
+ --output docs/plans/<date>-<feature>-traceability.md
87
+ ```
88
+
89
+ - **exit 0** — Matrix generated; review and fill in "Key Requirements" column
90
+ - **exit 1** — Parse error; design document may lack expected `##`/`###` headers
91
+ - **exit 2** — Usage error; check arguments
92
+
93
+ ### Step 2: Decompose into Tasks
94
+
95
+ Each task follows the TDD format in `references/task-template.md`.
96
+
97
+ **Granularity Guidelines:**
98
+ - Each task: 2-5 minutes of focused work
99
+ - One test = one behavior
100
+ - Prefer many small tasks over few large ones
101
+
102
+ Assign a `testingStrategy` to each task using `references/testing-strategy-guide.md` to control which verification techniques agents apply. Auto-determine `propertyTests` and `benchmarks` flags by matching each task's description and file paths against the category tables — do not leave these for the implementer to decide.
103
+
104
+ **Task Ordering:**
105
+ 1. Foundation first (types, interfaces, data structures)
106
+ 2. Core behaviors second
107
+ 3. Edge cases and error handling third
108
+ 4. Integration and glue code last
109
+
110
+ ### Step 3: Identify Parallelization
111
+
112
+ Analyze dependencies to find sequential chains and parallel-safe groups that can run simultaneously in worktrees.
113
+
114
+ ### Step 4: Generate Plan Document
115
+
116
+ Save to: `docs/plans/YYYY-MM-DD-<feature>.md`
117
+ Use the template from `references/plan-document-template.md`.
118
+
119
+ ### Step 5: Plan Verification
120
+
121
+ Run deterministic verification scripts instead of manual checklist review.
122
+
123
+ **5a. Design-to-plan coverage** — verify every Technical Design subsection maps to a task:
124
+
125
+ ```bash
126
+ scripts/verify-plan-coverage.sh \
127
+ --design-file docs/designs/<feature>.md \
128
+ --plan-file docs/plans/<date>-<feature>.md
129
+ ```
130
+
131
+ - **exit 0** — All design sections covered; proceed to 5b
132
+ - **exit 1** — Gaps found; add tasks for uncovered sections or defer with rationale
133
+ - **exit 2** — Usage error or empty design; check arguments
134
+
135
+ **5b. Spec coverage check** — verify planned test files exist and pass:
136
+
137
+ ```bash
138
+ scripts/spec-coverage-check.sh \
139
+ --plan-file docs/plans/<date>-<feature>.md \
140
+ --repo-root . \
141
+ --threshold 80
142
+ ```
143
+
144
+ - **exit 0** — All planned tests found and passing; plan verification complete
145
+ - **exit 1** — Missing test files or test failures; create missing tests or fix failures
146
+ - **exit 2** — Usage error; check arguments
147
+
148
+ For reference, consult `references/spec-tracing-guide.md` for the underlying methodology.
149
+
150
+ ## Anti-Patterns
151
+
152
+ | Don't | Do Instead |
153
+ |-------|------------|
154
+ | Write implementation first | Write failing test first |
155
+ | Create large tasks | Break into 2-5 min chunks |
156
+ | Skip dependency analysis | Identify parallel opportunities |
157
+ | Vague test descriptions | Specific: Method_Scenario_Outcome |
158
+ | Assume tests pass | Verify each test fails first |
159
+ | Add "nice to have" code | Only what the test requires |
160
+
161
+ ## Rationalization Debunking
162
+
163
+ | Excuse | Reality |
164
+ |--------|---------|
165
+ | "This is too simple for tests" | Simple code breaks too. Test it. |
166
+ | "I'll add tests after" | You won't. Or they'll be weak. |
167
+ | "Tests slow me down" | Debugging without tests is slower. |
168
+ | "The design is obvious" | Obvious to you now. Not in 3 months. |
169
+
170
+ ## State Management
171
+
172
+ On plan save:
173
+ ```
174
+ action: "set", featureId: "<id>", phase: "plan-review", updates: {
175
+ "artifacts": { "plan": "<plan-file-path>" },
176
+ "tasks": [{ "id": "001", "title": "...", "status": "pending", "branch": "...", "blockedBy": [] }, ...]
177
+ }
178
+ ```
179
+
180
+ ## Completion Criteria
181
+
182
+ - [ ] Design document read and understood
183
+ - [ ] Spec traceability table created (`scripts/generate-traceability.sh`)
184
+ - [ ] Scope declared (full or partial with rationale)
185
+ - [ ] Tasks decomposed to 2-5 min granularity
186
+ - [ ] Each task starts with failing test
187
+ - [ ] Dependencies mapped
188
+ - [ ] Parallel groups identified
189
+ - [ ] Plan verification passed — `scripts/verify-plan-coverage.sh` exit 0
190
+ - [ ] Spec coverage check passed — `scripts/spec-coverage-check.sh` exit 0
191
+ - [ ] Coverage thresholds met — `scripts/check-coverage-thresholds.sh` exit 0:
192
+
193
+ ```bash
194
+ scripts/check-coverage-thresholds.sh \
195
+ --coverage-file coverage/coverage-summary.json \
196
+ --line-threshold 80 \
197
+ --branch-threshold 70 \
198
+ --function-threshold 100
199
+ ```
200
+
201
+ - [ ] Plan saved to `docs/plans/`
202
+ - [ ] State file updated with plan path and tasks
203
+
204
+ ## Transition
205
+
206
+ After planning completes, **auto-continue to plan-review** (delta analysis):
207
+
208
+ 1. Set `.phase = "plan-review"` and populate tasks in state
209
+ 2. Run plan-review: compare design sections against planned tasks
210
+ - Gaps found: set `.planReview.gaps`, auto-loop back to `/exarchos:plan --revise`
211
+ - No gaps: present to user for approval (human checkpoint)
212
+ - On approval: set `.planReview.approved = true`, invoke `/exarchos:delegate`
213
+
214
+ **REQUIRED:** Run `scripts/verify-plan-coverage.sh --design-file <design> --plan-file <plan>`. If exit code 1: auto-invoke `Skill({ skill: "exarchos:plan", args: "--revise <design>" })`. If exit code 0: proceed to delegation.
215
+
216
+ ## Exarchos Integration
217
+
218
+ On plan completion, auto-emitted by `exarchos_workflow` `set` when phase transitions — emits `workflow.transition` from plan to plan-review. No manual `exarchos_event` append needed.
219
+
220
+ ## Troubleshooting
221
+
222
+ | Issue | Cause | Resolution |
223
+ |-------|-------|------------|
224
+ | `verify-plan-coverage.sh` exit 1 | Design sections not mapped to tasks | Add tasks for uncovered sections or add explicit deferral rationale |
225
+ | `spec-coverage-check.sh` exit 1 | Planned test files missing or failing | Create missing test stubs, verify file paths in plan match actual paths |
226
+ | `generate-traceability.sh` exit 1 | Design doc missing expected `##`/`###` headers | Verify design uses standard Markdown headings |
227
+ | Revision loop (3+ attempts) | Persistent gaps between design and plan | Set `planReview.revisionsExhausted = true`, suggest `/ideate --redesign` |
228
+
229
+ ## Performance Notes
230
+
231
+ - Complete each step fully before advancing — quality over speed
232
+ - Do not skip validation checks even when the change appears trivial
233
+ - Trace every design section to at least one task. Do not leave uncovered sections without explicit rationale.
@@ -0,0 +1,42 @@
1
+ # Plan Document Template
2
+
3
+ Save to: `docs/plans/YYYY-MM-DD-<feature>.md`
4
+
5
+ ```markdown
6
+ # Implementation Plan: [Feature Name]
7
+
8
+ ## Source Design
9
+ Link: `docs/designs/YYYY-MM-DD-<feature>.md`
10
+
11
+ ## Scope
12
+ **Target:** [Full design | Partial: <specific components>]
13
+ **Excluded:** [None | List excluded sections with rationale]
14
+
15
+ ## Summary
16
+ - Total tasks: [N]
17
+ - Parallel groups: [N]
18
+ - Estimated test count: [N]
19
+ - Design coverage: [X of Y sections covered]
20
+
21
+ ## Spec Traceability
22
+
23
+ [Traceability matrix from Step 1.5]
24
+
25
+ ## Task Breakdown
26
+
27
+ [Tasks in execution order]
28
+
29
+ ## Parallelization Strategy
30
+
31
+ [Which tasks can run in parallel worktrees]
32
+
33
+ ## Deferred Items
34
+
35
+ [Open questions or design sections not addressed, with rationale]
36
+
37
+ ## Completion Checklist
38
+ - [ ] All tests written before implementation
39
+ - [ ] All tests pass
40
+ - [ ] Code coverage meets standards
41
+ - [ ] Ready for review
42
+ ```
@@ -0,0 +1,51 @@
1
+ # Spec Tracing Guide
2
+
3
+ ## Traceability Matrix
4
+
5
+ Create a traceability table mapping design sections to planned tasks. This ensures complete coverage.
6
+
7
+ ```markdown
8
+ ## Spec Traceability
9
+
10
+ ### Scope Declaration
11
+
12
+ **Target:** [Full design | Partial: <specific components>]
13
+ **Excluded:** [List any intentionally excluded sections with rationale]
14
+
15
+ ### Traceability Matrix
16
+
17
+ | Design Section | Key Requirements | Task ID(s) | Status |
18
+ |----------------|-----------------|------------|--------|
19
+ | Technical Design > Component A | - Requirement 1<br>- Requirement 2 | 001, 002 | Covered |
20
+ | Technical Design > Component B | - Requirement 3 | 003 | Covered |
21
+ | Integration Points > X | - Connection to Y | 004 | Covered |
22
+ | Testing Strategy | - Unit tests<br>- Integration tests | 005, 006 | Covered |
23
+ | Open Questions > Q1 | Decision needed | — | Deferred: [reason] |
24
+ ```
25
+
26
+ ### Rules
27
+
28
+ - Every sub-section of Technical Design MUST map to at least one task
29
+ - Every file in "Files Changed" table MUST be touched by at least one task
30
+ - Open Questions MUST be resolved OR explicitly deferred with rationale
31
+ - For partial plans, declare scope upfront and only trace in-scope sections
32
+
33
+ ## Plan Verification
34
+
35
+ Before saving, verify completeness against the design document.
36
+
37
+ ### Coverage Checklist
38
+
39
+ - [ ] Every sub-section of "Technical Design" has at least one task
40
+ - [ ] All files in "Files Changed" table are touched by tasks
41
+ - [ ] Testing strategy items have corresponding test tasks
42
+ - [ ] Open questions are resolved OR explicitly deferred with rationale
43
+ - [ ] For partial plans: scope declaration is clear and justified
44
+
45
+ ### Delta Analysis
46
+
47
+ Compare design sections against task list. For each gap:
48
+ 1. Create a task to address it, OR
49
+ 2. Add to "Deferred Items" with explicit rationale
50
+
51
+ If significant gaps remain that cannot be justified, **do not proceed** — return to design phase for clarification.
@@ -0,0 +1,43 @@
1
+ # TDD Task Template
2
+
3
+ ## Task Format
4
+
5
+ Each task follows this structure:
6
+
7
+ ```markdown
8
+ ### Task [N]: [Brief Description]
9
+
10
+ **Phase:** [RED | GREEN | REFACTOR]
11
+
12
+ **TDD Steps:**
13
+ 1. [RED] Write test: `TestName_Scenario_ExpectedOutcome`
14
+ - File: `path/to/test.ts`
15
+ - Expected failure: [Specific failure reason]
16
+ - Run: `npm run test:run` - MUST FAIL
17
+
18
+ 2. [GREEN] Implement minimum code
19
+ - File: `path/to/implementation.ts`
20
+ - Changes: [Brief description]
21
+ - Run: `npm run test:run` - MUST PASS
22
+
23
+ 3. [REFACTOR] Clean up (optional)
24
+ - Apply: [SOLID principle or improvement]
25
+ - Run: `npm run test:run` - MUST STAY GREEN
26
+
27
+ **Verification:**
28
+ - [ ] Witnessed test fail for the right reason
29
+ - [ ] Test passes after implementation
30
+ - [ ] No extra code beyond test requirements
31
+
32
+ **Dependencies:** [Task IDs this depends on, or "None"]
33
+ **Parallelizable:** [Yes/No]
34
+ ```
35
+
36
+ ## Test Naming Convention
37
+
38
+ Follow: `MethodName_Scenario_ExpectedOutcome`
39
+
40
+ **Examples:**
41
+ - `CreateUser_ValidInput_ReturnsUserId`
42
+ - `CreateUser_EmptyEmail_ThrowsValidationError`
43
+ - `GetUser_NonExistentId_ReturnsNull`