From ceo-ralph
Start task execution loop using the best available executor (Codex MCP or Task sub-agents).
npx claudepluginhub dutstech/ceoralph --plugin ceo-ralph# /ceo-ralph:implement Start task execution loop using the best available executor (Codex MCP or Task sub-agents). ## Executor Detection Determine which executor to use: 1. Check `$ARGUMENTS` for `--executor <type>` (overrides config) 2. Read `./specs/.ralph-executor.json` for saved preference 3. Default to `auto` For `auto` or `codex` mode: - Check if `mcp__codex__codex` tool is available - If available → executor = `codex` - If not available: - `auto` mode → executor = `task-agent` (silent fallback) - `codex` mode → error: "Codex MCP not configured. Run /ceo-ralph:setup" For `ta...
/implementImplements tasks from a Conductor track plan using strict TDD workflow (red-green-refactor). Auto-selects incomplete track if unspecified; accepts track-id, --task, --phase args.
/implementImplements features/code by activating specialist personas and MCP tools (Context7, Sequential, Magic, Playwright) for analysis, generation, security/QA validation, testing, and integration.
/implementImplements a feature from spec via structured workflow: understand requirements, create feature branch, design, code incrementally with tests, self-review, and PR. Outputs change summary.
/implementAutomates full Evaluate-Loop for a track: detects state, dispatches planner/evaluator/executor/fixer agents, loops on failures until complete. Optional track ID.
/implementStarts task execution loop for active feature: validates prereqs, commits specs via git, initializes execution state JSON, outputs coordinator prompt. Accepts --max-task-iterations and --recovery-mode.
/implementStarts task execution loop for active spec: resolves/validates spec and tasks.md, parses iteration/recovery flags, initializes .ralph-state.json, runs tasks via coordinator until complete.
Start task execution loop using the best available executor (Codex MCP or Task sub-agents).
Determine which executor to use:
$ARGUMENTS for --executor <type> (overrides config)./specs/.ralph-executor.json for saved preferenceautoFor auto or codex mode:
mcp__codex__codex tool is availablecodexauto mode → executor = task-agent (silent fallback)codex mode → error: "Codex MCP not configured. Run /ceo-ralph:setup"For task mode:
task-agent (always)Output the detected executor:
Executor: [codex] Codex MCP
or
Executor: [task-agent] Claude Task sub-agents
./specs/.current-spec to get active spec name./specs/$spec/ directory exists./specs/$spec/tasks.md exists. If not: error "Tasks not found. Run /ceo-ralph:plan first."./specs/$spec/.progress.md exists. If missing, create a minimal stub with the goal and phase.From $ARGUMENTS:
- [ ] or - [x])- [x])Write .ralph-state.json:
{
"phase": "execution",
"taskIndex": <first incomplete>,
"totalTasks": <count>,
"taskIteration": 1,
"maxTaskIterations": <parsed from --max-task-iterations or default 5>,
"executor": "<codex|task-agent>"
}
Create/update ./specs/$spec/.ralph-delegation.json if it doesn't exist:
{
"specName": "<spec>",
"executor": "<codex|task-agent|auto>",
"workers": [],
"stats": {
"total": 0,
"completed": 0,
"failed": 0,
"running": 0,
"pending": 0,
"avgDurationMs": 0
}
}
For each task:
Same for both executors:
tasks.md./specs/$spec/.progress.md./specs/$spec/discovery.md (if exists)./specs/$spec/.design-summary.md or design.md (if exists)./agents/spec-executor.md for base instructionsw-<NNN> (e.g., w-001, w-002, ...)
Sequential, zero-padded to 3 digits.
Update ./specs/$spec/.ralph-delegation.json — add worker entry:
{
"workerId": "w-001",
"taskId": "1.1",
"taskTitle": "Task title from tasks.md",
"executor": "<codex|task-agent>",
"status": "running",
"startedAt": "<ISO timestamp>",
"completedAt": null,
"attempt": 1,
"result": null,
"summary": null,
"filesChanged": [],
"commitHash": null
}
Output status:
[<executor>] Task X.Y: <title> — dispatching...
Codex MCP path:
mcp__codex__codex({
prompt: "<spec-executor instructions>\n\nTask: <task block>\n\nContext: <files>",
sandbox: "workspace-write"
})
Task tool path:
Task({
subagent_type: "general-purpose",
model: "sonnet",
prompt: "<spec-executor instructions>\n\nTask: <task block>\n\nContext: <files>\n\nIMPORTANT: You are running as a Task sub-agent, not Codex MCP. Follow the spec-executor instructions exactly. Output TASK_COMPLETE when done."
})
After executor completes:
./specs/$spec/codex-log.md for a concise summary and referencesUpdate the worker entry in .ralph-delegation.json:
{
"status": "completed|failed",
"completedAt": "<ISO timestamp>",
"result": "TASK_COMPLETE|TASK_BLOCKED|FAILED",
"summary": "Brief output summary",
"filesChanged": ["src/Login.tsx", "..."],
"commitHash": "abc1234"
}
Update aggregate stats:
{
"total": <total workers>,
"completed": <count>,
"failed": <count>,
"running": <count>,
"pending": <remaining tasks>,
"avgDurationMs": <average of completed worker durations>
}
If Codex MCP returns AbortError:
.progress.md and codex-log.mdIf Task tool returns an error:
If the user manually stops execution, treat it as a cancel and stop cleanly (no retries).
Output status for each task:
[codex] Task 1.1: Setup project structure — DONE (12s)
[task-agent] Task 1.2: Implement login form — DONE (34s)
[task-agent] Task 1.3: Add validation — FAILED (attempt 2/5)
When taskIndex >= totalTasks and all tasks are [x], output:
ALL_TASKS_COMPLETE
tasks.md, .progress.md, codex-log.md) to reduce terminal flicker.