forge-auto

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

/forge-auto — FORGE Autopilot Mode

/forge-auto — FORGE Autopilot 模式

FORGE takes full control of the development pipeline. It analyzes, decides, executes, verifies, and iterates automatically until the objective is complete.
FORGE 全面掌控开发流水线。它会自动进行分析、决策、执行、验证和迭代,直至目标完成。

French Language Rule

法语语言规则

All content generated in French MUST use proper accents (é, è, ê, à, ù, ç, ô, î, etc.), follow French grammar rules (agreements, conjugations), and use correct spelling.
所有法语生成内容必须使用正确的重音符号(é, è, ê, à, ù, ç, ô, î等),遵循法语语法规则(配合、变位),并使用正确拼写。

Principle

核心原理

The user provides an objective → FORGE handles EVERYTHING else.
Planning → Architecture → Stories → Code → Tests → Verification → Deployment
用户提供目标 → FORGE 处理其余所有事项。
规划 → 架构设计 → 用户故事 → 代码开发 → 测试 → 验证 → 部署

Workflow

工作流程

  1. Load memory:
    • Read
      .forge/memory/MEMORY.md
      for project context
    • Read the latest session from
      .forge/memory/sessions/
      for continuity
    • Read
      .forge/sprint-status.yaml
      for the current state
    • Read
      .forge/config.yml
      for configuration
    • ~/.claude/scripts/forge-memory/forge-memory search "<current objective>" --limit 3
      → Load relevant past decisions and context
  2. Analyze state and determine the phase:
    The decision system follows this logic:
    IF no artifacts exist:
      → Start with /forge-plan (generates the PRD)
    
    IF PRD exists BUT no architecture:
      → Launch /forge-architect
    
    IF architecture exists BUT no UX design:
      → Launch /forge-ux
    
    IF UX exists BUT no stories:
      → Launch /forge-stories
    
    IF stories exist with "pending" status:
      → Count unblocked pending stories
      → IF 2+ unblocked stories AND Agent Teams available (CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1):
        → Delegate to /forge-team build [STORY-IDs] (parallel execution)
        → Wait for team completion, then continue with QA verdicts
      → ELSE:
        → Pick the next unblocked story
        → Launch /forge-build STORY-XXX (sequential)
    
    IF an "in_progress" story exists:
      → Resume /forge-build STORY-XXX
    
    IF story is implemented (Dev tests pass):
      → Launch /forge-verify STORY-XXX
    
    IF QA verdict = FAIL:
      → Increment failure counter for this story
      → IF failure counter < 3:
        → Fix and relaunch /forge-verify
      → IF failure counter >= 3:
        → Escalate to /forge-loop "Fix STORY-XXX: [QA failure summary]" --mode hitl
        → forge-loop iterates autonomously with sandbox guardrails until tests pass
        → On success: reset failure counter, continue with /forge-verify
    
    IF QA verdict = PASS:
      → Move to the next story
    
    IF all stories are "completed":
      → Propose /forge-deploy or new stories
  3. Execute with the appropriate agents:
    • Each phase invokes the corresponding agent (PM, Architect, UX, SM, Dev, QA)
    • The agent loads its persona from
      references/agents/
    • The agent produces its artifacts in
      docs/
      or
      src/
    • Agent Teams acceleration: when entering the build phase with 2+ unblocked stories, and
      CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1
      is set, autopilot delegates to
      /forge-team build
      for parallel story implementation (up to 4 Dev + 1 QA). If Agent Teams is not available, stories are built sequentially as before.
  4. Automatic quality gates:
    • After each story: lint + typecheck + tests > 80% coverage
    • After each /forge-verify: mandatory QA verdict
    • Loop escalation: if 3 consecutive failures on the same story, autopilot delegates to
      /forge-loop
      in HITL mode with the QA failure summary as task. forge-loop iterates with sandbox guardrails (cost cap, circuit breaker, rollback) until tests pass, then returns control to autopilot for re-verification.
    • Ultimate circuit breaker: if forge-loop also fails (hits its own circuit breaker) → pause + report to user
  5. Save memory:
    • Update
      .forge/memory/MEMORY.md
      with the current state
    • Create/update the session log
      .forge/memory/sessions/YYYY-MM-DD.md
    • Update
      .forge/sprint-status.yaml
  6. Human checkpoints (configurable):
    • Default: checkpoint after each major phase (plan, architecture, stories)
    • --no-pause
      mode: no checkpoints (full autopilot)
    • --pause-stories
      mode: pause after story decomposition
    • --pause-each
      mode: pause after each story
  1. 加载记忆:
    • 读取
      .forge/memory/MEMORY.md
      获取项目上下文
    • 读取
      .forge/memory/sessions/
      中的最新会话以保持连续性
    • 读取
      .forge/sprint-status.yaml
      获取当前状态
    • 读取
      .forge/config.yml
      获取配置信息
    • 执行
      ~/.claude/scripts/forge-memory/forge-memory search "<current objective>" --limit 3
      → 加载相关的过往决策和上下文
  2. 分析状态并确定阶段:
    决策系统遵循以下逻辑:
    IF 不存在任何工件:
      → 启动 /forge-plan(生成PRD)
    
    IF PRD已存在但无架构设计:
      → 启动 /forge-architect
    
    IF 架构设计已存在但无UX设计:
      → 启动 /forge-ux
    
    IF UX设计已存在但无用户故事:
      → 启动 /forge-stories
    
    IF 存在状态为"pending"的用户故事:
      → 统计未阻塞的待处理用户故事数量
      → IF 有2个及以上未阻塞故事且Agent Teams可用(CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1):
        → 委托给 /forge-team build [STORY-IDs](并行执行)
        → 等待团队完成,然后根据QA结果继续
      → ELSE:
        → 选择下一个未阻塞的用户故事
        → 启动 /forge-build STORY-XXX(串行执行)
    
    IF 存在状态为"in_progress"的用户故事:
      → 恢复 /forge-build STORY-XXX
    
    IF 用户故事已实现(开发测试通过):
      → 启动 /forge-verify STORY-XXX
    
    IF QA verdict = FAIL:
      → 增加该用户故事的失败计数器
      → IF 失败计数器 < 3:
        → 修复并重新启动 /forge-verify
      → IF 失败计数器 >= 3:
        → 升级至 /forge-loop "修复 STORY-XXX: [QA失败摘要]" --mode hitl
        → forge-loop 在沙箱防护下自主迭代直至测试通过
        → 成功后:重置失败计数器,继续执行 /forge-verify
    
    IF QA verdict = PASS:
      → 进入下一个用户故事
    
    IF 所有用户故事状态为"completed":
      → 提议执行 /forge-deploy 或创建新用户故事
  3. 调用对应Agent执行:
    • 每个阶段会调用对应的Agent(PM、架构师、UX、SM、开发、QA)
    • Agent从
      references/agents/
      加载其角色设定
    • Agent在
      docs/
      src/
      中生成工件
    • Agent Teams加速: 当进入构建阶段且有2个及以上未阻塞用户故事, 且已设置
      CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1
      时,自动驾驶模式会委托给
      /forge-team build
      进行并行用户故事实现(最多4个Dev + 1个QA)。 若Agent Teams不可用,则按之前的方式串行构建用户故事。
  4. 自动质量门禁:
    • 每个用户故事完成后:执行代码检查+类型检查+测试覆盖率>80%
    • 每次执行 /forge-verify 后:必须获取QA结果
    • 循环升级: 若同一个用户故事连续失败3次,自动驾驶模式会 委托给
      /forge-loop
      并以HITL模式运行,任务为QA失败摘要。 forge-loop 在沙箱防护(成本上限、断路器、回滚)下迭代 直至测试通过,然后将控制权交还给自动驾驶模式进行重新验证。
    • 终极断路器: 若forge-loop也失败(触发自身断路器) → 暂停并向用户报告
  5. 保存记忆:
    • 更新
      .forge/memory/MEMORY.md
      记录当前状态
    • 创建/更新会话日志
      .forge/memory/sessions/YYYY-MM-DD.md
    • 更新
      .forge/sprint-status.yaml
  6. 人工检查点(可配置):
    • 默认:每个主要阶段(规划、架构、用户故事)后设置检查点
    • --no-pause
      模式:无检查点(完全自动驾驶)
    • --pause-stories
      模式:用户故事分解后暂停
    • --pause-each
      模式:每个用户故事完成后暂停

