GitHub Specify, Ralph Loops, and Lisa Planning
GitHub Specify, Ralph Loops, and Lisa Planning: Proof-Driven Development with AI Agents
- The Ralph loop is three phases, two prompts, one outer loop. Phase 1 (human + LLM conversation) defines Jobs to Be Done (JTBD) and writes one spec file per Topic of Concern (`specs/FILENAME.md`). Phase 2 (PLANNING mode) does gap analysis against the code and writes a prioritised `IMPLEMENTATION_PLAN.md` — no implementation. Phase 3 (BUILDING mode) picks the most important task, implements it, runs backpressure (tests/lint), commits, updates the plan, and exits — the outer bash loop immediately restarts with a fresh context
- "Specify" is Phase 1 — not a product feature. GitHub has no product called "Specify." In the Ralph/Lisa context, "Specify" is the requirement-writing phase that produces `specs/*.md`. In GitHub Copilot Agent mode, the equivalent is a well-written issue with detailed body, custom `.instructions.md` files, and AGENTS.md — Copilot assigns the issue, generates a plan, opens a draft PR, and iterates without human intervention between cycles
- Spec format: one Markdown file per Topic of Concern. A topic is something describable in one sentence without "and." Specs contain what-not-how. Example topics for a new research fetcher: "YouTube transcript retrieval," "transcript deduplication," "config schema validation." Each spec → multiple tasks in the plan
- Context management is the core engineering discipline. Usable context is ~176K of the advertised 200K tokens; Ralph targets 40–60% utilisation ("smart zone"). One task per loop keeps context tight. The main agent acts as a scheduler; subagents handle expensive work (file reads, test runs). Each iteration deterministically loads the same three artefacts: `PROMPT.md` + `AGENTS.md` + `specs/*`
- Back-pressure (tests) is what makes the loop proof-driven. The loop cannot advance until tests, lint, and typechecks pass. Without a stable binary fitness signal the loop degenerates. Frank Bria's implementation requires both "completion indicators" AND an explicit EXIT_SIGNAL — preventing premature exit. Ian Reppel characterises Ralph as a (1,1) evolutionary strategy: single parent, LLM-generated mutation, test suite as fitness function
- Lisa = persistent memory + planning orchestration, Ralph = brute execution. Lisa Simpson (analytical, memory-keeping) contrasts with Ralph Wiggum (persistent, naive). In practice: the PLANNING mode prompt *is* Lisa. In more sophisticated implementations, Lisa is a separate agent layer with a knowledge graph (Graphiti + Neo4j via MCP) that survives session restarts — solving the "Groundhog Day Problem" where stateless Ralph loops forget everything overnight. Lisa uses Claude Code hooks (session-start, session-stop, user-prompt-submit) to extract and store timestamped facts, decisions, and relationships about the codebase
- GitHub Copilot Agent mode is spec-first by design. Copilot's coding agent (2025): assign an issue → agent reads codebase + AGENTS.md + Agent Skills → plans → implements → opens draft PR. Agent Skills (`.github/skills/` Markdown files, announced December 2025) are invokable patterns that Copilot applies automatically. This repo's `AGENTS.md` + `.github/skills/` setup is already Copilot Agent-compatible
- Active inference connection is structural, not merely analogical. A Ralph loop minimises prediction error against a spec-as-prior: the agent's generative model predicts "tests pass"; the fitness signal is the actual test result; iteration continues until prediction error reaches zero (all tests green). This is formally identical to active inference minimising free energy — each loop iteration is a perception–action cycle where the "perception" is test output and the "action" is code edit. Proof completion = surprise minimisation to zero
Research Question
What is "Specify" in the context of GitHub-integrated AI development workflows, how does the Ralph loop implement proof-driven development in practice, and what role does Lisa planning play in the specification-to-implementation pipeline?
Findings
Executive Summary
The Ralph Wiggum Technique is a proof-driven autonomous coding loop coined by Geoffrey Huntley (ghuntley.com/ralph/), published July 2025 and going viral December 2025. At its simplest it is a bash while loop that repeatedly feeds a prompt and project context to an LLM agent until a proof criterion (tests passing) is met. The workflow has three phases — Specify (write scoped requirements into specs/*.md), Plan (gap-analysis agent produces IMPLEMENTATION_PLAN.md), and Build (implementation agent executes one task per loop iteration, runs backpressure, commits, repeats). "Lisa" is the planning archetype: methodical, memory-keeping, orchestrating — contrasted with Ralph's brute persistence. GitHub Copilot Agent mode maps onto this pattern through issues, AGENTS.md, and Agent Skills. This repository already follows Ralph-compatible conventions; a thin layer of specs/ files and IMPLEMENTATION_PLAN.md would complete the setup.
Key Findings
-
The Ralph loop is three phases, two prompts, one outer loop. Phase 1 (human + LLM conversation) defines Jobs to Be Done (JTBD) and writes one spec file per Topic of Concern (
specs/FILENAME.md). Phase 2 (PLANNING mode) does gap analysis against the code and writes a prioritisedIMPLEMENTATION_PLAN.md— no implementation. Phase 3 (BUILDING mode) picks the most important task, implements it, runs backpressure (tests/lint), commits, updates the plan, and exits — the outer bash loop immediately restarts with a fresh context. -
"Specify" is Phase 1 — not a product feature. GitHub has no product called "Specify." In the Ralph/Lisa context, "Specify" is the requirement-writing phase that produces
specs/*.md. In GitHub Copilot Agent mode, the equivalent is a well-written issue with detailed body, custom.instructions.mdfiles, and AGENTS.md — Copilot assigns the issue, generates a plan, opens a draft PR, and iterates without human intervention between cycles. -
Spec format: one Markdown file per Topic of Concern. A topic is something describable in one sentence without "and." Specs contain what-not-how. Example topics for a new research fetcher: "YouTube transcript retrieval," "transcript deduplication," "config schema validation." Each spec → multiple tasks in the plan.
-
Context management is the core engineering discipline. Usable context is ~176K of the advertised 200K tokens; Ralph targets 40–60% utilisation ("smart zone"). One task per loop keeps context tight. The main agent acts as a scheduler; subagents handle expensive work (file reads, test runs). Each iteration deterministically loads the same three artefacts:
PROMPT.md+AGENTS.md+specs/*. -
Back-pressure (tests) is what makes the loop proof-driven. The loop cannot advance until tests, lint, and typechecks pass. Without a stable binary fitness signal the loop degenerates. Frank Bria's implementation requires both "completion indicators" AND an explicit EXIT_SIGNAL — preventing premature exit. Ian Reppel characterises Ralph as a (1,1) evolutionary strategy: single parent, LLM-generated mutation, test suite as fitness function.
-
Lisa = persistent memory + planning orchestration, Ralph = brute execution. Lisa Simpson (analytical, memory-keeping) contrasts with Ralph Wiggum (persistent, naive). In practice: the PLANNING mode prompt is Lisa. In more sophisticated implementations, Lisa is a separate agent layer with a knowledge graph (Graphiti + Neo4j via MCP) that survives session restarts — solving the "Groundhog Day Problem" where stateless Ralph loops forget everything overnight. Lisa uses Claude Code hooks (session-start, session-stop, user-prompt-submit) to extract and store timestamped facts, decisions, and relationships about the codebase.
-
GitHub Copilot Agent mode is spec-first by design. Copilot's coding agent (2025): assign an issue → agent reads codebase + AGENTS.md + Agent Skills → plans → implements → opens draft PR. Agent Skills (
.github/skills/Markdown files, announced December 2025) are invokable patterns that Copilot applies automatically. This repo'sAGENTS.md+.github/skills/setup is already Copilot Agent-compatible. -
Active inference connection is structural, not merely analogical. A Ralph loop minimises prediction error against a spec-as-prior: the agent's generative model predicts "tests pass"; the fitness signal is the actual test result; iteration continues until prediction error reaches zero (all tests green). This is formally identical to active inference minimising free energy — each loop iteration is a perception–action cycle where the "perception" is test output and the "action" is code edit. Proof completion = surprise minimisation to zero.
-
Security boundary is mandatory.
--dangerously-skip-permissions(or equivalent) is required for headless operation. Without a sandbox (Docker, Fly Sprites, E2B), a runaway Ralph loop has access to credentials, SSH keys, and browser cookies. Escape hatches: Ctrl+C,git reset --hard, plan regeneration. -
This repo can adopt the Ralph pattern with minimal changes. Existing foundations:
AGENTS.md(operational guide already loaded),src/(code),tests/(backpressure),pyproject.toml(validation commands). Gaps: nospecs/folder, noIMPLEMENTATION_PLAN.md, noloop.sh. The BACKLOG.md items are structurally equivalent to implementation plan tasks; the Research backlog items serve as specs. The main blocker for a full Ralph loop is headless Claude Code CLI access from CI.
Assumptions
- Assumption: Geoffrey Huntley coined the Ralph Wiggum Technique. Justification: ghuntley.com/ralph/ is cited by all downstream sources as the originating post; Huntley is credited as the inventor in every secondary source found.
- Assumption: "Specify" in the research question refers to Phase 1 of the Ralph workflow, not a GitHub product. Justification: Web search found no GitHub product called "Specify"; the ralph-playbook and ghuntley.com use "Specify" as a phase name. The Copilot "issue assignment" workflow is the closest product analogue.
- Assumption: Lisa as a persistent planning agent is community-built, not an official Huntley deliverable. Justification: ghuntley.com does not document Lisa; Lisa implementations (kenziecreative/lisa-simpson-claudecode, dev.to/tonycasey) are community responses to a real gap Huntley identifies (session statefulness).
Analysis
The workflow is a funnel, not a loop. The outer structure is: conversation (human-guided) → PLANNING pass (bounded, usually 1–2 iterations) → BUILDING loop (unbounded, terminates on proof). Only the BUILDING phase is truly indefinite. This distinction matters for tooling: PLANNING can be triggered once per feature; BUILDING runs until done.
Specs are the bottleneck, not the loop. Ralph cannot converge without precise, binary-testable specs. Vague or open-ended requirements produce loops that never reach proof completion. The rate-limiting investment is spec quality, not loop configuration. This applies directly to this repo: the research backlog items describe what to investigate but not what constitutes done. A fetcher spec would need to include: protocol contract, error behaviour, test coverage targets, config schema constraints.
Lisa's Groundhog Day solution is MCP-native. Lisa uses Claude Code hooks + MCP (Graphiti server) to extract and persist a knowledge graph across sessions. This is architecturally compatible with the MCP server stack this repo already configures. The memory MCP server configured in .mcp.json provides similar (lighter) cross-session memory via a knowledge graph without the full Graphiti/Neo4j infrastructure.
Evolutionary framing clarifies failure modes. A (1,1) strategy with no fitness signal degenerates. The practical corollary: deploy no Ralph loop without a test suite. For this repo, make check + pytest are the existing fitness signals. Any new feature worked on via Ralph-style autonomous loops requires those passing before commit.
GitHub Copilot Agent vs Claude Code Ralph: same pattern, different execution. GitHub Copilot Agent runs in GitHub's hosted environment (no local shell, no --dangerously-skip-permissions). Claude Code Ralph runs locally or in a sandboxed CI-like environment. For this repo's owner (GitHub-only, no local IDE), Copilot Agent mode is the practical entry point — assign a detailed issue with clear acceptance criteria and let the agent open a PR.
Risks, Gaps, and Uncertainties
- Lisa product maturity is low. Multiple community implementations exist; none appear production-stable. The Graphiti/Neo4j dependency is heavy for a knowledge graph that could be approximated with simpler solutions.
- "--dangerously-skip-permissions" is a hard requirement for headless Claude Code. GitHub Copilot Agent mode does not expose this flag — it runs with its own permission model. A true Claude Code Ralph loop requires a sandboxed environment this repo does not currently configure.
- Spec quality is the unconstrained variable. No tooling prevents writing vague specs. The "one sentence without and" test is a heuristic, not a guarantee. Observed failure mode: specs that describe the implementation rather than the behaviour.
- Active inference connection is speculative. The structural similarity is real but no primary source in this domain has drawn the connection formally. It remains an author's framing.
Open Questions
- Is there a community-accepted minimal Lisa implementation (hooks + lightweight memory) that works with Claude Code without Neo4j?
- Can the Ralph building loop be triggered from a GitHub Actions workflow using
gh copilotCLI or the Copilot API, making it accessible from the GitHub website? - What does a practical
specs/file look like for a new research item fetcher in this repo? Is one spec per fetcher protocol enough, or does the state/deduplication layer warrant its own spec?
sources
- [ ] Geoffrey Huntley's original Ralph Wiggum Technique repository and documentation
- [ ] community-curated comprehensive Ralph playbook
- [ ] Claude Code implementation of the Ralph autonomous development loop
- [ ] Geoffrey Huntley blog posts and talks on proof-driven development and the Ralph methodology
- [ ] GitHub Copilot Agent mode documentation — official GitHub docs on autonomous agent workflows
- [ ] GitHub blog posts on Copilot Workspace and specification-first development (2024–2025)
- [ ] Any primary sources on Lisa as a planning agent pattern (search Geoffrey Huntley's writing and the ralph-playbook for "Lisa" references)