You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AgentFlow solves a real problem: agents need structured task management and humans need visibility into what agents are doing. The current implementation proves the concept works, but the deployment model creates friction that limits adoption:
Separate Python process to manage alongside the agent runtime
CLI bridge for plugin operations (every tool call spawns a subprocess)
Text-based tool output that agents must parse instead of structured JSON
Meanwhile, the valuable parts — task lifecycle state machine, scoring formula, audit trail, stage-first workflow — are buried in implementation details.
Goal: Make AgentFlow a zero-config, install-and-use OpenClaw native plugin while preserving its core design as a reusable task governance library.
Current State Analysis
What Works Well
Task lifecycle model — The status machine (pending → approved → in_progress → pr_ready → pr_open → merged) with validation is solid
Scoring formula — (priority * 2 + impact * 3) / max(1, effort) is simple and effective for queue prioritization
Claim/lease/heartbeat — The distributed-lock pattern for multi-agent coordination is well-designed
Audit trail — status_history, runs, run_steps, triggers provide full traceability
Gate system — Configurable quality gates with command execution is a good governance primitive
Web Console — Stage Board UI with drag-and-drop is a compelling human interface
SSE streaming — Real-time event delivery to the dashboard is well-implemented
What Creates Friction
Deployment weight — Python environment + separate server process + manual init
Plugin bridge fragility — execFile("python3", ...) for every tool call is slow and unreliable
Unstructured tool output — CLI text tables force agent to parse instead of reason
No auto-init — Users must manually create DB, projects before first use
AgentFlow becomes an OpenClaw plugin that you install once and forget. The agent uses it for task tracking, the human opens a dashboard to see what is happening. No separate processes, no manual setup.
Codex adapter: Standalone adapter for users without OpenClaw
Claude Code adapter: Standalone adapter for Claude Code users
GitHub Actions integration: Periodic issue discovery via CI
Multi-project dashboard: Cross-project view for users managing multiple repos
Effort: Ongoing
Design Decisions
D1: Keep SQLite, but embed it
SQLite is the right choice for a single-user task management tool:
Zero config (no separate DB server)
Fast for the expected scale (hundreds of tasks, not millions)
Single-file deployment (easy to backup, move, delete)
better-sqlite3 in TypeScript is battle-tested and synchronous (simpler code)
D2: Status machine is the core contract
The task lifecycle is AgentFlow's most valuable IP. It should be:
Documented as a stable contract
Implemented as a pure function (no I/O)
Portable across languages (Python, TypeScript, potentially others)
// The entire status machine in ~20 linesconstTRANSITIONS: Record<string,Set<string>>={pending: newSet(["approved","blocked","skipped"]),approved: newSet(["pending","in_progress","blocked","skipped"]),in_progress: newSet(["approved","pr_ready","blocked"]),pr_ready: newSet(["approved","pr_open","blocked"]),pr_open: newSet(["approved","merged","blocked"]),blocked: newSet(["pending","approved","skipped"]),merged: newSet(),skipped: newSet(),};functionscore(priority: number,impact: number,effort: number): number{return(priority*2+impact*3)/Math.max(1,effort);}
D3: Python CLI remains for standalone use
The TypeScript plugin is the primary path for OpenClaw users. The Python CLI remains for:
Standalone use (no OpenClaw installed)
Scripting and automation
Development and testing
The two share the same schema and can coexist (both read/write the same SQLite DB).
D4: Dashboard is a static file, not a framework
The current embedded HTML approach works. Moving to React/Svelte adds build tooling complexity without proportional benefit for a dashboard this size. Keep it as a single HTML file with vanilla JS.
D5: Auto-init is mandatory
A plugin that requires manual setup will not be adopted. First tool call must work without any prior configuration:
User: "help me track these 3 tasks"
Agent: [calls agentflow_create_task] → DB auto-created → task created → done
RFC: AgentFlow 2.0 — Zero-config Native Plugin for Agent Task Management
Motivation
AgentFlow solves a real problem: agents need structured task management and humans need visibility into what agents are doing. The current implementation proves the concept works, but the deployment model creates friction that limits adoption:
Meanwhile, the valuable parts — task lifecycle state machine, scoring formula, audit trail, stage-first workflow — are buried in implementation details.
Goal: Make AgentFlow a zero-config, install-and-use OpenClaw native plugin while preserving its core design as a reusable task governance library.
Current State Analysis
What Works Well
pending → approved → in_progress → pr_ready → pr_open → merged) with validation is solid(priority * 2 + impact * 3) / max(1, effort)is simple and effective for queue prioritizationstatus_history,runs,run_steps,triggersprovide full traceabilityWhat Creates Friction
execFile("python3", ...)for every tool call is slow and unreliablePOST /api/tasksfor task creation still missing (Feature: Add POST /api/tasks endpoint for programmatic task creation #5)Proposal
Vision
Architecture
Phase 1: Zero-config Python plugin (minimal changes)
Keep Python, but eliminate setup friction:
~/.agentflow/agentflow.dbdefaultprojectPOST /api/tasksendpointEffort: ~2-3 days
Issues: #5, #11, #12, #13, #15, #18, #22, #23
Phase 2: TypeScript native plugin (rewrite core)
Reimplement as a pure TypeScript OpenClaw plugin:
better-sqlite3(same schema, same queries, pure TS)openclaw plugin install agentflowEffort: ~1-2 weeks
Issues: #20, #21
Phase 3: Agent execution integration
sessions_spawnintegration for sub-agent dispatchEffort: ~1 week
Issues: #1, #8, #9, #10, #14, #16
Phase 4: Ecosystem
Effort: Ongoing
Design Decisions
D1: Keep SQLite, but embed it
SQLite is the right choice for a single-user task management tool:
better-sqlite3in TypeScript is battle-tested and synchronous (simpler code)D2: Status machine is the core contract
The task lifecycle is AgentFlow's most valuable IP. It should be:
D3: Python CLI remains for standalone use
The TypeScript plugin is the primary path for OpenClaw users. The Python CLI remains for:
The two share the same schema and can coexist (both read/write the same SQLite DB).
D4: Dashboard is a static file, not a framework
The current embedded HTML approach works. Moving to React/Svelte adds build tooling complexity without proportional benefit for a dashboard this size. Keep it as a single HTML file with vanilla JS.
D5: Auto-init is mandatory
A plugin that requires manual setup will not be adopted. First tool call must work without any prior configuration:
Success Metrics
Related Issues
Bugs & Security
Features (current)
Proposals (this RFC)
Call for Feedback
Specifically looking for input on:
This RFC is a living document. Please comment with feedback, concerns, or alternative proposals.