@leitwerk-dev/mattpocock-skills 0.0.0-stage → 0.4.1

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 (38) hide show
  1. package/README.md +57 -2
  2. package/dist/LICENSE +13 -0
  3. package/dist/index.d.ts +5 -0
  4. package/dist/index.d.ts.map +1 -0
  5. package/dist/index.js +9 -0
  6. package/dist/index.js.map +1 -0
  7. package/dist/skills/manifest.json +46 -0
  8. package/dist/skills/mattpocock-codebase-design/DEEPENING.md +37 -0
  9. package/dist/skills/mattpocock-codebase-design/DESIGN-IT-TWICE.md +44 -0
  10. package/dist/skills/mattpocock-codebase-design/SKILL.md +114 -0
  11. package/dist/skills/mattpocock-codebase-design/licenses/LICENSE +21 -0
  12. package/dist/skills/mattpocock-domain-modeling/ADR-FORMAT.md +47 -0
  13. package/dist/skills/mattpocock-domain-modeling/GLOSSARY-FORMAT.md +62 -0
  14. package/dist/skills/mattpocock-domain-modeling/SKILL.md +48 -0
  15. package/dist/skills/mattpocock-domain-modeling/licenses/LICENSE +21 -0
  16. package/dist/skills/mattpocock-grilling/SKILL.md +16 -0
  17. package/dist/skills/mattpocock-grilling/licenses/LICENSE +21 -0
  18. package/dist/skills/mattpocock-improve-codebase-architecture/MARKDOWN-REPORT.md +30 -0
  19. package/dist/skills/mattpocock-improve-codebase-architecture/SKILL.md +55 -0
  20. package/dist/skills/mattpocock-improve-codebase-architecture/licenses/LICENSE +21 -0
  21. package/package.json +55 -5
  22. package/patches/leitwerk.patch +490 -0
  23. package/skill-pack.json +33 -0
  24. package/src/index.ts +8 -0
  25. package/upstream/LICENSE +21 -0
  26. package/upstream/skills/engineering/codebase-design/DEEPENING.md +37 -0
  27. package/upstream/skills/engineering/codebase-design/DESIGN-IT-TWICE.md +44 -0
  28. package/upstream/skills/engineering/codebase-design/SKILL.md +114 -0
  29. package/upstream/skills/engineering/codebase-design/agents/openai.yaml +3 -0
  30. package/upstream/skills/engineering/domain-modeling/ADR-FORMAT.md +47 -0
  31. package/upstream/skills/engineering/domain-modeling/GLOSSARY-FORMAT.md +60 -0
  32. package/upstream/skills/engineering/domain-modeling/SKILL.md +74 -0
  33. package/upstream/skills/engineering/domain-modeling/agents/openai.yaml +3 -0
  34. package/upstream/skills/engineering/improve-codebase-architecture/HTML-REPORT.md +123 -0
  35. package/upstream/skills/engineering/improve-codebase-architecture/SKILL.md +71 -0
  36. package/upstream/skills/engineering/improve-codebase-architecture/agents/openai.yaml +5 -0
  37. package/upstream/skills/productivity/grilling/SKILL.md +28 -0
  38. package/upstream/skills/productivity/grilling/agents/openai.yaml +3 -0
