Command Palette

Search for a command to run...

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

audit-rules

БесплатноБез исполняемых скриптовНе проверен

Audit the entire codebase for compliance with .claude/rules/ conventions. Use when: (1) running '/audit-rules', (2) asked to check whether the whole codebase…

abyssparanoiaот abyssparanoia★ 20 звёзд на GitHub

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

Whole-Codebase Rule-Compliance Audit

Audit every source file against .claude/rules/ using parallel reviewer agents in Audit Mode, auto-fix all violations, then open a PR with the fixes.

Workflow

1. Determine Scope      → parse optional arg, enumerate files with git ls-files
2. Partition Files      → split by rule category (domain, usecase, grpc, db-repo,
                          proto, migration, infra-other, tests)
3. Parallel Agent Audit → launch convention-reviewer per partition
                          (+ security-perf-reviewer on non-test code partitions) + test-reviewer
4. Aggregate Findings   → collect, deduplicate, sort
5. Auto-Fix Issues      → edit files to fix all auto-fixable violations
6. Verify Fixes         → codegen + lint/test retry loop
7. Create PR            → branch, commit, gh pr create
8. Report               → per-partition results table

Step 1: Determine Scope

Check for an optional argument. If provided (e.g. /audit-rules domain), run only that partition. Otherwise run all partitions.

Enumerate auditable files (exclude generated code):

# All tracked Go source files, excluding generated
git ls-files 'internal/**/*.go' \
  | grep -v '/mock/' \
  | grep -v '/dbmodel/' \
  | grep -v '\.pb\.go$' \
  | grep -v '_grpc\.pb\.go$'

# Proto files
git ls-files 'schema/proto/**/*.proto'

# Migration + constant files
git ls-files 'db/**/migrations/**/*.sql' 'db/**/constants/**/*.yaml'

Step 2: Partition Files

Assign each file to exactly one partition using the table below. Files matching multiple patterns go to the first matching partition.

Every non-test partition's convention-reviewer applies the full .claude/rules/*.md set, the matching checklists.md section, AND the whole ai-antipatterns.md catalog (#7–#50 are non-test conventions). The "Rule files" column below lists the primary rules for each partition; it is not an exhaustive allow-list — every rule and anti-pattern applies wherever its layer matches.

Code partitions that involve handlers, usecases, repositories, external-service / IdP integration, or migrations additionally run security-perf-reviewer (authorization, transaction boundaries, IdP sync order, N+1 / preload, missing index). domain and proto stay convention-only (no TX / authz / query surface); tests stays test-reviewer.

Partition glob patterns Reviewer Rule files
domain internal/domain/** (non-test) convention-reviewer domain-model.md, domain-errors.md, domain-service.md, repository.md, ai-antipatterns.md (non-test)
usecase internal/usecase/** (non-test) convention-reviewer + security-perf-reviewer usecase-interactor.md, domain-service.md, ai-antipatterns.md (non-test, incl. #50)
grpc internal/infrastructure/grpc/internal/handler/** (non-test) convention-reviewer + security-perf-reviewer grpc-handler.md, ai-antipatterns.md (non-test)
db-repo internal/infrastructure/{mysql,postgresql,spanner}/** (non-test), internal/infrastructure/dependency/** convention-reviewer + security-perf-reviewer repository.md, dependency-injection.md, external-service-integration.md, ai-antipatterns.md (non-test)
proto schema/proto/**/*.proto convention-reviewer proto-definition.md
migration db/**/migrations/**/*.sql, db/**/constants/**/*.yaml convention-reviewer + security-perf-reviewer migration.md
infra-other internal/infrastructure/{cognito,firebase,gcs,s3,redis,http,aws,cmd}/** (non-test), cmd/** (non-test) convention-reviewer + security-perf-reviewer external-service-integration.md, webhook-implementation.md, job-system.md, worker-pattern.md, cli-command-pattern.md, ai-antipatterns.md (non-test)
tests **/*_test.go test-reviewer testing.md, ai-antipatterns.md (#1-#6)

If a single partition has more than ~60 files, split it into sub-batches and run agents sequentially for that partition (to avoid context overflow). Each sub-batch agent still uses AUDIT MODE with its own file list.

Step 3: Parallel Agent Audit

CRITICAL: Use subagent_type, Do NOT Embed the Agent Definition

Specify subagent_type: "convention-reviewer" (or "security-perf-reviewer" / "test-reviewer"). Never read the agent .md and paste its body into prompt. Doing so breaks the model: sonnet and read-only tools enforcement, and causes drift.

Audit Mode Prompt Template

Pass only context — the agent's role comes from its own definition:

AUDIT MODE

Partition: {partition_name}

Files to audit (review complete file content — this is NOT a diff):
{file list, one path per line}

Review every listed file in full against your role definition. Do NOT run git diff or
detect $BASE. Apply all applicable rule checks to the complete file content.
Report findings in your defined Output Format, including Semantic Category on every finding.

Полный SKILL.md на GitHub

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

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

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

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

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

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

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

FAQ

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

Audit the entire codebase for compliance with .claude/rules/ conventions. Use when: (1) running '/audit-rules', (2) asked to check whether the whole codebase follows project conventions, (3) running a periodic convention sweep before a major release. Partitions source files by rule category, launches convention-reviewer and test-reviewer agents in parallel (audit mode), aggregates findings, auto-fixes all fixable violations, verifies with lint/test, and opens a PR. Accepts an optional category argument to scope to one partition (e.g. '/audit-rules domain').

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

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

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

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

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

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