Why this skill exists
Skills have a public API and a private body; the contract is context/public-surface-contract.md (bundled with this skill). External consumers (rules, agents, other skills, prose docs) must cite the public surface only, so editing the private body never breaks them.
Without enforcement, private bodies leak: a rule cites a path inside <skill>/<some-subdir>/, the author refactors that subdir, and the cite breaks silently. Nothing fails the build.
Distinct from /docs-hygiene:extract-ssot (content duplication via Rule of Three). Encapsulation violations are single-violation matters. Rule of Three does not gate them.
Public surface matrix
The Skill surface is defined by context/public-surface-contract.md: public = frontmatter + documented actions + args/flags + /skill-name slash invocation + the scripts/ entry surface; private = everything else inside .claude/skills/<X>/ or plugins/<plugin>/skills/<X>/ (any other subdirectory, all *.schema.json at any depth, all heading anchors). That file holds the data-file and scripts/ entry-surface carve-outs and the rip-and-paste-portability rationale. This skill also audits cites against two authoring surfaces the contract file does not enumerate:
| Surface | Public (cite externally) | Private |
|---------|--------------------------|---------|
| Rule file (.claude/rules/*.md) | All H2/H3 headings (entire file is shared vocabulary) | n/a |
| Scheduled-automation prompt (e.g. .claude/routines/*.md, if the consumer repo keeps them) | Top-of-file orchestration prompt | Internal exclusion lists, escape conditions |
CI / git-hook sharing. Pick a technique, not an exception
Workflows and git hooks needing logic that also lives in a skill must not reach into skill internals. Pick a sharing technique by logic size: scripts/ facade (a public scripts/<name>.sh entry delegating to a private backend; hooks/CI invoke it), intentional duplication, plugin packaging, or headless claude -p '/skill <action>' invocation, per context/public-surface-contract.md "CI / git-hook consumption. Entry surface, not internals".
The choice is per-cite. The bundled detect.sh is a candidate enumerator: exit 1 means candidates remain after mechanical filters, not adjudicated violations. Classify (filter taxonomy below) before treating a hit as illegal. Do not hard-gate CI or pre-commit on detect.sh's exit code alone.
Action router
| Argument | Action | Purpose |
|----------|--------|---------|
| (empty) / detect | Default | Run detection grep, classify legal vs illegal, output violation table. Behind the no-scope confirmation below when nothing narrows the scope |
| sweep | Explicit repo-wide detect | Default detect minus the no-scope confirmation, for when the user already said "whole repo" |
| fix <file>:<line> | Targeted remediation | Interactive Path A (promote-out) vs Path B (route-via-/<skill>) for one hit |
| file-issues | Batch | File one tracking work item per illegal hit in the consumer's tracker (e.g. gh issue create), after reading the house style (${CLAUDE_PLUGIN_ROOT}/reference/issue-house-style.md) and applying it; emit a checklist if no tracker is available |
| --repo <repo> (and the other target forms) | Several repositories | detect/sweep once per repository, per