Command Palette

Search for a command to run...

Назад к скиллам
скилл № 84053

Audit

Measure code for changed file/diff, path, or tree (`--all`) vs reference (size `--check`): size (lines per file), complexity (per-function cyclomatic…

БесплатноЗапускает вложенные скрипты
melodic-softwareот melodic-software★ 34 звезды на GitHub

Установить Audit в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Об этом скилле

Audit

Pre-computed context

Current branch: !git branch --show-current 2>/dev/null || echo "unknown"

Variables

Arguments: $ARGUMENTS

The first word names the action; the rest passes to its script unchanged, except the target forms, which the skill resolves and never passes to a script. ${CLAUDE_PLUGIN_ROOT}/reference/several-repositories.md says which scope argument a multi-repository run adds.

Actions

Argument Measures Script Full process
size Lines per file, every text file in every language ${CLAUDE_SKILL_DIR}/scripts/audit-size.sh actions/size.md
complexity Per-function cyclomatic and cognitive complexity and Halstead difficulty ${CLAUDE_SKILL_DIR}/scripts/audit-complexity.sh actions/complexity.md
type-debt Typed-code percentage per file and per language (TypeScript, Python) ${CLAUDE_SKILL_DIR}/scripts/audit-type-debt.sh actions/type-debt.md

With no action word, take the action from the request: file length or lines is size, complexity is complexity, typing or any is type-debt. When the request names none of them, list the three actions and ask which to run. Read the action's file before running its script; one action per invocation. Append --user-file '${user_config.config_file}' to every script call, exactly as written: it names the file holding your userConfig layer, and an empty or unsubstituted value means none (${CLAUDE_PLUGIN_ROOT}/reference/config.md).

Standing rules

  • Every action reports: each number sits beside a reference with its provenance, and nothing here is a pass, a fail, a finding or a severity. The one exception is size --check in a repository whose config sets size.check (off by default): it fails a changed file that crossed the reference, for a pre-commit hook or CI step the repository wires itself (actions/size.md, "Check mode").
  • Run the action's bundled script; never count, estimate or grep the measure by hand.
  • Scope is the change by default (the merge-base diff plus uncommitted files); explicit paths or --all widen it, and --json prints the code-metrics/v3 document instead of markdown.
  • A target form (--repo <repo> and the others) runs the action once per repository, as ${CLAUDE_PLUGIN_ROOT}/reference/several-repositories.md says; each repository gets its own section. size --check is a gate for one repository's hook or CI step, so it takes no target form.
  • Present the markdown report as printed, whole, with your notes after it, never in place of a part of it. Above all, never drop or reword these three: the "Coverage of this run" table, as a table, never a sentence about it; each reference's provenance line, section number included (such as ISO/IEC 5055:2021 §8.2.117, or that the value is the plugin's own number); and, for a measure with no reference, that no standard sets one. Keep the --json document when the numbers feed a comparison: /verification:measure metrics (if enabled) consumes it (treat status: empty on either side as INCONCLUSIVE); otherwise keep it beside your notes and compare by hand.
  • A null value is a number the collector did not produce, never zero.
  • Nothing is installed; a missing collector is a row in the run table with its install hint.

Spoke paths

The actions/ files write this skill's directory as <skill-dir>, which is ${CLAUDE_SKILL_DIR}, and the plugin's root directory as <plugin-root>, which is ${CLAUDE_PLUGIN_ROOT}. Put those paths in place of the placeholders before running a command: a ${…} token in a supporting file is not one this plugin can rely on being expanded, either in the file or in the Bash tool. Where each plugin variable resolves, and where it is exported: the plugins reference, https://code.claude.com/docs/en/plugins/manifest-reference#where-each-variable-resolves.

What this skill does not do

  • It does not run tests, edit files, or install a collector.
  • It does not judge: no reference is a bar, and only size has a check mode, opt-in through size.check.
  • It does not measure duplication, coverage or suppressions; those are the sibling audit-* skills in this plugin, and /code-metrics:principles explains what each number can and cannot tell you.

Next

  • A long file that also changes often needs a tracker item: /work-items:track add.
  • The numbers feed a before-and-after comparison: /verification:measure metrics.
  • A complex function's coverage and CRAP score are the real question: /code-metrics:audit-coverage.
  • A number is about to be quoted or read as a bar: /code-metrics:principles.

Gotchas

  • Change scope needs a merge-base with the default branch; outside a git repository, or on a branch with no default-branch ancestor, pass paths or --all (the usage error says which).
  • The report skill field and the dispatcher id are audit-size, audit-complexity and audit-type-debt, not this skill's nam
Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

  1. 01Bash(${CLAUDE_SKILL_DIR}/scripts/audit-size.sh:*)
  2. 02Bash(${CLAUDE_SKILL_DIR}/scripts/audit-complexity.sh:*)
  3. 03Bash(${CLAUDE_SKILL_DIR}/scripts/audit-type-debt.sh:*)
  4. 04Bash(git branch --show-current:*)

Вложенные файлы

  • actions/complexity.md
  • actions/size.md
  • actions/type-debt.md
  • evals/evals.json
  • scripts/audit-complexity.sh
  • scripts/audit-complexity.test.sh
  • scripts/audit-size.sh
  • scripts/audit-size.test.sh
  • scripts/audit-type-debt.sh
  • scripts/audit-type-debt.test.sh
  • scripts/size_check.py
  • scripts/size_commits.py
  • scripts/test_size_check.py

FAQ

Что делает скилл Audit?

Measure code for changed file/diff, path, or tree (`--all`) vs reference (size `--check`): size (lines per file), complexity (per-function cyclomatic complexity, cognitive, Halstead), type-debt (typed ratio, mypy). Use when 'which files are too big', 'how complex is this code', 'how many anys'. Not for CRAP: /code-metrics:audit-coverage.

Как установить скилл Audit?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл Audit запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить Audit с