[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6GH102ECR87RQT61AT6KV2J":3,"skill-same:01M6GH102ECR87RQT61AT6KV2J":119},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":48,"linkOnly":49,"markdownContent":50,"markdownBody":51,"frontMatter":52,"refName":59,"commitSha":60,"skillDirectory":61,"forksCount":14,"repositoryHtmlUrl":62,"repositoryHomepageUrl":6,"ownerHtmlUrl":63,"ownerBlogUrl":64,"ownerDescription":65,"updatedAt":66,"install":67,"resources":80},"01M6GH102ECR87RQT61AT6KV2J","rust-best-practices",null,"Guide for writing idiomatic Rust code based on Apollo GraphQL's best practices handbook. Use this skill when: (1) writing new Rust code or functions, (2) reviewing or refactoring existing Rust code, (3) deciding between borrowing vs cloning or ownership patterns, (4) implementing error handling with Result types, (5) optimizing Rust code for performance, (6) writing tests or documentation for Rust projects.","nibzard\u002Fskillctl","nibzard","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F6250945?v=4","01M6GH0XM2J5JXZE2W9CC3WNK2","Nikola Balic","01M6GH0XR91D1HE73ANBD0X6ES",0,"MIT","https:\u002F\u002Fgithub.com\u002Fnibzard\u002Fskillctl\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Frust-best-practices\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47],"rust","rust best practices","best practices","write","new","apollo graphql","when","result","implementing","with","types","error","cargo","tests","apollo","functions","cloning","use","writing","read","projects","refactoring","Bash","GraphQL","error handling","writing tests","code","documentation","performance","2026-11-10 10:12:30",false,"---\nname: rust-best-practices\ndescription: >\n  Guide for writing idiomatic Rust code based on Apollo GraphQL's best practices handbook. Use this skill when:\n  (1) writing new Rust code or functions,\n  (2) reviewing or refactoring existing Rust code,\n  (3) deciding between borrowing vs cloning or ownership patterns,\n  (4) implementing error handling with Result types,\n  (5) optimizing Rust code for performance,\n  (6) writing tests or documentation for Rust projects.\nlicense: MIT\ncompatibility: Rust 1.70+, Cargo\nmetadata:\n  author: apollographql\n  version: \"1.1.0\"\nallowed-tools: Bash(cargo:*) Bash(rustc:*) Bash(rustfmt:*) Bash(clippy:*) Read Write Edit Glob Grep\n---\n\n# Rust Best Practices\n\nApply these guidelines when writing or reviewing Rust code. Based on Apollo GraphQL's [Rust Best Practices Handbook](https:\u002F\u002Fgithub.com\u002Fapollographql\u002Frust-best-practices).\n\n## Best Practices Reference\n\nBefore reviewing, familiarize yourself with Apollo's Rust best practices. Read ALL relevant chapters in the same turn in parallel. Reference these files when providing feedback:\n\n- [Chapter 1 - Coding Styles and Idioms](references\u002Fchapter_01.md): Borrowing vs cloning, Copy trait, Option\u002FResult handling, iterators, comments\n- [Chapter 2 - Clippy and Linting](references\u002Fchapter_02.md): Clippy configuration, important lints, workspace lint setup\n- [Chapter 3 - Performance Mindset](references\u002Fchapter_03.md): Profiling, avoiding redundant clones, stack vs heap, zero-cost abstractions\n- [Chapter 4 - Error Handling](references\u002Fchapter_04.md): Result vs panic, thiserror vs anyhow, error hierarchies\n- [Chapter 5 - Automated Testing](references\u002Fchapter_05.md): Test naming, one assertion per test, snapshot testing\n- [Chapter 6 - Generics and Dispatch](references\u002Fchapter_06.md): Static vs dynamic dispatch, trait objects\n- [Chapter 7 - Type State Pattern](references\u002Fchapter_07.md): Compile-time state safety, when to use it\n- [Chapter 8 - Comments vs Documentation](references\u002Fchapter_08.md): When to comment, doc comments, rustdoc\n- [Chapter 9 - Understanding Pointers](references\u002Fchapter_09.md): Thread safety, Send\u002FSync, pointer types\n\n## Quick Reference\n\n### Borrowing & Ownership\n- Prefer `&T` over `.clone()` unless ownership transfer is required\n- Use `&str` over `String`, `&[T]` over `Vec\u003CT>` in function parameters\n- Small `Copy` types (≤24 bytes) can be passed by value\n- Use `Cow\u003C'_, T>` when ownership is ambiguous\n\n### Error Handling\n- Return `Result\u003CT, E>` for fallible operations; avoid `panic!` in production\n- Never use `unwrap()`\u002F`expect()` outside tests\n- Use `thiserror` for library errors, `anyhow` for binaries only\n- Prefer `?` operator over match chains for error propagation\n\n### Performance\n- Always benchmark with `--release` flag\n- Run `cargo clippy -- -D clippy::perf` for performance hints\n- Avoid cloning in loops; use `.iter()` instead of `.into_iter()` for Copy types\n- Prefer iterators over manual loops; avoid intermediate `.collect()` calls\n\n### Linting\nRun regularly: `cargo clippy --all-targets --all-features --locked -- -D warnings`\n\nKey lints to watch:\n- `redundant_clone` - unnecessary cloning\n- `large_enum_variant` - oversized variants (consider boxing)\n- `needless_collect` - premature collection\n\nUse `#[expect(clippy::lint)]` over `#[allow(...)]` with justification comment.\n\n### Testing\n- Name tests descriptively: `process_should_return_error_when_input_empty()`\n- One assertion per test when possible\n- Use doc tests (`\u002F\u002F\u002F`) for public API examples\n- Consider `cargo insta` for snapshot testing generated output\n\n### Generics & Dispatch\n- Prefer generics (static dispatch) for performance-critical code\n- Use `dyn Trait` only when heterogeneous collections are needed\n- Box at API boundaries, not internally\n\n### Type State Pattern\nEncode valid states in the type system to catch invalid operations at compile time:\n```rust\nstruct Connection\u003CState> { \u002F* ... *\u002F _state: PhantomData\u003CState> }\nstruct Disconnected;\nstruct Connected;\n\nimpl Connection\u003CConnected> {\n    fn send(&self, data: &[u8]) { \u002F* only connected can send *\u002F }\n}\n```\n\n### Documentation\n- `\u002F\u002F` comments explain *why* (safety, workarounds, design rationale)\n- `\u002F\u002F\u002F` doc comments explain *what* and *how* for public APIs\n- Every `TODO` needs a linked issue: `\u002F\u002F TODO(#42): ...`\n- Enable `#![deny(missing_docs)]` for libraries\n","# Rust Best Practices\n\nApply these guidelines when writing or reviewing Rust code. Based on Apollo GraphQL's [Rust Best Practices Handbook](https:\u002F\u002Fgithub.com\u002Fapollographql\u002Frust-best-practices).\n\n## Best Practices Reference\n\nBefore reviewing, familiarize yourself with Apollo's Rust best practices. Read ALL relevant chapters in the same turn in parallel. Reference these files when providing feedback:\n\n- [Chapter 1 - Coding Styles and Idioms](references\u002Fchapter_01.md): Borrowing vs cloning, Copy trait, Option\u002FResult handling, iterators, comments\n- [Chapter 2 - Clippy and Linting](references\u002Fchapter_02.md): Clippy configuration, important lints, workspace lint setup\n- [Chapter 3 - Performance Mindset](references\u002Fchapter_03.md): Profiling, avoiding redundant clones, stack vs heap, zero-cost abstractions\n- [Chapter 4 - Error Handling](references\u002Fchapter_04.md): Result vs panic, thiserror vs anyhow, error hierarchies\n- [Chapter 5 - Automated Testing](references\u002Fchapter_05.md): Test naming, one assertion per test, snapshot testing\n- [Chapter 6 - Generics and Dispatch](references\u002Fchapter_06.md): Static vs dynamic dispatch, trait objects\n- [Chapter 7 - Type State Pattern](references\u002Fchapter_07.md): Compile-time state safety, when to use it\n- [Chapter 8 - Comments vs Documentation](references\u002Fchapter_08.md): When to comment, doc comments, rustdoc\n- [Chapter 9 - Understanding Pointers](references\u002Fchapter_09.md): Thread safety, Send\u002FSync, pointer types\n\n## Quick Reference\n\n### Borrowing & Ownership\n- Prefer `&T` over `.clone()` unless ownership transfer is required\n- Use `&str` over `String`, `&[T]` over `Vec\u003CT>` in function parameters\n- Small `Copy` types (≤24 bytes) can be passed by value\n- Use `Cow\u003C'_, T>` when ownership is ambiguous\n\n### Error Handling\n- Return `Result\u003CT, E>` for fallible operations; avoid `panic!` in production\n- Never use `unwrap()`\u002F`expect()` outside tests\n- Use `thiserror` for library errors, `anyhow` for binaries only\n- Prefer `?` operator over match chains for error propagation\n\n### Performance\n- Always benchmark with `--release` flag\n- Run `cargo clippy -- -D clippy::perf` for performance hints\n- Avoid cloning in loops; use `.iter()` instead of `.into_iter()` for Copy types\n- Prefer iterators over manual loops; avoid intermediate `.collect()` calls\n\n### Linting\nRun regularly: `cargo clippy --all-targets --all-features --locked -- -D warnings`\n\nKey lints to watch:\n- `redundant_clone` - unnecessary cloning\n- `large_enum_variant` - oversized variants (consider boxing)\n- `needless_collect` - premature collection\n\nUse `#[expect(clippy::lint)]` over `#[allow(...)]` with justification comment.\n\n### Testing\n- Name tests descriptively: `process_should_return_error_when_input_empty()`\n- One assertion per test when possible\n- Use doc tests (`\u002F\u002F\u002F`) for public API examples\n- Consider `cargo insta` for snapshot testing generated output\n\n### Generics & Dispatch\n- Prefer generics (static dispatch) for performance-critical code\n- Use `dyn Trait` only when heterogeneous collections are needed\n- Box at API boundaries, not internally\n\n### Type State Pattern\nEncode valid states in the type system to catch invalid operations at compile time:\n```rust\nstruct Connection\u003CState> { \u002F* ... *\u002F _state: PhantomData\u003CState> }\nstruct Disconnected;\nstruct Connected;\n\nimpl Connection\u003CConnected> {\n    fn send(&self, data: &[u8]) { \u002F* only connected can send *\u002F }\n}\n```\n\n### Documentation\n- `\u002F\u002F` comments explain *why* (safety, workarounds, design rationale)\n- `\u002F\u002F\u002F` doc comments explain *what* and *how* for public APIs\n- Every `TODO` needs a linked issue: `\u002F\u002F TODO(#42): ...`\n- Enable `#![deny(missing_docs)]` for libraries\n",{"name":5,"license":15,"metadata":53,"description":56,"allowed-tools":57,"compatibility":58},{"author":54,"version":55},"apollographql","1.1.0","Guide for writing idiomatic Rust code based on Apollo GraphQL's best practices handbook. Use this skill when: (1) writing new Rust code or functions, (2) reviewing or refactoring existing Rust code, (3) deciding between borrowing vs cloning or ownership patterns, (4) implementing error handling with Result types, (5) optimizing Rust code for performance, (6) writing tests or documentation for Rust projects.\n","Bash(cargo:*) Bash(rustc:*) Bash(rustfmt:*) Bash(clippy:*) Read Write Edit Glob Grep","Rust 1.70+, Cargo","main","81233dc98bac3c5d144bae0838669291da8e7f0b",".agents\u002Fskills\u002Frust-best-practices","https:\u002F\u002Fgithub.com\u002Fnibzard\u002Fskillctl","https:\u002F\u002Fgithub.com\u002Fnibzard","https:\u002F\u002Fnibzard.com","experiments with AI agents — learnings https:\u002F\u002Fnibzard.com\u002F","2026-11-10 06:48:05",{"source":8,"skillName":5,"commands":68,"prompt":78,"zipAvailable":79},[69,72,75],{"tool":70,"command":71},"npx","npx skills add nibzard\u002Fskillctl --skill rust-best-practices",{"tool":73,"command":74},"bunx","bunx skills add nibzard\u002Fskillctl --skill rust-best-practices",{"tool":76,"command":77},"pnpm","pnpm dlx skills add nibzard\u002Fskillctl --skill rust-best-practices","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fnibzard\u002Fskillctl\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Frust-best-practices\u002FSKILL.md",true,[81,87,91,95,99,103,107,111,115],{"path":82,"resourceType":83,"resourceTypeDesc":84,"sizeBytes":85,"sourceHtmlUrl":86},"references\u002Fchapter_01.md","REFERENCE","参考文档",17339,"https:\u002F\u002Fgithub.com\u002Fnibzard\u002Fskillctl\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Frust-best-practices\u002Freferences\u002Fchapter_01.md",{"path":88,"resourceType":83,"resourceTypeDesc":84,"sizeBytes":89,"sourceHtmlUrl":90},"references\u002Fchapter_02.md",5453,"https:\u002F\u002Fgithub.com\u002Fnibzard\u002Fskillctl\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Frust-best-practices\u002Freferences\u002Fchapter_02.md",{"path":92,"resourceType":83,"resourceTypeDesc":84,"sizeBytes":93,"sourceHtmlUrl":94},"references\u002Fchapter_03.md",8785,"https:\u002F\u002Fgithub.com\u002Fnibzard\u002Fskillctl\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Frust-best-practices\u002Freferences\u002Fchapter_03.md",{"path":96,"resourceType":83,"resourceTypeDesc":84,"sizeBytes":97,"sourceHtmlUrl":98},"references\u002Fchapter_04.md",7082,"https:\u002F\u002Fgithub.com\u002Fnibzard\u002Fskillctl\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Frust-best-practices\u002Freferences\u002Fchapter_04.md",{"path":100,"resourceType":83,"resourceTypeDesc":84,"sizeBytes":101,"sourceHtmlUrl":102},"references\u002Fchapter_05.md",14122,"https:\u002F\u002Fgithub.com\u002Fnibzard\u002Fskillctl\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Frust-best-practices\u002Freferences\u002Fchapter_05.md",{"path":104,"resourceType":83,"resourceTypeDesc":84,"sizeBytes":105,"sourceHtmlUrl":106},"references\u002Fchapter_06.md",6813,"https:\u002F\u002Fgithub.com\u002Fnibzard\u002Fskillctl\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Frust-best-practices\u002Freferences\u002Fchapter_06.md",{"path":108,"resourceType":83,"resourceTypeDesc":84,"sizeBytes":109,"sourceHtmlUrl":110},"references\u002Fchapter_07.md",8236,"https:\u002F\u002Fgithub.com\u002Fnibzard\u002Fskillctl\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Frust-best-practices\u002Freferences\u002Fchapter_07.md",{"path":112,"resourceType":83,"resourceTypeDesc":84,"sizeBytes":113,"sourceHtmlUrl":114},"references\u002Fchapter_08.md",10132,"https:\u002F\u002Fgithub.com\u002Fnibzard\u002Fskillctl\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Frust-best-practices\u002Freferences\u002Fchapter_08.md",{"path":116,"resourceType":83,"resourceTypeDesc":84,"sizeBytes":117,"sourceHtmlUrl":118},"references\u002Fchapter_09.md",9570,"https:\u002F\u002Fgithub.com\u002Fnibzard\u002Fskillctl\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Frust-best-practices\u002Freferences\u002Fchapter_09.md",[120,132,145,151,158,169],{"skillNo":121,"name":122,"nameZh":6,"description":123,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":124,"licenseFileUrl":6,"sourceHtmlUrl":125,"categories":126,"keywords":127,"publishedAt":48},"01M70V8WZ0B1RJMY2GQ3C8BVZF","fixture-skill","Deterministic bundle fixture.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fnibzard\u002Fskillctl\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fbundle\u002Fcanonical\u002FSKILL.md",[],[128,129,130,131],"fixture","fixture skill","bundle","deterministic",{"skillNo":133,"name":134,"nameZh":6,"description":135,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":124,"licenseFileUrl":6,"sourceHtmlUrl":136,"categories":137,"keywords":138,"publishedAt":48},"01M6GH1W9FDJ8JJKHY9867P687","release-notes","Release notes helper for update blocker tests.","https:\u002F\u002Fgithub.com\u002Fnibzard\u002Fskillctl\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fupdate-blocker\u002F.agents\u002Fskills\u002Frelease-notes\u002FSKILL.md",[],[139,140,141,142,143,32,144],"release","release notes","notes","for","helper","update",{"skillNo":146,"name":134,"nameZh":6,"description":147,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":124,"licenseFileUrl":6,"sourceHtmlUrl":148,"categories":149,"keywords":150,"publishedAt":48},"01M6GH1V03W5PK85FZXFD9XA6S","Packaged release notes helper.","https:\u002F\u002Fgithub.com\u002Fnibzard\u002Fskillctl\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fsame-name-conflict\u002Fskills\u002Frelease-notes\u002FSKILL.md",[],[139,140,141,143],{"skillNo":152,"name":134,"nameZh":6,"description":153,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":124,"licenseFileUrl":6,"sourceHtmlUrl":154,"categories":155,"keywords":156,"publishedAt":48},"01M6GH1SKGAN0F2PDGDJZ76W79","Canonical release notes helper.","https:\u002F\u002Fgithub.com\u002Fnibzard\u002Fskillctl\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fsame-name-conflict\u002F.agents\u002Fskills\u002Frelease-notes\u002FSKILL.md",[],[139,140,141,157,143],"canonical",{"skillNo":159,"name":160,"nameZh":6,"description":161,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":124,"licenseFileUrl":6,"sourceHtmlUrl":162,"categories":163,"keywords":164,"publishedAt":48},"01M6GH1R5G9MWX54RT47CKN5DX","ai-sdk","Repo-root packaged AI SDK helper.","https:\u002F\u002Fgithub.com\u002Fnibzard\u002Fskillctl\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Frepo-root-layout\u002Fskills\u002Fai-sdk\u002FSKILL.md",[],[165,166,167,143,168],"ai sdk","sdk","repo","root",{"skillNo":170,"name":171,"nameZh":6,"description":172,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":124,"licenseFileUrl":6,"sourceHtmlUrl":173,"categories":174,"keywords":175,"publishedAt":48},"01M6GH1P8VBRQC25F0DXVPWWSP","private-skill","Local-only private source fixture.","https:\u002F\u002Fgithub.com\u002Fnibzard\u002Fskillctl\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fprivate-source\u002F.agents\u002Fskills\u002Fprivate-skill\u002FSKILL.md",[],[176,177,178,179,128],"private skill","source","only","local"]