parallel-agents

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Parallel agents

并行Agent

Merge conflicts among parallel agents concentrate in hub files: the files every feature must touch regardless of what the feature is (the subcommand dispatcher, the router, the single test main, the root AGENTS.md). Four rules reduce them, in the order you usually need them:
  1. New behavior gets its own file. The shared file it plugs into grows by exactly one line: a
    mod
    declaration, a route registration, a delegating match arm, a table entry.
  2. Shape edits to shared files so git merges them alone. One item per line, stable insertion order, no drive-by rewrites of lines you did not need to change, and never hand-resolve a generated file or lockfile; regenerate it.
  3. Find and split existing hubs. Rank files by churn times size, keep only the ones touched by unrelated features, and split them along concern seams as pure-move commits.
  4. Docs hold scars and invariants, nothing else. Delete anything an agent can discover with one grep or
    --help
    , and shard per-module detail out of the root doc.
并行Agent之间的合并冲突集中在枢纽文件(hub files)中:即无论功能是什么,每个功能都必须修改的文件(子命令调度器、路由、单测试主文件、根目录下的AGENTS.md)。以下四条规则可减少冲突,按通常的需求顺序排列:
  1. 新行为单独存放在独立文件中。它所接入的共享文件仅需增加一行内容:一个
    mod
    声明、一条路由注册、一个委托匹配分支、一个表项。
  2. 调整共享文件的编辑方式以支持Git自动合并。每行一个条目,保持插入顺序稳定,不要随意改写无需修改的行,绝不要手动解决生成文件或锁文件的冲突;重新生成即可。
  3. 查找并拆分现有枢纽文件。按变更频率乘以文件大小对文件排序,仅保留那些被无关功能修改的文件,并按关注点边界将它们拆分为纯移动提交(pure-move commits)。
  4. 文档仅保留关键规则和不变内容,其余一概删除。删除任何Agent只需通过一次grep或
    --help
    就能发现的内容,并将模块细节从根文档中拆分出去。

References

参考资料

Read the file that matches the task. Each stands alone.
  • references/one-feature-one-file.md
    : where new behavior lives, how to recognize a hub, patterns by project shape (CLI, HTTP service, web UI, tests).
  • references/mergeable-edits.md
    : list and registry discipline, formatter scope, ownership rules, generated files, resolving a conflict in a hub.
  • references/hotspot-audit.md
    : the churn measurement command, hub vs hot concern vs generated triage, pure-move splits, timing and cadence.
  • references/doc-gardening.md
    : what AGENTS.md/CLAUDE.md and user docs are for, the discoverability test, pruning, sharding the root doc.
阅读与任务匹配的文件,每个文件独立成篇。
  • references/one-feature-one-file.md
    :新行为的存放位置、如何识别枢纽文件、按项目类型(CLI、HTTP服务、Web UI、测试)划分的模式。
  • references/mergeable-edits.md
    :列表与注册表规范、格式化范围、所有权规则、生成文件、解决枢纽文件中的冲突。
  • references/hotspot-audit.md
    :变更频率测量命令、枢纽文件vs高频关注点vs生成文件的分类、纯移动拆分、时机与节奏。
  • references/doc-gardening.md
    :AGENTS.md/CLAUDE.md和用户文档的用途、可发现性测试、内容精简、根文档拆分。