Agent Flow Plugin
Transform Claude Code into a multi-agent orchestrated system with verification gates.
Features
- Specialized Agent Delegation: Route tasks to expert agents (Riko, Senku, Loid, Lawliet, Alphonse, Speedwagon)
- Mandatory Verification Gates: Stop hooks ensure tests pass before task completion
- Domain Expertise: Skills provide guidance on task classification and verification
- Cost-Aware Model Selection: Opus for planning (Senku), Sonnet for exploration/execution/review/verification
- Knowledge Graph Integration: Graphify MCP server gives Riko/Senku/Lawliet structural codebase queries (blast-radius, communities, shortest path)
- Personal Knowledge Base: Personal-kb MCP server surfaces cross-project prior decisions and patterns for Riko/Senku/Lawliet
- Codex Co-Review (optional): When the Codex CLI is installed and authenticated, Phase 4 routes the diff to OpenAI's Codex as a second reviewer alongside Lawliet, with availability-gated fallback. The Codex timeout is configurable via
AGENT_FLOW_CODEX_TIMEOUT (seconds, default 480). See Using Codex Co-Review.
- Session-History Search: AgentsView MCP server lets Riko/Senku/Lawliet search prior sessions to leverage past approaches and cross-verify current handling
The graphify and agentsview MCP servers are declared under mcpServers in .claude-plugin/plugin.json (there is no root .mcp.json: it doubled as project-scope config when developing in this repo, where ${CLAUDE_PLUGIN_ROOT} is unset, causing ENOENT).
Prerequisites
| Requirement | Version | Purpose |
|---|
| Claude Code CLI | latest | Plugin host |
| Bash | 3.2+ (macOS default) | Hook scripts |
jq | any | Plugin validation + hook scripts |
git | any | Installation |
Python 3.9+ with graphifyy[mcp] | optional | Knowledge graph queries (install via pipx install graphifyy && pipx inject graphifyy mcp) |
agentsview CLI | optional | Session-history search for prior-experience recall |
Installation
Method 0: Claude Code Marketplace (Recommended)
/plugin marketplace add josix/agent-flow
/plugin install agent-flow@josix-plugins
Method 1: Local Plugin Directory (Development)
claude --plugin-dir /path/to/agent-flow
Method 2: Git Clone
git clone https://github.com/josix/agent-flow.git
cd agent-flow
claude --plugin-dir .
New to agent-flow? Walk through your first orchestration — a fresh-repo demo of the /orchestrate pipeline.
Validating Your Installation
Before running your first orchestration, verify the plugin is wired up correctly:
bash scripts/validate-plugin.sh
The script runs 19 checks covering:
plugin.json and hooks/hooks.json are valid JSON
- All agent, skill, and command frontmatter parse correctly
- Hook scripts exist, are executable, and have valid syntax
validate-changes.sh guardrails: path traversal, sensitive files, and system paths are blocked; valid writes are allowed
- Unit test suites for
ensure-gitignore.sh, verify-completion.sh, dispatch-codex-review.sh, init-state escaping, and the research-report scripts
- Lawliet verdict-enum regression guard (Test 16): asserts
agents/Lawliet.md still declares [APPROVED | NEEDS_CHANGES] and never emits BLOCKED
- Workflow scenario tests for
implement-review-verify.js (needs node)
- Unit tests for
compile-explain.sh and compile-deep-dive.sh
If all checks pass, you see: ✓ All tests passed.
Commands
/deep-dive
Gather comprehensive codebase context using parallel exploration agents. Creates a reusable context file that accelerates subsequent orchestration tasks.
/deep-dive # Full codebase exploration
/deep-dive --focus=src/auth # Focus on specific path
/deep-dive --refresh # Refresh existing context
Output: .claude/deep-dive.local.md - Ephemeral, session-scoped context file
Workflow:
- Fire 8 parallel Riko agents exploring different aspects (structure, conventions, anti-patterns, purpose & use cases, key flows, etc.)
- Senku synthesizes findings into unified context
- Compile output to structured markdown — including what the project is, why it exists, and how it flows end-to-end
Integration with /orchestrate:
/orchestrate --use-deep-dive Add user authentication
When used with --use-deep-dive, orchestration leverages existing context to skip redundant exploration.
/orchestrate
Coordinate complex multi-step tasks through the agent system:
- Riko explores the codebase for context
- Senku creates an implementation plan
- Loid implements the changes
- Lawliet reviews code quality, with Codex as an optional co-reviewer
- Alphonse runs verification gates — in parallel with step 4