writing-agents-md

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Writing Agent Instructions

编写Agent指令

Keep
AGENTS.md
/
CLAUDE.md
focused on project decisions the agent cannot reliably infer from nearby code or tooling. Instruction loading differs by harness; verify which root and nested files apply before counting their context cost.
保持
AGENTS.md
/
CLAUDE.md
聚焦于Agent无法从周边代码或工具中可靠推断的项目决策。不同harness的指令加载方式不同;在计算上下文成本前,请确认哪些根文件和嵌套文件适用。

Keep, Move, or Remove

保留、迁移或删除

  • Keep non-obvious commands, expensive tripwires, domain vocabulary, and project-specific ownership/compatibility decisions.
  • Move a rule to the narrowest subtree or on-demand skill that needs it. Link long rationale or incident evidence instead of embedding it.
  • Remove generic engineering advice, duplicated rules, stale model pins, rhetorical emphasis, fixed response ceremonies, and procedures already owned by the harness or toolchain.
  • A rule must name when it applies. Availability of a skill does not justify requiring it for every task. Preserve concrete safety and product invariants while narrowing their procedure.
  • 保留非显而易见的命令、高成本触发条件、领域术语以及项目特定的归属/兼容性决策。
  • 将规则迁移至需要它的最窄子树或按需技能中。通过链接引用冗长的原理或事件证据,而非直接嵌入。
  • 移除通用工程建议、重复规则、过时的模型固定配置、修辞性强调、固定响应流程以及已由harness或工具链负责的流程。
  • 每条规则必须明确适用场景。技能的可用性并不意味着每个任务都需要使用它。在精简流程的同时,保留具体的安全和产品不变量。

Work

工作步骤

  1. Read the relevant instructions, current repository contracts, and user decisions. Check recent changes before pruning policy; keep historical evidence separate from active rules.
  2. Review rules by concern: keep, rewrite, relocate, or remove. Record material policy changes and relocations in a concise summary; a line-by-line public verdict table is unnecessary unless requested.
  3. Resolve contradictions using the user's current direction and the repository's authoritative policy. Ask only if a remaining conflict changes the outcome and has no established owner.
  4. Edit the owning file once and update its pointers. Preserve symlinks and tool-generated blocks; avoid parallel copies that drift.
  5. Check that important invariants and real commands remain reachable, nested instructions agree, and removed rules are not silently reintroduced by skills or memory. Review links and changed behavior; prose-only edits do not need tests that freeze wording.
Use short, concrete rules with emphasis reserved for costly violations. A command or example earns space when it prevents an actual ambiguity. Optimize the total material loaded for representative tasks, not line count alone or moving an unconditional full read into a reference.
Done when the requested scope has one clear owner per rule, no unresolved policy contradiction, and proportionate validation. Report what changed and any remaining limitations without creating a recurring audit ritual.
  1. 阅读相关指令、当前仓库约定以及用户决策。在精简策略前检查近期变更;将历史证据与有效规则分开存放。
  2. 按关注点审查规则:保留、重写、迁移或删除。将重大策略变更和迁移记录在简洁的摘要中;除非有要求,否则无需逐行公开裁决表。
  3. 根据用户当前方向和仓库的权威政策解决矛盾。仅当剩余冲突会改变结果且没有明确负责人时,才提出疑问。
  4. 编辑所属文件一次并更新其引用指针。保留符号链接和工具生成的代码块;避免会产生偏差的并行副本。
  5. 确保重要的不变量和实际命令仍可访问,嵌套指令保持一致,且已移除的规则不会被技能或内存悄悄重新引入。检查链接和变更后的行为;仅涉及文字的编辑无需添加固定措辞的测试。
使用简短、具体的规则,仅对高违规成本的内容加以强调。当命令或示例能避免实际歧义时,才值得保留。针对代表性任务优化加载的总内容,而非仅关注行数,或把无条件的完整阅读内容转为引用。
当请求范围内的每条规则都有明确负责人、不存在未解决的政策矛盾,且验证措施比例适当时,即完成任务。报告变更内容及任何剩余限制,但无需建立重复审核机制。