@slamb2k/mad-skills 2.0.6

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 (52) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +129 -0
  3. package/package.json +42 -0
  4. package/skills/brace/SKILL.md +51 -0
  5. package/skills/brace/assets/gitignore-template +28 -0
  6. package/skills/brace/assets/global-preferences-template.md +53 -0
  7. package/skills/brace/instructions.md +229 -0
  8. package/skills/brace/references/brace-workflow.md +109 -0
  9. package/skills/brace/references/claude-md-template.md +91 -0
  10. package/skills/brace/references/gotcha-principles.md +113 -0
  11. package/skills/brace/references/phase-prompts.md +228 -0
  12. package/skills/brace/references/report-template.md +38 -0
  13. package/skills/brace/references/scaffold-manifest.md +68 -0
  14. package/skills/brace/tests/evals.json +29 -0
  15. package/skills/build/SKILL.md +48 -0
  16. package/skills/build/instructions.md +293 -0
  17. package/skills/build/references/architecture-notes.md +34 -0
  18. package/skills/build/references/project-detection.md +45 -0
  19. package/skills/build/references/report-contracts.md +21 -0
  20. package/skills/build/references/stage-prompts.md +405 -0
  21. package/skills/build/tests/evals.json +28 -0
  22. package/skills/distil/SKILL.md +38 -0
  23. package/skills/distil/assets/DesignNav.tsx +54 -0
  24. package/skills/distil/instructions.md +255 -0
  25. package/skills/distil/references/design-guide.md +118 -0
  26. package/skills/distil/references/iteration-mode.md +186 -0
  27. package/skills/distil/references/project-setup.md +92 -0
  28. package/skills/distil/tests/evals.json +28 -0
  29. package/skills/manifest.json +76 -0
  30. package/skills/prime/SKILL.md +39 -0
  31. package/skills/prime/instructions.md +73 -0
  32. package/skills/prime/references/domains.md +38 -0
  33. package/skills/prime/tests/evals.json +28 -0
  34. package/skills/rig/SKILL.md +38 -0
  35. package/skills/rig/assets/azure-pipelines.yml +91 -0
  36. package/skills/rig/assets/ci.yml +104 -0
  37. package/skills/rig/assets/gitmessage +38 -0
  38. package/skills/rig/assets/lefthook.yml +29 -0
  39. package/skills/rig/assets/pull_request_template.md +24 -0
  40. package/skills/rig/instructions.md +162 -0
  41. package/skills/rig/references/configuration-steps.md +124 -0
  42. package/skills/rig/references/phase-prompts.md +180 -0
  43. package/skills/rig/references/report-template.md +28 -0
  44. package/skills/rig/tests/evals.json +29 -0
  45. package/skills/ship/SKILL.md +55 -0
  46. package/skills/ship/instructions.md +192 -0
  47. package/skills/ship/references/stage-prompts.md +322 -0
  48. package/skills/ship/tests/evals.json +30 -0
  49. package/skills/sync/SKILL.md +54 -0
  50. package/skills/sync/instructions.md +178 -0
  51. package/skills/sync/tests/evals.json +29 -0
  52. package/src/cli.js +419 -0
