hero-mmt-kit 1.1.6 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/README.md +19 -13
  3. package/package.json +2 -2
  4. package/skills.manifest.json +8 -9
  5. package/src/integrations.cjs +9 -7
  6. package/src/skills.cjs +17 -6
  7. package/templates/CLAUDE.md.tmpl +30 -42
  8. package/templates/skills/NOTICE +26 -8
  9. package/templates/skills/brainstorming/SKILL.md +9 -9
  10. package/templates/skills/executing-plans/SKILL.md +1 -1
  11. package/templates/skills/hero-coding/SKILL.md +148 -69
  12. package/templates/skills/hero-gitflow/SKILL.md +61 -0
  13. package/templates/skills/hero-mr-review/SKILL.md +3 -3
  14. package/templates/skills/hero-node/SKILL.md +177 -0
  15. package/templates/skills/hero-planning/SKILL.md +281 -59
  16. package/templates/skills/hero-report/SKILL.md +5 -2
  17. package/templates/skills/hero-reviewing/SKILL.md +322 -69
  18. package/templates/skills/hero-strict/SKILL.md +4 -4
  19. package/templates/skills/hero-unit-test/SKILL.md +128 -78
  20. package/templates/skills/subagent-driven-development/SKILL.md +22 -9
  21. package/templates/skills/subagent-driven-development/code-quality-reviewer-prompt.md +34 -34
  22. package/templates/skills/subagent-driven-development/implementer-prompt.md +4 -5
  23. package/templates/skills/subagent-driven-development/scripts/sdd-workspace.sh +9 -10
  24. package/templates/skills/subagent-driven-development/scripts/task-brief.sh +1 -1
  25. package/templates/skills/using-git-worktrees/SKILL.md +7 -5
  26. package/templates/skills/using-hero/SKILL.md +27 -19
  27. package/templates/skills/receiving-code-review/SKILL.md +0 -213
  28. package/templates/skills/requesting-code-review/SKILL.md +0 -108
  29. package/templates/skills/requesting-code-review/code-reviewer.md +0 -168
  30. package/templates/skills/writing-plans/SKILL.md +0 -173
  31. package/templates/skills/writing-plans/plan-document-reviewer-prompt.md +0 -49
