···11+---
22+name: code-review
33+description: Review the changes since a fixed point (commit, branch, tag, or merge-base) along two axes — Standards (does the code follow this repo's documented coding standards?) and Spec (does the code match what the originating issue/PRD asked for?). Runs both reviews in parallel sub-agents and reports them side by side. Use when the user wants to review a branch, a PR, work-in-progress changes, or asks to "review since X".
44+---
55+66+Two-axis review of the diff between `HEAD` and a fixed point the user supplies:
77+88+- **Standards** — does the code conform to this repo's documented coding standards?
99+- **Spec** — does the code faithfully implement the originating issue / PRD / spec?
1010+1111+Both axes run as **parallel sub-agents** so they don't pollute each other's context, then this skill aggregates their findings.
1212+1313+The issue tracker should have been provided to you — run `/setup-matt-pocock-skills` if `docs/agents/issue-tracker.md` is missing.
1414+1515+## Process
1616+1717+### 1. Pin the fixed point
1818+1919+Whatever the user said is the fixed point — a commit SHA, branch name, tag, `main`, `HEAD~5`, etc. If they didn't specify one, ask for it.
2020+2121+Capture the diff command once: `git diff <fixed-point>...HEAD` (three-dot, so the comparison is against the merge-base). Also note the list of commits via `git log <fixed-point>..HEAD --oneline`.
2222+2323+Before going further, confirm the fixed point resolves (`git rev-parse <fixed-point>`) and the diff is non-empty. A bad ref or empty diff should fail here — not inside two parallel sub-agents.
2424+2525+### 2. Identify the spec source
2626+2727+Look for the originating spec, in this order:
2828+2929+1. Issue references in the commit messages (`#123`, `Closes #45`, GitLab `!67`, etc.) — fetch via the workflow in `docs/agents/issue-tracker.md`.
3030+2. A path the user passed as an argument.
3131+3. A PRD/spec file under `docs/`, `specs/`, or `.scratch/` matching the branch name or feature.
3232+4. If nothing is found, ask the user where the spec is. If they say there isn't one, the **Spec** sub-agent will skip and report "no spec available".
3333+3434+### 3. Identify the standards sources
3535+3636+Anything in the repo that documents how code should be written, such as `CODING_STANDARDS.md` or `CONTRIBUTING.md`.
3737+3838+On top of whatever the repo documents, the Standards axis always carries the **smell baseline** below — a fixed set of Fowler code smells (_Refactoring_, ch.3) that applies even when a repo documents nothing. Two rules bind it:
3939+4040+- **The repo overrides.** A documented repo standard always wins; where it endorses something the baseline would flag, suppress the smell.
4141+- **Always a judgement call.** Each smell is a labelled heuristic ("possible Feature Envy"), never a hard violation — and, like any standard here, skip anything tooling already enforces.
4242+4343+Each smell reads *what it is* → *how to fix*; match it against the diff:
4444+4545+- **Mysterious Name** — a function, variable, or type whose name doesn't reveal what it does or holds. → rename it; if no honest name comes, the design's murky.
4646+- **Duplicated Code** — the same logic shape appears in more than one hunk or file in the change. → extract the shared shape, call it from both.
4747+- **Feature Envy** — a method that reaches into another object's data more than its own. → move the method onto the data it envies.
4848+- **Data Clumps** — the same few fields or params keep travelling together (a type wanting to be born). → bundle them into one type, pass that.
4949+- **Primitive Obsession** — a primitive or string standing in for a domain concept that deserves its own type. → give the concept its own small type.
5050+- **Repeated Switches** — the same `switch`/`if`-cascade on the same type recurs across the change. → replace with polymorphism, or one map both sites share.
5151+- **Shotgun Surgery** — one logical change forces scattered edits across many files in the diff. → gather what changes together into one module.
5252+- **Divergent Change** — one file or module is edited for several unrelated reasons. → split so each module changes for one reason.
5353+- **Speculative Generality** — abstraction, parameters, or hooks added for needs the spec doesn't have. → delete it; inline back until a real need shows.
5454+- **Message Chains** — long `a.b().c().d()` navigation the caller shouldn't depend on. → hide the walk behind one method on the first object.
5555+- **Middle Man** — a class or function that mostly just delegates onward. → cut it, call the real target direct.
5656+- **Refused Bequest** — a subclass or implementer that ignores or overrides most of what it inherits. → drop the inheritance, use composition.
5757+5858+### 4. Spawn both sub-agents in parallel
5959+6060+Send a single message with two `Agent` tool calls. Use the `general-purpose` subagent for both.
6161+6262+**Standards sub-agent prompt** — include:
6363+6464+- The full diff command and commit list.
6565+- The list of standards-source files you found in step 3, **plus the smell baseline from step 3** pasted in full — the sub-agent has no other access to it.
6666+- The brief: "Report — per file/hunk where relevant — (a) every place the diff violates a documented standard: cite the standard (file + the rule); and (b) any baseline smell you spot: name it and quote the hunk. Distinguish hard violations from judgement calls — documented-standard breaches can be hard, but baseline smells are always judgement calls, and a documented repo standard overrides the baseline. Skip anything tooling enforces. Under 400 words."
6767+6868+**Spec sub-agent prompt** — include:
6969+7070+- The diff command and commit list.
7171+- The path or fetched contents of the spec.
7272+- The brief: "Report: (a) requirements the spec asked for that are missing or partial; (b) behaviour in the diff that wasn't asked for (scope creep); (c) requirements that look implemented but where the implementation looks wrong. Quote the spec line for each finding. Under 400 words."
7373+7474+If the spec is missing, skip the Spec sub-agent and note this in the final report.
7575+7676+### 5. Aggregate
7777+7878+Present the two reports under `## Standards` and `## Spec` headings, verbatim or lightly cleaned. Do **not** merge or rerank findings — the two axes are deliberately separate (see _Why two axes_).
7979+8080+End with a one-line summary: total findings per axis, and the worst issue _within each axis_ (if any). Don't pick a single winner across axes — that's the reranking the separation exists to prevent.
8181+8282+## Why two axes
8383+8484+A change can pass one axis and fail the other:
8585+8686+- Code that follows every standard but implements the wrong thing → **Standards pass, Spec fail.**
8787+- Code that does exactly what the issue asked but breaks the project's conventions → **Spec pass, Standards fail.**
8888+8989+Reporting them separately stops one axis from masking the other.
+134
.agents/skills/diagnosing-bugs/SKILL.md
···11+---
22+name: diagnosing-bugs
33+description: Diagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports something broken/throwing/failing/slow.
44+---
55+66+# Diagnosing Bugs
77+88+A discipline for hard bugs. Skip phases only when explicitly justified.
99+1010+When exploring the codebase, read `CONTEXT.md` (if it exists) to get a clear mental model of the relevant modules, and check ADRs in the area you're touching.
1111+1212+## Phase 1 — Build a feedback loop
1313+1414+**This is the skill.** Everything else is mechanical. If you have a **tight** pass/fail signal for the bug — one that goes red on _this_ bug — you will find the cause; bisection, hypothesis-testing, and instrumentation all just consume it. If you don't have one, no amount of staring at code will save you.
1515+1616+Spend disproportionate effort here. **Be aggressive. Be creative. Refuse to give up.**
1717+1818+### Ways to construct one — try them in roughly this order
1919+2020+1. **Failing test** at whatever seam reaches the bug — unit, integration, e2e.
2121+2. **Curl / HTTP script** against a running dev server.
2222+3. **CLI invocation** with a fixture input, diffing stdout against a known-good snapshot.
2323+4. **Headless browser script** (Playwright / Puppeteer) — drives the UI, asserts on DOM/console/network.
2424+5. **Replay a captured trace.** Save a real network request / payload / event log to disk; replay it through the code path in isolation.
2525+6. **Throwaway harness.** Spin up a minimal subset of the system (one service, mocked deps) that exercises the bug code path with a single function call.
2626+7. **Property / fuzz loop.** If the bug is "sometimes wrong output", run 1000 random inputs and look for the failure mode.
2727+8. **Bisection harness.** If the bug appeared between two known states (commit, dataset, version), automate "boot at state X, check, repeat" so you can `git bisect run` it.
2828+9. **Differential loop.** Run the same input through old-version vs new-version (or two configs) and diff outputs.
2929+10. **HITL bash script.** Last resort. If a human must click, drive _them_ with `scripts/hitl-loop.template.sh` so the loop is still structured. Captured output feeds back to you.
3030+3131+Build the right feedback loop, and the bug is 90% fixed.
3232+3333+### Tighten the loop
3434+3535+Treat the loop as a product. Once you have _a_ loop, **tighten** it:
3636+3737+- Can I make it faster? (Cache setup, skip unrelated init, narrow the test scope.)
3838+- Can I make the signal sharper? (Assert on the specific symptom, not "didn't crash".)
3939+- Can I make it more deterministic? (Pin time, seed RNG, isolate filesystem, freeze network.)
4040+4141+A 30-second flaky loop is barely better than no loop; a 2-second deterministic one is tight — a debugging superpower.
4242+4343+### Non-deterministic bugs
4444+4545+The goal is not a clean repro but a **higher reproduction rate**. Loop the trigger 100×, parallelise, add stress, narrow timing windows, inject sleeps. A 50%-flake bug is debuggable; 1% is not — keep raising the rate until it's debuggable.
4646+4747+### When you genuinely cannot build a loop
4848+4949+Stop and say so explicitly. List what you tried. Ask the user for: (a) access to whatever environment reproduces it, (b) a captured artifact (HAR file, log dump, core dump, screen recording with timestamps), or (c) permission to add temporary production instrumentation. Do **not** proceed to hypothesise without a loop.
5050+5151+### Completion criterion — a tight loop that goes red
5252+5353+Phase 1 is done when the loop is **tight** and **red-capable**: you can name **one command** — a script path, a test invocation, a curl — that you have **already run at least once** (paste the invocation and its output), and that is:
5454+5555+- [ ] **Red-capable** — it drives the actual bug code path and asserts the **user's exact symptom**, so it can go red on this bug and green once fixed. Not "runs without erroring" — it must be able to _catch this specific bug_.
5656+- [ ] **Deterministic** — same verdict every run (flaky bugs: a pinned, high reproduction rate, per above).
5757+- [ ] **Fast** — seconds, not minutes.
5858+- [ ] **Agent-runnable** — you can run it unattended; a human in the loop only via `scripts/hitl-loop.template.sh`.
5959+6060+If you catch yourself reading code to build a theory before this command exists, **stop — jumping straight to a hypothesis is the exact failure this skill prevents.** No red-capable command, no Phase 2.
6161+6262+## Phase 2 — Reproduce + minimise
6363+6464+Run the loop. Watch it go red — the bug appears.
6565+6666+Confirm:
6767+6868+- [ ] The loop produces the failure mode the **user** described — not a different failure that happens to be nearby. Wrong bug = wrong fix.
6969+- [ ] The failure is reproducible across multiple runs (or, for non-deterministic bugs, reproducible at a high enough rate to debug against).
7070+- [ ] You have captured the exact symptom (error message, wrong output, slow timing) so later phases can verify the fix actually addresses it.
7171+7272+### Minimise
7373+7474+Once it's red, shrink the repro to the **smallest scenario that still goes red**. Cut inputs, callers, config, data, and steps **one at a time**, re-running the loop after each cut — keep only what's load-bearing for the failure.
7575+7676+Why bother: a minimal repro shrinks the hypothesis space in Phase 3 (fewer moving parts left to suspect) and becomes the clean regression test in Phase 5.
7777+7878+Done when **every remaining element is load-bearing** — removing any one of them makes the loop go green.
7979+8080+Do not proceed until you have reproduced **and** minimised.
8181+8282+## Phase 3 — Hypothesise
8383+8484+Generate **3–5 ranked hypotheses** before testing any of them. Single-hypothesis generation anchors on the first plausible idea.
8585+8686+Each hypothesis must be **falsifiable**: state the prediction it makes.
8787+8888+> Format: "If <X> is the cause, then <changing Y> will make the bug disappear / <changing Z> will make it worse."
8989+9090+If you cannot state the prediction, the hypothesis is a vibe — discard or sharpen it.
9191+9292+**Show the ranked list to the user before testing.** They often have domain knowledge that re-ranks instantly ("we just deployed a change to #3"), or know hypotheses they've already ruled out. Cheap checkpoint, big time saver. Don't block on it — proceed with your ranking if the user is AFK.
9393+9494+## Phase 4 — Instrument
9595+9696+Each probe must map to a specific prediction from Phase 3. **Change one variable at a time.**
9797+9898+Tool preference:
9999+100100+1. **Debugger / REPL inspection** if the env supports it. One breakpoint beats ten logs.
101101+2. **Targeted logs** at the boundaries that distinguish hypotheses.
102102+3. Never "log everything and grep".
103103+104104+**Tag every debug log** with a unique prefix, e.g. `[DEBUG-a4f2]`. Cleanup at the end becomes a single grep. Untagged logs survive; tagged logs die.
105105+106106+**Perf branch.** For performance regressions, logs are usually wrong. Instead: establish a baseline measurement (timing harness, `performance.now()`, profiler, query plan), then bisect. Measure first, fix second.
107107+108108+## Phase 5 — Fix + regression test
109109+110110+Write the regression test **before the fix** — but only if there is a **correct seam** for it.
111111+112112+A correct seam is one where the test exercises the **real bug pattern** as it occurs at the call site. If the only available seam is too shallow (single-caller test when the bug needs multiple callers, unit test that can't replicate the chain that triggered the bug), a regression test there gives false confidence.
113113+114114+**If no correct seam exists, that itself is the finding.** Note it. The codebase architecture is preventing the bug from being locked down. Flag this for the next phase.
115115+116116+If a correct seam exists:
117117+118118+1. Turn the minimised repro into a failing test at that seam.
119119+2. Watch it fail.
120120+3. Apply the fix.
121121+4. Watch it pass.
122122+5. Re-run the Phase 1 feedback loop against the original (un-minimised) scenario.
123123+124124+## Phase 6 — Cleanup + post-mortem
125125+126126+Required before declaring done:
127127+128128+- [ ] Original repro no longer reproduces (re-run the Phase 1 loop)
129129+- [ ] Regression test passes (or absence of seam is documented)
130130+- [ ] All `[DEBUG-...]` instrumentation removed (`grep` the prefix)
131131+- [ ] Throwaway prototypes deleted (or moved to a clearly-marked debug location)
132132+- [ ] The hypothesis that turned out correct is stated in the commit / PR message — so the next debugger learns
133133+134134+**Then ask: what would have prevented this bug?** If the answer involves architectural change (no good test seam, tangled callers, hidden coupling) hand off to the `/improve-codebase-architecture` skill with the specifics. Make the recommendation **after** the fix is in, not before — you have more information now than when you started.
···11+#!/usr/bin/env bash
22+# Human-in-the-loop reproduction loop.
33+# Copy this file, edit the steps below, and run it.
44+# The agent runs the script; the user follows prompts in their terminal.
55+#
66+# Usage:
77+# bash hitl-loop.template.sh
88+#
99+# Two helpers:
1010+# step "<instruction>" → show instruction, wait for Enter
1111+# capture VAR "<question>" → show question, read response into VAR
1212+#
1313+# At the end, captured values are printed as KEY=VALUE for the agent to parse.
1414+1515+set -euo pipefail
1616+1717+step() {
1818+ printf '\n>>> %s\n' "$1"
1919+ read -r -p " [Enter when done] " _
2020+}
2121+2222+capture() {
2323+ local var="$1" question="$2" answer
2424+ printf '\n>>> %s\n' "$question"
2525+ read -r -p " > " answer
2626+ printf -v "$var" '%s' "$answer"
2727+}
2828+2929+# --- edit below ---------------------------------------------------------
3030+3131+step "Open the app at http://localhost:3000 and sign in."
3232+3333+capture ERRORED "Click the 'Export' button. Did it throw an error? (y/n)"
3434+3535+capture ERROR_MSG "Paste the error message (or 'none'):"
3636+3737+# --- edit above ---------------------------------------------------------
3838+3939+printf '\n--- Captured ---\n'
4040+printf 'ERRORED=%s\n' "$ERRORED"
4141+printf 'ERROR_MSG=%s\n' "$ERROR_MSG"
+47
.agents/skills/domain-modeling/ADR-FORMAT.md
···11+# ADR Format
22+33+ADRs live in `docs/adr/` and use sequential numbering: `0001-slug.md`, `0002-slug.md`, etc.
44+55+Create the `docs/adr/` directory lazily — only when the first ADR is needed.
66+77+## Template
88+99+```md
1010+# {Short title of the decision}
1111+1212+{1-3 sentences: what's the context, what did we decide, and why.}
1313+```
1414+1515+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.
1616+1717+## Optional sections
1818+1919+Only include these when they add genuine value. Most ADRs won't need them.
2020+2121+- **Status** frontmatter (`proposed | accepted | deprecated | superseded by ADR-NNNN`) — useful when decisions are revisited
2222+- **Considered Options** — only when the rejected alternatives are worth remembering
2323+- **Consequences** — only when non-obvious downstream effects need to be called out
2424+2525+## Numbering
2626+2727+Scan `docs/adr/` for the highest existing number and increment by one.
2828+2929+## When to offer an ADR
3030+3131+All three of these must be true:
3232+3333+1. **Hard to reverse** — the cost of changing your mind later is meaningful
3434+2. **Surprising without context** — a future reader will look at the code and wonder "why on earth did they do it this way?"
3535+3. **The result of a real trade-off** — there were genuine alternatives and you picked one for specific reasons
3636+3737+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."
3838+3939+### What qualifies
4040+4141+- **Architectural shape.** "We're using a monorepo." "The write model is event-sourced, the read model is projected into Postgres."
4242+- **Integration patterns between contexts.** "Ordering and Billing communicate via domain events, not synchronous HTTP."
4343+- **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.
4444+- **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.
4545+- **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.
4646+- **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."
4747+- **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.
+60
.agents/skills/domain-modeling/CONTEXT-FORMAT.md
···11+# CONTEXT.md Format
22+33+## Structure
44+55+```md
66+# {Context Name}
77+88+{One or two sentence description of what this context is and why it exists.}
99+1010+## Language
1111+1212+**Order**:
1313+{A one or two sentence description of the term}
1414+_Avoid_: Purchase, transaction
1515+1616+**Invoice**:
1717+A request for payment sent to a customer after delivery.
1818+_Avoid_: Bill, payment request
1919+2020+**Customer**:
2121+A person or organization that places orders.
2222+_Avoid_: Client, buyer, account
2323+```
2424+2525+## Rules
2626+2727+- **Be opinionated.** When multiple words exist for the same concept, pick the best one and list the others under `_Avoid_`.
2828+- **Keep definitions tight.** One or two sentences max. Define what it IS, not what it does.
2929+- **Only include terms specific to this project's context.** General programming concepts (timeouts, error types, utility patterns) don't belong even if the project uses them extensively. Before adding a term, ask: is this a concept unique to this context, or a general programming concept? Only the former belongs.
3030+- **Group terms under subheadings** when natural clusters emerge. If all terms belong to a single cohesive area, a flat list is fine.
3131+3232+## Single vs multi-context repos
3333+3434+**Single context (most repos):** One `CONTEXT.md` at the repo root.
3535+3636+**Multiple contexts:** A `CONTEXT-MAP.md` at the repo root lists the contexts, where they live, and how they relate to each other:
3737+3838+```md
3939+# Context Map
4040+4141+## Contexts
4242+4343+- [Ordering](./src/ordering/CONTEXT.md) — receives and tracks customer orders
4444+- [Billing](./src/billing/CONTEXT.md) — generates invoices and processes payments
4545+- [Fulfillment](./src/fulfillment/CONTEXT.md) — manages warehouse picking and shipping
4646+4747+## Relationships
4848+4949+- **Ordering → Fulfillment**: Ordering emits `OrderPlaced` events; Fulfillment consumes them to start picking
5050+- **Fulfillment → Billing**: Fulfillment emits `ShipmentDispatched` events; Billing consumes them to generate invoices
5151+- **Ordering ↔ Billing**: Shared types for `CustomerId` and `Money`
5252+```
5353+5454+The skill infers which structure applies:
5555+5656+- If `CONTEXT-MAP.md` exists, read it to find contexts
5757+- If only a root `CONTEXT.md` exists, single context
5858+- If neither exists, create a root `CONTEXT.md` lazily when the first term is resolved
5959+6060+When multiple contexts exist, infer which one the current topic relates to. If unclear, ask.
+74
.agents/skills/domain-modeling/SKILL.md
···11+---
22+name: domain-modeling
33+description: Build and sharpen a project's domain model. Use when the user wants to pin down domain terminology or a ubiquitous language, record an architectural decision, or when another skill needs to maintain the domain model.
44+---
55+66+# Domain Modeling
77+88+Actively build and sharpen the project's domain model as you design. This is the *active* discipline — challenging terms, inventing edge-case scenarios, and writing the glossary and decisions down the moment they crystallise. (Merely *reading* `CONTEXT.md` for vocabulary is not this skill — that's a one-line habit any skill can do. This skill is for when you're changing the model, not just consuming it.)
99+1010+## File structure
1111+1212+Most repos have a single context:
1313+1414+```
1515+/
1616+├── CONTEXT.md
1717+├── docs/
1818+│ └── adr/
1919+│ ├── 0001-event-sourced-orders.md
2020+│ └── 0002-postgres-for-write-model.md
2121+└── src/
2222+```
2323+2424+If a `CONTEXT-MAP.md` exists at the root, the repo has multiple contexts. The map points to where each one lives:
2525+2626+```
2727+/
2828+├── CONTEXT-MAP.md
2929+├── docs/
3030+│ └── adr/ ← system-wide decisions
3131+├── src/
3232+│ ├── ordering/
3333+│ │ ├── CONTEXT.md
3434+│ │ └── docs/adr/ ← context-specific decisions
3535+│ └── billing/
3636+│ ├── CONTEXT.md
3737+│ └── docs/adr/
3838+```
3939+4040+Create files lazily — only when you have something to write. If no `CONTEXT.md` exists, create one when the first term is resolved. If no `docs/adr/` exists, create it when the first ADR is needed.
4141+4242+## During the session
4343+4444+### Challenge against the glossary
4545+4646+When the user uses a term that conflicts with the existing language in `CONTEXT.md`, call it out immediately. "Your glossary defines 'cancellation' as X, but you seem to mean Y — which is it?"
4747+4848+### Sharpen fuzzy language
4949+5050+When the user uses vague or overloaded terms, propose a precise canonical term. "You're saying 'account' — do you mean the Customer or the User? Those are different things."
5151+5252+### Discuss concrete scenarios
5353+5454+When domain relationships are being discussed, stress-test them with specific scenarios. Invent scenarios that probe edge cases and force the user to be precise about the boundaries between concepts.
5555+5656+### Cross-reference with code
5757+5858+When the user states how something works, check whether the code agrees. If you find a contradiction, surface it: "Your code cancels entire Orders, but you just said partial cancellation is possible — which is right?"
5959+6060+### Update CONTEXT.md inline
6161+6262+When a term is resolved, update `CONTEXT.md` right there. Don't batch these up — capture them as they happen. Use the format in [CONTEXT-FORMAT.md](./CONTEXT-FORMAT.md).
6363+6464+`CONTEXT.md` should be totally devoid of implementation details. Do not treat `CONTEXT.md` as a spec, a scratch pad, or a repository for implementation decisions. It is a glossary and nothing else.
6565+6666+### Offer ADRs sparingly
6767+6868+Only offer to create an ADR when all three are true:
6969+7070+1. **Hard to reverse** — the cost of changing your mind later is meaningful
7171+2. **Surprising without context** — a future reader will wonder "why did they do it this way?"
7272+3. **The result of a real trade-off** — there were genuine alternatives and you picked one for specific reasons
7373+7474+If any of the three is missing, skip the ADR. Use the format in [ADR-FORMAT.md](./ADR-FORMAT.md).
+7
.agents/skills/grill-with-docs/SKILL.md
···11+---
22+name: grill-with-docs
33+description: A relentless interview to sharpen a plan or design, which also creates docs (ADR's and glossary) as we go.
44+disable-model-invocation: true
55+---
66+77+Run a `/grilling` session, using the `/domain-modeling` skill.
+16
.agents/skills/handoff/SKILL.md
···11+---
22+name: handoff
33+description: Compact the current conversation into a handoff document for another agent to pick up.
44+argument-hint: "What will the next session be used for?"
55+disable-model-invocation: true
66+---
77+88+Write a handoff document summarising the current conversation so a fresh agent can continue the work. Save to the temporary directory of the user's OS - not the current workspace.
99+1010+Include a "suggested skills" section in the document, which suggests skills that the agent should invoke.
1111+1212+Do not duplicate content already captured in other artifacts (PRDs, plans, ADRs, issues, commits, diffs). Reference them by path or URL instead.
1313+1414+Redact any sensitive information, such as API keys, passwords, or personally identifiable information.
1515+1616+If the user passed arguments, treat them as a description of what the next session will focus on and tailor the doc accordingly.
+15
.agents/skills/implement/SKILL.md
···11+---
22+name: implement
33+description: "Implement a piece of work based on a PRD or set of issues."
44+disable-model-invocation: true
55+---
66+77+Implement the work described by the user in the PRD or issues.
88+99+Use /tdd where possible, at pre-agreed seams.
1010+1111+Run typechecking regularly, single test files regularly, and the full test suite once at the end.
1212+1313+Once done, use /code-review to review the work.
1414+1515+Commit your work to the current branch.
···11+# HTML Report Format
22+33+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.
44+55+## Scaffold
66+77+```html
88+<!doctype html>
99+<html lang="en">
1010+ <head>
1111+ <meta charset="utf-8" />
1212+ <title>Architecture review — {{repo name}}</title>
1313+ <script src="https://cdn.tailwindcss.com"></script>
1414+ <script type="module">
1515+ import mermaid from "https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.esm.min.mjs";
1616+ mermaid.initialize({ startOnLoad: true, theme: "neutral", securityLevel: "loose" });
1717+ </script>
1818+ <style>
1919+ /* small custom layer for things Tailwind doesn't cover cleanly:
2020+ dashed seam lines, hand-drawn-feeling arrow heads, etc. */
2121+ .seam { stroke-dasharray: 4 4; }
2222+ .leak { stroke: #dc2626; }
2323+ .deep { background: linear-gradient(135deg, #0f172a, #1e293b); }
2424+ </style>
2525+ </head>
2626+ <body class="bg-stone-50 text-slate-900 font-sans">
2727+ <main class="max-w-5xl mx-auto px-6 py-12 space-y-12">
2828+ <header>...</header>
2929+ <section id="candidates" class="space-y-10">...</section>
3030+ <section id="top-recommendation">...</section>
3131+ </main>
3232+ </body>
3333+</html>
3434+```
3535+3636+## Header
3737+3838+Repo name, date, and a compact legend: solid box = module, dashed line = seam, red arrow = leakage, thick dark box = deep module. No introduction paragraph — straight into the candidates.
3939+4040+## Candidate card
4141+4242+The diagrams carry the weight. Prose is sparse, plain, and uses the glossary terms (from the `/codebase-design` skill) without ceremony.
4343+4444+Each candidate is one `<article>`:
4545+4646+- **Title** — short, names the deepening (e.g. "Collapse the Order intake pipeline").
4747+- **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`).
4848+- **Files** — monospaced list, `font-mono text-sm`.
4949+- **Before / After diagram** — the centrepiece. Two columns, side by side. See patterns below.
5050+- **Problem** — one sentence. What hurts.
5151+- **Solution** — one sentence. What changes.
5252+- **Wins** — bullets, ≤6 words each. e.g. "Tests hit one interface", "Pricing logic stops leaking", "Delete 4 shallow wrappers".
5353+- **ADR callout** (if applicable) — one line in an amber-tinted box.
5454+5555+No paragraphs of explanation. If the diagram needs a paragraph to be understood, redraw the diagram.
5656+5757+## Diagram patterns
5858+5959+Pick the pattern that fits the candidate. Mix them. Don't make every diagram look the same — variety is part of the point.
6060+6161+### Mermaid graph (the workhorse for dependencies / call flow)
6262+6363+Use a Mermaid `flowchart` or `graph` when the point is "X calls Y calls Z, and look at the mess." Wrap it in a Tailwind-styled card so it doesn't feel parachuted in. Style with classDef to colour leakage edges red and the deep module dark. Sequence diagrams work well for "before: 6 round-trips; after: 1."
6464+6565+```html
6666+<div class="rounded-lg border border-slate-200 bg-white p-4">
6767+ <pre class="mermaid">
6868+ flowchart LR
6969+ A[OrderHandler] --> B[OrderValidator]
7070+ B --> C[OrderRepo]
7171+ C -.leak.-> D[PricingClient]
7272+ classDef leak stroke:#dc2626,stroke-width:2px;
7373+ class C,D leak
7474+ </pre>
7575+</div>
7676+```
7777+7878+### Hand-built boxes-and-arrows (when Mermaid's layout fights you)
7979+8080+Modules as `<div>`s with borders and labels. Arrows as inline SVG `<line>` or `<path>` elements positioned absolutely over a relative container. Reach for this when you want the "after" diagram to feel like one thick-bordered deep module with greyed-out internals — Mermaid won't render that with the right weight.
8181+8282+### Cross-section (good for layered shallowness)
8383+8484+Stack horizontal bands (`h-12 border-l-4`) to show layers a call passes through. Before: 6 thin layers each doing nothing. After: 1 thick band labelled with the consolidated responsibility.
8585+8686+### Mass diagram (good for "interface as wide as implementation")
8787+8888+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).
8989+9090+### Call-graph collapse
9191+9292+Before: a tree of function calls rendered as nested boxes. After: the same tree collapsed into one box, with the now-internal calls shown faded inside it.
9393+9494+## Style guidance
9595+9696+- Lean editorial, not corporate-dashboard. Generous whitespace. Serif optional for headings (`font-serif` works well with stone/slate).
9797+- Colour sparingly: one accent (emerald or indigo) plus red for leakage and amber for warnings.
9898+- Keep diagrams ~320px tall so before/after sits comfortably side by side without scrolling.
9999+- Use `text-xs uppercase tracking-wider` for module labels inside diagrams — they should read as schematic, not as UI.
100100+- 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.
101101+102102+## Top recommendation section
103103+104104+One larger card. Candidate name, one sentence on why, anchor link to its card. That's it.
105105+106106+## Tone
107107+108108+Plain English, concise — but the architectural nouns and verbs come straight from the `/codebase-design` skill. Concision is not an excuse to drift.
109109+110110+**Use exactly:** module, interface, implementation, depth, deep, shallow, seam, adapter, leverage, locality.
111111+112112+**Never substitute:** component, service, unit (for module) · API, signature (for interface) · boundary (for seam) · layer, wrapper (for module, when you mean module).
113113+114114+**Phrasings that fit the style:**
115115+116116+- "Order intake module is shallow — interface nearly matches the implementation."
117117+- "Pricing leaks across the seam."
118118+- "Deepen: one interface, one place to test."
119119+- "Two adapters justify the seam: HTTP in prod, in-memory in tests."
120120+121121+**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.
122122+123123+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` glossary, reach for one that is before inventing a new one.
···11+---
22+name: improve-codebase-architecture
33+description: Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.
44+disable-model-invocation: true
55+---
66+77+# Improve Codebase Architecture
88+99+Surface architectural friction and propose **deepening opportunities** — refactors that turn shallow modules into deep ones. The aim is testability and AI-navigability.
1010+1111+This command is _informed_ by the project's domain model and built on a shared design vocabulary:
1212+1313+- Run the `/codebase-design` skill for the architecture vocabulary (**module**, **interface**, **depth**, **seam**, **adapter**, **leverage**, **locality**) and its principles (the deletion test, "the interface is the test surface", "one adapter = hypothetical seam, two = real"). Use these terms exactly in every suggestion — don't drift into "component," "service," "API," or "boundary."
1414+- The domain language in `CONTEXT.md` gives names to good seams; ADRs in `docs/adr/` record decisions this command should not re-litigate.
1515+1616+## Process
1717+1818+### 1. Explore
1919+2020+Read the project's domain glossary (`CONTEXT.md`) and any ADRs in the area you're touching first.
2121+2222+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:
2323+2424+- Where does understanding one concept require bouncing between many small modules?
2525+- Where are modules **shallow** — interface nearly as complex as the implementation?
2626+- Where have pure functions been extracted just for testability, but the real bugs hide in how they're called (no **locality**)?
2727+- Where do tightly-coupled modules leak across their seams?
2828+- Which parts of the codebase are untested, or hard to test through their current interface?
2929+3030+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.
3131+3232+### 2. Present candidates as an HTML report
3333+3434+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.
3535+3636+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.
3737+3838+For each candidate, render a card with:
3939+4040+- **Files** — which files/modules are involved
4141+- **Problem** — why the current architecture is causing friction
4242+- **Solution** — plain English description of what would change
4343+- **Benefits** — explained in terms of locality and leverage, and how tests would improve
4444+- **Before / After diagram** — side-by-side, custom-drawn, illustrating the shallowness and the deepening
4545+- **Recommendation strength** — one of `Strong`, `Worth exploring`, `Speculative`, rendered as a badge
4646+4747+End the report with a **Top recommendation** section: which candidate you'd tackle first and why.
4848+4949+**Use CONTEXT.md vocabulary for the domain, and the `/codebase-design` vocabulary for the architecture.** If `CONTEXT.md` defines "Order," talk about "the Order intake module" — not "the FooBarHandler," and not "the Order service."
5050+5151+**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 — but worth reopening because…"_). Don't list every theoretical refactor an ADR forbids.
5252+5353+See [HTML-REPORT.md](HTML-REPORT.md) for the full HTML scaffold, diagram patterns, and styling guidance.
5454+5555+Do NOT propose interfaces yet. After the file is written, ask the user: "Which of these would you like to explore?"
5656+5757+### 3. Grilling loop
5858+5959+Once the user picks a candidate, run the `/grilling` skill to walk the design tree with them — constraints, dependencies, the shape of the deepened module, what sits behind the seam, what tests survive.
6060+6161+Side effects happen inline as decisions crystallize — run the `/domain-modeling` skill to keep the domain model current as you go:
6262+6363+- **Naming a deepened module after a concept not in `CONTEXT.md`?** Add the term to `CONTEXT.md`. Create the file lazily if it doesn't exist.
6464+- **Sharpening a fuzzy term during the conversation?** Update `CONTEXT.md` right there.
6565+- **User rejects the candidate with a load-bearing reason?** Offer an ADR, framed as: _"Want me to record this as an ADR so future architecture reviews don't re-suggest it?"_ Only offer when the reason would actually be needed by a future explorer to avoid re-suggesting the same thing — skip ephemeral reasons ("not worth it right now") and self-evident ones.
6666+- **Want to explore alternative interfaces for the deepened module?** Run the `/codebase-design` skill and use its design-it-twice parallel sub-agent pattern.
+130
.agents/skills/qa/SKILL.md
···11+---
22+name: qa
33+description: Interactive QA session where user reports bugs or issues conversationally, and the agent files GitHub issues. Explores the codebase in the background for context and domain language. Use when user wants to report bugs, do QA, file issues conversationally, or mentions "QA session".
44+---
55+66+# QA Session
77+88+Run an interactive QA session. The user describes problems they're encountering. You clarify, explore the codebase for context, and file GitHub issues that are durable, user-focused, and use the project's domain language.
99+1010+## For each issue the user raises
1111+1212+### 1. Listen and lightly clarify
1313+1414+Let the user describe the problem in their own words. Ask **at most 2-3 short clarifying questions** focused on:
1515+1616+- What they expected vs what actually happened
1717+- Steps to reproduce (if not obvious)
1818+- Whether it's consistent or intermittent
1919+2020+Do NOT over-interview. If the description is clear enough to file, move on.
2121+2222+### 2. Explore the codebase in the background
2323+2424+While talking to the user, kick off an Agent (subagent_type=Explore) in the background to understand the relevant area. The goal is NOT to find a fix — it's to:
2525+2626+- Learn the domain language used in that area (check UBIQUITOUS_LANGUAGE.md)
2727+- Understand what the feature is supposed to do
2828+- Identify the user-facing behavior boundary
2929+3030+This context helps you write a better issue — but the issue itself should NOT reference specific files, line numbers, or internal implementation details.
3131+3232+### 3. Assess scope: single issue or breakdown?
3333+3434+Before filing, decide whether this is a **single issue** or needs to be **broken down** into multiple issues.
3535+3636+Break down when:
3737+3838+- The fix spans multiple independent areas (e.g. "the form validation is wrong AND the success message is missing AND the redirect is broken")
3939+- There are clearly separable concerns that different people could work on in parallel
4040+- The user describes something that has multiple distinct failure modes or symptoms
4141+4242+Keep as a single issue when:
4343+4444+- It's one behavior that's wrong in one place
4545+- The symptoms are all caused by the same root behavior
4646+4747+### 4. File the GitHub issue(s)
4848+4949+Create issues with `gh issue create`. Do NOT ask the user to review first — just file and share URLs.
5050+5151+Issues must be **durable** — they should still make sense after major refactors. Write from the user's perspective.
5252+5353+#### For a single issue
5454+5555+Use this template:
5656+5757+```
5858+## What happened
5959+6060+[Describe the actual behavior the user experienced, in plain language]
6161+6262+## What I expected
6363+6464+[Describe the expected behavior]
6565+6666+## Steps to reproduce
6767+6868+1. [Concrete, numbered steps a developer can follow]
6969+2. [Use domain terms from the codebase, not internal module names]
7070+3. [Include relevant inputs, flags, or configuration]
7171+7272+## Additional context
7373+7474+[Any extra observations from the user or from codebase exploration that help frame the issue — e.g. "this only happens when using the Docker layer, not the filesystem layer" — use domain language but don't cite files]
7575+```
7676+7777+#### For a breakdown (multiple issues)
7878+7979+Create issues in dependency order (blockers first) so you can reference real issue numbers.
8080+8181+Use this template for each sub-issue:
8282+8383+```
8484+## Parent issue
8585+8686+#<parent-issue-number> (if you created a tracking issue) or "Reported during QA session"
8787+8888+## What's wrong
8989+9090+[Describe this specific behavior problem — just this slice, not the whole report]
9191+9292+## What I expected
9393+9494+[Expected behavior for this specific slice]
9595+9696+## Steps to reproduce
9797+9898+1. [Steps specific to THIS issue]
9999+100100+## Blocked by
101101+102102+- #<issue-number> (if this issue can't be fixed until another is resolved)
103103+104104+Or "None — can start immediately" if no blockers.
105105+106106+## Additional context
107107+108108+[Any extra observations relevant to this slice]
109109+```
110110+111111+When creating a breakdown:
112112+113113+- **Prefer many thin issues over few thick ones** — each should be independently fixable and verifiable
114114+- **Mark blocking relationships honestly** — if issue B genuinely can't be tested until issue A is fixed, say so. If they're independent, mark both as "None — can start immediately"
115115+- **Create issues in dependency order** so you can reference real issue numbers in "Blocked by"
116116+- **Maximize parallelism** — the goal is that multiple people (or agents) can grab different issues simultaneously
117117+118118+#### Rules for all issue bodies
119119+120120+- **No file paths or line numbers** — these go stale
121121+- **Use the project's domain language** (check UBIQUITOUS_LANGUAGE.md if it exists)
122122+- **Describe behaviors, not code** — "the sync service fails to apply the patch" not "applyPatch() throws on line 42"
123123+- **Reproduction steps are mandatory** — if you can't determine them, ask the user
124124+- **Keep it concise** — a developer should be able to read the issue in 30 seconds
125125+126126+After filing, print all issue URLs (with blocking relationships summarized) and ask: "Next issue, or are we done?"
127127+128128+### 5. Continue the session
129129+130130+Keep going until the user says they're done. Each issue is independent — don't batch them.
+12
.agents/skills/research/SKILL.md
···11+---
22+name: research
33+description: Investigate a question against high-trust primary sources and capture the findings as a Markdown file in the repo. Use when the user wants a topic researched, docs or API facts gathered, or reading legwork delegated to a background agent.
44+---
55+66+Spin up a **background agent** to do the research, so you keep working while it reads.
77+88+Its job:
99+1010+1. Investigate the question against **primary sources** — official docs, source code, specs, first-party APIs — not a secondary write-up of them. Follow every claim back to the source that owns it.
1111+2. Write the findings to a single Markdown file, citing each claim's source.
1212+3. Save it where the repo already keeps such notes; match the existing convention, and if there is none, put it somewhere sensible and say where.
+127
.agents/skills/setup-matt-pocock-skills/SKILL.md
···11+---
22+name: setup-matt-pocock-skills
33+description: Configure this repo for the engineering skills — set up its issue tracker, triage label vocabulary, and domain doc layout. Run once before first use of the other engineering skills.
44+disable-model-invocation: true
55+---
66+77+# Setup Matt Pocock's Skills
88+99+Scaffold the per-repo configuration that the engineering skills assume:
1010+1111+- **Issue tracker** — where issues live (GitHub by default; local markdown is also supported out of the box)
1212+- **Triage labels** — the strings used for the five canonical triage roles
1313+- **Domain docs** — where `CONTEXT.md` and ADRs live, and the consumer rules for reading them
1414+1515+This is a prompt-driven skill, not a deterministic script. Explore, present what you found, confirm with the user, then write.
1616+1717+## Process
1818+1919+### 1. Explore
2020+2121+Look at the current repo to understand its starting state. Read whatever exists; don't assume:
2222+2323+- `git remote -v` and `.git/config` — is this a GitHub repo? Which one?
2424+- `AGENTS.md` and `CLAUDE.md` at the repo root — does either exist? Is there already an `## Agent skills` section in either?
2525+- `CONTEXT.md` and `CONTEXT-MAP.md` at the repo root
2626+- `docs/adr/` and any `src/*/docs/adr/` directories
2727+- `docs/agents/` — does this skill's prior output already exist?
2828+- `.scratch/` — sign that a local-markdown issue tracker convention is already in use
2929+3030+### 2. Present findings and ask
3131+3232+Summarise what's present and what's missing. Then walk the user through the three decisions **one at a time** — present a section, get the user's answer, then move to the next. Don't dump all three at once.
3333+3434+Assume the user does not know what these terms mean. Each section starts with a short explainer (what it is, why these skills need it, what changes if they pick differently). Then show the choices and the default.
3535+3636+**Section A — Issue tracker.**
3737+3838+> Explainer: The "issue tracker" is where issues live for this repo. Skills like `to-issues`, `triage`, `to-prd`, and `qa` read from and write to it — they need to know whether to call `gh issue create`, write a markdown file under `.scratch/`, or follow some other workflow you describe. Pick the place you actually track work for this repo.
3939+4040+Default posture: these skills were designed for GitHub. If a `git remote` points at GitHub, propose that. If a `git remote` points at GitLab (`gitlab.com` or a self-hosted host), propose GitLab. Otherwise (or if the user prefers), offer:
4141+4242+- **GitHub** — issues live in the repo's GitHub Issues (uses the `gh` CLI)
4343+- **GitLab** — issues live in the repo's GitLab Issues (uses the [`glab`](https://gitlab.com/gitlab-org/cli) CLI)
4444+- **Local markdown** — issues live as files under `.scratch/<feature>/` in this repo (good for solo projects or repos without a remote)
4545+- **Other** (Jira, Linear, etc.) — ask the user to describe the workflow in one paragraph; the skill will record it as freeform prose
4646+4747+If — and only if — the user picked **GitHub** or **GitLab**, ask one follow-up:
4848+4949+> Explainer: Open-source repos often receive feature requests as pull requests, not just issues — a PR is an issue with attached code. If you turn this on, `/triage` pulls *external* PRs into the same queue and runs them through the same labels and states as issues (collaborators' in-flight PRs are left alone). Leave it off if PRs aren't a request surface for you.
5050+5151+- **PRs as a request surface** — yes / no (default: no). Record the answer in `docs/agents/issue-tracker.md`. For local-markdown and other trackers, skip this question — there are no PRs.
5252+5353+**Section B — Triage label vocabulary.**
5454+5555+> Explainer: When the `triage` skill processes an incoming issue, it moves it through a state machine — needs evaluation, waiting on reporter, ready for an AFK agent to pick up, ready for a human, or won't fix. To do that, it needs to apply labels (or the equivalent in your issue tracker) that match strings *you've actually configured*. If your repo already uses different label names (e.g. `bug:triage` instead of `needs-triage`), map them here so the skill applies the right ones instead of creating duplicates.
5656+5757+The five canonical roles:
5858+5959+- `needs-triage` — maintainer needs to evaluate
6060+- `needs-info` — waiting on reporter
6161+- `ready-for-agent` — fully specified, AFK-ready (an agent can pick it up with no human context)
6262+- `ready-for-human` — needs human implementation
6363+- `wontfix` — will not be actioned
6464+6565+Default: each role's string equals its name. Ask the user if they want to override any. If their issue tracker has no existing labels, the defaults are fine.
6666+6767+**Section C — Domain docs.**
6868+6969+> Explainer: Some skills (`improve-codebase-architecture`, `diagnosing-bugs`, `tdd`) read a `CONTEXT.md` file to learn the project's domain language, and `docs/adr/` for past architectural decisions. They need to know whether the repo has one global context or multiple (e.g. a monorepo with separate frontend/backend contexts) so they look in the right place.
7070+7171+Confirm the layout:
7272+7373+- **Single-context** — one `CONTEXT.md` + `docs/adr/` at the repo root. Most repos are this.
7474+- **Multi-context** — `CONTEXT-MAP.md` at the root pointing to per-context `CONTEXT.md` files (typically a monorepo).
7575+7676+### 3. Confirm and edit
7777+7878+Show the user a draft of:
7979+8080+- The `## Agent skills` block to add to whichever of `CLAUDE.md` / `AGENTS.md` is being edited (see step 4 for selection rules)
8181+- The contents of `docs/agents/issue-tracker.md`, `docs/agents/triage-labels.md`, `docs/agents/domain.md`
8282+8383+Let them edit before writing.
8484+8585+### 4. Write
8686+8787+**Pick the file to edit:**
8888+8989+- If `CLAUDE.md` exists, edit it.
9090+- Else if `AGENTS.md` exists, edit it.
9191+- If neither exists, ask the user which one to create — don't pick for them.
9292+9393+Never create `AGENTS.md` when `CLAUDE.md` already exists (or vice versa) — always edit the one that's already there.
9494+9595+If an `## Agent skills` block already exists in the chosen file, update its contents in-place rather than appending a duplicate. Don't overwrite user edits to the surrounding sections.
9696+9797+The block:
9898+9999+```markdown
100100+## Agent skills
101101+102102+### Issue tracker
103103+104104+[one-line summary of where issues are tracked, plus whether external PRs are a triage surface]. See `docs/agents/issue-tracker.md`.
105105+106106+### Triage labels
107107+108108+[one-line summary of the label vocabulary]. See `docs/agents/triage-labels.md`.
109109+110110+### Domain docs
111111+112112+[one-line summary of layout — "single-context" or "multi-context"]. See `docs/agents/domain.md`.
113113+```
114114+115115+Then write the three docs files using the seed templates in this skill folder as a starting point:
116116+117117+- [issue-tracker-github.md](./issue-tracker-github.md) — GitHub issue tracker
118118+- [issue-tracker-gitlab.md](./issue-tracker-gitlab.md) — GitLab issue tracker
119119+- [issue-tracker-local.md](./issue-tracker-local.md) — local-markdown issue tracker
120120+- [triage-labels.md](./triage-labels.md) — label mapping
121121+- [domain.md](./domain.md) — domain doc consumer rules + layout
122122+123123+For "other" issue trackers, write `docs/agents/issue-tracker.md` from scratch using the user's description.
124124+125125+### 5. Done
126126+127127+Tell the user the setup is complete and which engineering skills will now read from these files. Mention they can edit `docs/agents/*.md` directly later — re-running this skill is only necessary if they want to switch issue trackers or restart from scratch.
+51
.agents/skills/setup-matt-pocock-skills/domain.md
···11+# Domain Docs
22+33+How the engineering skills should consume this repo's domain documentation when exploring the codebase.
44+55+## Before exploring, read these
66+77+- **`CONTEXT.md`** at the repo root, or
88+- **`CONTEXT-MAP.md`** at the repo root if it exists — it points at one `CONTEXT.md` per context. Read each one relevant to the topic.
99+- **`docs/adr/`** — read ADRs that touch the area you're about to work in. In multi-context repos, also check `src/<context>/docs/adr/` for context-scoped decisions.
1010+1111+If any of these files don't exist, **proceed silently**. Don't flag their absence; don't suggest creating them upfront. The `/domain-modeling` skill (reached via `/grill-with-docs` and `/improve-codebase-architecture`) creates them lazily when terms or decisions actually get resolved.
1212+1313+## File structure
1414+1515+Single-context repo (most repos):
1616+1717+```
1818+/
1919+├── CONTEXT.md
2020+├── docs/adr/
2121+│ ├── 0001-event-sourced-orders.md
2222+│ └── 0002-postgres-for-write-model.md
2323+└── src/
2424+```
2525+2626+Multi-context repo (presence of `CONTEXT-MAP.md` at the root):
2727+2828+```
2929+/
3030+├── CONTEXT-MAP.md
3131+├── docs/adr/ ← system-wide decisions
3232+└── src/
3333+ ├── ordering/
3434+ │ ├── CONTEXT.md
3535+ │ └── docs/adr/ ← context-specific decisions
3636+ └── billing/
3737+ ├── CONTEXT.md
3838+ └── docs/adr/
3939+```
4040+4141+## Use the glossary's vocabulary
4242+4343+When your output names a domain concept (in an issue title, a refactor proposal, a hypothesis, a test name), use the term as defined in `CONTEXT.md`. Don't drift to synonyms the glossary explicitly avoids.
4444+4545+If the concept you need isn't in the glossary yet, that's a signal — either you're inventing language the project doesn't use (reconsider) or there's a real gap (note it for `/domain-modeling`).
4646+4747+## Flag ADR conflicts
4848+4949+If your output contradicts an existing ADR, surface it explicitly rather than silently overriding:
5050+5151+> _Contradicts ADR-0007 (event-sourced orders) — but worth reopening because…_
···11+# Issue tracker: GitHub
22+33+Issues and PRDs for this repo live as GitHub issues. Use the `gh` CLI for all operations.
44+55+## Conventions
66+77+- **Create an issue**: `gh issue create --title "..." --body "..."`. Use a heredoc for multi-line bodies.
88+- **Read an issue**: `gh issue view <number> --comments`, filtering comments by `jq` and also fetching labels.
99+- **List issues**: `gh issue list --state open --json number,title,body,labels,comments --jq '[.[] | {number, title, body, labels: [.labels[].name], comments: [.comments[].body]}]'` with appropriate `--label` and `--state` filters.
1010+- **Comment on an issue**: `gh issue comment <number> --body "..."`
1111+- **Apply / remove labels**: `gh issue edit <number> --add-label "..."` / `--remove-label "..."`
1212+- **Close**: `gh issue close <number> --comment "..."`
1313+1414+Infer the repo from `git remote -v` — `gh` does this automatically when run inside a clone.
1515+1616+## Pull requests as a triage surface
1717+1818+**PRs as a request surface: no.** _(Set to `yes` if this repo treats external PRs as feature requests; `/triage` reads this flag.)_
1919+2020+When set to `yes`, PRs run through the same labels and states as issues, using the `gh pr` equivalents:
2121+2222+- **Read a PR**: `gh pr view <number> --comments` and `gh pr diff <number>` for the diff.
2323+- **List external PRs for triage**: `gh pr list --state open --json number,title,body,labels,author,authorAssociation,comments` then keep only `authorAssociation` of `CONTRIBUTOR`, `FIRST_TIME_CONTRIBUTOR`, or `NONE` (drop `OWNER`/`MEMBER`/`COLLABORATOR`).
2424+- **Comment / label / close**: `gh pr comment`, `gh pr edit --add-label`/`--remove-label`, `gh pr close`.
2525+2626+GitHub shares one number space across issues and PRs, so a bare `#42` may be either — resolve with `gh pr view 42` and fall back to `gh issue view 42`.
2727+2828+## When a skill says "publish to the issue tracker"
2929+3030+Create a GitHub issue.
3131+3232+## When a skill says "fetch the relevant ticket"
3333+3434+Run `gh issue view <number> --comments`.
3535+3636+## Wayfinding operations
3737+3838+Used by `/wayfinder`. The **map** is a single issue with **child** issues as tickets.
3939+4040+- **Map**: a single issue labelled `wayfinder:map`, holding the Notes / Decisions-so-far / Fog body. `gh issue create --label wayfinder:map`.
4141+- **Child ticket**: an issue linked to the map as a GitHub sub-issue (`gh api` on the sub-issues endpoint). Where sub-issues aren't enabled, add the child to a task list in the map body and put `Part of #<map>` at the top of the child body. Labels: `wayfinder:<type>` (`research`/`prototype`/`grilling`/`task`). Once claimed, the ticket is assigned to the driving dev.
4242+- **Blocking**: GitHub's **native issue dependencies** — the canonical, UI-visible representation. Add an edge with `gh api --method POST repos/<owner>/<repo>/issues/<child>/dependencies/blocked_by -F issue_id=<blocker-db-id>`, where `<blocker-db-id>` is the blocker's numeric **database id** (`gh api repos/<owner>/<repo>/issues/<n> --jq .id`, _not_ the `#number` or `node_id`). GitHub reports `issue_dependencies_summary.blocked_by` (open blockers only — the live gate). Where dependencies aren't available, fall back to a `Blocked by: #<n>, #<n>` line at the top of the child body. A ticket is unblocked when every blocker is closed.
4343+- **Frontier query**: list the map's open children (`gh issue list --state open`, scoped to the map's sub-issues / task list), drop any with an open blocker (`issue_dependencies_summary.blocked_by > 0`, or an open issue in the `Blocked by` line) or an assignee; first in map order wins.
4444+- **Claim**: `gh issue edit <n> --add-assignee @me` — the session's first write.
4545+- **Resolve**: `gh issue comment <n> --body "<answer>"`, then `gh issue close <n>`, then append a context pointer (gist + link) to the map's Decisions-so-far.
···11+# Issue tracker: GitLab
22+33+Issues and PRDs for this repo live as GitLab issues. Use the [`glab`](https://gitlab.com/gitlab-org/cli) CLI for all operations.
44+55+## Conventions
66+77+- **Create an issue**: `glab issue create --title "..." --description "..."`. Use a heredoc for multi-line descriptions. Pass `--description -` to open an editor.
88+- **Read an issue**: `glab issue view <number> --comments`. Use `-F json` for machine-readable output.
99+- **List issues**: `glab issue list -F json` with appropriate `--label` filters.
1010+- **Comment on an issue**: `glab issue note <number> --message "..."`. GitLab calls comments "notes".
1111+- **Apply / remove labels**: `glab issue update <number> --label "..."` / `--unlabel "..."`. Multiple labels can be comma-separated or by repeating the flag.
1212+- **Close**: `glab issue close <number>`. `glab issue close` does not accept a closing comment, so post the explanation first with `glab issue note <number> --message "..."`, then close.
1313+- **Merge requests**: GitLab calls PRs "merge requests". Use `glab mr create`, `glab mr view`, `glab mr note`, etc. — the same shape as `gh pr ...` with `mr` in place of `pr` and `note`/`--message` in place of `comment`/`--body`.
1414+1515+Infer the repo from `git remote -v` — `glab` does this automatically when run inside a clone.
1616+1717+## Merge requests as a triage surface
1818+1919+**MRs as a request surface: no.** _(Set to `yes` if this repo treats external merge requests as feature requests; `/triage` reads this flag.)_
2020+2121+When set to `yes`, MRs run through the same labels and states as issues, using the `glab mr` equivalents:
2222+2323+- **Read an MR**: `glab mr view <number> --comments` and `glab mr diff <number>` for the diff.
2424+- **List external MRs for triage**: `glab mr list -F json`, then keep only MRs whose author is not a project member/owner (a contributor's MR, not a maintainer's in-flight work).
2525+- **Comment / label / close**: `glab mr note`, `glab mr update --label`/`--unlabel`, `glab mr close`.
2626+2727+Unlike GitHub, GitLab numbers issues and MRs separately, so `#42` is unambiguous once you know which surface the maintainer means.
2828+2929+## When a skill says "publish to the issue tracker"
3030+3131+Create a GitLab issue.
3232+3333+## When a skill says "fetch the relevant ticket"
3434+3535+Run `glab issue view <number> --comments`.
3636+3737+## Wayfinding operations
3838+3939+Used by `/wayfinder`. The **map** is a single issue with **child** issues as tickets.
4040+4141+- **Map**: a single issue labelled `wayfinder:map`, holding the Notes / Decisions-so-far / Fog body. `glab issue create --label wayfinder:map`. (On GitLab tiers with native epics, an epic may hold the map instead; a labelled issue works everywhere.)
4242+- **Child ticket**: an issue carrying `Part of #<map>` at the top of its description and labels `wayfinder:<type>` (`research`/`prototype`/`grilling`/`task`). Once claimed, the ticket is assigned to the driving dev.
4343+- **Blocking**: GitLab's **native blocking link** — the canonical, UI-visible representation. Add it with the `/blocked_by #<n>` quick action, posted as a note (`glab issue note <child> --message "/blocked_by #<blocker>"`). Native blocking links are a Premium/Ultimate feature; on the free tier (or where unavailable) fall back to a `Blocked by: #<n>, #<n>` line at the top of the description. A ticket is unblocked when every blocker is closed.
4444+- **Frontier query**: `glab issue list -F json` scoped to the map's children, drop any with an open blocker — a native `blocked_by` link to an open issue (`glab api projects/:id/issues/:iid/links`), or an open issue in the `Blocked by` line — or an assignee; first in map order wins.
4545+- **Claim**: `glab issue update <n> --assignee @me` — the session's first write.
4646+- **Resolve**: `glab issue note <n> --message "<answer>"`, then `glab issue close <n>`, then append a context pointer (gist + link) to the map's Decisions-so-far.
···11+# Issue tracker: Local Markdown
22+33+Issues and PRDs for this repo live as markdown files in `.scratch/`.
44+55+## Conventions
66+77+- One feature per directory: `.scratch/<feature-slug>/`
88+- The PRD is `.scratch/<feature-slug>/PRD.md`
99+- Implementation issues are `.scratch/<feature-slug>/issues/<NN>-<slug>.md`, numbered from `01`
1010+- Triage state is recorded as a `Status:` line near the top of each issue file (see `triage-labels.md` for the role strings)
1111+- Comments and conversation history append to the bottom of the file under a `## Comments` heading
1212+1313+## When a skill says "publish to the issue tracker"
1414+1515+Create a new file under `.scratch/<feature-slug>/` (creating the directory if needed).
1616+1717+## When a skill says "fetch the relevant ticket"
1818+1919+Read the file at the referenced path. The user will normally pass the path or the issue number directly.
2020+2121+## Wayfinding operations
2222+2323+Used by `/wayfinder`. The **map** is a file with one **child** file per ticket.
2424+2525+- **Map**: `.scratch/<effort>/map.md` — the Notes / Decisions-so-far / Fog body.
2626+- **Child ticket**: `.scratch/<effort>/issues/NN-<slug>.md`, numbered from `01`, with the question in the body. A `Type:` line records the ticket type (`research`/`prototype`/`grilling`/`task`); a `Status:` line records `claimed`/`resolved`.
2727+- **Blocking**: a `Blocked by: NN, NN` line near the top. A ticket is unblocked when every file it lists is `resolved`.
2828+- **Frontier**: scan `.scratch/<effort>/issues/` for files that are open, unblocked, and unclaimed; first by number wins.
2929+- **Claim**: set `Status: claimed` and save before any work.
3030+- **Resolve**: append the answer under an `## Answer` heading, set `Status: resolved`, then append a context pointer (gist + link) to the map's Decisions-so-far in `map.md`.
···11+# Triage Labels
22+33+The skills speak in terms of five canonical triage roles. This file maps those roles to the actual label strings used in this repo's issue tracker.
44+55+| Label in mattpocock/skills | Label in our tracker | Meaning |
66+| -------------------------- | -------------------- | ---------------------------------------- |
77+| `needs-triage` | `needs-triage` | Maintainer needs to evaluate this issue |
88+| `needs-info` | `needs-info` | Waiting on reporter for more information |
99+| `ready-for-agent` | `ready-for-agent` | Fully specified, ready for an AFK agent |
1010+| `ready-for-human` | `ready-for-human` | Requires human implementation |
1111+| `wontfix` | `wontfix` | Will not be actioned |
1212+1313+When a skill mentions a role (e.g. "apply the AFK-ready triage label"), use the corresponding label string from this table.
1414+1515+Edit the right-hand column to match whatever vocabulary you actually use.
+36
.agents/skills/tdd/SKILL.md
···11+---
22+name: tdd
33+description: Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions "red-green-refactor", or wants integration tests.
44+---
55+66+# Test-Driven Development
77+88+TDD is the red → green loop. This skill is the reference that makes that loop produce tests worth keeping: what a good test is, where tests go, the anti-patterns, and the rules of the loop. Every section applies on every cycle — consult them before and during the loop, not after.
99+1010+When exploring the codebase, read `CONTEXT.md` (if it exists) so test names and interface vocabulary match the project's domain language, and respect ADRs in the area you're touching.
1111+1212+## What a good test is
1313+1414+Tests verify behavior through public interfaces, not implementation details. Code can change entirely; tests shouldn't. A good test reads like a specification — "user can checkout with valid cart" tells you exactly what capability exists — and survives refactors because it doesn't care about internal structure.
1515+1616+See [tests.md](tests.md) for examples and [mocking.md](mocking.md) for mocking guidelines.
1717+1818+## Seams — where tests go
1919+2020+A **seam** is the public boundary you test at: the interface where you observe behavior without reaching inside. Tests live at seams, never against internals.
2121+2222+**Test only at pre-agreed seams.** Before writing any test, write down the seams under test and confirm them with the user. No test is written at an unconfirmed seam. You can't test everything — agreeing the seams up front is how testing effort lands on the critical paths and complex logic instead of every edge case.
2323+2424+Ask: "What's the public interface, and which seams should we test?"
2525+2626+## Anti-patterns
2727+2828+- **Implementation-coupled** — mocks internal collaborators, tests private methods, or verifies through a side channel (querying the database instead of using the interface). The tell: the test breaks when you refactor but behavior hasn't changed.
2929+- **Tautological** — the assertion recomputes the expected value the way the code does (`expect(add(a, b)).toBe(a + b)`, a snapshot derived by hand the same way, a constant asserted equal to itself), so it passes by construction and can never disagree with the code. Expected values must come from an independent source of truth — a known-good literal, a worked example, the spec.
3030+- **Horizontal slicing** — writing all tests first, then all implementation. Bulk tests verify _imagined_ behavior: you test the _shape_ of things rather than user-facing behavior, the tests go insensitive to real changes, and you commit to test structure before understanding the implementation. Work in **vertical slices** instead — one test → one implementation → repeat, each test a **tracer bullet** that responds to what the last cycle taught you.
3131+3232+## Rules of the loop
3333+3434+- **Red before green.** Write the failing test first, then only enough code to pass it. Don't anticipate future tests or add speculative features.
3535+- **One slice at a time.** One seam, one test, one minimal implementation per cycle.
3636+- **Refactoring is not part of the loop.** It belongs to the review stage (see the `code-review` skill), not the red → green implementation cycle.
+59
.agents/skills/tdd/mocking.md
···11+# When to Mock
22+33+Mock at **system boundaries** only:
44+55+- External APIs (payment, email, etc.)
66+- Databases (sometimes - prefer test DB)
77+- Time/randomness
88+- File system (sometimes)
99+1010+Don't mock:
1111+1212+- Your own classes/modules
1313+- Internal collaborators
1414+- Anything you control
1515+1616+## Designing for Mockability
1717+1818+At system boundaries, design interfaces that are easy to mock:
1919+2020+**1. Use dependency injection**
2121+2222+Pass external dependencies in rather than creating them internally:
2323+2424+```typescript
2525+// Easy to mock
2626+function processPayment(order, paymentClient) {
2727+ return paymentClient.charge(order.total);
2828+}
2929+3030+// Hard to mock
3131+function processPayment(order) {
3232+ const client = new StripeClient(process.env.STRIPE_KEY);
3333+ return client.charge(order.total);
3434+}
3535+```
3636+3737+**2. Prefer SDK-style interfaces over generic fetchers**
3838+3939+Create specific functions for each external operation instead of one generic function with conditional logic:
4040+4141+```typescript
4242+// GOOD: Each function is independently mockable
4343+const api = {
4444+ getUser: (id) => fetch(`/users/${id}`),
4545+ getOrders: (userId) => fetch(`/users/${userId}/orders`),
4646+ createOrder: (data) => fetch('/orders', { method: 'POST', body: data }),
4747+};
4848+4949+// BAD: Mocking requires conditional logic inside the mock
5050+const api = {
5151+ fetch: (endpoint, options) => fetch(endpoint, options),
5252+};
5353+```
5454+5555+The SDK approach means:
5656+- Each mock returns one specific shape
5757+- No conditional logic in test setup
5858+- Easier to see which endpoints a test exercises
5959+- Type safety per endpoint
+77
.agents/skills/tdd/tests.md
···11+# Good and Bad Tests
22+33+## Good Tests
44+55+**Integration-style**: Test through real interfaces, not mocks of internal parts.
66+77+```typescript
88+// GOOD: Tests observable behavior
99+test("user can checkout with valid cart", async () => {
1010+ const cart = createCart();
1111+ cart.add(product);
1212+ const result = await checkout(cart, paymentMethod);
1313+ expect(result.status).toBe("confirmed");
1414+});
1515+```
1616+1717+Characteristics:
1818+1919+- Tests behavior users/callers care about
2020+- Uses public API only
2121+- Survives internal refactors
2222+- Describes WHAT, not HOW
2323+- One logical assertion per test
2424+2525+## Bad Tests
2626+2727+**Implementation-detail tests**: Coupled to internal structure.
2828+2929+```typescript
3030+// BAD: Tests implementation details
3131+test("checkout calls paymentService.process", async () => {
3232+ const mockPayment = jest.mock(paymentService);
3333+ await checkout(cart, payment);
3434+ expect(mockPayment.process).toHaveBeenCalledWith(cart.total);
3535+});
3636+```
3737+3838+Red flags:
3939+4040+- Mocking internal collaborators
4141+- Testing private methods
4242+- Asserting on call counts/order
4343+- Test breaks when refactoring without behavior change
4444+- Test name describes HOW not WHAT
4545+- Verifying through external means instead of interface
4646+4747+```typescript
4848+// BAD: Bypasses interface to verify
4949+test("createUser saves to database", async () => {
5050+ await createUser({ name: "Alice" });
5151+ const row = await db.query("SELECT * FROM users WHERE name = ?", ["Alice"]);
5252+ expect(row).toBeDefined();
5353+});
5454+5555+// GOOD: Verifies through interface
5656+test("createUser makes user retrievable", async () => {
5757+ const user = await createUser({ name: "Alice" });
5858+ const retrieved = await getUser(user.id);
5959+ expect(retrieved.name).toBe("Alice");
6060+});
6161+```
6262+6363+**Tautological tests**: Expected value restates the implementation, so the test passes by construction.
6464+6565+```typescript
6666+// BAD: Expected value is recomputed the way the code computes it
6767+test("calculateTotal sums line items", () => {
6868+ const items = [{ price: 10 }, { price: 5 }];
6969+ const expected = items.reduce((sum, i) => sum + i.price, 0);
7070+ expect(calculateTotal(items)).toBe(expected);
7171+});
7272+7373+// GOOD: Expected value is an independent, known literal
7474+test("calculateTotal sums line items", () => {
7575+ expect(calculateTotal([{ price: 10 }, { price: 5 }])).toBe(15);
7676+});
7777+```
+84
.agents/skills/to-issues/SKILL.md
···11+---
22+name: to-issues
33+description: Break a plan, spec, or PRD into independently-grabbable issues on the project issue tracker using tracer-bullet vertical slices.
44+disable-model-invocation: true
55+---
66+77+# To Issues
88+99+Break a plan into independently-grabbable issues using vertical slices (tracer bullets).
1010+1111+The issue tracker and triage label vocabulary should have been provided to you — run `/setup-matt-pocock-skills` if not.
1212+1313+## Process
1414+1515+### 1. Gather context
1616+1717+Work from whatever is already in the conversation context. If the user passes an issue reference (issue number, URL, or path) as an argument, fetch it from the issue tracker and read its full body and comments.
1818+1919+### 2. Explore the codebase (optional)
2020+2121+If you have not already explored the codebase, do so to understand the current state of the code. Issue titles and descriptions should use the project's domain glossary vocabulary, and respect ADRs in the area you're touching.
2222+2323+Look for opportunities to prefactor the code to make the implementation easier. "Make the change easy, then make the easy change."
2424+2525+### 3. Draft vertical slices
2626+2727+Break the plan into **tracer bullet** issues. Each issue is a thin vertical slice that cuts through ALL integration layers end-to-end, NOT a horizontal slice of one layer.
2828+2929+<vertical-slice-rules>
3030+3131+- Each slice delivers a narrow but COMPLETE path through every layer (schema, API, UI, tests)
3232+- A completed slice is demoable or verifiable on its own
3333+- Any prefactoring should be done first
3434+3535+</vertical-slice-rules>
3636+3737+### 4. Quiz the user
3838+3939+Present the proposed breakdown as a numbered list. For each slice, show:
4040+4141+- **Title**: short descriptive name
4242+- **Blocked by**: which other slices (if any) must complete first
4343+- **User stories covered**: which user stories this addresses (if the source material has them)
4444+4545+Ask the user:
4646+4747+- Does the granularity feel right? (too coarse / too fine)
4848+- Are the dependency relationships correct?
4949+- Should any slices be merged or split further?
5050+5151+Iterate until the user approves the breakdown.
5252+5353+### 5. Publish the issues to the issue tracker
5454+5555+For each approved slice, publish a new issue to the issue tracker. Use the issue body template below. These issues are considered ready for AFK agents, so publish them with the correct triage label unless instructed otherwise.
5656+5757+Publish issues in dependency order (blockers first) so you can reference real issue identifiers. Where the tracker supports it, link each slice to its parent as a native **sub-issue** and wire each blocker as a native **blocking edge** (mechanics in the issue-tracker doc); the `## Parent` and `## Blocked by` body sections are the fallback otherwise.
5858+5959+<issue-template>
6060+## Parent
6161+6262+A reference to the parent issue on the issue tracker (if the source was an existing issue, otherwise omit this section).
6363+6464+## What to build
6565+6666+A concise description of this vertical slice. Describe the end-to-end behavior, not layer-by-layer implementation.
6767+6868+Avoid specific file paths or code snippets — they go stale fast. Exception: if the `/prototype` skill produced code that encodes a decision more precisely than prose can (state machine, reducer, schema, type shape), add a context pointer to where that prototype code lives rather than inlining it.
6969+7070+## Acceptance criteria
7171+7272+- [ ] Criterion 1
7373+- [ ] Criterion 2
7474+- [ ] Criterion 3
7575+7676+## Blocked by
7777+7878+- A reference to the blocking ticket (if any)
7979+8080+Or "None - can start immediately" if no blockers.
8181+8282+</issue-template>
8383+8484+Do NOT close or modify any parent issue.
+75
.agents/skills/to-prd/SKILL.md
···11+---
22+name: to-prd
33+description: Turn the current conversation into a PRD and publish it to the project issue tracker — no interview, just synthesis of what you've already discussed.
44+disable-model-invocation: true
55+---
66+77+This skill takes the current conversation context and codebase understanding and produces a PRD. Do NOT interview the user — just synthesize what you already know.
88+99+The issue tracker and triage label vocabulary should have been provided to you — run `/setup-matt-pocock-skills` if not.
1010+1111+## Process
1212+1313+1. Explore the repo to understand the current state of the codebase, if you haven't already. Use the project's domain glossary vocabulary throughout the PRD, and respect any ADRs in the area you're touching.
1414+1515+2. Sketch out the seams at which you're going to test the feature. Existing seams should be preferred to new ones. Use the highest seam possible. If new seams are needed, propose them at the highest point you can. The fewer seams across the codebase, the better - the ideal number is one.
1616+1717+Check with the user that these seams match their expectations.
1818+1919+3. Write the PRD using the template below, then publish it to the project issue tracker. Apply the `ready-for-agent` triage label - no need for additional triage.
2020+2121+<prd-template>
2222+2323+## Problem Statement
2424+2525+The problem that the user is facing, from the user's perspective.
2626+2727+## Solution
2828+2929+The solution to the problem, from the user's perspective.
3030+3131+## User Stories
3232+3333+A LONG, numbered list of user stories. Each user story should be in the format of:
3434+3535+1. As an <actor>, I want a <feature>, so that <benefit>
3636+3737+<user-story-example>
3838+1. As a mobile bank customer, I want to see balance on my accounts, so that I can make better informed decisions about my spending
3939+</user-story-example>
4040+4141+This list of user stories should be extremely extensive and cover all aspects of the feature.
4242+4343+## Implementation Decisions
4444+4545+A list of implementation decisions that were made. This can include:
4646+4747+- The modules that will be built/modified
4848+- The interfaces of those modules that will be modified
4949+- Technical clarifications from the developer
5050+- Architectural decisions
5151+- Schema changes
5252+- API contracts
5353+- Specific interactions
5454+5555+Do NOT include specific file paths or code snippets. They may end up being outdated very quickly.
5656+5757+Exception: if a prototype produced a snippet that encodes a decision more precisely than prose can (state machine, reducer, schema, type shape), inline it within the relevant decision and note briefly that it came from a prototype. Trim to the decision-rich parts — not a working demo, just the important bits.
5858+5959+## Testing Decisions
6060+6161+A list of testing decisions that were made. Include:
6262+6363+- A description of what makes a good test (only test external behavior, not implementation details)
6464+- Which modules will be tested
6565+- Prior art for the tests (i.e. similar types of tests in the codebase)
6666+6767+## Out of Scope
6868+6969+A description of the things that are out of scope for this PRD.
7070+7171+## Further Notes
7272+7373+Any further notes about the feature.
7474+7575+</prd-template>
+207
.agents/skills/triage/AGENT-BRIEF.md
···11+# Writing Agent Briefs
22+33+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.
44+55+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.
66+77+## Principles
88+99+### Durability over precision
1010+1111+The issue may sit in `ready-for-agent` for days or weeks. The codebase will change in the meantime. Write the brief so it stays useful even as files are renamed, moved, or refactored.
1212+1313+- **Do** describe interfaces, types, and behavioral contracts
1414+- **Do** name specific types, function signatures, or config shapes that the agent should look for or modify
1515+- **Don't** reference file paths — they go stale
1616+- **Don't** reference line numbers
1717+- **Don't** assume the current implementation structure will remain the same
1818+1919+### Behavioral, not procedural
2020+2121+Describe **what** the system should do, not **how** to implement it. The agent will explore the codebase fresh and make its own implementation decisions.
2222+2323+- **Good:** "The `SkillConfig` type should accept an optional `schedule` field of type `CronExpression`"
2424+- **Bad:** "Open src/types/skill.ts and add a schedule field on line 42"
2525+- **Good:** "When a user runs `/triage` with no arguments, they should see a summary of issues needing attention"
2626+- **Bad:** "Add a switch statement in the main handler function"
2727+2828+### Complete acceptance criteria
2929+3030+The agent needs to know when it's done. Every agent brief must have concrete, testable acceptance criteria. Each criterion should be independently verifiable.
3131+3232+- **Good:** "Running `gh issue list --label needs-triage` returns issues that have been through initial classification"
3333+- **Bad:** "Triage should work correctly"
3434+3535+### Explicit scope boundaries
3636+3737+State what is out of scope. This prevents the agent from gold-plating or making assumptions about adjacent features.
3838+3939+## Template
4040+4141+```markdown
4242+## Agent Brief
4343+4444+**Category:** bug / enhancement
4545+**Summary:** one-line description of what needs to happen
4646+4747+**Current behavior:**
4848+Describe what happens now. For bugs, this is the broken behavior.
4949+For enhancements, this is the status quo the feature builds on.
5050+5151+**Desired behavior:**
5252+Describe what should happen after the agent's work is complete.
5353+Be specific about edge cases and error conditions.
5454+5555+**Key interfaces:**
5656+- `TypeName` — what needs to change and why
5757+- `functionName()` return type — what it currently returns vs what it should return
5858+- Config shape — any new configuration options needed
5959+6060+**Acceptance criteria:**
6161+- [ ] Specific, testable criterion 1
6262+- [ ] Specific, testable criterion 2
6363+- [ ] Specific, testable criterion 3
6464+6565+**Out of scope:**
6666+- Thing that should NOT be changed or addressed in this issue
6767+- Adjacent feature that might seem related but is separate
6868+```
6969+7070+## Examples
7171+7272+### Good agent brief (bug)
7373+7474+```markdown
7575+## Agent Brief
7676+7777+**Category:** bug
7878+**Summary:** Skill description truncation drops mid-word, producing broken output
7979+8080+**Current behavior:**
8181+When a skill description exceeds 1024 characters, it is truncated at exactly
8282+1024 characters regardless of word boundaries. This produces descriptions
8383+that end mid-word (e.g. "Use when the user wants to confi").
8484+8585+**Desired behavior:**
8686+Truncation should break at the last word boundary before 1024 characters
8787+and append "..." to indicate truncation.
8888+8989+**Key interfaces:**
9090+- The `SkillMetadata` type's `description` field — no type change needed,
9191+ but the validation/processing logic that populates it needs to respect
9292+ word boundaries
9393+- Any function that reads SKILL.md frontmatter and extracts the description
9494+9595+**Acceptance criteria:**
9696+- [ ] Descriptions under 1024 chars are unchanged
9797+- [ ] Descriptions over 1024 chars are truncated at the last word boundary
9898+ before 1024 chars
9999+- [ ] Truncated descriptions end with "..."
100100+- [ ] The total length including "..." does not exceed 1024 chars
101101+102102+**Out of scope:**
103103+- Changing the 1024 char limit itself
104104+- Multi-line description support
105105+```
106106+107107+### Good agent brief (enhancement)
108108+109109+```markdown
110110+## Agent Brief
111111+112112+**Category:** enhancement
113113+**Summary:** Add `.out-of-scope/` directory support for tracking rejected feature requests
114114+115115+**Current behavior:**
116116+When a feature request is rejected, the issue is closed with a `wontfix` label
117117+and a comment. There is no persistent record of the decision or reasoning.
118118+Future similar requests require the maintainer to recall or search for the
119119+prior discussion.
120120+121121+**Desired behavior:**
122122+Rejected feature requests should be documented in `.out-of-scope/<concept>.md`
123123+files that capture the decision, reasoning, and links to all issues that
124124+requested the feature. When triaging new issues, these files should be
125125+checked for matches.
126126+127127+**Key interfaces:**
128128+- Markdown file format in `.out-of-scope/` — each file should have a
129129+ `# Concept Name` heading, a `**Decision:**` line, a `**Reason:**` line,
130130+ and a `**Prior requests:**` list with issue links
131131+- The triage workflow should read all `.out-of-scope/*.md` files early
132132+ and match incoming issues against them by concept similarity
133133+134134+**Acceptance criteria:**
135135+- [ ] Closing a feature as wontfix creates/updates a file in `.out-of-scope/`
136136+- [ ] The file includes the decision, reasoning, and link to the closed issue
137137+- [ ] If a matching `.out-of-scope/` file already exists, the new issue is
138138+ appended to its "Prior requests" list rather than creating a duplicate
139139+- [ ] During triage, existing `.out-of-scope/` files are checked and surfaced
140140+ when a new issue matches a prior rejection
141141+142142+**Out of scope:**
143143+- Automated matching (human confirms the match)
144144+- Reopening previously rejected features
145145+- Bug reports (only enhancement rejections go to `.out-of-scope/`)
146146+```
147147+148148+### Good agent brief (PR)
149149+150150+For a PR, "Current behavior" describes the state of the diff, and the brief asks the agent to finish or fix it rather than build from scratch.
151151+152152+```markdown
153153+## Agent Brief
154154+155155+**Category:** enhancement
156156+**Summary:** Finish the contributor's `--json` output flag for `triage list`
157157+158158+**Current behavior:**
159159+The PR adds a `--json` flag that serializes the issue list to JSON. The happy
160160+path works and the diff matches the project's command structure. Two gaps
161161+remain: errors are still printed as human text (not JSON), and the new flag has
162162+no test coverage.
163163+164164+**Desired behavior:**
165165+With `--json`, all output — including errors — is well-formed JSON on stdout,
166166+and the command's exit codes are unchanged. The existing human-readable output
167167+is untouched when the flag is absent.
168168+169169+**Key interfaces:**
170170+- The command's error path should emit `{ "error": string }` under `--json`
171171+ instead of the plain-text error
172172+- Reuse the existing serializer the PR already added; don't introduce a second
173173+174174+**Acceptance criteria:**
175175+- [ ] `triage list --json` emits valid JSON for both success and error cases
176176+- [ ] Exit codes match the non-JSON command
177177+- [ ] A test covers the `--json` success output and one error case
178178+- [ ] Default (non-JSON) output is byte-for-byte unchanged
179179+180180+**Out of scope:**
181181+- Adding `--json` to any other command
182182+- Changing the JSON shape of the success payload the PR already defined
183183+```
184184+185185+### Bad agent brief
186186+187187+```markdown
188188+## Agent Brief
189189+190190+**Summary:** Fix the triage bug
191191+192192+**What to do:**
193193+The triage thing is broken. Look at the main file and fix it.
194194+The function around line 150 has the issue.
195195+196196+**Files to change:**
197197+- src/triage/handler.ts (line 150)
198198+- src/types.ts (line 42)
199199+```
200200+201201+This is bad because:
202202+- No category
203203+- Vague description ("the triage thing is broken")
204204+- References file paths and line numbers that will go stale
205205+- No acceptance criteria
206206+- No scope boundaries
207207+- No description of current vs desired behavior
+105
.agents/skills/triage/OUT-OF-SCOPE.md
···11+# Out-of-Scope Knowledge Base
22+33+The `.out-of-scope/` directory in a repo stores persistent records of rejected feature requests. It serves two purposes:
44+55+1. **Institutional memory** — why a feature was rejected, so the reasoning isn't lost when the issue is closed
66+2. **Deduplication** — when a new issue comes in that matches a prior rejection, the skill can surface the previous decision instead of re-litigating it
77+88+## Directory structure
99+1010+```
1111+.out-of-scope/
1212+├── dark-mode.md
1313+├── plugin-system.md
1414+└── graphql-api.md
1515+```
1616+1717+One file per **concept**, not per issue. Multiple issues requesting the same thing are grouped under one file.
1818+1919+## File format
2020+2121+The file should be written in a relaxed, readable style — more like a short design document than a database entry. Use paragraphs, code samples, and examples to make the reasoning clear and useful to someone encountering it for the first time.
2222+2323+```markdown
2424+# Dark Mode
2525+2626+This project does not support dark mode or user-facing theming.
2727+2828+## Why this is out of scope
2929+3030+The rendering pipeline assumes a single color palette defined in
3131+`ThemeConfig`. Supporting multiple themes would require:
3232+3333+- A theme context provider wrapping the entire component tree
3434+- Per-component theme-aware style resolution
3535+- A persistence layer for user theme preferences
3636+3737+This is a significant architectural change that doesn't align with the
3838+project's focus on content authoring. Theming is a concern for downstream
3939+consumers who embed or redistribute the output.
4040+4141+```ts
4242+// The current ThemeConfig interface is not designed for runtime switching:
4343+interface ThemeConfig {
4444+ colors: ColorPalette; // single palette, resolved at build time
4545+ fonts: FontStack;
4646+}
4747+```
4848+4949+## Prior requests
5050+5151+- #42 — "Add dark mode support"
5252+- #87 — "Night theme for accessibility"
5353+- #134 — "Dark theme option"
5454+```
5555+5656+### Naming the file
5757+5858+Use a short, descriptive kebab-case name for the concept: `dark-mode.md`, `plugin-system.md`, `graphql-api.md`. The name should be recognizable enough that someone browsing the directory understands what was rejected without opening the file.
5959+6060+### Writing the reason
6161+6262+The reason should be substantive — not "we don't want this" but why. Good reasons reference:
6363+6464+- Project scope or philosophy ("This project focuses on X; theming is a downstream concern")
6565+- Technical constraints ("Supporting this would require Y, which conflicts with our Z architecture")
6666+- Strategic decisions ("We chose to use A instead of B because...")
6767+6868+The reason should be durable. Avoid referencing temporary circumstances ("we're too busy right now") — those aren't real rejections, they're deferrals.
6969+7070+## When to check `.out-of-scope/`
7171+7272+During triage (Step 1: Gather context), read all files in `.out-of-scope/`. When evaluating a new issue:
7373+7474+- Check if the request matches an existing out-of-scope concept
7575+- Matching is by concept similarity, not keyword — "night theme" matches `dark-mode.md`
7676+- If there's a match, surface it to the maintainer: "This is similar to `.out-of-scope/dark-mode.md` — we rejected this before because [reason]. Do you still feel the same way?"
7777+7878+The maintainer may:
7979+8080+- **Confirm** — the new issue gets added to the existing file's "Prior requests" list, then closed
8181+- **Reconsider** — the out-of-scope file gets deleted or updated, and the issue proceeds through normal triage
8282+- **Disagree** — the issues are related but distinct, proceed with normal triage
8383+8484+## When to write to `.out-of-scope/`
8585+8686+Only when an **enhancement** (not a bug) is *rejected* as `wontfix`. This applies to enhancement PRs exactly as it does to issues — a rejected PR is recorded here so the same request doesn't return as fresh code.
8787+8888+Do **not** write here when something is closed as `wontfix` because it's **already implemented**. That's a built feature, not a rejected one; recording it would poison the dedup checks with false rejections. Instead, the closing comment points to where the feature already lives.
8989+9090+The flow:
9191+9292+1. Maintainer decides a feature request is out of scope
9393+2. Check if a matching `.out-of-scope/` file already exists
9494+3. If yes: append the new issue to the "Prior requests" list
9595+4. If no: create a new file with the concept name, decision, reason, and first prior request
9696+5. Post a comment on the issue explaining the decision and mentioning the `.out-of-scope/` file
9797+6. Close the issue with the `wontfix` label
9898+9999+## Updating or removing out-of-scope files
100100+101101+If the maintainer changes their mind about a previously rejected concept:
102102+103103+- Delete the `.out-of-scope/` file
104104+- The skill does not need to reopen old issues — they're historical records
105105+- The new issue that triggered the reconsideration proceeds through normal triage
+112
.agents/skills/triage/SKILL.md
···11+---
22+name: triage
33+description: Move issues and external PRs through a state machine of triage roles — categorise, verify, grill if needed, and write agent-ready briefs.
44+disable-model-invocation: true
55+---
66+77+# Triage
88+99+Move issues on the project issue tracker through a small state machine of triage roles.
1010+1111+If this repo treats external pull requests as a request surface (see the issue-tracker config), triage covers them too: **a PR is an issue with attached code** — same roles, same states, same machine, with a few deltas marked "for a PR" below. Resolve a bare `#42` to an issue or PR per the tracker config.
1212+1313+Every comment or issue posted to the issue tracker during triage **must** start with this disclaimer:
1414+1515+```
1616+> *This was generated by AI during triage.*
1717+```
1818+1919+## Reference docs
2020+2121+- [AGENT-BRIEF.md](AGENT-BRIEF.md) — how to write durable agent briefs
2222+- [OUT-OF-SCOPE.md](OUT-OF-SCOPE.md) — how the `.out-of-scope/` knowledge base works
2323+2424+## Roles
2525+2626+Two **category** roles:
2727+2828+- `bug` — something is broken
2929+- `enhancement` — new feature or improvement
3030+3131+Five **state** roles:
3232+3333+- `needs-triage` — maintainer needs to evaluate
3434+- `needs-info` — waiting on reporter for more information
3535+- `ready-for-agent` — fully specified, ready for an AFK agent
3636+- `ready-for-human` — needs human implementation
3737+- `wontfix` — will not be actioned
3838+3939+For a PR, the same states read against the attached code: `ready-for-agent` means a brief is attached and an agent should take the next step on the diff; `ready-for-human` means it's ready for a human to merge.
4040+4141+Every triaged issue should carry exactly one category role and one state role. If state roles conflict, flag it and ask the maintainer before doing anything else.
4242+4343+These are canonical role names — the actual label strings used in the issue tracker may differ. The mapping should have been provided to you - run `/setup-matt-pocock-skills` if not.
4444+4545+State transitions: an unlabeled issue normally goes to `needs-triage` first; from there it moves to `needs-info`, `ready-for-agent`, `ready-for-human`, or `wontfix`. `needs-info` returns to `needs-triage` once the reporter replies. The maintainer can override at any time — flag transitions that look unusual and ask before proceeding.
4646+4747+## Invocation
4848+4949+The maintainer invokes `/triage` and describes what they want in natural language. Interpret the request and act. Examples:
5050+5151+- "Show me anything that needs my attention"
5252+- "Let's look at #42" (issue or PR)
5353+- "Move #42 to ready-for-agent"
5454+- "What's ready for agents to pick up?"
5555+5656+## Show what needs attention
5757+5858+Query the issue tracker and present three buckets, oldest first:
5959+6060+1. **Unlabeled** — never triaged.
6161+2. **`needs-triage`** — evaluation in progress.
6262+3. **`needs-info` with reporter activity since the last triage notes** — needs re-evaluation.
6363+6464+When PRs are in scope, include external PRs in these buckets and tag each line `[PR]` or `[issue]`. Discovery surfaces only *external* PRs (the tracker config defines who counts as external) — a collaborator's in-flight PR is not triage work. This filter is discovery-only; an explicitly named PR is always triaged regardless of author.
6565+6666+Show counts and a one-line summary per item. Let the maintainer pick.
6767+6868+## Triage a specific issue or PR
6969+7070+1. **Gather context.** Read the full issue or PR (body, comments, labels, author, dates; for a PR, the diff too). Parse any prior triage notes so you don't re-ask resolved questions. Explore the codebase using the project's domain glossary, respecting ADRs in the area. Run two checks against the codebase: (a) **redundancy** — search for an existing implementation of the requested behavior by domain concept (not just the request's wording), and report where you looked. If found, it's an already-implemented `wontfix` (step 5). (b) **prior rejection** — read `.out-of-scope/*.md` and surface any that resembles this request.
7171+7272+2. **Recommend.** Tell the maintainer your category and state recommendation with reasoning, plus a brief codebase summary relevant to the request — including whether it's already implemented. Wait for direction.
7373+7474+3. **Verify the claim.** Before any grilling, check that the claim holds up. For a bug, reproduce it from the reporter's steps. For a PR, confirm the diff does what it claims — check it out, run the relevant tests or commands. Report what happened: confirmed (with code path), failed, or insufficient detail (a strong `needs-info` signal). A confirmed verification makes a much stronger agent brief.
7575+7676+4. **Grill (if needed).** If the request needs fleshing out, run the `/grilling` and `/domain-modeling` skills together — grill it into shape one question at a time, sharpening domain terms and updating `CONTEXT.md`/ADRs inline as decisions land.
7777+7878+5. **Apply the outcome:**
7979+ - `ready-for-agent` — post an agent brief comment ([AGENT-BRIEF.md](AGENT-BRIEF.md)).
8080+ - `ready-for-human` — same structure as an agent brief, but note why it can't be delegated (judgment calls, external access, design decisions, manual testing).
8181+ - `needs-info` — post triage notes (template below).
8282+ - `wontfix` — close, with the comment depending on *why*:
8383+ - **Already implemented** — the change already exists in the codebase. Point to where it lives; do **not** write to `.out-of-scope/` (that KB is for *rejected* requests, not built ones).
8484+ - **Rejected (bug)** — polite explanation, then close.
8585+ - **Rejected (enhancement)** — write to `.out-of-scope/`, link to it from a comment, then close ([OUT-OF-SCOPE.md](OUT-OF-SCOPE.md)).
8686+ - `needs-triage` — apply the role. Optional comment if there's partial progress.
8787+8888+## Quick state override
8989+9090+If the maintainer says "move #42 to ready-for-agent", trust them and apply the role directly. Confirm what you're about to do (role changes, comment, close), then act. Skip grilling. If moving to `ready-for-agent` without a grilling session, ask whether they want to write an agent brief.
9191+9292+## Needs-info template
9393+9494+```markdown
9595+## Triage Notes
9696+9797+**What we've established so far:**
9898+9999+- point 1
100100+- point 2
101101+102102+**What we still need from you (@reporter):**
103103+104104+- question 1
105105+- question 2
106106+```
107107+108108+Capture everything resolved during grilling under "established so far" so the work isn't lost. Questions must be specific and actionable, not "please provide more info".
109109+110110+## Resuming a previous session
111111+112112+If prior triage notes exist on the issue or PR, read them, check whether the reporter has answered any outstanding questions, and present an updated picture before continuing. Don't re-ask resolved questions.
+126
.agents/skills/wayfinder/SKILL.md
···11+---
22+name: wayfinder
33+description: Plan a huge chunk of work — more than one agent session can hold — as a shared map of investigation tickets on your issue tracker, and resolve them one at a time until the way to the destination is clear.
44+---
55+66+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 skill charts the way as a **shared map** on the repo's issue tracker, then works its tickets one at a time until the route is clear.
77+88+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.
99+1010+## Plan, don't do
1111+1212+Wayfinder is **planning** by default: each ticket resolves a decision, and the map is done when the way is clear — nothing left to decide before someone goes and does the thing. The pull to just do the work is usually the signal you've reached the edge of the map and it's time to hand off. An effort can override this in its **Notes** — carrying execution into the map itself — but absent that, produce decisions, not deliverables.
1313+1414+## Refer by name
1515+1616+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.
1717+1818+## The Map
1919+2020+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.
2121+2222+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.
2323+2424+**Where the map, its child tickets, blocking, and frontier queries physically live is tracker-specific.** Consult `docs/agents/issue-tracker.md` (the "Wayfinding operations" section) for how _this_ repo expresses them. If that doc is absent, default to the local-markdown tracker.
2525+2626+### The map body
2727+2828+The whole map at low resolution, loaded once per session. Open tickets are **not** listed — they are open child issues, found by query.
2929+3030+```markdown
3131+## Destination
3232+3333+<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.>
3434+3535+## Notes
3636+3737+<domain; skills every session should consult; standing preferences for this effort>
3838+3939+## Decisions so far
4040+4141+<!-- the index — one line per closed ticket: enough to judge relevance, then zoom the link for the detail the ticket holds -->
4242+4343+- [<closed ticket title>](link) — <one-line gist of the answer>
4444+4545+## Not yet specified
4646+4747+<!-- see "Fog of war": in-scope fog you can't ticket yet; graduates as the frontier advances -->
4848+4949+## Out of scope
5050+5151+<!-- see "Out of scope": work ruled beyond the destination; closed, never graduates -->
5252+```
5353+5454+### Tickets
5555+5656+Each ticket is a **child issue** of the map; the tracker's issue id is its identity. Its body is the question, sized to one 100K token agent session:
5757+5858+```markdown
5959+## Question
6060+6161+<the decision or investigation this ticket resolves>
6262+```
6363+6464+Each ticket carries a `wayfinder:<type>` label — one of `research`, `prototype`, `grilling`, `task` (see [Ticket Types](#ticket-types)).
6565+6666+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.
6767+6868+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.
6969+7070+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.
7171+7272+## Ticket Types
7373+7474+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).
7575+7676+- **Research** (AFK): Reading documentation, third-party APIs, or local resources like knowledge bases. Creates a markdown summary as a linked asset. Use when knowledge outside the current working directory is required.
7777+- **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 via the /prototype skill. Links the prototype as an asset. Use when "how should it look" or "how should it behave" is the key question.
7878+- **Grilling** (HITL): Conversation via the /grilling and /domain-modeling skills, one question at a time. The default case.
7979+- **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.
8080+8181+## Fog of war
8282+8383+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.
8484+8585+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.
8686+8787+**Fog or ticket?** The test is whether you can state the question precisely now — _not_ whether you can answer it now.
8888+8989+- **Ticket when** the question is already sharp — even if it's blocked and you can't act on it yet.
9090+- **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.
9191+9292+**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).
9393+9494+## Out of scope
9595+9696+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.
9797+9898+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.
9999+100100+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.
101101+102102+## Invocation
103103+104104+Two modes. Either way, **never resolve more than one ticket per session.**
105105+106106+### Chart the map
107107+108108+User invokes with a loose idea.
109109+110110+1. **Name the destination.** Run a `/grilling` and `/domain-modeling` 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.
111111+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 and ask the user how they'd like to proceed.
112112+3. **Create the map** (label `wayfinder:map`): Destination and Notes filled in, Decisions-so-far empty, the fog sketched into **Not yet specified**.
113113+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.
114114+5. Stop — charting the map is one session's work; do not also resolve tickets.
115115+116116+### Work through the map
117117+118118+User invokes with a map (URL or number). A ticket is **optional** — without one, you pick the next decision, not the user.
119119+120120+1. Load the **map** — the low-res view, not every ticket body.
121121+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.
122122+3. Resolve it — **zoom as needed**: fetch the full body of any related or closed ticket on demand; invoke the skills the `## Notes` block names. If in doubt, use `/grilling` and `/domain-modeling`.
123123+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.
124124+5. Add newly-surfaced tickets (create-then-wire); graduate any fog the answer has made specifiable, clearing each graduated patch from **Not yet specified** so it lives only as its new ticket. If the answer reveals a ticket — this one or another — sits beyond the destination, **rule it out of scope** rather than resolving it on the route. If the decision invalidates other parts of the map, update or delete those tickets.
125125+126126+The user may run unblocked tickets in parallel, so expect other sessions to be editing the tracker concurrently.
···1010## Dev environment tips
1111If `DEVENV_ROOT` env variable is defined, just run project binaries (they are available).
1212If not, run them by prefixing with `devenv shell ...`
1313+1414+## Agent skills
1515+1616+### Issue tracker
1717+1818+Issues and pull requests are tracked on Tangled using the `tang` CLI; pull requests are also available at `https://tangled.org/mykiwi.dev/rssbase.io/pulls`. See `docs/agents/issue-tracker.md`.
1919+2020+### Triage labels
2121+2222+Use the default five-label triage vocabulary: `needs-triage`, `needs-info`, `ready-for-agent`, `ready-for-human`, `wontfix`. See `docs/agents/triage-labels.md`.
2323+2424+### Domain docs
2525+2626+Single-context domain docs: read root `CONTEXT.md`; ADRs live in `docs/architecture/decisions/` following the Diátaxis-inspired docs structure. See `docs/agents/domain.md`.
+17
docs/README.md
···11+# Documentation
22+33+This repo uses a Diátaxis-inspired documentation structure.
44+55+- **Tutorials** teach by walking through a learning path.
66+- **How-to guides** solve a specific practical problem.
77+- **Reference** records facts, options, APIs, commands, and configuration.
88+- **Explanation** gives background, reasoning, architecture, and trade-offs.
99+1010+## Structure
1111+1212+- `docs/agents/` — configuration consumed by agent skills.
1313+- `docs/architecture/explanation/` — architectural background and system explanations.
1414+- `docs/architecture/decisions/` — architectural decision records, named like `0001-use-atproto-for-user-data.md`.
1515+- `docs/development/how-to/` — developer task recipes.
1616+- `docs/development/reference/` — developer reference material.
1717+- `docs/product/explanation/` — product and domain explanations.
+44
docs/agents/domain.md
···11+# Domain Docs
22+33+How the engineering skills should consume this repo's domain documentation when exploring the codebase.
44+55+## Layout
66+77+This repo uses a single-context domain documentation layout.
88+99+## Before exploring, read these
1010+1111+- **`CONTEXT.md`** at the repo root, if it exists.
1212+- Architectural decision docs, if they exist.
1313+1414+If any of these files don't exist, proceed silently. Don't flag their absence; don't suggest creating them upfront.
1515+1616+## Documentation structure
1717+1818+This repo uses a Diátaxis-inspired documentation structure under `docs/`:
1919+2020+- `docs/architecture/explanation/` — architectural background and reasoning.
2121+- `docs/architecture/decisions/` — architectural decision records.
2222+- `docs/development/how-to/` — goal-oriented developer recipes.
2323+- `docs/development/reference/` — developer reference material.
2424+- `docs/product/explanation/` — product and domain explanations.
2525+2626+## ADR location
2727+2828+Architectural decision records live in `docs/architecture/decisions/`.
2929+3030+Use classic numbered ADR filenames, for example:
3131+3232+```text
3333+0001-use-atproto-for-user-data.md
3434+```
3535+3636+## Use the glossary's vocabulary
3737+3838+When your output names a domain concept, use the term as defined in `CONTEXT.md`. Don't drift to synonyms the glossary explicitly avoids.
3939+4040+If the concept you need isn't in the glossary yet, either reconsider the language or note the gap for future domain modeling.
4141+4242+## Flag ADR conflicts
4343+4444+If your output contradicts an existing architectural decision, surface it explicitly rather than silently overriding.
+31
docs/agents/issue-tracker.md
···11+# Issue tracker: Tangled
22+33+Issues and PRDs for this repo live as Tangled issues. Use the `tang` CLI for issue operations.
44+55+Pull requests are also managed through Tangled. Use the `tang` CLI when possible, and the web UI at <https://tangled.org/mykiwi.dev/rssbase.io/pulls> when needed.
66+77+## Conventions
88+99+- Inspect available commands with `tang --help`, `tang issue --help`, and `tang pr --help` before using a workflow for the first time.
1010+- Use `tang issue list` to list issues.
1111+- Use `tang issue create` to create issues.
1212+- Use `tang issue view` or the closest available command to read an issue and comments.
1313+- Use `tang issue comment`, `tang issue edit`, or the closest available command to update issues, labels, and comments.
1414+- Use `tang pr list`, `tang pr view`, `tang pr create`, or the closest available commands for pull request workflows.
1515+- Prefer the repository inferred from the current git remote: `git@tangled.org:mykiwi.dev/rssbase.io`.
1616+1717+Command names and flags may vary with the installed `tang` version. Verify with help output before writing.
1818+1919+## When a skill says "publish to the issue tracker"
2020+2121+Create a Tangled issue using `tang issue create`.
2222+2323+## When a skill says "fetch the relevant ticket"
2424+2525+Read the Tangled issue using `tang issue view` or the current equivalent from `tang issue --help`.
2626+2727+## Pull requests as a triage surface
2828+2929+Pull requests are available through Tangled using the `tang` CLI or the web UI at <https://tangled.org/mykiwi.dev/rssbase.io/pulls>.
3030+3131+Treat pull requests as related repo work, but prefer Tangled issues as the main request surface unless a skill or maintainer explicitly asks to triage PRs.
+13
docs/agents/triage-labels.md
···11+# Triage Labels
22+33+The skills speak in terms of five canonical triage roles. This file maps those roles to the actual label strings used in this repo's issue tracker.
44+55+| Label in mattpocock/skills | Label in our tracker | Meaning |
66+| -------------------------- | -------------------- | ---------------------------------------- |
77+| `needs-triage` | `needs-triage` | Maintainer needs to evaluate this issue |
88+| `needs-info` | `needs-info` | Waiting on reporter for more information |
99+| `ready-for-agent` | `ready-for-agent` | Fully specified, ready for an AFK agent |
1010+| `ready-for-human` | `ready-for-human` | Requires human implementation |
1111+| `wontfix` | `wontfix` | Will not be actioned |
1212+1313+When a skill mentions a role, use the corresponding label string from this table.
+6
docs/architecture/README.md
···11+# Architecture
22+33+Architecture documentation for RSSBase.
44+55+- `explanation/` contains background, diagrams, trade-offs, and system-level reasoning.
66+- `decisions/` contains architectural decision records.
+12
docs/architecture/decisions/README.md
···11+# Architectural Decision Records
22+33+Architectural decision records live here.
44+55+Use classic numbered filenames:
66+77+```text
88+0001-use-atproto-for-user-data.md
99+0002-choose-feed-fetching-strategy.md
1010+```
1111+1212+Each decision should explain the context, decision, consequences, and any alternatives considered.
+3
docs/architecture/explanation/README.md
···11+# Architecture Explanation
22+33+Use this directory for understanding-oriented architecture docs: system overviews, trade-offs, diagrams, constraints, and background reasoning.
+3
docs/development/how-to/README.md
···11+# Development How-to Guides
22+33+Use this directory for goal-oriented developer recipes, such as running a task, debugging a workflow, releasing, or operating a local service.
+3
docs/development/reference/README.md
···11+# Development Reference
22+33+Use this directory for information-oriented developer reference: commands, configuration, environment variables, APIs, schemas, and operational facts.
+3
docs/product/explanation/README.md
···11+# Product Explanation
22+33+Use this directory for product and domain explanations: what RSSBase is, user concepts, domain language, and product trade-offs.