智能技能依赖管理与自动解析
简介
OpenClaw 技能依赖管理工具,支持语义化版本约束、依赖树可视化、循环依赖检测及自动解析安装,类似 npm 的包管理模式。
原始描述
Track and manage dependencies between OpenClaw skills. Scan skills for dependencies, visualize skill trees, detect circular dependencies, and manage skill versioning. Use when analyzing skill relationships, checking which skills depend on others, or managing skill installations.
通过你的 Agent 添加
安装目录:skill-deps/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。
点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。
或者手动安装
包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可;
目录名不用换,也不要把包直接解压到 skills 根目录。
技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。
中文使用说明 来自收录源
核心用法
skill-deps 是 OpenClaw 生态的依赖管理系统,提供从声明到安装的全链路工具链:
- 依赖声明:在
SKILL.mdfrontmatter 或skill.json中通过depends(必需)、optional(增强)、conflicts(互斥)三类字段声明关系 - 版本控制:完整支持 Semver 语义——
>=(最低版本)、^(兼容主版本)、~(兼容次版本)、*(任意版本)、精确版本号 - 扫描分析:
scan-skills.sh遍历三级目录(系统内置/usr/lib/node_modules/openclaw/skills/、用户级~/.openclaw/workspace/skills/、项目本地./skills/)生成依赖图谱 - 可视化:
skill-tree.sh输出 ASCII 树形结构,清晰标注 required/optional 依赖层级 - 冲突解决:
check-conflicts.sh检测声明互斥,skill-install.sh自动解析依赖链并执行版本协商
显著优点
- 生态兼容性:借鉴 npm 成熟范式,降低开发者心智负担
- 自动化闭环:从发现缺失依赖到自动安装、版本协商、冲突检测一键完成
- 三级隔离:系统/用户/项目三级目录设计,兼顾全局共享与项目隔离
- 语义化版本:完整 Semver 支持,避免版本地狱
- 可选依赖优化:
optional 字段允许功能降级而非硬失败,提升容错性
潜在缺点与局限性
- 中心化风险:
ClawHub 作为唯一官方 registry,存在单点故障与审查可能
- 循环依赖盲区:文档提及检测但未展示具体处理策略(自动中断?提示人工介入?)
- 跨技能状态共享:
optional 依赖的"增强功能"实现细节未明,可能隐含隐式耦合
- 权限边界模糊:系统级
/usr/lib/ 与用户级安装需 root 权限,脚本未体现权限校验逻辑
- 版本锁定缺失:未见
skill-lock.json 机制,多环境一致性依赖人工维护
适合人群
- 管理 5+ 技能的中重度 OpenClaw 用户
- 需要构建技能链的自动化工作流开发者
- 维护内部技能 registry 的企业管理员
常规风险
风险类型
说明
供应链攻击
ClawHub registry 被篡改可导致恶意技能自动安装
版本冲突升级
自动解析可能选择破坏性更新版本(^ 约束下主版本变更)
权限提升
安装脚本需 sudo 时若未校验签名可成为本地提权通道
循环依赖死锁
复杂依赖网中循环未妥善处理可能导致无限递归或静默失败
optional 字段允许功能降级而非硬失败,提升容错性- 中心化风险:
ClawHub作为唯一官方 registry,存在单点故障与审查可能 - 循环依赖盲区:文档提及检测但未展示具体处理策略(自动中断?提示人工介入?)
- 跨技能状态共享:
optional依赖的"增强功能"实现细节未明,可能隐含隐式耦合 - 权限边界模糊:系统级
/usr/lib/与用户级安装需 root 权限,脚本未体现权限校验逻辑 - 版本锁定缺失:未见
skill-lock.json机制,多环境一致性依赖人工维护
适合人群
- 管理 5+ 技能的中重度 OpenClaw 用户
- 需要构建技能链的自动化工作流开发者
- 维护内部技能 registry 的企业管理员
常规风险
风险类型
说明
供应链攻击
ClawHub registry 被篡改可导致恶意技能自动安装
版本冲突升级
自动解析可能选择破坏性更新版本(^ 约束下主版本变更)
权限提升
安装脚本需 sudo 时若未校验签名可成为本地提权通道
循环依赖死锁
复杂依赖网中循环未妥善处理可能导致无限递归或静默失败
| 风险类型 | 说明 |
|---|---|
| 供应链攻击 | ClawHub registry 被篡改可导致恶意技能自动安装 |
| 版本冲突升级 | 自动解析可能选择破坏性更新版本(^ 约束下主版本变更) |
| 权限提升 | 安装脚本需 sudo 时若未校验签名可成为本地提权通道 |
| 循环依赖死锁 | 复杂依赖网中循环未妥善处理可能导致无限递归或静默失败 |
技能正文
name: skill-deps
description: Track and manage dependencies between OpenClaw skills. Scan skills for dependencies, visualize skill trees, detect circular dependencies, and manage skill versioning. Use when analyzing skill relationships, checking which skills depend on others, or managing skill installations.
Skill Dependencies
Manage dependencies between OpenClaw skills — like npm for skills.
Version Constraints
Supports semver-style version constraints:
depends:
- weather@>=1.0.0 # Version 1.0.0 or higher
- calendar@^2.0.0 # Compatible with 2.x.x
- browser@~1.2.0 # Approximately 1.2.x
- coding-agent@* # Any version
- github@1.5.0 # Exact version
Conflict Detection
Declare skills that cannot coexist:
conflicts:
- old-weather # Cannot use with old-weather
- legacy-calendar
Concepts
Declaring Dependencies
In a skill's SKILL.md frontmatter:
---
name: my-skill
description: Does something cool
depends:
- weather # Requires weather skill
- coding-agent # Requires coding-agent skill
optional:
- github # Enhanced if github skill present
---
Dependency Types
- depends — Required skills (fail if missing)
- optional — Enhanced functionality if present
- conflicts — Cannot be used with these skills
Commands
Scan Skills
# Scan all installed skills for dependencies
./scripts/scan-skills.sh
# Scan specific skill
./scripts/scan-skills.sh weather
Dependency Tree
# Show full dependency tree
./scripts/skill-tree.sh my-skill
# Output:
# my-skill
# ├── weather (required)
# │ └── (no dependencies)
# └── coding-agent (required)
# └── github (optional)
Check Missing
# Find skills with unmet dependencies
./scripts/check-deps.sh
Registry Format
Scan Skills
# Scan all installed skills for dependencies
./scripts/scan-skills.sh
# Scan specific skill
./scripts/scan-skills.sh weather
# Show full dependency tree
./scripts/skill-tree.sh my-skill
# Output:
# my-skill
# ├── weather (required)
# │ └── (no dependencies)
# └── coding-agent (required)
# └── github (optional)
Check Missing
# Find skills with unmet dependencies
./scripts/check-deps.sh
Registry Format
# Find skills with unmet dependencies
./scripts/check-deps.sh
Skills can declare their metadata in skill.json:
{
"name": "my-skill",
"version": "1.0.0",
"depends": {
"weather": ">=1.0.0",
"coding-agent": "*"
},
"optional": {
"github": ">=2.0.0"
}
}
Skill Locations
Scans these directories:
/usr/lib/node_modules/openclaw/skills/— Built-in skills~/.openclaw/workspace/skills/— User skills./skills/— Project-local skills
ClawHub Registry Integration
Install skills from clawhub.com:
# Install a skill (auto-resolves dependencies)
./scripts/skill-install.sh weather
# Install with specific version
./scripts/skill-install.sh weather@1.2.0
# Search for skills
./scripts/skill-search.sh "calendar"
# List installed vs available
./scripts/skill-list.sh --outdated
Auto-Resolution
When installing a skill with dependencies:
$ ./scripts/skill-install.sh travel-planner
📦 Resolving dependencies for travel-planner@1.0.0...
├── weather@>=1.0.0 → weather@1.2.3 ✅
├── calendar@^2.0 → calendar@2.1.0 ✅
└── browser (optional) → browser@3.0.0 ✅
🔍 Checking conflicts...
└── No conflicts found ✅
📥 Installing 4 skills...
✅ weather@1.2.3
✅ calendar@2.1.0
✅ browser@3.0.0
✅ travel-planner@1.0.0
Done! Installed 4 skills.
Commands Summary
Command
Description
scan-skills.sh
List all skills with their deps
skill-tree.sh <name>
Show dependency tree
check-deps.sh
Find missing dependencies
skill-install.sh <name>
Install from ClawHub
skill-search.sh <query>
Search registry
check-conflicts.sh
Detect conflicts
| Command | Description |
|---|---|
scan-skills.sh |
List all skills with their deps |
skill-tree.sh <name> |
Show dependency tree |
check-deps.sh |
Find missing dependencies |
skill-install.sh <name> |
Install from ClawHub |
skill-search.sh <query> |
Search registry |
check-conflicts.sh |
Detect conflicts |
正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。