ralph  by snarktank

Autonomous AI agent loop for iterative task completion

Created 4 days ago

New!

1,808 stars

Top 23.6% on SourcePulse

GitHubView on GitHub
1 Expert Loves This Project
Project Summary

Ralph is an autonomous AI agent loop designed to execute development tasks defined in a Product Requirements Document (PRD) using the Amp framework. It targets developers seeking to automate iterative software development, benefiting from a structured, repeatable process that aims for PRD completion.

How It Works

Ralph operates as a loop, spawning a fresh Amp instance with clean context for each iteration to ensure a predictable starting point. Memory and progress are maintained across these iterations via Git history, a progress.txt file for learnings, and a prd.json file tracking the status of user stories. This approach allows for the autonomous implementation of individual, small tasks derived from the PRD, with learnings explicitly captured to inform subsequent steps.

Quick Start & Requirements

  • Prerequisites: Amp CLI (installed and authenticated), jq (e.g., brew install jq), and a Git repository.
  • Setup: Users can either copy ralph.sh and prompt.md into their project's scripts/ralph/ directory or install the prd and ralph skills globally into ~/.config/amp/skills/.
  • Configuration: Enabling amp.experimental.autoHandoff in ~/.config/amp/settings.json is recommended for handling stories exceeding a single context window.
  • Workflow: Generate a PRD using the prd skill, convert it to prd.json using the ralph skill, and then execute the main loop with ./scripts/ralph/ralph.sh [max_iterations].
  • Resources: An interactive flowchart visualizing the process is available in the flowchart/ directory.

Highlighted Details

  • Autonomous AI agent loop for PRD-driven development.
  • Iterative task execution: Implements one user story per loop iteration.
  • Explicit memory persistence: Leverages Git, progress.txt, and prd.json for state tracking.
  • Learning capture: Updates AGENTS.md with discovered patterns and gotchas for future iterations.
  • UI verification: Integrates with a dev-browser skill for frontend story acceptance.

Maintenance & Community

No specific details regarding maintainers, community channels (e.g., Discord, Slack), or roadmaps are provided in the README.

Licensing & Compatibility

The README does not specify a software license, which may impact commercial use or integration decisions.

Limitations & Caveats

The system requires Product Requirements Document items to be small enough to fit within a single LLM context window. Success is highly dependent on robust feedback loops, such as passing type checks and unit tests, to prevent error accumulation. The "fresh context" approach necessitates explicit state management to avoid losing implicit project knowledge. The absence of a stated license is a notable caveat for adoption.

Health Check
Last Commit

3 days ago

Responsiveness

Inactive

Pull Requests (30d)
9
Issues (30d)
1
Star History
2,057 stars in the last 4 days

Explore Similar Projects

Feedback? Help us improve.