Audit Encapsulation
Audit skill encapsulation and boundary leak where external citation reaches private skill surface (.claude/skills/X/, plugins/*/skills/X/) beyond slash…
от melodic-software★ 34 звезды на GitHub
Установить Audit Encapsulation в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Audit encapsulation
Scope
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.
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 ${CLAUDE_PLUGIN_ROOT}/reference/target-scope.md and ../../context/clean-tree-fallback.md "Several repositories"; detect.sh runs from inside each root and scans only that repository. The per-repository subagents run in waves of 2–3, the pacing cap below. fix <file>:<line> with --repo <repo> beside it edits that repository's hit in its own worktree and pull request ("Writes stay per repository" there); file-issues files each hit in its own repository's tracker |
One action per response.
No inherited scope. Confirm before a repo-wide run
Shared clean-tree / no-scope shape: ../../context/clean-tree-fallback.md.
Read it when the bare invocation is unattended or non-interactive (the case the rules below leave
unstated), or when editing those rules.
This skill's trigger is "no inherited scope", not only "clean tree": a dirty tree with unrelated
edits still needs the confirm when nothing names the detect surface.
The default action's domain is the whole repo, but a bare invocation does not prove the user meant that. With no inherited working set (no diff in flight, no prior audit notes, nothing in the conversation narrowing the scope), ask one confirmation before running detection, presenting these prescribed defaults for adjustment:
| Default | Value |
|---|---|
| Scope | entire tracked repo (the detect script's scan domain) |
| Mode | detect + classify only; remediation stays a separate, user-approved step |
| Worker fan-out | off. Classify in-session. When the user opts into subagent classification or remediation, run 2–3 concurrent workers, no more (our pacing cap, independent of the harness's own concurrent-subagent limit: [pointer](https://code. |
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- context/public-surface-contract.md
- evals/evals.json
- scripts/detect.sh
- scripts/detect.test.sh
FAQ
Что делает скилл Audit Encapsulation?
Audit skill encapsulation and boundary leak where external citation reaches private skill surface (.claude/skills/X/, plugins/*/skills/X/) beyond slash invocation; read-only, explicit fix FILE:LINE. Use when 'audit encapsulation', 'find skill leaks', 'check skill boundaries', skill boundary violation, reaching into SKILL, API drift, refactor skill. Load it to ask what depends on another plugin's internals. Load it too before publishing plugins as separate installs.
Как установить скилл Audit Encapsulation?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл Audit Encapsulation запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
mcp-builder
AnthropicGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
claude-api
AnthropicReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
algorithmic-art
AnthropicCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
mcp-integration
AnthropicThis skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…