@skyf0xx/hedgehog 0.1.7 → 0.1.9

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 (88) hide show
  1. package/README.md +32 -35
  2. package/bin/cli.mjs +17 -5
  3. package/package.json +3 -2
  4. package/src/agents/bootstrap.md +133 -0
  5. package/src/agents/planner.md +58 -297
  6. package/src/agents/reviewer.md +7 -3
  7. package/src/golden-core/.github/workflows/phase-gate.yml +17 -0
  8. package/src/golden-core/.prettierignore +5 -0
  9. package/src/golden-core/.prettierrc +3 -0
  10. package/src/golden-core/.vscode/extensions.json +3 -0
  11. package/src/golden-core/apps/api/eslint.config.mjs +3 -0
  12. package/src/golden-core/apps/api/package.json +97 -0
  13. package/src/golden-core/apps/api/src/app/app.module.ts +10 -0
  14. package/src/golden-core/apps/api/src/app/health.controller.ts +9 -0
  15. package/src/golden-core/apps/api/src/assets/.gitkeep +0 -0
  16. package/src/golden-core/apps/api/src/main.ts +20 -0
  17. package/src/golden-core/apps/api/tsconfig.app.json +19 -0
  18. package/src/golden-core/apps/api/tsconfig.json +10 -0
  19. package/src/golden-core/apps/api/webpack.config.cjs +25 -0
  20. package/src/golden-core/apps/api-e2e/eslint.config.mjs +3 -0
  21. package/src/golden-core/apps/api-e2e/package.json +28 -0
  22. package/src/golden-core/apps/api-e2e/src/api/api.spec.ts +11 -0
  23. package/src/golden-core/apps/api-e2e/src/support/global-setup.ts +17 -0
  24. package/src/golden-core/apps/api-e2e/src/support/test-setup.ts +6 -0
  25. package/src/golden-core/apps/api-e2e/tsconfig.json +10 -0
  26. package/src/golden-core/apps/api-e2e/tsconfig.spec.json +28 -0
  27. package/src/golden-core/apps/api-e2e/vitest.config.mts +20 -0
  28. package/src/golden-core/apps/web/.prettierrc.js +10 -0
  29. package/src/golden-core/apps/web/.swcrc +30 -0
  30. package/src/golden-core/apps/web/components.json +21 -0
  31. package/src/golden-core/apps/web/eslint.config.mjs +12 -0
  32. package/src/golden-core/apps/web/index.d.ts +7 -0
  33. package/src/golden-core/apps/web/next-env.d.ts +6 -0
  34. package/src/golden-core/apps/web/next.config.js +9 -0
  35. package/src/golden-core/apps/web/package.json +23 -0
  36. package/src/golden-core/apps/web/postcss.config.mjs +7 -0
  37. package/src/golden-core/apps/web/public/.gitkeep +0 -0
  38. package/src/golden-core/apps/web/public/favicon.ico +0 -0
  39. package/src/golden-core/apps/web/src/app/global.css +83 -0
  40. package/src/golden-core/apps/web/src/app/layout.tsx +34 -0
  41. package/src/golden-core/apps/web/src/app/page.tsx +14 -0
  42. package/src/golden-core/apps/web/src/app/providers.tsx +12 -0
  43. package/src/golden-core/apps/web/src/components/theme-toggle.tsx +32 -0
  44. package/src/golden-core/apps/web/src/components/ui/button.tsx +60 -0
  45. package/src/golden-core/apps/web/src/lib/utils.ts +6 -0
  46. package/src/golden-core/apps/web/tsconfig.json +56 -0
  47. package/src/golden-core/apps/web-e2e/eslint.config.mjs +12 -0
  48. package/src/golden-core/apps/web-e2e/package.json +10 -0
  49. package/src/golden-core/apps/web-e2e/playwright.config.mts +75 -0
  50. package/src/golden-core/apps/web-e2e/src/example.spec.ts +7 -0
  51. package/src/golden-core/apps/web-e2e/tsconfig.json +26 -0
  52. package/src/golden-core/commitlint.config.cjs +3 -0
  53. package/src/golden-core/docker-compose.yml +14 -0
  54. package/src/golden-core/eslint.config.mjs +15 -0
  55. package/src/golden-core/lefthook.yml +17 -0
  56. package/src/golden-core/nx.json +83 -0
  57. package/src/golden-core/package.json +78 -0
  58. package/src/golden-core/packages/config/eslint-base.js +110 -0
  59. package/src/golden-core/packages/config/package.json +27 -0
  60. package/src/golden-core/packages/config/prettier.js +13 -0
  61. package/src/golden-core/packages/config/src/env.schema.spec.ts +25 -0
  62. package/src/golden-core/packages/config/src/env.schema.ts +17 -0
  63. package/src/golden-core/packages/config/src/index.ts +1 -0
  64. package/src/golden-core/packages/config/tsconfig.json +13 -0
  65. package/src/golden-core/packages/config/tsconfig.lib.json +27 -0
  66. package/src/golden-core/packages/config/tsconfig.spec.json +34 -0
  67. package/src/golden-core/packages/config/vitest.config.mts +18 -0
  68. package/src/golden-core/packages/db/package.json +27 -0
  69. package/src/golden-core/packages/db/src/index.ts +1 -0
  70. package/src/golden-core/packages/db/src/lib/db.spec.ts +48 -0
  71. package/src/golden-core/packages/db/src/lib/db.ts +40 -0
  72. package/src/golden-core/packages/db/tsconfig.json +13 -0
  73. package/src/golden-core/packages/db/tsconfig.lib.json +27 -0
  74. package/src/golden-core/packages/db/tsconfig.spec.json +34 -0
  75. package/src/golden-core/packages/db/vitest.config.mts +18 -0
  76. package/src/golden-core/pnpm-lock.yaml +22972 -0
  77. package/src/golden-core/pnpm-workspace.yaml +3 -0
  78. package/src/golden-core/tools/phase-gate.cjs +71 -0
  79. package/src/golden-core/tsconfig.base.json +21 -0
  80. package/src/golden-core/tsconfig.json +25 -0
  81. package/src/golden-core/vitest.workspace.ts +4 -0
  82. package/src/skills/hedgehog-bootstrap/SKILL.md +183 -597
  83. package/src/skills/hedgehog-bootstrap-core/SKILL.md +241 -0
  84. package/src/skills/hedgehog-intake/SKILL.md +353 -0
  85. package/src/skills/hedgehog-loop/SKILL.md +13 -5
  86. package/src/templates/CLAUDE.md +55 -27
  87. package/src/templates/TODO.md +15 -8
  88. package/src/templates/package.json +0 -5
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
- AI can write code faster than humans ever could.
3
+ [![GitHub stars](https://img.shields.io/github/stars/skyf0xx/hedgehog?style=social)](https://github.com/skyf0xx/hedgehog/stargazers)
4
4
 
5
- But **speed without discipline creates chaos**.
5
+ AI writes code faster than humans ever could, but **speed without discipline creates chaos**.
6
6
 
7
- Hedgehog gives AI the guard-rails it needs to **build software that stays clean.**
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
- A complete development methodology combining:
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
  ![Hedgehog — build software the right way, one step at a time](https://raw.githubusercontent.com/skyf0xx/hedgehog/master/docs/images/hero.png)
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
- ## Hedghog's secret to great outcomes
19
+ ## Hedgehog's secret to great outcomes
28
20
 
29
- - 🧩 **Progressive layering:** types → schema → backend → UI, each layer built on a stable one beneath it
30
- - 🎯 **Small context loops:** decompose work into atomic, verifiable changes
31
- - 🌳 **Self-documenting architecture:** the codebase carries the context, not the AI
32
- - 🔁 **Traceable evolution:** decisions are preserved through conventional commits
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
  ![Just describe what you want](https://raw.githubusercontent.com/skyf0xx/hedgehog/master/docs/images/curve.png)
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.
30
+ AI coding starts fast, then breaks down. Context accumulates, prompts get longer, architecture drifts. Eventually, adding one more feature feels dangerous.
41
31
 
42
- Eventually, adding one more feature feels
43
- dangerous.
44
-
45
- **The enemy isn't AI. It's the absence of guardrails.**
32
+ Hedgehog's answer: guardrails, not more discipline from the AI.
46
33
 
47
34
  ## Plans Expire. Structure Doesn't
48
35
 
@@ -65,10 +52,10 @@ The build order is not something you negotiate with the AI. It is encoded into t
65
52
  ## The Hedgehog Loop
66
53
 
67
54
  ``` text
68
- Bootstrap (once per project)
69
-
70
55
  Intake — scope boundary + domain vocabulary (planner agent)
71
56
 
57
+ Bootstrap (once per project)
58
+
72
59
  Phase A, per module — schema → contract → repository → service → controller
73
60
 
74
61
  Phase A closes for the module (gated: typecheck, lint, test)
@@ -89,9 +76,15 @@ From an empty project folder:
89
76
  npx @skyf0xx/hedgehog init
90
77
  ```
91
78
 
92
- Then open Claude Code and say:
79
+ Then open Claude Code and describe what you want to build. The
80
+ `planner` agent runs Intake first, asking what's in scope and which
81
+ add-ons (Auth, Queue, Mobile) you need; once you confirm, it scaffolds
82
+ the project itself.
93
83
 
94
- > bootstrap this project
84
+ The core workspace — Nx, `packages/config`, `packages/db`, `apps/api`,
85
+ `apps/web`, and every enforcement file — lands instantly from a
86
+ pre-verified template rather than being generated live; bootstrap then
87
+ only runs whichever add-ons Intake determined your project needs.
95
88
 
96
89
  Or paste the repo URL to your Agent and have it install for you.
97
90
 
@@ -115,7 +108,7 @@ AI becomes the builder operating inside those constraints — turning ideas into
115
108
 
116
109
  ## Architecture
117
110
 
118
- Hedgehog is a package of agents and skills. An opinionated stack is used so the build order above is mechanical and enforced by the tooling itself:
111
+ 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
112
 
120
113
  | Layer | Choice | Why |
121
114
  | --- | --- | --- |
@@ -141,11 +134,9 @@ Hedgehog is a package of agents and skills. An opinionated stack is used so the
141
134
 
142
135
  ## How Hedgehog Compares
143
136
 
144
- Superpowers and BMAD both improve on raw prompting: one gives the AI good habits, the other gives it a planning process.
145
-
146
- But in both, the order of work is a **convention, not a constraint** it's unable to break.
137
+ 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.
147
138
 
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.
139
+ 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
140
 
150
141
  | | Superpowers | BMAD | Hedgehog |
151
142
  | --- | --- | --- | --- |
@@ -157,3 +148,9 @@ Hedgehog **enforces its build order with tooling** instead: Nx module boundaries
157
148
  | **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
149
  | **Finding a bug** | Search wherever the task touched | Search wherever the story touched | Search one layer, in one module, in a fixed order |
159
150
  | **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 |
151
+
152
+ ## Support Hedgehog
153
+
154
+ If Hedgehog helps you build better AI software, consider giving it a ⭐ on GitHub.
155
+
156
+ [![GitHub stars](https://img.shields.io/github/stars/skyf0xx/hedgehog?style=social)](https://github.com/skyf0xx/hedgehog/stargazers)
package/bin/cli.mjs CHANGED
@@ -33,9 +33,13 @@ const PLAN = [
33
33
  { type: 'dir', from: 'src/skills', to: '.claude/skills' },
34
34
  { type: 'file', from: 'src/templates/CLAUDE.md', to: 'CLAUDE.md' },
35
35
  { type: 'file', from: 'src/templates/TODO.md', to: 'TODO.md' },
36
- // A minimal root package.json so bootstrap's `nx init` scaffolds a real
37
- // pnpm workspace rather than falling into standalone (.nx wrapper) mode.
38
- { type: 'file', from: 'src/templates/package.json', to: 'package.json' },
36
+ // The pre-built, pre-verified core Nx workspace packages/config,
37
+ // packages/db, apps/api, apps/web, and every enforcement file
38
+ // (lefthook, commitlint, phase gate, module boundaries). Lands the
39
+ // root package.json too, so there's no separate placeholder for it.
40
+ // `hedgehog-bootstrap-core` verifies this on first run rather than
41
+ // generating it live — see that skill for what's in here and why.
42
+ { type: 'dir', from: 'src/golden-core', to: '.' },
39
43
  ];
40
44
 
41
45
  const exists = (p) =>
@@ -130,8 +134,16 @@ async function init({ force }) {
130
134
  )}\n`,
131
135
  );
132
136
  console.log('Next steps:');
133
- console.log(` 1. ${bold('git add .claude CLAUDE.md TODO.md package.json && git commit')}`);
134
- console.log(` 2. Open Claude Code and say: ${bold('"bootstrap this project"')}\n`);
137
+ console.log(` 1. ${bold('git add -A && git commit -m "chore: install Hedgehog"')}`);
138
+ console.log(` 2. ${bold('pnpm install')}`);
139
+ console.log(` 3. Open Claude Code and say: ${bold('"bootstrap this project"')}\n`);
140
+ console.log(
141
+ dim(
142
+ 'The core workspace (Nx, packages/config, packages/db, apps/api,\n' +
143
+ 'apps/web) is already scaffolded and verified — bootstrap now only\n' +
144
+ 'runs whichever add-ons (Auth, Queue, Mobile) Intake calls for.',
145
+ ),
146
+ );
135
147
  }
136
148
 
137
149
  async function main() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skyf0xx/hedgehog",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "description": "Install the Hedgehog build discipline (agents + skills) into a repo.",
5
5
  "type": "module",
6
6
  "repository": {
@@ -20,7 +20,8 @@
20
20
  "bin",
21
21
  "src/agents",
22
22
  "src/skills",
23
- "src/templates"
23
+ "src/templates",
24
+ "src/golden-core"
24
25
  ],
25
26
  "engines": {
26
27
  "node": ">=18"
@@ -0,0 +1,133 @@
1
+ ---
2
+ name: bootstrap
3
+ description: Use once per invocation, at the start of a new Hedgehog project, to land core (via hedgehog-bootstrap-core, one pass) then run exactly ONE add-on step of the hedgehog-bootstrap skill (0-3 steps depending on Intake scope), handing off to a fresh instance of itself for the next add-on 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. Bootstrap has two
10
+ parts: **core**, landed in one pass by `hedgehog-bootstrap-core`
11
+ (copy a pre-built, pre-verified workspace, verify it's green, one
12
+ commit) — and **add-ons** (Auth, Queue, Mobile), run live, one at a time,
13
+ only when `docs/context.md`'s Add-ons note (written by `planner` at
14
+ Intake) turns each one on. A project with every add-on off does core
15
+ only, one commit total. A project with all three on does core plus
16
+ three more commits, one per add-on. **After core, you run exactly one
17
+ add-on step per invocation, then stop.**
18
+
19
+ You touch no domain modules — no schema, no contract, nothing under
20
+ `libs/<module>/`. That's Phase A, started after Bootstrap closes (core
21
+ plus every add-on that's on), run by `hedgehog-loop` and its own agents.
22
+
23
+ ## Which step is yours
24
+
25
+ `TODO.md`'s `## Bootstrap` section has one checkbox per core piece
26
+ (landed together) plus one per add-on. Before doing anything else:
27
+
28
+ 1. Read `TODO.md`. If any of the four core boxes are unchecked, core is
29
+ your step — run `hedgehog-bootstrap-core` in full (see below), not
30
+ an add-on.
31
+ 2. If all four core boxes are checked, find the **first unchecked**
32
+ add-on box — that's your step, and the only one you touch this run.
33
+ 3. Cross-check against the commit log
34
+ (`git log --oneline --grep="^feat("`) that no commit for your step
35
+ already exists. TODO.md is the fast path; the commit log is ground
36
+ truth if the two disagree (a commit landed but the box wasn't
37
+ checked) — trust the commit log and fix the checkbox before
38
+ proceeding.
39
+ 4. If every Bootstrap box (core and every add-on) is already checked,
40
+ there's no step for you to run — stop and say so; `hedgehog-loop`
41
+ owns everything from here.
42
+ 5. If `nx.json` already exists but boxes are unchecked, or a Bootstrap
43
+ commit exists for a step whose box is unchecked, that's drift
44
+ between TODO.md and reality, not a fresh start — reconcile the
45
+ checklist to match the commits actually on disk before running
46
+ anything, don't re-run a step that already landed.
47
+
48
+ ## Running core
49
+
50
+ Open `hedgehog-bootstrap-core` and follow it in full — it's a single,
51
+ short pass (confirm not already run, confirm Docker, land
52
+ `src/golden-core/` if the installer hasn't already, `pnpm install` +
53
+ `docker compose up -d`, verify typecheck/lint/test clean, one commit,
54
+ check all four core boxes at once). This isn't "step 1 of several" the
55
+ way add-ons are — it's copy-and-verify, not generate, so there's nothing
56
+ to gate between core's four pieces the way there was when each was
57
+ generated live. Don't skip ahead to add-ons until this pass completes
58
+ and its commit lands.
59
+
60
+ ## Running your add-on step
61
+
62
+ Once core is done, open `hedgehog-bootstrap` and read **only the
63
+ section for your add-on step** (Auth, Queue, or Mobile — plus
64
+ "Before running" and "Add-ons" for context on what's on/off). Don't read
65
+ ahead into other add-on steps' detail; you won't need it. Every command,
66
+ package choice, and known-issue workaround for your step lives in that
67
+ skill file — follow it exactly, don't work from memory of a prior
68
+ project's bootstrap (package/generator flags drift upstream).
69
+
70
+ Check `docs/context.md`'s Add-ons note — written by `planner` at
71
+ Intake — before doing anything else. That add-on off means this step
72
+ doesn't apply: check its box anyway (skipped-and-confirmed, not left
73
+ dangling for a future run to wonder about) and hand off to the next step
74
+ per "Closing your step" below (you're not necessarily the last step just
75
+ because you skipped — Queue skipped still hands off to Mobile). No
76
+ Add-ons note in `docs/context.md` at all (an older Intake, or drift) is
77
+ not the same as "off" — stop and point to `planner` to backfill the
78
+ decision rather than guessing which way to resolve it.
79
+
80
+ ## Closing your step
81
+
82
+ 1. Commit — exactly the message `hedgehog-bootstrap-core` or
83
+ `hedgehog-bootstrap` specifies for your step, once it compiles,
84
+ lints, and passes tests. A step that doesn't pass the gate isn't
85
+ done; don't check its box or hand off. (Skip this entirely for a
86
+ skipped add-on step — there's nothing to commit, just the checkbox.)
87
+ 2. Check the relevant box(es) in `TODO.md`'s `## Bootstrap` section (all
88
+ four core boxes together after core; one add-on box at a time after
89
+ that — skipped-and-confirmed if the add-on was off). Leave every
90
+ other box and every other section untouched.
91
+ 3. If every Bootstrap box is now checked — core plus every add-on,
92
+ whether run or skipped: Bootstrap is closed. State that plainly —
93
+ `hedgehog-loop` owns everything from here, one module at a time.
94
+ Don't hand off again. Check the whole `## Bootstrap` section for any
95
+ unchecked box before deciding you're done — don't assume by step
96
+ number alone (a project with Queue and Mobile both off closes right
97
+ after Auth, for instance).
98
+ 4. Otherwise: hand off to a fresh instance of yourself for the next
99
+ unchecked step (not necessarily the next add-on in table order — the
100
+ next one might itself be off, in which case that instance skips it
101
+ and hands off again). State plainly which step just closed/skipped
102
+ and which step is next, so whoever re-invokes you (the user or the
103
+ orchestrating session) knows to just say "continue bootstrap" rather
104
+ than re-deriving it.
105
+
106
+ ## Constraints
107
+
108
+ - Core lands in one pass, via `hedgehog-bootstrap-core`, before any
109
+ add-on step runs. After that, one add-on step per invocation — never
110
+ run two add-on steps in the same context just because you have room
111
+ left, the discipline is per-commit, not per-context-budget.
112
+ - Never re-run a step whose commit already exists — see "Which step is
113
+ yours." A felt need to redo a landed step is a Correction Protocol case
114
+ (patch it at its source, per `hedgehog-loop`), not a re-run.
115
+ - Don't scaffold `packages/auth`, `apps/worker`, or `apps/mobile` unless
116
+ that add-on is explicitly on per `docs/context.md`'s Add-ons note from
117
+ Intake.
118
+ - Don't add domain schema, contracts, or any `libs/<module>/*` content —
119
+ that's Phase A, started only after every Bootstrap box is checked.
120
+ - Don't deviate from the locked stack or package choices in
121
+ `hedgehog-bootstrap-core`/`hedgehog-bootstrap`, for whichever steps
122
+ actually run. If a generator or package name changed upstream since
123
+ those files were written, that's a `src/golden-core` regeneration
124
+ concern (see `hedgehog-bootstrap-core`), not something to patch
125
+ per-project — don't substitute a different library locally. Skipping
126
+ an add-on that's genuinely off is not a deviation.
127
+ - Local Postgres always runs through the `docker-compose.yml` core
128
+ lands, on every host OS, regardless of add-ons. Redis joins it only if
129
+ the Queue add-on is on. Never a natively-installed Postgres or Redis,
130
+ even to match a contributor's existing local setup.
131
+ - Don't read ahead into other steps' detail in `hedgehog-bootstrap`
132
+ beyond what "Running your add-on step" calls for — that's the context
133
+ budget this design protects.