@phuc1403/musketeer 0.9.0 → 0.10.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 (163) hide show
  1. package/INSTALLATION.md +52 -52
  2. package/bin/musketeer.js +168 -168
  3. package/package.json +48 -48
  4. package/src/dotnet-scaffold-copier.js +79 -79
  5. package/src/provisioner/detect.js +93 -93
  6. package/src/self-update.js +77 -77
  7. package/template/.claude/agents/git-manager.md +18 -18
  8. package/template/.claude/agents/hallmark-auditor.md +78 -78
  9. package/template/.claude/agents/researcher.md +33 -33
  10. package/template/.claude/hooks/block-unsafe-adr-title.cjs +85 -85
  11. package/template/.claude/hooks/init-adr-dir.cjs +173 -173
  12. package/template/.claude/hooks/inject-adr-flags.cjs +94 -94
  13. package/template/.claude/hooks/lib/adr/command-scan.cjs +115 -115
  14. package/template/.claude/hooks/lib/characteristics/checker.cjs +357 -357
  15. package/template/.claude/hooks/lib/git-info-cache.cjs +191 -191
  16. package/template/.claude/hooks/sync-adr-toc.cjs +146 -146
  17. package/template/.claude/hooks/usage-quota-cache-refresh.cjs +166 -166
  18. package/template/.claude/hooks/validate-characteristics-hook.cjs +66 -66
  19. package/template/.claude/hooks/validate-cml-hook.js +145 -145
  20. package/template/.claude/skills/adr-writer/SKILL.md +48 -48
  21. package/template/.claude/skills/adr-writer/references/adr-example.md +35 -35
  22. package/template/.claude/skills/architecture-characteristic-writer/SKILL.md +215 -215
  23. package/template/.claude/skills/architecture-characteristic-writer/assets/worksheet-template.md +29 -29
  24. package/template/.claude/skills/architecture-characteristic-writer/references/characteristics-catalog.md +40 -40
  25. package/template/.claude/skills/architecture-characteristic-writer/scripts/ranking-table.cjs +171 -171
  26. package/template/.claude/skills/context-map/SKILL.md +80 -80
  27. package/template/.claude/skills/context-map/example.cml +106 -106
  28. package/template/.claude/skills/context-map/reference/Bounded Context/Bounded Context.md +40 -40
  29. package/template/.claude/skills/context-map/reference/Bounded Context/businessModel.md +5 -5
  30. package/template/.claude/skills/context-map/reference/Bounded Context/domainVisionStatement.md +2 -2
  31. package/template/.claude/skills/context-map/reference/Bounded Context/evolution.md +5 -5
  32. package/template/.claude/skills/context-map/reference/Bounded Context/implementationTechnology.md +1 -1
  33. package/template/.claude/skills/context-map/reference/Bounded Context/implements.md +1 -1
  34. package/template/.claude/skills/context-map/reference/Bounded Context/knowledgeLevel.md +4 -4
  35. package/template/.claude/skills/context-map/reference/Bounded Context/realizes.md +9 -9
  36. package/template/.claude/skills/context-map/reference/Bounded Context/refines.md +10 -10
  37. package/template/.claude/skills/context-map/reference/Bounded Context/responsibilities.md +26 -26
  38. package/template/.claude/skills/context-map/reference/Bounded Context/type.md +23 -23
  39. package/template/.claude/skills/context-map/reference/Bounded Context Relationship/Anticorruption Layer.md +5 -5
  40. package/template/.claude/skills/context-map/reference/Bounded Context Relationship/Bounded Context Relationship.md +12 -12
  41. package/template/.claude/skills/context-map/reference/Bounded Context Relationship/Conformist.md +5 -5
  42. package/template/.claude/skills/context-map/reference/Bounded Context Relationship/Customer-Supplier (C-S).md +22 -22
  43. package/template/.claude/skills/context-map/reference/Bounded Context Relationship/Open Host Service.md +4 -4
  44. package/template/.claude/skills/context-map/reference/Bounded Context Relationship/Partnership (P).md +13 -13
  45. package/template/.claude/skills/context-map/reference/Bounded Context Relationship/Published Language.md +4 -4
  46. package/template/.claude/skills/context-map/reference/Bounded Context Relationship/Shared Kernel (SK).md +12 -12
  47. package/template/.claude/skills/context-map/reference/Context Map.md +62 -62
  48. package/template/.claude/skills/context-map/reference/Domain/Domain.md +30 -30
  49. package/template/.claude/skills/context-map/reference/Domain/supports.md +33 -33
  50. package/template/.claude/skills/context-map/reference/Domain/type.md +3 -3
  51. package/template/.claude/skills/context-map/reference/Semantic Rules.md +32 -32
  52. package/template/.claude/skills/hallmark/SKILL.md +552 -552
  53. package/template/.claude/skills/hallmark/references/anti-patterns.md +412 -412
  54. package/template/.claude/skills/hallmark/references/assets.md +406 -406
  55. package/template/.claude/skills/hallmark/references/color.md +95 -95
  56. package/template/.claude/skills/hallmark/references/component-cookbook.md +256 -256
  57. package/template/.claude/skills/hallmark/references/components/c1-outlined-chip.md +12 -12
  58. package/template/.claude/skills/hallmark/references/components/c2-inline-form-as-cta.md +16 -16
  59. package/template/.claude/skills/hallmark/references/components/c3-typographic-link.md +8 -8
  60. package/template/.claude/skills/hallmark/references/components/c4-sticky-bottom-bar.md +16 -16
  61. package/template/.claude/skills/hallmark/references/components/f1-bento-grid.md +20 -20
  62. package/template/.claude/skills/hallmark/references/components/f2-sticky-scroll-stack.md +20 -20
  63. package/template/.claude/skills/hallmark/references/components/f3-tabular-spec-sheet.md +11 -11
  64. package/template/.claude/skills/hallmark/references/components/f4-step-sequence.md +11 -11
  65. package/template/.claude/skills/hallmark/references/components/f5-annotated-screenshot.md +11 -11
  66. package/template/.claude/skills/hallmark/references/components/f6-product-card-grid.md +41 -41
  67. package/template/.claude/skills/hallmark/references/components/ft1-mast-headed.md +13 -13
  68. package/template/.claude/skills/hallmark/references/components/ft2-inline-rule-single-line.md +10 -10
  69. package/template/.claude/skills/hallmark/references/components/ft3-index-style-category-list.md +12 -12
  70. package/template/.claude/skills/hallmark/references/components/ft4-dense-typographic.md +10 -10
  71. package/template/.claude/skills/hallmark/references/components/ft5-statement.md +21 -21
  72. package/template/.claude/skills/hallmark/references/components/ft6-letter-close.md +19 -19
  73. package/template/.claude/skills/hallmark/references/components/ft7-newsletter-first.md +27 -27
  74. package/template/.claude/skills/hallmark/references/components/ft8-marquee-scroll.md +25 -25
  75. package/template/.claude/skills/hallmark/references/components/h1-marquee.md +15 -15
  76. package/template/.claude/skills/hallmark/references/components/h2-split-diptych.md +15 -15
  77. package/template/.claude/skills/hallmark/references/components/h3-quote-led.md +11 -11
  78. package/template/.claude/skills/hallmark/references/components/h4-stat-led.md +14 -14
  79. package/template/.claude/skills/hallmark/references/components/h5-letter-hero.md +11 -11
  80. package/template/.claude/skills/hallmark/references/components/h6-photographic-fold.md +16 -16
  81. package/template/.claude/skills/hallmark/references/components/h7-demo-video-clipped-by-viewport-edge.md +27 -27
  82. package/template/.claude/skills/hallmark/references/components/h8-mockup-split-browser-framed.md +23 -23
  83. package/template/.claude/skills/hallmark/references/components/h9-custom-illustration-centerpiece.md +27 -27
  84. package/template/.claude/skills/hallmark/references/components/n1-wordmark-2-links.md +12 -12
  85. package/template/.claude/skills/hallmark/references/components/n10-floating-on-scroll-morph.md +19 -19
  86. package/template/.claude/skills/hallmark/references/components/n2-floating-chip.md +14 -14
  87. package/template/.claude/skills/hallmark/references/components/n3-side-rail.md +14 -14
  88. package/template/.claude/skills/hallmark/references/components/n4-hidden-behind-k.md +9 -9
  89. package/template/.claude/skills/hallmark/references/components/n5-floating-pill.md +28 -28
  90. package/template/.claude/skills/hallmark/references/components/n6-newspaper-masthead.md +24 -24
  91. package/template/.claude/skills/hallmark/references/components/n7-brutal-slab.md +22 -22
  92. package/template/.claude/skills/hallmark/references/components/n8-terminal-command.md +21 -21
  93. package/template/.claude/skills/hallmark/references/components/n9-edge-aligned-minimal.md +17 -17
  94. package/template/.claude/skills/hallmark/references/components/s1-left-margin-numbered.md +15 -15
  95. package/template/.claude/skills/hallmark/references/components/s2-hanging.md +13 -13
  96. package/template/.claude/skills/hallmark/references/components/s3-sticky-pinned.md +19 -19
  97. package/template/.claude/skills/hallmark/references/components/s4-inline-no-break.md +11 -11
  98. package/template/.claude/skills/hallmark/references/components/s5-bottom-anchored.md +13 -13
  99. package/template/.claude/skills/hallmark/references/components/t1-pull-quote-with-marginalia.md +12 -12
  100. package/template/.claude/skills/hallmark/references/components/t2-logo-wall-hairline.md +19 -19
  101. package/template/.claude/skills/hallmark/references/components/t3-single-huge-quote.md +11 -11
  102. package/template/.claude/skills/hallmark/references/components/t4-numbered-stat-strip.md +14 -14
  103. package/template/.claude/skills/hallmark/references/contract.md +24 -24
  104. package/template/.claude/skills/hallmark/references/copy.md +182 -182
  105. package/template/.claude/skills/hallmark/references/custom-craft.md +626 -626
  106. package/template/.claude/skills/hallmark/references/custom-theme.md +329 -329
  107. package/template/.claude/skills/hallmark/references/design-md.md +116 -116
  108. package/template/.claude/skills/hallmark/references/export-formats.md +328 -328
  109. package/template/.claude/skills/hallmark/references/floating-nav.md +89 -89
  110. package/template/.claude/skills/hallmark/references/genres/atmospheric.md +65 -65
  111. package/template/.claude/skills/hallmark/references/genres/editorial.md +70 -70
  112. package/template/.claude/skills/hallmark/references/genres/modern-minimal.md +67 -67
  113. package/template/.claude/skills/hallmark/references/genres/playful.md +65 -65
  114. package/template/.claude/skills/hallmark/references/hero-enrichment.md +474 -474
  115. package/template/.claude/skills/hallmark/references/imagery-kit.md +170 -170
  116. package/template/.claude/skills/hallmark/references/interaction-and-states.md +207 -207
  117. package/template/.claude/skills/hallmark/references/layout-and-space.md +111 -111
  118. package/template/.claude/skills/hallmark/references/macrostructures/01-bento-grid.md +35 -35
  119. package/template/.claude/skills/hallmark/references/macrostructures/02-long-document.md +34 -34
  120. package/template/.claude/skills/hallmark/references/macrostructures/03-marquee-hero.md +31 -31
  121. package/template/.claude/skills/hallmark/references/macrostructures/04-stat-led.md +32 -32
  122. package/template/.claude/skills/hallmark/references/macrostructures/05-workbench.md +32 -32
  123. package/template/.claude/skills/hallmark/references/macrostructures/06-conversational-faq.md +33 -33
  124. package/template/.claude/skills/hallmark/references/macrostructures/07-manifesto.md +32 -32
  125. package/template/.claude/skills/hallmark/references/macrostructures/08-photographic.md +34 -34
  126. package/template/.claude/skills/hallmark/references/macrostructures/09-quote-led.md +32 -32
  127. package/template/.claude/skills/hallmark/references/macrostructures/10-specimen.md +32 -32
  128. package/template/.claude/skills/hallmark/references/macrostructures/11-catalogue.md +23 -23
  129. package/template/.claude/skills/hallmark/references/macrostructures/12-letter.md +23 -23
  130. package/template/.claude/skills/hallmark/references/macrostructures/13-index-first.md +23 -23
  131. package/template/.claude/skills/hallmark/references/macrostructures/14-narrative-workflow.md +23 -23
  132. package/template/.claude/skills/hallmark/references/macrostructures/15-split-studio.md +23 -23
  133. package/template/.claude/skills/hallmark/references/macrostructures/16-feature-stack.md +23 -23
  134. package/template/.claude/skills/hallmark/references/macrostructures/17-type-specimen.md +23 -23
  135. package/template/.claude/skills/hallmark/references/macrostructures/18-portfolio-grid.md +23 -23
  136. package/template/.claude/skills/hallmark/references/macrostructures/19-map-diagram.md +23 -23
  137. package/template/.claude/skills/hallmark/references/macrostructures/20-ecosystem-index.md +23 -23
  138. package/template/.claude/skills/hallmark/references/macrostructures/21-component-playground.md +23 -23
  139. package/template/.claude/skills/hallmark/references/macrostructures.md +89 -89
  140. package/template/.claude/skills/hallmark/references/microinteractions.md +260 -260
  141. package/template/.claude/skills/hallmark/references/motion.md +109 -109
  142. package/template/.claude/skills/hallmark/references/preview-examples.md +49 -49
  143. package/template/.claude/skills/hallmark/references/responsive.md +138 -138
  144. package/template/.claude/skills/hallmark/references/slop-test.md +205 -205
  145. package/template/.claude/skills/hallmark/references/structure.md +164 -164
  146. package/template/.claude/skills/hallmark/references/study.md +511 -511
  147. package/template/.claude/skills/hallmark/references/typography.md +243 -243
  148. package/template/.claude/skills/hallmark/references/verbs/audit.md +25 -25
  149. package/template/.claude/skills/hallmark/references/verbs/redesign.md +269 -269
  150. package/template/.claude/skills/hallmark-loop/SKILL.md +105 -105
  151. package/template/.claude/skills/hallmark-loop/references/auditor-call.md +60 -60
  152. package/template/.claude/skills/hallmark-loop/references/capture.md +78 -78
  153. package/template/.claude/skills/hallmark-loop/references/loop-control.md +79 -79
  154. package/template/.claude/skills/handoff/SKILL.md +15 -15
  155. package/template/.claude/skills/knowledge-crunching/SKILL.md +94 -94
  156. package/template/.claude/skills/research/SKILL.md +69 -69
  157. package/template/.claude/skills/tdd/SKILL.md +142 -142
  158. package/template/.claude/skills/tdd/deep-modules.md +15 -15
  159. package/template/.claude/skills/tdd/interface-design.md +31 -31
  160. package/template/.claude/skills/tdd/mocking.md +59 -59
  161. package/template/.claude/skills/tdd/refactoring.md +10 -10
  162. package/template/.claude/skills/tdd/tests.md +61 -61
  163. package/template/.claude/statusline.cjs +100 -37
