agentleFS
b1rdmaniab1rdmania/ghostclaw/.claude/skills/run-ralph/SKILL.md

run-ralph

Skill91 starsChanged 7 months agoMITView on GitHub

Start, stop, or check status of a Ralph autonomous task loop. Runs a checklist of tasks overnight — one per fresh context window, commits after each, messages progress.

  • Reads credentials

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 6 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Read the task file and assess each unchecked task:

    line 44
  2. Distinctive:

    Add up the estimates and add 2 for retry buffer.

    line 61
  3. Distinctive:

    If the user just says "go" or "run it", use your estimate.

    line 71
  4. Distinctive:

    Write an IPC file:

    line 75
  5. Distinctive:

    When all tasks are checked off:

    line 131
  6. Distinctive:

    Max iterations hit: Run stops, bot tells you how many tasks completed

    line 140
  7. Very specific:

    Service restart: Run state is on disk (data/ralph/{id}/config.json), but the current iteration's scheduled task may need re-queuing

    line 141

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Run Ralph — Autonomous Task Loop

Runs a markdown task file (checkboxes) as an autonomous loop. Each task gets a fresh agent with a fresh context window. After completing a task, the agent commits, the orchestrator marks it done, and schedules the next. Messages you with progress between iterations.

Starting a Run

1. Create or identify the task file

The task file is standard markdown with checkboxes:

# Feature: User Authentication

- [ ] Create user model with email and password fields
  POST /api/users table with bcrypt hashing
  Unit tests for model validation
- [ ] Add login endpoint with JWT
  POST /api/login returns token
  Returns 401 on invalid credentials
- [ ] Add registration endpoint
  POST /api/register with email verification
  Duplicate email returns 409

Rules for good task files:

  • Each task must be completable in one agent session (one context window)
  • Include acceptance criteria as indented lines below each checkbox
  • Tasks run in order — put dependencies first
  • Already-checked items [x] are skipped

2. Get the chat JID

sqlite3 store/messages.db "SELECT jid FROM registered_groups WHERE folder = 'main' LIMIT 1;"

3. Estimate iterations

Read the task file and assess each unchecked task:

Simple tasks (1 iteration each):

  • Config changes, env vars, small edits
  • Adding a single file or endpoint
  • Running a command and reporting results

Medium tasks (2 iterations each):

  • New feature with tests
  • Integration with an external service
  • Refactoring across multiple files

Complex tasks (3 iterations each):

  • Multi-file architectural changes
  • New system with several moving parts
  • Anything with "and also" or multiple acceptance criteria

Add up the estimates and add 2 for retry buffer. Tell the user:

"You have N tasks. I'd estimate M iterations based on complexity:

  • 3 simple (3 iterations)
  • 2 medium (4 iterations)
  • 1 complex (3 iterations)
  • Total: 12 iterations (10 + 2 buffer)

Want me to run with that, or set a different limit?"

If the user just says "go" or "run it", use your estimate. Don't block on confirmation for small runs (under 10 iterations).

4. Start the run

Write an IPC file:

CHAT_JID="<main chat JID>"
TASK_FILE="/absolute/path/to/tasks.md"
WORK_DIR="/absolute/path/to/project"
MAX_ITER=<task count + 2>

cat > data/ipc/main/tasks/ralph_start_$(date +%s).json << EOF
{
  "type": "start_ralph",
  "taskFile": "$TASK_FILE",
  "workDir": "$WORK_DIR",
  "targetJid": "$CHAT_JID",
  "maxIterations": $MAX_ITER,
  "notifyProgress": true
}
EOF

The bot will message you: "Ralph run started: ralph-{id}"

4. Monitor progress

Between each iteration, the bot messages you:

Ralph [3/7]: Completed "Add login endpoint with JWT"

Check detailed progress:

cat data/ralph/ralph-{id}/progress.txt

Check run status:

cat data/ralph/ralph-{id}/config.json | python3 -m json.tool

Stopping a Run

CHAT_JID="<main chat JID>"
RUN_ID="ralph-{id}"

cat > data/ipc/main/tasks/ralph_stop_$(date +%s).json << EOF
{
  "type": "stop_ralph",
  "runId": "$RUN_ID",
  "targetJid": "$CHAT_JID"
}
EOF

The bot will message: "Ralph run stopped: ralph-{id}"

What happens on completion

When all tasks are checked off:

Ralph run ralph-{id} completed. 5/5 tasks done in 5 iterations.

The task file will have all checkboxes marked [x].

What happens on failure

  • Task fails once: Retried on the next iteration (same task, fresh context)
  • Task fails 3 times: Skipped, bot messages you, moves to next task
  • Max iterations hit: Run stops, bot tells you how many tasks completed
  • Service restart: Run state is on disk (data/ralph/{id}/config.json), but the current iteration's scheduled task may need re-queuing

Safety

  • Each iteration runs in isolated context (fresh agent, no carried-over confusion)
  • Max 10 iterations by default (configurable via maxIterations or RALPH_MAX_ITERATIONS in .env)
  • Tasks that fail 3 times are skipped (configurable via maxFailuresPerTask in config.json)
  • Agent is instructed to commit after each task — easy to roll back
  • You can stop the loop at any time via the stop IPC command
  • The task file is re-read each iteration — you can manually edit it between iterations

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.