ralph
Specification-first AI development powered by Ouroboros. Socratic questioning exposes hidden assumptions before writing code. Evolutionary loop (Interview → Seed → Execute → Evaluate → Evolve) runs until ontology converges. Ralph mode persists until verification passes — the boulder never stops. Use when user says "ralph", "ooo", "don't stop", "must complete", "until it works", "keep going", "interview me", or "stop prompting".
What this skill does
# 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.
---
## When to use this skill
- **Before writing any code** — expose hidden assumptions with Socratic interviewing
- **Long-running tasks** that need autonomous iteration until verified
- **Vague requirements** — crystallize them into an immutable spec (Ambiguity ≤ 0.2)
- **Tasks requiring guaranteed completion** — loop until verification passes
- **When stuck** — 5 lateral thinking personas break through stagnation
- **Drift detection** — measure how far execution has deviated from original spec
---
## Core Architecture: The 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
```
The first diamond is **Socratic**: diverge into questions, converge into ontological clarity.
The second diamond is **pragmatic**: diverge into design options, converge into verified delivery.
---
## 1. Commands (Full Reference)
| Command | Trigger Keywords | What It Does |
|---------|-----------------|--------------|
| `ooo interview` | `ooo interview`, `interview me`, `clarify requirements`, `socratic questioning` | Socratic questioning → expose hidden assumptions |
| `ooo seed` | `ooo seed`, `crystallize`, `generate seed`, `freeze requirements` | Crystallize interview into immutable spec (Ambiguity ≤ 0.2) |
| `ooo run` | `ooo run`, `execute seed`, `ouroboros run` | Execute via Double Diamond decomposition |
| `ooo evaluate` | `ooo evaluate`, `3-stage check`, `evaluate this`, `verify execution` | 3-stage gate: Mechanical → Semantic → Multi-Model Consensus |
| `ooo evolve` | `ooo evolve`, `evolutionary loop`, `iterate until converged` | Evolutionary loop until ontology converges (similarity ≥ 0.95) |
| `ooo unstuck` | `ooo unstuck`, `I'm stuck`, `think sideways`, `lateral thinking` | 5 lateral thinking personas when stuck |
| `ooo status` | `ooo status`, `am I drifting?`, `drift check`, `session status` | Drift detection + session tracking |
| `ooo ralph` | `ooo ralph`, `ralph`, `don't stop`, `must complete`, `keep going` | Persistent loop until verified — The boulder never stops |
| `ooo setup` | `ooo setup` | Register MCP server (one-time) |
| `ooo help` | `ooo help` | Full reference |
---
## 2. Interview → Specification Flow
### Philosophy: From Wonder to Ontology
> *Wonder → "How should I live?" → "What IS 'live'?" → Ontology* — Socrates
```
Wonder Ontology
💡 🔬
"What do I want?" → "What IS the thing I want?"
"Build a task CLI" → "What IS a task? What IS priority?"
"Fix the auth bug" → "Is this the root cause, or a symptom?"
```
### Step 1: Interview (expose hidden assumptions)
```
ooo interview "I want to build a task management CLI"
```
The Socratic Interviewer asks questions until **Ambiguity ≤ 0.2**.
**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
Constraint: 0.8 × 0.3 = 0.24
Success: 0.7 × 0.3 = 0.21
──────
Clarity = 0.81
Ambiguity = 1 − 0.81 = 0.19 ≤ 0.2 → ✓ Ready for Seed
```
### Step 2: Seed (crystallize into immutable spec)
```
ooo seed
```
Generates YAML specification:
```yaml
goal: Build a CLI task management tool
constraints:
- Python 3.14+
- No external database
- SQLite for persistence
acceptance_criteria:
- Tasks can be created
- Tasks can be listed
- Tasks can be marked complete
ontology_schema:
name: TaskManager
fields:
- name: tasks
type: array
- name: title
type: string
```
### Step 3: Run (execute via Double Diamond)
```
ooo run seed.yaml
ooo run # uses seed from conversation context
```
### Step 4: Evaluate (3-stage verification)
```
ooo evaluate <session_id>
```
| Stage | Cost | What It Checks |
|-------|------|----------------|
| **Mechanical** | $0 | Lint, build, tests, coverage |
| **Semantic** | Standard | AC compliance, goal alignment, drift score |
| **Consensus** | Frontier (optional) | Multi-model vote, majority ratio |
Drift thresholds:
- `0.0 – 0.15` — Excellent: on track
- `0.15 – 0.30` — Acceptable: monitor closely
- `0.30+` — Exceeded: course correction needed
---
## 3. Ralph — Persistent Loop Until Verified
```
ooo ralph "fix all failing tests"
/ouroboros:ralph "fix all failing tests"
```
**"The boulder never stops."**
Each failure is data for the next attempt. Only complete success or max iterations stops it.
### How Ralph Works
```
┌─────────────────────────────────┐
│ 1. EXECUTE (parallel) │
│ Independent tasks │
│ concurrent scheduling │
├─────────────────────────────────┤
│ 2. VERIFY │
│ Check completion │
│ Validate tests pass │
│ Measure drift vs seed │
├─────────────────────────────────┤
│ 3. LOOP (if failed) │
│ Analyze failure │
│ Fix identified issues │
│ Repeat from step 1 │
├─────────────────────────────────┤
│ 4. PERSIST (checkpoint) │
│ .omc/state/ralph-state.json │
│ Resume after interruption │
└─────────────────────────────────┘
```
### State File
Create `.omc/state/ralph-state.json` on start:
```json
{
"mode": "ralph",
"session_id": "<uuid>",
"request": "<user request>",
"status": "running",
"iteration": 0,
"max_iterations": 10,
"last_checkpoint": null,
"verification_history": []
}
```
### Loop Logic
```
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>
})
if verification.passed:
save_checkpoint("complete")
break
iteration += 1
save_checkpoint("iteration_{iteration}")
```
### Progress Report Format
```
[Ralph Iteration 1/10]
Executing in parallel...
Verification: FAILED
Score: 0.65
Issues:
- 3 tests still failing
- Type errors in src/api.py
The boulder never stops. Continuing...
[Ralph Iteration 3/10]
Executing in parallel...
Verification: PASSED
Score: 1.0
Ralph 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)
```
### Cancellation
| Action | Command |
|--------|---------|
| Save checkpoint & exit | `/ouroboros:cancel` |
| Force clear all state | `/ouroboros:cancel --force` |
| Resume after interruption | `ooo ralph continue` or `ralph continue` |
---
## 4. Evolutionary Loop (Evolve)
```
ooo evolve "build a task management CLI"
ooo evolve "build a task management CLI" --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 ontology converges (similarity ≥ 0.95) or max 30 generations
```
### Convergence Formula
```
Similarity = 0.5 × name_overlap + 0.3 × type_match + 0.2 × exact_match
ThresRelated in Writing & Docs
jax-development
IncludedUse this skill when the user is writing, debugging, profiling, refactoring, reviewing, benchmarking, parallelising, exporting, or explaining JAX code, or when they mention JAX, jax.numpy, jit, grad, value_and_grad, vmap, scan, lax, random keys, pytrees, jax.Array, sharding, Mesh, PartitionSpec, NamedSharding, pmap, shard_map, Pallas, XLA, StableHLO, checkify, profiler, or the JAX repo. It helps turn NumPy or PyTorch-style code into pure functional JAX, fix tracer/control-flow/shape/PRNG bugs, remove recompiles and host-device syncs, choose transforms and sharding strategies, inspect jaxpr/lowering/IR, and benchmark compiled code correctly.
nature-article-writer
IncludedDrafts, rewrites, diagnostically critiques, and style-calibrates primary research manuscripts for Nature and Nature Portfolio journals. Use when the user wants a Nature-style title, summary paragraph or abstract, introduction, results, discussion, methods, figure legends, presubmission enquiry, cover letter, reviewer response, or when a scientific draft sounds generic, jargon-heavy, structurally weak, or AI-ish and needs precise, broad-reader-friendly prose without inventing data, analyses, or references. Best for primary research articles and letters rather than reviews or press releases unless explicitly adapting one.
deckrd
IncludedDocument-driven framework that derives requirements, specifications, implementation plans, and executable tasks from goals through structured AI dialogue. Use when user says "write requirements", "create spec", "plan implementation", "derive tasks", "structure this feature", "break down into tasks", or "document this module". Also use for reverse engineering existing code into docs (/deckrd rev). Do NOT use for direct code writing — use /deckrd-coder after tasks are generated. Do NOT use when the user only wants to run or fix existing code without planning.
clinical-decision-support
IncludedGenerate professional clinical decision support (CDS) documents for pharmaceutical and clinical research settings, including patient cohort analyses (biomarker-stratified with outcomes) and treatment recommendation reports (evidence-based guidelines with decision algorithms). Supports GRADE evidence grading, statistical analysis (hazard ratios, survival curves, waterfall plots), biomarker integration, and regulatory compliance. Outputs publication-ready LaTeX/PDF format optimized for drug development, clinical research, and evidence synthesis.
handling-sf-data
IncludedSalesforce data operations with 130-point scoring. Use this skill to create, update, delete, bulk import/export, generate test data, and clean up org records using sf CLI and anonymous Apex. TRIGGER when: user creates test data, performs bulk import/export, uses sf data CLI commands, needs data factory patterns for Apex tests, or needs to seed/clean records in a Salesforce org. DO NOT TRIGGER when: SOQL query writing only (use querying-soql), Apex test execution (use running-apex-tests), or metadata deployment (use deploying-metadata).
accelint-ac-to-playwright
IncludedConvert and validate acceptance criteria for Playwright test automation. Use when user asks to (1) review/evaluate/check if AC are ready for automation, (2) assess if AC can be converted as-is, (3) validate AC quality for Playwright, (4) turn AC into tests, (5) generate tests from acceptance criteria, (6) convert .md bullets or .feature Gherkin files to Playwright specs, (7) create test automation from requirements. Handles both bullet-style markdown and Gherkin syntax with JSON test plan generation and validation.