claude-agent-skills 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +65 -0
- package/bundled-skills/ask-matt/SKILL.md +61 -0
- package/bundled-skills/brainstorming/SKILL.md +159 -0
- package/bundled-skills/brainstorming/scripts/frame-template.html +213 -0
- package/bundled-skills/brainstorming/scripts/helper.js +167 -0
- package/bundled-skills/brainstorming/scripts/server.cjs +723 -0
- package/bundled-skills/brainstorming/scripts/start-server.sh +209 -0
- package/bundled-skills/brainstorming/scripts/stop-server.sh +120 -0
- package/bundled-skills/brainstorming/spec-document-reviewer-prompt.md +49 -0
- package/bundled-skills/brainstorming/visual-companion.md +298 -0
- package/bundled-skills/cavecrew/README.md +41 -0
- package/bundled-skills/cavecrew/SKILL.md +82 -0
- package/bundled-skills/caveman/README.md +48 -0
- package/bundled-skills/caveman/SKILL.md +78 -0
- package/bundled-skills/caveman-commit/README.md +44 -0
- package/bundled-skills/caveman-commit/SKILL.md +65 -0
- package/bundled-skills/caveman-compress/README.md +163 -0
- package/bundled-skills/caveman-compress/SECURITY.md +31 -0
- package/bundled-skills/caveman-compress/SKILL.md +111 -0
- package/bundled-skills/caveman-compress/scripts/__init__.py +9 -0
- package/bundled-skills/caveman-compress/scripts/__main__.py +3 -0
- package/bundled-skills/caveman-compress/scripts/benchmark.py +80 -0
- package/bundled-skills/caveman-compress/scripts/cli.py +85 -0
- package/bundled-skills/caveman-compress/scripts/compress.py +342 -0
- package/bundled-skills/caveman-compress/scripts/detect.py +121 -0
- package/bundled-skills/caveman-compress/scripts/validate.py +213 -0
- package/bundled-skills/caveman-help/README.md +38 -0
- package/bundled-skills/caveman-help/SKILL.md +63 -0
- package/bundled-skills/caveman-review/README.md +33 -0
- package/bundled-skills/caveman-review/SKILL.md +55 -0
- package/bundled-skills/caveman-stats/README.md +30 -0
- package/bundled-skills/caveman-stats/SKILL.md +10 -0
- package/bundled-skills/codebase-design/DEEPENING.md +37 -0
- package/bundled-skills/codebase-design/DESIGN-IT-TWICE.md +44 -0
- package/bundled-skills/codebase-design/SKILL.md +114 -0
- package/bundled-skills/council/SKILL.md +77 -0
- package/bundled-skills/diagnosing-bugs/SKILL.md +134 -0
- package/bundled-skills/diagnosing-bugs/scripts/hitl-loop.template.sh +41 -0
- package/bundled-skills/dispatching-parallel-agents/SKILL.md +185 -0
- package/bundled-skills/domain-modeling/ADR-FORMAT.md +47 -0
- package/bundled-skills/domain-modeling/CONTEXT-FORMAT.md +60 -0
- package/bundled-skills/domain-modeling/SKILL.md +74 -0
- package/bundled-skills/edit-article/SKILL.md +15 -0
- package/bundled-skills/executing-plans/SKILL.md +70 -0
- package/bundled-skills/finishing-a-development-branch/SKILL.md +241 -0
- package/bundled-skills/git-guardrails-claude-code/SKILL.md +95 -0
- package/bundled-skills/git-guardrails-claude-code/scripts/block-dangerous-git.sh +25 -0
- package/bundled-skills/grill-me/SKILL.md +7 -0
- package/bundled-skills/grill-with-docs/SKILL.md +7 -0
- package/bundled-skills/grilling/SKILL.md +10 -0
- package/bundled-skills/handoff/SKILL.md +16 -0
- package/bundled-skills/i-am-dumb/SKILL.md +57 -0
- package/bundled-skills/implement/SKILL.md +15 -0
- package/bundled-skills/improve-codebase-architecture/HTML-REPORT.md +123 -0
- package/bundled-skills/improve-codebase-architecture/SKILL.md +66 -0
- package/bundled-skills/migrate-to-shoehorn/SKILL.md +118 -0
- package/bundled-skills/obsidian-vault/SKILL.md +59 -0
- package/bundled-skills/ponytail/SKILL.md +117 -0
- package/bundled-skills/ponytail-audit/SKILL.md +50 -0
- package/bundled-skills/ponytail-debt/SKILL.md +59 -0
- package/bundled-skills/ponytail-gain/SKILL.md +51 -0
- package/bundled-skills/ponytail-help/SKILL.md +43 -0
- package/bundled-skills/ponytail-review/SKILL.md +51 -0
- package/bundled-skills/prototype/LOGIC.md +79 -0
- package/bundled-skills/prototype/SKILL.md +31 -0
- package/bundled-skills/prototype/UI.md +112 -0
- package/bundled-skills/receiving-code-review/SKILL.md +213 -0
- package/bundled-skills/requesting-code-review/SKILL.md +103 -0
- package/bundled-skills/requesting-code-review/code-reviewer.md +172 -0
- package/bundled-skills/resolving-merge-conflicts/SKILL.md +14 -0
- package/bundled-skills/scaffold-exercises/SKILL.md +106 -0
- package/bundled-skills/setup-matt-pocock-skills/SKILL.md +127 -0
- package/bundled-skills/setup-matt-pocock-skills/domain.md +51 -0
- package/bundled-skills/setup-matt-pocock-skills/issue-tracker-github.md +34 -0
- package/bundled-skills/setup-matt-pocock-skills/issue-tracker-gitlab.md +35 -0
- package/bundled-skills/setup-matt-pocock-skills/issue-tracker-local.md +19 -0
- package/bundled-skills/setup-matt-pocock-skills/triage-labels.md +15 -0
- package/bundled-skills/setup-pre-commit/SKILL.md +91 -0
- package/bundled-skills/subagent-driven-development/SKILL.md +418 -0
- package/bundled-skills/subagent-driven-development/implementer-prompt.md +139 -0
- package/bundled-skills/subagent-driven-development/scripts/review-package +44 -0
- package/bundled-skills/subagent-driven-development/scripts/sdd-workspace +22 -0
- package/bundled-skills/subagent-driven-development/scripts/task-brief +40 -0
- package/bundled-skills/subagent-driven-development/task-reviewer-prompt.md +188 -0
- package/bundled-skills/systematic-debugging/CREATION-LOG.md +119 -0
- package/bundled-skills/systematic-debugging/SKILL.md +296 -0
- package/bundled-skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
- package/bundled-skills/systematic-debugging/condition-based-waiting.md +115 -0
- package/bundled-skills/systematic-debugging/defense-in-depth.md +122 -0
- package/bundled-skills/systematic-debugging/find-polluter.sh +63 -0
- package/bundled-skills/systematic-debugging/root-cause-tracing.md +169 -0
- package/bundled-skills/systematic-debugging/test-academic.md +14 -0
- package/bundled-skills/systematic-debugging/test-pressure-1.md +58 -0
- package/bundled-skills/systematic-debugging/test-pressure-2.md +68 -0
- package/bundled-skills/systematic-debugging/test-pressure-3.md +69 -0
- package/bundled-skills/tdd/SKILL.md +108 -0
- package/bundled-skills/tdd/mocking.md +59 -0
- package/bundled-skills/tdd/refactoring.md +10 -0
- package/bundled-skills/tdd/tests.md +61 -0
- package/bundled-skills/teach/GLOSSARY-FORMAT.md +35 -0
- package/bundled-skills/teach/LEARNING-RECORD-FORMAT.md +46 -0
- package/bundled-skills/teach/MISSION-FORMAT.md +31 -0
- package/bundled-skills/teach/RESOURCES-FORMAT.md +32 -0
- package/bundled-skills/teach/SKILL.md +140 -0
- package/bundled-skills/test-driven-development/SKILL.md +371 -0
- package/bundled-skills/test-driven-development/testing-anti-patterns.md +299 -0
- package/bundled-skills/to-issues/SKILL.md +84 -0
- package/bundled-skills/to-prd/SKILL.md +75 -0
- package/bundled-skills/triage/AGENT-BRIEF.md +207 -0
- package/bundled-skills/triage/OUT-OF-SCOPE.md +105 -0
- package/bundled-skills/triage/SKILL.md +112 -0
- package/bundled-skills/using-git-worktrees/SKILL.md +202 -0
- package/bundled-skills/using-superpowers/SKILL.md +121 -0
- package/bundled-skills/using-superpowers/references/antigravity-tools.md +96 -0
- package/bundled-skills/using-superpowers/references/claude-code-tools.md +50 -0
- package/bundled-skills/using-superpowers/references/codex-tools.md +72 -0
- package/bundled-skills/using-superpowers/references/copilot-tools.md +49 -0
- package/bundled-skills/using-superpowers/references/gemini-tools.md +63 -0
- package/bundled-skills/using-superpowers/references/pi-tools.md +28 -0
- package/bundled-skills/verification-before-completion/SKILL.md +139 -0
- package/bundled-skills/writing-great-skills/GLOSSARY.md +195 -0
- package/bundled-skills/writing-great-skills/SKILL.md +82 -0
- package/bundled-skills/writing-plans/SKILL.md +174 -0
- package/bundled-skills/writing-plans/plan-document-reviewer-prompt.md +49 -0
- package/bundled-skills/writing-skills/SKILL.md +689 -0
- package/bundled-skills/writing-skills/anthropic-best-practices.md +1150 -0
- package/bundled-skills/writing-skills/examples/CLAUDE_MD_TESTING.md +189 -0
- package/bundled-skills/writing-skills/graphviz-conventions.dot +172 -0
- package/bundled-skills/writing-skills/persuasion-principles.md +187 -0
- package/bundled-skills/writing-skills/render-graphs.js +168 -0
- package/bundled-skills/writing-skills/testing-skills-with-subagents.md +384 -0
- package/commands/add.js +97 -0
- package/commands/check.js +54 -0
- package/commands/exportSkills.js +30 -0
- package/commands/hub.js +52 -0
- package/commands/importSkills.js +68 -0
- package/commands/list.js +37 -0
- package/commands/remove.js +59 -0
- package/commands/sync.js +66 -0
- package/commands/update.js +70 -0
- package/index.js +100 -0
- package/lib/banner.js +108 -0
- package/lib/constants.js +10 -0
- package/lib/deps.js +51 -0
- package/lib/hash.js +26 -0
- package/lib/install.js +31 -0
- package/lib/lockfile.js +37 -0
- package/lib/prompts.js +50 -0
- package/lib/scope.js +19 -0
- package/lib/summary.js +108 -0
- package/lib/theme.js +11 -0
- package/package.json +43 -0
- package/skills.json +164 -0
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
# Task Reviewer Prompt Template
|
|
2
|
+
|
|
3
|
+
Use this template when dispatching a task reviewer subagent. The reviewer
|
|
4
|
+
reads the task's diff once and returns two verdicts: spec compliance and
|
|
5
|
+
code quality.
|
|
6
|
+
|
|
7
|
+
**Purpose:** Verify one task's implementation matches its requirements (nothing
|
|
8
|
+
more, nothing less) and is well-built (clean, tested, maintainable)
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
Subagent (general-purpose):
|
|
12
|
+
description: "Review Task N (spec + quality)"
|
|
13
|
+
model: [MODEL — REQUIRED: choose per SKILL.md Model Selection; an omitted
|
|
14
|
+
model silently inherits the session's most expensive one]
|
|
15
|
+
prompt: |
|
|
16
|
+
You are reviewing one task's implementation: first whether it matches its
|
|
17
|
+
requirements, then whether it is well-built. This is a task-scoped gate,
|
|
18
|
+
not a merge review — a broad whole-branch review happens separately after
|
|
19
|
+
all tasks are complete.
|
|
20
|
+
|
|
21
|
+
## What Was Requested
|
|
22
|
+
|
|
23
|
+
Read the task brief: [BRIEF_FILE]
|
|
24
|
+
|
|
25
|
+
Global constraints from the spec/design that bind this task:
|
|
26
|
+
[GLOBAL_CONSTRAINTS]
|
|
27
|
+
|
|
28
|
+
## What the Implementer Claims They Built
|
|
29
|
+
|
|
30
|
+
Read the implementer's report: [REPORT_FILE]
|
|
31
|
+
|
|
32
|
+
## Diff Under Review
|
|
33
|
+
|
|
34
|
+
**Base:** [BASE_SHA]
|
|
35
|
+
**Head:** [HEAD_SHA]
|
|
36
|
+
**Diff file:** [DIFF_FILE]
|
|
37
|
+
|
|
38
|
+
Read the diff file once — it contains the commit list, a stat summary,
|
|
39
|
+
and the full diff with surrounding context, and it is your view of the
|
|
40
|
+
change. The diff's context lines ARE the changed files: do not Read a
|
|
41
|
+
changed file separately unless a hunk you must judge is cut off
|
|
42
|
+
mid-function — and say so in your report. Do not re-run git commands.
|
|
43
|
+
If the diff file is missing, fetch the diff yourself:
|
|
44
|
+
`git diff --stat [BASE_SHA]..[HEAD_SHA]` and `git diff [BASE_SHA]..[HEAD_SHA]`.
|
|
45
|
+
Do not crawl the broader codebase. Inspect code outside the diff only
|
|
46
|
+
to evaluate a concrete risk you can name — one focused check per named
|
|
47
|
+
risk, and name both the risk and what you checked in your report.
|
|
48
|
+
Cross-cutting changes are legitimate named risks: if the diff changes
|
|
49
|
+
lock ordering, a function or API contract, or shared mutable state,
|
|
50
|
+
checking the call sites is the right method.
|
|
51
|
+
|
|
52
|
+
Your review is read-only on this checkout. Do not mutate the working
|
|
53
|
+
tree, the index, HEAD, or branch state in any way.
|
|
54
|
+
|
|
55
|
+
## Do Not Trust the Report
|
|
56
|
+
|
|
57
|
+
Treat the implementer's report as unverified claims about the code. It
|
|
58
|
+
may be incomplete, inaccurate, or optimistic. Verify the claims against
|
|
59
|
+
the diff. Design rationales in the report are claims too: "left it per
|
|
60
|
+
YAGNI," "kept it simple deliberately," or any other justification is the
|
|
61
|
+
implementer grading their own work. Judge the code on its merits — a
|
|
62
|
+
stated rationale never downgrades a finding's severity.
|
|
63
|
+
|
|
64
|
+
## Tests
|
|
65
|
+
|
|
66
|
+
The implementer already ran the tests and reported results with TDD
|
|
67
|
+
evidence for exactly this code. Do not re-run the suite to confirm their
|
|
68
|
+
report. Run a test only when reading the code raises a specific doubt
|
|
69
|
+
that no existing run answers — and then a focused test, never a
|
|
70
|
+
package-wide suite, race detector run, or repeated/high-count loop. If
|
|
71
|
+
heavy validation seems warranted, recommend it in your report instead of
|
|
72
|
+
running it. If you cannot run commands in this environment, name the
|
|
73
|
+
test you would run.
|
|
74
|
+
|
|
75
|
+
Warnings or other noise in the implementer's reported test output are
|
|
76
|
+
findings — test output should be pristine.
|
|
77
|
+
|
|
78
|
+
## Part 1: Spec Compliance
|
|
79
|
+
|
|
80
|
+
Compare the diff against What Was Requested:
|
|
81
|
+
|
|
82
|
+
- **Missing:** requirements they skipped, missed, or claimed without
|
|
83
|
+
implementing
|
|
84
|
+
- **Extra:** features that weren't requested, over-engineering, unneeded
|
|
85
|
+
"nice to haves"
|
|
86
|
+
- **Misunderstood:** right feature built the wrong way, wrong problem
|
|
87
|
+
solved
|
|
88
|
+
|
|
89
|
+
If a requirement cannot be verified from this diff alone (it lives in
|
|
90
|
+
unchanged code or spans tasks), report it as a ⚠️ item instead of
|
|
91
|
+
broadening your search.
|
|
92
|
+
|
|
93
|
+
## Part 2: Code Quality
|
|
94
|
+
|
|
95
|
+
**Code quality:**
|
|
96
|
+
- Clean separation of concerns?
|
|
97
|
+
- Proper error handling?
|
|
98
|
+
- DRY without premature abstraction?
|
|
99
|
+
- Edge cases handled?
|
|
100
|
+
|
|
101
|
+
**Tests:**
|
|
102
|
+
- Do the new and changed tests verify real behavior, not mocks?
|
|
103
|
+
- Are the task's edge cases covered?
|
|
104
|
+
|
|
105
|
+
**Structure:**
|
|
106
|
+
- Does each file have one clear responsibility with a well-defined interface?
|
|
107
|
+
- Are units decomposed so they can be understood and tested independently?
|
|
108
|
+
- Is the implementation following the file structure from the plan?
|
|
109
|
+
- Did this change create new files that are already large, or
|
|
110
|
+
significantly grow existing files? (Don't flag pre-existing file
|
|
111
|
+
sizes — focus on what this change contributed.)
|
|
112
|
+
|
|
113
|
+
Your report should point at evidence: file:line references for every
|
|
114
|
+
finding and for any check you would otherwise answer with a bare
|
|
115
|
+
"yes." A tight report that cites lines gives the controller everything
|
|
116
|
+
it needs.
|
|
117
|
+
|
|
118
|
+
Your final message is the report itself: begin directly with the
|
|
119
|
+
spec-compliance verdict. Every line is a verdict, a finding with
|
|
120
|
+
file:line, or a check you ran — no preamble, no process narration,
|
|
121
|
+
no closing summary.
|
|
122
|
+
|
|
123
|
+
## Calibration
|
|
124
|
+
|
|
125
|
+
Categorize issues by actual severity. Not everything is Critical.
|
|
126
|
+
Important means this task cannot be trusted until it is fixed: incorrect
|
|
127
|
+
or fragile behavior, a missed requirement, or maintainability damage you
|
|
128
|
+
would block a merge over — verbatim duplication of a logic block,
|
|
129
|
+
swallowed errors, tests that assert nothing. "Coverage could be broader"
|
|
130
|
+
and polish suggestions are Minor.
|
|
131
|
+
If the plan or brief explicitly mandates something this rubric calls a
|
|
132
|
+
defect (a test that asserts nothing, verbatim duplication of a logic
|
|
133
|
+
block), that IS a finding — report it as Important, labeled
|
|
134
|
+
plan-mandated. The plan's authorship does not grade its own work; the
|
|
135
|
+
human decides.
|
|
136
|
+
Acknowledge what was done well before listing issues — accurate praise
|
|
137
|
+
helps the implementer trust the rest of the feedback.
|
|
138
|
+
|
|
139
|
+
## Output Format
|
|
140
|
+
|
|
141
|
+
### Spec Compliance
|
|
142
|
+
|
|
143
|
+
- ✅ Spec compliant | ❌ Issues found: [what's missing/extra/misunderstood,
|
|
144
|
+
with file:line references]
|
|
145
|
+
- ⚠️ Cannot verify from diff: [requirements you could not verify from the
|
|
146
|
+
diff alone, and what the controller should check — report alongside the
|
|
147
|
+
✅/❌ verdict for everything you could verify]
|
|
148
|
+
|
|
149
|
+
### Strengths
|
|
150
|
+
[What's well done? Be specific.]
|
|
151
|
+
|
|
152
|
+
### Issues
|
|
153
|
+
|
|
154
|
+
#### Critical (Must Fix)
|
|
155
|
+
#### Important (Should Fix)
|
|
156
|
+
#### Minor (Nice to Have)
|
|
157
|
+
|
|
158
|
+
For each issue: file:line, what's wrong, why it matters, how to fix
|
|
159
|
+
(if not obvious).
|
|
160
|
+
|
|
161
|
+
### Assessment
|
|
162
|
+
|
|
163
|
+
**Task quality:** [Approved | Needs fixes]
|
|
164
|
+
|
|
165
|
+
**Reasoning:** [1-2 sentence technical assessment]
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
**Placeholders:**
|
|
169
|
+
- `[MODEL]` — REQUIRED: reviewer model per SKILL.md Model Selection
|
|
170
|
+
- `[BRIEF_FILE]` — REQUIRED: the task brief file (`scripts/task-brief PLAN N`
|
|
171
|
+
prints the path; same file the implementer worked from)
|
|
172
|
+
- `[GLOBAL_CONSTRAINTS]` — the binding requirements copied verbatim from
|
|
173
|
+
the plan's Global Constraints section or the spec: exact values, formats,
|
|
174
|
+
and stated relationships between components (not process rules — those
|
|
175
|
+
are already in this template)
|
|
176
|
+
- `[REPORT_FILE]` — REQUIRED: the file the implementer wrote its detailed
|
|
177
|
+
report to
|
|
178
|
+
- `[BASE_SHA]` — commit before this task
|
|
179
|
+
- `[HEAD_SHA]` — current commit
|
|
180
|
+
- `[DIFF_FILE]` — REQUIRED: the path the controller wrote the review
|
|
181
|
+
package to (`scripts/review-package BASE HEAD` prints the unique path it
|
|
182
|
+
wrote; the package never enters the controller's context)
|
|
183
|
+
|
|
184
|
+
**Reviewer returns:** Spec Compliance verdict (✅/❌/⚠️), Strengths, Issues
|
|
185
|
+
(Critical/Important/Minor), Task quality verdict
|
|
186
|
+
|
|
187
|
+
A fix dispatch can address spec gaps and quality findings together;
|
|
188
|
+
re-review after fixes covers both verdicts.
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# Creation Log: Systematic Debugging Skill
|
|
2
|
+
|
|
3
|
+
Reference example of extracting, structuring, and bulletproofing a critical skill.
|
|
4
|
+
|
|
5
|
+
## Source Material
|
|
6
|
+
|
|
7
|
+
Extracted debugging framework from `~/.claude/CLAUDE.md`:
|
|
8
|
+
- 4-phase systematic process (Investigation → Pattern Analysis → Hypothesis → Implementation)
|
|
9
|
+
- Core mandate: ALWAYS find root cause, NEVER fix symptoms
|
|
10
|
+
- Rules designed to resist time pressure and rationalization
|
|
11
|
+
|
|
12
|
+
## Extraction Decisions
|
|
13
|
+
|
|
14
|
+
**What to include:**
|
|
15
|
+
- Complete 4-phase framework with all rules
|
|
16
|
+
- Anti-shortcuts ("NEVER fix symptom", "STOP and re-analyze")
|
|
17
|
+
- Pressure-resistant language ("even if faster", "even if I seem in a hurry")
|
|
18
|
+
- Concrete steps for each phase
|
|
19
|
+
|
|
20
|
+
**What to leave out:**
|
|
21
|
+
- Project-specific context
|
|
22
|
+
- Repetitive variations of same rule
|
|
23
|
+
- Narrative explanations (condensed to principles)
|
|
24
|
+
|
|
25
|
+
## Structure Following skill-creation/SKILL.md
|
|
26
|
+
|
|
27
|
+
1. **Rich when_to_use** - Included symptoms and anti-patterns
|
|
28
|
+
2. **Type: technique** - Concrete process with steps
|
|
29
|
+
3. **Keywords** - "root cause", "symptom", "workaround", "debugging", "investigation"
|
|
30
|
+
4. **Flowchart** - Decision point for "fix failed" → re-analyze vs add more fixes
|
|
31
|
+
5. **Phase-by-phase breakdown** - Scannable checklist format
|
|
32
|
+
6. **Anti-patterns section** - What NOT to do (critical for this skill)
|
|
33
|
+
|
|
34
|
+
## Bulletproofing Elements
|
|
35
|
+
|
|
36
|
+
Framework designed to resist rationalization under pressure:
|
|
37
|
+
|
|
38
|
+
### Language Choices
|
|
39
|
+
- "ALWAYS" / "NEVER" (not "should" / "try to")
|
|
40
|
+
- "even if faster" / "even if I seem in a hurry"
|
|
41
|
+
- "STOP and re-analyze" (explicit pause)
|
|
42
|
+
- "Don't skip past" (catches the actual behavior)
|
|
43
|
+
|
|
44
|
+
### Structural Defenses
|
|
45
|
+
- **Phase 1 required** - Can't skip to implementation
|
|
46
|
+
- **Single hypothesis rule** - Forces thinking, prevents shotgun fixes
|
|
47
|
+
- **Explicit failure mode** - "IF your first fix doesn't work" with mandatory action
|
|
48
|
+
- **Anti-patterns section** - Shows exactly what shortcuts look like
|
|
49
|
+
|
|
50
|
+
### Redundancy
|
|
51
|
+
- Root cause mandate in overview + when_to_use + Phase 1 + implementation rules
|
|
52
|
+
- "NEVER fix symptom" appears 4 times in different contexts
|
|
53
|
+
- Each phase has explicit "don't skip" guidance
|
|
54
|
+
|
|
55
|
+
## Testing Approach
|
|
56
|
+
|
|
57
|
+
Created 4 validation tests following skills/meta/testing-skills-with-subagents:
|
|
58
|
+
|
|
59
|
+
### Test 1: Academic Context (No Pressure)
|
|
60
|
+
- Simple bug, no time pressure
|
|
61
|
+
- **Result:** Perfect compliance, complete investigation
|
|
62
|
+
|
|
63
|
+
### Test 2: Time Pressure + Obvious Quick Fix
|
|
64
|
+
- User "in a hurry", symptom fix looks easy
|
|
65
|
+
- **Result:** Resisted shortcut, followed full process, found real root cause
|
|
66
|
+
|
|
67
|
+
### Test 3: Complex System + Uncertainty
|
|
68
|
+
- Multi-layer failure, unclear if can find root cause
|
|
69
|
+
- **Result:** Systematic investigation, traced through all layers, found source
|
|
70
|
+
|
|
71
|
+
### Test 4: Failed First Fix
|
|
72
|
+
- Hypothesis doesn't work, temptation to add more fixes
|
|
73
|
+
- **Result:** Stopped, re-analyzed, formed new hypothesis (no shotgun)
|
|
74
|
+
|
|
75
|
+
**All tests passed.** No rationalizations found.
|
|
76
|
+
|
|
77
|
+
## Iterations
|
|
78
|
+
|
|
79
|
+
### Initial Version
|
|
80
|
+
- Complete 4-phase framework
|
|
81
|
+
- Anti-patterns section
|
|
82
|
+
- Flowchart for "fix failed" decision
|
|
83
|
+
|
|
84
|
+
### Enhancement 1: TDD Reference
|
|
85
|
+
- Added link to skills/testing/test-driven-development
|
|
86
|
+
- Note explaining TDD's "simplest code" ≠ debugging's "root cause"
|
|
87
|
+
- Prevents confusion between methodologies
|
|
88
|
+
|
|
89
|
+
## Final Outcome
|
|
90
|
+
|
|
91
|
+
Bulletproof skill that:
|
|
92
|
+
- ✅ Clearly mandates root cause investigation
|
|
93
|
+
- ✅ Resists time pressure rationalization
|
|
94
|
+
- ✅ Provides concrete steps for each phase
|
|
95
|
+
- ✅ Shows anti-patterns explicitly
|
|
96
|
+
- ✅ Tested under multiple pressure scenarios
|
|
97
|
+
- ✅ Clarifies relationship to TDD
|
|
98
|
+
- ✅ Ready for use
|
|
99
|
+
|
|
100
|
+
## Key Insight
|
|
101
|
+
|
|
102
|
+
**Most important bulletproofing:** Anti-patterns section showing exact shortcuts that feel justified in the moment. When Claude thinks "I'll just add this one quick fix", seeing that exact pattern listed as wrong creates cognitive friction.
|
|
103
|
+
|
|
104
|
+
## Usage Example
|
|
105
|
+
|
|
106
|
+
When encountering a bug:
|
|
107
|
+
1. Load skill: skills/debugging/systematic-debugging
|
|
108
|
+
2. Read overview (10 sec) - reminded of mandate
|
|
109
|
+
3. Follow Phase 1 checklist - forced investigation
|
|
110
|
+
4. If tempted to skip - see anti-pattern, stop
|
|
111
|
+
5. Complete all phases - root cause found
|
|
112
|
+
|
|
113
|
+
**Time investment:** 5-10 minutes
|
|
114
|
+
**Time saved:** Hours of symptom-whack-a-mole
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
*Created: 2025-10-03*
|
|
119
|
+
*Purpose: Reference example for skill extraction and bulletproofing*
|
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: systematic-debugging
|
|
3
|
+
description: Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Systematic Debugging
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Random fixes waste time and create new bugs. Quick patches mask underlying issues.
|
|
11
|
+
|
|
12
|
+
**Core principle:** ALWAYS find root cause before attempting fixes. Symptom fixes are failure.
|
|
13
|
+
|
|
14
|
+
**Violating the letter of this process is violating the spirit of debugging.**
|
|
15
|
+
|
|
16
|
+
## The Iron Law
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
If you haven't completed Phase 1, you cannot propose fixes.
|
|
23
|
+
|
|
24
|
+
## When to Use
|
|
25
|
+
|
|
26
|
+
Use for ANY technical issue:
|
|
27
|
+
- Test failures
|
|
28
|
+
- Bugs in production
|
|
29
|
+
- Unexpected behavior
|
|
30
|
+
- Performance problems
|
|
31
|
+
- Build failures
|
|
32
|
+
- Integration issues
|
|
33
|
+
|
|
34
|
+
**Use this ESPECIALLY when:**
|
|
35
|
+
- Under time pressure (emergencies make guessing tempting)
|
|
36
|
+
- "Just one quick fix" seems obvious
|
|
37
|
+
- You've already tried multiple fixes
|
|
38
|
+
- Previous fix didn't work
|
|
39
|
+
- You don't fully understand the issue
|
|
40
|
+
|
|
41
|
+
**Don't skip when:**
|
|
42
|
+
- Issue seems simple (simple bugs have root causes too)
|
|
43
|
+
- You're in a hurry (rushing guarantees rework)
|
|
44
|
+
- Manager wants it fixed NOW (systematic is faster than thrashing)
|
|
45
|
+
|
|
46
|
+
## The Four Phases
|
|
47
|
+
|
|
48
|
+
You MUST complete each phase before proceeding to the next.
|
|
49
|
+
|
|
50
|
+
### Phase 1: Root Cause Investigation
|
|
51
|
+
|
|
52
|
+
**BEFORE attempting ANY fix:**
|
|
53
|
+
|
|
54
|
+
1. **Read Error Messages Carefully**
|
|
55
|
+
- Don't skip past errors or warnings
|
|
56
|
+
- They often contain the exact solution
|
|
57
|
+
- Read stack traces completely
|
|
58
|
+
- Note line numbers, file paths, error codes
|
|
59
|
+
|
|
60
|
+
2. **Reproduce Consistently**
|
|
61
|
+
- Can you trigger it reliably?
|
|
62
|
+
- What are the exact steps?
|
|
63
|
+
- Does it happen every time?
|
|
64
|
+
- If not reproducible → gather more data, don't guess
|
|
65
|
+
|
|
66
|
+
3. **Check Recent Changes**
|
|
67
|
+
- What changed that could cause this?
|
|
68
|
+
- Git diff, recent commits
|
|
69
|
+
- New dependencies, config changes
|
|
70
|
+
- Environmental differences
|
|
71
|
+
|
|
72
|
+
4. **Gather Evidence in Multi-Component Systems**
|
|
73
|
+
|
|
74
|
+
**WHEN system has multiple components (CI → build → signing, API → service → database):**
|
|
75
|
+
|
|
76
|
+
**BEFORE proposing fixes, add diagnostic instrumentation:**
|
|
77
|
+
```
|
|
78
|
+
For EACH component boundary:
|
|
79
|
+
- Log what data enters component
|
|
80
|
+
- Log what data exits component
|
|
81
|
+
- Verify environment/config propagation
|
|
82
|
+
- Check state at each layer
|
|
83
|
+
|
|
84
|
+
Run once to gather evidence showing WHERE it breaks
|
|
85
|
+
THEN analyze evidence to identify failing component
|
|
86
|
+
THEN investigate that specific component
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
**Example (multi-layer system):**
|
|
90
|
+
```bash
|
|
91
|
+
# Layer 1: Workflow
|
|
92
|
+
echo "=== Secrets available in workflow: ==="
|
|
93
|
+
echo "IDENTITY: ${IDENTITY:+SET}${IDENTITY:-UNSET}"
|
|
94
|
+
|
|
95
|
+
# Layer 2: Build script
|
|
96
|
+
echo "=== Env vars in build script: ==="
|
|
97
|
+
env | grep IDENTITY || echo "IDENTITY not in environment"
|
|
98
|
+
|
|
99
|
+
# Layer 3: Signing script
|
|
100
|
+
echo "=== Keychain state: ==="
|
|
101
|
+
security list-keychains
|
|
102
|
+
security find-identity -v
|
|
103
|
+
|
|
104
|
+
# Layer 4: Actual signing
|
|
105
|
+
codesign --sign "$IDENTITY" --verbose=4 "$APP"
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
**This reveals:** Which layer fails (secrets → workflow ✓, workflow → build ✗)
|
|
109
|
+
|
|
110
|
+
5. **Trace Data Flow**
|
|
111
|
+
|
|
112
|
+
**WHEN error is deep in call stack:**
|
|
113
|
+
|
|
114
|
+
See `root-cause-tracing.md` in this directory for the complete backward tracing technique.
|
|
115
|
+
|
|
116
|
+
**Quick version:**
|
|
117
|
+
- Where does bad value originate?
|
|
118
|
+
- What called this with bad value?
|
|
119
|
+
- Keep tracing up until you find the source
|
|
120
|
+
- Fix at source, not at symptom
|
|
121
|
+
|
|
122
|
+
### Phase 2: Pattern Analysis
|
|
123
|
+
|
|
124
|
+
**Find the pattern before fixing:**
|
|
125
|
+
|
|
126
|
+
1. **Find Working Examples**
|
|
127
|
+
- Locate similar working code in same codebase
|
|
128
|
+
- What works that's similar to what's broken?
|
|
129
|
+
|
|
130
|
+
2. **Compare Against References**
|
|
131
|
+
- If implementing pattern, read reference implementation COMPLETELY
|
|
132
|
+
- Don't skim - read every line
|
|
133
|
+
- Understand the pattern fully before applying
|
|
134
|
+
|
|
135
|
+
3. **Identify Differences**
|
|
136
|
+
- What's different between working and broken?
|
|
137
|
+
- List every difference, however small
|
|
138
|
+
- Don't assume "that can't matter"
|
|
139
|
+
|
|
140
|
+
4. **Understand Dependencies**
|
|
141
|
+
- What other components does this need?
|
|
142
|
+
- What settings, config, environment?
|
|
143
|
+
- What assumptions does it make?
|
|
144
|
+
|
|
145
|
+
### Phase 3: Hypothesis and Testing
|
|
146
|
+
|
|
147
|
+
**Scientific method:**
|
|
148
|
+
|
|
149
|
+
1. **Form Single Hypothesis**
|
|
150
|
+
- State clearly: "I think X is the root cause because Y"
|
|
151
|
+
- Write it down
|
|
152
|
+
- Be specific, not vague
|
|
153
|
+
|
|
154
|
+
2. **Test Minimally**
|
|
155
|
+
- Make the SMALLEST possible change to test hypothesis
|
|
156
|
+
- One variable at a time
|
|
157
|
+
- Don't fix multiple things at once
|
|
158
|
+
|
|
159
|
+
3. **Verify Before Continuing**
|
|
160
|
+
- Did it work? Yes → Phase 4
|
|
161
|
+
- Didn't work? Form NEW hypothesis
|
|
162
|
+
- DON'T add more fixes on top
|
|
163
|
+
|
|
164
|
+
4. **When You Don't Know**
|
|
165
|
+
- Say "I don't understand X"
|
|
166
|
+
- Don't pretend to know
|
|
167
|
+
- Ask for help
|
|
168
|
+
- Research more
|
|
169
|
+
|
|
170
|
+
### Phase 4: Implementation
|
|
171
|
+
|
|
172
|
+
**Fix the root cause, not the symptom:**
|
|
173
|
+
|
|
174
|
+
1. **Create Failing Test Case**
|
|
175
|
+
- Simplest possible reproduction
|
|
176
|
+
- Automated test if possible
|
|
177
|
+
- One-off test script if no framework
|
|
178
|
+
- MUST have before fixing
|
|
179
|
+
- Use the `superpowers:test-driven-development` skill for writing proper failing tests
|
|
180
|
+
|
|
181
|
+
2. **Implement Single Fix**
|
|
182
|
+
- Address the root cause identified
|
|
183
|
+
- ONE change at a time
|
|
184
|
+
- No "while I'm here" improvements
|
|
185
|
+
- No bundled refactoring
|
|
186
|
+
|
|
187
|
+
3. **Verify Fix**
|
|
188
|
+
- Test passes now?
|
|
189
|
+
- No other tests broken?
|
|
190
|
+
- Issue actually resolved?
|
|
191
|
+
|
|
192
|
+
4. **If Fix Doesn't Work**
|
|
193
|
+
- STOP
|
|
194
|
+
- Count: How many fixes have you tried?
|
|
195
|
+
- If < 3: Return to Phase 1, re-analyze with new information
|
|
196
|
+
- **If ≥ 3: STOP and question the architecture (step 5 below)**
|
|
197
|
+
- DON'T attempt Fix #4 without architectural discussion
|
|
198
|
+
|
|
199
|
+
5. **If 3+ Fixes Failed: Question Architecture**
|
|
200
|
+
|
|
201
|
+
**Pattern indicating architectural problem:**
|
|
202
|
+
- Each fix reveals new shared state/coupling/problem in different place
|
|
203
|
+
- Fixes require "massive refactoring" to implement
|
|
204
|
+
- Each fix creates new symptoms elsewhere
|
|
205
|
+
|
|
206
|
+
**STOP and question fundamentals:**
|
|
207
|
+
- Is this pattern fundamentally sound?
|
|
208
|
+
- Are we "sticking with it through sheer inertia"?
|
|
209
|
+
- Should we refactor architecture vs. continue fixing symptoms?
|
|
210
|
+
|
|
211
|
+
**Discuss with your human partner before attempting more fixes**
|
|
212
|
+
|
|
213
|
+
This is NOT a failed hypothesis - this is a wrong architecture.
|
|
214
|
+
|
|
215
|
+
## Red Flags - STOP and Follow Process
|
|
216
|
+
|
|
217
|
+
If you catch yourself thinking:
|
|
218
|
+
- "Quick fix for now, investigate later"
|
|
219
|
+
- "Just try changing X and see if it works"
|
|
220
|
+
- "Add multiple changes, run tests"
|
|
221
|
+
- "Skip the test, I'll manually verify"
|
|
222
|
+
- "It's probably X, let me fix that"
|
|
223
|
+
- "I don't fully understand but this might work"
|
|
224
|
+
- "Pattern says X but I'll adapt it differently"
|
|
225
|
+
- "Here are the main problems: [lists fixes without investigation]"
|
|
226
|
+
- Proposing solutions before tracing data flow
|
|
227
|
+
- **"One more fix attempt" (when already tried 2+)**
|
|
228
|
+
- **Each fix reveals new problem in different place**
|
|
229
|
+
|
|
230
|
+
**ALL of these mean: STOP. Return to Phase 1.**
|
|
231
|
+
|
|
232
|
+
**If 3+ fixes failed:** Question the architecture (see Phase 4.5)
|
|
233
|
+
|
|
234
|
+
## your human partner's Signals You're Doing It Wrong
|
|
235
|
+
|
|
236
|
+
**Watch for these redirections:**
|
|
237
|
+
- "Is that not happening?" - You assumed without verifying
|
|
238
|
+
- "Will it show us...?" - You should have added evidence gathering
|
|
239
|
+
- "Stop guessing" - You're proposing fixes without understanding
|
|
240
|
+
- "Ultra-think this" - Question fundamentals, not just symptoms
|
|
241
|
+
- "We're stuck?" (frustrated) - Your approach isn't working
|
|
242
|
+
|
|
243
|
+
**When you see these:** STOP. Return to Phase 1.
|
|
244
|
+
|
|
245
|
+
## Common Rationalizations
|
|
246
|
+
|
|
247
|
+
| Excuse | Reality |
|
|
248
|
+
|--------|---------|
|
|
249
|
+
| "Issue is simple, don't need process" | Simple issues have root causes too. Process is fast for simple bugs. |
|
|
250
|
+
| "Emergency, no time for process" | Systematic debugging is FASTER than guess-and-check thrashing. |
|
|
251
|
+
| "Just try this first, then investigate" | First fix sets the pattern. Do it right from the start. |
|
|
252
|
+
| "I'll write test after confirming fix works" | Untested fixes don't stick. Test first proves it. |
|
|
253
|
+
| "Multiple fixes at once saves time" | Can't isolate what worked. Causes new bugs. |
|
|
254
|
+
| "Reference too long, I'll adapt the pattern" | Partial understanding guarantees bugs. Read it completely. |
|
|
255
|
+
| "I see the problem, let me fix it" | Seeing symptoms ≠ understanding root cause. |
|
|
256
|
+
| "One more fix attempt" (after 2+ failures) | 3+ failures = architectural problem. Question pattern, don't fix again. |
|
|
257
|
+
|
|
258
|
+
## Quick Reference
|
|
259
|
+
|
|
260
|
+
| Phase | Key Activities | Success Criteria |
|
|
261
|
+
|-------|---------------|------------------|
|
|
262
|
+
| **1. Root Cause** | Read errors, reproduce, check changes, gather evidence | Understand WHAT and WHY |
|
|
263
|
+
| **2. Pattern** | Find working examples, compare | Identify differences |
|
|
264
|
+
| **3. Hypothesis** | Form theory, test minimally | Confirmed or new hypothesis |
|
|
265
|
+
| **4. Implementation** | Create test, fix, verify | Bug resolved, tests pass |
|
|
266
|
+
|
|
267
|
+
## When Process Reveals "No Root Cause"
|
|
268
|
+
|
|
269
|
+
If systematic investigation reveals issue is truly environmental, timing-dependent, or external:
|
|
270
|
+
|
|
271
|
+
1. You've completed the process
|
|
272
|
+
2. Document what you investigated
|
|
273
|
+
3. Implement appropriate handling (retry, timeout, error message)
|
|
274
|
+
4. Add monitoring/logging for future investigation
|
|
275
|
+
|
|
276
|
+
**But:** 95% of "no root cause" cases are incomplete investigation.
|
|
277
|
+
|
|
278
|
+
## Supporting Techniques
|
|
279
|
+
|
|
280
|
+
These techniques are part of systematic debugging and available in this directory:
|
|
281
|
+
|
|
282
|
+
- **`root-cause-tracing.md`** - Trace bugs backward through call stack to find original trigger
|
|
283
|
+
- **`defense-in-depth.md`** - Add validation at multiple layers after finding root cause
|
|
284
|
+
- **`condition-based-waiting.md`** - Replace arbitrary timeouts with condition polling
|
|
285
|
+
|
|
286
|
+
**Related skills:**
|
|
287
|
+
- **superpowers:test-driven-development** - For creating failing test case (Phase 4, Step 1)
|
|
288
|
+
- **superpowers:verification-before-completion** - Verify fix worked before claiming success
|
|
289
|
+
|
|
290
|
+
## Real-World Impact
|
|
291
|
+
|
|
292
|
+
From debugging sessions:
|
|
293
|
+
- Systematic approach: 15-30 minutes to fix
|
|
294
|
+
- Random fixes approach: 2-3 hours of thrashing
|
|
295
|
+
- First-time fix rate: 95% vs 40%
|
|
296
|
+
- New bugs introduced: Near zero vs common
|