面向代理的编写
MVPavan2026-10-26查看 667复制 1269
在创建或更改代理指令或其激活行为时使用。跳过仅纠正拼写或格式的编辑。
📘如何使用这个技能
- 1复制技能内容·点击上方「Copy SKILL.md」复制全部内容,或 Download 下载到本地
- 2打开你的 AI 客户端·支持 Claude Code、Trae、Cursor、ChatGPT、DeepSeek、Kimi 等任意 AI 助手
- 3粘贴为系统提示/知识文件·Claude Code:放入 .claude/skills/ 目录;普通对话:作为首条消息发送并说「请严格按这份技能文档执行」
- 4直接提出你的需求·AI 会按技能定义的工作流、格式和约束来处理,无需再解释背景
💡 提示:技能生效后,每次对话只需一句需求,AI 会按 SKILL.md 的流程执行。
SKILL.md2454 chars
--- name: authoring-for-agents description: Use when creating or changing agent instructions or their activation behavior. Skip edits that only correct spelling or formatting. --- # Authoring for Agents Write instructions for a named failure, a task-specific contract, or a repository fact the agent cannot infer reliably. Remove generic advice that adds no behavior. ## Choose the surface | Need | Owner | |---|---| | Policy needed on every task | AGENTS.md | | Convention needed for particular work | Project document with a conditional AGENTS.md pointer | | Repeated specialist workflow | Skill | | Explicit human entrypoint | Manual skill or thin alias | | Substantial material used by one branch | Conditional reference | | Deterministic enforcement | Existing hook, check, or script where authorized | Search for an existing owner before adding another. Keep shared semantics provider-neutral; runtime configuration owns models, effort, permissions and integration mechanics. Preserve scope restrictions on which files may change. ## Write - Put the activation boundary first: positive cases and the nearest misleading case to skip. A description should select the skill, not duplicate its steps. - Inline the common contract; link substantial optional material at the branch that needs it. Moving text behind an unconditional read does not save context. - State outputs, material invariants, authority boundaries and stop conditions. Use exact recipes for fragile operations and judgment for routine choices. - Prefer one effective instruction over repeated prohibitions or ritual steps. Treat wording techniques as hypotheses to evaluate, not psychological laws. For structural choices, consult `references/writing-principles.md`; for skill metadata, aliases and sidecars, consult `references/skill-anatomy.md`. ## Verify Inspect the diff for lost contracts and conflicting callers. For descriptions or routing changes, check a positive case and a nearby trivial/negative case through the actual discovery surface when available. Scale fresh-context and pressure trials to behavioral risk; methods are in `references/testing-docs.md`. Structural checks establish packaging, not model behavior. Report unavailable behavioral checks as a limit; do not manufacture evidence or bypass runtime restrictions to run them. Revise the smallest instruction implicated by a failed case, then recheck that case and its affected neighbors.