@martinffx/atelier 1.1.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.2.1](https://github.com/martinffx/atelier/compare/v1.2.0...v1.2.1) (2026-05-23)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **cli:** correct skills directory path and add legacy config migration ([14f9611](https://github.com/martinffx/atelier/commit/14f9611bf4d8876844ef86ccc3fce55b203f2bed))
9
+ * register missing skills in marketplace.json ([06da766](https://github.com/martinffx/atelier/commit/06da76647ed7c6721a2bc283f9bbd1c212b08456))
10
+ * register missing skills in marketplace.json ([9f48099](https://github.com/martinffx/atelier/commit/9f48099e0be5de184c6200105e9b0b839fbcda1a))
11
+
12
+ ## [1.2.0](https://github.com/martinffx/atelier/compare/v1.1.0...v1.2.0) (2026-05-23)
13
+
14
+
15
+ ### Features
16
+
17
+ * **code-debug:** upgrade to six-phase diagnose workflow ([62dec10](https://github.com/martinffx/atelier/commit/62dec1045555947462a447f4579e83b0dee63d17))
18
+ * **code-debug:** upgrade to six-phase diagnose workflow ([8df277d](https://github.com/martinffx/atelier/commit/8df277d425ca16dfa63a8bf1949003e3e6aaf87c))
19
+ * **code-handoff:** add code-handoff skill ([5ab6f5f](https://github.com/martinffx/atelier/commit/5ab6f5f5d890b024718e3b69103b23c3eb1205ef))
20
+ * **oracle-architect:** add vocabulary, evaluation heuristics, and interface design reference ([7c528d3](https://github.com/martinffx/atelier/commit/7c528d308ebc98929cfc6be17e8d5c7444b36607))
21
+ * **oracle-architect:** add vocabulary, evaluation heuristics, and interface design reference ([63ee753](https://github.com/martinffx/atelier/commit/63ee75380c4d4be92708539173534566f2033dea))
22
+ * **oracle-security:** add security architecture and threat modeling skill ([8fcbd87](https://github.com/martinffx/atelier/commit/8fcbd87943bcb23d51480ed9e9bd702f19817096))
23
+ * **oracle-security:** add security architecture and threat modeling skill ([69b6fdc](https://github.com/martinffx/atelier/commit/69b6fdcdf1f2b7732fb339cbf1d64c1fb7252eb7))
24
+ * **skills:** add code-handoff skill ([012f467](https://github.com/martinffx/atelier/commit/012f4676d48c7f6799361ca6bdfef12f33a8849e))
25
+ * **skills:** add oracle-doubt skill ([adf118b](https://github.com/martinffx/atelier/commit/adf118be197da43195c9ddd052b53f8c714405b5))
26
+ * **skills:** add oracle-doubt skill for adversarial review ([447673e](https://github.com/martinffx/atelier/commit/447673eb7904e4d28306360f64329f7874db5b2b))
27
+
3
28
  ## [1.1.0](https://github.com/martinffx/atelier/compare/v1.0.2...v1.1.0) (2026-05-23)
4
29
 
5
30
 
package/README.md CHANGED
@@ -29,7 +29,7 @@ That's it. Your project is now configured for spec-driven development.
29
29
 
30
30
  Atelier sets up three things in your project:
31
31
 
32
- ### 1. Skills (30 available)
32
+ ### 1. Skills (34 available)
33
33
 
34
34
  Specialized knowledge modules that auto-invoke based on context. Install them via the CLI (`--all` flag) or separately:
35
35
 
@@ -160,6 +160,9 @@ Analytical skills that provide patterns, principles, and deep reasoning. These a
160
160
 
161
161
  - `oracle-architect` — DDD, hexagonal architecture, component design
162
162
  - `oracle-challenge` — Challenge assumptions, validate decisions
163
+ - `oracle-doubt` — Adversarial review of non-trivial decisions
164
+ - `oracle-grillme` — Socratic interrogation of plans against domain model
165
+ - `oracle-security` — Security architecture and threat modeling
163
166
  - `oracle-testing` — Stub-driven TDD, layer boundary testing
164
167
  - `oracle-thinkdeep` — Extended sequential reasoning for complex problems
165
168
 
@@ -191,9 +194,11 @@ Technology-specific patterns and best practices. These are like having a senior
191
194
 
192
195
  Task-specific tools you invoke when you need them.
193
196
 
194
- - `code-review` — Multi-agent code review with specialized reviewers
197
+ - `code-commit` — Generate and validate conventional commits
195
198
  - `code-debug` — Systematic debugging workflow
196
199
  - `code-docs` — README, API docs, changelog generation
200
+ - `code-handoff` — Compact conversation into handoff document
201
+ - `code-review` — Multi-agent code review with specialized reviewers
197
202
  - `code-subagents` — Dispatch patterns for parallel implementation
198
203
 
199
204
  Skills are auto-invoked based on their description when you work with relevant technologies. No commands needed—just install and AI agents will use them when appropriate.
package/dist/atelier.js CHANGED
@@ -25704,8 +25704,7 @@ function deepMerge(target, source) {
25704
25704
  return result;
25705
25705
  }
25706
25706
  function writePluginJs(config, basePath) {
25707
- const skillsPath = config.skills_path || "~/.agents/skills/atelier";
25708
- const skillsDir = `${skillsPath}/atelier`;
25707
+ const skillsDir = config.skills_path || "~/.agents/skills";
25709
25708
  const plugin = `export default {
25710
25709
  config: {
25711
25710
  skillsDir: ${JSON.stringify(skillsDir)},
@@ -25747,13 +25746,12 @@ function writeCommandFiles(config, basePath) {
25747
25746
  } catch (err) {
25748
25747
  throw new FileWriteError(commandsDir, err instanceof Error ? err.message : String(err));
25749
25748
  }
25750
- let skillsBasePath = config.skills_path || "~/.agents/skills/atelier";
25751
- if (skillsBasePath.startsWith("~/")) {
25752
- skillsBasePath = join2(homedir(), skillsBasePath.slice(2));
25753
- } else if (!skillsBasePath.startsWith("/")) {
25754
- skillsBasePath = join2(process.cwd(), skillsBasePath);
25749
+ let skillsDir = config.skills_path || "~/.agents/skills";
25750
+ if (skillsDir.startsWith("~/")) {
25751
+ skillsDir = join2(homedir(), skillsDir.slice(2));
25752
+ } else if (!skillsDir.startsWith("/")) {
25753
+ skillsDir = join2(process.cwd(), skillsDir);
25755
25754
  }
25756
- const skillsDir = join2(skillsBasePath, "atelier");
25757
25755
  if (!existsSync3(skillsDir)) {
25758
25756
  return;
25759
25757
  }
@@ -29816,6 +29814,9 @@ function readConfig(path = CONFIG_PATH) {
29816
29814
  throw new InvalidConfigError(`Invalid JSON in ${path}: ${err instanceof Error ? err.message : String(err)}`);
29817
29815
  }
29818
29816
  const config = validateConfig(parsed);
29817
+ if (config.skills_path === "~/.agents/skills/atelier") {
29818
+ config.skills_path = "~/.agents/skills";
29819
+ }
29819
29820
  const known = new Set(["recon", "oracle", "architect"]);
29820
29821
  config.agents = config.agents.filter((a) => known.has(a.template));
29821
29822
  for (const name of known) {
@@ -29856,7 +29857,7 @@ function getDefaultConfig(harness, provider) {
29856
29857
  version: CURRENT_VERSION,
29857
29858
  harness,
29858
29859
  skills_source: "martinffx/atelier",
29859
- skills_path: "~/.agents/skills/atelier",
29860
+ skills_path: "~/.agents/skills",
29860
29861
  agents
29861
29862
  };
29862
29863
  if (harness === "opencode") {
@@ -29933,7 +29934,7 @@ function escapeShellArg(arg) {
29933
29934
  return `'${arg.replace(/'/g, "'\\''")}'`;
29934
29935
  }
29935
29936
  function writeHookScript(config, basePath) {
29936
- const skillsPath = config.skills_path || "~/.agents/skills/atelier";
29937
+ const skillsPath = config.skills_path || "~/.agents/skills";
29937
29938
  const safeSkillsPath = escapeShellArg(skillsPath);
29938
29939
  const script = `#!/bin/bash
29939
29940
  # Atelier session-start hook
@@ -29941,8 +29942,8 @@ function writeHookScript(config, basePath) {
29941
29942
 
29942
29943
  SKILLS_DIR=${safeSkillsPath}
29943
29944
 
29944
- if [ -d "$SKILLS_DIR/atelier" ]; then
29945
- echo '{"additionalContext": {"skillsDir": "'"$SKILLS_DIR"'/atelier"}}'
29945
+ if [ -d "$SKILLS_DIR" ]; then
29946
+ echo '{"additionalContext": {"skillsDir": "'"$SKILLS_DIR"'}}'
29946
29947
  else
29947
29948
  echo '{"additionalContext": {}}'
29948
29949
  fi
@@ -32560,7 +32561,7 @@ function isHarness(value) {
32560
32561
  return value === "claude" || value === "opencode";
32561
32562
  }
32562
32563
  function getSkillsPath(project) {
32563
- return project ? "./.agents/skills/atelier" : "~/.agents/skills/atelier";
32564
+ return project ? "./.agents/skills" : "~/.agents/skills";
32564
32565
  }
32565
32566
  function getConfigBasePath(options2) {
32566
32567
  return options2.cwd || (options2.project ? process.cwd() : homedir3());
@@ -32911,8 +32912,8 @@ Files to write:`);
32911
32912
  } else {
32912
32913
  generateOpenCode(config, harnessBasePath);
32913
32914
  }
32914
- console.log("Atelier updated.");
32915
- console.log("Skills not updated. Run `npx skills update martinffx/atelier` if needed.");
32915
+ console.log("Atelier updated (agents, hooks, and commands).");
32916
+ console.log("Skills are managed separately. Run `npx skills update martinffx/atelier` to update skills.");
32916
32917
  }
32917
32918
  function buildFileList2(config, basePath) {
32918
32919
  const files = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@martinffx/atelier",
3
- "version": "1.1.0",
3
+ "version": "1.2.1",
4
4
  "description": "Personal development toolkit - spec-driven development, code quality, deep thinking, and ecosystem patterns",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,258 +1,190 @@
1
1
  ---
2
2
  name: code-debug
3
3
  description: >
4
- Systematic debugging workflow and techniques. Use when something is broken, not working as
5
- expected, or throwing errors. Covers reproduction, isolation, hypothesis formation, fix
6
- implementation, and verification. Also triggers on "why does X fail", "debug this", "this
7
- is broken", or when encountering errors or unexpected behavior.
4
+ Disciplined diagnosis loop for hard bugs and performance regressions.
5
+ Reproduce → minimise → hypothesise → instrument → fix → regression-test.
6
+ Use when user says "diagnose this" / "debug this", reports a bug, says
7
+ something is broken/throwing/failing, or describes a performance regression.
8
8
  user-invocable: true
9
9
  ---
10
10
 
11
11
  # Code Debug
12
12
 
13
- Systematic debugging workflow to find and fix bugs efficiently. Never guess — always
14
- narrow down the problem through systematic elimination.
13
+ A discipline for hard bugs. Skip phases only when explicitly justified.
15
14
 
16
- ## The Debugging Mindset
17
-
18
- | Bad | Good |
19
- |-----|------|
20
- | "I think it's..." | "Let me verify..." |
21
- | Changing random things | Binary search narrowing |
22
- | Hoping it'll work | Verifying each hypothesis |
23
- | Moving on after it works | Adding regression test |
24
-
25
- ## The Five-Step Workflow
26
-
27
- ### Step 1: Reproduce
28
-
29
- Create the smallest possible reproduction case.
30
-
31
- **Questions to answer:**
32
- - What exactly triggers the bug?
33
- - Can I make it happen on demand?
34
- - What's the minimal input that causes it?
35
-
36
- **Techniques:**
37
- - Extract exact steps from bug report
38
- - Remove unrelated factors
39
- - Create a minimal test case
40
-
41
- **Output:** "I can reproduce the bug by [exact steps]."
15
+ When exploring the codebase, use the project's domain glossary to get a clear
16
+ mental model of the relevant modules, and check ADRs in the area you're touching.
42
17
 
43
18
  ---
44
19
 
45
- ### Step 2: Isolate
20
+ ## Phase 1 — Build a feedback loop
46
21
 
47
- Narrow down where the bug lives using binary search.
22
+ **This is the skill.** Everything else is mechanical. If you have a fast,
23
+ deterministic, agent-runnable pass/fail signal for the bug, you will find the
24
+ cause — bisection, hypothesis-testing, and instrumentation all just consume
25
+ that signal. If you don't have one, no amount of staring at code will save you.
48
26
 
49
- **Binary search strategies:**
50
- - Comment out half the code → does it still fail?
51
- - Isolate by layer: is it the UI, service, or data layer?
52
- - Isolate by file: which file contains the bug?
53
- - Isolate by function: which function causes the issue?
27
+ Spend disproportionate effort here. **Be aggressive. Be creative. Refuse to
28
+ give up.**
54
29
 
55
- **Git bisect** (for regression bugs):
56
- ```bash
57
- git bisect start
58
- git bisect bad # current commit is broken
59
- git bisect good <last-working-commit>
60
- # Run tests, mark good/bad
61
- git bisect reset # done
62
- ```
30
+ ### Ways to construct one — try them in roughly this order
63
31
 
64
- **Output:** "The bug is in [specific file/function/component]."
32
+ 1. **Failing test** at whatever seam reaches the bug — unit, integration, e2e.
33
+ 2. **Curl / HTTP script** against a running dev server.
34
+ 3. **CLI invocation** with a fixture input, diffing stdout against a known-good
35
+ snapshot.
36
+ 4. **Headless browser script** (Playwright / Puppeteer) — drives the UI,
37
+ asserts on DOM/console/network.
38
+ 5. **Replay a captured trace.** Save a real network request / payload / event
39
+ log to disk; replay it through the code path in isolation.
40
+ 6. **Throwaway harness.** Spin up a minimal subset of the system (one service,
41
+ mocked deps) that exercises the bug code path with a single function call.
42
+ 7. **Property / fuzz loop.** If the bug is "sometimes wrong output", run 1000
43
+ random inputs and look for the failure mode.
44
+ 8. **Bisection harness.** If the bug appeared between two known states (commit,
45
+ dataset, version), automate "boot at state X, check, repeat" so you can
46
+ `git bisect run` it.
47
+ 9. **Differential loop.** Run the same input through old-version vs new-version
48
+ (or two configs) and diff outputs.
49
+ 10. **HITL bash script.** Last resort. If a human must click, drive _them_ with
50
+ a structured script so the loop is still structured. Captured output feeds
51
+ back to you.
65
52
 
66
- ---
67
-
68
- ### Step 3: Form Hypothesis
53
+ Build the right feedback loop, and the bug is 90% fixed.
69
54
 
70
- Make a testable guess about the root cause.
55
+ ### Iterate on the loop itself
71
56
 
72
- **Good hypothesis:**
73
- - Specific: "The user ID is undefined because..."
74
- - Testable: Can verify with a test or log
75
- - Grounded: Based on evidence, not guess
57
+ Treat the loop as a product. Once you have _a_ loop, ask:
76
58
 
77
- **Questions to ask:**
78
- - Why does this happen?
79
- - What are the preconditions?
80
- - What's the actual vs expected behavior?
81
- - What changed recently?
59
+ - Can I make it faster? (Cache setup, skip unrelated init, narrow the test scope.)
60
+ - Can I make the signal sharper? (Assert on the specific symptom, not "didn't crash".)
61
+ - Can I make it more deterministic? (Pin time, seed RNG, isolate filesystem, freeze network.)
82
62
 
83
- **Output:** "I hypothesize that [root cause] because [evidence]."
63
+ A 30-second flaky loop is barely better than no loop. A 2-second deterministic
64
+ loop is a debugging superpower.
84
65
 
85
- ---
66
+ ### Non-deterministic bugs
86
67
 
87
- ### Step 4: Fix
68
+ The goal is not a clean repro but a **higher reproduction rate**. Loop the
69
+ trigger 100×, parallelise, add stress, narrow timing windows, inject sleeps.
70
+ A 50%-flake bug is debuggable; 1% is not — keep raising the rate until it's
71
+ debuggable.
88
72
 
89
- Implement the fix based on your hypothesis.
73
+ ### When you genuinely cannot build a loop
90
74
 
91
- **Rules:**
92
- - Make minimal changes
93
- - Don't refactor while fixing (separate concerns)
94
- - Write failing test first if possible
95
- - Consider edge cases
75
+ Stop and say so explicitly. List what you tried. Ask the user for:
76
+ (a) access to whatever environment reproduces it,
77
+ (b) a captured artifact (HAR file, log dump, core dump, screen recording with timestamps), or
78
+ (c) permission to add temporary production instrumentation.
96
79
 
97
- **Fix patterns:**
98
- - **Missing value** → Add null check or default
99
- - **Wrong value** → Correct the logic
100
- - **Exception** → Handle the error case
101
- - **Logic error** → Fix the condition
80
+ Do **not** proceed to hypothesise without a loop.
102
81
 
103
- **Output:** "Fix applied: [brief description]."
82
+ **Do not proceed to Phase 2 until you have a loop you believe in.**
104
83
 
105
84
  ---
106
85
 
107
- ### Step 5: Verify
108
-
109
- Confirm the fix works and doesn't break anything.
86
+ ## Phase 2 — Reproduce
110
87
 
111
- **Verification steps:**
112
- 1. Run the reproduction case → should pass now
113
- 2. Run related tests → should pass
114
- 3. Run full test suite → should pass
115
- 4. Add regression test → prevents future breakage
116
-
117
- **Output:** "Fix verified. Tests passing. Regression test added."
118
-
119
- ---
88
+ Run the loop. Watch the bug appear.
120
89
 
121
- ## Debugging Techniques
90
+ Confirm:
122
91
 
123
- ### Print Debugging
92
+ - [ ] The loop produces the failure mode the **user** described — not a different failure that happens to be nearby. Wrong bug = wrong fix.
93
+ - [ ] The failure is reproducible across multiple runs (or, for non-deterministic bugs, reproducible at a high enough rate to debug against).
94
+ - [ ] You have captured the exact symptom (error message, wrong output, slow timing) so later phases can verify the fix actually addresses it.
124
95
 
125
- Quick and dirty, but sometimes the fastest way.
96
+ **Do not proceed until you reproduce the bug.**
126
97
 
127
- **When to use:**
128
- - Quick checks in development
129
- - When debugger isn't available
130
- - Understanding flow in unfamiliar code
131
-
132
- **Best practices:**
133
- - Print at entry/exit of functions
134
- - Print variable values at key points
135
- - Remove print statements before committing
136
- - Consider structured logging instead
137
-
138
- ### Debugger
98
+ ---
139
99
 
140
- More powerful than print debugging.
100
+ ## Phase 3 — Hypothesise
141
101
 
142
- **When to use:**
143
- - Complex state to inspect
144
- - Stepping through logic
145
- - Evaluating expressions in context
102
+ Generate **3–5 ranked hypotheses** before testing any of them. Single-hypothesis
103
+ generation anchors on the first plausible idea.
146
104
 
147
- **See references/language-tools.md for language-specific debugger commands.**
105
+ Each hypothesis must be **falsifiable**: state the prediction it makes.
148
106
 
149
- ### Logging
107
+ > Format: "If `<X>` is the cause, then `<changing Y>` will make the bug disappear / `<changing Z>` will make it worse."
150
108
 
151
- Better than print for production issues.
109
+ If you cannot state the prediction, the hypothesis is a vibe — discard or sharpen it.
152
110
 
153
- **Strategies:**
154
- - Add context: request ID, user ID, correlation IDs
155
- - Log at appropriate levels: DEBUG, INFO, WARN, ERROR
156
- - Don't log sensitive data
157
- - Structured logging (JSON) for easier parsing
111
+ **Show the ranked list to the user before testing.** They often have domain
112
+ knowledge that re-ranks instantly ("we just deployed a change to #3"), or know
113
+ hypotheses they've already ruled out. Cheap checkpoint, big time saver. Don't
114
+ block on it — proceed with your ranking if the user is AFK.
158
115
 
159
- **See references/techniques.md for logging patterns.**
116
+ ---
160
117
 
161
- ### Binary Search
118
+ ## Phase 4 — Instrument
162
119
 
163
- Halving the search space.
120
+ Each probe must map to a specific prediction from Phase 3. **Change one variable
121
+ at a time.**
164
122
 
165
- **Strategies:**
166
- - Comment out code blocks
167
- - Test with half the data
168
- - Compare working vs broken configurations
169
- - Git bisect for regressions
123
+ Tool preference:
170
124
 
171
- ### Rubber Ducking
125
+ 1. **Debugger / REPL inspection** if the env supports it. One breakpoint beats ten logs.
126
+ 2. **Targeted logs** at the boundaries that distinguish hypotheses.
127
+ 3. Never "log everything and grep".
172
128
 
173
- Explain the problem out loud (or to a rubber duck).
129
+ **Tag every debug log** with a unique prefix, e.g. `[DEBUG-a4f2]`. Cleanup at
130
+ the end becomes a single grep. Untagged logs survive; tagged logs die.
174
131
 
175
- **Process:**
176
- 1. Describe the problem in detail
177
- 2. Explain what you expect to happen
178
- 3. Explain what's actually happening
179
- 4. Often the solution becomes clear mid-explanation
132
+ **Perf branch.** For performance regressions, logs are usually wrong. Instead:
133
+ establish a baseline measurement (timing harness, `performance.now()`, profiler,
134
+ query plan), then bisect. Measure first, fix second.
180
135
 
181
136
  ---
182
137
 
183
- ## Common Bug Patterns
184
-
185
- ### Null/Undefined Errors
186
-
187
- **Symptoms:** Cannot read property X of undefined
188
-
189
- **Debug approach:**
190
- 1. Find where the value becomes undefined
191
- 2. Trace back where it should come from
192
- 3. Add guard or fix source
138
+ ## Phase 5 — Fix + regression test
193
139
 
194
- **Fix patterns:**
195
- ```javascript
196
- // Before
197
- const name = user.profile.name;
140
+ Write the regression test **before the fix** — but only if there is a
141
+ **correct seam** for it.
198
142
 
199
- // After
200
- const name = user?.profile?.name ?? 'Unknown';
201
- // or
202
- if (!user?.profile) return;
203
- const name = user.profile.name;
204
- ```
205
-
206
- ### Race Conditions
143
+ A correct seam is one where the test exercises the **real bug pattern** as it
144
+ occurs at the call site. If the only available seam is too shallow (single-caller
145
+ test when the bug needs multiple callers, unit test that can't replicate the
146
+ chain that triggered the bug), a regression test there gives false confidence.
207
147
 
208
- **Symptoms:** Intermittent failures, flaky tests
148
+ **If no correct seam exists, that itself is the finding.** Note it. The codebase
149
+ architecture is preventing the bug from being locked down. Flag this for the
150
+ next phase.
209
151
 
210
- **Debug approach:**
211
- 1. Identify async operations
212
- 2. Find timing dependencies
213
- 3. Add delays or force ordering
152
+ If a correct seam exists:
214
153
 
215
- **Fix patterns:**
216
- - Use async/await properly
217
- - Add proper synchronization
218
- - Consider immutable state
154
+ 1. Turn the minimised repro into a failing test at that seam.
155
+ 2. Watch it fail.
156
+ 3. Apply the fix.
157
+ 4. Watch it pass.
158
+ 5. Re-run the Phase 1 feedback loop against the original (un-minimised) scenario.
219
159
 
220
- ### Logic Errors
221
-
222
- **Symptoms:** Wrong output, wrong behavior
160
+ ---
223
161
 
224
- **Debug approach:**
225
- 1. Trace through the logic manually
226
- 2. Compare expected vs actual at each step
227
- 3. Find the first step that diverges
162
+ ## Phase 6 — Cleanup + post-mortem
228
163
 
229
- **Fix patterns:**
230
- - Fix the condition
231
- - Correct the calculation
232
- - Update the state correctly
164
+ Required before declaring done:
233
165
 
234
- ### Performance Issues
166
+ - [ ] Original repro no longer reproduces (re-run the Phase 1 loop)
167
+ - [ ] Regression test passes (or absence of seam is documented)
168
+ - [ ] All `[DEBUG-...]` instrumentation removed (`grep` the prefix)
169
+ - [ ] Throwaway prototypes deleted (or moved to a clearly-marked debug location)
170
+ - [ ] The hypothesis that turned out correct is stated in the commit / PR message — so the next debugger learns
235
171
 
236
- **Symptoms:** Slow, memory leaks, timeouts
172
+ **Then ask: what would have prevented this bug?**
237
173
 
238
- **Debug approach:**
239
- 1. Measure first (don't guess)
240
- 2. Identify hot paths
241
- 3. Optimize the bottleneck
174
+ If the answer involves architectural change (no good test seam, tangled callers,
175
+ hidden coupling) flag this as a codebase health finding for the team.
242
176
 
243
177
  ---
244
178
 
245
- ## Skill Loading
179
+ ## References
246
180
 
247
- Check available skills for additional debugging support:
248
-
249
- - If debugging tests → load oracle-testing
250
-
251
- ---
181
+ - **Language-specific tools** → `references/language-tools.md`
182
+ - **Common bug patterns** → `references/bug-patterns.md`
183
+ - **Logging & techniques** → `references/techniques.md`
252
184
 
253
185
  ## Output Format
254
186
 
255
- After each debugging session, summarize:
187
+ After each debugging session, summarise:
256
188
 
257
189
  ```
258
190
  ## Debug Summary
@@ -261,7 +193,7 @@ After each debugging session, summarize:
261
193
  **Root Cause:** [What actually was wrong]
262
194
  **Fix:** [How you fixed it]
263
195
  **Verification:** [Test results]
264
- **Prevention:** [Regression test added?]
196
+ **Prevention:** [Regression test added? Architectural finding?]
265
197
  ```
266
198
 
267
199
  This helps future-you understand what happened.
@@ -0,0 +1,71 @@
1
+ # Common Bug Patterns
2
+
3
+ Quick reference for recognising and fixing recurring bug categories.
4
+
5
+ ---
6
+
7
+ ## Null/Undefined Errors
8
+
9
+ **Symptoms:** Cannot read property X of undefined
10
+
11
+ **Debug approach:**
12
+ 1. Find where the value becomes undefined
13
+ 2. Trace back where it should come from
14
+ 3. Add guard or fix source
15
+
16
+ **Fix patterns:**
17
+ ```javascript
18
+ // Before
19
+ const name = user.profile.name;
20
+
21
+ // After
22
+ const name = user?.profile?.name ?? 'Unknown';
23
+ // or
24
+ if (!user?.profile) return;
25
+ const name = user.profile.name;
26
+ ```
27
+
28
+ ---
29
+
30
+ ## Race Conditions
31
+
32
+ **Symptoms:** Intermittent failures, flaky tests
33
+
34
+ **Debug approach:**
35
+ 1. Identify async operations
36
+ 2. Find timing dependencies
37
+ 3. Add delays or force ordering to confirm
38
+
39
+ **Fix patterns:**
40
+ - Use async/await properly
41
+ - Add proper synchronization
42
+ - Consider immutable state
43
+
44
+ ---
45
+
46
+ ## Logic Errors
47
+
48
+ **Symptoms:** Wrong output, wrong behaviour
49
+
50
+ **Debug approach:**
51
+ 1. Trace through the logic manually
52
+ 2. Compare expected vs actual at each step
53
+ 3. Find the first step that diverges
54
+
55
+ **Fix patterns:**
56
+ - Fix the condition
57
+ - Correct the calculation
58
+ - Update the state correctly
59
+
60
+ ---
61
+
62
+ ## Performance Issues
63
+
64
+ **Symptoms:** Slow, memory leaks, timeouts
65
+
66
+ **Debug approach:**
67
+ 1. Measure first (don't guess)
68
+ 2. Identify hot paths
69
+ 3. Optimize the bottleneck
70
+
71
+ **See also:** Phase 4 "Perf branch" in SKILL.md for the disciplined approach.