hero-mmt-kit 1.1.2 → 1.1.3
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
CHANGED
|
@@ -4,6 +4,14 @@ Notable changes to `hero-mmt-kit` are documented here from `1.0.0` onward.
|
|
|
4
4
|
|
|
5
5
|
Format follows [Keep a Changelog](https://keepachangelog.com/); versioning follows [SemVer](https://semver.org/).
|
|
6
6
|
|
|
7
|
+
## [1.1.3] - 2026-07-16
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- `instrumented-debugging.md`, a hero-mmt-kit-original supporting technique added to the vendored `systematic-debugging` skill (alongside `root-cause-tracing.md`, `defense-in-depth.md`, and `condition-based-waiting.md`): for a logic/data bug reproducible from known input, trigger it via a temporary unit test built directly from that input, place tagged `console.log`/`print` checkpoints at breakpoint-equivalent locations, and read the collected trace instead of attaching a debugger. Mandatory cleanup removes the temporary test and all checkpoint lines before the session ends.
|
|
12
|
+
- `systematic-debugging/SKILL.md` Phase 1 and its Supporting Techniques list now point to `instrumented-debugging.md`; `hero-coding/SKILL.md` step 4 surfaces it as an option when a mid-implementation bug is reproducible from a known API payload.
|
|
13
|
+
- `templates/skills/NOTICE` documents this as a hero-mmt-kit design choice layered on top of the vendored skill, following the same precedent set for `subagent-driven-development`'s backported additions.
|
|
14
|
+
|
|
7
15
|
## [1.1.2] - 2026-07-14
|
|
8
16
|
|
|
9
17
|
### Changed
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hero-mmt-kit",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.3",
|
|
4
4
|
"description": "A focused Claude Code framework for human-led development — six direct-use skills (planning, coding, reviewing, unit testing, security, strict mode) plus an on-demand report writer, with simple state tracking. Works for new and existing (brownfield) projects.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"claude-code",
|
package/templates/skills/NOTICE
CHANGED
|
@@ -30,6 +30,15 @@ on top of hero-mmt-kit's own Review Budget tiering system, which upstream does n
|
|
|
30
30
|
have. The backported additions remain obra/superpowers-origin content under MIT;
|
|
31
31
|
Review Budget tiering is a hero-mmt-kit original design choice.
|
|
32
32
|
|
|
33
|
+
Note on systematic-debugging: this skill received a hero-mmt-kit-original
|
|
34
|
+
supporting technique, `instrumented-debugging.md` (structured console/log
|
|
35
|
+
checkpoint placement for a reproducible API/logic bug, used in place of
|
|
36
|
+
attaching a debugger), added alongside the vendored `root-cause-tracing.md`,
|
|
37
|
+
`defense-in-depth.md`, and `condition-based-waiting.md` technique files. This
|
|
38
|
+
addition is a hero-mmt-kit design choice; the vendored Phase 1-4 process and
|
|
39
|
+
the other supporting files remain unchanged obra/superpowers-origin content
|
|
40
|
+
under MIT.
|
|
41
|
+
|
|
33
42
|
Framework-authored skills shipped by hero-mmt-kit:
|
|
34
43
|
using-hero, hero-planning, hero-coding, hero-reviewing,
|
|
35
44
|
hero-unit-test, hero-security, hero-strict, hero-report
|
|
@@ -29,7 +29,7 @@ If there's no plan artifact, proceed on the strength of the request itself and n
|
|
|
29
29
|
1. Read the plan artifact fully before starting (if one exists). Don't begin editing from a partial read.
|
|
30
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
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.
|
|
32
|
+
4. If unexpected bugs surface mid-implementation, switch to the vendored `systematic-debugging` skill instead of guessing at fixes. For a bug reproducible from known input (a specific API payload), its `instrumented-debugging` technique triggers via a temporary unit test built from that input, with checkpoint logs in place of manual breakpoints.
|
|
33
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
34
|
6. Give a concise chat summary: what changed, the evidence collected, and any remaining risks or deviations from the plan. Don't write a report file by default — see Report Convention below.
|
|
35
35
|
|
|
@@ -107,6 +107,8 @@ You MUST complete each phase before proceeding to the next.
|
|
|
107
107
|
|
|
108
108
|
**This reveals:** Which layer fails (secrets → workflow ✓, workflow → build ✗)
|
|
109
109
|
|
|
110
|
+
**For a single reproducible API/logic bug from known input** (payload known, no debugger attached, no need to run the app): see `instrumented-debugging.md` in this directory — trigger via a temporary unit test built from that input, with checkpoint logs replacing manual breakpoints.
|
|
111
|
+
|
|
110
112
|
5. **Trace Data Flow**
|
|
111
113
|
|
|
112
114
|
**WHEN error is deep in call stack:**
|
|
@@ -282,6 +284,7 @@ These techniques are part of systematic debugging and available in this director
|
|
|
282
284
|
- **`root-cause-tracing.md`** - Trace bugs backward through call stack to find original trigger
|
|
283
285
|
- **`defense-in-depth.md`** - Add validation at multiple layers after finding root cause
|
|
284
286
|
- **`condition-based-waiting.md`** - Replace arbitrary timeouts with condition polling
|
|
287
|
+
- **`instrumented-debugging.md`** - Place structured log checkpoints at breakpoint-equivalent locations, triggered by a temporary unit test built from known input, instead of attaching a debugger
|
|
285
288
|
|
|
286
289
|
**Related skills:**
|
|
287
290
|
- **superpowers:test-driven-development** - For creating failing test case (Phase 4, Step 1)
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
# Instrumented Debugging (Checkpoints Instead of Breakpoints)
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
Sometimes you have a concrete, known input — a specific API payload, method, and route — but you don't want to attach a debugger or run the app in debug mode. You still need to see what the code actually did with that data at each point along the way.
|
|
6
|
+
|
|
7
|
+
**Core principle:** Place structured log checkpoints at the same locations you'd otherwise set breakpoints, trigger the code with a **temporary unit test** whose input is built directly from the data provided, then read the collected trace instead of stepping through it live.
|
|
8
|
+
|
|
9
|
+
This is a hero-mmt-kit-original addition to `systematic-debugging` (see `NOTICE`), used within its Phase 1 (Root Cause Investigation) when the bug is reproducible from known input but not being debugged interactively.
|
|
10
|
+
|
|
11
|
+
**This does not execute a real HTTP request against a running app.** The trigger is a unit test that calls the entry point function directly (or drives it in-process, e.g. via the project's existing supertest-style helper if one exists) — no server needs to be up, no real network call is made.
|
|
12
|
+
|
|
13
|
+
## When to Use
|
|
14
|
+
|
|
15
|
+
- The bug is reproducible from **one known input** (method + route + payload, or equivalent function arguments) — all of it known up front.
|
|
16
|
+
- It looks like a **logic or data bug** — wrong value, wrong branch taken, wrong transformation — not a crash, performance issue, or security defect.
|
|
17
|
+
- You'd rather not attach a debugger or run the app in debug mode.
|
|
18
|
+
|
|
19
|
+
**Don't use this for:**
|
|
20
|
+
- Bugs you can't reproduce from a known input — go gather more evidence first (main `SKILL.md`, Phase 1).
|
|
21
|
+
- Crashes with a clear stack trace — read the trace, don't instrument around it.
|
|
22
|
+
- Anything requiring inspecting memory/perf timing — this technique captures values at points in time, not performance profiles.
|
|
23
|
+
- Bugs that only manifest through the real network/process boundary (e.g. serialization over an actual socket, real middleware ordering across processes) — those need an actual running app, which is out of scope for this technique.
|
|
24
|
+
|
|
25
|
+
## Required Input Contract
|
|
26
|
+
|
|
27
|
+
Before writing the test or inserting any checkpoint, confirm you have all of the following. If anything is missing, ask — don't guess:
|
|
28
|
+
|
|
29
|
+
1. **Method + route/endpoint** (e.g. `POST /api/orders/:id/apply-discount`) — used to locate the entry point, not to make a real call.
|
|
30
|
+
2. **The payload** — body/params/query/headers, as a curl command or as plain data (JSON body, path params, etc.) — this becomes the unit test's input, verbatim.
|
|
31
|
+
3. **Expected vs. actual behavior** — what the return value/response/state should be, and what it actually is.
|
|
32
|
+
|
|
33
|
+
## The Process
|
|
34
|
+
|
|
35
|
+
### 1. Locate the Entry Point
|
|
36
|
+
|
|
37
|
+
Find the function the given route resolves to — route handler/controller, or the service/business-logic function it delegates to if that's a closer match to the reported symptom. Grep for the route string, or use GitNexus `route_map` / `api_impact` if the repo is indexed. Don't guess which file handles it — confirm by reading it.
|
|
38
|
+
|
|
39
|
+
### 2. Map the Likely Call Path
|
|
40
|
+
|
|
41
|
+
Read the code to sketch the path the input takes: handler → service/business logic → repository/DB → external calls → response construction. This is a static read, not a guess — open each file in the chain before instrumenting it.
|
|
42
|
+
|
|
43
|
+
### 3. Find the Project's Existing Test Pattern
|
|
44
|
+
|
|
45
|
+
Look for an existing test file covering this module or a sibling route/handler. Reuse its conventions: test framework (Jest/Vitest/Mocha/pytest/...), how it mocks the DB/external calls, and — if the entry point is an HTTP handler — how it invokes routes in-process (e.g. `supertest(app).post(...)`, a test client, or a direct call with constructed `req`/`res` objects). Don't invent a new test-setup style if the project already has one.
|
|
46
|
+
|
|
47
|
+
### 4. Choose Checkpoint Locations (Minimal First Pass)
|
|
48
|
+
|
|
49
|
+
Pick roughly **3–6** points, each one a location you'd otherwise set a breakpoint:
|
|
50
|
+
- Function/handler entry — log the raw inputs.
|
|
51
|
+
- Before/after any branch that affects the outcome (the `if` that decides which path is taken).
|
|
52
|
+
- Before/after the suspect data is transformed or persisted.
|
|
53
|
+
- Right before the return value/response is constructed.
|
|
54
|
+
|
|
55
|
+
Instrumenting everything at once defeats the purpose — it's as noisy as not instrumenting at all. Start narrow. If the first pass doesn't localize the divergence, add a **denser second pass** only around the checkpoint where things started going wrong.
|
|
56
|
+
|
|
57
|
+
### 5. Insert Tagged Checkpoints
|
|
58
|
+
|
|
59
|
+
Use a unique, greppable tag per debugging session so the output can be filtered from normal test noise, and log actual values — not just "reached this line":
|
|
60
|
+
|
|
61
|
+
```javascript
|
|
62
|
+
// Node/Express example
|
|
63
|
+
console.error(`[DBG:ORD-482] applyDiscount:entry`, { orderId, discountCode, cartTotal });
|
|
64
|
+
...
|
|
65
|
+
console.error(`[DBG:ORD-482] applyDiscount:afterLookup`, { discountCode, discount });
|
|
66
|
+
...
|
|
67
|
+
console.error(`[DBG:ORD-482] applyDiscount:branch`, { eligible, reason });
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
```python
|
|
71
|
+
# Python example
|
|
72
|
+
print(f"[DBG:ORD-482] apply_discount:entry order_id={order_id} code={discount_code} total={cart_total}")
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Use whatever the language/runtime's cheapest, most direct output mechanism is (`console.error`, `print`, `System.out.println`, `log.Printf`, ...) — this is throwaway instrumentation, not permanent logging, so it doesn't need to go through the project's logger.
|
|
76
|
+
|
|
77
|
+
### 6. Write the Temporary Test
|
|
78
|
+
|
|
79
|
+
Create a throwaway test file (clearly named, e.g. `tmp.instrumented-debug.test.ts`) that:
|
|
80
|
+
- Builds the input exactly from the payload provided (parse the curl `-d`/`--data` body into the same shape the code expects; map path/query params; construct a minimal `req`/`res` if calling a raw handler, or use the project's in-process route-testing helper found in step 3).
|
|
81
|
+
- Calls the entry point directly — no server start, no real network call.
|
|
82
|
+
- Asserts nothing yet, or asserts only the expected-vs-actual outcome from the bug report — its job here is to **trigger** the checkpoints, not to be a polished regression test.
|
|
83
|
+
|
|
84
|
+
### 7. Run the Test and Collect the Trace
|
|
85
|
+
|
|
86
|
+
Run just that one test file with the project's test runner (e.g. `npx jest tmp.instrumented-debug.test.ts`, `pytest test_tmp_instrumented.py`). Test runners pass through `console.error`/`print` output by default — capture it and filter by the session tag:
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
npx jest tmp.instrumented-debug.test.ts 2>&1 | grep 'DBG:ORD-482'
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### 8. Analyze Checkpoint-by-Checkpoint
|
|
93
|
+
|
|
94
|
+
Walk the checkpoints in order, comparing the logged value against what you expected at that point. The **first checkpoint where the actual value diverges from the expected one** is where the root cause lives — or where you need to trace further back (switch to `root-cause-tracing.md` in this directory if the divergence itself needs tracing to an even earlier source). Once localized, continue into the main `SKILL.md` process: Phase 2 (Pattern Analysis) → Phase 3 (Hypothesis and Testing) → Phase 4 (Implementation).
|
|
95
|
+
|
|
96
|
+
### 9. Mandatory Cleanup
|
|
97
|
+
|
|
98
|
+
Before ending the debugging session:
|
|
99
|
+
|
|
100
|
+
- Delete the temporary test file created in step 6.
|
|
101
|
+
- Remove **every** checkpoint line inserted in step 5.
|
|
102
|
+
- Run `git status`/`git diff` and confirm no debug-only test file or log lines remain in the working tree.
|
|
103
|
+
- If the temporary test turns out to be worth keeping as a real regression test, or a particular log genuinely belongs permanently, that is a **separate, explicit decision** — call it out to the user rather than silently leaving debug scaffolding behind disguised as real code.
|
|
104
|
+
|
|
105
|
+
## Example
|
|
106
|
+
|
|
107
|
+
**Bug report:** `POST /api/orders/482/apply-discount` with body `{ "discountCode": "SAVE10", "cartTotal": 45 }` should return a discount of `10`, but returns `0`.
|
|
108
|
+
|
|
109
|
+
**Checkpoints inserted** (3, first pass):
|
|
110
|
+
|
|
111
|
+
```javascript
|
|
112
|
+
function applyDiscount(orderId, discountCode, cartTotal) {
|
|
113
|
+
console.error(`[DBG:ORD-482] entry`, { orderId, discountCode, cartTotal });
|
|
114
|
+
|
|
115
|
+
const discount = lookupDiscount(discountCode);
|
|
116
|
+
console.error(`[DBG:ORD-482] afterLookup`, { discount });
|
|
117
|
+
|
|
118
|
+
const eligible = cartTotal >= discount.minimumSpend;
|
|
119
|
+
console.error(`[DBG:ORD-482] branch`, { eligible, minimumSpend: discount.minimumSpend });
|
|
120
|
+
|
|
121
|
+
return eligible ? discount.amount : 0;
|
|
122
|
+
}
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
**Temporary test** (`tmp.instrumented-debug.test.ts`), input built directly from the reported payload:
|
|
126
|
+
|
|
127
|
+
```javascript
|
|
128
|
+
const { applyDiscount } = require('../src/orders/discount');
|
|
129
|
+
|
|
130
|
+
test('tmp: trace apply-discount for order 482', () => {
|
|
131
|
+
applyDiscount(482, 'SAVE10', 45);
|
|
132
|
+
});
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
**Trace collected** (`npx jest tmp.instrumented-debug.test.ts 2>&1 | grep DBG:ORD-482`):
|
|
136
|
+
|
|
137
|
+
```
|
|
138
|
+
[DBG:ORD-482] entry { orderId: 482, discountCode: 'SAVE10', cartTotal: 45 }
|
|
139
|
+
[DBG:ORD-482] afterLookup { discount: { amount: 10, minimumSpend: 50 } }
|
|
140
|
+
[DBG:ORD-482] branch { eligible: false, minimumSpend: 50 }
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
**Analysis:** `discountCode` and `discount` lookup are correct — the divergence is at the branch: `cartTotal` (45) is below `minimumSpend` (50), so `eligible` is correctly `false` per the code, but the user expected `SAVE10` to apply regardless of cart total. Root cause is a **data/spec mismatch**, not a code bug: `SAVE10`'s `minimumSpend` was configured wrong. Fix at the source (the discount config), not by patching the branch.
|
|
144
|
+
|
|
145
|
+
**Cleanup:** `tmp.instrumented-debug.test.ts` deleted, all three `console.error` lines removed, `git status` confirmed clean before closing the session.
|
|
146
|
+
|
|
147
|
+
## Key Principle
|
|
148
|
+
|
|
149
|
+
Checkpoints are a stand-in for breakpoints, and a temporary unit test is the stand-in for manually driving the app — reproducible from known input, minimal, tagged, read once, then both the test and the logs are removed. Finding the divergent checkpoint doesn't end the process; it tells you where Phase 2 (Pattern Analysis) should start looking.
|