@ecc-hgy/ae 0.4.0 → 0.6.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 (49) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +168 -138
  3. package/bin/ae.js +2 -2
  4. package/package.json +43 -43
  5. package/skills/brainstorming/SKILL.md +133 -133
  6. package/skills/diagnose/SKILL.md +146 -146
  7. package/skills/diagnose/assets/issue-7-sections.md +35 -35
  8. package/skills/diagnose/scripts/hitl-loop.template.sh +41 -41
  9. package/skills/grill-me/SKILL.md +10 -10
  10. package/skills/handoff/SKILL.md +19 -19
  11. package/skills/improve-codebase-architecture/DEEPENING.md +37 -37
  12. package/skills/improve-codebase-architecture/HTML-REPORT.md +123 -123
  13. package/skills/improve-codebase-architecture/INTERFACE-DESIGN.md +44 -44
  14. package/skills/improve-codebase-architecture/LANGUAGE.md +53 -53
  15. package/skills/improve-codebase-architecture/SKILL.md +101 -101
  16. package/skills/karpathy-guidelines/SKILL.md +63 -63
  17. package/skills/powerautomate-email-to-sharepoint-excel/powerautomate-email-to-sharepoint-excel-skill.md +496 -0
  18. package/skills/review/SKILL.md +119 -119
  19. package/skills/tdd/SKILL.md +157 -157
  20. package/skills/tdd/deep-modules.md +33 -33
  21. package/skills/tdd/interface-design.md +31 -31
  22. package/skills/tdd/mocking.md +59 -59
  23. package/skills/tdd/refactoring.md +10 -10
  24. package/skills/tdd/tests.md +61 -61
  25. package/skills/to-issues/SKILL.md +79 -79
  26. package/skills/to-issues/todo-template.md +25 -25
  27. package/skills/to-prd/SKILL.md +108 -108
  28. package/skills/using-agentic-engineering/SKILL.md +62 -62
  29. package/skills/verification-before-completion/SKILL.md +153 -153
  30. package/skills/writing-plans/SKILL.md +115 -115
  31. package/skills/zoom-out/SKILL.md +7 -7
  32. package/src/cli.js +61 -61
  33. package/src/commands/init.js +137 -134
  34. package/src/commands/setup.js +162 -103
  35. package/src/platforms.js +132 -0
  36. package/src/skeleton.js +134 -99
  37. package/src/utils/copy.js +100 -100
  38. package/src/utils/paths.js +60 -60
  39. package/src/utils/report.js +30 -30
  40. package/templates/entries/AGENTS.md +2 -0
  41. package/templates/entries/CLAUDE.md +5 -5
  42. package/templates/entries/README.md +33 -31
  43. package/templates/entries/handoff.md +1 -1
  44. package/templates/entries/spec/ADR/AGENTS.md +30 -30
  45. package/templates/entries/spec/ADR/CLAUDE.md +5 -5
  46. package/templates/entries/spec/AGENTS.md +34 -34
  47. package/templates/entries/spec/CLAUDE.md +5 -5
  48. package/templates/entries/spec/INDEX.md +28 -28
  49. package/templates/entries/spec/README.md +23 -23