Options

选项

bash
undefined
bash
undefined

Full autopilot — FORGE decides everything

完全自动驾驶 — FORGE 决定所有事项

/forge-auto
/forge-auto

Autopilot with a specific objective

带具体目标的自动驾驶

/forge-auto "Implement the authentication system"
/forge-auto "Implement the authentication system"

Autopilot without pauses (warning: fully autonomous)

无暂停的自动驾驶(警告:完全自主)

/forge-auto --no-pause
/forge-auto --no-pause

Autopilot with pause after stories

用户故事分解后暂停的自动驾驶

/forge-auto --pause-stories
/forge-auto --pause-stories

Autopilot with pause after each story

每个用户故事完成后暂停的自动驾驶

/forge-auto --pause-each
/forge-auto --pause-each

Resume autopilot after a pause

暂停后恢复自动驾驶

/forge-auto --resume
undefined
/forge-auto --resume
undefined

Progress Report

进度报告

At each step, FORGE displays:
FORGE AUTOPILOT — Progress
──────────────────────────────
Phase     : Development (Story 3/8)
Last      : STORY-002 ✓ (QA: PASS)
Current   : STORY-003 — Implementation
Next      : STORY-004 (pending)

Metrics:
  Stories   : 2 completed / 1 in_progress / 5 pending
  Tests     : 47 pass / 0 fail
  Coverage  : 87%

