Skip to content
This repository was archived by the owner on Apr 11, 2026. It is now read-only.

Commit f08a88b

Browse files
z23ccclaude
andcommitted
feat: RP agent_run pipeline + 8 optimizations (v0.1.48)
Replace Claude Agent/Teams with RP agent_run for all agent spawning: - Workers self-create worktrees, coordinator only does start+merge - Scouts via agent_run(explore), workers via agent_run(engineer/pair) - steer replaces SendMessage for cross-worker coordination - Streaming continuous flow replaces wave-based execution Pipeline optimizations: - flowctl startup: single CLI call replaces 6 startup calls - worker-phase next --all: batch return all phases (24→1 calls) - worker-prompt --inline-skills: embed core rules in prompt - checklist check-all: batch verification (8→1 calls) - Brainstorm context_builder + oracle_send reuse across Plan - Speculative execution: Plan Review + Work Wave 1 in parallel - Impl Review reuses Plan Review chat_id via oracle_send - Worker Phase 10 guard dedup when no new commits Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent a031cb6 commit f08a88b

18 files changed

Lines changed: 763 additions & 646 deletions

File tree

.claude-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "flow-code",
3-
"version": "0.1.47",
3+
"version": "0.1.48",
44
"description": "Zero-dependency planning + execution with .flow/ task tracking and Ralph autonomous mode (multi-model review gates). Worker subagent per task with git worktree isolation for parallel execution. Three-layer quality system (guard + RP plan-review + Codex adversarial). Full-auto by default — AI decides from context, zero questions. Teams-default with file locking, DAG mutation, Codex-driven conflict resolution, auto draft-PR. Auto-detected stack profiles with one-command guard (test/lint/typecheck). Enhanced agent definitions with permissionMode/maxTurns/effort. Lifecycle hooks with state preservation (PreCompact injects .flow state into compaction, TaskCompleted auto-unlocks files, SubagentStart context injection). Memory v2 with atomic entries, dedup, and progressive disclosure. TDD enforcement mode. Multi-epic queue with dependency visualization. Includes 24 subagents, 22 commands, 74 skills.",
55
"author": {
66
"name": "z23cc",

CLAUDE.md

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -63,19 +63,20 @@ All three must pass (or be skipped via `flowctl config set review.backend none`)
6363
| `--quick` | go, run | Fast path for trivial changes (skip brainstorm, plan review, impl review) |
6464
| `--interactive` | go, run | Pause at key decisions for user confirmation |
6565

66-
## Worker Protocol (Teams Mode)
66+
## Worker Protocol (RP Session Mode)
6767

68-
Workers communicate with the coordinator via SendMessage with summary prefixes:
68+
Workers are spawned as RP agents via `agent_run` in isolated git worktrees registered as RP workspaces. The coordinator uses RP session operations for all communication:
6969

70-
| Worker → Coordinator | Coordinator Response |
71-
|---------------------|---------------------|
72-
| `"Task complete: fn-N.M"` | Verify status=done, unlock files, advance wave |
73-
| `"Blocked: fn-N.M"` | Log reason, skip task in current wave |
74-
| `"Spec conflict: fn-N.M"` | Fix spec → `"Spec updated: fn-N.M"` or skip → `"Task skipped: fn-N.M"` |
75-
| `"Need file access: path"` | `"Access granted: path"` or `"Access denied: path"` |
76-
| `"Need mutation: fn-N.M"` | Execute split/skip/dep change, reply with result |
70+
| RP Operation | Purpose |
71+
|-------------|---------|
72+
| `agent_run(start, detach:true)` | Spawn worker in worktree |
73+
| `agent_run(wait, session_ids)` | Batch wait for completion |
74+
| `agent_run(poll, session_id)` | Check individual worker status |
75+
| `agent_run(steer, session_id)` | Inject instructions mid-execution |
76+
| `agent_run(cancel, session_id)` | Terminate timed-out worker |
77+
| `agent_manage(cleanup_sessions)` | Clean up after wave/epic |
7778

78-
Approval timeouts: file access 120s, spec conflict 120s, mutation 300s. On timeout → worker self-blocks and stops.
79+
Workers output structured status (STATUS/TASK_ID/SUMMARY/FILES_CHANGED/TESTS) that the coordinator parses from session output. `steer` replaces SendMessage for spec conflict resolution, file access grants, and cross-worker coordination.
7980

8081
## Testing
8182

@@ -132,18 +133,18 @@ Rust: clippy for linting, cargo test for tests. No TypeScript, no npm. Skills an
132133
- **Learning loop**: plan injects memory (Step 6), worker saves lessons (Phase 11, included in default sequence when memory.enabled is true), epic close prompts retro, retro verifies stale entries via `flowctl memory verify <id>`
133134
- **Task duration**: `flowctl done` auto-tracks `duration_seconds` from start to completion, rendered in evidence
134135
- **File ownership**: `flowctl task create --files <paths>` declares owned files; `flowctl files <id>` shows ownership map + conflict detection
135-
- **File locking (Teams)**: `flowctl lock --task <id> --files <paths>` acquires runtime file locks; `flowctl unlock --task <id>` releases on completion; `flowctl lock-check --file <path>` inspects lock state; `flowctl unlock --all` clears all locks between waves
136-
- **Agent Teams mode**: `/flow-code:go` (or legacy `/flow-code:work`) spawns workers as Agent Team teammates with plain-text protocol messages (summary-prefix routing: "Task complete:", "Spec conflict:", "Blocked:", "Need file access:", "New task:", "Access granted/denied:", native `shutdown_request`) and file lock enforcement
136+
- **File locking**: `flowctl lock --task <id> --files <paths>` acquires runtime file locks; `flowctl unlock --task <id>` releases on completion; `flowctl lock-check --file <path>` inspects lock state; `flowctl unlock --all` clears all locks between waves
137+
- **RP agent_run mode**: `/flow-code:go` spawns workers as RP agents via `agent_run` in isolated git worktrees registered as RP workspaces. Coordinator uses `wait`/`poll` for monitoring, `steer` for mid-execution coordination, and `cancel` for timeouts. Workers output structured status fields (STATUS/TASK_ID/SUMMARY/FILES_CHANGED). File lock enforcement via flowctl remains unchanged
137138
- **Adversarial review**: `flowctl codex adversarial --base main [--focus "area"]` runs Codex in adversarial mode — tries to break the code, not validate it. Returns SHIP/NEEDS_WORK with grounded findings
138139
- **Three-layer quality system**: Layer 1: `flowctl guard` (deterministic lint/type/test — runs at Worker Phase 6, wave checkpoint, and close phase). Layer 2: RP plan-review (code-aware spec validation, invoked via `/flow-code:go` plan-review phase — RP sees full codebase via context_builder). Layer 3: `flowctl codex adversarial` (cross-model adversarial, epic completion — different model family catches blind spots). Spec conflicts and blockers forwarded to Codex for autonomous decision-making.
139140
- **Review circuit breaker**: Plan review max 2 iterations, impl review max 3, epic review max 2 — prevents infinite NEEDS_WORK cycles. After max iterations, pipeline proceeds with warning
140141
- **Review backend resolution**: All review phases use the same priority chain: `--review` flag > `FLOW_REVIEW_BACKEND` env > `.flow/config.json` > default `none`. The `--no-review` flag is equivalent to `--review=none` and always wins
141142
- **Auto-improve analysis-driven**: generates custom program.md from codebase analysis (hotspots, lint, coverage, memory) with Action Catalog ranked by impact — not static templates
142143
- **Auto-improve quantitative**: captures before/after metrics per experiment, commit messages include delta `[lint:23→21]`
143144
- **Worker self-review**: Phase 6 runs guard + structured diff review (correctness, quality, performance, testing) before commit
144-
- **Plan auto-execute**: `/flow-code:go` (or legacy `/flow-code:plan`) defaults to auto-execute work after planning (Teams mode handles any task count); `--plan-only` to opt out
145+
- **Plan auto-execute**: `/flow-code:go` (or legacy `/flow-code:plan`) defaults to auto-execute work after planning (RP agent_run handles any task count); `--plan-only` to opt out
145146
- **Goal-backward verification**: worker Phase 10 re-reads acceptance criteria and verifies each is actually satisfied before completing
146-
- **Full-auto by default**: `/flow-code:go` requires zero interactive questions — AI reads git state, `.flow/` config, and request context to make branch, review, and research decisions autonomously. Default mode is Worktree + Teams + Phase-Gate (all three active). Work resumes from `.flow/` state on every startup (not a special "resume mode"). All tasks done → auto push + draft PR (`--no-pr` to skip)
147+
- **Full-auto by default**: `/flow-code:go` requires zero interactive questions — AI reads git state, `.flow/` config, and request context to make branch, review, and research decisions autonomously. Default mode is Worktree + RP agent_run + Phase-Gate (all three active). Work resumes from `.flow/` state on every startup (not a special "resume mode"). All tasks done → auto push + draft PR (`--no-pr` to skip)
147148
- **Cross-platform**: flowctl is a single Rust binary (macOS/Linux). RP plan-review auto-degrades to Codex on platforms where rp-cli is unavailable. Bash hooks degrade gracefully on Windows (skip, don't block)
148149
- **Session start**: CLAUDE.md instruction (not an enforced hook) — if `.flow/` exists, run `flowctl status --interrupted` to check for unfinished work from a previous session and resume with the suggested `/flow-code:work <id>` command
149150
- **DAG cycle detection**: `flowctl dep add` validates that adding a dependency does not create a cycle in the task dependency graph. If a cycle would be created, the command fails with an error. The DAG is validated using topological sort via the `petgraph` crate

0 commit comments

Comments
 (0)