> Sourced from [yaml/yaml-serde](https://github.com/yaml/yaml-serde) โ [Apache-2.0](https://github.com/yaml/yaml-serde/blob/a25959abfac3fa58e8b82b738faabdcec5e50568/CLAUDE.md). # CLAUDE.md This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. ## Project Overview `yaml-serde` is the officially maintained fork of `serde_yaml`, bridging Rust's Serde serialization framework with YAML. It is published under the YAML organization and uses `libyaml-rs` for low-level YAML parsing and emission. ## Common Commands All commands use the Makes system (dependencies installed under `.cache/`). ```bash make shell cmd='cargo build' make shell cmd='cargo test' make shell cmd='cargo test test_name' # Run a single test make shell cmd='cargo clippy --tests -- -Dclippy::all -Dclippy::pedantic' make shell cmd='cargo doc' ``` Clippy is run with pedantic lints enabled and `-Dwarnings` is implicit in CI. Fix all Clippy warnings before committing. ## Architecture The library has two main layers: **High-level API (`lib.rs`):** Exports `from_str`, `from_slice`, `from_reader`, `to_string`, `to_writer`, and Value-based conversions (`from_value`, `to_value`). **Core modules:** - `de.rs` โ Serde `Deserializer` impl; drives `loader.rs` to consume YAML events and feeds them into Serde visitors. Handles anchors/aliases, enum tags (`!TagName`), and multi-document YAML. - `ser.rs` โ Serde `Serializer` impl; uses `libyaml/emitter.rs` to write YAML. Determines scalar style (plain, quoted, literal) based on content. - `loader.rs` โ Wraps the libyaml parser into a `Document` (event list + alias map); called by `de.rs`. - `value/` โ The loosely-typed `Value` enum (`Null`, `Bool`, `Number`, `String`, `Sequence`, `Mapping`, `Tagged`) with its own Serialize/Deserialize impls in `value/ser.rs` and `value/de.rs`. - `mapping.rs` โ `Mapping` type backed by `IndexMap<Value, Value>` (preserves insertion order). - `number.rs` โ `Number` with internal `PosInt(u64)`, `NegInt(i64)`, `Float(f64)` variants. - `libyaml/` โ Thin safe wrappers around `libyaml-rs` FFI: `parser.rs`, `emitter.rs`, `tag.rs`, `error.rs`. - `error.rs` โ `Error` type with `Location` (line/column/index). - `with.rs` โ Helpers for `#[serde(with = "...")]` attributes. **Data flow (deserialization):** ``` input bytes/str/reader โ loader::Loader (libyaml parser) โ loader::Document (event list) โ de::Deserializer (Serde visitor dispatch) โ user's Rust type ``` **Data flow (serialization):** ``` user's Rust type โ ser::Serializer (Serde serializer) โ libyaml::emitter::Emitter โ YAML bytes/string ``` ## Key Dependencies - `serde` โ serialization framework - `libyaml-rs` โ C YAML parser/emitter, safe wrapper - `indexmap` โ ordered map for `Mapping` ## Tests Tests live in `tests/`: - `test_de.rs` โ deserialization edge cases - `test_ser.rs` / `test_serde.rs` โ serialization and round-trip - `test_error.rs` โ error messages and locations - `test_value.rs` โ Value API Fuzz targets are in `fuzz/`. CI also runs Miri (with `-Zmiri-strict-provenance`) and minimal dependency versions.
Add to your project
Paste into your project's CLAUDE.md or ~/.claude/CLAUDE.md for global rules.
More for Rust
Graphgrc CLAUDE.md
by @engseclabs
Build security program documentation using Git and Markdown
Polyphony CLAUDE.md
by @penso
Repo-native AI orchestration engine โ connects issue trackers (GitHub, GitLab, Linear, webhooks) to coding agents (Claude, Codex, Copilot, Pi) with isolated wor
Bitsandbytes CLAUDE.md
by @bitsandbytes-foundation
Accessible large language models via k-bit quantization for PyTorch.
Dotfiles CLAUDE.md
by @phatblat
CLAUDE.md for the Dotfiles project (Shell).
N8n Install CLAUDE.md
by @kossakovsky
๐ Self-hosted AI automation platform. Deploy n8n, Ollama, Flowise, RAG, Supabase & 30+ tools with one command. Auto HTTPS. Free Zapier/Make alternative.
Cc Plugin Catalog CLAUDE.md
by @giginet
Static site generator for Claude Code Plugin Marketplace repositories
MCP servers for Rust
mediar-ai/screenpipe
๐๏ธ ๐ฆ ๐ ๐ Local-first system capturing screen/audio with timestamped indexing, SQL/embedding storage, semantic search, LLM-powered history analysis, and event-triggered actions - enables building c
Rust MCP SDK
The official Rust SDK for the Model Context Protocol
devflowinc/trieve
๐๏ธ ๐ โ๏ธ ๐ - Crawl, embed, chunk, search, and retrieve information from datasets through
Browse by Tag
Get the Claude Code Starter Pack
Top CLAUDE.md rules for Next.js, TypeScript, Python, Go, and React โ free.
