PRD interviews with a Ralph/Wiggum execution loop
npm install opencode-globex

PRD interviews with a Ralph/Wiggum execution loop
CLI tool powered by OpenCode
What It Is •
Why It’s Useful •
Features •
Screenshot •
Usage
---
Globex is a CLI + TUI for turning a rough idea into a validated spec and then executing it with an agentic loop.
- Generates research.md, plan.md, and features.json
- Requires human approval at each spec phase
- Runs an implementation loop with independent validation
- Converts vague ideas into concrete, reviewable artifacts
- Forces alignment before code changes begin
- Keeps execution iterative and accountable
---
> "Human leverage is highest at spec level, lowest at implementation."
Front-load human validation into research and planning. Execution runs autonomously.
Named after Hank Scorpio's company. The "Ralph loop" is named after Ralph Wiggum—persistent iteration despite setbacks.
Based on:
- Anthropic: Effective Harnesses for Long-Running Agents
- HumanLayer: ACE-FCA
- Geoffrey Huntley: Ralph Driven Development
- opencode-ralph
Globex is an independent project and not affiliated with or endorsed by The Simpsons, Fox, or Disney. Names and likenesses are used for humor; all trademarks belong to their respective owners.
- Standalone CLI — Run globex from any project directory
- TUI interface — Real-time progress display with OpenTUI
- @ file references — Autocomplete to attach files to your project description
- OpenCode SDK integration — Spawns sessions for each agent
- Phase-based workflow — Research, plan, features, execute
- Coach/player pattern — Ralph implements, Wiggum validates
---

---
``mermaid
flowchart TD
Research["Research"] --> ResearchInterview["Interview (approve)"]
ResearchInterview --> Plan["Plan"]
Plan --> PlanInterview["Interview (approve)"]
PlanInterview --> Features["Features"]
Features --> Confirm["Confirm (approve)"]
Confirm --> Ralph
Research -.-> ResearchArtifact["research.md"]
Plan -.-> PlanArtifact["plan.md"]
Features -.-> FeaturesArtifact["features.json"]
subgraph Execute["Execute (Ralph Loop)"]
Ralph["Ralph (implement)"] --> Wiggum["Wiggum (validate)"] --> Ralph
Ralph -.-> DoneMarker[".globex-done"]
Wiggum -.-> ApprovedMarker[".globex-approved"]
Wiggum -.-> RejectedMarker[".globex-rejected"]
end
`
Each phase requires human approval before proceeding.
---
`bash`
npm install -g opencode-globex
`bash`
git clone https://github.com/lleewwiiss/opencode-globex.git
cd globex
bun install
bun run build
bun link
This makes the globex command available globally.
---
`bash`
globex init "Add dark mode support"
Default model: openai/gpt-5.2-codex (variant high).
`bash`
globex # Resume active project
globex --project my-project # Run specific project
`bash`
globex status
globex switch my-project
globex abandon my-project --force
`bash`
globex workspace list
globex workspace cleanup
`bash`
globex --help
globex --model anthropic/claude-sonnet-4
---
Coach/player pattern with two agents per iteration:
1. Ralph (player) — Implements ONE feature, writes .globex-done in project workdir.globex-approved
2. Wiggum (coach) — Validates implementation against acceptance criteria
- Writes on success.globex-rejected
- Writes with JSON reasons on failure
3. On rejection, Ralph retries with feedback in next iteration
4. Fresh context between iterations (stateless execution)
Loop continues until all features complete.
Features sized for ~50% of agent context window:
| Constraint | Limit |
|:-----------|:------|
| Time | 30-60 min |
| Files | 10-20 max |
| Lines | ~500 max |
| Dependencies | 0-2 features |
| State | Description |
|:------|:------------|
| passes: false | Not yet implemented |passes: true
| | Implemented and verified |blocked: true
| | Cannot progress (skipped by loop) |
---
``
globex/
├── cli/
│ ├── bin/
│ │ └── globex.ts # CLI entry point (yargs)
│ ├── src/
│ │ ├── index.ts # Main entry, TUI startup
│ │ ├── app.tsx # TUI application (OpenTUI/Solid)
│ │ ├── loop/
│ │ │ ├── ralph.ts # Ralph loop executor
│ │ │ └── signals.ts # File marker detection
│ │ ├── phases/
│ │ │ ├── engine.ts # Phase execution engine
│ │ │ └── approval.ts # Approval handling
│ │ ├── agents/
│ │ │ ├── prompts.ts # Prompt loader
│ │ │ └── prompts/ # Prompt markdown
│ │ ├── opencode/
│ │ │ ├── server.ts # OpenCode server management
│ │ │ ├── session.ts # Session handling
│ │ │ └── events.ts # Event subscription
│ │ ├── state/
│ │ │ ├── types.ts # TypeScript types
│ │ │ ├── schema.ts # Effect Schema definitions
│ │ │ └── persistence.ts # State CRUD
│ │ ├── features/
│ │ │ └── manager.ts # Feature tracking
│ │ ├── artifacts/
│ │ │ ├── save.ts # Artifact persistence
│ │ │ └── validators.ts # Citation validation
│ │ ├── components/ # TUI components
│ │ ├── config.ts # Configuration loading
│ │ └── git.ts # Git operations
│ └── tests/ # Test files
├── .globex/ # Runtime state (gitignored)
├── package.json
└── tsconfig.json
---
``
.globex/
├── config.json # CLI configuration
└── projects/{projectId}/
├── state.json # Phase, approvals, execution state
├── research.md # Research findings
├── plan.md # Implementation plan
├── features.json # Feature list with pass/fail status
└── progress.md # Current progress
---
`bash``
bun run check # lint + build + test
bun run lint # oxlint cli/src/
bun run build # tsc
bun test # all tests
---
Globex uses the OpenCode SDK for agent sessions.
Reference implementation for a Ralph-style loop.
Original write-up of the Ralph loop concept.
---
MIT
---
"Don't call me Mr. Scorpion. It's Mr. Scorpio, but don't call me that either."