[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7EKGC5VR2DFJD9WMG23NREK":3,"skill-same:01M7EKGC5VR2DFJD9WMG23NREK":72},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":20,"frontMatter":21,"refName":22,"commitSha":23,"skillDirectory":24,"forksCount":13,"repositoryHtmlUrl":25,"repositoryHomepageUrl":6,"ownerHtmlUrl":26,"ownerBlogUrl":27,"ownerDescription":28,"updatedAt":29,"install":30,"resources":43},"01M7EKGC5VR2DFJD9WMG23NREK","rust-analyzer-context-indexing",null,"raillen\u002Fdaisy-code-editor","raillen","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F50306048?v=4","01M7EKBDVVBSPF21PBPVJYMNYR","Raillen Santos","01M7EKBDWD12A1K9N9Y638FGX9",0,"MIT","https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Frust-analyzer-context-indexing\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"# rust-analyzer Context Indexing\n\n## Purpose\nBuild and query code-context indexes for Rust workspaces through rust-analyzer: Cargo metadata-driven crate graph loading, LSP symbol, hover, definition, and reference extraction across crates, traits, and macros, flycheck-gated freshness, and ranked query answers bounded for AI agent consumption.\n\n## Use when\n- An agent needs accurate Rust definitions, trait implementations, macro expansions, or cross-crate references from a Cargo workspace.\n- rust-analyzer rolling 2026-09-01 or newer plus a working `cargo metadata` invocation are available.\n- Index freshness must survive file edits via rust-analyzer incremental salsa revisions without full workspace reloads.\n- Query answers must fit a fixed token budget with deterministic ranking.\n\n## Do not use when\n- The target language is not Rust; use the matching engine skill instead.\n- Only lexical search over `.rs` files is required with no need for trait resolution, generics, or macro expansion.\n- The workspace cannot run `cargo metadata` successfully, for example missing vendored registries with no network access and no vendor directory.\n\n## Required context\n- Workspace root, `cargo metadata --format-version 1` output, rust-analyzer version, and sysroot source for std symbols.\n- Token budget for a single query answer: at most 40 symbols and 12000 tokens of emitted context.\n- Performance targets: workspace load time, query p95 latency, and the golden symbol recall set.\n- Flycheck command used for diagnostics, normally `cargo check --workspace --message-format=json`.\n\n## Procedure\n1. **Load the crate graph**: run `cargo metadata --format-version 1 --no-deps` to enumerate packages and targets, then start rust-analyzer with `cargo.targetDir` set and confirm the status notification reaches ready. Abort indexing if metadata fails; an empty symbol set must never masquerade as an index.\n2. **Extract symbols per crate**: request `workspace\u002Fsymbol` with an empty query capped at 500 results per crate for the bulk pass, then `textDocument\u002FdocumentSymbol` per file for hierarchical detail including traits, impl blocks, structs, enums, functions, and macros.\n3. **Resolve relations**: map `textDocument\u002Fhover` for type signatures, `textDocument\u002Fdefinition` for jump targets, and `textDocument\u002Freferences` with `includeDeclaration: true` for call sites. Record trait-to-impl edges explicitly since they are the highest-value Rust context.\n4. **Gate freshness on flycheck**: subscribe to `textDocument\u002FpublishDiagnostics` fed by `cargo check --workspace --message-format=json`; documents with errors keep their last-good symbols flagged stale, and salsa revisions advance the index incrementally on each saved change.\n5. **Serve ranked queries**: expose `symbols --name 'ledger::apply_entry'`, `impls --trait 'LedgerStore'`, and `refs --symbol \u003Cpath>` with ranking by exact path match, then same-crate proximity, then dependency-distance hops, then recency, truncating at the 40-symbol and 12000-token caps.\n6. **Verify against goldens**: run `scripts\u002Fverify.sh`, assert query p95 under 300 ms warm, and require 100% recall on the golden set covering generics, trait objects, async fns, and macro-generated items.\n\n## Decision rules\n- **Metadata first**: no `cargo metadata`, no index; symbol extraction against a failed crate graph is forbidden.\n- **Stale flags are explicit**: symbols from files with flycheck errors are served only with a stale marker, never as fresh truth.\n- **Trait edges are mandatory**: every indexed trait stores its known implementations; a trait without impl edges is an incomplete record.\n- **Macro expansions recorded**: `macro_rules!` and derive-generated items are indexed at their expansion sites with the generating macro named.\n- **Bounded answers always**: every query path enforces the symbol and token caps even when the caller requests unlimited results.\n\n## Evidence required\n- Index specification following `templates\u002Frust-analyzer-context-indexing-spec.md` with metadata output, versions, and flycheck command.\n- Crate list with per-crate symbol counts and trait-to-impl edge counts.\n- Golden recall log with measured query p95 latency.\n- Passing execution log from `scripts\u002Fverify.sh`.\n\n## Output contract\n- Loaded rust-analyzer workspace with ready status and crate graph report.\n- Queryable symbol, reference, trait-implementation, and hover-signature index.\n- Freshness report showing stale-flagged files and salsa revision watermark.\n\n## Stop conditions\n- Golden symbol recall reaches 100% with query p95 under 300 ms on a warm workspace.\n- Single-file save propagates through salsa to fresh query results in under 4 seconds.\n- Token budget exhausted.\n- Blocked on external dependency.\n\n## Escalation rules\n- Escalate to the Rust build owner if `cargo metadata` or flycheck fails due to registry access, missing toolchains, or broken feature unification.\n- Escalate to the lead architect if proc-macro expansion is nondeterministic or too slow to index within budget, so expansion can be scoped or cached explicitly.\n",{},"main","2e465213b972294984c8c9515a47f811e4b358da",".agents\u002Fskills\u002Frust-analyzer-context-indexing","https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor","https:\u002F\u002Fgithub.com\u002Fraillen","https:\u002F\u002Fraillen.com","\u003C\u003CMarketing & IT>>\r\n\r\n@poppy-team\r\n@wasd-lat ","2026-10-16 09:17:52",{"source":7,"skillName":5,"commands":31,"prompt":41,"zipAvailable":42},[32,35,38],{"tool":33,"command":34},"npx","npx skills add raillen\u002Fdaisy-code-editor --skill rust-analyzer-context-indexing",{"tool":36,"command":37},"bunx","bunx skills add raillen\u002Fdaisy-code-editor --skill rust-analyzer-context-indexing",{"tool":39,"command":40},"pnpm","pnpm dlx skills add raillen\u002Fdaisy-code-editor --skill rust-analyzer-context-indexing","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Frust-analyzer-context-indexing\u002FSKILL.md",true,[44,50,54,58,64,68],{"path":45,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":48,"sourceHtmlUrl":49},"checks\u002Frust-analyzer-context-indexing-checklist.md","REFERENCE","参考文档",1631,"https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Frust-analyzer-context-indexing\u002Fchecks\u002Frust-analyzer-context-indexing-checklist.md",{"path":51,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":52,"sourceHtmlUrl":53},"manifest.json",2170,"https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Frust-analyzer-context-indexing\u002Fmanifest.json",{"path":55,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":56,"sourceHtmlUrl":57},"references\u002Frust-analyzer-context-indexing-guide.md",2503,"https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Frust-analyzer-context-indexing\u002Freferences\u002Frust-analyzer-context-indexing-guide.md",{"path":59,"resourceType":60,"resourceTypeDesc":61,"sizeBytes":62,"sourceHtmlUrl":63},"scripts\u002Fverify.sh","SCRIPT","脚本",4463,"https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Frust-analyzer-context-indexing\u002Fscripts\u002Fverify.sh",{"path":65,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":66,"sourceHtmlUrl":67},"templates\u002Frust-analyzer-context-indexing-spec.md",2157,"https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Frust-analyzer-context-indexing\u002Ftemplates\u002Frust-analyzer-context-indexing-spec.md",{"path":69,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":70,"sourceHtmlUrl":71},"templates\u002Frust-analyzer-context-indexing-template.md",838,"https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Frust-analyzer-context-indexing\u002Ftemplates\u002Frust-analyzer-context-indexing-template.md",[73,79,85,92,99,106],{"skillNo":74,"name":75,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":18},"01M7EKQYSDAX3SGSCRF873Z8E2","zoom-reflow","https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fzoom-reflow\u002FSKILL.md",[],[],{"skillNo":80,"name":81,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":18},"01M7EKQX0MWJNQD482GGZPGES4","wireframe-styleguide","https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fwireframe-styleguide\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":18},"01M7EKQS57FS6JYE6KWW6X5ADJ","visual-regression","Pixel-by-pixel snapshot testing, Playwright integration, dynamic content masking, deterministic font rendering, and cross-browser CI gates","https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fvisual-regression\u002FSKILL.md",[],[],{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":18},"01M7EKQMFR7651NVH100P5781Z","ui-implementation","Component-driven UI implementation, multi-state matrix (default, hover, focus-visible, active, disabled, loading, empty, error), DTCG design tokens, responsive layout contracts, and accessibility tree mapping.","https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fui-implementation\u002FSKILL.md",[],[],{"skillNo":100,"name":101,"nameZh":6,"description":102,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":18},"01M7EKQG3NVX6DPCYS6Q4PA71V","tui-editor-engine","Text buffer and editing semantics for a terminal code editor — index conversion, transaction-first editing, multi-cursor invariants, undo grouping, and large-file behaviour.","https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Ftui-editor-engine\u002FSKILL.md",[],[],{"skillNo":107,"name":108,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":109,"categories":110,"keywords":111,"publishedAt":18},"01M7EKQEJ993JGC72FE2KFY3ZZ","tree-sitter-context-indexing","https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Ftree-sitter-context-indexing\u002FSKILL.md",[],[]]