Core Dynamic Skills

作者 actionbook5c40d3ad7851无许可证1.5K 个星标收录于 2026年10月8日更新于 2026年10月8日仓库6周前更新

Internal command support for dynamic Rust crate skill management. Use only when explicitly invoked by /sync-crate-skills, /clean-crate-skills, or /update-crate-skill.

仅含说明AI & Agents
AI 生成的概览

为 Cargo.toml 中列出的 Rust crate 依赖生成并管理本地代理技能。

功能
该技能负责按需为项目 Cargo.toml 中的依赖创建针对具体 crate 的技能。它会解析依赖、检查 ~/.claude/skills/ 下哪些 crate 缺少技能,并利用 docs.rs 的文档生成缺失的技能,包括关键模块的参考文件。它还提供同步、清理和更新命令,并在完整插件基础设施不可用时提供内联回退模式。
适用场景
适用于在 Rust 项目中希望为其 crate 依赖生成代理技能的场景。它设计为通过 /sync-crate-skills、/clean-crate-skills 或 /update-crate-skill 命令显式调用,而非自动触发。
运行要求
需要一个包含 Cargo.toml 的 Rust 项目、对 docs.rs 的网络访问,以及本地 ~/.claude/skills/ 目录。代理模式依赖插件的代理与命令基础设施以及 actionbook MCP;内联模式使用 shell 命令、agent-browser 工具和 WebFetch 回退方案。该技能不附带脚本。

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:

  1. Detect Cargo.toml (single or workspace)
  2. Parse dependencies list
  3. Check which crates are missing skills
  4. If missing: "Found X dependencies without skills. Sync now?"
  5. 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

  1. actionbook MCP - Check for pre-generated llms.txt
  2. /create-llms-for-skills - Generate llms.txt from docs.rs
  3. /create-skills-via-llms - Create skills from llms.txt

Sync Command

bash
/sync-crate-skills [--force]
  1. Parse Cargo.toml for dependencies
  2. For each dependency:
    • Check if skill exists at ~/.claude/skills/{crate}/
    • If missing (or --force): generate skill
  3. Report results

Inline Mode (Skills-only Install)

When agent/command infrastructure is NOT available, execute manually:

Step 1: Parse Cargo.toml

bash
# Read dependenciescat 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

bash
# List existing skillsls ~/.claude/skills/

Compare with dependencies to find missing skills.

Step 3: Generate Missing Skills

For each missing crate:

bash
# 1. Fetch crate documentationagent-browser open "https://docs.rs/{crate}/latest/{crate}/"agent-browser get text ".docblock"# Save content
# 2. Create skill directorymkdir -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 modulesagent-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:

bash
# 1. Parse root Cargo.toml for workspace memberscat Cargo.toml | grep -A 10 '\[workspace\]'
# 2. For each member, parse their Cargo.tomlfor 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)

bash
# Clean specific craterm -rf ~/.claude/skills/{crate_name}
# Clean all generated skillsrm -rf ~/.claude/skills/*

Update Command (Inline)

bash
# Remove old skillrm -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

ErrorCauseSolution
Commands not foundSkills-only installUse inline mode
Cargo.toml not foundNot in Rust projectNavigate to project root
docs.rs unavailableNetwork issueRetry or skip crate
Permission deniedDirectory issueCheck ~/.claude/skills/ permissions

来源与署名

来源:actionbook/rust-skills位于skills/core-dynamic-skills提交5c40d3a

许可证: 无许可证

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架