@skyf0xx/hedgehog 2.0.13 → 3.0.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.
Files changed (35) hide show
  1. package/README.md +9 -3
  2. package/bin/cli.mjs +463 -19
  3. package/package.json +3 -2
  4. package/src/agents/backend-eng.md +56 -45
  5. package/src/agents/bootstrap.md +67 -73
  6. package/src/agents/front-end-eng.md +31 -18
  7. package/src/agents/planner.md +163 -84
  8. package/src/agents/reviewer.md +4 -4
  9. package/src/agents/tweaker.md +138 -106
  10. package/src/db/core.mjs +141 -0
  11. package/src/db/friction.mjs +25 -0
  12. package/src/db/init.mjs +35 -0
  13. package/src/db/intent.mjs +101 -0
  14. package/src/db/next.mjs +179 -0
  15. package/src/db/plan.mjs +222 -0
  16. package/src/db/schema.mjs +95 -0
  17. package/src/db/status.mjs +113 -0
  18. package/src/db/verify.mjs +286 -0
  19. package/src/db/why.mjs +97 -0
  20. package/src/golden-cores/full-stack-app/core.yaml +41 -0
  21. package/src/golden-cores/landing-page/core.yaml +41 -0
  22. package/src/skills/conventional-commits/SKILL.md +1 -1
  23. package/src/skills/hedgehog-bootstrap/SKILL.md +38 -41
  24. package/src/skills/hedgehog-bootstrap-full-stack-app-core/SKILL.md +8 -12
  25. package/src/skills/hedgehog-bootstrap-landing-page-core/SKILL.md +7 -9
  26. package/src/skills/hedgehog-core-design/SKILL.md +239 -0
  27. package/src/skills/hedgehog-landing-loop/SKILL.md +91 -57
  28. package/src/skills/hedgehog-loop/SKILL.md +109 -77
  29. package/src/skills/hedgehog-planning-intake/SKILL.md +72 -97
  30. package/src/templates/CLAUDE.core.full-stack-app.md +31 -24
  31. package/src/templates/CLAUDE.core.landing-page.md +11 -7
  32. package/src/templates/CLAUDE.md +46 -38
  33. package/src/templates/TODO.core.full-stack-app.md +0 -51
  34. package/src/templates/TODO.core.landing-page.md +0 -31
  35. package/src/templates/TODO.md +0 -12
@@ -19,11 +19,13 @@ pinned icon source. Neither restates the other's decision.
19
19
  ### The skills — invoke these, don't improvise
20
20
 
21
21
  - **`hedgehog-landing-loop`** — every unit of work once bootstrapped:
22
- pick the next step from `TODO.md`, run exactly one Chain Method phase
23
- through its owning agent, gate it, commit it, check it off. Also holds
24
- the Correction Protocol for fixing a wrong upstream phase (e.g. a
25
- signature element that doesn't trace back to the subject statement).
26
- Invoke it at the start of any build session and for "what's next".
22
+ `hedgehog next` emits the packet for one ready compiled layer, run the
23
+ fine-grained Chain Method phases it bundles through their owning
24
+ agents, gate the layer via `hedgehog verify`, which commits it on a
25
+ pass. Also holds the Correction Protocol for fixing a wrong upstream
26
+ phase (e.g. a signature element that doesn't trace back to the subject
27
+ statement). Invoke it at the start of any build session and for
28
+ "what's next".
27
29
  - **`hedgehog-bootstrap-landing-page-core`** — run **once**, at project
28
30
  start, to land the pre-verified Astro + Tailwind workspace. Skip if
29
31
  `astro.config.mjs` already exists.
@@ -47,8 +49,9 @@ pinned icon source. Neither restates the other's decision.
47
49
 
48
50
  - **`planner`** — planning intake (which core applies, then this core's
49
51
  own brief intake: the vendored BMAD-METHOD shelf, run in full and
50
- mined into subject, audience, single page job) at project start.
51
- Writes `TODO.md`, `.hedgehog/BMAD/`, and `.hedgehog/chain/00-brief.md`.
52
+ mined into subject, audience, single page job) at project start. Writes
53
+ the `landing` intent (`hedgehog intent add`, one call — this core has
54
+ no module axis), `.hedgehog/BMAD/`, and `.hedgehog/chain/00-brief.md`.
52
55
  On first run, hands off to the `bootstrap` agent once Confirm & Lock
53
56
  holds.
54
57
  - **`bootstrap`** — runs `hedgehog-bootstrap-landing-page-core`'s steps.
@@ -145,6 +148,7 @@ src/
145
148
  assets/ raster images, imported as modules and rendered through astro:assets `<Image />`
146
149
  styles/ global.css — @fontsource-variable imports + Tailwind v4 CSS-first import + the `@theme` token layer (hex values, font families, `--text-*` scale, spacing unit, easing family from Step 5)
147
150
  .hedgehog/
151
+ hedgehog.db the build graph — the landing intent, its five compiled tasks, verifications, committed to git
148
152
  BMAD/ vendored BMAD-METHOD shelf's raw output (brief, PR-FAQ, PRD, UX spec, research) —
149
153
  write-once, from planner
150
154
  chain/ this core's own archival planning intake output — subject statement, adjective tables,
@@ -17,7 +17,7 @@
17
17
  {{PROJECT_SUMMARY — 2–4 sentences the `planner` writes at planning
18
18
  intake: what this project is, who it's for, and what it does. State
19
19
  current intent, not history. Keep it tight — the full product narrative
20
- lives in this core's own planning-intake output and `TODO.md`, not
20
+ lives in this core's own planning-intake output and the build graph, not
21
21
  here.}}
22
22
 
23
23
  This project is built with **Hedgehog**: a one-step-at-a-time build
@@ -33,17 +33,16 @@ then hand straight to `planner`, which decides which Hedgehog core
33
33
  applies and runs that core's planning intake. Don't re-explain the
34
34
  discipline or summarize this file; the greeting is one line, not a tour.
35
35
  Skip this entirely once the placeholder is filled in — every later
36
- session starts with `TODO.md`, not a greeting.
36
+ session starts with `hedgehog status`, not a greeting.
37
37
 
38
38
  ## How to work here
39
39
 
40
40
  The build is a loop of small, gated, committed steps. You never hold the
41
41
  whole plan in context — the plan lives in the structure:
42
42
 
43
- - **`TODO.md`** is the live checklist and the source of truth for what's
44
- next. Read it at the start of every session. Its only state is
45
- checked/unchecked (or skipped-and-confirmed, wherever this core's own
46
- optional steps allow it).
43
+ - **The build graph** (`.hedgehog/hedgehog.db`) is the live source of
44
+ truth for what's next. Query it via `hedgehog status`/`hedgehog next`
45
+ at the start of every session — never re-derive state from prose.
47
46
  - **The commit log** is the record of what's built and why. Conventional
48
47
  commits are how progress is read, not a conversation summary.
49
48
  - **The architecture is fixed and opinionated for this project's core**
@@ -63,32 +62,41 @@ context** below).
63
62
 
64
63
  {{CORE_SECTION}}
65
64
 