@@ -1,78 +1,128 @@
1
- ---
2
- name: hero-unit-test
3
- description: Use to verify implementation correctness — either TDD-first before coding, or as a post-implementation test pass
4
- ---
5
-
6
- # Hero Unit Test
7
-
8
- ## Overview
9
-
10
- hero-unit-test is the dedicated testing stage of the hero-mmt-kit workflow. It supports two distinct modes:
11
-
12
- - **TDD-first** — tests are written before any implementation exists; the implementation is then written to satisfy them.
13
- - **Post-implementation** — tests are written against a completed implementation to pin down and verify its behavior.
14
-
15
- The mode is chosen explicitly and stated up front — never implied or left ambiguous.
16
-
17
- ## When to Use
18
-
19
- Use this skill for any change to behavior that needs automated verification:
20
- - Bugfixes: a failing (red) reproduction test should exist before the fix, per the vendored `test-driven-development` skill's discipline.
21
- - New features: choose TDD-first if the design is well understood up front, or post-implementation if the shape of the solution is still emerging during `hero-coding`.
22
- - Refactors: post-implementation tests (or pre-existing tests) confirm behavior didn't change.
23
-
24
- Skip this skill only for changes with no runtime behavior to verify (docs, comments, pure config).
25
-
26
- ## Inputs
27
-
28
- Read artifact-first:
29
- 1. The planning artifact (`docs/plans/YYYY-MM-DD-slug.md`) — required reading **before** any implementation exists, for TDD-first work.
30
- 2. The coding report (`docs/coding-reports/YYYY-MM-DD-slug.md`) and the changed code — for post-implementation work.
31
- 3. Existing test suite and conventions for the affected area.
32
-
33
- If an input is missing, continue with what is available and note the gap in the test report.
34
-
35
- ## Process
36
-
37
- 1. **Decide the mode** — TDD-first or post-implementation — and state the choice explicitly at the top of the test report.
38
- 2. **Apply the vendored `test-driven-development` skill's discipline:**
39
- - TDD-first: red (write a failing test) → green (minimal implementation to pass) → refactor.
40
- - Post-implementation: write tests that pin down the behavior the implementation already exhibits, including edge cases the implementation should handle.
41
- 3. **Run the test suite.** Capture pass/fail results and note how the changed behavior is covered.
42
- 4. **Verify before claiming.** Use the vendored `verification-before-completion` skill: actually run the test command and read its output — never assume or infer that tests pass.
43
- 5. **Document gaps.** State any known gaps or deliberately-skipped cases and why they're acceptable, in the chat summary. Don't write a report file by default — see Report Convention below.
44
-
45
- ## Report Convention (on request)
46
-
47
- hero-unit-test does not write a report file automatically. If the user asks for a written report, invoke the `hero-report` skill — it writes to `docs/test-reports/YYYY-MM-DD-<slug>.md` using the contract below.
48
-
49
- Report should cover:
50
- - Mode: TDD-first or post-implementation.
51
- - Commands run and their actual output (pass/fail counts).
52
- - Coverage of the changed behavior, in plain terms.
53
- - Known gaps or skipped cases, with reasons.
54
-
55
- Test report style:
56
- - Use concise bullets; avoid test-run storytelling.
57
- - Keep exact commands and observed results verbatim.
58
- - Include only meaningful coverage notes and known gaps.
59
- - Do not compress failure messages, test names, file paths, numbers, or command output summaries.
60
-
61
- ## Definition of Done
62
-
63
- - Tests are green, or failures are explicitly documented with a reason they're acceptable.
64
- - The changed behavior has meaningful test coverage.
65
- - The exact commands run and their results were stated, at minimum in the chat summary — not a claim without evidence.
66
- - If a report was requested, it was written via `hero-report` at the path above.
67
-
68
- ## ACTIVE_STATE.md Update
69
-
70
- - Update the relevant row in `docs/ACTIVE_STATE.md`'s Active Features table with current status. Link the test report only if `hero-report` wrote one.
71
-
72
- ## Related Skills
73
-
74
- - Wraps the vendored `test-driven-development` and `verification-before-completion` skills — this skill does not duplicate their content.
75
- - Reads output from `hero-planning` (for TDD-first) and/or `hero-coding` (for post-implementation).
76
- - Complements `hero-reviewing`, which is a parallel/independent fresh-eyes check rather than a test pass.
77
- - `hero-strict` may require re-running this skill's checks under a stricter bar before a "done" claim.
78
- - Use `hero-report` on request to write the test report.
1
+ ---
2
+ name: hero-unit-test
3
+ description: Use after implementation to write focused unit tests from the approved requirements, run them, and report the actual results
4
+ ---
5
+
6
+ # Hero Unit Test
7
+
8
+ ## Overview
9
+
10
+ hero-unit-test is the post-implementation unit-testing stage. It derives expected behavior from the approved plan or explicit acceptance criteria, writes focused unit tests around the implemented code, runs them, and reports the observed results. It does not implement or repair production code.
11
+
12
+ <HARD-BOUNDARY>
13
+ This stage may change tests and test-only support files only. It must not edit or refactor production code, perform code review, deploy or release, or perform git delivery actions.
14
+ </HARD-BOUNDARY>
15
+
16
+ ## When to Use
17
+
18
+ Use this skill after implementation for behavior that needs executable unit-level coverage:
19
+ - Bug fixes that need a durable regression case.
20
+ - New business rules, edge cases, error paths, or interfaces.
21
+ - Refactors whose approved behavior must remain stable.
22
+
23
+ Skip it only when there is no runtime behavior to exercise, such as prose-only documentation or comments.
24
+
25
+ ## Inputs
26
+
27
+ Normal inputs:
28
+
29
+ ```text
30
+ PLAN_PATH=<approved-plan-path>
31
+ TARGET=local
32
+ SCOPE=<requirements, tasks, modules, or files>
33
+ ```
34
+
35
+ - `PLAN_PATH` supplies requirements, business rules, edge cases, interfaces, and requirement-to-task coverage.
36
+ - A deliberately planless small change must have explicit acceptance criteria. If neither a plan nor clear criteria defines expected behavior, stop; do not infer the test oracle from the current implementation.
37
+ - `TARGET` defaults to the current local implementation. A commit/ref may be named for identity, but the runnable workspace must already contain that target.
38
+ - `SCOPE` narrows the requested unit-test work when only part of the implementation should be covered.
39
+ - Read existing unit-test conventions, helpers, fixtures, and commands for the affected area.
40
+
41
+ For a commit/ref target, resolve and record the intended SHA, then confirm the current workspace represents it. Do not check out, reset, or switch automatically. For a local target, record the initial production-code status before creating tests so test-stage changes can be distinguished from pre-existing implementation changes.
42
+
43
+ ## Expected-Behavior Oracle
44
+
45
+ Derive expected results in this order:
46
+
47
+ 1. Approved plan requirements and business rules.
48
+ 2. Explicit acceptance criteria or external contracts.
49
+ 3. Approved compatibility behavior.
50
+ 4. Existing implementation only for API shape, dependencies, and available test seams — never as the expected result merely because the code currently behaves that way.
51
+
52
+ A failing test is valid when it accurately demonstrates that the implementation violates an approved requirement.
53
+
54
+ ## Allowed Changes
55
+
56
+ This stage may:
57
+ - Create or edit unit-test files.
58
+ - Create or edit test-only fixtures, mocks, factories, snapshots, and helpers.
59
+ - Correct defective test setup or assertions and rerun the affected tests.
60
+ - Run relevant unit-test and coverage commands.
61
+
62
+ This stage must not:
63
+ - Edit or refactor production code to create a test seam or make a failure pass.
64
+ - Implement missing business behavior.
65
+ - Perform code review, deployment, or release work.
66
+ - Commit, push, merge, or open a pull/merge request.
67
+ - Invoke a generic workflow that implements production code as part of testing.
68
+
69
+ If production changes are required, preserve the accurate failing test where appropriate and hand the remediation back to `hero-coding`.
70
+
71
+ ## Process
72
+
73
+ 1. Read the complete plan/criteria and resolve the implementation target and requested scope.
74
+ 2. Build a requirement-to-test matrix covering normal behavior, boundaries, error paths, and named edge cases.
75
+ 3. Identify existing test conventions and the narrowest relevant unit-test command.
76
+ 4. Write focused tests and test-only support code. Do not change production files.
77
+ 5. Run the relevant unit tests and read the actual output.
78
+ 6. Fix only test defects, then rerun the affected command.
79
+ 7. Classify every remaining failure and report the exact result.
80
+ 8. Finish with coverage, gaps, and production-remediation items; do not make the production fix.
81
+
82
+ ## Failure Classification
83
+
84
+ Classify failures as:
85
+
86
+ - **Expected production mismatch:** the test represents an approved requirement and the implementation does not satisfy it. Preserve/report it and hand remediation to `hero-coding`.
87
+ - **Test defect:** setup, fixture, mock, timing, or assertion is wrong. Fix only the test and rerun it.
88
+ - **Environment/tooling failure:** the command cannot execute reliably. Report the command, error, and affected coverage.
89
+ - **Pre-existing unrelated failure:** evidence shows the failure is outside the requested implementation. List it separately; do not fix it here.
90
+
91
+ Green tests are not required for an honest test-stage result. The required outcome is accurate tests, executed commands, observed results, and a clear handoff for production mismatches.
92
+
93
+ ## Report Convention (on request)
94
+
95
+ hero-unit-test ends with a concise chat report and does not write a file automatically. If the user asks for a durable report, invoke `hero-report`; it writes `docs/test-reports/YYYY-MM-DD-<slug>.md` from the results already collected.
96
+
97
+ Report should cover:
98
+ - Plan/criteria, resolved implementation target, and requested scope.
99
+ - Requirement-to-test mapping.
100
+ - Test files and test-only support files changed.
101
+ - Exact commands run and actual pass/fail/skip counts and failure output.
102
+ - Behavioral coverage by requirement and edge case.
103
+ - Numeric coverage only when a coverage command was actually run.
104
+ - Known gaps, untestable requirements, and failure classifications.
105
+ - Production remediation items handed to `hero-coding`.
106
+ - Confirmation that no production code was changed.
107
+
108
+ Test report style:
109
+ - Use concise, evidence-first bullets; avoid test-run storytelling.
110
+ - Preserve exact commands, test names, file paths, API names, errors, counts, and output summaries.
111
+ - Separate production mismatches from test defects and environment failures.
112
+ - Never claim coverage or success that the executed output did not establish.
113
+
114
+ ## Definition of Done
115
+
116
+ - Planned unit tests for the requested scope were written or a concrete blocker explains why they could not be.
117
+ - Relevant commands were executed and their actual output was reported.
118
+ - Requirements and edge cases map to tests or explicit gaps.
119
+ - Every failure is classified and production remediation is handed to `hero-coding` without changing production code.
120
+ - Only test and test-only support files were modified by this stage.
121
+ - If a report was requested, it was written separately via `hero-report`.
122
+
123
+ ## Related Skills
124
+
125
+ - Reads expected behavior from `hero-planning` and the implementation from `hero-coding`.
126
+ - Complements the independent, read-only findings pass in `hero-reviewing`.
127
+ - `hero-strict` may later run broader suites and non-unit verification in its own session.
128
+ - Uses `hero-report` only when the user asks for a durable test report.
@@ -58,6 +58,17 @@ Pick the budget from actual risk and uncertainty, not by default. For each tier,
58
58
 
