check-rules
БесплатноБез исполняемых скриптовНе проверенCheck the current changes against CODE_RULES.md and report violations. Use before pushing, or when asked whether a change breaks the repo's rules. Each rule…
от Positronic-Robotics★ 92 звезды на GitHubОб этом скилле
Check Rules
Checks a diff against CODE_RULES.md. Nothing else — not a code review, not a style pass, not a bug
hunt. A finding that does not name a rule is out of scope, however good it is.
Each rule is checked by a subagent that starts empty — no conversation history, no files this session has read, no other rule. That much the platform guarantees; the one thing that would undo it is a fork, which inherits the parent conversation, so never use one here.
What the platform cannot guarantee is the prompt you write, and that is the only channel into the agent. You are the worst possible author for it: you know why every line looks the way it does, and that knowledge is what stops you seeing the violation. Whatever of it you write into the prompt, the agent inherits.
Step 1: Scope the diff
The caller owns the scope. Check whatever they name — a branch, a commit range, a set of files — and nothing else.
With nothing named, check the whole change as it would land if merged as it stands. Work out what that means here; it is a judgement about this checkout, not a fixed recipe.
Say which scope you used. A clean report over the wrong scope is worse than no report.
Step 2: One agent per rule
grep -n '^### ' CODE_RULES.md
Spawn them in parallel, one rule each rather than one agent holding all of them — an agent given nine rules skims for nine and checks none, and reporting nothing then means nine rules half-checked instead of one cleanly checked. Each needs its rule and a way to tell which code changed, and must deliberately not know how that code came to be: a cold-headed reviewer answering one question, not a colleague who sat through the reasoning.
Every prompt is the same five parts: the [check-rules checker] marker line below, the rule pasted
whole and verbatim, the scope Step 1 settled, the return format below, and the instructions that follow
it. Nothing else goes in.
Whatever you would add comes from knowing the change, and that knowledge is what kept you from seeing the violation yourself. Emphasis, an example, a "pay attention to", a scope trimmed to the lines you touched — each hands the agent your reading of the rule in place of the rule, and the reading you did not have is the one you spawned it for.
Spawn them on Sonnet — model: 'sonnet', on every agent. Each one answers a narrow question: one
rule against one diff. A fan-out of that width spends most of what it costs on being that wide rather
than on the judging. The parameter is not optional: omitted, an agent inherits whatever model the
session runs, which is the caller's business and not the checker's. Raise a single rule to opus where
its verdict turns on the change as a whole rather than on a shape in the diff, and name that rule in
the report, so a reader can tell what judged what.
Each agent returns two sections, either of which may be empty:
FINDINGS
Rule <rule-id> violated:
<file>:<line>
<what the code does, and the safe path>
WAIVERS
<file>:<line> — <the reason the waiver gives>
Start every agent's prompt with this exact line, alone on the first line:
[check-rules checker]
The fixed marker lets tooling that reads session transcripts recognise a checker run and leave it out of what it indexes.
Instruct every agent to:
- give every violation a file and a line, best effort — a finding with nowhere to point is not a finding;
- honour
# rules-allow: <its-rule-id> — <reason>on the line or its enclosing block, and list every waiver it honoured. A rule whose every match is waived returns an emptyFINDINGSand a populatedWAIVERS, which is not the same as passing; - leave
FINDINGSempty rather than reach for a marginal one. A checker that always finds something gets ignored, which costs more than the violation it caught.
Step 3: Report
Aggregate every agent's FINDINGS into one list, ordered by file and line, each entry keeping its
own rule and the agents' format, so local output matches what Codex posts on the PR. State
the scope and the rules checked, then list the collected WAIVERS separately — a rule silenced by a
waiver must never look the same as a rule that passed.
Report only. Fixing is a separate decision and the user makes it.
When a finding is wrong
A false positive is information about the rule, not just about the code. Say so in the report and stop
there: only a human changes CODE_RULES.md, through the add-rule skill and with their explicit
approval. This skill never edits a rule, however wrong the rule looks from here.
Установить check-rules в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл check-rules?
Check the current changes against CODE_RULES.md and report violations. Use before pushing, or when asked whether a change breaks the repo's rules. Each rule is checked by an isolated agent with no session context.
Как установить скилл check-rules?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл check-rules запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
docx
Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include…
от AnthropicUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple…
от Anthropicxlsx
Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing…
от Anthropicpptx
Use this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or…
от Anthropic