Discover MCPs & agents
Loading MCPs and agents…
Loading MCPs and agents…
Spec-driven AI coding automation CLI. AI Loops runner for Claude Code, OpenCode, Cursor, and other agent CLIs.
Jump to setup instructionsFetched from the repository for this visit.
SpecRalph (formerly Ralphex) is a spec-driven AI coding automation CLI for developers. It orchestrates iterative development loops with external agent CLIs like Claude Code, OpenCode, Cursor, Oh My Pi, Codex, Copilot, and Antigravity. Built with Go for cross-platform support (Linux, macOS, Windows), SpecRalph implements the Ralph Wiggum methodology for AI-assisted software development: define specs, generate implementation plans, and execute automated coding loops until completion.
SpecRalph wraps a supported agent CLI in a repeatable loop: resolve a prompt, run the agent, and repeat until the agent emits <promise>COMPLETE</promise> or max iterations is reached. Each pass works against the updated repository, which makes it a good fit for specs, implementation plans, and repository-local prompts.
[!NOTE] The repository is
iyaki/specralph, but the CLI command remainsralph.
[!IMPORTANT] SpecRalph does not bundle an agent runtime. Install and authenticate a supported agent CLI separately, then make sure its binary is available on your
PATH.
build-classic, build-subagents, and plan prompts plus inline, stdin, and file-based prompts; build is an alias that defaults to build-classic.Spec-driven development reduces ambiguity and keeps AI agents focused on concrete requirements.
| Agent | Config value | CLI binary |
|---|---|---|
| Claude Code | claude | claude |
| OpenCode | opencode | opencode |
| Cursor | cursor | cursor |
| Oh My Pi (version >= 17.0.0) | oh-my-pi (alias omp) | omp |
| OpenAI Codex | codex | codex |
| GitHub Copilot | copilot | copilot |
| Google Antigravity | antigravity (alias agy) | agy |
The agent config value accepts agy as an alias for antigravity and omp as an alias for oh-my-pi; a single canonical name per agent is used in documentation.
model and agent-mode are forwarded when the selected agent CLI supports them.
Agent support Pull Requests are always welcomed. To add or update agent integrations, follow the workflow in CONTRIBUTING.md ("Adding Support for a New Agent"):
agent-spec-creation for spec definitionagent-implementation for TDD-based code changesRequirements:
PATHcurl -fsSL https://raw.githubusercontent.com/iyaki/specralph/main/scripts/install.sh | bash
Binaries are available for Linux, macOS, and Windows. Download the appropriate binary for your platform and move it to a directory in your PATH.
chmod +x ralph
sudo mv ralph /usr/local/bin/
ghcr.io/iyaki/devcontainer-features/ralph:1 - Link to feature repository
Requirements:
1.25 if you are building from source# Clone the repository and then:
make build
./bin/ralph --help
./bin/ralph version
Install system-wide after building:
make install
For a reproducible local environment, open the repository with the included dev container in .devcontainer/devcontainer.json.
If you are already doing spec-driven development:
# Create a starter config
ralph init
# Generate or refresh the implementation plan for a scope
ralph plan authentication
# Run the default build loop
ralph
# Run the same default loop through the explicit entrypoint and prompt name
ralph run build
# Use a different agent for one run
ralph --agent claude --model claude-sonnet-4 build
Common prompt entrypoints:
# Inline prompt text
ralph --prompt "Review the repository and summarize the highest-risk area"
# Prompt from stdin
printf 'Prompt from stdin' | ralph -
# Prompt from a file with an explicit prompt name
ralph --prompt-file ./prompts/review.md review
# Per-run child agent environment override
ralph --env HTTP_PROXY=http://127.0.0.1:8080 build
| Command | Behavior |
|---|---|
ralph | Equivalent to ralph run build (build resolves via the build-alias-prompt config, default build-classic) |
ralph run <prompt> [scope] | Explicit loop entrypoint |
ralph <prompt> [scope] | Alias to ralph run <prompt> [scope] when <prompt> is not a subcommand |
ralph prompts list | List all available built-in and custom prompts |
ralph prompts show <name> | Display full content of a specific prompt |
ralph prompts guide | Print the authoring guide for custom prompt files |
ralph prompts validate <target> | Run static checks on a prompt file or named prompt |
ralph skill install [dir] | Install the bundled prompt-authoring skill into a project |
ralph init | Generate a starter config file |
ralph run init | Run a prompt named init |
ralph version | Print the version number |
Useful examples:
# Built-in planning prompt
ralph plan payment-service
# List available prompts
ralph prompts list
# View the full build prompt
ralph prompts show build
# View the full plan prompt
ralph prompts show plan
# Explicit run command
ralph run build
# Inline prompt text
ralph --prompt "Review the repository and summarize the highest-risk area"
# Prompt from stdin
printf 'Prompt from stdin' | ralph -
# Prompt from a file with an explicit prompt name
ralph --prompt-file ./prompts/review.md review
# Per-run child agent environment override
ralph --env HTTP_PROXY=http://127.0.0.1:8080 build
# Check Ralph version
ralph version
ralph initralph init currently writes a starter config with repository-friendly defaults. It requires an interactive terminal, writes to ./ralph.toml by default, and fails if the target already exists unless --force is set.
ralph init
ralph init --output ./team/ralph.toml
ralph init --force
The generated starter config disables logging by default (log file is empty). Users can enable logging during the interactive questionnaire by providing a log file path. The default prompts directory is set to .ralph/prompts so prompt files can live inside the repository. Init always writes build-alias-prompt = "build-subagents", opting new projects into the batch build prompt.
ralph promptsThe prompts command helps you discover and inspect built-in and custom prompts.
# List all available prompts
ralph prompts list
# View the full content of the build prompt
ralph prompts show build
# View the full content of the plan prompt
ralph prompts show plan
# View a custom prompt file
ralph prompts show review
# Print the prompt authoring guide
ralph prompts guide
# Validate a prompt before running it
ralph prompts validate review
The prompts list subcommand displays:
build-classic (single-task build), build-subagents (batch build with at least one subagent per task), and plan with brief descriptionsbuild and the prompt name it resolves to (configurable via build-alias-prompt)This command is useful when you want to:
The full prompt content is displayed exactly as it would be sent to the agent (with frontmatter stripped for custom prompts), making it easy to verify your prompt configuration or understand the default behavior.
ralph skillralph skill install [dir] writes the bundled prompt-authoring skill into a project so AI agents working there discover specralph prompt conventions automatically. The directory defaults to .agents/skills; the skill installs to <dir>/specralph-prompts/SKILL.md and always matches the installing binary's version. Use --force to overwrite an existing installation.
# Install into the current project
ralph skill install
# Install into a custom directory
ralph skill install ~/my-project/.agents/skills
When writing custom prompts (inline via --prompt or in prompt files), always include the completion signal so Specralph knows when the agent is done.
Inline prompt example:
ralph --prompt "Review the authentication module and suggest improvements. When done, output: <promise>COMPLETE</promise>"
Prompt file example (prompts/review.md):
Review the authentication module and identify security issues.
Write tests to cover edge cases.
When everything is done, output: <promise>COMPLETE</promise>
You can also use the placeholder <COMPLETION_SIGNAL> — Specralph automatically replaces it with <promise>COMPLETE</promise> at runtime:
Implement feature X.
Write tests for Y.
When everything is done, output: <COMPLETION_SIGNAL>
For full details on prompt resolution order and front matter, see Prompt Resolution.
Prompt content is resolved in this order:
For model and agent-mode, effective precedence is:
flags > environment variables > prompt front matter > [prompt-overrides.<prompt>] > global config
Specralph resolves settings with this precedence:
flags > environment variables > config file > defaults
Base config selection happens in this order:
--config <path>RALPH_CONFIG./ralph.toml in the current directoryIf a base config file is selected, a sibling ralph-local.toml is merged over it before environment variables and flags are applied. This lets you commit shared defaults in ralph.toml and keep machine-specific overrides untracked in ralph-local.toml.
For example, --config ./team/ralph.toml loads ./team/ralph-local.toml if it exists. It does not look for ./ralph-local.toml in the current working directory.
[env] entries and [prompt-overrides.<prompt>] entries merge by key across ralph.toml and ralph-local.toml. Parse errors in either file stop the run before the agent starts.
[!TIP] Keep shared team defaults in
ralph.toml, addralph-local.tomlto.gitignore, and use the local file for personal overrides and secrets.
Example ralph.toml:
agent = "opencode"
model = "gpt-5"
build-alias-prompt = "build-classic"
specs-dir = "specs"
specs-index-file = "README.md"
implementation-plan-name = "IMPLEMENTATION_PLAN.md"
prompts-dir = ".ralph/prompts"
no-log = false
log-file = "./ralph.log"
[prompt-overrides.plan]
agent-mode = "planner"
[env]
HTTP_PROXY = "http://127.0.0.1:8080"
| Variable | Purpose |
|---|---|
RALPH_CONFIG | Select the base config file path |
RALPH_MAX_ITERATIONS | Override max-iterations |
RALPH_SPECS_DIR | Override specs-dir |
RALPH_SPECS_INDEX_FILE | Override specs-index-file |
RALPH_IMPLEMENTATION_PLAN_NAME | Override implementation-plan-name |
RALPH_BUILD_ALIAS_PROMPT | Override the prompt name the build alias resolves to |
RALPH_CUSTOM_PROMPT | Provide inline prompt text, similar to --prompt |
RALPH_LOG_FILE | Override the log file path |
RALPH_LOG_ENABLED | Boolean: 1 or true enables logging, 0 or false disables it |
RALPH_LOG_APPEND | Boolean: 1 or true appends, 0 or false truncates on start |
RALPH_PROMPTS_DIR | Override prompts-dir |
RALPH_AGENT | Select the agent (supported names and aliases in Supported Agents) |
RALPH_MODEL | Override model |
RALPH_AGENT_MODE | Override agent-mode |
If prompts-dir is unset everywhere, the runtime default is $HOME/.ralph. The starter config written by ralph init pins prompts-dir to .ralph/prompts so prompt files live in the repository.
Specralph's own RALPH_* settings are separate from the environment passed to the child agent. Use [env] in config for shared values and repeatable --env KEY=VALUE flags for per-run overrides.
Child agent environment precedence is:
inherited environment < [env] in config < repeated --env flags
Later --env flags win for the same key. Each flag entry must use KEY=VALUE, and keys must match [A-Za-z_][A-Za-z0-9_]*.
With no config file, logging is disabled by default. When logging is enabled and no explicit path is configured, the effective default log file is ./ralph.log in the current working directory.
Logs mirror stdout and are written with 0600 permissions. Each run starts with a header that includes a timestamp plus git branch and commit metadata; unresolved git values are recorded as N/A.
# Enable logs for one run even if config disables them
ralph --no-log=false --log-file ./ralph.log build
# Start from an empty log file
ralph --no-log=false --log-file ./ralph.log --log-truncate build
# Same behavior through environment variables
RALPH_LOG_ENABLED=1 RALPH_LOG_APPEND=0 ralph build
Ralph detects task completion by searching for the following XML-like tag in agent output:
<promise>COMPLETE</promise>
The built-in prompts use the placeholder <COMPLETION_SIGNAL>, which Ralph automatically replaces with <promise>COMPLETE</promise> at runtime before sending the prompt to the agent.
When creating custom prompts (inline via --prompt or in prompt files), you can either:
Use the placeholder <COMPLETION_SIGNAL> — Ralph will replace it for you:
Implement feature X.
Write tests for Y.
When everything is done, output: <COMPLETION_SIGNAL>
Or directly include the actual signal:
Implement feature X.
Write tests for Y.
When everything is done, output: <promise>COMPLETE</promise>
The tag is case-sensitive and must appear exactly as shown. Ralph will stop after detecting the first occurrence.
[!TIP] For technical details on the completion signal mechanism, see specs/prompts.md#completion-signal. [!CAUTION] Prompt text and agent output are written to stdout and, when logging is enabled, to the configured log file. Treat prompt files, config overrides, and logs as sensitive.
Specralph is designed around a specs-first loop inspired by Geoffrey Huntley's Ralph methodology.
Typical flow:
specs/.ralph plan <scope> to generate or update IMPLEMENTATION_PLAN.md.ralph or ralph build to implement the next task (the build alias defaults to build-classic; configs generated by ralph init target build-subagents).The built-in prompts use a <COMPLETION_SIGNAL> placeholder, which Specralph replaces with <promise>COMPLETE</promise> before sending the prompt to the agent.
This repo includes the spec-creator skill (see .agents/skills/spec-creator/SKILL.md) for the first phase of Geoffrey Huntley's Ralph Wiggum methodology.
To install it using Vercel's skills CLI, run:
npx skills add https://github.com/iyaki/specralph/ --skill spec-creator
We welcome contributions! Please see our Contributing Guide for:
GitHub checked 15h ago - refresh overdue. Recently viewed repositories target hourly refresh.
Find a documented setup for your client. No sign-in, installation, or tool execution.
If this MCP is also published on mcpchannel.ai, you can subscribe from Browse and use the gateway config there instead.