/dd:rust:serdefrom dd:rust
Provides rules and patterns for Rust serde serialization: derive macros, snake_case defaults, enum representations, attribute usage, optional fields, and zero-copy deserialization. Useful when adding Serialize/Deserialize derives or configuring JSON/YAML/TOML serialization.
Ships in dd:rust. 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.
Read when SKILL.md points to them.
Always add #[serde(rename_all = "snake_case")] on every struct and enum — this is the project default. Only omit when matching an external API schema that requires a different casing.
#[derive(Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub struct UserProfile {
pub user_name: String,
pub created_at: DateTime<Utc>,
}
Serialize and Deserialize unless the type is write-only or read-only#[serde(...)] attributes directly below the derive — keep them visible#[serde(deny_unknown_fields)] on config types to catch typos early#[serde(default)] on the struct for backwards-compatible deserialization#[serde(skip)] — exclude field from both serialization and deserialization#[serde(skip_serializing_if = "Option::is_none")] — omit None fields from output#[serde(default)] on a field — use Default::default() if missing in input#[serde(flatten)] — inline nested struct fields into the parent#[serde(rename = "type")] — rename a single field (useful for reserved keywords)#[serde(with = "module")] — custom serialize/deserialize via a module with serialize/deserialize fns#[derive(Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub struct Config {
pub name: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(default)]
pub retries: u32,
}
default + skip_serializing_if for clean round-tripping of optional fieldsVec<T>: #[serde(default, skip_serializing_if = "Vec::is_empty")]#[serde(rename_all = "snake_case")] on enums too — variants serialize as snake_case strings#[serde(tag = "type")]) for most APIs — readable and explicituntagged sparingly — error messages are poor when deserialization failsreferences/enum-representations.mdserde_json::from_str::<T>(s) / serde_json::from_reader(r)serde_json::to_string(&val) / serde_json::to_string_pretty(&val)serde_json::Value for unknown schemas — access with value["key"]Value whenever the schema is knownOnly worth it for large payloads or hot paths — see references/zero-copy.md for #[serde(borrow)] patterns and their lifetime trade-offs.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub napalmpapalam/skills --plugin rust6 skills in this plugin
/coreThe Rust conventions that apply to almost every edit — type design, error handling, ownership, async/tokio, module layout, comments and doc comments, code style, and naming. Use whenever writing, changing, or reviewing Rust code, designing types or error enums, dealing with borrows and lifetimes, writing async/tokio code, organizing modules or workspaces, choosing visibility, writing or shortening comments, doc comments, and module headers, refactoring functions to be shorter or flatter, naming anything, or when the user asks about idiomatic Rust. This is the default Rust skill — load it first; reach for serde, testing, linting, or performance on top of it when the task calls for them./lintingRust workspace lint configuration, clippy enforcement, and formatting rules. Use whenever setting up or modifying Cargo.toml lint configuration, configuring clippy or rustfmt, adding CI checks for Rust, or when the user asks about lint rules, formatting settings, or workspace-level lint inheritance./performanceRust performance — iterators, release profiles, inlining, cache layout, bounds checks, allocation profiling. Use whenever optimizing Rust code, choosing between iterators and loops, configuring release profiles, adding inline hints, profiling allocations, or when the user asks about performance patterns, benchmarking, or hot-path optimization in Rust./reviewComprehensive Rust code review — runs cargo checks, loads all Rust convention skills, reviews changes, and generates a structured report. Use when reviewing finished Rust changes, closing a slice that touched Rust, preparing a PR for merge, or auditing Rust code quality — not while writing the code./testingRust testing — unit/integration layout, mocking with mockall, async test patterns, property testing, snapshot testing. Use whenever writing or reviewing Rust tests, setting up test infrastructure, choosing mocking strategies, organizing test modules, debugging test failures, or when the user asks about testing patterns, coverage, or test utilities in Rust projects.