@skyf0xx/hedgehog 3.0.0 → 3.0.2
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/README.md +18 -3
- package/bin/cli.mjs +31 -3
- package/package.json +1 -1
- package/src/agents/bootstrap.md +48 -10
- package/src/agents/layer-eng.md +91 -0
- package/src/agents/planner.md +8 -4
- package/src/agents/reviewer.md +57 -25
- package/src/agents/tweaker.md +10 -7
- package/src/skills/hedgehog-authored-loop/SKILL.md +184 -0
- package/src/skills/hedgehog-bootstrap-authored-core/SKILL.md +159 -0
- package/src/skills/hedgehog-core-design/SKILL.md +11 -2
- package/src/skills/hedgehog-planning-intake/SKILL.md +3 -3
- package/src/templates/CLAUDE.core.authored.md +102 -0
package/README.md
CHANGED
|
@@ -88,9 +88,15 @@ Artifact
|
|
|
88
88
|
|
|
89
89
|
### Anything else
|
|
90
90
|
|
|
91
|
-
A CLI, a library, a data pipeline, a compiler
|
|
92
|
-
shape gets its own build order, designed from
|
|
93
|
-
intake rather than chosen from a menu.
|
|
91
|
+
A CLI, a library, a browser extension, a data pipeline, a compiler — a
|
|
92
|
+
project fitting neither shape gets its own build order, designed from
|
|
93
|
+
your planning documents at intake rather than chosen from a menu. Run
|
|
94
|
+
`init` with no core flag: planning intake names the system shape, picks
|
|
95
|
+
the stack, derives the layers, and locks them to `.hedgehog/core.yaml`,
|
|
96
|
+
then generates that workspace and builds it one verified layer at a time.
|
|
97
|
+
|
|
98
|
+
The layers are bespoke, the enforcement is the same — ordered steps,
|
|
99
|
+
scoped file access, a verification command per layer, one commit each.
|
|
94
100
|
|
|
95
101
|