66
- ## Consuming TODO.md
67
-
68
- `TODO.md` at repo root is a thin checklist mirroring this core's phase/
69
- step structure. To work from it:
70
-
71
- 1. Read it. Find the first unchecked step whose gate (the step before it)
72
- is satisfied.
73
- 2. Build that one step via this core's loop skill (named in the section
74
- above).
75
- 3. Check the line off after the commit lands. Checked/unchecked is the
76
- only state — no notes, no rationale (that's the commit log's job).
77
-
78
- `planner` owns writing and extending `TODO.md`; the loop only checks
79
- boxes off. Keep it thin.
80
-
81
- **When the build is done:** once every item in scope is checked, the
82
- build session is complete. Before deleting `TODO.md`, offer the user a
83
- fresh-context handoff to the `tweaker` agent — it starts clean, reviews
84
- `.hedgehog/friction.md` once for a possible discipline-improvement
85
- suggestion (filed as a GitHub issue against the Hedgehog repo itself,
86
- never this project's repo, and only after showing the exact content and
87
- getting explicit approval), then takes any tweak requests one at a time.
88
- Once that handoff is offered (taken or declined), **delete `TODO.md`** —
89
- a finished checklist is noise, and the commit log is the durable record
90
- of what was built. Any archival planning-intake output this core
91
- produces stays — it's historical record, not a checklist.
65
+ ## Consuming the graph
66
+
67
+ `.hedgehog/hedgehog.db`, committed to git, is the source of truth for
68
+ what's next — never re-derive build state from prose. To work from it:
69
+
70
+ 1. Run `hedgehog next`. It emits the task packet for one ready task
71
+ (STATUS/WHY NOW/BLOCKED DOWNSTREAM/ALLOWED SCOPE/VERIFICATION) —
72
+ trust it: a task is never emitted unless every dependency is
73
+ `complete`.
74
+ 2. Delegate the full packet to this core's loop skill (named in the
75
+ section above), which hands it to the owning agent.
76
+ 3. Once the agent reports the work done, run `hedgehog verify
77
+ <task-id>`. It checks the touched files against the packet's ALLOWED
78
+ SCOPE, runs the verification command, and on a pass writes the commit
79
+ and unlocks whatever the task was blocking. An agent reporting success
80
+ never moves the task — only a passing `hedgehog verify` exit code
81
+ does.
82
+
83
+ `planner` owns writing intents (`hedgehog intent add`) at planning
84
+ intake; `hedgehog plan` compiles them into the task graph the loop
85
+ consumes. Nothing checks a box — there is no checklist, only queryable
86
+ state.
87
+
88
+ **When the build is done:** once `hedgehog status` shows every task
89
+ `complete`, the build session is complete. Offer the user a
90
+ fresh-context handoff to the `tweaker` agent — it starts clean, once
91
+ reviews the friction log (`hedgehog friction list`) for possible
92
+ discipline-improvement issues and separately asks the user directly for
93
+ feedback on the build, filing each real pattern or piece of feedback as
94
+ its own GitHub issue against the Hedgehog repo itself, never this
95
+ project's repo (friction as `bug`/`help wanted`, feedback as
96
+ `suggestion`, each only after showing the exact content and getting
97
+ explicit approval), then takes any tweak requests one at a time. Nothing
98
+ to delete once that handoff is offered — the build graph and the commit
99
+ log are the permanent record, not a checklist to clean up.
92
100
 
93
101
  ## Managing context
94
102
 
@@ -97,12 +105,12 @@ context small:
97
105
 
98
106
  - **Clear context at natural boundaries** — a module's Phase A, a
99
107
  landing page section, whatever this core's own unit boundary is — once
100
- that unit is done and committed. `/clear` and start fresh, then
101
- re-read `TODO.md` and continue. Nothing is lost, because the
102
- checklist, commits, and code hold all the state. Prefer this over
103
- letting one session accumulate the entire project.
104
- - **A cleared or new session recovers by reading `TODO.md` and the
105
- commit log**, never by needing the prior conversation.
108
+ that unit is done and committed. `/clear` and start fresh, then run
109
+ `hedgehog status`/`hedgehog next` and continue. Nothing is lost,
110
+ because the build graph, commits, and code hold all the state. Prefer
111
+ this over letting one session accumulate the entire project.
112
+ - **A cleared or new session recovers by running `hedgehog status` and
113
+ reading the commit log**, never by needing the prior conversation.
106
114
  - **Delegate heavy work to agents.** Planning intake, scaffolding, and
107
115
  every build step each run in their own isolated context — so that work
108
116
  doesn't pile up in the main thread.