Memory    : .forge/memory/MEMORY.md (up to date)
Session   : .forge/memory/sessions/2025-01-15.md
在每个步骤中,FORGE会显示:
FORGE AUTOPILOT — Progress
──────────────────────────────
Phase     : Development (Story 3/8)
Last      : STORY-002 ✓ (QA: PASS)
Current   : STORY-003 — Implementation
Next      : STORY-004 (pending)

Metrics:
  Stories   : 2 completed / 1 in_progress / 5 pending
  Tests     : 47 pass / 0 fail
  Coverage  : 87%

Memory    : .forge/memory/MEMORY.md (up to date)
Session   : .forge/memory/sessions/2025-01-15.md

How /forge-auto Uses Other FORGE Tools

/forge-auto 如何使用其他FORGE工具

SituationAutopilot delegates toCondition
2+ unblocked stories ready
/forge-team build
(parallel)
Agent Teams enabled
1 story ready
/forge-build STORY-XXX
(sequential)
Always
3 consecutive failures on a story
/forge-loop
(iterative fix)
Always
forge-loop also failsPause + report to userUltimate circuit breaker
场景自动驾驶委托给条件
有2个及以上未阻塞用户故事
/forge-team build
(并行)
Agent Teams已启用
有1个待处理用户故事
/forge-build STORY-XXX
(串行)
始终生效
同一个用户故事连续失败3次
/forge-loop
(迭代修复)
始终生效
forge-loop也失败暂停并向用户报告终极断路器

Difference with /forge-loop

与 /forge-loop 的区别

Aspect/forge-loop/forge-auto
ScopeA specific taskThe entire project
DecisionThe user chooses the taskFORGE decides the next action
AgentsA single one (usually Dev)All agents depending on the phase
MemoryLocal fix_plan.mdPersistent project memory
ProgressionLinear (iterations)Full pipeline (plan → deploy)
Use case"Implement this feature""Build this project from A to Z"
RelationStandalone or called by autoCalls /forge-loop on difficult stories
维度/forge-loop/forge-auto
范围单个具体任务整个项目
决策用户选择任务FORGE决定下一步操作
Agent单个Agent(通常是Dev)根据阶段调用所有相关Agent
记忆本地fix_plan.md持久化项目记忆
推进方式线性(迭代)完整流水线(规划→部署)
使用场景"实现这个功能""从头到尾构建这个项目"
关系独立工具或被auto调用在处理复杂用户故事时调用/forge-loop

Coexistence with Manual Mode

与手动模式共存

Autopilot and manual commands are 100% compatible:
  • You can start with
    /forge-auto
    , pause, then continue manually
  • You can work manually then launch
    /forge-auto --resume
    to continue
  • Memory is shared: both modes read/write the same files
  • /forge-status
    works in both modes
自动驾驶模式和手动命令100%兼容:
  • 你可以先启动
    /forge-auto
    ,暂停后手动继续
  • 你可以先手动工作,然后启动
    /forge-auto --resume
    继续
  • 记忆是共享的:两种模式读写相同的文件
  • /forge-status
    在两种模式下都能正常工作

Notes

注意事项

  • Autopilot ALWAYS respects quality gates (no shortcuts)
  • The circuit breaker protects against infinite loops
  • Persistent memory ensures continuity between sessions
  • Compatible with projects initialized via
    /forge-init
  • Also works for resuming existing projects (analyzes the state)
  • 自动驾驶模式始终遵守质量门禁(无捷径)
  • 断路器可防止无限循环
  • 持久化记忆确保会话间的连续性
  • 与通过
    /forge-init
    初始化的项目兼容
  • 也可用于恢复现有项目(会分析当前状态)