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,25 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: hstack-app-architecture
|
|
3
|
-
description:
|
|
4
|
-
Use this skill when the engineer wants to produce or refresh `hstack/context/app-architecture.md` — the five-section internal-architecture design (Module Map, Agent Orchestration, Deterministic-vs-LLM Split, State Ownership, Surface Boundaries). The Skill is Phase 3 of `/hstack:greenfield-init`, the app-architecture step of `/hstack:brownfield-init`, or a standalone atom for refreshing a single section. At terminal state the atom auto-scaffolds `hstack/specs/<module>/spec.md` stubs at `status: draft` for each declared module and updates `hstack/config.yaml`'s `surfaces` enum to match Section 5. Examples:
|
|
5
|
-
|
|
6
|
-
<example>
|
|
7
|
-
Context: Phase 3 of greenfield-init opens after data-architecture is current.
|
|
8
|
-
user: "/hstack:app-architecture"
|
|
9
|
-
assistant: "Loading product-brief, data-architecture, vision, mvp-scope. Stack-agnostic interview — I won't ask about frameworks here; that's Phase 4. Section 3 (Deterministic-vs-LLM Split) is the load-bearing AI-native decision: per user-facing flow, what's code and what's prompt, with rationale tied to a measurable property."
|
|
10
|
-
<commentary>
|
|
11
|
-
Internal architecture is stack-agnostic by design. Section 3 is where AI-native teams most often get architecture wrong by leaving the LLM/code split implicit. The atom forces per-step declaration.
|
|
12
|
-
</commentary>
|
|
13
|
-
</example>
|
|
14
|
-
|
|
15
|
-
<example>
|
|
16
|
-
Context: A brownfield repo's modules have evolved; the engineer wants the artifact refreshed against current code.
|
|
17
|
-
user: "/hstack:app-architecture --mode extract"
|
|
18
|
-
assistant: "Extract mode. Scanning src/, app/, lib/ via Glob; reading exports and dependencies. Proposing the Module Map from code-evidence. The drift challenge runs at the end of Section 1: does any module own state a persona never interacts with?"
|
|
19
|
-
<commentary>
|
|
20
|
-
Extract mode reads code-evidence to propose modules; the engineer confirms or revises. The orphan-module challenge catches modules that have grown beyond their persona-named purpose.
|
|
21
|
-
</commentary>
|
|
22
|
-
</example>
|
|
3
|
+
description: Use to produce or refresh `hstack/context/app-architecture.md` — module map, agent orchestration, deterministic-vs-LLM split, state ownership, surface boundaries. Greenfield Phase 3, the brownfield app-architecture step, or a standalone section refresh.
|
|
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
|
|
@@ -99,11 +80,3 @@ tools:
|
|
|
99
80
|
|
|
100
81
|
- **Subagent unreachable.** Persist session state; retry later.
|
|
101
82
|
- **Terminal-state side-effect commit fails partway** (e.g., one stub fails validator). The atom rolls back the in-progress write and halts with the validator error; the engineer fixes or routes through `/hstack:configure`. The artifact stays at `current` only when ALL three side effects land successfully.
|
|
102
|
-
|
|
103
|
-
## Anti-patterns
|
|
104
|
-
|
|
105
|
-
- Never name frameworks, ORMs, hosting providers, or specific runtimes in the artifact body or frontmatter. Stack-agnostic is load-bearing for portability across Phase 4 stack decisions.
|
|
106
|
-
- Never write authored content into module-spec stubs. Headers + `status: draft` + body note only.
|
|
107
|
-
- Never let Section 3's per-step declaration collapse to "the AI handles it end-to-end." Each step is named with mechanism + measurable-property rationale.
|
|
108
|
-
- Never bypass the end-of-atom coherence check on section-targeted re-entry.
|
|
109
|
-
- Never write surfaces into `hstack/config.yaml` outside the terminal-state atomic commit.
|
|
@@ -1,25 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: hstack-branch
|
|
3
|
-
description:
|
|
4
|
-
Use this skill when the engineer needs to check out or create the conventional `change/<change-id>` branch for a specific change-spec — typically because they realized mid-flow that they're on the wrong branch, or because they declined the branch offer at `/hstack:change-new` and want to switch later. One-shot, single-purpose, no subagent invoked. Examples:
|
|
5
|
-
|
|
6
|
-
<example>
|
|
7
|
-
Context: The engineer scaffolded the billing-overage change earlier, declined the branch offer at the time, and has since drafted the spec and ui-brief on main. Now they want to switch before implementing.
|
|
8
|
-
user: "/hstack:branch 2026-05-billing-overage-warning"
|
|
9
|
-
assistant: "I'll check whether `change/2026-05-billing-overage-warning` already exists. If yes, check out. If no, create from the current branch and check out. Any uncommitted work is preserved."
|
|
10
|
-
<commentary>
|
|
11
|
-
Idempotent: existing branch → checkout; missing branch → create-and-checkout. The Skill never force-deletes, never resets, never loses local work. If there are uncommitted changes that conflict with the target branch, the engineer is warned before the switch.
|
|
12
|
-
</commentary>
|
|
13
|
-
</example>
|
|
14
|
-
|
|
15
|
-
<example>
|
|
16
|
-
Context: The engineer wants the branch for whatever the most recently scaffolded change is and doesn't want to type the id.
|
|
17
|
-
user: "/hstack:branch"
|
|
18
|
-
assistant: "No id given. I'll detect the most recently scaffolded in-flight change-spec from hstack/specs/changes/, propose its expected branch name, and ask for confirmation before checking out."
|
|
19
|
-
<commentary>
|
|
20
|
-
No-arg mode defaults to the latest in-flight change for convenience. The Skill confirms before acting — the default is a guess, not a command.
|
|
21
|
-
</commentary>
|
|
22
|
-
</example>
|
|
3
|
+
description: Use to check out or create the conventional `change/<change-id>` branch for a change-spec — when the branch offer at change-new was declined, or you are on the wrong branch. No argument defaults to the latest in-flight change.
|
|
23
4
|
tools:
|
|
24
5
|
- Bash
|
|
25
6
|
- Read
|
|
@@ -68,7 +49,8 @@ Before any work:
|
|
|
68
49
|
|
|
69
50
|
## Outputs
|
|
70
51
|
|
|
71
|
-
- A git branch checkout (existing) or create-and-checkout (new). No artifact writes
|
|
52
|
+
- A git branch checkout (existing) or create-and-checkout (new). No artifact writes, no commits, and no push — pushing is hard to reverse and stays the engineer's explicit call.
|
|
53
|
+
- No branch deletion. Cleaning up obsolete `change/*` branches is post-ship hygiene, outside this Skill's domain.
|
|
72
54
|
|
|
73
55
|
## Auto-commit triggers
|
|
74
56
|
|
|
@@ -84,7 +66,7 @@ None. Branch operations do not create commits.
|
|
|
84
66
|
Beyond the kernel's general stop conditions:
|
|
85
67
|
|
|
86
68
|
- The named `<change-id>` does not correspond to an existing change-spec.
|
|
87
|
-
- The working tree has uncommitted changes that would be lost or conflict on switch. Halt and ask: "Uncommitted changes detected — stash, commit, or discard before switching?" (recommend `/hstack:commit` for the commit path; never auto-stash
|
|
69
|
+
- The working tree has uncommitted changes that would be lost or conflict on switch. Halt and ask: "Uncommitted changes detected — stash, commit, or discard before switching?" (recommend `/hstack:commit` for the commit path; never auto-stash, and never discard via `git checkout -- <files>` or any other path-discarding form — stash policy is the engineer's call).
|
|
88
70
|
- The engineer requested a `<base-branch>` that does not exist.
|
|
89
71
|
- The current branch is already the target branch — exit cleanly with the no-op message.
|
|
90
72
|
|
|
@@ -92,12 +74,3 @@ Beyond the kernel's general stop conditions:
|
|
|
92
74
|
|
|
93
75
|
- **`git checkout` fails due to conflicting local changes.** Surface the git error; do not retry. The engineer resolves manually.
|
|
94
76
|
- **Branch name collision with an unrelated existing branch.** If `change/<change-id>` exists but points at unrelated history (someone created it manually for another purpose), warn the engineer; do not silently overwrite. Engineer renames the unrelated branch or uses `--from` to specify their intent.
|
|
95
|
-
|
|
96
|
-
## Anti-patterns
|
|
97
|
-
|
|
98
|
-
- Never use `git checkout -B` (force-create). Use `git checkout -b` (create or fail) and let the engineer resolve collisions.
|
|
99
|
-
- Never auto-stash. Stash policy is the engineer's call.
|
|
100
|
-
- Never `git checkout -- <files>` or any path-discarding form.
|
|
101
|
-
- Never force-delete a branch. Cleanup of obsolete `change/*` branches is post-ship hygiene, not this Skill's domain.
|
|
102
|
-
- Never push the new branch automatically. Push is hard-to-reverse; the engineer pushes when ready.
|
|
103
|
-
- Never branch from anywhere other than the configured default (typically `main`) unless `--from` is explicit. The kernel's branching convention starts every change from `main`.
|
|
@@ -1,25 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: hstack-brownfield-init
|
|
3
|
-
description:
|
|
4
|
-
Use this skill when an engineer is adopting hstack on an **existing repository** (one with source code, documentation, or some product context already in place) and needs to produce `hstack/config.yaml` and populate every required document under `hstack/context/`. For empty repositories (no source yet), use `/hstack:greenfield-init` instead — that orchestrator composes the discovery atoms in elicit mode and ends with `/hstack:scaffold`. Until brownfield-init completes, no other hstack Skill works; every workflow Skill checks for init completion at session start and halts otherwise. Init is structured as discrete mini-sessions of ten-to-fifteen minutes each rather than one long block, so that an interruption costs at most one in-flight field. Mini-sessions for data and app architecture **delegate to the standalone atoms** (`/hstack:data-architecture`, `/hstack:app-architecture`), which can also be re-run later via `/hstack:configure` for enrichment when `/hstack:help` flags a layer as missing. Examples:
|
|
5
|
-
|
|
6
|
-
<example>
|
|
7
|
-
Context: A six-month-old codebase has thin docs and no hstack/. The engineer wants to adopt hstack against the existing source.
|
|
8
|
-
user: "Start /hstack:brownfield-init on this repo."
|
|
9
|
-
assistant: "I'll read CLAUDE.md, README, package.json, and the source tree to seed proposals. Then mini-session 0 (config), product context via product-manager (vision, glossary, mvp-scope, personas) reading existing docs in extract+confirm mode. For data-architecture and app-architecture I'll delegate to the standalone atoms running in extract mode against the live schema and src/ tree."
|
|
10
|
-
<commentary>
|
|
11
|
-
Brownfield init's distinct mode is extract+confirm against existing sources. Where source docs are thin, the engineer can opt into running /hstack:product-discovery as a follow-up enrichment step after init completes.
|
|
12
|
-
</commentary>
|
|
13
|
-
</example>
|
|
14
|
-
|
|
15
|
-
<example>
|
|
16
|
-
Context: Init was started two days ago, three documents were committed, and a session crash dropped the fourth. The engineer wants to resume rather than restart.
|
|
17
|
-
user: "Resume /hstack:brownfield-init — vision, glossary, and mvp-scope are already done."
|
|
18
|
-
assistant: "I'll read hstack/.session-state/<session-id>.yaml, confirm which documents are at status `current`, and resume with the next missing one — personas, based on what I see on disk."
|
|
19
|
-
<commentary>
|
|
20
|
-
Idempotency is load-bearing here: the Skill reads disk state, recognizes which documents are already terminal, and continues at the next empty mini-session boundary rather than re-running completed interviews.
|
|
21
|
-
</commentary>
|
|
22
|
-
</example>
|
|
3
|
+
description: Use to adopt hstack on an existing repository that already has source code or product docs, producing `hstack/config.yaml` and the `hstack/context/` layer by extracting from what is there. Empty repositories use `/hstack:greenfield-init` instead.
|
|
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 run after every confirmed field write"
|
|
32
13
|
- "{{TODO-SCRIPT: hstack/scripts/init-detect-mcps.sh — probes the consuming repo's Claude Code config for available MCPs and writes hstack/context/mcp-status.md}}"
|
|
33
14
|
---
|
|
34
15
|
|
|
@@ -50,8 +31,8 @@ Invoke when the consuming repo has no `hstack/config.yaml`, or when `hstack/conf
|
|
|
50
31
|
Before any work:
|
|
51
32
|
|
|
52
33
|
- Verify `hstack/` directory exists at the repo root. If not, halt and ask the engineer to confirm they are in the right directory.
|
|
53
|
-
- Read `hstack/
|
|
54
|
-
- **Load the consuming-repo context layer.** Read every artifact in the consuming repo (the working directory, NOT `hstack/`) that hints at its product, stack, or design system: `CLAUDE.md`, `README.md`, `package.json`, `docs/` if present, `.claude/agents/` and `.claude/skills/` for sibling tooling. This is the product being configured. Every interview prompt below frames against THIS context, not against `hstack/
|
|
34
|
+
- Read `hstack/KERNEL.md` (kernel) and `hstack/templates/` — both must be present. If either is missing, halt and ask the engineer to install or restore the hstack source. **The kernel describes the framework, not the consuming repo's product.** Treat it as behavioral rules, never as content to be configured.
|
|
35
|
+
- **Load the consuming-repo context layer.** Read every artifact in the consuming repo (the working directory, NOT `hstack/`) that hints at its product, stack, or design system: `CLAUDE.md`, `README.md`, `package.json`, `docs/` if present, `.claude/agents/` and `.claude/skills/` for sibling tooling. This is the product being configured. Every interview prompt below frames against THIS context, not against `hstack/KERNEL.md`.
|
|
55
36
|
- Probe Claude Code's MCP configuration for the consuming repo and write a draft `hstack/context/mcp-status.md` listing which MCPs are wired (Notion, Linear, GitHub, Figma, Supabase) and which are absent. Run `{{TODO-SCRIPT: hstack/scripts/init-detect-mcps.sh}}` for this; if absent, the Skill produces the file by interviewing the engineer instead.
|
|
56
37
|
- If `hstack/.session-state/` contains a prior init session-state file, read it and confirm with the engineer that resumption is the intent.
|
|
57
38
|
|
|
@@ -59,7 +40,7 @@ If the engineer signals "start fresh, abandon the prior partial init," archive t
|
|
|
59
40
|
|
|
60
41
|
## Orchestration steps
|
|
61
42
|
|
|
62
|
-
Init is split into discrete mini-sessions, each commitable independently. The order is fixed because later documents reference earlier ones.
|
|
43
|
+
Init is split into discrete mini-sessions, each commitable independently — that structure IS the resumability contract, so it is never collapsed into one long block. The order is fixed because later documents reference earlier ones.
|
|
63
44
|
|
|
64
45
|
1. **Mini-session 0 — config skeleton.** Every prompt in this mini-session is about THE CONSUMING REPO (not about hstack itself). Interview the engineer for:
|
|
65
46
|
- **Story store** for this repo's user stories — Notion DB, Linear, GitHub Issues, or `hstack/stories/`.
|
|
@@ -76,11 +57,11 @@ Init is split into discrete mini-sessions, each commitable independently. The or
|
|
|
76
57
|
|
|
77
58
|
Write `hstack/config.yaml` with `schemaVersion: 1`. The `init-status` field starts at `minimal-complete` after this mini-session ends, advancing to `complete` only when every required context document is at `current`. Commit.
|
|
78
59
|
|
|
79
|
-
2. **Mini-session 1 — vision.** Invoke `product-manager` via the Task tool with `subagent_type: product-manager` and context = [`hstack/
|
|
60
|
+
2. **Mini-session 1 — vision.** Invoke `product-manager` via the Task tool with `subagent_type: product-manager` and context = [`hstack/KERNEL.md`, `hstack/templates/vision.md`, any pointer the engineer offers to an existing vision source]. The subagent walks the five vision sections, confirms each, writes `hstack/context/vision.md` at `status: drafted` and advances to `current` at the end. Prompt cleanup of the source per the subagent's contract. Commit.
|
|
80
61
|
|
|
81
62
|
3. **Mini-session 2 — glossary.** Same orchestration with `hstack/templates/glossary.md`. Output: `hstack/context/glossary.md` at `current`. Commit.
|
|
82
63
|
|
|
83
|
-
4. **Mini-session 3 —
|
|
64
|
+
4. **Mini-session 3 — roadmap.** Same orchestration with `hstack/templates/roadmap.md`. Output: `hstack/context/roadmap.md` at `current`. When a legacy `mvp-scope.md` exists, `product-manager` offers the extract+confirm conversion (In MVP → Now, v2 → Next, Deferred → Later or Not on the path) and prompts deletion of the legacy file after the roadmap lands. Commit.
|
|
84
65
|
|
|
85
66
|
5. **Mini-session 4 — personas.** For each persona the engineer names, the `product-manager` subagent runs a persona sub-interview against `hstack/templates/persona.md`, including the challenge prompt "What is this persona explicitly not?" Personas are written to the configured store (typically `hstack/context/personas/<slug>.md`). Commit after each persona individually so partial completion is durable.
|
|
86
67
|
|
|
@@ -90,13 +71,13 @@ Init is split into discrete mini-sessions, each commitable independently. The or
|
|
|
90
71
|
|
|
91
72
|
8. **Mini-session 5b — app-architecture (delegated).** The Skill invokes `/hstack:app-architecture --mode extract`. The `app-architect` agent scans `src/`, `app/`, or `lib/` via Glob, reads each module's exports and dependencies, and proposes the Module Map plus the four downstream sections (Agent Orchestration Model, Deterministic-vs-LLM Split, State-Ownership Map, Surface Boundaries). At terminal state the atom auto-scaffolds `hstack/specs/<module>/spec.md` stubs at `status: draft`; subsequent `/hstack:module-spec <module>` invocations reverse-engineer the stubs to `current`. Output: `hstack/context/app-architecture.md` at `current` plus one stub per module. Commit.
|
|
92
73
|
|
|
93
|
-
7. **Mini-session 6 — infrastructure.** Invoke `spec-author` via the Task tool with `subagent_type: spec-author` and context = [`hstack/
|
|
74
|
+
7. **Mini-session 6 — infrastructure.** Invoke `spec-author` via the Task tool with `subagent_type: spec-author` and context = [`hstack/KERNEL.md`, `hstack/templates/infrastructure.md`, `hstack/context/tech-stack.md`, `hstack/context/ci-cd.md`, `hstack/context/data-architecture.md`, any existing infra source the engineer points to — cloud console screenshots, Terraform / Pulumi / CDK files, GitHub Actions YAML, Dockerfile, supabase config]. The subagent walks every H2 section of the template via interview, biasing toward grounded truth-gathering rather than aspirational design. **For engineers unfamiliar with infrastructure concepts, the subagent is expected to explain each section's intent before asking, and to spawn the `researcher` subagent for unfamiliar terms (e.g., "what is point-in-time recovery?", "what does a CDN actually do?") rather than asking the engineer to guess.** This mini-session is interview-heavy and often the longest of init for pre-prod teams. Output: `hstack/context/infrastructure.md` at `current`. The Blast-Radius Matrix must have at least one row before status advances to `current` (INF-03); the Unknowns section must be present even when empty (INF-02). Honest "we don't have this yet" answers are explicitly preferred over fabricated content; the resulting gaps land as tech-debt items in the Known Gaps section. Commit.
|
|
94
75
|
|
|
95
76
|
8. **Mini-session 7 — threat-model, hardening-checklist, incident-runbook.** The security-context triplet. By this point `infrastructure.md` is at `current`, so the security-reviewer has the operational ground truth it needs to model threats accurately. Author orchestration is per-document:
|
|
96
77
|
- `threat-model.md` and `hardening-checklist.md` are authored by `security-reviewer` via the Task tool with `subagent_type: security-reviewer`. The same subagent that scores per-change security-reviews at change time also authors the slow-changing policy these reviews score against — different cadence, same security framing (bias toward CONCERNS, challenge-driven prompts). Generalist subagents (spec-author, product-manager) are NOT offered here; the security-specific framing is load-bearing.
|
|
97
78
|
- `incident-runbook.md` is authored by `spec-author` from a founder-style interview — kill switches, revocation flows, comms templates are operational content, not threat-modeling.
|
|
98
79
|
|
|
99
|
-
`incident-runbook.md` is written with `git-ignored: true` in its frontmatter; the Skill verifies an entry exists in the repo's `.gitignore` before proceeding (creating the entry with confirmation if absent). The Skill warns the engineer at the start of this mini-session that incident-runbook content will not be committed to git and will need an out-of-band sync target named in `hstack/config.yaml`. Commit each context file as it lands.
|
|
80
|
+
`incident-runbook.md` is written with `git-ignored: true` in its frontmatter; the Skill verifies an entry exists in the repo's `.gitignore` before proceeding (creating the entry with confirmation if absent). The Skill warns the engineer at the start of this mini-session that incident-runbook content will not be committed to git and will need an out-of-band sync target named in `hstack/config.yaml`. Its contents are sensitive: confirm them in summary form rather than pasting them verbatim into the conversation transcript. Commit each context file as it lands.
|
|
100
81
|
|
|
101
82
|
The Skill maintains `hstack/.session-state/<session-id>.yaml` continuously, updating after every confirmed field write. The state file captures which mini-session is in progress, which fields within it are confirmed, and what the next prompt should be.
|
|
102
83
|
|
|
@@ -105,7 +86,7 @@ The Skill maintains `hstack/.session-state/<session-id>.yaml` continuously, upda
|
|
|
105
86
|
- `hstack/config.yaml` (status field on the config carries `init-status: minimal-complete` once mini-session 0 ends, advancing to `complete` only when every required context document is at `current`).
|
|
106
87
|
- `hstack/context/vision.md` at `current`.
|
|
107
88
|
- `hstack/context/glossary.md` at `current`.
|
|
108
|
-
- `hstack/context/
|
|
89
|
+
- `hstack/context/roadmap.md` at `current`.
|
|
109
90
|
- `hstack/context/personas/<slug>.md` per persona, or sync stubs when the store is Notion / Linear.
|
|
110
91
|
- `hstack/context/tech-stack.md`, `ci-cd.md`, `infrastructure.md`, `threat-model.md`, `hardening-checklist.md` — all at `current`.
|
|
111
92
|
- `hstack/context/data-architecture.md` at `current` (produced by the delegated `/hstack:data-architecture` atom, five-section structure).
|
|
@@ -148,11 +129,3 @@ Beyond the kernel's general stop conditions, this Skill halts when:
|
|
|
148
129
|
- **Subagent unreachable mid-mini-session.** Persist current state; instruct the engineer to retry in a moment.
|
|
149
130
|
- **Notion/Linear/GitHub MCP unreachable but configured as the story store.** Halt and ask the engineer to wire it; do not silently fall back to `hstack/stories/`.
|
|
150
131
|
- **`.gitignore` write refused.** The Skill cannot proceed past mini-session 7's incident-runbook step without it. Halt and surface the issue.
|
|
151
|
-
|
|
152
|
-
## Anti-patterns
|
|
153
|
-
|
|
154
|
-
- Never write `hstack/config.yaml` silently from inferred defaults. Every field passes through the engineer's confirmation gate via the `product-manager` subagent.
|
|
155
|
-
- Never collapse the eight mini-sessions into one long block. The mini-session structure is the resumability contract.
|
|
156
|
-
- Never advance `init-status: complete` while any required context document is below `current`.
|
|
157
|
-
- Never write `incident-runbook.md` content to the conversation transcript more than necessary; the file's contents are sensitive and should be confirmed in summary form rather than pasted verbatim.
|
|
158
|
-
- Never re-interview a completed mini-session on resume. Read the disk; trust the prior commit.
|
|
@@ -1,25 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: hstack-change-new
|
|
3
|
-
description:
|
|
4
|
-
Use this skill when an engineer wants to start a new change and needs the `hstack/specs/changes/<id>/` folder scaffolded with templates pre-populated, before any spec-author or planner work begins. The Skill validates that the affected module has a current module-spec, derives the change id from the area and slug, scaffolds the folder, and seeds `spec.md` with the canonical template. Examples:
|
|
5
|
-
|
|
6
|
-
<example>
|
|
7
|
-
Context: The engineer is about to start work on the billing overage warning feature and needs the change folder before drafting the spec.
|
|
8
|
-
user: "/hstack:change-new billing overage-warning"
|
|
9
|
-
assistant: "I'll scaffold hstack/specs/changes/2026-05-billing-overage-warning/ with spec.md pre-populated from the template. spec-author runs separately when you're ready to fill the fields."
|
|
10
|
-
<commentary>
|
|
11
|
-
This Skill does not author content; it produces the empty folder shape so spec-author has a target to write into. Scaffold-only separation keeps the Skill cheap to re-run and idempotent on partial state.
|
|
12
|
-
</commentary>
|
|
13
|
-
</example>
|
|
14
|
-
|
|
15
|
-
<example>
|
|
16
|
-
Context: The engineer tries to scaffold a change in an area that has no module-spec yet.
|
|
17
|
-
user: "/hstack:change-new playbook-runner inline-mode"
|
|
18
|
-
assistant: "I'll halt — there's no hstack/specs/playbook-runner/spec.md at status current. Run /hstack:module-spec playbook-runner first."
|
|
19
|
-
<commentary>
|
|
20
|
-
Scaffolding refuses when the module's baseline doesn't exist. This is a deliberate gate: a change-spec whose `area` points at a nonexistent module-spec fails SP-01 anyway, so the Skill halts before any folder is created rather than producing dead scaffolding.
|
|
21
|
-
</commentary>
|
|
22
|
-
</example>
|
|
3
|
+
description: Use to scaffold the `hstack/specs/changes/<id>/` folder and seed `spec.md` from the template at the start of a new change. Scaffolds only — `spec-author` fills the fields, and `/hstack:change-plan` sequences phases much later.
|
|
23
4
|
tools:
|
|
24
5
|
- Read
|
|
25
6
|
- Write
|
|
@@ -27,7 +8,7 @@ tools:
|
|
|
27
8
|
- Grep
|
|
28
9
|
- Glob
|
|
29
10
|
- Bash
|
|
30
|
-
- "
|
|
11
|
+
- "node hstack/scripts/validate-spec.mjs — validates the seeded change-spec frontmatter"
|
|
31
12
|
---
|
|
32
13
|
|
|
33
14
|
## Purpose
|
|
@@ -64,7 +45,7 @@ Before any work:
|
|
|
64
45
|
|
|
65
46
|
4. **Forward-reference reconciliation for `enables` chains.** Grep every existing `hstack/specs/changes/*/spec.md` for the new `<id>` in `enables:` arrays. For each match: the matched (upstream) spec already declares this new (downstream) spec as a Category-B enabler. Per SP-14, write the reciprocal `enabled-by: [<upstream-id>, ...]` array on the newly-seeded spec in the same scaffold commit (this is the atomic-pair guarantee — both halves land together). When no match exists, leave `enabled-by: []`. Read-only on the upstream spec — its `enables` array was already written when the upstream was authored; no edit there. This is a mechanical operation per the kernel's Mechanical-operations section; no subagent is invoked. Surface the reconciliation to the engineer: "Detected upstream spec(s) declaring `enables: [<id>]` — populating `enabled-by` reciprocally."
|
|
66
47
|
|
|
67
|
-
5. **Validate.** Run `
|
|
48
|
+
5. **Validate.** Run `node hstack/scripts/validate-spec.mjs <path>` against the seeded file. Validation at `status: draft` is permissive — empty arrays and empty prose are allowed at draft — but the universal floor (FM-01) must pass.
|
|
68
49
|
|
|
69
50
|
6. **Offer branch creation.** Run `git branch --show-current`. If the current branch is `main` (or the configured default), ask the engineer: "You're on `<current-branch>`. Convention is one branch per change-spec — create `change/<id>` from here and check out before the scaffold commits? [Y/n/type-different-name]". Default Yes. On confirmation, run `git checkout -b change/<id>` BEFORE step 7 so the scaffold commit lands on the correct branch from the start. If the engineer declines or names a different branch, honor the choice and continue on the chosen branch. If the current branch is anything other than the configured default (i.e., already on a feature branch), do nothing — the engineer has a deliberate branching strategy and the Skill respects it.
|
|
70
51
|
|
|
@@ -77,7 +58,7 @@ The Skill does not invoke any subagent. Scaffolding is mechanical and the engine
|
|
|
77
58
|
## Outputs
|
|
78
59
|
|
|
79
60
|
- New directory `hstack/specs/changes/<id>/`.
|
|
80
|
-
- New file `hstack/specs/changes/<id>/spec.md` at `status: draft`, with frontmatter populated to the floor and prose sections empty.
|
|
61
|
+
- New file `hstack/specs/changes/<id>/spec.md` at `status: draft`, with frontmatter populated to the floor and prose sections empty. Every subsequent status transition is owned by the authoring subagents, never by this Skill.
|
|
81
62
|
|
|
82
63
|
## Auto-commit triggers
|
|
83
64
|
|
|
@@ -101,11 +82,3 @@ Beyond the kernel's general stop conditions:
|
|
|
101
82
|
|
|
102
83
|
- **Validator fails on the seeded spec.** The template itself is broken — halt and surface as a hstack installation issue.
|
|
103
84
|
- **`git config user.name` returns empty and `hstack/config.yaml` has no default owner.** Halt and ask the engineer for their owner handle.
|
|
104
|
-
|
|
105
|
-
## Anti-patterns
|
|
106
|
-
|
|
107
|
-
- Never write prose content into the seeded `spec.md` beyond the template's existing prompts. The Skill scaffolds; `spec-author` authors.
|
|
108
|
-
- Never derive the id from anything other than the current month, the area, and the slug. Hand-rolled ids break the kebab-case + chronological-prefix convention that other Skills depend on.
|
|
109
|
-
- Never scaffold under an area whose module-spec is absent. The precondition is hard.
|
|
110
|
-
- Never modify an existing change folder. Reruns are no-ops or refusals, never overwrites.
|
|
111
|
-
- Never advance `status` past `draft` from this Skill. Subsequent transitions are owned by the authoring subagents.
|
|
@@ -1,25 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: hstack-change-plan
|
|
3
|
-
description:
|
|
4
|
-
Use this skill when a change-spec is at `status: ready-to-plan` (with its conditional upstream artifacts also at terminal status) and needs `plan.md` drafted as atomic phases. The Skill orchestrates the `planner` subagent. Examples:
|
|
5
|
-
|
|
6
|
-
<example>
|
|
7
|
-
Context: The billing-overage change-spec is at ready-to-plan, the ui-brief is drafted, the figma-handoff is ready, and the engineer is about to start implementation.
|
|
8
|
-
user: "/hstack:change-plan 2026-05-billing-overage-warning"
|
|
9
|
-
assistant: "I'll invoke planner with the change-spec, ui-brief, figma-handoff. Atomic phases with per-phase verifier expectations and a rollback strategy."
|
|
10
|
-
<commentary>
|
|
11
|
-
The planner is the only authoring path for plan.md. The Skill enforces that upstream conditional artifacts (ui-brief, figma-handoff for ui; data-review for db) are at terminal status before invoking — otherwise the planner halts.
|
|
12
|
-
</commentary>
|
|
13
|
-
</example>
|
|
14
|
-
|
|
15
|
-
<example>
|
|
16
|
-
Context: A change touching ui and db is at ready-to-plan but data-review has not been run yet.
|
|
17
|
-
user: "/hstack:change-plan 2026-06-knowledge-citations"
|
|
18
|
-
assistant: "I'll halt — surfaces includes db and data-review.md is missing. Run /hstack:data-review first."
|
|
19
|
-
<commentary>
|
|
20
|
-
The conditional upstream gate is hard. Skipping the data-review and producing a plan against an unscored data layer produces a plan that the implementer would refuse to act on anyway.
|
|
21
|
-
</commentary>
|
|
22
|
-
</example>
|
|
3
|
+
description: Use when a change-spec is at `ready-to-plan` with `test-plan.md` and every conditional upstream artifact terminal, and needs `plan.md` decomposed into atomic phases. Distinct from `/hstack:change-new`, which only scaffolds the folder.
|
|
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 — validates plan frontmatter and PL-01..PL-05"
|
|
32
13
|
---
|
|
33
14
|
|
|
34
15
|
## Purpose
|
|
@@ -39,6 +20,12 @@ tools:
|
|
|
39
20
|
|
|
40
21
|
Invoke when the change-spec reaches `status: ready-to-plan`, `test-plan.md` is at terminal status, and any conditional upstream artifacts required by the spec's `surfaces` are at terminal status. Re-invoke when the change-spec, the test-plan, or any conditional upstream artifact changes shape in ways that invalidate the existing plan.
|
|
41
22
|
|
|
23
|
+
When not to invoke — the conditional upstream gate is hard, and each miss has one remedy:
|
|
24
|
+
|
|
25
|
+
- `surfaces` includes `db` and `data-review.md` is missing or non-terminal → halt; run `/hstack:data-review <change-id>` first. Planning against an unscored data layer produces a plan the implementer would refuse to act on anyway.
|
|
26
|
+
- `surfaces` includes `ui` and `ui-brief.md` is not at `drafted` or `figma-handoff.md` is not at `ready` → halt; run `/hstack:ui-brief <change-id>` and get the handoff from the cofounder first.
|
|
27
|
+
- `test-plan.md` is missing or non-terminal → halt; run `/hstack:test-plan <change-id>` first.
|
|
28
|
+
|
|
42
29
|
## Inputs
|
|
43
30
|
|
|
44
31
|
- `<change-id>` (required, positional): the change-spec id.
|
|
@@ -54,12 +41,13 @@ Before any work:
|
|
|
54
41
|
- When `surfaces` includes `db`: verify `data-review.md` at `status: passed` or `concerns-acknowledged`. Halt otherwise.
|
|
55
42
|
- Verify the relevant module-spec at `status: current`.
|
|
56
43
|
- Read `hstack/context/tech-stack.md` (loaded by `planner` for pinned runtime constraints).
|
|
44
|
+
- Read `hstack/context/roadmap.md` for the plan's Roadmap Alignment line. Advisory, never a precondition: missing or stale (`status` ≠ `current`, or `updated` > 90 days) yields `n/a — roadmap stale/missing (<detail>)` in that line — no halt.
|
|
57
45
|
|
|
58
46
|
The security-review is not a planner precondition — security-review and the plan can be produced in either order, since neither depends on the other's content (the implementer reads both at session start). The test-plan, by contrast, IS a planner precondition: the planner's phase ordering and per-phase Test Strategy entries reference test-plan sections, so the test-plan must already be terminal.
|
|
59
47
|
|
|
60
48
|
## Orchestration steps
|
|
61
49
|
|
|
62
|
-
1. **Invoke `planner`.** Use the Task tool with `subagent_type: planner` and context = [kernel, `hstack/templates/plan.md`, change-spec, test-plan, ui-brief and figma-handoff if applicable, data-review if applicable, module-spec, tech-stack]. The subagent walks the
|
|
50
|
+
1. **Invoke `planner`.** Use the Task tool with `subagent_type: planner` and context = [kernel, `hstack/templates/plan.md`, change-spec, test-plan, ui-brief and figma-handoff if applicable, data-review if applicable, module-spec, tech-stack, roadmap when present]. The subagent walks the five plan sections — Roadmap Alignment (one honest line, per the planner contract: information for the human, never a gate), Phase Overview, Per-Phase Detail, Cross-Phase Risks, Rollback. Per-phase Test Strategy entries point at test-plan sections rather than re-stating tests inline.
|
|
63
51
|
|
|
64
52
|
2. **Phase decomposition.** Per the `planner` contract, typical plans hold 4–8 phases; > 12 phases requires an `oversized-plan-justification` frontmatter field. Each phase has a `step-id`, one-line summary, `depends-on` list, Files Touched (subset of `change-spec.in-scope`), Test Strategy, Risk sentence, and Verifier Expectations.
|
|
65
53
|
|
|
@@ -71,7 +59,7 @@ The security-review is not a planner precondition — security-review and the pl
|
|
|
71
59
|
|
|
72
60
|
6. **Leave `steps-completed: []`.** Per architecture amendment A3 and the planner's contract, `steps-completed` is owned by the implementer; the planner never populates it.
|
|
73
61
|
|
|
74
|
-
7. **Validate.** Run `
|
|
62
|
+
7. **Validate.** Run `node hstack/scripts/validate-spec.mjs <path>` — PL-01 (parent-change matches), PL-02 (phase count), PL-03 (steps-completed entries match plan phase ids), PL-04 (Files Touched is subset of in-scope), PL-05 (status advance gating).
|
|
75
63
|
|
|
76
64
|
8. **Transition.** When the validator passes, `planner` advances status from `draft` to `ready`. Auto-commit fires.
|
|
77
65
|
|
|
@@ -84,6 +72,16 @@ The security-review is not a planner precondition — security-review and the pl
|
|
|
84
72
|
- Status transition to `draft` after the Phase Overview table lands.
|
|
85
73
|
- Status transition to `ready` at end of authoring. Commit message: `plan(<change-id>): ready`.
|
|
86
74
|
|
|
75
|
+
## Session boundary
|
|
76
|
+
|
|
77
|
+
`change-plan` is a natural session cut: the auto-commit above left `plan.md` on disk, so the conversation holds nothing the next phase needs. The cut-notice format, the kickoff-prompt template and the context-block rules are in `KERNEL.md` § Session boundaries; this Skill's two variables are:
|
|
78
|
+
|
|
79
|
+
```
|
|
80
|
+
HSTACK-CUT: change-plan complete — cut recommended before implement.
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
and the next command, `/hstack:implement <first-phase-id> <change-id>`.
|
|
84
|
+
|
|
87
85
|
## Idempotency contract
|
|
88
86
|
|
|
89
87
|
- Re-running on an existing `ready` plan without spec changes: the subagent reads the existing plan as the proposal layer; identical re-confirmation is a no-op.
|
|
@@ -108,12 +106,3 @@ Beyond the kernel's general stop conditions:
|
|
|
108
106
|
- **`ui-brief.md` exists at `draft` rather than `drafted`.** Halt; the brief is incomplete.
|
|
109
107
|
- **Validator fails PL-04.** The planner halts immediately at the offending phase; the engineer either reshapes the phase or amends in-scope.
|
|
110
108
|
- **`planner` halts on cross-phase risk surfacing an invariant gap.** Halt; the engineer amends the change-spec via `spec-author`, then re-runs this Skill.
|
|
111
|
-
|
|
112
|
-
## Anti-patterns
|
|
113
|
-
|
|
114
|
-
- Never write code. Plans are prose plus YAML.
|
|
115
|
-
- Never silently accept a non-terminal upstream artifact.
|
|
116
|
-
- Never invent invariants or modify the change-spec's Invariants section — that is `spec-author`'s domain.
|
|
117
|
-
- Never write `steps-completed` values; the field belongs to the implementer.
|
|
118
|
-
- Never produce a multi-phase plan with empty Cross-Phase Risks without exercising the challenge prompt.
|
|
119
|
-
- Never write a rollback section with a plausible-sounding default the engineer did not endorse.
|
|
@@ -1,25 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: hstack-commit
|
|
3
|
-
description:
|
|
4
|
-
Use this skill when the engineer wants to commit work by hand using the same Commitizen format hstack subagents use for auto-commits — so the git log reads uniformly whether a phase landed through `/hstack:implement` or you fixed a typo manually. Pushed only on explicit confirmation. Examples:
|
|
5
|
-
|
|
6
|
-
<example>
|
|
7
|
-
Context: The engineer made a small cleanup edit between hstack workflow phases and wants to commit it without polluting the git history with a divergent message format.
|
|
8
|
-
user: "/hstack:commit"
|
|
9
|
-
assistant: "I'll read git status, walk you through which files to stage (specific paths over `-A`), show the diff, propose a Commitizen-format commit message, and commit on your confirmation. Push is a separate confirmation."
|
|
10
|
-
<commentary>
|
|
11
|
-
The Skill is for human-driven commits outside the hstack subagent flow. It's not used by subagents — they have their own auto-commit logic embedded in their session-start protocols. The format match is the value: same git log shape whether the commit came from an agent or a human.
|
|
12
|
-
</commentary>
|
|
13
|
-
</example>
|
|
14
|
-
|
|
15
|
-
<example>
|
|
16
|
-
Context: A pre-commit hook fails on the first attempt and the engineer is tempted to bypass.
|
|
17
|
-
user: "The hook is failing because of an unrelated lint error. Can we just --no-verify?"
|
|
18
|
-
assistant: "No — the kernel forbids hook bypass. I'll investigate the failing hook with you, fix the underlying issue, then re-attempt the commit cleanly."
|
|
19
|
-
<commentary>
|
|
20
|
-
Defense in depth on the kernel's forbidden-tools list: the Skill refuses --no-verify and other hook-bypass flags. Same rule the implementer subagent enforces. Hooks fail for a reason; investigating beats bypassing.
|
|
21
|
-
</commentary>
|
|
22
|
-
</example>
|
|
3
|
+
description: Use to commit hand-made edits in the same Commitizen format hstack subagents use for their auto-commits. For work outside a subagent flow only — subagents auto-commit at status transitions on their own.
|
|
23
4
|
tools:
|
|
24
5
|
- Bash
|
|
25
6
|
- Read
|
|
@@ -65,7 +46,7 @@ Before any work:
|
|
|
65
46
|
4. **Draft a Commitizen-format commit message.** Following the format codified for hstack:
|
|
66
47
|
- Format: `<type>(<scope>): <summary>`
|
|
67
48
|
- `<type>` is one of: `feat`, `fix`, `chore`, `docs`, `refactor`, `test`, `style`, `perf`, `ci`
|
|
68
|
-
- `<scope>` names the area
|
|
49
|
+
- `<scope>` names the area actually touched — never an invented or aspirational one. For commits inside hstack-governed code, prefer the change-id, the area, the Skill name, or the artifact type (e.g., `change-plan`, `billing`, `implement`, `data-review`). For non-hstack commits in the same repo, use the natural area (e.g., `auth`, `orchestrator`, `webhooks`). When the change spans several unrelated areas, no single honest scope exists — propose splitting into multiple commits.
|
|
69
50
|
- `<summary>` ≤ 72 characters, imperative present tense ("add" not "added"), no trailing period.
|
|
70
51
|
- Body (optional): the "why" rather than the "what". For commits inside hstack workflow, name the related change-id or artifact. For status transitions, name the transition explicitly.
|
|
71
52
|
- **Never add "Generated with Claude Code" or similar attribution.** The user's global rule.
|
|
@@ -73,9 +54,11 @@ Before any work:
|
|
|
73
54
|
|
|
74
55
|
5. **Confirm and commit.** Show the proposed commit message to the engineer. On confirmation, run `git commit -m "<subject>" -m "<body>"` (HEREDOC for multi-line bodies). Honor every git hook — `--no-verify`, `--no-gpg-sign`, and other bypass flags are forbidden.
|
|
75
56
|
|
|
76
|
-
6. **
|
|
57
|
+
6. **Kernel rules still apply.** Committing by hand does not relax the kernel's database-workflow or forbidden-tools rules. A `service_role` key, a `supabase db push` against a remote project, or any other kernel-forbidden artifact is forbidden on this path exactly as it is on the subagent path.
|
|
77
58
|
|
|
78
|
-
7. **
|
|
59
|
+
7. **Verify the commit landed.** Run `git log -1 --format='%h %s'` and surface the result.
|
|
60
|
+
|
|
61
|
+
8. **Push (only with explicit confirmation).** Push is hard-to-reverse and visible to others — never auto-push. If `--push` was provided, ask for confirmation in the conversation; if not provided, end without pushing. When pushing, use the current branch's tracked upstream (no `--force`, no force-with-lease without per-invocation authorization, no push to `main` if the current branch is `main` without explicit confirmation).
|
|
79
62
|
|
|
80
63
|
## Outputs
|
|
81
64
|
|
|
@@ -100,6 +83,7 @@ Beyond the kernel's general stop conditions:
|
|
|
100
83
|
- A pre-commit hook fails. Investigate and fix the underlying issue — do NOT bypass with `--no-verify`. If the fix requires out-of-scope edits (when committing inside an hstack-governed change), halt and surface as a scope-amendment situation.
|
|
101
84
|
- The proposed commit message exceeds 72 characters on the summary line. Re-draft.
|
|
102
85
|
- A destructive push operation is requested (`--force`, force-with-lease, push to `main`) without explicit per-invocation authorization in the current conversation. Halt and confirm.
|
|
86
|
+
- `git commit --amend` would rewrite a commit that has already been pushed. Halt and confirm per-invocation; amending published history is not a default.
|
|
103
87
|
- The engineer requested `--push` but the current branch has no upstream. Halt and ask which remote / branch to push to.
|
|
104
88
|
|
|
105
89
|
## Failure modes
|
|
@@ -108,15 +92,3 @@ Beyond the kernel's general stop conditions:
|
|
|
108
92
|
- **`gpg-sign` configured but signing key unavailable.** Surface the gpg error; do NOT bypass with `--no-gpg-sign`. Engineer fixes their gpg config and re-runs.
|
|
109
93
|
- **`git push` rejected (non-fast-forward).** Surface the rejection; recommend `git pull --rebase` then re-attempt; never propose `--force` without explicit authorization.
|
|
110
94
|
- **Empty commit attempted.** If `git add` left the index empty (e.g., every staged change was already committed), halt with the empty-commit message; do not use `--allow-empty` without engineer confirmation.
|
|
111
|
-
|
|
112
|
-
## Anti-patterns
|
|
113
|
-
|
|
114
|
-
- Never use `git add -A` silently. Default to staging by named path; sweep only with explicit engineer confirmation.
|
|
115
|
-
- Never use `--no-verify`, `--no-gpg-sign`, or any hook-bypass flag.
|
|
116
|
-
- Never use `git commit --amend` to modify a published (pushed) commit without explicit per-invocation authorization. The system prompt's safety rule applies.
|
|
117
|
-
- Never auto-push. Push is a separate, explicit, per-invocation decision.
|
|
118
|
-
- Never use `git push --force` or `--force-with-lease` without explicit per-invocation authorization in the current conversation.
|
|
119
|
-
- Never add "Generated with Claude Code" or any AI-attribution footer to the commit message. The user's global rule forbids it.
|
|
120
|
-
- Never invent a `<scope>` that doesn't reflect what was actually touched. If the change spans multiple unrelated areas, propose splitting into multiple commits.
|
|
121
|
-
- Never commit a file whose name matches the sensitive-pattern list without explicit engineer confirmation.
|
|
122
|
-
- Never bypass the kernel's database-workflow or forbidden-tools rules even when committing manually — `service_role` keys, `supabase db push` against remote, etc., are forbidden regardless of the commit path.
|
|
@@ -1,25 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: hstack-configure
|
|
3
|
-
description:
|
|
4
|
-
Use this skill when an engineer needs to update `hstack/config.yaml` after init has already completed, re-run the interview for a single product-context document, or migrate the schema-version when hstack itself ships a structural change. This is the editor counterpart to `hstack-init`; it never bootstraps from nothing and never advances the global `init-status` field. Examples:
|
|
5
|
-
|
|
6
|
-
<example>
|
|
7
|
-
Context: The team has decided to move their personas store from `hstack/context/personas/` to a Notion database now that the Notion MCP is wired up.
|
|
8
|
-
user: "Re-configure hstack to use the Notion personas store."
|
|
9
|
-
assistant: "I'll run /hstack:configure and walk the personas-store config field. Existing personas in hstack/context/personas/ stay on disk as sync stubs pointing at the new Notion records."
|
|
10
|
-
<commentary>
|
|
11
|
-
Configure is the right entry point because init has already produced a complete config; the change is scoped to one field and its downstream side effects. Re-running init would re-interview every product-context document, which is wasted work.
|
|
12
|
-
</commentary>
|
|
13
|
-
</example>
|
|
14
|
-
|
|
15
|
-
<example>
|
|
16
|
-
Context: An hstack point release introduces a new required frontmatter field on `change-spec.md` and bumps `schemaVersion` from 1 to 2.
|
|
17
|
-
user: "Run /hstack:configure --migrate."
|
|
18
|
-
assistant: "I'll detect the schema-version delta, walk through the field-level migration plan, and re-stamp every existing artifact's frontmatter under the new schema."
|
|
19
|
-
<commentary>
|
|
20
|
-
Migration is the one mode of configure that can touch many files at once. The Skill plans the migration first, presents the planned edits to the engineer, and executes only on confirmation — never silently rewrites artifact frontmatter.
|
|
21
|
-
</commentary>
|
|
22
|
-
</example>
|
|
3
|
+
description: Use to edit a `hstack/config.yaml` field after init has completed, re-run the interview for one product-context document, or migrate artifacts when an hstack release bumps the schema-version. Never bootstraps from nothing.
|
|
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 — validates frontmatter after every migration write"
|
|
32
13
|
- "{{TODO-SCRIPT: hstack/scripts/migrate-schema.ts — applies declarative migration steps between schema-version values}}"
|
|
33
14
|
---
|
|
34
15
|
|
|
@@ -42,7 +23,7 @@ Invoke when the engineer wants to change a config field after init has completed
|
|
|
42
23
|
|
|
43
24
|
## Inputs
|
|
44
25
|
|
|
45
|
-
- `--interview <doc-name>` (optional): re-run the conversational interview for one of `vision`, `glossary`, `
|
|
26
|
+
- `--interview <doc-name>` (optional): re-run the conversational interview for one of `vision`, `glossary`, `roadmap`, `personas`, `data-architecture`, `tech-stack`, `ci-cd`, `infrastructure`, `threat-model`, `hardening-checklist`, `incident-runbook`.
|
|
46
27
|
- `--migrate` (optional): detect the gap between `hstack/config.yaml`'s `schemaVersion` and the version declared by the current hstack release, and apply the declarative migration steps.
|
|
47
28
|
- No flag: open an interactive config editor that walks the engineer through `hstack/config.yaml` field by field, confirming or correcting each.
|
|
48
29
|
|
|
@@ -53,7 +34,7 @@ Invoke when the engineer wants to change a config field after init has completed
|
|
|
53
34
|
Before any work:
|
|
54
35
|
|
|
55
36
|
- Verify `hstack/config.yaml` exists and contains a valid `init-status: complete` value. If init has not completed, halt and surface the message to run `hstack-init` first.
|
|
56
|
-
- Read `hstack/
|
|
37
|
+
- Read `hstack/KERNEL.md` (kernel) and `hstack/templates/`.
|
|
57
38
|
- For `--interview <doc-name>`: verify the named document template exists under `hstack/templates/` and the corresponding instance exists under `hstack/context/`. Read the existing instance's current state to seed the interview.
|
|
58
39
|
- For `--migrate`: read the current `hstack/config.yaml schemaVersion` and the target version declared by the installed hstack release. If they match, halt with a "no migration needed" message.
|
|
59
40
|
|
|
@@ -68,8 +49,8 @@ Before any work:
|
|
|
68
49
|
### `--interview <doc-name>` mode
|
|
69
50
|
|
|
70
51
|
1. Read the existing `hstack/context/<doc-name>.md`.
|
|
71
|
-
2. Invoke the doc's canonical author via Task with `subagent_type` set per the routing table below. Context = [kernel, template, existing instance]. The subagent walks the document's fields, treating the existing values as the proposal layer and the engineer's responses as accept-or-correct. The routing must match the authoring agent used by `hstack-init` for the same document — same author at init time and at refresh time, different cadence:
|
|
72
|
-
- `vision`, `glossary`, `
|
|
52
|
+
2. Invoke the doc's canonical author via Task with `subagent_type` set per the routing table below. This Skill orchestrates; it never authors document content itself. Context = [kernel, template, existing instance]. The subagent walks the document's fields, treating the existing values as the proposal layer and the engineer's responses as accept-or-correct. The routing must match the authoring agent used by `hstack-init` for the same document — same author at init time and at refresh time, different cadence:
|
|
53
|
+
- `vision`, `glossary`, `roadmap`, `personas`, `data-architecture`, `tech-stack`, `ci-cd` → `product-manager`.
|
|
73
54
|
- `infrastructure`, `incident-runbook` → `spec-author`.
|
|
74
55
|
- `threat-model`, `hardening-checklist` → `security-reviewer`.
|
|
75
56
|
3. Updated document is written incrementally per the kernel's per-field write rule. Status moves to `drafted` if it had been `current`, then back to `current` at the end. Prompt source-cleanup per the subagent's contract.
|
|
@@ -79,7 +60,7 @@ Before any work:
|
|
|
79
60
|
|
|
80
61
|
1. Read `hstack/scripts/migrate-schema.ts` (or its current location) for the declarative migration steps between the current and target `schemaVersion`. Each step names: which artifact types it touches, which frontmatter fields it adds/renames/removes, and any prose-section structural changes.
|
|
81
62
|
2. Run a dry-run scan over `hstack/` and produce a written migration plan that lists every artifact file the migration would touch and the specific edits per file. Present the plan to the engineer for confirmation.
|
|
82
|
-
3. On confirmation, execute the migration step by step. After each artifact file is edited, run `
|
|
63
|
+
3. On confirmation, execute the migration step by step. After each artifact file is edited, run `node hstack/scripts/validate-spec.mjs <path>` against it; if validation fails, halt and surface the failure rather than continuing.
|
|
83
64
|
4. Update `hstack/config.yaml`'s `schemaVersion` to the target value on a successful migration. Commit.
|
|
84
65
|
|
|
85
66
|
For destructive or ambiguous migrations (renames of frontmatter fields, status enum changes), the Skill presents each ambiguity to the engineer rather than guessing.
|
|
@@ -116,11 +97,3 @@ Beyond the kernel's general stop conditions:
|
|
|
116
97
|
- **`migrate-schema.ts` absent or malformed.** Halt and surface as a hstack installation issue.
|
|
117
98
|
- **Validator failure on a migrated artifact.** Halt the migration; previous artifacts are already committed and represent a stable partial state.
|
|
118
99
|
- **Subagent halts mid-interview.** Persist current state; partial fields are already written per the kernel's incremental-write rule.
|
|
119
|
-
|
|
120
|
-
## Anti-patterns
|
|
121
|
-
|
|
122
|
-
- Never silently advance `schemaVersion` without a corresponding migration run.
|
|
123
|
-
- Never write context document content without invoking `product-manager`. This Skill orchestrates; it does not author.
|
|
124
|
-
- Never edit per-change artifacts (specs, plans, reviews) from this Skill. Those belong to their authoring subagents.
|
|
125
|
-
- Never apply a `--migrate` plan without the engineer's explicit confirmation of the dry-run output.
|
|
126
|
-
- Never re-run `hstack-init` semantics from this Skill. If the engineer wants to start over, they delete and re-init explicitly.
|