Zing Forum

Reading

Autofactory: An AI-Driven Code Automation Factory Based on Temporal

Autofactory is a fully automated code workflow system inspired by the AI dark factory model It uses Temporal for persistent workflow orchestration, supports multiple AI backends such as OpenCode, Codex, and Claude, and enables end-to-end DevOps automation from Issue classification to PR auto-merge.

AI自动化TemporalDevOps代码生成GitHub自动化CI/CDOpenCodeCodexClaude
Published 2026-05-09 00:45Recent activity 2026-05-09 00:54Estimated read 6 min
Autofactory: An AI-Driven Code Automation Factory Based on Temporal
1

Section 01

Autofactory: AI-Driven Code Automation Factory Based on Temporal (Introduction)

Autofactory is a fully automated code workflow system inspired by the AI dark factory model. It uses Temporal for persistent workflow orchestration, supports multiple AI backends (OpenCode, Codex, Claude), and enables end-to-end DevOps automation from Issue classification to PR auto-merge. It also supports GitHub/GitLab platforms and provides REST API integration.

2

Section 02

Project Background & Core Concept

The core vision of Autofactory is to introduce the "dark factory" (fully automated production without human intervention) concept into code development, aiming for end-to-end automation from Issue classification to PR verification and merge. Its tech stack prioritizes reliability and scalability: Temporal as workflow orchestration engine (ensures fault recovery), and multiple AI backends (OpenCode, Codex, Claude) for flexible choice based on needs and cost.

3

Section 03

Architecture Design & Core Workflows

Architecture: Autofactory uses a master-subagent pattern (Orchestrator for task decomposition/coordination; Subagents for specific tasks) following "Spec→Plan→Implementation↔Reviews" workflow. Temporal ensures workflow state recovery, long-task progress retention, concurrent resource sharing, and horizontal scaling. It supports pluggable AI backends with respective CLI installations:

  • OpenCode: npm install -g opencode-ai
  • Codex: npm install -g @openai/codex
  • Claude Code: npm install -g @anthropic-ai/claude-code

Core Workflows:

  1. @factory triggered PR creation (semi-automated: user mentions @factory→analyze Issue→AI plan→code implementation→create PR→wait human review).
  2. Fully automatic pipeline (no human intervention: auto Issue classification→AI plan→implement→create PR→run tests→auto fix→merge if passed).
4

Section 04

Multi-platform Support & Deployment Details

Multi-platform: Supports GitHub and GitLab. Configuration:

Platform Host Config Auth Method
GitHub Configurable via factory.github.host GITHUB_TOKEN (env var)
GitLab Configurable via factory.gitlab.host GITLAB_TOKEN (env var)
Both support full pipeline.

Deployment: System requirements: Node.js≥20, pnpm≥9, Docker, AI CLI tools. One-click install via install.sh (generates .env). Startup steps: edit .env→run start.sh→trigger workflow with pnpm autofactory run --repo .... State is persisted in ~/.autofactory/ (logs, workspaces, cost tracking).

5

Section 05

Practical Applications & Cost Considerations

Applications:

  1. Open source project maintenance (auto classify Issues, generate PRs for simple tasks).
  2. Internal tool development (handle small features/bugs).
  3. Document updates (auto fix outdated docs).
  4. Dependency updates (auto create PRs, test, merge).

Cost: AI backend calls incur fees; cost tracking is built-in (records LLM token usage in ~/.autofactory/costs/). Users can set workflow triggers based on budget (e.g., only specific Issue tags).

6

Section 06

Summary & Future Outlook

Autofactory explores the frontier of AI-driven software development automation. It combines Temporal's reliability, multi-AI flexibility, and well-designed orchestration to demonstrate the feasibility of "AI dark factory" in code development. Currently in active development, it's suitable for teams exploring AI automation potential. As AI improves and costs decrease, such tools may become standard, freeing developers from repetitive work to focus on creative tasks like architecture design and problem-solving.