Skill audit
Keep skills, playbooks, rules, and pstack overrides tight and non-overlapping. A skill or rule stays only when it holds domain knowledge pstack cannot have, or does a job pstack does not do.
Stay read-only until the owner approves cuts, unless the request explicitly asks to apply them.
Run the scanner
shnode <skill>/scripts/audit.mjs <target> [--json] [--min <score>]
Works on a pstack-managed project, a plain repo with custom skills or playbooks, or udecode/ustack itself. It reports project and user-scope skill inventory, typed counts, route counts, stale ustack copies, size budgets, oversized workflow scripts, retired infrastructure references, unmarked block rules, and candidate overlaps.
Surfaces
Audit every surface present in <target>:
- Custom project skills and rules:
.agents/rules/*.mdcplus.agents/rules/<name>/,.agents/skills/*(includingscripts/), and workflow guides named inAGENTS.md(judge each guide as a restatement of the block, like a skill that copies it). - Project playbooks:
.agents/playbooks/*.mdagainst upstream pstack base playbooks (poteto-mode/playbooks/*.md). - pstack overrides: the
AGENTS.mdpstack:begin/pstack:endblock,.agents/pstack/rules/*.md, unmarked rules missing<!-- # overrides -->,<!-- # relies -->, or<!-- # adds -->, and drift from the pinned tag. sync-pstackandustack: when auditingudecode/ustack, inspectskills/*/SKILL.md,skills/*/scripts/,skills/sync-pstack/assets/block.md,assets/pstack/rules/*.md, andassets/pstack/*.mjs; checkblock-budget.mjs,budget-check.mjs, and cross-skill overlap.- Workflow scripts and retired infrastructure: check scripts under
tooling/scripts/,.agents/pstack/,.agents/skills/*/scripts/,.agents/rules/*/scripts/, andskills/*/scripts/against the 500-line cap (excluding*.test.*), and flag references to retired infrastructure (plan-page,Artifact,ccd_session,page-stop,chips.mjs,tasks.mjs) across skills, rules, playbooks, and scripts.
Verdicts
Read each skill's source (.agents/rules/<name>.mdc and its references, not generated .agents/skills/ mirrors) and the closest pstack skill or playbook, then assign one verdict:
- cut: pstack, the block, or another kept skill already does the job, or nothing uses it. Name the working replacement, every typed command or route that loses its target (record dropped typed commands under
droppedin.agents/pstack.json), and where each kept rule lands. - fold: domain knowledge stays, but process text owned by pstack or the block goes. Quote each duplicated sentence beside the text that owns it and state whether every copy agrees; send any conflicting copy to the owner as a ruling before offering the fold.
- encode: a recurring prose rule belongs in a lint, hook, type, or script. Move enforcement into code and delete the prose rule it replaces.
- keep: holds domain knowledge pstack cannot have or does a job pstack does not do. Name that knowledge.
Rules and safety
- Record for each verdict which files were read in full and which were only searched.
- Treat overlap lines as candidates, not verdicts: a sentence can repeat pstack on purpose as a project override.
- Every unmarked block or rule entry is a finding: state whether it overrides pstack or adds to it.
- Check every typed count and playbook route before calling a skill unused, because a playbook can load a skill nobody types.
- Never propose editing a skill installed from another repository; judge it
keeporuninstall(npx --yes skills remove). - Treat a waiver or gate label that names a retired tool as an owner policy question, not a rename.
- When proposing a
/correctrun, list mistakes that reached a commit apart from those an existing check caught.
Size budgets
Flag every file or folder over cap; trim duplicated prose, encode rules into checks, or split references before adding text:
- Project targets: 14,000 B per playbook or
.mdcrule, 70,000 B total.agents/playbooks, 20,000 B perSKILL.md, 40,000 B per skill folder (docs and references), 500 lines per workflow or skill script (tooling/scripts/,.agents/pstack/,.agents/skills/*/scripts/,.agents/rules/*/scripts/,skills/*/scripts/, excluding*.test.*). ustacktarget: 16,384 B perskills/*/SKILL.md, 100,000 B total skills, 8,192 B perassets/pstack/rules/*.md, 80,000 B total rules, 18,200 B max renderedassets/block.md, 14 helper.mjsfiles.
Apply and verify
- Present candidates via
AskUserQuestion(or numbered options in Codex) with typed counts, route counts, and exact rule or gate impact. - Execute approved cuts with a disposition table (old rule -> new home or
dropped), add removed typed commands to.agents/pstack.jsondropped, updateAGENTS.mdand project workflow guides, and remove dropped external skills vianpx --yes skills remove. - Verify with
sync-pstackverify <project>on pstack projects,scripts/validate-skills --allonustack, and the project's own skill regeneration and check commands.


