opencode-globex
v0.1.3
Published
PRD interviews with a Ralph/Wiggum execution loop
Readme
What It Is
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, andfeatures.json - Requires human approval at each spec phase
- Runs an implementation loop with independent validation
Why It’s Useful
- Converts vague ideas into concrete, reviewable artifacts
- Forces alignment before code changes begin
- Keeps execution iterative and accountable
Philosophy
"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
Disclaimer
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.
Features
- Standalone CLI — Run
globexfrom 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
Screenshot
Flow
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"]
endEach phase requires human approval before proceeding.
Installation
Via npm
npm install -g opencode-globexFrom source
git clone https://github.com/lleewwiiss/opencode-globex.git
cd globex
bun install
bun run build
bun linkThis makes the globex command available globally.
Usage
Initialize a new project
globex init "Add dark mode support"Default model: openai/gpt-5.2-codex (variant high).
Resume a project
globex # Resume active project
globex --project my-project # Run specific projectManage projects
globex status
globex switch my-project
globex abandon my-project --forceWorktrees
globex workspace list
globex workspace cleanupOptions
globex --help
globex --model anthropic/claude-sonnet-4Ralph Loop
Coach/player pattern with two agents per iteration:
- Ralph (player) — Implements ONE feature, writes
.globex-donein project workdir - Wiggum (coach) — Validates implementation against acceptance criteria
- Writes
.globex-approvedon success - Writes
.globex-rejectedwith JSON reasons on failure
- Writes
- On rejection, Ralph retries with feedback in next iteration
- Fresh context between iterations (stateless execution)
Loop continues until all features complete.
Feature Sizing
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 |
Feature States
| State | Description |
|:------|:------------|
| passes: false | Not yet implemented |
| passes: true | Implemented and verified |
| blocked: true | Cannot progress (skipped by loop) |
Project Structure
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.jsonState Files
.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 progressDevelopment
bun run check # lint + build + test
bun run lint # oxlint cli/src/
bun run build # tsc
bun test # all testsAcknowledgements
OpenCode
Globex uses the OpenCode SDK for agent sessions.
opencode-ralph
Reference implementation for a Ralph-style loop.
Geoffrey Huntley's Ralph Driven Development
Original write-up of the Ralph loop concept.
License
MIT
