[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"tool-Agent-Field--SWE-AF":3,"similar-Agent-Field--SWE-AF":102},{"id":4,"github_repo":5,"name":6,"description_en":7,"description_zh":8,"ai_summary_zh":8,"readme_en":9,"readme_zh":10,"quickstart_zh":11,"use_case_zh":12,"hero_image_url":13,"owner_login":14,"owner_name":15,"owner_avatar_url":16,"owner_bio":17,"owner_company":18,"owner_location":18,"owner_email":19,"owner_twitter":20,"owner_website":21,"owner_url":22,"languages":23,"stars":36,"forks":37,"last_commit_at":38,"license":39,"difficulty_score":40,"env_os":41,"env_gpu":42,"env_ram":42,"env_deps":43,"category_tags":47,"github_topics":52,"view_count":71,"oss_zip_url":18,"oss_zip_packed_at":18,"status":72,"created_at":73,"updated_at":74,"faqs":75,"releases":101},532,"Agent-Field\u002FSWE-AF","SWE-AF","Autonomous software engineering fleet of AI agents for production-grade PRs on AgentField: plan, code, test, and ship.","SWE-AF 是一个基于 AgentField 构建的自主软件工程团队运行时。只需一次 API 调用，它就能启动包含产品经理、架构师、程序员、测试员等角色的完整 AI 工程舰队，实现从规划、编码、测试到发布生产级 Pull Request 的全流程自动化。\n\n在传统开发中，复杂任务的端到端落地往往依赖大量人工协调。SWE-AF 旨在解决这一痛点，将简单的指令转化为数百甚至数千次智能体调用的复杂程序，显著降低软件交付门槛。它特别适合软件开发人员、技术研究者以及追求高效研发流程的团队使用。\n\n其核心亮点在于强大的多智能体协作能力。SWE-AF 支持单仓库与多仓库两种模式，能灵活处理跨项目的依赖关系。用户还可以自定义不同角色所调用的大模型，例如为架构师指定更强大的推理模型，为测试员配置专门的验证模型。这种“工厂化”的工程模式，让复杂的编程任务变得像调用接口一样简洁可靠，是迈向完全自主软件工程的重要一步。","\u003Cdiv align=\"center\">\n\n# SWE-AF\n\n### Autonomous Engineering Team Runtime Built on [AgentField](https:\u002F\u002Fgithub.com\u002FAgent-Field\u002Fagentfield)\n\n**Pronounced:** _\"swee-AF\"_ (one word)\n\n[![Public Beta](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fstatus-public%20beta-0ea5e9?style=for-the-badge)](#)\n[![Python](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fpython-3.12%2B-3776AB?style=for-the-badge&logo=python&logoColor=white)](https:\u002F\u002Fwww.python.org\u002Fdownloads\u002F)\n[![License](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-Apache%202.0-16a34a?style=for-the-badge)](LICENSE)\n[![Tests](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FTests-make%20check-blue?style=for-the-badge)](.github\u002Fworkflows\u002Fci.yml)\n[![Built with AgentField](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FBuilt%20with-AgentField-0A66C2?style=for-the-badge)](https:\u002F\u002Fgithub.com\u002FAgent-Field\u002Fagentfield)\n[![More from Agent-Field](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FMore_from-Agent--Field-111827?style=for-the-badge&logo=github)](https:\u002F\u002Fgithub.com\u002FAgent-Field)\n![WorldSpace Community Developer](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FWorldSpace-Community%20Developer-111827?style=for-the-badge)\n[![Example PR](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FExample-PR%20%23179-ff6b35?style=for-the-badge&logo=github)](https:\u002F\u002Fgithub.com\u002FAgent-Field\u002Fagentfield\u002Fpull\u002F179)\n\n**One API call → full engineering team → shipped code.**\n\n\u003Cp>\n  \u003Ca href=\"#quick-start\">Quick Start\u003C\u002Fa> •\n  \u003Ca href=\"#why-swe-af\">Why SWE-AF\u003C\u002Fa> •\n  \u003Ca href=\"#in-action\">In Action\u003C\u002Fa> •\n  \u003Ca href=\"#adaptive-factory-control\">Factory Control\u003C\u002Fa> •\n  \u003Ca href=\"#benchmark\">Benchmark\u003C\u002Fa> •\n  \u003Ca href=\"#operating-modes\">Modes\u003C\u002Fa> •\n  \u003Ca href=\"#api-reference\">API\u003C\u002Fa> •\n  \u003Ca href=\"docs\u002FARCHITECTURE.md\">Architecture\u003C\u002Fa>\n\u003C\u002Fp>\n\n\u003C\u002Fdiv>\n\nOne API call spins up a full autonomous engineering team — product managers, architects, coders, reviewers, testers — that scopes, builds, adapts, and ships complex software end to end.\nSWE-AF is a first step toward **autonomous software engineering factories**, scaling from simple goals to hard multi-issue programs with hundreds to thousands of agent invocations.\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FAgent-Field_SWE-AF_readme_7e214ca569c4.jpg\" alt=\"SWE-AF autonomous engineering fleet banner\" width=\"100%\" \u002F>\n\u003C\u002Fp>\n\n## One-Call DX\n\n```bash\ncurl -X POST http:\u002F\u002Flocalhost:8080\u002Fapi\u002Fv1\u002Fexecute\u002Fasync\u002Fswe-planner.build \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d @- \u003C\u003C'JSON'\n{\n  \"input\": {\n    \"goal\": \"Refactor and harden auth + billing flows\",\n    \"repo_url\": \"https:\u002F\u002Fgithub.com\u002Fuser\u002Fmy-project\",\n    \"config\": {\n      \"runtime\": \"claude_code\",\n      \"models\": {\n        \"default\": \"sonnet\",\n        \"coder\": \"opus\",\n        \"qa\": \"opus\"\n      },\n      \"enable_learning\": true\n    }\n  }\n}\nJSON\n```\n\nSwap `models.default` and any role key (`coder`, `qa`, `architect`, etc.) to any model your runtime supports.\n\n## Operating Modes\n\nSWE-AF works in two modes: point it at a single repository, or orchestrate coordinated changes across multiple repos in one build.\n\n### Single-Repository Mode\n\nThe default. Pass `repo_url` (remote) or `repo_path` (local) and SWE-AF handles everything:\n\n```bash\ncurl -X POST http:\u002F\u002Flocalhost:8080\u002Fapi\u002Fv1\u002Fexecute\u002Fasync\u002Fswe-planner.build \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"input\": {\n      \"goal\": \"Add JWT auth\",\n      \"repo_url\": \"https:\u002F\u002Fgithub.com\u002Fuser\u002Fmy-project\"\n    }\n  }'\n```\n\n### Multi-Repository Mode\n\nWhen your work spans multiple codebases — a primary app plus shared libraries, monorepo sub-projects, or dependent microservices — pass `config.repos` as an array with roles:\n\n```bash\ncurl -X POST http:\u002F\u002Flocalhost:8080\u002Fapi\u002Fv1\u002Fexecute\u002Fasync\u002Fswe-planner.build \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"input\": {\n      \"goal\": \"Add JWT auth across API and shared-lib\",\n      \"config\": {\n        \"repos\": [\n          {\n            \"repo_url\": \"https:\u002F\u002Fgithub.com\u002Forg\u002Fmain-app\",\n            \"role\": \"primary\"\n          },\n          {\n            \"repo_url\": \"https:\u002F\u002Fgithub.com\u002Forg\u002Fshared-lib\",\n            \"role\": \"dependency\"\n          }\n        ],\n        \"runtime\": \"claude_code\",\n        \"models\": {\n          \"default\": \"sonnet\"\n        }\n      }\n    }\n  }'\n```\n\n**Roles:**\n- `primary` — The main application. Changes here drive the build; failures block progress.\n- `dependency` — Libraries or services modified to support the primary repo. Failures are captured but don't block.\n\n**Use cases:**\n- Primary app + shared SDK or utilities library\n- Monorepo sub-projects that live in separate repos\n- Feature spanning multiple microservices (e.g., API + worker queue)\n\n## Autonomous Build Spotlight\n\nRust-based Python compiler benchmark (built autonomously):\n\n| Metric                 | CPython (subprocess) | RustPython (SWE-AF)          | Improvement             |\n| ---------------------- | -------------------- | ---------------------------- | ----------------------- |\n| Steady-state execution | Baseline (~19ms)     | Optimized in-process runtime | **88.3x-602.3x faster** |\n| Geometric mean         | 1.0x baseline        | 253.8x                       | **253.8x**              |\n| Peak throughput        | ~52 ops\u002Fs            | 31,807 ops\u002Fs                 | **~612x**               |\n\n\u003Cdetails>\n\u003Csummary>Measurement methodology\u003C\u002Fsummary>\n\nThroughput comparison measures different execution models: CPython subprocess spawn (~19ms per call → ~52 ops\u002Fs) vs RustPython pre-warmed interpreter pool (in-process). This is the real-world tradeoff the system was built to optimize — replacing repeated subprocess invocations with a persistent pool for short-snippet execution.\n\n\u003C\u002Fdetails>\n\nArtifact trail includes **175 tracked autonomous agents** across planning, coding, review, merge, and verification.\n\nDetails: [`examples\u002Fllm-rust-python-compiler-sonnet\u002FREADME.md`](examples\u002Fllm-rust-python-compiler-sonnet\u002FREADME.md)\n\n## Why SWE-AF\n\nMost agent frameworks wrap a single coder loop. SWE-AF is a coordinated engineering factory — planning, execution, and governance agents run as a control stack that adapts in real time.\n\n- **Hardness-aware execution** — easy issues pass through quickly, while hard issues trigger deeper adaptation and DAG-level replanning instead of blind retries.\n- **Factory architecture** — not a single-agent wrapper. Planning, execution, and governance agents run as a coordinated control stack — the architecture encodes the engineering strategy, not the prompts (see [The Atomic Unit of Intelligence](https:\u002F\u002Fwww.santoshkumarradha.com\u002Fwriting\u002Fatomic-unit-of-intelligence)).\n- **Multi-model, multi-provider** — assign different models per role (`coder: opus`, `qa: haiku`). Works with Claude, OpenRouter, OpenAI, and Google.\n- **Continual learning** — with `enable_learning=true`, conventions and failure patterns discovered early are injected into downstream issues.\n- **Agent-scale parallelism** — dependency-level scheduling + isolated git worktrees allow large fan-out without branch collisions.\n- **Fleet-scale orchestration** — many SWE-AF nodes can run continuously in parallel via AgentField, driving thousands of agent invocations across concurrent builds.\n- **Explicit compromise tracking** — when scope is relaxed, debt is typed, severity-rated, and propagated.\n- **Long-run reliability** — checkpointed execution supports `resume_build` after crashes or interruptions.\n\n## In Action\n\n[PR #179: Go SDK DID\u002FVC Registration](https:\u002F\u002Fgithub.com\u002FAgent-Field\u002Fagentfield\u002Fpull\u002F179) — built entirely by SWE-AF (Claude runtime with haiku-class models). One API call, zero human code.\n\n| Metric              | Value              |\n| ------------------- | ------------------ |\n| Issues completed    | 10\u002F10              |\n| Tests passing       | 217                |\n| Acceptance criteria | 34\u002F34              |\n| Agent invocations   | 79                 |\n| Model               | `claude-haiku-4-5` |\n| **Total cost**      | **$19.23**         |\n\n\u003Cdetails>\n\u003Csummary>Cost breakdown by agent role\u003C\u002Fsummary>\n\n| Role                               | Cost  | %     |\n| ---------------------------------- | ----- | ----- |\n| Coder                              | $5.88 | 30.6% |\n| Code Reviewer                      | $3.48 | 18.1% |\n| QA                                 | $1.78 | 9.2%  |\n| GitHub PR                          | $1.66 | 8.6%  |\n| Integration Tester                 | $1.59 | 8.3%  |\n| Merger                             | $1.22 | 6.3%  |\n| Workspace Ops                      | $1.77 | 9.2%  |\n| Planning (PM + Arch + TL + Sprint) | $0.79 | 4.1%  |\n| Verifier + Finalize                | $0.34 | 1.8%  |\n| Synthesizer                        | $0.05 | 0.2%  |\n\n79 invocations, 2,070 conversation turns. Planning agents scope and decompose; coders work in parallel isolated worktrees; reviewers and QA validate each issue; merger integrates branches; verifier checks acceptance criteria against the PRD.\n\n\u003C\u002Fdetails>\n\n**Claude & open-source models supported**: Run builds with either runtime and tune models per role in one flat config map.\n- `runtime: \"claude_code\"` maps to Claude backend.\n- `runtime: \"open_code\"` maps to OpenCode backend (OpenRouter\u002FOpenAI\u002FGoogle\u002FAnthropic model IDs).\n\n## Adaptive Factory Control\n\nSWE-AF uses three nested control loops to adapt to task difficulty in real time:\n\n| Loop        | Scope         | Trigger              | Action                                                                             |\n| ----------- | ------------- | -------------------- | ---------------------------------------------------------------------------------- |\n| Inner loop  | Single issue  | QA\u002Freview fails      | Coder retries with feedback                                                        |\n| Middle loop | Single issue  | Inner loop exhausted | `run_issue_advisor` retries with a new approach, splits work, or accepts with debt |\n| Outer loop  | Remaining DAG | Escalated failures   | `run_replanner` restructures remaining issues and dependencies                     |\n\nThis is the core factory-control behavior: control agents supervise worker agents and continuously reshape the plan as reality changes.\n\n## Quick Start\n\n### Deploy with Railway (fastest)\n\n[![Deploy on Railway](https:\u002F\u002Frailway.com\u002Fbutton.svg)](https:\u002F\u002Frailway.com\u002Fdeploy\u002Fswe-af)\n\nOne click deploys SWE-AF + AgentField control plane + PostgreSQL. Set two environment variables in Railway:\n\n- `CLAUDE_CODE_OAUTH_TOKEN` — run `claude setup-token` in [Claude Code CLI](https:\u002F\u002Fdocs.anthropic.com\u002Fen\u002Fdocs\u002Fclaude-code) (uses Pro\u002FMax subscription credits)\n- `GH_TOKEN` — GitHub personal access token with `repo` scope for draft PR creation\n\nOnce deployed, trigger a build:\n\n```bash\ncurl -X POST https:\u002F\u002F\u003Ccontrol-plane>.up.railway.app\u002Fapi\u002Fv1\u002Fexecute\u002Fasync\u002Fswe-planner.build \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -H \"X-API-Key: this-is-a-secret\" \\\n  -d '{\"input\": {\"goal\": \"Add JWT auth\", \"repo_url\": \"https:\u002F\u002Fgithub.com\u002Fuser\u002Fmy-repo\"}}'\n```\n\n### 1. Requirements (local)\n\n- Python 3.12+\n- AgentField control plane (`af`)\n- AI provider API key (Anthropic, OpenRouter, OpenAI, or Google)\n\n### 2. Install\n\n```bash\npython3.12 -m venv .venv\nsource .venv\u002Fbin\u002Factivate\npython -m pip install --upgrade pip\npython -m pip install -e \".[dev]\"\n```\n\n### 3. Run\n\n```bash\naf                 # starts AgentField control plane on :8080\npython -m swe_af   # registers node id \"swe-planner\"\n```\n\n### 4. Trigger a build\n\n```bash\n# Default (uses Claude)\ncurl -X POST http:\u002F\u002Flocalhost:8080\u002Fapi\u002Fv1\u002Fexecute\u002Fasync\u002Fswe-planner.build \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d @- \u003C\u003C'JSON'\n{\n  \"input\": {\n    \"goal\": \"Add JWT auth to all API endpoints\",\n    \"repo_url\": \"https:\u002F\u002Fgithub.com\u002Fuser\u002Fmy-project\"\n  }\n}\nJSON\n\n# With open-source runtime + flat role map\ncurl -X POST http:\u002F\u002Flocalhost:8080\u002Fapi\u002Fv1\u002Fexecute\u002Fasync\u002Fswe-planner.build \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d @- \u003C\u003C'JSON'\n{\n  \"input\": {\n    \"goal\": \"Add JWT auth\",\n    \"repo_url\": \"https:\u002F\u002Fgithub.com\u002Fuser\u002Fmy-project\",\n    \"config\": {\n      \"runtime\": \"open_code\",\n      \"models\": {\n        \"default\": \"openrouter\u002Fminimax\u002Fminimax-m2.5\"\n      }\n    }\n  }\n}\nJSON\n\n# Local workspace mode (repo_path) + targeted role override\ncurl -X POST http:\u002F\u002Flocalhost:8080\u002Fapi\u002Fv1\u002Fexecute\u002Fasync\u002Fswe-planner.build \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d @- \u003C\u003C'JSON'\n{\n  \"input\": {\n    \"goal\": \"Refactor and harden auth + billing flows\",\n    \"repo_path\": \"\u002Fpath\u002Fto\u002Frepo\",\n    \"config\": {\n      \"runtime\": \"claude_code\",\n      \"models\": {\n        \"default\": \"sonnet\",\n        \"coder\": \"opus\",\n        \"qa\": \"opus\"\n      },\n      \"enable_learning\": true\n    }\n  }\n}\nJSON\n```\n\nFor OpenRouter with `open_code`, use model IDs in `openrouter\u002F\u003Cprovider>\u002F\u003Cmodel>` format (for example `openrouter\u002Fminimax\u002Fminimax-m2.5`).\n\n## What Happens In One Build\n\n- Architecture is generated and reviewed before coding starts\n- Issues are dependency-sorted and run in parallel across isolated worktrees\n- Each issue gets dedicated coder, tester, and reviewer passes\n- Failed issues trigger advisor-driven adaptation (split, re-scope, or escalate)\n- Escalations trigger replanning of the remaining DAG\n- End result is merged, integration-tested, and verified against acceptance criteria\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FAgent-Field_SWE-AF_readme_07c7eadb51b3.png\" alt=\"SWE-AF architecture\" width=\"100%\" \u002F>\n\u003C\u002Fp>\n\n> Typical runs spin up 400-500+ agent instances across planning, execution, QA, and verification. For larger DAGs and repeated adaptation\u002Freplanning cycles, SWE-AF can scale into the high hundreds to thousands of agent invocations in a single build.\n\n## Benchmark\n\n**95\u002F100 with haiku and MiniMax**: SWE-AF scored 95\u002F100 with both Claude haiku-class routing ($20) and MiniMax M2.5 via open runtime ($6), outperforming Claude Code sonnet (73), Codex o3 (62), and Claude Code haiku (59) on the same prompt.\n\n| Dimension       | SWE-AF (haiku) | SWE-AF (MiniMax) | CC Sonnet | Codex (o3) | CC Haiku |\n| --------------- | -------------- | ---------------- | --------- | ---------- | -------- |\n| Functional (30) | **30**         | **30**           | **30**    | **30**     | **30**   |\n| Structure (20)  | **20**         | **20**           | 10        | 10         | 10       |\n| Hygiene (20)    | **20**         | **20**           | 16        | 10         | 7        |\n| Git (15)        | **15**         | **15**           | 2         | 2          | 2        |\n| Quality (15)    | 10             | 10               | **15**    | 10         | 10       |\n| Total           | **95**         | **95**           | **73**    | **62**     | **59**   |\n| **Cost**        | **~$20**       | **~$6**          | ?         | ?          | ?        |\n| **Time**        | ~30-40 min     | 43 min           | ?         | ?          | ?        |\n\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>Full benchmark details and reproduction\u003C\u002Fstrong>\u003C\u002Fsummary>\n\nSame prompt tested across multiple agents. SWE-AF with Claude runtime (haiku-class model mapping) used 400+ agent instances; SWE-AF with MiniMax M2.5 via open runtime achieved identical quality at 70% cost savings.\n\n**Prompt used for all agents:**\n\n> Build a Node.js CLI todo app with add, list, complete, and delete commands. Data should persist to a JSON file. Initialize git, write tests, and commit your work.\n\n### Scoring framework\n\n| Dimension  | Points | What it measures                                 |\n| ---------- | ------ | ------------------------------------------------ |\n| Functional | 30     | CLI behavior and passing tests                   |\n| Structure  | 20     | Modular source layout and test organization      |\n| Hygiene    | 20     | `.gitignore`, clean status, no junk artifacts    |\n| Git        | 15     | Commit discipline and message quality            |\n| Quality    | 15     | Error handling, package metadata, README quality |\n\n### Reproduction\n\n```bash\n# SWE-AF (Claude runtime, haiku-class mapping) - $20, 30-40 min\ncurl -X POST http:\u002F\u002Flocalhost:8080\u002Fapi\u002Fv1\u002Fexecute\u002Fasync\u002Fswe-planner.build \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d @- \u003C\u003C'JSON'\n{\n  \"input\": {\n    \"goal\": \"Build a Node.js CLI todo app with add, list, complete, and delete commands. Data should persist to a JSON file. Initialize git, write tests, and commit your work.\",\n    \"repo_path\": \"\u002Ftmp\u002Fswe-af-output\",\n    \"config\": {\n      \"runtime\": \"claude_code\",\n      \"models\": {\n        \"default\": \"haiku\"\n      }\n    }\n  }\n}\nJSON\n\n# SWE-AF (MiniMax M2.5 via OpenRouter runtime) - $6, 43 min\ncurl -X POST http:\u002F\u002Flocalhost:8080\u002Fapi\u002Fv1\u002Fexecute\u002Fasync\u002Fswe-planner.build \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d @- \u003C\u003C'JSON'\n{\n  \"input\": {\n    \"goal\": \"Build a Node.js CLI todo app with add, list, complete, and delete commands. Data should persist to a JSON file. Initialize git, write tests, and commit your work.\",\n    \"repo_path\": \"\u002Fworkspaces\u002Ftodo-app-benchmark\",\n    \"config\": {\n      \"runtime\": \"open_code\",\n      \"models\": {\n        \"default\": \"openrouter\u002Fminimax\u002Fminimax-m2.5\"\n      }\n    }\n  }\n}\nJSON\n\n# Claude Code (haiku)\nclaude -p \"Build a Node.js CLI todo app with add, list, complete, and delete commands. Data should persist to a JSON file. Initialize git, write tests, and commit your work.\" --model haiku --dangerously-skip-permissions\n\n# Claude Code (sonnet)\nclaude -p \"Build a Node.js CLI todo app with add, list, complete, and delete commands. Data should persist to a JSON file. Initialize git, write tests, and commit your work.\" --model sonnet --dangerously-skip-permissions\n\n# Codex (gpt-5.3-codex)\ncodex exec \"Build a Node.js CLI todo app with add, list, complete, and delete commands. Data should persist to a JSON file. Initialize git, write tests, and commit your work.\" --full-auto\n```\n\n**MiniMax M2.5 Measured Metrics (Feb 2026):**\n- 99.22% code coverage (only agent with measured coverage)\n- 4 custom error types (TodoError, ValidationError, NotFoundError, StorageError)\n- 999 LOC, 4 modules, 74 tests, 9 commits\n\n**Production Quality Analysis:** [Objective comparison](examples\u002Fagent-comparison\u002FPRODUCTION_QUALITY_ANALYSIS.md) of measurable metrics across all agents.\n\nBenchmark assets, logs, evaluator, and generated projects live in [`examples\u002Fagent-comparison\u002F`](examples\u002Fagent-comparison\u002F).\n\n\u003C\u002Fdetails>\n\n> **Ship code, then audit it:** [SEC-AF](https:\u002F\u002Fgithub.com\u002FAgent-Field\u002Fsec-af) runs the same multi-agent architecture against your codebase — 250 agents, 94% noise reduction, every finding proven.\n\n## Docker\n\n```bash\ncp .env.example .env\n# Add your API key: ANTHROPIC_API_KEY, OPENROUTER_API_KEY, OPENAI_API_KEY, or GOOGLE_API_KEY\n# Optionally add GH_TOKEN for draft PR workflow\n\ndocker compose up -d\n```\n\nSubmit a build:\n\n```bash\n# Default (Claude)\ncurl -X POST http:\u002F\u002Flocalhost:8080\u002Fapi\u002Fv1\u002Fexecute\u002Fasync\u002Fswe-planner.build \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d @- \u003C\u003C'JSON'\n{\n  \"input\": {\n    \"goal\": \"Add JWT auth\",\n    \"repo_url\": \"https:\u002F\u002Fgithub.com\u002Fuser\u002Fmy-repo\"\n  }\n}\nJSON\n\n# With open-source runtime (set OPENROUTER_API_KEY in .env)\ncurl -X POST http:\u002F\u002Flocalhost:8080\u002Fapi\u002Fv1\u002Fexecute\u002Fasync\u002Fswe-planner.build \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d @- \u003C\u003C'JSON'\n{\n  \"input\": {\n    \"goal\": \"Add JWT auth\",\n    \"repo_url\": \"https:\u002F\u002Fgithub.com\u002Fuser\u002Fmy-repo\",\n    \"config\": {\n      \"runtime\": \"open_code\",\n      \"models\": {\n        \"default\": \"openrouter\u002Fminimax\u002Fminimax-m2.5\"\n      }\n    }\n  }\n}\nJSON\n\n# Local workspace mode (repo_path)\ncurl -X POST http:\u002F\u002Flocalhost:8080\u002Fapi\u002Fv1\u002Fexecute\u002Fasync\u002Fswe-planner.build \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d @- \u003C\u003C'JSON'\n{\n  \"input\": {\n    \"goal\": \"Add JWT auth\",\n    \"repo_path\": \"\u002Fworkspaces\u002Fmy-repo\"\n  }\n}\nJSON\n```\n\nScale workers:\n\n```bash\ndocker compose up --scale swe-agent=3 -d\n```\n\nUse a host control plane instead of Docker control-plane service:\n\n```bash\ndocker compose -f docker-compose.local.yml up -d\n```\n\n## GitHub Repo Workflow (Clone -> Build -> Draft PR)\n\nPass `repo_url` instead of `repo_path` to let SWE-AF clone and open a draft PR after execution.\n\n```bash\ncurl -X POST http:\u002F\u002Flocalhost:8080\u002Fapi\u002Fv1\u002Fexecute\u002Fasync\u002Fswe-planner.build \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d @- \u003C\u003C'JSON'\n{\n  \"input\": {\n    \"repo_url\": \"https:\u002F\u002Fgithub.com\u002Fuser\u002Fmy-project\",\n    \"goal\": \"Add comprehensive test coverage\",\n    \"config\": {\n      \"runtime\": \"claude_code\",\n      \"models\": {\n        \"default\": \"sonnet\",\n        \"coder\": \"opus\",\n        \"qa\": \"opus\"\n      }\n    }\n  }\n}\nJSON\n```\n\nRequirements:\n\n- `GH_TOKEN` in `.env` with `repo` scope\n- Repo access for that token\n\n## API Reference\n\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>Agent endpoints\u003C\u002Fstrong>\u003C\u002Fsummary>\n\nCore async endpoints (returns an `execution_id` immediately):\n\n```bash\n# Full build: plan -> execute -> verify\nPOST \u002Fapi\u002Fv1\u002Fexecute\u002Fasync\u002Fswe-planner.build\n\n# Plan only\nPOST \u002Fapi\u002Fv1\u002Fexecute\u002Fasync\u002Fswe-planner.plan\n\n# Execute a prebuilt plan\nPOST \u002Fapi\u002Fv1\u002Fexecute\u002Fasync\u002Fswe-planner.execute\n\n# Resume after interruption\nPOST \u002Fapi\u002Fv1\u002Fexecute\u002Fasync\u002Fswe-planner.resume_build\n```\n\nMonitoring:\n\n```bash\ncurl http:\u002F\u002Flocalhost:8080\u002Fapi\u002Fv1\u002Fexecutions\u002F\u003Cexecution_id>\n```\n\nEvery specialist is also callable directly:\n\n`POST \u002Fapi\u002Fv1\u002Fexecute\u002Fasync\u002Fswe-planner.\u003Cagent>`\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>Agent execution flow\u003C\u002Fstrong>\u003C\u002Fsummary>\n\n| Agent                    | In -> Out                                            |\n| ------------------------ | ---------------------------------------------------- |\n| `run_product_manager`    | goal -> PRD                                          |\n| `run_architect`          | PRD -> architecture                                  |\n| `run_tech_lead`          | architecture -> review                               |\n| `run_sprint_planner`     | architecture -> issue DAG                            |\n| `run_issue_writer`       | issue spec -> detailed issue                         |\n| `run_coder`              | issue + worktree -> code + tests + commit            |\n| `run_qa`                 | worktree -> test results                             |\n| `run_code_reviewer`      | worktree -> quality\u002Fsecurity review                  |\n| `run_qa_synthesizer`     | QA + review -> FIX \u002F APPROVE \u002F BLOCK                 |\n| `run_issue_advisor`      | failure context -> adapt \u002F split \u002F accept \u002F escalate |\n| `run_replanner`          | build state + failures -> restructured plan          |\n| `run_merger`             | branches -> merged output                            |\n| `run_integration_tester` | merged repo -> integration results                   |\n| `run_verifier`           | repo + PRD -> acceptance pass\u002Ffail                   |\n| `generate_fix_issues`    | failed criteria -> targeted fix issues               |\n| `run_github_pr`          | branch -> push + draft PR                            |\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>Configuration\u003C\u002Fstrong>\u003C\u002Fsummary>\n\nPass `config` to `build` or `execute`. Full schema: [`swe_af\u002Fexecution\u002Fschemas.py`](swe_af\u002Fexecution\u002Fschemas.py)\n\n| Key                       | Default         | Description                                           |\n| ------------------------- | --------------- | ----------------------------------------------------- |\n| `runtime`                 | `\"claude_code\"` | Model runtime: `\"claude_code\"` or `\"open_code\"`       |\n| `models`                  | `null`          | Flat role-model map (`default` + role keys below)     |\n| `max_coding_iterations`   | `5`             | Inner-loop retry budget                               |\n| `max_advisor_invocations` | `2`             | Middle-loop advisor budget                            |\n| `max_replans`             | `2`             | Build-level replanning budget                         |\n| `enable_issue_advisor`    | `true`          | Enable issue adaptation                               |\n| `enable_replanning`       | `true`          | Enable global replanning                              |\n| `enable_learning`         | `false`         | Enable cross-issue shared memory (continual learning) |\n| `agent_timeout_seconds`   | `2700`          | Per-agent timeout                                     |\n| `agent_max_turns`         | `150`           | Tool-use turn budget                                  |\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>Model Role Keys\u003C\u002Fstrong>\u003C\u002Fsummary>\n\n`models` supports:\n\n- `default`\n- `pm`, `architect`, `tech_lead`, `sprint_planner`\n- `coder`, `qa`, `code_reviewer`, `qa_synthesizer`\n- `replan`, `retry_advisor`, `issue_writer`, `issue_advisor`\n- `verifier`, `git`, `merger`, `integration_tester`\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>Resolution order\u003C\u002Fstrong>\u003C\u002Fsummary>\n\n`runtime defaults` \u003C `models.default` \u003C `models.\u003Crole>`\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>Config examples\u003C\u002Fstrong>\u003C\u002Fsummary>\n\nMinimal:\n\n```json\n{\n  \"runtime\": \"claude_code\"\n}\n```\n\nFully customized:\n\n```json\n{\n  \"runtime\": \"open_code\",\n  \"models\": {\n    \"default\": \"minimax\u002Fminimax-m2.5\",\n    \"pm\": \"openrouter\u002Fqwen\u002Fqwen-2.5-72b-instruct\",\n    \"architect\": \"openrouter\u002Fqwen\u002Fqwen-2.5-72b-instruct\",\n    \"coder\": \"deepseek\u002Fdeepseek-chat\",\n    \"qa\": \"deepseek\u002Fdeepseek-chat\",\n    \"verifier\": \"openrouter\u002Fqwen\u002Fqwen-2.5-72b-instruct\"\n  },\n  \"max_coding_iterations\": 6,\n  \"enable_learning\": true\n}\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>Artifacts\u003C\u002Fstrong>\u003C\u002Fsummary>\n\n```text\n.artifacts\u002F\n├── plan\u002F           # PRD, architecture, issue specs\n├── execution\u002F      # checkpoints, per-issue logs, agent outputs\n└── verification\u002F   # acceptance criteria results\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>Development\u003C\u002Fstrong>\u003C\u002Fsummary>\n\n```bash\nmake test\nmake check\nmake clean\nmake clean-examples\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>Security and Community\u003C\u002Fstrong>\u003C\u002Fsummary>\n\n- Contribution guide: [`docs\u002FCONTRIBUTING.md`](docs\u002FCONTRIBUTING.md)\n- Code of conduct: [`CODE_OF_CONDUCT.md`](CODE_OF_CONDUCT.md)\n- Security policy: [`SECURITY.md`](SECURITY.md)\n- Changelog: [`CHANGELOG.md`](CHANGELOG.md)\n- License: [`Apache-2.0`](LICENSE)\n\n\u003C\u002Fdetails>\n\n---\n\n### Also built on AgentField\n\n> **[SEC-AF](https:\u002F\u002Fgithub.com\u002FAgent-Field\u002Fsec-af)** — AI-native security auditor. 250 agents per audit, 94% noise reduction, every finding proven exploitable.\n>\n> **[Contract-AF](https:\u002F\u002Fgithub.com\u002FAgent-Field\u002Fcontract-af)** — Legal contract risk analyzer. Agents spawn agents at runtime. Adversarial review catches what solo LLMs miss.\n\n[All repos →](https:\u002F\u002Fgithub.com\u002FAgent-Field)\n\n---\n\nSWE-AF is built on [AgentField](https:\u002F\u002Fgithub.com\u002FAgent-Field\u002Fagentfield) as a first step from single-agent harnesses to autonomous software engineering factories. [See what else we're building →](https:\u002F\u002Fgithub.com\u002FAgent-Field)\n","\u003Cdiv align=\"center\">\n\n# SWE-AF\n\n### 基于 [AgentField](https:\u002F\u002Fgithub.com\u002FAgent-Field\u002Fagentfield) 构建的自主工程团队运行时\n\n**发音：** _\"swee-AF\"_（单字）\n\n[![Public Beta](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fstatus-public%20beta-0ea5e9?style=for-the-badge)](#)\n[![Python](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fpython-3.12%2B-3776AB?style=for-the-badge&logo=python&logoColor=white)](https:\u002F\u002Fwww.python.org\u002Fdownloads\u002F)\n[![License](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-Apache%202.0-16a34a?style=for-the-badge)](LICENSE)\n[![Tests](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FTests-make%20check-blue?style=for-the-badge)](.github\u002Fworkflows\u002Fci.yml)\n[![Built with AgentField](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FBuilt%20with-AgentField-0A66C2?style=for-the-badge)](https:\u002F\u002Fgithub.com\u002FAgent-Field\u002Fagentfield)\n[![More from Agent-Field](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FMore_from-Agent--Field-111827?style=for-the-badge&logo=github)](https:\u002F\u002Fgithub.com\u002FAgent-Field)\n![WorldSpace Community Developer](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FWorldSpace-Community%20Developer-111827?style=for-the-badge)\n[![Example PR](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FExample-PR%20%23179-ff6b35?style=for-the-badge&logo=github)](https:\u002F\u002Fgithub.com\u002FAgent-Field\u002Fagentfield\u002Fpull\u002F179)\n\n**一次 API 调用 → 完整的工程团队 → 交付的代码。**\n\n\u003Cp>\n  \u003Ca href=\"#quick-start\">快速开始\u003C\u002Fa> •\n  \u003Ca href=\"#why-swe-af\">为何选择 SWE-AF\u003C\u002Fa> •\n  \u003Ca href=\"#in-action\">实战演示\u003C\u002Fa> •\n  \u003Ca href=\"#adaptive-factory-control\">工厂控制\u003C\u002Fa> •\n  \u003Ca href=\"#benchmark\">基准测试\u003C\u002Fa> •\n  \u003Ca href=\"#operating-modes\">运行模式\u003C\u002Fa> •\n  \u003Ca href=\"#api-reference\">API 参考\u003C\u002Fa> •\n  \u003Ca href=\"docs\u002FARCHITECTURE.md\">架构\u003C\u002Fa>\n\u003C\u002Fp>\n\n\u003C\u002Fdiv>\n\n一次 API 调用即可启动一个完整的自主工程团队——包括产品经理、架构师、程序员、审查员、测试人员——他们负责规划、构建、适配并端到端地交付复杂软件。\nSWE-AF 是迈向**自主软件工程工厂**的第一步，能够从简单目标扩展到包含数百至数千次智能体 (Agent) 调用的复杂多问题程序。\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FAgent-Field_SWE-AF_readme_7e214ca569c4.jpg\" alt=\"SWE-AF autonomous engineering fleet banner\" width=\"100%\" \u002F>\n\u003C\u002Fp>\n\n## 单次调用开发体验 (DX)\n\n```bash\ncurl -X POST http:\u002F\u002Flocalhost:8080\u002Fapi\u002Fv1\u002Fexecute\u002Fasync\u002Fswe-planner.build \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d @- \u003C\u003C'JSON'\n{\n  \"input\": {\n    \"goal\": \"Refactor and harden auth + billing flows\",\n    \"repo_url\": \"https:\u002F\u002Fgithub.com\u002Fuser\u002Fmy-project\",\n    \"config\": {\n      \"runtime\": \"claude_code\",\n      \"models\": {\n        \"default\": \"sonnet\",\n        \"coder\": \"opus\",\n        \"qa\": \"opus\"\n      },\n      \"enable_learning\": true\n    }\n  }\n}\nJSON\n```\n\n将 `models.default` 和任何角色键（`coder`, `qa`, `architect` 等）替换为你运行时 (Runtime) 支持的任何模型。\n\n## 运行模式\n\nSWE-AF 有两种工作模式：指向单个仓库，或在一次构建中协调多个仓库之间的更改。\n\n### 单仓库模式\n\n默认模式。传入 `repo_url`（远程）或 `repo_path`（本地），SWE-AF 将处理所有事项：\n\n```bash\ncurl -X POST http:\u002F\u002Flocalhost:8080\u002Fapi\u002Fv1\u002Fexecute\u002Fasync\u002Fswe-planner.build \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"input\": {\n      \"goal\": \"Add JWT auth\",\n      \"repo_url\": \"https:\u002F\u002Fgithub.com\u002Fuser\u002Fmy-project\"\n    }\n  }'\n```\n\n### 多仓库模式\n\n当你的工作跨越多个代码库时——主应用加上共享库、单体仓库 (Monorepo) 子项目，或依赖的微服务 (Microservices)——请作为数组传入 `config.repos` 并附带角色：\n\n```bash\ncurl -X POST http:\u002F\u002Flocalhost:8080\u002Fapi\u002Fv1\u002Fexecute\u002Fasync\u002Fswe-planner.build \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"input\": {\n      \"goal\": \"Add JWT auth across API and shared-lib\",\n      \"config\": {\n        \"repos\": [\n          {\n            \"repo_url\": \"https:\u002F\u002Fgithub.com\u002Forg\u002Fmain-app\",\n            \"role\": \"primary\"\n          },\n          {\n            \"repo_url\": \"https:\u002F\u002Fgithub.com\u002Forg\u002Fshared-lib\",\n            \"role\": \"dependency\"\n          }\n        ],\n        \"runtime\": \"claude_code\",\n        \"models\": {\n          \"default\": \"sonnet\"\n        }\n      }\n    }\n  }'\n```\n\n**角色：**\n- `primary` —— 主应用程序。此处的更改驱动构建；失败会阻塞进度。\n- `dependency` —— 为支持主仓库而修改的库或服务。失败会被捕获但不会阻塞。\n\n**使用场景：**\n- 主应用 + 共享 SDK 或工具库\n- 位于独立仓库中的单体仓库 (Monorepo) 子项目\n- 跨越多个微服务 (Microservices) 的功能（例如 API + 工作队列）\n\n## 自主构建亮点\n\n基于 Rust 的 Python 编译器基准测试（自主构建）：\n\n| 指标                 | CPython (子进程) | RustPython (SWE-AF)          | 提升幅度             |\n| ---------------------- | -------------------- | ---------------------------- | ----------------------- |\n| 稳态执行 | 基线 (~19ms)     | 优化的进程内运行时 | **快 88.3 倍 -602.3 倍** |\n| 几何平均值         | 1.0 倍基线        | 253.8 倍                       | **253.8 倍**              |\n| 峰值吞吐量        | ~52 操作\u002F秒            | 31,807 操作\u002F秒                 | **约 612 倍**               |\n\n\u003Cdetails>\n\u003Csummary>测量方法\u003C\u002Fsummary>\n\n吞吐量比较衡量不同的执行模型：CPython 子进程启动（每次调用 ~19ms → ~52 ops\u002Fs）vs RustPython 预热的解释器池（进程内）。这是系统旨在优化的现实世界权衡——用持久池替换重复的子进程调用以进行短代码片段执行。\n\n\u003C\u002Fdetails>\n\n构建过程记录包含**175 个追踪的自主智能体 (Agents)**，涵盖规划、编码、审查、合并和验证环节。\n\n详情：[`examples\u002Fllm-rust-python-compiler-sonnet\u002FREADME.md`](examples\u002Fllm-rust-python-compiler-sonnet\u002FREADME.md)\n\n## 为什么选择 SWE-AF\n\n大多数智能体框架仅封装单个编码循环。SWE-AF 是一个协同工程工厂——规划、执行和治理智能体作为控制栈运行，能够实时自适应。\n\n- **难度感知执行** — 简单问题快速通过，而复杂问题会触发更深层的适应和 DAG（有向无环图）级重规划，而非盲目重试。\n- **工厂架构** — 并非单智能体包装器。规划、执行和治理智能体作为协同控制栈运行——该架构编码了工程策略，而非提示词（参见 [智能原子单元](https:\u002F\u002Fwww.santoshkumarradha.com\u002Fwriting\u002Fatomic-unit-of-intelligence)）。\n- **多模型、多提供商** — 为不同角色分配不同的模型（`coder: opus`, `qa: haiku`）。支持 Claude、OpenRouter、OpenAI 和 Google。\n- **持续学习** — 启用 `enable_learning=true` 时，早期发现的约定和失败模式会被注入到下游问题中。\n- **智能体级并行** — 依赖级调度 + 隔离的 Git 工作树允许大规模任务分发而无分支冲突。\n- **舰队级编排** — 多个 SWE-AF 节点可通过 AgentField 连续并行运行，驱动数千个并发构建中的智能体调用。\n- **显式妥协跟踪** — 当范围放宽时，债务被类型化、严重程度评级并传播。\n- **长期可靠性** — 检查点执行支持在崩溃或中断后 `resume_build`。\n\n## 实际案例\n\n[PR #179: Go SDK DID\u002FVC 注册](https:\u002F\u002Fgithub.com\u002FAgent-Field\u002Fagentfield\u002Fpull\u002F179) — 完全由 SWE-AF 构建（使用 Haiku 类模型的 Claude 运行时）。一次 API 调用，零人工代码。\n\n| 指标              | 数值              |\n| ------------------- | ------------------ |\n| 已完成问题    | 10\u002F10              |\n| 通过的测试       | 217                |\n| 验收标准 | 34\u002F34              |\n| 智能体调用   | 79                 |\n| 模型               | `claude-haiku-4-5` |\n| **总成本**      | **$19.23**         |\n\n\u003Cdetails>\n\u003Csummary>按智能体角色的成本细分\u003C\u002Fsummary>\n\n| 角色                               | 成本  | %     |\n| ---------------------------------- | ----- | ----- |\n| 编码员                              | $5.88 | 30.6% |\n| 代码审查员                      | $3.48 | 18.1% |\n| QA（质量保证） | $1.78 | 9.2%  |\n| GitHub 拉取请求                          | $1.66 | 8.6%  |\n| 集成测试员                 | $1.59 | 8.3%  |\n| 合并员                             | $1.22 | 6.3%  |\n| 工作区运维                      | $1.77 | 9.2%  |\n| 规划（产品经理 + 架构师 + 技术主管 + 冲刺） | $0.79 | 4.1%  |\n| 验证者 + 最终确认                | $0.34 | 1.8%  |\n| 合成器                        | $0.05 | 0.2%  |\n\n79 次调用，2,070 个对话轮次。规划智能体分解范围；编码员在隔离的工作树中并行工作；审查员和 QA 验证每个问题；合并员整合分支；验证者对照 PRD（产品需求文档）检查验收标准。\n\n\u003C\u002Fdetails>\n\n**支持 Claude 及开源模型**：使用任一运行时进行构建，并在一个扁平配置映射中调整各角色的模型。\n- `runtime: \"claude_code\"` 映射到 Claude 后端。\n- `runtime: \"open_code\"` 映射到 OpenCode 后端（OpenRouter\u002FOpenAI\u002FGoogle\u002FAnthropic 模型 ID）。\n\n## 自适应工厂控制\n\nSWE-AF 使用三个嵌套控制循环来实时适应任务难度：\n\n| 循环        | 范围         | 触发条件              | 操作                                                                             |\n| ----------- | ------------- | -------------------- | ---------------------------------------------------------------------------------- |\n| 内层循环  | 单个问题  | QA\u002F审查失败      | 编码员根据反馈重试                                                        |\n| 中层循环 | 单个问题  | 内层循环耗尽 | `run_issue_advisor` 使用新方法重试，拆分工作或接受债务 |\n| 外层循环  | 剩余 DAG（有向无环图） | 升级的故障   | `run_replanner` 重构剩余问题和依赖关系                     |\n\n这是核心工厂控制行为：控制智能体监督工作智能体，并随着现实情况的变化不断重塑计划。\n\n## 快速开始\n\n### 使用 Railway 部署（最快）\n\n[![Deploy on Railway](https:\u002F\u002Frailway.com\u002Fbutton.svg)](https:\u002F\u002Frailway.com\u002Fdeploy\u002Fswe-af)\n\n一键部署 SWE-AF + AgentField 控制平面 + PostgreSQL。在 Railway 中设置两个环境变量：\n\n- `CLAUDE_CODE_OAUTH_TOKEN` — 在 [Claude Code CLI](https:\u002F\u002Fdocs.anthropic.com\u002Fen\u002Fdocs\u002Fclaude-code) 中运行 `claude setup-token`（使用 Pro\u002FMax 订阅额度）\n- `GH_TOKEN` — 具有 `repo` 范围的 GitHub 个人访问令牌，用于创建草稿拉取请求\n\n部署完成后，触发构建：\n\n```bash\ncurl -X POST https:\u002F\u002F\u003Ccontrol-plane>.up.railway.app\u002Fapi\u002Fv1\u002Fexecute\u002Fasync\u002Fswe-planner.build \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -H \"X-API-Key: this-is-a-secret\" \\\n  -d '{\"input\": {\"goal\": \"Add JWT auth\", \"repo_url\": \"https:\u002F\u002Fgithub.com\u002Fuser\u002Fmy-repo\"}}'\n```\n\n### 1. 要求（本地）\n\n- Python 3.12+\n- AgentField 控制平面 (`af`)\n- AI 提供商 API 密钥（Anthropic、OpenRouter、OpenAI 或 Google）\n\n### 2. 安装\n\n```bash\npython3.12 -m venv .venv\nsource .venv\u002Fbin\u002Factivate\npython -m pip install --upgrade pip\npython -m pip install -e \".[dev]\"\n```\n\n### 3. 运行\n\n```bash\naf                 # 在 :8080 启动 AgentField 控制平面\npython -m swe_af   # 注册节点 ID \"swe-planner\"\n```\n\n### 4. 触发构建\n\n```bash\n# 默认（使用 Claude）\ncurl -X POST http:\u002F\u002Flocalhost:8080\u002Fapi\u002Fv1\u002Fexecute\u002Fasync\u002Fswe-planner.build \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d @- \u003C\u003C'JSON'\n{\n  \"input\": {\n    \"goal\": \"Add JWT auth to all API endpoints\",\n    \"repo_url\": \"https:\u002F\u002Fgithub.com\u002Fuser\u002Fmy-project\"\n  }\n}\nJSON\n\n# 使用开源运行时 + 扁平角色映射\ncurl -X POST http:\u002F\u002Flocalhost:8080\u002Fapi\u002Fv1\u002Fexecute\u002Fasync\u002Fswe-planner.build \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d @- \u003C\u003C'JSON'\n{\n  \"input\": {\n    \"goal\": \"Add JWT auth\",\n    \"repo_url\": \"https:\u002F\u002Fgithub.com\u002Fuser\u002Fmy-project\",\n    \"config\": {\n      \"runtime\": \"open_code\",\n      \"models\": {\n        \"default\": \"openrouter\u002Fminimax\u002Fminimax-m2.5\"\n      }\n    }\n  }\n}\nJSON\n\n# 本地工作区模式（repo_path）+ 定向角色覆盖\ncurl -X POST http:\u002F\u002Flocalhost:8080\u002Fapi\u002Fv1\u002Fexecute\u002Fasync\u002Fswe-planner.build \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d @- \u003C\u003C'JSON'\n{\n  \"input\": {\n    \"goal\": \"Refactor and harden auth + billing flows\",\n    \"repo_path\": \"\u002Fpath\u002Fto\u002Frepo\",\n    \"config\": {\n      \"runtime\": \"claude_code\",\n      \"models\": {\n        \"default\": \"sonnet\",\n        \"coder\": \"opus\",\n        \"qa\": \"opus\"\n      },\n      \"enable_learning\": true\n    }\n  }\n}\nJSON\n```\n\n对于使用 `open_code` 的 OpenRouter，请在 `openrouter\u002F\u003Cprovider>\u002F\u003Cmodel>` 格式中使用模型 ID（例如 `openrouter\u002Fminimax\u002Fminimax-m2.5`）。\n\n## 单次构建流程\n\n- 架构在编码开始前生成并审查\n- 问题按依赖关系排序，并在隔离的工作树（worktrees）中并行运行\n- 每个问题都会经过专门的编码、测试和审查阶段\n- 失败的问题会触发顾问驱动的自适应调整（拆分、重新界定范围或升级）\n- 升级操作会触发剩余有向无环图（DAG）的重新规划\n- 最终结果会被合并、进行集成测试，并根据验收标准验证\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FAgent-Field_SWE-AF_readme_07c7eadb51b3.png\" alt=\"SWE-AF architecture\" width=\"100%\" \u002F>\n\u003C\u002Fp>\n\n> 典型运行会在规划、执行、QA（质量保证）和验证阶段启动 400-500+ 个代理实例。对于更大的 DAG 和重复的自适应\u002F重新规划周期，SWE-AF 可以在单次构建中扩展到数百甚至数千次代理调用。\n\n## 基准测试\n\n**使用 haiku 和 MiniMax 达到 95\u002F100**：SWE-AF 在使用 Claude haiku 类路由（$20）和通过开放运行时（open runtime）的 MiniMax M2.5（$6）时均获得 95\u002F100 分，在同一次提示下优于 Claude Code sonnet（73）、Codex o3（62）和 Claude Code haiku（59）。\n\n| 维度              | SWE-AF (haiku) | SWE-AF (MiniMax) | CC Sonnet | Codex (o3) | CC Haiku |\n| --------------- | -------------- | ---------------- | --------- | ---------- | -------- |\n| 功能性 (30)     | **30**         | **30**           | **30**    | **30**     | **30**   |\n| 结构 (20)       | **20**         | **20**           | 10        | 10         | 10       |\n| 代码规范 (20)   | **20**         | **20**           | 16        | 10         | 7        |\n| Git             | **15**         | **15**           | 2         | 2          | 2        |\n| 质量 (15)       | 10             | 10               | **15**    | 10         | 10       |\n| 总分            | **95**         | **95**           | **73**    | **62**     | **59**   |\n| **成本**        | **~$20**       | **~$6**          | ?         | ?          | ?        |\n| **时间**        | ~30-40 分钟     | 43 分钟           | ?         | ?          | ?        |\n\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>完整基准测试详情与复现\u003C\u002Fstrong>\u003C\u002Fsummary>\n\n同一提示在多个代理上进行了测试。使用 Claude 运行时（haiku 类模型映射）的 SWE-AF 使用了 400+ 个代理实例；通过开放运行时使用 MiniMax M2.5 的 SWE-AF 以节省 70% 成本实现了相同的质量。\n\n**所有代理使用的提示词：**\n\n> 构建一个带有 add、list、complete 和 delete 命令的 Node.js CLI 待办事项应用。数据应持久化到 JSON 文件中。初始化 git，编写测试并提交你的工作。\n\n### 评分框架\n\n| 维度       | 分值 | 衡量内容                                 |\n| ---------- | ------ | ------------------------------------------------ |\n| 功能性     | 30     | CLI 行为及测试通过情况                   |\n| 结构       | 20     | 模块化源代码布局及测试组织                 |\n| 代码规范   | 20     | `.gitignore`、干净状态、无垃圾文件       |\n| Git        | 15     | 提交纪律及消息质量                         |\n| 质量       | 15     | 错误处理、包元数据、README 质量           |\n\n### 复现步骤\n\n```bash\n# SWE-AF (Claude runtime, haiku-class mapping) - $20, 30-40 min\ncurl -X POST http:\u002F\u002Flocalhost:8080\u002Fapi\u002Fv1\u002Fexecute\u002Fasync\u002Fswe-planner.build \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d @- \u003C\u003C'JSON'\n{\n  \"input\": {\n    \"goal\": \"Build a Node.js CLI todo app with add, list, complete, and delete commands. Data should persist to a JSON file. Initialize git, write tests, and commit your work.\",\n    \"repo_path\": \"\u002Ftmp\u002Fswe-af-output\",\n    \"config\": {\n      \"runtime\": \"claude_code\",\n      \"models\": {\n        \"default\": \"haiku\"\n      }\n    }\n  }\n}\nJSON\n\n# SWE-AF (MiniMax M2.5 via OpenRouter runtime) - $6, 43 min\ncurl -X POST http:\u002F\u002Flocalhost:8080\u002Fapi\u002Fv1\u002Fexecute\u002Fasync\u002Fswe-planner.build \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d @- \u003C\u003C'JSON'\n{\n  \"input\": {\n    \"goal\": \"Build a Node.js CLI todo app with add, list, complete, and delete commands. Data should persist to a JSON file. Initialize git, write tests, and commit your work.\",\n    \"repo_path\": \"\u002Fworkspaces\u002Ftodo-app-benchmark\",\n    \"config\": {\n      \"runtime\": \"open_code\",\n      \"models\": {\n        \"default\": \"openrouter\u002Fminimax\u002Fminimax-m2.5\"\n      }\n    }\n  }\n}\nJSON\n\n# Claude Code (haiku)\nclaude -p \"Build a Node.js CLI todo app with add, list, complete, and delete commands. Data should persist to a JSON file. Initialize git, write tests, and commit your work.\" --model haiku --dangerously-skip-permissions\n\n# Claude Code (sonnet)\nclaude -p \"Build a Node.js CLI todo app with add, list, complete, and delete commands. Data should persist to a JSON file. Initialize git, write tests, and commit your work.\" --model sonnet --dangerously-skip-permissions\n\n# Codex (gpt-5.3-codex)\ncodex exec \"Build a Node.js CLI todo app with add, list, complete, and delete commands. Data should persist to a JSON file. Initialize git, write tests, and commit your work.\" --full-auto\n```\n\n**MiniMax M2.5 实测指标（2026 年 2 月）：**\n- 99.22% 代码覆盖率（唯一提供可测覆盖率的代理）\n- 4 种自定义错误类型（TodoError, ValidationError, NotFoundError, StorageError）\n- 999 行代码，4 个模块，74 个测试，9 次提交\n\n**生产质量分析：** [客观比较](examples\u002Fagent-comparison\u002FPRODUCTION_QUALITY_ANALYSIS.md) 所有代理的可测量指标。\n\n基准测试资源、日志、评估器和生成的项目位于 [`examples\u002Fagent-comparison\u002F`](examples\u002Fagent-comparison\u002F)。\n\n\u003C\u002Fdetails>\n\n> **先发布代码，然后审计它：** [SEC-AF](https:\u002F\u002Fgithub.com\u002FAgent-Field\u002Fsec-af) 针对您的代码库运行相同的多人代理架构——250 个代理，94% 噪音减少，每个发现均有据可查。\n\n## Docker\n\n```bash\ncp .env.example .env\n# Add your API key: ANTHROPIC_API_KEY, OPENROUTER_API_KEY, OPENAI_API_KEY, or GOOGLE_API_KEY\n# Optionally add GH_TOKEN for draft PR workflow\n\ndocker compose up -d\n```\n\n提交构建任务：\n\n```bash\n# Default (Claude)\ncurl -X POST http:\u002F\u002Flocalhost:8080\u002Fapi\u002Fv1\u002Fexecute\u002Fasync\u002Fswe-planner.build \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d @- \u003C\u003C'JSON'\n{\n  \"input\": {\n    \"goal\": \"Add JWT auth\",\n    \"repo_url\": \"https:\u002F\u002Fgithub.com\u002Fuser\u002Fmy-repo\"\n  }\n}\nJSON\n\n# With open-source runtime (set OPENROUTER_API_KEY in .env)\ncurl -X POST http:\u002F\u002Flocalhost:8080\u002Fapi\u002Fv1\u002Fexecute\u002Fasync\u002Fswe-planner.build \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d @- \u003C\u003C'JSON'\n{\n  \"input\": {\n    \"goal\": \"Add JWT auth\",\n    \"repo_url\": \"https:\u002F\u002Fgithub.com\u002Fuser\u002Fmy-repo\",\n    \"config\": {\n      \"runtime\": \"open_code\",\n      \"models\": {\n        \"default\": \"openrouter\u002Fminimax\u002Fminimax-m2.5\"\n      }\n    }\n  }\n}\nJSON\n\n# Local workspace mode (repo_path)\ncurl -X POST http:\u002F\u002Flocalhost:8080\u002Fapi\u002Fv1\u002Fexecute\u002Fasync\u002Fswe-planner.build \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d @- \u003C\u003C'JSON'\n{\n  \"input\": {\n    \"goal\": \"Add JWT auth\",\n    \"repo_path\": \"\u002Fworkspaces\u002Fmy-repo\"\n  }\n}\nJSON\n```\n\n扩展工作节点：\n\n```bash\ndocker compose up --scale swe-agent=3 -d\n```\n\n使用主机控制平面代替 Docker 控制平面服务：\n\n```bash\ndocker compose -f docker-compose.local.yml up -d\n```\n\n## GitHub 仓库工作流（克隆 -> 构建 -> 草稿 PR）\n\n传递 `repo_url` 而非 `repo_path`，以便 SWE-AF 在运行后克隆仓库并打开一个草稿 PR。\n\n```bash\ncurl -X POST http:\u002F\u002Flocalhost:8080\u002Fapi\u002Fv1\u002Fexecute\u002Fasync\u002Fswe-planner.build \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d @- \u003C\u003C'JSON'\n{\n  \"input\": {\n    \"repo_url\": \"https:\u002F\u002Fgithub.com\u002Fuser\u002Fmy-project\",\n    \"goal\": \"Add comprehensive test coverage\",\n    \"config\": {\n      \"runtime\": \"claude_code\",\n      \"models\": {\n        \"default\": \"sonnet\",\n        \"coder\": \"opus\",\n        \"qa\": \"opus\"\n      }\n    }\n  }\n}\nJSON\n```\n\nRequirements:\n\n- `.env` 中的 `GH_TOKEN` 需包含 `repo` 范围权限\n- 该令牌需具有仓库访问权限\n\n## API 参考\n\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>智能体端点\u003C\u002Fstrong>\u003C\u002Fsummary>\n\n核心异步端点（立即返回 `execution_id`）：\n\n```bash\n# Full build: plan -> execute -> verify\nPOST \u002Fapi\u002Fv1\u002Fexecute\u002Fasync\u002Fswe-planner.build\n\n# Plan only\nPOST \u002Fapi\u002Fv1\u002Fexecute\u002Fasync\u002Fswe-planner.plan\n\n# Execute a prebuilt plan\nPOST \u002Fapi\u002Fv1\u002Fexecute\u002Fasync\u002Fswe-planner.execute\n\n# Resume after interruption\nPOST \u002Fapi\u002Fv1\u002Fexecute\u002Fasync\u002Fswe-planner.resume_build\n```\n\n监控：\n\n```bash\ncurl http:\u002F\u002Flocalhost:8080\u002Fapi\u002Fv1\u002Fexecutions\u002F\u003Cexecution_id>\n```\n\n每个专家也可以直接调用：\n\n`POST \u002Fapi\u002Fv1\u002Fexecute\u002Fasync\u002Fswe-planner.\u003Cagent>`\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>智能体执行流程\u003C\u002Fstrong>\u003C\u002Fsummary>\n\n| 智能体                    | 输入 -> 输出                                            |\n| ------------------------ | ---------------------------------------------------- |\n| `run_product_manager`    | 目标 -> PRD（产品需求文档）                                          |\n| `run_architect`          | PRD -> 架构                                  |\n| `run_tech_lead`          | 架构 -> 审查                               |\n| `run_sprint_planner`     | 架构 -> 问题 DAG（有向无环图）                            |\n| `run_issue_writer`       | 问题规范 -> 详细问题                         |\n| `run_coder`              | 问题 + worktree（工作树）-> 代码 + 测试 + 提交            |\n| `run_qa`                 | worktree（工作树）-> 测试结果                             |\n| `run_code_reviewer`      | worktree（工作树）-> 质量\u002F安全审查                  |\n| `run_qa_synthesizer`     | QA（质量保证）+ 审查 -> FIX \u002F APPROVE \u002F BLOCK                 |\n| `run_issue_advisor`      | 失败上下文 -> adapt \u002F split \u002F accept \u002F escalate |\n| `run_replanner`          | 构建状态 + 失败 -> 重构计划          |\n| `run_merger`             | 分支 -> 合并输出                            |\n| `run_integration_tester` | 合并后的仓库 -> 集成结果                   |\n| `run_verifier`           | 仓库 + PRD（产品需求文档）-> 验收通过\u002F失败                   |\n| `generate_fix_issues`    | 失败标准 -> 针对性修复问题               |\n| `run_github_pr`          | 分支 -> 推送 + 草稿 PR                            |\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>配置\u003C\u002Fstrong>\u003C\u002Fsummary>\n\n向 `build` 或 `execute` 传递 `config`。完整 Schema：[`swe_af\u002Fexecution\u002Fschemas.py`](swe_af\u002Fexecution\u002Fschemas.py)\n\n| 键                       | 默认值         | 描述                                           |\n| ------------------------- | --------------- | ----------------------------------------------------- |\n| `runtime`                 | `\"claude_code\"` | 模型运行时：`\"claude_code\"` 或 `\"open_code\"`       |\n| `models`                  | `null`          | 扁平角色 - 模型映射（`default` + 下方角色键）     |\n| `max_coding_iterations`   | `5`             | 内循环重试预算                               |\n| `max_advisor_invocations` | `2`             | 中间循环顾问预算                            |\n| `max_replans`             | `2`             | 构建级重规划预算                         |\n| `enable_issue_advisor`    | `true`          | 启用问题适配                               |\n| `enable_replanning`       | `true`          | 启用全局重规划                              |\n| `enable_learning`         | `false`         | 启用跨问题共享内存（持续学习） |\n| `agent_timeout_seconds`   | `2700`          | 每智能体超时                                     |\n| `agent_max_turns`         | `150`           | 工具使用轮次预算                                  |\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>模型角色键\u003C\u002Fstrong>\u003C\u002Fsummary>\n\n`models` 支持：\n\n- `default`\n- `pm`, `architect`, `tech_lead`, `sprint_planner`\n- `coder`, `qa`, `code_reviewer`, `qa_synthesizer`\n- `replan`, `retry_advisor`, `issue_writer`, `issue_advisor`\n- `verifier`, `git`, `merger`, `integration_tester`\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>解析顺序\u003C\u002Fstrong>\u003C\u002Fsummary>\n\n`runtime defaults` \u003C `models.default` \u003C `models.\u003Crole>`\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>配置示例\u003C\u002Fstrong>\u003C\u002Fsummary>\n\n最小化：\n\n```json\n{\n  \"runtime\": \"claude_code\"\n}\n```\n\n完全自定义：\n\n```json\n{\n  \"runtime\": \"open_code\",\n  \"models\": {\n    \"default\": \"minimax\u002Fminimax-m2.5\",\n    \"pm\": \"openrouter\u002Fqwen\u002Fqwen-2.5-72b-instruct\",\n    \"architect\": \"openrouter\u002Fqwen\u002Fqwen-2.5-72b-instruct\",\n    \"coder\": \"deepseek\u002Fdeepseek-chat\",\n    \"qa\": \"deepseek\u002Fdeepseek-chat\",\n    \"verifier\": \"openrouter\u002Fqwen\u002Fqwen-2.5-72b-instruct\"\n  },\n  \"max_coding_iterations\": 6,\n  \"enable_learning\": true\n}\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>产物\u003C\u002Fstrong>\u003C\u002Fsummary>\n\n```text\n.artifacts\u002F\n├── plan\u002F           # PRD, architecture, issue specs\n├── execution\u002F      # checkpoints, per-issue logs, agent outputs\n└── verification\u002F   # acceptance criteria results\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>开发\u003C\u002Fstrong>\u003C\u002Fsummary>\n\n```bash\nmake test\nmake check\nmake clean\nmake clean-examples\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>安全与社区\u003C\u002Fstrong>\u003C\u002Fsummary>\n\n- 贡献指南：[`docs\u002FCONTRIBUTING.md`](docs\u002FCONTRIBUTING.md)\n- 行为准则：[`CODE_OF_CONDUCT.md`](CODE_OF_CONDUCT.md)\n- 安全策略：[`SECURITY.md`](SECURITY.md)\n- 更新日志：[`CHANGELOG.md`](CHANGELOG.md)\n- 许可证：[`Apache-2.0`](LICENSE)\n\n\u003C\u002Fdetails>\n\n---\n\n### 同样基于 AgentField 构建\n\n> **[SEC-AF](https:\u002F\u002Fgithub.com\u002FAgent-Field\u002Fsec-af)** — 原生 AI 安全审计器。每次审计 250 个智能体，降噪 94%，每项发现均被证明可利用。\n>\n> **[Contract-AF](https:\u002F\u002Fgithub.com\u002FAgent-Field\u002Fcontract-af)** — 法律合同风险分析器。智能体在运行时生成子智能体。对抗性审查能捕捉到独立 LLM（大语言模型）遗漏的内容。\n\n[所有仓库 →](https:\u002F\u002Fgithub.com\u002FAgent-Field)\n\n---\n\nSWE-AF 基于 [AgentField](https:\u002F\u002Fgithub.com\u002FAgent-Field\u002Fagentfield) 构建，这是从单智能体框架迈向自主软件工程工厂的第一步。[查看我们正在构建的其他内容 →](https:\u002F\u002Fgithub.com\u002FAgent-Field)","# SWE-AF 快速上手指南\n\n**SWE-AF** 是一个基于 [AgentField](https:\u002F\u002Fgithub.com\u002FAgent-Field\u002Fagentfield) 构建的自主工程团队运行时。只需一次 API 调用，即可启动包含产品经理、架构师、程序员、测试员在内的完整工程团队，实现从需求到代码交付的全流程自动化。\n\n---\n\n## 环境准备\n\n在开始之前，请确保您的开发环境满足以下要求：\n\n*   **系统要求**: Linux \u002F macOS \u002F Windows (WSL)\n*   **Python 版本**: 3.12+\n*   **AI 服务**: 拥有有效的 API 密钥（支持 Anthropic, OpenRouter, OpenAI, Google 等）\n*   **前置依赖**: AgentField 控制平面 (`af`)\n\n> **提示**: 如果您希望快速体验而无需本地配置，可以使用 [Railway](https:\u002F\u002Frailway.com\u002Fdeploy\u002Fswe-af) 一键部署云端版本。\n\n---\n\n## 安装步骤\n\n### 1. 创建虚拟环境并激活\n\n```bash\npython3.12 -m venv .venv\nsource .venv\u002Fbin\u002Factivate\n```\n\n### 2. 安装项目依赖\n\n```bash\npython -m pip install --upgrade pip\npython -m pip install -e \".[dev]\"\n```\n\n### 3. 启动服务\n\n打开两个终端窗口分别运行以下命令：\n\n**终端 1：启动 AgentField 控制平面**\n```bash\naf\n```\n\n**终端 2：注册 SWE-AF 节点**\n```bash\npython -m swe_af\n```\n\n---\n\n## 基本使用\n\n服务启动后，默认监听 `localhost:8080`。您可以通过发送 HTTP POST 请求来触发构建任务。\n\n### 单仓库模式示例\n\n以下示例将自动为指定仓库添加 JWT 认证功能（默认使用 Claude 模型）：\n\n```bash\ncurl -X POST http:\u002F\u002Flocalhost:8080\u002Fapi\u002Fv1\u002Fexecute\u002Fasync\u002Fswe-planner.build \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d @- \u003C\u003C'JSON'\n{\n  \"input\": {\n    \"goal\": \"Add JWT auth to all API endpoints\",\n    \"repo_url\": \"https:\u002F\u002Fgithub.com\u002Fuser\u002Fmy-project\"\n  }\n}\nJSON\n```\n\n### 自定义模型与运行时\n\n您可以根据需要切换不同的 AI 模型或运行时环境（例如使用开源模型）：\n\n```bash\ncurl -X POST http:\u002F\u002Flocalhost:8080\u002Fapi\u002Fv1\u002Fexecute\u002Fasync\u002Fswe-planner.build \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d @- \u003C\u003C'JSON'\n{\n  \"input\": {\n    \"goal\": \"Add JWT auth\",\n    \"repo_url\": \"https:\u002F\u002Fgithub.com\u002Fuser\u002Fmy-project\",\n    \"config\": {\n      \"runtime\": \"open_code\",\n      \"models\": {\n        \"default\": \"openrouter\u002Fminimax\u002Fminimax-m2.5\"\n      }\n    }\n  }\n}\nJSON\n```\n\n### 多仓库协同模式\n\n如果您的项目涉及多个关联仓库（如主应用 + 共享库），可在 `config.repos` 中定义角色：\n\n```bash\ncurl -X POST http:\u002F\u002Flocalhost:8080\u002Fapi\u002Fv1\u002Fexecute\u002Fasync\u002Fswe-planner.build \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"input\": {\n      \"goal\": \"Add JWT auth across API and shared-lib\",\n      \"config\": {\n        \"repos\": [\n          {\n            \"repo_url\": \"https:\u002F\u002Fgithub.com\u002Forg\u002Fmain-app\",\n            \"role\": \"primary\"\n          },\n          {\n            \"repo_url\": \"https:\u002F\u002Fgithub.com\u002Forg\u002Fshared-lib\",\n            \"role\": \"dependency\"\n          }\n        ],\n        \"runtime\": \"claude_code\",\n        \"models\": {\n          \"default\": \"sonnet\"\n        }\n      }\n    }\n  }'\n```\n\n---\n\n**下一步建议**：查看官方文档中的 [Architecture](docs\u002FARCHITECTURE.md) 了解内部架构，或参考 [Benchmark](#benchmark) 了解性能表现。","某金融科技初创团队需在上线前完成核心鉴权与计费模块的重构。这涉及主应用与共享库两个仓库，时间紧迫。\n\n### 没有 SWE-AF 时\n- 人工沟通成本高，产品经理、架构师与开发者需反复拉会对齐需求细节。\n- 跨仓库修改极易遗漏依赖关系，常导致本地联调失败，浪费大量排查时间。\n- 测试用例编写耗时且覆盖率低，难以发现复杂的边界逻辑漏洞。\n- 代码审查流程冗长，紧急发布窗口期下团队压力巨大，容易引入人为失误。\n\n### 使用 SWE-AF 后\n- 通过 API 调用即可启动全栈智能体团队，自动拆解任务并分配规划、编码与测试角色。\n- 支持多仓库协同模式，精准感知主应用与共享库的依赖结构，确保同步更新无遗漏。\n- 内置自动化测试生成机制，快速执行单元测试与集成验证，保障功能稳定性。\n- 直接产出符合生产标准的 Pull Request，大幅缩短人工审查周期，加速上线节奏。\n\nSWE-AF 将原本需要数周的人工迭代压缩至小时级交付，显著降低维护成本并提升工程效率。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FAgent-Field_SWE-AF_7e214ca5.jpg","Agent-Field","AgentField","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002FAgent-Field_b50490bf.png","",null,"contact@agentfield.ai","agentfield_ai","www.agentfield.ai","https:\u002F\u002Fgithub.com\u002FAgent-Field",[24,28,32],{"name":25,"color":26,"percentage":27},"Python","#3572A5",99.7,{"name":29,"color":30,"percentage":31},"Dockerfile","#384d54",0.2,{"name":33,"color":34,"percentage":35},"Makefile","#427819",0.1,675,111,"2026-04-05T01:38:44","Apache-2.0",3,"Linux, macOS","未说明",{"notes":44,"python":45,"dependencies":46},"工具主要依赖云端大模型 API（如 Claude、OpenRouter、OpenAI），无需本地 GPU 推理；部署需配置 CLAUDE_CODE_OAUTH_TOKEN 和 GH_TOKEN；支持通过 Railway 一键部署（含 PostgreSQL）或本地运行 AgentField 控制平面。","3.12+",[15],[48,49,50,51],"Agent","插件","语言模型","开发框架",[53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70],"agent-factory","ai-factory","claude-code","code-generation","codex","coding-agent","gemini-cli","llm","agentfield","autonomous-agents","software-engineering","agentic-ai","ai-agents","developer-tools","multi-agent","open-source","openrouter","python",5,"ready","2026-03-27T02:49:30.150509","2026-04-06T05:17:25.739330",[76,81,86,91,96],{"id":77,"question_zh":78,"answer_zh":79,"source_url":80},2148,"如何将 fast_plan_tasks 模块从自定义 AgentAI 迁移到 AgentField 原生方法？","推荐使用 `router.harness()`（如果需要读取仓库文件）或 `router.ai()`（仅使用提示词上下文）。代码示例显示需将 `AgentAI(...).run()` 替换为 `await fast_router.harness()` 或 `await fast_router.ai()`。注意：主分支已完成迁移，现有用户无需额外代码更改。","https:\u002F\u002Fgithub.com\u002FAgent-Field\u002FSWE-AF\u002Fissues\u002F28",{"id":82,"question_zh":83,"answer_zh":84,"source_url":85},2149,"执行过程中出现停滞或退出码 -2 是什么原因及如何解决？","这通常发生在 coder 进入接受标准（AC）调试循环后无法收敛。维护者已在相关分支添加了基本的循环检测检查和单元测试。如果遇到此问题，请确保使用包含修复的最新版本（如 fix\u002Fclaude-sdk-rate-limit-event-compat 分支），以启用自动退出机制。","https:\u002F\u002Fgithub.com\u002FAgent-Field\u002FSWE-AF\u002Fissues\u002F12",{"id":87,"question_zh":88,"answer_zh":89,"source_url":90},2150,"编码循环的迭代状态是如何跟踪和重试的？","系统不再使用本地 JSON 文件跟踪迭代，而是通过 PlanDB 的重试策略管理。创建任务时需配置 `max_retries`（默认 5）和 `retry_backoff`。当 reviewer 拒绝导致失败时，调用 `adapter.fail_task`，若重试次数未超限，PlanDB 会自动重置任务为 ready 状态并重试。","https:\u002F\u002Fgithub.com\u002FAgent-Field\u002FSWE-AF\u002Fissues\u002F37",{"id":92,"question_zh":93,"answer_zh":94,"source_url":95},2151,"问题顾问（Advisor）如何处理任务修改、拆分或延期？","Advisor 决策通过 PlanDB 结构化原语执行。例如 `RETRY_MODIFIED` 使用 `plandb task amend` 修改标准，`SPLIT` 使用 `plandb task split` 拆分为子任务，`ACCEPT_WITH_DEBT` 使用 `plandb done` 标记完成。这些操作会重置任务状态以便重新执行。","https:\u002F\u002Fgithub.com\u002FAgent-Field\u002FSWE-AF\u002Fissues\u002F38",{"id":97,"question_zh":98,"answer_zh":99,"source_url":100},2152,"重规划（Replanner）如何修改 DAG 结构？","重规划决策通过 PlanDB 适配器应用，不再直接修改内存中的 DAGState。例如 `MODIFY_DAG` 动作对应 `plandb task create` 和 `add-dep`，`REDUCE_SCOPE` 对应 `cancel` 非关键任务，`ABORT` 则取消所有挂起任务。","https:\u002F\u002Fgithub.com\u002FAgent-Field\u002FSWE-AF\u002Fissues\u002F39",[],[103,112,121,129,137,149],{"id":104,"name":105,"github_repo":106,"description_zh":107,"stars":108,"difficulty_score":40,"last_commit_at":109,"category_tags":110,"status":72},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,"2026-04-05T11:01:52",[51,111,48],"图像",{"id":113,"name":114,"github_repo":115,"description_zh":116,"stars":117,"difficulty_score":118,"last_commit_at":119,"category_tags":120,"status":72},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",138956,2,"2026-04-05T11:33:21",[51,48,50],{"id":122,"name":123,"github_repo":124,"description_zh":125,"stars":126,"difficulty_score":118,"last_commit_at":127,"category_tags":128,"status":72},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",107662,"2026-04-03T11:11:01",[51,111,48],{"id":130,"name":131,"github_repo":132,"description_zh":133,"stars":134,"difficulty_score":118,"last_commit_at":135,"category_tags":136,"status":72},3704,"NextChat","ChatGPTNextWeb\u002FNextChat","NextChat 是一款轻量且极速的 AI 助手，旨在为用户提供流畅、跨平台的大模型交互体验。它完美解决了用户在多设备间切换时难以保持对话连续性，以及面对众多 AI 模型不知如何统一管理的痛点。无论是日常办公、学习辅助还是创意激发，NextChat 都能让用户随时随地通过网页、iOS、Android、Windows、MacOS 或 Linux 端无缝接入智能服务。\n\n这款工具非常适合普通用户、学生、职场人士以及需要私有化部署的企业团队使用。对于开发者而言，它也提供了便捷的自托管方案，支持一键部署到 Vercel 或 Zeabur 等平台。\n\nNextChat 的核心亮点在于其广泛的模型兼容性，原生支持 Claude、DeepSeek、GPT-4 及 Gemini Pro 等主流大模型，让用户在一个界面即可自由切换不同 AI 能力。此外，它还率先支持 MCP（Model Context Protocol）协议，增强了上下文处理能力。针对企业用户，NextChat 提供专业版解决方案，具备品牌定制、细粒度权限控制、内部知识库整合及安全审计等功能，满足公司对数据隐私和个性化管理的高标准要求。",87618,"2026-04-05T07:20:52",[51,50],{"id":138,"name":139,"github_repo":140,"description_zh":141,"stars":142,"difficulty_score":118,"last_commit_at":143,"category_tags":144,"status":72},2268,"ML-For-Beginners","microsoft\u002FML-For-Beginners","ML-For-Beginners 是由微软推出的一套系统化机器学习入门课程，旨在帮助零基础用户轻松掌握经典机器学习知识。这套课程将学习路径规划为 12 周，包含 26 节精炼课程和 52 道配套测验，内容涵盖从基础概念到实际应用的完整流程，有效解决了初学者面对庞大知识体系时无从下手、缺乏结构化指导的痛点。\n\n无论是希望转型的开发者、需要补充算法背景的研究人员，还是对人工智能充满好奇的普通爱好者，都能从中受益。课程不仅提供了清晰的理论讲解，还强调动手实践，让用户在循序渐进中建立扎实的技能基础。其独特的亮点在于强大的多语言支持，通过自动化机制提供了包括简体中文在内的 50 多种语言版本，极大地降低了全球不同背景用户的学习门槛。此外，项目采用开源协作模式，社区活跃且内容持续更新，确保学习者能获取前沿且准确的技术资讯。如果你正寻找一条清晰、友好且专业的机器学习入门之路，ML-For-Beginners 将是理想的起点。",84991,"2026-04-05T10:45:23",[111,145,146,49,48,147,50,51,148],"数据工具","视频","其他","音频",{"id":150,"name":151,"github_repo":152,"description_zh":153,"stars":154,"difficulty_score":40,"last_commit_at":155,"category_tags":156,"status":72},3128,"ragflow","infiniflow\u002Fragflow","RAGFlow 是一款领先的开源检索增强生成（RAG）引擎，旨在为大语言模型构建更精准、可靠的上下文层。它巧妙地将前沿的 RAG 技术与智能体（Agent）能力相结合，不仅支持从各类文档中高效提取知识，还能让模型基于这些知识进行逻辑推理和任务执行。\n\n在大模型应用中，幻觉问题和知识滞后是常见痛点。RAGFlow 通过深度解析复杂文档结构（如表格、图表及混合排版），显著提升了信息检索的准确度，从而有效减少模型“胡编乱造”的现象，确保回答既有据可依又具备时效性。其内置的智能体机制更进一步，使系统不仅能回答问题，还能自主规划步骤解决复杂问题。\n\n这款工具特别适合开发者、企业技术团队以及 AI 研究人员使用。无论是希望快速搭建私有知识库问答系统，还是致力于探索大模型在垂直领域落地的创新者，都能从中受益。RAGFlow 提供了可视化的工作流编排界面和灵活的 API 接口，既降低了非算法背景用户的上手门槛，也满足了专业开发者对系统深度定制的需求。作为基于 Apache 2.0 协议开源的项目，它正成为连接通用大模型与行业专有知识之间的重要桥梁。",77062,"2026-04-04T04:44:48",[48,111,51,50,147]]