pr-to-lint-rule
Synthesize a recurring code-review rule into a custom lint rule — gated by an independent soundness test that abstains rather than ship a checker it can't…
от zernie★ 17 звёзд на GitHub
Установить pr-to-lint-rule в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Turn a prose rule that no off-the-shelf linter rule matches into a custom
lint rule — the opt-in synthesis step. This is the hand-off target of the
custom rule (⚙) lane in a vigiles audit rule map: audit maps a rule there
when it looks enforceable but nothing off-the-shelf fits. You invoke this skill
explicitly; nothing here runs on its own, and installing vigiles never starts
synthesizing anything.
The point of this skill is not "write a checker." A model can write a plausible-looking checker in seconds. The point is the discipline that makes the result trustworthy: synthesize the rule and an independent test that encodes the rule's real intent, run the checker against adversarial cases it didn't author, and abstain — hand it back as prose — if it leaks. A checker that matches a rule's surface but not its intent gives false confidence (the measured failure mode: most naively-synthesized checkers silently leak). Shipping a green check nobody should trust is worse than shipping nothing.
Arguments
$ARGUMENTS — a prose rule to enforce. Either a custom rule (⚙) line copied
from a vigiles audit report, or free text. Examples:
- "we keep telling people not to import directly from antd — use our design-system barrel"
- "people forget to use our custom logger instead of console.log"
- "wrap outbound API calls in our
withRetryhelper" - "route handlers must go through the
withAuthwrapper"
The pipeline
prose rule
→ detect language + linter (ask if ambiguous)
→ REUSE first: does an off-the-shelf rule already fit? → use it, STOP (no synthesis)
→ clarify intent + read the codebase (what exactly is the violation? the fix?)
→ SYNTHESIZE: the rule + an INDEPENDENT intent-encoding test (adversarial cases)
→ TRUST GATE: run the checker on that test; precision AND recall must be 1.0
pass → KEPT (safe to enforce; wire it in)
leak → ABSTAIN (hand back as prose; never ship a checker it can't prove sound)
Instructions
Step 1 — Detect the language and toolchain
Read the repo to find the primary language, the linter in use (ESLint, Ruff, Pylint, Clippy, RuboCop, Stylelint…), the test framework, and any existing custom rules (to match conventions). If you cannot confidently pick one — polyglot repo, no linter config, several candidates — ask the user before generating anything.
Step 2 — REUSE before you synthesize (ADOPT > REUSE > SYNTHESIZE)
Synthesis is the last resort, not the first. Before writing any rule:
- Check existing plugins / built-in rules. Read the linter reference doc
below (the plugin table +
no-restricted-*families) — most one-off prohibitions are a config line, not custom code. - Try a built-in construct rule. ESLint
no-restricted-syntax/no-restricted-imports, Ruff/Pylint selects, RuboCop cops, etc. - Only synthesize when the rule needs AST analysis, a fix, or options that no existing rule provides.
If an off-the-shelf rule fits, use it and stop — enable it (one config line)
and jump to Step 6. That is the strengthen outcome, and it's the better one;
don't synthesize a rule when a maintained one exists.
| Language | Linter | Reference doc |
|---|---|---|
| JavaScript/TypeScript | ESLint | ../../../skills/linter-docs/eslint.md |
| Python | Ruff | ../../../skills/linter-docs/ruff.md |
| Python | Pylint | ../../../skills/linter-docs/pylint.md |
| Ruby | RuboCop | ../../../skills/linter-docs/rubocop.md |
| Rust | Clippy | ../../../skills/linter-docs/clippy.md |
| CSS | Stylelint | ../../../skills/linter-docs/stylelint.md |
For Go, generate a golang.org/x/tools/go/analysis analyzer with
analysistest tests. For any other language, use the most idiomatic linting
approach with test cases and integration notes.
Step 3 — Nail the intent, then read the codebase
Synthesis fails when the checker enforces what's easy to match instead of what the rule means. Before writing anything, pin down:
- The exact violation. "No hardcoded secrets" is not "a variable named
password" — it'sapiKey,token, an env-less literal too. "Wrap API calls in retry" needs the real signature of the calls and the wrapper. - The fix. What does the compliant form look like, concretely, in this codebase? Read the real files — the helper's import path, its call shape.
- The clean lookalikes. What looks like a violation but isn't? (the pattern
inside a string, a comment, a JSDoc
@example; an aliased/namespaced form.)
If any of this is ambiguous — and for anything like "wrap API calls in retry" it usually is — ask the user rather than guessing. A rule built on a guessed intent will fai
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл pr-to-lint-rule?
Synthesize a recurring code-review rule into a custom lint rule — gated by an independent soundness test that abstains rather than ship a checker it can't prove sound
Как установить скилл pr-to-lint-rule?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл pr-to-lint-rule запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
AnthropicGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
claude-api
AnthropicReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
algorithmic-art
AnthropicCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
mcp-integration
AnthropicThis skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…