Skip to content

Add Ralph loop tooling for autonomous spec implementation#9

Merged
KonH merged 2 commits into
mainfrom
feature/ralph-loop-tooling
Jul 13, 2026
Merged

Add Ralph loop tooling for autonomous spec implementation#9
KonH merged 2 commits into
mainfrom
feature/ralph-loop-tooling

Conversation

@KonH

@KonH KonH commented Jul 13, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds the original fresh-context-per-iteration Ralph loop, integrated with the existing spec workflow: scripts\ralph.ps1 -SpecIndex <n> derives a gated task list from the spec's plan (/create-prd), implements one task per fresh claude -p iteration, and on success commits and opens a PR via the existing /commit and /pr skills (/complete-prd)
  • Fresh context per task avoids long-session context rot; per-phase cost/token metrics land in gitignored .ralph/metrics_<n>.csv to enable a Ralph-vs-single-session cost comparison
  • Verification gates are honest by construction: dotnet build/test, venv python validators, or Unity MCP (refresh + empty error console); purely visual tasks are tagged unity-manual for manual follow-up
  • Safety rails: auto-branches to ralph/<spec>, refuses dirty trees, permission allowlist instead of skipping permissions, PR phase skipped when tasks remain unfinished
  • Also aligns /commit skill docs and project permission allowlist (Setup common skills)

Test plan

  • ralph.ps1 parse-checked clean (PowerShell 5.1, pure ASCII)
  • Bad spec index rejected; spec 45 resolves to Docs/Specs/45_province-ownership
  • Dirty-tree and main-branch guards fire before any claude invocation
  • End-to-end run against a real spec (/create-prd → loop → /complete-prd) with Unity Editor open
  • Metrics CSV totals sanity-checked after a real run

🤖 Generated with Claude Code

KonH and others added 2 commits July 13, 2026 14:48
Enables running approved spec plans autonomously with a fresh Claude
context per task (the original Ralph technique), instead of one long
session that degrades as context fills. ralph.ps1 drives three phases
around a spec index: /create-prd derives a gated task list from the
spec plan, the loop implements one task per iteration with headless
or Unity MCP verification, and /complete-prd hands off via the
existing /commit and /pr skills. Per-phase cost metrics are logged to
support comparing Ralph against single-session implementation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@KonH
KonH merged commit eb67469 into main Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant