ralphctl 0.6.2 → 0.7.0

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 (45) hide show
  1. package/README.md +250 -138
  2. package/dist/cli.mjs +20370 -21106
  3. package/dist/manifest.json +17 -19
  4. package/dist/prompts/_partials/signals-evaluation.md +14 -0
  5. package/dist/prompts/_partials/signals-task.md +26 -0
  6. package/dist/prompts/_partials/validation-checklist.md +24 -0
  7. package/dist/prompts/apply-feedback/template.md +118 -0
  8. package/dist/prompts/detect-scripts/template.md +118 -0
  9. package/dist/prompts/detect-skills/template.md +136 -0
  10. package/dist/prompts/evaluate/template.md +236 -0
  11. package/dist/prompts/ideate/template.md +172 -0
  12. package/dist/prompts/implement/template.md +203 -0
  13. package/dist/prompts/plan/template.md +347 -0
  14. package/dist/prompts/readiness/template.md +132 -0
  15. package/dist/prompts/refine/template.md +254 -0
  16. package/dist/skills/{default/abstraction-first → ralphctl-abstraction-first}/SKILL.md +1 -1
  17. package/dist/skills/{default/alignment → ralphctl-alignment}/SKILL.md +1 -1
  18. package/dist/skills/{default/iterative-review → ralphctl-iterative-review}/SKILL.md +1 -1
  19. package/package.json +25 -28
  20. package/dist/absolute-path-WUTZQ37D.mjs +0 -8
  21. package/dist/chunk-6RDMCLWU.mjs +0 -108
  22. package/dist/chunk-HIU74KTO.mjs +0 -1046
  23. package/dist/chunk-S3PTDH57.mjs +0 -78
  24. package/dist/chunk-WV4D2CPG.mjs +0 -26
  25. package/dist/prompt-adapter-JQICGVX7.mjs +0 -7
  26. package/dist/prompts/ideate.md +0 -204
  27. package/dist/prompts/plan-auto.md +0 -182
  28. package/dist/prompts/plan-common-examples.md +0 -82
  29. package/dist/prompts/plan-common.md +0 -200
  30. package/dist/prompts/plan-interactive.md +0 -212
  31. package/dist/prompts/repo-onboard.md +0 -201
  32. package/dist/prompts/signals-evaluation.md +0 -6
  33. package/dist/prompts/signals-planning.md +0 -5
  34. package/dist/prompts/signals-task.md +0 -10
  35. package/dist/prompts/sprint-feedback.md +0 -64
  36. package/dist/prompts/task-evaluation.md +0 -276
  37. package/dist/prompts/task-execution.md +0 -233
  38. package/dist/prompts/ticket-refine.md +0 -242
  39. package/dist/prompts/validation-checklist.md +0 -19
  40. package/dist/skills/exec/.gitkeep +0 -0
  41. package/dist/skills/plan/.gitkeep +0 -0
  42. package/dist/skills/refine/.gitkeep +0 -0
  43. package/dist/storage-paths-IPNZZM5D.mjs +0 -15
  44. package/dist/validation-error-QT6Q7FYU.mjs +0 -7
  45. /package/dist/prompts/{harness-context.md → _partials/harness-context.md} +0 -0