59
59
  **Final review is conditional.** Run a final integration review only when there were multiple independent task streams, high-risk/core changes, or prior reviews were narrow. If one combined review already covered the entire change, do not review the same scope again.
60
60
 
61
+ ## Hero Stage Boundary
62
+
63
+ An active Hero stage contract overrides this generic same-session lifecycle.
64
+
65
+ - Inside `hero-coding`, use this skill only for bounded implementation delegation. Do not self-review, run verification, dispatch reviewers, or fix review findings in that session, regardless of the review budget table or process diagram below.
66
+ - Finish the implementation-only session, then let the user start `hero-reviewing` separately.
67
+ - `hero-reviewing` performs the read-only review or feedback assessment. Exact confirmed correction IDs return only through a later `hero-coding` session after explicit user approval.
68
+ - Inside any other Hero stage, every delegated agent inherits that stage's allowed actions and exclusions.
69
+
70
+ The review/fix lifecycle below remains available only when no narrower Hero stage is active.
71
+
61
72
  ## Pre-Flight Plan Review
62
73
 
63
74
  Before dispatching Task 1, scan the whole plan once for internal contradictions or
@@ -125,18 +136,20 @@ controller that lost its place has been observed re-dispatching entire completed
125
136
  sequences — the single most expensive failure mode in this skill. Guard against it with
