use-facet-crates
Guidelines for using facet crates (facet-json, facet-toml, facet-args) instead of serde-based alternatives for consistent dogfooding
Security Assessment
About use-facet-crates
The 'use-facet-crates' skill provides guidelines for using facet-based crates (facet-json, facet-toml, facet-args) as replacements for the traditional serde-based crates in Rust projects. This skill is designed to ensure consistency within projects that aim to build and adopt the facet ecosystem instead of using the more commonly known serde library. By promoting the use of facet crates, it encourages developers to dogfood their own libraries, ultimately fostering the growth and stability of facet as a core serialization and deserialization tool.
FAQ
What are facet crates?
Facet crates are a set of libraries built as alternatives to the widely used serde ecosystem, such as facet-json for JSON handling, facet-toml for TOML parsing, and facet-args for CLI argument parsing.
When should I use facet-json instead of serde_json?
You should use facet-json for new code in the workspace, internal tools, or any code that doesn't require compatibility with serde. It's a good option when you want to stick to facet-based serialization and deserialization.
Can I still use serde_json if I need compatibility with other crates?
Yes, you can continue to use serde_json when interoping with external crates that rely on serde or for benchmarking the performance differences between facet and serde.
Are there any specific workspace migration tasks?
Yes, one task is migrating the benchmark-analyzer to use facet-json instead of serde_json for consistency. This is mentioned in the TODO section of the workspace.
How do I know if a crate should be replaced with a facet alternative?
When reviewing dependencies in Cargo.toml, check if the crate belongs to the serde ecosystem. If so, consider replacing it with a facet alternative unless compatibility with other crates is a requirement.
Install use-facet-crates
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
facet-rs/facet