pi-matt-pocock 0.2.1 → 0.3.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 (70) hide show
  1. package/ARCHITECTURE.zh-CN.md +37 -19
  2. package/README.md +80 -13
  3. package/package.json +12 -7
  4. package/procedures/code-review.md +25 -17
  5. package/procedures/codebase-design.md +11 -10
  6. package/procedures/deslop.md +4 -2
  7. package/procedures/diagnosing-bugs.md +25 -25
  8. package/procedures/domain-modeling.md +18 -20
  9. package/procedures/grill-me.md +1 -1
  10. package/procedures/grill-with-docs.md +1 -1
  11. package/procedures/grilling.md +29 -5
  12. package/procedures/handoff.md +1 -1
  13. package/procedures/implement.md +7 -1
  14. package/procedures/improve-codebase-architecture.md +22 -22
  15. package/procedures/pr.md +169 -0
  16. package/procedures/prototype.md +7 -6
  17. package/procedures/research.md +2 -2
  18. package/procedures/retro.md +42 -0
  19. package/procedures/setup-matt-pocock-skills.md +26 -22
  20. package/procedures/tdd.md +17 -15
  21. package/procedures/teach.md +11 -7
  22. package/procedures/to-questionnaire.md +7 -5
  23. package/procedures/to-spec.md +2 -2
  24. package/procedures/to-tickets.md +12 -12
  25. package/procedures/triage.md +22 -22
  26. package/procedures/wait-what.md +1 -1
  27. package/procedures/wayfinder.md +24 -24
  28. package/procedures/wizard.md +7 -7
  29. package/procedures/writing-for-agents.md +14 -14
  30. package/{procedures → references}/ADR-FORMAT.md +11 -11
  31. package/{procedures → references}/AGENT-BRIEF.md +4 -4
  32. package/{procedures → references}/DEEPENING.md +3 -3
  33. package/{procedures → references}/DESIGN-IT-TWICE.md +7 -7
  34. package/{procedures → references}/GLOSSARY-FORMAT.md +9 -2
  35. package/{procedures → references}/HTML-REPORT.md +15 -15
  36. package/{procedures → references}/LEARNING-RECORD-FORMAT.md +10 -10
  37. package/{procedures → references}/LOGIC.md +5 -5
  38. package/{procedures → references}/MISSION-FORMAT.md +2 -2
  39. package/{procedures → references}/OUT-OF-SCOPE.md +11 -11
  40. package/{procedures → references}/RESOURCES-FORMAT.md +1 -1
  41. package/{procedures → references}/SKILL-MECHANICS.md +3 -3
  42. package/{procedures → references}/UI.md +14 -14
  43. package/{procedures → references}/bdd-best-practices.md +3 -3
  44. package/{procedures → references}/bdd.md +9 -9
  45. package/{procedures → references}/domain.md +12 -12
  46. package/references/issue-tracker-github.md +50 -0
  47. package/{procedures → references}/issue-tracker-gitlab.md +9 -9
  48. package/{procedures → references}/issue-tracker-local.md +3 -3
  49. package/{procedures → references}/phase-boundaries.md +8 -8
  50. package/src/catalog.json +49 -28
  51. package/src/catalog.ts +58 -2
  52. package/src/index.ts +539 -363
  53. package/src/native-dialog.ts +149 -213
  54. package/src/resolver.ts +57 -11
  55. package/src/workflow.ts +76 -18
  56. package/upstream/UPSTREAM.md +116 -0
  57. package/{scripts → upstream}/check-upstream-sync.mjs +12 -12
  58. package/{upstream-selection.json → upstream/upstream-selection.json} +9 -7
  59. package/UPSTREAM.md +0 -63
  60. package/procedures/CONTEXT-FORMAT.md +0 -60
  61. package/procedures/issue-tracker-github.md +0 -45
  62. /package/{procedures → assets}/hitl-loop.template.sh +0 -0
  63. /package/{procedures → assets}/template.sh +0 -0
  64. /package/{procedures → references}/GLOSSARY.md +0 -0
  65. /package/{procedures → references}/gherkin-guide.md +0 -0
  66. /package/{procedures → references}/mocking.md +0 -0
  67. /package/{procedures → references}/testing-anti-patterns.md +0 -0
  68. /package/{procedures → references}/tests.md +0 -0
  69. /package/{procedures → references}/triage-labels.md +0 -0
  70. /package/{procedures → references}/writing-great-skills.md +0 -0
@@ -1,6 +1,6 @@
1
1
  A loose idea has arrived — too big for one agent session, and wrapped in fog: the way from here to the **destination** isn't visible yet. Wayfinding is about finding that way, not charging at the destination. This procedure charts the way as a **shared map** on the repo's issue tracker, then works its **decision tickets** — questions whose resolution is a decision, not slices of a build to execute — one at a time until the route is clear.
2
2
 
3
- The destination varies per effort, and naming it is the first act of charting — it shapes every ticket. It might be a spec to hand off and iterate on, a decision to lock before planning starts, or a change made in place like a data-structure migration. The map is domain-agnostic — engineering work, course content, whatever fits the shape.
3
+ The destination varies per effort, and naming it is the first act of charting: it shapes every ticket. It might be a spec to hand off and iterate on, a decision to lock before planning starts, or a change made in place like a data-structure migration. The map is domain-agnostic: engineering work, course content, whatever fits the shape.
4
4
 
5
5
  ## Plan, don't do
6
6
 
@@ -8,24 +8,24 @@ Wayfinder is **planning** by default: each ticket resolves a decision, and the m
8
8
 
9
9
  ## Refer by name
10
10
 