package/README.md CHANGED
@@ -1,3 +1,58 @@
1
- # Temporary Holding Version
1
+ # Matt Pocock skills for leitwerk
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ This extension packages four skills from
4
+ [mattpocock/skills](https://github.com/mattpocock/skills): architecture improvement,
5
+ codebase design, grilling, and domain modeling. `skill-pack.json` pins the upstream
6
+ commit and declares their IDs and dependencies. The pristine selection lives in
7
+ `upstream/`; `patches/leitwerk.patch` records all instruction changes.
8
+
9
+ ## Use
10
+
11
+ Build and install `@leitwerk-dev/mattpocock-skills`, then add it to
12
+ `extension_loading.sources`. Restart the server to import the pack. Select
13
+ `mattpocock-improve-codebase-architecture` when launching a process and ask for an
14
+ architecture review. Its design, grilling, and domain-modeling dependencies are
15
+ attached automatically. Each skill can also be selected individually.
16
+
17
+ The adapted skills are discoverable by the model after launch selection. The
18
+ architecture skill's upstream explicit-command-only flag is removed because
19
+ leitwerk selects skills at launch rather than exposing the upstream command UI.
20
+ The turn needs repository-reading tools for exploration. Interactive rounds use
21
+ `ask_questions` when enabled; otherwise the result records outstanding decisions.
22
+ Publication follows the turn's existing result and outcome contract.
23
+
24
+ ## Adaptations
25
+
26
+ The architecture report uses Markdown and fenced Mermaid before/after diagrams.
27
+ Its description and template use that format throughout. Supporting skills read
28
+ attached dependencies through `read`, explore alternative designs sequentially,
29
+ and respect the target repository's glossary and ADR conventions. Changes to
30
+ repository documents remain within the active task's scope and tools.
31
+
32
+ The pack defines instructions only. Loading it installs selectable catalog entries;
33
+ it does not create a process or attach skills to every worker.
34
+
35
+ ## Update
36
+
37
+ From the repository root, after building the dev tools:
38
+
39
+ ```sh
40
+ npm run skills:prepare -w @leitwerk-dev/mattpocock-skills
41
+ # Edit extensions/mattpocock-skills/.skill-pack/work/.
42
+ npm run skills:diff -w @leitwerk-dev/mattpocock-skills
43
+ npm run build -w @leitwerk-dev/mattpocock-skills
44
+ ```
45
+
46
+ Review and commit the patch. Source and built runtime lanes both consume
47
+ `dist/skills/manifest.json`. Finish with the repository's full validation.
48
+
49
+ To update upstream, finish or preserve the current working copy and remove
50
+ `.skill-pack/work/`, then run `skills:prepare` with `-- --ref <commit-or-tag>`.
51
+ Resolve any patch failures in the new working copy and regenerate the diff before
52
+ building. Commit the updated pristine files, pinned recipe, and patch together.
53
+ See [Skill packs](../../docs/skill-packs.md) for the contribution and maintenance
54
+ contracts.
55
+
56
+ The upstream files are MIT licensed. Their original license is retained under
57
+ `upstream/LICENSE` and copied into each generated skill bundle. The extension code
58
+ uses the repository's Apache-2.0 license.
package/dist/LICENSE ADDED
@@ -0,0 +1,13 @@
1
+ Copyright 2026 Leitwerk contributors.
2
+
3
+ Licensed under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at
6
+
7
+ http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ Unless required by applicable law or agreed to in writing, software
10
+ distributed under the License is distributed on an "AS IS" BASIS,
11
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ See the License for the specific language governing permissions and
13
+ limitations under the License.
@@ -0,0 +1,5 @@
1
+ import type { LeitwerkExtensionModule } from "@leitwerk-dev/process-sdk";
2
+ /** Adapted architecture skills from Matt Pocock. @public */
3
+ declare const mattpocockSkills: LeitwerkExtensionModule;
4
+ export default mattpocockSkills;
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEzE,4DAA4D;AAC5D,QAAA,MAAM,gBAAgB,EAAE,uBAEvB,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,9 @@
1
+ // src/index.ts
2
+ var mattpocockSkills = {
3
+ manifest: { id: "mattpocock-skills", version: "0.3.1" }
4
+ };
5
+ var index_default = mattpocockSkills;
6
+ export {
7
+ index_default as default
8
+ };
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type { LeitwerkExtensionModule } from \"@leitwerk-dev/process-sdk\";\n\n/** Adapted architecture skills from Matt Pocock. @public */\nconst mattpocockSkills: LeitwerkExtensionModule = {\n\tmanifest: { id: \"mattpocock-skills\", version: \"0.3.1\" },\n};\n\nexport default mattpocockSkills;\n"],"mappings":";AAGA,IAAM,mBAA4C;AAAA,EACjD,UAAU,EAAE,IAAI,qBAAqB,SAAS,QAAQ;AACvD;AAEA,IAAO,gBAAQ;","names":[]}
@@ -0,0 +1,46 @@
1
+ {
2
+ "formatVersion": 1,
3
+ "upstream": {
4
+ "url": "https://github.com/mattpocock/skills.git",
5
+ "commit": "4588b32ecab9ecc9fc8cc6b6c5e7d675b6004b0d"
6
+ },
7
+ "patchDigest": "dc68176eeabeab302d1c678c605a9f632afe607d57fe51aa6237f9cb6dd820a3",
8
+ "skills": [
9
+ {
10
+ "id": "mattpocock-improve-codebase-architecture",
11
+ "directory": "mattpocock-improve-codebase-architecture",
12
+ "label": "mattpocock-improve-codebase-architecture",
13
+ "description": "Scan a codebase for deepening opportunities, present them as a Markdown report with Mermaid diagrams, then grill through whichever one you pick.",
14
+ "sourcePath": "skills/engineering/improve-codebase-architecture",
15
+ "dependencies": [
16
+ "mattpocock-codebase-design",
17
+ "mattpocock-grilling",
18
+ "mattpocock-domain-modeling"
19
+ ]
20
+ },
21
+ {
22
+ "id": "mattpocock-codebase-design",
23
+ "directory": "mattpocock-codebase-design",
24
+ "label": "mattpocock-codebase-design",
25
+ "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.",
26
+ "sourcePath": "skills/engineering/codebase-design",
27
+ "dependencies": []
28
+ },
29
+ {
30
+ "id": "mattpocock-grilling",
31
+ "directory": "mattpocock-grilling",
32
+ "label": "mattpocock-grilling",
33
+ "description": "Grill the user relentlessly about a plan, decision, or idea. Use when the user wants to stress-test their thinking, or uses any 'grill' trigger phrases.",
34
+ "sourcePath": "skills/productivity/grilling",
35
+ "dependencies": []
36
+ },
37
+ {
38
+ "id": "mattpocock-domain-modeling",
39
+ "directory": "mattpocock-domain-modeling",
40
+ "label": "mattpocock-domain-modeling",
41
+ "description": "Build and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a domain glossary, or recording or editing an ADR.",
42
+ "sourcePath": "skills/engineering/domain-modeling",
43
+ "dependencies": []
44
+ }
45
+ ]
46
+ }
@@ -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 these sequential design passes. 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 designing alternatives, 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. Work through each design before comparing them.
18
+
19
+ ### 2. Design alternatives
20
+
21
+ Develop three **radically different** interfaces for the deepened module, one after another. Keep each design self-contained until comparison.
22
+
23
+ Start each pass 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. Use a different design constraint for each pass:
24
+
25
+ - Pass 1: "Minimize the interface: aim for 1–3 entry points max. Maximise leverage per entry point."
26
+ - Pass 2: "Maximise flexibility: support many use cases and extension."
27
+ - Pass 3: "Optimise for the most common caller: make the default case trivial."
28
+ - Optional pass: "Design around ports & adapters for cross-seam dependencies."
29
+
30
+ Include both [SKILL.md](SKILL.md) vocabulary and the target repository’s domain vocabulary in the brief so each design names things consistently with the architecture language and the project's domain language.
31
+
32
+ Each design includes:
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: mattpocock-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): design several radically different interfaces in sequential passes, then compare on depth, locality, and seam placement.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Matt Pocock
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -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,62 @@
1
+ # Default glossary format
2
+
3
+ Use this format when the target repository has no documented glossary format. Follow existing repository paths and conventions when present.
4
+
5
+ ## Structure
6
+
7
+ ```md
8
+ # {Context Name}
9
+
10
+ {One or two sentence description of what this context is and why it exists.}
11
+
12
+ ## Language
13
+
14
+ **Order**:
15
+ {A one or two sentence description of the term}
16
+ _Avoid_: Purchase, transaction
17
+
18
+ **Invoice**:
19
+ A request for payment sent to a customer after delivery.
20
+ _Avoid_: Bill, payment request
21
+
22
+ **Customer**:
23
+ A person or organization that places orders.
24
+ _Avoid_: Client, buyer, account
25
+ ```
26
+
27
+ ## Rules
28
+
29
+ - **Be opinionated.** When multiple words exist for the same concept, pick the best one and list the others under `_Avoid_`.
30
+ - **Keep definitions tight.** One or two sentences max. Define what it IS, not what it does.
31
+ - **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.
32
+ - **Group terms under subheadings** when natural clusters emerge. If all terms belong to a single cohesive area, a flat list is fine.
33
+
34
+ ## Single vs multi-context repos
35
+
36
+ **Single context (most repos):** One `GLOSSARY.md` at the repo root.
37
+
38
+ **Multiple contexts:** A `GLOSSARY-MAP.md` at the repo root lists the contexts, where they live, and how they relate to each other:
39
+
40
+ ```md
41
+ # Glossary Map
42
+
43
+ ## Contexts
44
+
45
+ - [Ordering](./src/ordering/GLOSSARY.md): receives and tracks customer orders
46
+ - [Billing](./src/billing/GLOSSARY.md): generates invoices and processes payments
47
+ - [Fulfillment](./src/fulfillment/GLOSSARY.md): manages warehouse picking and shipping
48
+
49
+ ## Relationships
50
+
51
+ - **Ordering → Fulfillment**: Ordering emits `OrderPlaced` events; Fulfillment consumes them to start picking
52
+ - **Fulfillment → Billing**: Fulfillment emits `ShipmentDispatched` events; Billing consumes them to generate invoices
53
+ - **Ordering ↔ Billing**: Shared types for `CustomerId` and `Money`
54
+ ```
55
+
56
+ The skill infers which structure applies:
57
+
58
+ - If `GLOSSARY-MAP.md` exists, read it to find contexts
59
+ - If only a root `GLOSSARY.md` exists, single context
60
+ - If neither exists, create a root `GLOSSARY.md` lazily when the first term is resolved
61
+
62
+ When multiple contexts exist, infer which one the current topic relates to. If unclear, ask.
@@ -0,0 +1,48 @@
1
+ ---
2
+ name: mattpocock-domain-modeling
3
+ description: Build and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a domain glossary, 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
+ ## Repository conventions
11
+
12
+ Read the target repository’s agent instructions and existing domain documentation first. Use its glossary and ADR paths and formats. Common glossary names include `GLOSSARY.md`, `CONTEXT.md`, and `docs/ubiquitous_language.md`; a context map may identify several glossaries. References to the glossary below mean the repository’s chosen file.
13
+
14
+ Update documents when the task authorizes those changes and the active turn exposes the necessary tools. Otherwise, publish proposed terms and decisions in the result. If no convention exists, use `GLOSSARY.md` and `docs/adr/` as defaults when creating the first needed document.
15
+
16
+ ## During the session
17
+
18
+ ### Challenge against the glossary
19
+
20
+ When the user uses a term that conflicts with the existing language in the glossary, call it out immediately. "Your glossary defines 'cancellation' as X, but you seem to mean Y. Which is it?"
21
+
22
+ ### Sharpen fuzzy language
23
+
24
+ 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."
25
+
26
+ ### Discuss concrete scenarios
27
+
28
+ 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.
29
+
30
+ ### Cross-reference with code
31
+
32
+ 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?"
33
+
34
+ ### Update the glossary inline
35
+
36
+ When a term is resolved, update the repository’s glossary as part of the authorized changes. Don't batch these up: capture them as they happen. Use the repository’s format, or [GLOSSARY-FORMAT.md](./GLOSSARY-FORMAT.md) when establishing one.
37
+
38
+ The glossary should be totally devoid of implementation details. Do not treat the glossary as a spec, a scratch pad, or a repository for implementation decisions. It is a glossary and nothing else.
39
+
40
+ ### Offer ADRs sparingly
41
+
42
+ Only offer to create an ADR when all three are true:
43
+
44
+ 1. **Hard to reverse**: the cost of changing your mind later is meaningful
45
+ 2. **Surprising without context**: a future reader will wonder "why did they do it this way?"
46
+ 3. **The result of a real trade-off**: there were genuine alternatives and you picked one for specific reasons
47
+
48
+ If any of the three is missing, skip the ADR. Use the repository’s ADR format, or [ADR-FORMAT.md](./ADR-FORMAT.md) when establishing one.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Matt Pocock
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,16 @@
1
+ ---
2
+ name: mattpocock-grilling
3
+ description: Grill the user relentlessly about a plan, decision, or idea. Use when the user wants to stress-test their thinking, or uses any 'grill' trigger phrases.
4
+ ---
5
+
6
+ Interview the user relentlessly until you reach a shared understanding. Map this as a **design tree**: every decision branches into the decisions that hang off it.
7
+
8
+ Work the tree in **rounds**. The **frontier** is every decision whose prerequisites are already settled: the questions you can ask _now_ without guessing at answers you haven't heard yet. Ask the whole frontier in one round: number each question and give your recommended answer. Then wait for the user's answers before the next round.
9
+
10
+ Use the active turn’s `ask_questions` tool for each round. Supply focused questions with distinct prepared choices; mark a recommended choice and explain why. Wait for the returned answers before progressing dependent decisions. When that tool is unavailable, publish the unresolved questions and recommendations through the turn’s result contract and leave those decisions open for follow-up.
11
+
12
+ Each round the user answers reshapes the tree: settled decisions push the frontier outward and unblock questions that depended on them. Recompute the frontier and ask the next round. A question whose answer depends on another question still open in this round belongs to a _later_ round, not this one.
13
+
14
+ Finding _facts_ is your job. Inspect the environment with the active turn’s tools before asking the operator for decisions. Work through independent exploration sequentially; then ask the questions whose prerequisites are settled.
15
+
16
+ The session is done when the frontier is empty: every branch of the design tree visited, nothing left silently assumed. Confirm the settled decisions through `ask_questions` when it is available. Carry out changes only within the current task’s authorized scope and tools.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Matt Pocock
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,30 @@
1
+ # Architecture report
2
+
3
+ Write the report as Markdown for the operator’s result view. Use the repository’s domain names and the vocabulary from `mattpocock-codebase-design`.
4
+
5
+ Start with the repository, reviewed scope, and a short recommendation. Give each candidate a heading and include:
6
+
7
+ - A recommendation strength: **Strong**, **Worth exploring**, or **Speculative**.
8
+ - The affected files and observed behavior that demonstrates the problem.
9
+ - The proposed change and its effect on locality, leverage, and testing.
10
+ - Separate **Before** and **After** fenced Mermaid diagrams.
11
+ - An ADR conflict when concrete evidence warrants reopening that decision.
12
+
13
+ Use simple Mermaid flowcharts for dependencies and sequence diagrams for call order. Give nodes short, quoted labels and use domain names. For example:
14
+
15
+ ```mermaid
16
+ flowchart LR
17
+ A["Order intake"] --> B["Validation"]
18
+ B --> C["Pricing"]
19
+ C --> D["Order storage"]
20
+ ```
21
+
22
+ ```mermaid
23
+ flowchart LR
24
+ A["Caller"] --> B["Order placement"]
25
+ B --> C["Order storage adapter"]
26
+ ```
27
+
28
+ Tie each diagram to evidence and label proposed behavior as a proposal. Close with the strongest candidate, the reason to tackle it first, and any operator decision needed next.
29
+
30
+ Use the active turn’s result-publication instructions to deliver the Markdown. Completion and operator questions follow the active turn’s available tools.