[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7BR0F6F4EQTP6PYWHSJPK4A":3,"skill-same:01M7BR0F6F4EQTP6PYWHSJPK4A":52},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":30,"ownerDescription":6,"updatedAt":31,"install":32,"resources":45},"01M7BR0F6F4EQTP6PYWHSJPK4A","compress-a-doc-set",null,"Use when asked to make a set of documents shorter, tighter or more concise: \"trim this\", \"it is too long\", \"can this be smaller\", \"hardly readable\", \"still too verbose\". Fires on a doc SET, a repo's docs\u002F tree, a playbook, a handbook, a skills directory, where facts can hide in more than one file. Do NOT fire for a single document, which is just an edit, for prose style or tone alone, or for agent config files read as a set, which is `agent-config-audit`.","damson\u002Fhard-won-skills","damson","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F804217?v=4","01M7BR01SMVEGA4HRD46VV1SXF","Damien D.","01M7BR01TR37MB9R73C1C0ENGG",1,"MIT","https:\u002F\u002Fgithub.com\u002Fdamson\u002Fhard-won-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fagent-config\u002Fskills\u002Fcompress-a-doc-set\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: compress-a-doc-set\ndescription: >\n  Use when asked to make a set of documents shorter, tighter or more concise:\n  \"trim this\", \"it is too long\", \"can this be smaller\", \"hardly readable\",\n  \"still too verbose\". Fires on a doc SET, a repo's docs\u002F tree, a playbook, a\n  handbook, a skills directory, where facts can hide in more than one file. Do\n  NOT fire for a single document, which is just an edit, for prose style or\n  tone alone, or for agent config files read as a set, which is\n  `agent-config-audit`.\n---\n\n# Compress a doc set\n\nProse is the layer everyone cuts first and the layer with the least in it.\nPolishing sentences across a set feels productive, shows a diff, and leaves the\nbulk untouched, so the request comes back. The bulk is one fact written in three\nplaces, and a directory nobody has re-justified since the thing it duplicates\narrived.\n\nCut in the order below and the first pass lands where the third would have.\n\n## Procedure\n\n### 1. Measure before cutting\n\nLines per file and per directory, recorded now, so the result is a number\nrather than a feeling and a regression is visible later.\n\n```bash\nfind . -name '*.md' -not -path '.\u002F.git\u002F*' | xargs wc -l | sort -n\n```\n\n### 2. Find every fact with more than one owner\n\nThis is where the lines are. Grep the distinctive phrasings, not the common\nwords, and look at what appears in three or more files.\n\n```bash\n# Candidate phrases, ranked by how many FILES hold them. Ranking the extraction\n# itself counts occurrences, which is a different number: on a 119-file set, 8 of\n# the top 20 disagreed, once by 3.3x, and in both directions, so a phrase in ten\n# files sorted below one confined to two.\ngrep -rhoE '\\b[a-z-]{4,}(\\s+[a-z-]{4,}){2,3}\\b' --include='*.md' . \\\n  | sort -u > \u002Ftmp\u002Fphrases\nwhile IFS= read -r p; do\n  n=$(grep -rlF --include='*.md' -- \"$p\" . | wc -l | tr -d ' ')\n  [ \"$n\" -ge 3 ] && printf '%3d  %s\\n' \"$n\" \"$p\"\ndone \u003C \u002Ftmp\u002Fphrases | sort -rn | head -40\n```\n\n**A count is a candidate, not a finding.** Follow the top hits to the files and\nmeasure how much of one document is inside the other, because the same command\nreturns house style on a set with no duplication and a document copied wholesale\non a set with plenty, and the two outputs look identical. On one repository the\ntop hit was a README boilerplate phrase in six files, worth nothing. On another\nit resolved to one file 95% contained in another, worth the whole pass. Say which\nway you divide when you measure: the smaller file inside the larger, and the\nlarger inside the smaller, differ by more than a factor of two on the same pair.\n\nA fact in one file is knowledge. The same fact in three is three things to keep\nin step, and they will drift on the first edit.\n\n### 3. Give each fact exactly one owner, and link the rest\n\nDecide the owner by what the file is *for*, not by which copy reads best:\nreference explains, checklists assert, procedures order, READMEs route. The\nother copies become a link, or go.\n\nWhere a file is genuinely two of those, **the owner is the file a reader has\nopen at the moment they need the fact.** A safety rule needed while running a\nprocedure lives in the procedure, even though a reference file also explains\nit. When that still ties, the more specific file wins over the more general\none, because a reader arrives at the general one only by search.\n\n**A copy a tool reads by path is not a duplicate.** Before assigning an owner,\nask whether anything loads one of these files from a fixed location: a pull\nrequest template a forge renders, a config a linter opens, a manifest a package\nmanager reads. Those are instances, and the tool owns the path while the master\nowns the content. Replacing one with a link removes the file and the behaviour\nwith it, silently. On a repository tested with this skill, the single largest\nduplication the previous step found, one file 95% contained in another, was\nexactly this, and following the rule would have deleted the repository's pull\nrequest form.\n\n**This step is the compression, on a set that has duplication to find.** Expect\nmost of the reduction here, and see step 7 for what it means when you do not.\n\n### 4. Ask what should not exist at all\n\nWhole files and directories, not lines:\n\n- a directory duplicating a capability that is now installed or upstream\n- a file marked inferred, recalled or provisional that nobody has since verified\n- a section restating what an upstream doc already documents\n- an example kept because it was expensive to write\n\n### 5. Only now compress prose\n\nOne rule per bullet: the imperative, then the evidence, ending in what it cost.\nA bullet needing more than that is two bullets, or it is a story. Cut hedging,\ntransitions and the sentence that announces what the next sentence will say.\n\n### 6. Enforce it mechanically, and see the guard fail once\n\nA cap the linter checks, so the next contributor cannot undo this by accident.\n\nSet the cap from the set you just cut, not from taste: take the longest file\nthat survived step 5 and round up. A cap below a file you decided to keep makes\nthe guard wrong on day one and teaches everyone to ignore it.\n\n```bash\n# -z and -0 throughout: a path with a space splits into words otherwise, `wc`\n# fails on each fragment, and the empty count then PASSES the comparison, so the\n# one file the cap could not read reports as under it\nCAP=$(git ls-files -z '*.md' | xargs -0 wc -l | awk '$(2)!=\"total\"{print $(1)}' \\\n        | sort -n | tail -1)                     # the longest survivor\nCAP=$(( (CAP + 9) \u002F 10 * 10 ))                   # round up to a readable number\necho \"cap: $CAP\"\n```\n\n**Freeze that number into the check. Do not recompute it there.** A check that\nderives its own limit from the tree it is checking cannot fail: pad a file and\nthe cap moves with it. Run the line above once, read the number, and write it\ninto the linter as a literal:\n\n```bash\nCAP=350                                          # the number you just read\n\ngit ls-files -z '*.md' | while IFS= read -r -d '' f; do\n  n=$(wc -l \u003C \"$f\" | tr -d ' ')\n  if [ -z \"$n\" ]\n    then echo \"UNREAD: $f\"                       # never silently a pass\n  elif [ \"$n\" -gt \"$CAP\" ]\n    then echo \"FAIL: $f: $n lines, over the $CAP-line cap\"\n  fi\ndone\n```\n\nThen prove it can fail: pad a file past the cap, watch it go red, remove the\npadding. A guard never seen failing is a guard nobody has tested, and with a\nrecomputed cap that is every run of it.\n\n### 7. Report the delta, and what you refused to cut\n\nBefore and after, per area. Name anything left long on purpose, so the next\nperson does not re-litigate it.\n\n**A small duplication haul is a finding, not a failed pass.** How much each layer\nholds depends on the set's history: one never edited for length has prose to lose\nfirst, and one already tightened has nothing left there at all. Measured on a\ntightly written 558-line set, a prose pass could touch at most 5 lines while\nduplication offered about 40; on a set that had never been cut, the two prose\nrounds took 753 and the duplication pass 137. Report which situation you were in,\nbecause it tells the next person whether to run this again.\n\n## When to STOP\n\n- **Step 2 found no duplication.** The set is already tight. Say so and stop;\n  shaving sentences to show effort is how a good doc set gets worse.\n- **Cutting would drop a costed claim.** Length is never worth evidence. Move\n  the claim to its owner instead.\n- **The duplication crosses a repo boundary**, where the other copy is a skill,\n  a package or an upstream doc. Deleting your copy changes what installs\n  elsewhere: propose it, do not do it silently.\n- **These are agent config files read as a set.** That is `agent-config-audit`,\n  which knows the personal-versus-team boundary this skill does not.\n- **The set is one document.** Just edit it.\n","# Compress a doc set\n\nProse is the layer everyone cuts first and the layer with the least in it.\nPolishing sentences across a set feels productive, shows a diff, and leaves the\nbulk untouched, so the request comes back. The bulk is one fact written in three\nplaces, and a directory nobody has re-justified since the thing it duplicates\narrived.\n\nCut in the order below and the first pass lands where the third would have.\n\n## Procedure\n\n### 1. Measure before cutting\n\nLines per file and per directory, recorded now, so the result is a number\nrather than a feeling and a regression is visible later.\n\n```bash\nfind . -name '*.md' -not -path '.\u002F.git\u002F*' | xargs wc -l | sort -n\n```\n\n### 2. Find every fact with more than one owner\n\nThis is where the lines are. Grep the distinctive phrasings, not the common\nwords, and look at what appears in three or more files.\n\n```bash\n# Candidate phrases, ranked by how many FILES hold them. Ranking the extraction\n# itself counts occurrences, which is a different number: on a 119-file set, 8 of\n# the top 20 disagreed, once by 3.3x, and in both directions, so a phrase in ten\n# files sorted below one confined to two.\ngrep -rhoE '\\b[a-z-]{4,}(\\s+[a-z-]{4,}){2,3}\\b' --include='*.md' . \\\n  | sort -u > \u002Ftmp\u002Fphrases\nwhile IFS= read -r p; do\n  n=$(grep -rlF --include='*.md' -- \"$p\" . | wc -l | tr -d ' ')\n  [ \"$n\" -ge 3 ] && printf '%3d  %s\\n' \"$n\" \"$p\"\ndone \u003C \u002Ftmp\u002Fphrases | sort -rn | head -40\n```\n\n**A count is a candidate, not a finding.** Follow the top hits to the files and\nmeasure how much of one document is inside the other, because the same command\nreturns house style on a set with no duplication and a document copied wholesale\non a set with plenty, and the two outputs look identical. On one repository the\ntop hit was a README boilerplate phrase in six files, worth nothing. On another\nit resolved to one file 95% contained in another, worth the whole pass. Say which\nway you divide when you measure: the smaller file inside the larger, and the\nlarger inside the smaller, differ by more than a factor of two on the same pair.\n\nA fact in one file is knowledge. The same fact in three is three things to keep\nin step, and they will drift on the first edit.\n\n### 3. Give each fact exactly one owner, and link the rest\n\nDecide the owner by what the file is *for*, not by which copy reads best:\nreference explains, checklists assert, procedures order, READMEs route. The\nother copies become a link, or go.\n\nWhere a file is genuinely two of those, **the owner is the file a reader has\nopen at the moment they need the fact.** A safety rule needed while running a\nprocedure lives in the procedure, even though a reference file also explains\nit. When that still ties, the more specific file wins over the more general\none, because a reader arrives at the general one only by search.\n\n**A copy a tool reads by path is not a duplicate.** Before assigning an owner,\nask whether anything loads one of these files from a fixed location: a pull\nrequest template a forge renders, a config a linter opens, a manifest a package\nmanager reads. Those are instances, and the tool owns the path while the master\nowns the content. Replacing one with a link removes the file and the behaviour\nwith it, silently. On a repository tested with this skill, the single largest\nduplication the previous step found, one file 95% contained in another, was\nexactly this, and following the rule would have deleted the repository's pull\nrequest form.\n\n**This step is the compression, on a set that has duplication to find.** Expect\nmost of the reduction here, and see step 7 for what it means when you do not.\n\n### 4. Ask what should not exist at all\n\nWhole files and directories, not lines:\n\n- a directory duplicating a capability that is now installed or upstream\n- a file marked inferred, recalled or provisional that nobody has since verified\n- a section restating what an upstream doc already documents\n- an example kept because it was expensive to write\n\n### 5. Only now compress prose\n\nOne rule per bullet: the imperative, then the evidence, ending in what it cost.\nA bullet needing more than that is two bullets, or it is a story. Cut hedging,\ntransitions and the sentence that announces what the next sentence will say.\n\n### 6. Enforce it mechanically, and see the guard fail once\n\nA cap the linter checks, so the next contributor cannot undo this by accident.\n\nSet the cap from the set you just cut, not from taste: take the longest file\nthat survived step 5 and round up. A cap below a file you decided to keep makes\nthe guard wrong on day one and teaches everyone to ignore it.\n\n```bash\n# -z and -0 throughout: a path with a space splits into words otherwise, `wc`\n# fails on each fragment, and the empty count then PASSES the comparison, so the\n# one file the cap could not read reports as under it\nCAP=$(git ls-files -z '*.md' | xargs -0 wc -l | awk '$(2)!=\"total\"{print $(1)}' \\\n        | sort -n | tail -1)                     # the longest survivor\nCAP=$(( (CAP + 9) \u002F 10 * 10 ))                   # round up to a readable number\necho \"cap: $CAP\"\n```\n\n**Freeze that number into the check. Do not recompute it there.** A check that\nderives its own limit from the tree it is checking cannot fail: pad a file and\nthe cap moves with it. Run the line above once, read the number, and write it\ninto the linter as a literal:\n\n```bash\nCAP=350                                          # the number you just read\n\ngit ls-files -z '*.md' | while IFS= read -r -d '' f; do\n  n=$(wc -l \u003C \"$f\" | tr -d ' ')\n  if [ -z \"$n\" ]\n    then echo \"UNREAD: $f\"                       # never silently a pass\n  elif [ \"$n\" -gt \"$CAP\" ]\n    then echo \"FAIL: $f: $n lines, over the $CAP-line cap\"\n  fi\ndone\n```\n\nThen prove it can fail: pad a file past the cap, watch it go red, remove the\npadding. A guard never seen failing is a guard nobody has tested, and with a\nrecomputed cap that is every run of it.\n\n### 7. Report the delta, and what you refused to cut\n\nBefore and after, per area. Name anything left long on purpose, so the next\nperson does not re-litigate it.\n\n**A small duplication haul is a finding, not a failed pass.** How much each layer\nholds depends on the set's history: one never edited for length has prose to lose\nfirst, and one already tightened has nothing left there at all. Measured on a\ntightly written 558-line set, a prose pass could touch at most 5 lines while\nduplication offered about 40; on a set that had never been cut, the two prose\nrounds took 753 and the duplication pass 137. Report which situation you were in,\nbecause it tells the next person whether to run this again.\n\n## When to STOP\n\n- **Step 2 found no duplication.** The set is already tight. Say so and stop;\n  shaving sentences to show effort is how a good doc set gets worse.\n- **Cutting would drop a costed claim.** Length is never worth evidence. Move\n  the claim to its owner instead.\n- **The duplication crosses a repo boundary**, where the other copy is a skill,\n  a package or an upstream doc. Deleting your copy changes what installs\n  elsewhere: propose it, do not do it silently.\n- **These are agent config files read as a set.** That is `agent-config-audit`,\n  which knows the personal-versus-team boundary this skill does not.\n- **The set is one document.** Just edit it.\n",{"name":5,"description":7},"main","9435f9fa04b69d2217f8cab3c817dd5c3c1d1021","plugins\u002Fagent-config\u002Fskills\u002Fcompress-a-doc-set",0,"https:\u002F\u002Fgithub.com\u002Fdamson\u002Fhard-won-skills","https:\u002F\u002Fgithub.com\u002Fdamson","http:\u002F\u002Fgoo.gl\u002F3UwFRt","2026-11-14 14:28:11",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add damson\u002Fhard-won-skills --skill compress-a-doc-set",{"tool":38,"command":39},"bunx","bunx skills add damson\u002Fhard-won-skills --skill compress-a-doc-set",{"tool":41,"command":42},"pnpm","pnpm dlx skills add damson\u002Fhard-won-skills --skill compress-a-doc-set","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fdamson\u002Fhard-won-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fagent-config\u002Fskills\u002Fcompress-a-doc-set\u002FSKILL.md",true,[46],{"path":47,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":50,"sourceHtmlUrl":51},"README.md","REFERENCE","参考文档",2885,"https:\u002F\u002Fgithub.com\u002Fdamson\u002Fhard-won-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fagent-config\u002Fskills\u002Fcompress-a-doc-set\u002FREADME.md",[53,60,66,71,76,81],{"skillNo":54,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":57,"categories":58,"keywords":59,"publishedAt":19},"01M7BRCESR9BRFAH87J2ZQY5T2","skill-two","Fixture skill","https:\u002F\u002Fgithub.com\u002Fdamson\u002Fhard-won-skills\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fwrong_welcome_total\u002Fplugins\u002Falpha\u002Fskills\u002Fskill-two\u002FSKILL.md",[],[],{"skillNo":61,"name":62,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":19},"01M7BRCDPHEPZES71BYBRTZ1G3","skill-one","https:\u002F\u002Fgithub.com\u002Fdamson\u002Fhard-won-skills\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fwrong_welcome_total\u002Fplugins\u002Falpha\u002Fskills\u002Fskill-one\u002FSKILL.md",[],[],{"skillNo":67,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":19},"01M7BRCCHHB3Q07BR0QN339D3F","https:\u002F\u002Fgithub.com\u002Fdamson\u002Fhard-won-skills\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fwrong_table_count\u002Fplugins\u002Falpha\u002Fskills\u002Fskill-two\u002FSKILL.md",[],[],{"skillNo":72,"name":62,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":19},"01M7BRC9J97QKZHGKVXMER5ZEE","https:\u002F\u002Fgithub.com\u002Fdamson\u002Fhard-won-skills\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fwrong_table_count\u002Fplugins\u002Falpha\u002Fskills\u002Fskill-one\u002FSKILL.md",[],[],{"skillNo":77,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":19},"01M7BRC8C39NM8VVAQ3TKP0CRS","https:\u002F\u002Fgithub.com\u002Fdamson\u002Fhard-won-skills\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fvalid_marketplace\u002Fplugins\u002Falpha\u002Fskills\u002Fskill-two\u002FSKILL.md",[],[],{"skillNo":82,"name":62,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":19},"01M7BRC75THG394KDGYV35ET19","https:\u002F\u002Fgithub.com\u002Fdamson\u002Fhard-won-skills\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fvalid_marketplace\u002Fplugins\u002Falpha\u002Fskills\u002Fskill-one\u002FSKILL.md",[],[]]