@@ -1,79 +1,79 @@
1
- # Loop control — state, stop condition, dry detection
2
-
3
- The MAIN session owns the loop control. It is **deterministic**: read the structured `state` the
4
- auditor returned and decide — no re-judging in MAIN (that would re-introduce self-review).
5
-
6
- ## State carried between rounds
7
-
8
- Keep this small object in MAIN (and nothing else from the round — no screenshots):
9
-
10
- ```
11
- state = {
12
- scores: { P, H, E, S, R, V }, // last auditor verdict, each 1–5
13
- findings: [ {gate, tell, source, verdict, evidence, severity, fix} ],
14
- }
15
- prevFindings = <previous round's findings, or null>
16
- dryRounds = <consecutive rounds with no net-new findings>
17
- round = <0-based round counter>
18
- ```
19
-
20
- ## Stop condition (check after each audit, before redesign)
21
-
22
- Stop the loop when **ANY** of the three fires:
23
-
24
- 1. **Converged** — all six axes `≥ 4` **AND** zero `critical` findings. Do **not** maintain a
25
- separate "hard-gate" list here — `slop-test.md` is the source of truth for which gates are
26
- auto-fail, and the auditor already surfaces those as `severity: critical` when it reads the
27
- rubric. So "zero critical findings" *is* the hard-gate check; nothing to duplicate. A
28
- `cant-tell` does **not** count as a failure — but log it.
29
- 2. **Max rounds** — `round >= 4`. Hallmark's six-axis critique almost always finds a sub-5;
30
- four rounds is the practical ceiling. Report what's still open rather than looping forever.
31
- 3. **Dry** — `dryRounds >= 2` (two consecutive rounds produced **no net-new findings**). The loop
32
- has stopped making progress; further rounds will churn, not improve.
33
-
34
- ## Net-new / dry detection
35
-
36
- After each audit, compute net-new findings vs the previous round:
37
-
38
- ```
39
- key(f) = `${f.gate}:${f.severity}` // a finding's identity
40
- newKeys = state.findings.map(key)
41
- oldKeys = (prevFindings ?? []).map(key)
42
- netNew = newKeys.filter(k => !oldKeys.includes(k))
43
-
44
- if (netNew.length === 0) dryRounds += 1
45
- else dryRounds = 0
46
- ```
47
-
48
- Compare against **`prevFindings`** (last round only), not against all-time findings — otherwise a
49
- finding the redesign legitimately could not fix would reset the counter every round and the loop
50
- would never go dry. Conversely, a finding that *reappears after being fixed* (a regression the
51
- redesign introduced) is correctly counted as net-new, which is what you want.
52
-
53
- ## Redesign targeting
54
-
55
- Pass the redesign step the **actionable** findings only: `verdict === "fail"`, sorted
56
- `critical → major → minor`. Skip `cant-tell` (instead, next round's capture should surface more
57
- evidence for those — e.g. capture an extra viewport or add the missing element to the
58
- `computed.json` selector list). Hand `/hallmark redesign` each finding's `gate`, `evidence`, and
59
- `fix` so it edits precisely rather than re-designing wholesale.
60
-
61
- ## Round log
62
-
63
- If `frontend/.hallmark/log.json` exists, append one record per round so future runs (and the
64
- diversification gates) can see the history:
65
-
66
- ```json
67
- { "loop": true, "round": 2, "scores": {"P":5,"H":4,"E":5,"S":4,"R":5,"V":5},
68
- "counts": {"critical":0,"major":1,"minor":2,"cant_tell":1}, "stopped": null }
69
- ```
70
-
71
- Set `"stopped"` to `"converged" | "max-rounds" | "dry"` on the final record.
72
-
73
- ## Final report (Step 6)
74
-
75
- Tell the user, concisely:
76
- - the **final six-axis scores**,
77
- - **which** stop condition fired (and at which round),
78
- - **residual findings** still open at stop, by gate number + severity, and any `cant-tell`s,
79
- - where the artifacts live (`frontend/.hallmark/loop/round-<N>/`).
1
+ # Loop control — state, stop condition, dry detection
2
+
3
+ The MAIN session owns the loop control. It is **deterministic**: read the structured `state` the
4
+ auditor returned and decide — no re-judging in MAIN (that would re-introduce self-review).
5
+
6
+ ## State carried between rounds
7
+
8
+ Keep this small object in MAIN (and nothing else from the round — no screenshots):
9
+
10
+ ```
11
+ state = {
12
+ scores: { P, H, E, S, R, V }, // last auditor verdict, each 1–5
13
+ findings: [ {gate, tell, source, verdict, evidence, severity, fix} ],
14
+ }
15
+ prevFindings = <previous round's findings, or null>
16
+ dryRounds = <consecutive rounds with no net-new findings>
17
+ round = <0-based round counter>
18
+ ```
19
+
20
+ ## Stop condition (check after each audit, before redesign)
21
+
22
+ Stop the loop when **ANY** of the three fires:
23
+
24
+ 1. **Converged** — all six axes `≥ 4` **AND** zero `critical` findings. Do **not** maintain a
25
+ separate "hard-gate" list here — `slop-test.md` is the source of truth for which gates are
26
+ auto-fail, and the auditor already surfaces those as `severity: critical` when it reads the
27
+ rubric. So "zero critical findings" *is* the hard-gate check; nothing to duplicate. A
28
+ `cant-tell` does **not** count as a failure — but log it.
29
+ 2. **Max rounds** — `round >= 4`. Hallmark's six-axis critique almost always finds a sub-5;
30
+ four rounds is the practical ceiling. Report what's still open rather than looping forever.
31
+ 3. **Dry** — `dryRounds >= 2` (two consecutive rounds produced **no net-new findings**). The loop
32
+ has stopped making progress; further rounds will churn, not improve.
33
+
34
+ ## Net-new / dry detection
35
+
36
+ After each audit, compute net-new findings vs the previous round:
37
+
38
+ ```
39
+ key(f) = `${f.gate}:${f.severity}` // a finding's identity
40
+ newKeys = state.findings.map(key)
41
+ oldKeys = (prevFindings ?? []).map(key)
42
+ netNew = newKeys.filter(k => !oldKeys.includes(k))
43
+
44
+ if (netNew.length === 0) dryRounds += 1
45
+ else dryRounds = 0
46
+ ```
47
+
48
+ Compare against **`prevFindings`** (last round only), not against all-time findings — otherwise a
49
+ finding the redesign legitimately could not fix would reset the counter every round and the loop
50
+ would never go dry. Conversely, a finding that *reappears after being fixed* (a regression the
51
+ redesign introduced) is correctly counted as net-new, which is what you want.
52
+
53
+ ## Redesign targeting
54
+
55
+ Pass the redesign step the **actionable** findings only: `verdict === "fail"`, sorted
56
+ `critical → major → minor`. Skip `cant-tell` (instead, next round's capture should surface more
57
+ evidence for those — e.g. capture an extra viewport or add the missing element to the
58
+ `computed.json` selector list). Hand `/hallmark redesign` each finding's `gate`, `evidence`, and
59
+ `fix` so it edits precisely rather than re-designing wholesale.
60
+
61
+ ## Round log
62
+
63
+ If `frontend/.hallmark/log.json` exists, append one record per round so future runs (and the
64
+ diversification gates) can see the history:
65
+
66
+ ```json
67
+ { "loop": true, "round": 2, "scores": {"P":5,"H":4,"E":5,"S":4,"R":5,"V":5},
68
+ "counts": {"critical":0,"major":1,"minor":2,"cant_tell":1}, "stopped": null }
69
+ ```
70
+
71
+ Set `"stopped"` to `"converged" | "max-rounds" | "dry"` on the final record.
72
+
73
+ ## Final report (Step 6)
74
+
75
+ Tell the user, concisely:
76
+ - the **final six-axis scores**,
77
+ - **which** stop condition fired (and at which round),
78
+ - **residual findings** still open at stop, by gate number + severity, and any `cant-tell`s,
79
+ - where the artifacts live (`frontend/.hallmark/loop/round-<N>/`).
@@ -1,15 +1,15 @@
1
- ---
2
- name: handoff
3
- description: Compact the current conversation into a handoff document for another agent to pick up.
4
- argument-hint: "What will the next session be used for?"
5
- ---
6
-
7
- Write a handoff document summarising the current conversation so a fresh agent can continue the work. Save to the temporary directory of the user's OS - not the current workspace.
8
-
9
- Include a "suggested skills" section in the document, which suggests skills that the agent should invoke.
10
-
11
- Do not duplicate content already captured in other artifacts (PRDs, plans, ADRs, issues, commits, diffs). Reference them by path or URL instead.
12
-
13
- Redact any sensitive information, such as API keys, passwords, or personally identifiable information.
14
-
15
- If the user passed arguments, treat them as a description of what the next session will focus on and tailor the doc accordingly.
1
+ ---
2
+ name: handoff
3
+ description: Compact the current conversation into a handoff document for another agent to pick up.
4
+ argument-hint: "What will the next session be used for?"
5
+ ---
6
+
7
+ Write a handoff document summarising the current conversation so a fresh agent can continue the work. Save to the temporary directory of the user's OS - not the current workspace.
8
+
9
+ Include a "suggested skills" section in the document, which suggests skills that the agent should invoke.
10
+
11
+ Do not duplicate content already captured in other artifacts (PRDs, plans, ADRs, issues, commits, diffs). Reference them by path or URL instead.
12
+
13
+ Redact any sensitive information, such as API keys, passwords, or personally identifiable information.
14
+
15
+ If the user passed arguments, treat them as a description of what the next session will focus on and tailor the doc accordingly.
@@ -1,94 +1,94 @@
1
- ---
2
- name: knowledge-crunching
3
- description: >-
4
- Crunch domain knowledge with the user as domain expert into test-driven domain-layer code and a ubiquitous language (DDD). Use when the user invokes /knowledge-crunching, describes a domain flow or feature to model, wants to discover a domain model, distill a ubiquitous language, or reconcile experts' terminology.
5
- ---
6
-
7
- # Knowledge Crunching
8
-
9
- You are the developer/architect on a DDD team; the user is the **domain expert** (the client). You crunch their knowledge into a model through a tight modeling dialogue, with one commitment: **the emerging model is test-driven domain-layer code, not diagrams.**
10
-
11
- **This skill handles:** the collaborative modeling *dialogue* and the domain-layer model it produces — types, behavior, unit tests, and the language in `docs/ubiquitous-language.md` — for a module that already exists, whether its domain layer is a bare scaffold or a live model. **Does NOT handle:** persistence, repositories, UI, API/transport, deployment, strategic context-mapping, or standing up a new module scaffold (a prerequisite, done first). Stay in the domain layer; if the user asks for the rest, note it's out of scope and offer to hand off afterward.
12
-
13
- ## The five stances (hold these the whole session)
14
-
15
- 1. **Model in code, not diagrams.** Every model fragment is a small type or method — in the bounded context's own language — you can show on screen. The running test, not a picture, is what makes the model concrete to the expert.
16
- 2. **Verify before you build.** Never write code for an unconfirmed concept — propose, ask, and **WAIT** for the answer.
17
- 3. **Speak the expert's words.** Use their nouns and verbs verbatim. Reconcile synonyms and contradictions out loud ("customer and account holder — same thing?"). Code names == language names.
18
- 4. **Distill, don't transcribe.** Exclude every fact the current problem doesn't need — the model is a distillation, not a transcription. Bring a concept back only when a feature actually pulls it in.
19
- 5. **Don't accept the solution as stated.** A request usually arrives already framed as a mechanism ("export the table, sort it, email a summary"). That framing is not the domain. Dig past it for the concepts underneath — that is where the model is.
20
-
21
- ## Workflow
22
-
23
- ### Step 1 — Read what already exists
24
- **First read any prior crunching output for that context** — `docs/ubiquitous-language.md` and the domain's code; in DDD, document = code. If the module is a bare scaffold with no language chosen yet, ask the user which language and test framework the context should be modeled in before proposing any code.
25
-
26
- If a model is already there, read it against the language and let each mismatch become a Step 4 loop turn — surface it, verify with the user, then change code and `docs/ubiquitous-language.md` together:
27
-
28
- - **Synonym drift** — code says `Learner`, experts now say `Student`. Reconcile and pick one, in both.
29
- - **Conflated concept** — one type doing two jobs the experts name separately → candidate split.
30
- - **Leaked invariant** — a rule enforced in a service/controller that an aggregate should own.
31
- - **Dead concept** — a type no scenario exercises anymore → remove it from the code and drop its entry.
32
-
33
- ### Step 2 — Find the first model elements
34
- The opening description is usually a mechanism, not a model (stance 5). Listen past it for the **domain nouns and verbs that keep recurring**, and name 2–4 of them back as candidate concepts.
35
-
36
- For each, ask whether it is something the business actually names and treats as a distinct thing — as opposed to a word used in passing, or one you invented. You are testing your own guesses, so expect to be corrected. This is *not* "which word do you prefer?" — choosing between two words for one thing is stance 3, and it only arises once you have two.
37
-
38
- > **You:** I'm hearing `Car`, `Inspection`, and something like `Listing` for a car on the lot for sale. Is `Listing` a real thing you'd name, or just "the car is on the lot"?
39
- >
40
- > **Expert:** It's real, but we call it a `Unit`, and only once it's passed inspection. A car we haven't inspected isn't a unit.
41
-
42
- One answer, and you have a concept, its actual name, and the rule that brings it into existence. Do not scaffold types yet.
43
-
44
- ### Step 3 — Focus on ONE scenario
45
- Narrow to a single concrete scenario to make progress. Ask the user to pick or confirm the one you'll model first; everything else waits. If their explanation runs ahead of you, say so and pull back here.
46
-
47
- ### Step 4 — The per-concept tight loop (the heart of the skill)
48
- For each concept the chosen scenario pulls in, run this loop — **one concept at a time**:
49
-
50
- 1. **Propose** one model fragment as minimal code in the project's language (a type, a method, a relationship) + a one-line plain gloss of what it means.
51
- 2. **Ask one sharp verifying question** that would expose a misunderstanding if your guess is wrong. Pick the type that fits the fragment you just proposed — a good question is falsifiable, concrete, and answerable in a sentence, never "does this look right?":
52
-
53
- | Type | What it pins down | Template |
54
- |---|---|---|
55
- | **Cardinality** | how many relate to how many | "Does one X belong to exactly one Y, or many?" |
56
- | **Synonym** | two words, one concept | "Are X and Y the same thing?" |
57
- | **Ownership of behavior** | which object does the work | "What pushes the signal — X or Y?" |
58
- | **Exclusion / relevance** | is this concept needed *now* | "Does X matter for this scenario?" |
59
- | **Simplification** | how little can we model | "Is a simplified Z enough instead of full X?" |
60
- | **Computation goal** | what the output must be | "What exactly do you need from this?" |
61
- | **Definition of a unit** | what one increment is | "What counts as one X?" |
62
- | **Lifetime / sameness** | shared vs per-instance data | "Is this the same for every instance, or per instance?" |
63
-
64
- If you can't think of a question, you don't understand the fragment well enough to code it — go smaller. Prefer a question that could get a "no"; one that can only be answered "yes" teaches nothing. After a "no," restate the corrected understanding before moving on.
65
- 3. **WAIT** for the answer. Do not write code, tests, or the next fragment until the user responds.
66
- 4. **Fold in** the correction (rename, re-shape, drop, or add), then record the term (Step 6).
67
-
68
- Example of the loop's rhythm (compressed):
69
-
70
- > **You:** Here's my first guess — an `Order` groups the `LineItem`s a customer buys in one go, so `Order` holds many `LineItem`s. Does a `LineItem` belong to exactly one `Order`, or can the same one sit on several?
71
- >
72
- > **Expert:** One line item, one order. Always.
73
- >
74
- > **You:** Good — I'll make that a hard invariant. *(folds in, records the term, then moves to the next concept)*
75
-
76
- A loop turn is complete only when **all three** agree: the **expert** has answered the verifying question, the **code** reflects that answer, and **`docs/ubiquitous-language.md`** records the term. If any of the three lags, close the gap before proposing the next concept.
77
-
78
- ### Step 5 — TDD the confirmed behavior (one test at a time)
79
- Make the confirmed fragment real with the red-green loop in the `tdd` skill (`.claude/skills/tdd/SKILL.md`) — its rules on one-test-at-a-time, minimal green, testing observable behavior through the public surface, and never refactoring while red all apply here unchanged.
80
-
81
- Two amendments for a crunching session:
82
-
83
- - **Domain layer only.** No persistence, no application handlers, no UI. Ignore that skill's full-vertical-slice default — here the slice stops at the domain, and what comes next is the expert's next concept, not the next layer.
84
- - **The Step 4 sketch is a drawing in the chat, not a file.** Do not create the production type ahead of its first failing test. A compile error because the type does not exist yet is a legitimate red, and that failing run is the point.
85
-
86
- ### Step 6 — Record the language immediately
87
- The ubiquitous language lives in **one** place: `docs/ubiquitous-language.md`. There is no separate glossary file. The moment a term is confirmed, add one line — `Term: ` then what it means in the expert's words. Nothing else: no rejected-synonym list, no deferred section, no grouping. The term is already the type's name (stance 3), so don't restate it. Rename in code, rename here in the same turn.
88
-
89
- Write a dictionary entry, not prose. One line. No lead-in, no narrative, no "this is the concept that…". Keep implementation and vendor words out — they name the mechanism, not the concept (stance 5). Keep invariants out — rules live in the code and its tests (Step 5).
90
-
91
- If the doc does not exist yet, copy `assets/ubiquitous-language.template.md` from this skill to `docs/ubiquitous-language.md`. If it already exists, edit it — never overwrite it, and never start a second one. It is canonical, and is also your seed (Step 1).
92
-
93
- ### Step 7 — Distill, then loop
94
- Drop concepts the current scenario doesn't need and say so ("I'll leave scheduling out for now; we'll bring it back when a feature needs it"). When a new scenario arrives and the model can't express it, brainstorm a new concept or refactor an existing one toward deeper insight — that is crunching the knowledge further. Return to Step 3 for the next scenario.
1
+ ---
2
+ name: knowledge-crunching
3
+ description: >-
4
+ Crunch domain knowledge with the user as domain expert into test-driven domain-layer code and a ubiquitous language (DDD). Use when the user invokes /knowledge-crunching, describes a domain flow or feature to model, wants to discover a domain model, distill a ubiquitous language, or reconcile experts' terminology.
5
+ ---
6
+
7
+ # Knowledge Crunching
8
+
9
+ You are the developer/architect on a DDD team; the user is the **domain expert** (the client). You crunch their knowledge into a model through a tight modeling dialogue, with one commitment: **the emerging model is test-driven domain-layer code, not diagrams.**
10
+
11
+ **This skill handles:** the collaborative modeling *dialogue* and the domain-layer model it produces — types, behavior, unit tests, and the language in `docs/ubiquitous-language.md` — for a module that already exists, whether its domain layer is a bare scaffold or a live model. **Does NOT handle:** persistence, repositories, UI, API/transport, deployment, strategic context-mapping, or standing up a new module scaffold (a prerequisite, done first). Stay in the domain layer; if the user asks for the rest, note it's out of scope and offer to hand off afterward.
12
+
13
+ ## The five stances (hold these the whole session)
14
+
15
+ 1. **Model in code, not diagrams.** Every model fragment is a small type or method — in the bounded context's own language — you can show on screen. The running test, not a picture, is what makes the model concrete to the expert.
16
+ 2. **Verify before you build.** Never write code for an unconfirmed concept — propose, ask, and **WAIT** for the answer.
17
+ 3. **Speak the expert's words.** Use their nouns and verbs verbatim. Reconcile synonyms and contradictions out loud ("customer and account holder — same thing?"). Code names == language names.
18
+ 4. **Distill, don't transcribe.** Exclude every fact the current problem doesn't need — the model is a distillation, not a transcription. Bring a concept back only when a feature actually pulls it in.
19
+ 5. **Don't accept the solution as stated.** A request usually arrives already framed as a mechanism ("export the table, sort it, email a summary"). That framing is not the domain. Dig past it for the concepts underneath — that is where the model is.
20
+
21
+ ## Workflow
22
+
23
+ ### Step 1 — Read what already exists
24
+ **First read any prior crunching output for that context** — `docs/ubiquitous-language.md` and the domain's code; in DDD, document = code. If the module is a bare scaffold with no language chosen yet, ask the user which language and test framework the context should be modeled in before proposing any code.
25
+
26
+ If a model is already there, read it against the language and let each mismatch become a Step 4 loop turn — surface it, verify with the user, then change code and `docs/ubiquitous-language.md` together:
27
+
28
+ - **Synonym drift** — code says `Learner`, experts now say `Student`. Reconcile and pick one, in both.
29
+ - **Conflated concept** — one type doing two jobs the experts name separately → candidate split.
30
+ - **Leaked invariant** — a rule enforced in a service/controller that an aggregate should own.
31
+ - **Dead concept** — a type no scenario exercises anymore → remove it from the code and drop its entry.
32
+
33
+ ### Step 2 — Find the first model elements
34
+ The opening description is usually a mechanism, not a model (stance 5). Listen past it for the **domain nouns and verbs that keep recurring**, and name 2–4 of them back as candidate concepts.
35
+
36
+ For each, ask whether it is something the business actually names and treats as a distinct thing — as opposed to a word used in passing, or one you invented. You are testing your own guesses, so expect to be corrected. This is *not* "which word do you prefer?" — choosing between two words for one thing is stance 3, and it only arises once you have two.
37
+
38
+ > **You:** I'm hearing `Car`, `Inspection`, and something like `Listing` for a car on the lot for sale. Is `Listing` a real thing you'd name, or just "the car is on the lot"?
39
+ >
40
+ > **Expert:** It's real, but we call it a `Unit`, and only once it's passed inspection. A car we haven't inspected isn't a unit.
41
+
42
+ One answer, and you have a concept, its actual name, and the rule that brings it into existence. Do not scaffold types yet.
43
+
44
+ ### Step 3 — Focus on ONE scenario
45
+ Narrow to a single concrete scenario to make progress. Ask the user to pick or confirm the one you'll model first; everything else waits. If their explanation runs ahead of you, say so and pull back here.
46
+
47
+ ### Step 4 — The per-concept tight loop (the heart of the skill)
48
+ For each concept the chosen scenario pulls in, run this loop — **one concept at a time**:
49
+
50
+ 1. **Propose** one model fragment as minimal code in the project's language (a type, a method, a relationship) + a one-line plain gloss of what it means.
51
+ 2. **Ask one sharp verifying question** that would expose a misunderstanding if your guess is wrong. Pick the type that fits the fragment you just proposed — a good question is falsifiable, concrete, and answerable in a sentence, never "does this look right?":
52
+
53
+ | Type | What it pins down | Template |
54
+ |---|---|---|
55
+ | **Cardinality** | how many relate to how many | "Does one X belong to exactly one Y, or many?" |
56
+ | **Synonym** | two words, one concept | "Are X and Y the same thing?" |
57
+ | **Ownership of behavior** | which object does the work | "What pushes the signal — X or Y?" |
58
+ | **Exclusion / relevance** | is this concept needed *now* | "Does X matter for this scenario?" |
59
+ | **Simplification** | how little can we model | "Is a simplified Z enough instead of full X?" |
60
+ | **Computation goal** | what the output must be | "What exactly do you need from this?" |
61
+ | **Definition of a unit** | what one increment is | "What counts as one X?" |
62
+ | **Lifetime / sameness** | shared vs per-instance data | "Is this the same for every instance, or per instance?" |
63
+
64
+ If you can't think of a question, you don't understand the fragment well enough to code it — go smaller. Prefer a question that could get a "no"; one that can only be answered "yes" teaches nothing. After a "no," restate the corrected understanding before moving on.
65
+ 3. **WAIT** for the answer. Do not write code, tests, or the next fragment until the user responds.
66
+ 4. **Fold in** the correction (rename, re-shape, drop, or add), then record the term (Step 6).
67
+
68
+ Example of the loop's rhythm (compressed):
69
+
70
+ > **You:** Here's my first guess — an `Order` groups the `LineItem`s a customer buys in one go, so `Order` holds many `LineItem`s. Does a `LineItem` belong to exactly one `Order`, or can the same one sit on several?
71
+ >
72
+ > **Expert:** One line item, one order. Always.
73
+ >
74
+ > **You:** Good — I'll make that a hard invariant. *(folds in, records the term, then moves to the next concept)*
75
+
76
+ A loop turn is complete only when **all three** agree: the **expert** has answered the verifying question, the **code** reflects that answer, and **`docs/ubiquitous-language.md`** records the term. If any of the three lags, close the gap before proposing the next concept.
77
+
78
+ ### Step 5 — TDD the confirmed behavior (one test at a time)
79
+ Make the confirmed fragment real with the red-green loop in the `tdd` skill (`.claude/skills/tdd/SKILL.md`) — its rules on one-test-at-a-time, minimal green, testing observable behavior through the public surface, and never refactoring while red all apply here unchanged.
80
+
81
+ Two amendments for a crunching session:
82
+
83
+ - **Domain layer only.** No persistence, no application handlers, no UI. Ignore that skill's full-vertical-slice default — here the slice stops at the domain, and what comes next is the expert's next concept, not the next layer.
84
+ - **The Step 4 sketch is a drawing in the chat, not a file.** Do not create the production type ahead of its first failing test. A compile error because the type does not exist yet is a legitimate red, and that failing run is the point.
85
+
86
+ ### Step 6 — Record the language immediately
87
+ The ubiquitous language lives in **one** place: `docs/ubiquitous-language.md`. There is no separate glossary file. The moment a term is confirmed, add one line — `Term: ` then what it means in the expert's words. Nothing else: no rejected-synonym list, no deferred section, no grouping. The term is already the type's name (stance 3), so don't restate it. Rename in code, rename here in the same turn.
88
+
89
+ Write a dictionary entry, not prose. One line. No lead-in, no narrative, no "this is the concept that…". Keep implementation and vendor words out — they name the mechanism, not the concept (stance 5). Keep invariants out — rules live in the code and its tests (Step 5).
90
+
91
+ If the doc does not exist yet, copy `assets/ubiquitous-language.template.md` from this skill to `docs/ubiquitous-language.md`. If it already exists, edit it — never overwrite it, and never start a second one. It is canonical, and is also your seed (Step 1).
92
+
93
+ ### Step 7 — Distill, then loop
94
+ Drop concepts the current scenario doesn't need and say so ("I'll leave scheduling out for now; we'll bring it back when a feature needs it"). When a new scenario arrives and the model can't express it, brainstorm a new concept or refactor an existing one toward deeper insight — that is crunching the knowledge further. Return to Step 3 for the next scenario.
@@ -1,69 +1,69 @@
1
- ---
2
- name: research
3
- description: "Research technical solutions and analyze architectures by spawning parallel researcher agents that search the web and cross-reference findings. Use for technology evaluation, best-practices research, solution design, and scalability/security/maintainability analysis."
4
- license: MIT
5
- argument-hint: "[topic]"
6
- metadata:
7
- author: Phuc Pham
8
- version: "2.1.1"
9
- ---
10
-
11
- # Research
12
-
13
- ## 1. Decompose
14
-
15
- Break the topic into independent sub-questions. Note recency requirements (how current
16
- the information must be) and any specific angles the user cares about (security, perf,
17
- cost, migration path) — these shape both the queries and the final sections.
18
-
19
- ## 2. Gather (parallel agents)
20
-
21
- For each independent sub-question, dispatch a `researcher` agent via the Agent tool
22
- (`subagent_type: "researcher"`). Run independent agents in a single message so they execute
23
- concurrently. Scale the count to the topic's breadth; don't spawn overlapping agents.
24
-
25
- Give each agent **one** sub-question plus any recency/angle constraints from step 1. The
26
- agent handles query crafting, source prioritization, and returning findings with URLs.
27
- Keep synthesis (steps 3–4) in the main agent.
28
-
29
- ## 3. Cross-reference
30
-
31
- Before synthesizing:
32
- - **Verify** each significant claim across multiple independent sources.
33
- - **Check dates** — flag stale information.
34
- - **Surface conflicts** explicitly rather than silently picking a side.
35
- - **Flag single-source claims** as unverified; discard or downgrade what fails.
36
-
37
- ## 4. Report
38
-
39
- Save to the output path if the main agent provided one; otherwise return inline. Cite
40
- sources throughout. Sacrifice grammar for concision.
41
-
42
- Adapt the structure to the topic — don't pad with empty sections. A typical shape:
43
-
44
- ```markdown
45
- # Research: [Topic]
46
-
47
- ## Summary
48
- [Key findings + recommendation, 1-3 paragraphs]
49
-
50
- ## Findings
51
- [Organized by sub-question. Add security / performance / cost subsections
52
- only where they're relevant to this topic.]
53
-
54
- ## Conflicts & Caveats
55
- [Conflicting or single-source claims, stale info]
56
-
57
- ## Recommendations
58
- [Actionable: what to do, code examples, pitfalls. Include a comparison if evaluating options.]
59
-
60
- ## References
61
- [Linked sources]
62
-
63
- ## Open Questions
64
- [Unresolved items — always include, even if empty.]
65
- ```
66
-
67
- **Standards:** accuracy (cross-referenced), currency (prefer last 12 months unless history
68
- matters), always cite with links. Deliver strategic intelligence that enables a decision,
69
- not a pile of links.
1
+ ---
2
+ name: research
3
+ description: "Research technical solutions and analyze architectures by spawning parallel researcher agents that search the web and cross-reference findings. Use for technology evaluation, best-practices research, solution design, and scalability/security/maintainability analysis."
4
+ license: MIT
5
+ argument-hint: "[topic]"
6
+ metadata:
7
+ author: Phuc Pham
8
+ version: "2.1.1"
9
+ ---
10
+
11
+ # Research
12
+
13
+ ## 1. Decompose
14
+
15
+ Break the topic into independent sub-questions. Note recency requirements (how current
16
+ the information must be) and any specific angles the user cares about (security, perf,
17
+ cost, migration path) — these shape both the queries and the final sections.
18
+
19
+ ## 2. Gather (parallel agents)
20
+
21
+ For each independent sub-question, dispatch a `researcher` agent via the Agent tool
22
+ (`subagent_type: "researcher"`). Run independent agents in a single message so they execute
23
+ concurrently. Scale the count to the topic's breadth; don't spawn overlapping agents.
24
+
25
+ Give each agent **one** sub-question plus any recency/angle constraints from step 1. The
26
+ agent handles query crafting, source prioritization, and returning findings with URLs.
27
+ Keep synthesis (steps 3–4) in the main agent.
28
+
29
+ ## 3. Cross-reference
30
+
31
+ Before synthesizing:
32
+ - **Verify** each significant claim across multiple independent sources.
33
+ - **Check dates** — flag stale information.
34
+ - **Surface conflicts** explicitly rather than silently picking a side.
35
+ - **Flag single-source claims** as unverified; discard or downgrade what fails.
36
+
37
+ ## 4. Report
38
+
39
+ Save to the output path if the main agent provided one; otherwise return inline. Cite
40
+ sources throughout. Sacrifice grammar for concision.
41
+
42
+ Adapt the structure to the topic — don't pad with empty sections. A typical shape:
43
+
44
+ ```markdown
45
+ # Research: [Topic]
46
+
47
+ ## Summary
48
+ [Key findings + recommendation, 1-3 paragraphs]
49
+
50
+ ## Findings
51
+ [Organized by sub-question. Add security / performance / cost subsections
52
+ only where they're relevant to this topic.]
53
+
54
+ ## Conflicts & Caveats
55
+ [Conflicting or single-source claims, stale info]
56
+
57
+ ## Recommendations
58
+ [Actionable: what to do, code examples, pitfalls. Include a comparison if evaluating options.]
59
+
60
+ ## References
61
+ [Linked sources]
62
+
63
+ ## Open Questions
64
+ [Unresolved items — always include, even if empty.]
65
+ ```
66
+
67
+ **Standards:** accuracy (cross-referenced), currency (prefer last 12 months unless history
68
+ matters), always cite with links. Deliver strategic intelligence that enables a decision,
69
+ not a pile of links.