This document details the architecture and usage of the Skills system in DeepV Code.
The Skills system adopts a three-layer architecture designed to modularly extend AI capabilities:
- Marketplace: The top-level container, typically a Git repository or a local directory, containing multiple Plugins.
- Plugin: A logical grouping that contains a set of related Skills, Commands, or Agents.
- Item: The smallest functional unit, categorized into three types:
- Skill: A complex capability defined by
SKILL.md, which can include executable scripts. - Command: An instruction defined by a single Markdown file, usually for specific tasks.
- Agent: A Markdown file defining a specific persona or role to guide the AI's behavioral patterns.
- Skill: A complex capability defined by
The DeepV Code CLI introduces the /skill command family to manage the entire lifecycle.
Manage skill sources (Marketplaces).
- List Marketplaces:
/skill marketplace list
- Add Marketplace:
Supports Git URLs or local paths.
/skill marketplace add <git-url-or-local-path> [--name <custom-name>] # Example /skill marketplace add https://github.com/anthropics/skills.git
- Update Marketplace:
Pull the latest changes from Git.
/skill marketplace update <marketplace-name>
- Browse Marketplace Content:
View available plugins in a marketplace. Supports searching by plugin name, description, or keywords.
/skill marketplace browse <marketplace-name> [search-query]
- Remove Marketplace:
/skill marketplace remove <marketplace-name> [--delete-files]
Manage the installation, enabling, and disabling of specific plugins.
- List Plugins:
Lists installed plugins if no argument is provided; lists available plugins in a specific marketplace if a name is provided.
/skill plugin list [marketplace-name]
- Install Plugin:
/skill plugin install <marketplace-name> <plugin-name>
- Uninstall Plugin:
/skill plugin uninstall <plugin-id>
- Enable/Disable Plugin:
/skill plugin enable <plugin-id> /skill plugin disable <plugin-id>
- View Plugin Info:
/skill plugin info <plugin-id>
View specific loaded skills.
- List All Skills:
/skill list
- View Skill Details:
/skill info <skill-id>
- View Statistics:
/skill stats
To create a new Skill, you need to follow a specific directory structure and file format.
A standard Skill directory structure is as follows:
my-plugin/
├── plugin.json # Plugin metadata (Optional, required in Strict mode)
├── commands/ # Command type files
│ └── my-command.md
├── agents/ # Agent type files
│ └── my-agent.md
└── skills/ # Skill type directories
└── my-skill/
├── SKILL.md # Core definition file (Required)
├── scripts/ # Executable scripts directory (Optional)
│ ├── script.py
│ └── tool.js
├── LICENSE.txt # License (Optional)
└── README.md # Supplementary documentation (Optional)
SKILL.md (Skill Type)
The SKILL.md file consists of YAML Frontmatter and a Markdown body.
---
name: my-skill-name # Skill name (lowercase, numbers, hyphens)
description: Short desc # Used for AI retrieval
license: MIT # License
allowedTools: # Whitelist of allowed tools
- run_shell_command
dependencies: [] # Other Skills this one depends on
---
# Usage Instructions
...Command/Agent Markdown (Command/Agent Type)
Command and Agent types are typically single Markdown files, also supporting YAML Frontmatter.
---
description: Description of this command
---
# Command Title
Specific instructions for the command go here...The Skills system supports Python (.py), Bash (.sh, .bash), and Node.js (.js, .mjs, .cjs) scripts.
- Scripts should be placed in the
scripts/subdirectory. - The AI is strictly required to call these scripts directly rather than rewriting the code.
The system provides the use_skill tool for the AI to invoke skills.
- Discovery: The AI sees a list of available Skills (metadata level) in its context.
- Activation: The AI calls
use_skill(skillName="name"). - Loading: The system loads the full content of
SKILL.md.- Skill with Scripts: The system issues a severe warning, forcing the AI to use
run_shell_commandto execute the pre-existing scripts, prohibiting the AI from writing new code to achieve the same functionality. - Pure Knowledge Skill: The system injects the Markdown content into the context as an operational guide.
- Skill with Scripts: The system issues a severe warning, forcing the AI to use
- Script Priority: If a Skill provides scripts, the AI must use them.
- Tool Whitelist: Skills can restrict which underlying tools the AI can use during execution.
- Sandbox Execution: It is recommended to run Skill scripts in a sandboxed environment to ensure security.
本文档详细说明了 Skills 系统架构及使用方法。
Skills 系统采用三层架构设计,旨在模块化扩展 AI 的能力:
- Marketplace (市场): 顶层容器,通常是一个 Git 仓库或本地目录,包含多个 Plugin。
- Plugin (插件): 逻辑分组,包含一组相关的 Skills、Commands 或 Agents。
- Item (项): 最小的功能单元,分为三种类型:
- Skill (技能): 由
SKILL.md定义的复杂能力,可包含脚本。 - Command (命令): 单个 Markdown 文件定义的指令,通常用于特定任务。
- Agent (代理): 定义特定角色的 Markdown 文件,用于指导 AI 的行为模式。
- Skill (技能): 由
DeepV Code CLI 新增了 /skill 命令族,用于管理整个生命周期。
管理技能来源(市场)。
- 列出市场:
/skill marketplace list
- 添加市场:
支持 Git URL 或本地路径。
/skill marketplace add <git-url-or-local-path> [--name <custom-name>] # 示例 /skill marketplace add https://github.com/anthropics/skills.git
- 更新市场:
从 Git 拉取最新更改。
/skill marketplace update <marketplace-name>
- 浏览市场内容:
查看市场中可用的插件。支持通过插件名称、描述或关键词(keywords)进行搜索。
/skill marketplace browse <marketplace-name> [search-query]
- 移除市场:
/skill marketplace remove <marketplace-name> [--delete-files]
管理具体的插件安装与启停。
- 列出插件:
如果不带参数,列出已安装插件;带市场名则列出该市场的可用插件。
/skill plugin list [marketplace-name]
- 安装插件:
/skill plugin install <marketplace-name> <plugin-name>
- 卸载插件:
/skill plugin uninstall <plugin-id>
- 启用/禁用插件:
/skill plugin enable <plugin-id> /skill plugin disable <plugin-id>
- 查看插件信息:
/skill plugin info <plugin-id>
查看已加载的具体技能。
- 列出所有技能:
/skill list
- 查看技能详情:
/skill info <skill-id>
- 查看统计信息:
/skill stats
要创建一个新的 Skill,需要遵循特定的目录结构和文件格式。
一个标准的 Skill 目录结构如下:
my-plugin/
├── plugin.json # 插件元数据 (可选,Strict模式下必需)
├── commands/ # Command 类型文件
│ └── my-command.md
├── agents/ # Agent 类型文件
│ └── my-agent.md
└── skills/ # Skill 类型目录
└── my-skill/
├── SKILL.md # 核心定义文件 (必需)
├── scripts/ # 可执行脚本目录 (可选)
│ ├── script.py
│ └── tool.js
├── LICENSE.txt # 许可证 (可选)
└── README.md # 补充文档 (可选)
SKILL.md (Skill 类型)
SKILL.md 文件由 YAML Frontmatter 和 Markdown 正文组成。
---
name: my-skill-name # 技能名称 (小写字母、数字、连字符)
description: 简短描述 # 用于 AI 检索
license: MIT # 许可证
allowedTools: # 允许使用的工具白名单
- run_shell_command
dependencies: [] # 依赖的其他 Skills
---
# 使用说明
...Command/Agent Markdown (Command/Agent 类型)
Command 和 Agent 类型通常是单个 Markdown 文件,也支持 YAML Frontmatter。
---
description: 这是一个命令的描述
---
# Command Title
这里是命令的具体指令...Skills 系统支持 Python (.py)、Bash (.sh, .bash) 和 Node.js (.js, .mjs, .cjs) 脚本。
- 脚本应放置在
scripts/子目录下。 - AI 会被强制要求直接调用这些脚本,而不是重新编写代码。
系统为 AI 提供了 use_skill 工具来调用技能。
- 发现: AI 在上下文中看到可用的 Skills 列表(元数据级别)。
- 激活: AI 调用
use_skill(skillName="name")。 - 加载: 系统加载
SKILL.md的完整内容。- 含脚本的 Skill: 系统会发出严重警告,强制 AI 使用
run_shell_command执行预置脚本,禁止 AI 编写新代码来实现相同功能。 - 纯知识 Skill: 系统将 Markdown 内容注入上下文,作为操作指南。
- 含脚本的 Skill: 系统会发出严重警告,强制 AI 使用
- 脚本优先: 如果 Skill 提供了脚本,AI 必须使用它们。
- 工具白名单: Skill 可以限制 AI 在执行任务时能使用的底层工具。
- 沙箱执行: 建议在沙箱环境中运行 Skill 脚本以确保安全。