@crouton-kit/crouter 0.2.5 → 0.3.1

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 (79) hide show
  1. package/dist/builtin-skills/skills/crouter-development/marketplaces/SKILL.md +9 -9
  2. package/dist/builtin-skills/skills/crouter-development/plugins/SKILL.md +19 -19
  3. package/dist/cli.js +42 -37
  4. package/dist/commands/__tests__/human.test.d.ts +1 -0
  5. package/dist/commands/__tests__/human.test.js +214 -0
  6. package/dist/commands/__tests__/skill.test.d.ts +1 -0
  7. package/dist/commands/__tests__/skill.test.js +287 -0
  8. package/dist/commands/debug.d.ts +3 -0
  9. package/dist/commands/debug.js +179 -0
  10. package/dist/commands/flow.d.ts +2 -0
  11. package/dist/commands/flow.js +24 -0
  12. package/dist/commands/human.d.ts +2 -0
  13. package/dist/commands/human.js +480 -0
  14. package/dist/commands/job.d.ts +2 -0
  15. package/dist/commands/job.js +669 -0
  16. package/dist/commands/pkg.d.ts +2 -0
  17. package/dist/commands/pkg.js +1021 -0
  18. package/dist/commands/plan.d.ts +4 -2
  19. package/dist/commands/plan.js +306 -22
  20. package/dist/commands/skill.d.ts +2 -2
  21. package/dist/commands/skill.js +615 -459
  22. package/dist/commands/spec.d.ts +3 -2
  23. package/dist/commands/spec.js +283 -10
  24. package/dist/commands/sys.d.ts +2 -0
  25. package/dist/commands/sys.js +712 -0
  26. package/dist/core/__tests__/argv-parser.test.d.ts +1 -0
  27. package/dist/core/__tests__/argv-parser.test.js +199 -0
  28. package/dist/core/__tests__/flow-leaves.test.d.ts +1 -0
  29. package/dist/core/__tests__/flow-leaves.test.js +248 -0
  30. package/dist/core/__tests__/job.test.d.ts +1 -0
  31. package/dist/core/__tests__/job.test.js +346 -0
  32. package/dist/core/__tests__/pkg.test.d.ts +1 -0
  33. package/dist/core/__tests__/pkg.test.js +218 -0
  34. package/dist/core/__tests__/sys.test.d.ts +1 -0
  35. package/dist/core/__tests__/sys.test.js +208 -0
  36. package/dist/core/artifact.d.ts +29 -18
  37. package/dist/core/artifact.js +78 -221
  38. package/dist/core/auto-update.js +11 -3
  39. package/dist/core/command.d.ts +36 -0
  40. package/dist/core/command.js +287 -0
  41. package/dist/core/errors.d.ts +3 -0
  42. package/dist/core/errors.js +5 -0
  43. package/dist/core/fs-utils.d.ts +1 -0
  44. package/dist/core/fs-utils.js +4 -0
  45. package/dist/core/help.d.ts +98 -0
  46. package/dist/core/help.js +163 -0
  47. package/dist/core/io.d.ts +29 -0
  48. package/dist/core/io.js +83 -0
  49. package/dist/core/jobs.d.ts +87 -0
  50. package/dist/core/jobs.js +353 -0
  51. package/dist/core/pagination.d.ts +33 -0
  52. package/dist/core/pagination.js +89 -0
  53. package/dist/core/self-update.d.ts +21 -0
  54. package/dist/{commands/update.js → core/self-update.js} +28 -63
  55. package/dist/core/spawn.d.ts +47 -65
  56. package/dist/core/spawn.js +78 -228
  57. package/dist/prompts/agent.d.ts +10 -5
  58. package/dist/prompts/agent.js +51 -74
  59. package/dist/prompts/debug.d.ts +8 -0
  60. package/dist/prompts/debug.js +37 -0
  61. package/dist/prompts/review.js +4 -11
  62. package/dist/prompts/skill.d.ts +0 -1
  63. package/dist/prompts/skill.js +95 -149
  64. package/package.json +4 -2
  65. package/dist/commands/agent.d.ts +0 -2
  66. package/dist/commands/agent.js +0 -265
  67. package/dist/commands/config.d.ts +0 -2
  68. package/dist/commands/config.js +0 -146
  69. package/dist/commands/doctor.d.ts +0 -2
  70. package/dist/commands/doctor.js +0 -268
  71. package/dist/commands/marketplace.d.ts +0 -2
  72. package/dist/commands/marketplace.js +0 -365
  73. package/dist/commands/plugin.d.ts +0 -2
  74. package/dist/commands/plugin.js +0 -367
  75. package/dist/commands/update.d.ts +0 -4
  76. package/dist/prompts/plan.d.ts +0 -1
  77. package/dist/prompts/plan.js +0 -175
  78. package/dist/prompts/spec.d.ts +0 -1
  79. package/dist/prompts/spec.js +0 -153
