nix-darwin/config/claude/skills/rust-doc/SKILL.md
Rust documentation conventions (RFC 1574). Apply when writing doc comments on public Rust items. Covers summary sentences, section headings, type references, and examples.
npx skillsauth add nubiv/my-nome rustdocInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Apply these rules when writing doc comments (///) on public Rust items.
Every doc comment starts with a single-line summary sentence.
// DO: third person singular present indicative, ends with period
/// Returns the length of the string.
/// Creates a new instance with default settings.
/// Parses the input and returns the result.
// DON'T: imperative, missing period, or verbose
/// Return the length of the string
/// This function creates a new instance with default settings.
/// Use this to parse the input and get the result back.
Use line comments, not block comments.
// DO
/// Summary sentence here.
///
/// More details if needed.
// DON'T
/**
* Summary sentence here.
*
* More details if needed.
*/
Use //! only for crate-level and module-level docs at the top of the file.
Use these exact headings (always plural):
/// Summary sentence.
///
/// # Examples
///
/// # Panics
///
/// # Errors
///
/// # Safety
///
/// # Aborts
///
/// # Undefined Behavior
// DO
/// # Examples
// DON'T
/// # Example
/// ## Examples
/// **Examples:**
Use full generic forms and link with reference-style markdown.
// DO
/// Returns [`Option<T>`] if the value exists.
///
/// [`Option<T>`]: std::option::Option
// DON'T
/// Returns `Option` if the value exists.
/// Returns an optional value.
Every public item should have examples showing usage.
/// Adds two numbers together.
///
/// # Examples
///
/// ```
/// let result = my_crate::add(2, 3);
/// assert_eq!(result, 5);
/// ```
pub fn add(a: i32, b: i32) -> i32 {
a + b
}
For multiple patterns:
/// Parses a string into a number.
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// let n: i32 = my_crate::parse("42").unwrap();
/// assert_eq!(n, 42);
/// ```
///
/// Handling errors:
///
/// ```
/// let result = my_crate::parse::<i32>("not a number");
/// assert!(result.is_err());
/// ```
Document what errors can be returned and when.
/// Reads a file from disk.
///
/// # Errors
///
/// Returns [`io::Error`] if the file does not exist or cannot be read.
///
/// [`io::Error`]: std::io::Error
Document conditions that cause panics.
/// Divides two numbers.
///
/// # Panics
///
/// Panics if `divisor` is zero.
pub fn divide(dividend: i32, divisor: i32) -> i32 {
assert!(divisor != 0, "divisor must not be zero");
dividend / divisor
}
Required for unsafe functions.
/// Dereferences a raw pointer.
///
/// # Safety
///
/// The pointer must be non-null and properly aligned.
/// The pointed-to memory must be valid for the lifetime `'a`.
pub unsafe fn deref<'a, T>(ptr: *const T) -> &'a T {
&*ptr
}
//!): high-level summaries, when to use this module///): comprehensive, self-containedSome duplication is acceptable.
Use American English spelling: "color" not "colour", "serialize" not "serialise".
development
Manage devlogs (session journal entries) under the active repo's `.claude/devlogs/`. Subcommands - `write` creates a new date-stamped entry, `read` loads existing entries into context. Use when the user invokes `/devlog <subcommand>` or asks to write, save, recall, or load today's/recent devlogs.
development
Run MY_WIKI operations (ingest, query, research, lint). Use when the user wants to add sources to the wiki, ask questions against it, research new topics from the web, or audit its quality.
testing
Create and edit Obsidian Flavored Markdown with wikilinks, embeds, callouts, properties, and other Obsidian-specific syntax. Use when working with .md files in Obsidian, or when the user mentions wikilinks, callouts, frontmatter, tags, embeds, or Obsidian notes.
tools
Interact with Obsidian vaults using the Obsidian CLI to read, create, search, and manage notes, tasks, properties, and more. Also supports plugin and theme development with commands to reload plugins, run JavaScript, capture errors, take screenshots, and inspect the DOM. Use when the user asks to interact with their Obsidian vault, manage notes, search vault content, perform vault operations from the command line, or develop and debug Obsidian plugins and themes.