heimdall-agent 1.0.0 → 1.2.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 (250) hide show
  1. package/README.md +57 -26
  2. package/README.pt-BR.md +443 -0
  3. package/agents/cloud-engineer.md +77 -0
  4. package/agents/code-sentinel.md +71 -34
  5. package/agents/database-architect.md +31 -25
  6. package/agents/frontend-designer.md +30 -28
  7. package/agents/mobile-designer.md +25 -24
  8. package/agents/modernizer.md +68 -0
  9. package/agents/orchestrator.md +107 -93
  10. package/agents/reviewer.md +102 -71
  11. package/agents/security-auditor.md +27 -27
  12. package/agents/tester.md +97 -90
  13. package/commands/grill-me.md +20 -4
  14. package/commands/orchestrate.md +16 -0
  15. package/commands/orchestrator.md +16 -0
  16. package/commands/plan.md +17 -1
  17. package/config/agents.json +31 -3
  18. package/config/mcp.json +72 -0
  19. package/config/models.json +26 -16
  20. package/config/profiles.json +2 -4
  21. package/config/skills.json +762 -573
  22. package/docs/SKILLS.md +393 -275
  23. package/docs/designs/old/2026-10-31 plan-lifecycle-backlog-and-clean-code-skill.md +87 -0
  24. package/docs/designs/old/2026-11-02 skill-upstream-audit-and-update.md +105 -0
  25. package/docs/designs/old/2026-11-05 communication-doctrine-bluf-ste.md +94 -0
  26. package/docs/designs/old/2026-11-06-cloud-engineer-and-resilience-synthesis.md +67 -0
  27. package/docs/designs/old/2026-11-06-herdr-native-agent-orchestration.md +45 -0
  28. package/docs/runs/skill-audit/2026-11-12-compare-report.json +1028 -0
  29. package/docs/runs/skill-audit/2026-11-12-upstream-audit.json +275 -0
  30. package/docs/runs/skill-audit/add_progressive_disclosure.cjs +30 -0
  31. package/docs/runs/skill-audit/check_heimdall_skills.ps1 +9 -0
  32. package/docs/runs/skill-audit/compare_classics.ps1 +26 -0
  33. package/docs/runs/skill-audit/compare_taste.ps1 +12 -0
  34. package/docs/runs/skill-audit/customization-report.json +380 -0
  35. package/docs/runs/skill-audit/diff_pending_skills.cjs +94 -0
  36. package/docs/runs/skill-audit/fetch_and_apply_skill.cjs +58 -0
  37. package/docs/runs/skill-audit/fetch_and_apply_taste_v2.cjs +65 -0
  38. package/docs/runs/skill-audit/inspect_pending_skills.cjs +71 -0
  39. package/docs/runs/skill-audit/inventory.json +308 -0
  40. package/docs/runs/skill-audit/list_local_taste.ps1 +1 -0
  41. package/docs/runs/skill-audit/phase5-update-plan.json +595 -0
  42. package/docs/runs/skill-audit/phase5-update-plan.md +138 -0
  43. package/docs/runs/skill-audit/probe.ps1 +16 -0
  44. package/docs/runs/skill-audit/probe_classics_branches.ps1 +3 -0
  45. package/docs/runs/skill-audit/probe_commits.ps1 +15 -0
  46. package/docs/runs/skill-audit/probe_repos.ps1 +17 -0
  47. package/docs/runs/skill-audit/probe_sentry_sec.ps1 +3 -0
  48. package/docs/runs/skill-audit/probe_sentry_sweep.ps1 +5 -0
  49. package/docs/runs/skill-audit/probe_snyk.ps1 +3 -0
  50. package/docs/runs/skill-audit/probe_snyk_recipes.ps1 +5 -0
  51. package/docs/runs/skill-audit/probe_taste_branches.ps1 +8 -0
  52. package/docs/runs/skill-audit/probe_taste_v19.ps1 +3 -0
  53. package/docs/runs/skill-audit/probe_user_repos.ps1 +19 -0
  54. package/docs/runs/skill-audit/prune_taste_skills.cjs +22 -0
  55. package/docs/runs/skill-audit/run_phase1_2.cjs +142 -0
  56. package/docs/runs/skill-audit/run_phase6_verification.cjs +107 -0
  57. package/docs/runs/skill-audit/show_16_details.ps1 +25 -0
  58. package/docs/runs/skill-audit/show_20_skills.ps1 +28 -0
  59. package/docs/runs/skill-audit/show_classics_diff.cjs +37 -0
  60. package/docs/runs/skill-audit/sync_agent_markdowns.cjs +30 -0
  61. package/docs/runs/skill-audit/taste-skill-upstream.md +542 -0
  62. package/docs/runs/skill-audit/update-manifest.md +88 -0
  63. package/docs/runs/skill-audit/update_config_skills.cjs +52 -0
  64. package/docs/runs/skill-audit/update_registry_phase7.cjs +83 -0
  65. package/docs/runs/skill-audit/upstream-status.json +563 -0
  66. package/docs/runs/skill-audit/verification-results.json +252 -0
  67. package/doctrine/AGENTS.md +42 -77
  68. package/hooks/git/pre-commit +11 -0
  69. package/hooks/heimdall-hook.cjs +81 -2
  70. package/hooks/herdr-agent-state.ps1 +55 -0
  71. package/hooks/hooks.json +0 -11
  72. package/lib/catalog-sync.cjs +167 -0
  73. package/lib/hermes-context.cjs +57 -0
  74. package/lib/model-context.cjs +123 -0
  75. package/lib/path-discovery.cjs +94 -0
  76. package/package.json +7 -3
  77. package/playbooks/01-interactive-grilling-gate.md +23 -6
  78. package/playbooks/02-fast-code-deep-verification.md +3 -2
  79. package/playbooks/03-adversarial-code-review.md +15 -7
  80. package/playbooks/05-canonical-plan-template.md +35 -19
  81. package/playbooks/06-model-registry-matrix.md +24 -13
  82. package/playbooks/07-legacy-code-modernization.md +74 -0
  83. package/playbooks/08-backlog-and-change-request-flow.md +122 -0
  84. package/setup.mjs +592 -172
  85. package/skills/antislop/SKILL.md +76 -56
  86. package/skills/antislop/VERSION +1 -0
  87. package/skills/antislop-copywriting/SKILL.md +407 -372
  88. package/skills/antislop-human/LICENSE-web-quality-skills +21 -0
  89. package/skills/antislop-human/SKILL.md +204 -147
  90. package/skills/antislop-human/contrast-check.py +168 -165
  91. package/skills/antislop-human/contrast-mcp.py +6 -3
  92. package/skills/antislop-human/references/A11Y-PATTERNS.md +249 -0
  93. package/skills/antislop-human/references/WCAG.md +127 -0
  94. package/skills/antislop-ui/LICENSE-web-quality-skills +21 -0
  95. package/skills/antislop-ui/SKILL.md +344 -304
  96. package/skills/antislop-ui/references/CORE-WEB-VITALS.md +181 -0
  97. package/skills/antislop-ui/references/WEB-BASELINE.md +28 -0
  98. package/skills/brainstorming/SKILL.md +296 -265
  99. package/skills/brainstorming/builder-check-prompt.md +23 -0
  100. package/skills/brainstorming/scripts/frame-template.html +213 -213
  101. package/skills/brainstorming/scripts/server.cjs +723 -723
  102. package/skills/brandkit/SKILL.md +798 -798
  103. package/skills/brutalist-skill/SKILL.md +93 -92
  104. package/skills/caveman/README.md +68 -0
  105. package/skills/caveman/SKILL.md +73 -38
  106. package/skills/claude-collaborator/SKILL.md +24 -44
  107. package/skills/clean-code/SKILL.md +152 -0
  108. package/skills/cloudflare-security-audit/AI-AND-LLM.md +83 -83
  109. package/skills/cloudflare-security-audit/ATTACK-CLASSES.md +130 -130
  110. package/skills/cloudflare-security-audit/CLIENT-SIDE.md +83 -83
  111. package/skills/cloudflare-security-audit/CLOUD-AND-DEPLOYMENT.md +86 -86
  112. package/skills/cloudflare-security-audit/DATA-ISOLATION-AND-LIFECYCLE.md +84 -84
  113. package/skills/cloudflare-security-audit/DESKTOP-MOBILE-AND-LOCAL-IPC.md +89 -89
  114. package/skills/cloudflare-security-audit/HUNTING.md +251 -251
  115. package/skills/cloudflare-security-audit/MEMORY-SAFETY-AND-BINARY.md +101 -101
  116. package/skills/cloudflare-security-audit/PROTOCOLS-RPC-AND-MESSAGING.md +81 -81
  117. package/skills/cloudflare-security-audit/RECONNAISSANCE.md +156 -156
  118. package/skills/cloudflare-security-audit/RESOURCE-EXHAUSTION-AND-AVAILABILITY.md +78 -78
  119. package/skills/cloudflare-security-audit/SKILL.md +192 -192
  120. package/skills/cloudflare-security-audit/SUPPLY-CHAIN-AND-RELEASE.md +73 -73
  121. package/skills/cloudflare-security-audit/VALIDATION-AND-REPORTING.md +186 -186
  122. package/skills/cloudflare-security-audit/WEB-PROTOCOL-AND-AUTH.md +105 -105
  123. package/skills/cloudflare-security-audit/report-schema.json +461 -461
  124. package/skills/cloudflare-security-audit/validate-coverage-ledger.cjs +872 -872
  125. package/skills/cloudflare-security-audit/validate-coverage-ledger.test.cjs +740 -740
  126. package/skills/cloudflare-security-audit/validate-findings.cjs +773 -773
  127. package/skills/cloudflare-security-audit/validate-findings.test.cjs +652 -652
  128. package/skills/codebase-design/DEEPENING.md +37 -0
  129. package/skills/codebase-design/DESIGN-IT-TWICE.md +44 -0
  130. package/skills/codebase-design/SKILL.md +114 -0
  131. package/skills/codex-collaborator/SKILL.md +24 -45
  132. package/skills/communication-doctrine/SKILL.md +89 -0
  133. package/skills/diagnosing-superpowers/SKILL.md +1 -1
  134. package/skills/diagnosing-superpowers/references/github-issues.md +3 -3
  135. package/skills/diagnosing-superpowers/templates/issue.md +23 -4
  136. package/skills/domain-modeling/ADR-FORMAT.md +47 -0
  137. package/skills/domain-modeling/GLOSSARY-FORMAT.md +60 -0
  138. package/skills/domain-modeling/SKILL.md +74 -0
  139. package/skills/executing-plans/SKILL.md +6 -56
  140. package/skills/executing-plans/scripts/task-done +52 -52
  141. package/skills/executing-plans/scripts/task-start +28 -28
  142. package/skills/gemini-collaborator/SKILL.md +24 -56
  143. package/skills/grill-me/SKILL.md +65 -0
  144. package/skills/handoff/SKILL.md +64 -0
  145. package/skills/herdr/SKILL.md +243 -0
  146. package/skills/image-to-code-skill/SKILL.md +1228 -1228
  147. package/skills/imagegen-frontend-mobile/SKILL.md +1465 -1465
  148. package/skills/imagegen-frontend-web/SKILL.md +987 -987
  149. package/skills/improve-codebase-architecture/HTML-REPORT.md +123 -0
  150. package/skills/improve-codebase-architecture/SKILL.md +71 -0
  151. package/skills/karpathy-guidelines/SKILL.md +67 -67
  152. package/skills/mcp-engineering/SKILL.md +74 -0
  153. package/skills/minimalist-skill/SKILL.md +87 -85
  154. package/skills/output-skill/SKILL.md +49 -49
  155. package/skills/owasp-security/reference/config-and-supply-chain.md +346 -344
  156. package/skills/owasp-security/reference/languages.md +378 -372
  157. package/skills/owasp-security/reference/owasp-report.md +1144 -1140
  158. package/skills/owasp-security/reference/review-checklist.md +134 -132
  159. package/skills/ponytail/SKILL.md +36 -52
  160. package/skills/postgres-best-practices/SKILL.md +30 -52
  161. package/skills/postgres-best-practices/references/backup-restore.md +372 -0
  162. package/skills/postgres-best-practices/references/bulk-loading.md +315 -0
  163. package/skills/postgres-best-practices/references/connection-pooling.md +310 -0
  164. package/skills/postgres-best-practices/references/hot-standby.md +221 -0
  165. package/skills/postgres-best-practices/references/indexing.md +318 -0
  166. package/skills/postgres-best-practices/references/logical-replication.md +610 -0
  167. package/skills/postgres-best-practices/references/major-version-upgrades.md +334 -0
  168. package/skills/postgres-best-practices/references/performance-diagnostics.md +553 -0
  169. package/skills/postgres-best-practices/references/query-optimization.md +294 -0
  170. package/skills/postgres-best-practices/references/query-patterns.md +566 -0
  171. package/skills/postgres-best-practices/references/schema-design.md +362 -0
  172. package/skills/postgres-best-practices/references/security-roles.md +489 -0
  173. package/skills/postgres-best-practices/references/transaction-isolation.md +344 -0
  174. package/skills/progressive-disclosure/SKILL.md +68 -0
  175. package/skills/pstack-discipline/SKILL.md +40 -0
  176. package/skills/receiving-code-review/SKILL.md +2 -23
  177. package/skills/requesting-code-review/SKILL.md +7 -36
  178. package/skills/soft-skill/SKILL.md +99 -98
  179. package/skills/stitch-skill/DESIGN.md +121 -121
  180. package/skills/stitch-skill/SKILL.md +185 -184
  181. package/skills/strix-security/SKILL.md +54 -53
  182. package/skills/subagent-driven-development/SKILL.md +35 -264
  183. package/skills/subagent-driven-development/references/batching.md +11 -0
  184. package/skills/subagent-driven-development/references/cannot-verify.md +10 -0
  185. package/skills/subagent-driven-development/references/final-review.md +47 -0
  186. package/skills/subagent-driven-development/references/fix-loop.md +77 -0
  187. package/skills/subagent-driven-development/references/handling-reports.md +15 -0
  188. package/skills/subagent-driven-development/references/preflight.md +26 -0
  189. package/skills/subagent-driven-development/references/resuming.md +12 -0
  190. package/skills/subagent-driven-development/scripts/review-package +53 -53
  191. package/skills/subagent-driven-development/scripts/sdd-workspace +87 -82
  192. package/skills/subagent-driven-development/scripts/task-brief +43 -43
  193. package/skills/systematic-debugging/SKILL.md +283 -306
  194. package/skills/taste-skill/SKILL.md +542 -1206
  195. package/skills/taste-skill/references/app-screens.md +1199 -0
  196. package/skills/taste-skill/references/colour.md +141 -0
  197. package/skills/taste-skill/references/copy.md +177 -0
  198. package/skills/taste-skill/references/critique.md +182 -0
  199. package/skills/taste-skill/references/imagery.md +791 -0
  200. package/skills/taste-skill/references/layout.md +292 -0
  201. package/skills/taste-skill/references/motion.md +980 -0
  202. package/skills/taste-skill/references/research.md +356 -0
  203. package/skills/taste-skill/references/scenes.md +174 -0
  204. package/skills/taste-skill/references/tells.md +115 -0
  205. package/skills/taste-skill/references/type.md +170 -0
  206. package/skills/test-driven-development/SKILL.md +330 -337
  207. package/skills/thermo/SKILL.md +67 -0
  208. package/skills/threat-modeling/SKILL.md +55 -0
  209. package/skills/to-spec/SKILL.md +75 -0
  210. package/skills/to-tickets/SKILL.md +105 -0
  211. package/skills/trailofbits-audit-context/SKILL.md +72 -72
  212. package/skills/trailofbits-insecure-defaults/commands/audit.md +35 -0
  213. package/skills/trailofbits-insecure-defaults/references/debug-features.json +13 -13
  214. package/skills/trailofbits-insecure-defaults/references/debug-features.md +75 -75
  215. package/skills/trailofbits-insecure-defaults/references/default-credentials.json +12 -12
  216. package/skills/trailofbits-insecure-defaults/references/default-credentials.md +76 -76
  217. package/skills/trailofbits-insecure-defaults/references/fail-open-security.json +11 -11
  218. package/skills/trailofbits-insecure-defaults/references/fail-open-security.md +70 -70
  219. package/skills/trailofbits-insecure-defaults/references/fallback-secrets.json +11 -11
  220. package/skills/trailofbits-insecure-defaults/references/fallback-secrets.md +70 -70
  221. package/skills/trailofbits-insecure-defaults/references/permissive-access.json +13 -13
  222. package/skills/trailofbits-insecure-defaults/references/permissive-access.md +62 -62
  223. package/skills/trailofbits-insecure-defaults/references/weak-crypto.json +13 -13
  224. package/skills/trailofbits-insecure-defaults/references/weak-crypto.md +71 -71
  225. package/skills/trailofbits-triage-brocards/SKILL.md +208 -208
  226. package/skills/verification-before-completion/SKILL.md +0 -14
  227. package/skills/wayfinder/SKILL.md +128 -0
  228. package/skills/writing-plans/SKILL.md +11 -15
  229. package/skills/writing-skills/SKILL.md +21 -303
  230. package/skills/writing-skills/references/CLAUDE_MD_TESTING.md +189 -0
  231. package/skills/writing-skills/references/anthropic-best-practices.md +1150 -0
  232. package/skills/writing-skills/references/bulletproofing.md +80 -0
  233. package/skills/writing-skills/references/discovery.md +201 -0
  234. package/skills/writing-skills/references/flowcharts.md +37 -0
  235. package/skills/writing-skills/references/graphviz-conventions.dot +172 -0
  236. package/skills/writing-skills/references/persuasion-principles.md +187 -0
  237. package/skills/writing-skills/references/testing-skills-with-subagents.md +384 -0
  238. package/tools/{claude-bridge.ps1 → archive/claude-bridge.ps1} +10 -7
  239. package/tools/{codex-bridge.ps1 → archive/codex-bridge.ps1} +1 -1
  240. package/tools/{gemini-bridge.ps1 → archive/gemini-bridge.ps1} +12 -19
  241. package/skills/gpt-tasteskill/SKILL.md +0 -74
  242. package/skills/taste-skill-v1/SKILL.md +0 -226
  243. /package/tools/{claude-bridge.cmd → archive/claude-bridge.cmd} +0 -0
  244. /package/tools/{claude-bridge.sh → archive/claude-bridge.sh} +0 -0
  245. /package/tools/{codex-bridge.cmd → archive/codex-bridge.cmd} +0 -0
  246. /package/tools/{codex-bridge.sh → archive/codex-bridge.sh} +0 -0
  247. /package/tools/{codexcli-bridge.cmd → archive/codexcli-bridge.cmd} +0 -0
  248. /package/tools/{codexcli-bridge.ps1 → archive/codexcli-bridge.ps1} +0 -0
  249. /package/tools/{gemini-bridge.cmd → archive/gemini-bridge.cmd} +0 -0
  250. /package/tools/{gemini-bridge.sh → archive/gemini-bridge.sh} +0 -0
