08. 扩展 Matcha
技能
技能是带 SKILL.md 的文件夹:一段可复用流程,你用斜杠命令调用,或在任务匹配描述时由 Matcha CLI 自行套用。
技能在这台机器上 — 在你的主目录、本仓库,或你安装的本地插件里。没有远程技能目录。
Matcha CLI 会找哪里
两个技能同名时,上表优先:
| 位置 | 范围 |
|---|---|
./.matcha/skills/、./.matcha/commands/ | 当前目录 |
<repo>/.matcha/skills/、…/commands/ | 本仓库 |
~/.matcha/skills/、~/.matcha/commands/ | 你的所有项目 |
./.claude/skills/、./.cursor/skills/,以及它们的 commands/ 对应目录 | 项目兼容(默认开) |
~/.claude/skills/、~/.cursor/skills/ | 用户兼容(默认开) |
Matcha CLI 还会在每一层走 .agents/skills/(以及 commands/),以及 cwd 到 git 根之间的每个目录。
commands/ 目录下的扁平 *.md 会变成斜杠命令。文件名主干即命令名。
追加额外文件夹:
[skills]
paths = ["~/my-team-skills"]
ignore = ["~/my-team-skills/wip"]
disabled = ["wip-skill"]paths 和 ignore 是文件系统路径(~ 会展开)。disabled 是技能 **名**:仍会列出,但不会被调用。
写一个技能
~/.matcha/skills/commit/SKILL.md---
name: commit
description: Create well-formatted git commits following conventional commit standards. Use when the user wants to commit changes or asks for /commit.
---
# Git Commit Skill
1. Run `git diff --staged`
2. Summarize what changed and why
3. Commit with a conventional messagename 是小写字母、数字和连字符(最多 64 个字符)。若省略,Matcha CLI 用目录名。description 决定何时自动调用 — 写上触发短语。
有用的可选 frontmatter:when-to-use、allowed-tools、argument-hint、user-invocable(默认 true)、disable-model-invocation(为 true 时仅斜杠调用)。
交互式创建:`/create-skill`
/create-skillMatcha CLI 会问名称、范围和工作流。**Project** 写入 <repo>/.matcha/skills/<name>/(可进 git 共享)。**User** 写入 ~/.matcha/skills/<name>/。短暂重新加载后,技能出现在斜杠菜单。
运行技能
输入 / 和技能名:
/commit
/commit fix the build名称后面的参数会传进技能。用 /skills 浏览 **Skills** 标签页(与 /hooks、/plugins 同一个扩展模态框)。
名字冲突
内置命令保留裸名(/login、/compact,…)。冲突的技能仍可用带前缀的名字:local:、repo:、user:,或插件名:
/local:commit
/user:commit
/acme:login斜杠菜单会给两行打标(built-in 与 skill · …)。matcha inspect 把冲突标成 [collides with /login → /acme:login]。
看已加载的内容
matcha inspect
matcha inspect --json每个技能标为 project、user、bundled、config,或 plugin: <name>。停用的技能仍列出,带 [disabled]。
随附技能缓存在 ~/.matcha/bundled/skills/。它们从不写入 ~/.matcha/skills/。同名的本地、仓库或用户技能会覆盖随附副本。同名的插件技能 **不会** 覆盖原生技能;用带前缀的 plugin:name 形式。
目前没有什么
- **远程技能目录** — 没有可浏览的服务器同步技能库。
matcha inspect里若出现server来源,会表示托管工作区同步。这条路径不是首发渠道。
你应该看到
| 你运行了 | 结果 |
|---|---|
保存了 ~/.matcha/skills/commit/SKILL.md | 斜杠菜单里出现 /commit |
/create-skill | 新文件夹 + SKILL.md |
冲突后的 /local:commit | 项目技能,不是内置命令 |
matcha inspect | 每个技能标上来源 |