@heihei0299/matt-skills 3.1.2 → 3.1.3
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 +2 -0
- package/bin/cli.js +2 -2
- package/bin/commands/init.js +1 -1
- package/bin/commands/sync.js +1 -1
- package/bin/project/template.js +11 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -66,6 +66,8 @@ npx @heihei0299/matt-skills sync --dry-run --json
|
|
|
66
66
|
|
|
67
67
|
`init` 对已有 `AGENTS.md` 始终跳过;已有项目使用 `sync`。默认 `sync` 保留已有 `AGENTS.md` 和项目规则,`--all` 只扩大技能范围。需要显式刷新 `AGENTS.md` 时使用 `sync --refresh-agents`;无受管区块时会先备份为 `AGENTS.md.bak`。`sync` 不删除目标项目的额外文件或自定义 skills。
|
|
68
68
|
|
|
69
|
+
默认 `init` / `sync` 不分发 `.pi` 与 `.opencode`;需要完整 harness 配置时使用 `--all`。
|
|
70
|
+
|
|
69
71
|
默认 workflow 范围固定为 9 个入口及依赖 skills,包含 `initialize-project`、`setup-matt-pocock-skills`、`grill-with-docs`、`to-spec`、`to-tickets`、`grilling`、`domain-modeling`、`tdd` 和 `diagnosing-bugs`;其中默认独有 skills 是 `initialize-project`。
|
|
70
72
|
|
|
71
73
|
## CLI
|
package/bin/cli.js
CHANGED
|
@@ -34,7 +34,7 @@ Usage:
|
|
|
34
34
|
|
|
35
35
|
Init options:
|
|
36
36
|
--dest <path> Target directory (default: current directory)
|
|
37
|
-
--all Include all distributable skills
|
|
37
|
+
--all Include all distributable skills and .pi/.opencode; default workflow skills only
|
|
38
38
|
--help, -h Show this help
|
|
39
39
|
提示:已有 AGENTS.md 时 init 始终跳过;需要更新已有项目请使用 sync。
|
|
40
40
|
|
|
@@ -47,7 +47,7 @@ Usage:
|
|
|
47
47
|
matt-skills sync [--all|--dry-run|--refresh-agents] [--dest <path>]
|
|
48
48
|
|
|
49
49
|
Sync options:
|
|
50
|
-
--all
|
|
50
|
+
--all 同步全部可分发技能和 .pi/.opencode;不改变 AGENTS.md 刷新策略
|
|
51
51
|
--refresh-agents 显式刷新 AGENTS.md;无受管区块时先备份为 AGENTS.md.bak
|
|
52
52
|
--dry-run 预演目标项目变化,只比对不写盘
|
|
53
53
|
--json 仅与 --dry-run 一起使用,输出机器可读结果
|
package/bin/commands/init.js
CHANGED
|
@@ -31,7 +31,7 @@ export async function runInit(args) {
|
|
|
31
31
|
if (await pathExists(marker)) {
|
|
32
32
|
process.stdout.write('模板已存在(AGENTS.md),跳过\n');
|
|
33
33
|
} else {
|
|
34
|
-
await copyTemplate(target);
|
|
34
|
+
await copyTemplate(target, { includeHarness: all });
|
|
35
35
|
const selectedSkills = await listSkillNames({ onlyProgramming });
|
|
36
36
|
await distributeProjectSkills({ target, sourceDir: SKILLS_DIR, skillNames: selectedSkills });
|
|
37
37
|
process.stdout.write(`模板:已复制(AGENTS.md、skills:${PROJECT_SKILLS_DIR})\n`);
|
package/bin/commands/sync.js
CHANGED
|
@@ -55,7 +55,7 @@ async function syncCommand({ dest, all, dryRun, json, refreshAgents, quiet = fal
|
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
const target = dest ? path.resolve(process.cwd(), dest) : process.cwd();
|
|
58
|
-
const template = await syncTemplate({ target, refreshAgents });
|
|
58
|
+
const template = await syncTemplate({ target, refreshAgents, includeHarness: all });
|
|
59
59
|
if (template.initialized) {
|
|
60
60
|
output('未检测到现有项目(AGENTS.md 不存在),将执行全新初始化\n');
|
|
61
61
|
output(`模板:已复制(AGENTS.md、skills:${PROJECT_SKILLS_DIR})\n`);
|
package/bin/project/template.js
CHANGED
|
@@ -8,17 +8,18 @@ const ROOT = path.join(path.dirname(fileURLToPath(import.meta.url)), '../..');
|
|
|
8
8
|
export const TEMPLATE_DIR = path.join(ROOT, 'template');
|
|
9
9
|
const DRY_RUN_PATHS = ['AGENTS.md', 'AGENTS.md.bak', '.opencode', '.pi', '.agents/skills', '.claude/skills'];
|
|
10
10
|
|
|
11
|
-
function shouldCopyTemplatePath(src) {
|
|
11
|
+
function shouldCopyTemplatePath(src, includeHarness) {
|
|
12
12
|
const relative = path.relative(TEMPLATE_DIR, src);
|
|
13
13
|
const parts = relative.split(path.sep);
|
|
14
|
-
|
|
14
|
+
if (parts[0] === '.agents' && parts[1] === 'skills') return false;
|
|
15
|
+
return includeHarness || (parts[0] !== '.pi' && parts[0] !== '.opencode');
|
|
15
16
|
}
|
|
16
17
|
|
|
17
|
-
export async function copyTemplate(target) {
|
|
18
|
+
export async function copyTemplate(target, { includeHarness = true } = {}) {
|
|
18
19
|
await cp(TEMPLATE_DIR, target, {
|
|
19
20
|
recursive: true,
|
|
20
21
|
force: true,
|
|
21
|
-
filter: shouldCopyTemplatePath,
|
|
22
|
+
filter: (src) => shouldCopyTemplatePath(src, includeHarness),
|
|
22
23
|
});
|
|
23
24
|
}
|
|
24
25
|
|
|
@@ -77,10 +78,10 @@ export async function refreshAgentsFile(targetFile) {
|
|
|
77
78
|
return 'full';
|
|
78
79
|
}
|
|
79
80
|
|
|
80
|
-
export async function syncTemplate({ target, refreshAgents }) {
|
|
81
|
+
export async function syncTemplate({ target, refreshAgents, includeHarness = true }) {
|
|
81
82
|
const marker = path.join(target, 'AGENTS.md');
|
|
82
83
|
if (!(await pathExists(marker))) {
|
|
83
|
-
await copyTemplate(target);
|
|
84
|
+
await copyTemplate(target, { includeHarness });
|
|
84
85
|
return { initialized: true, agentsManaged: false, agentsRefreshed: false, agentsRefreshMode: null };
|
|
85
86
|
}
|
|
86
87
|
|
|
@@ -95,7 +96,9 @@ export async function syncTemplate({ target, refreshAgents }) {
|
|
|
95
96
|
agentsManaged = await syncManagedAgents(marker, path.join(TEMPLATE_DIR, 'AGENTS.md'));
|
|
96
97
|
} catch {}
|
|
97
98
|
}
|
|
98
|
-
|
|
99
|
-
|
|
99
|
+
if (includeHarness) {
|
|
100
|
+
await cp(path.join(TEMPLATE_DIR, '.opencode'), path.join(target, '.opencode'), { recursive: true, force: true });
|
|
101
|
+
await cp(path.join(TEMPLATE_DIR, '.pi'), path.join(target, '.pi'), { recursive: true, force: true });
|
|
102
|
+
}
|
|
100
103
|
return { initialized: false, agentsManaged, agentsRefreshed, agentsRefreshMode };
|
|
101
104
|
}
|