lint-rules
Skill2 starsChanged 17 days agoMITView on GitHub
Use when fixing a bug, the user corrects the same mistake twice or says "you missed some", a review comment or gotcha recurs, or you are about to write a "don't do X"/"always do Y" into AGENTS.md, docs, a skill or a comment: the default answer is a repo-local lint rule. Also use when setting up or tightening linting, or contributing a rule back. Detects languages, wires shared rules into the linter and CI, and turns patterns into custom rules with failing examples.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- mbwsims/claude-universetheir own version, first seen Apr 14, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- mbwsims/claude-universe★ 71same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository22 other files it gives its agents.
- AGENTS.mdAGENTS.md
- act-within-scopeSkill
- build-filesSkill
- codingSkill
- context-managementSkill
- create-verification-skillSkill
- domain-modelingSkill
- encode-lessonsSkill
- experience-firstSkill
- eyes-onSkill
- fluxSkill
- frontend-designSkill
- gitSkill
- grill-with-docsSkill
- in-your-own-wordsSkill
- maintain-verification-skillSkill
- scripted-verificationSkill
- security-auditSkill
- skill-evaluationSkill
- test-auditSkill
- test-behavior-not-implementationSkill
- writingSkill
The file
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 6 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 18
If a linter can check it, it is a lint rule, not prose.
- Distinctive: line 24
Every message states the problem, why it matters (one line, or a link to the catalog row or decision note) and the fix, so an agent hitting …
- Very specific: line 50
Run cargo clippy --all-targets -- -D warnings.
- Very specific: line 56
Run them on rendered output (kustomize build), so placeholder image names are already replaced.
- Very specific: line 67
Run rules/test.sh here (or semgrep --test on the repo's rule directory) so every rule's failing example still fails.
- Very specific: line 78
Write the failing example first (// ruleid: <id> lines for semgrep, a fixture for others) and one passing example (// ok: <id>).
- Distinctive: line 85
Add the rule, its failing example and a catalog row (rule, why, bad example, date, origin, hits) in the same PR as the fix.
- Distinctive: line 91
Delete any AGENTS.md, doc, skill or comment text the rule now enforces.
- Distinctive: line 92
When you later hit a rule, read its message and fix the code.
- Distinctive: line 94
When the same rule recurs across repos, promote it here (see below).
- Very specific: line 133
When a repo-local rule turns out to be general, open a PR to agent-skills that adds the rule file, its failing example and a CATALOG.md row.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Lint Rules
Stock linters are the baseline. Custom rules catch the patterns that keep coming back. Every rule ships with a failing example and a catalog entry.
If a linter can check it, it is a lint rule, not prose. Prose (AGENTS.md, docs, skills, comments) holds only the why and what no linter can check. Rules break the build; prose gets skipped.
Rules Explain Themselves
Every message states the problem, why it matters (one line, or a link to the catalog row or decision note) and the fix, so an agent hitting it can act without reading anything else.
message: >-
Do not branch on error text. Messages change and wrapping breaks the match.
Compare with errors.Is against a sentinel, or errors.As into a typed error.{ path = "std::thread::sleep", reason = "fixed sleeps waste time when fast and flake when slow; wait on an event or a bounded deadline" },Apply The Rules To A Repo
- Detect languages:
go.mod(Go),Cargo.toml(Rust), Kubernetes YAML (kind:+apiVersion:, kustomize or Helm output), CSS (*.cssor a Stylelint config). - Go: enable golangci-lint with the settings in
rules/go/golangci.yml. Copy the
*.ymlfiles in rules/go/semgrep/ tolint/semgrep/and runsemgrep --config lint/semgrep --exclude vendor. - Rust: merge rules/rust/Cargo-lints.toml into
[workspace.lints]and opt in library crates only, as its header says, and merge rules/rust/clippy.toml intoclippy.toml. Runcargo clippy --all-targets -- -D warnings. On an existing crate, gate new code first: the cast lints alone hit hundreds of existingascasts. Land the config with the current hits allowed at crate level, block new ones in CI, then remove the allows as you burn them down. - Kubernetes: run kubeconform as in rules/k8s/README.md
and copy the
*.ymlfiles in rules/k8s/semgrep/. Run them on rendered output (kustomize build), so placeholder image names are already replaced. - CSS: copy rules/css/ (or merge
rules/css/create-config.cjs). Set
themeFile,prefix, anddeprecatedfor your palette. Installstylelint@16.23.1andpostcss-html, and run Stylelint as in rules/css/README.md. - Wire each linter into CI so a failure blocks merge. On an existing codebase,
gate only new code first (golangci-lint
new-from-rev, semgrep--baseline-commit), then burn down the backlog. A baseline or allowlist file may only shrink: see Baselines Only Shrink. - Run rules/test.sh here (or
semgrep --teston the repo's rule directory) so every rule's failing example still fails.
Write A New Rule
- A problem happens: a bug, a gotcha, a review comment, or a "don't do X" you were about to write down. One occurrence is enough for a repo-local rule when a linter can catch it.
- Pick the cheapest tool that can express it: a linter setting, then semgrep
or ruleguard for Go, Clippy
disallowed_methods/disallowed_typesor a dylint lint for Rust, Stylelint for CSS, semgrep for YAML. - Write the failing example first (
// ruleid: <id>lines for semgrep, a fixture for others) and one passing example (// ok: <id>). One rule per file:<id>.ymlplus<id>.go,<id>.test.yaml, or<id>.gomod. Clippy rules get a line in rules/rust/fixture and in thewantlist inrules/test.sh. - Measure: run it over the repo (every repo you can reach for a global rule), count hits and read a sample. Keep it only if most hits are real.
- Add the rule, its failing example and a catalog row (rule, why, bad
example, date, origin, hits) in the same PR as the fix. If the repo has no
lint/yet, scaffold the minimum:lint/semgrep/plus one CI step runningsemgrep --test lint/semgrep && semgrep --error --config lint/semgrep, or a[lints.clippy]table plusclippy.toml. - Wire it into CI so a violation fails the build.
- Delete any AGENTS.md, doc, skill or comment text the rule now enforces.
- When you later hit a rule, read its message and fix the code. Propose loosening the rule only if it is wrong, with the hits that show it.
- When the same rule recurs across repos, promote it here (see below).
Baselines Only Shrink
A lint baseline or allowlist (suppression file, ignored-path list, generated finding snapshot) may only shrink. Adding an entry hides a new violation behind a file that CI already trusts. Fix the code. Do not grow the file to make the build green.
CI compares entry counts with the merge base using
scripts/baseline-only-shrinks.sh. Growth
passes only when both are true: the pull request has the exact label
baseline-growth-approved, and the line directly before each added entry is
# owner: <who> — <why>. The dash is an em dash. <who> and <why> are
non-empty. A label whose name merely contains owner does not approve
growth. One owner comment covers only the next entry. A blank line or a
hyphen does not count. The failure text says why: growing the baseline hides
new violations, so fix the code instead.
PR_LABELS=baseline-growth-approved \
skills/lint-rules/scripts/baseline-only-shrinks.sh \
--base "$(git merge-base HEAD origin/master)" \
path/to/lint-baseline.txtPass --labels (or PR_LABELS) as a comma-separated list from the pull
request. Shrinking, reordering, or leaving the count unchanged always passes.
Global Versus Repo-Local
- Global (lives here): true in any codebase, names no product, employer,
internal package or domain type. Example: no bare
TODO. - Repo-local (lives in the repo's
lint/anddocs/lint-rules.md): mentions the repo's own types, packages, APIs or business rules. Example: "usebilling.Cents, notint64, for money".
Contribute A Rule Back
When a repo-local rule turns out to be general, open a PR to agent-skills that adds the rule file, its failing example and a CATALOG.md row. Strip work or employer-specific code, names, paths and identifiers. Rewrite the example from scratch rather than copying work code. Set origin to a generic description, never the employer or internal repo name.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