@@ -1,153 +0,0 @@
1
- export function specPrompt(specsDir) {
2
- return `# Spec workflow
3
-
4
- You are entering a focused spec session. The goal is to produce a design +
5
- requirements spec — a document describing **what** to build, the shape of the
6
- solution, and the behaviors it must satisfy. A spec is upstream of a plan: it
7
- captures decisions, not implementation steps.
8
-
9
- Specs for this directory live at:
10
- ${specsDir}
11
-
12
- If a relevant prior spec already exists there, read it first. Treat an
13
- existing spec as the starting point — extend or revise rather than restart.
14
-
15
- **Anti-pattern: do not fish for clarifications upfront.** Draft a concrete
16
- spec first based on your investigation, *then* iterate. A specific draft the
17
- user can react to converges faster than a list of questions in a vacuum.
18
-
19
- ## Phase 1: Shape
20
-
21
- Build a comprehensive picture of the problem and the relevant code. Surface
22
- existing patterns, constraints, and prior decisions.
23
-
24
- - **Launch up to 3 Explore subagents IN PARALLEL** (single message, multiple
25
- tool calls) to cover the codebase efficiently.
26
- - Use 1 agent for narrow, well-scoped problems.
27
- - Use multiple agents when the spec touches several subsystems or you need
28
- to compare existing implementations.
29
- - Quality over quantity — 3 agents maximum.
30
-
31
- After exploration, draft a high-level design in your head: the shape of the
32
- solution, the new or changed pieces, the boundaries.
33
-
34
- ## Phase 2: Requirements
35
-
36
- Translate the shape into concrete behavioral requirements. Each requirement
37
- should be:
38
-
39
- - **Testable** — has a clear pass/fail condition.
40
- - **Behavior-focused** — describes what the system does, not how.
41
- - **Scoped** — covers one observable behavior.
42
-
43
- Group requirements by capability. Plain English is fine for most things. If
44
- a requirement is conditional or stateful enough that phrasing gets fuzzy,
45
- EARS templates can sharpen it (\`When <trigger>, the system shall <behavior>\`
46
- or \`If <condition>, then the system shall <response>\`) — reach for them
47
- when they earn their keep, not by default.
48
-
49
- For larger / multi-component designs, before moving on it's worth walking
50
- the design end-to-end as a sanity check: at each step from trigger to
51
- final state, ask whether preconditions, state, failure handling, and
52
- handoffs between components are actually specified. Skip this for small
53
- self-contained specs — it's the kind of thing that catches bugs in the
54
- seams, so apply it where there are seams.
55
-
56
- ## Phase 3: Deepen
57
-
58
- - Read the critical files identified during Phase 1 to deepen your
59
- understanding before locking decisions.
60
- - Reconcile requirements against the shape — if a requirement reveals a gap
61
- in the design, refine the design before saving.
62
- - Use **AskUserQuestion** for any remaining ambiguities. Bias toward asking
63
- when a decision is non-obvious or when the user's intent is genuinely
64
- unclear.
65
-
66
- **Important:** Use AskUserQuestion ONLY to clarify requirements or choose
67
- between approaches. Never use it to ask "is this spec okay?" or "should I
68
- save?" — the save step below is the approval moment.
69
-
70
- ## Phase 4: Save
71
-
72
- Save the spec with \`crtr spec --name <kebab-case-name>\`. Pipe the markdown
73
- body in via stdin (heredoc):
74
-
75
- \`\`\`bash
76
- crtr spec --name <kebab-case-name> <<'EOF'
77
- # Spec: <one-line title>
78
-
79
- ## Context
80
- <the problem this spec addresses, what motivates it, and the intended
81
- outcome. Include relevant constraints — user goals, stakeholders, deadlines.>
82
-
83
- ## Design
84
- <the shape of the solution. Components, data flow, key decisions and why
85
- they were chosen. Reference existing code with \`file_path:line_number\`.>
86
-
87
- ## Requirements
88
- <grouped behavioral requirements. Each one testable. Plain English is fine.>
89
-
90
- ### <Capability A>
91
- - <one observable behavior>
92
- - ...
93
-
94
- ### <Capability B>
95
- - ...
96
-
97
- ## Out of scope
98
- <things explicitly NOT covered, so the next reader knows where the edges
99
- are.>
100
-
101
- ## Open questions
102
- <anything you could not resolve. Empty if all decisions are pinned.>
103
- EOF
104
- \`\`\`
105
-
106
- - Pick a short, descriptive kebab-case name. Names may be nested
107
- (\`crtr spec --name auth/refresh-tokens\`).
108
- - The file lands at \`${specsDir}/<name>.md\`.
109
- - If you are running inside tmux, the saved spec auto-opens in a side pane
110
- (or a new window when the current one is full) via termrender. The pane
111
- is **live** — it re-renders whenever the file changes on disk. For small
112
- tweaks, **edit the file path directly with the Edit tool** instead of
113
- re-running the heredoc save; the pane updates in place. Re-save via
114
- heredoc only when you want to re-trigger the reviewer.
115
-
116
- ## Phase 5: Review
117
-
118
- By default the save command **blocks** while a reviewer agent reads the spec
119
- in a side pane (10-min budget) and returns its findings on stdout under a
120
- \`--- review ---\` marker. **Read the review** when the command returns:
121
-
122
- - If \`Status: Approved\`, you are done.
123
- - If \`Status: Issues Found\`, address the listed issues by editing the spec
124
- (\`crtr spec edit <name>\` or rewriting via the save command), then save
125
- again to re-trigger review.
126
-
127
- Pass \`--no-review\` only when the spec is genuinely trivial (a paragraph, one
128
- behavior, no design decisions). For anything substantive, take the review.
129
-
130
- ## Phase 6: Done
131
-
132
- After the review returns Approved (or you have addressed its issues), your
133
- turn ends. No need to summarize the spec in chat — the user can read the file.
134
-
135
- If the user is ready to move into planning, ask once whether they want to
136
- hand off now. If yes, run:
137
-
138
- \`\`\`bash
139
- crtr agent plan --spec <name>
140
- \`\`\`
141
-
142
- This fires up a planner in a new tmux pane and closes the current pane a
143
- few seconds later. Do NOT run this without the user's go-ahead — the kill
144
- is irreversible for this session.
145
-
146
- ## See also
147
-
148
- - \`crtr spec list\` — list saved specs for the current directory
149
- - \`crtr spec show <name>\` — print the body of a saved spec
150
- - \`crtr spec edit <name>\` — open a saved spec in \$EDITOR
151
- - \`crtr spec path [name]\` — absolute path of a spec or the specs directory
152
- `;
153
- }