superpowers-mcp 6.3.1 → 6.3.3
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.ja.md +33 -8
- package/README.ko.md +33 -8
- package/README.md +33 -8
- package/README.zh-TW.md +32 -7
- package/out/server.js +39 -15
- package/package.json +1 -1
- package/skills/subagent-driven-development/SKILL.md +56 -2
- package/skills/subagent-driven-development/implementer-prompt.md +5 -2
- package/skills/using-superpowers/SKILL.md +2 -0
- package/skills/using-superpowers/references/devin-tools.md +41 -0
- package/skills/using-superpowers/references/opencode-tools.md +32 -0
- package/skills/writing-plans/SKILL.md +24 -0
- package/skills/writing-plans/skeleton-first-plans.md +131 -0
- package/skills/writing-skills/render-graphs.js +7 -6
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "superpowers-mcp",
|
|
3
3
|
"displayName": "Superpowers MCP",
|
|
4
4
|
"description": "Superpowers skills library (TDD, debugging, collaboration workflows) as an MCP server for VSCode and Antigravity",
|
|
5
|
-
"version": "6.3.
|
|
5
|
+
"version": "6.3.3",
|
|
6
6
|
"publisher": "superpowers",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"repository": {
|
|
@@ -173,6 +173,14 @@ its own text agrees with itself — the tests it specifies against the code it
|
|
|
173
173
|
specifies, the files it creates against the files it later touches. "The scan
|
|
174
174
|
is clean" without those rows is not a scan you ran.
|
|
175
175
|
|
|
176
|
+
**When the plan's header declares `Plan shape: skeleton-first`,** the
|
|
177
|
+
table gets a final section: the DISPATCH PLAN — group the pending tasks
|
|
178
|
+
into waves. Tasks in the same wave are mutually file-disjoint and consume
|
|
179
|
+
no interface still under construction — dispatch each wave's implementers
|
|
180
|
+
concurrently, one worktree per task, and integrate before the next wave;
|
|
181
|
+
tasks that fail those conditions serialize. On a skeleton-first plan, a
|
|
182
|
+
scan without a dispatch plan is not a scan you ran.
|
|
183
|
+
|
|
176
184
|
Write the table to the ledger. Rule on everything you find before execution
|
|
177
185
|
begins — each finding against the plan text that mandates it — and record
|
|
178
186
|
each ruling in the ledger. If the scan is clean, proceed without comment.
|
|
@@ -187,6 +195,10 @@ Use the least powerful model that can handle each role to conserve cost and incr
|
|
|
187
195
|
|
|
188
196
|
**Mechanical implementation tasks** (isolated functions, clear specs, 1-2 files): use a fast, cheap model. Most implementation tasks are mechanical when the plan is well-specified.
|
|
189
197
|
|
|
198
|
+
When a task carries a **Tier:** field, follow it — the planner already
|
|
199
|
+
ruled: mechanical → the cheapest available model; judgment → a standard
|
|
200
|
+
model. Do not re-litigate the tier at dispatch.
|
|
201
|
+
|
|
190
202
|
**Integration and judgment tasks** (multi-file coordination, pattern matching, debugging): use a standard model.
|
|
191
203
|
|
|
192
204
|
**Architecture and design tasks**: use the most capable available model.
|
|
@@ -208,7 +220,10 @@ most expensive — which silently defeats this section.
|
|
|
208
220
|
**Turn count beats token price.** Wall-clock and context cost scale with how
|
|
209
221
|
many turns a subagent takes, and the cheapest models routinely take 2-3× the
|
|
210
222
|
turns on multi-step work — costing more overall. Use a mid-tier model as the
|
|
211
|
-
floor for reviewers and for implementers working from
|
|
223
|
+
floor for reviewers and for implementers working from task contracts or
|
|
224
|
+
prose descriptions — unless the task's Tier line says mechanical: the
|
|
225
|
+
planner has already ruled the deliverable fully specified, so treat a
|
|
226
|
+
mechanical-tier contract like spelled-out content.
|
|
212
227
|
When the task's plan text contains the complete code to write, the
|
|
213
228
|
implementation is transcription plus testing: use the cheapest tier for
|
|
214
229
|
that implementer. Single-file mechanical fixes also take the cheapest tier.
|
|
@@ -260,7 +275,13 @@ and fix-round diffs need it.
|
|
|
260
275
|
know; (4) your resolution of any ambiguity you noticed in the brief;
|
|
261
276
|
(5) the report-file path and report contract. Exact values (numbers,
|
|
262
277
|
magic strings, signatures, test cases) appear only in the brief. Never
|
|
263
|
-
make a subagent read the whole plan file.
|
|
278
|
+
make a subagent read the whole plan file. When the brief is a contract
|
|
279
|
+
(goal, success criteria, interfaces) rather than written-out code, item
|
|
280
|
+
(3) also carries the elaboration the contract leaves to dispatch time:
|
|
281
|
+
the interfaces as actually built by completed tasks, environment facts
|
|
282
|
+
and discoveries from earlier reports, and any amendment rulings. There
|
|
283
|
+
the success criteria name the cases the tests must cover, and the
|
|
284
|
+
implementer designs its own code and tests within the contract.
|
|
264
285
|
- **Report file:** name the implementer's report file after the brief
|
|
265
286
|
(brief `…/task-N-brief.md` → report `…/task-N-report.md`) and put it in
|
|
266
287
|
the dispatch prompt. The implementer writes the full report there and
|
|
@@ -281,6 +302,26 @@ and fix-round diffs need it.
|
|
|
281
302
|
- Record the implementer's agent identity from the dispatch result —
|
|
282
303
|
fix-loop rounds 1-3 resume this agent.
|
|
283
304
|
- Never dispatch multiple implementation subagents in parallel (conflicts).
|
|
305
|
+
The one exception is a skeleton-first plan whose dispatch plan shows two
|
|
306
|
+
or more pending tasks mutually file-disjoint with none consuming an
|
|
307
|
+
interface still under construction. Dispatch those implementers
|
|
308
|
+
concurrently, each in its own worktree:
|
|
309
|
+
- Record the integration base commit in the ledger before the first
|
|
310
|
+
concurrent dispatch.
|
|
311
|
+
- Create one worktree per concurrent task off that base
|
|
312
|
+
(`git worktree add <repo-root>/.worktrees/task-<N> -b task-<N>
|
|
313
|
+
<base>`); each dispatch's `Work from:` is its own worktree, and its
|
|
314
|
+
BASE is that worktree's HEAD.
|
|
315
|
+
- Review each task's diff as usual when it reports. Integrate reviewed
|
|
316
|
+
branches in plan order: merge each into the integration branch
|
|
317
|
+
(`git merge --no-ff task-<N>`), and run that task's verification
|
|
318
|
+
commands after each merge.
|
|
319
|
+
- A merge conflict or post-merge verification failure is that task's
|
|
320
|
+
fix-loop round 1: rebase the task branch onto the current
|
|
321
|
+
integration head in its worktree, then resume its implementer
|
|
322
|
+
there. Never resolve conflicts yourself.
|
|
323
|
+
- Remove each worktree (`git worktree remove`) once its branch is
|
|
324
|
+
integrated, and record the integrated range in the ledger as usual.
|
|
284
325
|
|
|
285
326
|
Template: [implementer-prompt.md](implementer-prompt.md)
|
|
286
327
|
|
|
@@ -442,6 +483,19 @@ message as your other bookkeeping:
|
|
|
442
483
|
- `Task <N>: complete (commits <base7>..<head7>, <K> parked)` after a
|
|
443
484
|
tripped breaker
|
|
444
485
|
|
|
486
|
+
**On a skeleton-first plan,** write one plan-check line with the
|
|
487
|
+
completion line. Re-read the remaining tasks against what this task
|
|
488
|
+
actually established — interfaces as built, environment facts,
|
|
489
|
+
discoveries in the report — and append either `Plan holds` or
|
|
490
|
+
`Amendment: Task <M>: <what changes and why>` to the ledger. An
|
|
491
|
+
amendment is plan authority applied at the plan layer: from then on the
|
|
492
|
+
amended text IS the plan's text, and it rides into every affected task's
|
|
493
|
+
dispatch under item (3). In-flight tasks in the same concurrent wave are
|
|
494
|
+
not aborted mid-flight; any interface divergences are surfaced and
|
|
495
|
+
resolved through the standard integration merge, rebase, and fix-loop
|
|
496
|
+
protocol. Never dispatch a task whose brief a completed task's report has
|
|
497
|
+
already invalidated.
|
|
498
|
+
|
|
445
499
|
Then mark the todo complete and move on. Never move to the next task while
|
|
446
500
|
the review has open Critical/Important issues that are neither fixed nor
|
|
447
501
|
parked-with-ruling at the cap.
|
|
@@ -5,8 +5,11 @@ Use this template when dispatching an implementer subagent.
|
|
|
5
5
|
```
|
|
6
6
|
Subagent (general-purpose):
|
|
7
7
|
description: "Implement Task N: [task name]"
|
|
8
|
-
model: [MODEL — REQUIRED:
|
|
9
|
-
|
|
8
|
+
model: [MODEL — REQUIRED: when the brief carries a Tier line, set from it:
|
|
9
|
+
mechanical → the cheapest model the subagent tool offers; judgment →
|
|
10
|
+
a standard mid-tier model. Otherwise choose per SKILL.md Model
|
|
11
|
+
Selection. An omitted model silently inherits the session's most
|
|
12
|
+
expensive one]
|
|
10
13
|
prompt: |
|
|
11
14
|
You are implementing Task N: [task name]
|
|
12
15
|
|
|
@@ -57,6 +57,8 @@ If your harness appears here, read its reference file for special instructions:
|
|
|
57
57
|
- Pi: `references/pi-tools.md`
|
|
58
58
|
- Antigravity: `references/antigravity-tools.md`
|
|
59
59
|
- Hermes Agent: `references/hermes-tools.md`
|
|
60
|
+
- Devin CLI: `references/devin-tools.md`
|
|
61
|
+
- OpenCode: `references/opencode-tools.md`
|
|
60
62
|
|
|
61
63
|
## User Instructions
|
|
62
64
|
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Devin CLI Tool Mapping
|
|
2
|
+
|
|
3
|
+
Skills speak in actions ("dispatch a subagent", "create a todo", "read a file"). On Devin CLI these resolve to the tools below.
|
|
4
|
+
|
|
5
|
+
## Tools
|
|
6
|
+
|
|
7
|
+
| Action skills request | Devin CLI tool |
|
|
8
|
+
|---|---|
|
|
9
|
+
| Read a file | `read_file` / `view_file` |
|
|
10
|
+
| Create a new file | `write_to_file` |
|
|
11
|
+
| Edit a file (targeted patch) | `replace_file_content` / `edit_file` |
|
|
12
|
+
| Run a shell command | `run_command` |
|
|
13
|
+
| Search file contents | `grep_search` |
|
|
14
|
+
| Find files by name | `find_by_name` / `list_dir` |
|
|
15
|
+
| Fetch a URL / read a webpage | `read_url_content` / `browser` |
|
|
16
|
+
| Search the web | `search_web` |
|
|
17
|
+
| Dispatch a subagent | `invoke_subagent` / `spawn_agent` |
|
|
18
|
+
| Task tracking | `task_list` / session todo list |
|
|
19
|
+
| Ask user question | `ask_question` |
|
|
20
|
+
| Invoke a skill | Native `skill` tool or `read_skill` via MCP |
|
|
21
|
+
|
|
22
|
+
## Instructions file
|
|
23
|
+
|
|
24
|
+
When a skill mentions "your instructions file," on Devin CLI this is **`DEVIN.md`** or **`AGENTS.md`** in the project root directory.
|
|
25
|
+
|
|
26
|
+
## Invoking a skill
|
|
27
|
+
|
|
28
|
+
Devin CLI auto-discovers skills from installed plugins. To invoke a superpowers skill, invoke the native skill runner or call the MCP tool:
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
skill(name="brainstorming")
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
If native skill resolution is unavailable, fall back to reading the skill file directly or via the MCP server's `read_skill` tool.
|
|
35
|
+
|
|
36
|
+
## Subagent dispatch
|
|
37
|
+
|
|
38
|
+
When executing Subagent-Driven Development (SDD) or parallel dispatch, use Devin's subagent capability (`invoke_subagent`):
|
|
39
|
+
|
|
40
|
+
- **Implementers**: Dispatch focused implementer subagents for single task isolation.
|
|
41
|
+
- **Reviewers**: Dispatch fresh, independent reviewer subagents to review against specifications.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# OpenCode Tool Mapping
|
|
2
|
+
|
|
3
|
+
Skills speak in actions ("dispatch a subagent", "create a todo", "read a file"). On OpenCode these resolve to the tools below.
|
|
4
|
+
|
|
5
|
+
## Tools
|
|
6
|
+
|
|
7
|
+
| Action skills request | OpenCode tool |
|
|
8
|
+
|---|---|
|
|
9
|
+
| Read a file | `read_file` |
|
|
10
|
+
| Create a new file | `write_file` |
|
|
11
|
+
| Edit a file (targeted patch) | `edit_file` |
|
|
12
|
+
| Run a shell command | `bash` / `terminal` |
|
|
13
|
+
| Search file contents | `grep` / `search_files` |
|
|
14
|
+
| Find files by name | `find_files` |
|
|
15
|
+
| Fetch a URL / read a webpage | `fetch_url` |
|
|
16
|
+
| Search the web | `web_search` |
|
|
17
|
+
| Invoke a skill | `use_skill(name="...")` or MCP `read_skill` |
|
|
18
|
+
| List available skills | `find_skills` or MCP `list_skills` |
|
|
19
|
+
|
|
20
|
+
## Instructions file
|
|
21
|
+
|
|
22
|
+
When a skill mentions "your instructions file," on OpenCode this is **`AGENTS.md`** or **`OPENCODE.md`** in the project root directory.
|
|
23
|
+
|
|
24
|
+
## Invoking a skill
|
|
25
|
+
|
|
26
|
+
OpenCode discovers registered skills via its plugin ecosystem or MCP server. To invoke a skill:
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
use_skill(name="brainstorming")
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Or when running through the Superpowers MCP Server, use `read_skill(skill_name="brainstorming")`.
|
|
@@ -22,6 +22,30 @@ Assume they are a skilled developer, but know almost nothing about our toolset o
|
|
|
22
22
|
|
|
23
23
|
If the spec covers multiple independent subsystems, it should have been broken into sub-project specs during brainstorming. If it wasn't, suggest breaking this into separate plans — one per subsystem. Each plan should produce working, testable software on its own.
|
|
24
24
|
|
|
25
|
+
## Two Plan Shapes
|
|
26
|
+
|
|
27
|
+
Before mapping files, classify the plan's shape and say the
|
|
28
|
+
classification out loud — "this composes three subsystems, so I'll plan
|
|
29
|
+
it skeleton-first" — so your human partner can override it:
|
|
30
|
+
|
|
31
|
+
- **Task-by-task (default)** — tasks build the feature a component at a
|
|
32
|
+
time, each step carrying the actual content the engineer needs. Use it
|
|
33
|
+
for changes to code that already exists, for a spec that touches one
|
|
34
|
+
subsystem, and whenever the alternative's conditions do not clearly
|
|
35
|
+
hold. The rest of this skill describes this shape.
|
|
36
|
+
- **Skeleton-first (alternative)** — Task 1 is the thinnest end-to-end
|
|
37
|
+
slice through every subsystem the spec composes; later tasks widen it
|
|
38
|
+
one component at a time, each from a contract rather than written-out
|
|
39
|
+
code. Use it when the spec composes more than one subsystem AND a
|
|
40
|
+
running end-to-end slice early is worth a longer total build. Read
|
|
41
|
+
[skeleton-first-plans.md](skeleton-first-plans.md) before writing one
|
|
42
|
+
— it adds one line to the plan header and replaces this skill's task
|
|
43
|
+
granularity, task template, and plan-failure list.
|
|
44
|
+
|
|
45
|
+
When in doubt, plan task-by-task. Skeleton-first buys an earlier running
|
|
46
|
+
system and pays for it in total wall clock; it is a trade, not an
|
|
47
|
+
upgrade.
|
|
48
|
+
|
|
25
49
|
## File Structure
|
|
26
50
|
|
|
27
51
|
Before defining tasks, map out which files will be created or modified and what each one is responsible for. This is where decomposition decisions get locked in.
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
# Skeleton-First Plans
|
|
2
|
+
|
|
3
|
+
The alternative plan shape from writing-plans' Two Plan Shapes router.
|
|
4
|
+
Each section below replaces the same-named section of
|
|
5
|
+
[SKILL.md](SKILL.md); everything SKILL.md says that is not named here
|
|
6
|
+
still binds — Scope Check, File Structure, Task Right-Sizing, the plan
|
|
7
|
+
header, Self-Review, and the Execution Handoff.
|
|
8
|
+
|
|
9
|
+
## Overview
|
|
10
|
+
|
|
11
|
+
Write a plan that carries the decisions, not the keystrokes:
|
|
12
|
+
decomposition, file structure, interfaces, constraints, and a precise
|
|
13
|
+
contract per task. Assume the engineer is skilled and designs their own
|
|
14
|
+
code and tests from a precise contract, but knows nothing about our
|
|
15
|
+
codebase, toolset, or problem domain — every name, path, constraint, and
|
|
16
|
+
behavior they must match is stated explicitly. DRY. YAGNI. TDD.
|
|
17
|
+
Frequent commits.
|
|
18
|
+
|
|
19
|
+
## When This Shape Fits
|
|
20
|
+
|
|
21
|
+
Use it when the spec composes more than one subsystem and a running
|
|
22
|
+
end-to-end slice early is worth a longer total build: the value arrives
|
|
23
|
+
as soon as real input reaches real output, and every later task widens
|
|
24
|
+
something that already runs.
|
|
25
|
+
|
|
26
|
+
Do not use it for a change to one subsystem, or when the whole point is
|
|
27
|
+
to land the finished thing as fast as possible. This shape spends its
|
|
28
|
+
first task on a slice that does almost nothing, and it spends planning
|
|
29
|
+
effort on contracts and interfaces the task-by-task shape gets for free
|
|
30
|
+
by writing the code out.
|
|
31
|
+
|
|
32
|
+
## Plan Document Header
|
|
33
|
+
|
|
34
|
+
The header is SKILL.md's, plus one line directly under the **Goal:**
|
|
35
|
+
line, which is how executors know which shape they are running:
|
|
36
|
+
|
|
37
|
+
```markdown
|
|
38
|
+
**Plan shape:** skeleton-first
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Walking Skeleton First
|
|
42
|
+
|
|
43
|
+
Task 1 builds the thinnest end-to-end slice through every subsystem the
|
|
44
|
+
spec composes — real input to real output — before any task deepens a
|
|
45
|
+
single layer; later tasks widen the skeleton.
|
|
46
|
+
|
|
47
|
+
The test of a skeleton is that it runs. A first task that builds the
|
|
48
|
+
data loader, the schema, or the config layer is a foundation, not a
|
|
49
|
+
skeleton: nothing runs until something above it exists. A skeleton
|
|
50
|
+
reaches the output — thinly, with one real case — through every
|
|
51
|
+
subsystem the spec names.
|
|
52
|
+
|
|
53
|
+
## Task Contracts, Not Task Scripts
|
|
54
|
+
|
|
55
|
+
A task states WHAT must exist when it is done, precisely enough that a
|
|
56
|
+
skilled engineer can build it without asking you anything, without
|
|
57
|
+
prescribing HOW:
|
|
58
|
+
|
|
59
|
+
- **Goal:** one short paragraph naming the deliverable and its role in
|
|
60
|
+
the feature.
|
|
61
|
+
- **Success criteria:** concrete, checkable behaviors — exact commands
|
|
62
|
+
to run and what they must show, the cases tests must cover (including
|
|
63
|
+
failure cases), constraints that bind the implementation.
|
|
64
|
+
- **Notes:** what the engineer needs and cannot discover alone — spec
|
|
65
|
+
sections to read, files worth reading first, known pitfalls.
|
|
66
|
+
|
|
67
|
+
The Interfaces block carries the exact names, signatures, and types;
|
|
68
|
+
the success criteria carry the behaviors; the engineer supplies the
|
|
69
|
+
code and the test design. TDD and frequent commits remain required.
|
|
70
|
+
|
|
71
|
+
## Task Structure
|
|
72
|
+
|
|
73
|
+
````markdown
|
|
74
|
+
### Task N: [Component Name]
|
|
75
|
+
|
|
76
|
+
**Files:**
|
|
77
|
+
- Create: `exact/path/to/file.py`
|
|
78
|
+
- Modify: `exact/path/to/existing.py:123-145`
|
|
79
|
+
- Test: `tests/exact/path/to/test.py`
|
|
80
|
+
|
|
81
|
+
**Interfaces:**
|
|
82
|
+
- Consumes: [what this task uses from earlier tasks — exact signatures]
|
|
83
|
+
- Produces: [what later tasks rely on — exact function names, parameter
|
|
84
|
+
and return types. A task's implementer sees only their own task; this
|
|
85
|
+
block is how they learn the names and types neighboring tasks use.]
|
|
86
|
+
|
|
87
|
+
**Goal:** [one paragraph — the deliverable and its role in the feature]
|
|
88
|
+
|
|
89
|
+
**Success criteria:**
|
|
90
|
+
- Run: `pytest tests/exact/path/to/test.py -v` — all tests pass; tests
|
|
91
|
+
cover [the specific behaviors and failure cases, named concretely]
|
|
92
|
+
- [observable behavior the deliverable must exhibit, with the exact
|
|
93
|
+
command or input/output that demonstrates it]
|
|
94
|
+
- [constraint that binds the implementation, copied from the spec]
|
|
95
|
+
|
|
96
|
+
**Notes:** [spec sections to read; files to read first; known pitfalls]
|
|
97
|
+
|
|
98
|
+
**Tier:** mechanical | judgment. Mechanical = the deliverable is fully
|
|
99
|
+
specified by Files + Interfaces + success criteria above (most tasks in
|
|
100
|
+
a well-specified plan are mechanical); judgment = multi-file
|
|
101
|
+
coordination, debugging, or real design latitude remains. The
|
|
102
|
+
implementer's model follows this field — mark it deliberately.
|
|
103
|
+
|
|
104
|
+
**Commit:** one commit ending the task; message named here.
|
|
105
|
+
````
|
|
106
|
+
|
|
107
|
+
## No Vague Contracts
|
|
108
|
+
|
|
109
|
+
Every contract must be checkable by someone who did not write it. These
|
|
110
|
+
are **plan failures** — never write them:
|
|
111
|
+
- "TBD", "TODO", "implement later", "fill in details"
|
|
112
|
+
- Goals naming activity instead of a deliverable ("improve error handling")
|
|
113
|
+
- Success criteria with no observable check ("works correctly", "handles edge cases")
|
|
114
|
+
- Interfaces blocks omitting a name, signature, or type another task consumes
|
|
115
|
+
- "Similar to Task N" (state this task's own contract in full — the engineer may be reading tasks out of order)
|
|
116
|
+
- References to types, functions, or methods not defined in any task's Interfaces block
|
|
117
|
+
|
|
118
|
+
## Self-Review
|
|
119
|
+
|
|
120
|
+
Run SKILL.md's Self-Review checklist, reading step 2 against "No Vague
|
|
121
|
+
Contracts" above rather than "No Placeholders".
|
|
122
|
+
|
|
123
|
+
## Red Flags
|
|
124
|
+
|
|
125
|
+
| Thought | Reality |
|
|
126
|
+
|---------|---------|
|
|
127
|
+
| "Task 1 is the data loader — that's the foundation" | A foundation is a layer. The skeleton runs real input to real output through every subsystem the spec names, thinly. |
|
|
128
|
+
| "The skeleton can return a hardcoded value for now" | It may be thin, but the path must be real: real input, real wiring, real output. A hardcoded response tests nothing end to end. |
|
|
129
|
+
| "A contract without the code is vague" | Vague is an uncheckable success criterion. Exact names, exact commands, exact expected output — no code. |
|
|
130
|
+
| "I'll write the test code into the task to be safe" | The success criteria name the cases; the implementer designs the tests. Written-out tests are the task-by-task shape. |
|
|
131
|
+
| "Skeleton-first is the better shape, so I'll use it here" | It costs total wall clock. Without more than one subsystem and a reason to want an early running slice, plan task-by-task. |
|
|
@@ -15,11 +15,11 @@
|
|
|
15
15
|
|
|
16
16
|
const fs = require('fs');
|
|
17
17
|
const path = require('path');
|
|
18
|
-
const {
|
|
18
|
+
const { execFileSync } = require('child_process');
|
|
19
19
|
|
|
20
20
|
function extractDotBlocks(markdown) {
|
|
21
21
|
const blocks = [];
|
|
22
|
-
const regex = /```dot\n([\s\S]*?)```/g;
|
|
22
|
+
const regex = /```dot\r?\n([\s\S]*?)```/g;
|
|
23
23
|
let match;
|
|
24
24
|
|
|
25
25
|
while ((match = regex.exec(markdown)) !== null) {
|
|
@@ -69,7 +69,7 @@ ${bodies.join('\n\n')}
|
|
|
69
69
|
|
|
70
70
|
function renderToSvg(dotContent) {
|
|
71
71
|
try {
|
|
72
|
-
return
|
|
72
|
+
return execFileSync('dot', ['-Tsvg'], {
|
|
73
73
|
input: dotContent,
|
|
74
74
|
encoding: 'utf-8',
|
|
75
75
|
maxBuffer: 10 * 1024 * 1024
|
|
@@ -110,11 +110,12 @@ function main() {
|
|
|
110
110
|
// Check if dot is available. Run the binary directly rather than probing
|
|
111
111
|
// with `which`, which is not a command on Windows.
|
|
112
112
|
try {
|
|
113
|
-
|
|
113
|
+
execFileSync('dot', ['-V'], { stdio: 'ignore' });
|
|
114
114
|
} catch {
|
|
115
115
|
console.error('Error: graphviz (dot) not found. Install with:');
|
|
116
|
-
console.error(' brew install graphviz
|
|
117
|
-
console.error(' apt install graphviz
|
|
116
|
+
console.error(' brew install graphviz # macOS');
|
|
117
|
+
console.error(' apt install graphviz # Linux');
|
|
118
|
+
console.error(' winget install Graphviz.Graphviz # Windows');
|
|
118
119
|
process.exit(1);
|
|
119
120
|
}
|
|
120
121
|
|