coleam00/Archon

GitHub: coleam00/Archon

Archon 是首个开源的 AI 编码 Harness 构建器,通过 YAML 工作流定义将 AI 编码过程变得确定且可复现。

Stars: 17545 | Forks: 2761

Archon

Archon

首个面向 AI 编码的开源 harness 构建器。让 AI 编码变得确定且可复现。

coleam00%2FArchon | Trendshift

License: MIT CI Docs

Archon 是一个面向 AI 编码代理的 workflow engine。将你的开发流程定义为 YAML workflows——包括规划、实现、验证、code review、PR 创建——并在你的所有项目中可靠地运行。 就像 Dockerfiles 之于基础设施、GitHub Actions 之于 CI/CD 一样——Archon 之于 AI 编码 workflows。可以把它想象成 n8n,但专为软件开发设计。 ## 为什么选择 Archon? 当你让 AI 代理“修复这个 bug”时,实际发生的行为取决于模型的“心情”。它可能会跳过规划。它可能会忘记运行测试。它可能会写一份忽略了你模板的 PR 描述。每一次运行都各不相同。 Archon 解决了这个问题。将你的开发过程编码为一个 workflow。workflow 定义了阶段、验证门和产物。AI 在每一步提供智能,但结构是确定性的,且由你掌控。 - **可复现** - 每次 workflow 相同,执行顺序也相同。规划、实现、验证、review、PR。 - **隔离** - 每次 workflow 运行都在其自己的 git worktree 中进行。并行运行 5 个修复而不会产生冲突。 - **开火后不管** - 启动一个 workflow,然后去处理其他工作。回来时就能看到一个带 review 评论的已完成 PR。 - **可组合** - 将确定性节点与 AI 节点(规划、代码生成、review)混合使用。AI 仅在能增加价值的地方运行。 - **可移植** - 在 `.archon/workflows/` 中定义一次 workflows,提交到你的仓库。它们在 CLI、Web UI、Slack、Telegram 或 GitHub 中的工作方式完全一致。 ## 它看起来像什么 下面是一个 Archon workflow 的示例,它会进行规划,在循环中实现直到测试通过,获得你的批准,然后创建 PR: ``` # .archon/workflows/build-feature.yaml nodes: - id: plan prompt: "Explore the codebase and create an implementation plan" - id: implement depends_on: [plan] loop: # AI loop - iterate until done prompt: "Read the plan. Implement the next task. Run validation." until: ALL_TASKS_COMPLETE fresh_context: true # Fresh session each iteration - id: run-tests depends_on: [implement] bash: "bun run validate" # Deterministic - no AI - id: review depends_on: [run-tests] prompt: "Review all changes against the plan. Fix any issues." - id: approve depends_on: [review] loop: # Human approval gate prompt: "Present the changes for review. Address any feedback." until: APPROVED interactive: true # Pauses and waits for human input - id: create-pr depends_on: [approve] prompt: "Push changes and create a pull request" ``` 告诉你的 coding agent 你想要什么,Archon 会处理剩下的一切: ``` You: Use archon to add dark mode to the settings page Agent: I'll run the archon-idea-to-pr workflow for this. → Creating isolated worktree on branch archon/task-dark-mode... → Planning... → Implementing (task 1/4)... → Implementing (task 2/4)... → Tests failing - iterating... → Tests passing after 2 iterations → Code review complete - 0 issues → PR ready: https://github.com/you/project/pull/47 ``` ## 上一版本 寻找基于 Python 的原始 Archon(任务管理 + RAG)?它已完整保存在 [`archive/v1-task-management-rag`](https://github.com/coleam00/Archon/tree/archive/v1-task-management-rag) 分支上。 ## 快速开始 ### 完整设置(5 分钟) 克隆仓库并使用引导式设置向导。这将配置凭证、平台集成,并将 Archon skill 复制到你的目标项目中。
前置条件 - Bun、Claude Code 和 GitHub CLI **Bun** - [bun.sh](https://bun.sh) ``` # macOS/Linux curl -fsSL https://bun.sh/install | bash # Windows (PowerShell) irm bun.sh/install.ps1 | iex ``` **GitHub CLI** - [cli.github.com](https://cli.github.com/) ``` # macOS brew install gh # Windows (via winget) winget install GitHub.cli # Linux (Debian/Ubuntu) sudo apt install gh ``` **Claude Code** - [claude.ai/code](https://claude.ai/code) ``` # macOS/Linux/WSL curl -fsSL https://claude.ai/install.sh | bash # Windows (PowerShell) irm https://claude.ai/install.ps1 | iex ```
``` git clone https://github.com/coleam00/Archon cd Archon bun install claude ``` 然后说:**“Set up Archon”** 设置向导会引导你完成所有步骤:CLI 安装、身份验证、平台选择,并将 Archon skill 复制到你的目标仓库。 ### 快速安装(30 秒) 已经设置好了 Claude Code?安装独立的 CLI 二进制文件并跳过向导。 **macOS / Linux** ``` curl -fsSL https://archon.diy/install | bash ``` **Windows (PowerShell)** ``` irm https://archon.diy/install.ps1 | iex ``` **Homebrew** ``` brew install coleam00/archon/archon ``` ### 开始使用 Archon 完成上述任意设置路径后,前往你的项目并开始工作: ``` cd /path/to/your/project claude ``` ``` Use archon to fix issue #42 ``` ``` What archon workflows do I have? When would I use each one? ``` coding agent 会为你处理 workflow 选择、分支命名和 worktree 隔离。项目在首次使用时会自动注册。 ## Web UI Archon 包含一个 web dashboard,用于与 coding agent 聊天、运行 workflows 和监控活动。二进制安装方式:运行 `archon serve` 一步下载并启动 web UI。从源码构建:让你的 coding agent 从 Archon 仓库运行 frontend,或者你自己从仓库根目录运行 `bun run dev`。 通过点击聊天侧边栏中“Project”旁边的 **+** 来注册一个项目——输入 GitHub URL 或本地路径。然后开始对话,调用 workflows,并实时观察进度。 **关键页面:** - **Chat** - 带实时流和 tool call 可视化的对话界面 - **Dashboard** - 任务控制中心,用于监控正在运行的 workflows,可按项目、状态和日期筛选历史记录 - **Workflow Builder** - 可视化拖放编辑器,用于创建带有循环节点的 DAG workflows - **Workflow Execution** - 任何正在运行或已完成的 workflow 的分步进度视图 **监控中心:** 侧边栏显示来自**所有平台**的对话——而不仅仅是 Web。从 CLI 启动的 workflows、来自 Slack 或 Telegram 的消息、GitHub issue 交互——所有内容都集中在一个地方。 完整文档请参阅 [Web UI Guide](https://archon.diy/adapters/web/)。 ## 你可以自动化什么? Archon 附带了常见开发任务的 workflows: | Workflow | 功能描述 | |----------|-------------| | `archon-assist` | 通用问答、调试、探索——配备所有工具的完整 Claude Code agent | | `archon-fix-github-issue` | 分类 issue → 调查/规划 → 实现 → 验证 → PR → 智能 review → 自我修复 | | `archon-idea-to-pr` | Feature idea → 规划 → 实现 → 验证 → PR → 5 个并行 review → 自我修复 | | `archon-plan-to-pr` | 执行现有规划 → 实现 → 验证 → PR → review → 自我修复 | | `archon-issue-review-full` | 针对 GitHub issues 的全面修复 + 完整多代理 review 流程 | | `archon-smart-pr-review` | 分类 PR 复杂度 → 运行定向 review agents → 综合发现 | | `archon-comprehensive-pr-review` | 多代理 PR review(5 个并行 reviewer)并自动修复 | | `archon-create-issue` | 分类问题 → 收集上下文 → 调查 → 创建 GitHub issue | | `archon-validate-pr` | 彻底的 PR 验证,测试主分支和 feature 分支 | | `archon-resolve-conflicts` | 检测合并冲突 → 分析双方 → 解决 → 验证 → 提交 | | `archon-feature-development` | 从规划实现 feature → 验证 → 创建 PR | | `archon-architect` | 架构梳理、降低复杂度、代码库健康度改进 | | `archon-refactor-safely` | 安全重构,包含类型检查钩子和行为验证 | | `archon-ralph-dag` | PRD 实现循环——遍历 stories 直到完成 | | `archon-remotion-generate` | 使用 AI 生成或修改 Remotion 视频组合 | | `archon-test-loop-dag` | 循环节点测试 workflow——迭代计数直到完成 | | `archon-piv-loop` | 受指导的 Plan-Implement-Validate 循环,迭代之间有人类 review | Archon 附带了 17 个默认 workflows——运行 `archon workflow list` 或描述你想要什么,路由器会选择正确的一个。 **或者定义你自己的。** 默认 workflows 是很好的起点——从 `.archon/workflows/defaults/` 复制一个并进行自定义。Workflows 是 `.archon/workflows/` 中的 YAML 文件,commands 是 `.archon/commands/` 中的 markdown 文件。仓库中同名的文件会覆盖捆绑的默认值。提交它们——你的整个团队将运行相同的流程。 参阅 [Authoring Workflows](https://archon.diy/guides/authoring-workflows/) 和 [Authoring Commands](https://archon.diy/guides/authoring-commands/)。 ## 添加平台 Web UI 和 CLI 开箱即用。可以选择连接聊天平台以实现远程访问: | Platform | 设置时间 | 指南 | |----------|-----------|-------| | **Telegram** | 5 分钟 | [Telegram Guide](https://archon.diy/adapters/telegram/) | | **Slack** | 15 分钟 | [Slack Guide](https://archon.diy/adapters/slack/) | | **GitHub Webhooks** | 15 分钟 | [GitHub Guide](https://archon.diy/adapters/github/) | | **Discord** | 5 分钟 | [Discord Guide](https://archon.diy/adapters/community/discord/) | ## 架构 ``` ┌─────────────────────────────────────────────────────────┐ │ Platform Adapters (Web UI, CLI, Telegram, Slack, │ │ Discord, GitHub) │ └──────────────────────────┬──────────────────────────────┘ │ ▼ ┌─────────────────────────────────────────────────────────┐ │ Orchestrator │ │ (Message Routing & Context Management) │ └─────────────┬───────────────────────────┬───────────────┘ │ │ ┌───────┴────────┐ ┌───────┴────────┐ │ │ │ │ ▼ ▼ ▼ ▼ ┌───────────┐ ┌────────────┐ ┌──────────────────────────┐ │ Command │ │ Workflow │ │ AI Assistant Clients │ │ Handler │ │ Executor │ │ (Claude / Codex) │ │ (Slash) │ │ (YAML) │ │ │ └───────────┘ └────────────┘ └──────────────────────────┘ │ │ │ └──────────────┴──────────────────────┘ │ ▼ ┌─────────────────────────────────────────────────────────┐ │ SQLite / PostgreSQL (7 Tables) │ │ Codebases • Conversations • Sessions • Workflow Runs │ │ Isolation Environments • Messages • Workflow Events │ └─────────────────────────────────────────────────────────┘ ``` ## 文档 完整文档可在 **[archon.diy](https://archon.diy)** 获取。 | 主题 | 描述 | |-------|-------------| | [Getting Started](https://archon.diy/getting-started/overview/) | 设置指南(Web UI 或 CLI) | | [The Book of Archon](https://archon.diy/book/) | 10 章叙述式教程 | | [CLI Reference](https://archon.diy/reference/cli/) | 完整 CLI 参考 | | [Authoring Workflows](https://archon.diy/guides/authoring-workflows/) | 创建自定义 YAML workflows | | [Authoring Commands](https://archon.diy/guides/authoring-commands/) | 创建可复用的 AI commands | | [Configuration](https://archon.diy/reference/configuration/) | 所有配置选项、环境变量、YAML 设置 | | [AI Assistants](https://archon.diy/getting-started/ai-assistants/) | Claude 和 Codex 设置详情 | | [Deployment](https://archon.diy/deployment/) | Docker、VPS、生产环境设置 | | [Architecture](https://archon.diy/reference/architecture/) | 系统设计与内部原理 | | [Troubleshooting](https://archon.diy/reference/troubleshooting/) | 常见问题与修复 | ## 贡献 欢迎贡献!查看开放的 [issues](https://github.com/coleam00/Archon/issues) 了解可以着手处理的事项。 在提交 pull request 之前,请阅读 [CONTRIBUTING.md](CONTRIBUTING.md)。 ## 许可证 [MIT](LICENSE)
标签:AI代理, AI编程, DNS解析, Dockerfile, Git工作树, n8n, PR管理, SOC Prime, YAML, 人工智能, 代码审查, 代码生成, 低代码, 可复现性, 安全库, 工作流引擎, 工作流编排, 开发工具, 开发流程, 开源项目, 数据管道, 测试验证, 渗透测试工具, 用户模式Hook绕过, 确定性, 网络调试, 自动化, 自动化攻击, 软件工程