codingbuddy-rules 4.4.0 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/.ai-rules/adapters/antigravity.md +6 -6
  2. package/.ai-rules/adapters/claude-code.md +107 -4
  3. package/.ai-rules/adapters/codex.md +5 -5
  4. package/.ai-rules/adapters/cursor.md +2 -2
  5. package/.ai-rules/adapters/kiro.md +8 -8
  6. package/.ai-rules/adapters/opencode.md +7 -7
  7. package/.ai-rules/adapters/q.md +2 -2
  8. package/.ai-rules/agents/README.md +66 -16
  9. package/.ai-rules/agents/accessibility-specialist.json +2 -1
  10. package/.ai-rules/agents/act-mode.json +2 -1
  11. package/.ai-rules/agents/agent-architect.json +8 -7
  12. package/.ai-rules/agents/ai-ml-engineer.json +1 -0
  13. package/.ai-rules/agents/architecture-specialist.json +1 -0
  14. package/.ai-rules/agents/auto-mode.json +4 -2
  15. package/.ai-rules/agents/backend-developer.json +1 -0
  16. package/.ai-rules/agents/code-quality-specialist.json +1 -0
  17. package/.ai-rules/agents/code-reviewer.json +65 -64
  18. package/.ai-rules/agents/data-engineer.json +8 -7
  19. package/.ai-rules/agents/data-scientist.json +10 -9
  20. package/.ai-rules/agents/devops-engineer.json +1 -0
  21. package/.ai-rules/agents/documentation-specialist.json +1 -0
  22. package/.ai-rules/agents/eval-mode.json +20 -19
  23. package/.ai-rules/agents/event-architecture-specialist.json +1 -0
  24. package/.ai-rules/agents/frontend-developer.json +1 -0
  25. package/.ai-rules/agents/i18n-specialist.json +2 -1
  26. package/.ai-rules/agents/integration-specialist.json +1 -0
  27. package/.ai-rules/agents/migration-specialist.json +1 -0
  28. package/.ai-rules/agents/mobile-developer.json +8 -7
  29. package/.ai-rules/agents/observability-specialist.json +1 -0
  30. package/.ai-rules/agents/parallel-orchestrator.json +346 -0
  31. package/.ai-rules/agents/performance-specialist.json +1 -0
  32. package/.ai-rules/agents/plan-mode.json +3 -1
  33. package/.ai-rules/agents/plan-reviewer.json +208 -0
  34. package/.ai-rules/agents/platform-engineer.json +1 -0
  35. package/.ai-rules/agents/security-engineer.json +9 -8
  36. package/.ai-rules/agents/security-specialist.json +2 -1
  37. package/.ai-rules/agents/seo-specialist.json +1 -0
  38. package/.ai-rules/agents/software-engineer.json +1 -0
  39. package/.ai-rules/agents/solution-architect.json +11 -10
  40. package/.ai-rules/agents/systems-developer.json +9 -8
  41. package/.ai-rules/agents/technical-planner.json +11 -10
  42. package/.ai-rules/agents/test-engineer.json +7 -6
  43. package/.ai-rules/agents/test-strategy-specialist.json +1 -0
  44. package/.ai-rules/agents/tooling-engineer.json +4 -3
  45. package/.ai-rules/agents/ui-ux-designer.json +1 -0
  46. package/.ai-rules/keyword-modes.json +4 -4
  47. package/.ai-rules/rules/clarification-guide.md +14 -14
  48. package/.ai-rules/rules/core.md +90 -1
  49. package/.ai-rules/rules/parallel-execution.md +217 -0
  50. package/.ai-rules/skills/README.md +23 -1
  51. package/.ai-rules/skills/agent-design/SKILL.md +5 -0
  52. package/.ai-rules/skills/agent-design/examples/agent-template.json +58 -0
  53. package/.ai-rules/skills/agent-design/references/expertise-guidelines.md +112 -0
  54. package/.ai-rules/skills/agent-discussion/SKILL.md +199 -0
  55. package/.ai-rules/skills/agent-discussion-panel/SKILL.md +448 -0
  56. package/.ai-rules/skills/api-design/SKILL.md +5 -0
  57. package/.ai-rules/skills/api-design/examples/error-response.json +159 -0
  58. package/.ai-rules/skills/api-design/examples/openapi-template.yaml +393 -0
  59. package/.ai-rules/skills/build-fix/SKILL.md +234 -0
  60. package/.ai-rules/skills/code-explanation/SKILL.md +4 -0
  61. package/.ai-rules/skills/context-management/SKILL.md +1 -0
  62. package/.ai-rules/skills/cost-budget/SKILL.md +348 -0
  63. package/.ai-rules/skills/cross-repo-issues/SKILL.md +257 -0
  64. package/.ai-rules/skills/database-migration/SKILL.md +1 -0
  65. package/.ai-rules/skills/deepsearch/SKILL.md +214 -0
  66. package/.ai-rules/skills/deployment-checklist/SKILL.md +1 -0
  67. package/.ai-rules/skills/error-analysis/SKILL.md +1 -0
  68. package/.ai-rules/skills/finishing-a-development-branch/SKILL.md +281 -0
  69. package/.ai-rules/skills/frontend-design/SKILL.md +5 -0
  70. package/.ai-rules/skills/frontend-design/examples/component-template.tsx +203 -0
  71. package/.ai-rules/skills/frontend-design/references/css-patterns.md +243 -0
  72. package/.ai-rules/skills/git-master/SKILL.md +358 -0
  73. package/.ai-rules/skills/incident-response/SKILL.md +1 -0
  74. package/.ai-rules/skills/legacy-modernization/SKILL.md +1 -0
  75. package/.ai-rules/skills/mcp-builder/SKILL.md +7 -0
  76. package/.ai-rules/skills/mcp-builder/examples/resource-example.ts +233 -0
  77. package/.ai-rules/skills/mcp-builder/examples/tool-example.ts +203 -0
  78. package/.ai-rules/skills/mcp-builder/references/protocol-spec.md +215 -0
  79. package/.ai-rules/skills/performance-optimization/SKILL.md +3 -0
  80. package/.ai-rules/skills/plan-and-review/SKILL.md +115 -0
  81. package/.ai-rules/skills/pr-all-in-one/SKILL.md +15 -13
  82. package/.ai-rules/skills/pr-all-in-one/configuration-guide.md +7 -7
  83. package/.ai-rules/skills/pr-all-in-one/pr-templates.md +10 -10
  84. package/.ai-rules/skills/pr-review/SKILL.md +4 -0
  85. package/.ai-rules/skills/receiving-code-review/SKILL.md +347 -0
  86. package/.ai-rules/skills/refactoring/SKILL.md +1 -0
  87. package/.ai-rules/skills/requesting-code-review/SKILL.md +348 -0
  88. package/.ai-rules/skills/rule-authoring/SKILL.md +5 -0
  89. package/.ai-rules/skills/rule-authoring/examples/rule-template.md +142 -0
  90. package/.ai-rules/skills/rule-authoring/examples/trigger-patterns.md +126 -0
  91. package/.ai-rules/skills/security-audit/SKILL.md +4 -0
  92. package/.ai-rules/skills/skill-creator/SKILL.md +461 -0
  93. package/.ai-rules/skills/skill-creator/agents/analyzer.md +206 -0
  94. package/.ai-rules/skills/skill-creator/agents/comparator.md +167 -0
  95. package/.ai-rules/skills/skill-creator/agents/grader.md +152 -0
  96. package/.ai-rules/skills/skill-creator/assets/eval_review.html +289 -0
  97. package/.ai-rules/skills/skill-creator/assets/skill-template.md +43 -0
  98. package/.ai-rules/skills/skill-creator/eval-viewer/generate_review.py +496 -0
  99. package/.ai-rules/skills/skill-creator/references/frontmatter-guide.md +632 -0
  100. package/.ai-rules/skills/skill-creator/references/multi-tool-compat.md +480 -0
  101. package/.ai-rules/skills/skill-creator/references/schemas.md +784 -0
  102. package/.ai-rules/skills/skill-creator/scripts/aggregate_benchmark.py +302 -0
  103. package/.ai-rules/skills/skill-creator/scripts/init_skill.sh +196 -0
  104. package/.ai-rules/skills/skill-creator/scripts/run_loop.py +327 -0
  105. package/.ai-rules/skills/systematic-debugging/SKILL.md +1 -0
  106. package/.ai-rules/skills/tech-debt/SKILL.md +1 -0
  107. package/.ai-rules/skills/test-coverage-gate/SKILL.md +303 -0
  108. package/.ai-rules/skills/tmux-master/SKILL.md +491 -0
  109. package/.ai-rules/skills/using-git-worktrees/SKILL.md +368 -0
  110. package/.ai-rules/skills/verification-before-completion/SKILL.md +234 -0
  111. package/.ai-rules/skills/widget-slot-architecture/SKILL.md +6 -0
  112. package/.ai-rules/skills/widget-slot-architecture/examples/parallel-route-setup.tsx +206 -0
  113. package/.ai-rules/skills/widget-slot-architecture/examples/widget-component.tsx +250 -0
  114. package/.ai-rules/skills/writing-plans/SKILL.md +78 -0
  115. package/bin/cli.js +178 -0
  116. package/lib/init/detect-stack.js +148 -0
  117. package/lib/init/generate-config.js +31 -0
  118. package/lib/init/index.js +86 -0
  119. package/lib/init/prompt.js +60 -0
  120. package/lib/init/scaffold.js +67 -0
  121. package/lib/init/suggest-agent.js +46 -0
  122. package/package.json +10 -2
