/ai_dev:format_rustfrom ai_dev
Applies clippy-aligned Rust practices including Result/Option idioms, error-versus-invariant model with panic discipline, fallible builders, and borrowing clarity.
Ships in ai_dev. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Use clear, procedural flow with small, single‑purpose functions and explicit data flow; keep names concrete so intent is obvious at a glance.
Write code that naturally satisfies clippy by choosing the simplest correct form, and treat clippy warnings as signals to improve clarity, safety, and maintainability.
Use only necessary imports and prefer direct module paths; remove unused imports promptly to keep warnings clean.
Treat a failure the world causes, such as a missing file, malformed input, a value that does not parse, or a timeout, as a Result the caller handles with ?. Treat a failure that means one of the program's own guarantees is false as a panic, because continuing would compute on state already known to be void. Reach for unwrap only in that second category: it is an assertion, not a fallback. At each fallible call, decide whether failure there means the world is wrong or the code is wrong, and route accordingly. Using unwrap because writing the error type is tedious claims a broken invariant while actually sitting in an unhandled error.
Route fallible builder APIs through Result and the error idiom the consumer of that API selects under Error idiom follows the consumer, returning that error type from the builder rather than panicking.
On any path reachable from input the process does not control, return a typed error the caller handles. The constructs that panic on failure are unwrap, expect, direct indexing and slicing, and arithmetic that can overflow; treat each as a defect on that path, because an input that reaches one is a remotely triggerable denial of service.
Where a panic is the correct outcome, write an expect whose message names the invariant the site rests on rather than the symptom, and leave bare unwrap behind. That message makes the claim reviewable: a reader can check the stated invariant, while a bare unwrap cannot distinguish a proven claim from a skipped error path.
Use anyhow for a failure an operator reads, such as startup, CLI, scaffolding, or configuration, so context chains stay the right shape for a human reading a log. Use a typed thiserror enum for a failure a caller must act on programmatically, choosing between a status code, a fallback, and a degraded result, so the caller matches a variant. Carry both idioms in one codebase as a deliberate split by consumer. Put severity classification in the error type so one class of failure stays fatal or a warning consistently across call sites, and let the public response follow the variant rather than the error's text: the type picks what a caller outside the process is told, while the Display string stays on the operator channel.
When recovering a concrete error class by downcasting a boxed error at several call sites, introduce a typed enum at that boundary, because a class no caller recognises falls through to the default arm silently. Prefer a thiserror derive over a hand-rolled Display and Error impl pair.
Treat a catch-panic layer as covering only the stack it wraps, and give every surface outside it its own containment. For spawned work, retain the join handle, or collect handles in a join set, and log the resulting join error, so a panicking background task fails loudly instead of quietly ceasing to do its job while the process keeps serving.
Deny clippy::unwrap_used while leaving clippy::expect_used allowed so every intentional panic must carry a message someone can check. Wire both as a [lints.clippy] table in Cargo.toml. They are allow-by-default restriction lints, so a -D warnings build alone passes over them and review would otherwise carry the rule. Opt test code out explicitly: #![cfg_attr(test, allow(clippy::unwrap_used))] at the crate root for unit tests, and #![allow(clippy::unwrap_used)] at the head of each integration-test file. That table applies to every target, so the opt-outs are what keep test helpers usable.
Keep a catch-panic layer either way: denying unwrap removes few panic sources, because out-of-bounds indexing, division by zero, debug-build overflow, a double RefCell borrow, stack exhaustion that cannot be caught at all, and every dependency all still panic. The lint stops that layer from being used as an error strategy; what it buys is no unexplained panics rather than fewer panics. Leave two related levers unused on purpose: clippy::indexing_slicing covers the indexing half of the trust-boundary rule and is noisy enough to fight an author daily, and for arithmetic prefer overflow-checks = true on the release profile over a lint because it turns a silent wrong number into a caught panic.
Use idiomatic Option helpers such as is_some_and to express predicates clearly and keep intent obvious.
Use strip_prefix or strip_suffix to handle fixed prefixes and suffixes for safe, readable string handling.
Return or pass references directly so lifetimes remain clear and borrow scopes stay minimal.
Use loop forms that match iterator intent and keep borrow scopes minimal, choosing the form that supports safe consumption.
Use push for single characters and push_str for multi-character segments to keep string construction clear.
Group related parameters into structs or configuration types to keep function signatures concise and maintainable.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub theafh/ai-modules --plugin ai_dev27 skills in this plugin
/agent_spinnerRun helper agents from an orchestrating agent under one quality contract, whatever the host offers. Establishes the capability tier, declares a phase plan, picks an orchestration shape and width, contains each helper to one path, checks work refute-by-default, and merges cited findings into one verdict-first report. Use when deciding how to run helper agents, sub-agents, or subagents: sizing a fan-out over files, spawning parallel helpers, splitting a review into lenses, running a judge or verifier pass, cross-checking agents' work, containing concurrent writers, aggregating helper reports, recovering failed helpers, or running a serial implement-then-audit loop until the task is stamped audited, in sub-agents. Use it for a multi-agent run plan. Route a backlog-only request to task_* and a wiki request to wiki_fix unless the user names agent_spinner or asks for helpers; those families keep their own contracts. Per-harness facts stay with harness_portability.
/ai_instruction_formattingOrganize AI-consumed content (prompts, rules, skills, commands, agents, system instructions) into pseudo-XML by wrapping each semantic concern in a dedicated tag for role, policy, inputs, and output contract. Use when structuring or reorganizing the body of a SKILL.md, agent or sub-agent definition, command file, rules document (.mdc), CLAUDE.md, AGENTS.md, or GEMINI.md configuration, prompt template, or system prompt into semantic tags, when choosing tag boundaries, or when checking whether an instruction file follows the pseudo-XML convention. This is the structure-and-tags skill; its sibling ai_instruction_writing governs the wording./ai_instruction_writingWrite AI-consumed content using positive, action-oriented language as the primary carrier of every instruction. Use when creating or editing any artifact an AI reads at inference time. Those artifacts include SKILL.md files, .mdc rule files, CLAUDE.md/AGENTS.md/GEMINI.md configuration, prompt templates, system prompts, commands, agent and sub-agent definitions, instruction sets, and persona definitions./format_markdownApply markdown linting compliance and best practices when creating or editing markdown files (.md, .mdc). Covers blank-line rules around block elements, consistent bullet style, fenced code blocks with language identifiers, table alignment syntax, header level progression, list indentation and spacing, and link/image conventions./format_pythonApply formatting standards, code quality rules, structure conventions, linting prevention, and best practices when generating or editing Python code (.py). Covers indentation, quoting, imports, naming, line length, type hints, error handling, logging, data structures, testing, and security practices aligned with common linters (flake8, ruff, pylint)./git_auto_reviewRun an automated review-and-fix loop over the checked-out branch's change since the default branch plus its working tree, and over the default branch's uncommitted changes: git_review is the only gate, a single writer agent fixes the findings that qualify, each round is verified refute-by-default and re-reviewed on its delta, the cumulative run change from round 2 on, and the loop stops under stated convergence rules. Use when the user asks to auto-review and fix uncommitted changes, auto-review and fix this branch, run the automated review loop, keep reviewing and fixing until the change is clean, loop review and fix over my branch against main, auto-fix what the review finds, or drive an automated review gate to a clean exit. Every fix stays uncommitted.Other plugins' skills for the same job