How kesteva/cyboflow works
Purpose and entry points
Cyboflow is a self-contained macOS Electron desktop application for orchestrating multi-agent software workflows over local Git repositories. It supports built-in Planner, Sprint, Compound, Ship, verification setup, custom workflows, and ad-hoc sessions. Electron starts in main/src/index.ts; the privileged bridge is main/src/preload.ts; the React renderer starts at frontend/src/main.tsx and renders from frontend/src/App.tsx.
Desktop boundary and API surface
The renderer does not directly own filesystem, processes, Git, or persistence. It calls typed APIs through Electron IPC and tRPC: IPC registration/handlers live in main/src/ipc/index.ts and main/src/ipc/cyboflow.ts; the orchestrator-facing RPC router is main/src/orchestrator/trpc/router.ts, with renderer client wiring in frontend/src/trpc/client.ts. This is the primary trust boundary between UI and local-machine capabilities.
Workflow orchestration
main/src/orchestrator/Orchestrator.ts is the central application coordinator. It launches, resumes, pauses, retries, rewinds, cancels, and recovers runs; main/src/orchestrator/runLauncher.ts and main/src/orchestrator/runExecutor.ts drive execution. Workflow definitions, built-in bundles, agents, and prompt rendering are represented by main/src/orchestrator/workflowRegistry.ts, main/src/orchestrator/workflows/workflowBundle.ts, and main/src/orchestrator/workflowPromptRenderer.ts. Runs can use programmatic DAG-like control and human/visual gates via main/src/orchestrator/programmatic/workflowController.ts.
Agent execution substrates and event ingestion
Each isolated session can run Claude Code through SDK/chat or interactive PTY paths. Substrate selection/dispatch is handled by main/src/services/substrateDispatchFacade.ts; Claude process management is in main/src/services/panels/claude/claudeCodeManager.ts; Codex SDK/PTY support exists in main/src/services/panels/codex/codexSdkManager.ts and main/src/services/panels/codex/codexPtyManager.ts. Provider stream events are normalized, persisted/projected, and routed to orchestration/UI through main/src/services/streamParser/eventRouter.ts, main/src/services/streamParser/messageProjection.ts, and main/src/orchestrator/runEventBridge.ts.
State, isolation, and local infrastructure
SQLite is the durable system of record, with schema/migration evolution in main/src/database/database.ts, main/src/database/schema.sql, and main/src/database/migrations/. It stores projects, sessions, runs, workflow steps, tasks, review items, artifacts, usage, experiments, and integrations. Git worktrees isolate parallel work through main/src/services/worktreeManager.ts; Git status/diffs are managed by main/src/services/gitStatusManager.ts and main/src/services/gitDiffManager.ts. Terminal/PTY lifecycle is managed in main/src/services/terminalSessionManager.ts.
Human control, review, and verification
Agent permissions, questions, approvals, and review items are first-class workflow gates. Core routing/bridges reside in main/src/orchestrator/approvalRouter.ts, main/src/orchestrator/questionRouter.ts, and main/src/orchestrator/reviewItemRouter.ts. The renderer’s central operational surfaces include frontend/src/components/ReviewQueueView.tsx and frontend/src/components/cyboflow/RunView.tsx. Verification is a separate scheduling pipeline with runbook, snapshot, dependency, agent, and verdict stages in main/src/orchestrator/verify/verificationScheduler.ts, main/src/orchestrator/verify/runbookStore.ts, and main/src/orchestrator/verify/verdictDelivery.ts.
Renderer composition and integrations
The React UI is state-store driven; workflow/run/session state centers on frontend/src/stores/cyboflowStore.ts, frontend/src/stores/sessionStore.ts, and frontend/src/stores/workflowsStore.ts. The Cyboflow workspace root and workflow editor are frontend/src/components/cyboflow/CyboflowRoot.tsx and frontend/src/components/cyboflow/WorkflowEditorModal.tsx; task planning is surfaced through frontend/src/components/BacklogPane.tsx. External/local integrations include Claude Code, Codex runtimes, MCP via main/src/orchestrator/mcpServer/cyboflowMcpServer.ts, Linear and Plane tracker sync via main/src/services/trackerSync/trackerSyncService.ts, visual verification using Playwright/Peekaboo adapters, and Electron auto-updates via main/src/services/appUpdater.ts.
Main entry points: Orchestrator.ts Orchestrator · runExecutor.ts Run launcher & executor · eventRouter.ts Event ingestion & bridge · App.tsx React application
Components 21
React renderer
Operational UI and state stores.
- React application
frontend/src/App.tsx - tRPC client
frontend/src/trpc/client.ts - Workflow/run stores
frontend/src/stores/cyboflowStore.ts - Cyboflow workspace
frontend/src/components/cyboflow/CyboflowRoot.tsx - Review queue & run view
frontend/src/components/ReviewQueueView.tsx
Electron boundary
Typed privileged API boundary.
- Electron main
main/src/index.ts - Preload bridge
main/src/preload.ts - IPC handlers
main/src/ipc/index.ts - Orchestrator RPC router
main/src/orchestrator/trpc/router.ts
Workflow orchestration
Run coordination, definitions, and human gates.
- Orchestrator · Launches, resumes, controls, and recovers workflow runs.
main/src/orchestrator/Orchestrator.ts - Run launcher & executor
main/src/orchestrator/runExecutor.ts - Workflow registry
main/src/orchestrator/workflowRegistry.ts - Workflow controller
main/src/orchestrator/programmatic/workflowController.ts - Approval, question & review routers
main/src/orchestrator/approvalRouter.ts - Verification pipeline · Schedules runbook, snapshot, dependency, agent, and verdict stages.
main/src/orchestrator/verify/verificationScheduler.ts
Local execution
Agent runtimes, Git isolation, and event processing.
- Substrate dispatch
main/src/services/substrateDispatchFacade.ts - Claude & Codex runtimes
main/src/services/panels/claude/claudeCodeManager.ts - Event ingestion & bridge · Projects provider events to durable state, orchestration, and UI.
main/src/services/streamParser/eventRouter.ts - Git worktree isolation
main/src/services/worktreeManager.ts
Durable state & integrations
SQLite record and external/local integrations.
- SQLite system of record · Stores projects, sessions, runs, steps, tasks, artifacts, and integrations.
main/src/database/database.ts - MCP, trackers & updates
main/src/orchestrator/mcpServer/cyboflowMcpServer.ts
Connections 25
- Electron main → Preload bridge: loads
- Electron main → IPC handlers: registers
- Preload bridge → React application: exposes APIs to
- React application → Cyboflow workspace: renders
- Cyboflow workspace → Workflow/run stores: reads and updates
- Review queue & run view → Approval, question & review routers: resolves gates via
- React application → tRPC client: uses
- tRPC client → Orchestrator RPC router: typed RPC
- IPC handlers → Orchestrator: local commands
- Orchestrator RPC router → Orchestrator: orchestration calls
- Orchestrator → Run launcher & executor: drives
- Orchestrator → Workflow registry: loads workflows
- Run launcher & executor → Workflow controller: executes control flow
- Workflow controller → Approval, question & review routers: creates gates
- Run launcher & executor → Substrate dispatch: dispatches agents
- Run launcher & executor → Git worktree isolation: uses isolated worktrees
- Substrate dispatch → Claude & Codex runtimes: selects runtime
- Claude & Codex runtimes → Event ingestion & bridge: streams events
- Event ingestion & bridge → Orchestrator: run events
- Event ingestion & bridge → Workflow/run stores: projects updates
- Orchestrator → Verification pipeline: schedules verification
- Orchestrator → SQLite system of record: persists runs
- Event ingestion & bridge → SQLite system of record: persists events
- Verification pipeline → SQLite system of record: stores verdicts
- Orchestrator → MCP, trackers & updates: uses