
use-facet-crates
by facet-rs
use-facet-cratesは、ソフトウェア開発を効率化するスキルです。開発ワークフロー全体をサポートし、チームの生産性向上とコード品質の改善を実現します。
ユースケース
デバッグ支援
バグの特定と修正を効率的にサポート。use-facet-cratesを活用。
コード生成の効率化
ボイラープレートコードを自動生成し、開発時間を短縮。
コードレビュー支援
PRのコード変更を分析し、改善点を提案。
SKILL.md
name: use-facet-crates description: Guidelines for using facet crates (facet-json, facet-toml, facet-args) instead of serde-based alternatives for consistent dogfooding
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 | facet-args | CLI argument parsing |
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 serde_json::to_string() for chart labels/data.
スコア
総合スコア
リポジトリの品質指標に基づく評価
SKILL.mdファイルが含まれている
ライセンスが設定されている
100文字以上の説明がある
GitHub Stars 1000以上
1ヶ月以内に更新
10回以上フォークされている
オープンIssueが50未満
プログラミング言語が設定されている
1つ以上のタグが設定されている
レビュー
レビュー機能は近日公開予定です
