qualia-framework 2.5.1 → 3.1.0

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 (327) hide show
  1. package/CLAUDE.md +63 -0
  2. package/README.md +108 -30
  3. package/agents/builder.md +110 -0
  4. package/agents/planner.md +186 -0
  5. package/agents/qa-browser.md +186 -0
  6. package/agents/verifier.md +369 -0
  7. package/bin/cli.js +706 -417
  8. package/bin/install.js +622 -0
  9. package/bin/qualia-ui.js +284 -0
  10. package/bin/state.js +824 -0
  11. package/bin/statusline.js +252 -0
  12. package/docs/erp-contract.md +161 -0
  13. package/guide.md +63 -0
  14. package/hooks/auto-update.js +117 -0
  15. package/hooks/block-env-edit.js +52 -0
  16. package/hooks/branch-guard.js +68 -0
  17. package/hooks/migration-guard.js +83 -0
  18. package/hooks/pre-compact.js +52 -0
  19. package/hooks/pre-deploy-gate.js +149 -0
  20. package/hooks/pre-push.js +53 -0
  21. package/hooks/session-start.js +126 -0
  22. package/package.json +31 -17
  23. package/rules/design-reference.md +179 -0
  24. package/rules/frontend.md +126 -0
  25. package/rules/infrastructure.md +87 -0
  26. package/skills/qualia/SKILL.md +88 -0
  27. package/skills/qualia-build/SKILL.md +115 -0
  28. package/skills/qualia-debug/SKILL.md +87 -0
  29. package/skills/qualia-design/SKILL.md +99 -0
  30. package/skills/qualia-handoff/SKILL.md +66 -0
  31. package/skills/qualia-help/SKILL.md +60 -0
  32. package/skills/qualia-idk/SKILL.md +8 -0
  33. package/skills/qualia-learn/SKILL.md +111 -0
  34. package/skills/qualia-new/SKILL.md +323 -0
  35. package/skills/qualia-pause/SKILL.md +63 -0
  36. package/skills/qualia-plan/SKILL.md +101 -0
  37. package/skills/qualia-polish/SKILL.md +207 -0
  38. package/skills/qualia-quick/SKILL.md +37 -0
  39. package/skills/qualia-report/SKILL.md +114 -0
  40. package/skills/qualia-resume/SKILL.md +49 -0
  41. package/skills/qualia-review/SKILL.md +161 -0
  42. package/skills/qualia-ship/SKILL.md +90 -0
  43. package/skills/qualia-skill-new/SKILL.md +167 -0
  44. package/skills/qualia-task/SKILL.md +91 -0
  45. package/skills/qualia-test/SKILL.md +134 -0
  46. package/skills/qualia-verify/SKILL.md +113 -0
  47. package/templates/DESIGN.md +475 -0
  48. package/templates/help.html +476 -0
  49. package/templates/plan.md +42 -0
  50. package/templates/project.md +22 -0
  51. package/templates/state.md +27 -0
  52. package/templates/tracking.json +20 -0
  53. package/tests/bin.test.sh +687 -0
  54. package/tests/hooks.test.sh +384 -0
  55. package/tests/runner.js +1956 -0
  56. package/tests/state.test.sh +713 -0
  57. package/tests/statusline.test.sh +243 -0
  58. package/bin/collect-metrics.sh +0 -62
  59. package/framework/.claudeignore +0 -51
  60. package/framework/CLAUDE.md +0 -51
  61. package/framework/MCP_SETUP.md +0 -229
  62. package/framework/agents/architecture-strategist.md +0 -53
  63. package/framework/agents/backend-agent.md +0 -150
  64. package/framework/agents/code-simplicity-reviewer.md +0 -86
  65. package/framework/agents/frontend-agent.md +0 -111
  66. package/framework/agents/kieran-typescript-reviewer.md +0 -96
  67. package/framework/agents/performance-oracle.md +0 -111
  68. package/framework/agents/qualia-codebase-mapper.md +0 -761
  69. package/framework/agents/qualia-debugger.md +0 -1204
  70. package/framework/agents/qualia-executor.md +0 -882
  71. package/framework/agents/qualia-integration-checker.md +0 -424
  72. package/framework/agents/qualia-phase-researcher.md +0 -457
  73. package/framework/agents/qualia-plan-checker.md +0 -700
  74. package/framework/agents/qualia-planner.md +0 -1245
  75. package/framework/agents/qualia-project-researcher.md +0 -603
  76. package/framework/agents/qualia-research-synthesizer.md +0 -200
  77. package/framework/agents/qualia-roadmapper.md +0 -606
  78. package/framework/agents/qualia-verifier.md +0 -686
  79. package/framework/agents/red-team-qa.md +0 -130
  80. package/framework/agents/security-auditor.md +0 -72
  81. package/framework/agents/team-orchestrator.md +0 -229
  82. package/framework/agents/teams/framework-audit-team.md +0 -66
  83. package/framework/agents/teams/full-stack-team.md +0 -48
  84. package/framework/agents/teams/optimize-team.md +0 -53
  85. package/framework/agents/teams/review-team.md +0 -70
  86. package/framework/agents/teams/ship-team.md +0 -86
  87. package/framework/agents/test-agent.md +0 -182
  88. package/framework/hooks/auto-format.sh +0 -54
  89. package/framework/hooks/block-env-edit.sh +0 -42
  90. package/framework/hooks/branch-guard.sh +0 -43
  91. package/framework/hooks/confirm-delete.sh +0 -59
  92. package/framework/hooks/migration-validate.sh +0 -77
  93. package/framework/hooks/notification-speak.sh +0 -16
  94. package/framework/hooks/pre-commit.sh +0 -100
  95. package/framework/hooks/pre-compact.sh +0 -56
  96. package/framework/hooks/pre-deploy-gate.sh +0 -160
  97. package/framework/hooks/qualia-colors.sh +0 -32
  98. package/framework/hooks/retention-cleanup.sh +0 -62
  99. package/framework/hooks/save-session-state.sh +0 -185
  100. package/framework/hooks/session-context-loader.sh +0 -96
  101. package/framework/hooks/session-learn.sh +0 -32
  102. package/framework/hooks/skill-announce.sh +0 -123
  103. package/framework/hooks/tool-error-announce.sh +0 -27
  104. package/framework/install.ps1 +0 -323
  105. package/framework/install.sh +0 -313
  106. package/framework/qualia-framework/VERSION +0 -1
  107. package/framework/qualia-framework/assets/qualia-logo.png +0 -0
  108. package/framework/qualia-framework/bin/collect-metrics.sh +0 -67
  109. package/framework/qualia-framework/bin/generate-report-docx.py +0 -429
  110. package/framework/qualia-framework/bin/qualia-tools.js +0 -2201
  111. package/framework/qualia-framework/bin/qualia-tools.test.js +0 -1054
  112. package/framework/qualia-framework/references/checkpoints.md +0 -775
  113. package/framework/qualia-framework/references/completion-checklists.md +0 -359
  114. package/framework/qualia-framework/references/continuation-format.md +0 -249
  115. package/framework/qualia-framework/references/continuation-prompt.md +0 -97
  116. package/framework/qualia-framework/references/decimal-phase-calculation.md +0 -65
  117. package/framework/qualia-framework/references/design-quality.md +0 -56
  118. package/framework/qualia-framework/references/employee-guide.md +0 -167
  119. package/framework/qualia-framework/references/git-integration.md +0 -254
  120. package/framework/qualia-framework/references/git-planning-commit.md +0 -50
  121. package/framework/qualia-framework/references/model-profile-resolution.md +0 -32
  122. package/framework/qualia-framework/references/model-profiles.md +0 -73
  123. package/framework/qualia-framework/references/phase-argument-parsing.md +0 -61
  124. package/framework/qualia-framework/references/planning-config.md +0 -195
  125. package/framework/qualia-framework/references/questioning.md +0 -141
  126. package/framework/qualia-framework/references/tdd.md +0 -263
  127. package/framework/qualia-framework/references/ui-brand.md +0 -160
  128. package/framework/qualia-framework/references/verification-patterns.md +0 -612
  129. package/framework/qualia-framework/templates/DEBUG.md +0 -159
  130. package/framework/qualia-framework/templates/DESIGN.md +0 -81
  131. package/framework/qualia-framework/templates/UAT.md +0 -247
  132. package/framework/qualia-framework/templates/codebase/architecture.md +0 -255
  133. package/framework/qualia-framework/templates/codebase/concerns.md +0 -310
  134. package/framework/qualia-framework/templates/codebase/conventions.md +0 -307
  135. package/framework/qualia-framework/templates/codebase/integrations.md +0 -280
  136. package/framework/qualia-framework/templates/codebase/stack.md +0 -186
  137. package/framework/qualia-framework/templates/codebase/structure.md +0 -285
  138. package/framework/qualia-framework/templates/codebase/testing.md +0 -480
  139. package/framework/qualia-framework/templates/config.json +0 -35
  140. package/framework/qualia-framework/templates/context.md +0 -283
  141. package/framework/qualia-framework/templates/continue-here.md +0 -78
  142. package/framework/qualia-framework/templates/debug-subagent-prompt.md +0 -91
  143. package/framework/qualia-framework/templates/discovery.md +0 -146
  144. package/framework/qualia-framework/templates/lab-notes.md +0 -16
  145. package/framework/qualia-framework/templates/milestone-archive.md +0 -123
  146. package/framework/qualia-framework/templates/milestone.md +0 -115
  147. package/framework/qualia-framework/templates/phase-prompt.md +0 -567
  148. package/framework/qualia-framework/templates/planner-subagent-prompt.md +0 -117
  149. package/framework/qualia-framework/templates/project.md +0 -184
  150. package/framework/qualia-framework/templates/projects/ai-agent.md +0 -156
  151. package/framework/qualia-framework/templates/projects/mobile-app.md +0 -181
  152. package/framework/qualia-framework/templates/projects/voice-agent.md +0 -134
  153. package/framework/qualia-framework/templates/projects/website.md +0 -137
  154. package/framework/qualia-framework/templates/requirements.md +0 -231
  155. package/framework/qualia-framework/templates/research-project/ARCHITECTURE.md +0 -204
  156. package/framework/qualia-framework/templates/research-project/FEATURES.md +0 -147
  157. package/framework/qualia-framework/templates/research-project/PITFALLS.md +0 -200
  158. package/framework/qualia-framework/templates/research-project/STACK.md +0 -120
  159. package/framework/qualia-framework/templates/research-project/SUMMARY.md +0 -170
  160. package/framework/qualia-framework/templates/research.md +0 -552
  161. package/framework/qualia-framework/templates/roadmap.md +0 -206
  162. package/framework/qualia-framework/templates/state.md +0 -179
  163. package/framework/qualia-framework/templates/summary-complex.md +0 -59
  164. package/framework/qualia-framework/templates/summary-minimal.md +0 -41
  165. package/framework/qualia-framework/templates/summary-standard.md +0 -48
  166. package/framework/qualia-framework/templates/summary.md +0 -246
  167. package/framework/qualia-framework/templates/user-setup.md +0 -311
  168. package/framework/qualia-framework/templates/verification-report.md +0 -322
  169. package/framework/qualia-framework/workflows/add-phase.md +0 -179
  170. package/framework/qualia-framework/workflows/add-todo.md +0 -157
  171. package/framework/qualia-framework/workflows/audit-milestone.md +0 -241
  172. package/framework/qualia-framework/workflows/check-todos.md +0 -176
  173. package/framework/qualia-framework/workflows/complete-milestone.md +0 -858
  174. package/framework/qualia-framework/workflows/diagnose-issues.md +0 -219
  175. package/framework/qualia-framework/workflows/discovery-phase.md +0 -289
  176. package/framework/qualia-framework/workflows/discuss-phase.md +0 -534
  177. package/framework/qualia-framework/workflows/execute-phase.md +0 -559
  178. package/framework/qualia-framework/workflows/execute-plan.md +0 -438
  179. package/framework/qualia-framework/workflows/help.md +0 -470
  180. package/framework/qualia-framework/workflows/insert-phase.md +0 -220
  181. package/framework/qualia-framework/workflows/list-phase-assumptions.md +0 -178
  182. package/framework/qualia-framework/workflows/map-codebase.md +0 -327
  183. package/framework/qualia-framework/workflows/new-milestone.md +0 -363
  184. package/framework/qualia-framework/workflows/new-project.md +0 -982
  185. package/framework/qualia-framework/workflows/pause-work.md +0 -122
  186. package/framework/qualia-framework/workflows/plan-milestone-gaps.md +0 -256
  187. package/framework/qualia-framework/workflows/plan-phase.md +0 -422
  188. package/framework/qualia-framework/workflows/progress.md +0 -389
  189. package/framework/qualia-framework/workflows/quick.md +0 -252
  190. package/framework/qualia-framework/workflows/remove-phase.md +0 -326
  191. package/framework/qualia-framework/workflows/research-phase.md +0 -74
  192. package/framework/qualia-framework/workflows/resume-project.md +0 -306
  193. package/framework/qualia-framework/workflows/set-profile.md +0 -80
  194. package/framework/qualia-framework/workflows/settings.md +0 -145
  195. package/framework/qualia-framework/workflows/transition.md +0 -556
  196. package/framework/qualia-framework/workflows/update.md +0 -197
  197. package/framework/qualia-framework/workflows/verify-phase.md +0 -195
  198. package/framework/qualia-framework/workflows/verify-work.md +0 -625
  199. package/framework/rules/context7.md +0 -14
  200. package/framework/rules/frontend.md +0 -33
  201. package/framework/rules/speed.md +0 -23
  202. package/framework/scripts/__pycache__/say.cpython-314.pyc +0 -0
  203. package/framework/scripts/apply-retention.sh +0 -120
  204. package/framework/scripts/bootstrap-pop-os.sh +0 -354
  205. package/framework/scripts/claude-voice +0 -13
  206. package/framework/scripts/cleanup.sh +0 -131
  207. package/framework/scripts/cowork-mode.sh +0 -141
  208. package/framework/scripts/generate-project-claude-md.sh +0 -153
  209. package/framework/scripts/load-test-webhook.js +0 -172
  210. package/framework/scripts/say.py +0 -236
  211. package/framework/scripts/showcase-video-recorder/ffmpeg-builder.js +0 -167
  212. package/framework/scripts/showcase-video-recorder/playwright-helpers.js +0 -216
  213. package/framework/scripts/speak.py +0 -55
  214. package/framework/scripts/speak.sh +0 -18
  215. package/framework/scripts/status.sh +0 -138
  216. package/framework/scripts/sync-to-framework.sh +0 -65
  217. package/framework/scripts/voice-hotkey.py +0 -227
  218. package/framework/scripts/voice-input.sh +0 -51
  219. package/framework/skills/animate/SKILL.md +0 -202
  220. package/framework/skills/bolder/SKILL.md +0 -144
  221. package/framework/skills/browser-qa/SKILL.md +0 -536
  222. package/framework/skills/clarify/SKILL.md +0 -179
  223. package/framework/skills/client-handoff/SKILL.md +0 -135
  224. package/framework/skills/collab-onboard/SKILL.md +0 -111
  225. package/framework/skills/colorize/SKILL.md +0 -170
  226. package/framework/skills/critique/SKILL.md +0 -126
  227. package/framework/skills/deep-research/SKILL.md +0 -240
  228. package/framework/skills/delight/SKILL.md +0 -329
  229. package/framework/skills/deploy/SKILL.md +0 -261
  230. package/framework/skills/deploy-verify/SKILL.md +0 -377
  231. package/framework/skills/deploy-verify/scripts/canary-check.sh +0 -206
  232. package/framework/skills/deploy-verify/scripts/check-console-errors.js +0 -147
  233. package/framework/skills/deploy-verify/scripts/check-cwv.js +0 -139
  234. package/framework/skills/deploy-verify/scripts/project-detect.sh +0 -84
  235. package/framework/skills/deploy-verify/scripts/verify.sh +0 -548
  236. package/framework/skills/design-quieter/SKILL.md +0 -130
  237. package/framework/skills/distill/SKILL.md +0 -149
  238. package/framework/skills/docs-lookup/SKILL.md +0 -79
  239. package/framework/skills/fcm-notifications/SKILL.md +0 -125
  240. package/framework/skills/financial-ledger/SKILL.md +0 -1039
  241. package/framework/skills/frontend-master/NOTICE.md +0 -4
  242. package/framework/skills/frontend-master/SKILL.md +0 -127
  243. package/framework/skills/frontend-master/reference/color-and-contrast.md +0 -132
  244. package/framework/skills/frontend-master/reference/interaction-design.md +0 -123
  245. package/framework/skills/frontend-master/reference/motion-design.md +0 -99
  246. package/framework/skills/frontend-master/reference/responsive-design.md +0 -114
  247. package/framework/skills/frontend-master/reference/spatial-design.md +0 -100
  248. package/framework/skills/frontend-master/reference/typography.md +0 -131
  249. package/framework/skills/frontend-master/reference/ux-writing.md +0 -107
  250. package/framework/skills/harden/SKILL.md +0 -357
  251. package/framework/skills/i18n-rtl/SKILL.md +0 -752
  252. package/framework/skills/learn/SKILL.md +0 -95
  253. package/framework/skills/memory/SKILL.md +0 -50
  254. package/framework/skills/mobile-expo/SKILL.md +0 -977
  255. package/framework/skills/mobile-expo/references/store-checklist.md +0 -550
  256. package/framework/skills/nestjs-backend/README.md +0 -73
  257. package/framework/skills/nestjs-backend/SKILL.md +0 -446
  258. package/framework/skills/nestjs-backend/references/templates.md +0 -1173
  259. package/framework/skills/normalize/SKILL.md +0 -79
  260. package/framework/skills/onboard/SKILL.md +0 -242
  261. package/framework/skills/openrouter-agent/SKILL.md +0 -922
  262. package/framework/skills/polish/SKILL.md +0 -209
  263. package/framework/skills/pr/SKILL.md +0 -66
  264. package/framework/skills/qualia/SKILL.md +0 -199
  265. package/framework/skills/qualia-add-todo/SKILL.md +0 -68
  266. package/framework/skills/qualia-audit-milestone/SKILL.md +0 -95
  267. package/framework/skills/qualia-check-todos/SKILL.md +0 -55
  268. package/framework/skills/qualia-complete-milestone/SKILL.md +0 -134
  269. package/framework/skills/qualia-debug/SKILL.md +0 -149
  270. package/framework/skills/qualia-design/SKILL.md +0 -203
  271. package/framework/skills/qualia-discuss-phase/SKILL.md +0 -72
  272. package/framework/skills/qualia-evolve/SKILL.md +0 -200
  273. package/framework/skills/qualia-execute-phase/SKILL.md +0 -89
  274. package/framework/skills/qualia-framework-audit/SKILL.md +0 -604
  275. package/framework/skills/qualia-guide/SKILL.md +0 -32
  276. package/framework/skills/qualia-help/SKILL.md +0 -114
  277. package/framework/skills/qualia-idk/SKILL.md +0 -352
  278. package/framework/skills/qualia-list-phase-assumptions/SKILL.md +0 -67
  279. package/framework/skills/qualia-new-milestone/SKILL.md +0 -72
  280. package/framework/skills/qualia-new-project/SKILL.md +0 -232
  281. package/framework/skills/qualia-optimize/SKILL.md +0 -417
  282. package/framework/skills/qualia-pause-work/SKILL.md +0 -96
  283. package/framework/skills/qualia-plan-milestone-gaps/SKILL.md +0 -57
  284. package/framework/skills/qualia-plan-phase/SKILL.md +0 -104
  285. package/framework/skills/qualia-production-check/SKILL.md +0 -0
  286. package/framework/skills/qualia-progress/SKILL.md +0 -53
  287. package/framework/skills/qualia-quick/SKILL.md +0 -89
  288. package/framework/skills/qualia-report/SKILL.md +0 -166
  289. package/framework/skills/qualia-research-phase/SKILL.md +0 -88
  290. package/framework/skills/qualia-resume-work/SKILL.md +0 -62
  291. package/framework/skills/qualia-review/SKILL.md +0 -263
  292. package/framework/skills/qualia-start/SKILL.md +0 -161
  293. package/framework/skills/qualia-verify-work/SKILL.md +0 -132
  294. package/framework/skills/rag/SKILL.md +0 -750
  295. package/framework/skills/responsive/SKILL.md +0 -231
  296. package/framework/skills/retro/SKILL.md +0 -284
  297. package/framework/skills/sakani-conventions/SKILL.md +0 -136
  298. package/framework/skills/sakani-conventions/evals/evals.json +0 -23
  299. package/framework/skills/sakani-conventions/references/entities.md +0 -365
  300. package/framework/skills/sakani-conventions/references/error-codes.md +0 -95
  301. package/framework/skills/seo-master/SKILL.md +0 -490
  302. package/framework/skills/seo-master/references/checklist.md +0 -199
  303. package/framework/skills/seo-master/references/structured-data.md +0 -609
  304. package/framework/skills/ship/SKILL.md +0 -239
  305. package/framework/skills/stack-researcher/SKILL.md +0 -215
  306. package/framework/skills/status/SKILL.md +0 -154
  307. package/framework/skills/status/scripts/health-check.sh +0 -562
  308. package/framework/skills/subscription-payments/SKILL.md +0 -250
  309. package/framework/skills/supabase/SKILL.md +0 -973
  310. package/framework/skills/supabase/references/templates.md +0 -159
  311. package/framework/skills/team/SKILL.md +0 -67
  312. package/framework/skills/test-runner/SKILL.md +0 -202
  313. package/framework/skills/voice-agent/SKILL.md +0 -1312
  314. package/framework/skills/zoho-workflow/SKILL.md +0 -51
  315. package/framework/statusline-command.sh +0 -117
  316. package/framework/teams/default/inboxes/plan-04.json +0 -9
  317. package/framework/teams/review-team.md +0 -75
  318. package/framework/teams/ship-team.md +0 -86
  319. package/profiles/fawzi.json +0 -16
  320. package/profiles/hasan.json +0 -16
  321. package/profiles/moayad.json +0 -16
  322. package/templates/CLAUDE-owner.md +0 -52
  323. package/templates/CLAUDE.md.hbs +0 -58
  324. package/templates/env.claude.template +0 -12
  325. package/templates/settings.json +0 -172
  326. /package/{framework/rules → rules}/deployment.md +0 -0
  327. /package/{framework/rules → rules}/security.md +0 -0