126
137
  a durable ledger, not just the ephemeral todo list:
127
138
 
128
- - At skill start, run `bash scripts/sdd-workspace.sh` to resolve `.hero-mmt-kit/sdd/`,
129
- then check `.hero-mmt-kit/sdd/progress.md` if it exists. Tasks it lists as complete
139
+ - At skill start, run `bash scripts/sdd-workspace.sh` to resolve the scratch workspace.
140
+ It uses `.hero-mmt-kit/sdd/` only when already ignored, otherwise a repo-specific
141
+ cache path outside the repository; never create or edit `.gitignore`. Check
142
+ `progress.md` at the returned path if it exists. Tasks it lists as complete
130
143
  are **not** re-dispatched — verify quickly if anything looks stale, but trust the
131
144
  ledger over a fuzzy recollection of prior context.
132
145
  - When a task's review comes back clean, append one line before moving to the next
133
146
  task:
134
147
  ```
135
- Task N: complete (commits <base7>..<head7>, review clean)
148
+ Task N: complete (base <base7>, head <head7> or uncommitted diff, review clean)
136
149
  ```
137
- - The ledger lives in the self-ignoring `.hero-mmt-kit/sdd/` scratch dir (see Prompt
138
- Templates below) — it never needs the user's own `.gitignore` touched and is not
139
- meant to be committed.
150
+ - The ledger lives in the scratch path returned by `sdd-workspace.sh` (see Prompt
151
+ Templates below) — never change `.gitignore` to make room for it and do not
152
+ commit scratch files.
140
153
 
141
154
  ## Model Selection
142
155
 
@@ -193,7 +206,7 @@ treat ⚠️ as an automatic pass, and don't gate only on ❌ while leaving ⚠
193
206
  `bash scripts/task-brief.sh <plan-file> <N>` first — don't paste the full task text
194
207
  or make the implementer read the whole plan.
195
208
  - `./spec-reviewer-prompt.md` - Use only for `full-multi-stage-review` or explicit acceptance/spec risk.
196
- - `./code-quality-reviewer-prompt.md` - Use for combined quality review, targeted quality review, or full review budgets.
209
+ - `./code-quality-reviewer-prompt.md` - Thin adapter to the canonical `hero-reviewing` contract for combined quality review, targeted quality review, or full review budgets.
197
210
  - `./scripts/sdd-workspace.sh` - Resolves/creates `.hero-mmt-kit/sdd/`, the
198
211
  self-ignoring scratch dir for task briefs, review packages, and the progress ledger.
199
212
  - `./scripts/task-brief.sh PLAN_FILE N [OUTFILE]` - Extracts Task N's exact text into a
@@ -257,8 +270,8 @@ Task: Add auth-sensitive fullstack feature with API contract changes.
257
270
  ## Integration
258
271
 
259
272
  Useful companion skills:
260
- - **superpowers:writing-plans** - Creates the plan this skill may execute.
261
- - **superpowers:requesting-code-review** - Provides a reviewer prompt when review budget calls for it.
273
+ - **hero-planning** - Creates the implementation-only plan this skill may execute.
274
+ - **hero-reviewing** - Canonical read-only review and feedback-assessment contract; `code-quality-reviewer-prompt.md` is only an adapter.
262
275
  - **superpowers:verification-before-completion** - Ensures final claims match evidence.
263
276
  - **superpowers:using-git-worktrees** - Use when parallel agents may conflict or the user requests isolation.
264
277
 
