Ralph loop + OpenSpec 集成,用于 Cursor、OpenCode 和 ClaudeCode 的重载功能。
Ralph loop + OpenSpec 集成,用于 Cursor、OpenCode 和 ClaudeCode 的重载功能。
Spec-driven AI development with iterative execution. Combines OpenSpec + Ralph Loop for predictable AI-assisted coding.
Website: https://ralphy-spec.org Docs: https://ralphy-spec.org/en/docs/ Changelog: https://ralphy-spec.org/en/changelog/ · GitHub
npx ralphy-spec initCLI basics:
ralphy-spec run --dry-run
ralphy-spec run
ralphy-spec status
ralphy-spec budget --jsonLogs & artifacts (during/after runs):
ralphy-spec/STATUS.md: live status (primary)ralphy-spec/runs/.md: run log (immutable on completion)ralphy-spec/logs//...: backend transcripts (stdout/stderr + metadata)Then use the commands for your AI tool:
| Command | What it does |
|---|---|
/ralphy-plan |
Create specs from requirements |
/ralphy-implement |
Build with iterative loop |
/ralphy-validate |
Verify acceptance criteria |
/ralphy-archive |
Complete and archive |
If you want to run the full workflow from a terminal with Cursor as the backend (no IDE slash commands), you must authenticate Cursor Agent first:
cursor agent login
# or set CURSOR_API_KEY in your environment
ralphy-spec run --backend cursor
# backend output streams by default; add --no-stream-backend to silence| Command | What it does |
|---|---|
/ralphy-plan |
Create specs from requirements |
/ralphy-implement |
Build with iterative loop |
/ralphy-validate |
Verify acceptance criteria |
/ralphy-archive |
Complete and archive |
Use natural language with AGENTS.md:
"Follow AGENTS.md to plan [feature]""Follow AGENTS.md to implement [change]""Follow AGENTS.md to validate""Follow AGENTS.md to archive [change]"With Ralph Loop Runner:
npm install -g @th0rgal/ralph-wiggum
ralph "Follow AGENTS.md to implement add-api. Output TASK_COMPLETE when done." --max-iterations 20# 1. Plan: Create spec from your idea
You: /ralphy-plan Add user authentication with JWT
# 2. Implement: AI builds it iteratively
You: /ralphy-implement add-user-auth
# 3. Validate: Verify tests pass
You: /ralphy-validate
# 4. Archive: Complete the change
You: /ralphy-archive add-user-auth…Note: Legacy
.ralphy/folders are migrated toralphy-spec/automatically when found.
Ralph Wiggum Loop: AI receives the same prompt repeatedly until task completion. Each iteration, it sees previous work in files and self-corrects.
OpenSpec: Specs before code. Structured specifications with acceptance criteria ensure AI knows exactly what to build.
The Combination:
| Problem | Solution |
|---|---|
| Vague requirements in chat | Specs lock intent |
| AI stops mid-task | Loop retries until done |
| No way to verify | Tests validate output |
| Tool-specific setup | One command for all |
# npx (recommended)
npx ralphy-spec init
# Global install
npm install -g ralphy-spec
ralphy-spec init
# With specific tools
ralphy-spec init --tools cursor,claude-code,opencodeBuilt on the work of:
BSD-3-Clause
暂无开放 Issues,或尚未同步最近议题。