[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6CBB5ZVCHEEE4TQ4S435BQS":3,"skill-same:01M6CBB5ZVCHEEE4TQ4S435BQS":70},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":18,"categories":19,"keywords":30,"publishedAt":39,"linkOnly":40,"markdownContent":41,"markdownBody":42,"frontMatter":43,"refName":48,"commitSha":49,"skillDirectory":50,"forksCount":51,"repositoryHtmlUrl":52,"repositoryHomepageUrl":53,"ownerHtmlUrl":54,"ownerBlogUrl":17,"ownerDescription":17,"updatedAt":55,"install":56,"resources":69},"01M6CBB5ZVCHEEE4TQ4S435BQS","writing-for-agents","智能体文档编写规范","Writing rules for documents an agent consumes — skills, AGENTS.md, instruction files, and docs reached by a pointer","为供智能体阅读的文档制定的编写规则——包括 skills、AGENTS.md、指令文件以及通过指针引用到的文档。","shahboura\u002Fagents-opencode","shahboura","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F210767?v=4","01M6C6WKTBT0NH92BEPQRHQSYM","Shehab El Hadidy","01M6C6WKYXG8AE68MCGBNE5ZFR",2,"MIT",null,"https:\u002F\u002Fgithub.com\u002Fshahboura\u002Fagents-opencode\u002Fblob\u002Fmain\u002F.opencode\u002Fskills\u002Fwriting-for-agents\u002FSKILL.md",[20,25],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BVB0FJ0RR8KXYVFTKEA3XX","技术文档工程师","PROFESSION","适用职业",{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8C5C7NGT4DWWBE15R6QGEX5","技术文档编写","SCENARIO","使用场景",[31,32,33,34,35,36,37,38],"writing","writing for agents","docs","documentation","documents","Rules","opencode","files","2026-11-10 10:12:30",false,"---\nname: writing-for-agents\ndescription: Writing rules for documents an agent consumes — skills, AGENTS.md, instruction files, and docs reached by a pointer\nlicense: MIT\ncompatibility: opencode\nmetadata:\n  author: shahboura\n  version: \"1.0.0\"\n  audience: maintainers\n  workflow: documentation\n  adapted-from: \"mattpocock\u002Fskills (MIT)\"\n---\n\n# Writing for Agents\n\nRules for any text an agent reads: a skill, an `AGENTS.md`, a doc reached through\na pointer. The reader is a model with a fixed attention budget, not a colleague\nwho asks follow-up questions.\n\n## What I do\n\n- Check pointer wording, load cost, and document hierarchy before drafting\n- Rewrite steps into completion criteria the agent can check\n- Replace prohibitions and restatements with one positive target\n- Prune duplicates, no-ops, and sediment, starting with the environment's own sources\n\n## When to use me\n\nActivate when writing or editing:\n\n- A skill, agent file, instruction file, or `AGENTS.md`\n- A doc that another document points at (\"read X for details\")\n- A prompt, checklist, or command body an agent executes\n- A doc that keeps growing while compliance stays flat\n\n## Key Rules\n\n### 1. Context pointers\n\nA pointer is a line that tells the agent when to open something else. The pointer\nis always loaded; its target is not.\n\n- **Wording decides invocation.** If the sentence never names the situation, the\n  skill never loads. Write the situation, not the concept: \"before merging a\n  migration\" beats \"for database concerns\".\n- **One trigger per branch.** Each \"when\" clause maps to exactly one skill. Two\n  skills in one sentence split the decision and the agent picks neither.\n- **Front-load the leading word.** Put the discriminating term first in the\n  sentence, so the match happens before attention drifts: \"Ambiguous request →\n  `alignment`\", not \"If the request is ambiguous, consider loading…\".\n\n### 2. Two loads\n\n- **Context load:** tokens paid every time the file is read. Lower it by writing less,\n  or by moving detail behind a pointer.\n- **Cognitive load:** the human's memory of what exists and when to reach for it. Lower\n  it with fewer files and names that are findable without a map.\n- A new file trades context load for cognitive load. Make that trade knowingly.\n\n### 3. Information hierarchy\n\nThree tiers, cheapest first:\n\n1. **In-file step** — the agent must do it now.\n2. **In-file reference** — available beside the step, read when needed.\n3. **Disclosed reference** — a separate file behind a pointer.\n\n- **Progressive disclosure:** push detail down only when it is not needed on\n  every pass. Anything load-bearing for the step stays in the step.\n- **Co-location:** keep what changes together, together. A rule and its exception\n  should not be separated by three sections.\n- **Sprawl:** if one reader needs three documents to do one thing, the hierarchy\n  is wrong. The top document holds the decision and points to the mechanics.\n\n### 4. Steps and completion criteria\n\n- A **step** says what to do. A **completion criterion** says how you know it is\n  done. Agents stop at the first plausible stopping point.\n- **Clarity is not demand.** A clear instruction is understood; a demanding one\n  is binding. \"Consider X\" gets skipped; \"Do X before Y\" gets done.\n- **Premature completion:** any step without a checkable end state gets declared\n  complete at the cheapest point. Give it an observable end: a command, an exit\n  code, a file that exists.\n- **Post-completion pull:** text after the stop condition (\"then also…\") pulls the\n  agent past the finish line or stops it early. Put the finish line last, or move\n  the extra work before it.\n\n### 5. Leading words\n\n- One pretrained token replaces a paragraph: *atomic*, *idempotent*, *regression*,\n  *root cause*, *frozen snapshot*. The model already knows the pattern; naming it\n  is cheaper than describing it.\n- **Hunt restatements.** If the same idea appears twice, keep the version with the\n  leading word and delete the other. Two spellings of one rule read as two rules.\n\n### 6. Negation\n\n- **Prohibitions activate the banned behaviour.** \"Do not use tabs\" makes tabs\n  salient. State the positive target instead: \"Indent with two spaces\".\n- Keep a prohibition only when the failure is silent and costly, and always pair\n  it with the replacement behaviour.\n\n### 7. Pruning\n\n- **Single source of truth:** one normative home per rule. Everything else points\n  at it or is deleted.\n- **The environment is a source.** Package scripts, config, directory layout, and\n  CLI help already state facts. Do not restate them; your copy goes stale, theirs\n  does not.\n- **No-ops:** delete lines that repeat the model's default (\"be careful\", \"write\n  clean code\"). They cost tokens and change nothing.\n- **Sediment:** text accumulates because adding feels safer than deleting. On\n  every edit, remove one thing.\n\n## Review checklist\n\n- [ ] Pointer names the triggering situation; leading word comes first\n- [ ] Always-loaded text earns its tokens; detail sits one level down\n- [ ] Every step has an observable completion criterion\n- [ ] No restated leading word, no bare prohibition\n- [ ] No fact the repo already stores in scripts, config, or layout\n","# Writing for Agents\n\nRules for any text an agent reads: a skill, an `AGENTS.md`, a doc reached through\na pointer. The reader is a model with a fixed attention budget, not a colleague\nwho asks follow-up questions.\n\n## What I do\n\n- Check pointer wording, load cost, and document hierarchy before drafting\n- Rewrite steps into completion criteria the agent can check\n- Replace prohibitions and restatements with one positive target\n- Prune duplicates, no-ops, and sediment, starting with the environment's own sources\n\n## When to use me\n\nActivate when writing or editing:\n\n- A skill, agent file, instruction file, or `AGENTS.md`\n- A doc that another document points at (\"read X for details\")\n- A prompt, checklist, or command body an agent executes\n- A doc that keeps growing while compliance stays flat\n\n## Key Rules\n\n### 1. Context pointers\n\nA pointer is a line that tells the agent when to open something else. The pointer\nis always loaded; its target is not.\n\n- **Wording decides invocation.** If the sentence never names the situation, the\n  skill never loads. Write the situation, not the concept: \"before merging a\n  migration\" beats \"for database concerns\".\n- **One trigger per branch.** Each \"when\" clause maps to exactly one skill. Two\n  skills in one sentence split the decision and the agent picks neither.\n- **Front-load the leading word.** Put the discriminating term first in the\n  sentence, so the match happens before attention drifts: \"Ambiguous request →\n  `alignment`\", not \"If the request is ambiguous, consider loading…\".\n\n### 2. Two loads\n\n- **Context load:** tokens paid every time the file is read. Lower it by writing less,\n  or by moving detail behind a pointer.\n- **Cognitive load:** the human's memory of what exists and when to reach for it. Lower\n  it with fewer files and names that are findable without a map.\n- A new file trades context load for cognitive load. Make that trade knowingly.\n\n### 3. Information hierarchy\n\nThree tiers, cheapest first:\n\n1. **In-file step** — the agent must do it now.\n2. **In-file reference** — available beside the step, read when needed.\n3. **Disclosed reference** — a separate file behind a pointer.\n\n- **Progressive disclosure:** push detail down only when it is not needed on\n  every pass. Anything load-bearing for the step stays in the step.\n- **Co-location:** keep what changes together, together. A rule and its exception\n  should not be separated by three sections.\n- **Sprawl:** if one reader needs three documents to do one thing, the hierarchy\n  is wrong. The top document holds the decision and points to the mechanics.\n\n### 4. Steps and completion criteria\n\n- A **step** says what to do. A **completion criterion** says how you know it is\n  done. Agents stop at the first plausible stopping point.\n- **Clarity is not demand.** A clear instruction is understood; a demanding one\n  is binding. \"Consider X\" gets skipped; \"Do X before Y\" gets done.\n- **Premature completion:** any step without a checkable end state gets declared\n  complete at the cheapest point. Give it an observable end: a command, an exit\n  code, a file that exists.\n- **Post-completion pull:** text after the stop condition (\"then also…\") pulls the\n  agent past the finish line or stops it early. Put the finish line last, or move\n  the extra work before it.\n\n### 5. Leading words\n\n- One pretrained token replaces a paragraph: *atomic*, *idempotent*, *regression*,\n  *root cause*, *frozen snapshot*. The model already knows the pattern; naming it\n  is cheaper than describing it.\n- **Hunt restatements.** If the same idea appears twice, keep the version with the\n  leading word and delete the other. Two spellings of one rule read as two rules.\n\n### 6. Negation\n\n- **Prohibitions activate the banned behaviour.** \"Do not use tabs\" makes tabs\n  salient. State the positive target instead: \"Indent with two spaces\".\n- Keep a prohibition only when the failure is silent and costly, and always pair\n  it with the replacement behaviour.\n\n### 7. Pruning\n\n- **Single source of truth:** one normative home per rule. Everything else points\n  at it or is deleted.\n- **The environment is a source.** Package scripts, config, directory layout, and\n  CLI help already state facts. Do not restate them; your copy goes stale, theirs\n  does not.\n- **No-ops:** delete lines that repeat the model's default (\"be careful\", \"write\n  clean code\"). They cost tokens and change nothing.\n- **Sediment:** text accumulates because adding feels safer than deleting. On\n  every edit, remove one thing.\n\n## Review checklist\n\n- [ ] Pointer names the triggering situation; leading word comes first\n- [ ] Always-loaded text earns its tokens; detail sits one level down\n- [ ] Every step has an observable completion criterion\n- [ ] No restated leading word, no bare prohibition\n- [ ] No fact the repo already stores in scripts, config, or layout\n",{"name":5,"license":16,"metadata":44,"description":7,"compatibility":37},{"author":10,"version":45,"audience":46,"workflow":34,"adapted-from":47},"1.0.0","maintainers","mattpocock\u002Fskills (MIT)","main","9b951b5b2e5d07d427baff330db5deb2a8c67511",".opencode\u002Fskills\u002Fwriting-for-agents",0,"https:\u002F\u002Fgithub.com\u002Fshahboura\u002Fagents-opencode","https:\u002F\u002Fagnts.elkodr.com\u002F","https:\u002F\u002Fgithub.com\u002Fshahboura","2026-11-05 13:30:42",{"source":9,"skillName":5,"commands":57,"prompt":67,"zipAvailable":68},[58,61,64],{"tool":59,"command":60},"npx","npx skills add shahboura\u002Fagents-opencode --skill writing-for-agents",{"tool":62,"command":63},"bunx","bunx skills add shahboura\u002Fagents-opencode --skill writing-for-agents",{"tool":65,"command":66},"pnpm","pnpm dlx skills add shahboura\u002Fagents-opencode --skill writing-for-agents","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fshahboura\u002Fagents-opencode\u002Fblob\u002Fmain\u002F.opencode\u002Fskills\u002Fwriting-for-agents\u002FSKILL.md",true,[],[71,85,98,105,112,119],{"skillNo":72,"name":73,"nameZh":74,"description":17,"descriptionZh":75,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":76,"categories":77,"keywords":84,"publishedAt":39},"01M6CBBX1C6NV7VY8XK21DV5FW","python","Python 编程开发","","https:\u002F\u002Fgithub.com\u002Fshahboura\u002Fagents-opencode\u002Fblob\u002Fmain\u002Fscripts\u002Ffixtures\u002Fvalidate-agents\u002Fvalid\u002F.opencode\u002Fskills\u002Fpython\u002FSKILL.md",[78,81],{"categoryNo":79,"categoryName":80,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BQ6TQZN6R52WBJ9H8NRMQM","软件开发工程师",{"categoryNo":82,"categoryName":83,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8CEEYW9437JC839V6V453Q5","Python 开发",[73],{"skillNo":86,"name":87,"nameZh":88,"description":17,"descriptionZh":75,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":89,"categories":90,"keywords":95,"publishedAt":39},"01M6CBBVB7W6ABJH8XP3Z8PPMK","docs-validation","文档有效性校验","https:\u002F\u002Fgithub.com\u002Fshahboura\u002Fagents-opencode\u002Fblob\u002Fmain\u002Fscripts\u002Ffixtures\u002Fvalidate-agents\u002Fvalid\u002F.opencode\u002Fskills\u002Fdocs-validation\u002FSKILL.md",[91,94],{"categoryNo":92,"categoryName":93,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BQJH394GT47X57A9Q8G7HX","测试与质量保障",{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},[33,96,97],"validation","docs validation",{"skillNo":99,"name":73,"nameZh":74,"description":17,"descriptionZh":75,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":100,"categories":101,"keywords":104,"publishedAt":39},"01M6CBBT2WC781609MH5RN7KM7","https:\u002F\u002Fgithub.com\u002Fshahboura\u002Fagents-opencode\u002Fblob\u002Fmain\u002Fscripts\u002Ffixtures\u002Fvalidate-agents\u002Funknown-skill\u002F.opencode\u002Fskills\u002Fpython\u002FSKILL.md",[102,103],{"categoryNo":79,"categoryName":80,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":82,"categoryName":83,"taxonomyType":28,"taxonomyTypeDesc":29},[73],{"skillNo":106,"name":87,"nameZh":88,"description":17,"descriptionZh":75,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":107,"categories":108,"keywords":111,"publishedAt":39},"01M6CBBRNY6TDRZ5627GC8436D","https:\u002F\u002Fgithub.com\u002Fshahboura\u002Fagents-opencode\u002Fblob\u002Fmain\u002Fscripts\u002Ffixtures\u002Fvalidate-agents\u002Funknown-skill\u002F.opencode\u002Fskills\u002Fdocs-validation\u002FSKILL.md",[109,110],{"categoryNo":92,"categoryName":93,"taxonomyType":28,"taxonomyTypeDesc":29},{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},[33,96,97],{"skillNo":113,"name":73,"nameZh":74,"description":17,"descriptionZh":75,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":114,"categories":115,"keywords":118,"publishedAt":39},"01M6CBBQDS170GBYA1CVW3DC5D","https:\u002F\u002Fgithub.com\u002Fshahboura\u002Fagents-opencode\u002Fblob\u002Fmain\u002Fscripts\u002Ffixtures\u002Fvalidate-agents\u002Finline-skill\u002F.opencode\u002Fskills\u002Fpython\u002FSKILL.md",[116,117],{"categoryNo":79,"categoryName":80,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":82,"categoryName":83,"taxonomyType":28,"taxonomyTypeDesc":29},[73],{"skillNo":120,"name":87,"nameZh":121,"description":17,"descriptionZh":75,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":122,"categories":123,"keywords":130,"publishedAt":39},"01M6CBBP222WAW802YHY37F48A","文档校验","https:\u002F\u002Fgithub.com\u002Fshahboura\u002Fagents-opencode\u002Fblob\u002Fmain\u002Fscripts\u002Ffixtures\u002Fvalidate-agents\u002Finline-skill\u002F.opencode\u002Fskills\u002Fdocs-validation\u002FSKILL.md",[124,127],{"categoryNo":125,"categoryName":126,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BQGD5WG86P4AQ5GPSSKBFR","测试工程师",{"categoryNo":128,"categoryName":129,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BSYDSNXQT2W2GMZGF0ZHH4","示例与演示技能",[33,96,97]]