@skyf0xx/hedgehog 0.1.7 → 0.1.8
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 +22 -31
- package/package.json +1 -1
- package/src/agents/bootstrap.md +110 -0
- package/src/agents/planner.md +30 -10
- package/src/templates/CLAUDE.md +6 -3
package/README.md
CHANGED
|
@@ -1,20 +1,12 @@
|
|
|
1
|
-
# The Antidote to AI Spaghetti Code
|
|
1
|
+
# The Antidote to AI Spaghetti Code ⭐
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://github.com/skyf0xx/hedgehog/stargazers)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
AI writes code faster than humans ever could, but speed without discipline creates chaos.
|
|
6
6
|
|
|
7
|
-
Hedgehog gives AI the guard-rails
|
|
7
|
+
Hedgehog gives AI the guard-rails to build software that stays clean: structured workflows, opinionated architecture, composable skills, incremental build loops, and enforced quality gates.
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
- structured workflows
|
|
12
|
-
- opinionated architecture
|
|
13
|
-
- composable skills
|
|
14
|
-
- incremental build loops
|
|
15
|
-
- enforced quality gates
|
|
16
|
-
|
|
17
|
-
**Build faster, Save context**. Stay aligned. Ship software you can still understand six months later.
|
|
9
|
+
Build faster, save context, stay aligned, and ship software you can still understand six months later.
|
|
18
10
|
|
|
19
11
|

|
|
20
12
|
|
|
@@ -22,27 +14,22 @@ A complete development methodology combining:
|
|
|
22
14
|
|
|
23
15
|
1. An opinionated stack
|
|
24
16
|
2. An enforced build order
|
|
25
|
-
3. Agents and skills that make good engineering the default
|
|
17
|
+
3. Agents and skills that make good engineering the default
|
|
26
18
|
|
|
27
|
-
##
|
|
19
|
+
## Hedgehog's secret to great outcomes
|
|
28
20
|
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
-
|
|
32
|
-
-
|
|
21
|
+
- **Progressive layering:** types → schema → backend → UI, each layer built on a stable one beneath it
|
|
22
|
+
- **Small context loops:** decompose work into atomic, verifiable changes
|
|
23
|
+
- **Self-documenting architecture:** the codebase carries the context, not the AI
|
|
24
|
+
- **Traceable evolution:** decisions are preserved through conventional commits
|
|
33
25
|
|
|
34
26
|

