@heihei0299/matt-skills 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/skills/ask-matt/SKILL.md +78 -0
- package/.agents/skills/ask-matt/agents/openai.yaml +5 -0
- package/.agents/skills/code-review/SKILL.md +94 -0
- package/.agents/skills/code-review/agents/openai.yaml +3 -0
- package/.agents/skills/codebase-design/DEEPENING.md +37 -0
- package/.agents/skills/codebase-design/DESIGN-IT-TWICE.md +44 -0
- package/.agents/skills/codebase-design/SKILL.md +114 -0
- package/.agents/skills/codebase-design/agents/openai.yaml +3 -0
- package/.agents/skills/commit-check/SKILL.md +65 -0
- package/.agents/skills/commit-check/agents/openai.yaml +5 -0
- package/.agents/skills/commit-check/scripts/scan-sensitive.sh +36 -0
- package/.agents/skills/diagnose-fix/SKILL.md +66 -0
- package/.agents/skills/diagnose-fix/agents/openai.yaml +5 -0
- package/.agents/skills/diagnose-fix/references/anti-patterns.md +20 -0
- package/.agents/skills/diagnosing-bugs/SKILL.md +134 -0
- package/.agents/skills/diagnosing-bugs/agents/openai.yaml +3 -0
- package/.agents/skills/diagnosing-bugs/scripts/hitl-loop.template.sh +41 -0
- package/.agents/skills/domain-modeling/ADR-FORMAT.md +47 -0
- package/.agents/skills/domain-modeling/CONTEXT-FORMAT.md +60 -0
- package/.agents/skills/domain-modeling/SKILL.md +74 -0
- package/.agents/skills/domain-modeling/agents/openai.yaml +3 -0
- package/.agents/skills/grill-me/SKILL.md +7 -0
- package/.agents/skills/grill-me/agents/openai.yaml +5 -0
- package/.agents/skills/grill-to-spec/SKILL.md +83 -0
- package/.agents/skills/grill-to-spec/agents/openai.yaml +5 -0
- package/.agents/skills/grill-to-spec/references/rules.md +33 -0
- package/.agents/skills/grill-with-docs/SKILL.md +7 -0
- package/.agents/skills/grill-with-docs/agents/openai.yaml +5 -0
- package/.agents/skills/grilling/SKILL.md +12 -0
- package/.agents/skills/grilling/agents/openai.yaml +3 -0
- package/.agents/skills/handoff/SKILL.md +16 -0
- package/.agents/skills/handoff/agents/openai.yaml +5 -0
- package/.agents/skills/implement/SKILL.md +15 -0
- package/.agents/skills/implement/agents/openai.yaml +5 -0
- package/.agents/skills/improve-codebase-architecture/HTML-REPORT.md +123 -0
- package/.agents/skills/improve-codebase-architecture/SKILL.md +71 -0
- package/.agents/skills/improve-codebase-architecture/agents/openai.yaml +5 -0
- package/.agents/skills/prototype/LOGIC.md +79 -0
- package/.agents/skills/prototype/SKILL.md +26 -0
- package/.agents/skills/prototype/UI.md +112 -0
- package/.agents/skills/prototype/agents/openai.yaml +3 -0
- package/.agents/skills/research/SKILL.md +12 -0
- package/.agents/skills/research/agents/openai.yaml +3 -0
- package/.agents/skills/resolving-merge-conflicts/SKILL.md +14 -0
- package/.agents/skills/resolving-merge-conflicts/agents/openai.yaml +3 -0
- package/.agents/skills/setup-matt-pocock-skills/SKILL.md +116 -0
- package/.agents/skills/setup-matt-pocock-skills/agents/openai.yaml +5 -0
- package/.agents/skills/setup-matt-pocock-skills/domain.md +51 -0
- package/.agents/skills/setup-matt-pocock-skills/issue-tracker-github.md +45 -0
- package/.agents/skills/setup-matt-pocock-skills/issue-tracker-gitlab.md +46 -0
- package/.agents/skills/setup-matt-pocock-skills/issue-tracker-local.md +30 -0
- package/.agents/skills/setup-matt-pocock-skills/triage-labels.md +15 -0
- package/.agents/skills/tdd/SKILL.md +36 -0
- package/.agents/skills/tdd/agents/openai.yaml +3 -0
- package/.agents/skills/tdd/mocking.md +59 -0
- package/.agents/skills/tdd/tests.md +77 -0
- package/.agents/skills/tdd-implement/SKILL.md +143 -0
- package/.agents/skills/tdd-implement/agents/openai.yaml +5 -0
- package/.agents/skills/tdd-implement/references/stages.md +315 -0
- package/.agents/skills/teach/GLOSSARY-FORMAT.md +35 -0
- package/.agents/skills/teach/LEARNING-RECORD-FORMAT.md +46 -0
- package/.agents/skills/teach/MISSION-FORMAT.md +31 -0
- package/.agents/skills/teach/RESOURCES-FORMAT.md +32 -0
- package/.agents/skills/teach/SKILL.md +140 -0
- package/.agents/skills/teach/agents/openai.yaml +5 -0
- package/.agents/skills/to-spec/SKILL.md +75 -0
- package/.agents/skills/to-spec/agents/openai.yaml +5 -0
- package/.agents/skills/to-tickets/SKILL.md +105 -0
- package/.agents/skills/to-tickets/agents/openai.yaml +5 -0
- package/.agents/skills/triage/AGENT-BRIEF.md +207 -0
- package/.agents/skills/triage/OUT-OF-SCOPE.md +105 -0
- package/.agents/skills/triage/SKILL.md +112 -0
- package/.agents/skills/triage/agents/openai.yaml +5 -0
- package/.agents/skills/wayfinder/SKILL.md +128 -0
- package/.agents/skills/wayfinder/agents/openai.yaml +5 -0
- package/.agents/skills/writing-great-skills/GLOSSARY.md +201 -0
- package/.agents/skills/writing-great-skills/SKILL.md +83 -0
- package/.agents/skills/writing-great-skills/agents/openai.yaml +5 -0
- package/LICENSE +21 -0
- package/README.md +167 -0
- package/bin/cli.js +353 -0
- package/package.json +26 -0
- package/template/.opencode/CONTEXT.md +47 -0
- package/template/.opencode/agents/issue-audit.md +52 -0
- package/template/.opencode/commands/grill-to-spec.md +13 -0
- package/template/.opencode/commands/handoff.md +12 -0
- package/template/.opencode/commands/improve-codebase-architecture.md +13 -0
- package/template/.opencode/commands/issue-audit.md +115 -0
- package/template/.opencode/commands/teach.md +12 -0
- package/template/.opencode/commands/to-spec.md +13 -0
- package/template/.opencode/commands/to-tickets.md +12 -0
- package/template/.opencode/commands/triage.md +12 -0
- package/template/.opencode/commands/wayfinder.md +13 -0
- package/template/.opencode/commands/writing-great-skills.md +12 -0
- package/template/.opencode/docs/agents/domain.md +51 -0
- package/template/.opencode/docs/agents/issue-tracker.md +30 -0
- package/template/.opencode/docs/agents/runtime-discipline.md +36 -0
- package/template/.opencode/docs/agents/skill-design.md +32 -0
- package/template/.opencode/docs/agents/triage-labels.md +15 -0
- package/template/.opencode/skills/commit-check/SKILL.md +65 -0
- package/template/.opencode/skills/commit-check/agents/openai.yaml +5 -0
- package/template/.opencode/skills/commit-check/scripts/scan-sensitive.sh +36 -0
- package/template/.opencode/skills/diagnose-fix/SKILL.md +66 -0
- package/template/.opencode/skills/diagnose-fix/agents/openai.yaml +5 -0
- package/template/.opencode/skills/diagnose-fix/references/anti-patterns.md +20 -0
- package/template/.opencode/skills/grill-to-spec/SKILL.md +83 -0
- package/template/.opencode/skills/grill-to-spec/agents/openai.yaml +5 -0
- package/template/.opencode/skills/grill-to-spec/references/rules.md +33 -0
- package/template/.opencode/skills/tdd-implement/SKILL.md +143 -0
- package/template/.opencode/skills/tdd-implement/agents/openai.yaml +5 -0
- package/template/.opencode/skills/tdd-implement/references/stages.md +315 -0
- package/template/.pi/agents/issue-audit.md +52 -0
- package/template/.pi/docs/agents/domain.md +51 -0
- package/template/.pi/docs/agents/issue-tracker.md +30 -0
- package/template/.pi/docs/agents/runtime-discipline.md +36 -0
- package/template/.pi/docs/agents/skill-design.md +32 -0
- package/template/.pi/docs/agents/triage-labels.md +15 -0
- package/template/.pi/prompts/issue-audit.md +114 -0
- package/template/.pi/skills/commit-check/SKILL.md +65 -0
- package/template/.pi/skills/commit-check/agents/openai.yaml +5 -0
- package/template/.pi/skills/commit-check/scripts/scan-sensitive.sh +36 -0
- package/template/.pi/skills/diagnose-fix/SKILL.md +66 -0
- package/template/.pi/skills/diagnose-fix/agents/openai.yaml +5 -0
- package/template/.pi/skills/diagnose-fix/references/anti-patterns.md +20 -0
- package/template/.pi/skills/grill-to-spec/SKILL.md +83 -0
- package/template/.pi/skills/grill-to-spec/agents/openai.yaml +5 -0
- package/template/.pi/skills/grill-to-spec/references/rules.md +33 -0
- package/template/.pi/skills/tdd-implement/SKILL.md +143 -0
- package/template/.pi/skills/tdd-implement/agents/openai.yaml +5 -0
- package/template/.pi/skills/tdd-implement/references/stages.md +315 -0
- package/template/AGENTS.md +59 -0
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: diagnosing-bugs
|
|
3
|
+
description: Diagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports something broken/throwing/failing/slow.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Diagnosing Bugs
|
|
7
|
+
|
|
8
|
+
A discipline for hard bugs. Skip phases only when explicitly justified.
|
|
9
|
+
|
|
10
|
+
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.
|
|
11
|
+
|
|
12
|
+
## Phase 1 — Build a feedback loop
|
|
13
|
+
|
|
14
|
+
**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.
|
|
15
|
+
|
|
16
|
+
Spend disproportionate effort here. **Be aggressive. Be creative. Refuse to give up.**
|
|
17
|
+
|
|
18
|
+
### Ways to construct one — try them in roughly this order
|
|
19
|
+
|
|
20
|
+
1. **Failing test** at whatever seam reaches the bug — unit, integration, e2e.
|
|
21
|
+
2. **Curl / HTTP script** against a running dev server.
|
|
22
|
+
3. **CLI invocation** with a fixture input, diffing stdout against a known-good snapshot.
|
|
23
|
+
4. **Headless browser script** (Playwright / Puppeteer) — drives the UI, asserts on DOM/console/network.
|
|
24
|
+
5. **Replay a captured trace.** Save a real network request / payload / event log to disk; replay it through the code path in isolation.
|
|
25
|
+
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.
|
|
26
|
+
7. **Property / fuzz loop.** If the bug is "sometimes wrong output", run 1000 random inputs and look for the failure mode.
|
|
27
|
+
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.
|
|
28
|
+
9. **Differential loop.** Run the same input through old-version vs new-version (or two configs) and diff outputs.
|
|
29
|
+
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.
|
|
30
|
+
|
|
31
|
+
Build the right feedback loop, and the bug is 90% fixed.
|
|
32
|
+
|
|
33
|
+
### Tighten the loop
|
|
34
|
+
|
|
35
|
+
Treat the loop as a product. Once you have _a_ loop, **tighten** it:
|
|
36
|
+
|
|
37
|
+
- Can I make it faster? (Cache setup, skip unrelated init, narrow the test scope.)
|
|
38
|
+
- Can I make the signal sharper? (Assert on the specific symptom, not "didn't crash".)
|
|
39
|
+
- Can I make it more deterministic? (Pin time, seed RNG, isolate filesystem, freeze network.)
|
|
40
|
+
|
|
41
|
+
A 30-second flaky loop is barely better than no loop; a 2-second deterministic one is tight — a debugging superpower.
|
|
42
|
+
|
|
43
|
+
### Non-deterministic bugs
|
|
44
|
+
|
|
45
|
+
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.
|
|
46
|
+
|
|
47
|
+
### When you genuinely cannot build a loop
|
|
48
|
+
|
|
49
|
+
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.
|
|
50
|
+
|
|
51
|
+
### Completion criterion — a tight loop that goes red
|
|
52
|
+
|
|
53
|
+
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:
|
|
54
|
+
|
|
55
|
+
- [ ] **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_.
|
|
56
|
+
- [ ] **Deterministic** — same verdict every run (flaky bugs: a pinned, high reproduction rate, per above).
|
|
57
|
+
- [ ] **Fast** — seconds, not minutes.
|
|
58
|
+
- [ ] **Agent-runnable** — you can run it unattended; a human in the loop only via `scripts/hitl-loop.template.sh`.
|
|
59
|
+
|
|
60
|
+
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.
|
|
61
|
+
|
|
62
|
+
## Phase 2 — Reproduce + minimise
|
|
63
|
+
|
|
64
|
+
Run the loop. Watch it go red — the bug appears.
|
|
65
|
+
|
|
66
|
+
Confirm:
|
|
67
|
+
|
|
68
|
+
- [ ] The loop produces the failure mode the **user** described — not a different failure that happens to be nearby. Wrong bug = wrong fix.
|
|
69
|
+
- [ ] The failure is reproducible across multiple runs (or, for non-deterministic bugs, reproducible at a high enough rate to debug against).
|
|
70
|
+
- [ ] You have captured the exact symptom (error message, wrong output, slow timing) so later phases can verify the fix actually addresses it.
|
|
71
|
+
|
|
72
|
+
### Minimise
|
|
73
|
+
|
|
74
|
+
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.
|
|
75
|
+
|
|
76
|
+
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.
|
|
77
|
+
|
|
78
|
+
Done when **every remaining element is load-bearing** — removing any one of them makes the loop go green.
|
|
79
|
+
|
|
80
|
+
Do not proceed until you have reproduced **and** minimised.
|
|
81
|
+
|
|
82
|
+
## Phase 3 — Hypothesise
|
|
83
|
+
|
|
84
|
+
Generate **3–5 ranked hypotheses** before testing any of them. Single-hypothesis generation anchors on the first plausible idea.
|
|
85
|
+
|
|
86
|
+
Each hypothesis must be **falsifiable**: state the prediction it makes.
|
|
87
|
+
|
|
88
|
+
> Format: "If <X> is the cause, then <changing Y> will make the bug disappear / <changing Z> will make it worse."
|
|
89
|
+
|
|
90
|
+
If you cannot state the prediction, the hypothesis is a vibe — discard or sharpen it.
|
|
91
|
+
|
|
92
|
+
**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.
|
|
93
|
+
|
|
94
|
+
## Phase 4 — Instrument
|
|
95
|
+
|
|
96
|
+
Each probe must map to a specific prediction from Phase 3. **Change one variable at a time.**
|
|
97
|
+
|
|
98
|
+
Tool preference:
|
|
99
|
+
|
|
100
|
+
1. **Debugger / REPL inspection** if the env supports it. One breakpoint beats ten logs.
|
|
101
|
+
2. **Targeted logs** at the boundaries that distinguish hypotheses.
|
|
102
|
+
3. Never "log everything and grep".
|
|
103
|
+
|
|
104
|
+
**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.
|
|
105
|
+
|
|
106
|
+
**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.
|
|
107
|
+
|
|
108
|
+
## Phase 5 — Fix + regression test
|
|
109
|
+
|
|
110
|
+
Write the regression test **before the fix** — but only if there is a **correct seam** for it.
|
|
111
|
+
|
|
112
|
+
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.
|
|
113
|
+
|
|
114
|
+
**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.
|
|
115
|
+
|
|
116
|
+
If a correct seam exists:
|
|
117
|
+
|
|
118
|
+
1. Turn the minimised repro into a failing test at that seam.
|
|
119
|
+
2. Watch it fail.
|
|
120
|
+
3. Apply the fix.
|
|
121
|
+
4. Watch it pass.
|
|
122
|
+
5. Re-run the Phase 1 feedback loop against the original (un-minimised) scenario.
|
|
123
|
+
|
|
124
|
+
## Phase 6 — Cleanup + post-mortem
|
|
125
|
+
|
|
126
|
+
Required before declaring done:
|
|
127
|
+
|
|
128
|
+
- [ ] Original repro no longer reproduces (re-run the Phase 1 loop)
|
|
129
|
+
- [ ] Regression test passes (or absence of seam is documented)
|
|
130
|
+
- [ ] All `[DEBUG-...]` instrumentation removed (`grep` the prefix)
|
|
131
|
+
- [ ] Throwaway prototypes deleted (or moved to a clearly-marked debug location)
|
|
132
|
+
- [ ] The hypothesis that turned out correct is stated in the commit / PR message — so the next debugger learns
|
|
133
|
+
|
|
134
|
+
**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.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Human-in-the-loop reproduction loop.
|
|
3
|
+
# Copy this file, edit the steps below, and run it.
|
|
4
|
+
# The agent runs the script; the user follows prompts in their terminal.
|
|
5
|
+
#
|
|
6
|
+
# Usage:
|
|
7
|
+
# bash hitl-loop.template.sh
|
|
8
|
+
#
|
|
9
|
+
# Two helpers:
|
|
10
|
+
# step "<instruction>" → show instruction, wait for Enter
|
|
11
|
+
# capture VAR "<question>" → show question, read response into VAR
|
|
12
|
+
#
|
|
13
|
+
# At the end, captured values are printed as KEY=VALUE for the agent to parse.
|
|
14
|
+
|
|
15
|
+
set -euo pipefail
|
|
16
|
+
|
|
17
|
+
step() {
|
|
18
|
+
printf '\n>>> %s\n' "$1"
|
|
19
|
+
read -r -p " [Enter when done] " _
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
capture() {
|
|
23
|
+
local var="$1" question="$2" answer
|
|
24
|
+
printf '\n>>> %s\n' "$question"
|
|
25
|
+
read -r -p " > " answer
|
|
26
|
+
printf -v "$var" '%s' "$answer"
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
# --- edit below ---------------------------------------------------------
|
|
30
|
+
|
|
31
|
+
step "Open the app at http://localhost:3000 and sign in."
|
|
32
|
+
|
|
33
|
+
capture ERRORED "Click the 'Export' button. Did it throw an error? (y/n)"
|
|
34
|
+
|
|
35
|
+
capture ERROR_MSG "Paste the error message (or 'none'):"
|
|
36
|
+
|
|
37
|
+
# --- edit above ---------------------------------------------------------
|
|
38
|
+
|
|
39
|
+
printf '\n--- Captured ---\n'
|
|
40
|
+
printf 'ERRORED=%s\n' "$ERRORED"
|
|
41
|
+
printf 'ERROR_MSG=%s\n' "$ERROR_MSG"
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# ADR Format
|
|
2
|
+
|
|
3
|
+
ADRs live in `docs/adr/` and use sequential numbering: `0001-slug.md`, `0002-slug.md`, etc.
|
|
4
|
+
|
|
5
|
+
Create the `docs/adr/` directory lazily — only when the first ADR is needed.
|
|
6
|
+
|
|
7
|
+
## Template
|
|
8
|
+
|
|
9
|
+
```md
|
|
10
|
+
# {Short title of the decision}
|
|
11
|
+
|
|
12
|
+
{1-3 sentences: what's the context, what did we decide, and why.}
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
That's it. An ADR can be a single paragraph. The value is in recording *that* a decision was made and *why* — not in filling out sections.
|
|
16
|
+
|
|
17
|
+
## Optional sections
|
|
18
|
+
|
|
19
|
+
Only include these when they add genuine value. Most ADRs won't need them.
|
|
20
|
+
|
|
21
|
+
- **Status** frontmatter (`proposed | accepted | deprecated | superseded by ADR-NNNN`) — useful when decisions are revisited
|
|
22
|
+
- **Considered Options** — only when the rejected alternatives are worth remembering
|
|
23
|
+
- **Consequences** — only when non-obvious downstream effects need to be called out
|
|
24
|
+
|
|
25
|
+
## Numbering
|
|
26
|
+
|
|
27
|
+
Scan `docs/adr/` for the highest existing number and increment by one.
|
|
28
|
+
|
|
29
|
+
## When to offer an ADR
|
|
30
|
+
|
|
31
|
+
All three of these must be true:
|
|
32
|
+
|
|
33
|
+
1. **Hard to reverse** — the cost of changing your mind later is meaningful
|
|
34
|
+
2. **Surprising without context** — a future reader will look at the code and wonder "why on earth did they do it this way?"
|
|
35
|
+
3. **The result of a real trade-off** — there were genuine alternatives and you picked one for specific reasons
|
|
36
|
+
|
|
37
|
+
If a decision is easy to reverse, skip it — you'll just reverse it. If it's not surprising, nobody will wonder why. If there was no real alternative, there's nothing to record beyond "we did the obvious thing."
|
|
38
|
+
|
|
39
|
+
### What qualifies
|
|
40
|
+
|
|
41
|
+
- **Architectural shape.** "We're using a monorepo." "The write model is event-sourced, the read model is projected into Postgres."
|
|
42
|
+
- **Integration patterns between contexts.** "Ordering and Billing communicate via domain events, not synchronous HTTP."
|
|
43
|
+
- **Technology choices that carry lock-in.** Database, message bus, auth provider, deployment target. Not every library — just the ones that would take a quarter to swap out.
|
|
44
|
+
- **Boundary and scope decisions.** "Customer data is owned by the Customer context; other contexts reference it by ID only." The explicit no-s are as valuable as the yes-s.
|
|
45
|
+
- **Deliberate deviations from the obvious path.** "We're using manual SQL instead of an ORM because X." Anything where a reasonable reader would assume the opposite. These stop the next engineer from "fixing" something that was deliberate.
|
|
46
|
+
- **Constraints not visible in the code.** "We can't use AWS because of compliance requirements." "Response times must be under 200ms because of the partner API contract."
|
|
47
|
+
- **Rejected alternatives when the rejection is non-obvious.** If you considered GraphQL and picked REST for subtle reasons, record it — otherwise someone will suggest GraphQL again in six months.
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# CONTEXT.md Format
|
|
2
|
+
|
|
3
|
+
## Structure
|
|
4
|
+
|
|
5
|
+
```md
|
|
6
|
+
# {Context Name}
|
|
7
|
+
|
|
8
|
+
{One or two sentence description of what this context is and why it exists.}
|
|
9
|
+
|
|
10
|
+
## Language
|
|
11
|
+
|
|
12
|
+
**Order**:
|
|
13
|
+
{A one or two sentence description of the term}
|
|
14
|
+
_Avoid_: Purchase, transaction
|
|
15
|
+
|
|
16
|
+
**Invoice**:
|
|
17
|
+
A request for payment sent to a customer after delivery.
|
|
18
|
+
_Avoid_: Bill, payment request
|
|
19
|
+
|
|
20
|
+
**Customer**:
|
|
21
|
+
A person or organization that places orders.
|
|
22
|
+
_Avoid_: Client, buyer, account
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Rules
|
|
26
|
+
|
|
27
|
+
- **Be opinionated.** When multiple words exist for the same concept, pick the best one and list the others under `_Avoid_`.
|
|
28
|
+
- **Keep definitions tight.** One or two sentences max. Define what it IS, not what it does.
|
|
29
|
+
- **Only include terms specific to this project's context.** General programming concepts (timeouts, error types, utility patterns) don't belong even if the project uses them extensively. Before adding a term, ask: is this a concept unique to this context, or a general programming concept? Only the former belongs.
|
|
30
|
+
- **Group terms under subheadings** when natural clusters emerge. If all terms belong to a single cohesive area, a flat list is fine.
|
|
31
|
+
|
|
32
|
+
## Single vs multi-context repos
|
|
33
|
+
|
|
34
|
+
**Single context (most repos):** One `CONTEXT.md` at the repo root.
|
|
35
|
+
|
|
36
|
+
**Multiple contexts:** A `CONTEXT-MAP.md` at the repo root lists the contexts, where they live, and how they relate to each other:
|
|
37
|
+
|
|
38
|
+
```md
|
|
39
|
+
# Context Map
|
|
40
|
+
|
|
41
|
+
## Contexts
|
|
42
|
+
|
|
43
|
+
- [Ordering](./src/ordering/CONTEXT.md) — receives and tracks customer orders
|
|
44
|
+
- [Billing](./src/billing/CONTEXT.md) — generates invoices and processes payments
|
|
45
|
+
- [Fulfillment](./src/fulfillment/CONTEXT.md) — manages warehouse picking and shipping
|
|
46
|
+
|
|
47
|
+
## Relationships
|
|
48
|
+
|
|
49
|
+
- **Ordering → Fulfillment**: Ordering emits `OrderPlaced` events; Fulfillment consumes them to start picking
|
|
50
|
+
- **Fulfillment → Billing**: Fulfillment emits `ShipmentDispatched` events; Billing consumes them to generate invoices
|
|
51
|
+
- **Ordering ↔ Billing**: Shared types for `CustomerId` and `Money`
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
The skill infers which structure applies:
|
|
55
|
+
|
|
56
|
+
- If `CONTEXT-MAP.md` exists, read it to find contexts
|
|
57
|
+
- If only a root `CONTEXT.md` exists, single context
|
|
58
|
+
- If neither exists, create a root `CONTEXT.md` lazily when the first term is resolved
|
|
59
|
+
|
|
60
|
+
When multiple contexts exist, infer which one the current topic relates to. If unclear, ask.
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: domain-modeling
|
|
3
|
+
description: Build and sharpen a project's domain model. Use when 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.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Domain Modeling
|
|
7
|
+
|
|
8
|
+
Actively build and sharpen the project's domain model as you design. This is the *active* discipline — challenging terms, inventing edge-case scenarios, and writing the glossary and decisions down the moment they crystallise. (Merely *reading* `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.)
|
|
9
|
+
|
|
10
|
+
## File structure
|
|
11
|
+
|
|
12
|
+
Most repos have a single context:
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
/
|
|
16
|
+
├── CONTEXT.md
|
|
17
|
+
├── docs/
|
|
18
|
+
│ └── adr/
|
|
19
|
+
│ ├── 0001-event-sourced-orders.md
|
|
20
|
+
│ └── 0002-postgres-for-write-model.md
|
|
21
|
+
└── src/
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
If a `CONTEXT-MAP.md` exists at the root, the repo has multiple contexts. The map points to where each one lives:
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
/
|
|
28
|
+
├── CONTEXT-MAP.md
|
|
29
|
+
├── docs/
|
|
30
|
+
│ └── adr/ ← system-wide decisions
|
|
31
|
+
├── src/
|
|
32
|
+
│ ├── ordering/
|
|
33
|
+
│ │ ├── CONTEXT.md
|
|
34
|
+
│ │ └── docs/adr/ ← context-specific decisions
|
|
35
|
+
│ └── billing/
|
|
36
|
+
│ ├── CONTEXT.md
|
|
37
|
+
│ └── docs/adr/
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
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.
|
|
41
|
+
|
|
42
|
+
## During the session
|
|
43
|
+
|
|
44
|
+
### Challenge against the glossary
|
|
45
|
+
|
|
46
|
+
When the user uses a term that conflicts with the existing language in `CONTEXT.md`, call it out immediately. "Your glossary defines 'cancellation' as X, but you seem to mean Y — which is it?"
|
|
47
|
+
|
|
48
|
+
### Sharpen fuzzy language
|
|
49
|
+
|
|
50
|
+
When the user uses vague or overloaded terms, propose a precise canonical term. "You're saying 'account' — do you mean the Customer or the User? Those are different things."
|
|
51
|
+
|
|
52
|
+
### Discuss concrete scenarios
|
|
53
|
+
|
|
54
|
+
When domain relationships are being discussed, stress-test them with specific scenarios. Invent scenarios that probe edge cases and force the user to be precise about the boundaries between concepts.
|
|
55
|
+
|
|
56
|
+
### Cross-reference with code
|
|
57
|
+
|
|
58
|
+
When the user states how something works, check whether the code agrees. If you find a contradiction, surface it: "Your code cancels entire Orders, but you just said partial cancellation is possible — which is right?"
|
|
59
|
+
|
|
60
|
+
### Update CONTEXT.md inline
|
|
61
|
+
|
|
62
|
+
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).
|
|
63
|
+
|
|
64
|
+
`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.
|
|
65
|
+
|
|
66
|
+
### Offer ADRs sparingly
|
|
67
|
+
|
|
68
|
+
Only offer to create an ADR when all three are true:
|
|
69
|
+
|
|
70
|
+
1. **Hard to reverse** — the cost of changing your mind later is meaningful
|
|
71
|
+
2. **Surprising without context** — a future reader will wonder "why did they do it this way?"
|
|
72
|
+
3. **The result of a real trade-off** — there were genuine alternatives and you picked one for specific reasons
|
|
73
|
+
|
|
74
|
+
If any of the three is missing, skip the ADR. Use the format in [ADR-FORMAT.md](./ADR-FORMAT.md).
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: grill-to-spec
|
|
3
|
+
description: "Router:编排 grill-with-docs → to-spec,把模糊想法打磨成可执行 Spec。Use when the user asks to grill/design/polish an idea into a spec——只产出领域文档与 spec,不写代码。"
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Grill to Spec
|
|
8
|
+
|
|
9
|
+
**grill-with-docs**(grilling + domain-modeling)与 **to-spec** 的编排器。本 skill 只做编排:把设计压力测试成共识,把共识综合成 spec 发布——不写代码,不动源码。
|
|
10
|
+
|
|
11
|
+
## 职责
|
|
12
|
+
|
|
13
|
+
| 做 | 不做 |
|
|
14
|
+
|----|------|
|
|
15
|
+
| 编排 `grill-with-docs` → `to-spec` 完整通道 | 不编写代码、不修改任何源码(含测试) |
|
|
16
|
+
| 引导用户从模糊想法 → 结构化 spec | 不拆 tickets(`/to-tickets` 职责) |
|
|
17
|
+
| grilling 逐问挑战、打磨设计 | 不调用 `/code-review` |
|
|
18
|
+
| 同步产出领域文档(glossary inline;ADR 草稿经用户确认后落盘) | 阶段②仅综合,不新增采访 |
|
|
19
|
+
| 综合对话为可执行的 spec 文档并发布 | 不维护已发布的 spec |
|
|
20
|
+
| 产出物仅限领域文档与 spec | 实现与修复交给实现类 skill(如 `/tdd-implement`) |
|
|
21
|
+
|
|
22
|
+
## 流程
|
|
23
|
+
|
|
24
|
+
```text
|
|
25
|
+
① Grill with docs → ② Synthesize to spec
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
① 加载 `/grill-with-docs`:grilling 采访(一次一问、等反馈;决策逐条交由用户定夺)+ domain-modeling 产出 glossary/ADR。出口:用户确认共识达成。
|
|
29
|
+
|
|
30
|
+
① 内 ADR 子流转(与 glossary 的 inline 更新严格区分):
|
|
31
|
+
1. 触发:仅当 domain-modeling 三条件全满足(难逆转 / 无上下文费解 / 真实权衡)才提议 ADR
|
|
32
|
+
2. 草稿:按 ADR-FORMAT 把完整标题+正文展示给用户审阅,等待反馈
|
|
33
|
+
3. 确认:用户显式说「确认/写入」才落盘;用户拒绝则不写、继续访谈;用户要求修改则改草稿重新确认
|
|
34
|
+
4. 未确认前不得创建或写入 `docs/adr/` 下的任何文件
|
|
35
|
+
|
|
36
|
+
② 加载 `/to-spec`:探索代码(glossary 词汇贯穿 spec、尊重相关 ADR)→ 确认 seams(既有优先、最高 seam、理想一个)→ 编写 spec 草稿 → 展示给用户确认(只展示等决定,不新增采访提问)→ 发布到 `.scratch/<feature-slug>/spec.md` 并标 `ready-for-agent`。出口:spec 已发布。
|
|
37
|
+
|
|
38
|
+
## 产出物(格式严格对齐下游技能)
|
|
39
|
+
|
|
40
|
+
本技能产出物仅以下三种,格式以各技能文件为唯一事实源,不在本技能重写:
|
|
41
|
+
|
|
42
|
+
| 产出物 | 位置 | 格式来源 |
|
|
43
|
+
|--------|------|----------|
|
|
44
|
+
| Glossary | `CONTEXT.md`(多上下文:`CONTEXT-MAP.md` + 各上下文 `CONTEXT.md`) | [CONTEXT-FORMAT.md](.agents/skills/domain-modeling/CONTEXT-FORMAT.md) |
|
|
45
|
+
| ADR | `docs/adr/NNNN-slug.md`(多上下文:系统级在根,上下文级在 `src/<ctx>/docs/adr/`) | [ADR-FORMAT.md](.agents/skills/domain-modeling/ADR-FORMAT.md) |
|
|
46
|
+
| Spec | 发布到 issue tracker:`.scratch/<feature-slug>/spec.md` | [to-spec 七节模板](.agents/skills/to-spec/SKILL.md) |
|
|
47
|
+
|
|
48
|
+
三类产出物的格式细则(Glossary 守则 / ADR 守则 / Spec 守则)见 [references/rules.md](references/rules.md)——SKILL.md 不重复细节。
|
|
49
|
+
|
|
50
|
+
## 不可协商规则(无任何例外)
|
|
51
|
+
|
|
52
|
+
- **写入 ADR 必须由用户显式确认,无论任何情况、无任何例外**:三条件全满足、决策看似显然、② 补记,均不豁免。ADR 一旦落盘记录不可撤销(可 supersede,但痕迹永存),全部门槛都在写入之前
|
|
53
|
+
- **ADR 与 glossary 不对称**:`CONTEXT.md` 术语可随访谈 inline 更新(domain-modeling 规则),ADR 必须先审草稿、用户确认后才落盘——禁止把 inline 逻辑套用到 ADR
|
|
54
|
+
|
|
55
|
+
## 回退
|
|
56
|
+
|
|
57
|
+
| 触发点 | 条件 | 动作 |
|
|
58
|
+
|--------|------|------|
|
|
59
|
+
| ② seam 确认 | 用户不同意 seams | → ① 补充 |
|
|
60
|
+
| ② 综合时 | 关键信息缺失 | → ① 补采 |
|
|
61
|
+
| ② 发布后 | spec 有问题 | → ① 重新循环 |
|
|
62
|
+
|
|
63
|
+
## 异常终止
|
|
64
|
+
|
|
65
|
+
| 情况 | 处理 |
|
|
66
|
+
|------|------|
|
|
67
|
+
| 用户中途放弃 / 无主题 | 终止 |
|
|
68
|
+
| tracker 未配置 | 提示 `/setup-matt-pocock-skills`,终止 |
|
|
69
|
+
| ① 超过 5 轮无进展 | 建议暂停或缩小范围 |
|
|
70
|
+
|
|
71
|
+
## 约束
|
|
72
|
+
|
|
73
|
+
- ① 出口达成后方可进入 ②
|
|
74
|
+
- 全程不写代码、不动源码:唯一允许写入的文件是领域文档(`CONTEXT.md`/ADR)与 spec
|
|
75
|
+
- ② 探索代码只为确认 seams 与术语——只读不改
|
|
76
|
+
- 产出物格式细则(Glossary/ADR/Spec 守则)与反模式见 [references/rules.md](references/rules.md),不在本文件重写
|
|
77
|
+
|
|
78
|
+
## 引用
|
|
79
|
+
|
|
80
|
+
- [grill-with-docs](.agents/skills/grill-with-docs/SKILL.md)
|
|
81
|
+
- [grilling](.agents/skills/grilling/SKILL.md)
|
|
82
|
+
- [domain-modeling](.agents/skills/domain-modeling/SKILL.md)
|
|
83
|
+
- [to-spec](.agents/skills/to-spec/SKILL.md)
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# 守则:Grill-to-Spec 产出物格式细则
|
|
2
|
+
|
|
3
|
+
三类产出物(Glossary / ADR / Spec)格式的**唯一细节出处**,由 SKILL.md 直链引用。SKILL.md 只保留流程、导航与不可协商规则,本文件不重复流程内容。
|
|
4
|
+
|
|
5
|
+
## Glossary 守则
|
|
6
|
+
|
|
7
|
+
- 懒创建:首个术语解析时才建 `CONTEXT.md`;多上下文时先确认归属,归属不清则询问
|
|
8
|
+
- 只是 glossary:零实现细节,不当 spec/scratch pad
|
|
9
|
+
- 只收本上下文特有术语,通用编程概念不收
|
|
10
|
+
- 定义 WHAT 非 HOW,1-2 句;opinionated,同义词列 `_Avoid_`;术语解析即 inline 更新,不批量
|
|
11
|
+
|
|
12
|
+
## ADR 守则
|
|
13
|
+
|
|
14
|
+
- 三条件全满足才提议(难逆转 / 无上下文费解 / 真实权衡);`docs/adr/` 懒创建
|
|
15
|
+
- 格式:标题 + 1-3 句正文;可选节(Status/Considered Options/Consequences)按需,大多数不需要
|
|
16
|
+
- 编号:`0001-slug.md` 顺序递增,扫描最高号 +1
|
|
17
|
+
- 草稿经用户显式确认后落盘,任何情况无例外(见 SKILL.md 流程① 与不可协商规则)
|
|
18
|
+
|
|
19
|
+
## Spec 守则
|
|
20
|
+
|
|
21
|
+
- 完整七节模板逐节不缺:Problem Statement / Solution / User Stories / Implementation Decisions / Testing Decisions / Out of Scope / Further Notes
|
|
22
|
+
- User Stories:长编号列表,`As an <actor>, I want a <feature>, so that <benefit>` 格式
|
|
23
|
+
- Implementation Decisions:不含文件路径/代码片段;例外——原型产出的决策密集片段可 inline,注明来源并裁剪至决策部分
|
|
24
|
+
- 全文贯穿 glossary 词汇;尊重所触区域既有 ADR
|
|
25
|
+
- seams:既有优先于新建、取最高、理想数量 1,与用户确认
|
|
26
|
+
- 发布后标 `ready-for-agent`,triage 状态以 issue 文件顶部 `Status:` 行记录
|
|
27
|
+
|
|
28
|
+
## 反模式(不做什么)
|
|
29
|
+
|
|
30
|
+
- 不把守则当逐条朗读的检查清单——守则约束产出物格式,不约束对话节奏
|
|
31
|
+
- 不把 ADR 当 glossary 一样 inline 更新(见 SKILL.md 不可协商规则)
|
|
32
|
+
- 不产出守则之外的文件:产出物只有三种(Glossary / ADR / Spec)
|
|
33
|
+
- 不在本文件之外重复守则细节——SKILL.md 与 references 之间信息只在一处存在
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: grilling
|
|
3
|
+
description: Grill the user relentlessly about a plan, decision, or idea. Use when the user wants to stress-test their thinking, or uses any 'grill' trigger phrases.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Interview me relentlessly about every aspect of this until we reach a shared understanding. Walk down each branch of the decision tree, resolving dependencies between decisions one-by-one. For each question, provide your recommended answer.
|
|
7
|
+
|
|
8
|
+
Ask the questions one at a time, waiting for feedback on each question before continuing. Asking multiple questions at once is bewildering.
|
|
9
|
+
|
|
10
|
+
If a *fact* can be found by exploring the environment (filesystem, tools, etc.), look it up rather than asking me. The *decisions*, though, are mine — put each one to me and wait for my answer.
|
|
11
|
+
|
|
12
|
+
Do not act on it until I confirm we have reached a shared understanding.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: handoff
|
|
3
|
+
description: Compact the current conversation into a handoff document for another agent to pick up.
|
|
4
|
+
argument-hint: "What will the next session be used for?"
|
|
5
|
+
disable-model-invocation: true
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
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.
|
|
9
|
+
|
|
10
|
+
Include a "suggested skills" section in the document, which suggests skills that the agent should invoke.
|
|
11
|
+
|
|
12
|
+
Do not duplicate content already captured in other artifacts (specs, plans, ADRs, issues, commits, diffs). Reference them by path or URL instead.
|
|
13
|
+
|
|
14
|
+
Redact any sensitive information, such as API keys, passwords, or personally identifiable information.
|
|
15
|
+
|
|
16
|
+
If the user passed arguments, treat them as a description of what the next session will focus on and tailor the doc accordingly.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: implement
|
|
3
|
+
description: "Implement a piece of work based on a spec or set of tickets."
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Implement the work described by the user in the spec or tickets.
|
|
8
|
+
|
|
9
|
+
Use /tdd where possible, at pre-agreed seams.
|
|
10
|
+
|
|
11
|
+
Run typechecking regularly, single test files regularly, and the full test suite once at the end.
|
|
12
|
+
|
|
13
|
+
Once done, use /code-review to review the work.
|
|
14
|
+
|
|
15
|
+
Commit your work to the current branch.
|