@@ -0,0 +1,293 @@
1
+ # Build Instructions
2
+
3
+ Execute a detailed design/plan through the full feature-dev lifecycle with
4
+ maximum context isolation. Every heavy stage runs in a subagent so the primary
5
+ conversation only accumulates structured reports.
6
+
7
+ Stage prompts: `references/stage-prompts.md`
8
+ Report budgets: `references/report-contracts.md`
9
+ Agent selection: `references/architecture-notes.md`
10
+ Project detection: `references/project-detection.md`
11
+
12
+ ## Flags
13
+
14
+ Parse optional flags from the request:
15
+ - `--skip-questions`: Skip Stage 2 (clarifying questions)
16
+ - `--skip-review`: Skip Stage 5 (code review)
17
+ - `--no-ship`: Stop after Stage 8 docs update
18
+ - `--parallel-impl`: Split implementation into parallel agents when independent
19
+
20
+ ---
21
+
22
+ ## Pre-flight
23
+
24
+ Before starting, check all dependencies in this table:
25
+
26
+ | Dependency | Type | Check | Required | Resolution | Detail |
27
+ |-----------|------|-------|----------|------------|--------|
28
+ | ship | skill | `.claude/skills/ship/SKILL.md` | yes | stop | Install with: npx @slamb2k/mad-skills --skill ship |
29
+ | feature-dev:code-explorer | agent | — | no | fallback | Uses general-purpose agent |
30
+ | feature-dev:code-architect | agent | — | no | fallback | Uses general-purpose agent |
31
+ | feature-dev:code-reviewer | agent | — | no | fallback | Uses general-purpose agent |
32
+
33
+ For each row, in order:
34
+ 1. Run the Check command (for cli/npm) or test file existence (for agent/skill)
35
+ 2. If found: continue silently
36
+ 3. If missing: apply Resolution strategy
37
+ - **stop**: notify user with Detail, halt execution
38
+ - **url**: notify user with Detail (install link), halt execution
39
+ - **install**: notify user, run the command in Detail, continue if successful
40
+ - **ask**: notify user, offer to run command in Detail, continue either way (or halt if required)
41
+ - **fallback**: notify user with Detail, continue with degraded behavior
42
+ 4. After all checks: summarize what's available and what's degraded
43
+
44
+ 1. Capture **PLAN** (the user's argument) and **FLAGS**
45
+ 2. Detect project type using `references/project-detection.md` to populate
46
+ **PROJECT_CONFIG** (language, test_runner, test_setup)
47
+ 3. Check for outstanding questions from previous work:
48
+ - Search CLAUDE.md for a "Known Issues" or "Open Questions" section
49
+ - Search `goals/` for files containing "open_question" or "unresolved"
50
+ - Search memory (if available) for recent items of type "task" or
51
+ "open_question" that are unresolved
52
+ - Check for `DEBRIEF_ITEMS` in any recent build logs
53
+ 4. If outstanding items found, present via AskUserQuestion:
54
+ ```
55
+ "Found {count} outstanding items from previous work:"
56
+ {numbered list with summary of each}
57
+ "Address any of these before starting the build?"
58
+ ```
59
+ Options:
60
+ - **"Yes, let me choose which ones"** → present each; options:
61
+ "Incorporate into this build" / "Skip for now" / "Explain more"
62
+ Items marked "incorporate" get appended to the PLAN as additional
63
+ requirements for Stage 1 to explore.
64
+ - **"No, proceed with the build"** → continue normally
65
+ 5. Create a task list tracking all stages
66
+
67
+ ---
68
+
69
+ ## Stage 1: Explore
70
+
71
+ Launch **feature-dev:code-explorer** (fallback: general-purpose):
72
+
73
+ ```
74
+ Task(
75
+ subagent_type: "feature-dev:code-explorer",
76
+ description: "Explore codebase for build plan",
77
+ prompt: <read from references/stage-prompts.md#stage-1>
78
+ )
79
+ ```
80
+
81
+ Substitute `{PLAN}` into the prompt.
82
+ Parse EXPLORE_REPORT. Extract `questions` for Stage 2.
83
+
84
+ ---
85
+
86
+ ## Stage 2: Clarifying Questions
87
+
88
+ **Skip if `--skip-questions` or no questions found.**
89
+
90
+ Runs on the **primary thread** (requires user interaction).
91
+
92
+ 1. Review EXPLORE_REPORT `questions` and `potential_issues`
93
+ 2. Present questions to user via AskUserQuestion
94
+ 3. Store answers as CLARIFICATIONS
95
+
96
+ ---
97
+
98
+ ## Stage 3: Architecture Design
99
+
100
+ Launch **feature-dev:code-architect** (fallback: general-purpose):
101
+
102
+ ```
103
+ Task(
104
+ subagent_type: "feature-dev:code-architect",
105
+ description: "Design implementation architecture",
106
+ prompt: <read from references/stage-prompts.md#stage-3>
107
+ )
108
+ ```
109
+
110
+ Substitute `{PLAN}`, `{EXPLORE_REPORT}`, `{CLARIFICATIONS}`.
111
+ Parse ARCH_REPORT. Present `approach_summary` to user for confirmation.
112
+
113
+ If rejected, incorporate feedback and re-run.
114
+
115
+ ---
116
+
117
+ ## Stage 4: Implementation
118
+
119
+ If `--parallel-impl` and ARCH_REPORT has independent `parallel_groups`,
120
+ launch **multiple general-purpose subagents in parallel**.
121
+
122
+ Otherwise launch **one general-purpose subagent**:
123
+
124
+ ```
125
+ Task(
126
+ subagent_type: "general-purpose",
127
+ description: "Implement plan",
128
+ prompt: <read from references/stage-prompts.md#stage-4>
129
+ )
130
+ ```
131
+
132
+ Substitute `{PLAN}`, `{ARCH_REPORT}`, conventions, `{PROJECT_CONFIG.test_runner}`.
133
+ Parse IMPL_REPORT(s). If any failed, assess retry or abort.
134
+
135
+ ---
136
+
137
+ ## Stage 5: Code Review
138
+
139
+ **Skip if `--skip-review`.**
140
+
141
+ Launch **3 feature-dev:code-reviewer subagents in parallel** (fallback: general-purpose):
142
+
143
+ 1. Simplicity & DRY
144
+ 2. Bugs & Correctness
145
+ 3. Conventions & Integration
146
+
147
+ Prompts in `references/stage-prompts.md#stage-5`.
148
+
149
+ Consolidate reports. Present **only critical and high severity findings**.
150
+ Ask: "Fix these now, or proceed as-is?"
151
+
152
+ ---
153
+
154
+ ## Stage 6: Fix Review Findings
155
+
156
+ **Only if Stage 5 found issues AND user wants them fixed.**
157
+
158
+ Launch **general-purpose subagent**:
159
+
160
+ ```
161
+ Task(
162
+ subagent_type: "general-purpose",
163
+ description: "Fix review findings",
164
+ prompt: <read from references/stage-prompts.md#stage-6>
165
+ )
166
+ ```
167
+
168
+ ---
169
+
170
+ ## Stage 7: Verify
171
+
172
+ Launch **Bash subagent** (haiku):
173
+
174
+ ```
175
+ Task(
176
+ subagent_type: "Bash",
177
+ model: "haiku",
178
+ description: "Run verification tests",
179
+ prompt: <read from references/stage-prompts.md#stage-7>
180
+ )
181
+ ```
182
+
183
+ Substitute `{PROJECT_CONFIG.test_runner}` and `{PROJECT_CONFIG.test_setup}`.
184
+
185
+ If tests fail:
186
+ - First failure: launch general-purpose agent to fix, retry
187
+ - Second failure: report to user and stop
188
+
189
+ ---
190
+
191
+ ## Stage 8: Update Progress Documentation
192
+
193
+ **Skip if EXPLORE_REPORT has no `source_docs`.**
194
+
195
+ Launch **general-purpose subagent**:
196
+
197
+ ```
198
+ Task(
199
+ subagent_type: "general-purpose",
200
+ description: "Update progress documentation",
201
+ prompt: <read from references/stage-prompts.md#stage-8>
202
+ )
203
+ ```
204
+
205
+ **If `--no-ship`: Stop here and present final summary.**
206
+
207
+ ---
208
+
209
+ ## Stage 9: Ship
210
+
211
+ Invoke the `/ship` skill:
212
+
213
+ ```
214
+ /ship {approach_summary from ARCH_REPORT}. Files: {files from IMPL_REPORT}
215
+ ```
216
+
217
+ ---
218
+
219
+ ## Stage 10: Debrief
220
+
221
+ **Always runs** on the primary thread (requires user interaction).
222
+
223
+ 1. Scan all stage reports for unresolved items:
224
+ - EXPLORE_REPORT: `potential_issues` not addressed by implementation
225
+ - ARCH_REPORT: `risks` with deferred mitigations
226
+ - REVIEW_REPORT: `medium`/`low` findings not fixed in Stage 6
227
+ - TEST_REPORT: warnings, skipped tests, flaky results
228
+ - DOCS_REPORT: `docs_skipped` items
229
+ - IMPL_REPORT: `issues_encountered` that were worked around
230
+
231
+ 2. Compile into DEBRIEF_ITEMS (see `references/stage-prompts.md#stage-10`).
232
+ Categorise each as: unresolved_risk, deferred_fix, open_question,
233
+ assumption, or tech_debt.
234
+
235
+ 3. **If no items found, skip to Final Report.**
236
+
237
+ 4. Present numbered summary via AskUserQuestion grouped by category.
238
+ Each item shows: `[category] summary (effort)`.
239
+
240
+ Options:
241
+ - **"Fix now"** → create a task list of resolution activities for
242
+ each item; present for user confirmation, then work through them
243
+ - **"Create goals for future sessions"** → write goal files to `goals/`
244
+ (if GOTCHA structure exists) or append to CLAUDE.md as Known Issues
245
+ - **"Note and continue"** → acknowledge items without formal tracking;
246
+ log to memory (if exists) or as source file comments. No further action.
247
+ - **"Let me choose per item"** → present each individually with full
248
+ description, evidence, and impact. Options per item:
249
+ "Fix now" / "Add to goals" / "Explain more" / "Note and continue".
250
+ "Explain more" reads source files cited in evidence, provides
251
+ expanded context, then re-presents the item for decision.
252
+
253
+ 5. After resolution, include debrief summary in the Final Report.
254
+
255
+ ---
256
+
257
+ ## Final Report
258
+
259
+ ```
260
+ Build complete
261
+
262
+ Plan: {first line of PLAN}
263
+ Approach: {approach_summary}
264
+
265
+ Files modified: {count}
266
+ Files created: {count}
267
+ Tests: {passed}/{total}
268
+
269
+ Docs updated: {count or "none"}
270
+
271
+ PR: {pr_url} (merged at {merge_commit})
272
+
273
+ Key decisions:
274
+ - {decision 1}
275
+ - {decision 2}
276
+
277
+ Review findings addressed: {count fixed} / {count found}
278
+
279
+ Debrief: {count resolved} / {count surfaced} items addressed
280
+ {list of items created as goals or tasks, if any}
281
+ ```
282
+
283
+ If any stage failed, report the failure point and what was accomplished.
284
+
285
+ ---
286
+
287
+ ## Rollback
288
+
289
+ If implementation succeeds but later stages fail:
290
+ - Tests fail: fix agent attempts repair, then reports to user
291
+ - Review critical: user decides fix or proceed
292
+ - Ship fails: code is still committed locally; user can manually push
293
+ - Never silently revert completed implementation work
@@ -0,0 +1,34 @@
1
+ # Build Architecture Notes
2
+
3
+ ## Context Isolation Strategy
4
+
5
+ | Technique | Where Applied | Benefit |
6
+ |-----------|--------------|---------|
7
+ | Subagent delegation | Stages 1, 3-6, 8 | Heavy code I/O stays out of primary |
8
+ | Structured reports | All stages | Only 10-30 lines per stage in primary |
9
+ | Background tasks | Test runs, CI | Non-blocking; output read on completion |
10
+ | Skill chaining | Stage 9 | /ship handles its own subagent tree |
11
+ | Haiku for simple work | Git ops, test runs | Minimizes cost on mechanical stages |
12
+ | Report contracts | All subagents | Fixed-format summaries, not raw output |
13
+
14
+ ## Agent Type Selection
15
+
16
+ | Stage | Agent | Fallback | Rationale |
17
+ |-------|-------|----------|-----------|
18
+ | Explore | feature-dev:code-explorer | general-purpose | Deep codebase analysis |
19
+ | Questions | primary thread | — | User interaction required |
20
+ | Architect | feature-dev:code-architect | general-purpose | Design work |
21
+ | Implement | general-purpose | — | Full file editing capability |
22
+ | Review | feature-dev:code-reviewer | general-purpose | Confidence-based filtering |
23
+ | Fix | general-purpose | — | Targeted edits |
24
+ | Verify | Bash (haiku) | — | Just runs test command |
25
+ | Docs | general-purpose | — | Updates progress markers |
26
+ | Ship | /ship skill | — | Has own subagent tree |
27
+
28
+ ## Compaction Prevention
29
+
30
+ The primary thread never sees raw file contents, diffs, grep results, or
31
+ test output beyond final summary lines. Each subagent operates in its own
32
+ context window and returns only its structured report. This keeps the
33
+ primary conversation well under compaction thresholds even for large
34
+ multi-file implementations.
@@ -0,0 +1,45 @@
1
+ # Build Project Detection
2
+
3
+ Auto-detect the project's language, test runner, and build tools.
4
+ Run this during pre-flight to populate PROJECT_CONFIG.
5
+
6
+ ## Detection Chain
7
+
8
+ ```
9
+ 1. Check for package.json → Node.js project
10
+ test_runner: look for scripts.test → "npm test" / "bun test" / etc.
11
+ test_setup: none (or "npm install" if node_modules missing)
12
+
13
+ 2. Check for pyproject.toml / setup.py / requirements.txt → Python project
14
+ test_runner: "python -m pytest tests/ -x -q --tb=short"
15
+ test_setup: "source .venv/bin/activate" (if .venv exists)
16
+
17
+ 3. Check for go.mod → Go project
18
+ test_runner: "go test ./..."
19
+ test_setup: none
20
+
21
+ 4. Check for Cargo.toml → Rust project
22
+ test_runner: "cargo test"
23
+ test_setup: none
24
+
25
+ 5. Fallback → unknown
26
+ test_runner: prompt user
27
+ test_setup: prompt user
28
+ ```
29
+
30
+ ## PROJECT_CONFIG Output
31
+
32
+ ```
33
+ PROJECT_CONFIG:
34
+ language: node|python|go|rust|unknown
35
+ package_manager: npm|bun|pnpm|yarn|pip|cargo|go|unknown
36
+ test_runner: {command to run tests}
37
+ test_setup: {optional setup command, or "none"}
38
+ build_command: {optional build command, or "none"}
39
+ ```
40
+
41
+ ## Usage
42
+
43
+ All stage prompts reference `{PROJECT_CONFIG.test_runner}` instead of
44
+ hardcoded test commands. The orchestrator substitutes the detected value
45
+ before sending prompts to subagents.
@@ -0,0 +1,21 @@
1
+ # Build Report Contracts
2
+
3
+ Maximum line budgets for each stage report in the primary thread.
4
+
5
+ | Stage | Report | Max Lines | Content |
6
+ |-------|--------|-----------|---------|
7
+ | 1 | EXPLORE_REPORT | 30 | Files, patterns, conventions, issues, questions |
8
+ | 2 | CLARIFICATIONS | 10 | User answers to questions |
9
+ | 3 | ARCH_REPORT | 30 | Approach, implementation order, commit plan |
10
+ | 4 | IMPL_REPORT | 20 | Status, files changed, test result |
11
+ | 5 | REVIEW_REPORT | 15 (x3) | Findings by severity |
12
+ | 6 | FIX_REPORT | 10 | Fixes applied, test result |
13
+ | 7 | TEST_REPORT | 10 | Pass/fail counts, output tail |
14
+ | 8 | DOCS_REPORT | 15 | Updated markers, skipped items |
15
+ | 9 | SHIP_REPORT | 15 | PR URL, merge commit (from /ship) |
16
+ | 10 | DEBRIEF_ITEMS | 20 | Unresolved items, categories, suggested actions |
17
+
18
+ **Total primary thread budget: ~180 lines** across all stages.
19
+
20
+ The primary thread never sees raw file contents, diffs, grep results, or
21
+ verbose test output. Each subagent returns only its structured report.