hstack 0.7.0 → 0.16.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 +277 -0
- package/README.md +39 -13
- package/VERSION +1 -1
- package/dist/commands/doctor.js +51 -1
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/update.js +8 -2
- package/dist/commands/update.js.map +1 -1
- package/dist/lib/descriptions.js +167 -0
- package/dist/lib/descriptions.js.map +1 -0
- package/dist/lib/diff.js +1 -1
- package/dist/lib/git.js +16 -0
- package/dist/lib/git.js.map +1 -1
- package/dist/lib/wire.js +108 -4
- package/dist/lib/wire.js.map +1 -1
- package/dist/manifest.js +17 -2
- package/dist/manifest.js.map +1 -1
- package/package.json +3 -1
- package/template/.claude/agents/adversarial-reviewer.md +16 -64
- package/template/.claude/agents/app-architect.md +12 -49
- package/template/.claude/agents/data-architect.md +13 -51
- package/template/.claude/agents/data-specialist.md +5 -50
- package/template/.claude/agents/implementer.md +8 -65
- package/template/.claude/agents/kernel-fit-analyst.md +7 -68
- package/template/.claude/agents/planner.md +7 -42
- package/template/.claude/agents/product-discovery.md +12 -48
- package/template/.claude/agents/product-manager.md +8 -43
- package/template/.claude/agents/researcher.md +5 -41
- package/template/.claude/agents/security-reviewer.md +19 -54
- package/template/.claude/agents/spec-author.md +18 -52
- package/template/.claude/agents/stack-architect.md +14 -43
- package/template/.claude/agents/test-strategist.md +16 -57
- package/template/.claude/agents/ui-ux-briefer.md +6 -36
- package/template/.claude/agents/verifier.md +13 -45
- package/template/.claude/skills/hstack-adr-new/SKILL.md +6 -33
- package/template/.claude/skills/hstack-adversarial-review/SKILL.md +31 -52
- package/template/.claude/skills/hstack-adversarial-review/references/finding-categories.md +157 -0
- package/template/.claude/skills/hstack-app-architecture/SKILL.md +2 -29
- package/template/.claude/skills/hstack-branch/SKILL.md +4 -31
- package/template/.claude/skills/hstack-brownfield-init/SKILL.md +10 -37
- package/template/.claude/skills/hstack-change-new/SKILL.md +4 -31
- package/template/.claude/skills/hstack-change-plan/SKILL.md +21 -32
- package/template/.claude/skills/hstack-commit/SKILL.md +7 -35
- package/template/.claude/skills/hstack-configure/SKILL.md +7 -34
- package/template/.claude/skills/hstack-coord/SKILL.md +3 -39
- package/template/.claude/skills/hstack-data-architecture/SKILL.md +4 -30
- package/template/.claude/skills/hstack-data-review/SKILL.md +3 -42
- package/template/.claude/skills/hstack-finalize/SKILL.md +30 -49
- package/template/.claude/skills/hstack-flag/SKILL.md +9 -48
- package/template/.claude/skills/hstack-greenfield-init/SKILL.md +9 -36
- package/template/.claude/skills/hstack-help/SKILL.md +11 -37
- package/template/.claude/skills/hstack-implement/SKILL.md +28 -58
- package/template/.claude/skills/hstack-kernel-fit-promote/SKILL.md +7 -46
- package/template/.claude/skills/hstack-kernel-fit-scan/SKILL.md +5 -60
- package/template/.claude/skills/hstack-kernel-fit-scan/references/slack-setup.md +42 -0
- package/template/.claude/skills/hstack-kernel-fit-triage/SKILL.md +12 -50
- package/template/.claude/skills/hstack-module-spec/SKILL.md +5 -32
- package/template/.claude/skills/hstack-product-discovery/SKILL.md +5 -31
- package/template/.claude/skills/hstack-research/SKILL.md +3 -33
- package/template/.claude/skills/hstack-scaffold/SKILL.md +2 -29
- package/template/.claude/skills/hstack-security-review/SKILL.md +5 -43
- package/template/.claude/skills/hstack-ship/SKILL.md +43 -53
- package/template/.claude/skills/hstack-stack-decide/SKILL.md +3 -30
- package/template/.claude/skills/hstack-story-draft/SKILL.md +6 -33
- package/template/.claude/skills/hstack-tech-debt-new/SKILL.md +4 -31
- package/template/.claude/skills/hstack-tech-debt-resolve/SKILL.md +9 -44
- package/template/.claude/skills/hstack-tech-debt-stale/SKILL.md +10 -37
- package/template/.claude/skills/hstack-tech-debt-wontfix/SKILL.md +8 -35
- package/template/.claude/skills/hstack-telemetry/SKILL.md +5 -30
- package/template/.claude/skills/hstack-test-plan/SKILL.md +23 -46
- package/template/.claude/skills/hstack-ui-brief/SKILL.md +3 -30
- package/template/.claude/skills/hstack-verify/SKILL.md +26 -48
- package/template/KERNEL.md +410 -0
- package/template/scripts/compute-merge-readiness.mjs +780 -0
- package/template/scripts/coord/coord_scan.py +121 -22
- package/template/scripts/run-gates.sh +388 -0
- package/template/scripts/telemetry/insights/kernel_fit.py +1 -1
- package/template/scripts/telemetry/insights/token_economics.py +181 -8
- package/template/scripts/telemetry/parsers/sidecars.py +61 -0
- package/template/scripts/telemetry/parsers/transcripts.py +135 -22
- package/template/scripts/telemetry/render.py +68 -3
- package/template/scripts/telemetry/report.py +16 -4
- package/template/scripts/telemetry/run_kernel_fit.py +6 -2
- package/template/scripts/telemetry/session_id.py +139 -0
- package/template/scripts/validate-spec.mjs +3303 -0
- package/template/templates/adr.md +7 -0
- package/template/templates/adversarial-review.md +5 -5
- package/template/templates/ci-cd.md +14 -0
- package/template/templates/coord-message.md +3 -2
- package/template/templates/data-architecture.md +3 -6
- package/template/templates/kernel-fit-finding.md +2 -2
- package/template/templates/kernel-fit-flag.md +2 -2
- package/template/templates/plan.md +4 -0
- package/template/templates/product-brief.md +2 -2
- package/template/templates/roadmap.md +41 -0
- package/template/templates/security-review.md +1 -1
- package/template/templates/telemetry-sidecar.md +56 -13
- package/template/templates/test-plan.md +1 -1
- package/template/CLAUDE.md +0 -443
- package/template/templates/mvp-scope.md +0 -34
|
@@ -1,35 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: hstack-kernel-fit-triage
|
|
3
|
-
description:
|
|
4
|
-
Use this skill when the engineer wants to triage an open kernel-fit finding — either acknowledge it (intent to act, not yet promoted) or dismiss it (won't pursue). The Skill is mechanical per ADR-0001: structured-elicitation loop, proposed-diff preview, Y/n confirmation, direct `Edit` writes, one atomic commit. No subagent invoked. Promotion to an ADR is a separate Skill (`/hstack:kernel-fit-promote`); this Skill never touches ADRs or change-specs. Examples:
|
|
5
|
-
|
|
6
|
-
<example>
|
|
7
|
-
Context: The engineer received a Slack nudge about KF-0001 (KF-P1, Category-A claim with production paths) and wants to acknowledge it for later promotion.
|
|
8
|
-
user: "/hstack:kernel-fit-triage KF-0001 --action acknowledge"
|
|
9
|
-
assistant: "I'll read KF-0001, print it in full, show the proposed-diff (status: open → acknowledged; owner: <git-handle>; updated: today; Triage Log entry appended), wait for Y/n, then Edit + commit `kernel-fit(KF-0001): acknowledge`. No reason is required for acknowledge. If you later decide to promote, run `/hstack:kernel-fit-promote KF-0001 --slug <adr-slug>`."
|
|
10
|
-
<commentary>
|
|
11
|
-
Acknowledge does not require a `--reason`. It is the "I've seen this, I intend to act, but I'm not promoting yet" state. The Triage Log records the transition. The finding stays at `status: acknowledged` until promote or dismiss happens.
|
|
12
|
-
</commentary>
|
|
13
|
-
</example>
|
|
14
|
-
|
|
15
|
-
<example>
|
|
16
|
-
Context: The engineer reviewed KF-0002 and decided the pattern is engineer-error, not a kernel gap.
|
|
17
|
-
user: "/hstack:kernel-fit-triage KF-0002 --action dismiss --reason \"The two changes flagged actually do have downstream consumers; the change-specs simply omitted the user-stories array because the engineer copied an old template. Not a kernel-flag issue, just stale boilerplate.\""
|
|
18
|
-
assistant: "I'll verify the reason is ≥50 characters (KF-05), read KF-0002, print the proposed-diff (status: open → dismissed; dismissed-reason: <text>; owner; updated; Triage Log entry), wait for Y/n, then commit `kernel-fit(KF-0002): dismiss`. Dismissal is terminal — re-running on this finding will surface that it's already dismissed and exit no-op."
|
|
19
|
-
<commentary>
|
|
20
|
-
Dismissal requires a reason of ≥50 characters per KF-05. The check is mechanical at validation time; the Skill enforces it at step 2. Drive-by dismissals are exactly the failure mode the rule exists to catch. The dismissed-reason is itself audit signal — a high rate of dismissals on a given pattern means either the pattern is poorly tuned or the engineer is gaming the gate.
|
|
21
|
-
</commentary>
|
|
22
|
-
</example>
|
|
23
|
-
|
|
24
|
-
<example>
|
|
25
|
-
Context: The engineer tries to dismiss a finding with too-short reason.
|
|
26
|
-
user: "/hstack:kernel-fit-triage KF-0003 --action dismiss --reason \"not relevant\""
|
|
27
|
-
assistant: "I'll halt — `dismissed-reason` is 12 characters; KF-05 requires ≥50. Drive-by dismissals defeat the audit signal. Either provide a more substantive reason or leave the finding at `open` (open is a legitimate long-term state when triage is genuinely deferred)."
|
|
28
|
-
<commentary>
|
|
29
|
-
Short-reason rejection is a hard halt. The Skill does not negotiate — write a real reason or leave the finding alone. Same shape as the deferral-check in `hstack-tech-debt-wontfix`.
|
|
30
|
-
</commentary>
|
|
31
|
-
</example>
|
|
32
|
-
|
|
3
|
+
description: Use to acknowledge or dismiss an open kernel-fit finding. The second step of the kernel-fit loop — it only flips status and records a rationale; elevating a finding to an ADR is `/hstack:kernel-fit-promote`.
|
|
33
4
|
tools:
|
|
34
5
|
- Read
|
|
35
6
|
- Write
|
|
@@ -37,7 +8,7 @@ tools:
|
|
|
37
8
|
- Grep
|
|
38
9
|
- Glob
|
|
39
10
|
- Bash
|
|
40
|
-
- "
|
|
11
|
+
- "node hstack/scripts/validate-spec.mjs — validates the finding frontmatter flip and KF-05 (dismissed-reason non-null when status: dismissed)"
|
|
41
12
|
---
|
|
42
13
|
|
|
43
14
|
## Purpose
|
|
@@ -51,7 +22,7 @@ This Skill does not promote findings to ADRs. Promotion is a separate Skill (`/h
|
|
|
51
22
|
Invoke when a finding is at `status: open` and the engineer wants to:
|
|
52
23
|
|
|
53
24
|
- **Acknowledge** (`--action acknowledge`): record intent to act on the finding without committing to an ADR yet. Useful when the finding is real but the team needs more thinking time, or when the right kernel-change shape is unclear.
|
|
54
|
-
- **Dismiss** (`--action dismiss --reason <text>`): close the finding without pursuing a kernel change. The reason is mandatory (
|
|
25
|
+
- **Dismiss** (`--action dismiss --reason <text>`): close the finding without pursuing a kernel change. The reason is mandatory (KF-05) and becomes part of the audit trail.
|
|
55
26
|
|
|
56
27
|
For findings already at `acknowledged`, re-invoking with `--action acknowledge` is a no-op; re-invoking with `--action dismiss --reason <text>` is permitted (acknowledged → dismissed is a valid transition when the engineer reconsiders). Findings at terminal status (`dismissed`, `promoted`, `superseded`, `archived`) are immutable from this Skill's perspective — the Skill halts.
|
|
57
28
|
|
|
@@ -59,25 +30,25 @@ For findings already at `acknowledged`, re-invoking with `--action acknowledge`
|
|
|
59
30
|
|
|
60
31
|
- `<finding-id>` (required, positional): the finding id, e.g. `KF-0001-category-a-claim-spans-production` or the short form `KF-0001` (the Skill resolves the latter to the matching file via glob).
|
|
61
32
|
- `--action <acknowledge | dismiss>` (required): the triage action.
|
|
62
|
-
- `--reason <text>` (required when `--action dismiss`; forbidden when `--action acknowledge`): the dismissal rationale.
|
|
33
|
+
- `--reason <text>` (required when `--action dismiss`; forbidden when `--action acknowledge`): the dismissal rationale. It has to say what about the finding is wrong or not worth acting on, specifically enough that a reader six months from now can tell whether the dismissal still holds. "Not relevant" gives them nothing to check; "the kernel gives a norm here, not a bound" gives them everything, in forty-one characters. Length is not the test and is not checked (ADR-0014).
|
|
63
34
|
|
|
64
35
|
## Preconditions
|
|
65
36
|
|
|
66
37
|
- `hstack/kernel-fit/findings/<finding-id>*.md` exists. If missing, halt.
|
|
67
38
|
- The finding is at `status: open` (or `acknowledged` when transitioning to `dismissed`). If at any other status, halt with the current status named and the explanation that the status is terminal.
|
|
68
39
|
- `--action` is one of `acknowledge | dismiss` (controlled enum).
|
|
69
|
-
- When `--action dismiss`, `--reason` is non-empty and
|
|
40
|
+
- When `--action dismiss`, `--reason` is non-empty and re-evaluable by a later reader per the Inputs section. When it is not — the reason restates the finding, or asserts a preference with no referent — say so and ask for the specific claim; do not write the dismissal.
|
|
70
41
|
- When `--action acknowledge`, `--reason` is absent (the Skill rejects redundant reasons to keep the audit signal clean — acknowledge reasons live in the next promote / dismiss invocation if needed).
|
|
71
42
|
|
|
72
43
|
## Orchestration steps
|
|
73
44
|
|
|
74
45
|
1. **Resolve the finding file.** Glob `hstack/kernel-fit/findings/<finding-id>*.md`. If zero matches, halt. If multiple matches (shouldn't happen with the immutable-id rule, but defense in depth), halt and ask the engineer to disambiguate.
|
|
75
46
|
|
|
76
|
-
2. **Validate inputs against preconditions.** Walk the precondition checks above. On any failure, halt with the named reason.
|
|
47
|
+
2. **Validate inputs against preconditions.** Walk the precondition checks above. On any failure, halt with the named reason. When the failure is the `--reason` (`dismiss`), quote the reason back and name what is missing from it — the claim it makes, or the referent it lacks — so the engineer knows what to write rather than how long to write.
|
|
77
48
|
|
|
78
49
|
3. **Print the finding in full.** Read the resolved file and print its full body to the conversation. The engineer should re-read before committing to the triage action.
|
|
79
50
|
|
|
80
|
-
4. **Compose the frontmatter edit.** Compute the exact frontmatter changes:
|
|
51
|
+
4. **Compose the frontmatter edit.** These fields, and only these, are triage's to write — `pattern`, `evidence-rows`, `evidence-row-count` and `confidence` are the analyst's domain and are never edited here. Compute the exact frontmatter changes:
|
|
81
52
|
|
|
82
53
|
For `--action acknowledge`:
|
|
83
54
|
- `status: open → acknowledged`
|
|
@@ -102,15 +73,15 @@ For findings already at `acknowledged`, re-invoking with `--action acknowledge`
|
|
|
102
73
|
- `status: <prev> → dismissed` on <today> by <owner>. Reason: <dismissed-reason>.
|
|
103
74
|
```
|
|
104
75
|
|
|
105
|
-
Defensive
|
|
76
|
+
Defensive log-header check per the kernel: if `## Triage Log` is absent, append it before writing the entry.
|
|
106
77
|
|
|
107
|
-
6. **Print the proposed diff.** Show the engineer the exact frontmatter changes and the exact Triage Log entry that will land. This is the kernel's mechanical-operations confirmation gate
|
|
78
|
+
6. **Print the proposed diff.** Show the engineer the exact frontmatter changes and the exact Triage Log entry that will land. This is the kernel's mechanical-operations confirmation gate: the engineer sees what will land before it lands. The validator run in step 7 is the mechanical half of the same check.
|
|
108
79
|
|
|
109
80
|
7. **Confirm.** Print "Apply triage to <finding-id>? (Y/n)". Default Yes. On `n`, abort without writing.
|
|
110
81
|
|
|
111
82
|
8. **Edit + validate + commit.** On `Y`:
|
|
112
83
|
- `Edit` the file: frontmatter changes + Triage Log append.
|
|
113
|
-
- Run `
|
|
84
|
+
- Run `node hstack/scripts/validate-spec.mjs <path>` against the file. KF-01 through KF-05 must pass; specifically KF-05 (`dismissed-reason` non-null when `status: dismissed`) gates dismissal.
|
|
114
85
|
- On validation pass: `git add` the file and commit with message `kernel-fit(<finding-id>): <action>` (e.g. `kernel-fit(KF-0001): acknowledge`).
|
|
115
86
|
- On validation failure: halt; revert via `git checkout -- <finding-file>`. Report the failing rule to the engineer.
|
|
116
87
|
|
|
@@ -138,7 +109,7 @@ Beyond the kernel's general stop conditions:
|
|
|
138
109
|
|
|
139
110
|
- The finding does not exist or is at a terminal-from-triage status (`dismissed`, `promoted`, `superseded`, `archived`). Halt with the status named.
|
|
140
111
|
- `--action` is missing or not in the enum. Halt with usage.
|
|
141
|
-
- `--action dismiss` without `--reason`, or with `--reason`
|
|
112
|
+
- `--action dismiss` without `--reason`, or with a `--reason` that restates the finding instead of answering it. Halt, quote it back, and name what is missing.
|
|
142
113
|
- `--action acknowledge` with `--reason` present. Halt — acknowledge does not take a reason.
|
|
143
114
|
- The engineer declines confirmation at step 7. Abort cleanly.
|
|
144
115
|
- Validator fails at step 8 — halt with the failing rule; revert the unstaged edit.
|
|
@@ -146,14 +117,5 @@ Beyond the kernel's general stop conditions:
|
|
|
146
117
|
## Failure modes
|
|
147
118
|
|
|
148
119
|
- **Edit fails (filesystem, validator, git).** The frontmatter flip and the Triage Log append must land together in a single auto-commit. If `Edit` succeeds but `git add` or `git commit` fails, the working tree carries the unstaged change — revert via `git checkout -- <finding-file>` and re-invoke.
|
|
149
|
-
- **Drive-by dismissal attempt.** The
|
|
120
|
+
- **Drive-by dismissal attempt.** The re-evaluability judgment at step 2 is the v1 defense: the reason is read against the finding the Skill just resolved, and one that gives a later reader nothing to check is quoted back before any write occurs.
|
|
150
121
|
- **Stale finding (post-scan supersession in flight).** If a concurrent `/hstack:kernel-fit-scan` has just superseded the finding the engineer is triaging, the post-edit validator would catch the inconsistent state (superseded finding cannot be re-triaged). Halt and let the engineer re-fetch the working tree.
|
|
151
|
-
|
|
152
|
-
## Anti-patterns
|
|
153
|
-
|
|
154
|
-
- Never invoke a subagent for triage. The action's value is fully determined by `--action` and `--reason`; the kernel's Mechanical operations section requires direct Skill writes for cases like this (saving ~25k subagent-context tokens per call).
|
|
155
|
-
- Never accept a dismissal reason shorter than 50 characters. The audit signal depends on substantive rationales — drive-bys defeat the loop.
|
|
156
|
-
- Never edit a finding's `pattern`, `evidence-rows`, `confidence`, or `evidence-row-count` fields. Those are the analyst's domain; triage only flips `status`, sets `owner` / `updated`, and writes `dismissed-reason` (when dismissing).
|
|
157
|
-
- Never edit a `promoted` finding's `promoted-to` field. That is owned by `/hstack:kernel-fit-promote` and is reciprocally bound to the target ADR.
|
|
158
|
-
- Never re-open a `dismissed` or `superseded` finding. If the kernel-fit pattern recurs with new evidence, the next `/hstack:kernel-fit-scan` will produce a new finding with a new id — that's the right path.
|
|
159
|
-
- Never invoke `spec-author` for the triage action. Per ADR-0001, the Skill writes directly.
|
|
@@ -1,25 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: hstack-module-spec
|
|
3
|
-
description:
|
|
4
|
-
Use this skill when an engineer needs a baseline `hstack/specs/<module>/spec.md` reverse-engineered for an existing module on a brownfield repo. Module-specs are foundational: every change-spec validates that `area` references an existing module-spec at `status: current`, and every per-change downstream subagent loads the relevant module-spec at session start. Examples:
|
|
5
|
-
|
|
6
|
-
<example>
|
|
7
|
-
Context: The team has just finished `hstack-init` and the engineer wants to produce a module-spec for the billing module before any change work begins there.
|
|
8
|
-
user: "Run /hstack:module-spec billing."
|
|
9
|
-
assistant: "I'll invoke spec-author with the billing paths from hstack/config.yaml, pack the module via RepoMix, and walk the seven module-spec sections through an interview."
|
|
10
|
-
<commentary>
|
|
11
|
-
Module-specs are the only artifact the `spec-author` reverse-engineers from existing code rather than authoring fresh. The Skill is run once per critical module on adoption; thereafter the spec is refreshed via `hstack-configure --interview` or by re-running this Skill when the cron flags it `needs-refresh`.
|
|
12
|
-
</commentary>
|
|
13
|
-
</example>
|
|
14
|
-
|
|
15
|
-
<example>
|
|
16
|
-
Context: A 60-day refresh cron has flagged `hstack/specs/orchestrator/spec.md` as `needs-refresh` because the orchestrator module has been heavily modified.
|
|
17
|
-
user: "Refresh the orchestrator module-spec."
|
|
18
|
-
assistant: "I'll re-run /hstack:module-spec orchestrator. The existing spec is the proposal layer; spec-author walks each section, confirming or correcting against the current code."
|
|
19
|
-
<commentary>
|
|
20
|
-
Refresh mode is idempotent — when the existing module-spec is read in as the proposal layer, sections that remain accurate produce a no-op confirmation and the timestamp updates without churning the body.
|
|
21
|
-
</commentary>
|
|
22
|
-
</example>
|
|
3
|
+
description: Use to reverse-engineer or refresh the baseline `hstack/specs/<module>/spec.md` for one module. Required before any change-spec whose `area` names that module can validate.
|
|
23
4
|
tools:
|
|
24
5
|
- Read
|
|
25
6
|
- Write
|
|
@@ -29,12 +10,12 @@ tools:
|
|
|
29
10
|
- Bash
|
|
30
11
|
- Task
|
|
31
12
|
- "{{TODO-TOOL: RepoMix — packs the module slice (paths from hstack/config.yaml) into a single context bundle for spec-author}}"
|
|
32
|
-
- "
|
|
13
|
+
- "node hstack/scripts/validate-spec.mjs — validates module-spec frontmatter and MS-01/MS-02/MS-03"
|
|
33
14
|
---
|
|
34
15
|
|
|
35
16
|
## Purpose
|
|
36
17
|
|
|
37
|
-
`hstack-module-spec` produces a baseline `hstack/specs/<module>/spec.md` for one named module by orchestrating the `spec-author` subagent against a packed module slice. It is the one Skill where `spec-author` is permitted to grep the code in service of authorship —
|
|
18
|
+
`hstack-module-spec` produces a baseline `hstack/specs/<module>/spec.md` for one named module by orchestrating the `spec-author` subagent against a packed module slice. It is the one Skill where `spec-author` is permitted to grep the code in service of authorship — reading it, never modifying it. The module-spec is the system's anchor between its `area` controlled enum and the actual codebase, and a module-spec disconnected from real paths is worthless.
|
|
38
19
|
|
|
39
20
|
## When to invoke
|
|
40
21
|
|
|
@@ -62,13 +43,13 @@ Before any work:
|
|
|
62
43
|
|
|
63
44
|
3. **Exercise the Invariants challenge prompt.** Per the `spec-author` contract and MS-03, the Invariants section requires a minimum of three bullets, elicited via the challenge "What would a careless refactor in this module break that the tests would not catch?" The Skill does not bypass this even on refresh.
|
|
64
45
|
|
|
65
|
-
4. **Validate.** After each confirmed field write, the subagent runs `
|
|
46
|
+
4. **Validate.** After each confirmed field write, the subagent runs `node hstack/scripts/validate-spec.mjs <path>` against the in-progress file. The Skill verifies MS-01 (paths non-empty and resolve), MS-02 (no overlap with other module-specs' paths — important to surface mis-aligned module-to-paths mapping), MS-03 (Invariants ≥ 3 bullets).
|
|
66
47
|
|
|
67
48
|
5. **Transition to `status: current`.** When every section is confirmed and the validator passes, `spec-author` advances status from `drafted` to `current` and updates `last-refreshed` to today. Auto-commit fires.
|
|
68
49
|
|
|
69
50
|
## Outputs
|
|
70
51
|
|
|
71
|
-
- `hstack/specs/<module>/spec.md` at `status: current`, with frontmatter including the module's `paths` array mirrored from `hstack/config.yaml`.
|
|
52
|
+
- `hstack/specs/<module>/spec.md` at `status: current`, with frontmatter including the module's `paths` array mirrored from `hstack/config.yaml`. The Skill mirrors those globs; it never edits, substitutes, or invents them — `paths` are config's to change.
|
|
72
53
|
|
|
73
54
|
## Auto-commit triggers
|
|
74
55
|
|
|
@@ -95,11 +76,3 @@ Beyond the kernel's general stop conditions:
|
|
|
95
76
|
- **RepoMix unavailable.** Degraded mode — flag in the conversation, fall back to direct grep, continue.
|
|
96
77
|
- **Existing module-spec frontmatter does not match config's paths.** Halt; the engineer reconciles before the refresh can proceed.
|
|
97
78
|
- **Validator failure on a partial write.** `spec-author` halts at the field; the Skill surfaces the validator's message and waits.
|
|
98
|
-
|
|
99
|
-
## Anti-patterns
|
|
100
|
-
|
|
101
|
-
- Never invent paths. The module's `paths` come from `hstack/config.yaml`; the Skill never edits them and never substitutes.
|
|
102
|
-
- Never skip the Invariants challenge. Three-or-more bullets is a hard validator rule, not a heuristic.
|
|
103
|
-
- Never run this Skill against a module that does not appear in the config. The right move is to add the module to config first.
|
|
104
|
-
- Never overwrite an existing `current` module-spec without explicit refresh-or-re-author confirmation from the engineer.
|
|
105
|
-
- Never write code. `spec-author` is the only subagent invoked, and it reads code without modifying it.
|
|
@@ -1,25 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: hstack-product-discovery
|
|
3
|
-
description:
|
|
4
|
-
Use this skill when the engineer wants to produce or refresh `hstack/context/product/product-brief.md` — the durable thinking artifact that captures the project's product reasoning. The Skill is Phase 1 of `/hstack:greenfield-init` (elicit mode), an optional enrichment phase of `/hstack:brownfield-init` when source docs are thin (extract mode), or a standalone atom for retroactive brief authoring. It invokes the `product-discovery` subagent in one of three engineer-chosen techniques (Brainstorm, Forcing-Questions, Project-Brief), produces a single synthesis at `hstack/context/product/product-brief.md`, and auto-routes to `product-manager` for downstream context-doc refresh. Examples:
|
|
5
|
-
|
|
6
|
-
<example>
|
|
7
|
-
Context: Phase 1 of greenfield-init opens. The engineer types `/hstack:product-discovery` directly.
|
|
8
|
-
user: "/hstack:product-discovery"
|
|
9
|
-
assistant: "Pick a technique: [1] Brainstorm — facilitated ideation; [2] Forcing-Questions — reframe-driven probing (Gstack-style); [3] Project-Brief — structured walk. Default mode is elicit (no source docs). The brief lives at hstack/context/product/product-brief.md and is parkable any time."
|
|
10
|
-
<commentary>
|
|
11
|
-
The technique choice is the engineer's, not the agent's. Each technique's script is in hstack/templates/discovery/<technique>.md. Mid-technique switching is allowed but halts to confirm — mixing technique outputs produces an incoherent brief.
|
|
12
|
-
</commentary>
|
|
13
|
-
</example>
|
|
14
|
-
|
|
15
|
-
<example>
|
|
16
|
-
Context: A brownfield repo's brief never landed during init; /hstack:help flagged the missing artifact.
|
|
17
|
-
user: "/hstack:product-discovery --mode extract"
|
|
18
|
-
assistant: "Extract mode. I'll read existing vision.md, README, and any product docs you point me at, propose the brief sections from what I find, and walk you through confirm-or-revise. The three required forcing prompts still run — extract mode does not bypass blind-spot probes."
|
|
19
|
-
<commentary>
|
|
20
|
-
Extract+confirm mode is how brownfield enrichment works. The unification of modes is load-bearing: the brief produced is the same artifact whether elicited or extracted, so downstream phases load it identically.
|
|
21
|
-
</commentary>
|
|
22
|
-
</example>
|
|
3
|
+
description: Use to produce or refresh `hstack/context/product/product-brief.md` through one of three discovery techniques. Greenfield Phase 1, optional brownfield enrichment when source docs are thin, or standalone retroactive authoring.
|
|
23
4
|
tools:
|
|
24
5
|
- Read
|
|
25
6
|
- Write
|
|
@@ -28,7 +9,7 @@ tools:
|
|
|
28
9
|
- Glob
|
|
29
10
|
- Bash
|
|
30
11
|
- Task
|
|
31
|
-
- "
|
|
12
|
+
- "node hstack/scripts/validate-spec.mjs — frontmatter validator"
|
|
32
13
|
---
|
|
33
14
|
|
|
34
15
|
## Purpose
|
|
@@ -49,7 +30,7 @@ tools:
|
|
|
49
30
|
## Preconditions
|
|
50
31
|
|
|
51
32
|
- `hstack/config.yaml` exists and `init-status` is at least `minimal-complete` — the atom does not run standalone until config exists.
|
|
52
|
-
- `hstack/
|
|
33
|
+
- `hstack/KERNEL.md` and `hstack/templates/product-brief.md` are present.
|
|
53
34
|
- `hstack/templates/discovery/{brainstorm,forcing-questions,project-brief}.md` are present.
|
|
54
35
|
- In extract mode, at least one source document must be reachable; otherwise halt and ask the engineer to either supply source pointers or fall back to elicit mode.
|
|
55
36
|
|
|
@@ -60,13 +41,13 @@ tools:
|
|
|
60
41
|
3. **Invoke `product-discovery` subagent.** Via the Task tool with `subagent_type: product-discovery`. Pass mode, technique, optional section, and the canonical session-start context (kernel, template, technique script, source docs in extract mode).
|
|
61
42
|
4. **Walk sections.** The subagent runs the chosen technique's script and walks the brief sections with confirmation gates. Each confirmed section writes to disk and auto-commits.
|
|
62
43
|
5. **Run forcing prompts.** The three required reframes (Who pays? What's the wedge? What would falsify this?) fire before terminal state regardless of technique.
|
|
63
|
-
6. **Auto-route at terminal state.** When the brief reaches `status: current`, the Skill prints the auto-route message (with alternative-path commands) and hands off to `product-manager` via the Task tool with `subagent_type: product-manager` to refresh `vision.md`, `
|
|
44
|
+
6. **Auto-route at terminal state.** When the brief reaches `status: current`, the Skill prints the auto-route message (with alternative-path commands) and hands off to `product-manager` via the Task tool with `subagent_type: product-manager` to refresh `vision.md`, `roadmap.md`, `personas/`, `glossary.md`. If the engineer types `skip-routing`, the Skill commits the brief and exits cleanly — downstream Skills will halt on missing context docs.
|
|
64
45
|
|
|
65
46
|
## Outputs
|
|
66
47
|
|
|
67
48
|
- `hstack/context/product/product-brief.md` at `status: current`.
|
|
68
49
|
- `hstack/.session-state/<session-id>.yaml` (transient).
|
|
69
|
-
- Via auto-route: `vision.md`, `
|
|
50
|
+
- Via auto-route: `vision.md`, `roadmap.md`, `personas/*`, `glossary.md` refreshed (unless skip-routing).
|
|
70
51
|
|
|
71
52
|
## Auto-commit triggers
|
|
72
53
|
|
|
@@ -92,10 +73,3 @@ tools:
|
|
|
92
73
|
|
|
93
74
|
- **Subagent unreachable.** Persist session state; retry later.
|
|
94
75
|
- **Auto-route partial failure.** If `product-manager` succeeds on vision but fails on personas (e.g., Notion MCP unreachable), the partial state is on disk; re-running auto-route via `/hstack:configure personas --from-brief` recovers.
|
|
95
|
-
|
|
96
|
-
## Anti-patterns
|
|
97
|
-
|
|
98
|
-
- Never write to `vision.md`, `mvp-scope.md`, `personas/`, `glossary.md` from this Skill directly. Those refreshes belong to `product-manager` via the auto-route.
|
|
99
|
-
- Never bypass the three required forcing prompts, even in Project-Brief mode (the lightest touch).
|
|
100
|
-
- Never silently switch techniques mid-session.
|
|
101
|
-
- Never advance the brief to `current` while the Explicitly NOT section has fewer than two bullets.
|
|
@@ -1,25 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: hstack-research
|
|
3
|
-
description:
|
|
4
|
-
Use this skill when the engineer needs grounded research across one of five modes (API lookups, competitive scans, documentation, security CVEs, AI-native best practices) and wants a transient research session committed to `hstack/research/sessions/`. The Skill orchestrates the `researcher` subagent. A `--promote <session-id>` sub-mode elevates an existing session into an ADR (routes through `hstack-adr-new`), a tech-debt item (routes through `hstack-tech-debt-new`), or a durable note under `hstack/research/promoted/` (written by the researcher directly). Examples:
|
|
5
|
-
|
|
6
|
-
<example>
|
|
7
|
-
Context: The engineer is about to introduce a new HubSpot integration and needs to confirm current rate-limit and webhook signature behavior.
|
|
8
|
-
user: "/hstack:research HubSpot CRM v3 webhook signature verification and current rate limits."
|
|
9
|
-
assistant: "I'll invoke researcher in API-lookup mode. Canonical-source bias on HubSpot's docs over secondary tutorials; recency window pinned to the last 12 months. Session lands at hstack/research/sessions/<date>-hubspot-webhooks.md."
|
|
10
|
-
<commentary>
|
|
11
|
-
Mode classification drives source bias. API-lookup mode weights vendor docs over tutorials because tutorials are the most common cause of wrong-API integrations. Sessions are transient artifacts; the engineer chooses whether to promote.
|
|
12
|
-
</commentary>
|
|
13
|
-
</example>
|
|
14
|
-
|
|
15
|
-
<example>
|
|
16
|
-
Context: A research session reached a decision point; the engineer wants to promote it to an ADR.
|
|
17
|
-
user: "/hstack:research --promote 2026-05-orchestration-patterns"
|
|
18
|
-
assistant: "I'll route through /hstack:adr-new with --from-research 2026-05-orchestration-patterns. spec-author will receive the session findings as the Context section seed and walk the remaining Nygard sections via interview."
|
|
19
|
-
<commentary>
|
|
20
|
-
Promotion routing preserves the conversational interview pattern. The researcher does not write ADRs or tech-debt directly; it hands off via the appropriate Skill so the templates' challenge prompts are exercised.
|
|
21
|
-
</commentary>
|
|
22
|
-
</example>
|
|
3
|
+
description: Use when a decision needs grounded external information — API behavior, competitive scans, canonical docs, security CVEs, AI-native patterns — written to a transient research session. `--promote` elevates a session to an ADR, tech-debt, or durable note.
|
|
23
4
|
tools:
|
|
24
5
|
- Read
|
|
25
6
|
- Write
|
|
@@ -32,7 +13,7 @@ tools:
|
|
|
32
13
|
- WebFetch
|
|
33
14
|
- "{{TODO-MCP: Notion MCP — optional; useful when research must include prior team decisions in Notion}}"
|
|
34
15
|
- "{{TODO-MCP: GitHub MCP — optional; useful for searching issues and PRs on third-party SDK repos}}"
|
|
35
|
-
- "
|
|
16
|
+
- "node hstack/scripts/validate-spec.mjs — validates research session frontmatter"
|
|
36
17
|
- "{{TODO-SCRIPT: hstack/scripts/garbage-collect-research.sh — clears sessions past their garbage-collect-after date; promoted sessions exempt}}"
|
|
37
18
|
---
|
|
38
19
|
|
|
@@ -68,7 +49,7 @@ Before any work:
|
|
|
68
49
|
|
|
69
50
|
### Default mode
|
|
70
51
|
|
|
71
|
-
1. **Invoke `researcher`.** Use the Task tool with `subagent_type: researcher` and context = [kernel, query, mode-relevant context docs per the researcher's contract — tech-stack for API/documentation modes, vision/
|
|
52
|
+
1. **Invoke `researcher`.** Use the Task tool with `subagent_type: researcher` and context = [kernel, query, mode-relevant context docs per the researcher's contract — tech-stack for API/documentation modes, vision/roadmap for competitive/AI-native modes, threat-model/hardening-checklist for security-CVE mode]. The subagent classifies the query, applies the mode's source bias, and writes findings incrementally.
|
|
72
53
|
|
|
73
54
|
2. **Source discipline.** Per the `researcher` contract:
|
|
74
55
|
- API-lookup: canonical vendor docs over tutorials; 12-month recency window.
|
|
@@ -132,14 +113,3 @@ Beyond the kernel's general stop conditions:
|
|
|
132
113
|
- **WebSearch / WebFetch rate-limited or unavailable.** Surface the limitation; the researcher proceeds with cached or partial results, naming confidence as `low` for affected findings.
|
|
133
114
|
- **A vendor's docs have moved and the canonical URL no longer resolves.** Note the broken canonical source explicitly; do not silently switch to a tutorial.
|
|
134
115
|
- **Promote-to-ADR or promote-to-tech-debt halts inside `spec-author`'s interview.** The session's `promoted-to` field is not written until the destination artifact is at terminal state. Resume by re-running the destination Skill directly.
|
|
135
|
-
|
|
136
|
-
## Anti-patterns
|
|
137
|
-
|
|
138
|
-
- Never paraphrase vendor marketing as fact.
|
|
139
|
-
- Never assign `high` confidence to a single-source claim.
|
|
140
|
-
- Never invent a CVE id or a version number.
|
|
141
|
-
- Never advocate for an option beyond what the evidence supports — present options with pros / cons / source-backing; the engineer decides.
|
|
142
|
-
- Never promote unilaterally. Promotion is engineer-driven via the explicit flag.
|
|
143
|
-
- Never write ADRs or tech-debt items directly from this Skill. Route via `hstack-adr-new` / `hstack-tech-debt-new`. The exception is `--target note`, which the researcher writes directly because durable notes are free-form.
|
|
144
|
-
- Never silently drop a contradiction between sources.
|
|
145
|
-
- Never load implementer transcripts or per-change artifacts for context bleed; research is upstream of implementation.
|
|
@@ -1,25 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: hstack-scaffold
|
|
3
|
-
description:
|
|
4
|
-
Use this skill as Phase 6 of `/hstack:greenfield-init` to bootstrap the consuming repository from empty to bootable. The Skill generates a **bootstrap change-spec** from `hstack/templates/bootstrap.md` (a change-spec variant with `area: bootstrap`, `surfaces: [infra]`), enumerates `in-scope` explicitly from the upstream artifacts (Module Map from app-architecture, Migration Sketches from data-architecture, stack ADRs from Phase 4), runs `data-review` and `security-review` in `--mode foundational` against the proposed posture, then drives the implementer through the planner's phased execution to produce the actual source files, migrations, CI config, and module shells. This is the only Skill (besides `/hstack:greenfield-init` which composes it) that ends with executable code landing in the consuming repo as part of init. Examples:
|
|
5
|
-
|
|
6
|
-
<example>
|
|
7
|
-
Context: Phases 1–5 of greenfield-init are complete; all context artifacts and stack ADRs are at terminal status.
|
|
8
|
-
user: "/hstack:scaffold"
|
|
9
|
-
assistant: "Generating bootstrap change-spec at hstack/specs/changes/<YYYY-MM>-bootstrap/spec.md. in-scope enumerated from app-architecture Section 1 (module shells) + data-architecture Section 5 (migration files) + standard infra files (package.json, tsconfig, CI workflow). Running foundational-mode security-review and data-review against the proposed posture. Then planner phases → implementer phase-by-phase → verifier. At terminal state the repo is bootable; build and test commands exit 0."
|
|
10
|
-
<commentary>
|
|
11
|
-
Scaffold's distinct property: it scores against a proposed posture (no diff yet) using --mode foundational on security-reviewer and data-specialist. After the bootstrap ships, those reviewers go back to per-change diff-scoring mode.
|
|
12
|
-
</commentary>
|
|
13
|
-
</example>
|
|
14
|
-
|
|
15
|
-
<example>
|
|
16
|
-
Context: Scaffold was started two days ago; phase-3 (module shells) landed but phase-4 (CI workflow) hit a verifier failure.
|
|
17
|
-
user: "/hstack:scaffold"
|
|
18
|
-
assistant: "Resuming the bootstrap change-spec. plan.md shows phase-3 complete; phase-4 had verifier discrepancies. Re-running /hstack:verify on phase-4 outputs to identify what failed; then either re-implementing phase-4 (if the implementer's output was incorrect) or revising the plan (if the expectation was wrong)."
|
|
19
|
-
<commentary>
|
|
20
|
-
Scaffold inherits the standard per-change idempotency contract because bootstrap IS a change-spec. The planner and implementer's existing resume semantics apply unchanged.
|
|
21
|
-
</commentary>
|
|
22
|
-
</example>
|
|
3
|
+
description: Use as greenfield Phase 6 to bootstrap an empty repository from the terminal context artifacts to bootable source, via a generated bootstrap change-spec. Greenfield only; the only init path that lands executable code.
|
|
23
4
|
tools:
|
|
24
5
|
- Read
|
|
25
6
|
- Write
|
|
@@ -38,7 +19,7 @@ tools:
|
|
|
38
19
|
- "{{TODO-SKILL: /hstack:adversarial-review — runs in a fresh session for the bootstrap}}"
|
|
39
20
|
- "{{TODO-SKILL: /hstack:ship — final scorecard; bootstrap ships with a PR like any change}}"
|
|
40
21
|
- "{{TODO-SKILL: /hstack:finalize — post-merge cleanup}}"
|
|
41
|
-
- "
|
|
22
|
+
- "node hstack/scripts/validate-spec.mjs — frontmatter validator"
|
|
42
23
|
---
|
|
43
24
|
|
|
44
25
|
## Purpose
|
|
@@ -130,11 +111,3 @@ Scaffold inherits the standard per-change idempotency contract because bootstrap
|
|
|
130
111
|
- **Foundational-mode reviewer halts.** Foundational mode is honor-system in v1 — the reviewer is asked to score a proposed posture, not a diff. If the reviewer cannot honestly score (e.g., the threat-model is too thin), the reviewer halts with `HSTACK-HALT: reason=upstream-non-terminal` and routes the engineer back to `/hstack:configure threat-model`.
|
|
131
112
|
- **Implementer scope-lock fires on a path NOT in the enumerated in-scope.** This is a scaffold-spec gap, not an implementer bug. The Skill halts; the engineer revises `in-scope` (mechanical edit by the engineer per the kernel's scope-amendment path) and re-runs `/hstack:implement` for the affected phase.
|
|
132
113
|
- **CI runs from `ci-cd.md` haven't been authored yet for fresh projects.** The bootstrap change-spec's test-plan must define the canonical commands; otherwise verifier has nothing to run. The Skill checks this at preconditions.
|
|
133
|
-
|
|
134
|
-
## Anti-patterns
|
|
135
|
-
|
|
136
|
-
- Never run scaffold against a non-empty repo. Scaffold is greenfield-only; mixing modes produces incoherent in-scope enumeration.
|
|
137
|
-
- Never set `in-scope: ["."]`. Explicit file enumeration is the contract; the implementer's scope-lock does meaningful work only against an explicit list.
|
|
138
|
-
- Never skip foundational-mode security-review / data-review to "save time." Those gates are the v1 substrate for getting hardening and RLS posture right from line zero.
|
|
139
|
-
- Never bypass adversarial-review for the bootstrap. Bootstrap inherits the fresh-session contract from the kernel; ship without it is forbidden.
|
|
140
|
-
- Never flip `init-status: complete` while the bootstrap change-spec is below `shipped`.
|
|
@@ -1,34 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: hstack-security-review
|
|
3
|
-
description:
|
|
4
|
-
Use this skill when a change-spec is at `status: ready-to-plan` or later and needs `security-review.md` produced before the implementer can start. The Skill orchestrates the `security-reviewer` subagent. In v1 the output is an LLM-scored structured judgment (`scoring-mode: llm-scored`), not an executable test result — the Skill enforces this framing on every output. Examples:
|
|
5
|
-
|
|
6
|
-
<example>
|
|
7
|
-
Context: A change-spec introduces a new public-schema table with RLS and is at ready-to-plan.
|
|
8
|
-
user: "/hstack:security-review 2026-05-billing-overage-warning"
|
|
9
|
-
assistant: "I'll invoke security-reviewer. Surfaces is [ui, db], so the threat-model-delta section is mandatory. Scoring biases toward CONCERNS over PASS when evidence is thin; the three challenge prompts run regardless of what surfaces declares."
|
|
10
|
-
<commentary>
|
|
11
|
-
The Skill is the only authoring path for security-review.md. It enforces SR-03 (threat-model-delta required when surfaces touches agent/auth/api/db) and SR-02 (three challenge prompts mandatory). v1 framing is enforced on every rationale.
|
|
12
|
-
</commentary>
|
|
13
|
-
</example>
|
|
14
|
-
|
|
15
|
-
<example>
|
|
16
|
-
Context: A change touches the agent surface — new orchestrator prompt and a new tool boundary — and the threat-model.md has not been touched in eight weeks.
|
|
17
|
-
user: "/hstack:security-review 2026-06-playbook-runner-prompt"
|
|
18
|
-
assistant: "I'll invoke security-reviewer. The threat-model-delta is mandatory because surfaces includes agent; I'll halt if the delta can't be produced from the current threat-model. Findings will frame as structured judgment, not verified by test execution."
|
|
19
|
-
<commentary>
|
|
20
|
-
Agent-surface changes are exactly where the v1 honesty clause matters most. The Skill ensures the subagent does not claim test-backed evidence for prompt-injection resistance — that is v2 substrate work.
|
|
21
|
-
</commentary>
|
|
22
|
-
</example>
|
|
23
|
-
|
|
24
|
-
<example>
|
|
25
|
-
Context: A change is a small refactor with no declared security-sensitive surface, but the diff touches authentication-adjacent code.
|
|
26
|
-
user: "/hstack:security-review 2026-05-auth-helper-rename"
|
|
27
|
-
assistant: "I'll invoke security-reviewer. Even on a refactor, the three challenge prompts run — attack vector not covered by checklist, tenant-isolation citation, malicious-payload behavior — to surface anything the surface declaration may have missed."
|
|
28
|
-
<commentary>
|
|
29
|
-
Refactors near auth are exactly the place where the surface declaration may understate the risk. The challenge-prompt machinery is the v1 mitigation for humans missing what's missing.
|
|
30
|
-
</commentary>
|
|
31
|
-
</example>
|
|
3
|
+
description: Use when a change-spec is at `ready-to-plan` or later and needs `security-review.md` before implementation. Runs independently of `/hstack:change-plan` and `/hstack:data-review`.
|
|
32
4
|
tools:
|
|
33
5
|
- Read
|
|
34
6
|
- Write
|
|
@@ -38,7 +10,7 @@ tools:
|
|
|
38
10
|
- Bash
|
|
39
11
|
- Task
|
|
40
12
|
- "{{TODO-SCRIPT: hstack/scripts/score-security-review.ts — computes overall status from the scores map}}"
|
|
41
|
-
- "
|
|
13
|
+
- "node hstack/scripts/validate-spec.mjs — validates security-review frontmatter and SR-01..SR-05"
|
|
42
14
|
- "{{TODO-MCP: Supabase MCP — optional in v1 for live RLS introspection; v2 substrate will hard-fail when unreachable for db-surface changes}}"
|
|
43
15
|
---
|
|
44
16
|
|
|
@@ -71,11 +43,11 @@ Before any work:
|
|
|
71
43
|
|
|
72
44
|
2. **Threat-model delta.** When `threat-model-delta-required: true`, the subagent writes section 3 with a non-empty delta against the current threat-model.md. SR-03 enforces this at validation.
|
|
73
45
|
|
|
74
|
-
3. **Three challenge prompts (mandatory).** Per SR-02 and the subagent's contract, the subagent answers all three challenge prompts
|
|
46
|
+
3. **Three challenge prompts (mandatory).** Per SR-02 and the subagent's contract, the subagent answers all three challenge prompts. The canonical wording:
|
|
75
47
|
- "What attack vector did the In-Scope diff create that is NOT covered by the hardening checklist? If none, justify."
|
|
76
48
|
- "Which tenant_isolation guarantee does this change depend on? Cite the line of code that enforces it."
|
|
77
49
|
- "What part of this change would behave incorrectly under a malicious payload that the test suite does not cover?"
|
|
78
|
-
Each answer is at least one paragraph. The Skill verifies `challenge-prompts-answered: 3` in frontmatter.
|
|
50
|
+
The prompts must be answered; they need not be transcribed. Where a probe fits the change poorly as written, the subagent adapts it so it bites harder and records the adapted question in the heading — the `(a)` / `(b)` / `(c)` prefixes stay, because that is what SR-02 locates the answers by. Each answer is at least one paragraph. The Skill verifies `challenge-prompts-answered: 3` in frontmatter.
|
|
79
51
|
|
|
80
52
|
4. **Scoring discipline.** Per the subagent's contract, scoring biases toward CONCERNS when evidence is thin. The Skill does not override this bias. Tenant-isolation citations reference real lines of code; the subagent greps to verify.
|
|
81
53
|
|
|
@@ -85,7 +57,7 @@ Before any work:
|
|
|
85
57
|
|
|
86
58
|
7. **Tech-debt for deferred concerns.** When a CONCERNS finding is being deferred rather than fixed, the subagent prompts the engineer to invoke `hstack-tech-debt-new` to create the paper trail. The Skill does not file the tech-debt itself; it surfaces the recommendation.
|
|
87
59
|
|
|
88
|
-
8. **Validate.** Run `
|
|
60
|
+
8. **Validate.** Run `node hstack/scripts/validate-spec.mjs <path>` and `{{TODO-SCRIPT: hstack/scripts/score-security-review.ts}}` — SR-01 through SR-05.
|
|
89
61
|
|
|
90
62
|
## Outputs
|
|
91
63
|
|
|
@@ -121,13 +93,3 @@ Beyond the kernel's general stop conditions:
|
|
|
121
93
|
- **Tenant-isolation citation cannot be produced because the In-Scope diff drops tenant context.** Halt and surface — the change introduces a tenant-isolation bug.
|
|
122
94
|
- **Validator fails SR-02 (fewer than 3 challenge prompts answered).** Halt; the subagent re-runs the missing prompt.
|
|
123
95
|
- **v1 framing slips in a rationale.** The Skill detects "verified by test" language in any rationale paragraph and halts; the subagent re-words.
|
|
124
|
-
|
|
125
|
-
## Anti-patterns
|
|
126
|
-
|
|
127
|
-
- Never produce a PASS when evidence is thin. Default to CONCERNS and let the human acknowledge.
|
|
128
|
-
- Never skip or paraphrase a challenge prompt. The three are verbatim and mandatory.
|
|
129
|
-
- Never claim test-backed evidence in v1. The honesty clause is load-bearing.
|
|
130
|
-
- Never write `concerns-acknowledged-by` without the owner's explicit acknowledgement.
|
|
131
|
-
- Never silently fall back to `data-architecture.md` when the live-schema MCP is unreachable on a db-surface change — flag the degradation in the rationale and (in v1) continue if the change is low-stakes, halt if high-stakes.
|
|
132
|
-
- Never fabricate line numbers in tenant_isolation citations.
|
|
133
|
-
- Never file tech-debt from this Skill; surface the recommendation for the engineer to invoke `hstack-tech-debt-new`.
|