Skip to content
Back to skills

Refine Standard

ASecurity

Bring one file in the standards folder up to the bar the files already refined meet. It opens with its category's best possible safety, performance and experience, its claims follow from that opening and meet the standards README's phrasing rules, and a replay through a fresh agent shows the claims catch what they should. Use when asked to refine, open or audit a standards file.

  • 24 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 4, 2026
ai-agentsgogitsecurityperformancedocumentation

Works with

  • cli

Security analysis

A100/100

Scanned December 4, 2026

npx -y skills add ooloth/dotfiles --skill refine-standard --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Refine Standard?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Refine Standard
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ooloth-refine-standard/badge)](https://www.skillsdirectory.com/skills/ooloth-refine-standard)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: refine-standard
description: Bring one file in the standards folder up to the bar the files already refined meet. It opens with its category's best possible safety, performance and experience, its claims follow from that opening and meet the standards README's phrasing rules, and a replay through a fresh agent shows the claims catch what they should. Use when asked to refine, open or audit a standards file.
argument-hint: '<standards file, such as security.md>'
effort: high
model: opus
---

## What this is for

A standards file is what a reviewer grades code against. When its claims follow from what the
category is for, the reviewer finds the failures that matter, grades each one once, and finds
nothing in sound code. When the claims were written one at a time, real failures go unnamed and the
same gap gets graded at two tiers.

So each file opens with its category's best possible safety, performance and experience, as
`decision-making.md` defines them, and every claim follows from that opening. Each file already
refined, such as `documentation.md` or `performance.md`, opens with that list. Read the openings of
two of them, and the bodies of the commits that refined them, which record what the replays planted
and caught (`git log --format='%h %s%n%n%b' -- tools/agents/config/standards/<file>`), before
starting.

## Steps

1. Read the standards `README.md` (the tiers and the Phrasing rules), `decision-making.md` (the
   three properties), `documentation.md` and the target file, all in full. Read the open issue for
   the target file too, with its comments, using the `use-gh` skill: its title is
   `` `<file>` opens with its category's best possible safety, performance and experience ``, and
   earlier passes leave items there.
2. List how code or a system in this category can fail, under each property in turn: how it goes
   wrong or causes harm, how it is slow, and how it is hard to use or change. Write the list before
   reading the file's claims closely, because the list is what finds gaps.
3. Write the opening: the category's best possible safety, performance and experience. Where the
   file already has one, check it against the list instead, and change it only where the list shows
   a gap. Where the category barely bears on one of them, say so in a sentence, with the reason.
4. Check each claim against the opening and the list: which failure it catches, and at which tier. A
   failure no claim catches is a gap. Two claims that catch one gap are fine when one adds detail,
   because the higher tier decides. Two claims whose exemptions disagree are not.
5. Check each claim's wording against the Phrasing rules and `documentation.md`. The usual misses:
   an imperative in a body, a list of examples not marked as examples, a product named where a
   general term holds, an incident told as evidence, a figure with no source, an absolute with an
   exception, and a sentence that doesn't read in one pass when said aloud.
6. Draft every change as its exact current text and its new text, and sort them:
   - **Yours to decide:** marking examples, a general term for a product, removing an incident,
     rewrapping, fixing grammar.
   - **The user's to decide:** a new claim, a deleted claim, a changed tier, any change to the
     README rules, anything that changes how a reviewer grades a gap, and a change that softens or
     strengthens what a claim requires, such as replacing never with rather than.

   Every item carries its exact new text; a question with no draft goes to the user as a question,
   with lettered options.

   Apply them to a worktree of `HEAD` in a directory from `mktemp -d`, made with
   `git worktree add --detach <dir>/wt HEAD`, never to the repo's checkout, and copy nothing else
   into it. The replays then test the text the commit will hold, and the worktree's `HEAD` is what
   step 9 compares the checkout with. Where an item offers options, the worktree holds the
   recommended one. Then run `uv run scripts/checks/docs.py` from the worktree's root, and again
   after every later change to the worktree, so a heading or line that breaks the column limit is
   fixed in the draft rather than after approval. It lists files with git, so it checks only the
   folder it runs from. A fix that only rewraps needs no replay. Step 7 replays the worktree's
   files.
7. Replay the worktree's files before showing anything, so the user approves wording whose catches
   and misses are already known. Each round has four parts, and every agent in it is a fresh agent
   on Opus that reads its own inputs and spawns no subagents. Its prompt names the absolute paths it
   may read and says it invokes no skill and opens nothing else, `~/.agents/standards` and the
   repo's checkout included, because the global instructions otherwise have it load the live
   standards, the target file among them.
   - **Descriptions:** the main session writes, for each claim that changed or was added, a new
     problem it should catch, plus a clean sample with no problem, each under an opaque ID such as
     `s3`, unique for the whole run. The clean sample places the situations of every changed claim
     in one system whose parts interact, such as several deployables sharing one pipeline, so that
     two claims that cannot both hold, or a claim that flags sound practice, shows up as a finding
     in it. For each Must that was added or now reaches more, the descriptions also hold sound code
     of a kind the new wording reaches and the old did not, such as an interactive command under a
     timeout claim that now names subprocesses, keyed as clean; and each way the claim lists to meet
     it, written as a hurried author would apply it, keyed by whether that use meets the claim. A
     clean sample far from every claim cannot show a Must that flags sound code or accepts a method
     that fails. Each describes a concrete situation, such as what the code or doc does, never in
     the words of the claim. For a claim about docs, the problem can sit in a doc section, such as a
     README's rollback steps. The key maps each ID to the claims that should catch it and their
     tier, listing every claim step 4 accepted for that gap. The key stays in a folder of the main
     session's own and goes to no other agent. A revision that renames a heading changes the key's
     text for it, not which claims or tiers it lists.
   - **Samples:** an agent gets the descriptions with their IDs and nothing else, never the draft or
     the key, and writes one file per ID, named by the ID, into a `mktemp -d` folder of its own,
     with nothing in a sample that names or hints at its problem.
   - **Check:** the main session reads each sample against its description. A sample that lacks its
     problem, holds another, or hints at what is wrong with it is rewritten by a fresh sample agent
     given only its description, or dropped when that rewrite still fails. A dropped sample is
     reported in step 8, and its claim gets a new description in the next round. The main session
     then puts the round's samples and every sample carried from earlier rounds into one new folder
     for the review.
   - **Review:** another agent sees only the worktree's standards README, every standards file the
     refinement changes, the samples folder, and each other standards file whose claims could catch
     a gap a changed claim or scope bullet covers: each file a changed claim names as deciding a
     gap, each file the standards README loads for every task a changed file covers, such as
     `correctness.md` for code, and each file found by searching the standards folder for the
     situations the changed text describes, such as a silent fallback, rather than for its wording.
     A gap two files grade at different tiers is graded at the higher one, so a replay that leaves
     out the file with the higher claim reports the lower tier as settled. It reports each finding
     with the claim's heading and tier, lists any imperative left in the changed files, and names
     the claims whose wording left it unsure. In round 1 a
     second reviewer gets the same inputs with `HEAD`'s version of each changed file in place of the
     draft, written with `git -C <worktree> show HEAD:<path>` into a `mktemp -d` folder, so step 8
     can say which planted problems the old wording already caught. Only the first reviewer is
     graded.

   The main session grades the review against the key. A round passes when every claim that
   changed or was added had a planted sample reviewed, a clean sample was reviewed, and nothing in
   the round is a miss. These are misses: a planted problem caught under no claim its key entry
   lists, at a tier other than the highest of those claims, or a second time under a claim the
   entry does not list; any finding on a sample keyed clean; and an imperative left in a changed
   file. A finding about another problem on a planted sample does not fail the round, but it is
   reported in step 8. A finding that is only the newer rules applied to older text elsewhere is
   not a miss: it is drafted, into a file in a `mktemp -d` folder, as an item for the issue of the
   file it belongs to.

   Before revising, the main session reads each missed sample again. A miss whose sample does not
   hold what its description says, or holds a problem the check missed, is the sample's: the sample
   is replaced under a new ID, as the check replaces one, and reported in step 8, or reported as
   unreplaced when no round is left to review it. A miss whose key entry the README's rules
   contradict, such as a planned tier the higher-tier rule overrides, is the key's, and goes to step
   8 as a question. Every other miss is the draft's. Misses are sorted this way before any stop
   condition below is applied, and a sample whose miss turns out to be the sample's is no longer
   carried as a miss of the draft's.

   After a miss of the draft's, the draft is revised. Every round after one that did not pass uses a
   new reviewer on new samples for every changed claim and a new clean sample, plus each replacement
   sample and every sample an earlier round missed on the draft, so the wording is not tuned to one
   set. A doubt the reviewer named can be answered in a revision too, whether or not its round
   missed. The claims and tiers the key lists for each gap stay fixed, though each new sample adds
   an entry, and a revision stays inside them: one that would add or delete a claim, move a claim to
   another tier's section, change the README's rules, or change which claims or tiers a key entry
   lists goes to step 8 as a question with its exact text, rather than into the draft. Any other
   rewording goes into the draft and is replayed, even one step 6 sorts as the user's to decide, and
   step 8 still lists it among the user's decisions with its final text. One round of samples can be
   written ahead, in parallel with a review, while the claims and their headings stay the same. The
   replays stop at the first of these: a round passes with no revision waiting to be tested; at
   least one miss remains, every remaining miss waits on a question for the user, and no revision is
   waiting to be tested; a round that carried misses of the draft's clears none of them; or ten
   rounds have run. No revision follows the last round, so step 8 shows the text the last round
   replayed, and a fix found after it is a question.
8. Show the user, in one message and in their plain-speech style, every change with its current and
   new text, then the replays: for each round, what was planted, what was caught or missed and
   whose fault each miss was, any sample dropped or replaced, any extra finding, each doubt the
   reviewer named, what changed in response, which planted problems the old wording already caught
   in round 1, and any miss left at the end with why it remains. Then show each drafted issue item,
   as the text of the file it would be posted from, with the issue it goes to by number and title,
   or "new issue" where none is open. Every question comes last, in one numbered list with the
   recommended letter named: each change that is the user's to decide, each question with no draft,
   whether the rest of the wording is approved as shown, and whether each issue item may be posted.
   Then stop. Standards are agent instructions, so nothing is applied before the user approves the
   wording.
9. If the user's answers, or an edit the approved wording needs, such as a sentence that needs a
   general noun, change the text from what the replays tested, whether by new wording, a declined or
   deleted claim or a moved tier, put the change in the worktree and update the key to match. A
   sample whose key entry listed only a removed claim leaves the key, and the result names the gap
   it planted as one no claim now catches. Then replay the claims the change rewords, and every
   claim that shared a key entry with a removed one, carrying each sample whose key entry changed,
   as step 7 describes, with new descriptions for each claim replayed, a new clean sample, and no
   second reviewer, with a limit of ten rounds of its own, and show the new wording and its result
   as step 8 does. Then stop again.

   Each time every word is approved, compare the checkout with the worktree's `HEAD` before
   applying, running each command in the checkout:
   - **Commits since:** `git diff <base> HEAD -- <each changed file>` and the same for the
     standards README, where `<base>` is what `git -C <worktree> rev-parse HEAD` prints. Where one
     changed a claim a draft changes or a key entry lists, or the README's Tiers or Phrasing
     section, move the drafts to the new `HEAD`: make a new worktree there as step 6 does, run
     `git -C <old worktree> diff | git -C <new worktree> apply`, and remove the old one with
     `git worktree remove --force`. A draft that will not apply, because the commit changed a line
     it changes, applies nothing; the run then removes the new worktree, keeps the old one, and
     stops to show the user the commit's change beside the draft. Then replay, as this step's first
     paragraph does, that claim, or every changed claim after a README change. A change anywhere
     else, such as a File index line, is carried over without a replay or another stop.
   - **Uncommitted edits:** `git diff HEAD -- <each changed file and the standards README>` and
     `git status --short` show another session's edits, which belong to it and stay. Where one
     changes a line a draft changes, stop and show both to the user.

   Then apply exactly the approved text, as edits to the lines that change, never by copying a
   whole file over from the worktree. Other sessions may be editing the same files, such as an
   index most refinements touch, and a copied file drops their changes with no sign. Before
   applying, save `git diff HEAD -- <each changed file>` into a `mktemp -d` folder. After applying,
   the same command holds every changed line the saved copy held, plus the approved edits and
   nothing else, though lines that sit together may now share one hunk. A line missing or altered
   means something of theirs was lost: stop and tell the user.
10. Run the repo's full checks in the step 6 worktree, moved to the checkout's current `HEAD` as
    step 9 moves it if that has moved, so it holds `HEAD` plus exactly the approved text. If the
    `wrap-up-codebase` run that the global instructions require before the commit signal returns an
    ask that changes standards wording, its answer goes through step 9 first. Then ask for the
    commit signal, naming each file and what changed in it. A file that also holds another session's
    uncommitted changes is committed as `HEAD`'s text plus this run's lines alone, as the `commit`
    skill describes for committing part of a file, and the commit request names each such file and
    the changes it leaves out. The commit message says what the replays planted, what they caught,
    and what the old wording already caught. After the commit, or at the end of a run that makes
    none, each issue item the user approved, in step 8 or step 9, is posted unchanged from its file
    on the issue step 8 named, or proposed as a new issue through `write-ticket-description` where
    step 8 said "new issue". An item that relies on wording the user declined is shown to the user
    again instead. At the end of the run, every worktree it made is removed with
    `git worktree remove --force`, since they hold only drafts.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.