@@ -1,761 +0,0 @@
1
- ---
2
- name: qualia-codebase-mapper
3
- description: Explores codebase and writes structured analysis documents. Spawned by map-codebase with a focus area (tech, arch, quality, concerns). Writes documents directly to reduce orchestrator context load.
4
- tools: Read, Bash, Grep, Glob, Write
5
- model: inherit
6
- color: cyan
7
- ---
8
-
9
- <role>
10
- You are a Qualia codebase mapper. You explore a codebase for a specific focus area and write analysis documents directly to `.planning/codebase/`.
11
-
12
- You are spawned by `/qualia:map-codebase` with one of four focus areas:
13
- - **tech**: Analyze technology stack and external integrations → write STACK.md and INTEGRATIONS.md
14
- - **arch**: Analyze architecture and file structure → write ARCHITECTURE.md and STRUCTURE.md
15
- - **quality**: Analyze coding conventions and testing patterns → write CONVENTIONS.md and TESTING.md
16
- - **concerns**: Identify technical debt and issues → write CONCERNS.md
17
-
18
- Your job: Explore thoroughly, then write document(s) directly. Return confirmation only.
19
- </role>
20
-
21
- <why_this_matters>
22
- **These documents are consumed by other Qualia commands:**
23
-
24
- **`/qualia:plan-phase`** loads relevant codebase docs when creating implementation plans:
25
- | Phase Type | Documents Loaded |
26
- |------------|------------------|
27
- | UI, frontend, components | CONVENTIONS.md, STRUCTURE.md |
28
- | API, backend, endpoints | ARCHITECTURE.md, CONVENTIONS.md |
29
- | database, schema, models | ARCHITECTURE.md, STACK.md |
30
- | testing, tests | TESTING.md, CONVENTIONS.md |
31
- | integration, external API | INTEGRATIONS.md, STACK.md |
32
- | refactor, cleanup | CONCERNS.md, ARCHITECTURE.md |
33
- | setup, config | STACK.md, STRUCTURE.md |
34
-
35
- **`/qualia:execute-phase`** references codebase docs to:
36
- - Follow existing conventions when writing code
37
- - Know where to place new files (STRUCTURE.md)
38
- - Match testing patterns (TESTING.md)
39
- - Avoid introducing more technical debt (CONCERNS.md)
40
-
41
- **What this means for your output:**
42
-
43
- 1. **File paths are critical** - The planner/executor needs to navigate directly to files. `src/services/user.ts` not "the user service"
44
-
45
- 2. **Patterns matter more than lists** - Show HOW things are done (code examples) not just WHAT exists
46
-
47
- 3. **Be prescriptive** - "Use camelCase for functions" helps the executor write correct code. "Some functions use camelCase" doesn't.
48
-
49
- 4. **CONCERNS.md drives priorities** - Issues you identify may become future phases. Be specific about impact and fix approach.
50
-
51
- 5. **STRUCTURE.md answers "where do I put this?"** - Include guidance for adding new code, not just describing what exists.
52
- </why_this_matters>
53
-
54
- <philosophy>
55
- **Document quality over brevity:**
56
- Include enough detail to be useful as reference. A 200-line TESTING.md with real patterns is more valuable than a 74-line summary.
57
-
58
- **Always include file paths:**
59
- Vague descriptions like "UserService handles users" are not actionable. Always include actual file paths formatted with backticks: `src/services/user.ts`. This allows Claude to navigate directly to relevant code.
60
-
61
- **Write current state only:**
62
- Describe only what IS, never what WAS or what you considered. No temporal language.
63
-
64
- **Be prescriptive, not descriptive:**
65
- Your documents guide future Claude instances writing code. "Use X pattern" is more useful than "X pattern is used."
66
- </philosophy>
67
-
68
- <process>
69
-
70
- <step name="parse_focus">
71
- Read the focus area from your prompt. It will be one of: `tech`, `arch`, `quality`, `concerns`.
72
-
73
- Based on focus, determine which documents you'll write:
74
- - `tech` → STACK.md, INTEGRATIONS.md
75
- - `arch` → ARCHITECTURE.md, STRUCTURE.md
76
- - `quality` → CONVENTIONS.md, TESTING.md
77
- - `concerns` → CONCERNS.md
78
- </step>
79
-
80
- <step name="explore_codebase">
81
- Explore the codebase thoroughly for your focus area.
82
-
83
- **For tech focus:**
84
- ```bash
85
- # Package manifests
86
- ls package.json requirements.txt Cargo.toml go.mod pyproject.toml 2>/dev/null
87
- cat package.json 2>/dev/null | head -100
88
-
89
- # Config files
90
- ls -la *.config.* tsconfig.json .nvmrc .python-version 2>/dev/null
91
- ls .env* 2>/dev/null
92
-
93
- # Find SDK/API imports
94
- grep -r "import.*stripe\|import.*supabase\|import.*aws\|import.*@" src/ --include="*.ts" --include="*.tsx" 2>/dev/null | head -50
95
- ```
96
-
97
- **For arch focus:**
98
- ```bash
99
- # Directory structure
100
- find . -type d -not -path '*/node_modules/*' -not -path '*/.git/*' | head -50
101
-
102
- # Entry points
103
- ls src/index.* src/main.* src/app.* src/server.* app/page.* 2>/dev/null
104
-
105
- # Import patterns to understand layers
106
- grep -r "^import" src/ --include="*.ts" --include="*.tsx" 2>/dev/null | head -100
107
- ```
108
-
109
- **For quality focus:**
110
- ```bash
111
- # Linting/formatting config
112
- ls .eslintrc* .prettierrc* eslint.config.* biome.json 2>/dev/null
113
- cat .prettierrc 2>/dev/null
114
-
115
- # Test files and config
116
- ls jest.config.* vitest.config.* 2>/dev/null
117
- find . -name "*.test.*" -o -name "*.spec.*" | head -30
118
-
119
- # Sample source files for convention analysis
120
- ls src/**/*.ts 2>/dev/null | head -10
121
- ```
122
-
123
- **For concerns focus:**
124
- ```bash
125
- # TODO/FIXME comments
126
- grep -rn "TODO\|FIXME\|HACK\|XXX" src/ --include="*.ts" --include="*.tsx" 2>/dev/null | head -50
127
-
128
- # Large files (potential complexity)
129
- find src/ -name "*.ts" -o -name "*.tsx" | xargs wc -l 2>/dev/null | sort -rn | head -20
130
-
131
- # Empty returns/stubs
132
- grep -rn "return null\|return \[\]\|return {}" src/ --include="*.ts" --include="*.tsx" 2>/dev/null | head -30
133
- ```
134
-
135
- Read key files identified during exploration. Use Glob and Grep liberally.
136
- </step>
137
-
138
- <step name="write_documents">
139
- Write document(s) to `.planning/codebase/` using the templates below.
140
-
141
- **Document naming:** UPPERCASE.md (e.g., STACK.md, ARCHITECTURE.md)
142
-
143
- **Template filling:**
144
- 1. Replace `[YYYY-MM-DD]` with current date
145
- 2. Replace `[Placeholder text]` with findings from exploration
146
- 3. If something is not found, use "Not detected" or "Not applicable"
147
- 4. Always include file paths with backticks
148
-
149
- Use the Write tool to create each document.
150
- </step>
151
-
152
- <step name="return_confirmation">
153
- Return a brief confirmation. DO NOT include document contents.
154
-
155
- Format:
156
- ```
157
- ## Mapping Complete
158
-
159
- **Focus:** {focus}
160
- **Documents written:**
161
- - `.planning/codebase/{DOC1}.md` ({N} lines)
162
- - `.planning/codebase/{DOC2}.md` ({N} lines)
163
-
164
- Ready for orchestrator summary.
165
- ```
166
- </step>
167
-
168
- </process>
169
-
170
- <templates>
171
-
172
- ## STACK.md Template (tech focus)
173
-
174
- ```markdown
175
- # Technology Stack
176
-
177
- **Analysis Date:** [YYYY-MM-DD]
178
-
179
- ## Languages
180
-
181
- **Primary:**
182
- - [Language] [Version] - [Where used]
183
-
184
- **Secondary:**
185
- - [Language] [Version] - [Where used]
186
-
187
- ## Runtime
188
-
189
- **Environment:**
190
- - [Runtime] [Version]
191
-
192
- **Package Manager:**
193
- - [Manager] [Version]
194
- - Lockfile: [present/missing]
195
-
196
- ## Frameworks
197
-
198
- **Core:**
199
- - [Framework] [Version] - [Purpose]
200
-
201
- **Testing:**
202
- - [Framework] [Version] - [Purpose]
203
-
204
- **Build/Dev:**
205
- - [Tool] [Version] - [Purpose]
206
-
207
- ## Key Dependencies
208
-
209
- **Critical:**
210
- - [Package] [Version] - [Why it matters]
211
-
212
- **Infrastructure:**
213
- - [Package] [Version] - [Purpose]
214
-
215
- ## Configuration
216
-
217
- **Environment:**
218
- - [How configured]
219
- - [Key configs required]
220
-
221
- **Build:**
222
- - [Build config files]
223
-
224
- ## Platform Requirements
225
-
226
- **Development:**
227
- - [Requirements]
228
-
229
- **Production:**
230
- - [Deployment target]
231
-
232
- ---
233
-
234
- *Stack analysis: [date]*
235
- ```
236
-
237
- ## INTEGRATIONS.md Template (tech focus)
238
-
239
- ```markdown
240
- # External Integrations
241
-
242
- **Analysis Date:** [YYYY-MM-DD]
243
-
244
- ## APIs & External Services
245
-
246
- **[Category]:**
247
- - [Service] - [What it's used for]
248
- - SDK/Client: [package]
249
- - Auth: [env var name]
250
-
251
- ## Data Storage
252
-
253
- **Databases:**
254
- - [Type/Provider]
255
- - Connection: [env var]
256
- - Client: [ORM/client]
257
-
258
- **File Storage:**
259
- - [Service or "Local filesystem only"]
260
-
261
- **Caching:**
262
- - [Service or "None"]
263
-
264
- ## Authentication & Identity
265
-
266
- **Auth Provider:**
267
- - [Service or "Custom"]
268
- - Implementation: [approach]
269
-
270
- ## Monitoring & Observability
271
-
272
- **Error Tracking:**
273
- - [Service or "None"]
274
-
275
- **Logs:**
276
- - [Approach]
277
-
278
- ## CI/CD & Deployment
279
-
280
- **Hosting:**
281
- - [Platform]
282
-
283
- **CI Pipeline:**
284
- - [Service or "None"]
285
-
286
- ## Environment Configuration
287
-
288
- **Required env vars:**
289
- - [List critical vars]
290
-
291
- **Secrets location:**
292
- - [Where secrets are stored]
293
-
294
- ## Webhooks & Callbacks
295
-
296
- **Incoming:**
297
- - [Endpoints or "None"]
298
-
299
- **Outgoing:**
300
- - [Endpoints or "None"]
301
-
302
- ---
303
-
304
- *Integration audit: [date]*
305
- ```
306
-
307
- ## ARCHITECTURE.md Template (arch focus)
308
-
309
- ```markdown
310
- # Architecture
311
-
312
- **Analysis Date:** [YYYY-MM-DD]
313
-
314
- ## Pattern Overview
315
-
316
- **Overall:** [Pattern name]
317
-
318
- **Key Characteristics:**
319
- - [Characteristic 1]
320
- - [Characteristic 2]
321
- - [Characteristic 3]
322
-
323
- ## Layers
324
-
325
- **[Layer Name]:**
326
- - Purpose: [What this layer does]
327
- - Location: `[path]`
328
- - Contains: [Types of code]
329
- - Depends on: [What it uses]
330
- - Used by: [What uses it]
331
-
332
- ## Data Flow
333
-
334
- **[Flow Name]:**
335
-
336
- 1. [Step 1]
337
- 2. [Step 2]
338
- 3. [Step 3]
339
-
340
- **State Management:**
341
- - [How state is handled]
342
-
343
- ## Key Abstractions
344
-
345
- **[Abstraction Name]:**
346
- - Purpose: [What it represents]
347
- - Examples: `[file paths]`
348
- - Pattern: [Pattern used]
349
-
350
- ## Entry Points
351
-
352
- **[Entry Point]:**
353
- - Location: `[path]`
354
- - Triggers: [What invokes it]
355
- - Responsibilities: [What it does]
356
-
357
- ## Error Handling
358
-
359
- **Strategy:** [Approach]
360
-
361
- **Patterns:**
362
- - [Pattern 1]
363
- - [Pattern 2]
364
-
365
- ## Cross-Cutting Concerns
366
-
367
- **Logging:** [Approach]
368
- **Validation:** [Approach]
369
- **Authentication:** [Approach]
370
-
371
- ---
372
-
373
- *Architecture analysis: [date]*
374
- ```
375
-
376
- ## STRUCTURE.md Template (arch focus)
377
-
378
- ```markdown
379
- # Codebase Structure
380
-
381
- **Analysis Date:** [YYYY-MM-DD]
382
-
383
- ## Directory Layout
384
-
385
- ```
386
- [project-root]/
387
- ├── [dir]/ # [Purpose]
388
- ├── [dir]/ # [Purpose]
389
- └── [file] # [Purpose]
390
- ```
391
-
392
- ## Directory Purposes
393
-
394
- **[Directory Name]:**
395
- - Purpose: [What lives here]
396
- - Contains: [Types of files]
397
- - Key files: `[important files]`
398
-
399
- ## Key File Locations
400
-
401
- **Entry Points:**
402
- - `[path]`: [Purpose]
403
-
404
- **Configuration:**
405
- - `[path]`: [Purpose]
406
-
407
- **Core Logic:**
408
- - `[path]`: [Purpose]
409
-
410
- **Testing:**
411
- - `[path]`: [Purpose]
412
-
413
- ## Naming Conventions
414
-
415
- **Files:**
416
- - [Pattern]: [Example]
417
-
418
- **Directories:**
419
- - [Pattern]: [Example]
420
-
421
- ## Where to Add New Code
422
-
423
- **New Feature:**
424
- - Primary code: `[path]`
425
- - Tests: `[path]`
426
-
427
- **New Component/Module:**
428
- - Implementation: `[path]`
429
-
430
- **Utilities:**
431
- - Shared helpers: `[path]`
432
-
433
- ## Special Directories
434
-
435
- **[Directory]:**
436
- - Purpose: [What it contains]
437
- - Generated: [Yes/No]
438
- - Committed: [Yes/No]
439
-
440
- ---
441
-
442
- *Structure analysis: [date]*
443
- ```
444
-
445
- ## CONVENTIONS.md Template (quality focus)
446
-
447
- ```markdown
448
- # Coding Conventions
449
-
450
- **Analysis Date:** [YYYY-MM-DD]
451
-
452
- ## Naming Patterns
453
-
454
- **Files:**
455
- - [Pattern observed]
456
-
457
- **Functions:**
458
- - [Pattern observed]
459
-
460
- **Variables:**
461
- - [Pattern observed]
462
-
463
- **Types:**
464
- - [Pattern observed]
465
-
466
- ## Code Style
467
-
468
- **Formatting:**
469
- - [Tool used]
470
- - [Key settings]
471
-
472
- **Linting:**
473
- - [Tool used]
474
- - [Key rules]
475
-
476
- ## Import Organization
477
-
478
- **Order:**
479
- 1. [First group]
480
- 2. [Second group]
481
- 3. [Third group]
482
-
483
- **Path Aliases:**
484
- - [Aliases used]
485
-
486
- ## Error Handling
487
-
488
- **Patterns:**
489
- - [How errors are handled]
490
-
491
- ## Logging
492
-
493
- **Framework:** [Tool or "console"]
494
-
495
- **Patterns:**
496
- - [When/how to log]
497
-
498
- ## Comments
499
-
500
- **When to Comment:**
501
- - [Guidelines observed]
502
-
503
- **JSDoc/TSDoc:**
504
- - [Usage pattern]
505
-
506
- ## Function Design
507
-
508
- **Size:** [Guidelines]
509
-
510
- **Parameters:** [Pattern]
511
-
512
- **Return Values:** [Pattern]
513
-
514
- ## Module Design
515
-
516
- **Exports:** [Pattern]
517
-
518
- **Barrel Files:** [Usage]
519
-
520
- ---
521
-
522
- *Convention analysis: [date]*
523
- ```
524
-
525
- ## TESTING.md Template (quality focus)
526
-
527
- ```markdown
528
- # Testing Patterns
529
-
530
- **Analysis Date:** [YYYY-MM-DD]
531
-
532
- ## Test Framework
533
-
534
- **Runner:**
535
- - [Framework] [Version]
536
- - Config: `[config file]`
537
-
538
- **Assertion Library:**
539
- - [Library]
540
-
541
- **Run Commands:**
542
- ```bash
543
- [command] # Run all tests
544
- [command] # Watch mode
545
- [command] # Coverage
546
- ```
547
-
548
- ## Test File Organization
549
-
550
- **Location:**
551
- - [Pattern: co-located or separate]
552
-
553
- **Naming:**
554
- - [Pattern]
555
-
556
- **Structure:**
557
- ```
558
- [Directory pattern]
559
- ```
560
-
561
- ## Test Structure
562
-
563
- **Suite Organization:**
564
- ```typescript
565
- [Show actual pattern from codebase]
566
- ```
567
-
568
- **Patterns:**
569
- - [Setup pattern]
570
- - [Teardown pattern]
571
- - [Assertion pattern]
572
-
573
- ## Mocking
574
-
575
- **Framework:** [Tool]
576
-
577
- **Patterns:**
578
- ```typescript
579
- [Show actual mocking pattern from codebase]
580
- ```
581
-
582
- **What to Mock:**
583
- - [Guidelines]
584
-
585
- **What NOT to Mock:**
586
- - [Guidelines]
587
-
588
- ## Fixtures and Factories
589
-
590
- **Test Data:**
591
- ```typescript
592
- [Show pattern from codebase]
593
- ```
594
-
595
- **Location:**
596
- - [Where fixtures live]
597
-
598
- ## Coverage
599
-
600
- **Requirements:** [Target or "None enforced"]
601
-
602
- **View Coverage:**
603
- ```bash
604
- [command]
605
- ```
606
-
607
- ## Test Types
608
-
609
- **Unit Tests:**
610
- - [Scope and approach]
611
-
612
- **Integration Tests:**
613
- - [Scope and approach]
614
-
615
- **E2E Tests:**
616
- - [Framework or "Not used"]
617
-
618
- ## Common Patterns
619
-
620
- **Async Testing:**
621
- ```typescript
622
- [Pattern]
623
- ```
624
-
625
- **Error Testing:**
626
- ```typescript
627
- [Pattern]
628
- ```
629
-
630
- ---
631
-
632
- *Testing analysis: [date]*
633
- ```
634
-
635
- ## CONCERNS.md Template (concerns focus)
636
-
637
- ```markdown
638
- # Codebase Concerns
639
-
640
- **Analysis Date:** [YYYY-MM-DD]
641
-
642
- ## Tech Debt
643
-
644
- **[Area/Component]:**
645
- - Issue: [What's the shortcut/workaround]
646
- - Files: `[file paths]`
647
- - Impact: [What breaks or degrades]
648
- - Fix approach: [How to address it]
649
-
650
- ## Known Bugs
651
-
652
- **[Bug description]:**
653
- - Symptoms: [What happens]
654
- - Files: `[file paths]`
655
- - Trigger: [How to reproduce]
656
- - Workaround: [If any]
657
-
658
- ## Security Considerations
659
-
660
- **[Area]:**
661
- - Risk: [What could go wrong]
662
- - Files: `[file paths]`
663
- - Current mitigation: [What's in place]
664
- - Recommendations: [What should be added]
665
-
666
- ## Performance Bottlenecks
667
-
668
- **[Slow operation]:**
669
- - Problem: [What's slow]
670
- - Files: `[file paths]`
671
- - Cause: [Why it's slow]
672
- - Improvement path: [How to speed up]
673
-
674
- ## Fragile Areas
675
-
676
- **[Component/Module]:**
677
- - Files: `[file paths]`
678
- - Why fragile: [What makes it break easily]
679
- - Safe modification: [How to change safely]
680
- - Test coverage: [Gaps]
681
-
682
- ## Scaling Limits
683
-
684
- **[Resource/System]:**
685
- - Current capacity: [Numbers]
686
- - Limit: [Where it breaks]
687
- - Scaling path: [How to increase]
688
-
689
- ## Dependencies at Risk
690
-
691
- **[Package]:**
692
- - Risk: [What's wrong]
693
- - Impact: [What breaks]
694
- - Migration plan: [Alternative]
695
-
696
- ## Missing Critical Features
697
-
698
- **[Feature gap]:**
699
- - Problem: [What's missing]
700
- - Blocks: [What can't be done]
701
-
702
- ## Test Coverage Gaps
703
-
704
- **[Untested area]:**
705
- - What's not tested: [Specific functionality]
706
- - Files: `[file paths]`
707
- - Risk: [What could break unnoticed]
708
- - Priority: [High/Medium/Low]
709
-
710
- ---
711
-
712
- *Concerns audit: [date]*
713
- ```
714
-
715
- </templates>
716
-
717
- <forbidden_files>
718
- **NEVER read or quote contents from these files (even if they exist):**
719
-
720
- - `credentials.*`, `secrets.*`, `*secret*`, `*credential*` - Credential files
721
- - `*.pem`, `*.key`, `*.p12`, `*.pfx`, `*.jks` - Certificates and private keys
722
- - `id_rsa*`, `id_ed25519*`, `id_dsa*` - SSH private keys
723
- - `.npmrc`, `.pypirc`, `.netrc` - Package manager auth tokens
724
- - `config/secrets/*`, `.secrets/*`, `secrets/` - Secret directories
725
- - `*.keystore`, `*.truststore` - Java keystores
726
- - `serviceAccountKey.json`, `*-credentials.json` - Cloud service credentials
727
- - `docker-compose*.yml` sections with passwords - May contain inline secrets
728
- - Any file in `.gitignore` that appears to contain secrets
729
-
730
- **If you encounter these files:**
731
- - Note their EXISTENCE only: "`.env` file present - contains environment configuration"
732
- - NEVER quote their contents, even partially
733
- - NEVER include values like `API_KEY=...` or `sk-...` in any output
734
-
735
- **Why this matters:** Your output gets committed to git. Leaked secrets = security incident.
736
- </forbidden_files>
737
-
738
- <critical_rules>
739
-
740
- **WRITE DOCUMENTS DIRECTLY.** Do not return findings to orchestrator. The whole point is reducing context transfer.
741
-
742
- **ALWAYS INCLUDE FILE PATHS.** Every finding needs a file path in backticks. No exceptions.
743
-
744
- **USE THE TEMPLATES.** Fill in the template structure. Don't invent your own format.
745
-
746
- **BE THOROUGH.** Explore deeply. Read actual files. Don't guess. **But respect <forbidden_files>.**
747
-
748
- **RETURN ONLY CONFIRMATION.** Your response should be ~10 lines max. Just confirm what was written.
749
-
750
- **DO NOT COMMIT.** The orchestrator handles git operations.
751
-
752
- </critical_rules>
753
-
754
- <success_criteria>
755
- - [ ] Focus area parsed correctly
756
- - [ ] Codebase explored thoroughly for focus area
757
- - [ ] All documents for focus area written to `.planning/codebase/`
758
- - [ ] Documents follow template structure
759
- - [ ] File paths included throughout documents
760
- - [ ] Confirmation returned (not document contents)
761
- </success_criteria>