Skip to content
Back to skills

References

ASecurity

"Ralphing" (Retry And Loop Persistently until Happy) is a brutish but highly effective architectural technique for running autonomous AI agents. Instead of maintaining a massive conversational context window that degrades over time, Ralphing kills the agent's memory after every single action. It relies entirely on physical disk artifacts (`PRD.md`, `progress.txt`).

  • 85 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 8, 2026
ai-agentsgobash

Works with

  • cli

Security analysis

A100/100

Scanned October 8, 2026

npx -y skills add ThomasMoreAI/legal-skills-open --skill references --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of References?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for References
[![Security: A β€” Skills Directory](https://www.skillsdirectory.com/api/skills/thomasmoreai-references/badge)](https://www.skillsdirectory.com/skills/thomasmoreai-references)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

SKILL.md
# πŸ” The Ralphing Skill (R.A.L.P.H. Pattern)

"Ralphing" (Retry And Loop Persistently until Happy) is a brutish but highly effective architectural technique for running autonomous AI agents. Instead of maintaining a massive conversational context window that degrades over time, Ralphing kills the agent's memory after every single action. It relies entirely on physical disk artifacts (`PRD.md`, `progress.txt`).

## The Ralphing Directives (Strict Rules for the Agent)
1. **Amnesia Protocol:** Assume you were just born. Your very first action MUST be to read `PRD.md` to discover your current state.
2. **Micro-Tasking:** Find the *first* incomplete task (marked with `[ ]`) in `PRD.md`. Do **NOT** attempt to complete the whole file. Execute *only* that single task.
3. **Artifact Creation:** Write your analysis to the specific local file requested by the task. 
4. **State Update:** Update `PRD.md` by changing the `[ ]` to `[x]`. 
5. **Progress Logging:** Append a one-sentence summary to `progress.txt`.
6. **Clean Exit:** Exit immediately without asking for user input. If a document is unreadable, mark it `[FAILED]`, log the error, and exit.

## The Orchestrator Script (`ralph_loop.sh`)
*Run this bash script to execute the agent autonomously.*

```bash
#!/bin/bash
MAX_ITERATIONS=15
CURRENT_ITER=0

echo "Initiating the Ralph Loop. May the infinite probability drive be with us."

while [ $CURRENT_ITER -lt $MAX_ITERATIONS ]; do
    CURRENT_ITER=$((CURRENT_ITER + 1))
    echo "Starting Iteration $CURRENT_ITER..."

    # Launch the agent in a fresh, isolated state.
    agent-cli "scan case files" --headless

    EXIT_CODE=$?

    if [ $EXIT_CODE -eq 0 ]; then
        echo "Agent completed a cycle successfully."
        if ! grep -q "\[ \]" PRD.md; then
            echo "All tasks complete. The goldfish has built a castle."
            exit 0
        fi
    else
        echo "Agent hit a critical failure. Check progress.txt."
        exit 1
    fi
done
echo "Max iterations reached."

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.