From claude-commands
Executes genesis.py LLM orchestration workflow to refine and auto-run goals using fast-gen mode. Accepts goal description, optional iterations, and working directory.
npx claudepluginhub jleechanorg/claude-commandscommands/## โก EXECUTION INSTRUCTIONS FOR CLAUDE **When this command is invoked, YOU (Claude) must execute these steps immediately:** **This is NOT documentation - these are COMMANDS to execute right now.** **Use TodoWrite to track progress through multi-phase workflows.** ## ๐จ EXECUTION WORKFLOW ### Phase 1: Execution Instructions **Action Steps:** When this command is invoked with a goal: 2. **Orchestration Integration**: - **GenesisAgent Type**: Uses specialized orchestration agent for tmux management - **Raw Command Output**: Prints Python orchestration command for manual execution ...
When this command is invoked, YOU (Claude) must execute these steps immediately: This is NOT documentation - these are COMMANDS to execute right now. Use TodoWrite to track progress through multi-phase workflows.
Action Steps: When this command is invoked with a goal:
### Phase 2: Execution Options
**Action Steps:**
1. **Pool Size**: Configurable via `--pool-size N` (default: 5)
2. **Direct Execution**: All operations use `claude -p` directly
3. **Search-First**: Validates before building to prevent duplicates
4. **Quality Control**: No-placeholders policy enforced
### Phase 3: Workflow Benefits
**Action Steps:**
1. Review the reference documentation below and execute the detailed steps.
## ๐ REFERENCE DOCUMENTATION
# /gene - Genesis Execution (Auto-Execute)
**Command Summary**: Enhanced `/gen` that automatically executes the genesis.py workflow with fast-gen default mode
**Usage**: `/gene "goal description" [iterations] [working_directory]`
**Purpose**: Single-command goal refinement and execution using the enhanced genesis/genesis.py with fast-gen default mode
## โ ๏ธ Important: Genesis vs Ralph
**Genesis** = WorldArchitect.ai orchestration system (this command)
- Located at: `$HOME/projects/worktree_ralph/genesis/genesis.py`
- **Uses Codex CLI by default** (200K context via OpenRouter)
- Can override with `--claude` flag to use Claude Code CLI
- Integrated with WorldArchitect.ai project
- Fast-gen mode with Cerebras integration
**Ralph** = Standalone ralph-orchestrator fork (different system!)
- Located at: `$HOME/projects_other/ralph-orchestrator`
- Uses Codex CLI by default (200K context)
- Separate codebase, different architecture
- See `/ralph` command for Ralph execution
## Key Differences from /gen
- **Auto-Execution**: Automatically runs `python genesis/genesis.py` after goal setup
- **Fast-Gen Integration**: Uses the new default fast-gen mode (no --fast-gen flag needed)
- **Streamlined Workflow**: One command does everything from goal to execution
- **Enhanced UX**: Leverages the improved genesis.py interface
- **๐จ Self-Determination**: Genesis automatically detects completion with rigorous exit criteria
- **๐ Validation Protocol**: End-to-end validation prevents false success claims
- **๐ Iterate Mode**: Can use --iterate flag to skip initial Cerebras generation (when working with existing goals)
# Parse command arguments
INPUT="$1"
ITERATIONS="${2:-30}"
WORKDIR="${3:-/tmp/genesis_$(date +%Y%m%d_%H%M%S)}"
# Set up genesis working directory (default: /tmp with timestamp)
GENESIS_WORKDIR="$WORKDIR"
CURRENT_GOALS="$PWD/goals"
# Create working directory if it doesn't exist
mkdir -p "$GENESIS_WORKDIR"
# Copy goals to genesis working directory for context (if they exist)
if [[ -d "$CURRENT_GOALS" ]]; then
echo "๐ Copying goals directory to genesis working directory..."
cp -r "$CURRENT_GOALS" "$GENESIS_WORKDIR/"
echo "โ
Goals copied to $GENESIS_WORKDIR/goals"
fi
# Smart goal detection: goal directory vs. new prompt
# Check if input looks like a goal directory path
if [[ "$INPUT" =~ ^goals/ ]] || [[ -d "$INPUT" ]] || [[ -d "goals/$INPUT" ]]; then
# Goal directory mode
if [[ -d "$INPUT" ]]; then
GOAL_DIR="$INPUT"
elif [[ -d "goals/$INPUT" ]]; then
GOAL_DIR="goals/$INPUT"
else
GOAL_DIR="$INPUT"
fi
# Verify goal directory has required files
if [[ -f "$GOAL_DIR/00-goal-definition.md" ]]; then
echo "๐ Using existing goal directory: $GOAL_DIR"
GENESIS_CMD="python \"$PWD/genesis/genesis.py\" \"$GOAL_DIR\" \"$ITERATIONS\""
else
echo "โ Goal directory $GOAL_DIR exists but missing goal definition files"
echo "๐ก Use: /gene \"your goal description here\" to create new goals"
exit 1
fi
else
# New goal mode - use --refine
echo "๐ Creating new goal with: $INPUT"
GENESIS_CMD="python \"$PWD/genesis/genesis.py\" --refine \"$INPUT\" \"$ITERATIONS\""
fi
# Generate unique session name
SESSION_NAME="gene-$(date +%Y%m%d-%H%M%S)"
# Print raw Python orchestration command
echo '๐ RAW PYTHON ORCHESTRATION COMMAND:'
echo "======================================="
echo ""
echo "# Genesis Agent Orchestration Command"
echo "# Copy and execute this Python code to run via orchestration:"
echo ""
echo "python3 -c \""
echo "import sys"
echo "sys.path.append('$HOME/projects/worktree_ralph')"
echo "from orchestrate import TaskOrchestrator"
echo ""
echo "# Genesis Agent Configuration"
echo "agent_config = {"
echo " 'id': 'genesis-${SESSION_NAME}',"
echo " 'type': 'genesis',"
echo " 'session_name': '${SESSION_NAME}',"
echo " 'working_dir': '$GENESIS_WORKDIR',"
echo " 'genesis_cmd': '${GENESIS_CMD}',"
echo " 'environment': {"
echo " # No environment variables needed - using reasonable defaults"
echo " },"
echo " 'requires_llm': False"
echo "}"
echo ""
echo "# Initialize orchestrator and execute"
echo "orchestrator = TaskOrchestrator()"
echo "result = orchestrator.execute_genesis_task(agent_config)"
echo "print(f'Genesis task result: {result}')"
echo "\""
echo ""
echo "======================================="
echo ""
echo "๐ Alternative: Direct tmux execution"
echo "tmux new-session -d -s '$SESSION_NAME' env CEREBRAS_API_KEY=\"$CEREBRAS_API_KEY\" bash -c 'source \$HOME/.bashrc && cd $GENESIS_WORKDIR && $GENESIS_CMD; exec bash'"
echo ""
echo "๐ Session Management:"
echo " Attach: tmux attach -t $SESSION_NAME"
echo " Kill: tmux kill-session -t $SESSION_NAME"
echo " Observer: $PWD/scripts/genesis_observer.sh $SESSION_NAME"
echo ""
echo "๐ Genesis Log Paths (Available after startup):"
echo " Technical: /tmp/\$(basename $GENESIS_WORKDIR)/\$(cd $GENESIS_WORKDIR && git branch --show-current 2>/dev/null || echo unknown)/genesis_\$(date +%s).log"
echo " Human: /tmp/\$(basename $GENESIS_WORKDIR)/\$(cd $GENESIS_WORKDIR && git branch --show-current 2>/dev/null || echo unknown)/genesis_\$(date +%s)_human.log"
echo ""
echo "๐ Monitor Progress:"
echo " tail -f /tmp/\$(basename $GENESIS_WORKDIR)/\$(cd $GENESIS_WORKDIR && git branch --show-current 2>/dev/null || echo unknown)/genesis_*_human.log"
echo " tmux capture-pane -t $SESSION_NAME -p | tail -20"
goal_description: Required - description of what to builditerations: Optional - number of iterations (default: 30)working_directory: Optional - where Genesis runs (default: /tmp/genesis_YYYYMMDD_HHMMSS)Genesis now automatically detects completion using rigorous validation:
Primary Completion Indicators:
Consensus Response Analysis: Genesis automatically completes when consensus assessment contains:
๐จ Validation Requirements:
Anti-Patterns Prevented:
goals/YYYY-MM-DD-HHMM-[slug]/ automatically
# Default: runs in /tmp with timestamp
/gene "build a REST API for user management with authentication"
# Custom iterations
/gene "build calculator app" 15
# Custom working directory
/gene "build web scraper" 20 "/tmp/my_project"
# Run in current directory for benchmarking
/gene "text processing CLI" 30 "$PWD"
Expected Output:
๐ RAW PYTHON ORCHESTRATION COMMAND:
=======================================
# Genesis Agent Orchestration Command
# Copy and execute this Python code to run via orchestration:
python3 -c "
import sys
sys.path.append('$HOME/projects/worktree_ralph')
from orchestrate import TaskOrchestrator
# Genesis Agent Configuration
agent_config = {
'id': 'genesis-gene-20250923-0945',
'type': 'genesis',
'session_name': 'gene-20250923-0945',
'working_dir': '$HOME/projects_other/codex_plus',
'genesis_cmd': 'python $HOME/projects/worktree_ralph/genesis/genesis.py --refine "build a REST API for user management with authentication" 5 --iterate',
'environment': {},
'requires_llm': False
}
# Initialize orchestrator and execute
orchestrator = TaskOrchestrator()
result = orchestrator.execute_genesis_task(agent_config)
print(f'Genesis task result: {result}')
"
=======================================
๐ Alternative: Direct tmux execution
tmux new-session -d -s 'gene-20250923-0945' bash -c 'cd $HOME/projects_other/codex_plus && python $HOME/projects/worktree_ralph/genesis/genesis.py --refine "build a REST API for user management with authentication" 5 --iterate; exec bash'
๐ Session Management:
Attach: tmux attach -t gene-20250923-0945
Kill: tmux kill-session -t gene-20250923-0945
/gene "code fibonacci function" 3
/gene "build microservice architecture" 10 --pool-size 3
The command creates and populates:
goals/YYYY-MM-DD-HHMM-[slug]/
โโโ 00-goal-definition.md # Generated goal specification
โโโ 01-success-criteria.md # Generated exit criteria
โโโ 02-implementation-notes.md # Generated technical approach
โโโ 03-testing-strategy.md # Generated validation strategy
โโโ fix_plan.md # Living plan document (created during execution)
โโโ GENESIS.md # Self-improvement learnings (created during execution)
โโโ proto_genesis_session.json # Session state and progress
The command leverages enhanced genesis/genesis.py features:
claude -p directly--pool-size parameter for concurrency| Feature | /pgen | /gene |
|---|---|---|
| Goal Setup | Interactive /goal command | Fast /cereb generation |
| Execution | Manual copy-paste | Python orchestration command generation |
| Directory | Pre-created structure | Auto-generated with content |
| Context | Basic goal files | Enhanced 2000 token summaries |
| Speed | 2-phase workflow | Single streamlined workflow |
| Control | Manual execution timing | GenesisAgent orchestration ready |
| Monitoring | No built-in monitoring | Orchestration system + tmux fallback |
| Persistence | Terminal-dependent | Deterministic tmux session management |
| Observability | Limited output | Full verbose logging via orchestration |
Use /pgen when you want manual control over execution timing.
Use /gene when you want Python orchestration command generation for GenesisAgent execution.
IMPORTANT: This command is explicitly excluded from /exportcommands output as it is an internal development tool for rapid goal-to-implementation workflows.