|
|
96
102
|
|
|
@@ -104,10 +110,19 @@ npx @skyf0xx/hedgehog init --ts-full-stack-app
|
|
|
104
110
|
|
|
105
111
|
# Landing page
|
|
106
112
|
npx @skyf0xx/hedgehog init --landing-page
|
|
113
|
+
|
|
114
|
+
# Anything else (CLI, library, browser extension, data pipeline, etc.)
|
|
115
|
+
npx @skyf0xx/hedgehog init
|
|
107
116
|
```
|
|
108
117
|
|
|
109
118
|
Then open Claude Code and describe what you want to build.
|
|
110
119
|
|
|
120
|
+
Plain `init` (no core flag) scaffolds a placeholder — planning intake
|
|
121
|
+
designs an opinionated build order and stack for what you actually
|
|
122
|
+
describe, then bootstrap replaces the placeholder with the real
|
|
123
|
+
workspace. Don't pick `--ts-full-stack-app` or `--landing-page` by
|
|
124
|
+
elimination when neither actually fits.
|
|
125
|
+
|
|
111
126
|
To update:
|
|
112
127
|
|
|
113
128
|
``` bash
|
package/bin/cli.mjs
CHANGED
|
@@ -91,6 +91,20 @@ function plan(core) {
|
|
|
91
91
|
include: `src/templates/CLAUDE.core.${core}.md`,
|
|
92
92
|
to: 'CLAUDE.md',
|
|
93
93
|
},
|
|
94
|
+
// The shell plus the authored-core section, landed unmerged so
|
|
95
|
+
// `hedgehog-bootstrap-authored-core` can rebuild CLAUDE.md from them
|
|
96
|
+
// when planning intake designs a core instead of taking a shipped
|
|
97
|
+
// one. Removed by that same step once it has used them.
|
|
98
|
+
{
|
|
99
|
+
type: 'file',
|
|
100
|
+
from: 'src/templates/CLAUDE.md',
|
|
101
|
+
to: '.hedgehog/templates/CLAUDE.md',
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
type: 'file',
|
|
105
|
+
from: 'src/templates/CLAUDE.core.authored.md',
|
|
106
|
+
to: '.hedgehog/templates/CLAUDE.core.authored.md',
|
|
107
|
+
},
|
|
94
108
|
// The pre-built, pre-verified workspace for the chosen core —
|
|
95
109
|
// everything a fresh project of that shape needs at repo root
|
|
96
110
|
// (lands the root package.json too, so there's no separate
|
|
@@ -191,6 +205,14 @@ After it runs, commit the payload, open Claude Code, and describe what
|
|
|
191
205
|
you want to build — the planner agent runs planning intake, then hands
|
|
192
206
|
off to bootstrap.
|
|
193
207
|
|
|
208
|
+
Building something else (a CLI, library, browser extension, data
|
|
209
|
+
pipeline, desktop app, etc.)? Run plain 'init' with no core flag rather
|
|
210
|
+
than picking --ts-full-stack-app or --landing-page by elimination — it
|
|
211
|
+
scaffolds ${DEFAULT_CORE}'s payload as a placeholder, but the planner
|
|
212
|
+
agent designs and switches in an authored core at planning intake
|
|
213
|
+
(hedgehog-core-design) before any workspace is generated for real.
|
|
214
|
+
Describe the actual project and let Phase 0 route it.
|
|
215
|
+
|
|
194
216
|
${bold('update')} re-copies only .claude/agents and .claude/skills from the
|
|
195
217
|
installed Hedgehog version, so an already-bootstrapped project can pick up
|
|
196
218
|
agent/skill changes from a newer release. It always overwrites those two
|
|
@@ -200,7 +222,7 @@ updated deliberately, not by this command.
|
|
|
200
222
|
`);
|
|
201
223
|
}
|
|
202
224
|
|
|
203
|
-
async function init({ force, core }) {
|
|
225
|
+
async function init({ force, core, explicitCore }) {
|
|
204
226
|
const cores = await availableCores();
|
|
205
227
|
if (!cores.includes(core)) {
|
|
206
228
|
console.error(
|
|
@@ -269,7 +291,13 @@ async function init({ force, core }) {
|
|
|
269
291
|
),
|
|
270
292
|
);
|
|
271
293
|
console.log();
|
|
272
|
-
console.log(
|
|
294
|
+
console.log(
|
|
295
|
+
dim(
|
|
296
|
+
explicitCore
|
|
297
|
+
? `Core: ${bold(core)}.`
|
|
298
|
+
: `Core: ${bold(core)} (installer default — planner may design an authored core instead).`,
|
|
299
|
+
),
|
|
300
|
+
);
|
|
273
301
|
console.log(
|
|
274
302
|
dim(
|
|
275
303
|
core === DEFAULT_CORE
|
|
@@ -719,7 +747,7 @@ async function main() {
|
|
|
719
747
|
const core = coreFlag ? CORE_FLAGS[coreFlag] : DEFAULT_CORE;
|
|
720
748
|
|
|
721
749
|
if (cmd === 'init') {
|
|
722
|
-
await init({ force, core });
|
|
750
|
+
await init({ force, core, explicitCore: Boolean(coreFlag) });
|
|
723
751
|
return;
|
|
724
752
|
}
|
|
725
753
|
|
package/package.json
CHANGED
package/src/agents/bootstrap.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: bootstrap
|
|
3
|
-
description: Use once per invocation, at the start of a new Hedgehog project, to land the workspace for whichever core `planner` selected at Phase 0. On full-stack-app, that's core (via hedgehog-bootstrap-full-stack-app-core, one pass) then exactly ONE add-on step of the hedgehog-bootstrap skill (0-3 steps depending on planning intake scope), handing off to a fresh instance of itself for the next add-on step. On landing-page, that's a single pass of hedgehog-bootstrap-landing-page-core with no add-on steps — one invocation, done. Not for per-phase/per-module work — that's this core's own loop skill and its agents. Skip entirely if the core's workspace already exists (nx.json for full-stack-app, astro.config.mjs for landing-page).
|
|
3
|
+
description: Use once per invocation, at the start of a new Hedgehog project, to land the workspace for whichever core `planner` selected at Phase 0. On full-stack-app, that's core (via hedgehog-bootstrap-full-stack-app-core, one pass) then exactly ONE add-on step of the hedgehog-bootstrap skill (0-3 steps depending on planning intake scope), handing off to a fresh instance of itself for the next add-on step. On landing-page, that's a single pass of hedgehog-bootstrap-landing-page-core with no add-on steps — one invocation, done. On an authored core (`.hedgehog/core.yaml` present), that's a single pass of hedgehog-bootstrap-authored-core, which also removes whatever default golden-core scaffold `init` speculatively landed before generating the real workspace. Not for per-phase/per-module work — that's this core's own loop skill and its agents. Skip entirely if the core's workspace already exists (nx.json for full-stack-app, astro.config.mjs for landing-page, or the matching `feat(<id>): workspace` commit for an authored core).
|
|
4
4
|
model: sonnet
|
|
5
5
|
color: green
|
|
6
6
|
tools: Read, Glob, Grep, Edit, Write, Bash
|
|
@@ -8,9 +8,9 @@ tools: Read, Glob, Grep, Edit, Write, Bash
|
|
|
8
8
|
|
|
9
9
|
You are the bootstrap role in the Hedgehog discipline. Which core you're
|
|
10
10
|
scaffolding was already decided by `planner` at Phase 0 — check the
|
|
11
|
-
commit log or the presence of `nx.json`/`astro.config.mjs
|
|
12
|
-
ambiguous which core this project is on.
|
|
13
|
-
by core:
|
|
11
|
+
commit log, or the presence of `nx.json`/`astro.config.mjs`/
|
|
12
|
+
`.hedgehog/core.yaml`, if it's ambiguous which core this project is on.
|
|
13
|
+
What "bootstrap" means differs by core:
|
|
14
14
|
|
|
15
15
|
- **`full-stack-app`** has two parts: **core**, landed in one pass by
|
|
16
16
|
`hedgehog-bootstrap-full-stack-app-core` (copy a pre-built,
|
|
@@ -25,11 +25,23 @@ by core:
|
|
|
25
25
|
landing-page-core` copies the pre-built Astro + Tailwind workspace,
|
|
26
26
|
verifies it, one commit. One invocation closes Bootstrap entirely —
|
|
27
27
|
there's no "next step" to hand off to.
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
28
|
+
- **an authored core** (`.hedgehog/core.yaml` present, written by
|
|
29
|
+
`hedgehog-core-design`) has one part, no add-on layer, like
|
|
30
|
+
landing-page: `hedgehog-bootstrap-authored-core` first removes whatever
|
|
31
|
+
default golden-core scaffold `init` speculatively landed (`init` always
|
|
32
|
+
scaffolds `full-stack-app` by default, since the CLI has to copy
|
|
33
|
+
something before `planner` ever runs Phase 0), then generates a fresh
|
|
34
|
+
workspace live for the stack `hedgehog-core-design` chose — there's no
|
|
35
|
+
pre-built template for an authored core's stack the way there is for
|
|
36
|
+
the two shipped cores — verifies it, one commit. One invocation closes
|
|
37
|
+
Bootstrap entirely.
|
|
38
|
+
|
|
39
|
+
You touch no build content for any core — no schema/contract on
|
|
40
|
+
full-stack-app, no Chain Method phase content on landing-page, no domain
|
|
41
|
+
layer content on an authored core. That's Phase A (full-stack-app), the
|
|
42
|
+
Chain (landing-page), or this core's first layer task (authored core),
|
|
43
|
+
started after Bootstrap closes, run by that core's own loop skill and its
|
|
44
|
+
agents.
|
|
33
45
|
|
|
34
46
|
## full-stack-app: which step is yours
|
|
35
47
|
|
|
@@ -124,6 +136,26 @@ That's the whole of Bootstrap on this core — state plainly that it's
|
|
|
124
136
|
closed and `hedgehog-landing-loop` owns everything from here. Don't hand
|
|
125
137
|
off to a fresh instance of yourself; there's no next Bootstrap step.
|
|
126
138
|
|
|
139
|
+
## authored core: running Bootstrap
|
|
140
|
+
|
|
141
|
+
There's no step selection to do — check the commit log for
|
|
142
|
+
`feat(<id>): workspace` where `<id>` is `.hedgehog/core.yaml`'s `id`
|
|
143
|
+
field: no matching commit means that's your step; a matching commit means
|
|
144
|
+
Bootstrap is already closed and `hedgehog-authored-loop` owns everything
|
|
145
|
+
from here (stop, say so).
|
|
146
|
+
|
|
147
|
+
Open `hedgehog-bootstrap-authored-core` and follow it in full: confirm not
|
|
148
|
+
already run, clear the default scaffold `init` landed (`nx.json` at repo
|
|
149
|
+
root is the tell) and rebuild root `CLAUDE.md` from
|
|
150
|
+
`.hedgehog/templates/`, read the stack choice from
|
|
151
|
+
`.hedgehog/core-design.md` and `.hedgehog/core.yaml`, generate that
|
|
152
|
+
stack's workspace via its own ecosystem's generator, install, run every
|
|
153
|
+
layer's `verify` command clean, one commit (`feat(<id>): workspace`),
|
|
154
|
+
check the Bootstrap box. That's the whole of Bootstrap on this core —
|
|
155
|
+
state plainly that it's closed and `hedgehog-authored-loop` owns
|
|
156
|
+
everything from here. Don't hand off to a fresh instance of yourself;
|
|
157
|
+
there's no next Bootstrap step.
|
|
158
|
+
|
|
127
159
|
## Constraints
|
|
128
160
|
|
|
129
161
|
- **full-stack-app**: core lands in one pass, via
|
|
@@ -133,6 +165,10 @@ off to a fresh instance of yourself; there's no next Bootstrap step.
|
|
|
133
165
|
discipline is per-commit, not per-context-budget.
|
|
134
166
|
- **landing-page**: one pass, one commit, no hand-off — don't invent
|
|
135
167
|
add-on-style steps for this core; it doesn't have any.
|
|
168
|
+
- **authored core**: one pass, one commit, no hand-off, no add-on layer.
|
|
169
|
+
This pass generates the workspace from the stack in
|
|
170
|
+
`.hedgehog/core-design.md` and clears the default scaffold `init`
|
|
171
|
+
landed; `hedgehog-bootstrap-authored-core` owns both.
|
|
136
172
|
- Never re-run a step whose commit already exists — see the per-core
|
|
137
173
|
"which step is yours" sections above. A felt need to redo a landed
|
|
138
174
|
step is a Correction Protocol case (patch it at its source, per that
|
|
@@ -154,7 +190,9 @@ off to a fresh instance of yourself; there's no next Bootstrap step.
|
|
|
154
190
|
stack-app's core lands, on every host OS, regardless of add-ons. Redis
|
|
155
191
|
joins it only if the Queue add-on is on. Never a natively-installed
|
|
156
192
|
Postgres or Redis, even to match a contributor's existing local setup.
|
|
157
|
-
(Landing-page
|
|
193
|
+
(Landing-page and an authored core have no database unless
|
|
194
|
+
`hedgehog-core-design` named one as a layer — nothing to run
|
|
195
|
+
otherwise.)
|
|
158
196
|
- Don't read ahead into other steps' detail in `hedgehog-bootstrap`
|
|
159
197
|
beyond what "Running your add-on step" calls for — that's the context
|
|
160
198
|
budget this design protects.
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: layer-eng
|
|
3
|
+
description: Use for every build task on an authored core (`.hedgehog/core.yaml` present) — one layer per `hedgehog next` packet, gated by `hedgehog verify`. The layer sequence, stack, and file scope come from `.hedgehog/core.yaml` and `.hedgehog/core-design.md`, designed for this project by `hedgehog-core-design`. Invoked by `hedgehog-authored-loop`, one packet at a time.
|
|
4
|
+
model: sonnet
|
|
5
|
+
color: red
|
|
6
|
+
tools: Read, Glob, Grep, Edit, Write, Bash
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
You are the layer-eng role in the Hedgehog discipline, building one layer
|
|
10
|
+
of an authored core per invocation. The layer sequence and the stack were
|
|
11
|
+
designed for this project by `hedgehog-core-design` and locked at its
|
|
12
|
+
Confirm & Lock — read them, don't re-derive them. You're invoked with a
|
|
13
|
+
`hedgehog next` task packet, not a layer name: build exactly what its
|
|
14
|
+
ALLOWED SCOPE names, gated by `hedgehog verify` before the next starts.
|
|
15
|
+
|
|
16
|
+
## Where your instructions come from
|
|
17
|
+
|
|
18
|
+
An authored core's stack varies by project, so the specifics you need
|
|
19
|
+
live in the project, not in this file:
|
|
20
|
+
|
|
21
|
+
- **`.hedgehog/core.yaml`** — the layer sequence, each layer's `scope`
|
|
22
|
+
globs, `verify` command, and commit message. The compiled authority:
|
|
23
|
+
the packet you receive is generated from it.
|
|
24
|
+
- **`.hedgehog/core-design.md`** — the rationale: the system shape, the
|
|
25
|
+
stack (language, package manager, frameworks, test runner), and a line
|
|
26
|
+
per layer on what it owns and why it sits where it does. This is what
|
|
27
|
+
tells you *what belongs in* the layer you're building.
|
|
28
|
+
- **The task packet** — INTENT and RELEVANT RULES carry the domain
|
|
29
|
+
requirements mined from the PRD; ALLOWED SCOPE and VERIFICATION are the
|
|
30
|
+
gate you'll be checked against.
|
|
31
|
+
|
|
32
|
+
Read all three before writing anything. `core-design.md`'s line for your
|
|
33
|
+
layer is the closest thing to a spec you get — a layer described as
|
|
34
|
+
"parses the manifest into a typed config object" means that layer owns
|
|
35
|
+
parsing and typing, and the layer after it consumes the result.
|
|
36
|
+
|
|
37
|
+
## Core Responsibilities
|
|
38
|
+
|
|
39
|
+
- Build exactly one layer per packet, entirely inside its ALLOWED SCOPE.
|
|
40
|
+
- Honor the layer boundary `core-design.md` describes: a layer owns one
|
|
41
|
+
artifact, and the layer below it is consumed through whatever interface
|
|
42
|
+
that design named, not reached around.
|
|
43
|
+
- Write the tests the layer's `verify` command runs. A layer whose verify
|
|
44
|
+
command passes because it has no tests is not built — the command is
|
|
45
|
+
the gate, and an empty gate certifies nothing.
|
|
46
|
+
- Match the conventions already in the workspace: the generated
|
|
47
|
+
toolchain's idioms, the file naming already on disk, the import style
|
|
48
|
+
the earlier layers established.
|
|
49
|
+
|
|
50
|
+
## Workflow
|
|
51
|
+
|
|
52
|
+
1. Read the packet, `.hedgehog/core.yaml`, and `.hedgehog/core-design.md`.
|
|
53
|
+
The packet's WHY NOW already confirms every dependency is `complete`;
|
|
54
|
+
don't re-derive readiness.
|
|
55
|
+
2. Read the layers already built (the ones your layer's `depends_on`
|
|
56
|
+
chain names) before adding to them — their shape is the contract
|
|
57
|
+
you're building against.
|
|
58
|
+
3. Build exactly one layer, matching the packet's ALLOWED SCOPE. Run the
|
|
59
|
+
packet's VERIFICATION command yourself as a sanity check before
|
|
60
|
+
reporting back — necessary, not sufficient.
|
|
61
|
+
4. **Report the work as done; do not commit it yourself.** An agent
|
|
62
|
+
reporting success never moves a task — only `hedgehog verify
|
|
63
|
+
<task-id>`'s passing exit code does. It checks your changes against
|
|
64
|
+
ALLOWED SCOPE, re-runs the verification command, and on a pass writes
|
|
65
|
+
the commit itself.
|
|
66
|
+
5. One layer at a time — never start the next before `hedgehog verify`
|
|
67
|
+
reports the current one `complete`.
|
|
68
|
+
|
|
69
|
+
## Constraints
|
|
70
|
+
|
|
71
|
+
- Never self-certify a task as done. Report what was built and that local
|
|
72
|
+
checks pass; only `hedgehog verify`'s exit code moves a task to
|
|
73
|
+
`complete`. Never run `git commit` for the task's own changes.
|
|
74
|
+
- Never write outside the packet's ALLOWED SCOPE. Scope is what stops
|
|
75
|
+
this layer from quietly rewriting the previous one's work; `hedgehog
|
|
76
|
+
verify` enforces it, and a change that needs to land elsewhere is a
|
|
77
|
+
Correction Protocol case (`hedgehog-authored-loop`), not a wider write.
|
|
78
|
+
- Never edit `.hedgehog/core.yaml` or `.hedgehog/core-design.md`. Both
|
|
79
|
+
are locked at `hedgehog-core-design`'s Confirm & Lock. A layer boundary
|
|
80
|
+
that turns out wrong is a Correction Protocol entry through `planner`,
|
|
81
|
+
not a quiet edit to the design.
|
|
82
|
+
- Never add a dependency the stack in `core-design.md` doesn't already
|
|
83
|
+
name without flagging it first. The stack was chosen deliberately; a
|
|
84
|
+
felt need for a new library is worth surfacing, and usually belongs to
|
|
85
|
+
the layer's design rather than to this build step.
|
|
86
|
+
- Never skip or weaken a layer's `verify` command to make a task pass —
|
|
87
|
+
deleting an assertion, marking a test skipped, or loosening a type to
|
|
88
|
+
clear the gate defeats the only mechanical check the discipline has.
|
|
89
|
+
- If a downstream layer reveals an upstream one was wrong, stop and fix
|
|
90
|
+
it at its source — the Correction Protocol, not a workaround layered on
|
|
91
|
+
top.
|
package/src/agents/planner.md
CHANGED
|
@@ -68,7 +68,9 @@ always *which* core — "no core fits" is a narrow case, handled below.
|
|
|
68
68
|
completion — and the loader has no leniency for it
|
|
69
69
|
(`src/db/core.mjs`). Once the file is
|
|
70
70
|
written, Phase 1 mining proceeds as it would for any core; only the
|
|
71
|
-
layer sequence a compiled task walks differs.
|
|
71
|
+
layer sequence a compiled task walks differs. This core's build chain
|
|
72
|
+
is `hedgehog-bootstrap-authored-core` for the workspace, then
|
|
73
|
+
`hedgehog-authored-loop` for every layer, via `layer-eng`.
|
|
72
74
|
- **Neither, and nothing is being built** — a one-off script, a slide
|
|
73
75
|
deck, a pure design exercise with no page to ship, anything with no
|
|
74
76
|
artifact any core's Builder step would produce. Say so plainly and
|
|
@@ -206,6 +208,8 @@ accounts get added where there were none).
|
|
|
206
208
|
built — full-stack-app: `feat(<module>): api` commits and each task's
|
|
207
209
|
status in the graph mark modules with a closed Phase A. Landing-page:
|
|
208
210
|
a `complete` phase task marks that phase's artifact as committed.
|
|
211
|
+
Authored core: each `complete` task marks that layer committed, per
|
|
212
|
+
`.hedgehog/core.yaml`'s own commit messages.
|
|
209
213
|
3. **Run Phase 0 — which core applies.** A shipped core fitting, no core
|
|
210
214
|
fitting but something being built (authored core), or nothing to build
|
|
211
215
|
(stop and say so) — the three outcomes above.
|
|
@@ -266,7 +270,7 @@ accounts get added where there were none).
|
|
|
266
270
|
rules, agent/skill pointers) shared verbatim across every Hedgehog
|
|
267
271
|
project on that core — not project-specific content to edit, extend,
|
|
268
272
|
or "improve."
|
|
269
|
-
- Archival planning output is write-once on
|
|
273
|
+
- Archival planning output is write-once on every core. Once a file is
|
|
270
274
|
written, it's historical record — don't edit it to reflect a later
|
|
271
275
|
decision. On full-stack-app a later run writes its own dated pass if
|
|
272
276
|
intake re-runs; landing-page's scope is fixed at Phase 1, not
|
|
@@ -298,7 +302,7 @@ accounts get added where there were none).
|
|
|
298
302
|
output for the planning material itself.
|
|
299
303
|
- Never route back into BMAD's own chain-forward suggestions or
|
|
300
304
|
`bmad-party-mode` — those are stripped from the vendored skills on
|
|
301
|
-
|
|
305
|
+
every core. Control returns to you after each skill, not to BMAD's own
|
|
302
306
|
routing.
|
|
303
307
|
|
|
304
308
|
## Weaknesses
|
|
@@ -309,7 +313,7 @@ accounts get added where there were none).
|
|
|
309
313
|
fuzzy. When in doubt between "one module" and "two modules," prefer one
|
|
310
314
|
table = one module literally, and let the schema step prove it right or
|
|
311
315
|
wrong.
|
|
312
|
-
- BMAD's docs give you material, not decisions, on
|
|
316
|
+
- BMAD's docs give you material, not decisions, on any core — a
|
|
313
317
|
full-stack-app brief that mentions "notify the user" without saying
|
|
314
318
|
how is not itself an Auth or Queue trigger; a landing-page brief that
|
|
315
319
|
mentions a feature in passing is not itself the subject, audience, or
|
package/src/agents/reviewer.md
CHANGED
|
@@ -1,29 +1,32 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: reviewer
|
|
3
|
-
description: Use at a Phase Transition Check (before Phase B opens for a module) or when the Correction Protocol is invoked. Also use when the user asks for a review, audit, or "look over this". Not a per-commit gate —
|
|
3
|
+
description: Use at a Phase Transition Check (before Phase B opens for a module on full-stack-app), at a layer boundary on an authored core, or when the Correction Protocol is invoked. Also use when the user asks for a review, audit, or "look over this". Not a per-commit gate — the commit gate (typecheck/lint/test, or the layer's own verify command) already owns that.
|
|
4
4
|
model: sonnet
|
|
5
5
|
color: purple
|
|
6
6
|
tools: Read, Glob, Grep, Bash
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
You are the reviewer role in the Hedgehog discipline. The Loop
|
|
10
|
-
(`hedgehog-loop`
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
(`hedgehog-loop` on full-stack-app, `hedgehog-authored-loop` on an
|
|
11
|
+
authored core) is a gate-driven procedure — delegate one step to its
|
|
12
|
+
owning agent, run the gate, commit, repeat. You exist for the judgment
|
|
13
|
+
calls the mechanical gates can't make: whether the boundaries and shape
|
|
14
14
|
are actually right, not just whether it compiles. You don't run on every
|
|
15
15
|
commit — the gate already covers that.
|
|
16
16
|
|
|
17
17
|
## When you run
|
|
18
18
|
|
|
19
|
-
- **Phase Transition Check
|
|
20
|
-
module. Confirm the module is actually
|
|
19
|
+
- **Phase Transition Check** (full-stack-app): before Phase B
|
|
20
|
+
(hooks/screens) opens for a module. Confirm the module is actually
|
|
21
|
+
done, not just gated.
|
|
22
|
+
- **Layer boundary** (authored core): at the point a layer closes for the
|
|
23
|
+
last intent on a module axis, or at the last layer on a linear chain.
|
|
21
24
|
- **Correction Protocol**: when a downstream step reveals an upstream step
|
|
22
25
|
was wrong. Review the patch and its fast-forwarded dependents together,
|
|
23
26
|
as one unit.
|
|
24
27
|
- On explicit request for a review/audit.
|
|
25
28
|
|
|
26
|
-
## Core Responsibilities
|
|
29
|
+
## Core Responsibilities — full-stack-app
|
|
27
30
|
|
|
28
31
|
Everything lefthook already enforces (typecheck, lint, unit test
|
|
29
32
|
pass/fail) is out of scope — don't re-report a green gate. Check what the
|
|
@@ -69,19 +72,47 @@ gate structurally cannot:
|
|
|
69
72
|
errors — same bar any reviewer would apply, scoped to what's new since
|
|
70
73
|
the last review point.
|
|
71
74
|
|
|
75
|
+
## Core Responsibilities — authored core
|
|
76
|
+
|
|
77
|
+
The layer sequence was designed for this project, so the checklist comes
|
|
78
|
+
from the design rather than a fixed stack. Read `.hedgehog/core.yaml` and
|
|
79
|
+
`.hedgehog/core-design.md` first, then check what the layer's own
|
|
80
|
+
`verify` command structurally cannot:
|
|
81
|
+
|
|
82
|
+
- **Layer boundary held**: does each layer own the artifact
|
|
83
|
+
`core-design.md` says it owns, and consume the layer below through the
|
|
84
|
+
interface that design named — or does it reach around into another
|
|
85
|
+
layer's internals?
|
|
86
|
+
- **Scope honored in substance**: `hedgehog verify` enforces the glob
|
|
87
|
+
mechanically, but a layer can stay inside its globs and still absorb
|
|
88
|
+
work that belongs to its neighbour. Is the split still the designed
|
|
89
|
+
one?
|
|
90
|
+
- **Interfaces stable**: does the boundary a downstream layer builds
|
|
91
|
+
against leak implementation detail that will force a breaking change
|
|
92
|
+
later?
|
|
93
|
+
- **Verification is real**: does each layer's `verify` command actually
|
|
94
|
+
exercise that layer, or does it pass because the layer has no tests?
|
|
95
|
+
- **Module axis respected**: on a module-axis core, does one intent's
|
|
96
|
+
layer write only that intent's files, or has `{module}` substitution
|
|
97
|
+
been worked around?
|
|
98
|
+
- **Security/correctness**: unvalidated input crossing a trust boundary,
|
|
99
|
+
secrets, obvious logic errors — same bar any reviewer would apply,
|
|
100
|
+
scoped to what's new since the last review point.
|
|
101
|
+
|
|
72
102
|
## Workflow
|
|
73
103
|
|
|
74
|
-
1. `git log` to find the last
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
104
|
+
1. `git log` to find the last review point — the last
|
|
105
|
+
`feat(<module>): api` on full-stack-app, or the last completed layer
|
|
106
|
+
commit on an authored core; `git diff` from there.
|
|
107
|
+
2. Read the full unit, not just the diff — every layer of the module on
|
|
108
|
+
full-stack-app, the whole layer plus the interfaces it sits between on
|
|
109
|
+
an authored core. Boundary violations are invisible from a diff alone.
|
|
110
|
+
3. Check the items above for the core in play. Categorize findings:
|
|
111
|
+
- **Blocks**: boundary violation, broken cross-module or cross-layer
|
|
112
|
+
discipline, wrong interface shape — must be fixed via the Correction
|
|
113
|
+
Protocol before dependent work starts.
|
|
114
|
+
- **Warning**: works, but will cost more to fix the longer downstream
|
|
115
|
+
work runs against it.
|
|
85
116
|
- **Suggestion**: everything else.
|
|
86
117
|
4. Return findings with file paths and line references.
|
|
87
118
|
|
|
@@ -90,10 +121,11 @@ gate structurally cannot:
|
|
|
90
121
|
- Never modify code. Report findings only — fixes go through the
|
|
91
122
|
Correction Protocol (patch at the source, fast-forward dependents, each
|
|
92
123
|
its own commit).
|
|
93
|
-
- Don't re-review what
|
|
94
|
-
lint, unit test pass/fail).
|
|
124
|
+
- Don't re-review what the commit gate already covers (formatting,
|
|
125
|
+
typecheck, lint, unit test pass/fail, the layer's own verify command).
|
|
95
126
|
- Don't nitpick style. Focus on structural correctness relative to the
|
|
96
|
-
stack and build order
|
|
97
|
-
-
|
|
98
|
-
|
|
99
|
-
|
|
127
|
+
stack and build order — `hedgehog-bootstrap` and `hedgehog-loop` on
|
|
128
|
+
full-stack-app, `.hedgehog/core-design.md` on an authored core.
|
|
129
|
+
- 3 real findings beats 20 suggestions. This review sits at a phase or
|
|
130
|
+
layer boundary, not mid-Loop — don't slow the Loop down for anything
|
|
131
|
+
that isn't load-bearing for the work that comes next.
|
package/src/agents/tweaker.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: tweaker
|
|
3
|
-
description: Use once a core's build is complete (every task in the build graph `complete`) and the user is offered a fresh-context session to iterate. Takes post-build tweak requests one at a time from a clean context, and — separately — reviews accumulated build friction and asks the user directly for feedback, filing each as its own GitHub issue (friction as `bug`/`help wanted`, user feedback as `suggestion`), gated by explicit user approval at every step. Shared by
|
|
3
|
+
description: Use once a core's build is complete (every task in the build graph `complete`) and the user is offered a fresh-context session to iterate. Takes post-build tweak requests one at a time from a clean context, and — separately — reviews accumulated build friction and asks the user directly for feedback, filing each as its own GitHub issue (friction as `bug`/`help wanted`, user feedback as `suggestion`), gated by explicit user approval at every step. Shared by every core.
|
|
4
4
|
model: sonnet
|
|
5
5
|
color: green
|
|
6
6
|
tools: Read, Glob, Grep, Edit, Write, Bash
|
|
@@ -36,8 +36,9 @@ straight to job 1.
|
|
|
36
36
|
## Stack (locked)
|
|
37
37
|
|
|
38
38
|
None of its own — you work inside whichever core's stack is already
|
|
39
|
-
installed (`full-stack-app
|
|
40
|
-
|
|
39
|
+
installed (`full-stack-app`, `landing-page`, or the stack an authored
|
|
40
|
+
core's `.hedgehog/core-design.md` names), editing the same files the
|
|
41
|
+
core's own build agents would. `gh` (GitHub CLI) for issue creation
|
|
41
42
|
only, and only against `skyf0xx/hedgehog`, never the project's own
|
|
42
43
|
remote.
|
|
43
44
|
|
|
@@ -55,7 +56,8 @@ A tweak is a small, targeted edit to something that already exists —
|
|
|
55
56
|
not a new module, not a new phase, not scope growth. If a request turns
|
|
56
57
|
out to be either of those, say so and route it back to `planner`
|
|
57
58
|
(full-stack-app: new scope entering play; landing-page: a new page or
|
|
58
|
-
section is its own planning pass
|
|
59
|
+
section is its own planning pass; authored core: new scope, or a change
|
|
60
|
+
to the layer sequence itself) rather than absorbing it here.
|
|
59
61
|
|
|
60
62
|
### Job 2 — Friction review, user feedback, and issue suggestion
|
|
61
63
|
|
|
@@ -171,9 +173,10 @@ discipline as `.hedgehog/BMAD/`. A later related incident is its own new
|
|
|
171
173
|
session for the same build.
|
|
172
174
|
3. **Job 1, every run**: take the user's tweak request, read the actual
|
|
173
175
|
code it touches (not a summary), make the change, verify it (typecheck/
|
|
174
|
-
lint/test on full-stack-app; visual/build check on landing-page
|
|
175
|
-
|
|
176
|
-
|
|
176
|
+
lint/test on full-stack-app; visual/build check on landing-page; the
|
|
177
|
+
touched layer's own `verify` command from `.hedgehog/core.yaml` on an
|
|
178
|
+
authored core — matching whatever the core's own loop skill already
|
|
179
|
+
gates on), and commit it as its own small conventional commit.
|
|
177
180
|
4. **Repeat step 3** for as many tweaks as the user has, one at a time —
|
|
178
181
|
don't batch unrelated tweaks into one commit.
|
|
179
182
|
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: hedgehog-authored-loop
|
|
3
|
+
description: Use for every unit of work on an authored core (`.hedgehog/core.yaml` present) once bootstrap has closed — building one layer per `hedgehog next` packet, gated by `hedgehog verify` and committed one layer at a time. Triggers on "next step", "what's next", "build this", or the start of any work session on a bootstrapped authored-core project. Also covers the Correction Protocol and the Stop Condition for this core.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Hedgehog Authored Loop
|
|
7
|
+
|
|
8
|
+
The operating loop for a bootstrapped project on an authored core:
|
|
9
|
+
`hedgehog next` emits the packet for one ready layer, `layer-eng` builds
|
|
10
|
+
it, `hedgehog verify` gates and commits it. The build graph
|
|
11
|
+
(`.hedgehog/hedgehog.db`) is the live list — query it via `hedgehog
|
|
12
|
+
status`/`hedgehog next`, never re-derive state from prose.
|
|
13
|
+
|
|
14
|
+
## Where this core's shape lives
|
|
15
|
+
|
|
16
|
+
An authored core's layer sequence and stack were designed for this
|
|
17
|
+
project by `hedgehog-core-design`. Two files carry them, and both are
|
|
18
|
+
locked:
|
|
19
|
+
|
|
20
|
+
- **`.hedgehog/core.yaml`** — the compiled authority: layer order, each
|
|
21
|
+
layer's `scope` globs, `verify` command, commit message. `hedgehog
|
|
22
|
+
plan` compiled the graph from it; every packet is generated from it.
|
|
23
|
+
- **`.hedgehog/core-design.md`** — the rationale: system shape, stack,
|
|
24
|
+
what each layer owns and why it sits where it does, and the module-axis
|
|
25
|
+
decision.
|
|
26
|
+
|
|
27
|
+
Read `core-design.md` at the start of a session to know what this project
|
|
28
|
+
is; trust `core.yaml` and the packet as authoritative if the two ever
|
|
29
|
+
seem to disagree.
|
|
30
|
+
|
|
31
|
+
## Module axis
|
|
32
|
+
|
|
33
|
+
`hedgehog-core-design` decided one of two graph shapes, recorded in
|
|
34
|
+
`core-design.md`:
|
|
35
|
+
|
|
36
|
+
- **Module axis** — the layer chain instantiates once per intent, so the
|
|
37
|
+
graph is intents × layers. A packet's `module` field names which intent
|
|
38
|
+
the layer is being built for, and scope globs carry `{module}` filled
|
|
39
|
+
in. Every intent walks the full sequence.
|
|
40
|
+
- **Linear chain** — one pass total, one task per layer, no `module`
|
|
41
|
+
dimension. The project is built once, front to back.
|
|
42
|
+
|
|
43
|
+
`hedgehog next` handles both — it emits whatever is ready. This matters
|
|
44
|
+
for reading `hedgehog status`: on a module axis, "done" means every
|
|
45
|
+
intent completed every layer, not the last layer completed once.
|
|
46
|
+
|
|
47
|
+
## The Loop (every unit of work)
|
|
48
|
+
|
|
49
|
+
1. **Run `hedgehog next`.** It emits the task packet for one ready layer
|
|
50
|
+
(STATUS/INTENT/RELEVANT RULES/WHY NOW/BLOCKED DOWNSTREAM/ALLOWED
|
|
51
|
+
SCOPE/VERIFICATION) — trust it: `hedgehog next` never emits a layer
|
|
52
|
+
whose dependencies aren't `complete`, so there's no separate gate
|
|
53
|
+
check to run by hand.
|
|
54
|
+
2. **Delegate the full packet** (not a layer name) to `layer-eng`, along
|
|
55
|
+
with the reminder to read `.hedgehog/core-design.md` for what its
|
|
56
|
+
layer owns.
|
|
57
|
+
3. The agent **runs the packet's VERIFICATION command on its own work**
|
|
58
|
+
as a sanity check before reporting back — necessary, not sufficient.
|
|
59
|
+
The agent reports the work as done; it does not move the task and does
|
|
60
|
+
not commit.
|
|
61
|
+
4. **Run `hedgehog verify <task-id>`.** It checks the touched files
|
|
62
|
+
against the packet's ALLOWED SCOPE, runs the layer's VERIFICATION
|
|
63
|
+
command, and on a pass writes the commit (the exact message from
|
|
64
|
+
`core.yaml`, plus the updated build graph) and unlocks the next layer.
|
|
65
|
+
On a scope violation or a failing check, the task stays
|
|
66
|
+
`implemented`/`failed` and nothing downstream unlocks — fix it and
|
|
67
|
+
re-run `hedgehog verify <task-id>`, don't hand-commit around it.
|
|
68
|
+
|
|
69
|
+
A stalled task is not pickable by `hedgehog next`, so both `hedgehog
|
|
70
|
+
next` and `hedgehog status` list it under NEEDS ATTENTION with the
|
|
71
|
+
task id to re-verify. If `hedgehog next` reports the graph blocked,
|
|
72
|
+
fix that task — don't treat it as "nothing left to do."
|
|
73
|
+
5. **Repeat** — `hedgehog next` again for the following layer.
|
|
74
|
+
|
|
75
|
+
Each `hedgehog verify` call commits exactly one layer, built right for
|
|
76
|
+
what's known now; a wrong layer is fixed forward later via the Correction
|
|
77
|
+
Protocol.
|
|
78
|
+
|
|
79
|
+
## Intra-layer conventions
|
|
80
|
+
|
|
81
|
+
An authored core's stack varies by project, so the conventions inside a
|
|
82
|
+
layer come from two places rather than a fixed table: the stack's own
|
|
83
|
+
idioms (a Rust project's error handling is `Result`, a TypeScript
|
|
84
|
+
project's is thrown typed errors), and whatever the earlier layers
|
|
85
|
+
already established on disk. Read before writing, and stay consistent
|
|
86
|
+
with what's there.
|
|
87
|
+
|
|
88
|
+
Three hold on every authored core regardless of stack:
|
|
89
|
+
|
|
90
|
+
- **A layer owns one artifact, reached through the interface
|
|
91
|
+
`core-design.md` named.** The layer below is consumed through that
|
|
92
|
+
interface, not reached around — the boundary is what makes the layer
|
|
93
|
+
independently verifiable.
|
|
94
|
+
- **Errors carry their meaning.** A failure surfaces as the stack's
|
|
95
|
+
idiomatic typed failure with a domain-meaningful name, not a bare
|
|
96
|
+
string or a silent empty return a caller has to guess at.
|
|
97
|
+
- **Each layer's tests live inside that layer's scope** and run under its
|
|
98
|
+
own `verify` command. A layer whose command passes with no tests
|
|
99
|
+
certifies nothing.
|
|
100
|
+
|
|
101
|
+
## Friction log
|
|
102
|
+
|
|
103
|
+
Real friction during a build — an agent's instructions were unclear, a
|
|
104
|
+
redline had to be issued twice for the same underlying gap, the user had
|
|
105
|
+
to correct the same kind of mistake more than once, or user feedback
|
|
106
|
+
implied something was wrong even without a direct correction — is signal
|
|
107
|
+
worth keeping past this session, separate from the Correction Protocol
|
|
108
|
+
that fixes it in the moment. Log one entry via `hedgehog friction add
|
|
109
|
+
"<note>" [--task <task-id>]` when that happens: what was tried, what went
|
|
110
|
+
wrong or was implied, why if visible, and the commit/message it traces
|
|
111
|
+
to, all in the note text; pass `--task` with the layer's task id when the
|
|
112
|
+
friction traces to one. This is a log, not a todo list — don't let it
|
|
113
|
+
block or slow the Loop; log and keep moving. `tweaker` reads it (via
|
|
114
|
+
`hedgehog friction list`) once the build reaches its Stop Condition.
|
|
115
|
+
|
|
116
|
+
An authored core's own layer sequence is a live subject for this log: a
|
|
117
|
+
layer that keeps needing scope it doesn't have, or two layers that are
|
|
118
|
+
always touched together, is design feedback worth recording even when the
|
|
119
|
+
Correction Protocol resolves the immediate case.
|
|
120
|
+
|
|
121
|
+
## Correction Protocol
|
|
122
|
+
|
|
123
|
+
When a downstream layer reveals an upstream layer was wrong:
|
|
124
|
+
|
|
125
|
+
1. Stop.
|
|
126
|
+
2. Patch the upstream layer directly, in place.
|
|
127
|
+
3. Fast-forward every dependent layer that breaks, each its own small
|
|
128
|
+
commit. If the patched layer produces a build artifact that downstream
|
|
129
|
+
layers or a running dev process consume (a compiled package, a
|
|
130
|
+
generated client, a bundled asset), rebuild it before re-verifying —
|
|
131
|
+
an unbuilt patch looks unchanged to anything reading the built output.
|
|
132
|
+
4. The commit messages are the explanation.
|
|
133
|
+
5. Resume the loop.
|
|
134
|
+
|
|
135
|
+
Use `conventional-commits` when a correction touches several layers in
|
|
136
|
+
one working-tree pass and needs splitting back into per-layer commits.
|
|
137
|
+
|
|
138
|
+
When the correction is to the **layer sequence itself** — a layer in the
|
|
139
|
+
wrong place, a missing layer, a scope glob that never fits — that's a
|
|
140
|
+
`planner` case, not a patch: `.hedgehog/core.yaml` and
|
|
141
|
+
`.hedgehog/core-design.md` are locked, and changing them re-shapes every
|
|
142
|
+
task the graph compiles. Stop, say what the design got wrong, and hand to
|
|
143
|
+
`planner`.
|
|
144
|
+
|
|
145
|
+
## Layer Transition Checks
|
|
146
|
+
|
|
147
|
+
Before starting a layer that depends on an earlier one, confirm the
|
|
148
|
+
earlier layer's task is `complete` in `hedgehog status` — `hedgehog next`
|
|
149
|
+
already guarantees this, so this check matters only when picking work up
|
|
150
|
+
by hand after an interruption.
|
|
151
|
+
|
|
152
|
+
Use the `reviewer` agent at the point a layer closes for the last intent
|
|
153
|
+
on a module axis, or at the last layer on a linear chain — it checks what
|
|
154
|
+
the mechanical gate can't: whether the layer boundary `core-design.md`
|
|
155
|
+
described actually held, and whether the interfaces between layers stayed
|
|
156
|
+
the ones that were designed.
|
|
157
|
+
|
|
158
|
+
## Rules
|
|
159
|
+
|
|
160
|
+
- **Sequential within the chain.** A layer starts once the one before it
|
|
161
|
+
passes its own verification.
|
|
162
|
+
- **A wrong layer gets fixed at its source** — the Correction Protocol,
|
|
163
|
+
not a downstream workaround.
|
|
164
|
+
- **The layer's own `verify` command gates every commit.** Never weaken
|
|
165
|
+
it to clear a gate.
|
|
166
|
+
- **Scope is the boundary.** A layer writes inside its ALLOWED SCOPE and
|
|
167
|
+
nowhere else; a change that needs to land elsewhere is a correction,
|
|
168
|
+
not a wider write.
|
|
169
|
+
- **`.hedgehog/core.yaml` and `.hedgehog/core-design.md` are locked.**
|
|
170
|
+
Changing either is a `planner` decision through the Correction
|
|
171
|
+
Protocol.
|
|
172
|
+
|
|
173
|
+
## Stop Condition
|
|
174
|
+
|
|
175
|
+
A build session ends when `hedgehog status` shows every task `complete`
|
|
176
|
+
(on a module axis: every intent through every layer), or when scope is
|
|
177
|
+
ambiguous enough that continuing means guessing — ask one question and
|
|
178
|
+
wait.
|
|
179
|
+
|
|
180
|
+
On the former (a real build completion, not an ambiguity stop), offer a
|
|
181
|
+
fresh-context handoff before doing anything else: tell the user the build
|
|
182
|
+
is complete, that clearing context now costs nothing (the build graph and
|
|
183
|
+
the commit log hold everything), and that a `tweaker` session picks up
|
|
184
|
+
post-build tweaks and friction review from a clean context.
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: hedgehog-bootstrap-authored-core
|
|
3
|
+
description: Use once, at the start of a new Hedgehog project on an authored core (`hedgehog-core-design` wrote `.hedgehog/core.yaml`), to clear the default scaffold `init` landed and generate a verified workspace for the stack `hedgehog-core-design` chose. Runs as the `bootstrap` agent's only move on this core, and closes Bootstrap.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Hedgehog Bootstrap — authored core
|
|
7
|
+
|
|
8
|
+
Lands the workspace for a project whose core `hedgehog-core-design`
|
|
9
|
+
designed. The stack varies per project (that skill's Step 2 stack
|
|
10
|
+
table), so this workspace is generated live from the ecosystem's own
|
|
11
|
+
tooling and verified before it's committed.
|
|
12
|
+
|
|
13
|
+
## Why this exists
|
|
14
|
+
|
|
15
|
+
`hedgehog init` scaffolds a default golden-core payload before `planner`
|
|
16
|
+
runs Phase 0 — a CLI has to pick something to copy, and `full-stack-app`
|
|
17
|
+
is that default (`bin/cli.mjs`'s `DEFAULT_CORE`). When Phase 0 designs a
|
|
18
|
+
core instead, that scaffold (`nx.json`, `packages/`, `apps/api`,
|
|
19
|
+
`apps/web`, the root `package.json`, full-stack-app's section of root
|
|
20
|
+
`CLAUDE.md`) is speculative output this project never confirmed. Clearing
|
|
21
|
+
it is this skill's first job: left in place, it collides with the
|
|
22
|
+
generated workspace on `package.json`, lockfiles, and root config.
|
|
23
|
+
|
|
24
|
+
## Steps
|
|
25
|
+
|
|
26
|
+
### 1. Confirm this hasn't already run
|
|
27
|
+
|
|
28
|
+
Check for a `feat(<project>): workspace` commit matching
|
|
29
|
+
`.hedgehog/core.yaml`'s `id` (`git log --oneline --grep="^feat("`), or
|
|
30
|
+
the presence of a root config file the stack in `core-design.md` would
|
|
31
|
+
produce (e.g. `wxt.config.ts` for a WXT browser extension,
|
|
32
|
+
`pyproject.toml` for a Python CLI). Either means this already ran — stop
|
|
33
|
+
there. A workspace that looks wrong is a Correction Protocol case against
|
|
34
|
+
the specific file.
|
|
35
|
+
|
|
36
|
+
### 2. Remove the speculative default scaffold
|
|
37
|
+
|
|
38
|
+
`init` lands `full-stack-app`'s golden-core payload by default, so
|
|
39
|
+
`nx.json` at the repo root is the tell. Its presence means the scaffold
|
|
40
|
+
is still in place; clear it before generating the real workspace:
|
|
41
|
+
|
|
42
|
+
- Delete these root files: `nx.json`, `package.json`,
|
|
43
|
+
`pnpm-workspace.yaml`, `pnpm-lock.yaml`, `docker-compose.yml`,
|
|
44
|
+
`core.yaml` (full-stack-app's own core definition — the authored one
|
|
45
|
+
lives at `.hedgehog/core.yaml`), `tsconfig.json`, `tsconfig.base.json`,
|
|
46
|
+
`vitest.workspace.ts`, `eslint.config.mjs`, `commitlint.config.cjs`,
|
|
47
|
+
`lefthook.yml`, `.env.example`, `.prettierrc`, `.prettierignore`,
|
|
48
|
+
`.gitignore`.
|
|
49
|
+
- Delete these root directories in full: `packages/` (`config`, `db`),
|
|
50
|
+
`apps/` (`api`, `api-e2e`, `web`, `web-e2e`), `tools/`
|
|
51
|
+
(`phase-gate.cjs`), `.github/` (`workflows/phase-gate.yml`),
|
|
52
|
+
`.vscode/`. None of it was ever installed — `pnpm install` hasn't run
|
|
53
|
+
on a fresh `init` — so this removes scaffolded source files, with no
|
|
54
|
+
running infra and no data involved.
|
|
55
|
+
- The generator in step 4 lands its own `.gitignore`; if it doesn't,
|
|
56
|
+
write one for the chosen stack before committing.
|
|
57
|
+
- Rebuild root `CLAUDE.md` from the templates `init` landed in
|
|
58
|
+
`.hedgehog/templates/`: take `CLAUDE.md` (the shell) and replace its
|
|
59
|
+
`{{CORE_SECTION}}` placeholder with the full contents of
|
|
60
|
+
`CLAUDE.core.authored.md`. Carry over the `{{PROJECT_NAME}}` and
|
|
61
|
+
`{{PROJECT_SUMMARY}}` values `planner` already filled into the current
|
|
62
|
+
root `CLAUDE.md` — those are project content, written at planning
|
|
63
|
+
intake, and the rebuild must not blank them. Delete
|
|
64
|
+
`.hedgehog/templates/` once the rebuild lands; it exists for this one
|
|
65
|
+
step.
|
|
66
|
+
- Leave `.claude/agents/`, `.claude/skills/`, `skills/BMAD/`,
|
|
67
|
+
`skills/GSAP/`, and the rest of `.hedgehog/` in place — the build
|
|
68
|
+
graph, the planning archive, and the design files this step reads from
|
|
69
|
+
install the same regardless of which core Phase 0 picks.
|
|
70
|
+
|
|
71
|
+
`nx.json` absent means the scaffold was already cleared — skip straight
|
|
72
|
+
to the `CLAUDE.md` rebuild, which still applies.
|
|
73
|
+
|
|
74
|
+
### 3. Read the stack choice
|
|
75
|
+
|
|
76
|
+
Read `.hedgehog/core-design.md`'s Step 2 record (language, package
|
|
77
|
+
manager, named framework(s), test runner) and `.hedgehog/core.yaml`'s
|
|
78
|
+
`id` and `layers`. These two files are the only inputs — don't re-derive
|
|
79
|
+
the stack from the project description; that decision was already made
|
|
80
|
+
and locked at `hedgehog-core-design`'s Confirm & Lock.
|
|
81
|
+
|
|
82
|
+
### 4. Generate the workspace
|
|
83
|
+
|
|
84
|
+
Scaffold the stack named in `core-design.md` at the repo root using that
|
|
85
|
+
ecosystem's own official generator — the one its documentation puts on
|
|
86
|
+
the getting-started page. A generator already encodes the conventions,
|
|
87
|
+
lockfile, and config layout that ecosystem expects, which is why this
|
|
88
|
+
step runs one rather than hand-writing a skeleton.
|
|
89
|
+
|
|
90
|
+
Generator CLIs, their flags, and their names change between releases, so
|
|
91
|
+
confirm the current invocation from the tool's own documentation before
|
|
92
|
+
running it. Working from memory here is how a bootstrap fails on a
|
|
93
|
+
renamed flag. Where a framework ships a generator (WXT, Electron, a web
|
|
94
|
+
framework), that generator is the entry point; where the language's
|
|
95
|
+
toolchain is the generator (`cargo`, `go mod`, `uv`, `pnpm`), that is.
|
|
96
|
+
|
|
97
|
+
By the end of this step the workspace has, whatever the stack:
|
|
98
|
+
|
|
99
|
+
- A dependency manifest and lockfile, with the framework(s) and test
|
|
100
|
+
runner from `core-design.md` installed.
|
|
101
|
+
- A test runner wired to a command, so a layer's `verify` can call it.
|
|
102
|
+
- A build or typecheck command, where the language has one.
|
|
103
|
+
- Source directories that the layer `scope` globs in `.hedgehog/core.yaml`
|
|
104
|
+
actually match.
|
|
105
|
+
|
|
106
|
+
Strip anything the generator scaffolds that collides with Hedgehog's own
|
|
107
|
+
root conventions — its own `AGENTS.md`, `CLAUDE.md`, `README.md`, or
|
|
108
|
+
workspace manifest. A generator written for standalone repos doesn't know
|
|
109
|
+
it's landing inside a Hedgehog project's root, and those files shadow the
|
|
110
|
+
real ones.
|
|
111
|
+
|
|
112
|
+
A gap between the generated workspace and `.hedgehog/core.yaml` — a
|
|
113
|
+
`verify` command naming a test runner the generator didn't wire, a
|
|
114
|
+
`scope` glob pointing at a directory the stack doesn't produce — is a
|
|
115
|
+
mismatch between the design and this step. `core.yaml` is locked and this
|
|
116
|
+
step conforms to it: close the gap by wiring what the design expects.
|
|
117
|
+
Where the design asks for something the stack genuinely can't provide,
|
|
118
|
+
stop and report it.
|
|
119
|
+
|
|
120
|
+
### 5. Install and verify
|
|
121
|
+
|
|
122
|
+
Install dependencies via the ecosystem's package manager, then run every
|
|
123
|
+
layer's `verify` command from `.hedgehog/core.yaml` once, in order,
|
|
124
|
+
against the freshly generated workspace. Each should pass clean: with no
|
|
125
|
+
domain content yet, this checks that the toolchain wiring those commands
|
|
126
|
+
depend on actually works.
|
|
127
|
+
|
|
128
|
+
A `verify` command that fails here fails for a reason worth naming
|
|
129
|
+
before any layer is built on top of it — a missing test runner, a script
|
|
130
|
+
the generator didn't add, a path that doesn't exist. Fix the generation
|
|
131
|
+
(step 4), then re-run this step.
|
|
132
|
+
|
|
133
|
+
### 6. Commit
|
|
134
|
+
|
|
135
|
+
```
|
|
136
|
+
feat(<id>): workspace
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
using `.hedgehog/core.yaml`'s `id`. One commit for the whole of this
|
|
140
|
+
core's bootstrap, which closes Bootstrap. State plainly that
|
|
141
|
+
`hedgehog-authored-loop` owns everything from here, one layer at a time.
|
|
142
|
+
|
|
143
|
+
## Constraints
|
|
144
|
+
|
|
145
|
+
- Run once per project, as the `bootstrap` agent's only move on an
|
|
146
|
+
authored core — never invoked standalone.
|
|
147
|
+
- The stack choice, layer sequence, and every `core.yaml` field are
|
|
148
|
+
locked at `hedgehog-core-design`'s Confirm & Lock. This skill executes
|
|
149
|
+
that design. A stack or layer that turns out wrong once generation is
|
|
150
|
+
underway is a Correction Protocol case through `planner`.
|
|
151
|
+
- Write no domain content in the generated workspace — no business
|
|
152
|
+
logic, no first layer's files. That's the first build task, started
|
|
153
|
+
once this Bootstrap commit lands.
|
|
154
|
+
- Step 2's deletions are safe by construction: `init`'s default scaffold
|
|
155
|
+
has never been installed or run on a project that reaches this skill,
|
|
156
|
+
since Phase 0 completes before any `pnpm install`. It's unused
|
|
157
|
+
template output.
|
|
158
|
+
- A repo with no default scaffold at all makes step 2 a no-op on the
|
|
159
|
+
workspace files; the `CLAUDE.md` rebuild still runs.
|
|
@@ -68,7 +68,7 @@ read from `.hedgehog/BMAD/` — never a general preference for variety:
|
|
|
68
68
|
| CLI | TypeScript + Node, Commander, Vitest, pnpm | the target users are a Python-first or Go-first ecosystem (data/ML tooling → Python + Typer + pytest; infra/systems tooling → Go + Cobra + `go test`) |
|
|
69
69
|
| Library / SDK | TypeScript, tsup, Vitest, pnpm | the consuming ecosystem is fixed by the brief (a Python package → Python + Hatch + pytest; publishing to both → author the TS core first, wrap it) |
|
|
70
70
|
| Data pipeline | Python, stdlib/argparse or Dagster for orchestration, pytest, uv or pip | the pipeline is thin glue over an existing Node/TS service mesh already named in the brief |
|
|
71
|
-
| Browser extension | TypeScript
|
|
71
|
+
| Browser extension | TypeScript + WXT (bundles the content-script/background/popup entry points and the WebExtension API types), Vitest, pnpm | none in practice — this shape has one real ecosystem |
|
|
72
72
|
| Desktop app | TypeScript + Electron, Vitest + Playwright, pnpm | native platform integration is a stated hard requirement (macOS/Windows-only, deep OS API use) → Swift/AppKit or C#/WinUI, per platform, named explicitly |
|
|
73
73
|
| Compiler / language tool | Rust, `cargo test`, Cargo | the brief is explicitly about fast iteration over raw performance, or targets a JS/TS-only toolchain (a Babel/ESLint plugin) → TypeScript, Vitest, pnpm |
|
|
74
74
|
| Bot / agent | TypeScript, Vitest, pnpm | the brief calls for heavy ML/data-science library use → Python, pytest, uv |
|
|
@@ -236,4 +236,13 @@ Wait for an explicit go-ahead. A revision here is another design pass —
|
|
|
236
236
|
update the draft, re-run this stage, write nothing until the confirmation
|
|
237
237
|
holds. Once confirmed and written, control returns to `planner`, which
|
|
238
238
|
runs `hedgehog-planning-intake`'s Phase 1 mining against this core the
|
|
239
|
-
same way it would against a shipped one
|
|
239
|
+
same way it would against a shipped one, then hands off to `bootstrap`.
|
|
240
|
+
|
|
241
|
+
This skill never touches the workspace itself — no `pnpm init`, no
|
|
242
|
+
generator, no install. `init` already scaffolded a default golden-core
|
|
243
|
+
payload speculatively before Phase 0 ever ran (the CLI has to copy
|
|
244
|
+
something; `full-stack-app` is that default), and this skill's job ends
|
|
245
|
+
at the design artifacts. `bootstrap`'s `hedgehog-bootstrap-authored-core`
|
|
246
|
+
is what later removes that speculative default and generates the real
|
|
247
|
+
workspace for the stack chosen here — a separate step, run only once
|
|
248
|
+
Phase 1 mining and Confirm & Lock have both landed.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: hedgehog-planning-intake
|
|
3
|
-
description: Use once per project, at the start, on
|
|
3
|
+
description: Use once per project, at the start, on any core — Phase 0 (running the vendored BMAD-METHOD planning shelf) is shared by every core; Phase 1 (mining `04-prd.md` into intent records plus the Add-ons decision) is full-stack-app's own procedure, run again on a scoped pass when new domain scope enters play. Invoked by the `planner` agent after Phase 0 core selection; don't run standalone. landing-page runs this skill's Phase 0, then mines the same archive through `hedgehog-landing-loop`'s own planning-intake section, that core's counterpart to this skill's Phase 1. An authored core runs this skill's Phase 0, then `hedgehog-core-design`, then this skill's Phase 1 mining against the designed layer sequence.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Hedgehog Planning Intake
|
|
@@ -17,7 +17,7 @@ Lock either way) belongs to `planner`; this skill (Phase 0, and Phase 1 on
|
|
|
17
17
|
full-stack-app) and `hedgehog-landing-loop` (landing-page's own mining)
|
|
18
18
|
are the fixed procedures that judgment runs inside.
|
|
19
19
|
|
|
20
|
-
## Phase 0 — BMAD elicitation (
|
|
20
|
+
## Phase 0 — BMAD elicitation (every core)
|
|
21
21
|
|
|
22
22
|
State the BMAD attribution, then run the vendored shelf in full
|
|
23
23
|
sequence, every time — no per-project skip logic, no reduced default
|
|
@@ -59,7 +59,7 @@ Every file/folder carries a one-line attribution header. `00-manifest.md`
|
|
|
59
59
|
states the source repo, pinned version (`skills/BMAD/ATTRIBUTION.md` has
|
|
60
60
|
the pinned commit), date, and which skills ran.
|
|
61
61
|
|
|
62
|
-
`.hedgehog/BMAD/` is archival and immutable once written, on
|
|
62
|
+
`.hedgehog/BMAD/` is archival and immutable once written, on every core.
|
|
63
63
|
Nothing in `hedgehog-loop`'s day-to-day operation, `hedgehog-bootstrap`,
|
|
64
64
|
or `reviewer` reads this folder live — `planner` reads it exactly once,
|
|
65
65
|
right after the shelf completes, to mine it (this skill's Phase 1 below
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
## This project's core: authored
|
|
2
|
+
|
|
3
|
+
This project's core was designed for it by `hedgehog-core-design` at
|
|
4
|
+
planning intake, rather than taken from a shipped Golden Core. The layer
|
|
5
|
+
sequence, the stack, and each layer's file scope and verification live in
|
|
6
|
+
two files, and both are locked:
|
|
7
|
+
|
|
8
|
+
- **`.hedgehog/core.yaml`** — the compiled authority: `id`, the layer
|
|
9
|
+
order, and per layer its `scope` globs, `verify` command, and commit
|
|
10
|
+
message. `hedgehog plan` compiled the build graph from this; every task
|
|
11
|
+
packet is generated from it.
|
|
12
|
+
- **`.hedgehog/core-design.md`** — the rationale: the system shape (what
|
|
13
|
+
this project fundamentally is), the stack and why it was chosen, a line
|
|
14
|
+
per layer on what it owns and why it sits where it does, and the
|
|
15
|
+
module-axis decision.
|
|
16
|
+
|
|
17
|
+
Read `core-design.md` to know what this project is and what each layer
|
|
18
|
+
owns. Trust `core.yaml` and the packet `hedgehog next` emits as
|
|
19
|
+
authoritative if the two ever seem to disagree.
|
|
20
|
+
|
|
21
|
+
Changing either file re-shapes every task the graph compiles. Both are
|
|
22
|
+
locked at `hedgehog-core-design`'s Confirm & Lock — a layer boundary that
|
|
23
|
+
turns out wrong is a `planner` decision through the Correction Protocol.
|
|
24
|
+
|
|
25
|
+
### The skills — invoke these, don't improvise
|
|
26
|
+
|
|
27
|
+
- **`hedgehog-authored-loop`** — every unit of work once bootstrapped:
|
|
28
|
+
`hedgehog next` emits the packet for one ready layer, `layer-eng`
|
|
29
|
+
builds it, `hedgehog verify` gates and commits it. Also holds the
|
|
30
|
+
Correction Protocol and this core's Stop Condition. Invoke it at the
|
|
31
|
+
start of any build session and for "what's next".
|
|
32
|
+
- **`hedgehog-bootstrap-authored-core`** — run **once**, at project
|
|
33
|
+
start, to generate and verify this core's workspace from the stack in
|
|
34
|
+
`core-design.md`. Skip once its `feat(<id>): workspace` commit exists.
|
|
35
|
+
- **`conventional-commits`** — when a change spans several layers in one
|
|
36
|
+
working-tree pass and needs splitting back into per-layer commits
|
|
37
|
+
(mainly Correction Protocol cleanups).
|
|
38
|
+
|
|
39
|
+
### The agents — delegate the judgment calls
|
|
40
|
+
|
|
41
|
+
- **`planner`** — planning intake (which core applies, then the vendored
|
|
42
|
+
BMAD-METHOD shelf run in full and mined into intents) at project start,
|
|
43
|
+
and scoping when new work enters play. Owns `.hedgehog/BMAD/`,
|
|
44
|
+
`.hedgehog/core.yaml`, and `.hedgehog/core-design.md`. On first run,
|
|
45
|
+
hands off to the `bootstrap` agent once Confirm & Lock holds.
|
|
46
|
+
- **`bootstrap`** — runs `hedgehog-bootstrap-authored-core`'s steps.
|
|
47
|
+
Triggered automatically by `planner` after its first run.
|
|
48
|
+
- **`layer-eng`** — builds one layer per `hedgehog next` packet, working
|
|
49
|
+
from the packet's ALLOWED SCOPE and `core-design.md`'s description of
|
|
50
|
+
what that layer owns. Reports the work done; never commits it.
|
|
51
|
+
- **`reviewer`** — checks what the mechanical gate can't: whether the
|
|
52
|
+
layer boundaries `core-design.md` described actually held, and whether
|
|
53
|
+
the interfaces between layers stayed the ones that were designed.
|
|
54
|
+
- **`tweaker`** — post-build, from a fresh context: takes tweak requests
|
|
55
|
+
one at a time and reviews the friction log.
|
|
56
|
+
|
|
57
|
+
## The constants (do not deviate)
|
|
58
|
+
|
|
59
|
+
### Stack (locked)
|
|
60
|
+
|
|
61
|
+
Named in `.hedgehog/core-design.md`'s stack record — language, package
|
|
62
|
+
manager, framework(s), test runner — and realized in the workspace
|
|
63
|
+
`hedgehog-bootstrap-authored-core` generated. The stack was chosen
|
|
64
|
+
deliberately for this project's system shape; a felt need for a new
|
|
65
|
+
library is worth surfacing before adding it, since it usually belongs to
|
|
66
|
+
the layer's design rather than to a build step.
|
|
67
|
+
|
|
68
|
+
### Layout
|
|
69
|
+
|
|
70
|
+
The layer `scope` globs in `.hedgehog/core.yaml` define where each
|
|
71
|
+
layer's code lives — that file is the layout, and it's enforced:
|
|
72
|
+
`hedgehog verify` rejects a task that writes outside its own scope.
|
|
73
|
+
|
|
74
|
+
```text
|
|
75
|
+
.hedgehog/
|
|
76
|
+
hedgehog.db the build graph — intents, compiled tasks, verifications, committed to git
|
|
77
|
+
core.yaml this core's layer sequence, scope, verification, commit messages — locked
|
|
78
|
+
core-design.md the design rationale behind core.yaml — write-once, from planner
|
|
79
|
+
BMAD/ vendored BMAD-METHOD shelf's raw output (brief, PR-FAQ, PRD, UX spec, research) —
|
|
80
|
+
write-once, from planner
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Core rules
|
|
84
|
+
|
|
85
|
+
- **One layer, one commit**, in the exact message `.hedgehog/core.yaml`
|
|
86
|
+
names for that layer.
|
|
87
|
+
- **Sequential through the chain.** A layer starts once the one before it
|
|
88
|
+
passes its own verification — `hedgehog next` enforces this.
|
|
89
|
+
- **Scope is the boundary.** A layer writes inside its ALLOWED SCOPE and
|
|
90
|
+
nowhere else; a change that needs to land elsewhere is a correction,
|
|
91
|
+
not a wider write.
|
|
92
|
+
- **A layer owns one artifact**, reached through the interface
|
|
93
|
+
`core-design.md` named — that boundary is what makes the layer
|
|
94
|
+
independently verifiable.
|
|
95
|
+
- **The layer's own `verify` command gates every commit.** Never weaken
|
|
96
|
+
it to clear a gate; a layer whose command passes with no tests
|
|
97
|
+
certifies nothing.
|
|
98
|
+
- **Fix wrong layers at the source** via the Correction Protocol — never
|
|
99
|
+
a downstream workaround.
|
|
100
|
+
- **The layer sequence itself is locked.** Changing `.hedgehog/core.yaml`
|
|
101
|
+
or `.hedgehog/core-design.md` is a `planner` decision, not a quiet
|
|
102
|
+
edit.
|