@@ -1,51 +0,0 @@
1
- ## Add-ons
2
-
3
- <!-- Written by planner at planning intake. Each line: on/off + the
4
- one-line reason. An absent block reads as "never decided," not "off". -->
5
-
6
- - Auth: (fill in: on/off — reason)
7
- - Queue: (fill in: on/off — reason)
8
- - Mobile: (fill in: on/off — reason)
9
-
10
- ## Bootstrap
11
-
12
- <!-- Add-on steps (planner marks each on/skipped at planning intake, per
13
- the ## Add-ons block above) run live, one at a time, after core. A
14
- skipped add-on gets checked off as skipped, not left unchecked. -->
15
-
16
- - [x] Nx workspace + `packages/config` (incl. `docker-compose.yml` for local Postgres) — core, landed via `hedgehog init`, verified via `hedgehog-bootstrap-full-stack-app-core`
17
- - [x] `packages/db` — Drizzle client — core, landed via `hedgehog init`, verified via `hedgehog-bootstrap-full-stack-app-core`
18
- - [x] `apps/api` — Nest shell, Pino — core, landed via `hedgehog init`, verified via `hedgehog-bootstrap-full-stack-app-core`
19
- - [x] `apps/web` — Next shell, TanStack Query provider — core, landed via `hedgehog init`, verified via `hedgehog-bootstrap-full-stack-app-core`
20
- - [ ] `packages/auth` — Better Auth config + global guard on `apps/api` — Auth add-on (fill in: on / skipped, not in scope)
21
- - [ ] `apps/worker` — BullMQ seam, Redis (no consumers yet) — Queue add-on (fill in: on / skipped, not in scope)
22
- - [ ] `apps/mobile` — Expo shell — Mobile add-on (fill in: on / skipped, not in scope)
23
- ## Phase A — Backend
24
-
25
- <!-- One subsection per module in scope. Do not add hooks/screens here —
26
- that's Phase B, and doesn't start until every module below is checked. -->
27
-
28
- ### <module-name>
29
-
30
- - [ ] schema
31
- - [ ] contract
32
- - [ ] repository
33
- - [ ] service
34
- - [ ] api (controller)
35
- - [ ] queue (only if this operation genuinely needs async)
36
- ## Phase B — Frontend
37
-
38
- <!-- Do not touch this section until every module above has "api" checked. -->
39
-
40
- ### <module-name>
41
-
42
- - [ ] hooks
43
- - [ ] ux-planner — writes docs/design/<module-name>.md; ask for a
44
- mockup/screenshot/Stitch or Figma export here if one exists
45
- - [ ] screen-web
46
- - [ ] screen-mobile (only if building for mobile)
47
-
48
- <!-- STOP before deleting this file: every box above checked means the
49
- build is complete. Offer the user a fresh-context handoff to `tweaker`
50
- first — see hedgehog-loop's Stop Condition. Only delete this file after
51
- that offer has been made (taken or declined). -->
@@ -1,31 +0,0 @@
1
- ## Brief
2
-
3
- <!-- Written by planner at planning intake: the subject statement,
4
- audience, and the page's single job — full detail in
5
- .hedgehog/chain/00-brief.md. -->
6
-
7
- - Subject: (fill in)
8
- - Audience: (fill in)
9
- - Page job: (fill in)
10
-
11
- ## Bootstrap
12
-
13
- - [x] Astro workspace + Tailwind token layer — core, landed via `hedgehog init`, verified via `hedgehog-bootstrap-landing-page-core`
14
-
15
- ## Chain
16
-
17
- <!-- The Chain Method, one phase at a time, in strict order except where
18
- noted. Do not start a phase until the one above it is checked. -->
19
-
20
- - [ ] strategy — subject/audience/job + adjective pairs + visceral/behavioral/reflective sort + note timing — `landing-strategist`
21
- - [ ] systems — dial table + voice spec (parallel) → token system → signature element — `landing-systems`
22
- - [ ] sequence — per-section transitions, weight, spacing, beat structure — `landing-sequencer`
23
- - [ ] headline — headline + 2 backups, from distinct mechanisms, reviewed and locked by the user — `landing-headline-writer`
24
- - [ ] copy — one section at a time, per the paragraph algorithm, each section reviewed and locked by the user before the next starts — `landing-copywriter`
25
- - [ ] audit — traceability/distinctiveness + usability, reconciled to a pass — `landing-critic`
26
- - [ ] build — the artifact, in Astro — `landing-builder`
27
-
28
- <!-- STOP before deleting this file: every box above checked means the
29
- build is complete. Offer the user a fresh-context handoff to `tweaker`
30
- first — see hedgehog-landing-loop's Stop Condition. Only delete this
31
- file after that offer has been made (taken or declined). -->
@@ -1,12 +0,0 @@
1
- # TODO
2
-
3
- <!-- 2-3 sentences: what is this project. Full detail lives in this
4
- core's own archival planning-intake output — see CLAUDE.md's core
5
- section for where. -->
6
-
7
- ## Context
8
-
9
- (fill in per project — see this core's archival planning output for the
10
- full picture)
11
-
12
- {{CORE_SECTION}}