@heihei0299/matt-skills 3.0.27 → 3.0.29
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/README.md +3 -3
- package/bin/cli.js +21 -29
- package/bin/skill-selection.js +3 -12
- package/config/default.json +13 -0
- package/config/proprietary.json +0 -2
- package/config/required.json +0 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -51,7 +51,7 @@ repo-local skills 不会通过 `init`、`install`、`sync` 分发到用户项目
|
|
|
51
51
|
在目标仓库根目录执行:
|
|
52
52
|
|
|
53
53
|
```sh
|
|
54
|
-
npx @heihei0299/matt-skills init # 安装默认
|
|
54
|
+
npx @heihei0299/matt-skills init # 安装默认 workflow skills
|
|
55
55
|
npx @heihei0299/matt-skills init --all # 安装全部可分发 skills
|
|
56
56
|
```
|
|
57
57
|
|
|
@@ -65,7 +65,7 @@ npx @heihei0299/matt-skills sync --dry-run --json
|
|
|
65
65
|
|
|
66
66
|
`init` 对已有 `AGENTS.md` 始终跳过;已有项目使用 `sync`。默认 `sync` 保留已有 `AGENTS.md` 和项目规则,`--all` 只扩大技能范围。需要显式刷新 `AGENTS.md` 时使用 `sync --refresh-agents`;无受管区块时会先备份为 `AGENTS.md.bak`。`sync` 不删除目标项目的额外文件或自定义 skills。
|
|
67
67
|
|
|
68
|
-
默认
|
|
68
|
+
默认 workflow 范围固定为 11 个入口及依赖 skills,包含 `initialize-project`、`setup-matt-pocock-skills`、`grill-to-spec`、`grill-with-docs`、`to-spec`、`to-tickets`、`tdd-implement`、`grilling`、`domain-modeling`、`tdd` 和 `code-review`;其中默认独有 skills 是 `tdd-implement`、`grill-to-spec`、`initialize-project`。完整可分发集合(包括 `wayfinder`、`handoff` 和 `implement`)仍通过 `--all` 获取。
|
|
69
69
|
|
|
70
70
|
## CLI
|
|
71
71
|
|
|
@@ -79,7 +79,7 @@ npx @heihei0299/matt-skills check [--all] [--json] [--upstream <url>] [--ref <re
|
|
|
79
79
|
|
|
80
80
|
常用选项:
|
|
81
81
|
|
|
82
|
-
- `--all`:包含全部可分发 skills,默认范围只包含
|
|
82
|
+
- `--all`:包含全部可分发 skills,默认范围只包含 workflow skills;不会隐式刷新 `AGENTS.md`。
|
|
83
83
|
- `--refresh-agents`:显式刷新目标 `AGENTS.md`;与 `--all`、`--dry-run` 可组合。
|
|
84
84
|
- `--dest <dir>`:指定目标目录。
|
|
85
85
|
- `--tools <list>`:选择 `codex`、`pi`、`opencode` 或 `claude`;项目级 skills 统一写入 `.agents/skills/`,全局安装仍使用各工具目录。
|
package/bin/cli.js
CHANGED
|
@@ -15,18 +15,11 @@ import { loadSkillSet } from './skill-config.js';
|
|
|
15
15
|
|
|
16
16
|
const SKILLS_DIR = path.join(path.dirname(fileURLToPath(import.meta.url)), '..', '.agents', 'skills');
|
|
17
17
|
const TEMPLATE_DIR = path.join(path.dirname(fileURLToPath(import.meta.url)), '..', 'template');
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
return ENGINEERING_SKILLS;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
let REQUIRED_SKILLS = null;
|
|
27
|
-
async function loadRequiredSkills() {
|
|
28
|
-
if (!REQUIRED_SKILLS) REQUIRED_SKILLS = await loadSkillSet(REQUIRED_PATH, 'required');
|
|
29
|
-
return REQUIRED_SKILLS;
|
|
18
|
+
const DEFAULT_PATH = path.join(path.dirname(fileURLToPath(import.meta.url)), '..', 'config', 'default.json');
|
|
19
|
+
let DEFAULT_SKILLS = null;
|
|
20
|
+
async function loadDefaultSkills() {
|
|
21
|
+
if (!DEFAULT_SKILLS) DEFAULT_SKILLS = await loadSkillSet(DEFAULT_PATH, 'default');
|
|
22
|
+
return DEFAULT_SKILLS;
|
|
30
23
|
}
|
|
31
24
|
process.stdout.on('error', (err) => {
|
|
32
25
|
if (err.code === 'EPIPE') process.exit(0);
|
|
@@ -55,7 +48,7 @@ Usage:
|
|
|
55
48
|
|
|
56
49
|
Init options:
|
|
57
50
|
--dest <path> Target directory (default: current directory)
|
|
58
|
-
--all Include all distributable skills; default only default
|
|
51
|
+
--all Include all distributable skills; default only default workflow skills
|
|
59
52
|
--help, -h Show this help
|
|
60
53
|
提示:已有 AGENTS.md 时 init 始终跳过;需要更新已有项目请使用 sync。
|
|
61
54
|
|
|
@@ -76,7 +69,7 @@ Sync options:
|
|
|
76
69
|
--help, -h Show this help
|
|
77
70
|
项目 skills:${PROJECT_SKILL_DIRS}
|
|
78
71
|
|
|
79
|
-
|
|
72
|
+
说明:默认同步默认 workflow skill 并保留现有 AGENTS.md;--all 只扩大技能范围。
|
|
80
73
|
--refresh-agents 与 --all、--dry-run 可组合;上游检查请使用 check。
|
|
81
74
|
|
|
82
75
|
提示:matt-skills --help 查看全量
|
|
@@ -88,7 +81,7 @@ Usage:
|
|
|
88
81
|
matt-skills list [--all] [--json]
|
|
89
82
|
|
|
90
83
|
List options:
|
|
91
|
-
--all List all distributable skills (default only default
|
|
84
|
+
--all List all distributable skills (default only default workflow skills)
|
|
92
85
|
--json Output as JSON
|
|
93
86
|
--help, -h Show this help
|
|
94
87
|
|
|
@@ -117,7 +110,7 @@ Usage:
|
|
|
117
110
|
|
|
118
111
|
Install options:
|
|
119
112
|
--tools <a,b> Install for the given tools (codex, pi, opencode, claude); skips tool selection
|
|
120
|
-
--all Install all distributable skills (default only default
|
|
113
|
+
--all Install all distributable skills (default only default workflow); skips skill selection
|
|
121
114
|
--force Overwrite existing skills
|
|
122
115
|
--global Install to the user's global skill directories
|
|
123
116
|
--project Install to project skill directories (default)
|
|
@@ -160,8 +153,7 @@ async function listSkillNames({ onlyProgramming = false } = {}) {
|
|
|
160
153
|
return resolveSkillNames({
|
|
161
154
|
availableNames: await listAvailableSkillNames(),
|
|
162
155
|
mode: onlyProgramming ? 'default' : 'all',
|
|
163
|
-
|
|
164
|
-
required: onlyProgramming ? await loadRequiredSkills() : [],
|
|
156
|
+
defaults: onlyProgramming ? await loadDefaultSkills() : [],
|
|
165
157
|
});
|
|
166
158
|
}
|
|
167
159
|
|
|
@@ -317,11 +309,11 @@ async function promptTools() {
|
|
|
317
309
|
|
|
318
310
|
async function promptSkills(skills) {
|
|
319
311
|
const res = await prompts({
|
|
320
|
-
type: '
|
|
312
|
+
type: 'autocompleteMultiselect',
|
|
321
313
|
name: 'skills',
|
|
322
314
|
message: '选择要安装的技能',
|
|
323
315
|
choices: skills.map((s) => ({ title: s.name, value: s.name })),
|
|
324
|
-
instructions: '
|
|
316
|
+
instructions: '输入过滤,空格勾选,回车确认',
|
|
325
317
|
});
|
|
326
318
|
return Array.isArray(res?.skills) ? res.skills : [];
|
|
327
319
|
}
|
|
@@ -410,17 +402,17 @@ async function initCommand({ dest, all }) {
|
|
|
410
402
|
installed = entries.filter((e) => e.isDirectory() && !e.name.endsWith('.bak') && e.name !== '.git' && e.name !== 'skill-creator' && !isRepoLocalSkill(e.name)).length;
|
|
411
403
|
} catch {}
|
|
412
404
|
const allSkillsFull = await listSkills({ onlyProgramming: false });
|
|
413
|
-
const
|
|
414
|
-
const
|
|
405
|
+
const defaultSkills = await listSkills({ onlyProgramming: true });
|
|
406
|
+
const defaultCount = defaultSkills.length;
|
|
415
407
|
const upstreamFull = allSkillsFull.filter((s) => !PROPRIETARY_SKILLS.has(s.name)).length;
|
|
416
|
-
const
|
|
417
|
-
const displayTotal = onlyProgramming ?
|
|
418
|
-
const displayUpstream = onlyProgramming ?
|
|
408
|
+
const upstreamDefault = defaultSkills.filter((s) => !PROPRIETARY_SKILLS.has(s.name)).length;
|
|
409
|
+
const displayTotal = onlyProgramming ? defaultCount : allSkillsFull.length;
|
|
410
|
+
const displayUpstream = onlyProgramming ? upstreamDefault : upstreamFull;
|
|
419
411
|
if (path.resolve(skillsDir) === path.resolve(SKILLS_DIR)) {
|
|
420
|
-
process.stdout.write(`技能:已装 ${installed}、跳过 0(可分发 ${allSkillsFull.length},含上游 ${upstreamFull}
|
|
412
|
+
process.stdout.write(`技能:已装 ${installed}、跳过 0(可分发 ${allSkillsFull.length},含上游 ${upstreamFull};默认 workflow ${defaultCount},含上游 ${upstreamDefault})\n`);
|
|
421
413
|
} else {
|
|
422
414
|
if (onlyProgramming) {
|
|
423
|
-
process.stdout.write(`技能:已装 ${installed}
|
|
415
|
+
process.stdout.write(`技能:已装 ${installed}(默认 workflow ${displayTotal},含上游 ${displayUpstream};可分发 ${allSkillsFull.length},含上游 ${upstreamFull})\n`);
|
|
424
416
|
} else {
|
|
425
417
|
process.stdout.write(`技能:已装 ${installed}(可分发 ${displayTotal},含上游 ${displayUpstream})\n`);
|
|
426
418
|
}
|
|
@@ -454,7 +446,7 @@ async function compareDryRunTrees(target, stage) {
|
|
|
454
446
|
function formatTargetComparison({ target, result, onlyProgramming, refreshAgents }) {
|
|
455
447
|
const lines = [
|
|
456
448
|
`目标: ${target}`,
|
|
457
|
-
`范围: ${onlyProgramming ? '
|
|
449
|
+
`范围: ${onlyProgramming ? '默认 workflow' : '全部可分发'}${refreshAgents ? ';刷新 AGENTS.md' : ''}`,
|
|
458
450
|
'',
|
|
459
451
|
];
|
|
460
452
|
const totalDiff = result.added.length + result.updated.length + result.removed.length;
|
|
@@ -635,7 +627,7 @@ async function syncCommand({ dest, all, dryRun, json, refreshAgents, quiet = fal
|
|
|
635
627
|
if (preservedRepoLocal.length) {
|
|
636
628
|
output(`迁移提示:${preservedRepoLocal.join(', ')} 已不再分发,现有副本已保留\n`);
|
|
637
629
|
}
|
|
638
|
-
const modeLabel = onlyProgramming ? '
|
|
630
|
+
const modeLabel = onlyProgramming ? '默认 workflow' : '全部可分发';
|
|
639
631
|
output(`技能:新增 ${installed}、更新 ${updated}(${modeLabel} ${allSkills.length})\n`);
|
|
640
632
|
output(`目标路径:${target}\n`);
|
|
641
633
|
}
|
package/bin/skill-selection.js
CHANGED
|
@@ -1,25 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
DEFAULT_PROPRIETARY_SKILLS,
|
|
3
|
-
isDistributableSkill,
|
|
4
|
-
} from './skill-boundaries.js';
|
|
1
|
+
import { isDistributableSkill } from './skill-boundaries.js';
|
|
5
2
|
|
|
6
3
|
function asSet(value) {
|
|
7
4
|
return value instanceof Set ? new Set(value) : new Set(value ?? []);
|
|
8
5
|
}
|
|
9
6
|
|
|
10
|
-
export function resolveSkillNames({ availableNames, mode = 'default',
|
|
7
|
+
export function resolveSkillNames({ availableNames, mode = 'default', defaults }) {
|
|
11
8
|
if (mode !== 'default' && mode !== 'all') {
|
|
12
9
|
throw new Error(`unknown skill selection mode: ${mode}`);
|
|
13
10
|
}
|
|
14
11
|
|
|
15
12
|
const available = asSet(availableNames);
|
|
16
|
-
const candidates = mode === 'all'
|
|
17
|
-
? available
|
|
18
|
-
: new Set([
|
|
19
|
-
...asSet(engineering),
|
|
20
|
-
...asSet(required),
|
|
21
|
-
...DEFAULT_PROPRIETARY_SKILLS,
|
|
22
|
-
]);
|
|
13
|
+
const candidates = mode === 'all' ? available : asSet(defaults);
|
|
23
14
|
|
|
24
15
|
return [...candidates]
|
|
25
16
|
.filter((name) => available.has(name) && isDistributableSkill(name, available))
|
package/config/proprietary.json
CHANGED
package/config/required.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@heihei0299/matt-skills",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.29",
|
|
4
4
|
"description": "Agent skills + 项目配置模板:一条命令初始化 opencode / pi-agent 项目(含 mattpocock/skills 上游技能)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
"scripts/sync-upstream.js",
|
|
14
14
|
"scripts/codex-smoke.js",
|
|
15
15
|
"config/proprietary.json",
|
|
16
|
+
"config/default.json",
|
|
16
17
|
"config/engineering.json",
|
|
17
18
|
"config/required.json",
|
|
18
19
|
"README.md"
|