Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsCommunityBlog
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

Back to skills

Rust Librarian

ASecurity

[WHAT] Rust knowledge ingestion and semantic search system. Indexes Rust books, patterns, error examples, and crate documentation into Qdrant for agent-accessible retrieval. [HOW] Clones Rust book sources (markdown), chunks by chapter/section/concept, embeds via sentence-transformers (all-mpnet-base-v2, 768D), upserts to Qdrant collections following the os/agent/performance-engine schema. Provides search commands for agents. [WHEN] Use when ingesting new Rust learning material, querying Rust ...

22 stars
0 votes
0 copies
0 views
Added 9/20/2026
developmentpythonrustgobashgitapiperformancedocumentation

Works with

cliapi

Security Analysis

A100/100

Scanned 9/20/2026

Install to Claude Code

$npx -y skills add lev-os/agents --skill rust-librarian --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Rust Librarian?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Rust Librarian
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/lev-os-rust-librarian/badge)](https://www.skillsdirectory.com/skills/lev-os-rust-librarian)

More formats (shields.io, HTML) on the badges page.

Download Zip
Files
SKILL.md
---
name: rust-librarian
description: |
  [WHAT] Rust knowledge ingestion and semantic search system. Indexes Rust books, patterns,
  error examples, and crate documentation into Qdrant for agent-accessible retrieval.
  [HOW] Clones Rust book sources (markdown), chunks by chapter/section/concept, embeds via
  sentence-transformers (all-mpnet-base-v2, 768D), upserts to Qdrant collections following
  the os/agent/performance-engine schema. Provides search commands for agents.
  [WHEN] Use when ingesting new Rust learning material, querying Rust patterns during planning,
  or looking up idiomatic solutions to Rust compiler errors.
  [WHY] Agents writing Rust need access to canonical patterns, not just LLM training data.
  RAG over curated Rust books produces more idiomatic, correct code.
disable-model-invocation: true
context: fork
agent: general-purpose
allowed-tools: Read, Write, Edit, Bash, Glob, Grep, Task, WebFetch
tags: rust, knowledge-base, qdrant, semantic-search, ingestion, patterns, librarian
---

# Rust Librarian

Semantic knowledge system for Rust development. Ingests authoritative Rust sources into
Qdrant and provides search tools for agents planning or writing Rust code.

## Architecture

Mirrors the Go docs indexer pattern from `os/agent/performance-engine/`:

```
[Rust Book Sources (GitHub markdown)]
        |
        v
[Chunker: split by chapter/section/concept]
        |
        v
[Embedder: sentence-transformers all-mpnet-base-v2 (768D)]
        |
        v
[Qdrant Collections]
  - project-rust-stdlib-framework-docs   (std library API docs)
  - project-rust-books-guides            (The Rust Book, Rustonomicon, etc.)
  - project-rust-patterns                (Design patterns, idioms)
  - project-rust-error-examples          (Compiler errors + fixes)
  - project-rust-crate-docs              (Popular crate documentation)
        |
        v
[Search API: POST /search with metadata filtering]
```

## Commands

### `/rust-librarian ingest <source>`

Ingest a Rust knowledge source into Qdrant.

**Supported sources:**

| Source | Repository | Collection |
|--------|-----------|------------|
| `rust-book` | `github.com/rust-lang/book` | `project-rust-books-guides` |
| `rust-by-example` | `github.com/rust-lang/rust-by-example` | `project-rust-books-guides` |
| `rustonomicon` | `github.com/rust-lang/nomicon` | `project-rust-books-guides` |
| `rust-api-guidelines` | `github.com/rust-lang/api-guidelines` | `project-rust-patterns` |
| `rust-design-patterns` | `github.com/rust-unofficial/patterns` | `project-rust-patterns` |
| `rust-cookbook` | `github.com/rust-lang-nursery/rust-cookbook` | `project-rust-patterns` |
| `effective-rust` | `github.com/brson/effective-rust` (or local) | `project-rust-patterns` |
| `std` | `doc.rust-lang.org/std` | `project-rust-stdlib-framework-docs` |
| `error-index` | `doc.rust-lang.org/error_codes` | `project-rust-error-examples` |
| `crate:<name>` | `docs.rs/<name>` | `project-rust-crate-docs` |

**Ingestion pipeline:**

```bash
# 1. Clone source
git clone --depth 1 https://github.com/rust-lang/book ~/lev/workshop/intake/rust-book

# 2. Run chunker (Python, reuses os/agent schema)
python3 rust_librarian/ingest.py --source rust-book --path ~/lev/workshop/intake/rust-book/src/
```

### `/rust-librarian search <query>`

Search the Rust knowledge base. Returns ranked results with source attribution.

```bash
# Pattern search
/rust-librarian search "lifetime elision rules"

# Error search
/rust-librarian search "error[E0502] cannot borrow as mutable"

# Idiom search
/rust-librarian search "builder pattern in Rust"
```

### `/rust-librarian status`

Show ingestion status across all collections.

## Chunking Strategy

Different sources need different chunking:

### Books (The Rust Book, Rustonomicon)
- **Unit**: Chapter section (## heading)
- **Metadata**: chapter_number, section_title, book_name
- **Hierarchy**: CONCEPT
- **DocumentType**: GUIDE or TUTORIAL
- **Content**: Full section text including code examples

### API Docs (std library)
- **Unit**: Per item (struct, enum, fn, trait, module)
- **Metadata**: module_path, item_type, signature
- **Hierarchy**: FUNCTION / CLASS / MODULE / PACKAGE
- **DocumentType**: API
- **Content**: Signature + documentation + examples

### Patterns / Guidelines
- **Unit**: Per pattern (one pattern = one chunk)
- **Metadata**: pattern_name, category, applicability
- **Hierarchy**: CONCEPT
- **DocumentType**: STANDARD
- **Content**: Description + when to use + code example + tradeoffs

### Error Examples
- **Unit**: Per error code
- **Metadata**: error_code (E0xxx), category (borrow, lifetime, type)
- **Hierarchy**: CONCEPT
- **DocumentType**: EXAMPLE
- **Content**: Error message + explanation + fix + before/after code

## Qdrant Schema

Reuses `DocumentMetadata` from `os/agent/performance-engine/semantic-search/schemas/metadata.py`:

```python
DocumentMetadata(
    id="rust-book-ch04-ownership",
    content_type=ContentType.FRAMEWORK,   # or PRINCIPLE for patterns
    project="rust-knowledge",
    scope=Scope.GLOBAL,
    framework="rust",
    document_type=DocumentType.GUIDE,
    hierarchy_level=HierarchyLevel.CONCEPT,
    authority="external",                  # from official Rust docs
    source_file="src/ch04-01-what-is-ownership.md",
    source_url="https://doc.rust-lang.org/book/ch04-01-what-is-ownership.html",
    tags=["ownership", "memory", "borrowing"],
    keywords=["ownership", "move", "copy", "drop", "stack", "heap"],
    summary="Rust ownership: each value has one owner, transfers on assignment",
    custom_fields={
        "book": "the-rust-programming-language",
        "chapter": 4,
        "section": "4.1",
        "rust_concepts": ["ownership", "move-semantics"]
    }
)
```

**Collection config** (768D, Cosine, HNSW m=16 ef=100):
```python
VectorParams(size=768, distance=Distance.COSINE)
HnswConfigDiff(m=16, ef_construct=100)
```

## Integration Points

### SDLC Planning (workflow-rust-plan)
The `workflow-rust-plan` calls this skill's search before generating code plans:
1. Extract Rust concepts from task description
2. Query `project-rust-patterns` for relevant idioms
3. Query `project-rust-error-examples` for known pitfalls
4. Inject results into planning context

### Compile-Fix Loop (RustCoder pattern)
When `cargo build` fails:
1. Extract error code from compiler output (use `--message-format=json`)
2. Query `project-rust-error-examples` for the error code
3. Return fix examples + explanation to the fixing LLM

### Agent Context Enrichment
Any agent writing Rust can call:
```
/rust-librarian search "how to implement Display trait"
```

## Bootstrapping (priority order)

```bash
/rust-librarian ingest rust-book            # Foundation (~20 chapters)
/rust-librarian ingest rust-by-example      # Practical examples
/rust-librarian ingest error-index          # All compiler error codes
/rust-librarian ingest rust-design-patterns  # Idioms and patterns
/rust-librarian ingest rust-api-guidelines   # API design rules
/rust-librarian ingest rustonomicon         # Unsafe Rust
/rust-librarian ingest crate:serde          # Serialization
/rust-librarian ingest crate:tokio          # Async runtime
/rust-librarian ingest crate:clap           # CLI parsing
```

## Dependencies

- Python 3.8+ with `sentence-transformers`, `qdrant-client`
- Qdrant on localhost:6333 (or QDRANT_HOST)
- Git for cloning book sources
- Reuses schema from `os/agent/performance-engine/semantic-search/`

## Related

- `os/agent/performance-engine/` -- Go docs indexer (prior art, same architecture)
- `workflow-rust-plan` -- Planning workflow that consumes search
- `plugins/core-sdlc/` -- SDLC plan-execute-verify flow
- RustCoder (`~/lev/workshop/intake/RustCoder/`) -- Compile-fix loop reference

Attribution

lev-oslev-os
View sourceMore from lev-os →
SSkills DirectorySkills Directory

Your tool, in front of Claude Code builders.

3 founder slots · $299/mo · GSC-verified traffic · sponsors can never buy grades.

See placements

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Your tool, in front of Claude Code builders.

3 founder slots · $299/mo · GSC-verified traffic · sponsors can never buy grades.

See placements

Related Skills

Browser Extension Developer

Use this skill when developing or maintaining browser extension code in the `browser/` directory, including Chrome/Firefox/Edge compatibility, content scripts, background scripts, or i18n updates.

281612 votes

Seo Optimizer

SEO optimization with keyword analysis, readability assessment, technical validation, content quality. Use for search rankings, blog posts, content audits, or encountering keyword density, readability scores, meta tags, schema markup errors.

2132 votes

Google Official Seo Guide

Official Google SEO guide covering search optimization, best practices, Search Console, crawling, indexing, and improving website search visibility based on official Google documentation

1862 votes

Tanstack Start

Build a full-stack TanStack Start app on Cloudflare Workers from scratch — SSR, file-based routing, server functions, D1+Drizzle, better-auth, Tailwind v4+shadcn/ui. Use whenever the user mentions TanStack Start, asks to scaffold a full-stack Cloudflare app with SSR, wants an SSR dashboard, or asks for a React 19 + Cloudflare Workers app with file-based routing and server functions — even if they don't name TanStack Start specifically. No template repo — Claude generates every file fresh per ...

9881 votes

Pentest

PTES-aligned adversarial security audit for backend, frontend, and mobile applications. Produces a CVSS-scored Hacker Report with verified PoCs and phased remediation.

5491 votes
View all in development →