Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
akillness avatar

Ralph

  • 29 installs
  • 40 repo stars
  • Updated August 4, 2026
  • akillness/skills-template

Ralph (Ouroboros) is an agent skill for specification-first AI development that interviews vague ideas into immutable specs, then executes and loops autonomously until verification passes.

About

Ralph (Ouroboros) is a skill for specification-first AI development. A developer uses it to crystallize vague requirements into an immutable spec via Socratic interviewing before writing code, then execute and loop autonomously until verification passes. It provides ooo commands, Nine Minds lateral-thinking agents, drift detection, and a persistent Ralph loop with state files across Claude Code, Codex CLI, Gemini CLI, and OpenCode.

  • Socratic interviewing crystallizes an immutable spec at Ambiguity <= 0.2
  • Persistent Ralph loop with state files runs until verification passes
  • Nine Minds personas break stagnation across four agent platforms

Ralph by the numbers

  • 29 all-time installs (skills.sh)
  • Ranked #9,417 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
At a glance

ralph capabilities & compatibility

Capabilities
spec first development · socratic interview · autonomous loop · drift detection · orchestration
Use cases
planning · orchestration · code review
From the docs

What ralph says it does

Socratic interviewing crystallizes vague ideas into immutable specs (Ambiguity ≤ 0.2) before any code is written.
SKILL.md
Ralph mode loops with state persistence until verification passes — the boulder never stops.
SKILL.md
Stop prompting. Start specifying.
SKILL.md
npx skills add https://github.com/akillness/skills-template --skill ralph

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs29
repo stars40
Last updatedAugust 4, 2026
Repositoryakillness/skills-template

What it does

Run Socratic interviewing to reach an immutable spec (Ambiguity <= 0.2), then execute a Double Diamond run and loop autonomously with state persistence until verification passes.

Who is it for?

Turning vague requirements into an immutable spec and looping autonomous agents until a task is verified complete.

Skip if: Quick one-off edits where full spec-first interviewing and looping is overkill.

When should I use this skill?

You say ralph, ooo, stop prompting, start specifying, or need guaranteed completion before writing code.

What you get

A verified deliverable produced from an immutable spec with drift measured against it.

  • Immutable YAML seed spec
  • Executed and verified implementation
  • Ralph loop state files and progress reports

By the numbers

  • Nine Minds agents
  • Ambiguity <= 0.2 gate
  • Convergence at Similarity >= 0.95

Files

SKILL.mdMarkdownGitHub ↗

ralph (Ouroboros) — Specification-First AI Development

Stop prompting. Start specifying.

>

"The beginning is the end, and the end is the beginning."
The serpent doesn't repeat — it evolves.

>

Most AI coding fails at the input, not the output. Ouroboros fixes the human, not the machine.

---

When to use this skill

  • Before writing any code — expose hidden assumptions with Socratic interviewing (Ambiguity ≤ 0.2 required)
  • Vague requirements — crystallize into an immutable YAML seed spec before touching the keyboard
  • Long-running tasks needing autonomous iteration until verified completion
  • Guaranteed completion tasks — Ralph loop persists across session boundaries until verification passes
  • When stuck — Nine Minds lateral thinking personas break through stagnation
  • Drift detection — measure deviation from original seed and course-correct before it's too late
  • Ontology convergence — evolutionary loop runs until consecutive generations are ≥ 0.95 similar

---

Core Architecture: The Ouroboros Loop

    Interview → Seed → Execute → Evaluate
        ↑                           ↓
        └──── Evolutionary Loop ────┘

Each cycle evolves, not repeats. Evaluation output feeds back as input for the next generation until the system converges.

Double Diamond

    ◇ Wonder          ◇ Design
   ╱  (diverge)      ╱  (diverge)
  ╱    explore      ╱    create
 ╱                 ╱
◆ ──────────── ◆ ──────────── ◆
 ╲                 ╲
  ╲    define       ╲    deliver
   ╲  (converge)     ╲  (converge)
    ◇ Ontology        ◇ Evaluation

