smithery/facet-rs

use-facet-crates

Guidelines for using facet crates (facet-json, facet-toml, figue) instead of serde-based alternatives for consistent dogfooding

Installation

$ npx skills add smithery/facet-rs --skill use-facet-crates

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from smithery/facet-rs.

npx skills add smithery/facet-rs

Browse all from smithery/facet-rs

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 2,329 B
  • docs SUMMARY.md 151 B

History

  1. First recorded snapshot · 0 installs

SKILL.md

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 of Use Notes
serde facet Core derive and traits
serde_json facet-json JSON serialization/deserialization
toml facet-toml TOML parsing
serde_yaml facet-yaml YAML support
clap figue CLI argument parsing (separate repo)
serde_derive facet (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 serdejson::tostring() for chart labels/data.