How Dark Factory works

Task selection

Dark Factory selects tasks that are ready to start.

Isolated sessions

For each task, Agent Orchestrator creates an isolated worktree and starts a Codex session inside it.

Feature workflow

Archon guides that session through implementation, review, and merge preparation.

Delivery loop

Dark Factory orders and merges ready pull requests, cleans the completed feature's local resources, and continues until all tasks are complete.

Each feature gets its own AO worker, Codex session, worktree, services, and pull request.

Inside every feature

Archon executes the work. Dark Factory supervises the complete run.

Diagram key skill-name Agent skill

auto-feature

Archon workflow
  1. Start infrastructure wtc
  2. Start serversUses a helper from dev-start
  3. Plan the selected tasksuperpowers:writing-plans
  4. Implement + validatesuperpowers:subagent-driven-development
  5. Frontend QA when neededvercel-browser
  6. Mark task complete
  7. Commitcommit
  8. Open pull requestship

auto-merge

Custom skill

auto-squash

Custom skill
Loop
  1. Wait for a 5-minute quiet window
  2. auto-squash

    Archon workflow
    1. Check review comments + CI status Nothing to fix BREAK
    2. Scan the PRpr-scan
    3. Fix + validate
    4. Commit + pushcommit
    5. Resolve review threadspr-resolve

merge-gate

Archon workflow
Merge gate decision flow Ready work completes the gate. Stale or conflicting work is repaired, pushed, and checked again. Not-green or pending work retries auto-merge. Unsafe or failed repairs stop for recovery. Readiness check Check CI, freshness, and mergeability READY STALE CONFLICT Update branch Resolve conflicts fix-merge-conflicts Frontend affected? NO YES Browser QA vercel-browser Commit + push Readiness confirmed Merge PR on GitHub Human decision required Unsafe state or failed repair Automatic recovery Retry auto-merge

Dark Factory merge queue

Dark Factory integrates eligible pull requests one at a time and refreshes repository truth after every merge.

Merge queue

Dark Factory
Dark Factory merge queue flow Dark Factory orders eligible pull requests, verifies the next candidate, recovers an existing pull request when needed, finalizes ready work, reconciles repository state, and cleans each merged feature before re-evaluating the Task Graph, scheduling remaining work, or finishing the completed run. Collect eligible pull requests Build the queue, then refresh it after every merge Order the queue Task priority, then task ID Verify the next candidate Worker handoff · CI · branch freshness · mergeability Task status RECOVERY PATH READY UNSAFE Recover the existing PR Refresh PR state or resume auto-merge Finalize through auto-merge Update project state Update the AO session · refresh main · reread Task Graph Cleanup Clean resources for the merged feature More queued PRs? YES NO Check remaining tasks Reread the Task Graph and runtime state ALL TASKS COMPLETE Run finished All planned tasks are complete RECOVERY REQUIRED
MAKE PR READY FINALIZE WORK REMAINS