liteagents 3.0.0 → 3.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (154) hide show
  1. package/CHANGELOG.md +122 -1
  2. package/README.md +113 -169
  3. package/installer/cli.js +4 -2
  4. package/package.json +4 -3
  5. package/packages/ampcode/AGENT.md +10 -18
  6. package/packages/ampcode/agents/code-developer.md +11 -17
  7. package/packages/ampcode/agents/orchestrator.md +1 -1
  8. package/packages/ampcode/agents/quality-assurance.md +3 -1
  9. package/packages/ampcode/{commands/brainstorming.md → skills/brainstorming/SKILL.md} +2 -3
  10. package/packages/ampcode/{commands/branch-review.md → skills/branch-review/SKILL.md} +13 -13
  11. package/packages/{claude/commands/docs-builder.md → ampcode/skills/docs-builder/SKILL.md} +1 -1
  12. package/packages/ampcode/{commands/live-canvas.md → skills/live-canvas/SKILL.md} +8 -4
  13. package/packages/ampcode/{commands/refactor.md → skills/refactor/SKILL.md} +49 -7
  14. package/packages/ampcode/{commands/release.md → skills/release/SKILL.md} +4 -4
  15. package/packages/{claude/commands → ampcode/skills}/remember/AGENT_RULES.md +44 -84
  16. package/packages/ampcode/{commands/remember.md → skills/remember/SKILL.md} +11 -6
  17. package/packages/ampcode/{commands → skills}/remember/friction.cjs +0 -0
  18. package/packages/ampcode/{commands → skills}/remember/stub-check.cjs +28 -19
  19. package/packages/ampcode/{commands → skills}/remember/sync-rules.cjs +28 -19
  20. package/packages/{claude/commands → ampcode/skills}/remember/version-check.cjs +1 -1
  21. package/packages/ampcode/skills/root-cause/SKILL.md +220 -0
  22. package/packages/ampcode/{commands/trace-back → skills/root-cause}/find-polluter.sh +0 -0
  23. package/packages/{claude/commands/security.md → ampcode/skills/security/SKILL.md} +1 -1
  24. package/packages/{claude/commands/ship.md → ampcode/skills/ship/SKILL.md} +1 -1
  25. package/packages/ampcode/skills/skill-creator/LICENSE.txt +202 -0
  26. package/packages/ampcode/{commands/skill-creator.md → skills/skill-creator/SKILL.md} +1 -2
  27. package/packages/ampcode/{commands → skills}/skill-creator/scripts/init_skill.py +0 -0
  28. package/packages/ampcode/{commands → skills}/skill-creator/scripts/package_skill.py +0 -0
  29. package/packages/ampcode/{commands → skills}/skill-creator/scripts/quick_validate.py +0 -0
  30. package/packages/ampcode/{commands/stash.md → skills/stash/SKILL.md} +2 -1
  31. package/packages/{claude/commands/test-generate.md → ampcode/skills/test-generate/SKILL.md} +2 -2
  32. package/packages/ampcode/variants.json +2 -2
  33. package/packages/claude/CLAUDE.md +10 -17
  34. package/packages/claude/agents/code-developer.md +11 -17
  35. package/packages/claude/agents/orchestrator.md +2 -3
  36. package/packages/claude/agents/quality-assurance.md +3 -1
  37. package/packages/claude/skills/brainstorming/SKILL.md +1 -2
  38. package/packages/claude/{commands/branch-review.md → skills/branch-review/SKILL.md} +1 -1
  39. package/packages/{ampcode/commands/docs-builder.md → claude/skills/docs-builder/SKILL.md} +7 -7
  40. package/packages/claude/skills/live-canvas/SKILL.md +5 -1
  41. package/packages/claude/{commands/refactor.md → skills/refactor/SKILL.md} +45 -3
  42. package/packages/claude/{commands/release.md → skills/release/SKILL.md} +1 -1
  43. package/packages/{ampcode/commands → claude/skills}/remember/AGENT_RULES.md +38 -78
  44. package/packages/claude/{commands/remember.md → skills/remember/SKILL.md} +11 -6
  45. package/packages/claude/{commands → skills}/remember/friction.cjs +0 -0
  46. package/packages/claude/{commands → skills}/remember/stub-check.cjs +28 -19
  47. package/packages/claude/{commands → skills}/remember/sync-rules.cjs +28 -19
  48. package/packages/{ampcode/commands → claude/skills}/remember/version-check.cjs +3 -3
  49. package/packages/claude/skills/root-cause/SKILL.md +220 -0
  50. package/packages/{ampcode/commands/security.md → claude/skills/security/SKILL.md} +2 -2
  51. package/packages/{ampcode/commands/ship.md → claude/skills/ship/SKILL.md} +2 -2
  52. package/packages/claude/skills/skill-creator/SKILL.md +1 -2
  53. package/packages/claude/{commands/stash.md → skills/stash/SKILL.md} +2 -1
  54. package/packages/{ampcode/commands/test-generate.md → claude/skills/test-generate/SKILL.md} +3 -3
  55. package/packages/claude/variants.json +1 -2
  56. package/packages/droid/AGENTS.md +10 -15
  57. package/packages/droid/commands/brainstorming.md +1 -4
  58. package/packages/droid/commands/branch-review.md +11 -14
  59. package/packages/droid/commands/docs-builder.md +0 -3
  60. package/packages/droid/commands/live-canvas.md +7 -5
  61. package/packages/droid/commands/refactor.md +47 -8
  62. package/packages/droid/commands/release.md +2 -5
  63. package/packages/droid/commands/remember/AGENT_RULES.md +38 -78
  64. package/packages/droid/commands/remember/stub-check.cjs +28 -19
  65. package/packages/droid/commands/remember/sync-rules.cjs +28 -19
  66. package/packages/droid/commands/remember/version-check.cjs +1 -1
  67. package/packages/droid/commands/remember.md +6 -4
  68. package/packages/droid/commands/root-cause.md +218 -0
  69. package/packages/droid/commands/security.md +0 -3
  70. package/packages/droid/commands/ship.md +0 -3
  71. package/packages/droid/commands/skill-creator/LICENSE.txt +202 -0
  72. package/packages/droid/commands/skill-creator.md +0 -4
  73. package/packages/droid/commands/stash.md +0 -2
  74. package/packages/droid/commands/test-generate.md +1 -4
  75. package/packages/droid/droids/1-create-prd.md +6 -2
  76. package/packages/droid/droids/2-generate-tasks.md +1 -2
  77. package/packages/droid/droids/3-process-task-list.md +1 -2
  78. package/packages/droid/droids/code-developer.md +12 -19
  79. package/packages/droid/droids/feature-planner.md +1 -2
  80. package/packages/droid/droids/market-researcher.md +1 -2
  81. package/packages/droid/droids/orchestrator.md +1 -2
  82. package/packages/droid/droids/quality-assurance.md +4 -3
  83. package/packages/droid/droids/system-architect.md +1 -2
  84. package/packages/droid/droids/ui-designer.md +1 -2
  85. package/packages/opencode/AGENTS.md +10 -15
  86. package/packages/opencode/agent/code-developer.md +11 -17
  87. package/packages/opencode/agent/quality-assurance.md +3 -1
  88. package/packages/opencode/command/brainstorming.md +1 -4
  89. package/packages/opencode/command/branch-review.md +11 -15
  90. package/packages/opencode/command/docs-builder.md +0 -4
  91. package/packages/opencode/command/live-canvas.md +7 -5
  92. package/packages/opencode/command/refactor.md +47 -9
  93. package/packages/opencode/command/release.md +2 -5
  94. package/packages/opencode/command/remember/AGENT_RULES.md +38 -78
  95. package/packages/opencode/command/remember/stub-check.cjs +28 -19
  96. package/packages/opencode/command/remember/sync-rules.cjs +28 -19
  97. package/packages/opencode/command/remember/version-check.cjs +1 -1
  98. package/packages/opencode/command/remember.md +6 -4
  99. package/packages/opencode/command/root-cause.md +218 -0
  100. package/packages/opencode/command/security.md +0 -4
  101. package/packages/opencode/command/ship.md +0 -3
  102. package/packages/opencode/command/skill-creator/LICENSE.txt +202 -0
  103. package/packages/opencode/command/skill-creator.md +0 -4
  104. package/packages/opencode/command/stash.md +0 -3
  105. package/packages/opencode/command/test-generate.md +1 -5
  106. package/packages/opencode/opencode.jsonc +4 -24
  107. package/packages/subagentic-manual.md +147 -314
  108. package/packages/ampcode/commands/debug-method.md +0 -297
  109. package/packages/ampcode/commands/live-canvas/README.md +0 -264
  110. package/packages/ampcode/commands/optimize.md +0 -61
  111. package/packages/ampcode/commands/tdd-flow.md +0 -390
  112. package/packages/ampcode/commands/test-traps/example.ts +0 -158
  113. package/packages/ampcode/commands/test-traps.md +0 -378
  114. package/packages/ampcode/commands/trace-back.md +0 -176
  115. package/packages/ampcode/commands/verify-done.md +0 -152
  116. package/packages/claude/commands/optimize.md +0 -61
  117. package/packages/claude/plugins/live-canvas-marketplace/plugins/live-canvas-channel/README.md +0 -89
  118. package/packages/claude/skills/debug-method/CREATION-LOG.md +0 -119
  119. package/packages/claude/skills/debug-method/SKILL.md +0 -296
  120. package/packages/claude/skills/debug-method/test-academic.md +0 -14
  121. package/packages/claude/skills/debug-method/test-pressure-1.md +0 -58
  122. package/packages/claude/skills/debug-method/test-pressure-2.md +0 -68
  123. package/packages/claude/skills/debug-method/test-pressure-3.md +0 -69
  124. package/packages/claude/skills/live-canvas/README.md +0 -269
  125. package/packages/claude/skills/tdd-flow/SKILL.md +0 -392
  126. package/packages/claude/skills/test-traps/SKILL.md +0 -378
  127. package/packages/claude/skills/test-traps/example.ts +0 -158
  128. package/packages/claude/skills/trace-back/SKILL.md +0 -176
  129. package/packages/claude/skills/verify-done/SKILL.md +0 -152
  130. package/packages/droid/commands/debug-method.md +0 -297
  131. package/packages/droid/commands/live-canvas/README.md +0 -264
  132. package/packages/droid/commands/optimize.md +0 -61
  133. package/packages/droid/commands/tdd-flow.md +0 -390
  134. package/packages/droid/commands/test-traps/example.ts +0 -158
  135. package/packages/droid/commands/test-traps.md +0 -378
  136. package/packages/droid/commands/trace-back.md +0 -176
  137. package/packages/droid/commands/verify-done.md +0 -152
  138. package/packages/opencode/command/debug-method.md +0 -297
  139. package/packages/opencode/command/live-canvas/README.md +0 -264
  140. package/packages/opencode/command/optimize.md +0 -61
  141. package/packages/opencode/command/tdd-flow.md +0 -390
  142. package/packages/opencode/command/test-traps/example.ts +0 -158
  143. package/packages/opencode/command/test-traps.md +0 -378
  144. package/packages/opencode/command/trace-back.md +0 -176
  145. package/packages/opencode/command/verify-done.md +0 -152
  146. /package/packages/ampcode/{commands → skills}/docs-builder/docs-builder.cjs +0 -0
  147. /package/packages/ampcode/{commands → skills}/live-canvas/DESIGN_PRINCIPLES.md +0 -0
  148. /package/packages/ampcode/{commands → skills}/live-canvas/dev/post-variants.html +0 -0
  149. /package/packages/ampcode/{commands → skills}/live-canvas/templates/lab-banner.html +0 -0
  150. /package/packages/ampcode/{commands → skills}/live-canvas/templates/overlay-vanilla.js +0 -0
  151. /package/packages/claude/{commands → skills}/docs-builder/docs-builder.cjs +0 -0
  152. /package/packages/claude/skills/{trace-back → root-cause}/find-polluter.sh +0 -0
  153. /package/packages/droid/commands/{trace-back → root-cause}/find-polluter.sh +0 -0
  154. /package/packages/opencode/command/{trace-back → root-cause}/find-polluter.sh +0 -0
