US

use-facet-crates

Maps serde crates to facet equivalents and establishes criteria for choosing between facet and serde in Rust projects.

Install

mkdir -p .claude/skills/use-facet-crates && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/3335" && unzip -o skill.zip -d .claude/skills/use-facet-crates && rm skill.zip

Installs to .claude/skills/use-facet-crates

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Guidelines for using facet crates (facet-json, facet-toml, figue) instead of serde-based alternatives for consistent dogfooding
127 charsno explicit “when” trigger
Intermediate

Key capabilities

  • Replace Serde-based serialization with Facet-based traits
  • Migrate JSON and TOML handling to facet-json/facet-toml
  • Replace clap-based CLI parsing with figue
  • Implement Facet derive macros for data structures

How it works

It maps existing Serde dependencies to their Facet counterparts and replaces derive macros with those specific to the Facet ecosystem.

Inputs & outputs

You give it
Code referencing Serde crates
You get back
Code refactored to use Facet equivalents

When to use use-facet-crates

  • Replacing serde with facet-json
  • Migrating serde_toml to facet-toml
  • Setting up CLI args with figue
  • Updating derive macros to Facet

About this skill

Use Facet Crates Instead of Serde Ecosystem

When writing code in this workspace, prefer facet-based crates over serde-based ones. This project is building facet as a replacement for serde, so we should dogfood our own libraries.

Crate Replacements

Instead ofUseNotes
serdefacetCore derive and traits
serde_jsonfacet-jsonJSON serialization/deserialization
tomlfacet-tomlTOML parsing
serde_yamlfacet-yamlYAML support
clapfigueCLI argument parsing (separate repo)
serde_derivefacet (derive)#[derive(Facet)] replaces Serialize/Deserialize

When to Use Which

Use facet-json for:

  • New code in this workspace
  • Internal tools (like benchmark-analyzer)
  • Anything that doesn't need serde compatibility

serde_json is acceptable for:

  • Interop with external crates that require serde
  • Benchmarks comparing facet vs serde performance
  • Code that specifically tests serde compatibility

Quick Example

// OLD (serde)
use serde::{Serialize, Deserialize};
use serde_json;

#[derive(Serialize, Deserialize)]
struct Config {
    name: String,
}

let config: Config = serde_json::from_str(json)?;

// NEW (facet)
use facet::Facet;
use facet_json as json;

#[derive(Facet)]
struct Config {
    name: String,
}

let config: Config = json::from_str(json)?;

Checking Dependencies

When adding new dependencies or reviewing code, check Cargo.toml for serde ecosystem crates and consider if facet alternatives exist.

TODO for This Workspace

The benchmark-analyzer currently uses serde_json for JSON serialization in chart data. This should be migrated to facet-json for consistency (eating our own dogfood).

Location: tools/benchmark-analyzer/src/report.rs - uses serde_json::to_string() for chart labels/data.

When not to use it

  • When interoperability with existing crates that require Serde is mandatory
  • When testing for Serde compatibility

Prerequisites

Rust toolchainAccess to workspace dependencies

Limitations

  • Only applicable within workspaces using the Facet ecosystem
  • Limited community support compared to the Serde ecosystem

How it compares

It provides a framework for migrating to internal workspace crates rather than relying on standard public-facing libraries.

Compared to similar skills

use-facet-crates side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
use-facet-crates (this skill)16moNo flagsIntermediate
implementing-cards72moReviewAdvanced
write-rust-tests95moNo flagsIntermediate
rust-errors51moNo flagsAdvanced

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

implementing-cards

bcollazo

Fill out the implementation of effects of different attacks, abilities, and trainer cards in this Pokemon TCG Pocket engine codebase.

790

write-rust-tests

RediSearch

Write Rust tests to verify correctness of Rust code.

922

rust-errors

EpicenterHQ

Rust to TypeScript error handling patterns for Tauri apps. Use when defining Rust errors that will be passed to TypeScript, handling Tauri command errors, or creating discriminated union error types.

521

write-script-rust

windmill-labs

MUST use when writing Rust scripts.

415

rust-pro

vudovn

Master Rust 1.75+ with modern async patterns, advanced type system features, and production-ready systems programming. Expert in the latest Rust ecosystem including Tokio, axum, and cutting-edge crates. Use PROACTIVELY for Rust development, performance optimization, or systems programming.

39

rust-router

actionbook

CRITICAL: Use for ALL Rust questions including errors, design, and coding. HIGHEST PRIORITY for: 比较, 对比, compare, vs, versus, 区别, difference, 最佳实践, best practice, tokio vs, async-std vs, 比较 tokio, 比较 async, Triggers on: Rust, cargo, rustc, crate, Cargo.toml, 意图分析, 问题分析, 语义分析, analyze intent, question analysis, compile error, borrow error, lifetime error, ownership error, type error, trait error, value moved, cannot borrow, does not live long enough, mismatched types, not satisfied, E0382, E0597, E0277, E0308, E0499, E0502, E0596, async, await, Send, Sync, tokio, concurrency, error handling, 编译错误, compile error, 所有权, ownership, 借用, borrow, 生命周期, lifetime, 类型错误, type error, 异步, async, 并发, concurrency, 错误处理, error handling, 问题, problem, question, 怎么用, how to use, 如何, how to, 为什么, why, 什么是, what is, 帮我写, help me write, 实现, implement, 解释, explain

36

Search skills

Search the agent skills registry