Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

simplicity-audit

БесплатноЗапускает вложенные скриптыНе проверен

Weekly codebase-complexity audit — re-measures the v1.0.0 simplicity gates (language-core closure, command and flag counts, os.Getenv routes, duplicate symbol…

sunholo-dataот sunholo-data★ 39 звёзд на GitHub

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

Simplicity Audit

The 800-line file gate cannot see the thing that actually makes this repo hard for an agent: count and duplication. Two implementations of one concept, a sixth backend switch, a package with no comment, a command with no --help — none of those move a file over 800 lines. This skill measures them and diffs week over week.

It is the standing instrument for M-V1-SIMPLIFICATION-PROGRAM: the program closes the gaps once; this skill keeps them closed.

Run it

make simplicity-audit          # full: re-measures, diffs, banks, exit 2 on regression
make simplicity-audit-fast     # same without the timed make test-core row
bash .claude/skills/simplicity-audit/scripts/audit.sh --fast --offline    # no network: external rows null
bash .claude/skills/simplicity-audit/scripts/audit.sh --fast --services   # + Cloud Run usage (minutes)
tools/simplicity_external.sh [--services]   # just the external rows, as JSON

Under the hood: .claude/skills/simplicity-audit/scripts/audit.sh runs tools/simplicity_metrics.sh, compares the JSON with the newest snapshot under .ailang/state/simplicity/, prints a before/now/delta table, then the concrete names behind the counts (which symbols are duplicated where, which packages lack a comment, which platform packages the language core reaches, which skill cites a command that does not exist), banks today's snapshot, and exits 2 if any gated metric moved the wrong way. Snapshots are tracked in git so the diff works on any machine.

Health rows beyond count and duplication

Added 2026-11-12 so the audit tracks what HANDOVER-v1-codebase-health-2026-11-09 §2 measured by hand:

Row Source Gated?
unreachable_funcs go run golang.org/x/tools/cmd/[email protected] -test=false ./cmd/..., third_party/ excluded (counted apart as unreachable_funcs_third_party); detail = top packages le, ratchet at 1,301 (2026-11-12)
prod_loc_core / prod_loc_platform / prod_loc_platform_pct tracked non-test Go under internal/, split by the core list read from .claude/rules/architecture.md no (informational)
sonar_gate_passing, sonar_{security,reliability,maintainability}_rating SonarCloud public API (api/qualitygates/project_status, api/measures/component); ratings 1=A .. 5=E no
codeql_high_open, dependabot_open_{critical,high,medium,low}, secret_scanning_enabled gh api code-scanning (CodeQL, high+critical), Dependabot alerts, repo security_and_analysis no
cloud_run_services_used --services only: gcloud logging read of 30 days of 2xx request logs per Cloud Run service in prod/dev/test, gcloud's active account (or CLOUDSDK_CORE_ACCOUNT), read-only; per-service request classes (otlp, health, static, /api/<x>, /<x>) and distinct IPs in .services no

The external rows live in tools/simplicity_external.sh and are optional and offline-safe: no network, no gh credential, no gcloud, or --offline records value: null with a reason (listed under "unmeasured" and in the what-to-look-at block), never 0 and never a failed run. A 0 means the API answered "none". A crash of that script is a bug and does fail the run. --services takes minutes (the dev dashboard alone is ~86k requests a month); a service at the 250k-entry ceiling is marked capped.

unreachable_funcs counts test-only helpers as dead and cannot see reflection or data coupling: it tracks direction, it is not a deletion list. Each removal needs deadcode -test=true and git log -S (.claude/rules/coding-standards.md). It only sees packages linked into a cmd/ binary — a func in a package no binary imports is invisible to it, not "reachable".

In the diff, a row absent from the old snapshot shows — before and ? as the verdict, and a null on either side is ?; neither can be a regression.

scripts/dup_symbols.sh [min] on its own lists every top-level function name declared in min or more packages (default 3), with the packages. That list is where duplicate implementations hide — truncate ×5 with three semantics, writeJSON ×4, setProcessGroup ×4 were all found this way.

What to do with the output

  1. A WORSE row on a gated metric is a regression against the program's release gate. Find the commit: git log --since=<last snapshot date> -- <the area> and either revert the route or route it through the survivor the program names (one config package, one plane switch, one loader per concept).
  2. A new duplicate symbol name is not automatically wrong (NewClient per provider is honest). Open the two definitions; if they do the same job, the one with more callers survives and the other becomes a call to it. Cite git log -S in the commit, per .claude/rules/coding-standards.md — never delete on "unused" alone
Полный SKILL.md на GitHub

Установить simplicity-audit в Claude Code и Claude Desktop

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

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

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

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

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

Без ограничений — скилл может использовать любой инструмент.

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

scripts/audit.shscripts/dup_symbols.sh

FAQ

Что делает скилл simplicity-audit?

Weekly codebase-complexity audit — re-measures the v1.0.0 simplicity gates (language-core closure, command and flag counts, os.Getenv routes, duplicate symbol names across packages, packages without a doc comment, skill trees, instruction-surface bytes, tracked files, root clutter), diffs against the last banked snapshot, and names what got more complex. Use when the user says "simplicity audit", "weekly audit", "is the codebase getting more complex", "find duplicate implementations", "codebase health check", or before a release. NOT for file sizes (codebase-organizer) or Sonar issues (sonarcloud-triage).

Как установить скилл simplicity-audit?

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

Скилл simplicity-audit запускает скрипты?

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

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

Сравнить simplicity-audit с