@anionzo/skill 1.3.0 → 1.6.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 (57) hide show
  1. package/CONTRIBUTING.md +2 -1
  2. package/README.md +29 -10
  3. package/docs/design-brief.md +19 -13
  4. package/i18n/CONTRIBUTING.vi.md +2 -1
  5. package/i18n/README.vi.md +29 -10
  6. package/i18n/design-brief.vi.md +19 -13
  7. package/knowledge/global/skill-triggering-rules.md +2 -1
  8. package/package.json +1 -1
  9. package/scripts/install-opencode-skills +161 -12
  10. package/skills/brainstorming/SKILL.md +176 -13
  11. package/skills/brainstorming/meta.yaml +19 -10
  12. package/skills/code-review/SKILL.md +214 -19
  13. package/skills/code-review/meta.yaml +21 -9
  14. package/skills/commit/SKILL.md +187 -0
  15. package/skills/commit/examples.md +62 -0
  16. package/skills/commit/meta.yaml +30 -0
  17. package/skills/commit/references/output-template.md +14 -0
  18. package/skills/debug/SKILL.md +252 -0
  19. package/skills/debug/examples.md +83 -0
  20. package/skills/debug/meta.yaml +38 -0
  21. package/skills/debug/references/output-template.md +16 -0
  22. package/skills/docs-writer/SKILL.md +85 -10
  23. package/skills/docs-writer/meta.yaml +16 -12
  24. package/skills/extract/SKILL.md +161 -0
  25. package/skills/extract/examples.md +47 -0
  26. package/skills/extract/meta.yaml +27 -0
  27. package/skills/extract/references/output-template.md +24 -0
  28. package/skills/feature-delivery/SKILL.md +10 -5
  29. package/skills/feature-delivery/meta.yaml +5 -0
  30. package/skills/go-pipeline/SKILL.md +156 -0
  31. package/skills/go-pipeline/examples.md +56 -0
  32. package/skills/go-pipeline/meta.yaml +27 -0
  33. package/skills/go-pipeline/references/output-template.md +17 -0
  34. package/skills/planning/SKILL.md +128 -17
  35. package/skills/planning/meta.yaml +15 -6
  36. package/skills/refactor-safe/SKILL.md +10 -7
  37. package/skills/repo-onboarding/SKILL.md +11 -7
  38. package/skills/repo-onboarding/meta.yaml +2 -0
  39. package/skills/research/SKILL.md +100 -0
  40. package/skills/research/examples.md +79 -0
  41. package/skills/research/meta.yaml +27 -0
  42. package/skills/research/references/output-template.md +23 -0
  43. package/skills/test-driven-development/SKILL.md +194 -0
  44. package/skills/test-driven-development/examples.md +77 -0
  45. package/skills/test-driven-development/meta.yaml +31 -0
  46. package/skills/test-driven-development/references/.gitkeep +0 -0
  47. package/skills/test-driven-development/references/output-template.md +31 -0
  48. package/skills/using-skills/SKILL.md +32 -14
  49. package/skills/using-skills/examples.md +3 -3
  50. package/skills/using-skills/meta.yaml +8 -3
  51. package/skills/verification-before-completion/SKILL.md +127 -13
  52. package/skills/verification-before-completion/meta.yaml +24 -14
  53. package/templates/SKILL.md +8 -1
  54. package/skills/bug-triage/SKILL.md +0 -47
  55. package/skills/bug-triage/examples.md +0 -68
  56. package/skills/bug-triage/meta.yaml +0 -25
  57. package/skills/bug-triage/references/output-template.md +0 -26