@@ -1,53 +1,53 @@
1
- # Language
2
-
3
- Shared vocabulary for every suggestion this skill makes. Use these terms exactly — don't substitute "component," "service," "API," or "boundary." Consistent language is the whole point.
4
-
5
- ## Terms
6
-
7
- **Module**
8
- Anything with an interface and an implementation. Deliberately scale-agnostic — applies equally to a function, class, package, or tier-spanning slice.
9
- _Avoid_: unit, component, service.
10
-
11
- **Interface**
12
- Everything a caller must know to use the module correctly. Includes the type signature, but also invariants, ordering constraints, error modes, required configuration, and performance characteristics.
13
- _Avoid_: API, signature (too narrow — those refer only to the type-level surface).
14
-
15
- **Implementation**
16
- 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.
17
-
18
- **Depth**
19
- 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. A module is **shallow** when the interface is nearly as complex as the implementation.
20
-
21
- **Seam** _(from Michael Feathers)_
22
- A place where you can alter behaviour without editing in that place. The *location* at which a module's interface lives. Choosing where to put the seam is its own design decision, distinct from what goes behind it.
23
- _Avoid_: boundary (overloaded with DDD's bounded context).
24
-
25
- **Adapter**
26
- A concrete thing that satisfies an interface at a seam. Describes *role* (what slot it fills), not substance (what's inside).
27
-
28
- **Leverage**
29
- What callers get from depth. More capability per unit of interface they have to learn. One implementation pays back across N call sites and M tests.
30
-
31
- **Locality**
32
- What maintainers get from depth. Change, bugs, knowledge, and verification concentrate at one place rather than spreading across callers. Fix once, fixed everywhere.
33
-
34
- ## Principles
35
-
36
- - **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.
37
- - **The deletion test.** Imagine deleting the module. If complexity vanishes, the module wasn't hiding anything (it was a pass-through). If complexity reappears across N callers, the module was earning its keep.
38
- - **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.
39
- - **One adapter means a hypothetical seam. Two adapters means a real one.** Don't introduce a seam unless something actually varies across it.
40
-
41
- ## Relationships
42
-
43
- - A **Module** has exactly one **Interface** (the surface it presents to callers and tests).
44
- - **Depth** is a property of a **Module**, measured against its **Interface**.
45
- - A **Seam** is where a **Module**'s **Interface** lives.
46
- - An **Adapter** sits at a **Seam** and satisfies the **Interface**.
47
- - **Depth** produces **Leverage** for callers and **Locality** for maintainers.
48
-
49
- ## Rejected framings
50
-
51
- - **Depth as ratio of implementation-lines to interface-lines** (Ousterhout): rewards padding the implementation. We use depth-as-leverage instead.
52
- - **"Interface" as the TypeScript `interface` keyword or a class's public methods**: too narrow — interface here includes every fact a caller must know.
53
- - **"Boundary"**: overloaded with DDD's bounded context. Say **seam** or **interface**.
1
+ # Language
2
+
3
+ Shared vocabulary for every suggestion this skill makes. Use these terms exactly — don't substitute "component," "service," "API," or "boundary." Consistent language is the whole point.
4
+
5
+ ## Terms
6
+
7
+ **Module**
8
+ Anything with an interface and an implementation. Deliberately scale-agnostic — applies equally to a function, class, package, or tier-spanning slice.
9
+ _Avoid_: unit, component, service.
10
+
11
+ **Interface**
12
+ Everything a caller must know to use the module correctly. Includes the type signature, but also invariants, ordering constraints, error modes, required configuration, and performance characteristics.
13
+ _Avoid_: API, signature (too narrow — those refer only to the type-level surface).
14
+
15
+ **Implementation**
16
+ 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.
17
+
18
+ **Depth**
19
+ 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. A module is **shallow** when the interface is nearly as complex as the implementation.
20
+
21
+ **Seam** _(from Michael Feathers)_
22
+ A place where you can alter behaviour without editing in that place. The *location* at which a module's interface lives. Choosing where to put the seam is its own design decision, distinct from what goes behind it.
23
+ _Avoid_: boundary (overloaded with DDD's bounded context).
24
+
25
+ **Adapter**
26
+ A concrete thing that satisfies an interface at a seam. Describes *role* (what slot it fills), not substance (what's inside).
27
+
28
+ **Leverage**
29
+ What callers get from depth. More capability per unit of interface they have to learn. One implementation pays back across N call sites and M tests.
30
+
31
+ **Locality**
32
+ What maintainers get from depth. Change, bugs, knowledge, and verification concentrate at one place rather than spreading across callers. Fix once, fixed everywhere.
33
+
34
+ ## Principles
35
+
36
+ - **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.
37
+ - **The deletion test.** Imagine deleting the module. If complexity vanishes, the module wasn't hiding anything (it was a pass-through). If complexity reappears across N callers, the module was earning its keep.
38
+ - **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.
39
+ - **One adapter means a hypothetical seam. Two adapters means a real one.** Don't introduce a seam unless something actually varies across it.
40
+
41
+ ## Relationships
42
+
43
+ - A **Module** has exactly one **Interface** (the surface it presents to callers and tests).
44
+ - **Depth** is a property of a **Module**, measured against its **Interface**.
45
+ - A **Seam** is where a **Module**'s **Interface** lives.
46
+ - An **Adapter** sits at a **Seam** and satisfies the **Interface**.
47
+ - **Depth** produces **Leverage** for callers and **Locality** for maintainers.
48
+
49
+ ## Rejected framings
50
+
51
+ - **Depth as ratio of implementation-lines to interface-lines** (Ousterhout): rewards padding the implementation. We use depth-as-leverage instead.
52
+ - **"Interface" as the TypeScript `interface` keyword or a class's public methods**: too narrow — interface here includes every fact a caller must know.
53
+ - **"Boundary"**: overloaded with DDD's bounded context. Say **seam** or **interface**.
@@ -1,101 +1,101 @@
1
- ---
2
- name: improve-codebase-architecture
3
- description: Find architectural deepening opportunities, informed by `spec/INDEX.md` vocabulary and `spec/ADR/` decisions. User-triggered ONLY: use when the user wants to improve architecture, find refactoring opportunities, consolidate tightly-coupled modules, or make a codebase more testable and AI-navigable.
4
- ---
5
-
6
- # Improve Codebase Architecture
7
-
8
- Surface architectural friction and propose **deepening opportunities** — refactors that turn shallow modules into deep ones. The aim is testability and AI-navigability.
9
-
10
- ## Trigger model
11
-
12
- This skill is **user-triggered only**. It is NOT attached to any S1 node. Three legitimate trigger points:
13
-
14
- 1. **Post-B-loop** — a bug in B3 diagnose revealed structural coupling; B7 review noted "architectural change needed" but did NOT invoke this skill; the user now opts in.
15
- 2. **Pre-A3** — before writing `design.md` for a complex new need, the user wants a deep look at the area to be touched.
16
- 3. **Standalone** — periodic, user-driven architecture review.
17
-
18
- Do NOT invoke this skill from inside another skill. Other skills MAY recommend it; only the user calls it.
19
-
20
- ## Glossary
21
-
22
- Use these terms exactly in every suggestion. Consistent language is the point — don't drift into "component," "service," "API," or "boundary." Full definitions in [LANGUAGE.md](LANGUAGE.md).
23
-
24
- - **Module** — anything with an interface and an implementation (function, class, package, slice).
25
- - **Interface** — everything a caller must know to use the module: types, invariants, error modes, ordering, config. Not just the type signature.
26
- - **Implementation** — the code inside.
27
- - **Depth** — leverage at the interface: a lot of behaviour behind a small interface. **Deep** = high leverage. **Shallow** = interface nearly as complex as the implementation.
28
- - **Seam** — where an interface lives; a place behaviour can be altered without editing in place. (Use this, not "boundary.")
29
- - **Adapter** — a concrete thing satisfying an interface at a seam.
30
- - **Leverage** — what callers get from depth.
31
- - **Locality** — what maintainers get from depth: change, bugs, knowledge concentrated in one place.
32
-
33
- Key principles (see [LANGUAGE.md](LANGUAGE.md) for the full list):
34
-
35
- - **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.
36
- - **The interface is the test surface.**
37
- - **One adapter = hypothetical seam. Two adapters = real seam.**
38
-
39
- This skill is _informed_ by the project's domain model. Read `spec/INDEX.md` for the vocabulary of needs and ADRs; read `spec/needs/*/prd.md` and `spec/needs/*/design.md` for the domain language and the names of seams that matter; read `spec/ADR/*.md` to find decisions the skill should not re-litigate. Treat ADRs with `status: accepted` as binding.
40
-
41
- ## Process
42
-
43
- ### 1. Explore
44
-
45
- Read `spec/INDEX.md` (vocabulary + need landscape), the relevant `spec/needs/*/prd.md` and `spec/needs/*/design.md` files for the area being touched, and any `spec/ADR/*.md` with `status: accepted` that constrains the area.
46
-
47
- Then use the Agent tool with `subagent_type=Explore` to walk the codebase. Don't follow rigid heuristics — explore organically and note where you experience friction:
48
-
49
- - Where does understanding one concept require bouncing between many small modules?
50
- - Where are modules **shallow** — interface nearly as complex as the implementation?
51
- - Where have pure functions been extracted just for testability, but the real bugs hide in how they're called (no **locality**)?
52
- - Where do tightly-coupled modules leak across their seams?
53
- - Which parts of the codebase are untested, or hard to test through their current interface?
54
-
55
- Apply the **deletion test** to anything you suspect is shallow: would deleting it concentrate complexity, or just move it? A "yes, concentrates" is the signal you want.
56
-
57
- Classify dependencies using [DEEPENING.md](DEEPENING.md) before recommending a direction. The dependency category determines whether the proposed seam is in-process, local-substitutable, ports-and-adapters, or mock-backed.
58
-
59
- ### 2. Present candidates as an HTML report
60
-
61
- Write a self-contained HTML file to the OS temp directory so nothing lands in the repo. Resolve the temp dir from `$TMPDIR`, falling back to `/tmp` (or `%TEMP%` on Windows), and write to `<tmpdir>/architecture-review-<timestamp>.html` so each run gets a fresh file. Open it for the user — `xdg-open <path>` on Linux, `open <path>` on macOS, `start <path>` on Windows — and tell them the absolute path.
62
-
63
- The report uses **Tailwind via CDN** for layout and styling, and **Mermaid via CDN** for diagrams where a graph/flow/sequence reliably communicates the structure. Mix Mermaid with hand-crafted CSS/SVG visuals — use Mermaid when relationships are graph-shaped (call graphs, dependencies, sequences), and hand-built divs/SVG when you want something more editorial (mass diagrams, cross-sections, collapse animations). Each candidate gets a **before/after visualisation**. Be visual.
64
-
65
- Use [HTML-REPORT.md](HTML-REPORT.md) for the full HTML scaffold, diagram patterns, and styling guidance.
66
-
67
- For each candidate, the same template as before, but rendered as a card:
68
-
69
- - **Files** — which files/modules are involved
70
- - **Problem** — why the current architecture is causing friction
71
- - **Solution** — plain English description of what would change
72
- - **Benefits** — explained in terms of locality and leverage, and how tests would improve
73
- - **Before / After diagram** — side-by-side, custom-drawn, illustrating the shallowness and the deepening
74
- - **Recommendation strength** — one of `Strong`, `Worth exploring`, `Speculative`, rendered as a badge
75
-
76
- End the report with a **Top recommendation** section: which candidate you'd tackle first and why.
77
-
78
- **Use `spec/INDEX.md` + need-level `prd.md`/`design.md` vocabulary for the domain, and [LANGUAGE.md](LANGUAGE.md) vocabulary for the architecture.** If `spec/INDEX.md` defines "Order," talk about "the Order intake module" — not "the FooBarHandler," and not "the Order service."
79
-
80
- **ADR conflicts**: if a candidate contradicts an existing ADR, only surface it when the friction is real enough to warrant revisiting the ADR. Mark it clearly in the card (e.g. a warning callout: _"contradicts ADR-0007 in `spec/ADR/` — but worth reopening because..."_). Don't list every theoretical refactor an ADR forbids.
81
-
82
- Do NOT propose interfaces yet. After the file is written, ask the user: "Which of these would you like to explore?"
83
-
84
- ### 3. Grilling loop
85
-
86
- Once the user picks a candidate, drop into a grilling conversation. Walk the design tree with them — constraints, dependencies, the shape of the deepened module, what sits behind the seam, what tests survive.
87
-
88
- Side effects happen inline as decisions crystallize:
89
-
90
- - **Naming a deepened module after a concept not in `spec/INDEX.md`?** Add the term to the relevant `spec/needs/<need-name>/design.md` (or, if it spans needs, propose a new ADR). Do NOT create or modify a `CONTEXT.md` file — this project does not use that path.
91
- - **Sharpening a fuzzy term during the conversation?** Patch the relevant `design.md` or ADR right there.
92
- - **User rejects the candidate with a load-bearing reason?** Offer an ADR, framed as: _"Want me to record this as `spec/ADR/NNNN-architecture-<topic>.md` with `status: proposed` so future architecture reviews don't re-suggest it?"_ Only offer when the reason would actually be needed by a future explorer — skip ephemeral reasons ("not worth it right now") and self-evident ones.
93
- - **Want to explore alternative interfaces for the deepened module?** See [INTERFACE-DESIGN.md](INTERFACE-DESIGN.md).
94
- - **User accepts the candidate and asks you to apply it?** Stop here. Do NOT modify code from this skill. Bounce back to S1: open a new need (A1) for the refactor, or patch an existing `design.md` (A3). This skill is REVIEW-only.
95
-
96
- ## Boundaries
97
-
98
- - Do not attach this skill to A/B nodes. B7 may recommend it; only the user invokes it.
99
- - Do not modify application code from this skill.
100
- - Do not create `CONTEXT.md` or `docs/adr/`.
101
- - Keep architecture vocabulary in [LANGUAGE.md](LANGUAGE.md); keep report shape in [HTML-REPORT.md](HTML-REPORT.md); keep dependency strategy in [DEEPENING.md](DEEPENING.md); use [INTERFACE-DESIGN.md](INTERFACE-DESIGN.md) only after the user chooses a candidate.
1
+ ---
2
+ name: improve-codebase-architecture
3
+ description: Find architectural deepening opportunities, informed by `spec/INDEX.md` vocabulary and `spec/ADR/` decisions. User-triggered ONLY: use when the user wants to improve architecture, find refactoring opportunities, consolidate tightly-coupled modules, or make a codebase more testable and AI-navigable.
4
+ ---
5
+
6
+ # Improve Codebase Architecture
7
+
8
+ Surface architectural friction and propose **deepening opportunities** — refactors that turn shallow modules into deep ones. The aim is testability and AI-navigability.
9
+
10
+ ## Trigger model
11
+
12
+ This skill is **user-triggered only**. It is NOT attached to any S1 node. Three legitimate trigger points:
13
+
14
+ 1. **Post-B-loop** — a bug in B3 diagnose revealed structural coupling; B7 review noted "architectural change needed" but did NOT invoke this skill; the user now opts in.
15
+ 2. **Pre-A3** — before writing `design.md` for a complex new need, the user wants a deep look at the area to be touched.
16
+ 3. **Standalone** — periodic, user-driven architecture review.
17
+
18
+ Do NOT invoke this skill from inside another skill. Other skills MAY recommend it; only the user calls it.
19
+
20
+ ## Glossary
21
+
22
+ Use these terms exactly in every suggestion. Consistent language is the point — don't drift into "component," "service," "API," or "boundary." Full definitions in [LANGUAGE.md](LANGUAGE.md).
23
+
24
+ - **Module** — anything with an interface and an implementation (function, class, package, slice).
25
+ - **Interface** — everything a caller must know to use the module: types, invariants, error modes, ordering, config. Not just the type signature.
26
+ - **Implementation** — the code inside.
27
+ - **Depth** — leverage at the interface: a lot of behaviour behind a small interface. **Deep** = high leverage. **Shallow** = interface nearly as complex as the implementation.
28
+ - **Seam** — where an interface lives; a place behaviour can be altered without editing in place. (Use this, not "boundary.")
29
+ - **Adapter** — a concrete thing satisfying an interface at a seam.
30
+ - **Leverage** — what callers get from depth.
31
+ - **Locality** — what maintainers get from depth: change, bugs, knowledge concentrated in one place.
32
+
33
+ Key principles (see [LANGUAGE.md](LANGUAGE.md) for the full list):
34
+
35
+ - **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.
36
+ - **The interface is the test surface.**
37
+ - **One adapter = hypothetical seam. Two adapters = real seam.**
38
+
39
+ This skill is _informed_ by the project's domain model. Read `spec/INDEX.md` for the vocabulary of needs and ADRs; read `spec/needs/*/prd.md` and `spec/needs/*/design.md` for the domain language and the names of seams that matter; read `spec/ADR/*.md` to find decisions the skill should not re-litigate. Treat ADRs with `status: accepted` as binding.
40
+
41
+ ## Process
42
+
43
+ ### 1. Explore
44
+
45
+ Read `spec/INDEX.md` (vocabulary + need landscape), the relevant `spec/needs/*/prd.md` and `spec/needs/*/design.md` files for the area being touched, and any `spec/ADR/*.md` with `status: accepted` that constrains the area.
46
+
47
+ Then use the Agent tool with `subagent_type=Explore` to walk the codebase. Don't follow rigid heuristics — explore organically and note where you experience friction:
48
+
49
+ - Where does understanding one concept require bouncing between many small modules?
50
+ - Where are modules **shallow** — interface nearly as complex as the implementation?
51
+ - Where have pure functions been extracted just for testability, but the real bugs hide in how they're called (no **locality**)?
52
+ - Where do tightly-coupled modules leak across their seams?
53
+ - Which parts of the codebase are untested, or hard to test through their current interface?
54
+
55
+ Apply the **deletion test** to anything you suspect is shallow: would deleting it concentrate complexity, or just move it? A "yes, concentrates" is the signal you want.
56
+
57
+ Classify dependencies using [DEEPENING.md](DEEPENING.md) before recommending a direction. The dependency category determines whether the proposed seam is in-process, local-substitutable, ports-and-adapters, or mock-backed.
58
+
59
+ ### 2. Present candidates as an HTML report
60
+
61
+ Write a self-contained HTML file to the OS temp directory so nothing lands in the repo. Resolve the temp dir from `$TMPDIR`, falling back to `/tmp` (or `%TEMP%` on Windows), and write to `<tmpdir>/architecture-review-<timestamp>.html` so each run gets a fresh file. Open it for the user — `xdg-open <path>` on Linux, `open <path>` on macOS, `start <path>` on Windows — and tell them the absolute path.
62
+
63
+ The report uses **Tailwind via CDN** for layout and styling, and **Mermaid via CDN** for diagrams where a graph/flow/sequence reliably communicates the structure. Mix Mermaid with hand-crafted CSS/SVG visuals — use Mermaid when relationships are graph-shaped (call graphs, dependencies, sequences), and hand-built divs/SVG when you want something more editorial (mass diagrams, cross-sections, collapse animations). Each candidate gets a **before/after visualisation**. Be visual.
64
+
65
+ Use [HTML-REPORT.md](HTML-REPORT.md) for the full HTML scaffold, diagram patterns, and styling guidance.
66
+
67
+ For each candidate, the same template as before, but rendered as a card:
68
+
69
+ - **Files** — which files/modules are involved
70
+ - **Problem** — why the current architecture is causing friction
71
+ - **Solution** — plain English description of what would change
72
+ - **Benefits** — explained in terms of locality and leverage, and how tests would improve
73
+ - **Before / After diagram** — side-by-side, custom-drawn, illustrating the shallowness and the deepening
74
+ - **Recommendation strength** — one of `Strong`, `Worth exploring`, `Speculative`, rendered as a badge
75
+
76
+ End the report with a **Top recommendation** section: which candidate you'd tackle first and why.
77
+
78
+ **Use `spec/INDEX.md` + need-level `prd.md`/`design.md` vocabulary for the domain, and [LANGUAGE.md](LANGUAGE.md) vocabulary for the architecture.** If `spec/INDEX.md` defines "Order," talk about "the Order intake module" — not "the FooBarHandler," and not "the Order service."
79
+
80
+ **ADR conflicts**: if a candidate contradicts an existing ADR, only surface it when the friction is real enough to warrant revisiting the ADR. Mark it clearly in the card (e.g. a warning callout: _"contradicts ADR-0007 in `spec/ADR/` — but worth reopening because..."_). Don't list every theoretical refactor an ADR forbids.
81
+
82
+ Do NOT propose interfaces yet. After the file is written, ask the user: "Which of these would you like to explore?"
83
+
84
+ ### 3. Grilling loop
85
+
86
+ Once the user picks a candidate, drop into a grilling conversation. Walk the design tree with them — constraints, dependencies, the shape of the deepened module, what sits behind the seam, what tests survive.
87
+
88
+ Side effects happen inline as decisions crystallize:
89
+
90
+ - **Naming a deepened module after a concept not in `spec/INDEX.md`?** Add the term to the relevant `spec/needs/<need-name>/design.md` (or, if it spans needs, propose a new ADR). Do NOT create or modify a `CONTEXT.md` file — this project does not use that path.
91
+ - **Sharpening a fuzzy term during the conversation?** Patch the relevant `design.md` or ADR right there.
92
+ - **User rejects the candidate with a load-bearing reason?** Offer an ADR, framed as: _"Want me to record this as `spec/ADR/NNNN-architecture-<topic>.md` with `status: proposed` so future architecture reviews don't re-suggest it?"_ Only offer when the reason would actually be needed by a future explorer — skip ephemeral reasons ("not worth it right now") and self-evident ones.
93
+ - **Want to explore alternative interfaces for the deepened module?** See [INTERFACE-DESIGN.md](INTERFACE-DESIGN.md).
94
+ - **User accepts the candidate and asks you to apply it?** Stop here. Do NOT modify code from this skill. Bounce back to S1: open a new need (A1) for the refactor, or patch an existing `design.md` (A3). This skill is REVIEW-only.
95
+
96
+ ## Boundaries
97
+
98
+ - Do not attach this skill to A/B nodes. B7 may recommend it; only the user invokes it.
99
+ - Do not modify application code from this skill.
100
+ - Do not create `CONTEXT.md` or `docs/adr/`.
101
+ - Keep architecture vocabulary in [LANGUAGE.md](LANGUAGE.md); keep report shape in [HTML-REPORT.md](HTML-REPORT.md); keep dependency strategy in [DEEPENING.md](DEEPENING.md); use [INTERFACE-DESIGN.md](INTERFACE-DESIGN.md) only after the user chooses a candidate.
@@ -1,64 +1,64 @@
1
- ---
2
- name: karpathy-guidelines
3
- description: Behavioral guidelines to reduce common LLM coding mistakes. Use when writing, reviewing, or refactoring code to avoid overcomplication, make surgical changes, surface assumptions, and define verifiable success criteria.
4
- license: MIT
5
- ---
6
-
7
- # Karpathy Guidelines
8
- **Tradeoff:** These guidelines bias toward caution over speed. For trivial tasks, use judgment.
9
-
10
- ## 1. Think Before Coding
11
-
12
- **Don't assume. Don't hide confusion. Surface tradeoffs.**
13
-
14
- Before implementing:
15
- - State your assumptions explicitly. If uncertain, ask.
16
- - If multiple interpretations exist, present them - don't pick silently.
17
- - If a simpler approach exists, say so. Push back when warranted.
18
- - If something is unclear, stop. Name what's confusing. Ask.
19
-
20
- ## 2. Simplicity First
21
-
22
- **Minimum code that solves the problem. Nothing speculative.**
23
-
24
- - No features beyond what was asked.
25
- - No abstractions for single-use code.
26
- - No "flexibility" or "configurability" that wasn't requested.
27
- - No error handling for impossible scenarios.
28
- - If you write 200 lines and it could be 50, rewrite it.
29
-
30
- Ask yourself: "Would a senior engineer say this is overcomplicated?" If yes, simplify.
31
-
32
- ## 3. Surgical Changes
33
-
34
- **Touch only what you must. Clean up only your own mess.**
35
-
36
- When editing existing code:
37
- - Don't "improve" adjacent code, comments, or formatting.
38
- - Don't refactor things that aren't broken.
39
- - Match existing style, even if you'd do it differently.
40
- - If you notice unrelated dead code, mention it - don't delete it.
41
-
42
- When your changes create orphans:
43
- - Remove imports/variables/functions that YOUR changes made unused.
44
- - Don't remove pre-existing dead code unless asked.
45
-
46
- The test: Every changed line should trace directly to the user's request.
47
-
48
- ## 4. Goal-Driven Execution
49
-
50
- **Define success criteria. Loop until verified.**
51
-
52
- Transform tasks into verifiable goals:
53
- - "Add validation" → "Write tests for invalid inputs, then make them pass"
54
- - "Fix the bug" → "Write a test that reproduces it, then make it pass"
55
- - "Refactor X" → "Ensure tests pass before and after"
56
-
57
- For multi-step tasks, state a brief plan:
58
- ```
59
- 1. [Step] → verify: [check]
60
- 2. [Step] → verify: [check]
61
- 3. [Step] → verify: [check]
62
- ```
63
-
1
+ ---
2
+ name: karpathy-guidelines
3
+ description: Behavioral guidelines to reduce common LLM coding mistakes. Use when writing, reviewing, or refactoring code to avoid overcomplication, make surgical changes, surface assumptions, and define verifiable success criteria.
4
+ license: MIT
5
+ ---
6
+
7
+ # Karpathy Guidelines
8
+ **Tradeoff:** These guidelines bias toward caution over speed. For trivial tasks, use judgment.
9
+
10
+ ## 1. Think Before Coding
11
+
12
+ **Don't assume. Don't hide confusion. Surface tradeoffs.**
13
+
14
+ Before implementing:
15
+ - State your assumptions explicitly. If uncertain, ask.
16
+ - If multiple interpretations exist, present them - don't pick silently.
17
+ - If a simpler approach exists, say so. Push back when warranted.
18
+ - If something is unclear, stop. Name what's confusing. Ask.
19
+
20
+ ## 2. Simplicity First
21
+
22
+ **Minimum code that solves the problem. Nothing speculative.**
23
+
24
+ - No features beyond what was asked.
25
+ - No abstractions for single-use code.
26
+ - No "flexibility" or "configurability" that wasn't requested.
27
+ - No error handling for impossible scenarios.
28
+ - If you write 200 lines and it could be 50, rewrite it.
29
+
30
+ Ask yourself: "Would a senior engineer say this is overcomplicated?" If yes, simplify.
31
+
32
+ ## 3. Surgical Changes
33
+
34
+ **Touch only what you must. Clean up only your own mess.**
35
+
36
+ When editing existing code:
37
+ - Don't "improve" adjacent code, comments, or formatting.
38
+ - Don't refactor things that aren't broken.
39
+ - Match existing style, even if you'd do it differently.
40
+ - If you notice unrelated dead code, mention it - don't delete it.
41
+
42
+ When your changes create orphans:
43
+ - Remove imports/variables/functions that YOUR changes made unused.
44
+ - Don't remove pre-existing dead code unless asked.
45
+
46
+ The test: Every changed line should trace directly to the user's request.
47
+
48
+ ## 4. Goal-Driven Execution
49
+
50
+ **Define success criteria. Loop until verified.**
51
+
52
+ Transform tasks into verifiable goals:
53
+ - "Add validation" → "Write tests for invalid inputs, then make them pass"
54
+ - "Fix the bug" → "Write a test that reproduces it, then make it pass"
55
+ - "Refactor X" → "Ensure tests pass before and after"
56
+
57
+ For multi-step tasks, state a brief plan:
58
+ ```
59
+ 1. [Step] → verify: [check]
60
+ 2. [Step] → verify: [check]
61
+ 3. [Step] → verify: [check]
62
+ ```
63
+
64
64
  Strong success criteria let you loop independently. Weak criteria ("make it work") require constant clarification.