@@ -0,0 +1,368 @@
1
+ ---
2
+ name: using-git-worktrees
3
+ description: >-
4
+ Use when creating isolated workspaces for parallel execution, feature
5
+ exploration, or plan implementation. Covers worktree creation, naming
6
+ conventions, safety checks, and cleanup procedures.
7
+ user-invocable: true
8
+ argument-hint: "[create|cleanup|status]"
9
+ ---
10
+
11
+ # Using Git Worktrees
12
+
13
+ ## Overview
14
+
15
+ Git worktrees provide isolated working directories sharing a single `.git` repository. They enable parallel development without stashing, branch-switching conflicts, or duplicate clones.
16
+
17
+ **Core principle:** EVERY worktree operation must be verified before and after. Unverified worktrees cause lost work, orphaned branches, and corrupted state.
18
+
19
+ ## The Iron Law
20
+
21
+ ```
22
+ NO WORKTREE CREATION WITHOUT SAFETY CHECKS.
23
+ NO WORKTREE REMOVAL WITHOUT UNCOMMITTED CHANGE VERIFICATION.
24
+ ```
25
+
26
+ If you skip the safety checks, you will lose work. There are no exceptions.
27
+
28
+ ## When to Use
29
+
30
+ - **Parallel execution**: Running multiple tasks simultaneously (taskMaestro waves)
31
+ - **Feature isolation**: Working on a feature without disrupting main branch state
32
+ - **Plan implementation**: Creating a dedicated workspace before implementing a plan
33
+ - **Exploration**: Trying an approach without affecting current work
34
+ - **Code review**: Checking out a PR branch while keeping your current work intact
35
+
36
+ **Use this ESPECIALLY when:**
37
+ - You need to work on multiple issues simultaneously
38
+ - You want to preserve your current branch state while exploring something else
39
+ - A brainstorming session has produced a design ready for implementation
40
+ - You are about to run `/taskmaestro wave-transition`
41
+
42
+ **Don't skip when:**
43
+ - "It's just a quick branch switch" (worktrees prevent accidental stash loss)
44
+ - "I'll remember to clean up later" (stale worktrees accumulate silently)
45
+ - "The repo is small, cloning is fine" (clones don't share history; worktrees do)
46
+
47
+ ---
48
+
49
+ ## Phase 1: Assessment
50
+
51
+ **BEFORE creating any worktree, answer these questions:**
52
+
53
+ ### 1.1 Determine the Purpose
54
+
55
+ | Purpose | Directory Convention | Branch Convention |
56
+ |---------|---------------------|-------------------|
57
+ | Parallel execution (taskMaestro) | `.taskmaestro/wt-N` | `taskmaestro/<epoch>/pane-N` |
58
+ | Tool-managed isolation | Tool-specific (e.g., `.claude/worktrees/`) | Auto-managed by the tool |
59
+ | Standalone / manual | `.worktrees/<descriptive-name>` | `wt/<description>` or `feat/<issue>-<slug>` |
60
+
61
+ **Branch naming — Good vs Bad:**
62
+
63
+ | | Example | Why |
64
+ |---|---------|-----|
65
+ | **Good** | `feat/42-add-auth-middleware` | Encodes issue number and purpose; easy to find and clean up |
66
+ | **Good** | `wt/explore-cache-strategy` | `wt/` prefix makes worktree branches bulk-identifiable |
67
+ | **Bad** | `my-branch` | No context — impossible to identify purpose or clean up in bulk |
68
+ | **Bad** | `test` | Generic name; will collide with other worktrees or developers |
69
+
70
+ ### 1.2 Check Prerequisites
71
+
72
+ Run these checks before proceeding:
73
+
74
+ ```bash
75
+ # 1. Verify clean working tree (stash or commit first)
76
+ git status --porcelain
77
+ # Must be empty, or stash changes first
78
+
79
+ # 2. Verify you are NOT inside an existing worktree
80
+ git rev-parse --show-toplevel
81
+ # Should match your main repo root
82
+
83
+ # 3. List existing worktrees to avoid conflicts
84
+ git worktree list
85
+
86
+ # 4. Verify the target branch does not already exist
87
+ git branch --list "<your-branch-name>"
88
+ # Must be empty — git worktree add -b fails on existing branches
89
+
90
+ # 5. Verify the target directory does not already exist
91
+ ls -d "<your-worktree-path>" 2>/dev/null
92
+ # Must not exist, or must be empty
93
+ ```
94
+
95
+ **If any check fails:** Resolve the issue before proceeding. Do NOT skip checks.
96
+
97
+ ### 1.3 Choose Base Branch
98
+
99
+ ```bash
100
+ # Fetch latest to avoid stale base
101
+ git fetch origin master:master 2>/dev/null || git fetch origin main:main 2>/dev/null
102
+ ```
103
+
104
+ Use the project's default branch (usually `master` or `main`) as the base unless you specifically need to branch from another point.
105
+
106
+ ---
107
+
108
+ ## Phase 2: Creation
109
+
110
+ ### 2.1 Create the Worktree
111
+
112
+ **Standard creation (new branch):**
113
+
114
+ ```bash
115
+ # Pattern: git worktree add <directory> -b <branch-name> <base-branch>
116
+ git worktree add .worktrees/my-feature -b feat/42-user-auth master
117
+ ```
118
+
119
+ **taskMaestro pattern:**
120
+
121
+ ```bash
122
+ git worktree add .taskmaestro/wt-1 -b "taskmaestro/$(date +%s)/pane-1" master
123
+ ```
124
+
125
+ **From existing remote branch:**
126
+
127
+ ```bash
128
+ git worktree add .worktrees/review-pr origin/feat/some-branch
129
+ ```
130
+
131
+ ### 2.2 Verify Creation
132
+
133
+ ```bash
134
+ # Confirm worktree appears in the list
135
+ git worktree list
136
+
137
+ # Confirm the directory has a valid .git file (not directory)
138
+ cat <worktree-path>/.git
139
+ # Should contain: gitdir: /path/to/.git/worktrees/<name>
140
+
141
+ # Confirm correct branch
142
+ git -C <worktree-path> branch --show-current
143
+ ```
144
+
145
+ ### 2.3 Post-Creation Setup
146
+
147
+ Each worktree has its own working directory. Shared `.git` objects are reused, but working files are independent.
148
+
149
+ ```bash
150
+ # Install dependencies (JS/TS projects)
151
+ cd <worktree-path> && npm install # or yarn install
152
+
153
+ # Initialize submodules if present
154
+ git -C <worktree-path> submodule update --init
155
+
156
+ # Copy non-tracked config files if needed
157
+ cp .env.local <worktree-path>/.env.local # if applicable
158
+ ```
159
+
160
+ **Key understanding:** `node_modules/`, build caches, and IDE configs are NOT shared between worktrees. Each worktree needs its own setup.
161
+
162
+ ---
163
+
164
+ ## Phase 3: Work and Verification
165
+
166
+ ### 3.1 Know Where You Are
167
+
168
+ Always verify which worktree you are working in:
169
+
170
+ ```bash
171
+ # Show current worktree root
172
+ git rev-parse --show-toplevel
173
+
174
+ # Show current branch
175
+ git branch --show-current
176
+ ```
177
+
178
+ ### 3.2 Commit Hygiene
179
+
180
+ - **Commit frequently** within the worktree — uncommitted work is lost on removal
181
+ - **Push before cleanup** — local-only commits disappear with the worktree branch
182
+ - **Atomic commits** — each commit should be self-contained
183
+
184
+ ```bash
185
+ # Before leaving a worktree, always check
186
+ git -C <worktree-path> status --porcelain # uncommitted changes
187
+ git -C <worktree-path> log @{upstream}..HEAD # unpushed commits
188
+ ```
189
+
190
+ ### 3.3 Avoid Cross-Contamination
191
+
192
+ - Do NOT run git commands from one worktree that target another
193
+ - Do NOT create nested worktrees (worktree inside a worktree)
194
+ - Do NOT symlink `node_modules` between worktrees — it causes subtle bugs
195
+ - Do NOT checkout a branch that is already checked out in another worktree
196
+
197
+ ```bash
198
+ # If you need to check: which worktrees exist and what branches they use
199
+ git worktree list
200
+ ```
201
+
202
+ ---
203
+
204
+ ## Phase 4: Cleanup
205
+
206
+ **NEVER skip cleanup.** Stale worktrees and orphaned branches accumulate and cause confusion.
207
+
208
+ ### 4.1 Pre-Cleanup Safety Checks
209
+
210
+ ```bash
211
+ # 1. Check for uncommitted changes
212
+ git -C <worktree-path> status --porcelain
213
+ # Must be empty
214
+
215
+ # 2. Check for unpushed commits
216
+ git -C <worktree-path> log @{upstream}..HEAD 2>/dev/null
217
+ # Must be empty (or explicitly accepted as disposable)
218
+
219
+ # 3. Check lock status
220
+ git worktree list --porcelain | grep -A2 "<worktree-path>"
221
+ # Should NOT show "locked"
222
+ ```
223
+
224
+ **If uncommitted changes exist:** Commit and push, or explicitly confirm disposal.
225
+
226
+ ### 4.2 Remove the Worktree
227
+
228
+ **Removal — Good vs Bad:**
229
+
230
+ | | Command | Why |
231
+ |---|---------|-----|
232
+ | **Good** | `git worktree remove .worktrees/my-feature` | Cleans up both directory and `.git/worktrees/` metadata |
233
+ | **Bad** | `rm -rf .worktrees/my-feature` | Leaves orphaned metadata — breaks `git worktree list` and blocks branch ops |
234
+
235
+ ```bash
236
+ # Safe removal (fails if dirty)
237
+ git worktree remove <worktree-path>
238
+
239
+ # Force removal (destroys uncommitted work — use only after verification)
240
+ git worktree remove <worktree-path> --force
241
+ ```
242
+
243
+ ### 4.3 Clean Up the Branch
244
+
245
+ ```bash
246
+ # Delete the local branch (only after merge or explicit discard)
247
+ git branch -d <branch-name> # safe delete (fails if unmerged)
248
+ git branch -D <branch-name> # force delete (use with caution)
249
+
250
+ # Delete remote branch if pushed
251
+ git push origin --delete <branch-name>
252
+ ```
253
+
254
+ ### 4.4 Prune Stale References
255
+
256
+ ```bash
257
+ # Remove metadata for worktrees whose directories no longer exist
258
+ git worktree prune
259
+
260
+ # Verify clean state
261
+ git worktree list
262
+ # Should only show active worktrees
263
+ ```
264
+
265
+ ### 4.5 Bulk Cleanup (taskMaestro Pattern)
266
+
267
+ For cleaning up an entire parallel wave:
268
+
269
+ ```bash
270
+ # Remove all taskMaestro worktrees
271
+ for wt_dir in .taskmaestro/wt-*; do
272
+ [ -d "$wt_dir" ] || continue
273
+ branch=$(git -C "$wt_dir" branch --show-current 2>/dev/null)
274
+ git worktree remove "$wt_dir" --force 2>/dev/null || rm -rf "$wt_dir"
275
+ [ -n "$branch" ] && git branch -D "$branch" 2>/dev/null
276
+ done
277
+ git worktree prune
278
+ ```
279
+
280
+ ---
281
+
282
+ ## Health Check
283
+
284
+ Run periodically or when something seems wrong:
285
+
286
+ ```bash
287
+ # List all worktrees and their branches
288
+ git worktree list
289
+
290
+ # Prune any stale entries
291
+ git worktree prune
292
+
293
+ # Find worktree-related branches that may be orphaned
294
+ git branch --list 'taskmaestro/*'
295
+ git branch --list 'wt/*'
296
+
297
+ # Verify .gitignore includes worktree directories
298
+ grep -E '\.taskmaestro/|\.worktrees/|\.claude/worktrees/' .gitignore
299
+ ```
300
+
301
+ ---
302
+
303
+ ## Verification Checklist
304
+
305
+ Before considering your worktree work complete:
306
+
307
+ - [ ] Worktree created from a fresh base branch (`git fetch` ran first)
308
+ - [ ] Branch name follows the naming convention for the context
309
+ - [ ] `git worktree list` shows the worktree correctly
310
+ - [ ] Dependencies installed in the worktree (if applicable)
311
+ - [ ] All changes committed and pushed before cleanup
312
+ - [ ] Worktree removed with `git worktree remove` (not `rm -rf`)
313
+ - [ ] `git worktree prune` ran after removal
314
+ - [ ] Associated branch deleted if work is complete
315
+
316
+ ---
317
+
318
+ ## Red Flags — STOP
319
+
320
+ | Thought | Reality |
321
+ |---------|---------|
322
+ | "I'll just `rm -rf` the worktree directory" | NO. Use `git worktree remove`. Orphaned metadata in `.git/worktrees/` breaks `git worktree list` and blocks branch operations. |
323
+ | "The branch name doesn't matter" | NO. Systematic names enable bulk cleanup (`git branch --list 'wt/*'`). Random names become impossible to identify. |
324
+ | "I don't need to fetch before creating" | NO. A stale base branch causes merge conflicts in every worktree created from it. |
325
+ | "Uncommitted changes are fine, I'll get them later" | NO. `git worktree remove --force` destroys uncommitted work permanently. No recovery. |
326
+ | "One worktree can share `node_modules` with the main tree" | NO. Each worktree has its own working directory. Symlinks cause subtle, hard-to-debug build failures. |
327
+ | "I'll skip cleanup, it's just disk space" | NO. Stale worktrees and orphaned branches accumulate and confuse `git branch` / `git worktree list`. Clean up every time. |
328
+ | "I can checkout the same branch in two worktrees" | NO. Git forbids this. A branch can only be checked out in one worktree at a time. Create a new branch instead. |
329
+
330
+ ---
331
+
332
+ ## Integration with Other Skills
333
+
334
+ | Skill | Integration Point |
335
+ |-------|-------------------|
336
+ | **brainstorming** | After design validation, create a worktree for isolated implementation |
337
+ | **writing-plans** | Plans should be implemented in a dedicated worktree |
338
+ | **executing-plans** | Execute plan steps inside the worktree, not the main tree |
339
+ | **taskmaestro** | Automates worktree lifecycle for parallel waves (`/taskmaestro wave-transition`) |
340
+ | **parallel-issues** | Uses taskMaestro worktrees for concurrent issue implementation |
341
+
342
+ ---
343
+
344
+ ## Tool-Specific Notes
345
+
346
+ ### Claude Code
347
+
348
+ Claude Code provides a built-in `EnterWorktree` tool that:
349
+ - Creates worktrees in `.claude/worktrees/<name>`
350
+ - Manages branch creation automatically
351
+ - Provides `ExitWorktree` for cleanup (keep or remove)
352
+
353
+ Use `EnterWorktree` for single-worktree isolation within Claude Code sessions. Use the manual git workflow described above for multi-worktree parallel execution.
354
+
355
+ ### Other AI Tools (Cursor, Codex, Q, Kiro)
356
+
357
+ Use the standard `git worktree` CLI commands described in this skill. No tool-specific APIs exist for worktree management in these environments.
358
+
359
+ ---
360
+
361
+ ## Quick Reference
362
+
363
+ | Phase | Key Actions | Verification |
364
+ |-------|-------------|--------------|
365
+ | **1. Assessment** | Check prerequisites, choose naming | `git status`, `git worktree list`, target path clear |
366
+ | **2. Creation** | `git worktree add`, install deps | `git worktree list`, branch correct, deps installed |
367
+ | **3. Work** | Commit often, push before leaving | `git status --porcelain` empty, no unpushed commits |
368
+ | **4. Cleanup** | `git worktree remove`, delete branch, prune | `git worktree list` clean, no orphaned branches |
@@ -0,0 +1,234 @@
1
+ ---
2
+ name: verification-before-completion
3
+ description: Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims
4
+ user-invocable: true
5
+ ---
6
+
7
+ # Verification Before Completion
8
+
9
+ ## Overview
10
+
11
+ Claiming success without evidence is guessing. "It should work" is not verification.
12
+
13
+ **Core principle:** ALWAYS run verification commands and confirm output before claiming work is complete. Evidence before assertions.
14
+
15
+ **Violating the letter of these checks is violating the spirit of quality.**
16
+
17
+ ## The Iron Law
18
+
19
+ ```
20
+ NO SUCCESS CLAIMS WITHOUT RUNNING VERIFICATION COMMANDS
21
+ ```
22
+
23
+ If you haven't seen passing output with your own eyes, you cannot claim it works.
24
+
25
+ **No exceptions:**
26
+ - Don't say "tests should pass" — run them
27
+ - Don't say "build looks fine" — build it
28
+ - Don't say "no lint errors" — lint it
29
+ - Don't say "changes look good" — diff them
30
+
31
+ ## When to Use
32
+
33
+ **Always, before:**
34
+ - Claiming work is "done" or "complete"
35
+ - Committing code
36
+ - Creating pull requests
37
+ - Closing issues
38
+ - Reporting success to teammates
39
+ - Moving to the next task
40
+
41
+ **Use this ESPECIALLY when:**
42
+ - Under time pressure (rushing guarantees missed issues)
43
+ - Changes seem trivial ("just a typo" can break builds)
44
+ - You've made multiple changes across files
45
+ - Refactoring existing code
46
+ - Fixing bugs (verify the fix AND no regressions)
47
+
48
+ **Don't skip when:**
49
+ - Change seems too small to break anything (small changes break things)
50
+ - You're confident it works (confidence ≠ evidence)
51
+ - You "already tested manually" (manual ≠ systematic)
52
+ - CI will catch it (catch it NOW, not after push)
53
+
54
+ ## The Four Phases
55
+
56
+ You MUST complete all four phases before claiming completion. Order matters.
57
+
58
+ ### Phase 1: Test Execution
59
+
60
+ **Run ALL relevant tests, not just the ones you think matter.**
61
+
62
+ ```bash
63
+ # Run tests for affected area
64
+ npm test -- --coverage path/to/affected/
65
+ # OR
66
+ yarn test path/to/affected/
67
+
68
+ # Run full test suite if changes are cross-cutting
69
+ npm test
70
+ ```
71
+
72
+ **Verify:**
73
+ - [ ] All tests pass (zero failures)
74
+ - [ ] No test warnings or errors in output
75
+ - [ ] Coverage hasn't decreased
76
+ - [ ] New code has corresponding tests
77
+ - [ ] No skipped tests you forgot to unskip
78
+
79
+ **Test fails?** Fix it. Do NOT proceed to Phase 2.
80
+
81
+ **No tests exist?** Write them first. Untested code is unverified code.
82
+
83
+ ### Phase 2: Build Verification
84
+
85
+ **Confirm the project compiles and builds without errors.**
86
+
87
+ ```bash
88
+ # TypeScript projects
89
+ npx tsc --noEmit
90
+
91
+ # Build the project
92
+ npm run build
93
+ # OR
94
+ yarn build
95
+ ```
96
+
97
+ **Verify:**
98
+ - [ ] Zero TypeScript errors
99
+ - [ ] Zero build errors
100
+ - [ ] Zero build warnings (or only pre-existing ones)
101
+ - [ ] Output artifacts are generated correctly
102
+
103
+ **Build fails?** Fix it. Do NOT proceed to Phase 3.
104
+
105
+ **"It builds on my machine"** is not verification. Run the actual build command.
106
+
107
+ ### Phase 3: Lint and Quality Check
108
+
109
+ **Run linters and formatters to catch style and quality issues.**
110
+
111
+ ```bash
112
+ # Lint
113
+ npm run lint
114
+ # OR
115
+ npx eslint src/
116
+
117
+ # Format check
118
+ npm run format:check
119
+ # OR
120
+ npx prettier --check .
121
+ ```
122
+
123
+ **Verify:**
124
+ - [ ] Zero lint errors
125
+ - [ ] Zero formatting issues
126
+ - [ ] No new warnings introduced
127
+ - [ ] Pre-commit hooks will pass
128
+
129
+ **Lint fails?** Fix it. Do NOT proceed to Phase 4.
130
+
131
+ **Don't disable rules** to make lint pass. Fix the code.
132
+
133
+ ### Phase 4: Diff Review
134
+
135
+ **Review your own changes before anyone else sees them.**
136
+
137
+ ```bash
138
+ # Review all changes
139
+ git diff
140
+
141
+ # Review staged changes
142
+ git diff --cached
143
+
144
+ # Check for untracked files
145
+ git status
146
+ ```
147
+
148
+ **Verify:**
149
+ - [ ] No debug code (console.log, debugger, TODO hacks)
150
+ - [ ] No commented-out code
151
+ - [ ] No unintended file changes
152
+ - [ ] No secrets, credentials, or API keys
153
+ - [ ] No large binary files accidentally staged
154
+ - [ ] Commit scope matches intent (no unrelated changes)
155
+
156
+ **Found issues?** Fix them. Do NOT commit.
157
+
158
+ **"I'll clean it up later"** — No. Clean it up now.
159
+
160
+ ## The Verification Report
161
+
162
+ After completing all four phases, summarize evidence:
163
+
164
+ ```
165
+ ## Verification Complete
166
+
167
+ - Tests: ✅ X passed, 0 failed (Y% coverage)
168
+ - Build: ✅ Clean compilation, zero errors
169
+ - Lint: ✅ No errors, no new warnings
170
+ - Diff: ✅ Reviewed, no debug code or secrets
171
+ ```
172
+
173
+ **Only after this report can you claim work is complete.**
174
+
175
+ ## Red Flags — STOP and Verify
176
+
177
+ If you catch yourself thinking:
178
+
179
+ | Thought | Reality |
180
+ |---------|---------|
181
+ | "Tests should pass" | Run them. "Should" isn't evidence. |
182
+ | "I only changed one line" | One line can break everything. Verify. |
183
+ | "CI will catch it" | Catch it now. Don't waste CI time. |
184
+ | "I already tested manually" | Manual testing is incomplete. Run automated checks. |
185
+ | "Build was fine last time" | Your changes may have broken it. Build again. |
186
+ | "Lint is too strict" | Fix code, don't disable rules. |
187
+ | "I'll review the diff later" | Review now. Later never comes. |
188
+ | "It's just a docs change" | Docs can have broken links, bad formatting. Verify. |
189
+ | "Tests take too long" | Run them anyway. Slow tests > shipped bugs. |
190
+ | "I'm confident it works" | Confidence without evidence is arrogance. |
191
+
192
+ **ALL of these mean: STOP. Run the verification.**
193
+
194
+ ## Common Rationalizations
195
+
196
+ | Excuse | Reality |
197
+ |--------|---------|
198
+ | "Too simple to break" | Simple changes break builds. 30-second check prevents hours of debugging. |
199
+ | "I'll verify after commit" | Post-commit fixes require amend/revert. Verify before. |
200
+ | "Only changed tests" | Test changes can mask real failures. Run the suite. |
201
+ | "CI runs everything" | CI feedback is slow. Local verification is fast. Catch issues immediately. |
202
+ | "Time pressure, ship it" | Shipping broken code creates MORE time pressure. Verify now. |
203
+ | "Other tests are flaky" | Distinguish your failures from flaky ones. Don't hide behind noise. |
204
+ | "Reviewer will catch it" | Reviewers miss things. Self-review catches 80% of issues. |
205
+ | "It worked in dev" | Dev ≠ prod. Build and test in the actual target environment. |
206
+
207
+ ## Quick Reference
208
+
209
+ | Phase | Command | Success Criteria |
210
+ |-------|---------|------------------|
211
+ | **1. Tests** | `npm test` | All pass, no warnings |
212
+ | **2. Build** | `npm run build` / `tsc --noEmit` | Zero errors |
213
+ | **3. Lint** | `npm run lint` | Zero errors, no new warnings |
214
+ | **4. Diff** | `git diff` + `git status` | Clean, no debug code |
215
+
216
+ ## Integration with Other Skills
217
+
218
+ - **After TDD:** Verification is the final gate after Red-Green-Refactor completes
219
+ - **After debugging:** Verify the fix AND verify no regressions were introduced
220
+ - **Before shipping:** This skill is the prerequisite to any commit or PR workflow
221
+
222
+ **Related skills:**
223
+ - **superpowers:test-driven-development** — For writing tests (Phase 1 input)
224
+ - **superpowers:systematic-debugging** — For investigating failures found during verification
225
+
226
+ ## Final Rule
227
+
228
+ ```
229
+ Evidence before assertions.
230
+ Verification before completion.
231
+ Output before claims.
232
+ ```
233
+
234
+ No exceptions without your human partner's permission.
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: widget-slot-architecture
3
3
  description: Architecture guide using Next.js App Router's Parallel Routes for Widget-Slot pattern. Separates static layouts from dynamic widgets to achieve separation of concerns, fault isolation, and plug-and-play development.
4
+ user-invocable: false
4
5
  ---
5
6
 
6
7
  # Widget-Slot Architecture (WSA)
@@ -738,3 +739,8 @@ Key Rules
738
739
  4. Always Define default.tsx
739
740
  5. Widgets Must Be Portable
740
741
  ```
742
+
743
+ ## Additional resources
744
+
745
+ - [Parallel route setup](examples/parallel-route-setup.tsx) — Complete dashboard layout with multiple slots, loading, error, and default states
746
+ - [Widget component](examples/widget-component.tsx) — Full TaskBoard widget with Server/Client Component split, actions, and barrel exports