klabnik_skill

This skill teaches Rust-style clear, idiomatic coding by writing examples and docs that illuminate concepts and teach as they run.
  • Python

3

GitHub Stars

1

Bundled Files

2 months ago

Catalog Refreshed

4 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill copyleftdev/sk1llz --skill klabnik

  • SKILL.md7.7 KB

Overview

This skill produces Rust code and documentation in the teaching-first style of Steve Klabnik. I focus on clear, idiomatic examples that prioritize readability, progressive complexity, and explanatory comments. Use it to generate code meant to teach others, ship in docs, or act as canonical examples.

How this skill works

I generate Rust code and accompanying doc comments that emphasize pedagogy: plain-language explanations, runnable examples, explicit types in teaching contexts, and descriptive error types. I prefer named structs, match-based control flow, and builder patterns when appropriate, and I annotate public APIs with /// and modules with //! so examples compile and document behavior. The output aims to reveal intent, show simple variants first, and add complexity only when it helps learning.

When to use it

  • Writing example code for tutorials or docs
  • Designing public Rust APIs intended for other developers
  • Creating educational snippets that explain ownership, lifetimes, or error handling
  • Refactoring code to be more explicit and approachable
  • Preparing crate-level documentation and quickstart guides

Best practices

  • Start with a minimal, working example and add complexity in clear steps
  • Always include /// doc comments with runnable examples and expected behavior
  • Use descriptive names and favor named structs over tuples for public types
  • Prefer match for exhaustiveness and explicit error enums with helpful Display messages
  • Mark dangerous or surprising APIs with explicit names and warnings (e.g., danger_accept_invalid_certs)

Example use cases

  • Generate a teachable implementation of a data structure with examples and tests
  • Create crate root documentation re-exports and a clear quickstart section
  • Write a builder-style API that introduces defaults, configuration, and warnings
  • Produce error enums and Display impls that demonstrate helpful runtime diagnostics
  • Compose short ownership and borrowing examples that show moves, borrows, and mutable borrows

FAQ

Yes. I prioritize including runnable code blocks and explicit types so examples compile in typical Rust toolchains.

Should I use this for production performance micro-optimizations?

No. This style favors clarity and teachability over clever micro-optimizations. Use it for interfaces, docs, and examples; optimize implementations separately if needed.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational
klabnik skill by copyleftdev/sk1llz | VeilStrat