Summary
Refactor CodeFrame's execution layer so that frontier coding agents (Claude Code, Codex, OpenCode, Kilocode, etc.) are first-class execution engines, with CodeFrame's built-in ReactAgent as a fallback. CodeFrame becomes the orchestrator (PRD → tasks → dependencies → verification → PR) while delegating the actual code writing to whatever tool does it best.
Problem Statement
CodeFrame currently implements its own ReAct agent with 7 custom tools, a 4-level fuzzy editor, 3-tier token compaction, and adaptive iteration budgets. This is fundamentally trying to compete with Claude Code, Codex, OpenCode, and Kilocode — tools backed by entire engineering teams dedicated to making the best coding agent.
CodeFrame's actual value is everything around the coding agent:
- PRD generation and task decomposition
- Dependency graph analysis and batch scheduling
- Verification gates (ruff, pytest) with self-correction loops
- Human-in-the-loop blocker resolution
- State machine and lifecycle management
- PR workflow and Git integration
- Workspace hooks and configuration
None of this exists in Claude Code, Codex, or OpenCode. They write code for a single task. CodeFrame manages the full development lifecycle.
Architectural Vision
Current (CodeFrame IS the agent)
CLI → Runtime → ReactAgent → Anthropic API → custom tools → files
↑
CodeFrame owns ALL of this
Proposed (CodeFrame ORCHESTRATES agents)
CLI → Runtime → AgentAdapter → ┌─ claude-code (subprocess)
│ ├─ codex (app-server protocol)
│ ├─ opencode (subprocess)
│ ├─ kilocode (extension protocol)
│ ├─ custom (configurable)
│ └─ built-in (ReactAgent fallback)
│
CodeFrame still owns:
✅ Task context assembly
✅ Verification gates + self-correction
✅ Stall detection & blocker escalation
✅ State machine & lifecycle
✅ Batch orchestration
✅ Workspace hooks
✅ PR workflow
Key Design Principle
The AgentAdapter protocol defines what CodeFrame needs from any coding agent:
- Input: Task description + context (files, PRD, constraints)
- Output: Modified files + status (success/failure/blocked)
- Streaming: Progress events for observability
CodeFrame doesn't care how the agent writes code. It cares what happened (files changed, tests pass, blockers hit).
Sub-Issues
Implementation is broken into atomic sub-issues:
#413 — Aider adapter (closed, replaced by #416 OpenCode and #417 Kilocode)
Dependency Graph
#409 (protocol) ──┬──> #411 (Claude Code adapter)
├──> #412 (Codex adapter)
├──> #416 (OpenCode adapter)
├──> #417 (Kilocode adapter)
├──> #414 (engine registry) ──> needs ≥1 adapter
└──> #415 (verification wrapper)
#410 (context packager) ──> feeds into #411, #412, #416, #417
#409 and #410 are independent foundations.
#411, #412, #416, #417 are independent adapters (can be done in parallel).
#414 ties everything together.
#415 can be done in parallel with adapters.
What Stays the Same
core/react_agent.py — remains as the --engine built-in fallback
core/context.py — context loading (feeds into the new packager)
core/gates.py — verification gates
core/runtime.py — run lifecycle (extended with new engine types)
core/conductor.py — batch orchestration
- All CLI commands — just the
--engine flag gets new values
What This Means for the Roadmap
This should be early Phase 4 work because:
- It unblocks multi-agent by making agents interchangeable
- It dramatically reduces CodeFrame's maintenance burden
- It makes CodeFrame immediately useful today with Claude Code or OpenCode
- The built-in ReactAgent becomes the "no internet / no subscription" fallback
Acceptance Criteria
Summary
Refactor CodeFrame's execution layer so that frontier coding agents (Claude Code, Codex, OpenCode, Kilocode, etc.) are first-class execution engines, with CodeFrame's built-in ReactAgent as a fallback. CodeFrame becomes the orchestrator (PRD → tasks → dependencies → verification → PR) while delegating the actual code writing to whatever tool does it best.
Problem Statement
CodeFrame currently implements its own ReAct agent with 7 custom tools, a 4-level fuzzy editor, 3-tier token compaction, and adaptive iteration budgets. This is fundamentally trying to compete with Claude Code, Codex, OpenCode, and Kilocode — tools backed by entire engineering teams dedicated to making the best coding agent.
CodeFrame's actual value is everything around the coding agent:
None of this exists in Claude Code, Codex, or OpenCode. They write code for a single task. CodeFrame manages the full development lifecycle.
Architectural Vision
Current (CodeFrame IS the agent)
Proposed (CodeFrame ORCHESTRATES agents)
Key Design Principle
The
AgentAdapterprotocol defines what CodeFrame needs from any coding agent:CodeFrame doesn't care how the agent writes code. It cares what happened (files changed, tests pass, blockers hit).
Sub-Issues
Implementation is broken into atomic sub-issues:
#413 — Aider adapter(closed, replaced by #416 OpenCode and #417 Kilocode)Dependency Graph
#409 and #410 are independent foundations.
#411, #412, #416, #417 are independent adapters (can be done in parallel).
#414 ties everything together.
#415 can be done in parallel with adapters.
What Stays the Same
core/react_agent.py— remains as the--engine built-infallbackcore/context.py— context loading (feeds into the new packager)core/gates.py— verification gatescore/runtime.py— run lifecycle (extended with new engine types)core/conductor.py— batch orchestration--engineflag gets new valuesWhat This Means for the Roadmap
This should be early Phase 4 work because:
Acceptance Criteria
cf work start <id> --execute --engine claude-codedelegates to Claude Code CLIcf work start <id> --execute --engine opencodedelegates to OpenCodecf work start <id> --execute --engine built-inuses existing ReactAgent