archon
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseArchon CLI Skill
Archon CLI 技能
Archon is a remote agentic coding platform that runs AI workflows in isolated git worktrees. This skill teaches you how to run workflows, create new workflows and commands, and manage Archon configuration.
Archon是一个远程智能编码平台,可在隔离的Git工作树中运行AI工作流。本技能将教你如何运行工作流、创建新的工作流和命令,以及管理Archon配置。
Available Workflows (live)
可用工作流(实时)
!
archon workflow list 2>&1 || echo "Archon CLI not installed. Read guides/setup.md to set it up."!
archon workflow list 2>&1 || echo "Archon CLI not installed. Read guides/setup.md to set it up."Routing
路由规则
Determine the user's intent and dispatch to the appropriate guide:
| Intent | Action |
|---|---|
| Setup / install / "how to use" | Read |
| Config / settings | Read |
| Initialize .archon/ in a repo | Read |
| Create a workflow | Read |
| Quick parameter lookup — which field works on which node type | Read |
| Advanced features (hooks/MCP/skills) | Read |
| Create a command file | Read |
| Variable substitution reference | Read |
| CLI command reference | Read |
| Run an interactive workflow | Read |
| Workflow good practices / anti-patterns | Read |
| Troubleshoot a failing / stuck workflow | Read |
| Run a workflow (default) | Continue with "Running Workflows" below |
If the intent is ambiguous, ask the user to clarify.
判断用户意图并分配至对应指南:
| 意图 | 操作 |
|---|---|
| 搭建/安装/"使用方法" | 阅读 |
| 配置/设置 | 阅读 |
| 在仓库中初始化.archon/ | 阅读 |
| 创建工作流 | 阅读 |
| 快速参数查询——哪些字段适用于哪种节点类型 | 阅读 |
| 高级功能(钩子/MCP/技能) | 阅读 |
| 创建命令文件 | 阅读 |
| 变量替换参考 | 阅读 |
| CLI命令参考 | 阅读 |
| 运行交互式工作流 | 阅读 |
| 工作流最佳实践/反模式 | 阅读 |
| 故障排查(失败/卡住的工作流) | 阅读 |
| 运行工作流(默认) | 继续阅读下方的"运行工作流"章节 |
若意图不明确,请询问用户以澄清。
Richer Context: archon.diy
更多上下文:archon.diy
The references in this skill are a distilled subset. The full, canonical docs live at archon.diy (Starlight site from ). If the skill's reference pages don't cover what you need — an edge case, a worked example, a diagram, a deeper section on a feature — fetch the matching page from archon.diy.
packages/docs-web/本技能中的参考内容是提炼后的子集。完整的官方文档托管在 archon.diy(基于的Starlight站点)。如果本技能的参考页面未覆盖你的需求——比如边缘案例、完整示例、图表、功能深度解析——请从archon.diy获取对应页面。
packages/docs-web/When to reach for the live docs
何时使用在线文档
- You need an end-to-end example that's longer than what the skill shows (e.g. full patterns for hooks, MCP config, sandbox schema, approval flows)
- You're explaining a concept to the user and want the most readable framing (the series is written as a tutorial, not a reference)
book/ - You hit a feature the skill only mentions in passing (e.g. inline sub-agents, advanced Codex options, the full SyncHookJSONOutput schema)
agents: - The user asks "where is this documented?" — point them at the archon.diy URL, not a skill file path
- 你需要比本技能展示更长的端到端示例(例如钩子、MCP配置、沙箱 schema、审批流程的完整模式)
- 你需要向用户解释概念并希望使用最易读的表述(系列为教程式编写,而非参考文档)
book/ - 你遇到本技能仅提及的功能(例如内联子代理、高级Codex选项、完整的SyncHookJSONOutput schema)
agents: - 用户询问"此功能在哪里有文档?"——指向archon.diy的URL,而非技能文件路径
URL map
URL映射
| Topic | URL |
|---|---|
| Landing + install | archon.diy |
| Getting started (installation, quick start, concepts) | archon.diy/getting-started/ |
| The book (tutorial-style walkthrough) | archon.diy/book/ |
| Workflow authoring guide | archon.diy/guides/authoring-workflows/ |
| Command authoring guide | archon.diy/guides/authoring-commands/ |
| Node type guides | archon.diy/guides/loop-nodes/, /approval-nodes/, /script-nodes/ |
| Per-node features (Claude only) | /hooks/, /mcp-servers/, /skills/ |
| Global workflows/commands/scripts | archon.diy/guides/global-workflows/ |
| Variables reference | archon.diy/reference/variables/ |
| CLI reference | archon.diy/reference/cli/ |
Security model (env, sandbox, target-repo | archon.diy/reference/security/ |
| Architecture | archon.diy/reference/architecture/ |
Configuration ( | archon.diy/reference/configuration/ |
| Troubleshooting | archon.diy/reference/troubleshooting/ |
| Adapter setup (Slack/Telegram/GitHub/Web/Discord/Gitea/GitLab) | archon.diy/adapters/ |
| Deployment (Docker, cloud, Windows) | archon.diy/deployment/ |
URL shape is — the paths mirror the filenames under .
archon.diy/<section>/<page>/packages/docs-web/src/content/docs/| 主题 | URL |
|---|---|
| 首页 + 安装 | archon.diy |
| 入门指南(安装、快速开始、概念) | archon.diy/getting-started/ |
| 教程书籍(分步讲解) | archon.diy/book/ |
| 工作流创作指南 | archon.diy/guides/authoring-workflows/ |
| 命令创作指南 | archon.diy/guides/authoring-commands/ |
| 节点类型指南 | archon.diy/guides/loop-nodes/、/approval-nodes/、/script-nodes/ |
| 节点专属功能(仅Claude) | /hooks/、/mcp-servers/、/skills/ |
| 全局工作流/命令/脚本 | archon.diy/guides/global-workflows/ |
| 变量参考 | archon.diy/reference/variables/ |
| CLI参考 | archon.diy/reference/cli/ |
安全模型(环境变量、沙箱、目标仓库 | archon.diy/reference/security/ |
| 架构 | archon.diy/reference/architecture/ |
配置( | archon.diy/reference/configuration/ |
| 故障排查 | archon.diy/reference/troubleshooting/ |
| 适配器搭建(Slack/Telegram/GitHub/Web/Discord/Gitea/GitLab) | archon.diy/adapters/ |
| 部署(Docker、云服务、Windows) | archon.diy/deployment/ |
URL格式为 —— 路径与下的文件名一致。
archon.diy/<section>/<page>/packages/docs-web/src/content/docs/Precedence
优先级
This skill's reference pages are the primary source for routine workflow authoring, CLI use, and setup. Reach for archon.diy when the skill is incomplete for your case — don't go to the live docs first by default (skill refs load into context faster and are tuned for agents).
本技能的参考页面是日常工作流创作、CLI使用和搭建的主要来源。仅当本技能内容不足以满足需求时,再使用archon.diy——不要默认优先使用在线文档(技能参考加载到上下文的速度更快,且针对Agent进行了优化)。
Running Workflows
运行工作流
Core Command
核心命令
bash
archon workflow run <workflow-name> --branch <branch-name> "<message>"CRITICAL RULES:
-
Always run in background — Archon workflows are long-running. Always invoke the Bash tool with. Use
run_in_background: trueor the TaskOutput tool to check on progress./tasks -
Always use worktree isolation — Use theflag unless the user explicitly requests otherwise. This creates an isolated environment so Archon works without affecting the main branch.
--branch -
One workflow per shell — Each workflow blocks its shell. Run multiple workflows as separate background tasks.
bash
archon workflow run <workflow-name> --branch <branch-name> "<message>"关键规则:
-
始终在后台运行 —— Archon工作流运行时间较长。调用Bash工具时务必使用。使用
run_in_background: true或TaskOutput工具检查进度。/tasks -
始终使用工作树隔离 —— 除非用户明确要求,否则使用标志。这会创建一个隔离环境,确保Archon工作时不会影响主分支。
--branch -
每个Shell运行一个工作流 —— 每个工作流会阻塞其所在Shell。将多个工作流作为独立的后台任务运行。
Isolation Modes
隔离模式
| Mode | Flag | When to Use |
|---|---|---|
| Worktree (Default) | | Always use this unless told otherwise |
| Custom start-point | | Start from a specific branch |
| Direct checkout | | Only if user explicitly requests no isolation |
| Resume failed run | | Resume from the last failure point |
| 模式 | 标志 | 使用场景 |
|---|---|---|
| 工作树(默认) | | 除非另有指示,否则始终使用此模式 |
| 自定义起始点 | | 从特定分支开始 |
| 直接检出 | | 仅当用户明确要求不隔离时使用 |
| 恢复失败的运行 | | 从上一次失败点恢复运行 |
Workflow Selection
工作流选择
Match the user's intent to a workflow from the live list above. Common patterns:
| User Intent | Typical Workflow | Branch Pattern |
|---|---|---|
| "Fix issue #X" / "Resolve bug" | | |
| "Review PR #X" / "Full review" | | |
| "Quick review PR #X" | | |
| "Validate PR #X" / "Check PR" | | |
| "Implement from plan" | | |
| "Plan and implement feature" | | |
| "Execute plan file" | | |
| "Run ralph" / "Implement PRD" | | |
| "Resolve conflicts" | | |
| "Create issue" / "File a bug" | | |
| "Review issue #X fully" | | |
| "Refactor safely" | | |
| "Architecture review" | | |
| "PIV loop" / "guided dev" | | |
| "Create a PRD" / "interactive PRD" | | |
| General / debugging | | |
⚡ = Interactive workflow — requires the transparent relay protocol. Read before running.
references/interactive-workflows.mdIf no specific workflow matches, use as the fallback. The live workflow list above is always authoritative — it may include workflows not in this table.
archon-assist将用户意图与上方的实时工作流列表匹配。常见模式:
| 用户意图 | 典型工作流 | 分支模式 |
|---|---|---|
| "修复问题#X" / "解决bug" | | |
| "审核PR #X" / "全面审核" | | |
| "快速审核PR #X" | | |
| "验证PR #X" / "检查PR" | | |
| "根据方案实现功能" | | |
| "规划并实现功能" | | |
| "执行方案文件" | | |
| "运行ralph" / "实现PRD" | | |
| "解决冲突" | | |
| "创建问题" / "提交bug" | | |
| "全面审核问题#X" | | |
| "安全重构" | | |
| "架构审核" | | |
| "PIV循环" / "引导式开发" | | |
| "创建PRD" / "交互式PRD" | | |
| 通用/调试 | | |
⚡ = 交互式工作流 —— 需要透明中继协议。运行前请阅读。
references/interactive-workflows.md若没有匹配的特定工作流,使用作为备选。上方的实时工作流列表始终是权威的——可能包含本表未列出的工作流。
archon-assistMulti-Issue Invocation
多任务调用
When the user mentions multiple issues, PRs, or tasks — run each as a separate background task:
bash
undefined当用户提及多个问题、PR或任务时——将每个任务作为独立的后台任务运行:
bash
undefinedEach gets its own worktree — they won't conflict
每个任务都有独立的工作树——不会冲突
archon workflow run archon-fix-github-issue --branch fix/issue-10 "Fix issue #10"
archon workflow run archon-fix-github-issue --branch fix/issue-11 "Fix issue #11"
archon workflow run archon-fix-github-issue --branch fix/issue-12 "Fix issue #12"
Never combine multiple issues into a single command.
---archon workflow run archon-fix-github-issue --branch fix/issue-10 "Fix issue #10"
archon workflow run archon-fix-github-issue --branch fix/issue-11 "Fix issue #11"
archon workflow run archon-fix-github-issue --branch fix/issue-12 "Fix issue #12"
切勿将多个任务合并到单个命令中。
---Other CLI Commands
其他CLI命令
bash
archon workflow list # List all available workflows
archon workflow list --json # Machine-readable JSON
archon isolation list # Show active worktree environments
archon isolation cleanup # Remove stale worktrees (default: 7 days)
archon isolation cleanup --merged # Remove branches merged into main
archon complete <branch> # Complete branch lifecycle (remove worktree + branches)
archon version # Show version infoFor the full CLI reference with all flags: Read
references/cli-commands.mdbash
archon workflow list # 列出所有可用工作流
archon workflow list --json # 机器可读的JSON格式
archon isolation list # 显示活跃的工作树环境
archon isolation cleanup # 移除过期工作树(默认:7天)
archon isolation cleanup --merged # 移除已合并到主分支的分支
archon complete <branch> # 完成分支生命周期(移除工作树+分支)
archon version # 显示版本信息如需包含所有标志的完整CLI参考:阅读
references/cli-commands.mdAuthoring Quick Start
创作快速入门
Archon uses a single workflow format: nodes (DAG). Workflows are YAML files in .
.archon/workflows/IMPORTANT: The examples below are starting points. Always design the workflow around what the user actually needs — the number of nodes, their types, dependencies, and configuration should match the user's requirements, not these templates.
Archon使用单一工作流格式:节点(DAG)。工作流是目录下的YAML文件。
.archon/workflows/重要提示:以下示例为起始模板。请始终根据用户实际需求设计工作流——节点数量、类型、依赖关系和配置应匹配用户需求,而非这些模板。
Workflow Structure
工作流结构
yaml
name: my-workflow
description: What this workflow does
provider: claude # Optional: 'claude' or 'codex'
model: sonnet # Optional: model override
nodes:
- id: first-node
command: my-command # Loads .archon/commands/my-command.md
- id: second-node
prompt: "Use the output: $first-node.output"
depends_on: [first-node]yaml
name: my-workflow
description: What this workflow does
provider: claude # 可选:'claude'或'codex'
model: sonnet # 可选:模型覆盖
nodes:
- id: first-node
command: my-command # 加载.archon/commands/my-command.md
- id: second-node
prompt: "Use the output: $first-node.output"
depends_on: [first-node]Node Types
节点类型
Each node has exactly ONE of: , , , , , , or .
commandpromptbashscriptloopapprovalcancelCommand node — runs a file:
.archon/commands/*.mdyaml
- id: investigate
command: investigate-issuePrompt node — inline AI prompt:
yaml
- id: classify
prompt: "Classify this issue: $ARGUMENTS"
model: haiku
allowed_tools: []Bash node — shell script, no AI, stdout captured as output:
yaml
- id: fetch-data
bash: "gh issue view 42 --json title,body"
timeout: 15000Script node — TypeScript/JavaScript (via ) or Python (via ), no AI, stdout captured as output:
bunuvyaml
- id: transform
script: |
const raw = process.argv.slice(2).join(' ') || '{}';
console.log(JSON.stringify({ parsed: JSON.parse(raw) }));
runtime: bun # 'bun' (.ts/.js) or 'uv' (.py) — REQUIRED
timeout: 30000 # Optional, ms, default 120000每个节点必须包含以下类型之一:、、、、、或。
commandpromptbashscriptloopapprovalcancel命令节点 —— 运行文件:
.archon/commands/*.mdyaml
- id: investigate
command: investigate-issue提示节点 —— 内联AI提示:
yaml
- id: classify
prompt: "Classify this issue: $ARGUMENTS"
model: haiku
allowed_tools: []Bash节点 —— Shell脚本,无AI,标准输出会被捕获为输出:
yaml
- id: fetch-data
bash: "gh issue view 42 --json title,body"
timeout: 15000脚本节点 —— TypeScript/JavaScript(通过)或Python(通过),无AI,标准输出会被捕获为输出:
bunuvyaml
- id: transform
script: |
const raw = process.argv.slice(2).join(' ') || '{}';
console.log(JSON.stringify({ parsed: JSON.parse(raw) }));
runtime: bun # 'bun'(.ts/.js)或'uv'(.py)—— 必填
timeout: 30000 # 可选,毫秒,默认120000Or reference a named script from .archon/scripts/ or ~/.archon/scripts/
或引用.archon/scripts/或~/.archon/scripts/下的命名脚本
- id: analyze script: analyze-metrics # loads .archon/scripts/analyze-metrics.py runtime: uv deps: ["pandas>=2.0"] # Optional, uv only — 'uv run --with <dep>'
**Loop node** — iterates AI prompt until completion:
```yaml
- id: implement
loop:
prompt: "Implement next story. When done: <promise>COMPLETE</promise>"
until: COMPLETE
max_iterations: 10
fresh_context: true
until_bash: "bun run test" # Optional: exit 0 = doneApproval node — pauses the workflow for human review. Requires at the workflow level for Web UI delivery:
interactive: trueyaml
interactive: true # workflow level — required for web UI
nodes:
- id: review-gate
approval:
message: "Review the plan above before proceeding."
capture_response: true # Optional: user's comment → $review-gate.output
on_reject: # Optional: AI rework on rejection instead of cancel
prompt: "Revise based on feedback: $REJECTION_REASON"
max_attempts: 3 # Range 1-10, default 3
depends_on: [plan]Cancel node — terminates the workflow with a reason. Typically gated with :
when:yaml
- id: stop-if-unsafe
cancel: "Refusing to proceed: input flagged UNSAFE."
depends_on: [classify]
when: "$classify.output != 'SAFE'"For the full authoring guide with all fields, conditions, trigger rules, and patterns: Read
references/workflow-dag.md- id: analyze script: analyze-metrics # 加载.archon/scripts/analyze-metrics.py runtime: uv deps: ["pandas>=2.0"] # 可选,仅uv支持——'uv run --with <dep>'
**循环节点** —— 重复执行AI提示直到完成:
```yaml
- id: implement
loop:
prompt: "Implement next story. When done: <promise>COMPLETE</promise>"
until: COMPLETE
max_iterations: 10
fresh_context: true
until_bash: "bun run test" # 可选:exit 0表示完成审批节点 —— 暂停工作流等待人工审核。如需通过Web UI交付,需在工作流级别设置:
interactive: trueyaml
interactive: true # 工作流级别——Web UI必填
nodes:
- id: review-gate
approval:
message: "Review the plan above before proceeding."
capture_response: true # 可选:用户评论→$review-gate.output
on_reject: # 可选:拒绝后AI重新处理,而非取消
prompt: "Revise based on feedback: $REJECTION_REASON"
max_attempts: 3 # 范围1-10,默认3
depends_on: [plan]取消节点 —— 终止工作流并给出原因。通常与配合使用:
when:yaml
- id: stop-if-unsafe
cancel: "Refusing to proceed: input flagged UNSAFE."
depends_on: [classify]
when: "$classify.output != 'SAFE'"如需包含所有字段、条件、触发规则和模式的完整创作指南:阅读
references/workflow-dag.mdCreating a Command File
创建命令文件
Commands are files in containing AI prompt templates:
.md.archon/commands/markdown
---
description: What this command does
argument-hint: <expected arguments>
---命令是目录下的文件,包含AI提示模板:
.archon/commands/.mdmarkdown
---
description: What this command does
argument-hint: <expected arguments>
---My Command
My Command
User request: $ARGUMENTS
Workflow artifacts: $ARTIFACTS_DIR
[Instructions for the AI agent]
For the full command authoring guide: Read `references/authoring-commands.md`User request: $ARGUMENTS
Workflow artifacts: $ARTIFACTS_DIR
[Instructions for the AI agent]
如需完整的命令创作指南:阅读`references/authoring-commands.md`Key Variables
关键变量
| Variable | Description |
|---|---|
| User's input message |
| Pre-created directory for workflow artifacts |
| Base branch (auto-detected from git) |
| Unique workflow run ID |
| Output from upstream node |
Full variable reference: Read
references/variables.md| 变量 | 描述 |
|---|---|
| 用户输入消息 |
| 预创建的工作流产物目录 |
| 基础分支(从Git自动检测) |
| 唯一的工作流运行ID |
| 上游节点的输出 |
完整变量参考:阅读
references/variables.mdAdvanced Features (Command/Prompt Nodes, Claude Only)
高级功能(命令/提示节点,仅Claude)
hooksmcpskillsoutput_formatallowed_toolsdenied_toolsFor details: Read
references/dag-advanced.mdhooksmcpskillsoutput_formatallowed_toolsdenied_tools详情:阅读
references/dag-advanced.mdExample Files
示例文件
- — workflow with conditions, bash + script + loop nodes, structured output
examples/dag-workflow.yaml - — Command file skeleton with all variables
examples/command-template.md
- —— 包含条件、bash+脚本+循环节点、结构化输出的工作流
examples/dag-workflow.yaml - —— 包含所有变量的命令文件模板
examples/command-template.md
Example Interactions
交互示例
User: "Use Archon to fix issue #42"
bash
archon workflow run archon-fix-github-issue --branch fix/issue-42 "Fix issue #42"User: "Have Archon review PR #15"
bash
archon workflow run archon-comprehensive-pr-review --branch review/pr-15 "Review PR #15"User: "Create a workflow that reviews code and runs tests"
→ Read and create a workflow with parallel review nodes.
references/workflow-dag.mdUser: "Make a workflow with conditional routing"
→ Read and create nodes with conditions and .
references/workflow-dag.mdwhen:output_formatUser: "Write a command file for investigating bugs"
→ Read and create an file in .
references/authoring-commands.md.md.archon/commands/User: "Set up Archon in this repo"
→ Read to create the directory structure.
references/repo-init.md.archon/User: "Initialize .archon and create a custom workflow"
→ First read , then the appropriate workflow reference.
references/repo-init.md用户:"Use Archon to fix issue #42"
bash
archon workflow run archon-fix-github-issue --branch fix/issue-42 "Fix issue #42"用户:"Have Archon review PR #15"
bash
archon workflow run archon-comprehensive-pr-review --branch review/pr-15 "Review PR #15"用户:"Create a workflow that reviews code and runs tests"
→ 阅读并创建包含并行审核节点的工作流。
references/workflow-dag.md用户:"Make a workflow with conditional routing"
→ 阅读并创建带有条件和的节点。
references/workflow-dag.mdwhen:output_format用户:"Write a command file for investigating bugs"
→ 阅读并在目录下创建一个文件。
references/authoring-commands.md.archon/commands/.md用户:"Set up Archon in this repo"
→ 阅读创建目录结构。
references/repo-init.md.archon/用户:"Initialize .archon and create a custom workflow"
→ 先阅读,再阅读对应的工作流参考文档。
references/repo-init.md