beads-rs: Skill for Claude Code

.claude/skills/writing-rust-lints/SKILL.md

writing-rust-lints is a skill for Claude Code from delightful-ai/beads-rs. It costs 54 tokens per session (5,722 once invoked), scanned A, original, MIT.

A guide for building custom Rust lints with Dylint, a tool for detecting unwanted code patterns in Rust projects.

In plain words
What is it for?
Use it to create lints, choose between Rust compiler checking hooks, handle state or configuration, and test the resulting lint library.
Why use it?
It helps enforce project-specific rules that standard tools such as Clippy do not cover.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

This is delightful-ai/beads-rs's own configuration. It tells Claude Code how to work on beads-rs itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything beads-rs configures →

Reuse

Borrowing it

Nothing to install: this file belongs to delightful-ai/beads-rs. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/delightful-ai/beads-rs/main/.claude/skills/writing-rust-lints/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/delightful-ai/beads-rs

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for writing-rust-lints

README.md
[![agentmods](https://agentmods.dev/badge/skills/delightful-ai/beads-rs/writing-rust-lints/github.svg)](https://agentmods.dev/skills/delightful-ai/beads-rs/writing-rust-lints)
Your own site
<a href="https://agentmods.dev/skills/delightful-ai/beads-rs/writing-rust-lints"><img src="https://agentmods.dev/badge/skills/delightful-ai/beads-rs/writing-rust-lints/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for writing-rust-lints

Your own site · 80×15
<a href="https://agentmods.dev/skills/delightful-ai/beads-rs/writing-rust-lints"><img src="https://agentmods.dev/badge/skills/delightful-ai/beads-rs/writing-rust-lints.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 54 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,722 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00054 $0.05722
Opus 5 $0.00027 $0.02861
Sonnet 5 $0.00011 $0.01144
Haiku 4.5 $0.00005 $0.00572

Measured 10d ago against content hash 9f06229ba705, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

writing-rust-lints scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/writing-rust-lints/SKILL.md · 809 lines

How it starts

The opening of the file, as written. The whole thing — 809 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Writing Rust Lints with Dylint

Create custom Rust lints that run as dynamic libraries via Dylint.

When to Use

  • Creating project-specific lints for code patterns
  • Enforcing team conventions that Clippy doesn't cover
  • Building reusable lint libraries
  • Any task involving LateLintPass, EarlyLintPass, or rustc internals

Quick Start

cargo dylint new my_lint_name
cd my_lint_name
# Edit src/lib.rs, ui/main.rs
cargo build && cargo test

Macro Selection

digraph macro_selection {
    "Need custom lint?" [shape=diamond];
    "Has state/config?" [shape=diamond];
    "Multiple lints?" [shape=diamond];
    "Use declare_late_lint!" [shape=box];
    "Use impl_late_lint!" [shape=box];
    "Manual register_lints" [shape=box];

    "Need custom lint?" -> "Has state/config?" [label="yes"];
    "Has state/config?" -> "Multiple lints?" [label="no"];
    "Has state/config?" -> "Use impl_late_lint!" [label="yes"];
    "Multiple lints?" -> "Use declare_late_lint!" [label="no"];
    "Multiple lints?" -> "Manual register_lints" [label="yes"];
}
  • declare_late_lint!: Single lint, no state. Generates everything.
  • impl_late_lint!: Single lint WITH state/config. Pass initializer.
  • Manual register_lints: Multiple lints in one library. Use dylint_library!().

NEVER mix: If using declare_late_lint!, do NOT manually write dylint_library!() or register_lints.

EarlyLintPass (AST-level)

For lints that don't need type information (AST-only):

#![feature(rustc_private)]

extern crate rustc_ast;
extern crate rustc_lint;
extern crate rustc_session;

use rustc_ast::ast::{Expr, ExprKind};
use rustc_lint::{EarlyContext, EarlyLintPass, LintContext};
use rustc_session::{declare_lint, declare_lint_pass};

declare_lint! {
    pub MY_EARLY_LINT,
    Warn,
    "description"
}

declare_lint_pass!(MyEarlyLint => [MY_EARLY_LINT]);

impl EarlyLintPass for MyEarlyLint {
    fn check_expr(&mut self, cx: &EarlyContext<'_>, expr: &Expr) {
        // AST-level checks - NO type info available
        if let ExprKind::MethodCall(method_call) = &expr.kind {
            if method_call.seg.ident.name.as_str() == "unwrap" {
                cx.lint(MY_EARLY_LINT, |diag| {
                    diag.primary_message("found unwrap");
                });
            }
        }
    }
}

// IMPORTANT: Still need this for Dylint
dylint_linting::dylint_library!();

Read the full file on GitHub · 809 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 809 lines · 54 tokens per session scan A 9f06229ba705

Subscribe to this mod's changes

writing-rust-lints is a skill published in the GitHub repository delightful-ai/beads-rs (24 stars, last pushed 22d ago), licensed MIT. It adds 54 tokens to every session and 5,722 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories