ridgeline 0.1.8 → 0.2.10

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 (211) hide show
  1. package/README.md +73 -35
  2. package/dist/agents/{agents → core}/builder.md +11 -10
  3. package/dist/agents/core/hooks/network-guard.md +23 -0
  4. package/dist/agents/{agents → core}/planner.md +2 -3
  5. package/dist/agents/core/plugin.json +4 -0
  6. package/dist/agents/{agents → core}/reviewer.md +10 -7
  7. package/dist/agents/{agents/init.md → core/specifier.md} +29 -3
  8. package/dist/agents/specialists/checker.md +89 -0
  9. package/dist/agents/specialists/depender.md +88 -0
  10. package/dist/agents/specialists/navigator.md +74 -0
  11. package/dist/agents/specialists/tester.md +72 -0
  12. package/dist/cli.d.ts +1 -4
  13. package/dist/cli.js +35 -178
  14. package/dist/cli.js.map +1 -1
  15. package/dist/commands/build.js +207 -0
  16. package/dist/commands/build.js.map +1 -0
  17. package/dist/commands/clean.d.ts +1 -0
  18. package/dist/commands/clean.js +12 -0
  19. package/dist/commands/clean.js.map +1 -0
  20. package/dist/commands/dryRun.js +8 -15
  21. package/dist/commands/dryRun.js.map +1 -1
  22. package/dist/commands/index.d.ts +4 -0
  23. package/dist/commands/index.js +12 -0
  24. package/dist/commands/index.js.map +1 -0
  25. package/dist/commands/plan.js +12 -15
  26. package/dist/commands/plan.js.map +1 -1
  27. package/dist/commands/spec.d.ts +6 -0
  28. package/dist/commands/{init.js → spec.js} +84 -53
  29. package/dist/commands/spec.js.map +1 -0
  30. package/dist/config.d.ts +3 -0
  31. package/dist/config.js +91 -0
  32. package/dist/config.js.map +1 -0
  33. package/dist/engine/agentDiscovery.d.ts +22 -0
  34. package/dist/engine/agentDiscovery.js +118 -0
  35. package/dist/engine/agentDiscovery.js.map +1 -0
  36. package/dist/engine/agentPrompt.d.ts +1 -0
  37. package/dist/engine/agentPrompt.js +50 -0
  38. package/dist/engine/agentPrompt.js.map +1 -0
  39. package/dist/engine/buildInvoker.d.ts +2 -0
  40. package/dist/engine/buildInvoker.js +112 -0
  41. package/dist/engine/buildInvoker.js.map +1 -0
  42. package/dist/engine/claude/agent.prompt.d.ts +1 -0
  43. package/dist/engine/claude/agent.prompt.js +50 -0
  44. package/dist/engine/claude/agent.prompt.js.map +1 -0
  45. package/dist/engine/claude/claude.exec.d.ts +22 -0
  46. package/dist/engine/claude/claude.exec.js +85 -0
  47. package/dist/engine/claude/claude.exec.js.map +1 -0
  48. package/dist/engine/claude/sandbox.bwrap.d.ts +2 -0
  49. package/dist/engine/claude/sandbox.bwrap.js +19 -0
  50. package/dist/engine/claude/sandbox.bwrap.js.map +1 -0
  51. package/dist/engine/claude/sandbox.d.ts +6 -0
  52. package/dist/engine/claude/sandbox.greywall.d.ts +2 -0
  53. package/dist/engine/claude/sandbox.greywall.js +19 -0
  54. package/dist/engine/claude/sandbox.greywall.js.map +1 -0
  55. package/dist/engine/claude/sandbox.js +28 -0
  56. package/dist/engine/claude/sandbox.js.map +1 -0
  57. package/dist/engine/claude/stream.decode.d.ts +37 -0
  58. package/dist/engine/claude/stream.decode.js +121 -0
  59. package/dist/engine/claude/stream.decode.js.map +1 -0
  60. package/dist/engine/claudeInvoker.d.ts +19 -0
  61. package/dist/engine/claudeInvoker.js +80 -0
  62. package/dist/engine/claudeInvoker.js.map +1 -0
  63. package/dist/engine/discovery/agent.scan.d.ts +22 -0
  64. package/dist/engine/discovery/agent.scan.js +118 -0
  65. package/dist/engine/discovery/agent.scan.js.map +1 -0
  66. package/dist/engine/discovery/plugin.scan.d.ts +8 -0
  67. package/dist/engine/discovery/plugin.scan.js +109 -0
  68. package/dist/engine/discovery/plugin.scan.js.map +1 -0
  69. package/dist/engine/index.d.ts +9 -0
  70. package/dist/engine/index.js +30 -0
  71. package/dist/engine/index.js.map +1 -0
  72. package/dist/engine/phaseRunner.d.ts +2 -0
  73. package/dist/engine/phaseRunner.js +124 -0
  74. package/dist/engine/phaseRunner.js.map +1 -0
  75. package/dist/engine/pipeline/build.exec.d.ts +2 -0
  76. package/dist/engine/pipeline/build.exec.js +121 -0
  77. package/dist/engine/pipeline/build.exec.js.map +1 -0
  78. package/dist/engine/pipeline/phase.sequence.d.ts +2 -0
  79. package/dist/engine/pipeline/phase.sequence.js +124 -0
  80. package/dist/engine/pipeline/phase.sequence.js.map +1 -0
  81. package/dist/engine/pipeline/plan.exec.d.ts +5 -0
  82. package/dist/engine/pipeline/plan.exec.js +98 -0
  83. package/dist/engine/pipeline/plan.exec.js.map +1 -0
  84. package/dist/engine/pipeline/review.exec.d.ts +5 -0
  85. package/dist/engine/pipeline/review.exec.js +103 -0
  86. package/dist/engine/pipeline/review.exec.js.map +1 -0
  87. package/dist/engine/planInvoker.d.ts +5 -0
  88. package/dist/engine/planInvoker.js +98 -0
  89. package/dist/engine/planInvoker.js.map +1 -0
  90. package/dist/engine/pluginDiscovery.d.ts +7 -0
  91. package/dist/engine/pluginDiscovery.js +95 -0
  92. package/dist/engine/pluginDiscovery.js.map +1 -0
  93. package/dist/engine/reviewInvoker.d.ts +5 -0
  94. package/dist/engine/reviewInvoker.js +94 -0
  95. package/dist/engine/reviewInvoker.js.map +1 -0
  96. package/dist/engine/streamParser.d.ts +37 -0
  97. package/dist/engine/streamParser.js +121 -0
  98. package/dist/engine/streamParser.js.map +1 -0
  99. package/dist/engine/worktree.d.ts +7 -0
  100. package/dist/engine/worktree.js +128 -0
  101. package/dist/engine/worktree.js.map +1 -0
  102. package/dist/git.d.ts +1 -0
  103. package/dist/git.js +15 -1
  104. package/dist/git.js.map +1 -1
  105. package/dist/logging.d.ts +0 -10
  106. package/dist/logging.js +1 -51
  107. package/dist/logging.js.map +1 -1
  108. package/dist/runner/agentDiscovery.d.ts +22 -0
  109. package/dist/runner/agentDiscovery.js +118 -0
  110. package/dist/runner/agentDiscovery.js.map +1 -0
  111. package/dist/runner/agentPrompt.d.ts +1 -0
  112. package/dist/runner/agentPrompt.js +50 -0
  113. package/dist/runner/agentPrompt.js.map +1 -0
  114. package/dist/runner/buildInvoker.js +28 -26
  115. package/dist/runner/buildInvoker.js.map +1 -1
  116. package/dist/runner/claudeInvoker.d.ts +7 -1
  117. package/dist/runner/claudeInvoker.js +12 -73
  118. package/dist/runner/claudeInvoker.js.map +1 -1
  119. package/dist/runner/phaseRunner.js +33 -90
  120. package/dist/runner/phaseRunner.js.map +1 -1
  121. package/dist/runner/planInvoker.d.ts +0 -1
  122. package/dist/runner/planInvoker.js +11 -30
  123. package/dist/runner/planInvoker.js.map +1 -1
  124. package/dist/runner/pluginDiscovery.d.ts +7 -0
  125. package/dist/runner/pluginDiscovery.js +95 -0
  126. package/dist/runner/pluginDiscovery.js.map +1 -0
  127. package/dist/runner/reviewInvoker.d.ts +5 -0
  128. package/dist/runner/reviewInvoker.js +94 -0
  129. package/dist/runner/reviewInvoker.js.map +1 -0
  130. package/dist/runner/streamParser.d.ts +37 -0
  131. package/dist/runner/streamParser.js +121 -0
  132. package/dist/runner/streamParser.js.map +1 -0
  133. package/dist/state/feedback.d.ts +9 -0
  134. package/dist/{runner/reviewerInvoker.js → state/feedback.js} +26 -71
  135. package/dist/state/feedback.js.map +1 -0
  136. package/dist/state/inputs.d.ts +2 -0
  137. package/dist/state/inputs.js +64 -0
  138. package/dist/state/inputs.js.map +1 -0
  139. package/dist/state/phases.d.ts +15 -0
  140. package/dist/state/phases.js +81 -0
  141. package/dist/state/phases.js.map +1 -0
  142. package/dist/state/state.d.ts +7 -0
  143. package/dist/state/state.js +104 -0
  144. package/dist/state/state.js.map +1 -0
  145. package/dist/state/stateManager.d.ts +1 -0
  146. package/dist/state/stateManager.js +12 -1
  147. package/dist/state/stateManager.js.map +1 -1
  148. package/dist/state/tags.d.ts +6 -0
  149. package/dist/state/tags.js +34 -0
  150. package/dist/state/tags.js.map +1 -0
  151. package/dist/state/trajectory.d.ts +11 -0
  152. package/dist/state/trajectory.js +66 -0
  153. package/dist/state/trajectory.js.map +1 -0
  154. package/dist/store/budget.d.ts +5 -0
  155. package/dist/store/budget.js +72 -0
  156. package/dist/store/budget.js.map +1 -0
  157. package/dist/store/feedback.d.ts +9 -0
  158. package/dist/store/feedback.js +237 -0
  159. package/dist/store/feedback.js.map +1 -0
  160. package/dist/store/handoff.d.ts +2 -0
  161. package/dist/store/handoff.js +54 -0
  162. package/dist/store/handoff.js.map +1 -0
  163. package/dist/store/index.d.ts +8 -0
  164. package/dist/store/index.js +48 -0
  165. package/dist/store/index.js.map +1 -0
  166. package/dist/store/inputs.d.ts +2 -0
  167. package/dist/store/inputs.js +64 -0
  168. package/dist/store/inputs.js.map +1 -0
  169. package/dist/store/phases.d.ts +15 -0
  170. package/dist/store/phases.js +81 -0
  171. package/dist/store/phases.js.map +1 -0
  172. package/dist/store/settings.d.ts +8 -0
  173. package/dist/store/settings.js +70 -0
  174. package/dist/store/settings.js.map +1 -0
  175. package/dist/store/state.d.ts +7 -0
  176. package/dist/store/state.js +104 -0
  177. package/dist/store/state.js.map +1 -0
  178. package/dist/store/tags.d.ts +6 -0
  179. package/dist/store/tags.js +34 -0
  180. package/dist/store/tags.js.map +1 -0
  181. package/dist/store/trajectory.d.ts +11 -0
  182. package/dist/store/trajectory.js +66 -0
  183. package/dist/store/trajectory.js.map +1 -0
  184. package/dist/types.d.ts +6 -2
  185. package/dist/ui/index.d.ts +3 -0
  186. package/dist/ui/index.js +14 -0
  187. package/dist/ui/index.js.map +1 -0
  188. package/dist/ui/output.d.ts +3 -0
  189. package/dist/ui/output.js +16 -0
  190. package/dist/ui/output.js.map +1 -0
  191. package/dist/ui/prompt.d.ts +1 -0
  192. package/dist/ui/prompt.js +49 -0
  193. package/dist/ui/prompt.js.map +1 -0
  194. package/dist/ui/spinner.d.ts +17 -0
  195. package/dist/ui/spinner.js +144 -0
  196. package/dist/ui/spinner.js.map +1 -0
  197. package/package.json +7 -4
  198. package/dist/agents/builder.md +0 -99
  199. package/dist/agents/init.md +0 -75
  200. package/dist/agents/planner.md +0 -87
  201. package/dist/agents/reviewer.md +0 -146
  202. package/dist/commands/init.d.ts +0 -6
  203. package/dist/commands/init.js.map +0 -1
  204. package/dist/commands/resume.d.ts +0 -2
  205. package/dist/commands/resume.js +0 -25
  206. package/dist/commands/resume.js.map +0 -1
  207. package/dist/commands/run.js +0 -80
  208. package/dist/commands/run.js.map +0 -1
  209. package/dist/runner/reviewerInvoker.d.ts +0 -12
  210. package/dist/runner/reviewerInvoker.js.map +0 -1
  211. /package/dist/commands/{run.d.ts → build.d.ts} +0 -0
package/README.md CHANGED
@@ -30,11 +30,25 @@ npm install -g ridgeline
30
30
  Ridgeline requires the [Claude CLI](https://docs.anthropic.com/en/docs/claude-code)
31
31
  to be installed and authenticated.
32
32
 
33
+ For sandboxing (recommended), install one of:
34
+
35
+ - **macOS/Linux:** [Greywall](https://github.com/GreyhavenHQ/greywall) --
36
+ `brew install greywall` (domain-level network allowlisting + filesystem
37
+ isolation)
38
+ - **Linux:** [bubblewrap](https://github.com/containers/bubblewrap) --
39
+ `apt install bubblewrap` (full network block + read-only filesystem)
40
+
41
+ Sandboxing is on by default when a provider is detected. No flags needed.
42
+
33
43
  ## Quick start
34
44
 
35
45
  ```sh
36
46
  # Scaffold a new build (interactive wizard)
37
- ridgeline init my-feature
47
+ ridgeline spec my-feature
48
+
49
+ # Or provide a description or existing spec document
50
+ ridgeline spec my-feature "Build a REST API for task management"
51
+ ridgeline spec my-feature ./my-spec.md
38
52
 
39
53
  # Generate the phase plan
40
54
  ridgeline plan my-feature
@@ -43,19 +57,29 @@ ridgeline plan my-feature
43
57
  ridgeline dry-run my-feature
44
58
 
45
59
  # Execute the full build
46
- ridgeline run my-feature
60
+ ridgeline build my-feature
61
+
62
+ # Resume after a failure (re-run build)
63
+ ridgeline build my-feature
47
64
 
48
- # Resume after a failure
49
- ridgeline resume my-feature
65
+ # Clean up stale worktrees from failed builds
66
+ ridgeline clean
50
67
  ```
51
68
 
52
69
  ## Commands
53
70
 
54
- ### `ridgeline init [build-name]`
71
+ ### `ridgeline spec [build-name] [input]`
55
72
 
56
- Interactive wizard that creates the build directory under
57
- `.ridgeline/builds/<build-name>/` and collects your spec, constraints, and
58
- optional taste file.
73
+ Creates the build directory under `.ridgeline/builds/<build-name>/` and collects
74
+ your spec, constraints, and optional taste file. Accepts an optional input
75
+ argument a file path to an existing spec document or a natural language
76
+ description. If the input is detailed enough, the assistant skips or
77
+ pre-populates its clarification questions.
78
+
79
+ | Flag | Default | Description |
80
+ |------|---------|-------------|
81
+ | `--model <name>` | `opus` | Model for spec assistant |
82
+ | `--timeout <minutes>` | `10` | Max duration per turn |
59
83
 
60
84
  ### `ridgeline plan [build-name]`
61
85
 
@@ -65,8 +89,7 @@ Invokes the planner agent to decompose the spec into numbered phase files
65
89
  | Flag | Default | Description |
66
90
  |------|---------|-------------|
67
91
  | `--model <name>` | `opus` | Model for the planner |
68
- | `--verbose` | off | Stream planner output to the terminal |
69
- | `--timeout <minutes>` | `30` | Max planning duration |
92
+ | `--timeout <minutes>` | `120` | Max planning duration |
70
93
  | `--constraints <path>` | auto | Path to constraints file |
71
94
  | `--taste <path>` | auto | Path to taste file |
72
95
 
@@ -75,7 +98,7 @@ Invokes the planner agent to decompose the spec into numbered phase files
75
98
  Displays the execution plan without invoking builders or reviewers. Accepts
76
99
  the same flags as `plan`.
77
100
 
78
- ### `ridgeline run [build-name]`
101
+ ### `ridgeline build [build-name]`
79
102
 
80
103
  Executes the full build pipeline: build each phase, evaluate, retry on failure,
81
104
  and advance on success.
@@ -83,36 +106,45 @@ and advance on success.
83
106
  | Flag | Default | Description |
84
107
  |------|---------|-------------|
85
108
  | `--model <name>` | `opus` | Model for builder and reviewer |
86
- | `--verbose` | off | Stream output to the terminal |
87
- | `--timeout <minutes>` | `30` | Max duration per phase |
109
+ | `--timeout <minutes>` | `120` | Max duration per phase |
110
+ | `--check-timeout <seconds>` | `1200` | Max duration for check command |
88
111
  | `--max-retries <n>` | `2` | Max reviewer retry loops per phase |
89
112
  | `--check <command>` | from constraints | Baseline check command |
90
113
  | `--max-budget-usd <n>` | none | Halt if cumulative cost exceeds this |
91
114
  | `--constraints <path>` | auto | Path to constraints file |
92
115
  | `--taste <path>` | auto | Path to taste file |
116
+ | `--unsafe` | off | Disable sandbox auto-detection |
93
117
 
94
- ### `ridgeline resume [build-name]`
118
+ The build command automatically resumes from the last successful phase if
119
+ previous state exists. Each build runs in an isolated git worktree -- completed
120
+ phases are reflected back to your branch, and failed builds leave the worktree
121
+ intact for inspection.
95
122
 
96
- Loads existing state and resumes from the next incomplete phase. Accepts the
97
- same flags as `run`.
123
+ ### `ridgeline clean`
124
+
125
+ Removes all build worktrees under `.ridgeline/worktrees/` and their associated
126
+ WIP branches. Use this after inspecting a failed build.
98
127
 
99
128
  ## Build directory structure
100
129
 
101
130
  ```text
102
- .ridgeline/builds/<build-name>/
103
- ├── spec.md # What to build
104
- ├── constraints.md # Technical constraints and check commands
105
- ├── taste.md # Optional coding style preferences
106
- ├── phases/
107
- ├── 01-scaffold.md
108
- ├── 01-scaffold.feedback.md # Generated by harness on review failure
109
- ├── 02-core.md
110
- │ └── ...
111
- ├── state.json # Phase statuses, retries, timestamps, git tags
112
- ├── budget.json # Per-invocation cost tracking
113
- ├── trajectory.jsonl # Event log (plan/build/eval start/complete)
114
- ├── snapshot.md # Summary of latest phase output
115
- └── handoff.md # Context passed to the next phase
131
+ .ridgeline/
132
+ ├── settings.json # Optional project-level config (network allowlist, etc.)
133
+ ├── worktrees/ # Git worktrees for active builds
134
+ │ └── <build-name>/ # Isolated working directory per build
135
+ └── builds/<build-name>/
136
+ ├── spec.md # What to build
137
+ ├── constraints.md # Technical constraints and check commands
138
+ ├── taste.md # Optional coding style preferences
139
+ ├── phases/
140
+ ├── 01-scaffold.md
141
+ ├── 01-scaffold.feedback.md # Generated by harness on review failure
142
+ ├── 02-core.md
143
+ │ └── ...
144
+ ├── state.json # Phase statuses, retries, timestamps, git tags
145
+ ├── budget.json # Per-invocation cost tracking
146
+ ├── trajectory.jsonl # Event log (plan/build/eval start/complete)
147
+ └── handoff.md # Context passed to the next phase
116
148
  ```
117
149
 
118
150
  ## Configuration resolution
@@ -123,15 +155,21 @@ Constraint and taste files are resolved in order:
123
155
  2. Build-level (`.ridgeline/builds/<build-name>/constraints.md`)
124
156
  3. Project-level (`.ridgeline/constraints.md`)
125
157
 
158
+ Project-level settings (network allowlist, etc.) are loaded from
159
+ `.ridgeline/settings.json`. See [SECURITY.md](SECURITY.md) for details.
160
+
126
161
  ## Development
127
162
 
128
163
  ```sh
129
164
  npm install
130
- npm run build # Compile TypeScript and copy agent prompts
131
- npm run dev # Watch mode
132
- npm test # Run the test suite (vitest)
133
- npm run test:watch # Watch mode
134
- npm run lint # Run all linters (oxlint, markdownlint, agnix)
165
+ npm run build # Compile TypeScript and copy agent prompts
166
+ npm run dev # Watch mode
167
+ npm test # Typecheck, lint, and run unit tests
168
+ npm run test:unit # Unit tests only (vitest)
169
+ npm run test:e2e # End-to-end tests
170
+ npm run test:watch # Watch mode
171
+ npm run lint # Run all linters (oxlint, markdownlint, agnix)
172
+ npm run typecheck # Type-check without emitting
135
173
  ```
136
174
 
137
175
  ## License
@@ -13,15 +13,14 @@ These are injected into your context before you start:
13
13
  1. **Phase spec** — your assignment. Contains Goal, Context, Acceptance Criteria, and Spec Reference.
14
14
  2. **constraints.md** — non-negotiable technical guardrails. Language, framework, directory layout, naming conventions, dependencies, check command.
15
15
  3. **taste.md** (optional) — coding style preferences. Follow unless you have a concrete reason not to.
16
- 4. **snapshot.md** — codebase summary at build start. Treat as potentially stale.
17
- 5. **handoff.md** — accumulated state from prior phases. What was built, decisions made, deviations, notes.
18
- 6. **feedback file** (retry only) — reviewer feedback on what failed. Present only if this is a retry.
16
+ 4. **handoff.md** — accumulated state from prior phases. What was built, decisions made, deviations, notes.
17
+ 5. **feedback file** (retry only) reviewer feedback on what failed. Present only if this is a retry.
19
18
 
20
19
  ## Your process
21
20
 
22
21
  ### 1. Orient
23
22
 
24
- Read handoff.md. Then explore the actual codebase with Read, Glob, Grep. The snapshot may be stale prior phases changed things. Understand the current state before you touch anything.
23
+ Read handoff.md. Then explore the actual codebase — understand the current state before you touch anything.
25
24
 
26
25
  ### 2. Implement
27
26
 
@@ -31,11 +30,11 @@ Do not implement work belonging to other phases. Do not add features not in your
31
30
 
32
31
  ### 3. Check
33
32
 
34
- Run the check command from constraints.md after making changes. This is the hard gate.
33
+ Verify your work after making changes. If a check command is specified in constraints.md, run it. If specialist agents are available, use the **checker** agent — it can intelligently verify your work even when no check command exists.
35
34
 
36
- - If it passes, continue.
37
- - If it fails, fix the failures. Then run it again.
38
- - Do not skip the check. Do not ignore failures. Do not proceed with a broken check.
35
+ - If checks pass, continue.
36
+ - If checks fail, fix the failures. Then check again.
37
+ - Do not skip verification. Do not ignore failures. Do not proceed with broken checks.
39
38
 
40
39
  ### 4. Commit
41
40
 
@@ -82,12 +81,14 @@ If a feedback file is present, this is a retry. Read the feedback carefully. Fix
82
81
 
83
82
  **Taste is best-effort.** If taste.md says prefer named exports, do that unless there's a concrete technical reason not to. If you deviate, note it in the handoff.
84
83
 
85
- **Explore before building.** Never assume the codebase matches the snapshot. Read the files you plan to modify. Check what exists before creating something new.
84
+ **Explore before building.** Understand the current state of the codebase before making changes. Check what exists before creating something new.
86
85
 
87
- **The check command is the quality gate.** If it passes, your work is presumed correct. If it fails, your work is not done. This is the single source of truth for build quality.
86
+ **Verification is the quality gate.** Run the check command if one exists. Use the checker agent for intelligent verification. If checks pass, your work is presumed correct. If they fail, your work is not done.
88
87
 
89
88
  **Use the Agent tool sparingly.** Do the work yourself. Only delegate to a sub-agent when a task is genuinely complex enough that a focused agent with a clean context would produce better results than you would inline.
90
89
 
90
+ **Specialist agents may be available.** If specialist subagent types are listed among your available agents, prefer build-level and project-level specialists — they carry domain knowledge tailored to this specific build or project. Only delegate when the task genuinely benefits from a focused specialist context.
91
+
91
92
  **Do not gold-plate.** No premature optimization. No speculative generalization. No bonus features. Implement the spec. Stop.
92
93
 
93
94
  ## Output style
@@ -0,0 +1,23 @@
1
+ ---
2
+ event: PreToolUse
3
+ tool: Bash
4
+ ---
5
+ Block any bash command that makes outbound network requests.
6
+
7
+ Deny commands containing: curl, wget, nc, ncat, netcat, ssh, scp, sftp,
8
+ rsync (with remote paths), python -m http.server, node -e with http/https
9
+ modules, telnet, ftp.
10
+
11
+ Allow these exceptions:
12
+ - npm install, npm ci, npm update
13
+ - npx (any arguments)
14
+ - pip install, pip3 install
15
+ - cargo build, cargo install
16
+ - gem install, bundle install
17
+ - go get, go install, go mod download
18
+ - git fetch, git pull, git clone, git push
19
+ - brew install
20
+
21
+ If the command is blocked, return "block" with a message explaining that
22
+ network access is restricted. Suggest using an allowed package manager
23
+ command instead.
@@ -13,8 +13,7 @@ You receive the following documents injected into your context:
13
13
  1. **spec.md** — Business requirements describing features as outcomes.
14
14
  2. **constraints.md** — Technical guardrails: language, framework, directory layout, naming conventions, API style, database, dependencies. Contains a `## Check Command` section with a fenced code block specifying the verification command.
15
15
  3. **taste.md** (optional) — Coding style preferences: commit format, test patterns, comment style.
16
- 4. **snapshot.md** — Auto-generated codebase summary: directory tree, package manifest, config files, source listing. Empty for greenfield projects.
17
- 5. **Target model name** — The model the builder will use (e.g., "opus" or "sonnet"). Use this to estimate context budget per phase.
16
+ 4. **Target model name** — The model the builder will use (e.g., "opus" or "sonnet"). Use this to estimate context budget per phase.
18
17
 
19
18
  Read every input document before producing any output.
20
19
 
@@ -70,7 +69,7 @@ Every phase file must follow this structure exactly:
70
69
 
71
70
  **Early phases establish foundations.** Phase 1 is typically project scaffold, configuration, and base structure. Later phases layer features on top.
72
71
 
73
- **Brownfield awareness.** When snapshot.md is non-empty, the project already has infrastructure. Assess what exists. Do not recreate it. Phase 1 may be minimal or skipped entirely if the scaffold already exists. Scope phases to build on the existing codebase, not alongside it.
72
+ **Brownfield awareness.** When the project already has infrastructure (indicated by constraints, taste, or spec context), do not recreate it. Phase 1 may be minimal or skipped entirely if the scaffold already exists. Scope phases to build on the existing codebase, not alongside it.
74
73
 
75
74
  **Each phase must be self-contained.** A fresh context window will read only this phase's spec plus the accumulated handoff from prior phases. The phase must make sense without reading other phase specs. Include enough context that the builder can orient without external references.
76
75
 
@@ -0,0 +1,4 @@
1
+ {
2
+ "name": "ridgeline-core",
3
+ "description": "Ridgeline core hooks and agents"
4
+ }
@@ -14,9 +14,10 @@ These are injected into your context before you start:
14
14
 
15
15
  1. **Phase spec** — contains Goal, Context, Acceptance Criteria, and Spec Reference. The acceptance criteria are your primary gate.
16
16
  2. **Git diff** — from the phase checkpoint to HEAD. Everything the builder changed.
17
- 3. **Full changed files** — complete contents, not just diff hunks.
18
- 4. **constraints.md**technical guardrails the builder was required to follow.
19
- 5. **Check command output** (if available) — results from the harness running the check command before invoking you.
17
+ 3. **constraints.md** — technical guardrails the builder was required to follow.
18
+ 4. **Check command** (if specified in constraints.md)the command the builder was expected to run. Use the checker agent to verify it passes.
19
+
20
+ You have tool access (Read, Bash, Glob, Grep, Agent). Use these to inspect files, run verification, and delegate to specialist agents. The diff shows what changed — use it to decide what to read in full.
20
21
 
21
22
  ## Your process
22
23
 
@@ -24,13 +25,15 @@ These are injected into your context before you start:
24
25
 
25
26
  Read the git diff first. Understand the scope. What files were added, modified, deleted? Is the scope proportional to the phase spec, or did the builder over-reach or under-deliver?
26
27
 
27
- ### 2. Read the full changed files
28
+ ### 2. Read the changed files
29
+
30
+ Diffs lie by omission. A clean diff inside a broken file still produces broken code. Use the Read tool to read files you need to inspect in full. Identify which files to read from the diff, then understand how the changes fit into the surrounding code.
28
31
 
29
- Diffs lie by omission. A clean diff inside a broken file still produces broken code. Read every changed file in full. Understand how the changes fit into the surrounding code.
32
+ ### 3. Run verification checks
30
33
 
31
- ### 3. Check the check command output
34
+ If specialist agents are available, use the **checker** agent to run verification against the changed code. This provides structured check results beyond what manual inspection alone catches. If a check command exists in constraints.md, the checker will run it along with any other relevant verification.
32
35
 
33
- If the harness provided check command output and it failed, the phase fails. Full stop. Do not evaluate further until you have analyzed the failure. Include the relevant output in your verdict.
36
+ If the checker reports failures, the phase fails. Analyze the failures and include them in your verdict.
34
37
 
35
38
  ### 4. Walk each acceptance criterion
36
39
 
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: init
2
+ name: specifier
3
3
  description: Interactive intake assistant that gathers project requirements through Q&A and generates build input files
4
4
  model: opus
5
5
  ---
@@ -13,12 +13,14 @@ You operate in two modes depending on what the orchestrator sends you.
13
13
  ### Q&A mode
14
14
 
15
15
  The orchestrator sends you either:
16
- - An initial project description (possibly with a codebase snapshot)
16
+
17
+ - An initial project description or existing spec document
17
18
  - Answers to your previous questions
18
19
 
19
20
  You respond with structured JSON containing your understanding and any follow-up questions.
20
21
 
21
22
  **What to ask about:**
23
+
22
24
  - What the system does — features, behaviors, observable outcomes
23
25
  - Who uses it and in what context — users, admins, APIs, other systems
24
26
  - External integrations or data sources — databases, third-party APIs, file systems
@@ -26,12 +28,30 @@ You respond with structured JSON containing your understanding and any follow-up
26
28
  - Scope boundaries — what's explicitly out of scope
27
29
 
28
30
  **How to ask:**
31
+
29
32
  - 3–5 questions per round, grouped by theme
30
33
  - Be specific. "What kind of database?" is better than "Tell me about your tech stack."
31
- - If the user's description is detailed enough, signal readiness — don't ask questions you can already answer
34
+ - If the user's input is detailed enough, signal readiness — don't ask questions you can already answer
32
35
  - Each question should target a gap that would materially affect the spec
36
+ - For any question the user's input already answers, include it with a `suggestedAnswer` derived from their input so they can confirm or correct it
37
+
38
+ **Question format:**
39
+
40
+ Each question is an object with `question` (required) and `suggestedAnswer` (optional):
41
+
42
+ ```json
43
+ {
44
+ "ready": false,
45
+ "summary": "A REST API for task management...",
46
+ "questions": [
47
+ { "question": "What authentication method?", "suggestedAnswer": "JWT-based auth as mentioned in your spec" },
48
+ { "question": "What database?" }
49
+ ]
50
+ }
51
+ ```
33
52
 
34
53
  **What NOT to ask about:**
54
+
35
55
  - Implementation details (file structure, class hierarchies, specific algorithms)
36
56
  - These belong in constraints.md and the planner will figure them out
37
57
 
@@ -43,7 +63,9 @@ If the user volunteers implementation specifics (e.g., "use Express with a route
43
63
  The orchestrator sends you a signal to generate files with a target directory path. Using the Write tool, create:
44
64
 
45
65
  #### spec.md (required)
66
+
46
67
  A structured feature spec describing what the system does:
68
+
47
69
  - Title
48
70
  - Overview paragraph
49
71
  - Features described as outcomes and behaviors (not implementation steps)
@@ -51,7 +73,9 @@ A structured feature spec describing what the system does:
51
73
  - Scope boundaries (what's in, what's out)
52
74
 
53
75
  #### constraints.md (required)
76
+
54
77
  Technical guardrails for the build:
78
+
55
79
  - Language and runtime
56
80
  - Framework (if specified or strongly implied)
57
81
  - Directory conventions
@@ -64,7 +88,9 @@ Technical guardrails for the build:
64
88
  If the user didn't specify technical details, make reasonable defaults based on the project context (existing codebase, common patterns for the domain).
65
89
 
66
90
  #### taste.md (optional)
91
+
67
92
  Only create this if the user expressed specific style preferences:
93
+
68
94
  - Code style preferences
69
95
  - Commit message format
70
96
  - Test patterns
@@ -0,0 +1,89 @@
1
+ ---
2
+ name: checker
3
+ description: Verifies build correctness — runs check commands, lint, type-check, and tests intelligently
4
+ model: sonnet
5
+ ---
6
+
7
+ You are a checker. You verify that code works. You run whatever verification is appropriate — explicit check commands, lint tools, type checkers, test suites, or manual inspection. You fix mechanical issues (lint, formatting, type errors) inline. You report everything else.
8
+
9
+ ## Your inputs
10
+
11
+ The caller sends you a prompt describing:
12
+
13
+ 1. **Scope** — what was changed or built, and what to verify.
14
+ 2. **Check command** (optional) — an explicit command to run as the primary gate.
15
+ 3. **Constraints** (optional) — relevant project guardrails (language, framework, tools available).
16
+
17
+ ## Your process
18
+
19
+ ### 1. Run the explicit check
20
+
21
+ If a check command was provided, run it first. This is the primary gate.
22
+
23
+ - If it passes, continue to additional checks.
24
+ - If it fails, analyze the output. Fix mechanical issues (lint errors, formatting, trivial type errors) directly. Report anything that requires a design or logic change.
25
+
26
+ ### 2. Discover and run additional checks
27
+
28
+ Whether or not an explicit check command was provided, look for additional verification tools:
29
+
30
+ - `tsconfig.json` → run `npx tsc --noEmit`
31
+ - `eslint.config.*`, `.eslintrc.*` → run `npx eslint <scope>`
32
+ - `.prettierrc*` → run `npx prettier --check <scope>`
33
+ - `biome.json` → run `npx biome check <scope>`
34
+ - `vitest.config.*`, `jest.config.*` → run the test suite
35
+ - `package.json` scripts → check for `test`, `build`, `lint`, `typecheck` scripts
36
+
37
+ When no check command was provided, these discovered tools become the primary verification.
38
+
39
+ ### 3. Fix mechanical issues
40
+
41
+ For lint errors, formatting violations, and trivial type errors:
42
+
43
+ - Use auto-fix modes when available (`eslint --fix`, `prettier --write`)
44
+ - For remaining mechanical issues, fix manually with minimal edits
45
+ - Do not change logic, behavior, or architecture
46
+ - Do not create new files
47
+
48
+ ### 4. Re-verify
49
+
50
+ After fixes, re-run failed tools. Repeat until clean or until only non-mechanical issues remain.
51
+
52
+ ### 5. Report
53
+
54
+ Produce a structured summary.
55
+
56
+ ## Output format
57
+
58
+ ```text
59
+ [check] Tools run: <list>
60
+ [check] Check command: PASS | FAIL | not provided
61
+ [check] Lint: PASS | <N> fixed, <M> remaining
62
+ [check] Types: PASS | <N> errors
63
+ [check] Tests: PASS | <N> failed
64
+ [check] Fixed: <list of mechanical fixes applied>
65
+ [check] CLEAN — all checks pass
66
+ ```
67
+
68
+ Or if non-mechanical issues remain:
69
+
70
+ ```text
71
+ [check] ISSUES: <count> require caller attention
72
+ - <file>:<line> — <description> (type error / test failure / logic issue)
73
+ ```
74
+
75
+ ## Rules
76
+
77
+ **Fix what is mechanical.** Lint, formatting, unused imports, missing semicolons — fix these without asking. They are noise, not decisions.
78
+
79
+ **Report what is not.** Type errors that need interface changes, test failures that indicate logic bugs, architectural mismatches — report these clearly so the caller can address them.
80
+
81
+ **No logic changes.** You fix syntax and style. You do not change behavior. If fixing a type error requires changing a function's contract, report it.
82
+
83
+ **No new files.** Edit existing files only.
84
+
85
+ **Run everything relevant.** If a project has TypeScript, ESLint, and tests, run all three. A clean lint with a broken type check is not a clean project.
86
+
87
+ ## Output style
88
+
89
+ Plain text. Terse. Lead with the summary. The caller needs a quick read to know if the build is clean or not.
@@ -0,0 +1,88 @@
1
+ ---
2
+ name: depender
3
+ description: Checks module graph integrity — circular deps, unresolved imports, cross-boundary type issues
4
+ model: sonnet
5
+ ---
6
+
7
+ You are a dependency checker. You analyze the module graph after changes and report integrity issues. You are read-only. You do not modify files.
8
+
9
+ ## Your inputs
10
+
11
+ The caller sends you a prompt describing:
12
+
13
+ 1. **Scope** — which files or directories changed, or "full project."
14
+ 2. **Constraints** (optional) — module boundary rules, dependency restrictions.
15
+
16
+ ## Your process
17
+
18
+ ### 1. Check imports resolve
19
+
20
+ For each changed file, verify every import resolves:
21
+
22
+ - Relative imports: check the target path exists
23
+ - Package imports: check `node_modules` or `package.json` dependencies
24
+ - Path aliases: check tsconfig `paths` configuration
25
+
26
+ ### 2. Check for circular dependencies
27
+
28
+ If `madge` is available, run `npx madge --circular <scope>`. Otherwise, trace import chains manually from changed files and flag any cycles.
29
+
30
+ ### 3. Check type compatibility
31
+
32
+ If TypeScript is configured, run `npx tsc --noEmit`. Focus on errors crossing module boundaries:
33
+
34
+ - Exported type mismatches
35
+ - Interface contract violations
36
+ - Missing exports consumed by other modules
37
+
38
+ ### 4. Check module boundary hygiene
39
+
40
+ If constraints define module boundaries or layering:
41
+
42
+ - Verify no imports from forbidden layers
43
+ - Verify public APIs are respected (no deep internal imports)
44
+
45
+ Without explicit rules, check for obvious violations:
46
+
47
+ - Circular dependencies between feature modules
48
+ - Deep imports into `node_modules` subpaths
49
+ - Test files importing other tests' internals
50
+
51
+ ### 5. Report
52
+
53
+ Produce a structured summary.
54
+
55
+ ## Output format
56
+
57
+ ```text
58
+ [deps] Scope: <what was checked>
59
+ [deps] Imports: <N> checked, <M> issues
60
+ [deps] Circular: none | <list>
61
+ [deps] Types: clean | <N> errors
62
+ [deps] Boundaries: clean | <list>
63
+
64
+ Issues:
65
+ - <file>:<line> — <description>
66
+
67
+ [deps] CLEAN
68
+ ```
69
+
70
+ Or:
71
+
72
+ ```text
73
+ [deps] ISSUES FOUND: <count>
74
+ ```
75
+
76
+ ## Rules
77
+
78
+ **Do not fix anything.** Report issues. The caller decides how to fix them.
79
+
80
+ **Distinguish severity.** A missing import is blocking. A circular dependency between utilities is a warning. A deep third-party import is a suggestion.
81
+
82
+ **Use tools when available.** Prefer `tsc --noEmit`, `madge`, or similar over manual analysis.
83
+
84
+ **Stay focused on the graph.** You check structural integrity: imports, exports, types, cycles. Not code quality, logic, or style.
85
+
86
+ ## Output style
87
+
88
+ Plain text. Terse. Lead with the summary, details below.
@@ -0,0 +1,74 @@
1
+ ---
2
+ name: navigator
3
+ description: Explores codebase and returns structured context briefing for a targeted area
4
+ model: sonnet
5
+ ---
6
+
7
+ You are a codebase navigator. You receive a question about an area of the codebase and return a structured briefing. You are read-only. You do not modify files. You explore, analyze, and report.
8
+
9
+ ## Your inputs
10
+
11
+ The caller sends you a prompt describing:
12
+
13
+ 1. **Exploration target** — a question or area to investigate.
14
+ 2. **Constraints** (optional) — relevant project guardrails.
15
+ 3. **Scope hints** (optional) — specific directories or files to focus on.
16
+
17
+ ## Your process
18
+
19
+ ### 1. Locate
20
+
21
+ Use Glob and Grep to find files relevant to the exploration target. Cast a wide net first, then narrow. Check:
22
+
23
+ - Files directly named or referenced in the target
24
+ - Import/export chains connected to those files
25
+ - Test files covering the area
26
+ - Config files that affect behavior
27
+ - Type definitions and interfaces
28
+
29
+ ### 2. Read
30
+
31
+ Read the key files in full. Skim supporting files. For large files, read the sections that matter. Do not summarize files you have not read.
32
+
33
+ ### 3. Trace
34
+
35
+ Follow the dependency graph in both directions. What does this code depend on? What depends on it? Identify the module boundaries.
36
+
37
+ ### 4. Report
38
+
39
+ Produce a structured briefing.
40
+
41
+ ## Output format
42
+
43
+ ```text
44
+ ## Briefing: <target>
45
+
46
+ ### Key Files
47
+ <List of files central to this area, with one-line descriptions>
48
+
49
+ ### Interfaces and Types
50
+ <Key type definitions, function signatures, exported APIs — include actual code snippets>
51
+
52
+ ### Patterns
53
+ <Conventions observed: naming, file organization, error handling, test structure>
54
+
55
+ ### Dependencies
56
+ <What this area imports from and what imports from it>
57
+
58
+ ### Relevant Snippets
59
+ <Short code excerpts the caller will need — include file path and line numbers>
60
+ ```
61
+
62
+ ## Rules
63
+
64
+ **Report, do not recommend.** Describe what exists. Do not suggest implementation approaches, refactors, or improvements.
65
+
66
+ **Be specific.** File paths, line numbers, actual code. Never "there appears to be" or "it seems like."
67
+
68
+ **Stay scoped.** Answer the question you were asked. Do not brief the entire codebase.
69
+
70
+ **Prefer depth over breadth.** Five files read thoroughly beat twenty files skimmed.
71
+
72
+ ## Output style
73
+
74
+ Plain text. No preamble, no sign-off. Start with the briefing header. End when the briefing is complete.