@@ -0,0 +1,37 @@
1
+ # Deepening
2
+
3
+ How to deepen a cluster of shallow modules safely, given its dependencies. Assumes the vocabulary in [SKILL.md](SKILL.md): **module**, **interface**, **seam**, **adapter**.
4
+
5
+ ## Dependency categories
6
+
7
+ When assessing a candidate for deepening, classify its dependencies. The category determines how the deepened module is tested across its seam.
8
+
9
+ ### 1. In-process
10
+
11
+ Pure computation, in-memory state, no I/O. Always deepenable: merge the modules and test through the new interface directly. No adapter needed.
12
+
13
+ ### 2. Local-substitutable
14
+
15
+ Dependencies that have local test stand-ins (PGLite for Postgres, in-memory filesystem). Deepenable if the stand-in exists. The deepened module is tested with the stand-in running in the test suite. The seam is internal; no port at the module's external interface.
16
+
17
+ ### 3. Remote but owned (Ports & Adapters)
18
+
19
+ Your own services across a network boundary (microservices, internal APIs). Define a **port** (interface) at the seam. The deep module owns the logic; the transport is injected as an **adapter**. Tests use an in-memory adapter. Production uses an HTTP/gRPC/queue adapter.
20
+
21
+ Recommendation shape: *"Define a port at the seam, implement an HTTP adapter for production and an in-memory adapter for testing, so the logic sits in one deep module even though it's deployed across a network."*
22
+
23
+ ### 4. True external (Mock)
24
+
25
+ Third-party services (Stripe, Twilio, etc.) you don't control. The deepened module takes the external dependency as an injected port; tests provide a mock adapter.
26
+
27
+ ## Seam discipline
28
+
29
+ - **One adapter means a hypothetical seam. Two adapters means a real one.** Don't introduce a port unless at least two adapters are justified (typically production + test). A single-adapter seam is just indirection.
30
+ - **Internal seams vs external seams.** A deep module can have internal seams (private to its implementation, used by its own tests) as well as the external seam at its interface. Don't expose internal seams through the interface just because tests use them.
31
+
32
+ ## Testing strategy: replace, don't layer
33
+
34
+ - Old unit tests on shallow modules become waste once tests at the deepened module's interface exist; delete them.
35
+ - Write new tests at the deepened module's interface. The **interface is the test surface**.
36
+ - Tests assert on observable outcomes through the interface, not internal state.
37
+ - Tests should survive internal refactors, since they describe behaviour, not implementation. If a test has to change when the implementation changes, it's testing past the interface.
@@ -0,0 +1,44 @@
1
+ # Design It Twice
2
+
3
+ When the user wants to explore alternative interfaces for a chosen deepening candidate, use this parallel sub-agent pattern. Based on "Design It Twice" (Ousterhout): your first idea is unlikely to be the best.
4
+
5
+ Uses the vocabulary in [SKILL.md](SKILL.md): **module**, **interface**, **seam**, **adapter**, **leverage**.
6
+
7
+ ## Process
8
+
9
+ ### 1. Frame the problem space
10
+
11
+ Before spawning sub-agents, write a user-facing explanation of the problem space for the chosen candidate:
12
+
13
+ - The constraints any new interface would need to satisfy
14
+ - The dependencies it would rely on, and which category they fall into (see [DEEPENING.md](DEEPENING.md))
15
+ - A rough illustrative code sketch to ground the constraints, not a proposal, just a way to make the constraints concrete
16
+
17
+ Show this to the user, then immediately proceed to Step 2. The user reads and thinks while the sub-agents work in parallel.
18
+
19
+ ### 2. Spawn sub-agents
20
+
21
+ Spawn 3+ sub-agents in parallel, each with a fresh context window. Each must produce a **radically different** interface for the deepened module.
22
+
23
+ Prompt each sub-agent with a separate technical brief (file paths, coupling details, dependency category from [DEEPENING.md](DEEPENING.md), what sits behind the seam). The brief is independent of the user-facing problem-space explanation in Step 1. Give each agent a different design constraint:
24
+
25
+ - Agent 1: "Minimize the interface: aim for 1–3 entry points max. Maximise leverage per entry point."
26
+ - Agent 2: "Maximise flexibility: support many use cases and extension."
27
+ - Agent 3: "Optimise for the most common caller: make the default case trivial."
28
+ - Agent 4 (if applicable): "Design around ports & adapters for cross-seam dependencies."
29
+
30
+ Include both [SKILL.md](SKILL.md) vocabulary and GLOSSARY.md vocabulary in the brief so each sub-agent names things consistently with the architecture language and the project's domain language.
31
+
32
+ Each sub-agent outputs:
33
+
34
+ 1. Interface (types, methods, params, plus invariants, ordering, error modes)
35
+ 2. Usage example showing how callers use it
36
+ 3. What the implementation hides behind the seam
37
+ 4. Dependency strategy and adapters (see [DEEPENING.md](DEEPENING.md))
38
+ 5. Trade-offs: where leverage is high, where it's thin
39
+
40
+ ### 3. Present and compare
41
+
42
+ Present designs sequentially so the user can absorb each one, then compare them in prose. Contrast by **depth** (leverage at the interface), **locality** (where change concentrates), and **seam placement**.
43
+
44
+ After comparing, give your own recommendation: which design you think is strongest and why. If elements from different designs would combine well, propose a hybrid. Be opinionated: the user wants a strong read, not a menu.
@@ -0,0 +1,114 @@
1
+ ---
2
+ name: codebase-design
3
+ description: Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.
4
+ ---
5
+
6
+ # Codebase Design
7
+
8
+ Design **deep modules**: a lot of behaviour behind a small interface, placed at a clean seam, testable through that interface. Use this language and these principles wherever code is being designed or restructured. The aim is leverage for callers, locality for maintainers, and testability for everyone.
9
+
10
+ ## Glossary
11
+
12
+ Use these terms exactly: don't substitute "component," "service," "API," or "boundary." Consistent language is the whole point.
13
+
14
+ **Module**: anything with an interface and an implementation. Deliberately scale-agnostic: a function, class, package, or tier-spanning slice. _Avoid_: unit, component, service.
15
+
16
+ **Interface**: everything a caller must know to use the module correctly: the type signature, but also invariants, ordering constraints, error modes, required configuration, and performance characteristics. _Avoid_: API, signature (too narrow, they refer only to the type-level surface).
17
+
18
+ **Implementation**: what's inside a module, its body of code. Distinct from **Adapter**: a thing can be a small adapter with a large implementation (a Postgres repo) or a large adapter with a small implementation (an in-memory fake). Reach for "adapter" when the seam is the topic; "implementation" otherwise.
19
+
20
+ **Depth**: leverage at the interface. The amount of behaviour a caller (or test) can exercise per unit of interface they have to learn. A module is **deep** when a large amount of behaviour sits behind a small interface, **shallow** when the interface is nearly as complex as the implementation.
21
+
22
+ **Seam** _(Michael Feathers)_: a place where you can alter behaviour without editing in that place; the *location* at which a module's interface lives. Where to put the seam is its own design decision, distinct from what goes behind it. _Avoid_: boundary (overloaded with DDD's bounded context).
23
+
24
+ **Adapter**: a concrete thing that satisfies an interface at a seam. Describes *role* (what slot it fills), not substance (what's inside).
25
+
26
+ **Leverage**: what callers get from depth. More capability per unit of interface they learn. One implementation pays back across N call sites and M tests.
27
+
28
+ **Locality**: what maintainers get from depth. Change, bugs, knowledge, and verification concentrate in one place rather than spreading across callers. Fix once, fixed everywhere.
29
+
30
+ ## Deep vs shallow
31
+
32
+ **Deep module** = small interface + lots of implementation:
33
+
34
+ ```
35
+ ┌─────────────────────┐
36
+ │ Small Interface │ ← Few methods, simple params
37
+ ├─────────────────────┤
38
+ │ │
39
+ │ Deep Implementation│ ← Complex logic hidden
40
+ │ │
41
+ └─────────────────────┘
42
+ ```
43
+
44
+ **Shallow module** = large interface + little implementation (avoid):
45
+
46
+ ```
47
+ ┌─────────────────────────────────┐
48
+ │ Large Interface │ ← Many methods, complex params
49
+ ├─────────────────────────────────┤
50
+ │ Thin Implementation │ ← Just passes through
51
+ └─────────────────────────────────┘
52
+ ```
53
+
54
+ When designing an interface, ask:
55
+
56
+ - Can I reduce the number of methods?
57
+ - Can I simplify the parameters?
58
+ - Can I hide more complexity inside?
59
+
60
+ ## Principles
61
+
62
+ - **Depth is a property of the interface, not the implementation.** A deep module can be internally composed of small, mockable, swappable parts; they just aren't part of the interface. A module can have **internal seams** (private to its implementation, used by its own tests) as well as the **external seam** at its interface.
63
+ - **The deletion test.** Imagine deleting the module. If complexity vanishes, it was a pass-through. If complexity reappears across N callers, it was earning its keep.
64
+ - **The interface is the test surface.** Callers and tests cross the same seam. If you want to test *past* the interface, the module is probably the wrong shape.
65
+ - **One adapter means a hypothetical seam. Two adapters means a real one.** Don't introduce a seam unless something actually varies across it.
66
+
67
+ ## Designing for testability
68
+
69
+ Good interfaces make testing natural:
70
+
71
+ 1. **Accept dependencies, don't create them.**
72
+
73
+ ```typescript
74
+ // Testable
75
+ function processOrder(order, paymentGateway) {}
76
+
77
+ // Hard to test
78
+ function processOrder(order) {
79
+ const gateway = new StripeGateway();
80
+ }
81
+ ```
82
+
83
+ 2. **Return results, don't produce side effects.**
84
+
85
+ ```typescript
86
+ // Testable
87
+ function calculateDiscount(cart): Discount {}
88
+
89
+ // Hard to test
90
+ function applyDiscount(cart): void {
91
+ cart.total -= discount;
92
+ }
93
+ ```
94
+
95
+ 3. **Small surface area.** Fewer methods = fewer tests needed. Fewer params = simpler test setup.
96
+
97
+ ## Relationships
98
+
99
+ - A **Module** has exactly one **Interface** (the surface it presents to callers and tests).
100
+ - **Depth** is a property of a **Module**, measured against its **Interface**.
101
+ - A **Seam** is where a **Module**'s **Interface** lives.
102
+ - An **Adapter** sits at a **Seam** and satisfies the **Interface**.
103
+ - **Depth** produces **Leverage** for callers and **Locality** for maintainers.
104
+
105
+ ## Rejected framings
106
+
107
+ - **Depth as ratio of implementation-lines to interface-lines** (Ousterhout): rewards padding the implementation. We use depth-as-leverage instead.
108
+ - **"Interface" as the TypeScript `interface` keyword or a class's public methods**: too narrow: interface here includes every fact a caller must know.
109
+ - **"Boundary"**: overloaded with DDD's bounded context. Say **seam** or **interface**.
110
+
111
+ ## Going deeper
112
+
113
+ - **Deepening a cluster given its dependencies**, see [DEEPENING.md](DEEPENING.md): dependency categories, seam discipline, and replace-don't-layer testing.
114
+ - **Exploring alternative interfaces**, see [DESIGN-IT-TWICE.md](DESIGN-IT-TWICE.md): spin up parallel sub-agents to design the interface several radically different ways, then compare on depth, locality, and seam placement.
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: codex-collaborator
3
3
  description: >
4
- Coordinate with OpenAI Codex CLI (codex.exe) to cross-validate changes, request second-opinion
4
+ Coordinate with OpenAI Codex CLI (codex.exe) via Herdr to cross-validate changes, request second-opinion
5
5
  adversarial reviews on git diffs, or validate test and build executions.
6
6
  upstream: https://github.com/bepaldes/heimdall-agent
7
7
  version: 1.0.0
@@ -9,19 +9,7 @@ version: 1.0.0
9
9
 
10
10
  # Codex Collaborator Skill
11
11
 
12
- This skill enables Google Antigravity and Claude Code to orchestrate tasks with OpenAI Codex CLI (`codex.exe`), delegating complex architectural reasoning, diff reviews, and adversarial validation across the tri-directional bridge.
13
-
14
- ## Real-Time Visibility in Herdr (Right Split & Auto-Close)
15
-
16
- By default when running inside Herdr, all bridge invocations automatically:
17
- - **Split the calling screen to the right**: Creates a side-by-side split pane in your current Herdr window.
18
- - **Display a prominent request banner**:
19
- - Caller AI $\rightarrow$ Target Model (`gpt-6-astra`)
20
- - Action & Working Directory
21
- - **`>> WHAT IS BEING REQUESTED:`** A highlighted box showing the exact prompt/instructions.
22
- - Summary of modified files (`git diff --stat`) for code reviews.
23
- - **Stream Codex's live execution**: Real-time display of reasoning, tool calls, and output right in that split pane.
24
- - **Auto-close when complete**: Automatically closes the right pane after finishing and collapses your screen back to normal, returning the captured output to the caller.
12
+ This skill enables Google Antigravity and Claude Code to orchestrate tasks with OpenAI Codex CLI (`codex.exe`) directly through native Herdr multiplexing, delegating complex architectural reasoning, diff reviews, and adversarial validation.
25
13
 
26
14
  ## When to Activate
27
15
 
@@ -29,48 +17,39 @@ By default when running inside Herdr, all bridge invocations automatically:
29
17
  - In multi-agent plans requiring tri-directional cross-model validation (Claude $\rightarrow$ Codex, or Gemini $\rightarrow$ Codex).
30
18
  - When validating complex TypeScript types, database migrations, or edge-case logic with an alternative reasoning perspective.
31
19
 
32
- ## Available Actions via `tools/codex-bridge.ps1`
20
+ ## Orchestration Method: Native Herdr Agent (`herdr` skill)
33
21
 
34
- Run commands using the project PowerShell helper script:
22
+ When running inside Herdr (`$env:HERDR_ENV = "1"`), communicate directly using Herdr's native agent orchestration. This maintains a persistent session across turns, preserves context, respects interactive approvals (`blocked`), and handles bracketed paste:
35
23
 
36
- ### 1. Adversarial Code Review of Git Diff
37
- Splits the screen to the right, runs Codex CLI review, streams live, and auto-closes:
38
- ```powershell
39
- powershell -ExecutionPolicy Bypass -File tools/codex-bridge.ps1 review
24
+ ### 1. Fast Path: Re-use Active Idle Agent
25
+ Before splitting a pane, check if a Codex agent is already running and idle:
26
+ ```bash
27
+ herdr agent list
40
28
  ```
41
- To provide specific review instructions:
42
- ```powershell
43
- powershell -ExecutionPolicy Bypass -File tools/codex-bridge.ps1 review "Focus on security vulnerabilities and boundary conditions"
29
+ If an agent named `codex-reviewer` or `codex` is idle or done, prompt it directly:
30
+ ```bash
31
+ herdr agent prompt codex-reviewer "Review the latest changes." --wait --timeout 120000
44
32
  ```
45
33
 
46
- ### 2. Consult Codex for Architectural Second Opinion
47
- Sends an inquiry or architectural prompt directly to Codex (Astra) in a right-split pane:
48
- ```powershell
49
- powershell -ExecutionPolicy Bypass -File tools/codex-bridge.ps1 ask "How should we design idempotency keys for external webhook processing?"
34
+ ### 2. Spawning a New Codex Agent (Single-Execution Batch)
35
+ If no active Codex agent exists, batch pane creation and agent startup in a single command:
36
+ ```bash
37
+ PANE_ID=$(herdr pane split --current --direction right --cwd "$PWD" --no-focus | jq -r '.result.pane.pane_id')
38
+ herdr agent start codex-reviewer --kind codex --pane "$PANE_ID"
39
+ herdr agent prompt codex-reviewer "Review git diff for security regressions and boundary conditions." --wait --timeout 120000
50
40
  ```
51
41
 
52
- ### 3. Validate Test or Build Run
53
- Runs a test command and has Codex analyze output and errors in a right-split pane:
54
- ```powershell
55
- powershell -ExecutionPolicy Bypass -File tools/codex-bridge.ps1 validate "pnpm test"
42
+ ### 3. Read Findings into Context
43
+ ```bash
44
+ herdr agent read codex-reviewer --source recent-unwrapped --lines 120
56
45
  ```
57
46
 
58
- ### 4. Interactive Handoff to Codex in a Right Split Pane
59
- Launches a full interactive Codex session in a right split pane pre-loaded with a task:
60
- ```powershell
61
- powershell -ExecutionPolicy Bypass -File tools/codex-bridge.ps1 interactive "Let's investigate this edge case together"
47
+ ### 4. Interactive Collaboration
48
+ When an interactive session or clarification is needed, send keys or prompt interactively:
49
+ ```bash
50
+ herdr agent send-keys codex-reviewer enter
62
51
  ```
63
52
 
64
- ### Display & Control Flags:
65
- - *(default)*: Splits the current Herdr screen to the right, streams live, and auto-closes when done.
66
- - `-KeepOpen`: Keeps the split pane open after completion instead of auto-closing.
67
- - `-Tab`: Opens in a new Herdr tab instead of splitting the screen.
68
- - `-Window`: Forces a standalone OS console window instead of Herdr.
69
- - `-Headless`: Runs silently in the background (for CI/unattended scripts).
70
- - `-NoFocus`: Prevents switching focus to the right pane.
71
- - `-Model <name>`: Override model (e.g. `-Model gpt-6-astra`).
72
- - `-Effort <level>`: Reasoning effort (`low`, `medium`, `high`, `xhigh`).
73
-
74
53
  ## Guidelines for Collaborating Agents
75
54
 
76
55
  - **Synthesize, Don't Blindly Echo**: When Codex returns feedback, analyze its critiques against the project's requirements and design system.
@@ -0,0 +1,89 @@
1
+ ---
2
+ name: communication-doctrine
3
+ description: >
4
+ Bottom Line Up Front (BLUF) and Simplified Technical English (STE) communication doctrine.
5
+ Enforces zero-latency verdicts in reports and unambiguous, imperative step definitions in plans.
6
+ ---
7
+
8
+ # Communication Doctrine: BLUF & Simplified Technical English (STE)
9
+
10
+ This skill governs structured communication across Google Antigravity, Claude Code, and OpenAI Codex CLI. It eliminates AI throat-clearing, hidden conclusions, and linguistic ambiguity.
11
+
12
+ ---
13
+
14
+ ## 1. Macro Architecture: Bottom Line Up Front (BLUF)
15
+
16
+ Always state the decision, status, verdict, or core recommendation in the **first 1–2 sentences** before presenting context, analysis, or supporting steps.
17
+
18
+ ### Schema A: Subagent Scratchpad Handoff (`docs/runs/<task_id>/report.md`)
19
+ Every subagent report must open with this exact 3-line block:
20
+ ```markdown
21
+ ### Subagent BLUF
22
+ - **Status**: SUCCESS | FAILURE | ESCALATED
23
+ - **Blast Radius**: [Files modified, tests added/executed, zero dev servers spawned]
24
+ - **Deliverable**: [Path to diff, artifact, or commit hash]
25
+ ```
26
+
27
+ ### Schema B: Code Reviewer & Security Sentinel Verdict (`agents/reviewer.md`)
28
+ Every review or audit output must open with this exact verdict block:
29
+ ```markdown
30
+ ### Review Verdict: APPROVED | BLOCKED | REVISION_NEEDED
31
+ - **Blockers**: <count>
32
+ - **Warnings**: <count>
33
+ - **Nits**: <count>
34
+ - **Mandatory Action**: [1-sentence summary of immediate action required before merge, or "None"]
35
+ ```
36
+
37
+ ### Schema C: Implementation Plan Header (`docs/designs/`)
38
+ Every implementation plan must lead with:
39
+ ```markdown
40
+ ### Plan BLUF
41
+ - **Goal**: [1 sentence describing exactly what is built]
42
+ - **Architectural Approach**: [1-2 sentences on core mechanism]
43
+ - **Risk & Blast Radius**: [Low | Medium | High — state key failure modes]
44
+ - **Human Approval Gate**: [Required before Phase X | Autonomous non-destructive]
45
+ ```
46
+
47
+ ---
48
+
49
+ ## 2. Micro Syntax: Simplified Technical English (STE)
50
+
51
+ Derived from ASD-STE100 principles, STE eliminates ambiguous interpretation, reduces token waste, and guarantees deterministic execution by child subagents.
52
+
53
+ ### Rule 1: Imperative Verb First
54
+ Every procedural step must start with an active imperative verb:
55
+ * **Approved Verbs**: `Create`, `Modify`, `Assert`, `Verify`, `Delete`, `Run`, `Open`, `Extract`, `Replace`, `Benchmark`.
56
+ * **Prohibited**: Passive constructions (*"The file should be updated..."*), conversational requests (*"Let's go ahead and..."*), or hedged steps (*"Consider checking..."*).
57
+
58
+ ### Rule 2: Strict Sentence Length Limits
59
+ * **Procedural Steps**: Maximum **20 words** per step. Each step represents exactly one checkable operation.
60
+ * **Descriptive Text**: Maximum **25 words** per sentence.
61
+
62
+ ### Rule 3: Banned Ambiguous Qualifiers (The Zero-Vagueness Lexicon)
63
+ The following words mask missing specifications and are strictly prohibited in implementation steps and suggested fixes:
64
+
65
+ | Banned Word | Why Prohibited | STE Replacement Pattern |
66
+ | :--- | :--- | :--- |
67
+ | `ensure` | Does not specify the mechanism. | `Verify <condition> equals <expected>. If not, <action>.` |
68
+ | `properly` | Subjective without testable criteria. | `Assert <field> matches regex <pattern>.` |
69
+ | `appropriately` | Defers specification to executor. | State the exact configuration parameter or value. |
70
+ | `gracefully` | Vague error handling. | `Catch <ErrorType>, log warning, and return <FallbackValue>.` |
71
+ | `as needed` / `as appropriate` | Unbounded scope. | Explicitly list the conditions or omit the step. |
72
+ | `robustly` / `seamlessly` | Pure AI marketing filler. | Delete the word. |
73
+ | `etc.` | Executor cannot guess remaining items. | List all items exhaustively. |
74
+
75
+ ### Rule 4: Explicit Object Naming (No Floating Pronouns)
76
+ Do not use ambiguous pronouns (*"it"*, *"this"*, *"they"*, *"that"*) when referring to code symbols, files, or error states. Always repeat the specific noun:
77
+ * *Bad*: *"Read the config and update it so it does not fail when it is missing."*
78
+ * *STE*: *"Read `config.json`. If `port` key is missing, assign default port `8080`."*
79
+
80
+ ---
81
+
82
+ ## 3. Communication Checklist
83
+
84
+ Before finalizing any plan, subagent report, or review output:
85
+ - [ ] Verdict or conclusion is on Line 1 (BLUF).
86
+ - [ ] Procedural steps start with an approved imperative verb.
87
+ - [ ] No procedural step exceeds 20 words.
88
+ - [ ] No banned qualifiers (`ensure`, `properly`, `appropriately`, `gracefully`, `as needed`, `etc.`).
89
+ - [ ] All code targets and file paths are explicitly named.
@@ -100,7 +100,7 @@ yourself in step 3 and which findings to lead with in the verdict.
100
100
  partner either.
101
101
  - **Approval gates.** No archive before your partner has seen the scrub
102
102
  log and file list. No issue or comment before they approve the exact
103
- text.
103
+ text, and none with a placeholder summary.
104
104
  - **Intake before analysis.** Nothing in steps 2–7 starts until your
105
105
  partner has answered. If they are away, write the questions and stop.
106
106
  A statement you reconstructed for them is not an answer. An
@@ -36,11 +36,11 @@ labels land only for collaborators; the template footer still marks the
36
36
  issue as skill-filed. `gh` cannot attach files: give your partner the
37
37
  bundle path to attach through the browser after the issue exists.
38
38
 
39
- Without `gh`, hand over a prefilled link on the `diagnosis_report.md`
40
- template, which applies both labels for any reporter:
39
+ Without `gh`, hand over a prefilled link on the `bug_report.md` template,
40
+ which applies the `bug` label for any reporter:
41
41
 
42
42
  ```
43
- https://github.com/obra/superpowers/issues/new?template=diagnosis_report.md&title=<url-encoded title>&body=<url-encoded body>
43
+ https://github.com/obra/superpowers/issues/new?template=bug_report.md&title=<url-encoded title>&body=<url-encoded body>
44
44
  ```
45
45
 
46
46
  GitHub rejects URLs over about 8,000 characters; past that, send the link
@@ -2,6 +2,20 @@ Title: <skill or symptom>: <one-line observable> (<harness>)
2
2
 
3
3
  - [x] I searched existing issues and this is not a duplicate (searched: <query terms>; closest: <#n title, or "none">)
4
4
 
5
+ ## Who's filing this report? (required)
6
+
7
+ <model and harness of this session>, filing on behalf of <how your
8
+ partner wants to be named, or "my human partner">, who asked: "<their
9
+ request from this session that led to the diagnosis or the issue,
10
+ scrubbed>"
11
+
12
+ ## Human-authored summary (required, under 200 words)
13
+
14
+ <Your partner's own words on what went wrong and what should have
15
+ happened, pasted as written. Ask for them; a placeholder here means the
16
+ issue is not ready to file. If they run long, ask them to trim rather
17
+ than editing their words.>
18
+
5
19
  ## Environment (required)
6
20
 
7
21
  | Field | Value | Provenance / supporting evidence |
@@ -17,8 +31,12 @@ Title: <skill or symptom>: <one-line observable> (<harness>)
17
31
 
18
32
  - [ ] I confirmed this issue does not occur without Superpowers installed
19
33
 
20
- The reporter has not tried reproducing without superpowers. Evidence for
21
- involvement is below; it does not establish cause.
34
+ How I verified that this issue does not reproduce without Superpowers:
35
+ <"Not tried", or what your partner ran without superpowers and what
36
+ happened, with the transcript path if there is one. Tick the box above
37
+ only when a transcript shows the problem did not recur.>
38
+
39
+ Evidence for involvement is below; it does not establish cause.
22
40
 
23
41
  ## What happened?
24
42
 
@@ -47,5 +65,6 @@ Superpowers involvement per the diagnosis report: <possible | likely>, with
47
65
  evidence at <transcript lines>. This report does not propose a fix.
48
66
 
49
67
  ---
50
- Filed with the `diagnosing-superpowers` skill. Model, harness, harness
51
- version, and installed plugins are listed above.
68
+ Filed with the `diagnosing-superpowers` skill. The filing model and
69
+ harness are under "Who's filing"; the diagnosed session's model, harness,
70
+ versions, and plugins are in the Environment table.
@@ -0,0 +1,47 @@
1
+ # ADR Format
2
+
3
+ ADRs live in `docs/adr/` and use sequential numbering: `0001-slug.md`, `0002-slug.md`, etc.
4
+
5
+ Create the `docs/adr/` directory lazily: only when the first ADR is needed.
6
+
7
+ ## Template
8
+
9
+ ```md
10
+ # {Short title of the decision}
11
+
12
+ {1-3 sentences: what's the context, what did we decide, and why.}
13
+ ```
14
+
15
+ That's it. An ADR can be a single paragraph. The value is in recording *that* a decision was made and *why*, not in filling out sections.
16
+
17
+ ## Optional sections
18
+
19
+ Only include these when they add genuine value. Most ADRs won't need them.
20
+
21
+ - **Status** frontmatter (`proposed | accepted | deprecated | superseded by ADR-NNNN`): useful when decisions are revisited
22
+ - **Considered Options**: only when the rejected alternatives are worth remembering
23
+ - **Consequences**: only when non-obvious downstream effects need to be called out
24
+
25
+ ## Numbering
26
+
27
+ Scan `docs/adr/` for the highest existing number and increment by one.
28
+
29
+ ## When to offer an ADR
30
+
31
+ All three of these must be true:
32
+
33
+ 1. **Hard to reverse**: the cost of changing your mind later is meaningful
34
+ 2. **Surprising without context**: a future reader will look at the code and wonder "why on earth did they do it this way?"
35
+ 3. **The result of a real trade-off**: there were genuine alternatives and you picked one for specific reasons
36
+
37
+ If a decision is easy to reverse, skip it: you'll just reverse it. If it's not surprising, nobody will wonder why. If there was no real alternative, there's nothing to record beyond "we did the obvious thing."
38
+
39
+ ### What qualifies
40
+
41
+ - **Architectural shape.** "We're using a monorepo." "The write model is event-sourced, the read model is projected into Postgres."
42
+ - **Integration patterns between contexts.** "Ordering and Billing communicate via domain events, not synchronous HTTP."
43
+ - **Technology choices that carry lock-in.** Database, message bus, auth provider, deployment target. Not every library: just the ones that would take a quarter to swap out.
44
+ - **Boundary and scope decisions.** "Customer data is owned by the Customer context; other contexts reference it by ID only." The explicit no-s are as valuable as the yes-s.
45
+ - **Deliberate deviations from the obvious path.** "We're using manual SQL instead of an ORM because X." Anything where a reasonable reader would assume the opposite. These stop the next engineer from "fixing" something that was deliberate.
46
+ - **Constraints not visible in the code.** "We can't use AWS because of compliance requirements." "Response times must be under 200ms because of the partner API contract."
47
+ - **Rejected alternatives when the rejection is non-obvious.** If you considered GraphQL and picked REST for subtle reasons, record it; otherwise someone will suggest GraphQL again in six months.
@@ -0,0 +1,60 @@
1
+ # GLOSSARY.md Format
2
+
3
+ ## Structure
4
+
5
+ ```md
6
+ # {Context Name}
7
+
8
+ {One or two sentence description of what this context is and why it exists.}
9
+
10
+ ## Language
11
+
12
+ **Order**:
13
+ {A one or two sentence description of the term}
14
+ _Avoid_: Purchase, transaction
15
+
16
+ **Invoice**:
17
+ A request for payment sent to a customer after delivery.
18
+ _Avoid_: Bill, payment request
19
+
20
+ **Customer**:
21
+ A person or organization that places orders.
22
+ _Avoid_: Client, buyer, account
23
+ ```
24
+
25
+ ## Rules
26
+
27
+ - **Be opinionated.** When multiple words exist for the same concept, pick the best one and list the others under `_Avoid_`.
28
+ - **Keep definitions tight.** One or two sentences max. Define what it IS, not what it does.
29
+ - **Only include terms specific to this project's context.** General programming concepts (timeouts, error types, utility patterns) don't belong even if the project uses them extensively. Before adding a term, ask: is this a concept unique to this context, or a general programming concept? Only the former belongs.
30
+ - **Group terms under subheadings** when natural clusters emerge. If all terms belong to a single cohesive area, a flat list is fine.
31
+
32
+ ## Single vs multi-context repos
33
+
34
+ **Single context (most repos):** One `GLOSSARY.md` at the repo root.
35
+
36
+ **Multiple contexts:** A `GLOSSARY-MAP.md` at the repo root lists the contexts, where they live, and how they relate to each other:
37
+
38
+ ```md
39
+ # Glossary Map
40
+
41
+ ## Contexts
42
+
43
+ - [Ordering](./src/ordering/GLOSSARY.md): receives and tracks customer orders
44
+ - [Billing](./src/billing/GLOSSARY.md): generates invoices and processes payments
45
+ - [Fulfillment](./src/fulfillment/GLOSSARY.md): manages warehouse picking and shipping
46
+
47
+ ## Relationships
48
+
49
+ - **Ordering → Fulfillment**: Ordering emits `OrderPlaced` events; Fulfillment consumes them to start picking
50
+ - **Fulfillment → Billing**: Fulfillment emits `ShipmentDispatched` events; Billing consumes them to generate invoices
51
+ - **Ordering ↔ Billing**: Shared types for `CustomerId` and `Money`
52
+ ```
53
+
54
+ The skill infers which structure applies:
55
+
56
+ - If `GLOSSARY-MAP.md` exists, read it to find contexts
57
+ - If only a root `GLOSSARY.md` exists, single context
58
+ - If neither exists, create a root `GLOSSARY.md` lazily when the first term is resolved
59
+
60
+ When multiple contexts exist, infer which one the current topic relates to. If unclear, ask.
@@ -0,0 +1,74 @@
1
+ ---
2
+ name: domain-modeling
3
+ description: Build and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a GLOSSARY.md, or recording or editing an ADR.
4
+ ---
5
+
6
+ # Domain Modeling
7
+
8
+ Actively build and sharpen the project's domain model as you design. This is the *active* discipline: challenging terms, inventing edge-case scenarios, and writing the glossary and decisions down the moment they crystallise. (Merely *reading* `GLOSSARY.md` for vocabulary is not this skill: that's a one-line habit any skill can do. This skill is for when you're changing the model, not just consuming it.)
9
+
10
+ ## File structure
11
+
12
+ Most repos have a single context:
13
+
14
+ ```
15
+ /
16
+ ├── GLOSSARY.md
17
+ ├── docs/
18
+ │ └── adr/
19
+ │ ├── 0001-event-sourced-orders.md
20
+ │ └── 0002-postgres-for-write-model.md
21
+ └── src/
22
+ ```
23
+
24
+ If a `GLOSSARY-MAP.md` exists at the root, the repo has multiple contexts. The map points to where each one lives:
25
+
26
+ ```
27
+ /
28
+ ├── GLOSSARY-MAP.md
29
+ ├── docs/
30
+ │ └── adr/ ← system-wide decisions
31
+ ├── src/
32
+ │ ├── ordering/
33
+ │ │ ├── GLOSSARY.md
34
+ │ │ └── docs/adr/ ← context-specific decisions
35
+ │ └── billing/
36
+ │ ├── GLOSSARY.md
37
+ │ └── docs/adr/
38
+ ```
39
+
40
+ Create files lazily: only when you have something to write. If no `GLOSSARY.md` exists, create one when the first term is resolved. If no `docs/adr/` exists, create it when the first ADR is needed.
41
+
42
+ ## During the session
43
+
44
+ ### Challenge against the glossary
45
+
46
+ When the user uses a term that conflicts with the existing language in `GLOSSARY.md`, call it out immediately. "Your glossary defines 'cancellation' as X, but you seem to mean Y. Which is it?"
47
+
48
+ ### Sharpen fuzzy language
49
+
50
+ When the user uses vague or overloaded terms, propose a precise canonical term. "You're saying 'account': do you mean the Customer or the User? Those are different things."
51
+
52
+ ### Discuss concrete scenarios
53
+
54
+ When domain relationships are being discussed, stress-test them with specific scenarios. Invent scenarios that probe edge cases and force the user to be precise about the boundaries between concepts.
55
+
56
+ ### Cross-reference with code
57
+
58
+ When the user states how something works, check whether the code agrees. If you find a contradiction, surface it: "Your code cancels entire Orders, but you just said partial cancellation is possible. Which is right?"
59
+
60
+ ### Update GLOSSARY.md inline
61
+
62
+ When a term is resolved, update `GLOSSARY.md` right there. Don't batch these up: capture them as they happen. Use the format in [GLOSSARY-FORMAT.md](./GLOSSARY-FORMAT.md).
63
+
64
+ `GLOSSARY.md` should be totally devoid of implementation details. Do not treat `GLOSSARY.md` as a spec, a scratch pad, or a repository for implementation decisions. It is a glossary and nothing else.
65
+
66
+ ### Offer ADRs sparingly
67
+
68
+ Only offer to create an ADR when all three are true:
69
+
70
+ 1. **Hard to reverse**: the cost of changing your mind later is meaningful
71
+ 2. **Surprising without context**: a future reader will wonder "why did they do it this way?"
72
+ 3. **The result of a real trade-off**: there were genuine alternatives and you picked one for specific reasons
73
+
74
+ If any of the three is missing, skip the ADR. Use the format in [ADR-FORMAT.md](./ADR-FORMAT.md).