psmgr 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/rules/changelog-rules.md +38 -0
- package/.agents/rules/code-standards-rules.md +74 -0
- package/.agents/rules/project-rules.md +126 -0
- package/.agents/rules/skill-lifecycle-rules.md +34 -0
- package/.agents/rules/skill-scheduling-rules.md +119 -0
- package/.agents/rules/templates/code-standards-go.md +14 -0
- package/.agents/rules/templates/code-standards-node.md +14 -0
- package/.agents/rules/templates/code-standards-python.md +15 -0
- package/.agents/rules/templates/code-standards-rust.md +14 -0
- package/.agents/rules/templates/project-rules-base.md +119 -0
- package/.agents/rules/version-management-rules.md +85 -0
- package/.agents/skills/INDEX.md +160 -0
- package/.agents/skills/generating-changelogs/SKILL.md +87 -0
- package/.agents/skills/installing-project-skills/SKILL.md +274 -0
- package/.agents/skills/managing-project-skills/SKILL.md +97 -0
- package/.agents/skills/scheduling-project-skills/SKILL.md +70 -0
- package/.agents/skills-config.template.json +21 -0
- package/.agents/skills-registry.json +172 -0
- package/.agents/tools.json +70 -0
- package/LICENSE +21 -0
- package/README.md +133 -0
- package/bin/psm.js +2004 -0
- package/package.json +50 -0
- package/scripts/bootstrap.js +145 -0
- package/scripts/bootstrap.sh +157 -0
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
# 技能树 INDEX
|
|
2
|
+
|
|
3
|
+
> 🎯 **任何 AI Agent / AI IDE 的统一导航入口** — 安装后优先读取此文件了解技能结构
|
|
4
|
+
> 由 psm install 自动生成 — 运行 `npx psm install --yes` 重新生成
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## 🤖 Agent 使用协议
|
|
9
|
+
|
|
10
|
+
任何 AI Agent 在加载本项目后,应按以下流程操作:
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
1. 读取本 INDEX.md ──────────────── 了解技能树结构和路由规则
|
|
14
|
+
2. 根据用户输入 + 项目上下文 ─────── 匹配「导航指南」或「条件路由」表
|
|
15
|
+
3. 加载对应的 L2 SKILL.md ───────── 技能文件含完整执行流程
|
|
16
|
+
4. 多技能任务 → 加载 skill-scheduling-rules.md
|
|
17
|
+
5. 执行完成 → 更新任务状态
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
**核心原则:** Agent 不应跳过技能树直接执行。先路由,再执行。
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## 🌳 技能树总览
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
L0: managing-project-skills(根节点 — 用户入口)
|
|
28
|
+
│
|
|
29
|
+
├── L1: 🔧 生命周期管理
|
|
30
|
+
│ └── L2: installing-project-skills — 安装/更新/卸载/查看技能
|
|
31
|
+
│
|
|
32
|
+
├── L1: 📋 任务调度
|
|
33
|
+
│ └── L2: scheduling-project-skills — 技能编排/难度分级/场景映射
|
|
34
|
+
│
|
|
35
|
+
└── L1: 📦 版本发布
|
|
36
|
+
└── L2: generating-changelogs — 从 git commit 生成 CHANGELOG.md
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## 🧭 导航指南(按用户意图路由)
|
|
42
|
+
|
|
43
|
+
### 流程:用户发来消息 → 匹配 L1 类别 → 加载 L2 技能
|
|
44
|
+
|
|
45
|
+
| 用户说/场景 | → 匹配 L1 | → 加载 L2 技能 |
|
|
46
|
+
|------------|----------|---------------|
|
|
47
|
+
| "安装技能和规则" / "setup skills" | 🔧 生命周期管理 | `installing-project-skills` |
|
|
48
|
+
| "更新/升级/卸载技能 xxx" | 🔧 生命周期管理 | `installing-project-skills` |
|
|
49
|
+
| "查看技能" / "技能状态" | 🔧 生命周期管理 | `installing-project-skills` |
|
|
50
|
+
| 多技能编排/判断难度/复杂任务 | 📋 任务调度 | `scheduling-project-skills` |
|
|
51
|
+
| "更新更新日志为 vx.x.x" | 📦 版本发布 | `generating-changelogs` |
|
|
52
|
+
| "版本管理" / "版本规范" | 📦 版本发布 | 检查 `version-management-rules.md` |
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## 🔀 条件路由(按项目上下文路由)
|
|
57
|
+
|
|
58
|
+
> 当用户意图不明确或涉及多个领域时,根据项目上下文自动选择路径。
|
|
59
|
+
|
|
60
|
+
| 项目上下文 | 用户意图模糊时 → 默认路径 | 说明 |
|
|
61
|
+
|-----------|------------------------|------|
|
|
62
|
+
| 项目无 `.agents/skills/` | → 直接触发 `installing-project-skills` full-install | 首次配置 |
|
|
63
|
+
| 项目有 `package.json` + React/Vue | → 优先路由到前端相关技能链 | 技术栈感知 |
|
|
64
|
+
| 项目有 `Cargo.toml` | → 路由到 Rust 工程链 | 内存安全/并发 |
|
|
65
|
+
| 项目有 `go.mod` | → 路由到 Go 微服务链 | 微服务/网络 |
|
|
66
|
+
| 项目有 `requirements.txt` / `pyproject.toml` | → 路由到 Python 数据链 | 数据处理/ML |
|
|
67
|
+
| 项目有 `package.json` + UI 框架 | → 额外评估前端设计技能(见 registry) | 设计技能匹配 |
|
|
68
|
+
| 用户说"帮我看看这个项目" | → 先 `installing-project-skills` status check | 快速诊断 |
|
|
69
|
+
| 错误信息中带有 stack trace | → 加载 `scheduling-project-skills` + 调试场景 | 异常处理 |
|
|
70
|
+
|
|
71
|
+
> **优先级:** 条件路由 > 导航指南。即项目上下文匹配时优先走条件路由,否则根据用户意图走导航指南。
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## 📂 文件索引
|
|
76
|
+
|
|
77
|
+
| 文件 | 树路径 | 用途 |
|
|
78
|
+
|------|-------|------|
|
|
79
|
+
| `managing-project-skills/SKILL.md` | `root` | 根节点,L0 入口调度 |
|
|
80
|
+
| `installing-project-skills/SKILL.md` | `lifecycle/install` | L2,安装/更新/卸载/查看 |
|
|
81
|
+
| `scheduling-project-skills/SKILL.md` | `schedule/orchestrate` | L2,编排/调度/难度分级 |
|
|
82
|
+
| `generating-changelogs/SKILL.md` | `release/changelog` | L2,更新日志生成 |
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## 🔌 跨平台兼容矩阵
|
|
87
|
+
|
|
88
|
+
| 平台 | 技能识别方式 | 规则加载方式 | 兼容状态 | 启用方式 |
|
|
89
|
+
|------|-------------|-------------|---------|---------|
|
|
90
|
+
| **Trae** | `.agents/skills/` 自动识别 | `.agents/rules/` 自动加载 | ✅ 原生支持 | 无需配置 |
|
|
91
|
+
| **Cursor** | `.cursor/rules/` + AGENTS.md | 文件匹配 | ⚠️ 需配置 | 安装后运行 `npx psm setup --cursor` |
|
|
92
|
+
| **Windsurf** | `.windsurf/` 目录 | 特定目录 | ⚠️ 需配置 | 安装后运行 `npx psm setup --windsurf` |
|
|
93
|
+
| **Claude Code** | `CLAUDE.md` | 全量 prompt | ⚠️ 部分支持 | 安装后 AGENTS.md 自动注入技能树入口 |
|
|
94
|
+
| **GitHub Copilot** | `.github/copilot-instructions.md` | 指令文件 | ❌ 未适配 | 需要手动配置 |
|
|
95
|
+
| **Cline / Roo Code** | `CLINE.md` / `ROO.md` | 全量 prompt | ❌ 未适配 | 暂无适配计划 |
|
|
96
|
+
|
|
97
|
+
> 平台适配层规划见 `.agents/adapters/`(未来版本)。
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## ⚡ 按需加载决策表
|
|
102
|
+
|
|
103
|
+
| 触发条件 | 操作 | 加载方式 |
|
|
104
|
+
|---------|------|---------|
|
|
105
|
+
| 用户说「更新更新日志」「发布」「打 tag」 | 读取 `version-management-rules.md` 并应用 | 按需加载 |
|
|
106
|
+
| 用户说「修改代码」「新增」「提交代码」 | 读取 `code-standards-rules.md` 检查规范 | 按需加载 |
|
|
107
|
+
| 用户说「安装/更新/卸载技能」 | 读取 `skill-lifecycle-rules.md` 执行生命周期 | 按需加载 |
|
|
108
|
+
| 技能执行时编排任务 | 读取 `skill-scheduling-rules.md` 决定调度策略 | 按需加载 |
|
|
109
|
+
| 用户说「更新更新日志为 vx.x.x」 | 读取 `changelog-rules.md` 生成更新日志 | 按需加载 |
|
|
110
|
+
| 未匹配以上条件 | 仅使用 `project-rules.md`(已全量加载) | 全量加载 |
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## 🛍️ 可安装技能市场
|
|
115
|
+
|
|
116
|
+
> 以下技能来自 `.agents/skills-registry.json`,可根据项目技术栈安装。
|
|
117
|
+
|
|
118
|
+
| 来源 | 技能 | 适用项目 | 安装条件 |
|
|
119
|
+
|------|------|---------|---------|
|
|
120
|
+
| superpowers | TDD、系统调试、验证循环 | 任何项目 | ✅ 始终推荐 |
|
|
121
|
+
| karpathy | 工程规范、调试方法论 | 任何项目 | ✅ 始终推荐 |
|
|
122
|
+
| ecc | React/Vue 前端、Jest/Cypress 测试 | Node/前端项目 | ⚠️ 技术栈匹配 |
|
|
123
|
+
| impeccable | 代码审查、UI 设计 | 前端/全栈项目 | ⚠️ 有 UI 框架 |
|
|
124
|
+
| taste-skill | 设计品味、前端美学 | 前端/全栈项目 | ⚠️ 有 UI 框架 |
|
|
125
|
+
| gitnexus | Git 代码智能(自管理) | 任何 Git 项目 | 🔄 自管理(CLI 安装) |
|
|
126
|
+
| codegraph | 符号搜索/调用图(自管理) | 任何项目 | 🔄 自管理(CLI 安装) |
|
|
127
|
+
|
|
128
|
+
> 用户自定义源:在项目根目录创建 `.agents/skills-config.json` 可添加私有技能源。
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
## 🔧 工具依赖管理
|
|
133
|
+
|
|
134
|
+
> 以下工具为技能提供 CLI/MCP 能力。通过 `psm tool install` 交互式安装,支持 CLI 和 MCP 两种方式。
|
|
135
|
+
|
|
136
|
+
| 工具 | 用途 | CLI 安装 | MCP 配置 | 状态索引 |
|
|
137
|
+
|------|------|---------|---------|---------|
|
|
138
|
+
| **codegraph** | 符号搜索、调用图、影响分析 | `curl ... install.sh \| sh` | `codegraph install` 自动配置 IDE | `.agents/tools.json` |
|
|
139
|
+
| **gitnexus** | Git blame、日志分析、变更影响 | `npm install -g gitnexus` | 自动写入 `.mcp.json` | `.agents/tools.json` |
|
|
140
|
+
|
|
141
|
+
**命令:**
|
|
142
|
+
- `npx psm tool list` — 查看所有工具安装状态、路径、已验证的子命令
|
|
143
|
+
- `npx psm tool install <name>` — 交互式安装(选 CLI 还是 MCP)
|
|
144
|
+
- `npx psm tool setup` — 扫描已安装技能,批量安装缺失工具
|
|
145
|
+
- `npx psm tool verify` — 重新验证已安装工具的所有子命令可用性
|
|
146
|
+
|
|
147
|
+
**调用方式:** 技能通过读取 `.agents/tools.json` 获取工具的安装路径和可用命令。例如 `codegraph query` 在 tools.json 中记录为 `verified: true`,技能可直接调用。MCP 方式则通过 IDE 的 MCP 服务器配置调用,无需手动管理命令路径。
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## 相关工具
|
|
152
|
+
|
|
153
|
+
| 工具 | 用途 | 位置 |
|
|
154
|
+
|------|------|------|
|
|
155
|
+
| `psm` CLI | 安装/更新/卸载技能和规则 | `npx psm install` |
|
|
156
|
+
| `bootstrap.js` | 跨平台项目检测 + 技能安装状态 | `scripts/bootstrap.js` |
|
|
157
|
+
| `bootstrap.sh` | Linux/macOS 版项目检测 | `scripts/bootstrap.sh` |
|
|
158
|
+
| `skills-registry.json` | 技能注册中心(可扩展) | `.agents/skills-registry.json` |
|
|
159
|
+
|
|
160
|
+
> **注意:** 本 INDEX.md 由 psm 维护。任何 AI IDE(Cursor / Windsurf / Trae / Claude Code / GitHub Copilot)均可通过读取此文件理解技能树结构。
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: generating-changelogs
|
|
3
|
+
description: Use when the user says "更新更新日志为 vx.x.x" or "update changelog" or any request to generate or update a CHANGELOG.md from git history
|
|
4
|
+
tree: release/changelog
|
|
5
|
+
version: 1.0.0
|
|
6
|
+
author: JiunianTV
|
|
7
|
+
requires: []
|
|
8
|
+
requires_tools:
|
|
9
|
+
- git
|
|
10
|
+
platforms:
|
|
11
|
+
- cursor
|
|
12
|
+
- windsurf
|
|
13
|
+
- trae
|
|
14
|
+
- claude-code
|
|
15
|
+
tags:
|
|
16
|
+
- release
|
|
17
|
+
- changelog
|
|
18
|
+
- versioning
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
# Generating Changelogs
|
|
22
|
+
|
|
23
|
+
> 📍 **技能树位置:L1/L2 — 版本发布/更新日志** — 受 managing-project-skills(根节点)分派
|
|
24
|
+
|
|
25
|
+
## Overview
|
|
26
|
+
|
|
27
|
+
Collects commits since the last tag, classifies them by type, and writes a formatted CHANGELOG.md entry.
|
|
28
|
+
|
|
29
|
+
## Trigger
|
|
30
|
+
|
|
31
|
+
User says: "更新更新日志为 vx.x.x" or "发布新版本" or "打 tag" or equivalent.
|
|
32
|
+
|
|
33
|
+
## Version Management Dependency
|
|
34
|
+
|
|
35
|
+
Before executing, check if `.agents/rules/version-management-rules.md` exists:
|
|
36
|
+
|
|
37
|
+
- **Exists:** Load it first — it may contain project-specific version numbering, CHANGELOG format, or release process customizations. Apply those rules instead of the defaults below.
|
|
38
|
+
- **Missing:** Use the default flow below. Consider suggesting the user run `npx psm install --preview` to detect and extract version management rules from AGENTS.md/CLAUDE.md.
|
|
39
|
+
|
|
40
|
+
> **Note:** If the project has custom version management rules in AGENTS.md/CLAUDE.md that were not extracted to `.agents/rules/version-management-rules.md`, the behavior may be inconsistent. Recommend extraction for consistency.
|
|
41
|
+
|
|
42
|
+
## Flow
|
|
43
|
+
|
|
44
|
+
### 1. Collect Commits
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
# Get the last tag
|
|
48
|
+
git describe --tags --abbrev=0
|
|
49
|
+
# Get commits since that tag
|
|
50
|
+
git log <last-tag>..HEAD --oneline
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### 2. Classify by Type
|
|
54
|
+
|
|
55
|
+
| Category | Emoji | Keywords |
|
|
56
|
+
|---|---|---|
|
|
57
|
+
| New feature | 🎉 新增 | feat:, feature, 新增, add |
|
|
58
|
+
| UX polish | ✨ 优化 | improve, optimize, enhance, perf |
|
|
59
|
+
| Bug fix | 🔧 修复 | fix:, bug, patch, 修复 |
|
|
60
|
+
| Config | ⚡ 调整 | config, setting, param, env |
|
|
61
|
+
| Refactor | 🏗️ 重构 | refactor:, restructure, 重构 |
|
|
62
|
+
| Documentation | 📊 文档 | docs:, doc, readme, 文档 |
|
|
63
|
+
| Style | 🎨 样式 | style, css, ui, theme, 样式 |
|
|
64
|
+
|
|
65
|
+
Use conventional commit prefixes when available; otherwise infer from message semantics.
|
|
66
|
+
|
|
67
|
+
### 3. Output Format
|
|
68
|
+
|
|
69
|
+
```markdown
|
|
70
|
+
## v{x.y.z} - {YYYY-MM-DD}
|
|
71
|
+
|
|
72
|
+
### 🎉 新增
|
|
73
|
+
- Feature 1
|
|
74
|
+
- Feature 2
|
|
75
|
+
|
|
76
|
+
### ✨ 优化
|
|
77
|
+
- Improvement 1
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### 4. Version Bump
|
|
81
|
+
|
|
82
|
+
Update version in: `package.json`, `pyproject.toml`, `VERSION`, and CHANGELOG.md header.
|
|
83
|
+
|
|
84
|
+
### 5. CHANGELOG.md Location
|
|
85
|
+
|
|
86
|
+
- Prepend to existing `CHANGELOG.md` in project root
|
|
87
|
+
- Create one if none exists
|
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: installing-project-skills
|
|
3
|
+
description: Use when installing skills for a new project, or when the user asks to update, upgrade, uninstall, or check status of project skills
|
|
4
|
+
tree: lifecycle/install
|
|
5
|
+
version: 1.0.0
|
|
6
|
+
author: JiunianTV
|
|
7
|
+
requires: []
|
|
8
|
+
requires_tools:
|
|
9
|
+
- git
|
|
10
|
+
- node (>=18)
|
|
11
|
+
platforms:
|
|
12
|
+
- cursor
|
|
13
|
+
- windsurf
|
|
14
|
+
- trae
|
|
15
|
+
- claude-code
|
|
16
|
+
tags:
|
|
17
|
+
- lifecycle
|
|
18
|
+
- install
|
|
19
|
+
- upgrade
|
|
20
|
+
- uninstall
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
# Installing Project Skills
|
|
24
|
+
|
|
25
|
+
> 📍 **技能树位置:L1/L2 — 生命周期管理/安装** — 受 managing-project-skills(根节点)分派
|
|
26
|
+
|
|
27
|
+
## Overview
|
|
28
|
+
|
|
29
|
+
Covers the full lifecycle of project skills: first-time install, migration from other directories, upgrade from upstream repos, uninstall, and status checks.
|
|
30
|
+
|
|
31
|
+
## When to Use
|
|
32
|
+
|
|
33
|
+
- User says "安装技能和规则" / "setup skills" — full install
|
|
34
|
+
- User says "更新技能" / "升级技能" / "同步技能" — upgrade existing
|
|
35
|
+
- User says "卸载技能 xxx" — remove a skill
|
|
36
|
+
- User says "查看技能" / "技能状态" — list and verify
|
|
37
|
+
- User says "有什么技能适合我" / "推荐技能" / "discover skills" — skill discovery
|
|
38
|
+
|
|
39
|
+
## Skill Discovery
|
|
40
|
+
|
|
41
|
+
When the user asks what skills are available or suitable for their project:
|
|
42
|
+
|
|
43
|
+
1. **Read the registry** — open `.agents/skills-registry.json` and list all available sources
|
|
44
|
+
2. **Scan project tech stack** — detect `package.json` / `go.mod` / `Cargo.toml` / `requirements.txt`
|
|
45
|
+
3. **Filter by tech stack** — match registry source `filter` and `match` rules against project deps
|
|
46
|
+
4. **Show recommendations** — present a table of available skills with:
|
|
47
|
+
- ✅ **always** — recommended for every project
|
|
48
|
+
- ⚠️ **tech-stack** — only if project dependencies match
|
|
49
|
+
- 🔄 **self-managed** — installed via their own CLI
|
|
50
|
+
5. **Ask user** which ones to install, then proceed to Core Flow step 5 (confirmation)
|
|
51
|
+
|
|
52
|
+
Also check `.agents/skills-config.json` for user-defined custom sources and include them in the recommendation list.
|
|
53
|
+
|
|
54
|
+
## Core Flow
|
|
55
|
+
|
|
56
|
+
### 1. Detect Project Info
|
|
57
|
+
|
|
58
|
+
Read `package.json` / `requirements.txt` / `Cargo.toml` / `go.mod` to determine tech stack. If none found, ask.
|
|
59
|
+
|
|
60
|
+
### 2. Scan Existing Skills
|
|
61
|
+
|
|
62
|
+
Search `**/SKILL.md` and `**/skill.md` across the project. Target dirs: `.agents/skills/`, `.trae/skills/`, `skills/`, `.skills/`, `docs/skills/`.
|
|
63
|
+
|
|
64
|
+
**Self-managed tools (DO NOT migrate):** GitNexus, codegraph — they manage their own skill dirs via CLI.
|
|
65
|
+
|
|
66
|
+
### 2.5. Scan & Extract Existing Rules from AGENTS.md / CLAUDE.md
|
|
67
|
+
|
|
68
|
+
**Why:** Projects often have version management and code standards rules embedded in AGENTS.md or CLAUDE.md. These should be extracted to `.agents/rules/` so they become discoverable by psm and don't duplicate across files.
|
|
69
|
+
|
|
70
|
+
**Detection:** Scan AGENTS.md and CLAUDE.md for these patterns:
|
|
71
|
+
|
|
72
|
+
| Rule type | Search keywords |
|
|
73
|
+
|-----------|----------------|
|
|
74
|
+
| 版本管理 | 版本管理、版本更新、版本号、versioning、changelog、更新日志、release |
|
|
75
|
+
| 代码规范 | 代码规范、编码规范、提交规范、code style、commit convention、代码风格、lint |
|
|
76
|
+
|
|
77
|
+
**Action for each detected match:**
|
|
78
|
+
|
|
79
|
+
1. **Ask the user:** "检测到 AGENTS.md 中包含版本管理/代码规范规则。要提取到 `.agents/rules/` 并替换为引用吗?"
|
|
80
|
+
2. **If yes:** Extract the section(s) to the corresponding rule file (`version-management-rules.md` or `code-standards-rules.md`), then replace the original section in AGENTS.md with a short reference: `> **版本管理:** 详见 \`.agents/rules/version-management-rules.md\``
|
|
81
|
+
3. **If no:** Leave as-is, but record in INDEX.md as "未提取(用户选择保留)"
|
|
82
|
+
4. **If AGENTS.md doesn't exist:** Generate AGENTS.md with the required loading chain reference
|
|
83
|
+
|
|
84
|
+
**Loading chain:** Ensure AGENTS.md has the mandatory skill tree entry. If not, inject:
|
|
85
|
+
```markdown
|
|
86
|
+
## psm 技能树入口
|
|
87
|
+
|
|
88
|
+
读取 `.agents/skills/INDEX.md` 了解技能树和按需加载规则。
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
**CLAUDE.md:** If CLAUDE.md exists and doesn't have `@AGENTS.md`, prepend it. This is automatically handled by `npx psm install`.
|
|
92
|
+
|
|
93
|
+
### 3. Read Skill Registry
|
|
94
|
+
|
|
95
|
+
Read `.agents/skills-registry.json` to discover available skill sources. The registry defines:
|
|
96
|
+
|
|
97
|
+
- **Source name & URL** — where to clone from
|
|
98
|
+
- **Filter rule** — `always` (install for every project) or `tech-stack` (only when dependencies match)
|
|
99
|
+
- **Skill list** — which skills each source provides
|
|
100
|
+
- **selfManaged** — tools that manage their own skill directories (GitNexus, codegraph), skip migration
|
|
101
|
+
|
|
102
|
+
```json
|
|
103
|
+
// 示例:skills-registry.json 结构
|
|
104
|
+
{
|
|
105
|
+
"sources": [
|
|
106
|
+
{ "name": "superpowers", "filter": "always" },
|
|
107
|
+
{ "name": "ecc", "filter": "tech-stack", "match": { "dependencies": ["react", "vue"] } },
|
|
108
|
+
{ "name": "gitnexus", "selfManaged": true }
|
|
109
|
+
],
|
|
110
|
+
"customSources": { "hint": "新建 .agents/skills-config.json 可自定义源" }
|
|
111
|
+
}
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
**Self-managed tools** (marked `selfManaged: true`): they automatically download/update skills to their own directories via CLI. Detect and skip during migration — do NOT move them into `.agents/skills/`.
|
|
115
|
+
|
|
116
|
+
**Design skill evaluation rule:** For sources with `filter: tech-stack`, check the project's dependency files (`package.json`, `go.mod`, etc.) against the `match` criteria. Only install when the project's dependencies satisfy the match.
|
|
117
|
+
|
|
118
|
+
### 3a. Custom Sources (User Config)
|
|
119
|
+
|
|
120
|
+
Check if `.agents/skills-config.json` exists in the project. If it does, merge its `customSources` into the registry:
|
|
121
|
+
|
|
122
|
+
```json
|
|
123
|
+
// .agents/skills-config.json — 用户自定义技能源
|
|
124
|
+
{
|
|
125
|
+
"customSources": [
|
|
126
|
+
{
|
|
127
|
+
"name": "my-team-skills",
|
|
128
|
+
"url": "https://github.com/myorg/team-skills",
|
|
129
|
+
"filter": "always",
|
|
130
|
+
"skills": ["my-standards", "my-deployment"]
|
|
131
|
+
}
|
|
132
|
+
],
|
|
133
|
+
"ignore": ["impeccable-ui"], // 强制忽略某些技能
|
|
134
|
+
"alwaysInstall": ["my-standards"] // 强制安装某些技能
|
|
135
|
+
}
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
**Template:** `.agents/skills-config.template.json` can be copied as a starting point.
|
|
139
|
+
**Note:** This file is NEVER overwritten by `psm install`, so users can safely customize it.
|
|
140
|
+
|
|
141
|
+
### 4. Tech-Stack Filtering
|
|
142
|
+
|
|
143
|
+
| Project type | Priority skills |
|
|
144
|
+
|---|---|
|
|
145
|
+
| Node/frontend (package.json) | Design, testing, code-quality |
|
|
146
|
+
| Python (requirements.txt/pyproject.toml) | Data, ML, API |
|
|
147
|
+
| Rust (Cargo.toml) | Memory-safe, concurrent |
|
|
148
|
+
| Go (go.mod) | Microservice, container |
|
|
149
|
+
| Full-stack | Combined from both tiers |
|
|
150
|
+
|
|
151
|
+
### 5. User Confirmation & Customization
|
|
152
|
+
|
|
153
|
+
**Before any files are written**, present a full checklist to the user and let them customize:
|
|
154
|
+
|
|
155
|
+
#### 5a. Present the Checklist
|
|
156
|
+
|
|
157
|
+
Show the user a structured summary:
|
|
158
|
+
|
|
159
|
+
```
|
|
160
|
+
📋 安装计划确认
|
|
161
|
+
|
|
162
|
+
【待安装】来自上游仓库
|
|
163
|
+
□ superpowers/test-driven-development
|
|
164
|
+
□ superpowers/systematic-debugging
|
|
165
|
+
□ karpathy/karpathy-engineering
|
|
166
|
+
□ ECC/frontend-react ← 仅在匹配技术栈时
|
|
167
|
+
□ impeccable/impeccable-ui ← 仅在有 UI 框架时
|
|
168
|
+
|
|
169
|
+
【待迁移】来自旧目录
|
|
170
|
+
□ .trae/skills/xxx → .agents/skills/xxx
|
|
171
|
+
|
|
172
|
+
【待删除】旧目录(迁移完成后)
|
|
173
|
+
□ .trae/skills/
|
|
174
|
+
□ skills/ ← 仅当所有内容已迁移
|
|
175
|
+
□ .skills/
|
|
176
|
+
|
|
177
|
+
【待生成】规则文件
|
|
178
|
+
□ skill-lifecycle-rules.md
|
|
179
|
+
□ skill-scheduling-rules.md
|
|
180
|
+
□ changelog-rules.md
|
|
181
|
+
□ project-rules.md ← 根据项目技术栈动态生成代码规范
|
|
182
|
+
□ version-management-rules.md ← 如 AGENTS.md 中有版本管理规则
|
|
183
|
+
□ code-standards-rules.md ← 如 AGENTS.md 中有代码规范规则
|
|
184
|
+
|
|
185
|
+
【待注入】技能树入口
|
|
186
|
+
□ AGENTS.md → 指向 .agents/skills/INDEX.md
|
|
187
|
+
□ CLAUDE.md → @AGENTS.md(如不存在)
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
#### 5b. Offer Customization Actions
|
|
191
|
+
|
|
192
|
+
For each item, the user can say:
|
|
193
|
+
|
|
194
|
+
| 用户指令 | 处理方式 |
|
|
195
|
+
|---------|---------|
|
|
196
|
+
| "保留 xxx" | Skip deletion, keep the skill/rules as-is where it is |
|
|
197
|
+
| "删除 xxx" | Remove from the install/migrate list entirely |
|
|
198
|
+
| "只安装 xxx 和 yyy" | Prune the list to only the named items |
|
|
199
|
+
| "这个不需要" | Remove that specific item |
|
|
200
|
+
| "先安装全部,再手动清理" | Skip confirmation, proceed with full plan |
|
|
201
|
+
|
|
202
|
+
#### 5c. Apply User Choices
|
|
203
|
+
|
|
204
|
+
After the user confirms (with or without modifications), proceed with the approved list. Skip items the user rejected. Record skipped items in INDEX.md as "用户选择跳过".
|
|
205
|
+
|
|
206
|
+
### 6. Handle Conflicts
|
|
207
|
+
|
|
208
|
+
| Conflict | Action |
|
|
209
|
+
|---|---|
|
|
210
|
+
| Same name, different version | Ask: keep old / install new / keep both (rename) |
|
|
211
|
+
| Functional overlap | Ask user to pick one |
|
|
212
|
+
| Dependency conflict | Auto-select compatible version or report |
|
|
213
|
+
|
|
214
|
+
### 7. Install & Migrate
|
|
215
|
+
|
|
216
|
+
- Move migratable skills into `.agents/skills/<name>/SKILL.md`
|
|
217
|
+
- Keep self-managed tool dirs untouched
|
|
218
|
+
- Install new skills from upstream repos into `.agents/skills/`
|
|
219
|
+
- Record migration history (原位置 → 新位置) in INDEX.md
|
|
220
|
+
|
|
221
|
+
### 8. Clean Up Old Dirs
|
|
222
|
+
|
|
223
|
+
Delete `.trae/skills/`, `skills/`, `.skills/` **only if** all content has been migrated and no self-managed tools remain.
|
|
224
|
+
|
|
225
|
+
### 9. Tool Dependency Resolution
|
|
226
|
+
|
|
227
|
+
For each skill that declares `requires_tools` in its frontmatter:
|
|
228
|
+
|
|
229
|
+
1. **Check tools.json** — read `.agents/tools.json` to see if the tool has been installed or configured before
|
|
230
|
+
2. **Check system PATH** — run `psm tool list [target]` to see which tools are available
|
|
231
|
+
3. **If not found** — ask the user: "技能 xxx 需要 Y 能力,要安装吗?"
|
|
232
|
+
- 使用 `npx psm tool install <name>` 进行交互式安装(CLI 或 MCP,用户自选)
|
|
233
|
+
- 安装完成后自动更新 `.agents/tools.json`
|
|
234
|
+
4. **Batch check** — run `npx psm tool setup` to scan all installed skills and install missing tools in one go
|
|
235
|
+
|
|
236
|
+
**工具定义来源:** `.agents/skills-registry.json` 中的 `tools` 字段,每个工具定义了:
|
|
237
|
+
- `checkCommand` — 检测是否已安装
|
|
238
|
+
- `cli` — CLI 安装命令和安装后配置
|
|
239
|
+
- `mcp` — MCP 服务器配置方式(command + args)
|
|
240
|
+
|
|
241
|
+
**自管理工具**(如 GitNexus、CodeGraph):它们有自己的 CLI 来管理技能和更新,通过 `psm tool install` 安装后,其技能由自身 CLI 管理,PSM 不做迁移。
|
|
242
|
+
|
|
243
|
+
### 10. Generate INDEX.md
|
|
244
|
+
|
|
245
|
+
List all installed skills with purpose, source, version, and migration notes.
|
|
246
|
+
|
|
247
|
+
---
|
|
248
|
+
|
|
249
|
+
## Upgrade Flow
|
|
250
|
+
|
|
251
|
+
1. Compare installed versions against upstream repos
|
|
252
|
+
2. Identify new applicable skills (based on current tech stack)
|
|
253
|
+
3. **Present upgrade plan** to the user as a checklist (same format as 5a), with:
|
|
254
|
+
- Skills that will be updated
|
|
255
|
+
- New skills that will be installed
|
|
256
|
+
- Skills that will be removed (if upstream dropped them)
|
|
257
|
+
- Whether rules will be overwritten or merged
|
|
258
|
+
4. Let user customize: "保留旧版", "这个不更新", "只更新 xxx" etc.
|
|
259
|
+
5. Download updates; merge custom rules (do NOT overwrite user customizations)
|
|
260
|
+
6. Update INDEX.md; clean up obsolete entries
|
|
261
|
+
|
|
262
|
+
## Uninstall Flow
|
|
263
|
+
|
|
264
|
+
1. Confirm skill name
|
|
265
|
+
2. Remove from `.agents/skills/<name>/`
|
|
266
|
+
3. Remove from INDEX.md
|
|
267
|
+
4. Check if any rule file references it; ask about cleanup
|
|
268
|
+
|
|
269
|
+
## Status Check
|
|
270
|
+
|
|
271
|
+
1. List `.agents/skills/` contents
|
|
272
|
+
2. Show version / source / last-updated for each
|
|
273
|
+
3. Verify dependency tools are installed
|
|
274
|
+
4. Report any unmigrated skills (excluding self-managed dirs)
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: managing-project-skills
|
|
3
|
+
description: Use when the user asks to install, update, upgrade, uninstall, or check status of project skills and rules, or when setting up skills for a new project
|
|
4
|
+
tree: root
|
|
5
|
+
version: 1.0.0
|
|
6
|
+
author: JiunianTV
|
|
7
|
+
requires:
|
|
8
|
+
- installing-project-skills
|
|
9
|
+
- scheduling-project-skills
|
|
10
|
+
- generating-changelogs
|
|
11
|
+
requires_tools:
|
|
12
|
+
- git
|
|
13
|
+
platforms:
|
|
14
|
+
- cursor
|
|
15
|
+
- windsurf
|
|
16
|
+
- trae
|
|
17
|
+
- claude-code
|
|
18
|
+
tags:
|
|
19
|
+
- core
|
|
20
|
+
- orchestrator
|
|
21
|
+
- lifecycle
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
# Managing Project Skills
|
|
25
|
+
|
|
26
|
+
> 📍 **技能树位置:L0 — 根节点** — 所有技能调度的统一入口
|
|
27
|
+
> 子节点:L1「生命周期管理」→ [installing-project-skills] / L1「任务调度」→ [scheduling-project-skills] / L1「版本发布」→ [generating-changelogs]
|
|
28
|
+
|
|
29
|
+
## Overview
|
|
30
|
+
|
|
31
|
+
Orchestration entry point for project skill management. Dispatches to the appropriate sub-skill based on the user's intent.
|
|
32
|
+
|
|
33
|
+
## First-Load Detection
|
|
34
|
+
|
|
35
|
+
### 1. Check INDEX.md
|
|
36
|
+
If **`.agents/skills/INDEX.md` is missing or empty**, the project has not yet run skill installation.
|
|
37
|
+
|
|
38
|
+
### 2. Check for Unextracted Rules
|
|
39
|
+
If INDEX.md exists, check AGENTS.md and CLAUDE.md for version management or code standards rules that should have been extracted to `.agents/rules/`.
|
|
40
|
+
|
|
41
|
+
Look for these patterns in AGENTS.md/CLAUDE.md:
|
|
42
|
+
|
|
43
|
+
| Rule type | Detection keywords | Expected location |
|
|
44
|
+
|-----------|-------------------|------------------|
|
|
45
|
+
| 版本管理 | 版本管理、版本更新、版本号、versioning、changelog、更新日志 | `.agents/rules/version-management-rules.md` |
|
|
46
|
+
| 代码规范 | 代码规范、编码规范、提交规范、code style、commit convention | `.agents/rules/code-standards-rules.md` |
|
|
47
|
+
|
|
48
|
+
If patterns found but rule files missing, warn the user:
|
|
49
|
+
> "检测到 AGENTS.md/CLAUDE.md 中包含版本管理/代码规范规则,但未提取到 `.agents/rules/`。建议运行 `npx psm install --yes` 来自动提取。"
|
|
50
|
+
|
|
51
|
+
### 3. Bootstrap hint
|
|
52
|
+
If INDEX.md missing, print:
|
|
53
|
+
> "检测到技能尚未安装。在 IDE 中输入「安装技能和规则」即可自动扫描项目并安装匹配的技能。"
|
|
54
|
+
> 或运行 `node scripts/bootstrap.js` 查看项目检测报告和引导信息
|
|
55
|
+
|
|
56
|
+
### 4. Proceed
|
|
57
|
+
Then proceed to [installing-project-skills] when the user confirms.
|
|
58
|
+
|
|
59
|
+
## 技能树调度(L0 → L1 → L2)
|
|
60
|
+
|
|
61
|
+
> 使用树形分层调度:先匹配 L1 类别(用户意图所属域),再分派到 L2 具体技能。
|
|
62
|
+
> 完整的技能树结构见 `.agents/skills/INDEX.md`
|
|
63
|
+
|
|
64
|
+
### 技能树结构
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
L0: managing-project-skills(根节点 — 统一入口)
|
|
68
|
+
│
|
|
69
|
+
├── L1: 🔧 生命周期管理
|
|
70
|
+
│ └── L2: [installing-project-skills] — 安装/更新/卸载/查看
|
|
71
|
+
│
|
|
72
|
+
├── L1: 📋 任务调度
|
|
73
|
+
│ └── L2: [scheduling-project-skills] — 编排/难度分级/场景映射
|
|
74
|
+
│
|
|
75
|
+
└── L1: 📦 版本发布
|
|
76
|
+
└── L2: [generating-changelogs] — 更新日志生成
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### L0 → L1 匹配规则
|
|
80
|
+
|
|
81
|
+
| 用户意图 | 匹配的 L1 类别 | 匹配后再加载的 L2 技能 |
|
|
82
|
+
|---------|---------------|----------------------|
|
|
83
|
+
| "安装技能和规则" / "setup skills" / 首次配置 | 🔧 生命周期管理 | [installing-project-skills] — full install flow |
|
|
84
|
+
| "更新技能" / "升级技能" / "同步技能" | 🔧 生命周期管理 | [installing-project-skills] — upgrade flow |
|
|
85
|
+
| "卸载技能 xxx" | 🔧 生命周期管理 | [installing-project-skills] — uninstall flow |
|
|
86
|
+
| "查看技能" / "技能状态" | 🔧 生命周期管理 | [installing-project-skills] — status check |
|
|
87
|
+
| 技能执行时编排任务 | 📋 任务调度 | [scheduling-project-skills] |
|
|
88
|
+
| "更新更新日志为 vx.x.x" / "changelog" | 📦 版本发布 | [generating-changelogs] |
|
|
89
|
+
| "版本管理规则" / "版本规范" / "版本号" | 📦 版本发布 | 检查 .agents/rules/version-management-rules.md |
|
|
90
|
+
|
|
91
|
+
## Cross-references## Cross-references
|
|
92
|
+
|
|
93
|
+
- **REQUIRED SUB-SKILL:** [installing-project-skills] — lifecycle management
|
|
94
|
+
- **REQUIRED SUB-SKILL:** [scheduling-project-skills] — task orchestration
|
|
95
|
+
- **REQUIRED SUB-SKILL:** [generating-changelogs] — changelog generation
|
|
96
|
+
- **REQUIRED RULES:** `.agents/rules/version-management-rules.md` — 版本管理(缺失时提示)
|
|
97
|
+
- **REQUIRED RULES:** `.agents/rules/code-standards-rules.md` — 代码规范(缺失时提示)
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: scheduling-project-skills
|
|
3
|
+
description: Use when orchestrating multiple skills for a task — determining execution order, parallelism, and difficulty grading. Also use when the user asks how skills are dispatched
|
|
4
|
+
tree: schedule/orchestrate
|
|
5
|
+
version: 1.0.0
|
|
6
|
+
author: JiunianTV
|
|
7
|
+
requires: []
|
|
8
|
+
requires_tools: []
|
|
9
|
+
platforms:
|
|
10
|
+
- cursor
|
|
11
|
+
- windsurf
|
|
12
|
+
- trae
|
|
13
|
+
- claude-code
|
|
14
|
+
tags:
|
|
15
|
+
- orchestration
|
|
16
|
+
- scheduling
|
|
17
|
+
- difficulty
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
# Scheduling Project Skills
|
|
21
|
+
|
|
22
|
+
> 📍 **技能树位置:L1/L2 — 任务调度/编排** — 受 managing-project-skills(根节点)分派
|
|
23
|
+
|
|
24
|
+
## Overview
|
|
25
|
+
|
|
26
|
+
Defines how skills are selected, ordered, and executed: difficulty grading (L1-L4), scenario-to-skill mapping, and serial/parallel orchestration.
|
|
27
|
+
|
|
28
|
+
## Difficulty Grading
|
|
29
|
+
|
|
30
|
+
| Level | Difficulty | Max parallel skills | Examples |
|
|
31
|
+
|---|---|---|---|
|
|
32
|
+
| L1 | Simple | 1 | Translation, formatting, simple fixes |
|
|
33
|
+
| L2 | Medium | 2 | Feature implementation, unit tests |
|
|
34
|
+
| L3 | Complex | 3 | Architecture design, multi-module coordination |
|
|
35
|
+
| L4 | Expert | 5 | Performance audit, security review, deep refactor |
|
|
36
|
+
|
|
37
|
+
**L3/L4 special rule:** If `brainstorming` skill is installed, call it first to decompose the task before dispatching other skills.
|
|
38
|
+
|
|
39
|
+
## 技能调度(参考技能树)
|
|
40
|
+
|
|
41
|
+
> 技能选择按树形分层:先在 INDEX.md 中匹配 L1 类别,再加载对应 L2 技能。
|
|
42
|
+
> 完整的调度映射表见 `.agents/skills/INDEX.md` 的导航指南和树形结构。
|
|
43
|
+
|
|
44
|
+
当 L2 技能被选中后,本技能负责其编排策略:决定串行/并行、难度分级、执行顺序。
|
|
45
|
+
|
|
46
|
+
## Skill Selection Priority
|
|
47
|
+
|
|
48
|
+
1. **Project-local first:** `.agents/skills/` over global skills
|
|
49
|
+
2. **Specialized over generic:** e.g. `vue-skill` before `frontend-generic`
|
|
50
|
+
3. **Higher version over lower:** same-function skills
|
|
51
|
+
4. **CLI over MCP:** prefer CLI tools over MCP server calls
|
|
52
|
+
|
|
53
|
+
## Orchestration Patterns
|
|
54
|
+
|
|
55
|
+
| Complexity | Pattern | Example |
|
|
56
|
+
|---|---|---|
|
|
57
|
+
| L1 | Single skill, direct execution | Translate a string |
|
|
58
|
+
| L2 | Main + helper, serial | Implement login → write tests → security check |
|
|
59
|
+
| L3 | Parallel + merge | Understand code + check coverage + analyze deps → merge → plan → refactor |
|
|
60
|
+
| L4 | Multi-agent + cross-verify | Coordinator dispatches sub-agents, results cross-checked |
|
|
61
|
+
|
|
62
|
+
## Pre-execution Checklist
|
|
63
|
+
|
|
64
|
+
- [ ] Task type identified
|
|
65
|
+
- [ ] Difficulty assessed
|
|
66
|
+
- [ ] Relevant skills installed
|
|
67
|
+
- [ ] Dependency tools available
|
|
68
|
+
- [ ] Call order correct (prerequisites first)
|
|
69
|
+
- [ ] Results verified
|
|
70
|
+
- [ ] Multi-skill output merged
|