Agent skill
core-dynamic-skills
Install this agent skill to your Project
npx add-skill https://github.com/actionbook/rust-skills/tree/main/skills/core-dynamic-skills
SKILL.md
Dynamic Skills Manager
Version: 2.1.0 | Last Updated: 2025-01-27
Orchestrates on-demand generation of crate-specific skills based on project dependencies.
Concept
Dynamic skills are:
- Generated locally at
~/.claude/skills/ - Based on Cargo.toml dependencies
- Created using llms.txt from docs.rs
- Versioned and updatable
- Not committed to the rust-skills repository
Trigger Scenarios
Prompt-on-Open
When entering a directory with Cargo.toml:
- Detect Cargo.toml (single or workspace)
- Parse dependencies list
- Check which crates are missing skills
- If missing: "Found X dependencies without skills. Sync now?"
- If confirmed: run
/sync-crate-skills
Manual Commands
/sync-crate-skills- Sync all dependencies/clean-crate-skills [crate]- Remove skills/update-crate-skill <crate>- Update specific skill
Execution Mode Detection
CRITICAL: Check if agent and command infrastructure is available.
Try to read: ../../agents/ directory
Check if /create-llms-for-skills and /create-skills-via-llms commands work.
Agent Mode (Plugin Install)
When full plugin infrastructure is available:
Architecture
Cargo.toml
↓
Parse dependencies
↓
For each crate:
├─ Check ~/.claude/skills/{crate}/
├─ If missing: Check actionbook for llms.txt
│ ├─ Found: /create-skills-via-llms
│ └─ Not found: /create-llms-for-skills first
└─ Load skill
Workflow Priority
- actionbook MCP - Check for pre-generated llms.txt
- /create-llms-for-skills - Generate llms.txt from docs.rs
- /create-skills-via-llms - Create skills from llms.txt
Sync Command
/sync-crate-skills [--force]
- Parse Cargo.toml for dependencies
- For each dependency:
- Check if skill exists at
~/.claude/skills/{crate}/ - If missing (or --force): generate skill
- Check if skill exists at
- Report results
Inline Mode (Skills-only Install)
When agent/command infrastructure is NOT available, execute manually:
Step 1: Parse Cargo.toml
# Read dependencies
cat Cargo.toml | grep -A 100 '\[dependencies\]' | grep -E '^[a-zA-Z]'
Or use Read tool to parse Cargo.toml and extract:
[dependencies]section[dev-dependencies]section (optional)- Workspace members (if workspace project)
Step 2: Check Existing Skills
# List existing skills
ls ~/.claude/skills/
Compare with dependencies to find missing skills.
Step 3: Generate Missing Skills
For each missing crate:
# 1. Fetch crate documentation
agent-browser open "https://docs.rs/{crate}/latest/{crate}/"
agent-browser get text ".docblock"
# Save content
# 2. Create skill directory
mkdir -p ~/.claude/skills/{crate}
mkdir -p ~/.claude/skills/{crate}/references
# 3. Create SKILL.md
# Use template from rust-skill-creator inline mode
# 4. Create reference files for key modules
agent-browser open "https://docs.rs/{crate}/latest/{crate}/{module}/"
agent-browser get text ".docblock"
# Save to ~/.claude/skills/{crate}/references/{module}.md
agent-browser close
WebFetch fallback:
WebFetch("https://docs.rs/{crate}/latest/{crate}/", "Extract API documentation overview, key types, and usage examples")
Step 4: Workspace Support
For Cargo workspace projects:
# 1. Parse root Cargo.toml for workspace members
cat Cargo.toml | grep -A 10 '\[workspace\]'
# 2. For each member, parse their Cargo.toml
for member in members; do
cat ${member}/Cargo.toml | grep -A 100 '\[dependencies\]'
done
# 3. Aggregate and deduplicate dependencies
# 4. Generate skills for missing crates
Clean Command (Inline)
# Clean specific crate
rm -rf ~/.claude/skills/{crate_name}
# Clean all generated skills
rm -rf ~/.claude/skills/*
Update Command (Inline)
# Remove old skill
rm -rf ~/.claude/skills/{crate_name}
# Re-generate (same as sync for single crate)
# Follow Step 3 above for the specific crate
Local Skills Directory
~/.claude/skills/
├── tokio/
│ ├── SKILL.md
│ └── references/
├── serde/
│ ├── SKILL.md
│ └── references/
└── axum/
├── SKILL.md
└── references/
Related Commands
/sync-crate-skills- Main sync command/clean-crate-skills- Cleanup command/update-crate-skill- Update command/create-llms-for-skills- Generate llms.txt (Agent Mode only)/create-skills-via-llms- Create skills from llms.txt (Agent Mode only)
Error Handling
| Error | Cause | Solution |
|---|---|---|
| Commands not found | Skills-only install | Use inline mode |
| Cargo.toml not found | Not in Rust project | Navigate to project root |
| docs.rs unavailable | Network issue | Retry or skip crate |
| Permission denied | Directory issue | Check ~/.claude/skills/ permissions |
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
meta-cognition-parallel
EXPERIMENTAL: Three-layer parallel meta-cognition analysis. Triggers on: /meta-parallel, 三层分析, parallel analysis, 并行元认知
domain-cloud-native
Use when building cloud-native apps. Keywords: kubernetes, k8s, docker, container, grpc, tonic, microservice, service mesh, observability, tracing, metrics, health check, cloud, deployment, 云原生, 微服务, 容器
m07-concurrency
CRITICAL: Use for concurrency/async. Triggers: E0277 Send Sync, cannot be sent between threads, thread, spawn, channel, mpsc, Mutex, RwLock, Atomic, async, await, Future, tokio, deadlock, race condition, 并发, 线程, 异步, 死锁
unsafe-checker
CRITICAL: Use for unsafe Rust code review and FFI. Triggers on: unsafe, raw pointer, FFI, extern, transmute, *mut, *const, union, #[repr(C)], libc, std::ffi, MaybeUninit, NonNull, SAFETY comment, soundness, undefined behavior, UB, safe wrapper, memory layout, bindgen, cbindgen, CString, CStr, 安全抽象, 裸指针, 外部函数接口, 内存布局, 不安全代码, FFI 绑定, 未定义行为
rust-refactor-helper
Safe Rust refactoring with LSP analysis. Triggers on: /refactor, rename symbol, move function, extract, 重构, 重命名, 提取函数, 安全重构
rust-skill-creator
Use when creating skills for Rust crates or std library documentation. Keywords: create rust skill, create crate skill, create std skill, 创建 rust skill, 创建 crate skill, 创建 std skill, 动态 rust skill, 动态 crate skill, skill for tokio, skill for serde, skill for axum, generate rust skill, rust 技能, crate 技能, 从文档创建skill, from docs create skill
Didn't find tool you were looking for?