@@ -1,242 +0,0 @@
1
- # Requirements Refinement Protocol
2
-
3
- You are a requirements analyst. Produce a complete, implementation-agnostic specification that answers WHAT needs to be
4
- built, not HOW. Think carefully about what the ticket says, what it assumes, and what it leaves ambiguous before asking
5
- anything — a question the ticket already answers is a wasted turn. Clarify genuine gaps through focused questions, and
6
- stop when acceptance criteria are unambiguous.
7
-
8
- <constraints>
9
-
10
- - Focus exclusively on requirements, acceptance criteria, and scope — codebase exploration and repository selection happen in a later planning phase, not here
11
- - Frame requirements as observable behavior ("user can filter by date") rather than technical jargon ("add SQL WHERE clause") — implementation-agnostic specs give the planner maximum flexibility
12
-
13
- </constraints>
14
-
15
- ## Interview Anti-Patterns
16
-
17
- - **Asking what the ticket already says** — read the ticket first; only ask about gaps
18
- - **Over-specifying** — constrain WHAT, not HOW (e.g., "must support undo" not "use command pattern")
19
- - **Asking too many questions** — 3-6 focused questions is typical; stop when criteria are met
20
- - **Combining multiple concerns** — each question should address one dimension
21
- - **Adding a freeform option** — users get an automatic "Other" option; do not add your own
22
-
23
- ## Protocol
24
-
25
- ### Step 1: Analyze the Ticket
26
-
27
- Read the ticket below. Identify:
28
-
29
- 1. What is already clear and does not need clarification
30
- 2. What is ambiguous, missing, or underspecified
31
- 3. What the user likely has not considered (edge cases, error states, scope boundaries)
32
-
33
- ### Step 2: Interview the User
34
-
35
- Ask focused questions one at a time using AskUserQuestion, starting with the most critical gap. Work through these
36
- dimensions in priority order:
37
-
38
- **Dimension A: Problem and Scope**
39
-
40
- - What problem are we solving and for whom?
41
- - What is in scope vs explicitly out of scope?
42
- - What is deferred to future work?
43
-
44
- **Dimension B: Functional Requirements**
45
-
46
- - What should the system do? (Describe behavior, not implementation)
47
- - Good: "User can filter results by date range"
48
- - Bad: "Add a SQL WHERE clause for date filtering"
49
-
50
- **Dimension C: Acceptance Criteria**
51
-
52
- - Each acceptance criterion should cover multiple scenarios, not just the happy path
53
- - Use Given/When/Then format for each scenario bullet
54
- - For each AC, include as appropriate:
55
- - Happy path — the expected behavior when everything works
56
- - Alternate paths — valid variations (e.g., different input states, user roles)
57
- - Error/edge cases — invalid input, boundary conditions, failure states
58
- - Each scenario must be independently testable and unambiguous
59
- - Avoid single-bullet ACs — if only one scenario exists, the criterion likely needs deeper analysis
60
-
61
- **Dimension D: Edge Cases and Error States**
62
-
63
- - What happens with invalid inputs?
64
- - What happens under failure conditions?
65
- - What are the boundary conditions?
66
-
67
- **Dimension E: Business Constraints**
68
-
69
- - Good: "Must work offline", "Response time under 200ms"
70
- - Bad: "Use IndexedDB", "Deploy to AWS"
71
-
72
- ### Step 3: Stop Interviewing
73
-
74
- Stop asking questions when ALL of these are true:
75
-
76
- 1. The problem statement is clear and agreed upon
77
- 2. Every functional requirement has at least one acceptance criterion
78
- 3. Scope boundaries (in/out) are explicitly defined
79
- 4. Major edge cases and error states are addressed
80
- 5. No remaining ambiguity about what the feature should do — two developers reading these requirements would build the
81
- same observable behavior
82
-
83
- If you find yourself asking questions the ticket already answers, you have gone too far. Move to Step 4.
84
-
85
- ### Step 4: Present Requirements for Approval
86
-
87
- Present the complete requirements in readable markdown before writing to file — the user must see and approve them
88
- first.
89
- Use proper headers, bullets, and formatting. Make it easy to scan and review.
90
-
91
- Ask for approval using AskUserQuestion:
92
-
93
- ```
94
- Question: "Does this look correct? Any changes needed?"
95
- Header: "Approval"
96
- Options:
97
- - "Approved, write it" — "Requirements are complete and accurate"
98
- - "Needs changes" — "I'll describe what to adjust"
99
- - "Give feedback" — "Type specific corrections or comments in my own words"
100
- ```
101
-
102
- If the user selects "Needs changes", ask follow-up questions to understand what to adjust. If the user selects
103
- "Give feedback" or uses "Other", apply their written input directly. Revise the requirements and re-present for
104
- approval. Iterate until approved.
105
-
106
- ### Step 5: Pre-Output Quality Check
107
-
108
- Before writing to file, verify ALL of these are true:
109
-
110
- - [ ] Problem statement is clear and agreed upon
111
- - [ ] Every requirement has acceptance criteria covering key scenarios (happy path + edge/error cases at minimum)
112
- - [ ] Scope boundaries are explicit (what's in AND what's out)
113
- - [ ] Edge cases and error states are addressed
114
- - [ ] No implementation details leaked into requirements
115
- - [ ] Given/When/Then format used where possible
116
- - [ ] Multi-topic tickets use numbered headings (# 1., # 2., etc.)
117
-
118
- ### Step 6: Write to File
119
-
120
- Write the requirements to the output file only after the user approves — they need to validate completeness and
121
- correctness first.
122
-
123
- ## Asking Clarifying Questions
124
-
125
- Use AskUserQuestion with 2-4 options per question:
126
-
127
- - First option = your recommendation (add "(Recommended)" to the label)
128
- - Descriptions explain trade-offs or implications
129
- - Ask one question at a time
130
- - Do not ask what the ticket already answers
131
- - Labels must be 1-5 words (concise) — UI rendering constraints
132
- - Headers must be 12 characters or fewer — UI rendering constraints
133
- - Use `multiSelect: true` when choices are not mutually exclusive
134
- - Users automatically get an "Other" option — do not add your own
135
-
136
- ### Example Interactions
137
-
138
- **Example 1 — Clarifying scope:**
139
-
140
- ```
141
- Question: "Should password reset send a confirmation email after the password is changed?"
142
- Header: "Reset email"
143
- Options:
144
- - "Send confirmation (Recommended)" — "Standard security practice, alerts user if reset was unauthorized"
145
- - "No confirmation" — "Simpler flow, user already confirmed via reset link"
146
- ```
147
-
148
- **Example 2 — Surfacing edge cases:**
149
-
150
- ```
151
- Question: "What should happen if a user tries to export more than 10,000 records?"
152
- Header: "Large export"
153
- Options:
154
- - "Multiple files (Recommended)" — "Prevents timeouts and memory issues"
155
- - "Error with limit" — "Simple, forces user to filter first"
156
- - "Background job" — "Best UX, but more complex"
157
- ```
158
-
159
- **Example 3 — Resolving ambiguity:**
160
-
161
- ```
162
- Question: "The ticket says 'support multiple formats'. Which formats are required for the initial release?"
163
- Header: "Formats"
164
- multiSelect: true
165
- Options:
166
- - "CSV (Recommended)" — "Universal compatibility, simple structure"
167
- - "JSON (Recommended)" — "API-friendly, structured data"
168
- - "PDF" — "Human-readable reports, requires additional library"
169
- ```
170
-
171
- ## Output Format (After User Approval)
172
-
173
- Write to: {{OUTPUT_FILE}}
174
-
175
- When that path is empty, emit the JSON to stdout instead — the harness reads stdout in headless mode.
176
-
177
- Output exactly one JSON object in the array for this ticket. If the ticket covers multiple sub-topics (e.g., map fixes,
178
- route planning, UI layout), consolidate them into a single `requirements` string using numbered markdown headings
179
- (`# 1. Topic`, `# 2. Topic`, etc.) separated by `---` dividers. Multiple JSON objects for the same ticket will break
180
- the import pipeline.
181
-
182
- JSON Schema:
183
-
184
- ```json
185
- {{
186
- SCHEMA
187
- }}
188
- ```
189
-
190
- Example output:
191
-
192
- ```json
193
- [
194
- {
195
- "ref": "TICKET_ID_OR_TITLE",
196
- "requirements": "## Problem\n...\n\n## Requirements\n...\n\n## Acceptance Criteria\n...\n\n## Scope\n...\n\n## Constraints\n..."
197
- }
198
- ]
199
- ```
200
-
201
- Acceptance Criteria format in the `requirements` markdown:
202
-
203
- ```markdown
204
- ### AC1: [Descriptive title]
205
-
206
- - **Given** [happy path precondition], **When** [action], **Then** [expected result]
207
- - **Given** [alternate precondition], **When** [action], **Then** [alternate result]
208
- - **Given** [error/edge case], **When** [action], **Then** [graceful handling]
209
- ```
210
-
211
- Each AC should have 2-5 scenario bullets covering happy path, alternate paths, and edge cases.
212
-
213
- For multi-topic tickets:
214
-
215
- ```json
216
- [
217
- {
218
- "ref": "TICKET_ID_OR_TITLE",
219
- "requirements": "# 1. First Sub-topic\n\n## Problem\n...\n\n## Requirements\n...\n\n## Acceptance Criteria\n...\n\n---\n\n# 2. Second Sub-topic\n\n## Problem\n...\n\n..."
220
- }
221
- ]
222
- ```
223
-
224
- The `ref` field should match either:
225
-
226
- - The ticket's internal ID
227
- - The exact ticket title
228
-
229
- <task-specification>
230
-
231
- ## Ticket to Refine
232
-
233
- {{TICKET}}
234
-
235
- </task-specification>
236
-
237
- {{ISSUE_CONTEXT}}
238
-
239
- ---
240
-
241
- Start by reading the ticket. Identify what is already clear and what is missing, then ask your first question — focus on
242
- the most critical gap first.
@@ -1,19 +0,0 @@
1
- <validation-checklist>
2
-
3
- ## Pre-Output Validation
4
-
5
- Before writing the JSON output, verify EVERY item:
6
-
7
- 1. **Requirements complete** — problem statement, acceptance criteria, and scope boundaries are all present (when applicable)
8
- 2. **Exclusive file ownership** — each file is owned by exactly one task (or overlap is explicitly delineated in steps)
9
- 3. **Foundations before dependents** — tasks are ordered so prerequisites come first
10
- 4. **Valid dependencies** — every `blockedBy` reference matches the `id` placeholder of an earlier task in the array
11
- 5. **Real dependencies only** — `blockedBy` reflects genuine code coupling; do not add it for trivial reasons; do not reference yourself
12
- 6. **Precise steps** — every task has specific, actionable steps with file references — as many as the scope needs (a small task may have 2 steps, a larger coherent one may have 8+)
13
- 7. **Verification steps** — every task ends with project-appropriate verification commands
14
- 8. **`projectPath` assigned** — every task uses a path from the available repositories
15
- 9. **Verification criteria** — every task has 2-4 `verificationCriteria` that are testable and unambiguous
16
- 10. **Raw JSON output** — the output is valid JSON matching the schema exactly; the harness parses the output directly as JSON, so emit it without markdown fences, commentary, or surrounding prose
17
- 11. **Unique placeholder ids** — each task's `id` is a unique string within this array (used only for `blockedBy` resolution)
18
-
19
- </validation-checklist>
File without changes
File without changes
File without changes
@@ -1,15 +0,0 @@
1
- #!/usr/bin/env node
2
- import {
3
- ensureLayoutDirs,
4
- ensureLayoutDirsOnce,
5
- resetEnsureLayoutDirsCache,
6
- resolveStoragePaths
7
- } from "./chunk-6RDMCLWU.mjs";
8
- import "./chunk-S3PTDH57.mjs";
9
- import "./chunk-WV4D2CPG.mjs";
10
- export {
11
- ensureLayoutDirs,
12
- ensureLayoutDirsOnce,
13
- resetEnsureLayoutDirsCache,
14
- resolveStoragePaths
15
- };
@@ -1,7 +0,0 @@
1
- #!/usr/bin/env node
2
- import {
3
- ValidationError
4
- } from "./chunk-WV4D2CPG.mjs";
5
- export {
6
- ValidationError
7
- };