ralph-opencode-free-loop

Run an autonomous Open Ralph Wiggum coding loop using OpenCode Zen with free models and automatic fallback.

3,891 stars

Best use case

ralph-opencode-free-loop is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Run an autonomous Open Ralph Wiggum coding loop using OpenCode Zen with free models and automatic fallback.

Teams using ralph-opencode-free-loop should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/open-ralph/SKILL.md --create-dirs "https://raw.githubusercontent.com/openclaw/skills/main/skills/bderiel/open-ralph/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/open-ralph/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How ralph-opencode-free-loop Compares

Feature / Agentralph-opencode-free-loopStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Run an autonomous Open Ralph Wiggum coding loop using OpenCode Zen with free models and automatic fallback.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

## What this skill does

This skill runs an autonomous **Ralph Wiggum** coding loop using the `ralph` CLI with OpenCode as the agent provider.

It repeatedly executes the same coding prompt until:

- The success criteria are met, OR
- The completion promise is printed, OR
- Max iterations are reached

The loop is optimized for **free OpenCode Zen models** and includes a fallback chain in case models are rate-limited, disabled, or removed.

---

## When to use

Use this skill when you want autonomous coding execution such as:

- Fixing failing tests
- Implementing scoped features
- Refactoring codebases
- Resolving lint/type errors
- Running build-fix loops
- Multi-iteration debugging

You MUST be inside a git repository before running Ralph.

---

## Free model fallback order

Always attempt models in this order:

1. `opencode/kimi-k2.5-free` ← Best coding performance (limited time free)
2. `opencode/minimax-m2.1-free`
3. `opencode/glm-4.7-free`
4. `opencode/big-pickle` ← Free stealth model fallback

If a model fails due to availability or quota, immediately retry using the next model without changing the prompt or loop parameters.

### Failure triggers for fallback

Fallback if you encounter errors like:

- model disabled
- model not found
- insufficient quota
- quota exceeded
- payment required
- rate limit
- provider unavailable

---

## How to run the loop

### Attempt #1 (primary model)

Run:

ralph "<TASK PROMPT>

Success criteria:

- <list verifiable checks>
- Build passes
- Tests pass

Completion promise:
<promise>COMPLETE</promise>" \
 --agent opencode \
 --model opencode/kimi-k2.5-free \
 --completion-promise "COMPLETE" \
 --max-iterations 20

---

### Attempt #2 (fallback)

If attempt #1 fails due to model issues, rerun with:

--model opencode/minimax-m2.1-free

---

### Attempt #3 (fallback)

If attempt #2 fails:

--model opencode/glm-4.7-free

---

### Attempt #4 (final fallback)

If attempt #3 fails:

--model opencode/big-pickle

---

## Tasks mode (for large projects)

For multi-step execution:

ralph "<BIG TASK PROMPT>" \
 --agent opencode \
 --model opencode/kimi-k2.5-free \
 --tasks \
 --max-iterations 50

Fallback model order still applies.

---

## Plugin troubleshooting

If OpenCode plugins interfere with loop execution, rerun with:

--no-plugins

---

## Sanity check available Zen models

If free model availability changes, check:

https://opencode.ai/zen/v1/models

Update fallback order if needed.

---

## Safety notes

- Always run inside a git repo
- Set iteration limits to avoid runaway loops
- Ensure prompts contain verifiable success criteria
- Review diffs before merging autonomous changes

---

## Example usage

Fix failing TypeScript errors:

ralph "Fix all TypeScript errors in the repo.

Success criteria:

- tsc passes
- Build succeeds

Completion promise:
<promise>COMPLETE</promise>" \
 --agent opencode \
 --model opencode/kimi-k2.5-free \
 --completion-promise "COMPLETE" \
 --max-iterations 20

Related Skills

exa-web-search-free

3891
from openclaw/skills

Free AI search via Exa MCP. Web search for news/info, code search for docs/examples from GitHub/StackOverflow, company research for business intel. No API key needed.

Data & Research

opencode-acp-control

3891
from openclaw/skills

Control OpenCode directly via the Agent Client Protocol (ACP). Start sessions, send prompts, resume conversations, and manage OpenCode updates.

todokan-review-loop

3891
from openclaw/skills

Process Todokan task and thought boards with a review-loop workflow. Use when a task enters doing and the agent should pick it up, read latest comments, respond to the newest comment with a high-quality context-aware reply, add an execution update comment, and move the task back to done (Review). Use for recurring polling/cron automation with Todokan MCP.

doctorbot-healthcheck-free

3891
from openclaw/skills

🩺 Free Security & Health Audit. Your OpenClaw deserves a check-up. This skill performs a non-invasive scan to detect security risks, outdated software, and misconfigurations.

Amazon Listing Optimizer — Free Listing Analysis & Keyword Research

3891
from openclaw/skills

**Free alternative to Helium 10 ($97/mo) and Jungle Scout ($49/mo).**

unfreeze

3891
from openclaw/skills

Clear the freeze boundary set by freeze, allowing edits to all directories again. Use when you want to widen edit scope without ending the session. Use when: "unfreeze", "unlock edits", "remove freeze", "allow all edits".

freeze

3891
from openclaw/skills

Restrict file edits to a specific directory for the session. Blocks Edit and Write outside the allowed path. Use when debugging to prevent accidentally fixing unrelated code, or when scoping changes to one module. Use when: "freeze", "restrict edits", "only edit this folder", "lock down edits".

free-stock-global-quotes-news

3891
from openclaw/skills

global-quotes: free stock quotes and news. Use when: user asks for global stock price, quote, ticker symbol, or company news for US (e.g. AAPL), HK (0700.HK), or China A-shares (000001.SZ, 600000.SS). Uses free sources: Yahoo/Finnhub for US, Tencent/EastMoney/AkShare for CN/HK.

epic-free-games

3891
from openclaw/skills

Auto-claim free games from Epic Games Store. 2026 latest page adaptation with persistent login state, completes the full claim process (Get → Place Order → Confirm). 自动领取 Epic Games Store 每周免费游戏。2026年最新页面适配,支持持久化登录状态, 自动完成完整领取流程(获取 → 下订单 → 确认领取)。

freeride

3891
from openclaw/skills

Manages free AI models from OpenRouter for OpenClaw. Automatically ranks models by quality, configures fallbacks for rate-limit handling, and updates openclaw.json. Use when the user mentions free AI, OpenRouter, model switching, rate limits, or wants to reduce AI costs.

polymarket-simmer-fastloop

3891
from openclaw/skills

Trade Polymarket BTC/ETH/SOL 5/15-minute fast markets with momentum and order book filters.

polymarket-simmer-fastloop-sync-pulse

3891
from openclaw/skills

Trade Polymarket BTC/ETH/SOL 5-minute fast markets using a zero-delay Triple-Trigger strategy. Combines Binance momentum, NOFX OI/Netflow (free public API), and L2 Wall detection to choose between Trend Following and Mean Reversion. Pre-Caches market IDs to bypass the Simmer API blackout at market open.