bigpowers 2.87.4 → 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 (258) 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 +7 -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/test-install-helpers.js +31 -0
@@ -0,0 +1,95 @@
1
+ ---
2
+ name: hook-commits
3
+ model: haiku
4
+ description: "Set up pre-commit hooks with lint-staged (Prettier), type checking, and tests in the current repo. Use when user wants to add pre-commit hooks, set up Husky, configure lint-staged, or add commit-time formatting/typechecking/testing."
5
+ disable-model-invocation: true
6
+ ---
7
+
8
+ # Hook Commits
9
+ > **HARD GATE** — **HARD GATE** — Pre-commit and commit-msg hooks must run before any commit lands. Skipping hooks (`--no-verify`) is forbidden unless explicitly authorized for a specific commit and documented.
10
+
11
+
12
+ ## What This Sets Up
13
+
14
+ - **Husky** pre-commit hook
15
+ - **lint-staged** running Prettier on all staged files
16
+ - **Prettier** config (if missing)
17
+ - **typecheck** and **test** scripts in the pre-commit hook
18
+
19
+ ## Steps
20
+
21
+ ### 1. Detect package manager
22
+
23
+ Check for `package-lock.json` (npm), `pnpm-lock.yaml` (pnpm), `yarn.lock` (yarn), `bun.lockb` (bun). Use whichever is present. Default to npm if unclear.
24
+
25
+ ### 2. Install dependencies
26
+
27
+ Install as devDependencies:
28
+
29
+ ```
30
+ husky lint-staged prettier
31
+ ```
32
+
33
+ ### 3. Initialize Husky
34
+
35
+ ```bash
36
+ npx husky init
37
+ ```
38
+
39
+ This creates `.husky/` dir and adds `prepare: "husky"` to package.json.
40
+
41
+ ### 4. Create `.husky/pre-commit`
42
+
43
+ Write this file (no shebang needed for Husky v9+):
44
+
45
+ ```
46
+ npx lint-staged
47
+ npm run typecheck
48
+ npm run test
49
+ ```
50
+
51
+ **Adapt**: Replace `npm` with detected package manager. If repo has no `typecheck` or `test` script in package.json, omit those lines and tell the user.
52
+
53
+ ### 5. Create `.lintstagedrc`
54
+
55
+ ```json
56
+ {
57
+ "*": "prettier --ignore-unknown --write"
58
+ }
59
+ ```
60
+
61
+ ### 6. Create `.prettierrc` (if missing)
62
+
63
+ Only create if no Prettier config exists. Use these defaults:
64
+
65
+ ```json
66
+ {
67
+ "useTabs": false,
68
+ "tabWidth": 2,
69
+ "printWidth": 80,
70
+ "singleQuote": false,
71
+ "trailingComma": "es5",
72
+ "semi": true,
73
+ "arrowParens": "always"
74
+ }
75
+ ```
76
+
77
+ ### 7. Verify
78
+
79
+ - [ ] `.husky/pre-commit` exists and is executable
80
+ - [ ] `.lintstagedrc` exists
81
+ - [ ] `prepare` script in package.json is `"husky"`
82
+ - [ ] `prettier` config exists
83
+ - [ ] Run `npx lint-staged` to verify it works
84
+
85
+ ### 8. Commit
86
+
87
+ Stage all changed/created files and commit with message: `chore: add pre-commit hooks (husky + lint-staged + prettier)`
88
+
89
+ This will run through the new pre-commit hooks — a good smoke test that everything works.
90
+
91
+ ## Notes
92
+
93
+ - Husky v9+ doesn't need shebangs in hook files
94
+ - `prettier --ignore-unknown` skips files Prettier can't parse (images, etc.)
95
+ - The pre-commit runs lint-staged first (fast, staged-only), then full typecheck and tests
@@ -0,0 +1,107 @@
1
+ ---
2
+ name: inspect-quality
3
+ model: sonnet
4
+ description: "Interactive QA session where user reports bugs or issues conversationally, and the agent logs them to specs/bugs/registry.yaml with a structured audit schema. Explores the codebase in the background for context and domain language. Use when user wants to report bugs, do QA, or mentions \"QA session\"."
5
+ disable-model-invocation: true
6
+ ---
7
+
8
+ # Inspect Quality
9
+ > **HARD GATE** — **HARD GATE** — Quality metrics (coverage, lint, cyclomatic complexity, security scans) must be monitored. If a metric degrades, surface it as a blocker. Do NOT accept regressions.
10
+
11
+
12
+ Run an interactive QA session. The user describes problems they're encountering. You clarify, explore the codebase for context, and log each issue to `specs/bugs/registry.yaml` with a structured, durable format.
13
+
14
+ ## For each issue the user raises
15
+
16
+ ### 1. Listen and lightly clarify
17
+
18
+ Let the user describe the problem in their own words. Ask **at most 2–3 short clarifying questions** focused on:
19
+
20
+ - What they expected vs what actually happened
21
+ - Steps to reproduce (if not obvious)
22
+ - Whether it's consistent or intermittent
23
+
24
+ Do NOT over-interview. If the description is clear enough to log, move on.
25
+
26
+ ### 2. Explore the codebase in the background
27
+
28
+ Kick off an Agent (subagent_type=Explore) to understand the relevant area. The goal is NOT to find a fix — it's to:
29
+
30
+ - Learn the domain language used in that area (check `specs/UBIQUITOUS_LANGUAGE_LATEST.md` if present)
31
+ - Understand what the feature is supposed to do
32
+ - Identify the user-facing behavior boundary
33
+
34
+ ### 3. Assess scope: single issue or breakdown?
35
+
36
+ Break down when:
37
+
38
+ - The fix spans multiple independent areas
39
+ - There are clearly separable concerns that could be worked on in parallel
40
+ - The user describes something with multiple distinct failure modes
41
+
42
+ Keep as a single issue when:
43
+
44
+ - It's one behavior that's wrong in one place
45
+ - The symptoms are all caused by the same root behavior
46
+
47
+ ### 4. Log to specs/bugs/registry.yaml
48
+
49
+ Append the issue to `specs/bugs/registry.yaml`. Create the `specs/bugs/` directory if it doesn't exist.
50
+
51
+ #### registry.yaml format
52
+
53
+ The file maintains a Markdown table with the following columns (derived from structured audit practice):
54
+
55
+ | Field | Description |
56
+ |-------|-------------|
57
+ | `bug_id` | `BUG-YYYY-MM-DDTHHMMSS` |
58
+ | `date` | `YYYY-MM-DD` |
59
+ | `severity` | `critical` / `high` / `medium` / `low` |
60
+ | `priority` | `p0` / `p1` / `p2` / `p3` |
61
+ | `scope` | kebab-case area (e.g. `auth`, `checkout`) |
62
+ | `what_happened` | actual behavior (user-facing terms) |
63
+ | `what_expected` | expected behavior |
64
+ | `steps_to_reproduce` | numbered steps |
65
+ | `root_cause` | one-line hypothesis |
66
+ | `files_changed` | filled in after fix |
67
+ | `approach` | filled in after fix |
68
+ | `risk_level` | `low` / `medium` / `high` |
69
+ | `new_tests` | count (filled in after fix) |
70
+ | `type_check` | `pass` / `fail` (filled in after fix) |
71
+ | `lint` | `pass` / `fail` (filled in after fix) |
72
+ | `commit_type` | `fix` / `fix!` / `feat` (filled in after fix) |
73
+ | `release_type` | `patch` / `minor` / `major` (filled in after fix) |
74
+ | `commit_message` | Conventional Commits message (filled in after fix) |
75
+ | `follow_ups` | semicolon-separated follow-up items |
76
+ | `file` | path to detailed `specs/bugs/BUG-*.md` (filled in by investigate-bug) |
77
+ | `status` | `open` / `in-progress` / `fixed` / `wont-fix` |
78
+
79
+ When a bug is fixed (via `validate-fix`), update the relevant row with the resolution fields.
80
+
81
+ #### Issue body (for context below the table)
82
+
83
+ For each bug, also append a detail section:
84
+
85
+ ```markdown
86
+ ### BUG-YYYY-MM-DDTHHMMSS: [short title]
87
+
88
+ **What happened:** [actual behavior, plain language]
89
+ **What I expected:** [expected behavior]
90
+ **Steps to reproduce:**
91
+ 1. [Step 1]
92
+ 2. [Step 2]
93
+
94
+ **Additional context:** [domain-language observations, no file paths]
95
+ ```
96
+
97
+ #### Rules for all entries
98
+
99
+ - **bug_id** uses full timestamp: `BUG-YYYY-MM-DDTHHMMSS` — matches the individual bug file name in `specs/bugs/`
100
+ - **No file paths or line numbers** — these go stale
101
+ - **Use the project's domain language** (check `specs/UBIQUITOUS_LANGUAGE_LATEST.md` if it exists)
102
+ - **Describe behaviors, not code** — "the sync service fails to apply the patch" not "applyPatch() throws"
103
+ - **Reproduction steps are mandatory** — if you can't determine them, ask the user
104
+
105
+ ### 5. Continue the session
106
+
107
+ After logging, ask: "Next issue, or are we done?" Keep going until the user says done. Each issue is independent — don't batch them.
@@ -0,0 +1,128 @@
1
+ ---
2
+ name: investigate-bug
3
+ model: sonnet
4
+ description: "Investigate a bug or issue 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, mentions \"triage\", or wants to plan a fix."
5
+ disable-model-invocation: true
6
+ ---
7
+
8
+ # Investigate Bug
9
+
10
+ **Boundary**: End-to-end bug entry point — history check → RCA (via `diagnose-root`) → fix approach → TDD plan → bug file. Delegates the 4-phase RCA to `diagnose-root`; does not re-implement it.
11
+
12
+ Investigate a reported problem, find its root cause, and write a TDD fix plan to `specs/bugs/BUG-*.md`. This is a mostly hands-off workflow — minimize questions to the user.
13
+
14
+ ## Process
15
+
16
+ ### 0. Read previous bug history
17
+
18
+ Before starting diagnosis:
19
+
20
+ 1. Read `specs/bugs/registry.yaml` (if it exists) — check for prior bugs in the same `scope` or with similar symptoms.
21
+ 2. If a relevant prior bug is found, read the corresponding `specs/bugs/BUG-*.md` file to understand previous root cause analysis and fix approach.
22
+ 3. Note in your investigation whether this is a recurrence, a related issue, or novel.
23
+
24
+ ### 1. Capture the problem
25
+
26
+ Get a brief description of the issue from the user. If they haven't provided one, ask ONE question: "What's the problem you're seeing?"
27
+
28
+ Do NOT ask follow-up questions yet. Start investigating immediately.
29
+
30
+ > **Security-impact assessment** — After capturing the problem, assess and document: `Security impact: NONE / LOW / MEDIUM / HIGH / CRITICAL`. If HIGH or CRITICAL, assign bug severity HIGH and document the exploit path in findings. If MEDIUM+, include exploit path in the bug file. Document "no security exploit path identified" for NONE/LOW.
31
+
32
+ ### 2. Explore and diagnose (4-phase RCA)
33
+
34
+ Run the 4-phase root-cause analysis via the `diagnose-root` skill (Reproduce → Isolate → Hypothesize → Verify). That skill is the canonical RCA engine — do not re-implement the phases here.
35
+
36
+ Also look at:
37
+ - Recent changes to affected files (`git log --oneline <file>`)
38
+ - Existing tests (what's tested, what's missing)
39
+ - Similar patterns elsewhere in the codebase that work correctly
40
+
41
+ > **HARD GATE** — Do NOT proceed to Step 3 (Fix Approach) until `diagnose-root` Phase 4 produces a verified root cause. "It probably is X" is not verified.
42
+
43
+ ### 3. Identify the fix approach
44
+
45
+ Based on your investigation, determine:
46
+
47
+ - The minimal change needed to fix the root cause
48
+ - Which modules/interfaces are affected
49
+ - What behaviors need to be verified via tests
50
+ - Whether this is a regression, missing feature, or design flaw
51
+ - Risk level: Low / Medium / High
52
+
53
+ ### 4. Design TDD fix plan
54
+
55
+ Create a concrete, ordered list of RED-GREEN cycles. Each cycle is one vertical slice:
56
+
57
+ - **RED**: Describe a specific test that captures the broken/missing behavior
58
+ - **GREEN**: Describe the minimal code change to make that test pass
59
+
60
+ Rules:
61
+ - Tests verify behavior through public interfaces, not implementation details
62
+ - One test at a time, vertical slices (NOT all tests first, then all code)
63
+ - Each test should survive internal refactors
64
+ - Include a final refactor step if needed
65
+ - **Durability**: Only suggest fixes that would survive radical codebase changes. Tests assert on observable outcomes (API responses, UI state, user-visible effects), not internal state.
66
+
67
+ ### 5. Write the bug file
68
+
69
+ Save the investigation and fix plan to `specs/bugs/BUG-NNN-slug.md`. Create the `specs/bugs/` directory if it doesn't exist.
70
+
71
+ After writing, append a row to `specs/bugs/registry.yaml` with: bug_id (same timestamp), date, severity, priority, scope, summary, and file path. Create `specs/bugs/registry.yaml` if it doesn't exist.
72
+
73
+ <diagnosis-template>
74
+
75
+ # BUG-YYYY-MM-DDTHHMMSS: [short title]
76
+
77
+ ## Problem
78
+
79
+ A clear description of the bug or issue, including:
80
+ - What happens (actual behavior)
81
+ - What should happen (expected behavior)
82
+ - How to reproduce (if applicable)
83
+
84
+ ## Root Cause Analysis
85
+
86
+ Describe what you found during investigation:
87
+ - The code path involved
88
+ - Why the current code fails
89
+ - Any contributing factors
90
+ - Risk level: Low / Medium / High
91
+
92
+ Do NOT include specific file paths, line numbers, or implementation details that couple to current code layout. Describe modules, behaviors, and contracts instead.
93
+
94
+ ## TDD Fix Plan
95
+
96
+ A numbered list of RED-GREEN cycles:
97
+
98
+ 1. **RED**: Write a test that [describes expected behavior]
99
+ **GREEN**: [Minimal change to make it pass]
100
+ **verify**: [runnable command]
101
+
102
+ 2. **RED**: Write a test that [describes next behavior]
103
+ **GREEN**: [Minimal change to make it pass]
104
+ **verify**: [runnable command]
105
+
106
+ **REFACTOR**: [Any cleanup needed after all tests pass]
107
+
108
+ ## Acceptance Criteria
109
+
110
+ - [ ] Criterion 1
111
+ - [ ] Criterion 2
112
+ - [ ] All new tests pass
113
+ - [ ] Existing tests still pass
114
+
115
+ ## Resolution
116
+
117
+ <!-- filled in by validate-fix -->
118
+
119
+ </diagnosis-template>
120
+
121
+ After writing the bug file, print a one-line summary of the root cause and suggest running `kickoff-branch` next to create a fix branch.
122
+
123
+ ## References
124
+
125
+ <!-- story: e35s10 -->
126
+
127
+ - [Feathers' Seams & Characterization Tests](../../docs/references/feathers.md) — seam types, characterization tests, and the legacy code change algorithm
128
+ - [Fowler's Code Smells](../../docs/references/fowler.md) — identifying structural problems by smell before investigating
@@ -0,0 +1,144 @@
1
+ ---
2
+ name: kickoff-branch
3
+ model: haiku
4
+ description: "Create a git worktree and feature branch, then verify a clean test baseline before any code is written. Use when starting a new feature or task, when user wants to work in isolation from main, or mentions \"start a branch\" or \"new worktree\"."
5
+ disable-model-invocation: true
6
+ ---
7
+
8
+ # story: e51s03
9
+ # story: e20s03
10
+
11
+
12
+ # Kickoff Branch
13
+
14
+ > **HARD GATE** — Direct work on `main` or `master` is PROHIBITED. Every task MUST start with this skill to create a feature branch or worktree.
15
+ >
16
+ > **HARD GATE** — Do NOT proceed with development until **Preflight** passes on the default branch. Red Preflight blocks branch creation and all forward work — invoke `quick-fix` or `fix-bug` per CONVENTIONS § Discovered Defects.
17
+
18
+ Create an isolated working environment before touching any code. **Preflight must be green** before you write feature code — solo-default owns the whole tree, not just the current task diff.
19
+
20
+ ## Process
21
+
22
+ ### 1. Confirm task name
23
+
24
+ Ask if not already known: "What's the name of this feature or task?" Use it as the branch name slug (kebab-case, max 40 chars).
25
+
26
+ ### 2. Anchor on default branch (main or master)
27
+
28
+ > **HARD GATE** — Kickoff MUST start from an updated, clean default branch in the **primary** repository root (not a linked worktree).
29
+
30
+ ```bash
31
+ # Detect default branch
32
+ DEFAULT=$(git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@' || echo main)
33
+
34
+ git checkout "$DEFAULT"
35
+ git pull --ff-only origin "$DEFAULT" # skip if no remote
36
+ git status # working tree MUST be clean
37
+ git log --oneline -5
38
+ ```
39
+
40
+ **Spec-only pre-kickoff** — before enforcing the clean-tree gate, check whether dirty files are spec artifacts:
41
+
42
+ ```bash
43
+ DIRTY=$(git status --porcelain | awk '{print $2}')
44
+ NON_SPEC=$(echo "$DIRTY" | grep -v '^specs/' || true)
45
+
46
+ if [ -z "$DIRTY" ]; then
47
+ : # clean — proceed
48
+ elif [ -z "$NON_SPEC" ]; then
49
+ # spec-only dirty tree — offer auto-commit
50
+ echo "Dirty spec artifacts: $(echo $DIRTY | tr '\n' ' ')"
51
+ read -p "Commit spec artifacts before kickoff? [Y/n]: " CONFIRM
52
+ CONFIRM=${CONFIRM:-Y}
53
+ if [[ "$CONFIRM" =~ ^[Yy] ]]; then
54
+ git add specs/
55
+ git commit -m "chore(state): checkpoint before kickoff"
56
+ fi
57
+ else
58
+ echo "Dirty tree: $NON_SPEC (not a spec artifact). Stash or commit before proceeding."
59
+ exit 1
60
+ fi
61
+ ```
62
+
63
+ - **Spec artifacts** match `specs/` — state.yaml, epics YAMLs, execution-status.yaml, etc.
64
+ - **Non-spec dirty files** (src/, scripts/, SKILL.md, …) still enforce the full clean-tree gate.
65
+ - If not on `$DEFAULT` after checkout, stop and fix before continuing.
66
+
67
+ ### 3. Pre-flight & Conflict Resolution
68
+
69
+ Before creating the worktree, verify the target environment is clean:
70
+
71
+ ```bash
72
+ # 1. Check for existing directory
73
+ ls -d ../<task-slug> 2>/dev/null
74
+
75
+ # 2. Check for existing branch
76
+ git branch --list <task-slug>
77
+
78
+ # 3. Check for "ghost" worktrees (metadata exists but directory is gone)
79
+ git worktree list | grep "<task-slug>"
80
+ ```
81
+
82
+ **Handling Conflicts:**
83
+ - **Directory exists:** If `../<task-slug>` already exists, ask the user if they want to use it or delete it.
84
+ - **Branch exists:** If the branch exists but no worktree is attached, ask to use the existing branch (`git worktree add ../<task-slug> <task-slug>`) or delete it.
85
+ - **Ghost worktree:** If `git worktree list` shows the path but the directory is missing, run `git worktree prune` to clear the stale metadata. `bash scripts/cleanup-worktrees.sh` does this plus reports any worktree whose branch is already merged or deleted — advisory only, it prints the `git worktree remove`/`git branch -d` commands rather than running them, so review before acting.
86
+
87
+ ### 4. Create worktree + branch
88
+
89
+ ```bash
90
+ # From the main repo root (not another worktree)
91
+ git worktree add ../<task-slug> -b <task-slug>
92
+ cd ../<task-slug>
93
+ ```
94
+
95
+ If the user prefers a branch without a worktree:
96
+ ```bash
97
+ git checkout -b <task-slug>
98
+ ```
99
+
100
+ ### 4. Verify clean baseline
101
+
102
+ > **HARD GATE (e39s02):** Acquire story lock in `specs/agent-locks.yaml` before running tests.
103
+
104
+ ```bash
105
+ LOCK="specs/agent-locks.yaml"; STORY="<story-id>"
106
+ if [ -f "$LOCK" ]; then
107
+ python3 -c "
108
+ import yaml,sys,datetime
109
+ d=yaml.safe_load(open('$LOCK'))or{'locks':[]}
110
+ for l in d['locks']:
111
+ if l['story_id']=='$STORY':print(f'LOCKED by {l[\"locked_by\"]} at {l[\"locked_at\"]}');sys.exit(1)
112
+ d['locks'].append({'story_id':'$STORY','locked_by':'agent: build-epic','locked_at':datetime.datetime.utcnow().strftime('%Y-%m-%dT%H:%M:%SZ'),'files_touched':[]})
113
+ yaml.dump(d,open('$LOCK','w'),default_flow_style=False)
114
+ print(f'LOCK ACQUIRED: $STORY')
115
+ "
116
+ fi
117
+ ```
118
+
119
+ If locked: abort. If unlocked: entry added, proceed.
120
+
121
+ Run **Preflight** (from `CLAUDE.md` Commands table, or `BP_PREFLIGHT` from `bash scripts/bp-read-agents.sh`) and confirm green before writing any code:
122
+
123
+ ```bash
124
+ # Preflight — project's full local verification stack
125
+ # bigpowers example:
126
+ npm run compliance && bash scripts/run-verification-gates.sh
127
+
128
+ # Or project-specific from CLAUDE.md / AGENTS.md
129
+ ```
130
+
131
+ - [ ] Preflight passes (all chained gates green)
132
+ - [ ] No type errors (`npm run typecheck` or equivalent, if not in Preflight)
133
+ - [ ] No lint errors (`npm run lint` or equivalent, if not in Preflight)
134
+
135
+ If Preflight is red, **stop** — route to `quick-fix` or `fix-bug`. Fix before kickoff continues.
136
+
137
+ ### 5. Confirm readiness
138
+
139
+ Report: `✓ Preflight green` + branch + worktree. Suggest next: `develop-tdd` or `execute-plan`.
140
+
141
+ ## Handoff
142
+
143
+ Gate: READY -> next: develop-tdd
144
+ Writes: state.yaml handoff.next_skill = develop-tdd
@@ -0,0 +1,65 @@
1
+ ---
2
+ name: maintain-wiki
3
+ model: haiku
4
+ description: "Agent-maintained OKF wiki — INGEST source docs, LINT for issues, QUERY across concept pages. Run as part of build-epic Step 8 and verify-work Phase 3."
5
+ disable-model-invocation: true
6
+ ---
7
+
8
+ # Maintain Wiki
9
+
10
+ Three operations for keeping the OKF wiki bundle consistent with its source docs.
11
+
12
+ ## INGEST
13
+
14
+ Read source doc (CLAUDE.md, CONVENTIONS.md, or SKILL.md) and write/update OKF concept pages:
15
+
16
+ ```bash
17
+ # Regenerate skills-wiki from SKILL.md files
18
+ bash scripts/sync-skills.sh --okf
19
+
20
+ # Regenerate conventions-wiki from CONVENTIONS.md
21
+ bash scripts/decompose-conventions.sh
22
+
23
+ # Regenerate agent-guide from CLAUDE.md
24
+ bash scripts/generate-agent-guide.sh
25
+ ```
26
+
27
+ ## LINT
28
+
29
+ Check for common OKF issues:
30
+
31
+ 1. **Stale concepts** — source file mtime vs concept page mtime. If source is newer, concept is stale.
32
+ 2. **Orphan concepts** — concept page exists but source doc section no longer exists.
33
+ 3. **Missing cross-references** — skill concept pages with no `enforced_by` or `references` links.
34
+ 4. **Contradictions** — two concept pages that make opposite claims about the same topic.
35
+ 5. **Broken links** — internal OKF links that point to non-existent concept pages.
36
+
37
+ ```bash
38
+ # Quick stale check: compare source vs concept mtimes
39
+ for page in specs/skills-wiki/skills/*.md; do
40
+ skill=$(basename "$page" .md)
41
+ source="skills/$skill/SKILL.md"
42
+ if [ -f "$source" ] && [ "$page" -ot "$source" ]; then
43
+ echo "STALE: $skill (SKILL.md newer than concept page)"
44
+ fi
45
+ done
46
+ ```
47
+
48
+ ## QUERY
49
+
50
+ Search across OKF concept pages to answer questions:
51
+
52
+ ```bash
53
+ # Find all concepts about a topic
54
+ grep -rl "topic" specs/skills-wiki/ specs/conventions-wiki/ specs/agent-guide/
55
+
56
+ # Trace a convention → enforcing skills
57
+ grep -A1 "enforced_by" specs/conventions-wiki/*.md
58
+
59
+ # Find skill by description keyword
60
+ grep -ril "keyword" specs/skills-wiki/skills/*.md
61
+ ```
62
+
63
+ ## Verify
64
+
65
+ → verify: `test -d specs/skills-wiki && test -d specs/conventions-wiki && test -d specs/agent-guide`
@@ -0,0 +1,72 @@
1
+ ---
2
+ name: map-codebase
3
+ model: sonnet
4
+ description: "Derives the tech-stack doc from scratch by scanning the codebase — analyzes stack, architecture, and gray areas (error handling, API shapes) and persists findings into specs/tech-architecture/tech-stack.md. Run when the tech doc doesn't exist yet; use survey-context to consume it once it does."
5
+ disable-model-invocation: true
6
+ ---
7
+
8
+ # Map Codebase
9
+
10
+ Perform a deep architectural and structural analysis of the codebase. Unlike `survey-context` which identifies "where we are", `map-codebase` identifies "what we are dealing with" and "how things are done".
11
+
12
+ > **Use this vs survey-context:** `map-codebase` BUILDS the tech-stack doc by scanning the codebase from scratch. `survey-context` READS existing specs/tech-architecture docs without re-deriving them. Run `map-codebase` when `specs/tech-architecture/tech-stack.md` doesn't exist yet; run `survey-context` when it does.
13
+
14
+ > **HARD GATE** — Cold analysis only. Do NOT assume architectural patterns without reading the code. If the codebase structure surprises you, call out the delta.
15
+
16
+ ## Process
17
+
18
+ ### 1. Identify Core Stack & Dependencies
19
+ - Scan `package.json`, `Cargo.toml`, `requirements.txt`, etc.
20
+ - Identify primary framework, runtime, and critical libraries (ORM, Auth, State, UI).
21
+ - Note version constraints and any deprecated or unusual dependencies.
22
+
23
+ ### 2. Map High-Level Architecture
24
+ - Identify the entry points (CLI, Web, API).
25
+ - Map the primary data flow (e.g., Controller → Service → Repository).
26
+ - Identify where business logic lives vs. where I/O lives.
27
+ - Look for established patterns (e.g., hexagonal, layered, feature-folders).
28
+
29
+ ### 3. Analyze "Gray Areas" (The "How")
30
+ Search for patterns and anti-patterns in these categories:
31
+ - **Error Handling:** Are exceptions caught early or bubbled? Is there a global error handler? Are error messages structured?
32
+ - **API Shapes:** Is it REST, GraphQL, or RPC? What is the casing (camelCase, snake_case)? How are responses structured?
33
+ - **Type Safety:** Is it strictly typed? Are there many `any` or `unsafe` blocks? Are interfaces used for DIP?
34
+ - **Observability:** Is there structured logging? Are there health checks? Where do logs go?
35
+ - **Testing:** What is the test coverage strategy? Are mocks used? Where do tests live?
36
+
37
+ ### 4. Identify Planning "Signals"
38
+ Look for signals that will influence upcoming plans:
39
+ - **Consistency Gaps:** "Half the project uses async/await, the other half uses Promises."
40
+ - **Debt Hotspots:** "The `AuthManager` is 1500 lines and handles both JWT and session logic."
41
+ - **Integration Points:** "We need to talk to the Stripe API, but there's no wrapper yet."
42
+ - **Conventions:** "The team always uses functional components over classes."
43
+
44
+ ### 5. Persist to specs/tech-architecture/tech-stack.md
45
+ Compile all findings into `specs/tech-architecture/tech-stack.md`. This file serves as the project's "Long-Term Memory".
46
+
47
+ ```markdown
48
+ # Project Context
49
+
50
+ ## Stack
51
+ - [Framework/Language]
52
+ - [Key Libraries]
53
+
54
+ ## Architecture
55
+ - [Pattern Description]
56
+ - [Data Flow]
57
+
58
+ ## Conventions (Observed)
59
+ - [Error Handling Pattern]
60
+ - [API Design]
61
+ - [Type System]
62
+
63
+ ## Signals / Active Considerations
64
+ - [Gap 1]
65
+ - [Hotspot 2]
66
+ ```
67
+
68
+ ## When to Use
69
+ - When first joining a project.
70
+ - Before a major refactor or architectural change.
71
+ - When `survey-context` reveals a lack of domain knowledge.
72
+ - To refresh `specs/tech-architecture/tech-stack.md` after significant changes.