First diamond (Socratic): diverge into questions → converge into ontological clarity. Second diamond (Pragmatic): diverge into design options → converge into verified delivery.

You cannot design what you haven't understood. The first diamond is a prerequisite for the second.

---

Commands

CommandTriggersWhat It Does
ooo interviewooo interview, interview me, clarify requirements, socratic questioningSocratic questioning until Ambiguity ≤ 0.2
ooo seedooo seed, crystallize, generate seed, freeze requirementsCrystallize into immutable YAML spec
ooo runooo run, execute seed, ouroboros runExecute via Double Diamond
ooo evaluateooo evaluate, 3-stage check, evaluate this3-stage gate: Mechanical → Semantic → Consensus
ooo evolveooo evolve, evolutionary loop, iterate until convergedEvolutionary loop until Similarity ≥ 0.95
ooo unstuckooo unstuck, I'm stuck, think sideways, lateral thinkingNine Minds lateral thinking personas
ooo statusooo status, am I drifting?, drift checkDrift detection + session tracking
ooo ralphooo ralph, ralph-ooo, don't stop, must complete, keep goingPersistent loop until verified
ooo setupooo setupRegister MCP server (one-time)
ooo cancel/ouroboros:cancel, /ralph-ooo:cancelSave checkpoint and exit

---

Phase 1: Interview — From Wonder to Ontology

Wonder → "How should I live?" → "What IS 'live'?" → Ontology — Socrates

The Socratic Interviewer asks questions until Ambiguity ≤ 0.2. This is the gate between vague desire and executable spec.

ooo interview "I want to build a task management CLI"

Ambiguity Formula

Ambiguity = 1 − Σ(clarityᵢ × weightᵢ)

Greenfield: Goal(40%) + Constraint(30%) + Success(30%)
Brownfield: Goal(35%) + Constraint(25%) + Success(25%) + Context(15%)

Threshold: Ambiguity ≤ 0.2 → ready for Seed

Example scoring:

Goal:       0.9 × 0.4 = 0.36   # "Build a CLI task manager" — clear
Constraint: 0.8 × 0.3 = 0.24   # "Python 3.14+, SQLite only" — defined
Success:    0.7 × 0.3 = 0.21   # "Tasks create/list/complete" — measurable
                      ──────
Clarity             = 0.81
Ambiguity = 1 − 0.81 = 0.19 ≤ 0.2 → ✓ Ready for Seed

Why 0.2? At 80% weighted clarity, remaining unknowns are small enough for code-level decisions to resolve. Above that threshold, you're still guessing at architecture.

---

Phase 2: Seed — Immutable Specification

ooo seed

Generates YAML spec locked from interview answers:

goal: Build a CLI task management tool
constraints:
  - Python 3.14+
  - No external database
  - SQLite for persistence
acceptance_criteria:
  - Tasks can be created with title and priority
  - Tasks can be listed with status filter
  - Tasks can be marked complete
ontology_schema:
  name: TaskManager
  fields:
    - name: tasks
      type: array
    - name: title
      type: string
    - name: priority
      type: enum[low, medium, high]
    - name: status
      type: enum[open, done]

The seed is immutable. Once generated, it is the ground truth. Drift is measured against it.

---

Phase 3: Execute — Double Diamond Run

ooo run seed.yaml
ooo run   # uses seed from conversation context

Executes the four phases: 1. Discover — research existing patterns, constraints, precedents 2. Define — ontological clarity, edge cases, decision boundaries 3. Design — architecture, component breakdown, interface contracts 4. Deliver — implementation, tests, documentation

---

Phase 4: Evaluate — 3-Stage Verification Gate

ooo evaluate <session_id>
StageCostWhat It Checks
MechanicalFreeLint, build, tests, coverage, type checks
SemanticStandardAC compliance, goal alignment, drift score
ConsensusFrontier (optional)Multi-model vote, majority ratio

Drift Thresholds

ScoreStatusAction
0.0 – 0.15ExcellentOn track
0.15 – 0.30AcceptableMonitor closely
0.30+ExceededCourse correction required

Drift = weighted deviation from seed across three axes: Goal(50%) + Constraint(30%) + Ontology(20%).

