skills/refine-file/SKILL.md
Audit one instruction file by composing the durable-instruction lenses over it — vet-fact (WORTH: does each fact earn a line?), place-fact (PLACE: is it in the right home?), tighten-instruction (SHAPE: tighten the line). Pick the subset the file needs: shape-only, worth+shape, or worth+place+shape. A misplaced fact can be relocated to its right home on your approval, or deferred for a durable-docs-update batch. TRIGGER when: user wants a skill file or durable doc (CLAUDE.md, a rule, ARCHITECTURE.md) audited for what to keep, where it belongs, and how it reads; user says 'refine/audit this file', 'prune and tighten this doc', 'what here is worth keeping'. For shape-only tightening, tighten-file is the leaner sibling.
npx skillsauth add preetamnath/agent-skills refine-fileInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Primitive: WORTH + PLACE + SHAPE — composes the three durable-instruction lenses over one file, in any real subset (S, W+S, W+P+S).
CLAUDE.md, a .claude/rules/*.md, ARCHITECTURE.md).NOT for:
tighten-file (SHAPE only) is leaner.durable-docs-update (it scans the diff and adds new facts repo-wide). refine-file starts from the one file you name.The combiner owns ordering; the lenses never chain to each other. Apply the selected lenses per fact, in WORTH → PLACE → SHAPE order, referencing each by name (never paraphrased):
| Lens | Primitive | The check | Verdict |
|---|---|---|---|
| vet-fact | WORTH | does this fact deserve a line? | keep (+ category), or cut |
| place-fact | PLACE | is it in the right home? | stay, or move it (on approval) |
| tighten-instruction | SHAPE | does the line read cold? | keep, or tighten the line |
Composition glue (written once, here):
place-fact routes a kept fact to a different home, surface it as a MOVE. On your approval, refine-file executes it — open the target home, shape the fact for it, add it, remove it here (if the target already carries the fact, it's just a CUT here) — or you can defer it as a flag for a durable-docs-update batch. The single file you name is the audit scope, not a sandbox. Skill/agent prompts have no tier-homes — skip PLACE for them entirely.vet-fact keeps as rationale carries its reason as the fact — tighten-instruction shapes it to "behaviour — constraint" (its Step 4), and must not strip the reason as explain-why (its Step 2). Same for any kept fact whose non-derivable part is a consequence (a gotcha's failure mode).CLAUDE.md / .claude/rules/*.md / ARCHITECTURE.md; tier-homed → PLACE applies).AskUserQuestion with the fixed menu — {S, W+S} for a skill/agent prompt, {S, W+S, W+P+S} for a durable doc, recommendation first. Never offer a free-form combo.general-purpose subagents, parallel). Brief each with: the file path, the operand type, the selected subset, the three lens skills by name, and the composition glue above.vet-fact: the line + one-line reason.place-fact routes it to another home: fact + WORTH category + target home.Sweep: for any finding where max < 0.80 AND any reviewer < 0.70, run second-opinion; update scores.
Filter: keep findings where any reviewer scored ≥ 0.75; rank by max.
Order (composition order): CUT → MOVE → SHAPE; within SHAPE, whole-file → section → line, then max desc.
Table:
| # | Action | Finding | R0 | R1 | R2 | Max | Crossed |
Finding holds: current — reason (CUT), current → target home (MOVE), or current → proposed (SHAPE).
Checkpoint: AskUserQuestion to confirm the list before walking.
Walk order: CUT → MOVE → SHAPE. Within SHAPE: whole-file → section (structural pass), then re-sort remaining line findings by max desc.
Queue rule: any approved edit dissolves a queued finding it subsumes — drop it with a one-line reason. (E.g. a CUT dissolves a same-line MOVE/SHAPE; a MOVE dissolves a same-line SHAPE, since the fact is shaped in its new home.)
For each finding:
tighten-instruction Step 2); propose the cut, the move (naming the target home), or the tightened line; then show the R0/R1/R2 split.AskUserQuestion — CUT/SHAPE: apply / alternative / keep; MOVE: move / flag for later / keep.
Edit — CUT deletes; SHAPE replaces; MOVE adds the target-shaped fact to the target home (after checking it isn't already carried) and removes it here. "Flag for later" records the move to the deferred list instead — no Edit.second-opinion anchored on the finding.fact | this file → target home | category; run durable-docs-update to batch them, or move them yourself.development
Judge whether a candidate fact earns a durable-doc line: keep only what a future agent would get the wrong answer without; cut anything derivable from code, setup, breadcrumb, or a restated default. TRIGGER when: user asks 'does this belong in CLAUDE.md / a rule / the docs', 'is this worth keeping/writing down', 'should this be a comment'; vetting or pruning a fact before it's filed or shaped.
development
Route a kept fact to its durable home by delivery trigger and most-local-wins — across in-file comment, nested CLAUDE.md, path-scoped rule, root CLAUDE.md, ARCHITECTURE.md, or a skill. TRIGGER when: user asks 'where should this go', 'which file/rule/home does this belong in', 'is this in the right place', 'should this be a pointer'; placing or re-homing a fact already judged worth keeping.
development
Sequence a locked spec into dependency-ordered, wave-grouped tasks. TRIGGER when: user says 'build the plan' or 'sequence this'; a spec needs slicing into parallel-safe waves.
testing
Turn a locked product/UX spec into technical design — the HOW: architecture, data shapes, signatures, file layout. TRIGGER when: user asks how to implement a spec'd feature; user wants architecture, data-shape, or file-layout decisions; user says 'tech design' or 'design the implementation'.