Finish a Ralph loop run: commit any remaining changes and open a pull request.
Arguments: $ARGUMENTS — either the spec index (e.g. 45), bot:<featureId> for a bot-feature run (e.g. bot:opinionTargeting), or perf:<target> for a performance-optimization run (e.g. perf:CountryPopulationCollector).
-
Resolve the spec folder.
- Spec-index form:
Docs/Specs/<index>_<name>/. bot:<featureId>form: the standing specDocs/Specs/52_bot-feature-eval-harness/(bot features have no per-feature spec/plan — see the Constitution's bot-feature carve-out).perf:<target>form: the standing specDocs/Specs/26_07_18_18_benchmarkdotnet-perf-harness/(perf-optimization attempts have no per-target spec/plan — see the Constitution's performance-optimization carve-out).
Read
.ralph/prd.mdand.ralph/activity.md. Determine run status: how many tasks have"passes": trueout of the total, and which are"category": "unity-manual". - Spec-index form:
-
Run
git status(never-uall) andgit diff. If uncommitted changes remain, stage them and create a commit using the /commit skill (it handles branch rules and the version bump). If the working tree is clean, still run the /commit version-bump flow only if no commit exists on this branch yet; otherwise proceed. -
Create the pull request using the /pr skill. Create it as a draft when any PRD task is unfinished or the activity journal records a blocker; create it ready for review only when every task passes and no blocker remains. In addition to the /pr skill's standard body format, append a section:
## Ralph run - Spec: Docs/Specs/<index>_<name>/ - Tasks passed: X/N - Manual Editor verification needed: <list of unity-manual tasks, or "none"> - Unfinished tasks / blockers: <from activity.md, or "none">Unchecked test-plan items must include every
unity-manualtask.bot:<featureId>form only — follow the Ralph run section with an## Eval verdictsection sourced fromDocs/BotFeatures/<featureId>/eval_history.json(latest entry) andeval_summary.md:## Eval verdict - Gates: score=<pass/fail>, command-on=<pass/fail>, command-off=<pass/fail> - Mean delta: <mean> (median <median>) vs epsilon <epsilon> - Improved (mean > 0): <yes/no> - Winning parameters: <winner's parameter set, or "no search"> - Attempts: <count> - Details: Docs/BotFeatures/<featureId>/perf:<target>form only — follow the Ralph run section with a## Benchmark verdictsection sourced fromDocs/Benchmarks/history.json(latest entry/entries for the target) andDocs/Benchmarks/summary.md:## Benchmark verdict | Benchmark | Baseline mean | Current mean | % change | Verdict | Allocated bytes | |---|---|---|---|---|---| | <name> | <baseline ns> | <current ns> | <%> | <pass/fail> | <bytes> | - Attempts: <count> - Details: Docs/Benchmarks/ -
After the pull request exists, clear the completed run artifacts: replace
.ralph/prd.mdwith a short# Ralph PRDheader stating that no run is active, reset.ralph/activity.mdto its standard header only (# Ralph Activity Journal, its intro line, and---), and delete every file under.ralph/logs/(per-iteration loop stdout/stderr logs — not needed once the run's outcome is captured in the PR). Stage and commit this cleanup as a separate follow-up commit using the /commit skill, then push it to the same pull-request branch. Do not combine this artifact cleanup with the implementation commit or the PR-creation commit. -
Report the PR URL and the follow-up cleanup commit.
- Do not flip any
"passes"flags here — this skill reports state, it does not verify tasks. - Do not refuse to create a PR merely because the Ralph run is incomplete. A partial PR preserves verified progress and makes the remaining tasks and blockers reviewable.
- If the loop left blockers in
.ralph/activity.md, quote them in the PR body verbatim rather than paraphrasing them away. - For
bot:<featureId>runs: never fabricate the eval verdict section — read it from the committedeval_history.json/eval_summary.md; if those files are missing or empty, say so rather than inventing numbers. - For
perf:<target>runs: never fabricate the benchmark verdict section — read it from the committedDocs/Benchmarks/history.json/summary.md; if those files are missing the target's entries, say so rather than inventing numbers.