---

Phase 5: Evolve — Ontological Convergence

ooo evolve "build a task management CLI"
ooo evolve "topic" --no-execute   # ontology-only fast mode

Flow

Gen 1: Interview → Seed(O₁) → Execute → Evaluate
Gen 2: Wonder → Reflect → Seed(O₂) → Execute → Evaluate
Gen 3: Wonder → Reflect → Seed(O₃) → Execute → Evaluate
...until Similarity ≥ 0.95 or 30 generations

Convergence Formula

Similarity = 0.5 × name_overlap + 0.3 × type_match + 0.2 × exact_match
Threshold: Similarity ≥ 0.95 → CONVERGED

Gen 1: {Task, Priority, Status}                     → baseline
Gen 2: {Task, Priority, Status, DueDate}            → similarity 0.78 → CONTINUE
Gen 3: {Task, Priority, Status, DueDate}            → similarity 1.00 → CONVERGED ✓

Stagnation Detection

SignalConditionResponse
StagnationSimilarity ≥ 0.95 for 3 consecutive gensStop — converged
OscillationGen N ≈ Gen N-2 (period-2 cycle)Invoke contrarian persona
Repetitive feedback≥ 70% question overlap across 3 gensInvoke researcher persona
Hard cap30 generations reachedStop — safety valve

---

Ralph — Persistent Loop Until Verified

ooo ralph "fix all failing tests"
ooo ralph "implement the payment module"

"The boulder never stops." Each failure is data for the next attempt. Only verified success or max iterations stops it.

Loop Architecture

┌─────────────────────────────────────┐
│  1. EXECUTE (parallel agents)       │
│     Fire independent sub-tasks      │
│     concurrently via Agent tool     │
├─────────────────────────────────────┤
│  2. VERIFY                          │
│     Check acceptance criteria       │
│     Run tests, lint, typecheck      │
│     Measure drift vs seed           │
├─────────────────────────────────────┤
│  3. LOOP (if failed)                │
│     Analyze failure evidence        │
│     Fix identified issues           │
│     Increment iteration counter     │
│     Repeat from step 1              │
├─────────────────────────────────────┤
│  4. PERSIST (each iteration)        │
│     .omc/state/ralph-ooo-state.json │
│     Resume after interruption       │
└─────────────────────────────────────┘

State File Schema

Create .omc/state/ralph-ooo-state.json on start:

{
  "mode": "ralph-ooo",
  "session_id": "<uuid>",
  "request": "<user request>",
  "status": "running",
  "iteration": 0,
  "max_iterations": 10,
  "last_checkpoint": null,
  "seed_path": null,
  "verification_history": []
}

Loop Logic (Pseudocode)

while iteration < max_iterations:
    result = execute_parallel(request, context)
    verification = verify_result(result, acceptance_criteria)
    state.verification_history.append({
        "iteration": iteration,
        "passed": verification.passed,
        "score": verification.score,
        "timestamp": now()
    })
    save_checkpoint(f"iteration_{iteration}")
    if verification.passed:
        save_checkpoint("complete")
        break
    iteration += 1

Progress Report Format

[Ralph-OOO Iteration 1/10]
Executing in parallel...

Verification: FAILED
Score: 0.65
Issues:
  - 3 tests still failing
  - Type error in src/api.py:42

The boulder never stops. Continuing...

[Ralph-OOO Iteration 3/10]
Verification: PASSED ✓
Score: 1.0

Ralph-OOO COMPLETE
==================
Request: Fix all failing tests
Duration: 8m 32s
Iterations: 3
Verification History:
  - Iteration 1: FAILED (0.65)
  - Iteration 2: FAILED (0.85)
  - Iteration 3: PASSED (1.0)

Completion Promise (Codex / Gemini)

<promise>DONE</promise>

Default promise: DONE | Default max iterations: 10

Cancellation

ActionCommand
Save checkpoint & exit/ouroboros:cancel or /ralph-ooo:cancel
Force clear all state/ouroboros:cancel --force
Resume after interruptionooo ralph continue

