К основному содержанию
скилл CX Codex

audit · rainmanjam — скилл для Claude Code: проверка структуры кода

Скилл проверяет уже работающий код на структурные проблемы и ранжирует их по цене будущих изменений. Пригодится перед рефакторингом, когда важно отделить серьёзные риски от вопросов стиля.

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add rainmanjam/poka-yoke --skill audit -a claude-code
Открыть на GitHub

Что делает audit

Скилл направляет проверку на публичные функции и классы, имена, импорты, длинные функции и тесты. Он ищет смешанные ответственности, устаревшие имена, неверное направление зависимостей, разошедшиеся копии кода и неявное состояние. Форматирование и порядок импортов не считает находками.

Результаты нужно привязать к строкам, упорядочить по ожидаемой цене проблемы и описать сначала как изъян, затем как минимальное исправление. Скилл также предлагает отмечать проверенные участки, которые оставлены без изменений, и объяснять почему. Он рассчитан на аудит структуры, а не на проверку правильности бизнес-правил; длинная функция сама по себе не считается проблемой.

Какие задачи решает

  • найти функции, которые совмещают разные обязанности
  • заметить имена, переставшие соответствовать коду
  • выявить зависимости бизнес-логики от инфраструктуры
  • определить, какая из разошедшихся копий кода неверна
  • отсортировать замечания по цене будущих изменений

Примеры запросов агенту

  • Проверь структуру этого кода и перечисли только значимые проблемы, привязав их к строкам.
  • Найди разошедшиеся копии и укажи, какая из них выглядит правильной.
  • Оцени зависимости и тестируемость бизнес-логики, затем предложи минимальные исправления.

Как установить audit

1Через Skills CLI (Vercel)

npx skills add rainmanjam/poka-yoke --skill audit -a claude-code

2Вручную: положить файлы

~/.claude/skills/audit/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/audit/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о audit

Как установить audit в Claude Code?

Выполните npx skills add rainmanjam/poka-yoke --skill audit -a claude-code. Файл скилла появится по пути ~/.claude/skills/audit/SKILL.md.

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

Он ищет структурные проблемы в работающем коде и ранжирует находки по ожидаемой цене будущих изменений. Замечания должны ссылаться на строки и предлагать небольшое исправление.

Считает ли audit длинную функцию проблемой?

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

Исходный текст

SKILL.md · MIT
---
name: audit
description: >-
  Reviewing code that already exists for structural problems: responsibilities that have drifted
  together, names that no longer describe what they name, dependencies pointing the wrong way,
  and duplication that has hardened into divergence.
---

# Audit: Reading Code That Already Works

Everything you are looking at ships and passes its tests. That is the constraint. You are not
hunting for bugs; you are finding the places where the structure will make the *next* change
expensive or risky, and saying which ones are worth paying to fix now.

That framing matters, because a review that lists everything imperfect is indistinguishable
from a review that found nothing important.

## Read in this order

**1. The public surface.** Exported functions, classes and endpoints. This is what other code
depends on, so problems here have the largest blast radius and the highest migration cost.

**2. The names.** Read them without reading the bodies. Any name that turns out to be wrong
once you read the implementation is a finding, because every future reader will make the same
mistake you just did.

**3. The imports.** They show the dependency direction at a glance. Business logic importing a
web framework, an ORM or a mail client is the single most reliable structural smell.

**4. The longest functions.** Not because length is the problem, but because that is where
several responsibilities usually ended up together.

**5. The tests.** Tests are a readout of the design. Heavy mocking means tangled dependencies.
Long setup means complicated construction. Absent tests for the core logic usually means the
core logic is hard to reach.

## What to look for

**Responsibilities that drifted together.** Describe the unit in one sentence. If you need
"and", note where the seam is: which parts change for different reasons, and on whose schedule.

**Names that have gone stale.** A function called `validate_user` that also creates a session.
A `TempFile` class that outlives the request. A `config` parameter that is actually a feature
flag. The code changed, the name did not, and the name is what the next reader trusts.

**Dependency direction.** Which module could not be tested, reused or moved without dragging
something heavy behind it? That is coupling with a cost you can name.

**Duplication that has diverged.** Two copies that started identical and have drifted are worse
than either one alone, because a fix applied to one leaves the other wrong. Note which is
correct.

**Ambient state.** Module-level singletons, globals, and implicit context. Each makes a unit's
behaviour depend on something not visible at its call site.

**Boolean parameters at call sites.** `render(rows, True, False)` cannot be read. Note it where
the call sites are numerous enough for the confusion to be real.

**Comments explaining what the code does.** Usually a sign the code does not say it. The
comment is not the finding; what forced it is.

## Ranking, which is most of the value

An unordered list of twenty observations moves nothing. Rank by expected cost of leaving it,
which is roughly *how often this code changes* multiplied by *how badly the structure hurts
when it does*.

- **High:** misleading names on widely-called functions; business logic that cannot be tested without infrastructure; diverged duplication where one copy is wrong.
- **Medium:** long multi-responsibility functions in code that changes regularly; ambient state; unclear module boundaries.
- **Low:** long functions in stable code nobody touches; naming that is imperfect but unambiguous; local inconsistency in a file that is otherwise clear.
- **Not a finding:** formatting, brace style, import order, and anything a tool should own. Raising these spends the reader's attention and teaches them to skim the rest.

## Say what you did not flag