@@ -1,34 +1,34 @@
1
- # Code Quality Reviewer Prompt Template
2
-
3
- Use this template when dispatching a code quality reviewer subagent.
4
-
5
- **Purpose:** Verify implementation is well-built (clean, tested, maintainable)
6
-
7
- **Only dispatch after spec compliance review passes.**
8
-
9
- ```
10
- Task tool (general-purpose):
11
- Use template at requesting-code-review/code-reviewer.md
12
- model: [MODEL - explicit, do not omit. See SKILL.md Model Selection.]
13
-
14
- DESCRIPTION: [task summary, from implementer's report]
15
- PLAN_OR_REQUIREMENTS: Task N from [plan-file]
16
- BASE_SHA: [commit before task]
17
- HEAD_SHA: [current commit]
18
- DIFF_FILE: [PATH from `bash scripts/review-package.sh BASE_SHA HEAD_SHA` - read
19
- this instead of re-deriving the diff]
20
- ```
21
-
22
- **Do Not Trust the Report:** The implementer's self-report and any rationale they give
23
- for a decision are unverified claims, not facts. Verify against `DIFF_FILE` and the
24
- actual code — don't accept "I did it this way because..." at face value.
25
-
26
- **In addition to standard code quality concerns, the reviewer should check:**
27
- - Does each file have one clear responsibility with a well-defined interface?
28
- - Are units decomposed so they can be understood and tested independently?
29
- - Is the implementation following the file structure from the plan?
30
- - Did this implementation create new files that are already large, or significantly grow existing files? (Don't flag pre-existing file sizes — focus on what this change contributed.)
31
-
32
- **Code reviewer returns:** Strengths, Issues (Critical/Important/Minor), ⚠️ Cannot
33
- verify from diff (requirement + why — the controller resolves these, not the
34
- reviewer), Assessment
1
+ # Code Quality Reviewer Prompt Template
2
+
3
+ Use this thin adapter when a review budget calls for one implementation-quality reviewer. The canonical review contract and finding schema live in `hero-reviewing`; do not duplicate or broaden them here.
4
+
5
+ **Only dispatch after the implementation target is stable enough to identify an explicit base and head.**
6
+
7
+ ```text
8
+ Task tool (general-purpose):
9
+ model: [MODEL - explicit, do not omit. See SKILL.md Model Selection.]
10
+ prompt: |
11
+ Invoke `hero-reviewing` with:
12
+
13
+ MODE=review
14
+ REVIEWER=direct
15
+ PLAN_PATH=[plan file, or use the exact task/acceptance criteria below]
16
+ TARGET=ref:[HEAD_SHA]
17
+ BASE_REF=[BASE_SHA]
18
+
19
+ Exact task / acceptance criteria:
20
+ [TASK N FROM PLAN OR BOUNDED REQUIREMENTS]
21
+
22
+ Supplemental review package:
23
+ [DIFF_FILE from `bash scripts/review-package.sh BASE_SHA HEAD_SHA`]
24
+
25
+ Follow `hero-reviewing`'s read-only, findings-only boundary. Do not edit files,
26
+ run build/lint/typecheck/tests/coverage, change git state, apply fixes, or
27
+ dispatch another reviewer. Read the actual target code and relevant unchanged
28
+ callers/contracts; the review package and implementer's report are context,
29
+ not substitutes for the repository.
30
+ ```
31
+
32
+ **Do Not Trust the Report:** The implementer's self-report and rationale are unverified claims. Verify every returned finding against the diff, resulting code, requirements, and relevant surrounding contracts.
33
+
34
+ **Reviewer returns:** reviewed target, evidence-backed findings, coverage gaps, verdict, and correction candidates awaiting user approval, using the `hero-reviewing` schema.
@@ -38,9 +38,8 @@ Task tool (general-purpose):
38
38
  1. Implement exactly what the task specifies
39
39
  2. Write tests (following TDD if task says to)
40
40
  3. Verify implementation works
41
- 4. Commit your work
42
- 5. Self-review (see below)
43
- 6. Report back
41
+ 4. Self-review (see below)
42
+ 5. Report back (do not commit unless the user specifically requested it; follow `hero-gitflow` if they did)
44
43
 
45
44
  Work from: [directory]
46
45
 
@@ -110,8 +109,8 @@ Task tool (general-purpose):
110
109
  - What you implemented (or what you attempted, if blocked)
111
110
  - What you tested and test results
112
111
  - Files changed
113
- - Base commit before you started and HEAD commit after your final commit (the
114
- controller needs both for the review package and the progress ledger)
112
+ - Base and HEAD refs for the review package and progress ledger; if no commit was
113
+ requested, say so and include the working-tree diff instead
115
114
  - Self-review findings (if any)
116
115
  - Any issues or concerns
117
116
 
@@ -2,11 +2,9 @@
2
2
  # Resolve (and create) this repo's subagent-driven-development scratch workspace.
3
3
  # Usage: sdd-workspace.sh
4
4
  #
5
- # Prints the absolute path to <repo-root>/.hero-mmt-kit/sdd/ on stdout.
6
- # Creates the directory and a self-ignoring .gitignore inside it if missing,
7
- # so task briefs, review packages, and the progress ledger never need the
8
- # user's own .gitignore touched. Only this subtree is ignored — the rest of
9
- # .hero-mmt-kit/ (config.json, session.json) stays tracked as before.
5
+ # Prints the scratch workspace path on stdout. Uses the repo-local directory
6
+ # only when it is already ignored; otherwise uses a repo-specific cache path
7
+ # outside the repository. Never creates or changes any .gitignore.
10
8
 
11
9
  set -euo pipefail
12
10
 
@@ -15,11 +13,12 @@ REPO_ROOT="$(git rev-parse --show-toplevel 2>/dev/null)" || {
15
13
  exit 1
16
14
  }
17
15
 
18
- SDD_DIR="${REPO_ROOT}/.hero-mmt-kit/sdd"
19
- mkdir -p "$SDD_DIR"
20
-
21
- if [[ ! -f "${SDD_DIR}/.gitignore" ]]; then
22
- printf '*\n' > "${SDD_DIR}/.gitignore"
16
+ if git -C "$REPO_ROOT" check-ignore -q -- .hero-mmt-kit/sdd/progress.md; then
17
+ SDD_DIR="${REPO_ROOT}/.hero-mmt-kit/sdd"
18
+ else
19
+ REPO_KEY="$(printf '%s' "$REPO_ROOT" | git hash-object --stdin)"
20
+ SDD_DIR="${XDG_CACHE_HOME:-$HOME/.cache}/hero-mmt-kit/sdd/$REPO_KEY"
23
21
  fi
22
+ mkdir -p "$SDD_DIR"
24
23
 
25
24
  echo "$SDD_DIR"
@@ -3,7 +3,7 @@
3
3
  # Usage: task-brief.sh PLAN_FILE N [OUTFILE]
4
4
  #
5
5
  # Finds the heading matching "Task N" at whatever heading level it uses
6
- # (writing-plans emits "### Task N: [Component Name]") and copies everything
6
+ # (hero-planning emits "### Task N: [Component Name]") and copies everything
7
7
  # up to (not including) the next heading at the same or shallower level,
8
8
  # respecting fenced code blocks (``` or ~~~) so a heading-looking line
9
9
  # inside a fenced step (e.g. a comment in example code) doesn't end the
@@ -52,7 +52,7 @@ Honor any existing declared preference without asking. If the user declines cons
52
52
 
53
53
  The user has asked for an isolated workspace (Step 0 consent). Do you already have a way to create a worktree? It might be a tool with a name like `EnterWorktree`, `WorktreeCreate`, a `/worktree` command, or a `--worktree` flag. If you do, use it and skip to Step 3.
54
54
 
55
- Native tools handle directory placement, branch creation, and cleanup automatically. Using `git worktree add` when you have a native tool creates phantom state your harness can't see or manage.
55
+ Native tools handle directory placement, branch creation, and cleanup automatically. Before creating a branch, apply `hero-gitflow`'s explicit-request, branch-name, and base-branch rules, including with native tools. Using `git worktree add` when you have a native tool creates phantom state your harness can't see or manage.
56
56
 
57
57
  Only proceed to Step 1b if you have no native worktree tool available.
58
58
 
@@ -83,9 +83,9 @@ Follow this priority order. Explicit user preference always beats observed files
83
83
  git check-ignore -q .worktrees 2>/dev/null || git check-ignore -q worktrees 2>/dev/null
84
84
  ```
85
85
 
86
- **If NOT ignored:** Add to .gitignore, commit the change, then proceed.
86
+ **If NOT ignored:** Do not edit, stage, restore, or commit `.gitignore`. Choose an existing ignored location or ask the user for an external directory outside the repository; if neither is available, stop worktree setup. Preserve any existing local `.gitignore` changes exactly as they are.
87
87
 
88
- **Why critical:** Prevents accidentally committing worktree contents to repository.
88
+ **Why critical:** Prevents accidentally committing worktree contents without altering the user's ignore rules.
89
89
 
90
90
  #### Create the Worktree
91
91
 
@@ -95,7 +95,9 @@ project=$(basename "$(git rev-parse --show-toplevel)")
95
95
  # Determine path based on chosen location
96
96
  # path="$LOCATION/$BRANCH_NAME"
97
97
 
98
- git worktree add "$path" -b "$BRANCH_NAME"
98
+ # BASE_REF must be confirmed under hero-gitflow's branch rules
99
+ # Create a branch only if the user specifically requested branch creation
100
+ git worktree add "$path" -b "$BRANCH_NAME" "$BASE_REF"
99
101
  cd "$path"
100
102
  ```
101
103
 
@@ -153,7 +155,7 @@ Ready to implement <feature-name>
153
155
  | `worktrees/` exists | Use it (verify ignored) |
154
156
  | Both exist | Use `.worktrees/` |
155
157
  | Neither exists | Check instruction file, then default `.worktrees/` |
156
- | Directory not ignored | Add to .gitignore + commit |
158
+ | Directory not ignored | Use an existing ignored location or ask for an external path; never edit `.gitignore` |
157
159
  | Permission error on create | Sandbox fallback, work in place |
158
160
  | Tests fail during baseline | Report failures + ask |
159
161
  | No package.json/Cargo.toml | Skip dependency install |
@@ -13,20 +13,27 @@ hero-mmt-kit is a human-led workflow: the developer decides what to work on and
13
13
 
14
14
  | Skill | Use when | Artifact / report |
15
15
  |---|---|---|
16
- | `hero-planning` | Starting new work — a feature, bugfix, or refactor that needs a plan before code changes. | `docs/plans/YYYY-MM-DD-slug.md` — always written (it's the deliverable, not a report) |
17
- | `hero-coding` | Implementing an approved plan (or a small change that doesn't need one). | `docs/coding-reports/YYYY-MM-DD-slug.md` |
18
- | `hero-reviewing` | Fresh-eyes check of an implementation against its plan, before merge. | `docs/reviews/YYYY-MM-DD-slug.md` |
19
- | `hero-unit-test` | Verifying implementation correctness — TDD-first or post-implementation. | `docs/test-reports/YYYY-MM-DD-slug.md` |
16
+ | `hero-planning` | Clarifying non-trivial work through analysis and brainstorming, then writing an implementation-only plan. | `docs/plans/YYYY-MM-DD-slug.md` — always written (it's the deliverable, not a report) |
17
+ | `hero-coding` | Implementing every task and requirement in an approved plan, or a small bounded request. No testing or self-review. | `docs/coding-reports/YYYY-MM-DD-slug.md` — on request |
18
+ | `hero-node` | Node.js JavaScript/TypeScript implementation with explicit coding conventions; inherits the same `hero-coding` stage and boundaries. | Same coding report — on request, through `hero-report` with source stage `hero-coding` |
19
+ | `hero-reviewing` | Single read-only entry point for a fresh implementation review, assessment of supplied review feedback, or an explicit combination of both. | `docs/reviews/YYYY-MM-DD-slug.md` — on request |
20
+ | `hero-unit-test` | Writing and running post-implementation unit tests from the approved requirements; no production-code fixes. | `docs/test-reports/YYYY-MM-DD-slug.md` — on request |
20
21
  | `hero-security` | You want an independent OWASP + AI/LLM security review of a sensitive surface. | `docs/security-reports/YYYY-MM-DD-slug.md` — always written for the security pass. |
21
- | `hero-mr-review` | Reviewing a teammate's merge request or commit before it merges — given a commit/tag/branch. | `docs/mr-reviews/YYYY-MM-DD-slug.md` — always written. |
22
- | `hero-strict` | Extra rigor is wanted before a "done" claim — a full verification pass. | Appends to the current report, if one exists/was requested. |
22
+ | `hero-mr-review` | Reviewing a teammate's committed merge request/ref against MR intent and repository conventions. | `docs/mr-reviews/YYYY-MM-DD-slug.md` — always written. |
23
+ | `hero-gitflow` | Performing a Git action explicitly requested by the user, with protected-branch and `.gitignore` safeguards. | Chat result; no automatic next Git action. |
24
+ | `hero-strict` | Extra rigor is wanted in a separate full verification session before a "done" claim. | Appends to the current report, if one exists/was requested. |
23
25
  | `hero-report` | A written report is actually wanted for a finished `hero-coding`/`hero-reviewing`/`hero-unit-test` phase. | Writes the report at the path the source skill defines. |
24
26
 
25
- A typical flow is `hero-planning` → `hero-coding` → `hero-unit-test` and/or `hero-reviewing` → done. Invoke `hero-security` separately when you want a dedicated security pass. Skip stages that don't fit the size of the change — a one-line typo fix doesn't need a plan artifact.
27
+ A typical flow is `hero-planning` → `hero-coding` → `hero-unit-test` and/or `hero-reviewing` → done. Start each stage explicitly, preferably in a fresh session. The plan contains implementation work only; coding implements it only; unit testing writes/runs tests only; reviewing conducts a fresh review and/or assesses supplied feedback without fixing code or running tests. Confirmed review items require explicit user approval before a later `hero-coding` correction session. Invoke `hero-security` or `hero-strict` separately when their assurance depth is wanted. Invoke `hero-gitflow` only for a specifically requested Git action; neither completing a stage nor using the skill authorizes the next Git action. Skip stages that do not fit the size of the change.
26
28
 
27
- `hero-mr-review` is not part of this flow at all — it reviews a *teammate's* merge request, not the invoking developer's own work-in-progress. It has no plan or coding report to read; it reads the diff itself. Invoke it directly whenever a colleague's MR needs review, independent of whatever phase your own work is in.
29
+ For Node.js services, CLIs, workers, or libraries written in JavaScript/TypeScript, choose `hero-node` instead of generic `hero-coding` when its explicit coding conventions apply. It reads and inherits the parent contract; the user does not need to invoke both. This is the same coding stage, not an automatic extra stage, and its on-request report uses source stage `hero-coding`.
28
30
 
29
- `hero-planning`, `hero-coding`, `hero-reviewing`, and `hero-unit-test` are done per-phase, not gated into an automatic full pipeline — finishing one doesn't trigger the next; the developer decides what to invoke next.
31
+ Choose review by source of truth, not merely by whether a git ref exists:
32
+ - Use `hero-reviewing` when an implementation should be assessed against a Hero plan or explicit acceptance criteria, or when supplied review feedback needs technical validation. It can inspect local, exact-commit, or explicit-base ref targets and may use one internal fresh reviewer without requiring another user-facing skill.
33
+ - Use `hero-mr-review` for a teammate's committed MR/ref assessed against MR intent, repository conventions, impact, and potential bugs. It always writes its standalone report.
34
+ - Use `hero-gitflow` for an explicitly requested branch creation or Git delivery action. It never acts as an automatic handoff from coding, testing, or review.
35
+
36
+ `hero-planning`, `hero-coding`, `hero-reviewing`, and `hero-unit-test` are independent stages, not an automatic pipeline. Finishing one never triggers the next. Generic vendored skills and delegated agents must inherit the active Hero stage's exclusions; they must not broaden its responsibility.
30
37
 
31
38
  ## Report writing
32
39
 
@@ -34,7 +41,7 @@ A typical flow is `hero-planning` → `hero-coding` → `hero-unit-test` and/or
34
41
 
35
42
  ## Session state
36
43
 
37
- `docs/ACTIVE_STATE.md`'s Active Features table is the single source of durable workflow state — there is no separate session pointer file. It's injected into context automatically at the start of a session. Each hero-* skill's Definition of Done includes updating it.
44
+ `docs/ACTIVE_STATE.md`'s Active Features table is the single source of durable workflow state — there is no separate session pointer file. It's injected into context automatically at the start of a session. Update it only when a skill's contract calls for durable workflow metadata; read-only reviewing and test-only work must not create unrelated implementation changes merely to record progress.
38
45
 
39
46
  Resuming work in a fresh session:
40
47
  1. Check the injected Active Features context (or read `docs/ACTIVE_STATE.md` directly if it wasn't injected).
@@ -42,22 +49,23 @@ Resuming work in a fresh session:
42
49
 
43
50
  ## Related vendored skills
44
51
 
45
- The hero-* skills wrap general-purpose technique skills rather than duplicate them: `brainstorming`, `writing-plans`, `executing-plans`, `test-driven-development`, `systematic-debugging`, `verification-before-completion`, `requesting-code-review`, `receiving-code-review`, `dispatching-parallel-agents`, `subagent-driven-development`, `using-git-worktrees`. `hero-security` is the standalone security review skill rather than a wrapper. Each hero-* skill names the vendored skill(s) it invokes.
52
+ The kit also ships general-purpose technique skills: `brainstorming`, `executing-plans`, `test-driven-development`, `systematic-debugging`, `verification-before-completion`, `dispatching-parallel-agents`, `subagent-driven-development`, and `using-git-worktrees`. They remain available for direct use, but a Hero stage must not invoke a generic lifecycle whose mandatory actions cross that stage's hard boundary. Generic instructions to commit or edit `.gitignore` do not override `hero-gitflow` or the project Git rules. `hero-planning`, `hero-coding`, `hero-reviewing`, `hero-unit-test`, and `hero-security` define their own stage contracts.
46
53
 
47
54
  ## Output Style
48
55
 
49
- Hero workflow artifacts should be concise by default: compress prose scaffolding, keep every technical fact.
56
+ Hero workflow outputs inherit the project-wide `Response Style` in `CLAUDE.md`. Apply it to chat summaries, progress updates, plans, and reports.
50
57
 
51
- Use this rule for chat summaries and generated artifacts:
52
- - Drop filler, pleasantries, and self-reference.
53
- - Prefer tight bullets over long explanation.
54
- - Keep code, commands, API names, error strings, file paths, and numbers verbatim.
55
- - Preserve the user's language.
56
- - Do not compress safety-critical content: security warnings, irreversible/destructive actions, production changes, or ambiguous multi-step instructions need full clarity.
58
+ Workflow-specific emphasis:
59
+ - Lead with the result or current status, then the evidence, then the next action or decision.
60
+ - Use plain wording in the user's language for prose and avoid unnecessary English code-switching.
61
+ - Keep code identifiers, commands, file paths, API names, configuration keys, exact errors, numbers, and necessary established technical terms verbatim. Do not translate technical tokens or invent awkward equivalents.
62
+ - Briefly explain a necessary specialized term in the user's language on first use.
63
+ - Make plans and reports actionable for their audience: use concrete labels and actions, identify targets or conditions where relevant, and explain unfamiliar acronyms.
64
+ - Be concise when the work is simple, but expand risks, blockers, uncertainty, destructive actions, production changes, and ambiguous multi-step instructions until the user can act safely.
57
65
 
58
66
  ## Rules
59
67
 
60
68
  - Don't run heavy ceremony for small tasks — a Tiny fix (typo, trivial config) can go straight to `hero-coding` with no plan artifact.
61
69
  - Don't claim work is done without the relevant skill's Definition of Done being met.
62
70
  - Keep `docs/ACTIVE_STATE.md` as the durable index — link to artifacts, don't duplicate their content there.
63
- - Write artifact updates in concise-output style: short prose, full evidence, no lost technical detail.
71
+ - Write artifact updates using the Output Style above: concise where safe, complete where clarity requires it, with all evidence and technical facts preserved.