11
- Every map and ticket is an issue, so it has a **name** — its title. In everything the human reads — narration, the map's Decisions-so-far — refer to it by that name, never by a bare id, number, or slug. A wall of `#42, #43, #44` is illegible; names read at a glance. The id and URL don't vanish — a name wraps its link — but they ride *inside* the name, never stand in for it.
11
+ Every map and ticket is an issue, so it has a **name**: its title. In everything the human reads (narration, the map's Decisions-so-far), refer to it by that name, never by a bare id, number, or slug. A wall of `#42, #43, #44` is illegible; names read at a glance. The id and URL don't vanish; a name wraps its link, but they ride _inside_ the name, never stand in for it.
12
12
 
13
13
  ## The Map
14
14
 
15
- The map is a single issue on this repo's issue tracker, labelled `wayfinder:map` — the canonical artifact. Its tickets are child issues of the map.
15
+ The map is a single issue on this repo's issue tracker, labelled `wayfinder:map`, the canonical artifact. Its tickets are child issues of the map.
16
16
 
17
- The map is an **index**, not a store. It lists the decisions made and points at the tickets that hold their detail; a decision lives in exactly one place — its ticket — so the map never restates it, only gists it and links.
17
+ The map is an **index**, not a store. It lists the decisions made and points at the tickets that hold their detail; a decision lives in exactly one place, its ticket, so the map never restates it, only gists it and links.
18
18
 
19
19
  **Where the map, its child tickets, blocking, and frontier queries physically live is tracker-specific.** The issue tracker should have been provided to you — load [setup-matt-pocock-skills](setup-matt-pocock-skills.md) with `matt_pocock_active` (`action: "load"`, from available references) if not. It is a package procedure, not a Pi skill. Consult the tracker doc's "Wayfinding operations" section for how _this_ repo expresses them. If no tracker has been provided, default to the local-markdown tracker.
20
20
 
21
21
  ### The map body
22
22
 
23
- The whole map at low resolution, loaded once per session. Open tickets are **not** listed — they are open child issues, found by query.
23
+ The whole map at low resolution, loaded once per session. Open tickets are **not** listed: they are open child issues, found by query.
24
24
 
25
25
  ```markdown
26
26
  ## Destination
27
27
 
28
- <what reaching the end of this map looks like — the spec, decision, or change this effort is finding its way to. One or two lines; every session orients to it before choosing a ticket.>
28
+ <what reaching the end of this map looks like: the spec, decision, or change this effort is finding its way to. One or two lines; every session orients to it before choosing a ticket.>
29
29
 
30
30
  ## Notes
31
31
 
@@ -33,9 +33,9 @@ The whole map at low resolution, loaded once per session. Open tickets are **not
33
33
 
34
34
  ## Decisions so far
35
35
 
36
- <!-- the index — one line per closed ticket: enough to judge relevance, then zoom the link for the detail the ticket holds -->
36
+ <!-- the index: one line per closed ticket, enough to judge relevance, then zoom the link for the detail the ticket holds -->
37
37
 
38
- - [<closed ticket title>](link) — <one-line gist of the answer>
38
+ - [<closed ticket title>](link): <one-line gist of the answer>
39
39
 
40
40
  ## Not yet specified
41
41
 
@@ -56,43 +56,43 @@ Each ticket is a **child issue** of the map; the tracker's issue id is its ident
56
56
  <the decision or investigation this ticket resolves>
57
57
  ```
58
58
 
59
- Each ticket carries a `wayfinder:<type>` label — one of `research`, `prototype`, `grilling`, `task` (see [Ticket Types](#ticket-types)).
59
+ Each ticket carries a `wayfinder:<type>` label — one of `research`, `prototype`, `grilling`, `task` (see [Ticket Types](#ticket-types)). Wayfinder labels are the only labels a map and its tickets carry, never a triage label like `ready-for-agent`: these tickets are decisions, not implementation work.
60
60
 
61
61
  A session **claims** a ticket by assigning it to the dev driving the map, **first**, before any work, so concurrent sessions skip it. That assignee _is_ the claim: an open, unassigned ticket is unclaimed.
62
62
 
63
- Blocking uses the tracker's **native** dependency relationship — essential because it renders the frontier _visually_ in the tracker's own UI, so the human sees what's takeable without opening the map. Only a tracker that lacks native blocking falls back to a body convention. A ticket is **unblocked** when every ticket blocking it is closed; the **frontier** is the open, unblocked, unclaimed children — the edge of the known.
63
+ Blocking uses the tracker's **native** dependency relationship: essential because it renders the frontier _visually_ in the tracker's own UI, so the human sees what's takeable without opening the map. Only a tracker that lacks native blocking falls back to a body convention. A ticket is **unblocked** when every ticket blocking it is closed; the **frontier** is the open, unblocked, unclaimed children, the edge of the known.
64
64
 
65
- The answer isn't part of the body — it's recorded on resolution (see [Work through the map](#work-through-the-map)). Assets created while resolving a ticket are linked from the issue, not pasted in.
65
+ The answer isn't part of the body; it's recorded on resolution (see [Work through the map](#work-through-the-map)). Assets created while resolving a ticket are linked from the issue, not pasted in.
66
66
 
67
67
  ## Ticket Types
68
68
 
69
- Every ticket is either **HITL** — human in the loop, worked *with* a human who speaks for themselves — or **AFK**, driven by the agent alone. A HITL ticket only resolves through that live exchange; the agent never stands in for the human's side of it (a grilling agent that answers its own questions has broken this).
69
+ Every ticket is either **HITL** (human in the loop, worked _with_ a human who speaks for themselves) or **AFK**, driven by the agent alone. A HITL ticket only resolves through that live exchange; the agent never stands in for the human's side of it (a grilling agent that answers its own questions has broken this).
70
70
 
71
71
  - **Research** (AFK): Reading documentation, third-party APIs, or local resources like knowledge bases to surface a fact a decision waits on. Delegate it to a teammate when the teammate facility is available; otherwise research it sequentially. Use when knowledge outside the current working directory is required.
72
72
  - **Prototype** (HITL): Raise the fidelity of the discussion by making a cheap, rough, concrete artifact to react to — an outline, a rough take, a stub, or UI/logic code by transitioning to the [prototype](prototype.md) procedure. Links the prototype as an asset. Use when "how should it look" or "how should it behave" is the key question.
73
73
  - **Grilling** (HITL): Conversation with the bundled [grilling](grilling.md) and [domain-modeling](domain-modeling.md) procedures, one question at a time. The default case.
74
- - **Task** (HITL or AFK): Manual work that must happen before a *decision* can be made — nothing to decide, prototype, or research, but the discussion is blocked until it's done. Signing up for a service so its API can be judged, provisioning access, moving data so its shape can be seen. This is the one type that *does* rather than decides — and it earns its place by unblocking a decision, not by delivering the destination. The agent drives it alone where it can (AFK); otherwise it hands the human a precise checklist (HITL). Resolved when the work is done; the answer records what was done and any resulting facts (credentials location, new URLs, row counts) later tickets depend on.
74
+ - **Task** (HITL or AFK): Manual work that must happen before a _decision_ can be made: nothing to decide, prototype, or research, but the discussion is blocked until it's done. Signing up for a service so its API can be judged, provisioning access, moving data so its shape can be seen. This is the one type that _does_ rather than decides, and it earns its place by unblocking a decision, not by delivering the destination. The agent drives it alone where it can (AFK); otherwise it hands the human a precise checklist (HITL). Resolved when the work is done; the answer records what was done and any resulting facts (credentials location, new URLs, row counts) later tickets depend on.
75
75
 
76
76
  ## Fog of war
77
77
 
78
- The map is _deliberately_ incomplete: don't chart what you can't yet see. Beyond the live tickets lies the **fog of war** — the dim view of decisions and investigations you can tell are coming but can't yet pin down, because they hang on questions still open. Resolving a ticket clears the fog ahead of it, graduating whatever's now specifiable into fresh tickets — one at a time, until the way to the destination is clear and no tickets remain.
78
+ The map is _deliberately_ incomplete: don't chart what you can't yet see. Beyond the live tickets lies the **fog of war**: the dim view of decisions and investigations you can tell are coming but can't yet pin down, because they hang on questions still open. Resolving a ticket clears the fog ahead of it, graduating whatever's now specifiable into fresh tickets, one at a time, until the way to the destination is clear and no tickets remain.
79
79
 
80
- The map's **Not yet specified** section is where that dim view is written down: the suspected question, the area to revisit later. It's the undiscovered frontier _toward_ the destination — everything here is in scope, just not sharp enough to ticket. Write as loosely or as fully as the view allows; it doubles as a signpost for collaborators reading where the effort is headed.
80
+ The map's **Not yet specified** section is where that dim view is written down: the suspected question, the area to revisit later. It's the undiscovered frontier _toward_ the destination: everything here is in scope, just not sharp enough to ticket. Write as loosely or as fully as the view allows; it doubles as a signpost for collaborators reading where the effort is headed.
81
81
 
82
- **Fog or ticket?** The test is whether you can state the question precisely now — _not_ whether you can answer it now.
82
+ **Fog or ticket?** The test is whether you can state the question precisely now, _not_ whether you can answer it now.
83
83
 
84
- - **Ticket when** the question is already sharp — even if it's blocked and you can't act on it yet.
84
+ - **Ticket when** the question is already sharp, even if it's blocked and you can't act on it yet.
85
85
  - **Not yet specified when** you can't yet phrase it that sharply. Don't pre-slice the fog into ticket-sized pieces: it's coarser than a ticket, and one patch may graduate into several tickets, or none, once the frontier reaches it.
86
86
 
87
87
  **Not yet specified** excludes what's already decided (Decisions so far), what's already a live ticket, and what's out of scope (the next section).
88
88
 
89
89
  ## Out of scope
90
90
 
91
- Fog only ever gathers _toward_ the destination. The destination fixes the scope, so work beyond it is **out of scope** — it isn't fog, and it doesn't belong in **Not yet specified**. It gets its own **Out of scope** section on the map: work you've consciously ruled out of _this_ effort. Scope, not sharpness, lands it here.
91
+ Fog only ever gathers _toward_ the destination. The destination fixes the scope, so work beyond it is **out of scope**: it isn't fog, and it doesn't belong in **Not yet specified**. It gets its own **Out of scope** section on the map: work you've consciously ruled out of _this_ effort. Scope, not sharpness, lands it here.
92
92
 
93
- Out-of-scope work never graduates — the frontier stops at the destination — so it returns only if the destination is redrawn, and then as a fresh effort, not a resumption.
93
+ Out-of-scope work never graduates (the frontier stops at the destination), so it returns only if the destination is redrawn, and then as a fresh effort, not a resumption.
94
94
 
95
- Ruling something out of scope is a scoping act, not a step on the route. When a ticket that already exists turns out to sit past the destination — mis-scoped in while charting, or exposed by a resolution — **close it** (a closed ticket is unambiguously off the frontier) and leave one line in the **Out of scope** section: the gist plus why it's out of scope, linking the closed ticket. It stays out of **Decisions so far**, which records the route actually walked — a scope boundary isn't a step on it.
95
+ Ruling something out of scope is a scoping act, not a step on the route. When a ticket that already exists turns out to sit past the destination (mis-scoped in while charting, or exposed by a resolution), **close it** (a closed ticket is unambiguously off the frontier) and leave one line in the **Out of scope** section: the gist plus why it's out of scope, linking the closed ticket. It stays out of **Decisions so far**, which records the route actually walked; a scope boundary isn't a step on it.
96
96
 
97
97
  ## CRITICAL: Claim before work; keep the frontier moving
98
98
 
@@ -109,15 +109,15 @@ User invokes with a loose idea.
109
109
  1. **Name the destination.** Run a [grilling](grilling.md) and [domain-modeling](domain-modeling.md) session to pin down what this map is finding its way to — the spec, decision, or change. The destination fixes the scope, so it's settled first.
110
110
  2. **Map the frontier.** Grill again, **breadth-first** this time: fan out across the whole space rather than deep on any one thread, surfacing the open decisions and the first steps takeable now. **If this surfaces no fog** — the way to the destination is already clear, the whole journey small enough for one session — you don't need a map. Stop, ask directly in the conversation how the user would like to proceed (e.g., proceed without a map / chart the map anyway), and wait for the reply.
111
111
  3. **Create the map** (label `wayfinder:map`): Destination and Notes filled in, Decisions-so-far empty, the fog sketched into **Not yet specified**.
112
- 4. **Create the tickets you can specify now** as child issues of the map — then wire blocking edges in a **second pass** (issues need ids before they can reference each other). Wiring sorts them into the frontier and the blocked; everything you can't yet specify stays in the fog — the **Not yet specified** section.
113
- 5. **Research the frontier.** For each `research` ticket you just created, use [research](research.md). Delegate independent tickets to teammates only when the teammate facility is available; otherwise resolve them sequentially. Capture findings on a throwaway `research/<name>` branch with a context pointer from the ticket.
112
+ 4. **Create the tickets you can specify now** as child issues of the map — then wire blocking edges in a **second pass** (issues need ids before they can reference each other) and write cross-references in that pass too, with real ids; a placeholder `#N` autolinks to an unrelated issue. Wiring sorts them into the frontier and the blocked; everything you can't yet specify stays in the fog — the **Not yet specified** section.
113
+ 5. **Research the frontier.** For each `research` ticket you just created, use [research](research.md). Delegate independent tickets to teammates with a fresh context window each, only when the teammate facility is available; otherwise resolve them sequentially. Capture findings on a throwaway `research/<name>` branch with a context pointer from the ticket.
114
114
  6. Continue directly into the first unblocked AFK research or task ticket. Claim it before work, resolve it, record the resolution, and then work every newly unblocked AFK ticket in order. Stop only when the frontier requires a HITL decision, unavailable fact, or external action. Do not stop merely because charting is complete or ask the user whether to continue.
115
115
 
116
116
  ### Work through the map
117
117
 
118
- User invokes with a map (URL or number). A ticket is **optional** — without one, you pick the next decision, not the user.
118
+ User invokes with a map (URL or number). A ticket is **optional**: without one, you pick the next decision, not the user.
119
119
 
120
- 1. Load the **map** — the low-res view, not every ticket body.
120
+ 1. Load the **map**: the low-res view, not every ticket body.
121
121
  2. Choose the ticket. If the user named one, use it. Otherwise take the first frontier ticket in order. **Claim it**: assign it to yourself before any work.
122
122
  3. Resolve it — **zoom as needed**: fetch the full body of any related or closed ticket on demand; invoke the procedures the `## Notes` block names. If in doubt, follow the bundled [grilling](grilling.md) and [domain-modeling](domain-modeling.md).
123
123
  4. Record the resolution: post the answer as a **resolution comment**, **close** the issue, and **append a context pointer** to the map's Decisions-so-far.
@@ -2,7 +2,7 @@
2
2
 
3
3
  A **wizard** is a bash script that walks a human, step by step, through a manual procedure that's tedious to do by hand and tedious to re-explain to an AI every time. It opens each URL, says exactly what to click and copy, captures the values, writes them where they belong (`.env`, GitHub secrets), confirms at every stage, and shows how many stages are left. It might configure third-party services, run a one-off migration, or move the project from one state to another.
4
4
 
5
- The delightful UX is already solved by [template.sh](template.sh) — stage-by-stage progress, confirmation gates, cross-platform URL opening (including WSL), hidden secret entry, idempotent `.env` upserts, `gh secret`/`gh variable` writes, and a closing summary. **Your job is only to scope the procedure and author its stages.** The library above the `STAGES` marker is identical in every wizard; that consistency is the point — never hand-edit it.
5
+ The delightful UX is already solved by [template.sh](../assets/template.sh): stage-by-stage progress, confirmation gates, cross-platform URL opening (including WSL), hidden secret entry, idempotent `.env` upserts, `gh secret`/`gh variable` writes, and a closing summary. **Your job is only to scope the procedure and author its stages.** The library above the `STAGES` marker is identical in every wizard; that consistency is the point: never hand-edit it.
6
6
 
7
7
  A wizard is ephemeral by default — built for one run, saved to a scratch or `scripts/` path, deleted when the job's done. When the user wants a repeatable setup path to live in the repo, use the repository's git-agent workflow to record it.
8
8
 
@@ -10,18 +10,18 @@ A wizard is ephemeral by default — built for one run, saved to a scratch or `s
10
10
 
11
11
  ### 1. Scope the procedure
12
12
 
13
- Work out every manual step the human must take and every value that gets captured along the way. Read the repo first — don't ask cold:
13
+ Work out every manual step the human must take and every value that gets captured along the way. Read the repo first, don't ask cold:
14
14
 
15
15
  - For setup: `.env`, `.env.example`, `.env.*`, `README`, `docker-compose*`, framework config, and `.github/workflows/*` (every `secrets.*` / `vars.*` reference is a value the wizard must produce).
16
16
  - For a migration or transition: the current state, the target state, and the irreversible actions between them.
17
17
 
18
- Then show the user the ordered list of stages and the values each produces, and confirm — they may add, drop, or reorder.
18
+ Then show the user the ordered list of stages and the values each produces, and confirm: they may add, drop, or reorder.
19
19
 
20
- **Done when:** every stage is named in order, and for each captured value you know (a) where the human gets it, (b) where it's written (`.env`, a GitHub secret, both, or nowhere — some stages are pure actions), and (c) whether it's secret (hidden entry) or public.
20
+ **Done when:** every stage is named in order, and for each captured value you know (a) where the human gets it, (b) where it's written (`.env`, a GitHub secret, both, or nowhere; some stages are pure actions), and (c) whether it's secret (hidden entry) or public.
21
21
 
22
22
  ### 2. Map each stage's journey
23
23
 
24
- For each stage, write the precise path a human follows: which URL to open, what to do there, where a value is shown, which variable it fills — e.g. "Dashboard → Developers → API keys → Reveal test key → copy". Where you don't actually know the current UI or the exact command, say so and ask the user or check the docs — never invent steps that may not exist.
24
+ For each stage, write the precise path a human follows: which URL to open, what to do there, where a value is shown, which variable it fills: e.g. "Dashboard → Developers → API keys → Reveal test key → copy". Where you don't actually know the current UI or the exact command, say so and ask the user or check the docs: never invent steps that may not exist.
25
25
 
26
26
  **Done when:** every stage traces to concrete instructions a stranger could follow.
27
27
 
@@ -29,11 +29,11 @@ For each stage, write the precise path a human follows: which URL to open, what
29
29
 
30
30
  Copy `template.sh` to the target path. Replace the example stage with one `stage` per step, in dependency order. Use the library helpers — `stage`, `say`/`step`, `open_url`, `ask`/`ask_secret`, `write_env`, `set_secret`/`set_var`, `pause`/`confirm` — and set `TOTAL_STAGES` to the number of stages you wrote.
31
31
 
32
- Hold the bar the template sets: open the URL before asking for its value, use `ask_secret` for anything secret, `write_env` every persisted value, `set_secret` only the values CI actually needs, and `confirm` before any irreversible action. Each `stage` clears the screen so only the current step is visible — keep a stage to one focused task so nothing the human needs scrolls away. Don't touch the library above the marker.
32
+ Hold the bar the template sets: open the URL before asking for its value, use `ask_secret` for anything secret, `write_env` every persisted value, `set_secret` only the values CI actually needs, and `confirm` before any irreversible action. Each `stage` clears the screen so only the current step is visible: keep a stage to one focused task so nothing the human needs scrolls away. Don't touch the library above the marker.
33
33
 
34
34
  ### 4. Verify and hand off
35
35
 
36
36
  - `bash -n <script>`; run `shellcheck` if available.
37
37
  - `chmod +x <script>`.
38
- - Don't run it end-to-end yourself — it opens browsers and blocks on human input. Trace it statically instead: every value from step 1 is captured and lands where step 1 said, and every `set_secret` name exactly matches a `secrets.*` reference in CI.
38
+ - Don't run it end-to-end yourself: it opens browsers and blocks on human input. Trace it statically instead: every value from step 1 is captured and lands where step 1 said, and every `set_secret` name exactly matches a `secrets.*` reference in CI.
39
39
  - Tell the user how to run it. If it is a repeatable setup path, use the repository's git-agent workflow to record it and link it from the README so the next person runs the script instead of asking an AI.
@@ -1,6 +1,6 @@
1
1
  Reference for writing any document an agent consumes — a skill, an `AGENTS.md` / `CLAUDE.md`, a doc reached by a pointer. The packaging differs; the writing does not: the same levers make each one predictable — the agent taking the same _process_ every run, not producing the same output.
2
2
 
3
- When the document you're writing is a skill, read [`SKILL-MECHANICS.md`](SKILL-MECHANICS.md) for frontmatter, invocation choice, and router skills.
3
+ When the document you're writing is a skill, read [`SKILL-MECHANICS.md`](../references/SKILL-MECHANICS.md) for frontmatter, invocation choice, and router skills.
4
4
 
5
5
  ## Model-aware instruction audit
6
6
 
@@ -18,11 +18,11 @@ Use the sections below to apply this audit; preserve instructions that encode re
18
18
 
19
19
  ## Context pointers
20
20
 
21
- A **context pointer** is a reference held in the agent's context that names some out-of-context material and encodes the condition for reaching it. A skill's description is one; a line in `AGENTS.md` naming a doc is the same object. The pointer's _wording_, not its target, decides when the agent reaches the material — and how reliably. A must-have target behind a weakly worded pointer is a variance bug: sharpen the wording first, and inline the material only if sharpening fails.
21
+ A **context pointer** is a reference held in the agent's context that names some out-of-context material and encodes the condition for reaching it. A skill's description is one; a line in `AGENTS.md` naming a doc is the same object. The pointer's _wording_, not its target, decides when the agent reaches the material, and how reliably. A must-have target behind a weakly worded pointer is a variance bug: sharpen the wording first, and inline the material only if sharpening fails.
22
22
 
23
- A pointer does two jobs — state what the material is, and list the **branches** that should trigger reaching it (a branch is a distinct case the document handles, so different runs take different paths through it). Every word of an always-loaded pointer costs on every turn, so it earns even harder pruning than the body:
23
+ A pointer does two jobs: state what the material is, and list the **branches** that should trigger reaching it (a branch is a distinct case the document handles, so different runs take different paths through it). Every word of an always-loaded pointer costs on every turn, so it earns even harder pruning than the body:
24
24
 
25
- - **Front-load the leading word** — the pointer is where it does its triggering work.
25
+ - **Front-load the leading word**: the pointer is where it does its triggering work.
26
26
  - **One trigger per branch.** Synonyms that rename a single branch are one branch written twice; collapse them and keep only genuinely distinct branches.
27
27
  - **Cut identity the body already carries.**
28
28
 
@@ -45,7 +45,7 @@ A document is built from two content types — **steps** (the ordered actions th
45
45
 
46
46
  Push too little down and the top bloats; push too much and you hide material the agent actually needs. That tension is the whole decision.
47
47
 
48
- **Progressive disclosure** is the move down the ladder — out of the main file and behind a pointer — so the top stays legible. Not primarily a token optimisation: it is how the hierarchy is protected. Branching is the cleanest disclosure test: inline what every branch needs, and push behind a pointer what only some branches reach. When a document has steps, in-file reference that should be disclosed buries them and turns attending to them into a coin-flip — a variance lever, not just a legibility one.
48
+ **Progressive disclosure** is the move down the ladder (out of the main file and behind a pointer) so the top stays legible. Not primarily a token optimisation: it is how the hierarchy is protected. Branching is the cleanest disclosure test: inline what every branch needs, and push behind a pointer what only some branches reach. When a document has steps, in-file reference that should be disclosed buries them and turns attending to them into a coin-flip: a variance lever, not just a legibility one.
49
49
 
50
50
  **Co-location** is the within-file companion: where the ladder decides _how far down_ a piece sits, co-location decides _what sits beside it_ once there. Keep a concept's definition, rules, and caveats under one heading rather than scattered, so reading one part brings its neighbours with it. The test: the document should read like documentation written for the agent — grouped material reads that way; scattered material does not. (Distinct from duplication: that repeats one meaning in two places; scattering fragments one meaning across many.)
51
51
 
@@ -53,10 +53,10 @@ Push too little down and the top bloats; push too much and you hide material the
53
53
 
54
54
  ## Steps and completion criteria
55
55
 
56
- Every step ends on a **completion criterion** — the condition that tells the agent the work is done. Two properties make it a lever:
56
+ Every step ends on a **completion criterion**, the condition that tells the agent the work is done. Two properties make it a lever:
57
57
 
58
58
  - **Clarity** — can the agent tell done from not-done? A vague bound ("understanding reached") invites **premature completion**: ending the step before it is genuinely done, attention slipping to _being done_. The visible steps still ahead — the **post-completion steps** — supply the pull; the criterion's clarity is the resistance. Defend in order: **sharpen the bound first** (local and cheap); only if it is irreducibly fuzzy _and_ you observe the rush, hide the later steps by splitting the sequence — and hiding only works across a real context boundary (a hand-off or teammate delegation when available; an inline call leaves the later steps in context and clears nothing).
59
- - **Demand** — how much it requires. "Every modified model accounted for" forces thorough work where "produce a change list" does not. Demand drives **legwork** — the digging the agent does within the work, latent in the wording rather than written as its own step — and it is not step-bound: "every rule applied" binds a body of flat reference just as "every step done" binds a sequence, which is how an all-reference document still carries an exhaustiveness bar.
59
+ - **Demand**: how much it requires. "Every modified model accounted for" forces thorough work where "produce a change list" does not. Demand drives **legwork** (the digging the agent does within the work, latent in the wording rather than written as its own step), and it is not step-bound: "every rule applied" binds a body of flat reference just as "every step done" binds a sequence, which is how an all-reference document still carries an exhaustiveness bar.
60
60
 
61
61
  The strongest criteria are both checkable and exhaustive.
62
62
 
@@ -64,12 +64,12 @@ The strongest criteria are both checkable and exhaustive.
64
64
 
65
65
  Splitting one document into two spends one of the two loads, so split only when the cut earns it:
66
66
 
67
- - **By sequence** — split a run of steps where the post-completion steps tempt the agent to rush the one in front of it. Keeping them out of view drives more legwork on the current task. Beware the reverse: merging sequences exposes each step's later steps to what follows, inviting premature completion.
68
- - **By invocation** — skill-specific: see [`SKILL-MECHANICS.md`](SKILL-MECHANICS.md).
67
+ - **By sequence**: split a run of steps where the post-completion steps tempt the agent to rush the one in front of it. Keeping them out of view drives more legwork on the current task. Beware the reverse: merging sequences exposes each step's later steps to what follows, inviting premature completion.
68
+ - **By invocation**, skill-specific: see [`SKILL-MECHANICS.md`](../references/SKILL-MECHANICS.md).
69
69
 
70
70
  ## Leading words
71
71
 
72
- A **leading word** is a compact concept already living in the model's pretraining that the agent thinks with while running the document (_lesson_, _fog of war_, _tracer bullets_). Repeated as a token, never as a sentence, it accumulates a distributed definition and anchors a whole region of behaviour in the fewest tokens, by recruiting priors the model already holds. Coining your own works if you define it clearly, but a made-up word recruits no priors — you pay in definition tokens what a pretrained word gives free; reach for an existing word first.
72
+ A **leading word** is a compact concept already living in the model's pretraining that the agent thinks with while running the document (_lesson_, _fog of war_, _tracer bullets_). Repeated as a token, never as a sentence, it accumulates a distributed definition and anchors a whole region of behaviour in the fewest tokens, by recruiting priors the model already holds. Coining your own works if you define it clearly, but a made-up word recruits no priors: you pay in definition tokens what a pretrained word gives free; reach for an existing word first.
73
73
 
74
74
  It anchors twice. In the body, _execution_: the agent reaches for the same behaviour every time the word appears, and inside flat reference it focuses attention on a class of thing to look for. In a pointer, _invocation_: when the same word lives in your prompts, your docs, and your codebase, the agent links that shared language to the material and reaches it more reliably.
75
75
 
@@ -80,11 +80,11 @@ Hunt for opportunities to refactor with leading words. A triad spelled out at th
80
80
 
81
81
  You win twice: fewer tokens, and a sharper hook for the agent to hang its thinking on. Assume every document is carrying restatements that leading words retire — go find them.
82
82
 
83
- **Negation** is the failure mode beside this lever: steering by prohibition drags the forbidden behaviour into context and makes it _more_ available, not less. _Don't think of an elephant_, and the elephant is all there is; the negation is a weak modifier the strongly-activated concept overruns, so the ban half-reads as an instruction to do the thing. Prompt the **positive** — state the target behaviour ("write one-line comments") so the banned one is never spoken. A prohibition earns its place only as a hard guardrail you cannot phrase positively; even then, pair it with the positive target so attention lands on what to do.
83
+ **Negation** is the failure mode beside this lever: steering by prohibition drags the forbidden behaviour into context and makes it _more_ available, not less. _Don't think of an elephant_, and the elephant is all there is; the negation is a weak modifier the strongly-activated concept overruns, so the ban half-reads as an instruction to do the thing. Prompt the **positive**: state the target behaviour ("write one-line comments") so the banned one is never spoken. A prohibition earns its place only as a hard guardrail you cannot phrase positively; even then, pair it with the positive target so attention lands on what to do.
84
84
 
85
85
  ## Pruning
86
86
 
87
- - Keep each meaning in a **single source of truth**: one authoritative place, so changing the behaviour is a one-place edit. **Duplication** — the same meaning in more than one place — costs maintenance and tokens, and inflates a meaning's prominence on the ladder past its real rank. (The accidental inverse of a leading word, which repeats a token on purpose, never the meaning.)
88
- - The **environment** is a source of truth too — `package.json` scripts, config files, the directory layout, `--help` output — and a document that restates it is a **cache**: a copy of a lookup, earning its load only when the lookup is expensive. Cache what the agent cannot find by looking: the unwritten convention, the reason behind a choice, the gotcha no config confesses. Leave the one-file, one-command lookups to the environment, where they cannot go stale.
87
+ - Keep each meaning in a **single source of truth**: one authoritative place, so changing the behaviour is a one-place edit. **Duplication** (the same meaning in more than one place) costs maintenance and tokens, and inflates a meaning's prominence on the ladder past its real rank. (The accidental inverse of a leading word, which repeats a token on purpose, never the meaning.)
88
+ - The **environment** is a source of truth too (`package.json` scripts, config files, the directory layout, `--help` output), and a document that restates it is a **cache**: a copy of a lookup, earning its load only when the lookup is expensive. Cache what the agent cannot find by looking: the unwritten convention, the reason behind a choice, the gotcha no config confesses. Leave the one-file, one-command lookups to the environment, where they cannot go stale.
89
89
  - Check every line for **relevance**: does it still bear on what the document does? A line loses relevance by never bearing on the task (mere exposition, or a branch that should be disclosed) or by going stale as the behaviour or world it describes changes. Shorter documents are easier to keep relevant. Without a pruning discipline the default fate is **sediment**: stale layers that settle because adding feels safe and removing feels risky, until you must core down through them to find what is still live.
90
- - Hunt **no-ops** sentence by sentence: an instruction the model already obeys by default pays load to say nothing. The test — does it change behaviour versus the default? — is model-relative, not reader-relative: two people disagreeing about a no-op disagree about the default, and settle it by running the document, not by debate. When a sentence fails, delete the whole sentence rather than trim words from it. The test also grades leading words: a word too weak to beat the default (_be thorough_ when the agent is already thorough-ish) is a no-op, and the fix is a stronger word (_relentless_), not a different technique.
90
+ - Hunt **no-ops** sentence by sentence: an instruction the model already obeys by default pays load to say nothing. The test (does it change behaviour versus the default?) is model-relative, not reader-relative: two people disagreeing about a no-op disagree about the default, and settle it by running the document, not by debate. When a sentence fails, delete the whole sentence rather than trim words from it. The test also grades leading words: a word too weak to beat the default (_be thorough_ when the agent is already thorough-ish) is a no-op, and the fix is a stronger word (_relentless_), not a different technique.
@@ -2,7 +2,7 @@
2
2
 
3
3
  ADRs live in `docs/adr/` and use sequential numbering: `0001-slug.md`, `0002-slug.md`, etc.
4
4
 
5
- Create the `docs/adr/` directory lazily — only when the first ADR is needed.
5
+ Create the `docs/adr/` directory lazily: only when the first ADR is needed.
6
6
 
7
7
  ## Template
8
8
 
@@ -12,15 +12,15 @@ Create the `docs/adr/` directory lazily — only when the first ADR is needed.
12
12
  {1-3 sentences: what's the context, what did we decide, and why.}
13
13
  ```
14
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.
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
16
 
17
17
  ## Optional sections
18
18
 
19
19
  Only include these when they add genuine value. Most ADRs won't need them.
20
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
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
24
 
25
25
  ## Numbering
26
26
 
@@ -30,18 +30,18 @@ Scan `docs/adr/` for the highest existing number and increment by one.
30
30
 
31
31
  All three of these must be true:
32
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
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
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."
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
38
 
39
39
  ### What qualifies
40
40
 
41
41
  - **Architectural shape.** "We're using a monorepo." "The write model is event-sourced, the read model is projected into Postgres."
42
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.
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
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
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
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.
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.
@@ -1,8 +1,8 @@
1
1
  # Writing Agent Briefs
2
2
 
3
- An agent brief is a structured comment posted on a GitHub issue or PR when it moves to `ready-for-agent`. It is the authoritative specification that an AFK agent will work from. The original body and discussion are context — the agent brief is the contract.
3
+ An agent brief is a structured comment posted on a GitHub issue or PR when it moves to `ready-for-agent`. It is the authoritative specification that an AFK agent will work from. The original body and discussion are context: the agent brief is the contract.
4
4
 
5
- The brief states **what the agent should do**, which stretches to both surfaces: for an issue, that's building the change from nothing; for a PR, it's what's left to do *to the existing diff* — finish it, close gaps, address review points. Same principles either way; the PR example below shows the difference.
5
+ The brief states **what the agent should do**, which stretches to both surfaces: for an issue, that's building the change from nothing; for a PR, it's what's left to do *to the existing diff*: finish it, close gaps, address review points. Same principles either way; the PR example below shows the difference.
6
6
 
7
7
  ## Principles
8
8
 
@@ -12,7 +12,7 @@ The issue may sit in `ready-for-agent` for days or weeks. The codebase will chan
12
12
 
13
13
  - **Do** describe interfaces, types, and behavioral contracts
14
14
  - **Do** name specific types, function signatures, or config shapes that the agent should look for or modify
15
- - **Don't** reference file paths — they go stale
15
+ - **Don't** reference file paths: they go stale
16
16
  - **Don't** reference line numbers
17
17
  - **Don't** assume the current implementation structure will remain the same
18
18
 
@@ -22,7 +22,7 @@ Describe **what** the system should do, not **how** to implement it. The agent w
22
22
 
23
23
  - **Good:** "The `SkillConfig` type should accept an optional `schedule` field of type `CronExpression`"
24
24
  - **Bad:** "Open src/types/skill.ts and add a schedule field on line 42"
25
- - **Good:** "When a user runs [triage](triage.md) with no arguments, they should see a summary of issues needing attention"
25
+ - **Good:** "When a user runs [triage](../procedures/triage.md) with no arguments, they should see a summary of issues needing attention"
26
26
  - **Bad:** "Add a switch statement in the main handler function"
27
27
 
28
28
  ### Complete acceptance criteria
@@ -1,6 +1,6 @@
1
1
  # Deepening
2
2
 
3
- How to deepen a cluster of shallow modules safely, given its dependencies. Assumes the vocabulary in [codebase-design.md](codebase-design.md) — **module**, **interface**, **seam**, **adapter**.
3
+ How to deepen a cluster of shallow modules safely, given its dependencies. Assumes the vocabulary in [codebase-design.md](../procedures/codebase-design.md) — **module**, **interface**, **seam**, **adapter**.
4
4
 
5
5
  ## Dependency categories
6
6
 
@@ -8,7 +8,7 @@ When assessing a candidate for deepening, classify its dependencies. The categor
8
8
 
9
9
  ### 1. In-process
10
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.
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
12
 
13
13
  ### 2. Local-substitutable
14
14
 
@@ -31,7 +31,7 @@ Third-party services (Stripe, Twilio, etc.) you don't control. The deepened modu
31
31
 
32
32
  ## Testing strategy: replace, don't layer
33
33
 
34
- - Old unit tests on shallow modules become waste once tests at the deepened module's interface exist — delete them.
34
+ - Old unit tests on shallow modules become waste once tests at the deepened module's interface exist; delete them.
35
35
  - Write new tests at the deepened module's interface. The **interface is the test surface**.
36
36
  - Tests assert on observable outcomes through the interface, not internal state.
37
37
  - Tests should survive internal refactors — they describe behaviour, not implementation. If a test has to change when the implementation changes, it's testing past the interface.
@@ -2,7 +2,7 @@
2
2
 
3
3
  When the user wants to explore alternative interfaces for a chosen deepening candidate, compare distinct designs. Use parallel teammates only when the teammate facility is available; otherwise work through the designs sequentially. Based on "Design It Twice" (Ousterhout) — your first idea is unlikely to be the best.
4
4
 
5
- Uses the vocabulary in [codebase-design.md](codebase-design.md) — **module**, **interface**, **seam**, **adapter**, **leverage**.
5
+ Uses the vocabulary in [codebase-design.md](../procedures/codebase-design.md) — **module**, **interface**, **seam**, **adapter**, **leverage**.
6
6
 
7
7
  ## Process
8
8
 
@@ -12,13 +12,13 @@ Before beginning the design comparisons, write a user-facing explanation of the
12
12
 
13
13
  - The constraints any new interface would need to satisfy
14
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
15
+ - A rough illustrative code sketch to ground the constraints, not a proposal, just a way to make the constraints concrete
16
16
 
17
17
  Show this to the user, then immediately proceed to Step 2. The user reads and thinks while the comparisons are prepared.
18
18
 
19
19
  ### 2. Produce distinct designs
20
20
 
21
- Produce 3+ **radically different** interfaces for the deepened module. If the teammate facility is available, delegate the independent briefs to separate teammates and compare their reports; otherwise produce the designs sequentially in the current context.
21
+ Produce 3+ **radically different** interfaces for the deepened module. If the teammate facility is available, delegate the independent briefs to separate teammates, each with a fresh context window, and compare their reports; otherwise produce the designs sequentially in the current context.
22
22
 
23
23
  Give each design brief the file paths, coupling details, dependency category from [DEEPENING.md](DEEPENING.md), and what sits behind the seam. Keep it independent of the user-facing problem-space explanation in Step 1. Use a different constraint for each design:
24
24
 
@@ -27,18 +27,18 @@ Give each design brief the file paths, coupling details, dependency category fro
27
27
  - Design 3: "Optimise for the most common caller — make the default case trivial."
28
28
  - Design 4 (if applicable): "Design around ports & adapters for cross-seam dependencies."
29
29
 
30
- Include both [codebase-design.md](codebase-design.md) vocabulary and CONTEXT.md vocabulary in each brief so the designs name things consistently with the architecture language and the project's domain language.
30
+ Include both [codebase-design.md](../procedures/codebase-design.md) vocabulary and GLOSSARY.md vocabulary in each brief so the designs name things consistently with the architecture language and the project's domain language.
31
31
 
32
32
  Each design outputs:
33
33
 
34
- 1. Interface (types, methods, params — plus invariants, ordering, error modes)
34
+ 1. Interface (types, methods, params, plus invariants, ordering, error modes)
35
35
  2. Usage example showing how callers use it
36
36
  3. What the implementation hides behind the seam
37
37
  4. Dependency strategy and adapters (see [DEEPENING.md](DEEPENING.md))
38
- 5. Trade-offs — where leverage is high, where it's thin
38
+ 5. Trade-offs: where leverage is high, where it's thin
39
39
 
40
40
  ### 3. Present and compare
41
41
 
42
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
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.
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.
@@ -29,7 +29,14 @@ _Avoid_: Effort score, intensity rating
29
29
  - **Add a term only when the user understands it.** The glossary is a record of compressed knowledge, not a dictionary the user reads to learn. If the user has just been introduced to a concept, wait until they can use it correctly before promoting it here.
30
30
  - **Be opinionated.** When several words exist for the same concept, pick the best one and list the rest as aliases to avoid. This is how language compresses.
31
31
  - **Keep definitions tight.** One or two sentences. Define what the term IS, not what it does or how to do it.
32
- - **Use the glossary's own terms inside definitions.** Once a term is in the glossary, prefer it everywhere — including inside other definitions. This is what makes complex terms easier to grasp later.
32
+ - **Use the glossary's own terms inside definitions.** Once a term is in the glossary, prefer it everywhere, including inside other definitions. This is what makes complex terms easier to grasp later.
33
33
  - **Group under subheadings** when natural clusters emerge (e.g. `## Anatomy`, `## Programming`). A flat list is fine when terms cohere.
34
- - **Flag ambiguities explicitly.** If a term is used loosely in the wider field, note the resolution: "In this workspace, 'set' always means a working set — warm-ups are tracked separately."
34
+ - **Flag ambiguities explicitly.** If a term is used loosely in the wider field, note the resolution: "In this workspace, 'set' always means a working set; warm-ups are tracked separately."
35
35
  - **Revise as understanding deepens.** A definition the user wrote in week one may be wrong by week six. Update in place; do not leave stale entries.
36
+
37
+ ## Single vs multi-context repositories
38
+
39
+ Most repositories use one `GLOSSARY.md` at the root. A repository with
40
+ multiple bounded contexts may use a root `GLOSSARY-MAP.md` that points to one
41
+ `GLOSSARY.md` per context and records their relationships. Read the map first
42
+ when it exists; create the glossary lazily when the first term is resolved.
@@ -1,6 +1,6 @@
1
1
  # HTML Report Format
2
2
 
3
- The architectural review is rendered as a single self-contained HTML file in the OS temp directory. Tailwind and Mermaid both come from CDNs. Mermaid handles graph-shaped diagrams reliably; hand-built divs and inline SVG handle the more editorial visuals (mass diagrams, cross-sections). Mix the two — don't lean on Mermaid for everything, it'll start to look generic.
3
+ The architectural review is rendered as a single self-contained HTML file in the OS temp directory. Tailwind and Mermaid both come from CDNs. Mermaid handles graph-shaped diagrams reliably; hand-built divs and inline SVG handle the more editorial visuals (mass diagrams, cross-sections). Mix the two: don't lean on Mermaid for everything, it'll start to look generic.
4
4
 
5
5
  ## Scaffold
6
6
 
@@ -39,18 +39,18 @@ Repo name, date, and a compact legend: solid box = module, dashed line = seam, r
39
39
 
40
40
  ## Candidate card
41
41
 
42
- The diagrams carry the weight. Prose is sparse, plain, and uses the glossary terms (from the [codebase-design](codebase-design.md) capability) without ceremony.
42
+ The diagrams carry the weight. Prose is sparse, plain, and uses the glossary terms (from the [codebase-design](../procedures/codebase-design.md) capability) without ceremony.
43
43
 
44
44
  Each candidate is one `<article>`:
45
45
 
46
- - **Title** — short, names the deepening (e.g. "Collapse the Order intake pipeline").
47
- - **Badge row** — recommendation strength (`Strong` = emerald, `Worth exploring` = amber, `Speculative` = slate), plus a tag for the dependency category (`in-process`, `local-substitutable`, `ports & adapters`, `mock`).
48
- - **Files** — monospaced list, `font-mono text-sm`.
49
- - **Before / After diagram** — the centrepiece. Two columns, side by side. See patterns below.
50
- - **Problem** — one sentence. What hurts.
51
- - **Solution** — one sentence. What changes.
52
- - **Wins** — bullets, ≤6 words each. e.g. "Tests hit one interface", "Pricing logic stops leaking", "Delete 4 shallow wrappers".
53
- - **ADR callout** (if applicable) — one line in an amber-tinted box.
46
+ - **Title**: short, names the deepening (e.g. "Collapse the Order intake pipeline").
47
+ - **Badge row**: recommendation strength (`Strong` = emerald, `Worth exploring` = amber, `Speculative` = slate), plus a tag for the dependency category (`in-process`, `local-substitutable`, `ports & adapters`, `mock`).
48
+ - **Files**: monospaced list, `font-mono text-sm`.
49
+ - **Before / After diagram**: the centrepiece. Two columns, side by side. See patterns below.
50
+ - **Problem**: one sentence. What hurts.
51
+ - **Solution**: one sentence. What changes.
52
+ - **Wins**: bullets, ≤6 words each. e.g. "Tests hit one interface", "Pricing logic stops leaking", "Delete 4 shallow wrappers".
53
+ - **ADR callout** (if applicable): one line in an amber-tinted box.
54
54
 
55
55
  No paragraphs of explanation. If the diagram needs a paragraph to be understood, redraw the diagram.
56
56
 
@@ -85,7 +85,7 @@ Stack horizontal bands (`h-12 border-l-4`) to show layers a call passes through.
85
85
 
86
86
  ### Mass diagram (good for "interface as wide as implementation")
87
87
 
88
- Two rectangles per module — one for interface surface area, one for implementation. Before: interface rectangle is nearly as tall as the implementation rectangle (shallow). After: interface rectangle is short, implementation rectangle is tall (deep).
88
+ Two rectangles per module: one for interface surface area, one for implementation. Before: interface rectangle is nearly as tall as the implementation rectangle (shallow). After: interface rectangle is short, implementation rectangle is tall (deep).
89
89
 
90
90
  ### Call-graph collapse
91
91
 
@@ -97,7 +97,7 @@ Before: a tree of function calls rendered as nested boxes. After: the same tree
97
97
  - Colour sparingly: one accent (emerald or indigo) plus red for leakage and amber for warnings.
98
98
  - Keep diagrams ~320px tall so before/after sits comfortably side by side without scrolling.
99
99
  - Use `text-xs uppercase tracking-wider` for module labels inside diagrams — they should read as schematic, not as UI.
100
- - The only scripts are the Tailwind CDN and the Mermaid ESM import. The report is otherwise static — no app code, no interactivity beyond Mermaid's own rendering.
100
+ - The only scripts are the Tailwind CDN and the Mermaid ESM import. The report is otherwise static: no app code, no interactivity beyond Mermaid's own rendering.
101
101
 
102
102
  ## Top recommendation section
103
103
 
@@ -105,7 +105,7 @@ One larger card. Candidate name, one sentence on why, anchor link to its card. T
105
105
 
106
106
  ## Tone
107
107
 
108
- Plain English, concise — but the architectural nouns and verbs come straight from the [codebase-design](codebase-design.md) capability. Concision is not an excuse to drift.
108
+ Plain English, concise — but the architectural nouns and verbs come straight from the [codebase-design](../procedures/codebase-design.md) capability. Concision is not an excuse to drift.
109
109
 
110
110
  **Use exactly:** module, interface, implementation, depth, deep, shallow, seam, adapter, leverage, locality.
111
111
 
@@ -113,11 +113,11 @@ Plain English, concise — but the architectural nouns and verbs come straight f
113
113
 
114
114
  **Phrasings that fit the style:**
115
115
 
116
- - "Order intake module is shallow — interface nearly matches the implementation."
116
+ - "Order intake module is shallow: interface nearly matches the implementation."
117
117
  - "Pricing leaks across the seam."
118
118
  - "Deepen: one interface, one place to test."
119
119
  - "Two adapters justify the seam: HTTP in prod, in-memory in tests."
120
120
 
121
121
  **Wins bullets** name the gain in glossary terms: *"locality: bugs concentrate in one module"*, *"leverage: one interface, N call sites"*, *"interface shrinks; implementation absorbs the wrappers"*. Don't write *"easier to maintain"* or *"cleaner code"* — those terms aren't in the glossary and don't earn their place.
122
122
 
123
- No hedging, no throat-clearing, no "it's worth noting that…". If a sentence could be a bullet, make it a bullet. If a bullet could be cut, cut it. If a term isn't in the [codebase-design](codebase-design.md) glossary, reach for one that is before inventing a new one.
123
+ No hedging, no throat-clearing, no "it's worth noting that…". If a sentence could be a bullet, make it a bullet. If a bullet could be cut, cut it. If a term isn't in the [codebase-design](../procedures/codebase-design.md) glossary, reach for one that is before inventing a new one.
@@ -1,6 +1,6 @@
1
1
  # Learning Record Format
2
2
 
3
- Learning records live in `./learning-records/` and use sequential numbering: `0001-slug.md`, `0002-slug.md`, etc. Create the directory lazily — only when the first record is written.
3
+ Learning records live in `./learning-records/` and use sequential numbering: `0001-slug.md`, `0002-slug.md`, etc. Create the directory lazily: only when the first record is written.
4
4
 
5
5
  They are the teaching equivalent of ADRs: they capture non-obvious lessons, key insights, and stated prior knowledge that will steer future sessions. They are used to calculate the zone of proximal development.
6
6
 
@@ -12,15 +12,15 @@ They are the teaching equivalent of ADRs: they capture non-obvious lessons, key
12
12
  {1-3 sentences: what was learned (or what prior knowledge was established), and why it matters for future sessions.}
13
13
  ```
14
14
 
15
- That is the whole format. A learning record can be a single paragraph. The value is recording _that_ this is now known and _why_ it changes what to teach next — not in filling out sections.
15
+ That is the whole format. A learning record can be a single paragraph. The value is recording _that_ this is now known and _why_ it changes what to teach next, not in filling out sections.
16
16
 
17
17
  ## Optional sections
18
18
 
19
19
  Only include these when they add genuine value. Most records won't need them.
20
20
 
21
- - **Status** frontmatter (`active | superseded by LR-NNNN`) — useful when an earlier understanding turns out to be wrong and is replaced.
22
- - **Evidence** — how the user demonstrated the understanding (a question answered, an exercise completed, prior experience cited). Useful when the claim might be revisited.
23
- - **Implications** — what this unlocks or rules out for future sessions. Worth recording when non-obvious.
21
+ - **Status** frontmatter (`active | superseded by LR-NNNN`): useful when an earlier understanding turns out to be wrong and is replaced.
22
+ - **Evidence**: how the user demonstrated the understanding (a question answered, an exercise completed, prior experience cited). Useful when the claim might be revisited.
23
+ - **Implications**: what this unlocks or rules out for future sessions. Worth recording when non-obvious.
24
24
 
25
25
  ## Numbering
26
26
 
@@ -30,16 +30,16 @@ Scan `./learning-records/` for the highest existing number and increment by one.
30
30
 
31
31
  Write one when any of these is true:
32
32
 
33
- 1. **The user demonstrated genuine understanding of something non-trivial** — not just exposure, but evidence they can use the concept correctly. This sets a new floor for what to teach next.
34
- 2. **The user disclosed prior knowledge** — "I already know X." Record it so future sessions don't re-teach it. Also record the _depth_ claimed.
35
- 3. **A misconception was corrected** — the user previously believed something wrong and now sees why. These are high-value: they predict future stumbling blocks for related topics.
36
- 4. **The mission shifted in response to learning** — the user discovered they cared about something different than they thought. Cross-link to [[MISSION.md]] and update it.
33
+ 1. **The user demonstrated genuine understanding of something non-trivial**: not just exposure, but evidence they can use the concept correctly. This sets a new floor for what to teach next.
34
+ 2. **The user disclosed prior knowledge**: "I already know X." Record it so future sessions don't re-teach it. Also record the _depth_ claimed.
35
+ 3. **A misconception was corrected**: the user previously believed something wrong and now sees why. These are high-value: they predict future stumbling blocks for related topics.
36
+ 4. **The mission shifted in response to learning**: the user discovered they cared about something different than they thought. Cross-link to [[MISSION.md]] and update it.
37
37
 
38
38
  ### What does _not_ qualify
39
39
 
40
40
  - Material that was merely covered. Coverage is not learning. Wait for evidence.
41
41
  - Anything already captured tersely in [[GLOSSARY.md]] as a term definition. Don't duplicate.
42
- - Session-by-session activity logs. Learning records are not a journal — they are decision-grade insights.
42
+ - Session-by-session activity logs. Learning records are not a journal: they are decision-grade insights.
43
43
 
44
44
  ## Supersession
45
45