@@ -60,31 +60,40 @@ function lexists(p) {
60
60
  * "the file is absent" and is still followed on write — or any parent
61
61
  * directory may be a link pointing elsewhere. This runs across a whole fleet
62
62
  * of repos, so a relative link only has to reach a sibling checkout.
63
+ *
64
+ * A link that stays INSIDE the repo is not an escape: a repo that keeps its
65
+ * rules or its config behind an in-repo symlink is an ordinary setup, and
66
+ * refusing it would strand that repo forever. So the leaf is followed by hand
67
+ * with readlink — which works on a dangling link, where realpath cannot — and
68
+ * each hop re-resolves the parents, because the file a link points at can sit
69
+ * behind a linked directory of its own.
63
70
  */
64
71
  function escapesRepo(repo, target) {
65
72
  let root;
66
73
  try { root = fs.realpathSync(repo); } catch (e) { return true; }
67
74
 
68
- // Walk up to the deepest ancestor that exists; anything below it cannot be
69
- // a link yet, so only the existing part needs resolving.
70
- const tail = [];
71
- let dir = path.dirname(target);
72
- while (!lexists(dir)) {
73
- tail.unshift(path.basename(dir));
74
- const up = path.dirname(dir);
75
- if (up === dir) return true; // walked off the filesystem root
76
- dir = up;
77
- }
78
-
79
- let resolved;
80
- try { resolved = path.join(fs.realpathSync(dir), ...tail, path.basename(target)); }
81
- catch (e) { return true; } // an ancestor is a dangling link
82
-
83
- // The last component can be a link even when every directory above it is
84
- // clean — that is the dangling-file case.
85
- try { if (fs.lstatSync(resolved).isSymbolicLink()) return true; } catch (e) { /* absent: fine */ }
75
+ let p = path.resolve(target);
76
+ for (let hop = 0; hop < 40; hop++) {
77
+ // Resolve the existing part of the path. Walk up to the deepest ancestor
78
+ // that exists; anything below it cannot be a link yet.
79
+ const tail = [];
80
+ let dir = path.dirname(p);
81
+ while (!lexists(dir)) {
82
+ tail.unshift(path.basename(dir));
83
+ const up = path.dirname(dir);
84
+ if (up === dir) return true; // walked off the filesystem root
85
+ dir = up;
86
+ }
87
+ try { p = path.join(fs.realpathSync(dir), ...tail, path.basename(p)); }
88
+ catch (e) { return true; } // an ancestor is a dangling link
86
89
 
87
- return resolved !== root && !resolved.startsWith(root + path.sep);
90
+ let to;
91
+ try { to = fs.readlinkSync(p); } catch (e) {
92
+ return p !== root && !p.startsWith(root + path.sep); // not a link: decide here
93
+ }
94
+ p = path.resolve(path.dirname(p), to);
95
+ }
96
+ return true; // a link cycle: refuse
88
97
  }
89
98
 
90
99
  /** Index range of the lines strictly between a marker pair, or null. */
@@ -50,31 +50,40 @@ function lexists(p) {
50
50
  * "the file is absent" and is still followed on write — or any parent
51
51
  * directory may be a link pointing elsewhere. This runs across a whole fleet
52
52
  * of repos, so a relative link only has to reach a sibling checkout.
53
+ *
54
+ * A link that stays INSIDE the repo is not an escape: a repo that keeps its
55
+ * rules or its config behind an in-repo symlink is an ordinary setup, and
56
+ * refusing it would strand that repo forever. So the leaf is followed by hand
57
+ * with readlink — which works on a dangling link, where realpath cannot — and
58
+ * each hop re-resolves the parents, because the file a link points at can sit
59
+ * behind a linked directory of its own.
53
60
  */
54
61
  function escapesRepo(repo, target) {
55
62
  let root;
56
63
  try { root = fs.realpathSync(repo); } catch (e) { return true; }
57
64
 
58
- // Walk up to the deepest ancestor that exists; anything below it cannot be
59
- // a link yet, so only the existing part needs resolving.
60
- const tail = [];
61
- let dir = path.dirname(target);
62
- while (!lexists(dir)) {
63
- tail.unshift(path.basename(dir));
64
- const up = path.dirname(dir);
65
- if (up === dir) return true; // walked off the filesystem root
66
- dir = up;
67
- }
68
-
69
- let resolved;
70
- try { resolved = path.join(fs.realpathSync(dir), ...tail, path.basename(target)); }
71
- catch (e) { return true; } // an ancestor is a dangling link
72
-
73
- // The last component can be a link even when every directory above it is
74
- // clean — that is the dangling-file case.
75
- try { if (fs.lstatSync(resolved).isSymbolicLink()) return true; } catch (e) { /* absent: fine */ }
65
+ let p = path.resolve(target);
66
+ for (let hop = 0; hop < 40; hop++) {
67
+ // Resolve the existing part of the path. Walk up to the deepest ancestor
68
+ // that exists; anything below it cannot be a link yet.
69
+ const tail = [];
70
+ let dir = path.dirname(p);
71
+ while (!lexists(dir)) {
72
+ tail.unshift(path.basename(dir));
73
+ const up = path.dirname(dir);
74
+ if (up === dir) return true; // walked off the filesystem root
75
+ dir = up;
76
+ }
77
+ try { p = path.join(fs.realpathSync(dir), ...tail, path.basename(p)); }
78
+ catch (e) { return true; } // an ancestor is a dangling link
76
79
 
77
- return resolved !== root && !resolved.startsWith(root + path.sep);
80
+ let to;
81
+ try { to = fs.readlinkSync(p); } catch (e) {
82
+ return p !== root && !p.startsWith(root + path.sep); // not a link: decide here
83
+ }
84
+ p = path.resolve(path.dirname(p), to);
85
+ }
86
+ return true; // a link cycle: refuse
78
87
  }
79
88
 
80
89
  function templatePath() {
@@ -79,7 +79,7 @@ function versionFromPackageJson() {
79
79
  }
80
80
 
81
81
  // The installer stamps the release it wrote into <install root>/manifest.json.
82
- // version-check.cjs sits at <root>/<commands|command>/remember/, so the root is
82
+ // version-check.cjs sits at <root>/<skills|commands|command>/remember/, so the root
83
83
  // two levels up. This is the fast path: reading a file beats spawning npm.
84
84
  function versionFromManifest() {
85
85
  try {
@@ -0,0 +1,220 @@
1
+ ---
2
+ name: root-cause
3
+ description: Use when any test fails, bug appears, or behaviour surprises you, before proposing a fix - find the cause and prove it, by reading real evidence, tracing bad values back to their origin, comparing against a working case, and testing one hypothesis at a time
4
+ allowed-tools: Read, Grep, Glob
5
+ ---
6
+
7
+ # Root Cause
8
+
9
+ **Find the cause before you change any code.**
10
+
11
+ ## The Law
12
+
13
+ ```
14
+ NO FIX WITHOUT A CAUSE YOU CAN POINT AT
15
+ ```
16
+
17
+ A fix at the place the error *appeared* is a symptom fix. It is a failure even when
18
+ the symptom goes away, because the real cause is still there and will surface
19
+ somewhere else, later, with less context.
20
+
21
+ You cannot propose a fix until Phase 1 is done.
22
+
23
+ ## When to Use
24
+
25
+ Any technical issue: a failing test, a production bug, unexpected behaviour, a
26
+ performance problem, a broken build, an integration that will not talk.
27
+
28
+ **Especially when it feels like overkill:**
29
+ - Under time pressure — emergencies are exactly when guessing is most tempting and most expensive
30
+ - "Just one quick fix" looks obvious
31
+ - You have already tried a fix and it did not work
32
+ - You do not fully understand the issue
33
+
34
+ Simple bugs have root causes too, and finding one takes minutes. Guess-and-check
35
+ takes hours and leaves damage behind.
36
+
37
+ ---
38
+
39
+ ## Phase 1 — Gather Evidence
40
+
41
+ Do all of this **before** forming any opinion about the fix.
42
+
43
+ ### 1. Read the error completely
44
+
45
+ Do not skim past it. Read the whole message, the whole stack trace, every warning
46
+ above it. Note line numbers, file paths, error codes. The answer is often written
47
+ there in full.
48
+
49
+ ### 2. Reproduce it consistently
50
+
51
+ Can you trigger it on demand? What are the exact steps? Does it happen every time?
52
+
53
+ If it is not reproducible, gather more data. Do not start guessing — an
54
+ intermittent bug you cannot trigger is a bug you cannot prove you fixed.
55
+
56
+ ### 3. Check what changed
57
+
58
+ Recent commits, the working diff, new dependencies, config edits, environment
59
+ differences between the place it works and the place it does not.
60
+
61
+ Be careful here: the most recent change is the most *available* suspect, not the
62
+ most likely one. Recency is a lead to test, never a conclusion.
63
+
64
+ ### 4. Instrument the boundaries (multi-component systems)
65
+
66
+ When the path crosses components — CI → build → sign, API → service → database,
67
+ workflow → script → tool — do not reason about where it breaks. Measure it.
68
+
69
+ For each boundary, log what goes **in** and what comes **out**, and confirm
70
+ configuration and environment actually propagated across it.
71
+
72
+ ```bash
73
+ echo "=== layer 1: is the secret present in the workflow? ==="
74
+ echo "IDENTITY: ${IDENTITY:+SET}${IDENTITY:-UNSET}"
75
+
76
+ echo "=== layer 2: did it survive into the build script? ==="
77
+ env | grep IDENTITY || echo "IDENTITY not in environment"
78
+
79
+ echo "=== layer 3: what does the tool actually see? ==="
80
+ security find-identity -v
81
+ ```
82
+
83
+ Run it **once** to find which boundary fails, then investigate only that
84
+ component. This turns "somewhere in the pipeline" into a named layer.
85
+
86
+ ### 5. Trace the bad value back to where it was born
87
+
88
+ When the error surfaces deep in the call stack, the place it exploded is almost
89
+ never the place it went wrong. Walk backwards.
90
+
91
+ **The chain:**
92
+
93
+ 1. **Observe the symptom** — `git init` ran in the source directory
94
+ 2. **Find the immediate cause** — the code that directly did it:
95
+ `execFileAsync('git', ['init'], { cwd: projectDir })`
96
+ 3. **Ask what called this, and with what value** — `projectDir` was `''`, and an
97
+ empty `cwd` silently resolves to the process's own directory
98
+ 4. **Keep going up** — who passed the empty string? and who gave it to *them*?
99
+ 5. **Stop at the origin** — the point where a correct value first became wrong
100
+
101
+ Fix it **there**. Then, if the value is dangerous, validate it at each layer on
102
+ the way down as well, so the same mistake cannot recur through a different path.
103
+
104
+ **When you cannot trace it by reading, instrument it:**
105
+
106
+ ```typescript
107
+ async function gitInit(directory: string) {
108
+ console.error('DEBUG git init:', {
109
+ directory,
110
+ cwd: process.cwd(),
111
+ stack: new Error().stack,
112
+ });
113
+ await execFileAsync('git', ['init'], { cwd: directory });
114
+ }
115
+ ```
116
+
117
+ - Capture the **stack**, not just the value — it names the caller you are looking for
118
+ - Log **before** the dangerous operation, not in its failure handler
119
+ - Include surrounding context: the directory, the working directory, relevant environment
120
+ - In tests, write to standard error directly; a project logger may be suppressed
121
+
122
+ **When something pollutes a test run but you cannot tell which test:** bisect.
123
+ Run the tests one at a time and stop at the first one that leaves the mess behind.
124
+ `find-polluter.sh` in this skill's directory does exactly that.
125
+
126
+ ---
127
+
128
+ ## Phase 2 — Compare Against Something That Works
129
+
130
+ You are looking for a difference, and the fastest way to see one is a side-by-side.
131
+
132
+ - **Find a working example** — similar code in the same codebase that behaves correctly
133
+ - **Read the reference completely** if you are following a pattern. Every line. Skimming a
134
+ reference and adapting "the idea" is how half-understood patterns ship
135
+ - **List every difference**, however small. Do not filter by "that can't matter" — that
136
+ judgement is exactly what you do not have yet
137
+ - **Check the dependencies**: what config, what environment, what other components does
138
+ the working one have that the broken one does not?
139
+
140
+ ---
141
+
142
+ ## Phase 3 — One Hypothesis, One Variable
143
+
144
+ - **State it in writing:** "I think X is the cause, because Y." Specific, not vague.
145
+ - **Test it with the smallest possible change.** One variable. A controlled test that
146
+ isolates your suspect beats a plausible story about the most recent commit.
147
+ - **Read the result honestly.** Confirmed → Phase 4. Not confirmed → form a *new*
148
+ hypothesis. Never stack a second fix on top of an unconfirmed first one.
149
+ - **Say when you do not know.** "I don't understand why X happens" is a real state and a
150
+ useful thing to report. Pretending to know produces confident wrong fixes.
151
+
152
+ ---
153
+
154
+ ## Phase 4 — Fix at the Source
155
+
156
+ ### 1. Write the failing test first
157
+
158
+ The simplest reproduction you can manage — an automated test if there is a suite, a
159
+ throwaway script if there is not.
160
+
161
+ **Run it against the unfixed code and watch it fail, for the reason you expect.** A
162
+ test written after the fix, or one that passes both before and after, proves nothing.
163
+ This is the step that converts your hypothesis into evidence.
164
+
165
+ ### 2. Make one change
166
+
167
+ Fix the cause you identified. One change. No "while I'm here" improvements, no bundled
168
+ refactoring — those make it impossible to tell what actually worked.
169
+
170
+ ### 3. Verify
171
+
172
+ Does the new test pass? Does the rest of the suite still pass? Is the original symptom
173
+ actually gone — checked, not assumed?
174
+
175
+ ### 4. If the fix did not work, stop and count
176
+
177
+ Under three attempts: return to Phase 1 with what you just learned. The failed attempt
178
+ is evidence.
179
+
180
+ **Three or more failed fixes means you have the wrong model of the problem.** Do not
181
+ attempt a fourth. The pattern to watch for: each fix uncovers a new problem somewhere
182
+ else, or each one needs "just a bit of refactoring" to land.
183
+
184
+ That is an architecture question, not a hypothesis question. Stop and raise it.
185
+
186
+ ---
187
+
188
+ ## Red Flags — Stop and Return to Phase 1
189
+
190
+ - "Quick fix now, investigate later"
191
+ - "Just try changing X and see"
192
+ - Several changes at once, then run the tests
193
+ - "Skip the test, I'll check it by hand"
194
+ - "It's probably X" — probably is not a cause
195
+ - "I don't fully understand this, but this might work"
196
+ - Listing fixes before tracing where the bad value came from
197
+ - "One more attempt" when two have already failed
198
+ - Each fix revealing a new problem somewhere else
199
+
200
+ ## Quick Reference
201
+
202
+ | Phase | You do | Done when |
203
+ |---|---|---|
204
+ | **1. Evidence** | Read the error, reproduce, check changes, instrument boundaries, trace the value back | You can say what happened and where it started |
205
+ | **2. Compare** | Find a working case, read it fully, list every difference | You know what is different |
206
+ | **3. Hypothesis** | State one cause, test one variable | Confirmed, or you have a new hypothesis |
207
+ | **4. Fix** | Failing test first, one change, verify | The test that failed now passes, and nothing else broke |
208
+
209
+ ## When There Really Is No Root Cause
210
+
211
+ It happens — a genuine race, an upstream bug, a hardware fault. But roughly nineteen
212
+ times in twenty, "no root cause" means the investigation stopped early.
213
+
214
+ Before you conclude it: can you reproduce it? Did you instrument every boundary? Did
215
+ you trace the value to its origin, or only to the last function you recognised?
216
+
217
+ ## Related
218
+
219
+ - **AGENT_RULES.md → Testing Standards** — what makes the Phase 4 test a real one
220
+ - **`/test-generate`** — build out the suite once the cause is fixed
@@ -1,9 +1,9 @@
1
1
  ---
2
2
  name: security
3
3
  description: Security audit — recurring six, injection, auth, trust boundaries
4
- usage: /security
5
4
  argument-hint: [file, directory, or leave empty for full scan]
6
5
  allowed-tools: Read, Grep, Glob, Bash(git log:*), Bash(git grep:*), Bash(rg:*)
6
+ disable-model-invocation: true
7
7
  ---
8
8
  Audit $ARGUMENTS for security vulnerabilities. **Reports, never edits** — it
9
9
  verifies every claim, then hands the findings to whoever asked.
@@ -1,8 +1,8 @@
1
1
  ---
2
2
  name: ship
3
3
  description: Mechanical pre-deploy gate — tests, build, tree state
4
- usage: /ship
5
4
  allowed-tools: Read, Grep, Glob, Bash(git:*), Bash(npm:*), Bash(pnpm:*), Bash(yarn:*), Bash(pytest:*), Bash(python:*), Bash(go:*), Bash(cargo:*), Bash(make:*)
5
+ disable-model-invocation: true
6
6
  ---
7
7
  Mechanical pre-deploy / pre-merge gate. Every item here is answerable by
8
8
  **running a command** and reading its exit code — no code judgment. Code
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -1,9 +1,8 @@
1
1
  ---
2
2
  name: skill-creator
3
3
  description: Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.
4
- usage: /skill-creator <skill-type> <skill-description>
5
- auto_trigger: false
6
4
  license: Complete terms in LICENSE.txt
5
+ allowed-tools: Read, Grep, Glob
7
6
  ---
8
7
 
9
8
  # Skill Creator
@@ -1,8 +1,9 @@
1
1
  ---
2
2
  name: stash
3
3
  description: Stash session context [name]
4
- usage: /stash ["optional-name"]
5
4
  argument-hint: [optional stash name]
5
+ allowed-tools: Read, Grep, Glob
6
+ disable-model-invocation: true
6
7
  ---
7
8
 
8
9
  Save session context for compaction recovery or handoffs.
@@ -1,9 +1,9 @@
1
1
  ---
2
2
  name: test-generate
3
3
  description: Generate and run tests [file]
4
- usage: /test-generate <file>
5
4
  argument-hint: [file or symbol to test]
6
5
  allowed-tools: Read, Edit, Write, Grep, Glob, Bash(npm test:*), Bash(npx jest:*), Bash(npx vitest:*), Bash(pnpm test:*), Bash(yarn test:*), Bash(pytest:*), Bash(python:*), Bash(go test:*), Bash(cargo test:*), Bash(make test:*)
6
+ disable-model-invocation: true
7
7
  ---
8
8
  Generate tests for $ARGUMENTS, then run them. This is a generate → run →
9
9
  verify loop, not just file generation.
@@ -28,7 +28,7 @@ Match existing patterns:
28
28
  or new test-runner config.
29
29
  - Do **not** add test-only public methods or exports to production code to
30
30
  make a test possible — if the test wants a hook the prod code doesn't
31
- expose, stop and ask (`test-traps` territory).
31
+ expose, stop and ask.
32
32
 
33
33
  ## 3. Run
34
34
  Execute the project's real test command, scoped to just the new tests
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "pro": {
3
3
  "name": "Pro",
4
- "description": "Complete installation with all agents and commands",
4
+ "description": "Complete installation with all agents and skills",
5
5
  "agents": "*",
6
- "commands": "*"
6
+ "skills": "*"
7
7
  }
8
8
  }