hstack 0.7.1 → 0.17.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 +308 -0
- package/README.md +90 -154
- package/VERSION +1 -1
- package/dist/commands/doctor.js +69 -9
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/init.js +7 -3
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/update.js +17 -4
- package/dist/commands/update.js.map +1 -1
- package/dist/lib/descriptions.js +160 -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 +274 -142
- package/dist/lib/wire.js.map +1 -1
- package/dist/manifest.js +49 -22
- package/dist/manifest.js.map +1 -1
- package/package.json +4 -3
- package/template/.claude/agents/adversarial-reviewer.md +42 -98
- package/template/.claude/agents/app-architect.md +44 -133
- package/template/.claude/agents/data-architect.md +46 -127
- package/template/.claude/agents/test-strategist.md +39 -109
- package/template/.claude/skills/hstack-adr-new/SKILL.md +23 -100
- package/template/.claude/skills/hstack-adversarial-review/SKILL.md +47 -174
- package/template/.claude/skills/hstack-adversarial-review/references/finding-categories.md +134 -0
- package/template/.claude/skills/hstack-app-architecture/SKILL.md +43 -95
- package/template/.claude/skills/hstack-commit/SKILL.md +28 -97
- package/template/.claude/skills/hstack-data-architecture/SKILL.md +34 -82
- package/template/.claude/skills/hstack-promote/SKILL.md +55 -0
- package/template/.claude/skills/hstack-story/SKILL.md +58 -0
- package/template/.claude/skills/hstack-test-audit/SKILL.md +64 -0
- package/template/.claude/skills/hstack-wrap/SKILL.md +48 -0
- package/template/.claude/skills/hstack-wrap/references/pr-description.md +45 -0
- package/template/KERNEL.md +167 -0
- package/template/templates/adr.md +9 -18
- package/template/templates/app-architecture.md +38 -50
- package/template/templates/data-architecture.md +39 -93
- package/template/templates/infrastructure.md +54 -148
- package/template/templates/roadmap.md +35 -0
- package/template/templates/story.md +7 -13
- package/template/templates/tech-debt.md +2 -37
- package/template/templates/tech-stack.md +2 -12
- package/template/.claude/agents/data-specialist.md +0 -126
- package/template/.claude/agents/implementer.md +0 -154
- package/template/.claude/agents/kernel-fit-analyst.md +0 -190
- package/template/.claude/agents/planner.md +0 -110
- package/template/.claude/agents/product-discovery.md +0 -165
- package/template/.claude/agents/product-manager.md +0 -111
- package/template/.claude/agents/researcher.md +0 -123
- package/template/.claude/agents/security-reviewer.md +0 -123
- package/template/.claude/agents/spec-author.md +0 -123
- package/template/.claude/agents/stack-architect.md +0 -137
- package/template/.claude/agents/ui-ux-briefer.md +0 -105
- package/template/.claude/agents/verifier.md +0 -113
- package/template/.claude/skills/hstack-branch/SKILL.md +0 -103
- package/template/.claude/skills/hstack-brownfield-init/SKILL.md +0 -158
- package/template/.claude/skills/hstack-change-new/SKILL.md +0 -111
- package/template/.claude/skills/hstack-change-plan/SKILL.md +0 -119
- package/template/.claude/skills/hstack-configure/SKILL.md +0 -126
- package/template/.claude/skills/hstack-coord/SKILL.md +0 -131
- package/template/.claude/skills/hstack-data-review/SKILL.md +0 -132
- package/template/.claude/skills/hstack-finalize/SKILL.md +0 -159
- package/template/.claude/skills/hstack-flag/SKILL.md +0 -138
- package/template/.claude/skills/hstack-greenfield-init/SKILL.md +0 -175
- package/template/.claude/skills/hstack-help/SKILL.md +0 -179
- package/template/.claude/skills/hstack-implement/SKILL.md +0 -185
- package/template/.claude/skills/hstack-kernel-fit-promote/SKILL.md +0 -164
- package/template/.claude/skills/hstack-kernel-fit-scan/SKILL.md +0 -197
- package/template/.claude/skills/hstack-kernel-fit-triage/SKILL.md +0 -159
- package/template/.claude/skills/hstack-module-spec/SKILL.md +0 -105
- package/template/.claude/skills/hstack-product-discovery/SKILL.md +0 -101
- package/template/.claude/skills/hstack-research/SKILL.md +0 -145
- package/template/.claude/skills/hstack-scaffold/SKILL.md +0 -140
- package/template/.claude/skills/hstack-security-review/SKILL.md +0 -133
- package/template/.claude/skills/hstack-ship/SKILL.md +0 -129
- package/template/.claude/skills/hstack-stack-decide/SKILL.md +0 -108
- package/template/.claude/skills/hstack-story-draft/SKILL.md +0 -119
- package/template/.claude/skills/hstack-tech-debt-new/SKILL.md +0 -122
- package/template/.claude/skills/hstack-tech-debt-resolve/SKILL.md +0 -158
- package/template/.claude/skills/hstack-tech-debt-stale/SKILL.md +0 -113
- package/template/.claude/skills/hstack-tech-debt-wontfix/SKILL.md +0 -104
- package/template/.claude/skills/hstack-telemetry/SKILL.md +0 -98
- package/template/.claude/skills/hstack-test-plan/SKILL.md +0 -182
- package/template/.claude/skills/hstack-ui-brief/SKILL.md +0 -108
- package/template/.claude/skills/hstack-verify/SKILL.md +0 -150
- package/template/CLAUDE.md +0 -443
- package/template/scripts/coord/coord_scan.py +0 -681
- package/template/scripts/telemetry/__init__.py +0 -6
- package/template/scripts/telemetry/insights/__init__.py +0 -0
- package/template/scripts/telemetry/insights/contract_drift.py +0 -137
- package/template/scripts/telemetry/insights/kernel_fit.py +0 -438
- package/template/scripts/telemetry/insights/overengineering.py +0 -115
- package/template/scripts/telemetry/insights/quality_outcomes.py +0 -131
- package/template/scripts/telemetry/insights/token_economics.py +0 -129
- package/template/scripts/telemetry/insights/workflow_shape.py +0 -198
- package/template/scripts/telemetry/parsers/__init__.py +0 -0
- package/template/scripts/telemetry/parsers/bodies.py +0 -87
- package/template/scripts/telemetry/parsers/commits.py +0 -219
- package/template/scripts/telemetry/parsers/frontmatter.py +0 -322
- package/template/scripts/telemetry/parsers/transcripts.py +0 -181
- package/template/scripts/telemetry/render.py +0 -395
- package/template/scripts/telemetry/report.py +0 -138
- package/template/scripts/telemetry/run_kernel_fit.py +0 -91
- package/template/templates/adversarial-review.md +0 -54
- package/template/templates/bootstrap.md +0 -105
- package/template/templates/change-spec.md +0 -82
- package/template/templates/ci-cd.md +0 -27
- package/template/templates/coord-message.md +0 -55
- package/template/templates/data-review.md +0 -54
- package/template/templates/discovery/brainstorm.md +0 -69
- package/template/templates/discovery/forcing-questions.md +0 -76
- package/template/templates/discovery/project-brief.md +0 -53
- package/template/templates/figma-handoff.md +0 -38
- package/template/templates/glossary.md +0 -20
- package/template/templates/hardening-checklist.md +0 -73
- package/template/templates/incident-runbook.md +0 -57
- package/template/templates/kernel-fit-finding.md +0 -63
- package/template/templates/kernel-fit-flag.md +0 -52
- package/template/templates/module-spec.md +0 -49
- package/template/templates/mvp-scope.md +0 -34
- package/template/templates/persona.md +0 -38
- package/template/templates/plan.md +0 -49
- package/template/templates/product-brief.md +0 -56
- package/template/templates/security-review.md +0 -63
- package/template/templates/telemetry-sidecar.md +0 -184
- package/template/templates/test-plan.md +0 -119
- package/template/templates/threat-model.md +0 -54
- package/template/templates/ui-brief.md +0 -49
- package/template/templates/verification.md +0 -63
- package/template/templates/vision.md +0 -34
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
---
|
|
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>
|
|
23
|
-
tools:
|
|
24
|
-
- Read
|
|
25
|
-
- Write
|
|
26
|
-
- Edit
|
|
27
|
-
- Grep
|
|
28
|
-
- Glob
|
|
29
|
-
- Bash
|
|
30
|
-
- Task
|
|
31
|
-
- "{{TODO-TOOL: RepoMix — packs the module slice (paths from hstack/config.yaml) into a single context bundle for spec-author}}"
|
|
32
|
-
- "{{TODO-SCRIPT: hstack/scripts/validate-spec.ts — validates module-spec frontmatter and MS-01/MS-02/MS-03}}"
|
|
33
|
-
---
|
|
34
|
-
|
|
35
|
-
## Purpose
|
|
36
|
-
|
|
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 — 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
|
-
|
|
39
|
-
## When to invoke
|
|
40
|
-
|
|
41
|
-
Invoke once per critical module after `hstack-init` completes, before any change-spec in that module's `area` can validate. Re-invoke when the 60-day `needs-refresh` cron flags the spec, when the module's shape materially changes (new owned table, new public surface, new dependency), or on demand when the engineer wants a refresh.
|
|
42
|
-
|
|
43
|
-
## Inputs
|
|
44
|
-
|
|
45
|
-
- `<module>` (required, positional): the module key as declared in `hstack/config.yaml`'s module-to-area mapping. Must match an existing entry.
|
|
46
|
-
|
|
47
|
-
## Preconditions
|
|
48
|
-
|
|
49
|
-
Before any work:
|
|
50
|
-
|
|
51
|
-
- Verify `hstack/config.yaml` exists at `init-status: complete`. If not, halt and direct the engineer to `hstack-init`.
|
|
52
|
-
- Verify the named module exists in the config's module-to-area mapping. If not, halt and ask the engineer to add it via `hstack-configure` first.
|
|
53
|
-
- Read the module's declared `paths` globs from config and verify at least one path resolves to existing files. If none resolve, halt — the module-to-paths mapping is stale.
|
|
54
|
-
- Check whether `hstack/specs/<module>/spec.md` already exists. If yes and at `status: current`, ask the engineer whether this is a refresh (proceed with the existing spec as the proposal layer) or a re-author (archive the existing spec first).
|
|
55
|
-
- Read `hstack/context/glossary.md` and `hstack/context/tech-stack.md` (required by `spec-author`'s session-start protocol).
|
|
56
|
-
|
|
57
|
-
## Orchestration steps
|
|
58
|
-
|
|
59
|
-
1. **Pack the module slice.** Run `{{TODO-TOOL: RepoMix}}` over the module's `paths` globs and write the packed bundle to a temporary location. If RepoMix is unavailable, fall back to having `spec-author` grep the paths directly; flag the degraded read in the conversation.
|
|
60
|
-
|
|
61
|
-
2. **Invoke `spec-author`.** Use the Task tool with `subagent_type: spec-author` and context = [kernel, `hstack/templates/module-spec.md`, glossary, tech-stack, packed module bundle, existing module-spec instance if refresh]. The subagent reads the bundle, walks the seven module-spec sections — Purpose, Public Surface, Data Owned, External Dependencies, Invariants, Known Tech-Debt and ADRs, Refresh Policy — with confirmation gates per field.
|
|
62
|
-
|
|
63
|
-
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
|
-
|
|
65
|
-
4. **Validate.** After each confirmed field write, the subagent runs `{{TODO-SCRIPT: hstack/scripts/validate-spec.ts}}` 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
|
-
|
|
67
|
-
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
|
-
|
|
69
|
-
## Outputs
|
|
70
|
-
|
|
71
|
-
- `hstack/specs/<module>/spec.md` at `status: current`, with frontmatter including the module's `paths` array mirrored from `hstack/config.yaml`.
|
|
72
|
-
|
|
73
|
-
## Auto-commit triggers
|
|
74
|
-
|
|
75
|
-
- Status moves from absent to `drafted` after the first section is confirmed (so partial work survives).
|
|
76
|
-
- Status moves from `drafted` to `current` when the full spec lands. Commit message: `module-spec(<module>): draft baseline` or `module-spec(<module>): refresh` depending on prior state.
|
|
77
|
-
|
|
78
|
-
## Idempotency contract
|
|
79
|
-
|
|
80
|
-
- Re-running on a `current` module-spec without specifying refresh intent: the Skill detects the existing spec and asks the engineer whether to refresh.
|
|
81
|
-
- Re-running mid-authoring after a halt: `spec-author` reads the partial file, identifies the first un-confirmed section, and resumes the interview there.
|
|
82
|
-
- Re-running on a refresh where the engineer accepts every section unchanged: a no-op diff body with only the `updated` and `last-refreshed` timestamps changing.
|
|
83
|
-
|
|
84
|
-
## Stop conditions
|
|
85
|
-
|
|
86
|
-
Beyond the kernel's general stop conditions:
|
|
87
|
-
|
|
88
|
-
- The module's `paths` globs resolve to zero existing files. Halt; the module-to-paths mapping in config is wrong.
|
|
89
|
-
- MS-02 fails — the module's paths overlap with another module's paths. Halt and ask the engineer to reconcile the mapping via `hstack-configure`.
|
|
90
|
-
- The Invariants challenge prompt cannot produce three bullets after honest interview. Halt; either the module is too small to merit its own spec (fold into a parent module via `hstack-configure`) or the engineer needs more time to think.
|
|
91
|
-
- `spec-author` halts because a referenced glossary term cannot be reconciled. Halt and surface; the engineer either updates the glossary via `hstack-configure --interview glossary` or rephrases.
|
|
92
|
-
|
|
93
|
-
## Failure modes
|
|
94
|
-
|
|
95
|
-
- **RepoMix unavailable.** Degraded mode — flag in the conversation, fall back to direct grep, continue.
|
|
96
|
-
- **Existing module-spec frontmatter does not match config's paths.** Halt; the engineer reconciles before the refresh can proceed.
|
|
97
|
-
- **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,101 +0,0 @@
|
|
|
1
|
-
---
|
|
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>
|
|
23
|
-
tools:
|
|
24
|
-
- Read
|
|
25
|
-
- Write
|
|
26
|
-
- Edit
|
|
27
|
-
- Grep
|
|
28
|
-
- Glob
|
|
29
|
-
- Bash
|
|
30
|
-
- Task
|
|
31
|
-
- "{{TODO-SCRIPT: hstack/scripts/validate-spec.ts — frontmatter validator}}"
|
|
32
|
-
---
|
|
33
|
-
|
|
34
|
-
## Purpose
|
|
35
|
-
|
|
36
|
-
`hstack-product-discovery` is the atom that produces `hstack/context/product/product-brief.md` via the `product-discovery` subagent. It is the canonical authoring path for the brief; the brief never lands via a generic spec-author interview.
|
|
37
|
-
|
|
38
|
-
## When to invoke
|
|
39
|
-
|
|
40
|
-
- Phase 1 of `/hstack:greenfield-init` (elicit mode, no source).
|
|
41
|
-
- Optional enrichment within `/hstack:brownfield-init` when existing product docs are thin and the engineer wants the deeper reframe-style brief.
|
|
42
|
-
- Standalone via `/hstack:product-discovery [--mode extract|elicit] [--section <name>]` for retroactive brief authoring on any repo.
|
|
43
|
-
|
|
44
|
-
## Inputs
|
|
45
|
-
|
|
46
|
-
- `--mode extract | elicit` — defaults: `elicit` if no source docs are reachable; `extract` if a `product-brief.md` exists or the engineer points at source documents.
|
|
47
|
-
- `--section <name>` — optional, fast-jumps to a specific section for refresh. Re-runs the end-of-atom check across all sections before commit.
|
|
48
|
-
|
|
49
|
-
## Preconditions
|
|
50
|
-
|
|
51
|
-
- `hstack/config.yaml` exists and `init-status` is at least `minimal-complete` — the atom does not run standalone until config exists.
|
|
52
|
-
- `hstack/CLAUDE.md` and `hstack/templates/product-brief.md` are present.
|
|
53
|
-
- `hstack/templates/discovery/{brainstorm,forcing-questions,project-brief}.md` are present.
|
|
54
|
-
- 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
|
-
|
|
56
|
-
## Orchestration steps
|
|
57
|
-
|
|
58
|
-
1. **Detect mode.** Read disk state. If `hstack/context/product/product-brief.md` exists at `status: current` and no `--section` flag, this is a refresh confirmation — print summary and exit unless engineer opts into full re-interview.
|
|
59
|
-
2. **Pick technique** (elicit mode only). Prompt the engineer to choose Brainstorm / Forcing-Questions / Project-Brief. Persist the choice as `technique-used` in the brief frontmatter.
|
|
60
|
-
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
|
-
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
|
-
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`, `mvp-scope.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
|
-
|
|
65
|
-
## Outputs
|
|
66
|
-
|
|
67
|
-
- `hstack/context/product/product-brief.md` at `status: current`.
|
|
68
|
-
- `hstack/.session-state/<session-id>.yaml` (transient).
|
|
69
|
-
- Via auto-route: `vision.md`, `mvp-scope.md`, `personas/*`, `glossary.md` refreshed (unless skip-routing).
|
|
70
|
-
|
|
71
|
-
## Auto-commit triggers
|
|
72
|
-
|
|
73
|
-
- Each confirmed section writes immediately and auto-commits.
|
|
74
|
-
- Brief reaches `status: current` → final commit with the auto-route message in the body.
|
|
75
|
-
- Downstream refreshes by `product-manager` each auto-commit per the product-manager subagent's contract.
|
|
76
|
-
|
|
77
|
-
## Idempotency contract
|
|
78
|
-
|
|
79
|
-
- Brief at `current` + no `--section` + no `--force`: print summary, exit no-op.
|
|
80
|
-
- Brief at `draft` or partial: read disk + session-state, resume at next non-confirmed section.
|
|
81
|
-
- Brief at `needs-refresh` (flipped by `/hstack:configure` because upstream changed): walk all sections in confirm-or-revise mode.
|
|
82
|
-
|
|
83
|
-
## Stop conditions
|
|
84
|
-
|
|
85
|
-
- A required source document in extract mode is unreachable.
|
|
86
|
-
- Forcing-prompt answer is too vague after one re-ask. The subagent halts with `HSTACK-HALT: reason=ambiguous-spec` or `missing-context`.
|
|
87
|
-
- Mid-technique switch requested.
|
|
88
|
-
- Engineer signals end-of-session.
|
|
89
|
-
- Downstream auto-route fails (e.g., `product-manager` cannot reach the configured personas store). The Skill surfaces the failure; the brief stays at `current`, downstream context docs stay at their prior status until the engineer resolves.
|
|
90
|
-
|
|
91
|
-
## Failure modes
|
|
92
|
-
|
|
93
|
-
- **Subagent unreachable.** Persist session state; retry later.
|
|
94
|
-
- **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,145 +0,0 @@
|
|
|
1
|
-
---
|
|
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>
|
|
23
|
-
tools:
|
|
24
|
-
- Read
|
|
25
|
-
- Write
|
|
26
|
-
- Edit
|
|
27
|
-
- Grep
|
|
28
|
-
- Glob
|
|
29
|
-
- Bash
|
|
30
|
-
- Task
|
|
31
|
-
- WebSearch
|
|
32
|
-
- WebFetch
|
|
33
|
-
- "{{TODO-MCP: Notion MCP — optional; useful when research must include prior team decisions in Notion}}"
|
|
34
|
-
- "{{TODO-MCP: GitHub MCP — optional; useful for searching issues and PRs on third-party SDK repos}}"
|
|
35
|
-
- "{{TODO-SCRIPT: hstack/scripts/validate-spec.ts — validates research session frontmatter}}"
|
|
36
|
-
- "{{TODO-SCRIPT: hstack/scripts/garbage-collect-research.sh — clears sessions past their garbage-collect-after date; promoted sessions exempt}}"
|
|
37
|
-
---
|
|
38
|
-
|
|
39
|
-
## Purpose
|
|
40
|
-
|
|
41
|
-
`hstack-research` produces grounded research outputs via the `researcher` subagent and routes explicit promotion to durable artifacts. The Skill has two modes:
|
|
42
|
-
|
|
43
|
-
- **Default mode.** Invoke the researcher with a query; classify into one of five modes; write a transient session artifact under `hstack/research/sessions/` with sources, confidence markers, and proposed promotion targets.
|
|
44
|
-
- **`--promote <session-id>` mode.** Elevate an existing session to a durable artifact: ADR (route through `hstack-adr-new`), tech-debt (route through `hstack-tech-debt-new`), or a durable note under `hstack/research/promoted/` (the researcher writes this directly).
|
|
45
|
-
|
|
46
|
-
## When to invoke
|
|
47
|
-
|
|
48
|
-
Invoke when the engineer wants to ground a decision or implementation choice in current external information rather than speculation. Common triggers: third-party API integration choices, competitive scans before an ADR, security-CVE checks against pinned dependencies, AI-native pattern lookups (prompt-caching, retrieval, orchestration).
|
|
49
|
-
|
|
50
|
-
## Inputs
|
|
51
|
-
|
|
52
|
-
Default mode:
|
|
53
|
-
- `<query>` (required, positional): the research question, in natural language. The Skill does not require a pre-classified mode — the researcher classifies during the session.
|
|
54
|
-
|
|
55
|
-
Promote mode:
|
|
56
|
-
- `--promote <session-id>` (required): the session to elevate.
|
|
57
|
-
- `--target adr | tech-debt | note` (optional): the promotion target. When omitted, the Skill asks the engineer based on the session's proposed promotion targets.
|
|
58
|
-
|
|
59
|
-
## Preconditions
|
|
60
|
-
|
|
61
|
-
Before any work:
|
|
62
|
-
|
|
63
|
-
- Verify `hstack/config.yaml` exists at `init-status: complete`.
|
|
64
|
-
- Default mode: verify `hstack/research/sessions/` exists; create if absent.
|
|
65
|
-
- Promote mode: verify the named session exists at `hstack/research/sessions/<session-id>.md` and is at `status: current`. Verify the session is not already promoted.
|
|
66
|
-
|
|
67
|
-
## Orchestration steps
|
|
68
|
-
|
|
69
|
-
### Default mode
|
|
70
|
-
|
|
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/mvp-scope 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
|
-
|
|
73
|
-
2. **Source discipline.** Per the `researcher` contract:
|
|
74
|
-
- API-lookup: canonical vendor docs over tutorials; 12-month recency window.
|
|
75
|
-
- Competitive-scan: engineering-side sources over marketing pages; vendors named explicitly.
|
|
76
|
-
- Documentation: canonical sources only; contradictions surfaced rather than papered.
|
|
77
|
-
- Security-CVE: CVE databases and vendor advisories; recency window open; cross-checked against `tech-stack.md` pins.
|
|
78
|
-
- AI-native best practices: 6-month recency bias; engineering blogs and tooling repos over vendor marketing.
|
|
79
|
-
Every source is named with URL and access timestamp. Single-source claims marked explicitly.
|
|
80
|
-
|
|
81
|
-
3. **Confidence markers.** Each finding lands with `high | medium | low` confidence per the researcher's contract.
|
|
82
|
-
|
|
83
|
-
4. **Proposed promotion targets.** The session artifact closes with a Promotion Targets section: "Promote to ADR / tech-debt / research-note? Engineer decides." The Skill does not promote unilaterally.
|
|
84
|
-
|
|
85
|
-
5. **Session artifact frontmatter.** Includes `garbage-collect-after: <today + 30 days>` per the architecture's retention rule. Promoted sessions are exempt; the `--promote` operation sets a flag that the garbage-collector honors.
|
|
86
|
-
|
|
87
|
-
### Promote mode
|
|
88
|
-
|
|
89
|
-
1. **Read the session.** Surface the proposed promotion targets to the engineer.
|
|
90
|
-
|
|
91
|
-
2. **Route by `--target` value:**
|
|
92
|
-
- `--target adr`: invoke `hstack-adr-new` with `--from-research <session-id>` and a slug supplied by the engineer. The ADR's Context section is seeded from the session findings; `spec-author` walks the remaining Nygard sections via its conversational interview, exercising the Consequences challenge prompt.
|
|
93
|
-
- `--target tech-debt`: invoke `hstack-tech-debt-new` with the engineer-supplied slug and any `--origin <change-spec-id>` when applicable. `spec-author` walks the six tech-debt sections.
|
|
94
|
-
- `--target note`: the `researcher` writes a durable note at `hstack/research/promoted/<topic>.md` directly. Free-form structure; no template constraint. This is the only target where the researcher writes the promoted artifact directly — the kernel's promotion-routing rule explicitly permits this for free-form notes.
|
|
95
|
-
|
|
96
|
-
3. **Mark the session as promoted.** Update the session's frontmatter with `promoted-to: adr:<ADR-NNNN>` (or `tech-debt:<TD-NNNN>` or `note:<path>`). Exempt from garbage collection.
|
|
97
|
-
|
|
98
|
-
## Outputs
|
|
99
|
-
|
|
100
|
-
Default mode:
|
|
101
|
-
- `hstack/research/sessions/<YYYY-MM-DD>-<topic-slug>.md` at `status: current`, with query, classified mode(s), sources, findings, options, and proposed promotion targets.
|
|
102
|
-
|
|
103
|
-
Promote mode (depending on `--target`):
|
|
104
|
-
- A new ADR at `hstack/adr/ADR-NNNN-<slug>.md` (via `hstack-adr-new`).
|
|
105
|
-
- A new tech-debt item at `hstack/tech-debt/TD-NNNN-<slug>.md` (via `hstack-tech-debt-new`).
|
|
106
|
-
- A new durable note at `hstack/research/promoted/<topic>.md` (written by the researcher).
|
|
107
|
-
- An edit to the source session marking it `promoted-to: ...`.
|
|
108
|
-
|
|
109
|
-
## Auto-commit triggers
|
|
110
|
-
|
|
111
|
-
- Default mode: one commit when the session artifact lands. Commit message: `research(<topic>): drafted`.
|
|
112
|
-
- Promote mode: the destination Skill's auto-commit fires (ADR or tech-debt). For `--target note`, one commit when the note lands plus the session's `promoted-to` edit.
|
|
113
|
-
|
|
114
|
-
## Idempotency contract
|
|
115
|
-
|
|
116
|
-
- Default mode: re-running with an identical query produces a new session file with today's date in the filename — research is recency-sensitive and re-running is intentional. The engineer may delete the prior session manually, or let the garbage collector handle it after 30 days.
|
|
117
|
-
- Promote mode: re-running on an already-promoted session is a no-op; the Skill detects the `promoted-to` field and exits.
|
|
118
|
-
|
|
119
|
-
## Stop conditions
|
|
120
|
-
|
|
121
|
-
Beyond the kernel's general stop conditions:
|
|
122
|
-
|
|
123
|
-
- Query is too vague to classify into a mode. Ask for clarification.
|
|
124
|
-
- A load-bearing context document is unreachable.
|
|
125
|
-
- Sources are contradictory and the resolution requires a human call.
|
|
126
|
-
- Promote mode: target is unspecified and the engineer has not chosen.
|
|
127
|
-
- Promote mode: the named session does not exist or is already promoted.
|
|
128
|
-
- Promote mode with `--target adr` or `--target tech-debt`: the routed Skill halts; surface the halt message.
|
|
129
|
-
|
|
130
|
-
## Failure modes
|
|
131
|
-
|
|
132
|
-
- **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
|
-
- **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
|
-
- **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,140 +0,0 @@
|
|
|
1
|
-
---
|
|
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>
|
|
23
|
-
tools:
|
|
24
|
-
- Read
|
|
25
|
-
- Write
|
|
26
|
-
- Edit
|
|
27
|
-
- Grep
|
|
28
|
-
- Glob
|
|
29
|
-
- Bash
|
|
30
|
-
- Task
|
|
31
|
-
- "{{TODO-SKILL: /hstack:change-new — scaffolds the bootstrap change-spec folder}}"
|
|
32
|
-
- "{{TODO-SKILL: /hstack:test-plan — produces test-plan.md for the bootstrap}}"
|
|
33
|
-
- "{{TODO-SKILL: /hstack:security-review — invoked in --mode foundational}}"
|
|
34
|
-
- "{{TODO-SKILL: /hstack:data-review — invoked in --mode foundational}}"
|
|
35
|
-
- "{{TODO-SKILL: /hstack:change-plan — invokes planner}}"
|
|
36
|
-
- "{{TODO-SKILL: /hstack:implement — invokes implementer phase-by-phase}}"
|
|
37
|
-
- "{{TODO-SKILL: /hstack:verify — invokes verifier after the last implement phase}}"
|
|
38
|
-
- "{{TODO-SKILL: /hstack:adversarial-review — runs in a fresh session for the bootstrap}}"
|
|
39
|
-
- "{{TODO-SKILL: /hstack:ship — final scorecard; bootstrap ships with a PR like any change}}"
|
|
40
|
-
- "{{TODO-SKILL: /hstack:finalize — post-merge cleanup}}"
|
|
41
|
-
- "{{TODO-SCRIPT: hstack/scripts/validate-spec.ts — frontmatter validator}}"
|
|
42
|
-
---
|
|
43
|
-
|
|
44
|
-
## Purpose
|
|
45
|
-
|
|
46
|
-
`hstack-scaffold` is the Phase 6 execution Skill of `/hstack:greenfield-init`. It bridges discovery to working code: the upstream phases (product-brief, data-architecture, app-architecture, stack ADRs, threat-model, hardening-checklist, infrastructure, incident-runbook) declare the design; this Skill executes it. The execution path is the **standard per-change workflow** applied to a one-off change-spec with `area: bootstrap` — there is no special-cased "bootstrap workflow"; the kernel's per-change discipline applies in full, with two adjustments: (a) `security-review` and `data-review` run in `--mode foundational` (score against proposed posture, not diff), and (b) the change-spec uses the `hstack/templates/bootstrap.md` variant.
|
|
47
|
-
|
|
48
|
-
## When to invoke
|
|
49
|
-
|
|
50
|
-
- Phase 6 of `/hstack:greenfield-init` (the orchestrator calls this Skill after Phase 5 terminates).
|
|
51
|
-
- Standalone is **not** supported in v1 — scaffold runs once per project lifetime and assumes the full upstream discovery layer is at terminal status. Standalone invocation halts with a directive to run `/hstack:greenfield-init` instead.
|
|
52
|
-
|
|
53
|
-
## Inputs
|
|
54
|
-
|
|
55
|
-
- No positional arguments. The Skill reads upstream artifacts and the bootstrap-change-spec scaffolding from disk.
|
|
56
|
-
|
|
57
|
-
## Preconditions
|
|
58
|
-
|
|
59
|
-
- All of the following at `status: current`:
|
|
60
|
-
- `hstack/context/product/product-brief.md`
|
|
61
|
-
- `hstack/context/data-architecture.md`
|
|
62
|
-
- `hstack/context/app-architecture.md`
|
|
63
|
-
- `hstack/context/threat-model.md`, `hardening-checklist.md`, `infrastructure.md`, `incident-runbook.md`
|
|
64
|
-
- `hstack/context/tech-stack.md`, `ci-cd.md`
|
|
65
|
-
- Stack ADRs from Phase 4 at `status: accepted`.
|
|
66
|
-
- `hstack/templates/bootstrap.md` present.
|
|
67
|
-
- The consuming repo has no source code beyond `hstack/` and standard hidden files. If non-empty, halt — scaffold is a greenfield-only operation.
|
|
68
|
-
|
|
69
|
-
## Orchestration steps
|
|
70
|
-
|
|
71
|
-
1. **Generate the bootstrap change-spec.** Invoke `/hstack:change-new` with `area: bootstrap` and a derived id (`<YYYY-MM>-bootstrap`). The change-spec folder is scaffolded with `spec.md` pre-populated from `hstack/templates/bootstrap.md`. The Skill then performs mechanical writes to populate:
|
|
72
|
-
- `in-scope`: enumerated from app-architecture Module Map (one entry per module directory) + data-architecture Migration Sketches (one entry per `m_NNNN_*.sql`) + standard infra files (`package.json`, `tsconfig.json`, build config, CI workflow path, etc.). The enumeration is explicit; `["."]` is not permitted.
|
|
73
|
-
- `related-adrs`: the full list of Phase 4 stack ADRs.
|
|
74
|
-
- `threat-model-delta: true`.
|
|
75
|
-
The change-spec lands at `status: draft` after this step; `spec-author` walks it to `ready-to-plan` via a confirmation interview (the engineer reviews the enumerated `in-scope` and confirms or revises).
|
|
76
|
-
|
|
77
|
-
2. **Test plan.** Invoke `/hstack:test-plan` for the bootstrap. The test-strategist produces `test-plan.md` covering build / lint / typecheck / migration / RLS-enforcement smoke tests. Bootstrap test plans bias toward operational-correctness assertions (build exits 0, migrations apply cleanly, RLS denies cross-tenant access) rather than feature behavior.
|
|
78
|
-
|
|
79
|
-
3. **Foundational-mode security-review.** Invoke `/hstack:security-review` with the security-reviewer in `--mode foundational`. The reviewer scores against the proposed posture (threat-model + hardening-checklist + the stack ADRs) rather than against a diff. Output: `security-review.md` at `status: passed` or `concerns-noted` per the standard contract.
|
|
80
|
-
|
|
81
|
-
4. **Foundational-mode data-review.** Invoke `/hstack:data-review` with the data-specialist in `--mode foundational`. The reviewer scores the migration sketches from data-architecture Section 5 against RLS coverage rules (DR-02) and tenant-isolation rules (DR-03), scoring proposed-DDL rather than live schema. Output: `data-review.md` at `status: passed` or `concerns-noted`.
|
|
82
|
-
|
|
83
|
-
5. **Plan.** Invoke `/hstack:change-plan`. The planner produces `plan.md` with atomic phases. A typical bootstrap plan sequence:
|
|
84
|
-
- Phase 1: install dependencies (`npm install` / `pnpm install` / equivalent).
|
|
85
|
-
- Phase 2: initialize framework scaffold (e.g., Next.js boilerplate, tsconfig, eslint config).
|
|
86
|
-
- Phase 3: land migration files in `supabase/migrations/` per data-architecture Section 5.
|
|
87
|
-
- Phase 4: scaffold module shells per app-architecture Section 1 (one directory per module with index.ts plus any per-module config).
|
|
88
|
-
- Phase 5: wire CI workflow per `ci-cd.md`.
|
|
89
|
-
- Phase 6: smoke tests (build, lint, typecheck, run RLS-denial test).
|
|
90
|
-
Each phase declares its verifier expectations explicitly.
|
|
91
|
-
|
|
92
|
-
6. **Implement.** Invoke `/hstack:implement <bootstrap-id> <phase-id>` once per plan phase. Each invocation runs the implementer scope-locked to the `in-scope` enumeration. The implementer creates files (no edits — bootstrap is greenfield) and auto-commits at phase completion.
|
|
93
|
-
|
|
94
|
-
7. **Verify.** Invoke `/hstack:verify` after the last implement phase. The verifier runs the canonical commands from `ci-cd.md` and compares against per-phase Verifier Expectations.
|
|
95
|
-
|
|
96
|
-
8. **Adversarial review.** Direct the engineer to open a fresh Claude Code session and run `/hstack:adversarial-review`. Bootstrap inherits the standard fresh-session contract (kernel rule).
|
|
97
|
-
|
|
98
|
-
9. **Ship + finalize.** After adversarial review reaches `findings-resolved`, `/hstack:ship` produces the PR description. The engineer opens the PR, gets it merged, then runs `/hstack:finalize` to advance the bootstrap change-spec from `ready-to-ship` to `shipped` (no tech-debt resolution applies for bootstrap). `hstack/config.yaml`'s `init-status` flips to `complete` in the same finalize commit.
|
|
99
|
-
|
|
100
|
-
## Outputs
|
|
101
|
-
|
|
102
|
-
- A complete bootstrap change-spec folder at `hstack/specs/changes/<YYYY-MM>-bootstrap/` with `spec.md`, `test-plan.md`, `security-review.md`, `data-review.md`, `plan.md`, `verification.md`, `adversarial-review.md`, `pr-body.md`.
|
|
103
|
-
- The consuming repo's actual source files, migrations, CI workflow, build config, and per-module shells.
|
|
104
|
-
- `hstack/config.yaml` at `init-status: complete`.
|
|
105
|
-
|
|
106
|
-
## Auto-commit triggers
|
|
107
|
-
|
|
108
|
-
- Bootstrap change-spec advances through standard status transitions (`draft → ready-to-plan → ready-for-implementation → ready-for-review → ready-to-ship → shipped`); each transition auto-commits per the kernel.
|
|
109
|
-
- Each plan phase auto-commits when implementer completes it.
|
|
110
|
-
- `hstack/config.yaml` flips to `init-status: complete` in the finalize commit alongside the change-spec's advance to `shipped`.
|
|
111
|
-
|
|
112
|
-
## Idempotency contract
|
|
113
|
-
|
|
114
|
-
Scaffold inherits the standard per-change idempotency contract because bootstrap IS a change-spec:
|
|
115
|
-
|
|
116
|
-
- Re-running `/hstack:scaffold` reads the bootstrap change-spec's status and resumes at the next non-terminal artifact.
|
|
117
|
-
- Plan phases that have committed are skipped; only the first incomplete phase runs.
|
|
118
|
-
- A failed verifier produces `verification.md` at `status: failed-with-discrepancies`; re-running `/hstack:scaffold` does NOT silently retry — it surfaces the discrepancies and waits for the engineer to either re-implement the failing phase or revise the plan.
|
|
119
|
-
|
|
120
|
-
## Stop conditions
|
|
121
|
-
|
|
122
|
-
- Any upstream artifact at non-terminal status.
|
|
123
|
-
- The consuming repo is non-empty at scaffold start.
|
|
124
|
-
- Foundational-mode security-review or data-review lands at `concerns-noted` with unresolved CONCERNS. The engineer either resolves the concerns (revises threat-model / hardening / migration sketches) or accepts them via the standard concerns-acknowledgement path.
|
|
125
|
-
- Implementer halts mid-phase (file already exists outside in-scope, verifier expectation unsatisfiable, etc.). Standard implementer halt semantics apply.
|
|
126
|
-
- The engineer signals end-of-session — the standard per-change idempotency picks up on resume.
|
|
127
|
-
|
|
128
|
-
## Failure modes
|
|
129
|
-
|
|
130
|
-
- **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
|
-
- **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
|
-
- **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`.
|