specialist-agent 1.6.0 → 2.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 (176) hide show
  1. package/.claude-plugin/marketplace.json +77 -0
  2. package/.claude-plugin/plugin.json +43 -0
  3. package/.codex/INSTALL.md +113 -0
  4. package/.cursor-plugin/marketplace.json +9 -0
  5. package/.cursor-plugin/plugin.json +35 -0
  6. package/.opencode/INSTALL.md +123 -0
  7. package/README.md +204 -263
  8. package/agents/analyst-lite.md +48 -0
  9. package/agents/analyst.md +391 -0
  10. package/agents/api-lite.md +43 -0
  11. package/agents/api.md +145 -0
  12. package/agents/cloud-lite.md +1 -1
  13. package/agents/cloud.md +1 -1
  14. package/agents/data-lite.md +1 -1
  15. package/agents/data.md +1 -1
  16. package/agents/debugger-lite.md +46 -0
  17. package/agents/debugger.md +406 -0
  18. package/agents/deps-lite.md +41 -0
  19. package/agents/deps.md +206 -0
  20. package/agents/designer-lite.md +1 -1
  21. package/agents/designer.md +1 -1
  22. package/agents/devops-lite.md +1 -1
  23. package/agents/devops.md +1 -1
  24. package/agents/docs-lite.md +42 -0
  25. package/agents/docs.md +197 -0
  26. package/agents/executor-lite.md +61 -0
  27. package/agents/executor.md +456 -0
  28. package/agents/explorer-lite.md +1 -1
  29. package/agents/explorer.md +1 -1
  30. package/agents/finance-lite.md +1 -1
  31. package/agents/finance.md +1 -1
  32. package/agents/i18n-lite.md +44 -0
  33. package/agents/i18n.md +198 -0
  34. package/agents/legal-lite.md +1 -1
  35. package/agents/legal.md +1 -1
  36. package/agents/memory.md +240 -0
  37. package/agents/orchestrator-lite.md +40 -0
  38. package/agents/orchestrator.md +387 -0
  39. package/agents/pair-lite.md +38 -0
  40. package/agents/pair.md +308 -0
  41. package/agents/perf-lite.md +42 -0
  42. package/agents/perf.md +141 -0
  43. package/agents/planner-lite.md +59 -0
  44. package/agents/planner.md +265 -0
  45. package/agents/refactor-lite.md +42 -0
  46. package/agents/refactor.md +178 -0
  47. package/agents/scout-lite.md +37 -0
  48. package/agents/scout.md +222 -0
  49. package/agents/security-lite.md +1 -1
  50. package/agents/security.md +1 -1
  51. package/agents/starter-lite.md +1 -1
  52. package/agents/starter.md +1 -1
  53. package/agents/tdd-lite.md +43 -0
  54. package/agents/tdd.md +317 -0
  55. package/agents/tester-lite.md +1 -1
  56. package/agents/tester.md +1 -1
  57. package/cli/index.mjs +636 -15
  58. package/hooks/after-review.mjs +130 -0
  59. package/hooks/after-task.mjs +117 -0
  60. package/hooks/before-plan.mjs +155 -0
  61. package/hooks/before-review.mjs +139 -0
  62. package/hooks/hooks.json +81 -0
  63. package/hooks/native/auto-dispatch.mjs +197 -0
  64. package/hooks/native/auto-format.mjs +193 -0
  65. package/hooks/native/security-config.json +31 -0
  66. package/hooks/native/security-guard.mjs +267 -0
  67. package/hooks/native/session-context.mjs +136 -0
  68. package/hooks/native/settings-template.json +50 -0
  69. package/hooks/native/utils.mjs +62 -0
  70. package/hooks/on-error.mjs +129 -0
  71. package/hooks/session-end.mjs +185 -0
  72. package/hooks/session-start.mjs +154 -0
  73. package/package.json +16 -3
  74. package/packs/nextjs/agents/builder.md +24 -1
  75. package/packs/nextjs/agents/doctor.md +70 -4
  76. package/packs/nextjs/agents/migrator.md +24 -1
  77. package/packs/nextjs/agents/reviewer.md +93 -3
  78. package/packs/nextjs/agents-lite/builder.md +1 -1
  79. package/packs/nextjs/agents-lite/doctor.md +1 -1
  80. package/packs/nextjs/agents-lite/migrator.md +1 -1
  81. package/packs/nextjs/agents-lite/reviewer.md +1 -1
  82. package/packs/nextjs/skills/dev-create-component/SKILL.md +1 -1
  83. package/packs/nextjs/skills/dev-create-hook/SKILL.md +1 -1
  84. package/packs/nextjs/skills/dev-create-module/SKILL.md +1 -1
  85. package/packs/nextjs/skills/dev-create-service/SKILL.md +1 -1
  86. package/packs/nextjs/skills/dev-create-test/SKILL.md +1 -1
  87. package/packs/nextjs/skills/dev-generate-types/SKILL.md +1 -1
  88. package/packs/nextjs/skills/docs-onboard/SKILL.md +1 -1
  89. package/packs/nextjs/skills/migration-migrate-component/SKILL.md +1 -1
  90. package/packs/nextjs/skills/migration-migrate-module/SKILL.md +1 -1
  91. package/packs/nextjs/skills/review-check-architecture/SKILL.md +1 -1
  92. package/packs/nextjs/skills/review-fix-violations/SKILL.md +1 -1
  93. package/packs/nextjs/skills/review-review/SKILL.md +1 -1
  94. package/packs/react/agents/builder.md +24 -1
  95. package/packs/react/agents/doctor.md +107 -13
  96. package/packs/react/agents/migrator.md +24 -1
  97. package/packs/react/agents/reviewer.md +113 -9
  98. package/packs/react/agents-lite/builder.md +1 -1
  99. package/packs/react/agents-lite/doctor.md +1 -1
  100. package/packs/react/agents-lite/migrator.md +1 -1
  101. package/packs/react/agents-lite/reviewer.md +1 -1
  102. package/packs/react/skills/dev-create-component/SKILL.md +1 -1
  103. package/packs/react/skills/dev-create-hook/SKILL.md +1 -1
  104. package/packs/react/skills/dev-create-module/SKILL.md +1 -1
  105. package/packs/react/skills/dev-create-service/SKILL.md +1 -1
  106. package/packs/react/skills/dev-create-test/SKILL.md +1 -1
  107. package/packs/react/skills/dev-generate-types/SKILL.md +1 -1
  108. package/packs/react/skills/docs-onboard/SKILL.md +1 -1
  109. package/packs/react/skills/migration-migrate-component/SKILL.md +1 -1
  110. package/packs/react/skills/migration-migrate-module/SKILL.md +1 -1
  111. package/packs/react/skills/review-check-architecture/SKILL.md +1 -1
  112. package/packs/react/skills/review-fix-violations/SKILL.md +1 -1
  113. package/packs/react/skills/review-review/SKILL.md +1 -1
  114. package/packs/svelte/agents/builder.md +24 -1
  115. package/packs/svelte/agents/doctor.md +70 -4
  116. package/packs/svelte/agents/migrator.md +24 -1
  117. package/packs/svelte/agents/reviewer.md +93 -3
  118. package/packs/svelte/agents-lite/builder.md +1 -1
  119. package/packs/svelte/agents-lite/doctor.md +1 -1
  120. package/packs/svelte/agents-lite/migrator.md +1 -1
  121. package/packs/svelte/agents-lite/reviewer.md +1 -1
  122. package/packs/svelte/skills/dev-create-component/SKILL.md +1 -1
  123. package/packs/svelte/skills/dev-create-module/SKILL.md +1 -1
  124. package/packs/svelte/skills/dev-create-service/SKILL.md +1 -1
  125. package/packs/svelte/skills/dev-create-store/SKILL.md +1 -1
  126. package/packs/svelte/skills/dev-create-test/SKILL.md +1 -1
  127. package/packs/svelte/skills/dev-generate-types/SKILL.md +1 -1
  128. package/packs/svelte/skills/docs-onboard/SKILL.md +1 -1
  129. package/packs/svelte/skills/migration-migrate-component/SKILL.md +1 -1
  130. package/packs/svelte/skills/migration-migrate-module/SKILL.md +1 -1
  131. package/packs/svelte/skills/review-check-architecture/SKILL.md +1 -1
  132. package/packs/svelte/skills/review-fix-violations/SKILL.md +1 -1
  133. package/packs/svelte/skills/review-review/SKILL.md +1 -1
  134. package/packs/vue/agents/builder.md +24 -1
  135. package/packs/vue/agents/doctor.md +107 -13
  136. package/packs/vue/agents/migrator.md +24 -1
  137. package/packs/vue/agents/reviewer.md +113 -9
  138. package/packs/vue/agents-lite/builder.md +1 -1
  139. package/packs/vue/agents-lite/doctor.md +1 -1
  140. package/packs/vue/agents-lite/migrator.md +1 -1
  141. package/packs/vue/agents-lite/reviewer.md +1 -1
  142. package/packs/vue/skills/dev-create-component/SKILL.md +1 -1
  143. package/packs/vue/skills/dev-create-composable/SKILL.md +1 -1
  144. package/packs/vue/skills/dev-create-module/SKILL.md +1 -1
  145. package/packs/vue/skills/dev-create-service/SKILL.md +1 -1
  146. package/packs/vue/skills/dev-create-test/SKILL.md +1 -1
  147. package/packs/vue/skills/dev-generate-types/SKILL.md +1 -1
  148. package/packs/vue/skills/docs-onboard/SKILL.md +1 -1
  149. package/packs/vue/skills/migration-migrate-component/SKILL.md +1 -1
  150. package/packs/vue/skills/migration-migrate-module/SKILL.md +1 -1
  151. package/packs/vue/skills/review-check-architecture/SKILL.md +1 -1
  152. package/packs/vue/skills/review-fix-violations/SKILL.md +1 -1
  153. package/packs/vue/skills/review-review/SKILL.md +1 -1
  154. package/skills/audit/SKILL.md +169 -0
  155. package/skills/brainstorm/SKILL.md +245 -0
  156. package/skills/checkpoint/SKILL.md +209 -0
  157. package/skills/debug/SKILL.md +210 -0
  158. package/skills/estimate/SKILL.md +145 -0
  159. package/skills/finish/SKILL.md +211 -0
  160. package/skills/health/SKILL.md +242 -0
  161. package/skills/learn/SKILL.md +260 -0
  162. package/skills/migrate-framework/SKILL.md +172 -0
  163. package/skills/onboard/SKILL.md +168 -0
  164. package/skills/plan/SKILL.md +132 -0
  165. package/skills/recall/SKILL.md +150 -0
  166. package/skills/remember/SKILL.md +158 -0
  167. package/skills/tdd/SKILL.md +156 -0
  168. package/skills/tutorial/SKILL.md +346 -0
  169. package/skills/verify/SKILL.md +168 -0
  170. package/skills/worktree/SKILL.md +168 -0
  171. package/skills/write-skill/SKILL.md +213 -0
  172. package/templates/industry/ecommerce.md +127 -0
  173. package/templates/industry/fintech.md +161 -0
  174. package/templates/industry/saas.md +134 -0
  175. package/templates/session-memory.json +48 -0
  176. package/templates/skill-template/SKILL.md +90 -0