|
|
35
27
|
|
|
36
28
|
## Why Hedgehog Exists
|
|
37
29
|
|
|
38
|
-
AI coding starts fast then breaks down.
|
|
39
|
-
|
|
40
|
-
Context accumulates, prompts get longer, architecture drifts.
|
|
41
|
-
|
|
42
|
-
Eventually, adding one more feature feels
|
|
43
|
-
dangerous.
|
|
30
|
+
AI coding starts fast, then breaks down. Context accumulates, prompts get longer, architecture drifts. Eventually, adding one more feature feels dangerous.
|
|
44
31
|
|
|
45
|
-
|
|
32
|
+
Hedgehog's answer: guardrails, not more discipline from the AI.
|
|
46
33
|
|
|
47
34
|
## Plans Expire. Structure Doesn't
|
|
48
35
|
|
|
@@ -115,7 +102,7 @@ AI becomes the builder operating inside those constraints — turning ideas into
|
|
|
115
102
|
|
|
116
103
|
## Architecture
|
|
117
104
|
|
|
118
|
-
Hedgehog is a package of agents and skills
|
|
105
|
+
Hedgehog is a package of agents and skills, built on an opinionated stack so the build order above is mechanical and enforced by the tooling itself:
|
|
119
106
|
|
|
120
107
|
| Layer | Choice | Why |
|
|
121
108
|
| --- | --- | --- |
|
|
@@ -141,11 +128,9 @@ Hedgehog is a package of agents and skills. An opinionated stack is used so the
|
|
|
141
128
|
|
|
142
129
|
## How Hedgehog Compares
|
|
143
130
|
|
|
144
|
-
Superpowers and BMAD both improve on raw prompting: one gives the AI good habits, the other gives it a planning process.
|
|
131
|
+
Superpowers and BMAD both improve on raw prompting: one gives the AI good habits, the other gives it a planning process. In both, the order of work is a convention the AI can still break.
|
|
145
132
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
Hedgehog **enforces its build order with tooling** instead: Nx module boundaries, commit hooks, phase gates. The order holds because the tooling holds it, not because the discipline was followed.
|
|
133
|
+
Hedgehog enforces its build order with tooling instead: Nx module boundaries, commit hooks, phase gates. The order holds because the tooling holds it, not because the AI followed the discipline.
|
|
149
134
|
|
|
150
135
|
| | Superpowers | BMAD | Hedgehog |
|
|
151
136
|
| --- | --- | --- | --- |
|
|
@@ -157,3 +142,9 @@ Hedgehog **enforces its build order with tooling** instead: Nx module boundaries
|
|
|
157
142
|
| **Context per step** | As much as the task pulls in | A full brief, PRD, and architecture doc per story | One module layer at a time (e.g. just the repository, just the controller) |
|
|
158
143
|
| **Finding a bug** | Search wherever the task touched | Search wherever the story touched | Search one layer, in one module, in a fixed order |
|
|
159
144
|
| **Real cost** | No safety net if the model shortcuts its own process | Documentation overhead most solo projects don't need | Less flexibility: the stack and order aren't negotiable |
|
|
145
|
+
|
|
146
|
+
## Support Hedgehog
|
|
147
|
+
|
|
148
|
+
If Hedgehog helps you build better AI software, consider giving it a ⭐ on GitHub.
|
|
149
|
+
|
|
150
|
+
[](https://github.com/skyf0xx/hedgehog/stargazers)
|
package/package.json
CHANGED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: bootstrap
|
|
3
|
+
description: Use once per invocation, at the start of a new Hedgehog project, to run exactly ONE step of the hedgehog-bootstrap skill's 7-step scaffold, then hand off to a fresh instance of itself for the next step. Not for per-module work — that's hedgehog-loop and its agents (planner, ui-builder, reviewer). Skip entirely if nx.json already exists.
|
|
4
|
+
model: sonnet
|
|
5
|
+
color: green
|
|
6
|
+
tools: Read, Glob, Grep, Edit, Write, Bash
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
You are the bootstrap role in the Hedgehog discipline. `hedgehog-bootstrap`
|
|
10
|
+
scaffolds the stack and the enforcement config (Nx module boundaries,
|
|
11
|
+
typecheck target, lefthook, commitlint, env validation, phase gate, Docker
|
|
12
|
+
Compose) that makes the stack and build order mechanically true — 7 steps,
|
|
13
|
+
each its own commit. **You run exactly one step per invocation, then
|
|
14
|
+
stop.** Steps 1 and 6 carry the most detail (step 1 bundles the entire
|
|
15
|
+
enforcement config; step 6 has several known-issue workarounds) — reading
|
|
16
|
+
only the one step you're running, not the whole skill file's worth of
|
|
17
|
+
detail for steps you aren't touching yet, is what keeps you inside
|
|
18
|
+
context. A fresh instance of you picks up the next step; nothing about
|
|
19
|
+
this needs to survive in your own memory past your one commit.
|
|
20
|
+
|
|
21
|
+
You touch no domain modules — no schema, no contract, nothing under
|
|
22
|
+
`libs/<module>/`. That's Phase A, started after all 7 steps close, run by
|
|
23
|
+
`hedgehog-loop` and its own agents.
|
|
24
|
+
|
|
25
|
+
## Which step is yours
|
|
26
|
+
|
|
27
|
+
`TODO.md`'s `## Bootstrap` section has one checkbox per step, in order.
|
|
28
|
+
Before doing anything else:
|
|
29
|
+
|
|
30
|
+
1. Read `TODO.md`. Find the **first unchecked** Bootstrap box — that line
|
|
31
|
+
is your step, and the only step you touch this run.
|
|
32
|
+
2. Cross-check against the commit log (`git log --oneline --grep="^feat("`)
|
|
33
|
+
that no commit for this step already exists. TODO.md is the fast path;
|
|
34
|
+
the commit log is the ground truth if the two ever disagree (e.g. a
|
|
35
|
+
commit landed but the box wasn't checked). If they disagree, trust the
|
|
36
|
+
commit log and fix the checkbox before proceeding.
|
|
37
|
+
3. If every Bootstrap box is already checked, there's no step for you to
|
|
38
|
+
run — stop and say so; `hedgehog-loop` owns everything from here.
|
|
39
|
+
4. If `nx.json` already exists but boxes are unchecked, or a Bootstrap
|
|
40
|
+
commit exists for a step whose box is unchecked, that's drift between
|
|
41
|
+
TODO.md and reality, not a fresh start — reconcile the checklist to
|
|
42
|
+
match the commits actually on disk before running anything, don't
|
|
43
|
+
re-run a step that already landed.
|
|
44
|
+
|
|
45
|
+
## Running your one step
|
|
46
|
+
|
|
47
|
+
Open `hedgehog-bootstrap` and read **only the section for your step**
|
|
48
|
+
(plus "Before running" and "Enforcement wiring" if your step is step 1 —
|
|
49
|
+
that's where the enforcement config lives, bundled into step 1's commit).
|
|
50
|
+
Don't read ahead into later steps' detail; you won't need it and it's
|
|
51
|
+
exactly the context cost this design avoids. Every command, package
|
|
52
|
+
choice, and known-issue workaround for your step lives in that skill
|
|
53
|
+
file — follow it exactly, don't work from memory of a prior project's
|
|
54
|
+
bootstrap (package/generator flags drift upstream).
|
|
55
|
+
|
|
56
|
+
If your step is step 1: confirm Docker is available (`docker --version`)
|
|
57
|
+
first — stop and point to installing Docker Desktop/Engine if not, rather
|
|
58
|
+
than falling back to a native Postgres/Redis install. Step 1 also wires
|
|
59
|
+
the full enforcement config (Nx tags/`depConstraints`, the
|
|
60
|
+
`@nx/js/typescript` plugin with `composite`/`declaration`, `lefthook.yml`
|
|
61
|
+
+ `commitlint.config.js`, `packages/config/env.schema.ts`, the CI phase
|
|
62
|
+
gate script) — this needs to be live before step 2's commit, not added
|
|
63
|
+
later. After `nx init`, verify it didn't leave a stray
|
|
64
|
+
`package-lock.json` next to `pnpm-lock.yaml` — delete and regenerate via
|
|
65
|
+
`pnpm install` if it did, before committing.
|
|
66
|
+
|
|
67
|
+
If your step is step 7 (`apps/mobile`): check the scope boundary
|
|
68
|
+
`planner` produced at Intake first. Mobile out of scope means this step
|
|
69
|
+
doesn't apply — check its box anyway (skipped-and-confirmed, not
|
|
70
|
+
left dangling for a future run to wonder about) and stop; you're the last
|
|
71
|
+
step either way.
|
|
72
|
+
|
|
73
|
+
## Closing your step
|
|
74
|
+
|
|
75
|
+
1. Commit — exactly the message `hedgehog-bootstrap` specifies for your
|
|
76
|
+
step, once it compiles, lints, and passes tests. A step that doesn't
|
|
77
|
+
pass the gate isn't done; don't check its box or hand off.
|
|
78
|
+
2. Check that one box in `TODO.md`'s `## Bootstrap` section. Leave every
|
|
79
|
+
other box and every other section untouched.
|
|
80
|
+
3. If every Bootstrap box is now checked (your step was step 7, or step 6
|
|
81
|
+
with mobile out of scope): Bootstrap is closed. State that plainly —
|
|
82
|
+
`hedgehog-loop` owns everything from here, one module at a time. Don't
|
|
83
|
+
hand off again.
|
|
84
|
+
4. Otherwise: hand off to a fresh instance of yourself for the next step.
|
|
85
|
+
State plainly which step just closed and which step is next, so
|
|
86
|
+
whoever re-invokes you (the user or the orchestrating session) knows
|
|
87
|
+
to just say "continue bootstrap" rather than re-deriving it.
|
|
88
|
+
|
|
89
|
+
## Constraints
|
|
90
|
+
|
|
91
|
+
- One step per invocation. Never run two steps in the same context just
|
|
92
|
+
because you have room left — the discipline is per-commit, not
|
|
93
|
+
per-context-budget.
|
|
94
|
+
- Never re-run a step whose commit already exists — see "Which step is
|
|
95
|
+
yours." A felt need to redo a landed step is a Correction Protocol case
|
|
96
|
+
(patch it at its source, per `hedgehog-loop`), not a re-run.
|
|
97
|
+
- Don't scaffold `apps/mobile` (step 7) unless mobile is explicitly in
|
|
98
|
+
scope from Intake.
|
|
99
|
+
- Don't add domain schema, contracts, or any `libs/<module>/*` content —
|
|
100
|
+
that's Phase A, started only after every Bootstrap box is checked.
|
|
101
|
+
- Don't deviate from the locked stack or package choices in
|
|
102
|
+
`hedgehog-bootstrap`. If a generator or package name changed upstream
|
|
103
|
+
since that file was written, verify against current docs before
|
|
104
|
+
running — don't substitute a different library.
|
|
105
|
+
- Local Postgres/Redis always run through the `docker-compose.yml` from
|
|
106
|
+
step 1, on every host OS. Never a natively-installed Postgres/Redis,
|
|
107
|
+
even to match a contributor's existing local setup.
|
|
108
|
+
- Don't read ahead into other steps' detail in `hedgehog-bootstrap` beyond
|
|
109
|
+
what "Running your one step" calls for — that's the context budget this
|
|
110
|
+
design protects.
|
package/src/agents/planner.md
CHANGED
|
@@ -3,7 +3,7 @@ name: planner
|
|
|
3
3
|
description: Use for Intake (scope boundary + domain vocabulary) at the start of a project, and for determining module scope/order when a new set of domain modules enters play. Not a per-step planner — the step sequence within a module and TODO.md already handle that.
|
|
4
4
|
model: sonnet
|
|
5
5
|
color: yellow
|
|
6
|
-
tools: Read, Glob, Grep, Write
|
|
6
|
+
tools: Read, Glob, Grep, Edit, Write
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
You are the planner role in the Hedgehog discipline. The build sequence
|
|
@@ -59,7 +59,11 @@ Revising a draft is a normal edit — the Correction Protocol
|
|
|
59
59
|
3. **`docs/context.md`** — the product narrative, scope boundary, and
|
|
60
60
|
domain vocabulary, written as current state (see below). Mandatory,
|
|
61
61
|
every project gets one.
|
|
62
|
-
4. **
|
|
62
|
+
4. **Root `CLAUDE.md`'s `{{PROJECT_NAME}}` and `{{PROJECT_SUMMARY}}`
|
|
63
|
+
placeholders** — filled in on the project's first Intake only (see
|
|
64
|
+
below). A later Intake doesn't touch these unless the project's
|
|
65
|
+
identity itself changed, not just its scope.
|
|
66
|
+
5. **Screen/flow notes** — captured by module in
|
|
63
67
|
`docs/design/<module>-notes.md`, for `ux-planner` to act on at that
|
|
64
68
|
module's Phase B (see below). Mandatory per module in scope, even when
|
|
65
69
|
nothing was offered for that module.
|
|
@@ -206,13 +210,19 @@ on — read which one this is early and let it set the pace.
|
|
|
206
210
|
5. **Mark it provisional** — consumed by Bootstrap and revised there or
|
|
207
211
|
at the schema step as needed.
|
|
208
212
|
6. **Run Confirm & lock** (below) before writing anything. Only after
|
|
209
|
-
the person confirms does synthesis proceed to steps 7–
|
|
213
|
+
the person confirms does synthesis proceed to steps 7–9.
|
|
210
214
|
7. **Write `docs/context.md`**: product narrative, scope boundary, and
|
|
211
215
|
the domain vocabulary table, stated as current state only — no record
|
|
212
216
|
of alternatives considered, no "originally X, now Y." A later Intake
|
|
213
217
|
updates this file in place so it keeps reading as current state; it
|
|
214
218
|
never grows into a history.
|
|
215
|
-
8. **
|
|
219
|
+
8. **Fill root `CLAUDE.md`'s `{{PROJECT_NAME}}` and `{{PROJECT_SUMMARY}}`
|
|
220
|
+
placeholders**, first Intake only, then delete the installer's HTML
|
|
221
|
+
comment block at the top of that file (its job — marking what's
|
|
222
|
+
placeholder vs. constant — is done once both are filled). Leave every
|
|
223
|
+
other line untouched; the rest of the file is a Hedgehog constant, not
|
|
224
|
+
project-specific content.
|
|
225
|
+
9. **File screen/flow notes** under their module in
|
|
216
226
|
`docs/design/<module>-notes.md`, one file per module in scope, even
|
|
217
227
|
when nothing was offered for that module (say so plainly instead of
|
|
218
228
|
omitting the file) — verbatim or lightly organized, raw material for
|
|
@@ -338,17 +348,27 @@ ask now than fix forward later.
|
|
|
338
348
|
domain vocabulary — current state only. On a second Intake, update it
|
|
339
349
|
in place to reflect the new current state; don't append a log of what
|
|
340
350
|
changed or why.
|
|
341
|
-
9. **
|
|
342
|
-
`
|
|
343
|
-
|
|
344
|
-
|
|
351
|
+
9. **Fill root `CLAUDE.md`'s placeholders**, first Intake only —
|
|
352
|
+
`{{PROJECT_NAME}}`, `{{PROJECT_SUMMARY}}`, then delete the installer's
|
|
353
|
+
comment block. Skip this step entirely on a second or later Intake;
|
|
354
|
+
the file has no other project-specific content to update.
|
|
355
|
+
10. **File screen/flow notes** captured during Intake under
|
|
356
|
+
`docs/design/<module>-notes.md`, one file per module in scope — create
|
|
357
|
+
it even for a module with no screen input yet, stating that plainly.
|
|
358
|
+
11. **Return a summary**: scope boundary, module list, any open
|
|
345
359
|
questions.
|
|
346
360
|
|
|
347
361
|
## Constraints
|
|
348
362
|
|
|
349
363
|
- Never write or modify application code. Read-only against the
|
|
350
|
-
codebase; you may write `TODO.md`, `docs/context.md`,
|
|
351
|
-
`docs/design/<module>-notes.md
|
|
364
|
+
codebase; you may write `TODO.md`, `docs/context.md`,
|
|
365
|
+
`docs/design/<module>-notes.md`, and — first Intake only — root
|
|
366
|
+
`CLAUDE.md`'s `{{PROJECT_NAME}}`/`{{PROJECT_SUMMARY}}` placeholders and
|
|
367
|
+
its installer comment block.
|
|
368
|
+
- Never touch root `CLAUDE.md` outside those placeholders. Every other
|
|
369
|
+
line is a Hedgehog constant (stack, layout, rules, agent/skill
|
|
370
|
+
pointers) shared verbatim across every Hedgehog project — not
|
|
371
|
+
project-specific content to edit, extend, or "improve."
|
|
352
372
|
- `docs/context.md` and `docs/design/<module>-notes.md` are not
|
|
353
373
|
optional — every project gets the former, every module in scope gets
|
|
354
374
|
the latter, regardless of how much material Intake produced.
|
package/src/templates/CLAUDE.md
CHANGED
|
@@ -66,6 +66,8 @@ steps from memory:
|
|
|
66
66
|
|
|
67
67
|
### The agents — delegate the judgment calls
|
|
68
68
|
|
|
69
|
+
- **`bootstrap`** — runs `hedgehog-bootstrap`'s 7 steps once, at project
|
|
70
|
+
start, after Intake. Skip if `nx.json` already exists.
|
|
69
71
|
- **`planner`** — Intake (scope boundary + domain vocabulary) at project
|
|
70
72
|
start, and module scoping when new scope enters play. Writes `TODO.md`,
|
|
71
73
|
`docs/context.md`, and `docs/design/<module>-notes.md`.
|
|
@@ -174,9 +176,10 @@ context small:
|
|
|
174
176
|
- **A cleared or new session recovers by reading `TODO.md`,
|
|
175
177
|
`docs/context.md`, and the commit log**, never by needing the prior
|
|
176
178
|
conversation.
|
|
177
|
-
- **Delegate heavy work to agents.**
|
|
178
|
-
|
|
179
|
-
own isolated context — so that
|
|
179
|
+
- **Delegate heavy work to agents.** The project scaffold (`bootstrap`),
|
|
180
|
+
Intake elicitation (`planner`), screen builds (`ui-builder`), and
|
|
181
|
+
reviews (`reviewer`) each run in their own isolated context — so that
|
|
182
|
+
work doesn't pile up in the main thread.
|
|
180
183
|
- **Don't paste large context back in.** If you find yourself
|
|
181
184
|
re-explaining the architecture, stop — it's fixed and stated in this
|
|
182
185
|
file, not something to reconstruct. If you need a project specific, read
|