---

The Nine Minds

Loaded on-demand — never preloaded. Each mind has a single core question it cannot stop asking.

AgentRoleCore Question
Socratic InterviewerQuestions-only. Never builds."What are you assuming?"
OntologistFinds essence, not symptoms"What IS this, really?"
Seed ArchitectCrystallizes specs from dialogue"Is this complete and unambiguous?"
Evaluator3-stage verification"Did we build the right thing?"
ContrarianChallenges every assumption"What if the opposite were true?"
HackerFinds unconventional paths"What constraints are actually real?"
SimplifierRemoves complexity"What's the simplest thing that could work?"
ResearcherStops coding, starts investigating"What evidence do we actually have?"
ArchitectIdentifies structural causes"If we started over, would we build it this way?"

See references/nine-minds.md for full agent profiles.

---

Unstuck — Lateral Thinking

When blocked after repeated failures:

ooo unstuck                  # auto-select based on context
ooo unstuck simplifier       # cut scope to MVP
ooo unstuck hacker           # make it work first, elegance later
ooo unstuck contrarian       # challenge all assumptions
ooo unstuck researcher       # stop coding, find missing information
ooo unstuck architect        # restructure the approach entirely

Decision guide:

  • Repeated similar failures → contrarian (challenge assumptions)
  • Too many options / paralysis → simplifier (reduce scope)
  • Missing information / unclear root cause → researcher (seek evidence)
  • Analysis paralysis / need momentum → hacker (just make it work)
  • Structural issues / wrong foundation → architect (redesign)

---

Quick Reference

ActionCommand
Socratic interviewooo interview "topic"
Generate specooo seed
Execute specooo run [seed.yaml]
3-stage evaluateooo evaluate <session_id>
Evolve until convergedooo evolve "topic"
Persistent loopooo ralph "task"
Break stagnationooo unstuck [persona]
Check driftooo status [session_id]
First-time setupooo setup
Cancel/ouroboros:cancel
Force cancel/ouroboros:cancel --force
Resumeooo ralph continue

---

Available Scripts

Run from the skill directory:

ScriptPurpose
scripts/setup-codex-hook.shConfigure Codex CLI for ralph-ooo (developer_instructions + prompts)
scripts/setup-gemini-hook.shConfigure Gemini CLI AfterAgent hook for loop continuation
scripts/ooo-state.shManage .omc/state/ralph-ooo-state.json (init/status/checkpoint/reset/resume)

---

Platform Support Matrix

PlatformSupportMechanismooo CommandsAuto Loop
Claude CodeFullSkills system + hooksAll ooo commandsVia hooks
Codex CLIAdaptedbash loop + /prompts:ralph-oooVia conversationManual state file
Gemini CLINativeAfterAgent hookAll ooo commandsVia hook
OpenCodeNativeSkills systemAll ooo commandsVia loop

---

Installation

# Claude Code (via oh-my-skills)
npx skills add https://github.com/akillness/oh-my-skills --skill ralph-ooo

# Codex CLI setup
bash .agent-skills/ralph-ooo/scripts/setup-codex-hook.sh

# Gemini CLI setup
bash .agent-skills/ralph-ooo/scripts/setup-gemini-hook.sh

# Ouroboros native plugin
claude plugin marketplace add Q00/ouroboros
claude plugin install ouroboros@ouroboros
ooo setup

---

References

Detailed documentation in references/:

FileContents
references/ouroboros-commands.mdFull ooo command syntax, parameters, output formats, state schemas
references/nine-minds.mdAll 9 agent profiles, core questions, when to invoke, unstuck guide
references/platform-setup.mdPer-platform setup, hooks.json, AfterAgent config, Gemini bug workarounds

---

Source: Q00/ouroboros — MIT License

Related skills

FAQ

What ambiguity threshold gates the spec?

Socratic interviewing continues until Ambiguity <= 0.2 before a seed spec is generated.

Which platforms are supported?

Claude Code (full), Codex CLI (adapted), Gemini CLI (native), and OpenCode (native).

AI & Agent Buildingagentsautomation

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.