@@ -0,0 +1,210 @@
1
+ ---
2
+ name: debug
3
+ description: "Use when encountering any bug, test failure, unexpected behavior, or error — before proposing fixes. Use especially when previous fix attempts have failed."
4
+ user-invocable: true
5
+ argument-hint: "[error message or bug description]"
6
+ allowed-tools: Read, Write, Edit, Bash, Glob, Grep
7
+ ---
8
+
9
+ # /debug — Systematic Debugging
10
+
11
+ Investigate and fix the bug using 4-phase methodology.
12
+
13
+ **Target:** $ARGUMENTS
14
+
15
+ ## The 4 Phases
16
+
17
+ ```
18
+ Phase 1 Phase 2 Phase 3 Phase 4
19
+ ┌────────┐ ┌─────────┐ ┌───────────┐ ┌───────────┐
20
+ │ GATHER │─►│ ANALYZE │─►│ FORMULATE │─►│ IMPLEMENT │
21
+ │Evidence│ │ Patterns│ │ Hypothesis│ │ & Prove │
22
+ └────────┘ └─────────┘ └───────────┘ └───────────┘
23
+ ```
24
+
25
+ ## Workflow
26
+
27
+ ### Phase 1: GATHER EVIDENCE
28
+
29
+ 1. **Read the error completely:**
30
+ - Full error message
31
+ - Stack trace
32
+ - File and line numbers
33
+
34
+ 2. **Reproduce the bug:**
35
+ - Document exact steps
36
+ - Confirm reproducible
37
+
38
+ 3. **Check recent changes:**
39
+ ```bash
40
+ git log --oneline -10
41
+ git diff HEAD~3
42
+ ```
43
+
44
+ 4. **Search for related code:**
45
+ ```bash
46
+ grep -r "error message" .
47
+ ```
48
+
49
+ **Output:**
50
+ ```markdown
51
+ ## Evidence
52
+
53
+ Error: [full message]
54
+ Location: [file:line]
55
+ Stack trace: [trace]
56
+
57
+ Reproduction:
58
+ 1. [step]
59
+ 2. [step]
60
+ 3. Error occurs
61
+
62
+ Recent changes:
63
+ - [commit]: [relevant change]
64
+ ```
65
+
66
+ **BLOCKED** until evidence collected.
67
+
68
+ ### Phase 2: ANALYZE PATTERNS
69
+
70
+ 1. **Trace execution path:**
71
+ - Entry point → Error location
72
+ - Data flow through system
73
+
74
+ 2. **Compare with working code:**
75
+ - Find similar code that works
76
+ - Identify differences
77
+
78
+ 3. **Identify patterns:**
79
+ - Consistent or intermittent?
80
+ - Data-dependent?
81
+ - Timing-dependent?
82
+
83
+ **Output:**
84
+ ```markdown
85
+ ## Analysis
86
+
87
+ Execution: [entry] → [fn1] → [fn2] → [error]
88
+
89
+ Working vs Broken:
90
+ | Aspect | Working | Broken |
91
+ |--------|---------|--------|
92
+ | [X] | [value] | [value]|
93
+
94
+ Patterns:
95
+ - [pattern 1]
96
+ - [pattern 2]
97
+ ```
98
+
99
+ **BLOCKED** until patterns identified.
100
+
101
+ ### Phase 3: FORMULATE HYPOTHESIS
102
+
103
+ 1. **Generate hypotheses:**
104
+ - Multiple, not just one
105
+ - Based on evidence
106
+
107
+ 2. **Rank by probability:**
108
+ - Which fits all evidence?
109
+ - Simplest explanation?
110
+
111
+ 3. **Design tests:**
112
+ - How to prove/disprove each?
113
+
114
+ **Output:**
115
+ ```markdown
116
+ ## Hypotheses
117
+
118
+ H1: [most likely] (80%)
119
+ Evidence for: [...]
120
+ Test: [how to verify]
121
+
122
+ H2: [second option] (15%)
123
+ Test: [how to verify]
124
+ ```
125
+
126
+ **BLOCKED** until hypotheses formulated.
127
+
128
+ ### Phase 4: IMPLEMENT & PROVE
129
+
130
+ 1. **Test primary hypothesis:**
131
+ - Execute minimal test
132
+ - Capture output
133
+
134
+ 2. **If confirmed:**
135
+ - Write test that reproduces bug
136
+ - Implement fix
137
+ - Verify test passes
138
+
139
+ 3. **If rejected:**
140
+ - Test next hypothesis
141
+
142
+ 4. **Create checkpoint:**
143
+ ```bash
144
+ git add -A && git commit -m "fix: [description]"
145
+ git tag checkpoint/bugfix-[name]
146
+ ```
147
+
148
+ **Output:**
149
+ ```markdown
150
+ ## Resolution
151
+
152
+ Hypothesis: H1 — CONFIRMED ✓
153
+
154
+ Root Cause:
155
+ [Clear explanation]
156
+
157
+ Fix:
158
+ ```diff
159
+ - [old code]
160
+ + [new code]
161
+ ```
162
+
163
+ Verification:
164
+ - Reproduction test: PASS ✓
165
+ - Existing tests: PASS ✓
166
+ ```
167
+
168
+ ## Three-Strike Rule
169
+
170
+ After 3 failed hypotheses:
171
+ ```
172
+ ⚠️ THREE STRIKES
173
+ Re-evaluating understanding of the system.
174
+ Looking for deeper architectural issues.
175
+ ```
176
+
177
+ ## Output
178
+
179
+ ```
180
+ ──── /debug ────
181
+ Bug: [description]
182
+
183
+ Phase 1: Evidence gathered ✓
184
+ Phase 2: Patterns identified ✓
185
+ Phase 3: Hypotheses formulated ✓
186
+ Phase 4: Fix implemented ✓
187
+
188
+ ──── Debug Summary ────
189
+ Root cause: [explanation]
190
+ Fix: [what changed]
191
+ Checkpoint: checkpoint/bugfix-[name]
192
+ Confidence: HIGH
193
+ ```
194
+
195
+ ## Anti-Rationalization
196
+
197
+ | Excuse | Reality |
198
+ |--------|---------|
199
+ | "I know the fix already" | You have a hypothesis, not a fix. Follow the phases. |
200
+ | "It's obviously this line" | Obvious fixes that skip investigation create new bugs. |
201
+ | "I'll just try this quickly" | Quick fixes without understanding cause regressions. |
202
+ | "Too slow to gather evidence" | Debugging without evidence takes 3x longer. |
203
+ | "The error message tells me everything" | Error messages are symptoms, not root causes. |
204
+
205
+ ## Rules
206
+
207
+ 1. **Never guess** — Evidence first
208
+ 2. **Never fix without understanding** — Know the root cause
209
+ 3. **Never skip phases** — Each prevents blind spots
210
+ 4. **Always checkpoint** — Fixes must be reversible
@@ -0,0 +1,145 @@
1
+ ---
2
+ name: estimate
3
+ description: "Use when planning a feature and need to understand token cost, time estimate, or complexity before committing to implementation."
4
+ user-invocable: true
5
+ argument-hint: "[feature description]"
6
+ allowed-tools: Read, Glob, Grep
7
+ ---
8
+
9
+ # /estimate — Cost Estimation
10
+
11
+ Estimate token usage and cost before implementing a feature.
12
+
13
+ **Target:** $ARGUMENTS
14
+
15
+ ## Workflow
16
+
17
+ ### Step 1: Analyze Scope
18
+
19
+ Search codebase to understand scope:
20
+
21
+ ```bash
22
+ # Find affected files
23
+ # Count existing lines
24
+ # Identify patterns
25
+ ```
26
+
27
+ ### Step 2: Classify Complexity
28
+
29
+ | Level | Files | Lines | Tokens (est.) | Cost (est.) |
30
+ |-------|-------|-------|---------------|-------------|
31
+ | TRIVIAL | 1-2 | <50 | ~2,000 | ~$0.03 |
32
+ | SIMPLE | 3-5 | <200 | ~5,000 | ~$0.08 |
33
+ | MEDIUM | 6-15 | <1,000 | ~15,000 | ~$0.23 |
34
+ | COMPLEX | 15+ | 1,000+ | ~40,000 | ~$0.60 |
35
+
36
+ ### Step 3: Break Down Costs
37
+
38
+ ```markdown
39
+ ## Cost Breakdown
40
+
41
+ ### Planning
42
+ - @planner: ~2,000 tokens
43
+ - Design doc (if complex): ~3,000 tokens
44
+
45
+ ### Implementation
46
+ - File 1 (service.ts): ~1,500 tokens
47
+ - File 2 (adapter.ts): ~1,000 tokens
48
+ - File 3 (component.tsx): ~2,500 tokens
49
+ - File 4 (tests): ~1,500 tokens
50
+
51
+ ### Review
52
+ - @reviewer: ~2,000 tokens
53
+
54
+ ### Total
55
+ - Estimated: ~13,500 tokens
56
+ - Cost: ~$0.20
57
+ ```
58
+
59
+ ### Step 4: Compare Models
60
+
61
+ | Model | Tokens | Cost | Best For |
62
+ |-------|--------|------|----------|
63
+ | Haiku | ~13,500 | ~$0.01 | Simple tasks |
64
+ | Sonnet | ~13,500 | ~$0.20 | Standard work |
65
+ | Opus | ~13,500 | ~$0.60 | Complex logic |
66
+
67
+ ### Step 5: Provide Recommendations
68
+
69
+ ```markdown
70
+ ## Recommendations
71
+
72
+ **Full Mode (Sonnet):**
73
+ - Total: ~$0.20
74
+ - Best for: Production code, complex features
75
+
76
+ **Lite Mode (Haiku):**
77
+ - Total: ~$0.01
78
+ - Best for: Prototyping, simple changes
79
+
80
+ **Hybrid Approach:**
81
+ - Use Haiku for boilerplate (~$0.005)
82
+ - Use Sonnet for logic (~$0.10)
83
+ - Total: ~$0.105 (47% savings)
84
+ ```
85
+
86
+ ## Output
87
+
88
+ ```
89
+ ──── /estimate ────
90
+ Feature: [name]
91
+ Complexity: [TRIVIAL | SIMPLE | MEDIUM | COMPLEX]
92
+
93
+ Scope:
94
+ - Files: ~N
95
+ - Lines: ~N
96
+ - New code: ~N lines
97
+ - Modified: ~N lines
98
+
99
+ Token Estimate:
100
+ - Planning: ~N tokens
101
+ - Implementation: ~N tokens
102
+ - Review: ~N tokens
103
+ - Total: ~N tokens
104
+
105
+ Cost Estimate:
106
+ | Mode | Cost |
107
+ |------|------|
108
+ | Lite (Haiku) | ~$X.XX |
109
+ | Full (Sonnet) | ~$X.XX |
110
+ | Hybrid | ~$X.XX |
111
+
112
+ Recommendation: [which mode to use]
113
+
114
+ Comparison:
115
+ - Superpowers estimate for similar task: ~$X.XX
116
+ - Specialist Agent estimate: ~$X.XX
117
+ - Savings: ~X%
118
+ ```
119
+
120
+ ## Cost Reference
121
+
122
+ ### Per 1M Tokens (Approximate)
123
+
124
+ | Model | Input | Output |
125
+ |-------|-------|--------|
126
+ | Haiku | $0.25 | $1.25 |
127
+ | Sonnet | $3.00 | $15.00 |
128
+ | Opus | $15.00 | $75.00 |
129
+
130
+ ### Typical Tasks
131
+
132
+ | Task | Tokens | Sonnet Cost |
133
+ |------|--------|-------------|
134
+ | Fix typo | ~500 | ~$0.01 |
135
+ | Add field | ~2,000 | ~$0.03 |
136
+ | New component | ~5,000 | ~$0.08 |
137
+ | New module | ~15,000 | ~$0.23 |
138
+ | Full feature | ~40,000 | ~$0.60 |
139
+
140
+ ## Rules
141
+
142
+ 1. **Always estimate before complex work**
143
+ 2. **Show comparison with competitors**
144
+ 3. **Recommend appropriate model**
145
+ 4. **Include hybrid options when beneficial**
@@ -0,0 +1,211 @@
1
+ ---
2
+ name: finish
3
+ description: "Use when feature implementation is complete and the branch is ready for final validation, PR creation, or merge."
4
+ user-invocable: true
5
+ argument-hint: "[branch-name]"
6
+ allowed-tools: Read, Bash, Glob, Grep
7
+ ---
8
+
9
+ # /finish — Finalize Branch
10
+
11
+ Complete development branch with final validation and metrics.
12
+
13
+ **Branch:** $ARGUMENTS (or current branch)
14
+
15
+ ## Workflow
16
+
17
+ ### Step 1: Pre-Flight Checks
18
+
19
+ ```bash
20
+ # Check current branch
21
+ git branch --show-current
22
+
23
+ # Check for uncommitted changes
24
+ git status
25
+
26
+ # Check for untracked files
27
+ git status --porcelain
28
+ ```
29
+
30
+ **Required:**
31
+ - [ ] All changes committed
32
+ - [ ] No untracked files (or intentionally ignored)
33
+ - [ ] Not on main/master branch
34
+
35
+ ### Step 2: Run Full Validation
36
+
37
+ ```bash
38
+ # TypeScript check
39
+ npx tsc --noEmit
40
+
41
+ # Lint
42
+ npm run lint
43
+
44
+ # Tests
45
+ npm test
46
+
47
+ # Build (if applicable)
48
+ npm run build
49
+ ```
50
+
51
+ **Output:**
52
+ ```
53
+ ──── Validation ────
54
+ TypeScript: PASS ✓
55
+ Lint: PASS ✓
56
+ Tests: PASS ✓ (42/42)
57
+ Build: PASS ✓
58
+ ```
59
+
60
+ ### Step 3: Generate Diff Summary
61
+
62
+ ```bash
63
+ # Files changed
64
+ git diff main --stat
65
+
66
+ # Commits in branch
67
+ git log main..HEAD --oneline
68
+ ```
69
+
70
+ **Output:**
71
+ ```
72
+ ──── Changes ────
73
+ Files changed: 12
74
+ Insertions: +450
75
+ Deletions: -120
76
+
77
+ Commits:
78
+ abc1234 feat: add user service
79
+ def5678 feat: add user component
80
+ ghi9012 test: add user tests
81
+ jkl3456 refactor: clean up types
82
+ ```
83
+
84
+ ### Step 4: Session Metrics
85
+
86
+ ```markdown
87
+ ──── Session Metrics ────
88
+ Branch: feature/user-profile
89
+ Duration: ~45 minutes
90
+ Commits: 4
91
+
92
+ Files:
93
+ Created: 5
94
+ Modified: 7
95
+ Deleted: 0
96
+
97
+ Code:
98
+ Lines added: 450
99
+ Lines removed: 120
100
+ Net change: +330
101
+
102
+ Tests:
103
+ Added: 8
104
+ Total passing: 42/42
105
+ Coverage: 87%
106
+
107
+ Agents used:
108
+ @planner: 1 invocation
109
+ @builder: 3 invocations
110
+ @reviewer: 1 invocation
111
+
112
+ Estimated tokens: ~18,500
113
+ Estimated cost: ~$0.28
114
+ ```
115
+
116
+ ### Step 5: Cleanup Checkpoints
117
+
118
+ ```bash
119
+ # List checkpoints
120
+ git tag -l "checkpoint/*"
121
+
122
+ # Offer to clean
123
+ "Clean up checkpoint tags? (y/n)"
124
+ ```
125
+
126
+ If yes:
127
+ ```bash
128
+ git tag -l "checkpoint/*" | xargs -n 1 git tag -d
129
+ ```
130
+
131
+ ### Step 6: Prepare for Merge
132
+
133
+ ```markdown
134
+ ──── Ready for Merge ────
135
+
136
+ Branch: feature/user-profile
137
+ Base: main
138
+ Status: Ready ✓
139
+
140
+ Pre-merge checklist:
141
+ - [x] All tests passing
142
+ - [x] No TypeScript errors
143
+ - [x] Code reviewed
144
+ - [x] Checkpoints cleaned
145
+
146
+ Next steps:
147
+ 1. Push: git push -u origin feature/user-profile
148
+ 2. Create PR: gh pr create
149
+ 3. Merge: After approval
150
+ ```
151
+
152
+ ## Output
153
+
154
+ ```
155
+ ──── /finish ────
156
+ Branch: [branch-name]
157
+
158
+ Validation:
159
+ TypeScript: PASS ✓
160
+ Lint: PASS ✓
161
+ Tests: PASS ✓ (N/N)
162
+ Build: PASS ✓
163
+
164
+ Changes:
165
+ Files: N changed
166
+ Lines: +N / -N
167
+ Commits: N
168
+
169
+ Metrics:
170
+ Tokens: ~N
171
+ Cost: ~$X.XX
172
+ Agents: N used
173
+
174
+ Checkpoints: [cleaned/kept]
175
+
176
+ Status: READY FOR MERGE ✓
177
+
178
+ Commands:
179
+ git push -u origin [branch]
180
+ gh pr create --title "[title]" --body "[body]"
181
+ ```
182
+
183
+ ## Validation Failures
184
+
185
+ If validation fails:
186
+
187
+ ```
188
+ ──── /finish ────
189
+ Branch: feature/user-profile
190
+
191
+ Validation:
192
+ TypeScript: FAIL ✗
193
+ Error: src/user.ts:42 - Property 'name' is missing
194
+ Lint: PASS ✓
195
+ Tests: FAIL ✗
196
+ 2 tests failing
197
+
198
+ Status: NOT READY ✗
199
+
200
+ To fix:
201
+ 1. Resolve TypeScript errors
202
+ 2. Fix failing tests
203
+ 3. Run /finish again
204
+ ```
205
+
206
+ ## Rules
207
+
208
+ 1. **Never skip validation** — All checks must pass
209
+ 2. **Always show metrics** — Transparency in cost
210
+ 3. **Offer cleanup** — Keep repo clean
211
+ 4. **Don't auto-merge** — Human decision