Status: Design & Reference Implementation
This repository contains the design documentation and reference implementation for an autonomous PRP batch orchestrator. The actual production implementation will be done through the ClaudeAgents PRP process.
- ✅ PRP Definition: Complete requirements for the orchestrator
- ✅ Reference Implementation: Working prototype (
execute-prps.py) - ✅ Helper Scripts: Batch API integration scripts
- ✅ Documentation: Setup and usage guides
- ❌ No Git Remote: Currently local-only repository
⚠️ Queue is Empty: Safe to run without processing anything
Process Product Requirements Proposals (PRPs) autonomously from brain-dump definitions to complete implementations using Anthropic Batch API and Claude Code.
# Copy definition to ClaudeAgents queue
./submit-to-claudeagents.sh
# Then follow PRP process in ClaudeAgents repo
cd ~/Repositories/ClaudeAgents
# Use /draft-prp, /generate-prp, /execute-prp commands# It's safe to run - queue is empty!
python execute-prps.py --status
# To test with example:
cd prp/queue
mv EXAMPLE-test-feature-definition.md.disabled EXAMPLE-test-feature-definition.md
cd ../..
python execute-prps.py# Clone or navigate to repository
cd GitWorkflow
# Install dependencies
pip install -r requirements.txt
# Configure API key
cp .env.example .env
# Edit .env and add your ANTHROPIC_API_KEY
# Make scripts executable
chmod +x scripts/*.sh# Activate your environment
source venv/bin/activate # or your env activation command
# Process all PRPs in queue (one-time)
python execute-prps.py
# Or run in daemon mode (continuous monitoring)
python execute-prps.py --daemon
# Check status
python execute-prps.py --statusDrop brain-dump definition files in prp/queue/:
# Create a definition file
cat > prp/queue/my-feature-definition.md <<'EOF'
# Feature: User Authentication
Add OAuth2 login with Google and GitHub providers.
Requirements:
- Secure token storage
- Session management
- User profile sync
- 2FA support
...
EOF
# The orchestrator will automatically:
# 1. Create draft PRP
# 2. Generate complete PRP(s)
# 3. Execute implementation via Claude Code
# 4. Move completed to prp/completed/Definition → Draft → Generate → Execute → Complete
(You) (Batch) (Batch) (Claude) (Done)
- Definition Phase (Human): Drop brain-dump
.mdfile inprp/queue/ - Draft Phase (Batch API): Converts definition to structured draft PRP
- Generate Phase (Batch API): Creates comprehensive implementation-ready PRP
- Execute Phase (Claude Code): Implements PRP with full TDD workflow
- Complete: Results in
prp/completed/, definition moved toprp/queue/processed/
GitWorkflow/
├── execute-prps.py # Main orchestrator
├── .env # Your configuration (API keys, rate limits)
├── scripts/
│ ├── collect-prp-context.sh # Gather project context
│ ├── create-batch-request.sh # Format batch API requests
│ └── submit-batch.sh # Submit and monitor batches
├── prp/
│ ├── queue/ # Drop definitions here
│ │ ├── processed/ # Successfully processed
│ │ └── failed/ # Failed with error logs
│ ├── drafts/ # Draft PRPs (Phase 1 output)
│ ├── active/ # Ready-to-implement PRPs (Phase 2 output)
│ └── completed/ # Completed implementations (Phase 3 output)
├── batch/ # Batch API intermediate files
└── logs/ # Orchestrator logs and state
Edit .env to customize:
# API Key (REQUIRED)
ANTHROPIC_API_KEY=your-key-here
# Environment (optional)
ENVIRONMENT=dev # dev, qa, or prod
# Rate Limiting (adjust to budget)
MAX_BATCHES_PER_HOUR=1 # Conservative default
MIN_BATCH_INTERVAL_MINUTES=60 # Minimum time between batches
# Polling Intervals
QUEUE_CHECK_INTERVAL_SECONDS=300 # Check queue every 5 min
BATCH_POLL_INTERVAL_SECONDS=60 # Check batch status every 1 min
BATCH_TIMEOUT_HOURS=3 # Max batch wait timeEach environment (prod/qa/dev) should have its own API key and rate limits:
Development:
ENVIRONMENT=dev
ANTHROPIC_API_KEY=sk-ant-dev-...
MAX_BATCHES_PER_HOUR=10
MIN_BATCH_INTERVAL_MINUTES=10QA:
ENVIRONMENT=qa
ANTHROPIC_API_KEY=sk-ant-qa-...
MAX_BATCHES_PER_HOUR=5
MIN_BATCH_INTERVAL_MINUTES=20Production:
ENVIRONMENT=prod
ANTHROPIC_API_KEY=sk-ant-prod-...
MAX_BATCHES_PER_HOUR=2
MIN_BATCH_INTERVAL_MINUTES=45# Process all queued definitions once
python execute-prps.py# Run as daemon (monitors queue continuously)
python execute-prps.py --daemon
# Use with systemd or supervisor for production$ python execute-prps.py --status
=== PRP Orchestrator Status ===
Queue directory: /path/to/prp/queue
Queued: 3 files
Processed: 15 files
Current: None
Last batch: 2025-10-25T14:30:00Z
Batches (1h): 1
Can submit: False (Minimum interval: Wait 45 minutes since last batch.)The orchestrator includes built-in rate limiting to prevent unexpected costs:
- Hourly Limits: Max batches per hour (default: 1)
- Minimum Intervals: Min time between batches (default: 60 min)
- Automatic Throttling: Waits if rate limits would be exceeded
- State Tracking: Remembers batch history across restarts
For higher throughput (adjust in .env):
MAX_BATCHES_PER_HOUR=5 # Up to 5 batches per hour
MIN_BATCH_INTERVAL_MINUTES=15 # Min 15 min between batchesFor cost savings (more conservative):
MAX_BATCHES_PER_HOUR=1 # Only 1 batch per hour
MIN_BATCH_INTERVAL_MINUTES=120 # Wait 2 hours between batchesError: ANTHROPIC_API_KEY not set! Create .env file with your API key.
Solution: Copy .env.example to .env and add your API key.
Rate limit: 1 batches in last hour. Wait 45 minutes.
Solution: Either wait or increase MAX_BATCHES_PER_HOUR in .env (costs will increase).
Error: Script not found: /path/to/scripts/collect-prp-context.sh
Solution: Ensure all scripts are executable:
chmod +x scripts/*.shError: Timeout waiting for batch completion
Solution: Increase BATCH_TIMEOUT_HOURS in .env or check Anthropic API status.
Check prp/queue/failed/ directory:
# View error log
cat prp/queue/failed/my-feature-error.txt
# Retry: move back to queue
mv prp/queue/failed/my-feature-definition.md prp/queue/All operations are logged:
# View orchestrator log
tail -f logs/prp-orchestrator-dev.log
# View batch API responses
cat batch/*/batch-status.json
# View state file
cat logs/prp-orchestrator-state.jsonThis orchestrator is designed to work with the ClaudeAgents repository:
- Slash Commands: Uses
/draft-prpand/generate-prpprompts - Templates: Follows PRP templates from
templates/prp/ - Execute: Calls Claude Code with
/execute-prpfor implementation - Standards: Respects all project standards and TDD requirements
##Dependencies
- Python 3.8+
- python-dotenv
- jq (system package for JSON processing)
- curl
- Claude Code CLI
- Anthropic API key
Install Python dependencies:
pip install -r requirements.txtProprietary - For internal use only.
For issues or questions:
- Check logs in
logs/prp-orchestrator-dev.log - Review failed PRPs in
prp/queue/failed/ - Run status check:
python execute-prps.py --status - Open issue with log excerpts if needed