aider-delegate
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseAider Delegate
Aider 任务委托
You are the orchestrator. Hand a bounded coding task to a separate implementer - Aider - then
review what it produced and land it yourself. You write the brief and own the judgment; Aider does the
typing in its own run; you verify and commit.
The loop needs only a shell command and file access, so any comparable orchestrator can drive it.
你是协调者。将一个明确的编码任务交给独立的实现者——Aider,然后审核其产出并自行落地。你编写任务简报并负责判断;Aider在独立运行中完成代码编写;你负责验证并提交。
该流程仅需要shell命令和文件访问权限,因此任何类似的协调工具都可以驱动它。
The one thing to know about Aider
关于Aider必须了解的一点
Aider commits by default. Two of its defaults would destroy the reviewable diff this skill exists
to produce:
- (default
--auto-commits) - Aider commits its own edits after each exchange.True - (default
--dirty-commits) - Aider commits your pre-existing uncommitted work before it starts editing.True
The relay always passes and , and neither is configurable
through it. If you ever drive by hand instead of through the relay, pass both yourself, or the
work lands as commits you never reviewed. The relay also passes , because Aider
otherwise writes into on startup and dirties the tree you are about to read.
--no-auto-commits--no-dirty-commitsaider--no-gitignore.aider*.gitignoreAider默认会提交代码。它的两个默认设置会破坏本技能旨在生成的可审核diff:
- (默认值
--auto-commits)——Aider在每次交互后自动提交自己的编辑内容。True - (默认值
--dirty-commits)——Aider在开始编辑前,会提交你已有的未提交工作。True
中继工具始终会传递和,且这两个参数无法通过中继工具配置。如果你手动运行而非通过中继工具,请自行传递这两个参数,否则工作会以你从未审核过的提交形式落地。中继工具还会传递,因为否则Aider会在启动时将写入,弄脏你即将读取的工作树。
--no-auto-commits--no-dirty-commitsaider--no-gitignore.aider*.gitignoreWhen NOT to use this
请勿使用本技能的场景
- The task is small enough to do inline; delegation overhead is not worth it.
- The CLI is not installed, or no model is configured for it.
aider - You want the implementer to manage its own commits. Aider can, but this skill deliberately turns that off - the diff is the deliverable.
- 任务小到可以直接完成;委托的开销不值得。
- 未安装CLI,或未为其配置模型。
aider - 你希望实现者自行管理提交。Aider可以做到,但本技能特意关闭了该功能——diff是交付成果。
Prerequisites (check once)
前置条件(检查一次)
- Install Aider - , or the standalone installer from the Aider install docs.
python -m pip install aider-chat - Configure a model. Aider reads provider keys from the environment (,
OPENAI_API_KEY, …) or its own config; see Aider's model docs.ANTHROPIC_API_KEY - Confirm succeeds.
aider --version - Work in, or point at, the target git repository.
--cd
- 安装Aider——执行,或从Aider 安装文档获取独立安装程序。
python -m pip install aider-chat - 配置模型。Aider从环境变量(、
OPENAI_API_KEY……)或自身配置文件读取服务商密钥;详见Aider 模型文档。ANTHROPIC_API_KEY - 确认执行成功。
aider --version - 在目标git仓库中工作,或通过指定目标git仓库路径。
--cd
Choose the model
选择模型
Aider uses its own configured model when is omitted. Pass to pick another.
--model--model <name>当省略参数时,Aider使用自身配置的模型。传递参数可选择其他模型。
--model--model <name>Local and self-hosted models
本地与自托管模型
Aider talks to any OpenAI-compatible endpoint, so this is also the skill for delegating to a model
running on the user's own hardware - llama.cpp's server, Ollama, vLLM, LM Studio, or anything else
that serves the same API. Pair with :
--model--api-basebash
node "<skill-dir>/scripts/relay.mjs" --brief brief.txt --cd /path/to/repo \
--model openai/<served-model-name> --api-base http://127.0.0.1:<port>/v1Three things differ from a hosted provider:
- The prefix is required. It tells Aider to speak the OpenAI protocol to your endpoint; the part after it is whatever name your server reports, not a provider catalog name.
openai/ - A placeholder key is still needed. Export any non-empty . The client library requires the header even when the server ignores its value.
OPENAI_API_KEY - Ask for a smaller edit format. Local models often fail Aider's default format, which requires exact search/replace blocks.
difftrades tokens for reliability; keep the brief's scope tight with--edit-format wholeso whole-file rewrites stay cheap.--file
A local endpoint that is not running looks like a hang, not an error: Aider retries the connection
until the relay's watchdog fires and reports . Confirm the server is up
before dispatching a long brief.
--timeoutstatus: "timeout"Aider可与任何OpenAI兼容的端点通信,因此本技能也适用于委托给用户本地硬件运行的模型——llama.cpp的服务器、Ollama、vLLM、LM Studio,或任何提供相同API的服务。将与配合使用:
--model--api-basebash
node "<skill-dir>/scripts/relay.mjs" --brief brief.txt --cd /path/to/repo \
--model openai/<served-model-name> --api-base http://127.0.0.1:<port>/v1与托管服务商相比,有三点不同:
- 必须添加前缀。它告知Aider向你的端点使用OpenAI协议;前缀后的部分是你的服务器报告的名称,而非服务商目录中的名称。
openai/ - 仍需要占位符密钥。导出任意非空的。即使服务器忽略该值,客户端库仍要求此请求头。
OPENAI_API_KEY - 请求更小的编辑格式。本地模型通常无法处理Aider默认的格式,该格式需要精确的搜索/替换块。
diff以消耗更多token为代价提升可靠性;通过--edit-format whole参数严格限制简报范围,使全文件重写的成本可控。--file
未运行的本地端点会导致任务挂起而非报错:Aider会重试连接,直到中继工具的监控触发并返回。在发送长简报前,请确认服务器已启动。
--timeoutstatus: "timeout"Staying offline
保持离线状态
No account or provider registration is involved: Aider is a pip install, the endpoint is yours, and
only has to be non-empty. The relay pins the flags that would otherwise reach the
network on their own - , (Aider's own default is , which
opts some sessions in by itself), and , without which Aider offers to scrape any URL
in the brief and accepts that offer silently.
OPENAI_API_KEY--no-check-update--no-analyticsrandom--no-detect-urls--yes-always--no-suggest-shell-commands--auto-lint无需账户或服务商注册:Aider是一个pip包,端点由你自己掌控,且只需非空即可。中继工具会固定那些可能主动联网的标志——、(Aider自身默认值为,会随机将部分会话纳入统计),以及,否则Aider会主动抓取简报中的任何URL,而会静默接受该请求。
OPENAI_API_KEY--no-check-update--no-analyticsrandom--no-detect-urls--yes-always--no-suggest-shell-commands--auto-lintThe loop
流程
Run these five steps per task. Steps 1, 4, and 5 require judgment; 2 and 3 are mechanical.
每个任务执行以下五个步骤。步骤1、4、5需要判断;步骤2和3是机械操作。
1. Write the brief
1. 编写简报
Aider sees only the text you send plus the files in its editing scope - no chat history or shared
context. Include the goal, current state, what to change, what to leave untouched, the project's
actual gates, and a report contract. Keep one task per brief. See
references/writing-the-brief.md.
Aider只能看到你发送的文本及其编辑范围内的文件——没有聊天历史或共享上下文。请包含目标、当前状态、需要修改的内容、需要保留的内容、项目的实际验收标准,以及报告约定。每个简报对应一个任务。详见references/writing-the-brief.md。
2. Dispatch
2. 调度
Use the bundled helper. It wraps Aider's headless mode, captures the run, and writes
. ( is the installed folder containing this .)
--message-fileresult.json<skill-dir>SKILL.mdbash
node "<skill-dir>/scripts/relay.mjs" --brief brief.txt --cd /path/to/repo使用内置的辅助工具。它封装了Aider的无头模式,捕获运行过程并写入。(是包含本的安装目录。)
--message-fileresult.json<skill-dir>SKILL.mdbash
node "<skill-dir>/scripts/relay.mjs" --brief brief.txt --cd /path/to/repochoose a model: add --model <name>
选择模型: 添加 --model <name>
point at an OpenAI-compatible server: add --api-base <url>
指定OpenAI兼容服务器: 添加 --api-base <url>
scope the edit surface: add --file <path> (repeatable), --read <path> for context only
限制编辑范围: 添加 --file <path>(可重复),--read <path>仅用于获取上下文
dry run, no files modified: add --read-only
试运行,不修改文件: 添加 --read-only
continue the previous chat: add --resume-last (delta brief only)
继续之前的对话: 添加 --resume-last (仅传递增量简报)
hard time limit (watchdog): add --timeout 2h (the 30m default suits short runs; implementation briefs routinely need 1-2h)
硬时间限制(监控): 添加 --timeout 2h (默认30分钟适合短任务;实现类简报通常需要1-2小时)
see all options: node .../relay.mjs --help
查看所有选项: node .../relay.mjs --help
The child process's cwd pins the workspace. The brief is delivered with `--message-file`, so it never
rides argv: it stays out of the host process list and clear of the OS argument size cap. The relay
writes artifacts under the system temp dir by default and never commits. See
[references/dispatch-and-poll.md](references/dispatch-and-poll.md).
子进程的当前工作目录固定为工作区。简报通过`--message-file`传递,因此不会出现在命令行参数中:它不会进入主机进程列表,也不会受限于OS的参数大小限制。中继工具默认将产物写入系统临时目录,且不会提交代码。详见[references/dispatch-and-poll.md](references/dispatch-and-poll.md)。3. Wait for completion
3. 等待完成
The helper blocks until Aider finishes. Run it with the orchestrator's background-command facility, or
background it in the shell and poll for . A pre-run usage error exits 2 and writes no
result; a missing exits 127 and writes .
result.jsonaiderstatus: "aider_unavailable"Trust process state and the working tree over a progress display. Completion means the process exited
and exists. Aider's report is the field in (also printed in
full on stdout between the report markers).
result.jsonfinalMessageresult.jsonAider exits 0 even when it never reached a model, so the relay scans the run for Aider's own endpoint
and authentication errors and reports when it finds one. Treat a status
with an mentioning the endpoint as a configuration problem, not a coding failure.
status: "failed"failederror辅助工具会阻塞直到Aider完成。使用协调者的后台命令功能运行它,或在shell中将其置于后台并轮询。预运行的使用错误会以状态码2退出且不写入结果;找不到会以状态码127退出并写入。
result.jsonaiderstatus: "aider_unavailable"信任进程状态和工作树而非进度显示。完成意味着进程已退出且存在。Aider的报告位于的字段(也会完整打印在stdout的报告标记之间)。
result.jsonresult.jsonfinalMessage即使未连接到模型,Aider也会以状态码0退出,因此中继工具会扫描运行日志,查找Aider自身的端点和认证错误,并在发现时报告。如果状态的字段提及端点,请将其视为配置问题而非编码失败。
status: "failed"failederror4. Review - do not trust the self-report
4. 审核——不要相信自我报告
Treat Aider's final message and gate claims as claims:
- Re-run the project's gates yourself.
- Read the diff against the brief, starting with .
touchedFiles - Run relevant guard skills if installed.
- Round-trip migrations and grep for dangling references after removals or renames.
Aider's is on by default, so it may have already run a linter and fixed its own
complaints. That is Aider's lint, not your gates - run yours anyway. See
references/review-and-land.md.
--auto-lint将Aider的最终消息和验收标准声明视为待验证的主张:
- 自行运行项目的验收标准。
- 根据简报审核diff,从开始。
touchedFiles - 如果已安装相关守卫技能,请运行它们。
- 在删除或重命名后,往返迁移并 grep 查找悬空引用。
Aider默认开启,因此它可能已运行过代码检查工具并修复了自身的问题。但这是Aider的检查,而非你的验收标准——请务必运行你自己的检查。详见references/review-and-land.md。
--auto-lint5. Land it
5. 落地
The implementer edits the working tree; the orchestrator commits. Commit only after the gates pass
and the diff holds. If rework is needed, send a delta brief with , then review again.
--resume-last实现者编辑工作树;协调者提交代码。仅当验收标准通过且diff符合要求时再提交。如果需要返工,请使用发送增量简报,然后再次审核。
--resume-lastAutonomy and permissions
自主性与权限
The relay passes , Aider's own term for auto-confirming every prompt, because a headless
run cannot answer one. Understand what that consents to in advance. Auto-confirmation applies to
every prompt Aider would otherwise raise, and Aider's prompts are not limited to file edits: left at
its defaults it also offers to run shell commands it has suggested, and would accept
those with nobody reading them. The relay therefore pins , which removes
that path.
--yes-always--yes-always--no-suggest-shell-commandsWhat remains is not a sandbox, and nothing here pretends otherwise. Aider has no permission modes and
no isolation: within its file scope it edits freely, and (on by default) runs whatever
linter the repository configures. A brief that tells Aider to run a command still gets a command run.
Delegation is the authorization; if a run must not be able to touch the host, run it in a container or
a throwaway worktree, because no flag in this relay will give you that.
--auto-lintFile selection is not a security boundary. , , and set what Aider
puts in its chat context, which is a scoping and token-cost decision. They do not confine what it can
reach. See references/writing-the-brief.md.
--file--read--subtree-only--read-only--dry-rungit status --porcelain--read-onlytouchedFiles中继工具会传递,这是Aider对所有提示自动确认的术语,因为无头运行无法响应提示。请提前了解这会自动同意哪些操作。自动确认适用于Aider所有可能弹出的提示,且Aider的提示不限于文件编辑:默认情况下,它还会提议运行自己建议的shell命令,而会无人审核就接受这些命令。因此中继工具固定了,关闭了这条路径。
--yes-always--yes-always--no-suggest-shell-commands剩余的并非沙箱,本技能也不会假装是。Aider没有权限模式或隔离机制:在其文件范围内可自由编辑,且默认开启的会运行仓库配置的任何代码检查工具。如果简报要求Aider运行命令,该命令仍会被执行。委托即授权;如果运行不能接触主机,请在容器或临时工作树中执行,因为本中继工具的任何标志都无法提供这种隔离。
--auto-lint文件选择不是安全边界。、和用于设置Aider的聊天上下文范围,这是一个范围界定和token成本的决策。它们无法限制Aider可访问的范围。详见references/writing-the-brief.md。
--file--read--subtree-only--read-only--dry-rungit status --porcelain--read-onlytouchedFilesResume
恢复会话
Aider has no session ids. Its resume unit is the chat history file it keeps in the repository
(), so maps to Aider's and
pins a specific one. Because that history lives in the repo, resume is per-worktree,
not per-user: two clones of the same project do not share it.
.aider.chat.history.md--resume-last--restore-chat-history--history-fileAider没有会话ID。它的恢复单元是保存在仓库中的聊天历史文件(),因此对应Aider的,用于指定特定的历史文件。由于该历史文件存储在仓库中,恢复是基于工作树而非用户的:同一项目的两个克隆不会共享该历史。
.aider.chat.history.md--resume-last--restore-chat-history--history-fileAuthorization model
授权模型
Delegation is something the human opts into. Once they have ("run this queue", "proceed"), committing
verified, gate-passing work is the agreed contract. Two limits remain: surface, don't absorb
(report Aider's design decisions, defensible-but-unasked turns, and non-blocking nitpicks) and stop
for scope changes (if correct completion needs going beyond the brief, ask instead of expanding the
mandate). See references/review-and-land.md.
委托是人类主动选择的操作。一旦用户选择(“运行此队列”、“继续”),提交经过验证、符合验收标准的工作就是约定的契约。仍有两个限制:展示而非吸收(报告Aider的设计决策、合理但未被要求的变更,以及非阻塞性的小问题)和范围变更时停止(如果正确完成任务需要超出简报范围,请先询问用户而非扩大任务范围)。详见references/review-and-land.md。
References
参考资料
- references/writing-the-brief.md - structure, report contract, real gates, file scope, and delta briefs.
- references/dispatch-and-poll.md - flags, artifacts,
, polling, and failure recovery.
result.json - references/review-and-land.md - review checklist, the commit boundary, and rework through Aider's chat history.
- references/multi-task-queues.md - sequential queues, constraint carry-forward, progress tracking, and the final coherence pass.
- references/writing-the-brief.md - 结构、报告约定、实际验收标准、文件范围和增量简报。
- references/dispatch-and-poll.md - 标志、产物、、轮询和故障恢复。
result.json - references/review-and-land.md - 审核清单、提交边界和通过Aider聊天历史进行返工。
- references/multi-task-queues.md - 顺序队列、约束传递、进度跟踪和最终一致性检查。