@@ -0,0 +1,187 @@
1
+ # Commit
2
+
3
+ ## Purpose
4
+
5
+ Create clean, well-scoped commits by learning the repo's commit style first, then proposing a message for user approval.
6
+
7
+ This skill ensures that every commit is intentional, matches the project's existing conventions, and is never created without explicit user permission.
8
+
9
+ ## The Iron Rule
10
+
11
+ ```
12
+ NEVER COMMIT WITHOUT EXPLICIT USER APPROVAL
13
+ ```
14
+
15
+ No exceptions. Not even when the user says "commit this" — still show the proposed message and wait for confirmation. The only exception is when the user explicitly grants blanket permission (e.g., "commit freely", "auto-commit is fine").
16
+
17
+ ## When To Use
18
+
19
+ Load this skill when:
20
+
21
+ - ready to commit completed work
22
+ - the user says "commit this", "save my changes", or "commit"
23
+ - finishing a task and need to record the change properly
24
+ - multiple unrelated changes are staged and need to be split
25
+
26
+ ## Workflow
27
+
28
+ 1. Read the repo's recent commit history to learn the style.
29
+ 2. Review what is staged.
30
+ 3. Verify the staged changes are coherent (single concern).
31
+ 4. Generate a commit message that matches the repo's style.
32
+ 5. Present the commit for user approval.
33
+ 6. Commit ONLY after explicit approval.
34
+
35
+ ## Step 1: Learn the Repo's Commit Style
36
+
37
+ **Before proposing any commit message, study the existing history:**
38
+
39
+ ```bash
40
+ git log --oneline -20
41
+ ```
42
+
43
+ Look for:
44
+
45
+ - **Format pattern** — does the repo use conventional commits (`feat:`, `fix:`), plain messages, ticket prefixes (`JIRA-123:`), or something else?
46
+ - **Casing** — lowercase subjects? Sentence case? All caps type prefix?
47
+ - **Scope usage** — does the repo use `feat(auth):` or just `feat:`?
48
+ - **Subject length** — typical length of subject lines?
49
+ - **Body style** — do commits have bodies? What do they explain?
50
+ - **Language** — English? Vietnamese? Mixed?
51
+
52
+ **Match the observed pattern.** Do not impose a different convention on a repo that already has one.
53
+
54
+ If the repo has no clear pattern (new repo, mixed styles), fall back to conventional commits:
55
+
56
+ ```
57
+ <type>(<scope>): <subject>
58
+ ```
59
+
60
+ Types: `feat`, `fix`, `docs`, `style`, `refactor`, `perf`, `test`, `chore`, `build`, `ci`
61
+
62
+ ## Step 2: Review Staged Changes
63
+
64
+ ```bash
65
+ git status
66
+ git diff --staged
67
+ ```
68
+
69
+ Check:
70
+
71
+ - Are the right files staged?
72
+ - Is anything missing that should be included?
73
+ - Is anything staged that should not be (secrets, generated files, unrelated changes)?
74
+
75
+ ## Step 3: Verify Coherence
76
+
77
+ A good commit addresses ONE concern. If the staged diff mixes unrelated work:
78
+
79
+ > These changes span multiple concerns:
80
+ > - Feature X changes in `src/feature/`
81
+ > - Bug fix in `src/utils/`
82
+ >
83
+ > Recommend splitting into separate commits. Stage one concern at a time.
84
+
85
+ Do NOT commit mixed changes without calling it out.
86
+
87
+ ## Step 4: Generate Commit Message
88
+
89
+ Based on the style learned in Step 1, generate a commit message that:
90
+
91
+ - Matches the repo's existing format and conventions
92
+ - Has a subject that explains the WHY or the user-visible change
93
+ - Has a body that explains reasoning (not a diff summary) when the change is non-trivial
94
+ - References task/issue IDs when applicable
95
+ - Does not include "Co-Authored-By" unless the user requests it
96
+ - Does not include "Generated with AI" or similar attribution
97
+
98
+ ## Step 5: Present for Approval
99
+
100
+ ```
101
+ Repo commit style observed: conventional commits, lowercase, with scope
102
+ Recent examples:
103
+ feat: add 6 new skills and upgrade 4 existing skills
104
+ fix(auth): handle expired refresh tokens
105
+
106
+ Proposed commit:
107
+
108
+ feat(planning): add bite-sized task granularity and no-placeholder rule
109
+
110
+ Staged files:
111
+ M skills/planning/SKILL.md
112
+ M skills/planning/meta.yaml
113
+
114
+ Proceed? (yes / edit message / no)
115
+ ```
116
+
117
+ **WAIT for the user's response.** Do NOT proceed until you receive one of:
118
+
119
+ - **yes / ok / go / ship it** → commit
120
+ - **edit** → user provides a new message or adjustments
121
+ - **no** → abort, explain what to do next
122
+
123
+ ## Step 6: Commit
124
+
125
+ Only after explicit approval:
126
+
127
+ ```bash
128
+ git commit -m "<approved-message>"
129
+ ```
130
+
131
+ ## Output Format
132
+
133
+ Present results using the Shared Output Contract:
134
+
135
+ 1. **Goal/Result** — whether a commit was proposed, created, or blocked
136
+ 2. **Key Details:**
137
+ - observed repo commit style
138
+ - the proposed or final commit message
139
+ - staged files summary
140
+ - any concerns about the diff (mixed concerns, missing files)
141
+ - approval status
142
+ 3. **Next Action** — only when a natural follow-up exists:
143
+ - after successful commit → `verification-before-completion` or `extract`
144
+ - if commit blocked → explain what to fix first
145
+
146
+ ## Commit Rules
147
+
148
+ - **NEVER auto-commit without user approval** — this is the most important rule
149
+ - Only commit staged files
150
+ - No "Co-Authored-By" lines unless the user requests it
151
+ - No "Generated with AI" or similar attribution lines
152
+ - If nothing is staged, say so and stop
153
+ - Learn the repo style before proposing — do not impose a foreign convention
154
+
155
+ ## Red Flags
156
+
157
+ - committing without reviewing the diff
158
+ - committing without reading the repo's commit history first
159
+ - proposing a commit style that does not match the repo's existing convention
160
+ - mixing unrelated changes in one commit
161
+ - writing commit messages that describe the diff instead of the intent
162
+ - auto-committing without user approval
163
+ - committing with failing tests or lint errors still present
164
+ - assuming "commit this" means "commit without showing me"
165
+
166
+ ## Checklist
167
+
168
+ - [ ] Repo commit history read (git log)
169
+ - [ ] Commit style identified and matched
170
+ - [ ] Staged changes reviewed
171
+ - [ ] Changes are coherent (single concern)
172
+ - [ ] Commit message follows repo's convention
173
+ - [ ] Subject explains why/what changed (not a diff summary)
174
+ - [ ] Commit message presented to user
175
+ - [ ] User explicitly approved
176
+ - [ ] Commit created successfully
177
+
178
+ ## Abort Conditions
179
+
180
+ - Nothing staged
181
+ - Staged diff includes unrelated work that should be split
182
+ - User has not explicitly approved the final message
183
+ - Secrets or credentials detected in staged files
184
+
185
+ ## Done Criteria
186
+
187
+ This skill is complete when the commit is created with explicit user approval, or when the user is informed why the commit was blocked and what to do about it. A commit created without user approval is a skill failure, regardless of whether the message was correct.
@@ -0,0 +1,62 @@
1
+ # Examples
2
+
3
+ ## Example 1
4
+
5
+ User request:
6
+
7
+ ```text
8
+ Commit my changes.
9
+ ```
10
+
11
+ Expected result:
12
+
13
+ - review staged changes
14
+ - check coherence (single concern)
15
+ - generate conventional commit message
16
+ - present for approval
17
+
18
+ Sample completed output:
19
+
20
+ ```
21
+ Goal/Result: Commit proposed — awaiting approval.
22
+
23
+ Key Details:
24
+ Ready to commit:
25
+
26
+ feat(auth): add JWT token refresh endpoint
27
+
28
+ - Adds /auth/refresh route for issuing new access tokens
29
+ - Preserves existing sessions during refresh
30
+
31
+ Staged files:
32
+ M src/routes/auth.ts
33
+ A src/middleware/refresh.ts
34
+ M tests/auth.test.ts
35
+
36
+ Proceed? (yes / no / edit)
37
+ ```
38
+
39
+ ## Example 2
40
+
41
+ User request:
42
+
43
+ ```text
44
+ Save my work.
45
+ ```
46
+
47
+ Expected result — mixed changes detected:
48
+
49
+ ```
50
+ Goal/Result: Commit blocked — staged changes span multiple concerns.
51
+
52
+ Key Details:
53
+ These changes span multiple concerns:
54
+ - Feature: new search endpoint in src/routes/search.ts
55
+ - Bug fix: null check in src/utils/format.ts
56
+ - Style: whitespace cleanup in src/app.ts
57
+
58
+ Recommend splitting into separate commits.
59
+ Stage one concern at a time.
60
+
61
+ Next Action: Stage the feature changes first, then commit each concern separately.
62
+ ```
@@ -0,0 +1,30 @@
1
+ name: commit
2
+ version: 0.2.0
3
+ category: workflow
4
+ summary: Learn repo commit style from history, propose a matching message, and commit ONLY after explicit user approval.
5
+ summary_vi: "Học style commit từ history, đề xuất message phù hợp, và commit CHỈ KHI user xác nhận rõ ràng."
6
+ triggers:
7
+ - commit these changes
8
+ - save my work
9
+ - ready to commit
10
+ inputs:
11
+ - staged git changes
12
+ - repo commit history (read automatically)
13
+ - optional task or issue reference
14
+ outputs:
15
+ - observed commit style
16
+ - proposed commit message matching repo convention
17
+ - user approval gate
18
+ - committed changes
19
+ constraints:
20
+ - NEVER auto-commit without explicit user approval
21
+ - read commit history before proposing a message
22
+ - match the repo's existing commit convention
23
+ - one concern per commit
24
+ related_skills:
25
+ - using-skills
26
+ - verification-before-completion
27
+ - code-review
28
+ - debug
29
+ - extract
30
+ - go-pipeline
@@ -0,0 +1,14 @@
1
+ ## Goal/Result
2
+
3
+ - Commit status:
4
+
5
+ ## Key Details
6
+
7
+ - Commit message:
8
+ - Staged files:
9
+ - Diff concerns:
10
+ - Approval status:
11
+
12
+ ## Next Action
13
+
14
+ - Recommended follow-up:
@@ -0,0 +1,252 @@
1
+ # Debug
2
+
3
+ ## Purpose
4
+
5
+ Systematically diagnose and fix errors through structured investigation, root cause analysis, and verified resolution.
6
+
7
+ This skill exists to prevent fixing symptoms without understanding root causes, and to enforce the discipline of evidence-based debugging over guesswork.
8
+
9
+ ## When To Use
10
+
11
+ Load this skill when:
12
+
13
+ - a build fails (compilation, type error, missing dependency)
14
+ - a test fails (assertion mismatch, timeout, flaky)
15
+ - a runtime crash or exception occurs
16
+ - an integration failure happens (API mismatch, env config, auth)
17
+ - a user reports a bug or regression
18
+ - a task is blocked with unclear cause
19
+ - the user says "debug this", "fix this error", "why is this failing", or "investigate this"
20
+
21
+ ## The Iron Law
22
+
23
+ ```
24
+ NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST
25
+ ```
26
+
27
+ If you have not completed Phase 1, you cannot propose fixes. Symptom fixes are failure.
28
+
29
+ ## The Four Phases
30
+
31
+ You MUST complete each phase before proceeding to the next.
32
+
33
+ ### Phase 1: Investigate — Find the Root Cause
34
+
35
+ **BEFORE attempting ANY fix:**
36
+
37
+ #### 1a. Classify the Issue
38
+
39
+ Classify before investigating. Misclassifying wastes time.
40
+
41
+ | Type | Signals |
42
+ |---|---|
43
+ | **Build failure** | Compilation error, type error, missing module, bundler failure |
44
+ | **Test failure** | Assertion mismatch, snapshot diff, timeout, flaky intermittent |
45
+ | **Runtime error** | Crash, uncaught exception, undefined behavior |
46
+ | **Integration failure** | HTTP 4xx/5xx, env variable missing, API schema mismatch |
47
+ | **Blocked task** | Circular dependency, conflicting changes, unclear requirement |
48
+
49
+ **Output:** One-line classification: `[TYPE] in [component]: [symptom]`
50
+
51
+ #### 1b. Reproduce
52
+
53
+ Run the exact failing command verbatim:
54
+
55
+ ```bash
56
+ <failing-command> 2>&1
57
+ ```
58
+
59
+ - Capture error output verbatim. Exact line numbers and messages matter.
60
+ - Run twice — if intermittent, classify as flaky (check shared state, race conditions, test ordering).
61
+ - If the command cannot be reproduced, note that explicitly and gather more data. Do not guess.
62
+
63
+ #### 1c. Read Implicated Files
64
+
65
+ Read exactly the files mentioned in the error output. Do not read the entire codebase.
66
+
67
+ #### 1d. Check Recent Changes
68
+
69
+ ```bash
70
+ git log --oneline -10
71
+ git diff HEAD~3 -- <failing-file>
72
+ ```
73
+
74
+ If a recent commit introduced the failure, the fix is likely adjusting that change.
75
+
76
+ #### 1e. Multi-Component Diagnostics
77
+
78
+ When the system has multiple components (CI -> build -> deploy, API -> service -> database):
79
+
80
+ Add diagnostic instrumentation at EACH component boundary BEFORE proposing fixes:
81
+
82
+ ```
83
+ For EACH component boundary:
84
+ - Log what data enters the component
85
+ - Log what data exits the component
86
+ - Verify environment/config propagation
87
+ - Check state at each layer
88
+
89
+ Run once to gather evidence showing WHERE it breaks
90
+ THEN analyze evidence to identify the failing component
91
+ THEN investigate that specific component
92
+ ```
93
+
94
+ #### 1f. Narrow to Root Cause
95
+
96
+ Write a one-sentence root cause:
97
+
98
+ > Root cause: `<file>:<line>` — `<what is wrong and why>`
99
+
100
+ **If you cannot write this sentence, you do not have the root cause yet. Do NOT proceed to Phase 2.**
101
+
102
+ ### Phase 2: Analyze — Find the Pattern
103
+
104
+ #### 2a. Find Working Examples
105
+
106
+ Locate similar working code in the same codebase. What works that is similar to what is broken?
107
+
108
+ #### 2b. Compare Against References
109
+
110
+ If implementing a pattern, read the reference implementation COMPLETELY. Do not skim.
111
+
112
+ #### 2c. Identify Differences
113
+
114
+ What is different between working and broken? List every difference, however small. Do not assume "that can't matter."
115
+
116
+ #### 2d. Form Hypothesis
117
+
118
+ State clearly: "I think X is the root cause because Y."
119
+
120
+ Be specific, not vague. Write it down.
121
+
122
+ ### Phase 3: Fix — Implement and Verify
123
+
124
+ #### 3a. Small Fix (1-3 files, obvious change)
125
+
126
+ - Implement directly
127
+ - Run verification immediately
128
+
129
+ #### 3b. Substantial Fix (cross-cutting, logic redesign)
130
+
131
+ - Consider whether the fix needs its own plan (hand off to `planning`)
132
+ - Document the root cause and fix approach before implementing
133
+
134
+ #### 3c. Verify the Fix
135
+
136
+ Run the exact command that originally failed. It must pass cleanly:
137
+
138
+ ```bash
139
+ <original-failing-command>
140
+ ```
141
+
142
+ Also run broader checks for regressions:
143
+
144
+ ```bash
145
+ # Project-specific build/test/lint — adapt to your project
146
+ ```
147
+
148
+ **If verification fails, return to Phase 1 with new information. Do NOT report success.**
149
+
150
+ #### 3d. Escalation: 3+ Failed Fixes
151
+
152
+ Count how many fixes you have attempted.
153
+
154
+ - **< 3 fixes failed:** Return to Phase 1, re-analyze with new information.
155
+ - **>= 3 fixes failed: STOP.** Question the architecture.
156
+
157
+ Signs of an architectural problem:
158
+
159
+ - Each fix reveals new shared state, coupling, or problems in different places
160
+ - Fixes require "massive refactoring" to implement
161
+ - Each fix creates new symptoms elsewhere
162
+
163
+ **Stop and discuss with the user before attempting more fixes.** This is not a failed hypothesis — this is a wrong architecture.
164
+
165
+ ### Phase 4: Learn — Capture the Pattern
166
+
167
+ Ask: would knowing this save 15+ minutes in a future session?
168
+
169
+ If yes, document the pattern:
170
+
171
+ ```markdown
172
+ ## [Classification]
173
+
174
+ **Root cause:** [one sentence]
175
+ **Signal:** [how to recognize this pattern]
176
+ **Fix:** [what resolves it]
177
+ ```
178
+
179
+ Consider handing off to `extract` for significant learnings.
180
+
181
+ ## Quick Reference
182
+
183
+ | Situation | First action |
184
+ |---|---|
185
+ | Build fails | `git log --oneline -10` — check recent changes |
186
+ | Test fails | Run test verbatim, capture exact assertion output |
187
+ | Flaky test | Run 5x — if intermittent, check shared state/ordering |
188
+ | Runtime crash | Read stack trace top-to-bottom, find first line in your code |
189
+ | Integration error | Check env vars, then API response body (not just status code) |
190
+ | Bug report | Restate symptom, then reproduce or explain why reproduction is blocked |
191
+ | 3+ fixes failed | Stop fixing. Question the architecture. |
192
+
193
+ ## Output Format
194
+
195
+ Present results using the Shared Output Contract:
196
+
197
+ 1. **Goal/Result** — what was debugged and whether it is fixed
198
+ 2. **Key Details:**
199
+ - classification and root cause (one-line each)
200
+ - reproduction status
201
+ - what was changed to fix it
202
+ - verification result (pass/fail)
203
+ - number of fix attempts if > 1
204
+ - whether a learning was captured
205
+ 3. **Next Action** — only when a natural follow-up exists:
206
+ - fix applied → resume implementation with `feature-delivery`
207
+ - fix revealed a pattern → `extract`
208
+ - fix needs review → `code-review`
209
+ - fix is non-trivial → `planning` before implementation
210
+ - 3+ fixes failed → discuss architecture with user
211
+
212
+ ## Common Rationalizations
213
+
214
+ | Excuse | Reality |
215
+ |--------|---------|
216
+ | "Issue is simple, don't need process" | Simple issues have root causes too. Process is fast for simple bugs. |
217
+ | "Emergency, no time for process" | Systematic debugging is FASTER than guess-and-check thrashing. |
218
+ | "Just try this first, then investigate" | First fix sets the pattern. Do it right from the start. |
219
+ | "I see the problem, let me fix it" | Seeing symptoms is not understanding root cause. |
220
+ | "One more fix attempt" (after 2+ failures) | 3+ failures signals architectural problem. Question the pattern. |
221
+ | "Quick fix for now, investigate later" | Later never comes. Fix properly now. |
222
+
223
+ ## Red Flags
224
+
225
+ - fixing symptoms without identifying root cause
226
+ - skipping reproduction — diagnosing from error message alone
227
+ - guessing the fix without reading the implicated code
228
+ - proposing fixes before tracing data flow
229
+ - committing a fix without running verification
230
+ - proposing a rewrite before understanding the current failure
231
+ - changing many files before narrowing the cause
232
+ - not capturing a learning when the fix took more than 15 minutes to find
233
+ - declaring "should work now" without running the failing command again
234
+ - attempting fix #4+ without questioning the architecture
235
+
236
+ ## Checklist
237
+
238
+ - [ ] Issue classified (one-line)
239
+ - [ ] Reproduced with exact command
240
+ - [ ] Implicated files read
241
+ - [ ] Recent changes checked
242
+ - [ ] Root cause identified (one sentence with file:line)
243
+ - [ ] Working example compared (if applicable)
244
+ - [ ] Fix applied
245
+ - [ ] Fix verified (original command passes)
246
+ - [ ] Regression check run
247
+ - [ ] Fix attempt count tracked (escalate at 3+)
248
+ - [ ] Learning captured (if pattern is new/useful)
249
+
250
+ ## Done Criteria
251
+
252
+ This skill is complete when the root cause is identified, the fix is verified with the originally failing command, and a regression check has been run. If 3+ fixes have failed, the skill is complete when the architectural concern has been raised with the user. If the fix cannot be completed, the skill is complete when the root cause and blocker are documented.
@@ -0,0 +1,83 @@
1
+ # Examples
2
+
3
+ ## Example 1
4
+
5
+ User request:
6
+
7
+ ```text
8
+ The build is failing after the last merge.
9
+ ```
10
+
11
+ Expected result:
12
+
13
+ - classify the issue
14
+ - reproduce the failure
15
+ - narrow to root cause
16
+ - fix and verify
17
+
18
+ Sample completed output:
19
+
20
+ ```
21
+ Goal/Result: Build failure debugged and fixed.
22
+
23
+ Key Details:
24
+ Classification: [Build failure] in auth module: missing import after merge
25
+
26
+ Root cause: src/auth/index.ts:15 — import references
27
+ `refreshToken` from ./providers but the function was renamed to
28
+ `refreshAccessToken` in PR #142 (merged 2h ago).
29
+
30
+ Fix applied: Updated import in src/auth/index.ts:15
31
+ - Before: import { refreshToken } from './providers'
32
+ - After: import { refreshAccessToken } from './providers'
33
+
34
+ Verification:
35
+ - npm run build — PASS
36
+ - npm test — PASS (42/42)
37
+
38
+ Learning: Rename refactors should use project-wide find-replace.
39
+ This pattern has caused 3 build failures in the last month.
40
+
41
+ Next Action: commit — fix is verified and ready.
42
+ ```
43
+
44
+ ## Example 2
45
+
46
+ User request:
47
+
48
+ ```text
49
+ Tests are flaky — sometimes pass, sometimes fail.
50
+ ```
51
+
52
+ Expected result:
53
+
54
+ - reproduce intermittent failure
55
+ - identify shared state or race condition
56
+ - fix and verify stability
57
+
58
+ Sample completed output:
59
+
60
+ ```
61
+ Goal/Result: Flaky test diagnosed and fixed.
62
+
63
+ Key Details:
64
+ Classification: [Test failure] in user service: intermittent assertion
65
+ failure on test ordering
66
+
67
+ Reproduction: Ran 5 times — failed 2/5. Failures occur when
68
+ "create user" test runs before "list users" test.
69
+
70
+ Root cause: tests/user.test.ts:45 — tests share a database
71
+ connection without cleanup. "list users" test returns results
72
+ from "create user" test when run order is alphabetical.
73
+
74
+ Fix applied: Added beforeEach() cleanup hook to reset test
75
+ database state between tests.
76
+
77
+ Verification: Ran 10 times — 10/10 PASS.
78
+
79
+ Learning captured: Test isolation pattern — always clean up
80
+ shared state in beforeEach, not afterAll.
81
+
82
+ Next Action: commit
83
+ ```
@@ -0,0 +1,38 @@
1
+ name: debug
2
+ version: 0.2.0
3
+ category: troubleshooting
4
+ summary: 4-phase systematic debugging with root cause investigation, multi-component diagnostics, and 3+ fix escalation.
5
+ summary_vi: "Gỡ lỗi hệ thống 4 giai đoạn với điều tra nguyên nhân gốc, chẩn đoán đa thành phần, và leo thang khi 3+ lần sửa thất bại."
6
+ triggers:
7
+ - debug this error
8
+ - fix this failure
9
+ - why is this failing
10
+ - diagnose this issue
11
+ - investigate this error
12
+ - debug this regression
13
+ - failing test or production issue
14
+ inputs:
15
+ - error message or stack trace
16
+ - failing command
17
+ - bug report or reproduction steps
18
+ - optional task context
19
+ outputs:
20
+ - classification
21
+ - root cause with file:line
22
+ - verified fix
23
+ - fix attempt count
24
+ - learning captured
25
+ constraints:
26
+ - no fixes without root cause investigation first
27
+ - must reproduce before diagnosing
28
+ - must verify fix before declaring success
29
+ - escalate at 3+ failed fix attempts
30
+ related_skills:
31
+ - using-skills
32
+ - planning
33
+ - feature-delivery
34
+ - extract
35
+ - code-review
36
+ - commit
37
+ - verification-before-completion
38
+ - test-driven-development
@@ -0,0 +1,16 @@
1
+ ## Goal/Result
2
+
3
+ - What was debugged:
4
+ - Fix status:
5
+
6
+ ## Key Details
7
+
8
+ - Classification:
9
+ - Root cause:
10
+ - Fix applied:
11
+ - Verification result:
12
+ - Learning captured:
13
+
14
+ ## Next Action
15
+
16
+ - Recommended follow-up: