@crouton-kit/crouter 0.1.8 → 0.2.2
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/dist/builtin-skills/.crouter-plugin/plugin.json +5 -0
- package/dist/builtin-skills/skills/crouter-development/marketplaces/SKILL.md +157 -0
- package/dist/builtin-skills/skills/crouter-development/plugins/SKILL.md +156 -0
- package/dist/builtin-skills/skills/crouter-development/skills/SKILL.md +166 -0
- package/dist/commands/doctor.js +54 -2
- package/dist/commands/plugin.js +4 -1
- package/dist/commands/skill.js +78 -7
- package/dist/core/artifact.js +14 -3
- package/dist/core/frontmatter.d.ts +1 -1
- package/dist/core/frontmatter.js +5 -0
- package/dist/core/resolver.d.ts +6 -2
- package/dist/core/resolver.js +208 -20
- package/dist/core/scope.d.ts +1 -0
- package/dist/core/scope.js +13 -2
- package/dist/prompts/agent.js +87 -27
- package/dist/prompts/plan.js +34 -1
- package/dist/prompts/review.js +48 -28
- package/dist/prompts/skill.js +291 -27
- package/dist/prompts/spec.js +24 -9
- package/dist/types.d.ts +6 -1
- package/dist/types.js +4 -0
- package/package.json +2 -2
package/dist/prompts/agent.js
CHANGED
|
@@ -25,37 +25,97 @@ The originating pane has closed; the user is watching you here. Begin now.`;
|
|
|
25
25
|
* First user message for a plan → implementation handoff.
|
|
26
26
|
*/
|
|
27
27
|
export function implementHandoffPrompt(planPath) {
|
|
28
|
-
return `You are an
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
return `You are executing an approved plan. For small plans, implement directly.
|
|
29
|
+
For plans with parallelizable scale, orchestrate parallel subagents and
|
|
30
|
+
coordinate them — don't write all the code yourself when the plan is
|
|
31
|
+
structured to fan out.
|
|
31
32
|
|
|
32
33
|
**Plan to implement:** ${planPath}
|
|
33
34
|
|
|
34
|
-
##
|
|
35
|
-
|
|
36
|
-
1. Read the plan end-to-end
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
35
|
+
## Phase 1: Read
|
|
36
|
+
|
|
37
|
+
1. Read the plan end-to-end. If it references a spec (\`--spec\` was passed
|
|
38
|
+
at save time), read that too — it's the contract you are realizing.
|
|
39
|
+
2. Read the files the plan names under "Files to modify / create" (or the
|
|
40
|
+
per-task \`Files:\` lines) and "Existing utilities to reuse" to ground
|
|
41
|
+
yourself in current code.
|
|
42
|
+
3. If the plan has task blocks with dependencies, extract the task list,
|
|
43
|
+
dependency graph, and integration contracts.
|
|
44
|
+
|
|
45
|
+
## Phase 2: Scale
|
|
46
|
+
|
|
47
|
+
Count the plan's **independent task groups** (tasks with no mutual
|
|
48
|
+
dependencies that can run in parallel). Pick the strategy:
|
|
49
|
+
|
|
50
|
+
| Independent groups | Files touched | Strategy |
|
|
51
|
+
|-------------------|---------------|----------|
|
|
52
|
+
| 1 | 1–3 | **Implement directly.** Skip Phases 3–5; just execute the plan and go to Phase 6. |
|
|
53
|
+
| 1–2 | 3–5 | Implement directly, or single subagent if you want parallelism with verification |
|
|
54
|
+
| 2–4 | 5–15 | **2 parallel subagents** |
|
|
55
|
+
| 4–8 | 10–30 | **3 parallel subagents** |
|
|
56
|
+
| 8+ | 25+ | **4 parallel subagents** (cap) |
|
|
57
|
+
|
|
58
|
+
Use the higher column to pick the tier. Never spawn more subagents than
|
|
59
|
+
there are independent groups. **Bump one tier** if: tight cross-group
|
|
60
|
+
interface coordination, mixed languages/frameworks, or both infra +
|
|
61
|
+
application layers change.
|
|
62
|
+
|
|
63
|
+
## Phase 3: Partition
|
|
64
|
+
|
|
65
|
+
Group tasks into **disjoint sets** where:
|
|
66
|
+
|
|
67
|
+
- Each group owns clear file boundaries — **no two groups edit the same files**.
|
|
68
|
+
- Within a group, tasks are sequenced for one subagent to execute in order.
|
|
69
|
+
- Across groups, dependencies become layers: dependent groups run *after*
|
|
70
|
+
their predecessors complete.
|
|
71
|
+
|
|
72
|
+
If two tasks must touch the same file, sequence them in the same group.
|
|
73
|
+
|
|
74
|
+
## Phase 4: Dispatch
|
|
56
75
|
|
|
57
|
-
|
|
58
|
-
|
|
76
|
+
For each task group in the current dependency layer, dispatch a subagent
|
|
77
|
+
in parallel via the Task tool. Use \`general-purpose\` by default; use
|
|
78
|
+
\`devcore:programmer\` if the project has devcore installed.
|
|
79
|
+
|
|
80
|
+
**Each subagent's prompt must include:**
|
|
81
|
+
- The specific tasks from the plan it owns (paste verbatim)
|
|
82
|
+
- The plan path: \`${planPath}\`
|
|
83
|
+
- The spec path if one exists
|
|
84
|
+
- The exact file ownership for this group
|
|
85
|
+
- Integration contracts it produces or consumes (types, APIs, shapes)
|
|
86
|
+
- **Constraint: do NOT run tests or typechecks** — other subagents may be
|
|
87
|
+
mid-edit. The orchestrator runs verification at layer boundaries.
|
|
88
|
+
- Instruction to return when its tasks are complete, surfacing blockers
|
|
89
|
+
|
|
90
|
+
## Phase 5: Coordinate
|
|
91
|
+
|
|
92
|
+
Wait for all subagents in the current layer. Then:
|
|
93
|
+
|
|
94
|
+
- If any reports a blocker, resolve it: fix yourself, adjust scope with
|
|
95
|
+
the user, or re-dispatch a corrected task. Don't proceed past the blocker.
|
|
96
|
+
- Run the plan's verification for the just-finished layer (tests, manual
|
|
97
|
+
checks). Fix any failures before dispatching the next layer.
|
|
98
|
+
- Dispatch the next layer.
|
|
99
|
+
|
|
100
|
+
**Stay in the coordinator role.** Don't implement tasks yourself unless a
|
|
101
|
+
subagent returns blocked work and the fix is small enough that re-dispatch
|
|
102
|
+
would be slower.
|
|
103
|
+
|
|
104
|
+
## Phase 6: Report
|
|
105
|
+
|
|
106
|
+
When all tasks complete and verification passes, write one short message:
|
|
107
|
+
files touched per group, tests run, what works. The user may then ask for
|
|
108
|
+
a code review via \`crtr agent review\`.
|
|
109
|
+
|
|
110
|
+
## Guardrails (apply to you AND your subagents)
|
|
111
|
+
|
|
112
|
+
- **No redesign.** If the plan is wrong, surface the issue — do not
|
|
113
|
+
silently substitute your own approach.
|
|
114
|
+
- **No scope expansion.** No drive-by refactors, no "while I'm here"
|
|
115
|
+
cleanup, no new abstractions the plan didn't request.
|
|
116
|
+
- **Honor conventions.** Match each file's existing style, naming, and
|
|
117
|
+
patterns. Use the utilities the plan named.
|
|
118
|
+
- **Commit only if the user asks.**
|
|
59
119
|
|
|
60
120
|
You were launched in a new tmux pane via \`crtr agent implement\`. The
|
|
61
121
|
originating pane has closed; the user is watching you here. Begin by reading
|
package/dist/prompts/plan.js
CHANGED
|
@@ -58,6 +58,19 @@ between approaches. Never use it to ask the user "is this plan okay?" or
|
|
|
58
58
|
|
|
59
59
|
## Phase 4: Final Plan
|
|
60
60
|
|
|
61
|
+
### Quality bar
|
|
62
|
+
|
|
63
|
+
Hold the draft to these — they're cheap to satisfy and they save the
|
|
64
|
+
implementer from re-deciding things:
|
|
65
|
+
|
|
66
|
+
- Every decision pinned. No "if X then Y" branches, no "investigate
|
|
67
|
+
whether…", no deferred choices. If you don't know, find out or ask now.
|
|
68
|
+
- No timelines, no fallbacks, no magic values, no "for now" shortcuts.
|
|
69
|
+
- Where the plan creates a new interface, schema, or contract, write the
|
|
70
|
+
actual shape rather than "design a Foo type."
|
|
71
|
+
|
|
72
|
+
### Save
|
|
73
|
+
|
|
61
74
|
Save the plan with \`crtr plan --name <kebab-case-name>\`. Pipe the markdown
|
|
62
75
|
body in via stdin (heredoc):
|
|
63
76
|
|
|
@@ -85,6 +98,22 @@ Be concise enough to scan, detailed enough to execute.>
|
|
|
85
98
|
EOF
|
|
86
99
|
\`\`\`
|
|
87
100
|
|
|
101
|
+
For plans touching 4+ files across distinct concerns, the implementer can
|
|
102
|
+
dispatch parallel subagents — but only if you structure tasks for it. In
|
|
103
|
+
that case, replace "Files to modify / create" with task blocks like:
|
|
104
|
+
|
|
105
|
+
\`\`\`
|
|
106
|
+
## Tasks
|
|
107
|
+
- **Task 1**: <name>
|
|
108
|
+
- Files: \`a.ts\`, \`b.ts\` (disjoint from other tasks)
|
|
109
|
+
- Depends on: (none) | Task N
|
|
110
|
+
- Integration: <shared types/APIs with exact shape>
|
|
111
|
+
- Changes: <bullets>
|
|
112
|
+
\`\`\`
|
|
113
|
+
|
|
114
|
+
Skip this structure for small plans; it's noise when there's no
|
|
115
|
+
parallelism to unlock.
|
|
116
|
+
|
|
88
117
|
- Pick a short, descriptive kebab-case name. Names may be nested
|
|
89
118
|
(\`crtr plan --name auth/jwt-refresh\`) — they become subdirectories.
|
|
90
119
|
- If this plan implements a saved spec, pass \`--spec <spec-name>\` so the
|
|
@@ -92,7 +121,11 @@ EOF
|
|
|
92
121
|
\`crtr plan --name <name> --spec <spec-name> <<'EOF' ... EOF\`
|
|
93
122
|
- The file lands at \`${plansDir}/<name>.md\`.
|
|
94
123
|
- If you are running inside tmux, the saved plan auto-opens in a side pane
|
|
95
|
-
via termrender.
|
|
124
|
+
(or a new window when the current one is full) via termrender. The pane
|
|
125
|
+
is **live** — it re-renders whenever the file changes on disk. For small
|
|
126
|
+
tweaks, **edit the file path directly with the Edit tool** instead of
|
|
127
|
+
re-running the heredoc save; the pane updates in place. Re-save via
|
|
128
|
+
heredoc only when you want to re-trigger the reviewer.
|
|
96
129
|
|
|
97
130
|
## Phase 5: Review
|
|
98
131
|
|
package/dist/prompts/review.js
CHANGED
|
@@ -16,40 +16,53 @@ summarize or chat after submission — \`crtr agent submit\` IS the response.
|
|
|
16
16
|
If you cannot complete the review (file missing, totally malformed, etc.),
|
|
17
17
|
still call \`crtr agent submit\` with a brief explanation of why.`;
|
|
18
18
|
export function specReviewPrompt(specPath) {
|
|
19
|
-
return `You are reviewing a spec document. Verify it is complete and ready for
|
|
19
|
+
return `You are reviewing a spec document. Verify it is complete and ready for
|
|
20
|
+
planning.
|
|
20
21
|
|
|
21
22
|
**Spec to review:** ${specPath}
|
|
22
23
|
|
|
23
|
-
|
|
24
|
+
Read the spec end-to-end first.
|
|
24
25
|
|
|
25
|
-
|
|
26
|
+
## What to check
|
|
27
|
+
|
|
28
|
+
| Category | What to look for |
|
|
26
29
|
|----------|------------------|
|
|
27
30
|
| Completeness | TODOs, placeholders, "TBD", incomplete sections |
|
|
28
31
|
| Consistency | Internal contradictions, conflicting requirements |
|
|
29
32
|
| Clarity | Requirements ambiguous enough to cause someone to build the wrong thing |
|
|
30
|
-
| Scope | Focused enough for a single plan
|
|
33
|
+
| Scope | Focused enough for a single plan |
|
|
31
34
|
| YAGNI | Unrequested features, over-engineering |
|
|
32
35
|
|
|
33
|
-
|
|
36
|
+
For specs with non-trivial component interaction, also walk the primary
|
|
37
|
+
flow from trigger to final state and check whether preconditions, state
|
|
38
|
+
transitions, failure handling, and handoffs between components are
|
|
39
|
+
actually specified. This is the highest-signal check when there are
|
|
40
|
+
seams to fall between — skip it for self-contained specs.
|
|
34
41
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
42
|
+
For larger specs touching established patterns, optionally spawn a Task
|
|
43
|
+
agent (\`general-purpose\`, \`sonnet\`) to cross-check the spec's design
|
|
44
|
+
against \`CLAUDE.md\` / \`.claude/rules/*.md\` and the files it references,
|
|
45
|
+
looking for contradictions with project conventions. Skip for small specs.
|
|
46
|
+
|
|
47
|
+
## Calibration
|
|
39
48
|
|
|
40
|
-
Approve unless
|
|
49
|
+
Approve unless an implementer or planner would be led astray. Real issues:
|
|
50
|
+
missing requirements, contradictory design, unspecified failure modes on
|
|
51
|
+
critical paths, requirements ambiguous enough to be built two ways. Not
|
|
52
|
+
issues: wording preferences, "I'd have organized this differently",
|
|
53
|
+
sections less detailed than others.
|
|
41
54
|
|
|
42
|
-
## Output
|
|
55
|
+
## Output
|
|
43
56
|
|
|
44
57
|
## Spec Review
|
|
45
58
|
|
|
46
59
|
**Status:** Approved | Issues Found
|
|
47
60
|
|
|
48
61
|
**Issues (if any):**
|
|
49
|
-
- [Section
|
|
62
|
+
- [Section]: [specific issue] — [why it matters for planning]
|
|
50
63
|
|
|
51
64
|
**Recommendations (advisory, do not block approval):**
|
|
52
|
-
- [suggestions
|
|
65
|
+
- [suggestions]
|
|
53
66
|
|
|
54
67
|
${SUBMIT_INSTRUCTIONS}`;
|
|
55
68
|
}
|
|
@@ -65,39 +78,46 @@ merits (internal completeness, task decomposition, buildability). Skip the
|
|
|
65
78
|
|
|
66
79
|
Read the plan first, then the spec, then evaluate alignment and the other
|
|
67
80
|
criteria below.`;
|
|
68
|
-
return `You are reviewing a plan document. Verify it is complete and ready for
|
|
81
|
+
return `You are reviewing a plan document. Verify it is complete and ready for
|
|
82
|
+
implementation.
|
|
69
83
|
|
|
70
84
|
${inputs}
|
|
71
85
|
|
|
72
|
-
## What to
|
|
86
|
+
## What to check
|
|
73
87
|
|
|
74
|
-
| Category | What to
|
|
88
|
+
| Category | What to look for |
|
|
75
89
|
|----------|------------------|
|
|
76
90
|
| Completeness | TODOs, placeholders, incomplete tasks, missing steps |
|
|
77
|
-
| Spec
|
|
78
|
-
|
|
|
79
|
-
|
|
|
91
|
+
${specPath === null ? '' : '| Spec alignment | Plan covers spec requirements, no major scope creep, no unjustified divergence from the spec\'s design |\n'}| Resolved decisions | No "if X then Y" branches, no "investigate whether…", no deferred choices |
|
|
92
|
+
| Buildability | Could an engineer follow this without getting stuck or re-deciding things? |
|
|
93
|
+
| Quality smells | Timelines, "for now" shortcuts, magic values, fallbacks, missing type definitions where the plan creates a new contract |
|
|
80
94
|
|
|
81
|
-
|
|
95
|
+
For medium+ plans that claim parallelizable tasks, also check that tasks
|
|
96
|
+
own disjoint files (or call out unavoidable overlap) and that shared
|
|
97
|
+
types/APIs between tasks have their contracts specified.
|
|
98
|
+
|
|
99
|
+
For large plans${specPath === null ? '' : ', or when spec coverage feels uncertain'}, you may
|
|
100
|
+
optionally spawn one Task agent (\`general-purpose\`, \`sonnet\`) to
|
|
101
|
+
cross-check ${specPath === null ? 'coverage of the plan\'s own stated phases against its task list' : `spec requirements at \`${specPath}\` against plan tasks`}.
|
|
102
|
+
Skip for small plans.
|
|
82
103
|
|
|
83
|
-
|
|
84
|
-
An implementer building the wrong thing or getting stuck is an issue.
|
|
85
|
-
Minor wording, stylistic preferences, and "nice to have" suggestions are not.
|
|
104
|
+
## Calibration
|
|
86
105
|
|
|
87
|
-
Approve unless
|
|
88
|
-
|
|
106
|
+
Approve unless an implementer would build the wrong thing, get stuck, or
|
|
107
|
+
ship something that violates the plan's quality bar. Minor wording,
|
|
108
|
+
stylistic preferences, and "nice to have" reorganizations are NOT issues.
|
|
89
109
|
|
|
90
|
-
## Output
|
|
110
|
+
## Output
|
|
91
111
|
|
|
92
112
|
## Plan Review
|
|
93
113
|
|
|
94
114
|
**Status:** Approved | Issues Found
|
|
95
115
|
|
|
96
116
|
**Issues (if any):**
|
|
97
|
-
- [Task
|
|
117
|
+
- [Task / Section]: [specific issue] — [why it matters for implementation]
|
|
98
118
|
|
|
99
119
|
**Recommendations (advisory, do not block approval):**
|
|
100
|
-
- [suggestions
|
|
120
|
+
- [suggestions]
|
|
101
121
|
|
|
102
122
|
${SUBMIT_INSTRUCTIONS}`;
|
|
103
123
|
}
|