[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M735A2DH2GX7EPEWBE0N5FZ8":3,"skill-same:01M735A2DH2GX7EPEWBE0N5FZ8":51},{"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":30,"commitSha":31,"skillDirectory":32,"forksCount":33,"repositoryHtmlUrl":34,"repositoryHomepageUrl":35,"ownerHtmlUrl":36,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":37,"install":38,"resources":50},"01M735A2DH2GX7EPEWBE0N5FZ8","skill-builder",null,"Create or update a skill.","Morrison-Lab\u002Fai-config","Morrison-Lab","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F104235520?v=4","01M734G0451S2G35MN4HFQK7XP","Morrison Lab","01M734G059BYFDFQA8YTPDGPMH",4,"MIT","https:\u002F\u002Fgithub.com\u002FMorrison-Lab\u002Fai-config\u002Fblob\u002Fmain\u002Fskills\u002Fskill-builder\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"---\nname: skill-builder\ndescription: \"Create or update a skill.\"\nuser-invocable: true\nallowed-tools:\n  - Bash\n  - Read\n  - Edit\n  - Write\n---\n\n# skill-builder — author a new skill (extend-first)\n\nCreate — or, preferably, *extend* — an ai-config skill following the repo's\nconventions. The prime directive: **don't create a new skill until you've\nconfirmed no existing one should be extended instead**, and that no other\nbranch is already building it.\n\n## When this fires\n\n- \"build a skill\", \"create a skill\", \"make a new skill\", \"add a skill\",\n  \"skill-builder\"\n- Creating an **alias** for an existing skill — \"add an alias for X\", \"make X\n  an alias for Y\", \"should this be an alias for Y\" — is a skill-builder task\n  too, not a raw `Write` of a stub file. Hand-writing an alias `SKILL.md`\n  skips the codex-wrapper regeneration (the required step below) and trips the\n  `validate` CI check, and skips the self-review pass that catches errors in\n  the stub's own prose. (ai-config#569: a hand-written `giardia`→`gia` alias\n  stub failed `validate` on the missing wrapper and needed a review round to\n  fix a reversed phase-order description — both avoidable by routing here.)\n- Any time a repeatable multi-step workflow emerges that's worth codifying —\n  proactively suggest capturing it as a skill.\n\n## Step 0 — Extend before you create (do this FIRST, always)\n\nRule out extending an existing skill *before* scaffolding anything:\n\n1. **Search the whole corpus, not only `skills\u002F`**, for something that already\n   owns (or is adjacent to) this concern:\n   ```bash\n   cd \"${CLAUDE_PLUGIN_ROOT:-$(git -C ~\u002F.claude\u002Fskills\u002Fskill-builder rev-parse --show-toplevel 2>\u002Fdev\u002Fnull || pwd)}\"   # the ai-config repo\n   ls skills\u002F scripts\u002F hooks\u002F\n   grep -ril \"\u003Ckeywords>\" skills\u002F scripts\u002F hooks\u002F shared\u002F memories\u002F CLAUDE.md\n   ```\n   If a skill already covers it, **extend that skill** (a new alias, a new\n   section, an extra trigger phrase) rather than adding a near-duplicate.\n   If a **script or hook** already performs it, the skill you were about to\n   author is a wrapper around that instrument, so document the instrument\n   instead of restating its procedure as prose.\n\n   **`scripts\u002F` and `hooks\u002F` are the paths most often left out of this search,\n   and they are where prior art for a procedural skill is likeliest to sit.**\n   A skill describing a procedure is frequently a wrapper around an instrument\n   that already exists, because\n   [`deterministic-tools`](..\u002F..\u002Fshared\u002Fprinciples\u002Fdeterministic-tools.md)\n   pushes every recurring judgment task toward a script.\n   So an instrument in `scripts\u002F` is prior art for a skill exactly as another\n   skill is.\n   A search confined to `skills\u002F*\u002FSKILL.md` answers the narrower question\n   \"does a skill exist\", rather than the one actually being asked, \"does this\n   capability exist\".\n\n   Omitting them produces the failure shape\n   [`grep-is-not-coverage`](..\u002F..\u002Fshared\u002Fworkflow\u002Fgrep-is-not-coverage.md)\n   describes: a real command, a real null result, and a conclusion wider than\n   the paths that were searched.\n   So report the paths you covered alongside the step 4 decision below, rather\n   than reporting the decision alone.\n\n   - **Do:** search `scripts\u002F` and `hooks\u002F` alongside `skills\u002F` before\n     concluding that a capability does not already exist.\n   - **Do:** name the paths the search covered when stating the\n     extend-or-create decision.\n   - **Don't:** read a clean grep over `skills\u002F*\u002FSKILL.md` as evidence that\n     the capability is absent; it answers a narrower question.\n   - **Don't:** author a skill describing a procedure without first checking\n     whether an instrument already performs it.\n\n   (Morrison-Lab\u002Fai-config#1055 and #1056, 2026-08-02: a Step 0 pass ran\n   `ls skills\u002F`, the `skills\u002F*\u002FSKILL.md` grep, and the branch, worktree, and\n   open-PR scans below, plus a wider grep over `skills\u002F`, `shared\u002F`,\n   `memories\u002F`, and `CLAUDE.md`.\n   Every one came back clean, so the session filed #1055 and opened #1056 to\n   author a new `refresh-claude-token` skill.\n   `scripts\u002Frotate-claude-token.py` had been on `main` since commit\n   `18173c88`, merged as #953 under issue #952, at 312 lines with a 329-line\n   test file beside it.\n   It already discovers its target repos rather than hardcoding them, previews\n   by default, reads the token from stdin or the environment so it never\n   reaches `argv`, and re-reads each secret's `updated_at` to verify the write.\n   It surfaced only incidentally, from a\n   `gh search code 'CLAUDE_CODE_OAUTH_TOKEN'` run made for an unrelated\n   reason.\n   `scripts\u002F` was in none of the searched paths.)\n\n2. **Scan EVERY branch AND every local worktree for in-flight work --- the whole tree, not only `skills\u002F`.**\n   You, another CLI session, or the `@claude` bot may already be adding it, and a growing share of contributions are edits to `shared\u002F`, `CLAUDE.md`, `memories\u002F`, or `scripts\u002F` rather than a new `skills\u002F\u003Cname>\u002F` directory, so a `skills\u002F`-scoped scan is blind to exactly the kind of parallel work most likely to collide (Morrison-Lab\u002Fai-config#776).\n   A parallel CLI session usually builds its skill in an **unpushed local worktree**, so a remote-only `git branch -r` scan misses it entirely (this hit PR #67 --- a sibling skill was caught only by a stray system-reminder, not the scan).\n   Scan local refs *and* the worktree working trees too:\n   ```bash\n   git fetch origin --prune\n   # local + remote branches --- NOT just -r; unpushed local branches count.\n   # Whole-tree filename match, not skills\u002F[^\u002F]*\u003Ckeyword> --- a colliding edit\n   # to shared\u002F or CLAUDE.md has no skills\u002F path to match:\n   for b in $(git branch -a --format='%(refname:short)' | grep -v HEAD); do\n     git ls-tree -r --name-only \"$b\" | grep -iE \"\u003Ckeyword>\" | sed \"s|^|$b: |\"\n   done\n   # uncommitted, ref-less work in sibling worktrees — list only UNTRACKED\n   # files (whole tree, not just skills\u002F), so shipped skills (committed in the\n   # main worktree) don't false-match.\n   # Read paths via sed + `while read` (not $(...)\u002Fawk $2) so paths with spaces\n   # survive:\n   git worktree list --porcelain | sed -n 's\u002F^worktree \u002F\u002Fp' | while IFS= read -r wt; do\n     git -C \"$wt\" ls-files --others --exclude-standard 2>\u002Fdev\u002Fnull \\\n       | grep -iE \"\u003Ckeyword>\" | sed \"s|^|$wt: |\"\n   done\n   # A filename match still misses an EDIT to an existing shared\u002F or CLAUDE.md\n   # file that introduces the concept with no new path to catch --- pickaxe by\n   # content instead, recent-window scoped so it doesn't drown in unrelated\n   # history:\n   git log --all --oneline --since=14.days -S'\u003Ckeyword>' -- shared\u002F memories\u002F scripts\u002F hooks\u002F CLAUDE.md\n   ```\n   If a branch or worktree is already building it, **continue that work** (check\n   it out \u002F extend its PR) instead of opening a colliding parallel branch.\n\n3. **Check open PRs too** — a branch scan misses work already pushed and\n   opened as a PR if you never fetched it. See\n   [`check-open-prs-before-duplicating`](..\u002F..\u002Fshared\u002Fworkflow\u002Fcheck-open-prs-before-duplicating.md).\n\n4. **Decide explicitly: extend (preferred) or new.** State which and why before\n   writing a line. A new alias or section almost always beats a whole new skill.\n\n## Anatomy of a skill\n\nOne directory per skill, `name` matching the directory:\n\n```\nskills\u002F\u003Cname>\u002FSKILL.md\n```\n\n```yaml\n---\nname: \u003Cname>                 # MUST equal the directory name\ndescription: \"\u003Cwhat it does>. Use when asked to '\u003Ctrigger>', '\u003Ctrigger>', …\"\nuser-invocable: true\nallowed-tools:               # real skill: list its tools. alias: mirror the canonical's list\n  - Bash\n  - Read\n  - Edit\n  - Write\n---\n```\n\n- **`description` is how the skill gets discovered.** Pack it with *what it\n  does* AND the natural-language triggers (`Use when asked to '…'`). The matcher\n  reads this — be generous with trigger phrasings.\n- Body shape: `# \u003Cname> — \u003Ctagline>`, then `## When this fires`,\n  `## Procedure`, `## Relationship to other skills`, `## Anti-patterns`.\n  Concrete commands beat prose.\n\n## Conventions (match the existing family)\n\n- **Decide checklist fit explicitly.** Before adding a checklist section to a\n  skill (new or extended), apply\n  [`shared\u002Fworkflow\u002Fskill-checklists.md`](..\u002F..\u002Fshared\u002Fworkflow\u002Fskill-checklists.md):\n  add one only for repeatable, high-cost, mechanically verifiable failure\n  modes. If the skill is mostly judgment\u002Fexploration, skip checklist boilerplate.\n- **Include reusable, copy-pasteable shell commands where useful.**\n  Instead of leaving procedural steps as abstract prose (\"grep for X\", \"check CI logs\", \"query PRs\"),\n  provide concrete, tested shell command snippets with realistic placeholders (e.g. `gh pr list ...`, `rg -ni ...`).\n  This ensures agents and users don't have to reformulate or debug command pipelines every time they execute the skill.\n- **Pair short names with spelled-out aliases.** When the canonical skill has an\n  acronym\u002Fshort name (`gi`, `sup`, `ums`, `dc`), also create the spelled-out\n  alias dir (`grab-issue`, `send-upstream`, `update-memories-and-skills`) — and\n  give a memorable short alias to a spelled-out canonical where it helps. The\n  alias file is thin and only redirects:\n  ```markdown\n  ---\n  name: \u003Calias>\n  description: \"Alias for `\u003Ccanonical>`. \u003Cone-line>. Use when asked to '\u003Ctrigger>'.\"\n  user-invocable: true\n  allowed-tools:        # mirror the canonical's allowed-tools exactly\n    - Bash\n    - Read\n    - Edit\n    - Write\n  ---\n\n  # \u003Calias> (alias for `\u003Ccanonical>`)\n\n  This is a spelled-out alias. Read and follow the canonical skill:\n\n  → **[\u003Ccanonical>](..\u002F\u003Ccanonical>\u002FSKILL.md)**\n  ```\n  Keep the real content in **one** canonical file; aliases never duplicate it.\n  The alias's `allowed-tools` is the one exception: copy the canonical's list\n  verbatim so invoking the alias permits exactly what the canonical needs (an\n  alias redirects, so it must not be more restrictive than its target).\n- **Cross-link** related skills under `## Relationship to other skills`.\n- **No registry to update.** Skills are auto-discovered from `skills\u002F` (the\n  bootstrap symlink and the plugin root both read the directory) — adding the\n  directory is enough.\n- **List it in `skills.qmd` if it belongs in one of the category tables**, and\n  bump the \"All N+ canonical skills\" count at the bottom to the **actual**\n  directory count (`ls -d skills\u002F*\u002F | wc -l`), not a manual +1 — `main` often\n  gains other skills while your PR is in review, so a hand-incremented count\n  drifts and reads as stale by the time you merge (ai-config#347).\n- **Register any new tool the skill names.** Discovery needs no registry, but\n  tool *references* do. If the procedure names a **GitHub MCP tool or `gh`\u002F`git`\n  operation not already in `tool-mappings.yml`** (grep it to check), verify the\n  tool is real first (`ToolSearch` for it in a live session), then add it there\n  — `id`, `description`, `cli` (the CLI fallback), and `github_mcp` (the MCP\n  tool) — and rerun `scripts\u002Fsync-codex-skill-wrappers.py` so the Codex wrappers\n  can translate it.\n  Skip this and the `@claude` reviewer flags the unregistered name\n  as a *possible hallucination* — it can't tell a real-but-undocumented tool from\n  an invented one. (`push-memory` #311 hit this: `mcp__github__create_branch` and\n  `mcp__github__push_files` were real but unregistered, and the first review round\n  flagged both.)\n- **Grep-verify any citation to `CLAUDE.md`, a `shared\u002F` fragment, or an\n  \"existing convention\u002Fscale\" before writing it into new skill prose** — not\n  only when auditing someone else's text. A skill being authored is new\n  content too, and the same failure `purge-hallucinations` catches in other\n  authors' text (a citation that reads as authoritative but doesn't resolve)\n  is just as easy to introduce while writing your own. `grep -rn \"\u003Cexact\n  phrase>\" CLAUDE.md shared\u002F` before the sentence ships, especially for\n  \"mirrors the scale already used\" \u002F \"per CLAUDE.md's ...\" phrasing — that\n  pattern claims unverified precedent. (`check-info-quality` #349 shipped\n  both: a `CLAUDE.md` section citation that didn't exist, and a claimed\n  \"blocking\u002Fnit\u002Foptional\" severity scale the cited doc never defined — both\n  caught by the `@claude` reviewer, not by the skill's author.)\n- **Test any regex\u002Fgrep detection heuristic against the skill's own cited\n  canonical examples before shipping — don't just reason about it\n  abstractly.** When a skill's description or fragment names specific\n  example phrases it's supposed to catch, actually run the pattern against\n  those exact strings. A heuristic that doesn't match its own advertised\n  examples is broken, not just incomplete, and a reviewer checking prose\n  for accuracy (`fact-check-prose`) will catch the mismatch even if you\n  don't. (`fix-forward-references` \u002F ai-config#507: the first version of\n  `forward-references.md`'s heuristic required a paired reference-cue\n  alongside the directional word, but every one of its own cited examples\n  — \"see below\", \"as discussed below\", \"we'll cover this later\" — has no\n  such cue, so none of them actually matched; caught in review, not before\n  pushing.)\n- **After testing a heuristic against multiple canonical examples, verify\n  every pattern you tested actually landed in the shipped fragment —\n  passing the test isn't the same as writing the result down.** Testing\n  two patterns and confirming each catches a different example, then only\n  transcribing one of them into the file, ships a fragment that\n  contradicts its own skill's procedure description (which still says to\n  run both). `diff` or re-read the fragment against your test\n  notes before committing, not just your terminal scrollback. (`ai-config#524`:\n  both regexes were verified working in a scratch test file, but only the\n  first was written into `informal-definitions.md` — caught by the\n  `@claude` reviewer, not before pushing.)\n- **Write example commands and claims so a literal, mechanical reader gets\n  the right answer — intent-correct isn't enough.** A verification command\n  whose comment says \"the base PR *adds* it\" must actually constrain to\n  added lines (`grep \"^+.*\u003Csymbol>\"` on a diff — unanchored, it also matches\n  deletions and context, inverting the answer), and an absolute claim\n  (\"guarantees a conflict\") is a review finding when a plain counterexample\n  exists (identical edits to the same passage merge cleanly — write \"almost\n  always conflicts\"). (`stack-prs` #577: two of the review round's three\n  findings were this one class, both caught by the reviewer rather than the\n  author's own self-review.)\n- **Use `\u003Cangle-bracket>` placeholders in command blocks — never bare ALLCAPS.**\n  Identifiers like `PATH`, `URL`, `TARGET` look like shell env vars; bare `PATH`\n  looks like the `$PATH` env var, and `path` is a zsh special that mirrors\n  `$PATH`. A reader who copies the command without substituting the placeholder\n  runs something wrong. Use `\u003Cpath>`, `\u003Curl>`, `\u003Ctarget>` instead. (See\n  `memories\u002Fclaude-code.md` → \"Skill command blocks\".)\n- **Every procedural step needs a runnable command, not just prose.** If\n  sibling steps in the same skill show a bash snippet, a step that only\n  describes the action in prose (\"rebase to drop the commits\") reads as\n  incomplete and invites a reviewer finding. This matters most for a\n  destructive or history-rewriting step that already requires explicit user\n  approval — the user needs to see exactly what they're approving, not infer\n  it. (`stack-prs` #359 round 1: the one step without a concrete command was\n  the abandoned-base-PR rebase.)\n- **Verify a cross-skill claim against the referenced skill's actual\n  mechanics before writing it — don't infer from what would be plausible.**\n  A claim like \"skill X uses signal Y to detect Z\" needs to be checked against\n  X's real procedure, not assumed from what sounds reasonable. (`stack-prs`\n  #359 round 1: claimed `ardia`'s stacked-PR detection reads the PR body,\n  when `ardia\u002FSKILL.md` actually matches `baseRefName` against `headRefName`\n  — the body note only helps a human scanning the list.)\n\n## If the skill fans out to subagents\n\nWhen a skill's procedure spawns subagents (to parallelize per-item work, e.g.\n`pr-status-all` runs one subagent per PR), write the **subagent prompt as if the\nskill file doesn't exist** — because for the subagent it doesn't. A spawned\nsubagent starts fresh: it sees only the prompt the orchestrator hands it, not\nthis skill's text. Any discipline the work depends on (the exact query, the\nbot-login wording, how to resolve owner\u002Frepo, \"read the LATEST review\") has to be\nrestated inside the subagent prompt, not assumed inherited. Keep the cheap,\nonce-per-run setup in the orchestrator — enumerate the work items there, and pass\ndown the per-item data the orchestrator already holds so each subagent doesn't\nre-fetch it. `pr-status-all` is the worked example.\n\nIf the same worker persona would be spawned by more than one call site, or the\nfan-out step needs a harness-enforced tool boundary an inline prompt can't\nguarantee (e.g. a detection pass that must never be able to write), promote it\nto a **persistent** `.claude\u002Fagents\u002F\u003Cname>.md` subagent instead of an inline\nprompt — hand off to `agent-builder` for that. `dependency-auditor`,\n`hallucination-detector`, and `community-demand-scout` are the worked examples.\n\n## If the skill encodes a standing rule\n\nWhen the skill codifies general guidance or a preference (not just a one-off\nprocedure), **also** update `memories\u002Fpreferences.md`, and for top-level\nworkflow policy add a `CLAUDE.md` section. Standing rule: update **BOTH** the\nskill AND preferences — the skill encodes the behavior, preferences make it\npersist and fire across all contexts even when the skill isn't invoked.\n\n## Ship it\n\nSkills and memories all live in the ai-config repo — never leave changes\nlocal-only. Commit via a **branch + PR** (not direct to main), request\n`the repository owner` as reviewer, then **ARDI to clean**.\n\n> **In a worktree session, the repo toplevel below is the MAIN checkout, not\n> your worktree.** `~\u002F.claude\u002Fskills` symlinks into the main `ai-config`\n> checkout, so `git -C ~\u002F.claude\u002Fskills … rev-parse --show-toplevel` returns the\n> main repo root — often on another session's branch. Don't `cd` there and don't\n> pass that path to Write\u002FEdit: the skill files (and git commits) would land in\n> the main checkout, clobbering another session's working tree. Instead author\n> the files in your **worktree's own** `skills\u002F\u003Cname>\u002F` dir and run git from the\n> worktree (it's a full checkout of the same repo). Confirm with\n> `git branch --show-current` before committing.\n\n```bash\ncd \"${CLAUDE_PLUGIN_ROOT:-$(git -C ~\u002F.claude\u002Fskills\u002Fskill-builder rev-parse --show-toplevel 2>\u002Fdev\u002Fnull || pwd)}\"   # ai-config root — NOTE: the MAIN checkout, NOT your worktree (see caveat above)\ngit fetch origin main && git checkout -b add-\u003Cname>-skill origin\u002Fmain   # FETCH, CREATE_BRANCH\n# write skills\u002F\u003Cname>\u002FSKILL.md (+ alias dir, + preferences\u002FCLAUDE.md if it's a rule)\npython3 scripts\u002Fsync-codex-skill-wrappers.py   # regenerate codex-skills\u002F wrappers — REQUIRED for every new\u002Frenamed skill\npython3 scripts\u002Fsemantic-line-breaks.py skills\u002F\u003Cname>\u002FSKILL.md   # preview only; --write to apply (see caveat below)\n# The `validate` CI job runs these four — run all four locally before pushing:\npython3 scripts\u002Fvalidate-skills.py             # frontmatter + wrapper-sync + manifest checks + the 8000-char skill-listing budget\npython3 scripts\u002Fcheck-links.py                 # relative markdown links resolve\npython3 scripts\u002Fcheck-vendored-drift.py        # shared-fragment vendored-content drift check\nnpx --yes markdownlint-cli2@0.22.1             # markdown style (config in .markdownlint-cli2.jsonc)\ngit add skills\u002F\u003Cname>\u002FSKILL.md codex-skills\u002F\u003Cname> \\\n        skills\u002F\u003Calias>\u002FSKILL.md codex-skills\u002F\u003Calias> \\\n        memories\u002Fpreferences.md                             # stage the files you\n                                                            # touched (incl. the\n                                                            # generated wrappers, and\n                                                            # the alias dir if you made\n                                                            # one) — NOT `-A`, which\n                                                            # sweeps in unrelated edits\ngit commit -m \"skills: add \u003Cname> — \u003Csummary>\"   # COMMIT\n```\n\nPush as a separate Bash call, per [`check-before-pushing`](..\u002F..\u002Fshared\u002Fworkflow\u002Fcheck-before-pushing.md)'s \"Keep the commit in its own Bash call\":\n\n```bash\n# Re-derived rather than inherited: a separate Bash call never keeps the\n# previous one's variables, and whether it keeps the directory is\n# unsettled. Target the active branch's worktree, falling back to the checkout root:\nrepo=\"${CLAUDE_PLUGIN_ROOT:-$(git -C ~\u002F.claude\u002Fskills\u002Fskill-builder rev-parse --show-toplevel 2>\u002Fdev\u002Fnull || pwd)}\"\nwt=\"$(git -C \"$repo\" worktree list --porcelain | awk '\u002F^worktree \u002F{w=$2} \u002F^branch refs\\\u002Fheads\\\u002Fadd-\u003Cname>-skill$\u002F{print w}')\"\ntarget=\"${wt:-$repo}\"\ngit -C \"$target\" push -u origin HEAD   # PUSH\n```\n\nOpen the PR in a separate Bash call:\n\n```bash\ngh pr create --fill   # CREATE_PR\n```\n\n**Regenerate the Codex wrappers — every new or renamed skill needs them.**\n`codex-skills\u002F` is a generated tree of thin Codex-compatible wrappers, one per\n`skills\u002F\u003Cname>\u002F`, and the `validate` CI job fails if it's out of sync (the red\nlog reads `Codex skill wrappers are out of sync:`). After writing the skill (and\nany alias dir), run\n`python3 scripts\u002Fsync-codex-skill-wrappers.py`, then `git add` the new\n`codex-skills\u002F\u003Cname>\u002F` (and `codex-skills\u002F\u003Calias>\u002F`) alongside the source.\nThe `validate` CI job runs four checks — `scripts\u002Fvalidate-skills.py`\n(frontmatter + wrapper sync + manifests), `scripts\u002Fcheck-links.py` (relative\nmarkdown links), `scripts\u002Fcheck-vendored-drift.py` (shared-fragment drift), and\n`markdownlint-cli2` (markdown style). Run all four before pushing to catch a\nstale wrapper, broken link, drift, or lint violation without a red-CI\nround-trip. Markdownlint lints every `SKILL.md`; the corpus disabled the\nrules its legacy files already violate (see `.markdownlint-cli2.jsonc`), so a\nnew skill still has to pass the rest — e.g. unique headings (MD024) and blank\nlines around tables (MD058).\n\n**A fifth CI gate isn't among those four, and it fires on the new file's own prose: `check-new-line-breaks`, a separate workflow that rejects a line you add which packs more than one sentence, or which reaches 80 characters and carries a mid-line semicolon.**\nIts scope is **Markdown only** (`globs: '*.md'`), minus the `paths-ignore` set --- `codex-skills\u002F**`, `docs\u002F**`, `_site\u002F**`, `.quarto\u002F**`.\nSo it scans every `.md` the skill touches, and it never scans the generated wrappers, which must not be hand-edited to satisfy a gate that does not read them.\n\n`scripts\u002Fsemantic-line-breaks.py` is **not** that gate.\nAs of ai-config#2085 it loads the same checker the gate pins, so `--write`\nsplits a mid-line semicolon the gate would flag rather than manufacturing\none.\nThe script is still a reformatter of named files, not the diff-scoped job:\ntake the verdict from the real check, whose runnable command is in\n[`semantic-line-breaks`](..\u002F..\u002Fshared\u002Fwriting\u002Fsemantic-line-breaks.md).\nThe gate only flags **lines this branch actually changed against `origin\u002Fmain`**,\nso run the reformatter against every file the skill touches, not just the new\n`SKILL.md`.\nAdd `--write` to apply once you've confirmed the diff is what you expect.\n**Don't reach for `--all` by default** --- it widens the reformat to the whole file, and on a file with pre-existing hard-wrapped (but otherwise CI-clean) prose it can rewrite hundreds of untouched lines into a large, unrelated-looking diff.\nPrefer the scoped mode, and if it under-fixes a paragraph (a same-sentence line shows up as \"still would change\" on a second scoped run even though `git diff origin\u002Fmain` shows that region untouched), just fix that one paragraph by hand instead of widening scope.\n\n**The 8000-char skill-listing budget lives inside `validate-skills.py`, not a separate script.**\nAdding a skill grows two catalogs at once --- `skills\u002F` (this repo's own routing prompt) and `codex-skills\u002F` (the Codex-wrapper mirror) --- and `validate-skills.py` reports both totals even when neither is over budget, so a passing run still tells you your margin.\nIf either is over, shorten **this skill's own** `description` field rather than editing an unrelated skill's frontmatter to make room.\nRe-run `sync-codex-skill-wrappers.py` after any frontmatter edit, since the Codex listing is derived from it.\n\nThen, as their own explicit steps (don't leave them buried in a comment):\n\n1. **Request the reviewer:** `gh pr edit --add-reviewer \u003Creviewer>` (`EDIT_PR`; see\n   `request-pr-review`).\n2. **Drive to clean:** run the `ardi` skill on the new PR until the verdict has\n   zero findings.\n\n> Why `git -C … rev-parse --show-toplevel` over `dirname \"$(readlink …)\"`:\n> bare `readlink` (no `-f`) resolves only a single hop and behaves\n> inconsistently across macOS\u002FLinux; `rev-parse --show-toplevel` returns the\n> repo root directly regardless of how the symlink chain is set up.\n\n## Relationship to other skills\n\n- **`spot-skill-opportunities`** — the recognition step that runs before this\n  one: it notices, continuously and in the moment, that a pattern is\n  skill-shaped and hands off here to build it. `ums` \u002F `record-learnings`\n  route through it too rather than judging recurrence themselves.\n- **`ums` \u002F `record-learnings`** — when a session reveals a workflow worth\n  codifying, they hand off to this skill to build it.\n- **`memorize` \u002F `remember`** — for a one-line fact or preference (not a\n  procedure), write a memory instead of a skill.\n- **`request-pr-review`, `ardi`** — used to ship and clean the new skill's PR.\n- **`simplify` \u002F `tidy`** — when extending, prefer collapsing into an existing\n  skill over proliferating near-duplicates.\n- **`consolidate-skills`** — when you discover a near-duplicate that already\n  shipped (two real skills for one workflow), hand the cleanup there: it merges\n  them into one canonical skill plus alias stubs.\n- **`decompose-skill`** — when Step 0 finds the closest existing skill to\n  extend is actually two concerns wearing one name, hand the cleanup there\n  instead of bolting a third concern on.\n- **`heal-skill`** — the repair counterpart: this skill authors a skill,\n  `heal-skill` fixes one that misfired after it shipped.\n- **`agent-builder`** — the subagent-file counterpart: this skill authors\n  user-invocable workflows in `skills\u002F`; `agent-builder` authors the\n  persistent, read-only fan-out worker personas a heavy skill's subagent step\n  can promote to `.claude\u002Fagents\u002F\u003Cname>.md`.\n- **`link-skills`** — this skill cross-links the one skill it authors;\n  `link-skills` is the corpus-wide audit that catches cross-reference gaps a\n  single authoring pass missed.\n- **`config-ai`** — the broader router this skill is one destination for: when\n  a request names a capability but not a mechanism, `config-ai` decides\n  whether it's a skill (→ here), a subagent, a memory, a hook, or a `gha`\n  capability, then hands off accordingly.\n\n## Anti-patterns\n\n- ❌ Creating a new skill when an existing one should be extended (skipping step 0).\n- ❌ Searching only `skills\u002F` in step 0 -- `scripts\u002F` and `hooks\u002F` hold the\n  instruments a procedural skill is likeliest to duplicate, so a clean grep\n  over `skills\u002F*\u002FSKILL.md` alone is not evidence the capability is missing\n  (#1055\u002F#1056).\n- ❌ Not scanning other branches → colliding parallel work \u002F duplicate skills.\n- ❌ Not checking open PRs → building a second draft of a skill someone already\n  pushed and opened a PR for, instead of redirecting to it.\n- ❌ Duplicating canonical content across alias files (aliases must only redirect).\n- ❌ Hand-writing an alias `SKILL.md` directly (raw `Write`) instead of routing\n  through skill-builder — skips codex-wrapper regeneration (trips `validate`)\n  and the self-review pass (`giardia`→`gia`, #569).\n- ❌ A thin description with no trigger phrases — the skill never gets discovered.\n- ❌ In a subagent-fanning skill, writing the subagent prompt as if it inherits\n  this skill's text — it doesn't; restate every needed discipline in the prompt.\n- ❌ `name:` not matching the directory name.\n- ❌ Encoding a standing rule in the skill but not in `preferences.md`.\n- ❌ Naming a GitHub MCP tool (or `gh`\u002F`git` operation) the skill uses without\n  registering it in `tool-mappings.yml` — the reviewer flags the unregistered\n  name as a possible hallucination (`push-memory` #311, `resolve-pr-threads` #347).\n- ❌ Bumping `skills.qmd`'s skill count by a manual +1 instead of re-deriving it\n  from `ls -d skills\u002F*\u002F | wc -l` — it drifts whenever `main` gains other skills\n  mid-review (`resolve-pr-threads` #347).\n- ❌ Citing a `CLAUDE.md` section or an \"existing scale\u002Fconvention\" in new\n  skill prose without grepping to confirm it actually exists first\n  (`check-info-quality` #349).\n- ❌ Leaving the new skill as a local-only uncommitted file (or pushing direct to main).\n- ❌ In a worktree session, writing the skill files to the `rev-parse --show-toplevel`\n  path — it resolves to the main checkout (via the `~\u002F.claude\u002Fskills` symlink), not\n  your worktree, so the files land on another session's branch. Author in the\n  worktree's own `skills\u002F` dir.\n","# skill-builder — author a new skill (extend-first)\n\nCreate — or, preferably, *extend* — an ai-config skill following the repo's\nconventions. The prime directive: **don't create a new skill until you've\nconfirmed no existing one should be extended instead**, and that no other\nbranch is already building it.\n\n## When this fires\n\n- \"build a skill\", \"create a skill\", \"make a new skill\", \"add a skill\",\n  \"skill-builder\"\n- Creating an **alias** for an existing skill — \"add an alias for X\", \"make X\n  an alias for Y\", \"should this be an alias for Y\" — is a skill-builder task\n  too, not a raw `Write` of a stub file. Hand-writing an alias `SKILL.md`\n  skips the codex-wrapper regeneration (the required step below) and trips the\n  `validate` CI check, and skips the self-review pass that catches errors in\n  the stub's own prose. (ai-config#569: a hand-written `giardia`→`gia` alias\n  stub failed `validate` on the missing wrapper and needed a review round to\n  fix a reversed phase-order description — both avoidable by routing here.)\n- Any time a repeatable multi-step workflow emerges that's worth codifying —\n  proactively suggest capturing it as a skill.\n\n## Step 0 — Extend before you create (do this FIRST, always)\n\nRule out extending an existing skill *before* scaffolding anything:\n\n1. **Search the whole corpus, not only `skills\u002F`**, for something that already\n   owns (or is adjacent to) this concern:\n   ```bash\n   cd \"${CLAUDE_PLUGIN_ROOT:-$(git -C ~\u002F.claude\u002Fskills\u002Fskill-builder rev-parse --show-toplevel 2>\u002Fdev\u002Fnull || pwd)}\"   # the ai-config repo\n   ls skills\u002F scripts\u002F hooks\u002F\n   grep -ril \"\u003Ckeywords>\" skills\u002F scripts\u002F hooks\u002F shared\u002F memories\u002F CLAUDE.md\n   ```\n   If a skill already covers it, **extend that skill** (a new alias, a new\n   section, an extra trigger phrase) rather than adding a near-duplicate.\n   If a **script or hook** already performs it, the skill you were about to\n   author is a wrapper around that instrument, so document the instrument\n   instead of restating its procedure as prose.\n\n   **`scripts\u002F` and `hooks\u002F` are the paths most often left out of this search,\n   and they are where prior art for a procedural skill is likeliest to sit.**\n   A skill describing a procedure is frequently a wrapper around an instrument\n   that already exists, because\n   [`deterministic-tools`](..\u002F..\u002Fshared\u002Fprinciples\u002Fdeterministic-tools.md)\n   pushes every recurring judgment task toward a script.\n   So an instrument in `scripts\u002F` is prior art for a skill exactly as another\n   skill is.\n   A search confined to `skills\u002F*\u002FSKILL.md` answers the narrower question\n   \"does a skill exist\", rather than the one actually being asked, \"does this\n   capability exist\".\n\n   Omitting them produces the failure shape\n   [`grep-is-not-coverage`](..\u002F..\u002Fshared\u002Fworkflow\u002Fgrep-is-not-coverage.md)\n   describes: a real command, a real null result, and a conclusion wider than\n   the paths that were searched.\n   So report the paths you covered alongside the step 4 decision below, rather\n   than reporting the decision alone.\n\n   - **Do:** search `scripts\u002F` and `hooks\u002F` alongside `skills\u002F` before\n     concluding that a capability does not already exist.\n   - **Do:** name the paths the search covered when stating the\n     extend-or-create decision.\n   - **Don't:** read a clean grep over `skills\u002F*\u002FSKILL.md` as evidence that\n     the capability is absent; it answers a narrower question.\n   - **Don't:** author a skill describing a procedure without first checking\n     whether an instrument already performs it.\n\n   (Morrison-Lab\u002Fai-config#1055 and #1056, 2026-08-02: a Step 0 pass ran\n   `ls skills\u002F`, the `skills\u002F*\u002FSKILL.md` grep, and the branch, worktree, and\n   open-PR scans below, plus a wider grep over `skills\u002F`, `shared\u002F`,\n   `memories\u002F`, and `CLAUDE.md`.\n   Every one came back clean, so the session filed #1055 and opened #1056 to\n   author a new `refresh-claude-token` skill.\n   `scripts\u002Frotate-claude-token.py` had been on `main` since commit\n   `18173c88`, merged as #953 under issue #952, at 312 lines with a 329-line\n   test file beside it.\n   It already discovers its target repos rather than hardcoding them, previews\n   by default, reads the token from stdin or the environment so it never\n   reaches `argv`, and re-reads each secret's `updated_at` to verify the write.\n   It surfaced only incidentally, from a\n   `gh search code 'CLAUDE_CODE_OAUTH_TOKEN'` run made for an unrelated\n   reason.\n   `scripts\u002F` was in none of the searched paths.)\n\n2. **Scan EVERY branch AND every local worktree for in-flight work --- the whole tree, not only `skills\u002F`.**\n   You, another CLI session, or the `@claude` bot may already be adding it, and a growing share of contributions are edits to `shared\u002F`, `CLAUDE.md`, `memories\u002F`, or `scripts\u002F` rather than a new `skills\u002F\u003Cname>\u002F` directory, so a `skills\u002F`-scoped scan is blind to exactly the kind of parallel work most likely to collide (Morrison-Lab\u002Fai-config#776).\n   A parallel CLI session usually builds its skill in an **unpushed local worktree**, so a remote-only `git branch -r` scan misses it entirely (this hit PR #67 --- a sibling skill was caught only by a stray system-reminder, not the scan).\n   Scan local refs *and* the worktree working trees too:\n   ```bash\n   git fetch origin --prune\n   # local + remote branches --- NOT just -r; unpushed local branches count.\n   # Whole-tree filename match, not skills\u002F[^\u002F]*\u003Ckeyword> --- a colliding edit\n   # to shared\u002F or CLAUDE.md has no skills\u002F path to match:\n   for b in $(git branch -a --format='%(refname:short)' | grep -v HEAD); do\n     git ls-tree -r --name-only \"$b\" | grep -iE \"\u003Ckeyword>\" | sed \"s|^|$b: |\"\n   done\n   # uncommitted, ref-less work in sibling worktrees — list only UNTRACKED\n   # files (whole tree, not just skills\u002F), so shipped skills (committed in the\n   # main worktree) don't false-match.\n   # Read paths via sed + `while read` (not $(...)\u002Fawk $2) so paths with spaces\n   # survive:\n   git worktree list --porcelain | sed -n 's\u002F^worktree \u002F\u002Fp' | while IFS= read -r wt; do\n     git -C \"$wt\" ls-files --others --exclude-standard 2>\u002Fdev\u002Fnull \\\n       | grep -iE \"\u003Ckeyword>\" | sed \"s|^|$wt: |\"\n   done\n   # A filename match still misses an EDIT to an existing shared\u002F or CLAUDE.md\n   # file that introduces the concept with no new path to catch --- pickaxe by\n   # content instead, recent-window scoped so it doesn't drown in unrelated\n   # history:\n   git log --all --oneline --since=14.days -S'\u003Ckeyword>' -- shared\u002F memories\u002F scripts\u002F hooks\u002F CLAUDE.md\n   ```\n   If a branch or worktree is already building it, **continue that work** (check\n   it out \u002F extend its PR) instead of opening a colliding parallel branch.\n\n3. **Check open PRs too** — a branch scan misses work already pushed and\n   opened as a PR if you never fetched it. See\n   [`check-open-prs-before-duplicating`](..\u002F..\u002Fshared\u002Fworkflow\u002Fcheck-open-prs-before-duplicating.md).\n\n4. **Decide explicitly: extend (preferred) or new.** State which and why before\n   writing a line. A new alias or section almost always beats a whole new skill.\n\n## Anatomy of a skill\n\nOne directory per skill, `name` matching the directory:\n\n```\nskills\u002F\u003Cname>\u002FSKILL.md\n```\n\n```yaml\n---\nname: \u003Cname>                 # MUST equal the directory name\ndescription: \"\u003Cwhat it does>. Use when asked to '\u003Ctrigger>', '\u003Ctrigger>', …\"\nuser-invocable: true\nallowed-tools:               # real skill: list its tools. alias: mirror the canonical's list\n  - Bash\n  - Read\n  - Edit\n  - Write\n---\n```\n\n- **`description` is how the skill gets discovered.** Pack it with *what it\n  does* AND the natural-language triggers (`Use when asked to '…'`). The matcher\n  reads this — be generous with trigger phrasings.\n- Body shape: `# \u003Cname> — \u003Ctagline>`, then `## When this fires`,\n  `## Procedure`, `## Relationship to other skills`, `## Anti-patterns`.\n  Concrete commands beat prose.\n\n## Conventions (match the existing family)\n\n- **Decide checklist fit explicitly.** Before adding a checklist section to a\n  skill (new or extended), apply\n  [`shared\u002Fworkflow\u002Fskill-checklists.md`](..\u002F..\u002Fshared\u002Fworkflow\u002Fskill-checklists.md):\n  add one only for repeatable, high-cost, mechanically verifiable failure\n  modes. If the skill is mostly judgment\u002Fexploration, skip checklist boilerplate.\n- **Include reusable, copy-pasteable shell commands where useful.**\n  Instead of leaving procedural steps as abstract prose (\"grep for X\", \"check CI logs\", \"query PRs\"),\n  provide concrete, tested shell command snippets with realistic placeholders (e.g. `gh pr list ...`, `rg -ni ...`).\n  This ensures agents and users don't have to reformulate or debug command pipelines every time they execute the skill.\n- **Pair short names with spelled-out aliases.** When the canonical skill has an\n  acronym\u002Fshort name (`gi`, `sup`, `ums`, `dc`), also create the spelled-out\n  alias dir (`grab-issue`, `send-upstream`, `update-memories-and-skills`) — and\n  give a memorable short alias to a spelled-out canonical where it helps. The\n  alias file is thin and only redirects:\n  ```markdown\n  ---\n  name: \u003Calias>\n  description: \"Alias for `\u003Ccanonical>`. \u003Cone-line>. Use when asked to '\u003Ctrigger>'.\"\n  user-invocable: true\n  allowed-tools:        # mirror the canonical's allowed-tools exactly\n    - Bash\n    - Read\n    - Edit\n    - Write\n  ---\n\n  # \u003Calias> (alias for `\u003Ccanonical>`)\n\n  This is a spelled-out alias. Read and follow the canonical skill:\n\n  → **[\u003Ccanonical>](..\u002F\u003Ccanonical>\u002FSKILL.md)**\n  ```\n  Keep the real content in **one** canonical file; aliases never duplicate it.\n  The alias's `allowed-tools` is the one exception: copy the canonical's list\n  verbatim so invoking the alias permits exactly what the canonical needs (an\n  alias redirects, so it must not be more restrictive than its target).\n- **Cross-link** related skills under `## Relationship to other skills`.\n- **No registry to update.** Skills are auto-discovered from `skills\u002F` (the\n  bootstrap symlink and the plugin root both read the directory) — adding the\n  directory is enough.\n- **List it in `skills.qmd` if it belongs in one of the category tables**, and\n  bump the \"All N+ canonical skills\" count at the bottom to the **actual**\n  directory count (`ls -d skills\u002F*\u002F | wc -l`), not a manual +1 — `main` often\n  gains other skills while your PR is in review, so a hand-incremented count\n  drifts and reads as stale by the time you merge (ai-config#347).\n- **Register any new tool the skill names.** Discovery needs no registry, but\n  tool *references* do. If the procedure names a **GitHub MCP tool or `gh`\u002F`git`\n  operation not already in `tool-mappings.yml`** (grep it to check), verify the\n  tool is real first (`ToolSearch` for it in a live session), then add it there\n  — `id`, `description`, `cli` (the CLI fallback), and `github_mcp` (the MCP\n  tool) — and rerun `scripts\u002Fsync-codex-skill-wrappers.py` so the Codex wrappers\n  can translate it.\n  Skip this and the `@claude` reviewer flags the unregistered name\n  as a *possible hallucination* — it can't tell a real-but-undocumented tool from\n  an invented one. (`push-memory` #311 hit this: `mcp__github__create_branch` and\n  `mcp__github__push_files` were real but unregistered, and the first review round\n  flagged both.)\n- **Grep-verify any citation to `CLAUDE.md`, a `shared\u002F` fragment, or an\n  \"existing convention\u002Fscale\" before writing it into new skill prose** — not\n  only when auditing someone else's text. A skill being authored is new\n  content too, and the same failure `purge-hallucinations` catches in other\n  authors' text (a citation that reads as authoritative but doesn't resolve)\n  is just as easy to introduce while writing your own. `grep -rn \"\u003Cexact\n  phrase>\" CLAUDE.md shared\u002F` before the sentence ships, especially for\n  \"mirrors the scale already used\" \u002F \"per CLAUDE.md's ...\" phrasing — that\n  pattern claims unverified precedent. (`check-info-quality` #349 shipped\n  both: a `CLAUDE.md` section citation that didn't exist, and a claimed\n  \"blocking\u002Fnit\u002Foptional\" severity scale the cited doc never defined — both\n  caught by the `@claude` reviewer, not by the skill's author.)\n- **Test any regex\u002Fgrep detection heuristic against the skill's own cited\n  canonical examples before shipping — don't just reason about it\n  abstractly.** When a skill's description or fragment names specific\n  example phrases it's supposed to catch, actually run the pattern against\n  those exact strings. A heuristic that doesn't match its own advertised\n  examples is broken, not just incomplete, and a reviewer checking prose\n  for accuracy (`fact-check-prose`) will catch the mismatch even if you\n  don't. (`fix-forward-references` \u002F ai-config#507: the first version of\n  `forward-references.md`'s heuristic required a paired reference-cue\n  alongside the directional word, but every one of its own cited examples\n  — \"see below\", \"as discussed below\", \"we'll cover this later\" — has no\n  such cue, so none of them actually matched; caught in review, not before\n  pushing.)\n- **After testing a heuristic against multiple canonical examples, verify\n  every pattern you tested actually landed in the shipped fragment —\n  passing the test isn't the same as writing the result down.** Testing\n  two patterns and confirming each catches a different example, then only\n  transcribing one of them into the file, ships a fragment that\n  contradicts its own skill's procedure description (which still says to\n  run both). `diff` or re-read the fragment against your test\n  notes before committing, not just your terminal scrollback. (`ai-config#524`:\n  both regexes were verified working in a scratch test file, but only the\n  first was written into `informal-definitions.md` — caught by the\n  `@claude` reviewer, not before pushing.)\n- **Write example commands and claims so a literal, mechanical reader gets\n  the right answer — intent-correct isn't enough.** A verification command\n  whose comment says \"the base PR *adds* it\" must actually constrain to\n  added lines (`grep \"^+.*\u003Csymbol>\"` on a diff — unanchored, it also matches\n  deletions and context, inverting the answer), and an absolute claim\n  (\"guarantees a conflict\") is a review finding when a plain counterexample\n  exists (identical edits to the same passage merge cleanly — write \"almost\n  always conflicts\"). (`stack-prs` #577: two of the review round's three\n  findings were this one class, both caught by the reviewer rather than the\n  author's own self-review.)\n- **Use `\u003Cangle-bracket>` placeholders in command blocks — never bare ALLCAPS.**\n  Identifiers like `PATH`, `URL`, `TARGET` look like shell env vars; bare `PATH`\n  looks like the `$PATH` env var, and `path` is a zsh special that mirrors\n  `$PATH`. A reader who copies the command without substituting the placeholder\n  runs something wrong. Use `\u003Cpath>`, `\u003Curl>`, `\u003Ctarget>` instead. (See\n  `memories\u002Fclaude-code.md` → \"Skill command blocks\".)\n- **Every procedural step needs a runnable command, not just prose.** If\n  sibling steps in the same skill show a bash snippet, a step that only\n  describes the action in prose (\"rebase to drop the commits\") reads as\n  incomplete and invites a reviewer finding. This matters most for a\n  destructive or history-rewriting step that already requires explicit user\n  approval — the user needs to see exactly what they're approving, not infer\n  it. (`stack-prs` #359 round 1: the one step without a concrete command was\n  the abandoned-base-PR rebase.)\n- **Verify a cross-skill claim against the referenced skill's actual\n  mechanics before writing it — don't infer from what would be plausible.**\n  A claim like \"skill X uses signal Y to detect Z\" needs to be checked against\n  X's real procedure, not assumed from what sounds reasonable. (`stack-prs`\n  #359 round 1: claimed `ardia`'s stacked-PR detection reads the PR body,\n  when `ardia\u002FSKILL.md` actually matches `baseRefName` against `headRefName`\n  — the body note only helps a human scanning the list.)\n\n## If the skill fans out to subagents\n\nWhen a skill's procedure spawns subagents (to parallelize per-item work, e.g.\n`pr-status-all` runs one subagent per PR), write the **subagent prompt as if the\nskill file doesn't exist** — because for the subagent it doesn't. A spawned\nsubagent starts fresh: it sees only the prompt the orchestrator hands it, not\nthis skill's text. Any discipline the work depends on (the exact query, the\nbot-login wording, how to resolve owner\u002Frepo, \"read the LATEST review\") has to be\nrestated inside the subagent prompt, not assumed inherited. Keep the cheap,\nonce-per-run setup in the orchestrator — enumerate the work items there, and pass\ndown the per-item data the orchestrator already holds so each subagent doesn't\nre-fetch it. `pr-status-all` is the worked example.\n\nIf the same worker persona would be spawned by more than one call site, or the\nfan-out step needs a harness-enforced tool boundary an inline prompt can't\nguarantee (e.g. a detection pass that must never be able to write), promote it\nto a **persistent** `.claude\u002Fagents\u002F\u003Cname>.md` subagent instead of an inline\nprompt — hand off to `agent-builder` for that. `dependency-auditor`,\n`hallucination-detector`, and `community-demand-scout` are the worked examples.\n\n## If the skill encodes a standing rule\n\nWhen the skill codifies general guidance or a preference (not just a one-off\nprocedure), **also** update `memories\u002Fpreferences.md`, and for top-level\nworkflow policy add a `CLAUDE.md` section. Standing rule: update **BOTH** the\nskill AND preferences — the skill encodes the behavior, preferences make it\npersist and fire across all contexts even when the skill isn't invoked.\n\n## Ship it\n\nSkills and memories all live in the ai-config repo — never leave changes\nlocal-only. Commit via a **branch + PR** (not direct to main), request\n`the repository owner` as reviewer, then **ARDI to clean**.\n\n> **In a worktree session, the repo toplevel below is the MAIN checkout, not\n> your worktree.** `~\u002F.claude\u002Fskills` symlinks into the main `ai-config`\n> checkout, so `git -C ~\u002F.claude\u002Fskills … rev-parse --show-toplevel` returns the\n> main repo root — often on another session's branch. Don't `cd` there and don't\n> pass that path to Write\u002FEdit: the skill files (and git commits) would land in\n> the main checkout, clobbering another session's working tree. Instead author\n> the files in your **worktree's own** `skills\u002F\u003Cname>\u002F` dir and run git from the\n> worktree (it's a full checkout of the same repo). Confirm with\n> `git branch --show-current` before committing.\n\n```bash\ncd \"${CLAUDE_PLUGIN_ROOT:-$(git -C ~\u002F.claude\u002Fskills\u002Fskill-builder rev-parse --show-toplevel 2>\u002Fdev\u002Fnull || pwd)}\"   # ai-config root — NOTE: the MAIN checkout, NOT your worktree (see caveat above)\ngit fetch origin main && git checkout -b add-\u003Cname>-skill origin\u002Fmain   # FETCH, CREATE_BRANCH\n# write skills\u002F\u003Cname>\u002FSKILL.md (+ alias dir, + preferences\u002FCLAUDE.md if it's a rule)\npython3 scripts\u002Fsync-codex-skill-wrappers.py   # regenerate codex-skills\u002F wrappers — REQUIRED for every new\u002Frenamed skill\npython3 scripts\u002Fsemantic-line-breaks.py skills\u002F\u003Cname>\u002FSKILL.md   # preview only; --write to apply (see caveat below)\n# The `validate` CI job runs these four — run all four locally before pushing:\npython3 scripts\u002Fvalidate-skills.py             # frontmatter + wrapper-sync + manifest checks + the 8000-char skill-listing budget\npython3 scripts\u002Fcheck-links.py                 # relative markdown links resolve\npython3 scripts\u002Fcheck-vendored-drift.py        # shared-fragment vendored-content drift check\nnpx --yes markdownlint-cli2@0.22.1             # markdown style (config in .markdownlint-cli2.jsonc)\ngit add skills\u002F\u003Cname>\u002FSKILL.md codex-skills\u002F\u003Cname> \\\n        skills\u002F\u003Calias>\u002FSKILL.md codex-skills\u002F\u003Calias> \\\n        memories\u002Fpreferences.md                             # stage the files you\n                                                            # touched (incl. the\n                                                            # generated wrappers, and\n                                                            # the alias dir if you made\n                                                            # one) — NOT `-A`, which\n                                                            # sweeps in unrelated edits\ngit commit -m \"skills: add \u003Cname> — \u003Csummary>\"   # COMMIT\n```\n\nPush as a separate Bash call, per [`check-before-pushing`](..\u002F..\u002Fshared\u002Fworkflow\u002Fcheck-before-pushing.md)'s \"Keep the commit in its own Bash call\":\n\n```bash\n# Re-derived rather than inherited: a separate Bash call never keeps the\n# previous one's variables, and whether it keeps the directory is\n# unsettled. Target the active branch's worktree, falling back to the checkout root:\nrepo=\"${CLAUDE_PLUGIN_ROOT:-$(git -C ~\u002F.claude\u002Fskills\u002Fskill-builder rev-parse --show-toplevel 2>\u002Fdev\u002Fnull || pwd)}\"\nwt=\"$(git -C \"$repo\" worktree list --porcelain | awk '\u002F^worktree \u002F{w=$2} \u002F^branch refs\\\u002Fheads\\\u002Fadd-\u003Cname>-skill$\u002F{print w}')\"\ntarget=\"${wt:-$repo}\"\ngit -C \"$target\" push -u origin HEAD   # PUSH\n```\n\nOpen the PR in a separate Bash call:\n\n```bash\ngh pr create --fill   # CREATE_PR\n```\n\n**Regenerate the Codex wrappers — every new or renamed skill needs them.**\n`codex-skills\u002F` is a generated tree of thin Codex-compatible wrappers, one per\n`skills\u002F\u003Cname>\u002F`, and the `validate` CI job fails if it's out of sync (the red\nlog reads `Codex skill wrappers are out of sync:`). After writing the skill (and\nany alias dir), run\n`python3 scripts\u002Fsync-codex-skill-wrappers.py`, then `git add` the new\n`codex-skills\u002F\u003Cname>\u002F` (and `codex-skills\u002F\u003Calias>\u002F`) alongside the source.\nThe `validate` CI job runs four checks — `scripts\u002Fvalidate-skills.py`\n(frontmatter + wrapper sync + manifests), `scripts\u002Fcheck-links.py` (relative\nmarkdown links), `scripts\u002Fcheck-vendored-drift.py` (shared-fragment drift), and\n`markdownlint-cli2` (markdown style). Run all four before pushing to catch a\nstale wrapper, broken link, drift, or lint violation without a red-CI\nround-trip. Markdownlint lints every `SKILL.md`; the corpus disabled the\nrules its legacy files already violate (see `.markdownlint-cli2.jsonc`), so a\nnew skill still has to pass the rest — e.g. unique headings (MD024) and blank\nlines around tables (MD058).\n\n**A fifth CI gate isn't among those four, and it fires on the new file's own prose: `check-new-line-breaks`, a separate workflow that rejects a line you add which packs more than one sentence, or which reaches 80 characters and carries a mid-line semicolon.**\nIts scope is **Markdown only** (`globs: '*.md'`), minus the `paths-ignore` set --- `codex-skills\u002F**`, `docs\u002F**`, `_site\u002F**`, `.quarto\u002F**`.\nSo it scans every `.md` the skill touches, and it never scans the generated wrappers, which must not be hand-edited to satisfy a gate that does not read them.\n\n`scripts\u002Fsemantic-line-breaks.py` is **not** that gate.\nAs of ai-config#2085 it loads the same checker the gate pins, so `--write`\nsplits a mid-line semicolon the gate would flag rather than manufacturing\none.\nThe script is still a reformatter of named files, not the diff-scoped job:\ntake the verdict from the real check, whose runnable command is in\n[`semantic-line-breaks`](..\u002F..\u002Fshared\u002Fwriting\u002Fsemantic-line-breaks.md).\nThe gate only flags **lines this branch actually changed against `origin\u002Fmain`**,\nso run the reformatter against every file the skill touches, not just the new\n`SKILL.md`.\nAdd `--write` to apply once you've confirmed the diff is what you expect.\n**Don't reach for `--all` by default** --- it widens the reformat to the whole file, and on a file with pre-existing hard-wrapped (but otherwise CI-clean) prose it can rewrite hundreds of untouched lines into a large, unrelated-looking diff.\nPrefer the scoped mode, and if it under-fixes a paragraph (a same-sentence line shows up as \"still would change\" on a second scoped run even though `git diff origin\u002Fmain` shows that region untouched), just fix that one paragraph by hand instead of widening scope.\n\n**The 8000-char skill-listing budget lives inside `validate-skills.py`, not a separate script.**\nAdding a skill grows two catalogs at once --- `skills\u002F` (this repo's own routing prompt) and `codex-skills\u002F` (the Codex-wrapper mirror) --- and `validate-skills.py` reports both totals even when neither is over budget, so a passing run still tells you your margin.\nIf either is over, shorten **this skill's own** `description` field rather than editing an unrelated skill's frontmatter to make room.\nRe-run `sync-codex-skill-wrappers.py` after any frontmatter edit, since the Codex listing is derived from it.\n\nThen, as their own explicit steps (don't leave them buried in a comment):\n\n1. **Request the reviewer:** `gh pr edit --add-reviewer \u003Creviewer>` (`EDIT_PR`; see\n   `request-pr-review`).\n2. **Drive to clean:** run the `ardi` skill on the new PR until the verdict has\n   zero findings.\n\n> Why `git -C … rev-parse --show-toplevel` over `dirname \"$(readlink …)\"`:\n> bare `readlink` (no `-f`) resolves only a single hop and behaves\n> inconsistently across macOS\u002FLinux; `rev-parse --show-toplevel` returns the\n> repo root directly regardless of how the symlink chain is set up.\n\n## Relationship to other skills\n\n- **`spot-skill-opportunities`** — the recognition step that runs before this\n  one: it notices, continuously and in the moment, that a pattern is\n  skill-shaped and hands off here to build it. `ums` \u002F `record-learnings`\n  route through it too rather than judging recurrence themselves.\n- **`ums` \u002F `record-learnings`** — when a session reveals a workflow worth\n  codifying, they hand off to this skill to build it.\n- **`memorize` \u002F `remember`** — for a one-line fact or preference (not a\n  procedure), write a memory instead of a skill.\n- **`request-pr-review`, `ardi`** — used to ship and clean the new skill's PR.\n- **`simplify` \u002F `tidy`** — when extending, prefer collapsing into an existing\n  skill over proliferating near-duplicates.\n- **`consolidate-skills`** — when you discover a near-duplicate that already\n  shipped (two real skills for one workflow), hand the cleanup there: it merges\n  them into one canonical skill plus alias stubs.\n- **`decompose-skill`** — when Step 0 finds the closest existing skill to\n  extend is actually two concerns wearing one name, hand the cleanup there\n  instead of bolting a third concern on.\n- **`heal-skill`** — the repair counterpart: this skill authors a skill,\n  `heal-skill` fixes one that misfired after it shipped.\n- **`agent-builder`** — the subagent-file counterpart: this skill authors\n  user-invocable workflows in `skills\u002F`; `agent-builder` authors the\n  persistent, read-only fan-out worker personas a heavy skill's subagent step\n  can promote to `.claude\u002Fagents\u002F\u003Cname>.md`.\n- **`link-skills`** — this skill cross-links the one skill it authors;\n  `link-skills` is the corpus-wide audit that catches cross-reference gaps a\n  single authoring pass missed.\n- **`config-ai`** — the broader router this skill is one destination for: when\n  a request names a capability but not a mechanism, `config-ai` decides\n  whether it's a skill (→ here), a subagent, a memory, a hook, or a `gha`\n  capability, then hands off accordingly.\n\n## Anti-patterns\n\n- ❌ Creating a new skill when an existing one should be extended (skipping step 0).\n- ❌ Searching only `skills\u002F` in step 0 -- `scripts\u002F` and `hooks\u002F` hold the\n  instruments a procedural skill is likeliest to duplicate, so a clean grep\n  over `skills\u002F*\u002FSKILL.md` alone is not evidence the capability is missing\n  (#1055\u002F#1056).\n- ❌ Not scanning other branches → colliding parallel work \u002F duplicate skills.\n- ❌ Not checking open PRs → building a second draft of a skill someone already\n  pushed and opened a PR for, instead of redirecting to it.\n- ❌ Duplicating canonical content across alias files (aliases must only redirect).\n- ❌ Hand-writing an alias `SKILL.md` directly (raw `Write`) instead of routing\n  through skill-builder — skips codex-wrapper regeneration (trips `validate`)\n  and the self-review pass (`giardia`→`gia`, #569).\n- ❌ A thin description with no trigger phrases — the skill never gets discovered.\n- ❌ In a subagent-fanning skill, writing the subagent prompt as if it inherits\n  this skill's text — it doesn't; restate every needed discipline in the prompt.\n- ❌ `name:` not matching the directory name.\n- ❌ Encoding a standing rule in the skill but not in `preferences.md`.\n- ❌ Naming a GitHub MCP tool (or `gh`\u002F`git` operation) the skill uses without\n  registering it in `tool-mappings.yml` — the reviewer flags the unregistered\n  name as a possible hallucination (`push-memory` #311, `resolve-pr-threads` #347).\n- ❌ Bumping `skills.qmd`'s skill count by a manual +1 instead of re-deriving it\n  from `ls -d skills\u002F*\u002F | wc -l` — it drifts whenever `main` gains other skills\n  mid-review (`resolve-pr-threads` #347).\n- ❌ Citing a `CLAUDE.md` section or an \"existing scale\u002Fconvention\" in new\n  skill prose without grepping to confirm it actually exists first\n  (`check-info-quality` #349).\n- ❌ Leaving the new skill as a local-only uncommitted file (or pushing direct to main).\n- ❌ In a worktree session, writing the skill files to the `rev-parse --show-toplevel`\n  path — it resolves to the main checkout (via the `~\u002F.claude\u002Fskills` symlink), not\n  your worktree, so the files land on another session's branch. Author in the\n  worktree's own `skills\u002F` dir.\n",{"name":5,"description":7,"allowed-tools":24,"user-invocable":29},[25,26,27,28],"Bash","Read","Edit","Write",true,"main","0f720481f8ce3b3d9fef485f6e230d8b3035748e","skills\u002Fskill-builder",1,"https:\u002F\u002Fgithub.com\u002FMorrison-Lab\u002Fai-config","https:\u002F\u002Fmorrison-lab.github.io\u002Fai-config\u002F","https:\u002F\u002Fgithub.com\u002FMorrison-Lab","2026-11-15 04:39:15",{"source":8,"skillName":5,"commands":39,"prompt":49,"zipAvailable":29},[40,43,46],{"tool":41,"command":42},"npx","npx skills add Morrison-Lab\u002Fai-config --skill skill-builder",{"tool":44,"command":45},"bunx","bunx skills add Morrison-Lab\u002Fai-config --skill skill-builder",{"tool":47,"command":48},"pnpm","pnpm dlx skills add Morrison-Lab\u002Fai-config --skill skill-builder","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FMorrison-Lab\u002Fai-config\u002Fblob\u002Fmain\u002Fskills\u002Fskill-builder\u002FSKILL.md",[],[52,59,66,73,80,87],{"skillNo":53,"name":54,"nameZh":6,"description":55,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":56,"categories":57,"keywords":58,"publishedAt":19},"01M735BVYCGR5VEC65AFDVSNKW","wrap-up","End-of-session verification and UMS.","https:\u002F\u002Fgithub.com\u002FMorrison-Lab\u002Fai-config\u002Fblob\u002Fmain\u002Fskills\u002Fwrap-up\u002FSKILL.md",[],[],{"skillNo":60,"name":61,"nameZh":6,"description":62,"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},"01M735BTH469T1CQ8G2Q9GENCR","workaround-watcher","Watch upstream issue for fix.","https:\u002F\u002Fgithub.com\u002FMorrison-Lab\u002Fai-config\u002Fblob\u002Fmain\u002Fskills\u002Fworkaround-watcher\u002FSKILL.md",[],[],{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":19},"01M735BRKZWFANSQ0GM380B4TD","wn","→ whats-next.","https:\u002F\u002Fgithub.com\u002FMorrison-Lab\u002Fai-config\u002Fblob\u002Fmain\u002Fskills\u002Fwn\u002FSKILL.md",[],[],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":19},"01M735BPE9V830B3B6NGXQ56J6","whats-next","Recommend concrete next step or action.","https:\u002F\u002Fgithub.com\u002FMorrison-Lab\u002Fai-config\u002Fblob\u002Fmain\u002Fskills\u002Fwhats-next\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":19},"01M735BMHQ60EAD5B7QAWXC5A0","wait-for-results","Wait for pipeline\u002FCI results.","https:\u002F\u002Fgithub.com\u002FMorrison-Lab\u002Fai-config\u002Fblob\u002Fmain\u002Fskills\u002Fwait-for-results\u002FSKILL.md",[],[],{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":19},"01M735BKGZHPN1PEMJ7YBD5VJ8","wai","→ send-notes.","https:\u002F\u002Fgithub.com\u002FMorrison-Lab\u002Fai-config\u002Fblob\u002Fmain\u002Fskills\u002Fwai\u002FSKILL.md",[],[]]