A review that lists only problems reads as though everything unmentioned was examined and
approved. Name what you looked at and considered acceptable, and why:

> The `reports/` package has three near-identical builders. I left them: they render for
> different audiences and have changed independently twice, so the duplication is carrying real
> variation rather than hiding it.

That sentence is worth more than three more findings, because it tells the reader what your
threshold was.

## What good output looks like

- **Anchored to lines.** `orders.py:142, apply_discount` is reviewable; "the discount logic" is not.
- **Problem before fix.** State what the structure costs, then what you would do.
- **Ordered by cost**, with the ordering visible, so the reader can stop partway and still have covered the important ones.
- **Sized honestly.** If three findings matter, give three. Padding to a round number buries them.
- **With the shape shown.** A short before-and-after communicates faster than a paragraph.

## What to avoid

**Rewriting to taste.** Code that is consistent and clear but not your style is not a finding.
Local consistency beats individual improvement.

**Findings that are true everywhere.** "Consider adding tests" and "reduce coupling" apply to
every codebase and therefore inform nothing about this one.

**Reviewing the domain instead of the code.** Whether the discount rules are correct is a
question for whoever owns them; whether they are legible and changeable is yours.

**Proposing a rewrite.** A large restructuring cannot be reviewed, so it will be merged on
trust. Propose the smallest change that removes the problem you named.

**Counting lines as complexity.** A hundred-line function doing one thing in sequence is easier
to follow than five short ones threading state between them.

© rainmanjam · MIT · rainmanjam/poka-yoke

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

Все скиллы по теме «Код-ревью и рефакторинг» →

Сначала — audit от других авторов.

audit jsmastery-pro Сканирует проект и создаёт файлы AGENTS.md для контекста ИИ-агентов. Помогает описать правила кодовой базы с нуля или дополнить пропущенные зоны. CX Codex +1 4 300установок audit educlopez Проводит технический аудит интерфейса: доступность, производительность, адаптивность. Отдаёт таблицу находок по приоритетам. CX Codex +1 929установок audit calm-north Скилл прогоняет сайт по пяти слоям SEO-аудита: техническая база, оптимизация страниц, качество контента, ссылочный профиль и позиция среди конкурентов. CX Codex +1 6 400установок audit официальный OpenAI Пошагово проходит интерфейсы, сохраняет проверенные скриншоты и формирует отчёт по UX и доступности прямо в чате. CX Codex GP ChatGPT 10установок audit aladicf Прогоняет код по пяти направлениям: доступность, производительность, темы, адаптивность и анти-паттерны. Выдаёт отчёт со скорингом и планом правок. CX Codex +1 625установок improve-codebase-architecture Matt Pocock Скилл ищет архитектурные узкие места в кодовой базе и показывает варианты углубления модулей в HTML-отчёте. Подойдёт для ревью перед рефакторингом. 1 163 035установок tdd Matt Pocock Скилл управляет циклом красный-зелёный в TDD: проверяет, что тесты пишутся до кода, держит их на уровне публичных интерфейсов и не завязывает на внутреннюю структуру. 1 141 062установок triage Matt Pocock Скилл проводит issue и внешние PR через роли триажа, проверку и подготовку брифа для агента. Подойдёт мейнтейнеру, который разбирает очередь задач. 990 453установок codebase-design Matt Pocock Скилл помогает проектировать модули с небольшим интерфейсом и скрытой внутри сложностью. Подходит для рефакторинга, тестируемости и поиска чистого seam. 850 344установок code-review Matt Pocock Проверяет изменения от выбранной точки по стандартам репозитория и требованиям задачи. Нужен для ревью ветки, PR или незавершённой работы. 789 521установок implement Matt Pocock Выполняет задачу по спецификации или тикетам, ведёт работу через тесты и завершает её ревью с коммитом. Подходит для задач, где нужен дисциплинированный цикл разработки. 774 700установок

Из того же набора20

retro Помогает разобрать инцидент, найти архитектурную причину сбоя в коде и сформулировать выводы для будущих разработчиков. CX Codex +1 ★ 24звёзд репо design Помогает продумать интерфейс, модуль, схему или тип до появления зависимого от них кода. Полезен, когда нужно заранее проверить форму вызова, границы ответственности и тестируемость. CX Codex +1 ★ 24звёзд репо clean-code Проверяет ваш код на связность, имена, дублирование и размер функций. Плюс подсказывает, как спроектировать новое, чтобы читалось без автора. CX Codex +1 ★ 24звёзд репо authz Помогает проектировать и проверять логику авторизации, отделяя принятие решений от их исполнения. CX Codex +1 ★ 24звёзд репо ux Скилл для проектирования интерфейсов, где пользователь не может сделать необратимую ошибку: формы, удаление, массовые действия, оплата. CX Codex +1 ★ 24звёзд репо retro Помогает разобрать аварию или баг, найти системную уязвимость и устранить целый класс повторных ошибок. CX Codex +1 ★ 24звёзд репо poka-yoke Скилл разбирает, как ошибка превращается в дефект, и предлагает встроенную защиту для кода, схемы или процесса. Пригодится, когда нужно сделать действие труднее выполнить неправильно. CX Codex +1 ★ 24звёзд репо ops Помогает оценить радиус поражения перед выкаткой: что необратимо, что ломается в окне деплоя и как быстро откатиться. CX Codex +1 ★ 24звёзд репо

Спонсоры проекта

Компании, которые помогают держать аналитику открытой