bigpowers 2.87.3 → 2.87.5

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 (259) hide show
  1. package/.cursor/rules/align-grid.mdc +109 -0
  2. package/.cursor/rules/assess-impact.mdc +90 -0
  3. package/.cursor/rules/audit-code.mdc +183 -0
  4. package/.cursor/rules/audit-plan.mdc +88 -0
  5. package/.cursor/rules/build-epic.mdc +104 -0
  6. package/.cursor/rules/change-request.mdc +120 -0
  7. package/.cursor/rules/commit-message.mdc +139 -0
  8. package/.cursor/rules/compose-workflow.mdc +81 -0
  9. package/.cursor/rules/context7-mcp.mdc +54 -0
  10. package/.cursor/rules/craft-skill.mdc +195 -0
  11. package/.cursor/rules/deepen-architecture.mdc +259 -0
  12. package/.cursor/rules/define-language.mdc +79 -0
  13. package/.cursor/rules/define-success.mdc +11 -0
  14. package/.cursor/rules/delegate-task.mdc +90 -0
  15. package/.cursor/rules/deploy.mdc +197 -0
  16. package/.cursor/rules/design-interface.mdc +96 -0
  17. package/.cursor/rules/develop-tdd.mdc +415 -0
  18. package/.cursor/rules/diagnose-root.mdc +23 -0
  19. package/.cursor/rules/diagnose-stall.mdc +53 -0
  20. package/.cursor/rules/dispatch-agents.mdc +117 -0
  21. package/.cursor/rules/edit-document.mdc +22 -0
  22. package/.cursor/rules/elaborate-spec.mdc +100 -0
  23. package/.cursor/rules/enforce-first.mdc +44 -0
  24. package/.cursor/rules/evolve-skill.mdc +54 -0
  25. package/.cursor/rules/execute-plan.mdc +60 -0
  26. package/.cursor/rules/extract-design.mdc +131 -0
  27. package/.cursor/rules/find-way.mdc +190 -0
  28. package/.cursor/rules/fix-bug.mdc +66 -0
  29. package/.cursor/rules/gate-trace.mdc +91 -0
  30. package/.cursor/rules/generate-allure-report.mdc +284 -0
  31. package/.cursor/rules/grill-me.mdc +107 -0
  32. package/.cursor/rules/grill-with-docs.mdc +52 -0
  33. package/.cursor/rules/guard-git.mdc +230 -0
  34. package/.cursor/rules/harden-vps.mdc +290 -0
  35. package/.cursor/rules/hook-commits.mdc +93 -0
  36. package/.cursor/rules/inspect-quality.mdc +105 -0
  37. package/.cursor/rules/investigate-bug.mdc +126 -0
  38. package/.cursor/rules/kickoff-branch.mdc +142 -0
  39. package/.cursor/rules/maintain-wiki.mdc +63 -0
  40. package/.cursor/rules/map-codebase.mdc +70 -0
  41. package/.cursor/rules/migrate-spec.mdc +907 -0
  42. package/.cursor/rules/model-domain.mdc +231 -0
  43. package/.cursor/rules/orchestrate-project.mdc +173 -0
  44. package/.cursor/rules/organize-workspace.mdc +163 -0
  45. package/.cursor/rules/plan-refactor.mdc +86 -0
  46. package/.cursor/rules/plan-release.mdc +144 -0
  47. package/.cursor/rules/plan-tests.mdc +74 -0
  48. package/.cursor/rules/plan-work.mdc +271 -0
  49. package/.cursor/rules/publish-package.mdc +337 -0
  50. package/.cursor/rules/quick-fix.mdc +113 -0
  51. package/.cursor/rules/release-branch.mdc +301 -0
  52. package/.cursor/rules/request-review.mdc +112 -0
  53. package/.cursor/rules/research-first.mdc +86 -0
  54. package/.cursor/rules/reset-baseline.mdc +20 -0
  55. package/.cursor/rules/respond-review.mdc +70 -0
  56. package/.cursor/rules/run-benchmark.mdc +84 -0
  57. package/.cursor/rules/run-evals.mdc +79 -0
  58. package/.cursor/rules/run-planning.mdc +100 -0
  59. package/.cursor/rules/scope-work.mdc +62 -0
  60. package/.cursor/rules/search-skills.mdc +72 -0
  61. package/.cursor/rules/security-review.mdc +383 -0
  62. package/.cursor/rules/seed-conventions.mdc +311 -0
  63. package/.cursor/rules/session-state.mdc +145 -0
  64. package/.cursor/rules/setup-environment.mdc +38 -0
  65. package/.cursor/rules/simple-english.mdc +345 -0
  66. package/.cursor/rules/simulate-agents.mdc +25 -0
  67. package/.cursor/rules/slice-tasks.mdc +67 -0
  68. package/.cursor/rules/smoke-test.mdc +260 -0
  69. package/.cursor/rules/spike-prototype.mdc +94 -0
  70. package/.cursor/rules/stocktake-skills.mdc +73 -0
  71. package/.cursor/rules/survey-context.mdc +134 -0
  72. package/.cursor/rules/terse-mode.mdc +41 -0
  73. package/.cursor/rules/trace-requirement.mdc +68 -0
  74. package/.cursor/rules/using-bigpowers.mdc +110 -0
  75. package/.cursor/rules/validate-contracts.mdc +285 -0
  76. package/.cursor/rules/validate-fix.mdc +146 -0
  77. package/.cursor/rules/verify-work.mdc +190 -0
  78. package/.cursor/rules/visual-dashboard.mdc +49 -0
  79. package/.cursor/rules/wire-ci.mdc +380 -0
  80. package/.cursor/rules/wire-observability.mdc +96 -0
  81. package/.cursor/rules/write-document.mdc +280 -0
  82. package/.gemini/extensions/bigpowers/commands/prompts/align-grid.md +109 -0
  83. package/.gemini/extensions/bigpowers/commands/prompts/assess-impact.md +90 -0
  84. package/.gemini/extensions/bigpowers/commands/prompts/audit-code.md +183 -0
  85. package/.gemini/extensions/bigpowers/commands/prompts/audit-plan.md +88 -0
  86. package/.gemini/extensions/bigpowers/commands/prompts/build-epic.md +104 -0
  87. package/.gemini/extensions/bigpowers/commands/prompts/change-request.md +120 -0
  88. package/.gemini/extensions/bigpowers/commands/prompts/commit-message.md +139 -0
  89. package/.gemini/extensions/bigpowers/commands/prompts/compose-workflow.md +81 -0
  90. package/.gemini/extensions/bigpowers/commands/prompts/context7-mcp.md +54 -0
  91. package/.gemini/extensions/bigpowers/commands/prompts/craft-skill.md +195 -0
  92. package/.gemini/extensions/bigpowers/commands/prompts/deepen-architecture.md +259 -0
  93. package/.gemini/extensions/bigpowers/commands/prompts/define-language.md +79 -0
  94. package/.gemini/extensions/bigpowers/commands/prompts/define-success.md +11 -0
  95. package/.gemini/extensions/bigpowers/commands/prompts/delegate-task.md +90 -0
  96. package/.gemini/extensions/bigpowers/commands/prompts/deploy.md +197 -0
  97. package/.gemini/extensions/bigpowers/commands/prompts/design-interface.md +96 -0
  98. package/.gemini/extensions/bigpowers/commands/prompts/develop-tdd.md +415 -0
  99. package/.gemini/extensions/bigpowers/commands/prompts/diagnose-root.md +23 -0
  100. package/.gemini/extensions/bigpowers/commands/prompts/diagnose-stall.md +53 -0
  101. package/.gemini/extensions/bigpowers/commands/prompts/dispatch-agents.md +117 -0
  102. package/.gemini/extensions/bigpowers/commands/prompts/edit-document.md +22 -0
  103. package/.gemini/extensions/bigpowers/commands/prompts/elaborate-spec.md +100 -0
  104. package/.gemini/extensions/bigpowers/commands/prompts/enforce-first.md +44 -0
  105. package/.gemini/extensions/bigpowers/commands/prompts/evolve-skill.md +54 -0
  106. package/.gemini/extensions/bigpowers/commands/prompts/execute-plan.md +60 -0
  107. package/.gemini/extensions/bigpowers/commands/prompts/extract-design.md +131 -0
  108. package/.gemini/extensions/bigpowers/commands/prompts/find-way.md +190 -0
  109. package/.gemini/extensions/bigpowers/commands/prompts/fix-bug.md +66 -0
  110. package/.gemini/extensions/bigpowers/commands/prompts/gate-trace.md +91 -0
  111. package/.gemini/extensions/bigpowers/commands/prompts/generate-allure-report.md +284 -0
  112. package/.gemini/extensions/bigpowers/commands/prompts/grill-me.md +107 -0
  113. package/.gemini/extensions/bigpowers/commands/prompts/grill-with-docs.md +52 -0
  114. package/.gemini/extensions/bigpowers/commands/prompts/guard-git.md +230 -0
  115. package/.gemini/extensions/bigpowers/commands/prompts/harden-vps.md +290 -0
  116. package/.gemini/extensions/bigpowers/commands/prompts/hook-commits.md +93 -0
  117. package/.gemini/extensions/bigpowers/commands/prompts/inspect-quality.md +105 -0
  118. package/.gemini/extensions/bigpowers/commands/prompts/investigate-bug.md +126 -0
  119. package/.gemini/extensions/bigpowers/commands/prompts/kickoff-branch.md +142 -0
  120. package/.gemini/extensions/bigpowers/commands/prompts/maintain-wiki.md +63 -0
  121. package/.gemini/extensions/bigpowers/commands/prompts/map-codebase.md +70 -0
  122. package/.gemini/extensions/bigpowers/commands/prompts/migrate-spec.md +907 -0
  123. package/.gemini/extensions/bigpowers/commands/prompts/model-domain.md +231 -0
  124. package/.gemini/extensions/bigpowers/commands/prompts/orchestrate-project.md +173 -0
  125. package/.gemini/extensions/bigpowers/commands/prompts/organize-workspace.md +163 -0
  126. package/.gemini/extensions/bigpowers/commands/prompts/plan-refactor.md +86 -0
  127. package/.gemini/extensions/bigpowers/commands/prompts/plan-release.md +144 -0
  128. package/.gemini/extensions/bigpowers/commands/prompts/plan-tests.md +74 -0
  129. package/.gemini/extensions/bigpowers/commands/prompts/plan-work.md +271 -0
  130. package/.gemini/extensions/bigpowers/commands/prompts/publish-package.md +337 -0
  131. package/.gemini/extensions/bigpowers/commands/prompts/quick-fix.md +113 -0
  132. package/.gemini/extensions/bigpowers/commands/prompts/release-branch.md +301 -0
  133. package/.gemini/extensions/bigpowers/commands/prompts/request-review.md +112 -0
  134. package/.gemini/extensions/bigpowers/commands/prompts/research-first.md +86 -0
  135. package/.gemini/extensions/bigpowers/commands/prompts/reset-baseline.md +20 -0
  136. package/.gemini/extensions/bigpowers/commands/prompts/respond-review.md +70 -0
  137. package/.gemini/extensions/bigpowers/commands/prompts/run-benchmark.md +84 -0
  138. package/.gemini/extensions/bigpowers/commands/prompts/run-evals.md +79 -0
  139. package/.gemini/extensions/bigpowers/commands/prompts/run-planning.md +100 -0
  140. package/.gemini/extensions/bigpowers/commands/prompts/scope-work.md +62 -0
  141. package/.gemini/extensions/bigpowers/commands/prompts/search-skills.md +72 -0
  142. package/.gemini/extensions/bigpowers/commands/prompts/security-review.md +383 -0
  143. package/.gemini/extensions/bigpowers/commands/prompts/seed-conventions.md +311 -0
  144. package/.gemini/extensions/bigpowers/commands/prompts/session-state.md +145 -0
  145. package/.gemini/extensions/bigpowers/commands/prompts/setup-environment.md +38 -0
  146. package/.gemini/extensions/bigpowers/commands/prompts/simple-english.md +345 -0
  147. package/.gemini/extensions/bigpowers/commands/prompts/simulate-agents.md +25 -0
  148. package/.gemini/extensions/bigpowers/commands/prompts/slice-tasks.md +67 -0
  149. package/.gemini/extensions/bigpowers/commands/prompts/smoke-test.md +260 -0
  150. package/.gemini/extensions/bigpowers/commands/prompts/spike-prototype.md +94 -0
  151. package/.gemini/extensions/bigpowers/commands/prompts/stocktake-skills.md +73 -0
  152. package/.gemini/extensions/bigpowers/commands/prompts/survey-context.md +134 -0
  153. package/.gemini/extensions/bigpowers/commands/prompts/terse-mode.md +41 -0
  154. package/.gemini/extensions/bigpowers/commands/prompts/trace-requirement.md +68 -0
  155. package/.gemini/extensions/bigpowers/commands/prompts/using-bigpowers.md +110 -0
  156. package/.gemini/extensions/bigpowers/commands/prompts/validate-contracts.md +285 -0
  157. package/.gemini/extensions/bigpowers/commands/prompts/validate-fix.md +146 -0
  158. package/.gemini/extensions/bigpowers/commands/prompts/verify-work.md +190 -0
  159. package/.gemini/extensions/bigpowers/commands/prompts/visual-dashboard.md +49 -0
  160. package/.gemini/extensions/bigpowers/commands/prompts/wire-ci.md +380 -0
  161. package/.gemini/extensions/bigpowers/commands/prompts/wire-observability.md +96 -0
  162. package/.gemini/extensions/bigpowers/commands/prompts/write-document.md +280 -0
  163. package/.gemini/extensions/bigpowers/gemini-extension.json +16 -0
  164. package/.gemini/extensions/bigpowers/hooks/HOOKS.md +43 -0
  165. package/.gemini/extensions/bigpowers/hooks/before-tool-git-guard.sh +26 -0
  166. package/.gemini/extensions/bigpowers/hooks/before-tool-rtk.sh +14 -0
  167. package/.gemini/extensions/bigpowers/hooks/before-tool-token-mgmt.sh +19 -0
  168. package/.gemini/extensions/bigpowers/hooks/hooks-manifest.json +36 -0
  169. package/.gemini/extensions/bigpowers/hooks/run-hook.cmd +29 -0
  170. package/.gemini/extensions/bigpowers/hooks/session-start +48 -0
  171. package/.gemini/extensions/bigpowers/hooks/settings.json.example +41 -0
  172. package/.gemini/extensions/bigpowers/skills/align-grid/SKILL.md +111 -0
  173. package/.gemini/extensions/bigpowers/skills/assess-impact/SKILL.md +92 -0
  174. package/.gemini/extensions/bigpowers/skills/audit-code/SKILL.md +185 -0
  175. package/.gemini/extensions/bigpowers/skills/audit-plan/SKILL.md +90 -0
  176. package/.gemini/extensions/bigpowers/skills/build-epic/SKILL.md +106 -0
  177. package/.gemini/extensions/bigpowers/skills/change-request/SKILL.md +122 -0
  178. package/.gemini/extensions/bigpowers/skills/commit-message/SKILL.md +141 -0
  179. package/.gemini/extensions/bigpowers/skills/compose-workflow/SKILL.md +83 -0
  180. package/.gemini/extensions/bigpowers/skills/context7-mcp/SKILL.md +56 -0
  181. package/.gemini/extensions/bigpowers/skills/craft-skill/SKILL.md +197 -0
  182. package/.gemini/extensions/bigpowers/skills/deepen-architecture/SKILL.md +261 -0
  183. package/.gemini/extensions/bigpowers/skills/define-language/SKILL.md +81 -0
  184. package/.gemini/extensions/bigpowers/skills/define-success/SKILL.md +13 -0
  185. package/.gemini/extensions/bigpowers/skills/delegate-task/SKILL.md +92 -0
  186. package/.gemini/extensions/bigpowers/skills/deploy/SKILL.md +199 -0
  187. package/.gemini/extensions/bigpowers/skills/design-interface/SKILL.md +98 -0
  188. package/.gemini/extensions/bigpowers/skills/develop-tdd/SKILL.md +417 -0
  189. package/.gemini/extensions/bigpowers/skills/diagnose-root/SKILL.md +25 -0
  190. package/.gemini/extensions/bigpowers/skills/diagnose-stall/SKILL.md +55 -0
  191. package/.gemini/extensions/bigpowers/skills/dispatch-agents/SKILL.md +119 -0
  192. package/.gemini/extensions/bigpowers/skills/edit-document/SKILL.md +24 -0
  193. package/.gemini/extensions/bigpowers/skills/elaborate-spec/SKILL.md +102 -0
  194. package/.gemini/extensions/bigpowers/skills/enforce-first/SKILL.md +46 -0
  195. package/.gemini/extensions/bigpowers/skills/evolve-skill/SKILL.md +56 -0
  196. package/.gemini/extensions/bigpowers/skills/execute-plan/SKILL.md +62 -0
  197. package/.gemini/extensions/bigpowers/skills/extract-design/SKILL.md +133 -0
  198. package/.gemini/extensions/bigpowers/skills/find-way/SKILL.md +192 -0
  199. package/.gemini/extensions/bigpowers/skills/fix-bug/SKILL.md +68 -0
  200. package/.gemini/extensions/bigpowers/skills/gate-trace/SKILL.md +93 -0
  201. package/.gemini/extensions/bigpowers/skills/generate-allure-report/SKILL.md +286 -0
  202. package/.gemini/extensions/bigpowers/skills/grill-me/SKILL.md +109 -0
  203. package/.gemini/extensions/bigpowers/skills/grill-with-docs/SKILL.md +54 -0
  204. package/.gemini/extensions/bigpowers/skills/guard-git/SKILL.md +232 -0
  205. package/.gemini/extensions/bigpowers/skills/harden-vps/SKILL.md +292 -0
  206. package/.gemini/extensions/bigpowers/skills/hook-commits/SKILL.md +95 -0
  207. package/.gemini/extensions/bigpowers/skills/inspect-quality/SKILL.md +107 -0
  208. package/.gemini/extensions/bigpowers/skills/investigate-bug/SKILL.md +128 -0
  209. package/.gemini/extensions/bigpowers/skills/kickoff-branch/SKILL.md +144 -0
  210. package/.gemini/extensions/bigpowers/skills/maintain-wiki/SKILL.md +65 -0
  211. package/.gemini/extensions/bigpowers/skills/map-codebase/SKILL.md +72 -0
  212. package/.gemini/extensions/bigpowers/skills/migrate-spec/SKILL.md +909 -0
  213. package/.gemini/extensions/bigpowers/skills/model-domain/SKILL.md +233 -0
  214. package/.gemini/extensions/bigpowers/skills/orchestrate-project/SKILL.md +175 -0
  215. package/.gemini/extensions/bigpowers/skills/organize-workspace/SKILL.md +165 -0
  216. package/.gemini/extensions/bigpowers/skills/plan-refactor/SKILL.md +88 -0
  217. package/.gemini/extensions/bigpowers/skills/plan-release/SKILL.md +146 -0
  218. package/.gemini/extensions/bigpowers/skills/plan-tests/SKILL.md +76 -0
  219. package/.gemini/extensions/bigpowers/skills/plan-work/SKILL.md +273 -0
  220. package/.gemini/extensions/bigpowers/skills/publish-package/SKILL.md +339 -0
  221. package/.gemini/extensions/bigpowers/skills/quick-fix/SKILL.md +115 -0
  222. package/.gemini/extensions/bigpowers/skills/release-branch/SKILL.md +303 -0
  223. package/.gemini/extensions/bigpowers/skills/request-review/SKILL.md +114 -0
  224. package/.gemini/extensions/bigpowers/skills/research-first/SKILL.md +88 -0
  225. package/.gemini/extensions/bigpowers/skills/reset-baseline/SKILL.md +22 -0
  226. package/.gemini/extensions/bigpowers/skills/respond-review/SKILL.md +72 -0
  227. package/.gemini/extensions/bigpowers/skills/run-benchmark/SKILL.md +86 -0
  228. package/.gemini/extensions/bigpowers/skills/run-evals/SKILL.md +81 -0
  229. package/.gemini/extensions/bigpowers/skills/run-planning/SKILL.md +102 -0
  230. package/.gemini/extensions/bigpowers/skills/scope-work/SKILL.md +64 -0
  231. package/.gemini/extensions/bigpowers/skills/search-skills/SKILL.md +74 -0
  232. package/.gemini/extensions/bigpowers/skills/security-review/SKILL.md +385 -0
  233. package/.gemini/extensions/bigpowers/skills/seed-conventions/SKILL.md +313 -0
  234. package/.gemini/extensions/bigpowers/skills/session-state/SKILL.md +147 -0
  235. package/.gemini/extensions/bigpowers/skills/setup-environment/SKILL.md +40 -0
  236. package/.gemini/extensions/bigpowers/skills/simple-english/SKILL.md +347 -0
  237. package/.gemini/extensions/bigpowers/skills/simulate-agents/SKILL.md +27 -0
  238. package/.gemini/extensions/bigpowers/skills/slice-tasks/SKILL.md +69 -0
  239. package/.gemini/extensions/bigpowers/skills/smoke-test/SKILL.md +262 -0
  240. package/.gemini/extensions/bigpowers/skills/spike-prototype/SKILL.md +96 -0
  241. package/.gemini/extensions/bigpowers/skills/stocktake-skills/SKILL.md +75 -0
  242. package/.gemini/extensions/bigpowers/skills/survey-context/SKILL.md +136 -0
  243. package/.gemini/extensions/bigpowers/skills/terse-mode/SKILL.md +43 -0
  244. package/.gemini/extensions/bigpowers/skills/trace-requirement/SKILL.md +70 -0
  245. package/.gemini/extensions/bigpowers/skills/using-bigpowers/SKILL.md +112 -0
  246. package/.gemini/extensions/bigpowers/skills/validate-contracts/SKILL.md +287 -0
  247. package/.gemini/extensions/bigpowers/skills/validate-fix/SKILL.md +148 -0
  248. package/.gemini/extensions/bigpowers/skills/verify-work/SKILL.md +192 -0
  249. package/.gemini/extensions/bigpowers/skills/visual-dashboard/SKILL.md +51 -0
  250. package/.gemini/extensions/bigpowers/skills/wire-ci/SKILL.md +382 -0
  251. package/.gemini/extensions/bigpowers/skills/wire-observability/SKILL.md +98 -0
  252. package/.gemini/extensions/bigpowers/skills/write-document/SKILL.md +282 -0
  253. package/.pi/package.json +1 -1
  254. package/CHANGELOG.md +14 -0
  255. package/package.json +1 -1
  256. package/scripts/lib/__pycache__/link_utils.cpython-312.pyc +0 -0
  257. package/scripts/lib/__pycache__/srp_engine_links.cpython-312.pyc +0 -0
  258. package/scripts/lib/install-helpers.js +147 -20
  259. package/scripts/test-install-helpers.js +141 -0
@@ -0,0 +1,81 @@
1
+ ---
2
+ name: compose-workflow
3
+ description: "Chain multiple bigpowers skills into a custom workflow recipe saved in specs/. Use when a project repeats a non-standard skill sequence, or user wants a documented playbook beyond orchestrate-project modes."
4
+ ---
5
+
6
+ # story: e09s01
7
+ # story: e45s27
8
+ # story: e21s04
9
+
10
+ # Compose Workflow
11
+ > **HARD GATE** — **HARD GATE** — Workflows are orchestration, not automation. Do NOT create workflows for tasks that should be single skills. Workflow complexity must be justified.
12
+
13
+
14
+ ## Process
15
+
16
+ 1. Interview: goal, phases, which skills, gates between steps.
17
+ 2. Write `specs/workflows/<name>.yaml`:
18
+ - `name`, `command`, `description`, `skills[]`, `verify`
19
+ - Optional: `args` for skill-specific arguments
20
+ 3. Register in state.yaml Active Decisions.
21
+ 4. Optional: reference from `orchestrate-project` Ad-Hoc mode.
22
+
23
+ > **Prefer the YAML recipe format** over the legacy `specs/WORKFLOW-<name>.md` markdown format.
24
+ > YAML recipes are command-mappable, machine-readable, and listed in the Standard Recipe Library.
25
+
26
+ ## Terminal-state taxonomy (e45s27)
27
+
28
+ Every workflow step and `/loop` tick MUST exit with exactly one terminal state:
29
+
30
+ | State | Meaning | Next action |
31
+ |-------|---------|-------------|
32
+ | `success` | Step verify passed; artifacts written | Advance to next skill in recipe |
33
+ | `no-op` | Nothing to do (already green / already applied) | Skip step; advance |
34
+ | `blocked` | External gate (approval, red CI, missing dep) | `diagnose-stall` or escalate to user |
35
+ | `exhausted` | Max iterations/cycles reached (review cap, dispatch cycles) | Stop; human decision required |
36
+
37
+ Record terminal state in `specs/state.yaml` `handoff.last_terminal_state` when a recipe step completes. `/loop` ticks that produce no progress for two consecutive wakes → invoke `diagnose-stall`.
38
+
39
+ ## Standard Recipe Library
40
+
41
+ Pre-built recipes in `specs/workflows/` map agentic stack commands to skill chains.
42
+ Reference them in AGENTS.md so `/command` directly invokes the matching recipe.
43
+
44
+ | Command | Workflow | Skill chain |
45
+ |---------|----------|-------------|
46
+ | `/check-stack` | check-stack | survey-context → assess-impact → setup-environment |
47
+ | `/ship` | ship | audit-code → commit-message → release-branch |
48
+ | `/tdd` | tdd | develop-tdd → enforce-first |
49
+ | `/code-review` | code-review | audit-code → request-review → respond-review |
50
+ | `/security` | security | audit-code → request-review |
51
+ | `/plan` | plan | survey-context → research-first → plan-work |
52
+ | `/build-fix` | build-fix | investigate-bug → diagnose-root → develop-tdd → validate-fix |
53
+ | `/e2e` | e2e | smoke-test → verify-work |
54
+
55
+ Add to `AGENTS.md`:
56
+ ```
57
+ /check-stack = compose-workflow check-stack
58
+ /ship = compose-workflow ship
59
+ ```
60
+
61
+ ## Verify
62
+
63
+ → verify: `[ "$(ls specs/workflows/*.yaml 2>/dev/null | wc -l | tr -d ' ')" -ge 8 ]`
64
+
65
+ See [REFERENCE.md](REFERENCE.md) for template.
66
+
67
+ ---
68
+
69
+ # Workflow template
70
+
71
+ ```markdown
72
+ # WORKFLOW: <name>
73
+
74
+ **Trigger:** Use when ...
75
+
76
+ | Step | Skill | Output | verify |
77
+ |------|-------|--------|--------|
78
+ | 1 | survey-context | state.yaml handoff | ... |
79
+ | 2 | research-first | Prior Art in SCOPE_LATEST.yaml | ... |
80
+ | 3 | plan-work | epics/eNN-*.yaml tasks | ... |
81
+ ```
@@ -0,0 +1,54 @@
1
+ ---
2
+ name: context7-mcp
3
+ description: "Fetch current library docs via Context7 MCP instead of training data. Use when user asks about frameworks, APIs, setup, or code examples for React, Next.js, Prisma, etc."
4
+ ---
5
+
6
+ # Context7 MCP
7
+
8
+ > **HARD GATE** — Max **3** Context7 tool calls per user question (`resolve-library-id` + `query-docs` count toward the cap). On quota/rate-limit errors, emit an explicit **CONTEXT7_UNAVAILABLE** block — do NOT silently answer from training data.
9
+ >
10
+ > **HARD GATE** — Before HTTP fetch, check `bash scripts/lib/doc-fetch-cache.sh get "<libraryId>:<query>"`. Cache hit within TTL → use cached body (no round-trip). On ETag mismatch after conditional refresh, replace cache entry.
11
+
12
+ ## When to Use
13
+
14
+ - Setup/configuration questions ("How do I configure Next.js middleware?")
15
+ - Code involving libraries ("Write a Prisma query for…")
16
+ - API references ("What are the Supabase auth methods?")
17
+ - User mentions specific frameworks (React, Vue, Svelte, Express, Tailwind, etc.)
18
+
19
+ ## Bounded Retry (max 3x)
20
+
21
+ | Attempt | Action |
22
+ |---------|--------|
23
+ | 1 | `resolve-library-id` → pick best match |
24
+ | 2 | `query-docs` with selected `libraryId` |
25
+ | 3 | Retry `query-docs` once with refined query (narrower scope) |
26
+
27
+ After 3 failures, stop and print:
28
+
29
+ ```
30
+ CONTEXT7_UNAVAILABLE
31
+ Reason: <quota|rate-limit|no-match|timeout>
32
+ Action: Ask user to retry later, paste official docs URL, or run `bts docs <lib>`.
33
+ Do NOT substitute training-data answers without labeling them UNVERIFIED.
34
+ ```
35
+
36
+ ## Fetch Cache (ETag-revalidated)
37
+
38
+ 1. **Cache key:** `"<libraryId>:<normalized-query>"` (lowercase, trimmed).
39
+ 2. **Read:** `bash scripts/lib/doc-fetch-cache.sh get "<key>"` — exit 0 → use cached body.
40
+ 3. **Miss / stale:** call `query-docs`; store via `doc-fetch-cache.sh put`.
41
+ 4. **TTL:** 300s default (`DOC_CACHE_TTL`). Stale entries refresh on next fetch; honor `ETag` when MCP returns it.
42
+
43
+ `bts docs <lib>` shares the same cache helper when invoked from this skill.
44
+
45
+ ## Process
46
+
47
+ 1. `resolve-library-id` with `libraryName` + full user `query`.
48
+ 2. Select match: name similarity, reputation, benchmark score; prefer version-specific IDs when user names a version.
49
+ 3. `query-docs` with `libraryId` + specific question (one concept per call).
50
+ 4. Answer using fetched docs; cite library/version when relevant.
51
+
52
+ ## Verify
53
+
54
+ → verify: `test -f scripts/lib/doc-fetch-cache.sh`
@@ -0,0 +1,195 @@
1
+ ---
2
+ name: craft-skill
3
+ description: "Create new bigpowers skills with proper structure, progressive disclosure, and bundled resources. Use when user wants to create, write, or build a new skill for the bigpowers lifecycle."
4
+ ---
5
+
6
+ # Craft Skill
7
+
8
+ > **HARD GATE** — Do NOT name a skill without a two-word verb-noun pair. Do NOT merge a new skill without running `sync-skills.sh`. Generated `.cursor/rules/` and `.gemini/` artifacts MUST match the source SKILL.md.
9
+
10
+ ## CSO Description Discipline (e45s02)
11
+
12
+ The YAML `description` is the **Catalog Selection Object** — the only field agents see when picking a skill.
13
+
14
+ | Rule | Limit |
15
+ |------|-------|
16
+ | Max length | 1024 characters |
17
+ | Voice | Third person |
18
+ | Content | Capability + `Use when …` triggers only |
19
+ | Forbidden | Workflow steps, phase chains, numbered lists, `→ verify:`, HARD GATE prose |
20
+
21
+ Move process detail into the SKILL.md body or REFERENCE.md — never into `description`.
22
+
23
+ ## Agentic STE body discipline (e79s02)
24
+
25
+ Skill-body instructional prose MUST follow [AGENTIC-STE.md](../../docs/AGENTIC-STE.md).
26
+
27
+ | Rule | Limit |
28
+ |------|-------|
29
+ | Sentence length | ≤20 words per instruction sentence |
30
+ | Voice | Imperative, active |
31
+ | Directive terms | MUST, MUST NOT, NEVER, ALWAYS, DO, DO NOT |
32
+ | Banned modals | should, might, could, may, consider, try, generally, typically |
33
+ | Scope | SKILL.md body only — not YAML `description`, not `terse-mode` output |
34
+
35
+ > **HARD GATE** — Do NOT merge a new or edited skill until `bash scripts/validate-agentic-ste.sh --strict skills/<name>/SKILL.md` exits 0. Fix violations before `sync-skills.sh`.
36
+
37
+ ## Process
38
+
39
+ 1. **Gather requirements** — ask user about:
40
+ - What task/domain does the skill cover?
41
+ - Which use cases must the skill handle?
42
+ - Does it need executable scripts or just instructions?
43
+ - Any reference materials to include?
44
+ - What specs/ output does it produce (if any)?
45
+
46
+ 2. **Verify Principles** — Ensure the skill aligns with [PRINCIPLES.md](../../docs/PRINCIPLES.md):
47
+ - Is it atomic (verb-noun)?
48
+ - Is it "deep" (simple interface, complex internal logic)?
49
+ - Does it include Hard Gates?
50
+ - Is it verifiable with a `.feature` file?
51
+
52
+ 3. **Draft the skill** — create:
53
+ - SKILL.md with concise instructions (see [REFERENCE.md](REFERENCE.md) for template)
54
+ - Additional reference files if content exceeds 100 lines
55
+ - Utility scripts if deterministic operations needed
56
+
57
+ **Auto-skill from library README:** When user provides a library README or API docs URL, extract triggers and HARD GATEs.
58
+ Draft verify commands and specs/ output into SKILL.md. Do NOT invent APIs not in the source.
59
+
60
+ 4. Add `model:` frontmatter (`haiku` | `sonnet` | `opus`) per [model-profiles.md](../../docs/references/model-profiles.md).
61
+
62
+ > **STREAM CONTINUITY** — When writing file content, output in continuous chunks of ~200 lines. Do not pause. Continue immediately until complete. If you need time, emit a placeholder comment rather than going silent.
63
+
64
+ 5. **Review with user** — present draft and ask:
65
+ - Does this cover your use cases?
66
+ - Anything missing or unclear?
67
+ - Does any section need more or less detail?
68
+
69
+ 6. **Completion-honesty gate (HARD GATE — e45s02)** — Before declaring done:
70
+ - Run `bash scripts/validate-skill-description.sh skills/<name>/SKILL.md` — must exit 0
71
+ - Run `bash scripts/validate-agentic-ste.sh --strict skills/<name>/SKILL.md` — must exit 0 (e79s02)
72
+ - Run `bash scripts/sync-skills.sh` — must complete without error
73
+ - Run `bash scripts/run-skill-verify.sh <name>` if the skill defines a verify command
74
+ - Show terminal output for each — narration without evidence is rejected
75
+
76
+ ## Naming Rules
77
+
78
+ Every skill name must be a **two-word verb-noun pair**. See [REFERENCE.md](REFERENCE.md) for full rules, examples, and documented exceptions.
79
+
80
+ ## specs/ Output
81
+
82
+ If the skill produces written output, it goes in `specs/` at the project root. Document the output file path in the skill body and in CONVENTIONS.md's output files table.
83
+
84
+ ## Review Checklist
85
+
86
+ After drafting, verify:
87
+
88
+ - [ ] Name is a two-word verb-noun pair (or follows grill-me exception)
89
+ - [ ] Description < 1024 chars, triggers only, no workflow-summary leakage
90
+ - [ ] Description includes triggers ("Use when...")
91
+ - [ ] SKILL.md under 100 lines
92
+ - [ ] No time-sensitive info
93
+ - [ ] Consistent terminology with CONVENTIONS.md
94
+ - [ ] specs/ output documented if applicable
95
+ - [ ] `validate-skill-description.sh` exits 0
96
+ - [ ] `validate-agentic-ste.sh --strict` exits 0 (e79s02)
97
+ - [ ] `sync-skills.sh` run to propagate to Cursor/Gemini
98
+ - [ ] `bash scripts/validate-skill-catalog.sh` passes for the new skill (HARD GATE — completion honesty)
99
+
100
+ > **HARD GATE** — Do NOT declare the skill done until `bash scripts/validate-skill-catalog.sh --strict --skill <name>` exits 0. Validator enforces verb-noun name, HARD GATE block, description ≤1024 chars, and `→ verify:` command.
101
+
102
+ ## Verify
103
+
104
+ → verify: `bash scripts/validate-skill-catalog.sh --strict --skill craft-skill && bash scripts/validate-skill-description.sh skills/craft-skill/SKILL.md`
105
+
106
+ ---
107
+
108
+ # Craft Skill — Reference
109
+
110
+ ## Naming Rules (full)
111
+
112
+ Every skill name must be a **two-word verb-noun pair**:
113
+ - First word: a verb (survey, model, define, develop, audit…)
114
+ - Second word: a noun from PMBOK 6 / Agile vocabulary (context, domain, language, tdd, code…)
115
+ - Pronounceable in any language, searchable, no noise words, no encodings
116
+ - Exception precedent: `grill-me` — kept for recognizability
117
+
118
+ Good: `survey-context`, `audit-code`, `validate-fix`
119
+ Bad: `context-surveyor`, `code-auditing-skill`, `fix-validator`
120
+
121
+ Any new naming exception requires an entry in CONVENTIONS.md before the skill is published.
122
+
123
+ ## Skill Structure
124
+
125
+ ```
126
+ skill-name/
127
+ ├── SKILL.md # Main instructions (required)
128
+ ├── REFERENCE.md # Detailed docs (if needed)
129
+ ├── EXAMPLES.md # Usage examples (if needed)
130
+ └── scripts/ # Utility scripts (if needed)
131
+ └── helper.sh
132
+ ```
133
+
134
+ ## SKILL.md Template
135
+
136
+ ```md
137
+ ---
138
+ name: skill-name
139
+ description: Brief description of capability. Use when [specific triggers].
140
+ ---
141
+
142
+ # Skill Name
143
+
144
+ ## Quick start
145
+
146
+ [Minimal working example]
147
+
148
+ ## Workflows
149
+
150
+ [Step-by-step processes with checklists for complex tasks]
151
+
152
+ ## Advanced features
153
+
154
+ [Link to separate files: See [REFERENCE.md](REFERENCE.md)]
155
+ ```
156
+
157
+ ## Description Requirements
158
+
159
+ The description is **the only thing your agent sees** when deciding which skill to load.
160
+
161
+ **Format**:
162
+ - Max 1024 chars
163
+ - Write in third person
164
+ - First sentence: what it does
165
+ - Second sentence: "Use when [specific triggers]"
166
+
167
+ **Good example**:
168
+ ```
169
+ Investigate a bug by exploring the codebase to find root cause, then write a TDD-based fix plan to specs/bugs/BUG-*.md. Use when user reports a bug, wants to investigate a problem, or mentions "triage".
170
+ ```
171
+
172
+ ## When to Add Scripts
173
+
174
+ Add utility scripts when:
175
+ - Operation is deterministic (validation, formatting)
176
+ - Same code would be generated repeatedly
177
+ - Errors need explicit handling
178
+
179
+ ## When to Split Files
180
+
181
+ Split into separate files when:
182
+ - SKILL.md exceeds 100 lines
183
+ - Content has distinct domains
184
+ - Advanced features are rarely needed
185
+
186
+ ## sync-skills.sh Propagation
187
+
188
+ After adding a new skill directory with SKILL.md, run `scripts/sync-skills.sh` from the bigpowers repo root. This automatically generates:
189
+ - `.cursor/rules/<name>.mdc` — for Cursor
190
+ - `.gemini/extensions/bigpowers/skills/<name>/SKILL.md` — Agent Skill
191
+ - `.gemini/extensions/bigpowers/commands/<name>.toml` — Slash Command
192
+ - `.gemini/extensions/bigpowers/commands/prompts/<name>.md` — Command Prompt
193
+ - Updated `gemini-extension.json`
194
+
195
+ verify: `bash scripts/sync-skills.sh 2>&1 | grep "skills synced"`
@@ -0,0 +1,259 @@
1
+ ---
2
+ name: deepen-architecture
3
+ description: "Find deepening opportunities in a codebase, informed by the domain language in specs/tech-architecture/tech-stack.md and the decisions in specs/adr/. Use when the user wants to improve architecture, find refactoring opportunities, consolidate tightly-coupled modules, or make a codebase more testable and AI-navigable."
4
+ ---
5
+
6
+ # Deepen Architecture
7
+
8
+ Surface architectural friction and propose **deepening opportunities** — refactors that turn shallow modules into deep ones. The aim is testability and AI-navigability.
9
+
10
+ **Distinct from `define-language` and `model-domain`:** Use this skill to find module-level refactoring opportunities in the codebase. Use `define-language` to produce a canonical glossary of terms. Use `model-domain` to stress-test a plan through a domain-model interview.
11
+
12
+ > **HARD GATE** — Deep modules must solve a forcing function, not just be "nice abstractions." If you cannot articulate why the abstraction exists, it is premature.
13
+
14
+ ## Glossary
15
+
16
+ Use these terms exactly in every suggestion. Consistent language is the point — don't drift into "component," "service," "API," or "boundary." Full definitions in [LANGUAGE.md](LANGUAGE.md).
17
+
18
+ - **Module** — anything with an interface and an implementation (function, class, package, slice).
19
+ - **Interface** — everything a caller must know to use the module: types, invariants, error modes, ordering, config. Not just the type signature.
20
+ - **Implementation** — the code inside.
21
+ - **Depth** — leverage at the interface: a lot of behaviour behind a small interface. **Deep** = high leverage. **Shallow** = interface nearly as complex as the implementation.
22
+ - **Seam** — where an interface lives; a place behaviour can be altered without editing in place. (Use this, not "boundary.")
23
+ - **Adapter** — a concrete thing satisfying an interface at a seam.
24
+ - **Leverage** — what callers get from depth.
25
+ - **Locality** — what maintainers get from depth: change, bugs, knowledge concentrated in one place.
26
+
27
+ Key principles (see [LANGUAGE.md](LANGUAGE.md) for the full list):
28
+
29
+ - **Deletion test**: imagine deleting the module. If complexity vanishes, it was a pass-through. If complexity reappears across N callers, it was earning its keep.
30
+ - **The interface is the test surface.**
31
+ - **One adapter = hypothetical seam. Two adapters = real seam.**
32
+
33
+ This skill is _informed_ by the project's domain model — `specs/tech-architecture/tech-stack.md` and any `specs/adr/`. The domain language gives names to good seams; ADRs record decisions the skill should not re-litigate. See [CONTEXT-FORMAT.md](../model-domain/CONTEXT-FORMAT.md) and [ADR-FORMAT.md](../model-domain/ADR-FORMAT.md).
34
+
35
+ ## Process
36
+
37
+ ### 1. Explore
38
+
39
+ Read existing documentation first:
40
+
41
+ - `specs/tech-architecture/tech-stack.md` (or `specs/tech-architecture/tech-stack.md` + each `specs/tech-architecture/tech-stack.md` in a multi-context repo)
42
+ - Relevant ADRs in `specs/adr/`
43
+
44
+ If any of these files don't exist, proceed silently — don't flag their absence or suggest creating them upfront.
45
+
46
+ **Look-here-first (churn heuristic):** Before organic exploration, rank candidate modules by recent commit frequency. High-churn files are architectural friction magnets — start there.
47
+
48
+ ```bash
49
+ bash scripts/bp-churn-rank.sh --since 90.days --limit 20
50
+ ```
51
+
52
+ Then use the Agent tool with `subagent_type=Explore` to walk the codebase. Don't follow rigid heuristics — explore organically and note where you experience friction:
53
+
54
+ - Where does understanding one concept require bouncing between many small modules?
55
+ - Where are modules **shallow** — interface nearly as complex as the implementation?
56
+ - Where have pure functions been extracted just for testability, but the real bugs hide in how they're called?
57
+ - Where do tightly-coupled modules leak across their seams?
58
+ - Which parts of the codebase are untested, or hard to test through their current interface?
59
+
60
+ Apply the **deletion test** to anything you suspect is shallow.
61
+
62
+ ### 2. Module Depth score
63
+
64
+ For each candidate module, assign a **Module Depth score** (1–5, Ousterhout):
65
+
66
+ | Score | Meaning |
67
+ |-------|---------|
68
+ | 1 | Shallow — interface complexity ≈ implementation |
69
+ | 3 | Balanced |
70
+ | 5 | Deep — small interface, substantial hidden behavior |
71
+
72
+ Include the score in each candidate row. Prioritize score ≤ 2 for deepening.
73
+
74
+ ### 3. Present candidates
75
+
76
+ Present a numbered list of deepening opportunities. For each candidate:
77
+
78
+ - **Files** — which files/modules are involved
79
+ - **Problem** — why the current architecture is causing friction
80
+ - **Solution** — plain English description of what would change
81
+ - **Benefits** — explained in terms of locality and leverage, and how tests would improve
82
+
83
+ **Use `specs/tech-architecture/tech-stack.md` vocabulary for the domain, and [LANGUAGE.md](LANGUAGE.md) vocabulary for the architecture.**
84
+
85
+ **ADR conflicts**: if a candidate contradicts an existing ADR, only surface it when the friction is real enough to warrant revisiting the ADR. Mark it clearly. Don't list every theoretical refactor an ADR forbids.
86
+
87
+ Do NOT propose interfaces yet. Ask the user: "Which of these would you like to explore?"
88
+
89
+ ### 4. Grilling loop
90
+
91
+ Once the user picks a candidate, drop into a grilling conversation. Walk the design tree with them — constraints, dependencies, the shape of the deepened module, what sits behind the seam, what tests survive.
92
+
93
+ Side effects happen inline as decisions crystallize:
94
+
95
+ - **Naming a deepened module after a concept not in `specs/tech-architecture/tech-stack.md`?** Add the term to `specs/tech-architecture/tech-stack.md` — same discipline as `model-domain` (see [CONTEXT-FORMAT.md](../model-domain/CONTEXT-FORMAT.md)). Create the file lazily if it doesn't exist.
96
+ - **Sharpening a fuzzy term during the conversation?** Update `specs/tech-architecture/tech-stack.md` right there.
97
+ - **User rejects the candidate with a load-bearing reason?** Offer an ADR, framed as: _"Want me to record this as an ADR so future architecture reviews don't re-suggest it?"_ Only offer when the reason would actually be needed by a future explorer. See [ADR-FORMAT.md](../model-domain/ADR-FORMAT.md).
98
+ - **Want to explore alternative interfaces for the deepened module?** See [INTERFACE-DESIGN.md](INTERFACE-DESIGN.md).
99
+
100
+ ### 5. Import-boundary hygiene (e45s14)
101
+
102
+ When a deepening move **splits or merges modules**, update `specs/import-boundaries.json` (Playwright `DEPS.list` pattern) — declare which `scripts/lib/*.sh` files may `source` which peers. CI enforces via:
103
+
104
+ ```bash
105
+ bash scripts/check-import-boundaries.sh
106
+ ```
107
+
108
+ Run the check before proposing cross-module `source` edges. Convention docs alone do not authorize new imports; the allowlist must list them.
109
+
110
+ ## Verify
111
+
112
+ → verify: `test -f specs/import-boundaries.json && bash scripts/check-import-boundaries.sh`
113
+
114
+
115
+
116
+ <!-- story: e07s02 -->
117
+
118
+ ---
119
+
120
+ # Deepening
121
+
122
+ How to deepen a cluster of shallow modules safely, given its dependencies. Assumes the vocabulary in [LANGUAGE.md](LANGUAGE.md) — **module**, **interface**, **seam**, **adapter**.
123
+
124
+ ## Dependency categories
125
+
126
+ When assessing a candidate for deepening, classify its dependencies. The category determines how the deepened module is tested across its seam.
127
+
128
+ ### 1. In-process
129
+
130
+ Pure computation, in-memory state, no I/O. Always deepenable — merge the modules and test through the new interface directly. No adapter needed.
131
+
132
+ ### 2. Local-substitutable
133
+
134
+ Dependencies that have local test stand-ins (PGLite for Postgres, in-memory filesystem). Deepenable if the stand-in exists. The deepened module is tested with the stand-in running in the test suite. The seam is internal; no port at the module's external interface.
135
+
136
+ ### 3. Remote but owned (Ports & Adapters)
137
+
138
+ Your own services across a network boundary (microservices, internal APIs). Define a **port** (interface) at the seam. The deep module owns the logic; the transport is injected as an **adapter**. Tests use an in-memory adapter. Production uses an HTTP/gRPC/queue adapter.
139
+
140
+ Recommendation shape: *"Define a port at the seam, implement an HTTP adapter for production and an in-memory adapter for testing, so the logic sits in one deep module even though it's deployed across a network."*
141
+
142
+ ### 4. True external (Mock)
143
+
144
+ Third-party services (Stripe, Twilio, etc.) you don't control. The deepened module takes the external dependency as an injected port; tests provide a mock adapter.
145
+
146
+ ## Seam discipline
147
+
148
+ - **One adapter means a hypothetical seam. Two adapters means a real one.** Don't introduce a port unless at least two adapters are justified (typically production + test). A single-adapter seam is just indirection.
149
+ - **Internal seams vs external seams.** A deep module can have internal seams (private to its implementation, used by its own tests) as well as the external seam at its interface. Don't expose internal seams through the interface just because tests use them.
150
+
151
+ ## Testing strategy: replace, don't layer
152
+
153
+ - Old unit tests on shallow modules become waste once tests at the deepened module's interface exist — delete them.
154
+ - Write new tests at the deepened module's interface. The **interface is the test surface**.
155
+ - Tests assert on observable outcomes through the interface, not internal state.
156
+ - Tests should survive internal refactors — they describe behaviour, not implementation. If a test has to change when the implementation changes, it's testing past the interface.
157
+
158
+ ---
159
+
160
+ # Interface Design
161
+
162
+ When the user wants to explore alternative interfaces for a chosen deepening candidate, use this parallel sub-agent pattern. Based on "Design It Twice" (Ousterhout) — your first idea is unlikely to be the best.
163
+
164
+ Uses the vocabulary in [LANGUAGE.md](LANGUAGE.md) — **module**, **interface**, **seam**, **adapter**, **leverage**.
165
+
166
+ ## Process
167
+
168
+ ### 1. Frame the problem space
169
+
170
+ Before spawning sub-agents, write a user-facing explanation of the problem space for the chosen candidate:
171
+
172
+ - The constraints any new interface would need to satisfy
173
+ - The dependencies it would rely on, and which category they fall into (see [DEEPENING.md](DEEPENING.md))
174
+ - A rough illustrative code sketch to ground the constraints — not a proposal, just a way to make the constraints concrete
175
+
176
+ Show this to the user, then immediately proceed to Step 2. The user reads and thinks while the sub-agents work in parallel.
177
+
178
+ ### 2. Spawn sub-agents
179
+
180
+ Spawn 3+ sub-agents in parallel using the Agent tool. Each must produce a **radically different** interface for the deepened module.
181
+
182
+ Prompt each sub-agent with a separate technical brief (file paths, coupling details, dependency category from [DEEPENING.md](DEEPENING.md), what sits behind the seam). The brief is independent of the user-facing problem-space explanation in Step 1. Give each agent a different design constraint:
183
+
184
+ - Agent 1: "Minimize the interface — aim for 1–3 entry points max. Maximise leverage per entry point."
185
+ - Agent 2: "Maximise flexibility — support many use cases and extension."
186
+ - Agent 3: "Optimise for the most common caller — make the default case trivial."
187
+ - Agent 4 (if applicable): "Design around ports & adapters for cross-seam dependencies."
188
+
189
+ Include both [LANGUAGE.md](LANGUAGE.md) vocabulary and CONTEXT.md vocabulary in the brief so each sub-agent names things consistently with the architecture language and the project's domain language.
190
+
191
+ Each sub-agent outputs:
192
+
193
+ 1. Interface (types, methods, params — plus invariants, ordering, error modes)
194
+ 2. Usage example showing how callers use it
195
+ 3. What the implementation hides behind the seam
196
+ 4. Dependency strategy and adapters (see [DEEPENING.md](DEEPENING.md))
197
+ 5. Trade-offs — where leverage is high, where it's thin
198
+
199
+ ### 3. Present and compare
200
+
201
+ Present designs sequentially so the user can absorb each one, then compare them in prose. Contrast by **depth** (leverage at the interface), **locality** (where change concentrates), and **seam placement**.
202
+
203
+ After comparing, give your own recommendation: which design you think is strongest and why. If elements from different designs would combine well, propose a hybrid. Be opinionated — the user wants a strong read, not a menu.
204
+
205
+ ---
206
+
207
+ # Language
208
+
209
+ Shared vocabulary for every suggestion this skill makes. Use these terms exactly — don't substitute "component," "service," "API," or "boundary." Consistent language is the whole point.
210
+
211
+ ## Terms
212
+
213
+ **Module**
214
+ Anything with an interface and an implementation. Deliberately scale-agnostic — applies equally to a function, class, package, or tier-spanning slice.
215
+ _Avoid_: unit, component, service.
216
+
217
+ **Interface**
218
+ Everything a caller must know to use the module correctly. Includes the type signature, but also invariants, ordering constraints, error modes, required configuration, and performance characteristics.
219
+ _Avoid_: API, signature (too narrow — those refer only to the type-level surface).
220
+
221
+ **Implementation**
222
+ What's inside a module — its body of code. Distinct from **Adapter**: a thing can be a small adapter with a large implementation (a Postgres repo) or a large adapter with a small implementation (an in-memory fake). Reach for "adapter" when the seam is the topic; "implementation" otherwise.
223
+
224
+ **Depth**
225
+ Leverage at the interface — the amount of behaviour a caller (or test) can exercise per unit of interface they have to learn. A module is **deep** when a large amount of behaviour sits behind a small interface. A module is **shallow** when the interface is nearly as complex as the implementation.
226
+
227
+ **Seam** _(from Michael Feathers)_
228
+ A place where you can alter behaviour without editing in that place. The *location* at which a module's interface lives. Choosing where to put the seam is its own design decision, distinct from what goes behind it.
229
+ _Avoid_: boundary (overloaded with DDD's bounded context).
230
+
231
+ **Adapter**
232
+ A concrete thing that satisfies an interface at a seam. Describes *role* (what slot it fills), not substance (what's inside).
233
+
234
+ **Leverage**
235
+ What callers get from depth. More capability per unit of interface they have to learn. One implementation pays back across N call sites and M tests.
236
+
237
+ **Locality**
238
+ What maintainers get from depth. Change, bugs, knowledge, and verification concentrate at one place rather than spreading across callers. Fix once, fixed everywhere.
239
+
240
+ ## Principles
241
+
242
+ - **Depth is a property of the interface, not the implementation.** A deep module can be internally composed of small, mockable, swappable parts — they just aren't part of the interface. A module can have **internal seams** (private to its implementation, used by its own tests) as well as the **external seam** at its interface.
243
+ - **The deletion test.** Imagine deleting the module. If complexity vanishes, the module wasn't hiding anything (it was a pass-through). If complexity reappears across N callers, the module was earning its keep.
244
+ - **The interface is the test surface.** Callers and tests cross the same seam. If you want to test *past* the interface, the module is probably the wrong shape.
245
+ - **One adapter means a hypothetical seam. Two adapters means a real one.** Don't introduce a seam unless something actually varies across it.
246
+
247
+ ## Relationships
248
+
249
+ - A **Module** has exactly one **Interface** (the surface it presents to callers and tests).
250
+ - **Depth** is a property of a **Module**, measured against its **Interface**.
251
+ - A **Seam** is where a **Module**'s **Interface** lives.
252
+ - An **Adapter** sits at a **Seam** and satisfies the **Interface**.
253
+ - **Depth** produces **Leverage** for callers and **Locality** for maintainers.
254
+
255
+ ## Rejected framings
256
+
257
+ - **Depth as ratio of implementation-lines to interface-lines** (Ousterhout): rewards padding the implementation. We use depth-as-leverage instead.
258
+ - **"Interface" as the TypeScript `interface` keyword or a class's public methods**: too narrow — interface here includes every fact a caller must know.
259
+ - **"Boundary"**: overloaded with DDD's bounded context. Say **seam** or **interface**.
@@ -0,0 +1,79 @@
1
+ ---
2
+ name: define-language
3
+ description: "Extract a DDD-style ubiquitous language glossary from the current conversation, flagging ambiguities and proposing canonical terms. Saves to specs/UBIQUITOUS_LANGUAGE_LATEST.md. Use when user wants to define domain terms, build a glossary, harden terminology, create a ubiquitous language, or mentions \"domain model\" or \"DDD\"."
4
+ ---
5
+
6
+ # Define Language
7
+
8
+ Extract and formalize domain terminology from the current conversation into a consistent glossary, saved to `specs/UBIQUITOUS_LANGUAGE_LATEST.md`.
9
+
10
+ **Distinct from `model-domain` and `deepen-architecture`:** Use this skill to produce a canonical glossary of terms (words and definitions). Use `model-domain` to stress-test a plan through an interview that resolves domain model decisions. Use `deepen-architecture` to find module-level refactoring opportunities in the codebase.
11
+
12
+ > **HARD GATE** — Ubiquitous language is NOT optional. Every term in the domain that could be misunderstood must be glossed. Ambiguity = rework.
13
+
14
+ ## Process
15
+
16
+ 1. **Scan the conversation** for domain-relevant nouns, verbs, and concepts
17
+ 2. **Identify problems**:
18
+ - Same word used for different concepts (ambiguity)
19
+ - Different words used for the same concept (synonyms)
20
+ - Vague or overloaded terms
21
+ 3. **Propose a canonical glossary** with opinionated term choices
22
+ 4. **Write to `specs/UBIQUITOUS_LANGUAGE_LATEST.md`** in the working directory using the format below
23
+ 5. **Output a summary** inline in the conversation
24
+
25
+ ## Output Format
26
+
27
+ Write a `specs/UBIQUITOUS_LANGUAGE_LATEST.md` file with this structure:
28
+
29
+ ```md
30
+ # Ubiquitous Language
31
+
32
+ ## Order lifecycle
33
+
34
+ | Term | Definition | Aliases to avoid |
35
+ | ----------- | ------------------------------------------------------- | --------------------- |
36
+ | **Order** | A customer's request to purchase one or more items | Purchase, transaction |
37
+ | **Invoice** | A request for payment sent to a customer after delivery | Bill, payment request |
38
+
39
+ ## People
40
+
41
+ | Term | Definition | Aliases to avoid |
42
+ | ------------ | ------------------------------------------- | ---------------------- |
43
+ | **Customer** | A person or organization that places orders | Client, buyer, account |
44
+ | **User** | An authentication identity in the system | Login, account |
45
+
46
+ ## Relationships
47
+
48
+ - An **Invoice** belongs to exactly one **Customer**
49
+ - An **Order** produces one or more **Invoices**
50
+
51
+ ## Example dialogue
52
+
53
+ > **Dev:** "When a **Customer** places an **Order**, do we create the **Invoice** immediately?"
54
+ > **Domain expert:** "No — an **Invoice** is only generated once a **Fulfillment** is confirmed."
55
+
56
+ ## Flagged ambiguities
57
+
58
+ - "account" was used to mean both **Customer** and **User** — these are distinct concepts.
59
+ ```
60
+
61
+ ## Rules
62
+
63
+ - **Be opinionated.** When multiple words exist for the same concept, pick the best one and list the others as aliases to avoid.
64
+ - **Flag conflicts explicitly.** If a term is used ambiguously, call it out in "Flagged ambiguities" with a clear recommendation.
65
+ - **Only include terms relevant for domain experts.** Skip names of modules or classes unless they have domain meaning.
66
+ - **Keep definitions tight.** One sentence max. Define what it IS, not what it does.
67
+ - **Show relationships.** Use bold term names and express cardinality where obvious.
68
+ - **Group terms into multiple tables** when natural clusters emerge. One table is fine if terms are cohesive.
69
+ - **Write an example dialogue.** 3–5 exchanges between a dev and domain expert showing terms used precisely.
70
+
71
+ ## Re-running
72
+
73
+ When invoked again in the same conversation:
74
+
75
+ 1. Read the existing `specs/UBIQUITOUS_LANGUAGE_LATEST.md`
76
+ 2. Incorporate any new terms from subsequent discussion
77
+ 3. Update definitions if understanding has evolved
78
+ 4. Re-flag any new ambiguities
79
+ 5. Rewrite the example dialogue to incorporate new terms