hero-mmt-kit 1.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.
- package/CHANGELOG.md +57 -0
- package/LICENSE +21 -0
- package/README.md +158 -0
- package/bin/hero-mmt-kit.js +70 -0
- package/package.json +35 -0
- package/presets/enterprise.json +3 -0
- package/presets/small-team.json +3 -0
- package/presets/solo.json +3 -0
- package/skills.manifest.json +72 -0
- package/src/detect.cjs +43 -0
- package/src/discover.cjs +159 -0
- package/src/doctor.cjs +130 -0
- package/src/init.cjs +114 -0
- package/src/integrations.cjs +93 -0
- package/src/links.cjs +37 -0
- package/src/merge.cjs +61 -0
- package/src/profile-config.cjs +28 -0
- package/src/render.cjs +27 -0
- package/src/skills.cjs +107 -0
- package/src/update.cjs +75 -0
- package/src/util.cjs +56 -0
- package/src/workflow-state.cjs +65 -0
- package/templates/.hero-mmt-kit/session.schema.json +15 -0
- package/templates/AGENTS.md.tmpl +16 -0
- package/templates/CLAUDE.md.tmpl +23 -0
- package/templates/common/.claude/hooks/git-guard.cjs +57 -0
- package/templates/common/.claude/hooks/session-bridge.cjs +43 -0
- package/templates/common/.claude/hooks/stop-reminder.cjs +43 -0
- package/templates/common/.claude/settings.json +27 -0
- package/templates/docs/ACTIVE_STATE.md +41 -0
- package/templates/docs/BROWNFIELD_DISCOVERY.md +45 -0
- package/templates/docs/DESIGN_STANDARDS.md +86 -0
- package/templates/docs/INTERACTION_PATTERNS.md +58 -0
- package/templates/docs/PERFORMANCE_STANDARDS.md +31 -0
- package/templates/docs/SECURITY_STANDARDS.md +38 -0
- package/templates/docs/templates/DESIGN_BRIEF.md +44 -0
- package/templates/docs/templates/PRD_AI_FEATURE.md +87 -0
- package/templates/skills/NOTICE +69 -0
- package/templates/skills/brainstorming/SKILL.md +161 -0
- package/templates/skills/brainstorming/scripts/frame-template.html +214 -0
- package/templates/skills/brainstorming/scripts/helper.js +88 -0
- package/templates/skills/brainstorming/scripts/server.cjs +354 -0
- package/templates/skills/brainstorming/scripts/start-server.sh +148 -0
- package/templates/skills/brainstorming/scripts/stop-server.sh +56 -0
- package/templates/skills/brainstorming/spec-document-reviewer-prompt.md +49 -0
- package/templates/skills/brainstorming/visual-companion.md +287 -0
- package/templates/skills/dispatching-parallel-agents/SKILL.md +186 -0
- package/templates/skills/executing-plans/SKILL.md +72 -0
- package/templates/skills/finishing-a-development-branch/SKILL.md +253 -0
- package/templates/skills/hero-coding/SKILL.md +69 -0
- package/templates/skills/hero-planning/SKILL.md +64 -0
- package/templates/skills/hero-reviewing/SKILL.md +66 -0
- package/templates/skills/hero-security/SKILL.md +425 -0
- package/templates/skills/hero-strict/SKILL.md +77 -0
- package/templates/skills/hero-unit-test/SKILL.md +79 -0
- package/templates/skills/receiving-code-review/SKILL.md +213 -0
- package/templates/skills/requesting-code-review/SKILL.md +108 -0
- package/templates/skills/requesting-code-review/code-reviewer.md +168 -0
- package/templates/skills/subagent-driven-development/SKILL.md +269 -0
- package/templates/skills/subagent-driven-development/code-quality-reviewer-prompt.md +34 -0
- package/templates/skills/subagent-driven-development/implementer-prompt.md +121 -0
- package/templates/skills/subagent-driven-development/scripts/review-package.sh +38 -0
- package/templates/skills/subagent-driven-development/scripts/sdd-workspace.sh +25 -0
- package/templates/skills/subagent-driven-development/scripts/task-brief.sh +58 -0
- package/templates/skills/subagent-driven-development/spec-reviewer-prompt.md +76 -0
- package/templates/skills/systematic-debugging/SKILL.md +296 -0
- package/templates/skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
- package/templates/skills/systematic-debugging/condition-based-waiting.md +115 -0
- package/templates/skills/systematic-debugging/defense-in-depth.md +122 -0
- package/templates/skills/systematic-debugging/find-polluter.sh +63 -0
- package/templates/skills/systematic-debugging/root-cause-tracing.md +169 -0
- package/templates/skills/test-driven-development/SKILL.md +371 -0
- package/templates/skills/test-driven-development/testing-anti-patterns.md +299 -0
- package/templates/skills/using-git-worktrees/SKILL.md +206 -0
- package/templates/skills/using-hero/SKILL.md +54 -0
- package/templates/skills/using-superpowers/SKILL.md +119 -0
- package/templates/skills/verification-before-completion/SKILL.md +139 -0
- package/templates/skills/writing-plans/SKILL.md +173 -0
- package/templates/skills/writing-plans/plan-document-reviewer-prompt.md +49 -0
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: finishing-a-development-branch
|
|
3
|
+
description: Use when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for merge, PR, or cleanup
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Finishing a Development Branch
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Guide completion of development work by presenting clear options and handling chosen workflow.
|
|
11
|
+
|
|
12
|
+
**Core principle:** Verify tests → Detect environment → Present options → Execute choice → Clean up.
|
|
13
|
+
|
|
14
|
+
**See also:** `using-git-worktrees` — this skill finishes and cleans up the workspace that `using-git-worktrees` sets up. Directory ownership and provenance conventions are defined there.
|
|
15
|
+
|
|
16
|
+
**Announce at start:** "I'm using the finishing-a-development-branch skill to complete this work."
|
|
17
|
+
|
|
18
|
+
## The Process
|
|
19
|
+
|
|
20
|
+
### Step 1: Verify Tests
|
|
21
|
+
|
|
22
|
+
**Before presenting options, verify tests pass:**
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
# Run project's test suite
|
|
26
|
+
npm test / cargo test / pytest / go test ./...
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
**If tests fail:**
|
|
30
|
+
```
|
|
31
|
+
Tests failing (<N> failures). Must fix before completing:
|
|
32
|
+
|
|
33
|
+
[Show failures]
|
|
34
|
+
|
|
35
|
+
Cannot proceed with merge/PR until tests pass.
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Stop. Don't proceed to Step 2.
|
|
39
|
+
|
|
40
|
+
**If tests pass:** Continue to Step 2.
|
|
41
|
+
|
|
42
|
+
### Step 2: Detect Environment
|
|
43
|
+
|
|
44
|
+
**Determine workspace state before presenting options:**
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
GIT_DIR=$(cd "$(git rev-parse --git-dir)" 2>/dev/null && pwd -P)
|
|
48
|
+
GIT_COMMON=$(cd "$(git rev-parse --git-common-dir)" 2>/dev/null && pwd -P)
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
This determines which menu to show and how cleanup works:
|
|
52
|
+
|
|
53
|
+
| State | Menu | Cleanup |
|
|
54
|
+
|-------|------|---------|
|
|
55
|
+
| `GIT_DIR == GIT_COMMON` (normal repo) | Standard 4 options | No worktree to clean up |
|
|
56
|
+
| `GIT_DIR != GIT_COMMON`, named branch | Standard 4 options | Provenance-based (see Step 6) |
|
|
57
|
+
| `GIT_DIR != GIT_COMMON`, detached HEAD | Reduced 3 options (no merge) | No cleanup (externally managed) |
|
|
58
|
+
|
|
59
|
+
### Step 3: Determine Base Branch
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
# Try common base branches
|
|
63
|
+
git merge-base HEAD main 2>/dev/null || git merge-base HEAD master 2>/dev/null
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Or ask: "This branch split from main - is that correct?"
|
|
67
|
+
|
|
68
|
+
### Step 4: Present Options
|
|
69
|
+
|
|
70
|
+
**Normal repo and named-branch worktree — present exactly these 4 options:**
|
|
71
|
+
|
|
72
|
+
```
|
|
73
|
+
Implementation complete. What would you like to do?
|
|
74
|
+
|
|
75
|
+
1. Merge back to <base-branch> locally
|
|
76
|
+
2. Push and create a Pull Request
|
|
77
|
+
3. Keep the branch as-is (I'll handle it later)
|
|
78
|
+
4. Discard this work
|
|
79
|
+
|
|
80
|
+
Which option?
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
**Detached HEAD — present exactly these 3 options:**
|
|
84
|
+
|
|
85
|
+
```
|
|
86
|
+
Implementation complete. You're on a detached HEAD (externally managed workspace).
|
|
87
|
+
|
|
88
|
+
1. Push as new branch and create a Pull Request
|
|
89
|
+
2. Keep as-is (I'll handle it later)
|
|
90
|
+
3. Discard this work
|
|
91
|
+
|
|
92
|
+
Which option?
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
**Don't add explanation** - keep options concise.
|
|
96
|
+
|
|
97
|
+
### Step 5: Execute Choice
|
|
98
|
+
|
|
99
|
+
#### Option 1: Merge Locally
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
# Get main repo root for CWD safety
|
|
103
|
+
MAIN_ROOT=$(git -C "$(git rev-parse --git-common-dir)/.." rev-parse --show-toplevel)
|
|
104
|
+
cd "$MAIN_ROOT"
|
|
105
|
+
|
|
106
|
+
# Merge first — verify success before removing anything
|
|
107
|
+
git checkout <base-branch>
|
|
108
|
+
git pull
|
|
109
|
+
git merge <feature-branch>
|
|
110
|
+
|
|
111
|
+
# Verify tests on merged result
|
|
112
|
+
<test command>
|
|
113
|
+
|
|
114
|
+
# Only after merge succeeds: cleanup worktree (Step 6), then delete branch
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Then: Cleanup worktree (Step 6), then delete branch:
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
git branch -d <feature-branch>
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
#### Option 2: Push and Create PR
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
# Push branch
|
|
127
|
+
git push -u origin <feature-branch>
|
|
128
|
+
|
|
129
|
+
# Create PR
|
|
130
|
+
gh pr create --title "<title>" --body "$(cat <<'EOF'
|
|
131
|
+
## Summary
|
|
132
|
+
<2-3 bullets of what changed>
|
|
133
|
+
|
|
134
|
+
## Test Plan
|
|
135
|
+
- [ ] <verification steps>
|
|
136
|
+
EOF
|
|
137
|
+
)"
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
**Do NOT clean up worktree** — user needs it alive to iterate on PR feedback.
|
|
141
|
+
|
|
142
|
+
#### Option 3: Keep As-Is
|
|
143
|
+
|
|
144
|
+
Report: "Keeping branch <name>. Worktree preserved at <path>."
|
|
145
|
+
|
|
146
|
+
**Don't cleanup worktree.**
|
|
147
|
+
|
|
148
|
+
#### Option 4: Discard
|
|
149
|
+
|
|
150
|
+
**Confirm first:**
|
|
151
|
+
```
|
|
152
|
+
This will permanently delete:
|
|
153
|
+
- Branch <name>
|
|
154
|
+
- All commits: <commit-list>
|
|
155
|
+
- Worktree at <path>
|
|
156
|
+
|
|
157
|
+
Type 'discard' to confirm.
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
Wait for exact confirmation.
|
|
161
|
+
|
|
162
|
+
If confirmed:
|
|
163
|
+
```bash
|
|
164
|
+
MAIN_ROOT=$(git -C "$(git rev-parse --git-common-dir)/.." rev-parse --show-toplevel)
|
|
165
|
+
cd "$MAIN_ROOT"
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
Then: Cleanup worktree (Step 6), then force-delete branch:
|
|
169
|
+
```bash
|
|
170
|
+
git branch -D <feature-branch>
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
### Step 6: Cleanup Workspace
|
|
174
|
+
|
|
175
|
+
**Only runs for Options 1 and 4.** Options 2 and 3 always preserve the worktree.
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
GIT_DIR=$(cd "$(git rev-parse --git-dir)" 2>/dev/null && pwd -P)
|
|
179
|
+
GIT_COMMON=$(cd "$(git rev-parse --git-common-dir)" 2>/dev/null && pwd -P)
|
|
180
|
+
WORKTREE_PATH=$(git rev-parse --show-toplevel)
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
**If `GIT_DIR == GIT_COMMON`:** Normal repo, no worktree to clean up. Done.
|
|
184
|
+
|
|
185
|
+
**If the worktree path is under one of the owned directories defined in `using-git-worktrees` § Directory Selection (`.worktrees/` or `worktrees/`):** Superpowers created this worktree — we own cleanup.
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
MAIN_ROOT=$(git -C "$(git rev-parse --git-common-dir)/.." rev-parse --show-toplevel)
|
|
189
|
+
cd "$MAIN_ROOT"
|
|
190
|
+
git worktree remove "$WORKTREE_PATH"
|
|
191
|
+
git worktree prune # Self-healing: clean up any stale registrations
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
**Otherwise:** The host environment (harness) owns this workspace. Do NOT remove it. If your platform provides a workspace-exit tool, use it. Otherwise, leave the workspace in place.
|
|
195
|
+
|
|
196
|
+
## Quick Reference
|
|
197
|
+
|
|
198
|
+
| Option | Merge | Push | Keep Worktree | Cleanup Branch |
|
|
199
|
+
|--------|-------|------|---------------|----------------|
|
|
200
|
+
| 1. Merge locally | yes | - | - | yes |
|
|
201
|
+
| 2. Create PR | - | yes | yes | - |
|
|
202
|
+
| 3. Keep as-is | - | - | yes | - |
|
|
203
|
+
| 4. Discard | - | - | - | yes (force) |
|
|
204
|
+
|
|
205
|
+
## Common Mistakes
|
|
206
|
+
|
|
207
|
+
**Skipping test verification**
|
|
208
|
+
- **Problem:** Merge broken code, create failing PR
|
|
209
|
+
- **Fix:** Always verify tests before offering options
|
|
210
|
+
|
|
211
|
+
**Open-ended questions**
|
|
212
|
+
- **Problem:** "What should I do next?" is ambiguous
|
|
213
|
+
- **Fix:** Present exactly 4 structured options (or 3 for detached HEAD)
|
|
214
|
+
|
|
215
|
+
**Cleaning up worktree for Option 2**
|
|
216
|
+
- **Problem:** Remove worktree user needs for PR iteration
|
|
217
|
+
- **Fix:** Only cleanup for Options 1 and 4
|
|
218
|
+
|
|
219
|
+
**Deleting branch before removing worktree**
|
|
220
|
+
- **Problem:** `git branch -d` fails because worktree still references the branch
|
|
221
|
+
- **Fix:** Merge first, remove worktree, then delete branch
|
|
222
|
+
|
|
223
|
+
**Running git worktree remove from inside the worktree**
|
|
224
|
+
- **Problem:** Command fails silently when CWD is inside the worktree being removed
|
|
225
|
+
- **Fix:** Always `cd` to main repo root before `git worktree remove`
|
|
226
|
+
|
|
227
|
+
**Cleaning up harness-owned worktrees**
|
|
228
|
+
- **Problem:** Removing a worktree the harness created causes phantom state
|
|
229
|
+
- **Fix:** Only clean up worktrees under the owned directories from `using-git-worktrees` § Directory Selection (`.worktrees/` or `worktrees/`)
|
|
230
|
+
|
|
231
|
+
**No confirmation for discard**
|
|
232
|
+
- **Problem:** Accidentally delete work
|
|
233
|
+
- **Fix:** Require typed "discard" confirmation
|
|
234
|
+
|
|
235
|
+
## Red Flags
|
|
236
|
+
|
|
237
|
+
**Never:**
|
|
238
|
+
- Proceed with failing tests
|
|
239
|
+
- Merge without verifying tests on result
|
|
240
|
+
- Delete work without confirmation
|
|
241
|
+
- Force-push without explicit request
|
|
242
|
+
- Remove a worktree before confirming merge success
|
|
243
|
+
- Clean up worktrees you didn't create (provenance check)
|
|
244
|
+
- Run `git worktree remove` from inside the worktree
|
|
245
|
+
|
|
246
|
+
**Always:**
|
|
247
|
+
- Verify tests before offering options
|
|
248
|
+
- Detect environment before presenting menu
|
|
249
|
+
- Present exactly 4 options (or 3 for detached HEAD)
|
|
250
|
+
- Get typed confirmation for Option 4
|
|
251
|
+
- Clean up worktree for Options 1 & 4 only
|
|
252
|
+
- `cd` to main repo root before worktree removal
|
|
253
|
+
- Run `git worktree prune` after removal
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: hero-coding
|
|
3
|
+
description: Use when implementing an approved plan from hero-planning, or making a small change that doesn't need a plan
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Hero Coding
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
hero-coding is the implementation stage — it turns an approved plan into working code and produces a written record of what changed and why. It does not replace review or testing; it answers: "What did I build, how do I know it works, and where does it deviate from the plan?"
|
|
11
|
+
|
|
12
|
+
## When to Use
|
|
13
|
+
|
|
14
|
+
Use this skill when:
|
|
15
|
+
- `hero-planning` has produced an approved plan and it's time to implement it.
|
|
16
|
+
- The change is small or obvious enough (Tiny/Fast-sized work) that a full plan artifact would be pure overhead — go straight here.
|
|
17
|
+
|
|
18
|
+
## Inputs
|
|
19
|
+
|
|
20
|
+
Read artifact-first:
|
|
21
|
+
1. The plan artifact in `docs/plans/` (if one exists).
|
|
22
|
+
2. Any existing test plan or acceptance criteria.
|
|
23
|
+
3. The current codebase state relevant to the change.
|
|
24
|
+
|
|
25
|
+
If there's no plan artifact, proceed on the strength of the request itself and note that in the coding report.
|
|
26
|
+
|
|
27
|
+
## Process
|
|
28
|
+
|
|
29
|
+
1. Read the plan artifact fully before starting (if one exists). Don't begin editing from a partial read.
|
|
30
|
+
2. Implement using the vendored `executing-plans` skill's discipline: work through tasks in bite-sized steps, run the verification each task specifies, and mark tasks complete as you go rather than at the end.
|
|
31
|
+
3. For independent or parallel work streams, use the vendored `subagent-driven-development` and `dispatching-parallel-agents` skills to delegate. Keep dependent work sequential; only fan out work that has no shared state or ordering constraint.
|
|
32
|
+
4. If unexpected bugs surface mid-implementation, switch to the vendored `systematic-debugging` skill instead of guessing at fixes.
|
|
33
|
+
5. Run relevant verification — build, lint, targeted tests — as you go, not only at the end. Catching a break right after the edit that caused it is cheaper than catching it after ten more edits.
|
|
34
|
+
6. Write an execution report describing what changed, the evidence collected, and any remaining risks or deviations from the plan.
|
|
35
|
+
|
|
36
|
+
## Output Artifact
|
|
37
|
+
|
|
38
|
+
`docs/coding-reports/YYYY-MM-DD-<slug>.md` — use the same slug as the originating plan when one exists, so the two artifacts pair up.
|
|
39
|
+
|
|
40
|
+
Report should cover:
|
|
41
|
+
- What changed (files, symbols, behavior) and why.
|
|
42
|
+
- Evidence: commands run and what they showed (build/lint/test output, manual checks).
|
|
43
|
+
- Deviations from the plan, if any, and the reasoning behind them.
|
|
44
|
+
- Open risks or follow-ups for review/testing to pick up.
|
|
45
|
+
|
|
46
|
+
Report style:
|
|
47
|
+
- Keep the report tight: no narrative scaffolding, no "I did..." filler.
|
|
48
|
+
- Preserve all technical evidence verbatim: commands, output summaries, file paths, symbols, errors, numbers.
|
|
49
|
+
- Use concise bullets for changed files, evidence, deviations, and risks.
|
|
50
|
+
- Use full prose only where brevity could hide a risk, deviation, or irreversible action.
|
|
51
|
+
|
|
52
|
+
## Definition of Done
|
|
53
|
+
|
|
54
|
+
- Implementation matches the plan, or deviations are documented and explained.
|
|
55
|
+
- Evidence of correctness is recorded — not just "tests pass" but which commands were run and what they showed.
|
|
56
|
+
- The coding report is saved at the artifact path above.
|
|
57
|
+
|
|
58
|
+
## ACTIVE_STATE.md Update
|
|
59
|
+
|
|
60
|
+
- Update the Active Features row's status/phase in `docs/ACTIVE_STATE.md` to reflect coding is complete.
|
|
61
|
+
- Write `.hero-mmt-kit/session.json` with `currentSkill: "hero-coding"`, `resumePath` pointing at the coding report, `nextAction` (typically `"review"` or `"test"`), and `lastCheckpoint`/`updatedAt` set to the current ISO timestamp.
|
|
62
|
+
|
|
63
|
+
## Related Skills
|
|
64
|
+
|
|
65
|
+
This skill wraps the vendored `executing-plans`, `subagent-driven-development`, `dispatching-parallel-agents`, and `systematic-debugging` skills rather than duplicating their content.
|
|
66
|
+
|
|
67
|
+
- Reads its input from `hero-planning`.
|
|
68
|
+
- Hands off to `hero-reviewing` and/or `hero-unit-test` next.
|
|
69
|
+
- Recommend a separate `hero-security` pass if the change touched a sensitive surface (auth, data, secrets, external input, AI/LLM behavior); do not embed the security review in this coding stage.
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: hero-planning
|
|
3
|
+
description: Use when starting new work — a feature, bugfix, or refactor that needs a plan before code changes
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Hero Planning
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
hero-planning turns a request into an agreed, written plan before any code changes. It is the entry point for anything bigger than a trivial fix — the moment where scope, approach, and risk get worked out with the human instead of guessed at mid-implementation.
|
|
11
|
+
|
|
12
|
+
## When to Use
|
|
13
|
+
|
|
14
|
+
Use this skill when:
|
|
15
|
+
- Starting a new feature.
|
|
16
|
+
- Fixing a bug that needs more than a one-line change.
|
|
17
|
+
- Planning a refactor.
|
|
18
|
+
- The approach isn't obvious and is worth agreeing on before touching code.
|
|
19
|
+
|
|
20
|
+
Skip it for typo fixes, trivial config edits, or an obvious one-file change — those can go straight to `hero-coding` with no plan artifact.
|
|
21
|
+
|
|
22
|
+
## Inputs
|
|
23
|
+
|
|
24
|
+
- The user's request or brief.
|
|
25
|
+
- Existing codebase context — use GitNexus (`gitnexus_query`, `gitnexus_context`, `gitnexus_impact`) or Serena when available to understand what's already there; don't block on them if they aren't.
|
|
26
|
+
- Any existing state to resume from: `docs/ACTIVE_STATE.md`'s Active Features table, or `.hero-mmt-kit/session.json`.
|
|
27
|
+
|
|
28
|
+
## Process
|
|
29
|
+
|
|
30
|
+
1. **Brainstorm with the human first.** Invoke the vendored `brainstorming` skill to clarify goals, requirements, constraints, edge cases, and open questions before writing anything down. Don't skip this by guessing at intent — surface ambiguity and resolve it in conversation.
|
|
31
|
+
2. **Assess blast radius for existing-behavior changes.** For refactors or changes to existing behavior, run `gitnexus_impact` (upstream) if GitNexus is available, and report the blast radius — direct callers, affected processes, risk level — before proceeding.
|
|
32
|
+
3. **Write the plan.** Use the vendored `writing-plans` skill's structure to produce: scope, approach, files/areas touched, risks, and a step-by-step breakdown.
|
|
33
|
+
4. **Get explicit approval.** The plan is not ready for `hero-coding` until the human has approved it — via Claude Code's Plan Mode, or an explicit "looks good" in chat. Do not proceed on an assumed yes.
|
|
34
|
+
|
|
35
|
+
## Output Artifact
|
|
36
|
+
|
|
37
|
+
`docs/plans/YYYY-MM-DD-<slug>.md` — lowercase kebab-case slug matching the work item.
|
|
38
|
+
|
|
39
|
+
Plan writing style:
|
|
40
|
+
- Be concise but complete: scope, approach, touched files, risks, and steps must remain explicit.
|
|
41
|
+
- Use bullets and checklists over prose where possible.
|
|
42
|
+
- Preserve exact file paths, commands, APIs, config keys, and risk labels.
|
|
43
|
+
- Use full clarity for ambiguous sequencing, destructive actions, or security-sensitive steps.
|
|
44
|
+
|
|
45
|
+
## Definition of Done
|
|
46
|
+
|
|
47
|
+
- The plan covers scope, approach, touched files, risks, and a step-by-step breakdown.
|
|
48
|
+
- The human has explicitly approved the plan.
|
|
49
|
+
- The plan is saved at the artifact path above.
|
|
50
|
+
|
|
51
|
+
## ACTIVE_STATE.md Update
|
|
52
|
+
|
|
53
|
+
- Add or update this work item's row in the Active Features table in `docs/ACTIVE_STATE.md`.
|
|
54
|
+
- Write `.hero-mmt-kit/session.json` with:
|
|
55
|
+
- `currentSkill: "hero-planning"`
|
|
56
|
+
- `resumePath` pointing at the plan file
|
|
57
|
+
- `nextAction` describing the first concrete implementation step
|
|
58
|
+
- `updatedAt` (ISO timestamp)
|
|
59
|
+
|
|
60
|
+
## Related Skills
|
|
61
|
+
|
|
62
|
+
- Wraps the vendored `brainstorming` skill (requirements/edge-case discovery with the human) and `writing-plans` skill (plan structure).
|
|
63
|
+
- Hands off to `hero-coding` once the plan is approved.
|
|
64
|
+
- For refactors, lean on `gitnexus_impact` and `gitnexus_rename` during planning and later execution.
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: hero-reviewing
|
|
3
|
+
description: Use for a fresh-eyes check of an implementation against its plan, before merge
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Hero Reviewing
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
hero-reviewing is a separate, fresh-eyes read of the planning artifact, the coding report, and the actual changed code — checking that the implementation really does what was agreed, before the work is considered mergeable. It is a review pass, not a testing pass: it does not write or run unit tests. That belongs to `hero-unit-test`, which is a parallel, independent stage.
|
|
11
|
+
|
|
12
|
+
**Core principle:** don't trust the chat transcript or the "done" claim — read the artifacts and the diff, and verify the plan and the code actually agree.
|
|
13
|
+
|
|
14
|
+
## When to Use
|
|
15
|
+
|
|
16
|
+
Use this skill after `hero-coding` completes, before merge or handover.
|
|
17
|
+
|
|
18
|
+
- Optional for trivial, single-file, low-risk changes (typo fixes, copy tweaks, config values).
|
|
19
|
+
- Expected for Standard-or-larger changes: behavior changes to existing code, refactors, new features, anything with more than one plausible way to implement it.
|
|
20
|
+
- Also reach for it whenever the coding report is thin, the diff is larger than expected, or something about the change feels rushed.
|
|
21
|
+
|
|
22
|
+
## Inputs
|
|
23
|
+
|
|
24
|
+
Read artifact-first, not the whole conversation history:
|
|
25
|
+
1. The planning artifact (`docs/plans/YYYY-MM-DD-slug.md`), if one exists.
|
|
26
|
+
2. The coding report (`docs/coding-reports/YYYY-MM-DD-slug.md`).
|
|
27
|
+
3. The actual changed code / diff — the source of truth, not the report's description of it.
|
|
28
|
+
4. Existing project conventions and any prior review notes on the same area.
|
|
29
|
+
|
|
30
|
+
If the plan artifact doesn't exist (small change that skipped planning), review the diff against the stated intent in the coding report instead, and note that no plan was reviewed against.
|
|
31
|
+
|
|
32
|
+
## Process
|
|
33
|
+
|
|
34
|
+
1. Read the planning artifact, the execution report, and the changed code. Do not rely on the chat transcript for what happened — the artifacts are the record.
|
|
35
|
+
2. Check build success, syntax, and adherence to project conventions (naming, structure, existing patterns in the touched files).
|
|
36
|
+
3. Check whether the implementation actually matches the plan: every planned step done, no silent scope cuts, no undocumented deviations. Flag anything the plan promised that the code doesn't deliver, and anything the code does that the plan didn't mention.
|
|
37
|
+
4. If delegating the review to a sub-agent, use the vendored `requesting-code-review` skill's prompt structure so the sub-agent has the right context and scope. If you are the one receiving findings back, follow `receiving-code-review` discipline: fix Critical/Important findings before proceeding, re-review only the fix or the disputed finding (don't re-review the whole diff) unless scope expanded, and push back on findings you believe are incorrect with evidence rather than accepting them by default.
|
|
38
|
+
5. Do not write or run unit tests in this phase — that's `hero-unit-test`'s job, not this skill's.
|
|
39
|
+
6. Record findings and a clear verdict: pass, pass with follow-ups, or blocked.
|
|
40
|
+
|
|
41
|
+
## Output Artifact
|
|
42
|
+
|
|
43
|
+
`docs/reviews/YYYY-MM-DD-<slug>.md` — findings plus a verdict.
|
|
44
|
+
|
|
45
|
+
Review style:
|
|
46
|
+
- Keep it concise: what was reviewed, what was found, what remains open.
|
|
47
|
+
- Use finding bullets with severity, file/path, issue, evidence, and required action.
|
|
48
|
+
- Do not compress code names, paths, commands, exact errors, or line references.
|
|
49
|
+
- Use full clarity for security issues, destructive fixes, or blocking findings.
|
|
50
|
+
|
|
51
|
+
## Definition of Done
|
|
52
|
+
|
|
53
|
+
- Findings are recorded with a clear verdict (pass / pass with follow-ups / blocked).
|
|
54
|
+
- Blocking issues are either resolved, or explicitly deferred with an owner and a stated reason — never silently dropped.
|
|
55
|
+
|
|
56
|
+
## ACTIVE_STATE.md Update
|
|
57
|
+
|
|
58
|
+
- Update the Active Features row's status in `docs/ACTIVE_STATE.md` to reflect the review verdict.
|
|
59
|
+
- Write `.hero-mmt-kit/session.json` with `currentSkill: "hero-reviewing"`, `resumePath` pointing at the review report, `nextAction` set to `"fix findings"` or `"proceed to delivery"`, and `updatedAt` as an ISO timestamp.
|
|
60
|
+
|
|
61
|
+
## Related Skills
|
|
62
|
+
|
|
63
|
+
- Wraps the vendored `requesting-code-review` and `receiving-code-review` skills — this skill is the hero-shaped wrapper around their discipline, not a replacement for it.
|
|
64
|
+
- Reads output from `hero-planning` (the plan) and `hero-coding` (the report and diff).
|
|
65
|
+
- May recommend a separate `hero-security` pass if the review surfaces a sensitive-surface concern (auth, data, secrets, external input, AI/LLM behavior).
|
|
66
|
+
- Complements `hero-unit-test`: the two are a parallel, independent stage — neither is a prerequisite for the other.
|