writing-for-agents
Write predictable documents for agents. Use for skills, AGENTS.md, CLAUDE.md, or agent-facing reference documents.
- License 许可
- MIT
- 最近更新
- 2026-10-03
- Stars
- ★ 1
- Forks
- 0
01 前言 Front Matter
- name
- writing-for-agents
- description
- Write predictable documents for agents. Use for skills, AGENTS.md, CLAUDE.md, or agent-facing reference documents.
02 资源文件 2
- 参考文档agents/openai.yaml261 B
- 参考文档references/skill-mechanics.md1.0 KB
03 SKILL.md 正文
Writing for Agents
Write every agent-facing document so repeated runs follow the same process. Apply the same rules to skills, repository instructions, and referenced documents. For skill packaging, invocation, and routers, read skill mechanics.
Context pointers
A context pointer names material outside the current context and states when to read it. Its wording controls discovery.
- State what the material contains.
- Name one trigger for each distinct branch.
- Front-load the leading concept.
- Remove identity already carried by the target.
Always-loaded pointers spend context on every turn. User-invoked material spends human attention because the human must remember it.
Information hierarchy
Place each instruction at the highest useful level:
- In-file steps describe the ordered process.
- In-file reference defines rules consulted during that process.
- Disclosed reference serves branches that only some runs need.
Keep definitions, rules, and caveats together. Split a document when a branch hides the main process or the visible later steps cause premature completion.
Completion criteria
End every step with an observable completion criterion. Sharpen vague criteria before splitting the sequence. Demand exhaustive output where missing one item invalidates the result.
Use leading words that already carry useful meaning. Reuse the token across the document. Phrase target behavior positively. Reserve prohibitions for hard guardrails and pair them with the desired action.
Pruning
- Keep each meaning in one authoritative location.
- Treat configuration, commands, and directory layout as sources of truth.
- Document conventions, reasons, and traps the environment cannot reveal.
- Remove stale lines, duplicated branches, and no-op instructions.
- Test disputed instructions by running the document and comparing behavior.
The document is complete when every live branch has a pointer, every step has a checkable end, and every line changes behavior or preserves necessary reference.
04 同仓库更多 Skills
verify-this
Verify a falsifiable claim with fresh baseline and treatment evidence. Use for verify this, prove it works, did this fix it, before-and-after evidence, or measurable behavior claims.
type-system-discipline
Apply when designing types, reviewing a function signature, or writing code in any statically-typed language. Make illegal states unrepresentable, brand semantic primitives, parse external data at boundaries, refuse to lie to the compiler, exhaust variants, derive from authoritative schemas.
tdd
Use only when the user explicitly asks for TDD, a failing test, or a regression test, OR when the bug has an obvious cheap local test target. Skip when the test path is unclear, expensive, integration-heavy, or not requested.
resolving-merge-conflicts
Resolve conflicts in an in-progress Git merge or rebase and complete the authorized operation.
research
Investigate a technical question using primary sources and save a cited Markdown research note.
plain-language
Restate the last message in plain human language, with no jargon.