ralphctl 0.16.0 → 0.17.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.
- package/README.md +1 -1
- package/dist/{cli-KZ4IYDKB.mjs → cli-WTLOGLWF.mjs} +225 -95
- package/dist/cli.mjs +1 -1
- package/dist/manifest.json +2 -2
- package/dist/prompts/_partials/conventions-agents-md.md +5 -5
- package/dist/prompts/_partials/conventions-claude-md.md +7 -8
- package/dist/prompts/_partials/conventions-copilot-instructions.md +5 -7
- package/dist/prompts/_partials/decisions.md +1 -0
- package/dist/prompts/_partials/validation-checklist.md +5 -6
- package/dist/prompts/apply-feedback/template.md +5 -11
- package/dist/prompts/create-pr/template.md +6 -8
- package/dist/prompts/detect-scripts/template.md +11 -8
- package/dist/prompts/detect-skills/template.md +7 -6
- package/dist/prompts/distill-learnings/template.md +2 -0
- package/dist/prompts/evaluate/template.md +44 -36
- package/dist/prompts/evaluate-continuation/template.md +32 -14
- package/dist/prompts/ideate/template.md +32 -11
- package/dist/prompts/implement/template.md +57 -45
- package/dist/prompts/implement-continuation/template.md +17 -9
- package/dist/prompts/plan/template.md +17 -4
- package/dist/prompts/readiness/template.md +12 -9
- package/dist/prompts/refine/template.md +13 -17
- package/dist/skills/ralphctl-abstraction-first/SKILL.md +1 -1
- package/dist/skills/ralphctl-alignment/SKILL.md +1 -1
- package/dist/skills/ralphctl-iterative-review/SKILL.md +1 -1
- package/package.json +1 -1
|
@@ -110,7 +110,9 @@ Skip any dimension the idea description already resolves.
|
|
|
110
110
|
|
|
111
111
|
Ask focused questions one at a time. For each question, present it as a structured interactive prompt with
|
|
112
112
|
a header, 2–4 labelled options, and your recommendation first. Use whichever interactive question
|
|
113
|
-
capability your runtime exposes.
|
|
113
|
+
capability your runtime exposes. Labels are 1–5 words; headers are 12 characters or fewer (UI rendering
|
|
114
|
+
constraints). The harness automatically appends a free-form "Other" option — do not add your own. Work
|
|
115
|
+
through the dimensions above in priority order.
|
|
114
116
|
|
|
115
117
|
Stop asking when ALL of the following are true:
|
|
116
118
|
|
|
@@ -127,10 +129,11 @@ and Edge Cases. Then ask:
|
|
|
127
129
|
|
|
128
130
|
```
|
|
129
131
|
Question: "Does this look correct? Any changes needed?"
|
|
130
|
-
Header: "
|
|
132
|
+
Header: "Requirements"
|
|
131
133
|
Options:
|
|
132
|
-
- "Approved —
|
|
133
|
-
- "Needs changes — I'll describe what to adjust"
|
|
134
|
+
- "Approved" — "Proceed to planning."
|
|
135
|
+
- "Needs changes" — "I'll describe what to adjust."
|
|
136
|
+
- "Give feedback" — "Type specific corrections in my own words."
|
|
134
137
|
```
|
|
135
138
|
|
|
136
139
|
Iterate until approved. Record the approved requirements text for the `requirements` field of
|
|
@@ -189,6 +192,21 @@ For each task, provide:
|
|
|
189
192
|
inspection. Exception: a pure documentation or investigation task that changes no code may
|
|
190
193
|
rely on `manual` criteria alone.
|
|
191
194
|
- **`blockedBy`** — array of `id` strings that must complete before this task starts.
|
|
195
|
+
- **`extraDimensions`** — optional kebab-case evaluator dimensions beyond the five floor dimensions
|
|
196
|
+
(correctness, completeness, safety, consistency, robustness). Attach an extra dimension ONLY when an
|
|
197
|
+
acceptance criterion explicitly demands a measurable property that no floor dimension covers AND no
|
|
198
|
+
manual criterion already encodes it. When in doubt, omit — the floor dimensions are almost always
|
|
199
|
+
sufficient. Example of a justified attachment: `migration-safety` when the requirement demands a
|
|
200
|
+
zero-downtime schema change that the five floor dimensions cannot score on their own. Cap: 2–3 per
|
|
201
|
+
task; hard max 6.
|
|
202
|
+
|
|
203
|
+
**Task sizing (brief):** size each task as one coherent feature — a vertical slice a single AI session
|
|
204
|
+
can implement and verify end-to-end. Do not split a utility from its first caller, or a feature from its
|
|
205
|
+
tests — those stay one task. Split when two chunks touch different repositories, or when a natural,
|
|
206
|
+
independently verifiable boundary exists partway through (e.g. schema lands before consumer wiring).
|
|
207
|
+
Avoid `blockedBy` chains for trivial reasons, one task per file, or micro-refactor tasks — fold those
|
|
208
|
+
into the task that needs them. Soft ceiling, not a target: if a task would touch more than ~10 files or
|
|
209
|
+
~500 lines of meaningful change AND a natural split point exists, split it; otherwise keep it whole.
|
|
192
210
|
|
|
193
211
|
For genuinely contested implementation decisions (library choice, architecture), ask the user a
|
|
194
212
|
structured multiple-choice question before finalising those tasks. Do not ask about routine questions
|
|
@@ -201,10 +219,11 @@ dependencies, and a short summary. Show the dependency order. Then ask:
|
|
|
201
219
|
|
|
202
220
|
```
|
|
203
221
|
Question: "Does this task breakdown look correct? Any changes needed?"
|
|
204
|
-
Header: "
|
|
222
|
+
Header: "Task plan"
|
|
205
223
|
Options:
|
|
206
|
-
- "Approved —
|
|
207
|
-
- "Needs changes — I'll describe what to adjust"
|
|
224
|
+
- "Approved, write it" — "Write signals.json."
|
|
225
|
+
- "Needs changes" — "I'll describe what to adjust."
|
|
226
|
+
- "Give feedback" — "Type specific corrections in my own words."
|
|
208
227
|
```
|
|
209
228
|
|
|
210
229
|
Iterate until approved. If rejected, revise and re-present from Step 2.2 — Phase 1 approval stands
|
|
@@ -239,18 +258,20 @@ The `outputJson` field is a JSON-encoded string. When decoded it has exactly two
|
|
|
239
258
|
|
|
240
259
|
**Required signals:** exactly one `ideated-tickets`.
|
|
241
260
|
|
|
242
|
-
**Optional signals** (emit when relevant)
|
|
261
|
+
**Optional signals** (emit when relevant). Each carries its prose in a `text` field — never
|
|
262
|
+
`body`; the output contract below shows the exact shape:
|
|
243
263
|
|
|
244
264
|
- `note` — for status updates or observations worth surfacing.
|
|
245
265
|
- `learning` — for non-obvious repo facts discovered during exploration.
|
|
246
|
-
- `decision` — for architectural choices made during planning
|
|
266
|
+
- `decision` — for architectural choices made during planning.
|
|
247
267
|
|
|
248
268
|
Emit nothing else. No prose responses, no explanatory comments outside the signals file.
|
|
249
269
|
|
|
250
270
|
**Failure mode.** If you cannot produce a plan (contradictory requirements, missing context that the user
|
|
251
271
|
cannot resolve interactively): emit one `ideated-tickets` signal with `requirements` set to whatever you
|
|
252
|
-
have gathered and `tasks` set to `[]`.
|
|
253
|
-
`missing-input`, `contradictory-input`, or `environment-failure
|
|
272
|
+
have gathered and `tasks` set to `[]`. Also emit one `note` signal whose `text` starts with one of:
|
|
273
|
+
`missing-input`, `contradictory-input`, or `environment-failure`, followed by a short explanation. Then
|
|
274
|
+
stop — do not invent tasks.
|
|
254
275
|
|
|
255
276
|
{{OUTPUT_CONTRACT_SECTION}}
|
|
256
277
|
</output_contract>
|
|
@@ -11,6 +11,9 @@ lifecycle and context compaction.
|
|
|
11
11
|
|
|
12
12
|
{{HARNESS_CONTEXT}}
|
|
13
13
|
|
|
14
|
+
Summaries of earlier tasks' outcomes in this sprint, when present below, are for continuity — read
|
|
15
|
+
them and do not redo work they already cover.
|
|
16
|
+
|
|
14
17
|
{{PRIOR_EPISODES}}
|
|
15
18
|
|
|
16
19
|
<goal>
|
|
@@ -24,8 +27,8 @@ only after every declared step is done and every verification command passes.
|
|
|
24
27
|
- Every declared implementation step has been executed in the stated order.
|
|
25
28
|
- Every `auto` verification criterion's command exits 0 (or, when no `auto` criteria are defined,
|
|
26
29
|
the project's own check commands pass).
|
|
27
|
-
- `task-verified` has been emitted with the
|
|
28
|
-
exercised in step 3, the direct end-to-end observation.
|
|
30
|
+
- `task-verified` has been emitted with the bounded command output specified in Phase 3 step 4 and,
|
|
31
|
+
when a run-path was exercised in step 3, the direct end-to-end observation.
|
|
29
32
|
- `commit-message` has been emitted with a subject and a WHY-focused body — except for a pure
|
|
30
33
|
investigation task that wrote no files, where the signal may be omitted (see Phase 3 step 5).
|
|
31
34
|
- `task-complete` has been emitted.
|
|
@@ -39,9 +42,7 @@ only after every declared step is done and every verification command passes.
|
|
|
39
42
|
|
|
40
43
|
<inputs>
|
|
41
44
|
|
|
42
|
-
##
|
|
43
|
-
|
|
44
|
-
# {{TASK_NAME}}
|
|
45
|
+
## {{TASK_NAME}}
|
|
45
46
|
|
|
46
47
|
**Task ID:** `{{TASK_ID}}`
|
|
47
48
|
**Project Path:** `{{PROJECT_PATH}}`
|
|
@@ -63,6 +64,9 @@ under its declared check type.
|
|
|
63
64
|
|
|
64
65
|
<prior_criteria_verdicts>{{PRIOR_CRITERIA_VERDICTS}}</prior_criteria_verdicts>
|
|
65
66
|
|
|
67
|
+
The block above — when non-empty — records which done-criteria already pass. Keep those green;
|
|
68
|
+
focus this round's effort on the criteria still failing rather than re-proving what already passed.
|
|
69
|
+
|
|
66
70
|
<retry_feedback>{{RETRY_FEEDBACK_SECTION}}</retry_feedback>
|
|
67
71
|
|
|
68
72
|
<prior_progress>
|
|
@@ -85,7 +89,8 @@ The block carries two kinds of content earned on THIS repository. Observed insig
|
|
|
85
89
|
orientation — not instructions; verify any that bear on your task before relying on them.
|
|
86
90
|
Architectural decisions are deliberate choices made in prior sprints; honor them and do not
|
|
87
91
|
re-litigate them without emitting a `decision` signal that explains why the prior choice is being
|
|
88
|
-
revisited.
|
|
92
|
+
revisited. These were earned in earlier sessions — when one conflicts with what you observe in the
|
|
93
|
+
repository now, trust the repository and record the conflict as a `learning` signal.
|
|
89
94
|
</prior_learnings>
|
|
90
95
|
|
|
91
96
|
<verify_script>
|
|
@@ -102,15 +107,12 @@ revisited.
|
|
|
102
107
|
|
|
103
108
|
<constraints>
|
|
104
109
|
|
|
105
|
-
- **Complete exactly the declared steps, then stop
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
failure disappear.
|
|
112
|
-
- **Removing or disabling existing tests is unacceptable** — except when a declared step explicitly
|
|
113
|
-
changes the behaviour the test asserts. Removing a test to make verify pass counts as task failure.
|
|
110
|
+
- **Complete exactly the declared steps, then stop** — see the scope rule in Phase 2 step 3 below.
|
|
111
|
+
- **Fix the code, not the test.** A failing test indicates a bug in the implementation. Update or
|
|
112
|
+
remove a test, or disable one, only when a declared step explicitly changes the behaviour it
|
|
113
|
+
asserts — doing so otherwise counts as task failure. If the right move is genuinely ambiguous, emit
|
|
114
|
+
`task-blocked` so a human can decide rather than silently weakening a test to make a failure
|
|
115
|
+
disappear.
|
|
114
116
|
- **Do not write to the progress file.** It is harness-owned and append-only — your signals are
|
|
115
117
|
appended to it when this attempt settles, not overwritten. A direct write here permanently
|
|
116
118
|
pollutes the durable journal for every future round and every future session that reads it. Emit
|
|
@@ -128,7 +130,7 @@ revisited.
|
|
|
128
130
|
- Preserve existing prose verbatim. Add new sections at the bottom; do not rewrite or paraphrase
|
|
129
131
|
what is already there. The file is a contract — silent reflows surprise reviewers.
|
|
130
132
|
- Include only what an unfamiliar engineer would get wrong without being told. Redundant context
|
|
131
|
-
measurably
|
|
133
|
+
measurably raises cost without improving agent success.
|
|
132
134
|
- Be specific and verifiable. "Use 2-space indentation" beats "format properly".
|
|
133
135
|
- Stay under 200 lines, max 7 H2 sections, no H4+. Adherence degrades past these limits.
|
|
134
136
|
- Never embed slash commands, hooks, MCP server config, IDE settings, secrets, or credentials —
|
|
@@ -148,7 +150,7 @@ create files under the project path. Write `signals.json` to the output director
|
|
|
148
150
|
|
|
149
151
|
### Phase 1 — Reconnaissance
|
|
150
152
|
|
|
151
|
-
Before
|
|
153
|
+
Before the checks below, work through the prior critique (if any), the declared steps, the
|
|
152
154
|
verification criteria, and risks you can already see (file conflicts, ambiguous scope, edges the
|
|
153
155
|
steps do not cover). Addressing the prior critique's dimensions comes before any new implementation
|
|
154
156
|
work. Proceed directly for routine file edits and command runs.
|
|
@@ -165,12 +167,18 @@ on the first attempt, not to discover problems after the fact.
|
|
|
165
167
|
it for cross-task context; re-read `{{PROGRESS_FILE}}` directly only when you need the latest
|
|
166
168
|
on-disk state (e.g. another task settled mid-session).
|
|
167
169
|
4. **Working tree state** — inspect the working tree for uncommitted changes before writing anything.
|
|
170
|
+
Unexpected pre-existing uncommitted changes are an environment failure — emit `task-blocked` naming
|
|
171
|
+
the dirty tree rather than building on unknown state. Exception: when `<prior_critique>` or
|
|
172
|
+
`<retry_feedback>` above is non-empty, an earlier round of this task left its work uncommitted —
|
|
173
|
+
that dirt is expected; continue from it.
|
|
168
174
|
5. **Git log orientation** — run `git log --oneline -20` to see what prior tasks on this branch have
|
|
169
175
|
committed. Cross-reference with `<prior_progress>` to avoid re-implementing or conflicting with
|
|
170
176
|
their work. Changes already committed by a prior task are done — do not redo them.
|
|
171
177
|
6. **Environment** — review `<verify_script>` and `<pre_verify_results>` above. If
|
|
172
178
|
`<pre_verify_results>` is non-empty, the harness already verified the baseline — review those
|
|
173
|
-
results instead of re-running. If `<pre_verify_results>` is empty and
|
|
179
|
+
results instead of re-running. If `<pre_verify_results>` is empty and a verify script IS
|
|
180
|
+
configured (e.g. the first task of a fresh setup), run it once yourself to establish the
|
|
181
|
+
baseline before changing anything. If `<pre_verify_results>` is empty and no verify script is
|
|
174
182
|
configured, run the project's own verification commands (consult the project's AI context file
|
|
175
183
|
when present, or project config). If any check shows a pre-existing failure, stop immediately:
|
|
176
184
|
emit `task-blocked` with reason `"Pre-existing failure: [details]"`.
|
|
@@ -178,11 +186,16 @@ on the first attempt, not to discover problems after the fact.
|
|
|
178
186
|
that regression as the very first priority of this attempt before doing any other work.
|
|
179
187
|
7. **Conventions** — read project config to understand what is enforced: lint and formatter settings,
|
|
180
188
|
compiler config, test framework patterns (e.g. `*.test.ts` vs `*.spec.ts`, `__tests__/` vs
|
|
181
|
-
co-located).
|
|
189
|
+
co-located). Also check the directories your task touches for a nested context file (for example
|
|
190
|
+
a nested `AGENTS.md`) — the nearest file wins for local conventions.
|
|
182
191
|
8. **Existing patterns** — search for code similar to what you need to build. Matching existing
|
|
183
192
|
patterns is the single most important feedforward control — it prevents introducing new conventions
|
|
184
193
|
that conflict with neighbours.
|
|
185
194
|
|
|
195
|
+
Before writing any code, restate in your working notes — three to five lines, not part of any
|
|
196
|
+
signal — the task goal, the acceptance criteria, and the specific facts from the prior progress or
|
|
197
|
+
learnings above that you will rely on.
|
|
198
|
+
|
|
186
199
|
Proceed to Phase 2 once Phase 1 passes.
|
|
187
200
|
|
|
188
201
|
### Phase 2 — Implementation
|
|
@@ -208,13 +221,14 @@ Proceed to Phase 2 once Phase 1 passes.
|
|
|
208
221
|
In order:
|
|
209
222
|
|
|
210
223
|
1. **Confirm all steps done** — every declared step has been completed.
|
|
211
|
-
2. **Run each `auto` criterion's command once** and fix any failures before proceeding.
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
run the
|
|
217
|
-
completion.
|
|
224
|
+
2. **Run each `auto` criterion's command once** and fix any failures before proceeding. If a
|
|
225
|
+
command fails intermittently, re-run it once; if the two runs disagree, report the inconsistency
|
|
226
|
+
as evidence in `task-verified` rather than asserting a clean pass or fail. Do NOT run the verify
|
|
227
|
+
script from `<verify_script>` — the harness runs it after your turn as the independent commit
|
|
228
|
+
gate; running it yourself would duplicate that gate and inflate cost. Exception: when the task
|
|
229
|
+
defines no `auto` criteria, run the verify script once yourself to confirm no regressions before
|
|
230
|
+
signalling completion. When no verify script is configured either, run the project's own check
|
|
231
|
+
commands (as found during Phase 1 reconnaissance) before signalling completion.
|
|
218
232
|
3. **End-to-end exercise — required when a run-path exists.** Before recording verification
|
|
219
233
|
results, check `<project_tooling>` for a way to start or invoke the product: a dev-server
|
|
220
234
|
start command, application entry point, CLI invocation, or end-to-end / smoke suite. Consult
|
|
@@ -239,9 +253,12 @@ In order:
|
|
|
239
253
|
unavailable, runtime not found), emit `task-blocked` with the failure details — do not skip
|
|
240
254
|
silently. A deliberate skip (no run-path declared) does not warrant `task-blocked`.
|
|
241
255
|
|
|
242
|
-
4. **Record verification results** — emit `task-verified` with the
|
|
243
|
-
combined stdout/stderr
|
|
244
|
-
|
|
256
|
+
4. **Record verification results** — emit `task-verified` with the commands from step 2 and their
|
|
257
|
+
combined stdout/stderr, plus the end-to-end observation from step 3 when it ran, all in the
|
|
258
|
+
`output` field. Include each command, its exit code, every failing
|
|
259
|
+
test/check name, and roughly the last 50 lines of output per command; when a command's output
|
|
260
|
+
exceeds that, write the full log to a file in your session working directory — never inside
|
|
261
|
+
the repository — and cite its path instead of pasting the rest.
|
|
245
262
|
5. **Propose the commit message** — emit `commit-message` with a real subject and a body explaining
|
|
246
263
|
WHY the change exists, what alternatives you weighed, and any follow-ups a reviewer should know.
|
|
247
264
|
The harness commits after this turn using your wording verbatim. The fallback when you omit the
|
|
@@ -259,30 +276,25 @@ In order:
|
|
|
259
276
|
changes. Fix and re-verify. If unfixable after a reasonable attempt, emit `task-blocked` with the
|
|
260
277
|
concrete failure as the `reason`.
|
|
261
278
|
|
|
262
|
-
**Tests break.** Determine whether your changes or a pre-existing issue caused the failure
|
|
263
|
-
|
|
279
|
+
**Tests break.** Determine whether your changes or a pre-existing issue caused the failure (see the
|
|
280
|
+
test-weakening rule in `<constraints>`). If pre-existing: emit `task-blocked` with
|
|
264
281
|
`reason: "Pre-existing test failure: [details]"`.
|
|
265
282
|
|
|
266
283
|
**Blocked by another task.** Emit `task-blocked` with
|
|
267
284
|
`reason: "Missing dependency: [what is missing and which task should produce it]"`. Do NOT stub or
|
|
268
285
|
mock the missing piece.
|
|
269
286
|
|
|
270
|
-
**Scope seems wrong.**
|
|
271
|
-
|
|
272
|
-
seem genuinely incomplete relative to the ticket, emit `task-blocked` rather than expanding scope.
|
|
287
|
+
**Scope seems wrong.** See the scope rule in Phase 2 step 3 above — emit `task-blocked` rather than
|
|
288
|
+
expanding scope.
|
|
273
289
|
|
|
274
|
-
**Cannot complete** — environment failure, contradictory input, or unresolvable ambiguity: emit
|
|
275
|
-
|
|
290
|
+
**Cannot complete** — environment failure, contradictory input, or unresolvable ambiguity: emit
|
|
291
|
+
`task-blocked` with a concrete reason and stop. Do not invent plausible-looking output.
|
|
292
|
+
|
|
293
|
+
**Round ends without `task-complete`, or with criteria still failing.** Emit one `note` signal
|
|
294
|
+
distilling the approaches you attempted, the dead ends you ruled out and why, and the most
|
|
295
|
+
promising untried direction — this is what the next round or the next escalated session starts
|
|
296
|
+
from, not a blank slate.
|
|
276
297
|
|
|
277
298
|
{{DECISIONS_GUIDANCE}}
|
|
278
299
|
|
|
279
300
|
{{OUTPUT_CONTRACT_SECTION}}
|
|
280
|
-
|
|
281
|
-
## References
|
|
282
|
-
|
|
283
|
-
- Anthropic agent-memory guidance — empirical basis for the 200-line / 7-H2 caps and the
|
|
284
|
-
adherence-degradation finding.
|
|
285
|
-
- Anthropic coding-agent best practices — source of the "no slash commands / hooks / MCP / IDE
|
|
286
|
-
settings in the project context file" rule.
|
|
287
|
-
- Gloaguen et al., _Evaluating AGENTS.md_ (arXiv 2602.11988) — redundant context measurably
|
|
288
|
-
reduces agent success rate.
|
|
@@ -46,15 +46,23 @@ For the complete history — older than the excerpt above — read `{{PROGRESS_F
|
|
|
46
46
|
|
|
47
47
|
<goal>
|
|
48
48
|
Address every dimension the evaluator flagged in `<prior_critique>`, then run each `auto`
|
|
49
|
-
criterion's command once.
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
`
|
|
49
|
+
criterion's command once. If a command fails intermittently, re-run it once; if the two runs
|
|
50
|
+
disagree, report the inconsistency as evidence in `task-verified` rather than asserting a clean
|
|
51
|
+
pass or fail. Do NOT run the verify script — the harness runs it after your turn as the
|
|
52
|
+
independent commit gate. Exception: when the task defines no `auto` criteria, run the verify
|
|
53
|
+
script once yourself. Emit `task-verified` with each command, its exit code, every failing
|
|
54
|
+
test/check name, and roughly the last 50 lines of output per command — when a command's output
|
|
55
|
+
exceeds that, write the full log to a file in your session working directory (never inside the
|
|
56
|
+
repository) and cite its path — propose a `commit-message` when you touched any file, and emit
|
|
57
|
+
`task-complete` only after every flagged dimension is resolved and every criterion command
|
|
58
|
+
passes. Removing or disabling a test to make verify pass counts as task failure — fix the
|
|
59
|
+
implementation, not the test — except when a declared step explicitly changes the behaviour the
|
|
60
|
+
test asserts. When a flagged item is genuinely blocked (missing dependency, contradictory input,
|
|
61
|
+
unresolvable ambiguity), emit `task-blocked` with the concrete reason instead of guessing. Emit
|
|
62
|
+
`change`, `learning`, and `note` signals as applicable — the harness records them in the sprint
|
|
63
|
+
journal. When this round ends without `task-complete` or with criteria still failing, also emit
|
|
64
|
+
one `note` signal distilling the approaches attempted, the dead ends ruled out and why, and the
|
|
65
|
+
most promising untried direction.
|
|
58
66
|
</goal>
|
|
59
67
|
|
|
60
68
|
{{OUTPUT_CONTRACT_SECTION}}
|
|
@@ -29,8 +29,8 @@ Produce a dependency-ordered task array and write it as a `task-plan` signal to
|
|
|
29
29
|
</success_criteria>
|
|
30
30
|
|
|
31
31
|
<session_topology>
|
|
32
|
-
Your working directory for this session is
|
|
33
|
-
|
|
32
|
+
Your working directory for this session is a harness-managed session directory — you are NOT
|
|
33
|
+
running inside any project repository.
|
|
34
34
|
|
|
35
35
|
The project repositories listed under `<repositories>` are mounted as read-only sources
|
|
36
36
|
you can explore — each one has equal access weight; no single repository is primary. Read
|
|
@@ -332,6 +332,8 @@ them; do not re-litigate a prior decision without surfacing why in the plan.
|
|
|
332
332
|
|
|
333
333
|
<existing_tasks>{{EXISTING_TASKS}}</existing_tasks>
|
|
334
334
|
|
|
335
|
+
If `<existing_tasks>` is empty, this is a fresh plan — there is nothing to replace.
|
|
336
|
+
|
|
335
337
|
</inputs>
|
|
336
338
|
|
|
337
339
|
## Protocol
|
|
@@ -344,7 +346,9 @@ and sequence dependencies.
|
|
|
344
346
|
Read the repositories mounted under `<repositories>` to:
|
|
345
347
|
|
|
346
348
|
1. Read repo instruction files (`CLAUDE.md`, `AGENTS.md`, `.github/copilot-instructions.md`)
|
|
347
|
-
when present.
|
|
349
|
+
when present. Also check major subdirectories for nested context files (for example a
|
|
350
|
+
nested `AGENTS.md`) — note directory-local conventions in the plan when they differ from
|
|
351
|
+
the root.
|
|
348
352
|
2. Skim project structure and manifests (`package.json`, `pyproject.toml`, etc.).
|
|
349
353
|
3. Run `git log --oneline -20` per repository so you don't plan tasks that re-implement
|
|
350
354
|
already-landed work.
|
|
@@ -368,7 +372,9 @@ Draft the plan first, before writing JSON.
|
|
|
368
372
|
|
|
369
373
|
For genuinely contested decisions, ask the user a structured multiple-choice question — one
|
|
370
374
|
at a time, 2–4 labelled options per question, recommendation as the first option. Use your
|
|
371
|
-
runtime's interactive question capability to present the question.
|
|
375
|
+
runtime's interactive question capability to present the question. Labels are 1–5 words;
|
|
376
|
+
headers are 12 characters or fewer (UI rendering constraints). The harness automatically
|
|
377
|
+
appends a free-form "Other" option — do not add your own.
|
|
372
378
|
|
|
373
379
|
Good questions:
|
|
374
380
|
|
|
@@ -431,4 +437,11 @@ Once the user has answered "Approved, write it" in Step 4 AND every checklist it
|
|
|
431
437
|
satisfied, write the `task-plan` signal into `signals.json` per the output contract below.
|
|
432
438
|
The task array goes into the signal's `tasksJson` field as a JSON-encoded string.
|
|
433
439
|
|
|
440
|
+
**Optional signals** (emit when relevant). Each carries its prose in a `text` field — never
|
|
441
|
+
`body`; the output contract below shows the exact shape:
|
|
442
|
+
|
|
443
|
+
- `note` — for status updates or observations worth surfacing.
|
|
444
|
+
- `learning` — for non-obvious repo facts discovered during exploration.
|
|
445
|
+
- `decision` — for architectural choices made during planning.
|
|
446
|
+
|
|
434
447
|
{{OUTPUT_CONTRACT_SECTION}}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<role>
|
|
2
2
|
You are an AI coding agent performing a one-shot, read-only repository inventory. Your sole job for this call
|
|
3
3
|
is to produce a project context file proposal that the harness writes to the target path after operator
|
|
4
|
-
review.
|
|
4
|
+
review. Write nothing except `signals.json`; run only read-only inspection commands — never build,
|
|
5
|
+
install, or otherwise mutating commands. The harness owns execution.
|
|
5
6
|
</role>
|
|
6
7
|
|
|
7
8
|
<goal>
|
|
@@ -15,8 +16,8 @@ warranted. Write all signals to the `signals.json` path described in `<output_co
|
|
|
15
16
|
|
|
16
17
|
- `agents-md-proposal` signal emitted with `tag: "{{WIRE_TAG}}"` and a non-empty `content` field.
|
|
17
18
|
- Every tech-stack claim in `content` is backed by a quoted file path or file content, not inferred.
|
|
18
|
-
- `content`
|
|
19
|
-
|
|
19
|
+
- `content` follows the length guidance for `{{CURRENT_TOOL}}` in `<target_file_conventions>`
|
|
20
|
+
below — the exact target and ceiling are provider-specific.
|
|
20
21
|
- When an existing context file is supplied in `<existing_context_file>`, `content` starts with that body
|
|
21
22
|
verbatim — byte-for-byte, unchanged, in the same order — before any additions.
|
|
22
23
|
- Setup and verify skill proposals, when emitted, cite only commands that resolve in this specific repo
|
|
@@ -54,9 +55,8 @@ with this repo would get it wrong without being told. Anything an agent can deri
|
|
|
54
55
|
existing docs does not belong in the context file — redundant context measurably reduces agent success.
|
|
55
56
|
Lean is better than comprehensive.
|
|
56
57
|
|
|
57
|
-
**Output length.**
|
|
58
|
-
provider-specific —
|
|
59
|
-
Brevity is a feature — the file is read fresh on every AI session.
|
|
58
|
+
**Output length.** Follow the length guidance in `<target_file_conventions>` below — the target and
|
|
59
|
+
any ceiling are provider-specific. Brevity is a feature — the file is read fresh on every AI session.
|
|
60
60
|
|
|
61
61
|
**Structure caps.** Exactly one H1; at most 7 H2 sections; no H4 or deeper headings. Prefer bullets and
|
|
62
62
|
short sentences.
|
|
@@ -90,8 +90,8 @@ shell line per step — chain with `&&`, not `;`, so the runner stops at the fir
|
|
|
90
90
|
|
|
91
91
|
<capabilities>
|
|
92
92
|
You can read files anywhere in `{{REPOSITORY_PATH}}` — limit yourself to the inspection scope above. You can
|
|
93
|
-
search the repository for file names or content patterns
|
|
94
|
-
|
|
93
|
+
search the repository for file names or content patterns, and run read-only inspection commands. Write
|
|
94
|
+
nothing except `signals.json`; never run build, install, or otherwise mutating commands.
|
|
95
95
|
</capabilities>
|
|
96
96
|
|
|
97
97
|
<output_contract>
|
|
@@ -147,7 +147,8 @@ Write `signals.json` to the path described in `<output_contract>` with the signa
|
|
|
147
147
|
emit prose commentary outside the signal file.
|
|
148
148
|
|
|
149
149
|
If you cannot characterise the repository (e.g. the repo is empty, no manifest files are readable, the
|
|
150
|
-
inspection scope yields no evidence), emit a single `note` signal with
|
|
150
|
+
inspection scope yields no evidence), emit a single `note` signal whose `text` starts with `missing-input`,
|
|
151
|
+
followed by a short explanation, and stop.
|
|
151
152
|
Do not invent stack claims without evidence.
|
|
152
153
|
|
|
153
154
|
## Signal summary
|
|
@@ -162,3 +163,5 @@ Do not invent stack claims without evidence.
|
|
|
162
163
|
`["typescript-strict"]`).
|
|
163
164
|
5. `note` — optional. One short observation. MUST be the only signal emitted when the repo cannot be
|
|
164
165
|
characterised.
|
|
166
|
+
6. `learning` — optional. A durable insight worth recording beyond this session (e.g. a
|
|
167
|
+
non-obvious convention the inspection uncovered), in its `text` field.
|
|
@@ -7,8 +7,9 @@ from any earlier session is assumed; read `<prior_progress>` below to orient you
|
|
|
7
7
|
|
|
8
8
|
<goal>
|
|
9
9
|
Produce a single `refined-ticket` signal written to `signals.json` in the output directory. The
|
|
10
|
-
signal's `body` field carries the approved requirements markdown. Success = the body is
|
|
11
|
-
approved, covers the happy path plus edge/error cases, and contains no implementation
|
|
10
|
+
signal's `body` field carries the approved requirements markdown. Success = the body is
|
|
11
|
+
operator-approved, covers the happy path plus edge/error cases, and contains no implementation
|
|
12
|
+
details.
|
|
12
13
|
</goal>
|
|
13
14
|
|
|
14
15
|
<success_criteria>
|
|
@@ -28,12 +29,12 @@ approved, covers the happy path plus edge/error cases, and contains no implement
|
|
|
28
29
|
<inputs>
|
|
29
30
|
<ticket>{{TICKET}}</ticket>
|
|
30
31
|
|
|
31
|
-
|
|
32
|
+
{{ISSUE_CONTEXT}}
|
|
32
33
|
|
|
33
34
|
<prior_progress>{{PRIOR_PROGRESS}}</prior_progress>
|
|
34
35
|
|
|
35
36
|
If `<prior_progress>` is empty, no prior work has been recorded for this sprint yet.
|
|
36
|
-
If `<
|
|
37
|
+
If the `<context>` block above is empty or absent, no upstream issue body was available.
|
|
37
38
|
</inputs>
|
|
38
39
|
|
|
39
40
|
{{HARNESS_CONTEXT}}
|
|
@@ -43,8 +44,8 @@ If `<issue_context>` is empty, no upstream issue body was available.
|
|
|
43
44
|
date range"), not technical decisions ("add a SQL WHERE clause"). The planner that runs after you
|
|
44
45
|
needs maximum flexibility on HOW; your job is WHAT.
|
|
45
46
|
- MUST NOT explore the repository. No source files are mounted in this session — only the output
|
|
46
|
-
directory is writable. If a question requires source context,
|
|
47
|
-
as
|
|
47
|
+
directory is writable. If a question requires source context, note it in the requirements body
|
|
48
|
+
as an open question requiring repo investigation.
|
|
48
49
|
- One concern per question. Combining "what should it do AND how should it look" forces a fuzzy
|
|
49
50
|
answer to both — ask each dimension separately.
|
|
50
51
|
- Honor prior decisions in `<prior_progress>`. Do not re-open a dimension the sprint has already
|
|
@@ -58,7 +59,7 @@ If `<issue_context>` is empty, no upstream issue body was available.
|
|
|
58
59
|
### Step 1 — Analyse the ticket
|
|
59
60
|
|
|
60
61
|
Before producing any output, work through what is clear, what is ambiguous, and what edge cases the
|
|
61
|
-
ticket omits.
|
|
62
|
+
ticket omits.
|
|
62
63
|
|
|
63
64
|
Then identify, in order:
|
|
64
65
|
|
|
@@ -143,13 +144,7 @@ Options:
|
|
|
143
144
|
|
|
144
145
|
### Step 3 — Stop interviewing
|
|
145
146
|
|
|
146
|
-
Stop
|
|
147
|
-
|
|
148
|
-
1. The problem statement is clear and agreed.
|
|
149
|
-
2. Every functional requirement has at least one acceptance criterion.
|
|
150
|
-
3. Scope boundaries (in / out / deferred) are explicit.
|
|
151
|
-
4. Major edge cases and error states are addressed.
|
|
152
|
-
5. Two engineers reading these requirements would build the same thing.
|
|
147
|
+
Stop asking questions once every item in the Step 5 pre-output quality checklist would pass.
|
|
153
148
|
|
|
154
149
|
### Step 4 — Present requirements for approval
|
|
155
150
|
|
|
@@ -249,9 +244,10 @@ them with `---`:
|
|
|
249
244
|
```
|
|
250
245
|
|
|
251
246
|
<output_contract>
|
|
252
|
-
Write `signals.json` to the output directory.
|
|
253
|
-
|
|
254
|
-
|
|
247
|
+
Write `signals.json` to the output directory. Only `signals.json` is read by the harness; all
|
|
248
|
+
other session output is forensic and not persisted as data. The file MUST contain exactly one
|
|
249
|
+
`refined-ticket` signal. The harness validates this file after the session exits; a missing file,
|
|
250
|
+
unparseable JSON, or zero/multiple `refined-ticket` entries are all validation failures.
|
|
255
251
|
|
|
256
252
|
Permitted signal kinds:
|
|
257
253
|
|
|
@@ -7,7 +7,7 @@ description: Cross-phase skill — design the shape of the change (entities, bou
|
|
|
7
7
|
|
|
8
8
|
> Concept
|
|
9
9
|
>
|
|
10
|
-
> from [
|
|
10
|
+
> from [SPDD (Zhang & Xia, martinfowler.com) — "Abstraction-First"](https://martinfowler.com/articles/structured-prompt-driven/abstraction-first.html).
|
|
11
11
|
> Adapted for ralphctl's three phases.
|
|
12
12
|
|
|
13
13
|
The shape of the change comes before the words that describe it. Name the entities, the boundaries, and the
|
|
@@ -5,7 +5,7 @@ description: Cross-phase skill — establish a shared understanding of what will
|
|
|
5
5
|
|
|
6
6
|
# Alignment
|
|
7
7
|
|
|
8
|
-
> Concept from [
|
|
8
|
+
> Concept from [SPDD (Zhang & Xia, martinfowler.com) — "Alignment"](https://martinfowler.com/articles/structured-prompt-driven/alignment.html).
|
|
9
9
|
> Adapted for ralphctl's three phases.
|
|
10
10
|
|
|
11
11
|
The fastest way to ship the wrong thing is to start producing output before you have agreed on what is being
|
|
@@ -7,7 +7,7 @@ description: Cross-phase skill — treat AI output as a controlled feedback loop
|
|
|
7
7
|
|
|
8
8
|
> Concept
|
|
9
9
|
>
|
|
10
|
-
> from [
|
|
10
|
+
> from [SPDD (Zhang & Xia, martinfowler.com) — "Iterative Review"](https://martinfowler.com/articles/structured-prompt-driven/iterative-review.html).
|
|
11
11
|
> Adapted for ralphctl's three phases.
|
|
12
12
|
|
|
13
13
|
One-shot generation looks fast and is slow. The cheap review you skipped at iteration N becomes the expensive
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ralphctl",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.1",
|
|
4
4
|
"description": "Agent harness for long-running AI coding tasks — orchestrates Claude Code, GitHub Copilot, and OpenAI Codex across repositories",
|
|
5
5
|
"homepage": "https://github.com/lukas-grigis/ralphctl",
|
|
6
6
|
"type": "module",
|