@heihei0299/matt-skills 2.1.13 → 3.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.
Files changed (99) hide show
  1. package/README.md +3 -2
  2. package/bin/cli.js +40 -92
  3. package/package.json +1 -1
  4. package/template/.opencode/CONTEXT.md +7 -7
  5. package/template/.pi/CONTEXT.md +7 -7
  6. package/template/.agents/skills/ask-matt/PHASE-BOUNDARIES.md +0 -55
  7. package/template/.agents/skills/ask-matt/SKILL.md +0 -90
  8. package/template/.agents/skills/ask-matt/agents/openai.yaml +0 -5
  9. package/template/.agents/skills/code-review/SKILL.md +0 -87
  10. package/template/.agents/skills/code-review/agents/openai.yaml +0 -3
  11. package/template/.agents/skills/codebase-design/DEEPENING.md +0 -37
  12. package/template/.agents/skills/codebase-design/DESIGN-IT-TWICE.md +0 -44
  13. package/template/.agents/skills/codebase-design/SKILL.md +0 -114
  14. package/template/.agents/skills/codebase-design/agents/openai.yaml +0 -3
  15. package/template/.agents/skills/diagnose-fix/SKILL.md +0 -43
  16. package/template/.agents/skills/diagnose-fix/agents/openai.yaml +0 -5
  17. package/template/.agents/skills/diagnose-fix/references/anti-patterns.md +0 -21
  18. package/template/.agents/skills/diagnosing-bugs/SKILL.md +0 -138
  19. package/template/.agents/skills/diagnosing-bugs/agents/openai.yaml +0 -3
  20. package/template/.agents/skills/diagnosing-bugs/scripts/hitl-loop.template.sh +0 -44
  21. package/template/.agents/skills/domain-modeling/ADR-FORMAT.md +0 -47
  22. package/template/.agents/skills/domain-modeling/CONTEXT-FORMAT.md +0 -60
  23. package/template/.agents/skills/domain-modeling/SKILL.md +0 -74
  24. package/template/.agents/skills/domain-modeling/agents/openai.yaml +0 -3
  25. package/template/.agents/skills/grill-me/SKILL.md +0 -7
  26. package/template/.agents/skills/grill-me/agents/openai.yaml +0 -5
  27. package/template/.agents/skills/grill-to-spec/SKILL.md +0 -55
  28. package/template/.agents/skills/grill-to-spec/agents/openai.yaml +0 -5
  29. package/template/.agents/skills/grill-to-spec/references/rules.md +0 -47
  30. package/template/.agents/skills/grill-with-docs/SKILL.md +0 -7
  31. package/template/.agents/skills/grill-with-docs/agents/openai.yaml +0 -5
  32. package/template/.agents/skills/grilling/SKILL.md +0 -28
  33. package/template/.agents/skills/grilling/agents/openai.yaml +0 -3
  34. package/template/.agents/skills/handoff/SKILL.md +0 -16
  35. package/template/.agents/skills/handoff/agents/openai.yaml +0 -5
  36. package/template/.agents/skills/implement/SKILL.md +0 -15
  37. package/template/.agents/skills/implement/agents/openai.yaml +0 -5
  38. package/template/.agents/skills/implement-review-loop/SKILL.md +0 -34
  39. package/template/.agents/skills/implement-review-loop/agents/openai.yaml +0 -5
  40. package/template/.agents/skills/improve-codebase-architecture/HTML-REPORT.md +0 -123
  41. package/template/.agents/skills/improve-codebase-architecture/SKILL.md +0 -71
  42. package/template/.agents/skills/improve-codebase-architecture/agents/openai.yaml +0 -5
  43. package/template/.agents/skills/instance-test/SKILL.md +0 -70
  44. package/template/.agents/skills/instance-test/agents/openai.yaml +0 -5
  45. package/template/.agents/skills/instance-test/references/instances.md +0 -75
  46. package/template/.agents/skills/prototype/LOGIC.md +0 -67
  47. package/template/.agents/skills/prototype/SKILL.md +0 -26
  48. package/template/.agents/skills/prototype/UI.md +0 -112
  49. package/template/.agents/skills/prototype/agents/openai.yaml +0 -3
  50. package/template/.agents/skills/research/SKILL.md +0 -12
  51. package/template/.agents/skills/research/agents/openai.yaml +0 -3
  52. package/template/.agents/skills/resolving-merge-conflicts/SKILL.md +0 -14
  53. package/template/.agents/skills/resolving-merge-conflicts/agents/openai.yaml +0 -3
  54. package/template/.agents/skills/scaffold-functional-test/SKILL.md +0 -64
  55. package/template/.agents/skills/scaffold-functional-test/agents/openai.yaml +0 -5
  56. package/template/.agents/skills/scaffold-functional-test/references/schema.md +0 -80
  57. package/template/.agents/skills/setup-matt-pocock-skills/SKILL.md +0 -116
  58. package/template/.agents/skills/setup-matt-pocock-skills/agents/openai.yaml +0 -5
  59. package/template/.agents/skills/setup-matt-pocock-skills/domain.md +0 -51
  60. package/template/.agents/skills/setup-matt-pocock-skills/issue-tracker-github.md +0 -45
  61. package/template/.agents/skills/setup-matt-pocock-skills/issue-tracker-gitlab.md +0 -46
  62. package/template/.agents/skills/setup-matt-pocock-skills/issue-tracker-local.md +0 -30
  63. package/template/.agents/skills/setup-matt-pocock-skills/triage-labels.md +0 -15
  64. package/template/.agents/skills/show-me/SKILL.md +0 -28
  65. package/template/.agents/skills/tdd/SKILL.md +0 -38
  66. package/template/.agents/skills/tdd/agents/openai.yaml +0 -3
  67. package/template/.agents/skills/tdd/mocking.md +0 -59
  68. package/template/.agents/skills/tdd/tests.md +0 -77
  69. package/template/.agents/skills/tdd-implement/SKILL.md +0 -81
  70. package/template/.agents/skills/tdd-implement/agents/openai.yaml +0 -5
  71. package/template/.agents/skills/tdd-implement/references/finalize.md +0 -16
  72. package/template/.agents/skills/tdd-implement/references/orchestration.md +0 -54
  73. package/template/.agents/skills/tdd-implement/references/verify.md +0 -15
  74. package/template/.agents/skills/teach/GLOSSARY-FORMAT.md +0 -35
  75. package/template/.agents/skills/teach/LEARNING-RECORD-FORMAT.md +0 -46
  76. package/template/.agents/skills/teach/MISSION-FORMAT.md +0 -31
  77. package/template/.agents/skills/teach/RESOURCES-FORMAT.md +0 -32
  78. package/template/.agents/skills/teach/SKILL.md +0 -140
  79. package/template/.agents/skills/teach/agents/openai.yaml +0 -5
  80. package/template/.agents/skills/to-questionnaire/SKILL.md +0 -54
  81. package/template/.agents/skills/to-questionnaire/agents/openai.yaml +0 -5
  82. package/template/.agents/skills/to-spec/SKILL.md +0 -75
  83. package/template/.agents/skills/to-spec/agents/openai.yaml +0 -5
  84. package/template/.agents/skills/to-tickets/SKILL.md +0 -105
  85. package/template/.agents/skills/to-tickets/agents/openai.yaml +0 -5
  86. package/template/.agents/skills/triage/AGENT-BRIEF.md +0 -207
  87. package/template/.agents/skills/triage/OUT-OF-SCOPE.md +0 -105
  88. package/template/.agents/skills/triage/SKILL.md +0 -112
  89. package/template/.agents/skills/triage/agents/openai.yaml +0 -5
  90. package/template/.agents/skills/wait-what/SKILL.md +0 -7
  91. package/template/.agents/skills/wait-what/agents/openai.yaml +0 -5
  92. package/template/.agents/skills/wayfinder/SKILL.md +0 -128
  93. package/template/.agents/skills/wayfinder/agents/openai.yaml +0 -5
  94. package/template/.agents/skills/wizard/SKILL.md +0 -44
  95. package/template/.agents/skills/wizard/agents/openai.yaml +0 -3
  96. package/template/.agents/skills/wizard/template.sh +0 -204
  97. package/template/.agents/skills/writing-for-agents/SKILL-MECHANICS.md +0 -22
  98. package/template/.agents/skills/writing-for-agents/SKILL.md +0 -81
  99. package/template/.agents/skills/writing-for-agents/agents/openai.yaml +0 -3
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # matt-skills
2
2
 
3
- 面向项目仓库的 Agent skills 与配置模板。模板包含共享 skills、`AGENTS.md`、项目上下文占位文件,以及 pi / opencode 所需的项目配置。
3
+ 面向项目仓库的 Agent skills 与配置模板。模板包含项目 skeleton、`AGENTS.md`、项目上下文占位文件,以及 pi / opencode 所需的项目配置;共享 Skills 由 CLI 从 Workspace 的 canonical source 直接组装到目标项目。
4
4
 
5
5
  ## 模板内容
6
6
 
@@ -8,11 +8,12 @@
8
8
  template/
9
9
  ├── AGENTS.md Agent 行为路由与项目上下文入口
10
10
  ├── PROJECT.md 目标项目填写的目标、范围和主要入口
11
- ├── .agents/skills/ 共享 skills 的唯一项目级来源
12
11
  ├── .opencode/ opencode agents、commands、docs
13
12
  └── .pi/ pi prompts、docs 与项目自定义 skills 占位
14
13
  ```
15
14
 
15
+ 共享 Skills 不作为 Template Snapshot 的持久化副本;`init`、`sync` 和 `install` 根据 distribution boundary 从 Workspace 的 canonical source 分发到目标项目的 `.agents/skills/`。
16
+
16
17
  - `PROJECT.md` 描述项目是什么;操作规则放在 `AGENTS.md`。
17
18
  - `.opencode/CONTEXT.md` / `.pi/CONTEXT.md` 保存领域术语与边界。
18
19
  - `.opencode/skills/` 与 `.pi/skills/` 仅用于项目自定义 skills。
package/bin/cli.js CHANGED
@@ -156,27 +156,33 @@ function parseFrontmatter(text) {
156
156
  return fields;
157
157
  }
158
158
 
159
- async function listSkills({ onlyProgramming = false } = {}) {
159
+ async function listSkillNames({ onlyProgramming = false } = {}) {
160
160
  const entries = await readdir(SKILLS_DIR, { withFileTypes: true });
161
+ let names = entries
162
+ .filter((entry) => entry.isDirectory())
163
+ .filter((entry) => !entry.name.endsWith('.bak'))
164
+ .filter((entry) => entry.name !== 'skill-creator' && entry.name !== '.git')
165
+ .filter((entry) => !isRepoLocalSkill(entry.name))
166
+ .map((entry) => entry.name);
167
+ if (onlyProgramming) {
168
+ const engineering = await loadEngineeringSkills();
169
+ const required = await loadRequiredSkills();
170
+ names = names.filter((name) => isProgrammingSkill(name, engineering, required));
171
+ }
172
+ return names.sort();
173
+ }
174
+
175
+ async function listSkills({ onlyProgramming = false } = {}) {
161
176
  const skills = [];
162
- let engineering = null;
163
- let required = null;
164
- if (onlyProgramming) engineering = await loadEngineeringSkills();
165
- if (onlyProgramming) required = await loadRequiredSkills();
166
- for (const entry of entries) {
167
- if (!entry.isDirectory()) continue;
168
- if (entry.name.endsWith('.bak')) continue;
169
- if (entry.name === 'skill-creator') continue;
170
- if (isRepoLocalSkill(entry.name)) continue;
171
- if (onlyProgramming && !isProgrammingSkill(entry.name, engineering, required)) continue;
177
+ for (const name of await listSkillNames({ onlyProgramming })) {
172
178
  let content;
173
179
  try {
174
- content = await readFile(path.join(SKILLS_DIR, entry.name, 'SKILL.md'), 'utf8');
180
+ content = await readFile(path.join(SKILLS_DIR, name, 'SKILL.md'), 'utf8');
175
181
  } catch {
176
182
  continue;
177
183
  }
178
- const { name, description } = parseFrontmatter(content);
179
- if (name && description) skills.push({ name, description });
184
+ const { description } = parseFrontmatter(content);
185
+ if (description) skills.push({ name, description });
180
186
  }
181
187
  return skills.sort((a, b) => (a.name < b.name ? -1 : a.name > b.name ? 1 : 0));
182
188
  }
@@ -193,7 +199,7 @@ async function pathExists(p) {
193
199
  function shouldCopyTemplatePath(src) {
194
200
  const relative = path.relative(TEMPLATE_DIR, src);
195
201
  const parts = relative.split(path.sep);
196
- return !(parts[0] === '.agents' && parts[1] === 'skills' && isRepoLocalSkill(parts[2]));
202
+ return !(parts[0] === '.agents' && parts[1] === 'skills');
197
203
  }
198
204
 
199
205
  const TOOLS = ['codex', 'pi', 'opencode', 'claude'];
@@ -245,6 +251,7 @@ async function installCommand({ dest, all, force, tools, global }) {
245
251
  const onlyProgramming = !all;
246
252
  const engineering = onlyProgramming ? await loadEngineeringSkills() : null;
247
253
  const required = onlyProgramming ? await loadRequiredSkills() : null;
254
+ const skillNames = await listSkillNames({ onlyProgramming });
248
255
  const skillsAll = await listSkills({ onlyProgramming: false });
249
256
  const skills = onlyProgramming ? skillsAll.filter(s => isProgrammingSkill(s.name, engineering, required)) : skillsAll;
250
257
  let targets;
@@ -271,12 +278,12 @@ async function installCommand({ dest, all, force, tools, global }) {
271
278
  }
272
279
  targets = [...seen.values()];
273
280
  }
274
- const selected = all ? skills.map((s) => s.name) : await promptSkills(skills);
281
+ const selected = all ? skillNames : await promptSkills(skills);
275
282
  if (selected.length === 0) {
276
283
  process.stdout.write('未选择任何技能,未安装任何技能\n');
277
284
  return;
278
285
  }
279
- const knownDistributable = new Set(skills.map((skill) => skill.name));
286
+ const knownDistributable = new Set(skillNames);
280
287
  for (const name of selected) {
281
288
  if (!isDistributableSkill(name, knownDistributable)) {
282
289
  throw new Error(`${name} is repository-local or unavailable and cannot be distributed`);
@@ -312,23 +319,16 @@ async function initCommand({ dest, all }) {
312
319
  force: true,
313
320
  filter: shouldCopyTemplatePath,
314
321
  });
315
- process.stdout.write('模板:已复制(AGENTS.md、.agents/skills、.opencode/、.pi/)\n');
316
- // 默认范围(engineering + 独有所需 + 默认独有),--all 才保留其余 productivity
317
- if (onlyProgramming && path.resolve(target) !== path.resolve(path.join(path.dirname(fileURLToPath(import.meta.url)), '..'))) {
318
- const engineering = await loadEngineeringSkills();
319
- const required = await loadRequiredSkills();
320
- const skillsDirFilter = path.join(target, '.agents', 'skills');
321
- try {
322
- const entries = await readdir(skillsDirFilter, { withFileTypes: true });
323
- for (const e of entries) {
324
- if (!e.isDirectory()) continue;
325
- if (e.name.endsWith('.bak') || e.name === '.git' || e.name === 'skill-creator') continue;
326
- if (!isProgrammingSkill(e.name, engineering, required)) {
327
- await rm(path.join(skillsDirFilter, e.name), { recursive: true, force: true });
328
- }
329
- }
330
- } catch {}
322
+ const selectedSkills = await listSkillNames({ onlyProgramming });
323
+ const skillsDir = path.join(target, '.agents', 'skills');
324
+ await mkdir(skillsDir, { recursive: true });
325
+ for (const name of selectedSkills) {
326
+ const source = path.join(SKILLS_DIR, name);
327
+ const destination = path.join(skillsDir, name);
328
+ if (path.resolve(source) === path.resolve(destination)) continue;
329
+ await cp(source, destination, { recursive: true, force: true });
331
330
  }
331
+ process.stdout.write('模板:已复制(AGENTS.md、.opencode/、.pi/)\n');
332
332
  }
333
333
  // 统计(区分编程 vs 全量)
334
334
  const skillsDir = path.join(target, '.agents', 'skills');
@@ -399,22 +399,10 @@ async function syncCommand({ dest, all, dryRun, json, upstreamUrl, ref }) {
399
399
  });
400
400
  return;
401
401
  }
402
- // 默认范围:分别复制非 skills 部分,skills 由后续 allSkills 循环处理
402
+ // Skeleton only; shared Skills are copied from the canonical source below.
403
403
  await cp(path.join(TEMPLATE_DIR, 'AGENTS.md'), path.join(target, 'AGENTS.md'), { force: true });
404
404
  await cp(path.join(TEMPLATE_DIR, '.opencode'), path.join(target, '.opencode'), { recursive: true, force: true });
405
405
  await cp(path.join(TEMPLATE_DIR, '.pi'), path.join(target, '.pi'), { recursive: true, force: true });
406
- // .agents/skills 不通过模板拷贝,留给后续按 allSkills 精确同步
407
- await mkdir(path.join(target, '.agents', 'skills'), { recursive: true });
408
- // 若 .agents 下有非 skills 文件(未来扩展),也拷贝但排除 skills
409
- try {
410
- const agEntries = await readdir(path.join(TEMPLATE_DIR, '.agents'), { withFileTypes: true });
411
- for (const e of agEntries) {
412
- if (e.name === 'skills') continue;
413
- const src = path.join(TEMPLATE_DIR, '.agents', e.name);
414
- const dst = path.join(target, '.agents', e.name);
415
- await cp(src, dst, { recursive: true, force: true });
416
- }
417
- } catch {}
418
406
  }
419
407
  if (!(await pathExists(marker))) {
420
408
  process.stdout.write('未检测到现有项目(AGENTS.md 不存在),将执行全新初始化\n');
@@ -424,7 +412,7 @@ async function syncCommand({ dest, all, dryRun, json, upstreamUrl, ref }) {
424
412
  force: true,
425
413
  filter: shouldCopyTemplatePath,
426
414
  });
427
- process.stdout.write('模板:已复制(AGENTS.md、.agents/skills、.opencode/、.pi/)\n');
415
+ process.stdout.write('模板:已复制(AGENTS.md、.opencode/、.pi/)\n');
428
416
  } else {
429
417
  process.stdout.write('同步:检测到现有项目,将增量更新\n');
430
418
  let skipAgents = false;
@@ -436,26 +424,8 @@ async function syncCommand({ dest, all, dryRun, json, upstreamUrl, ref }) {
436
424
  } catch {}
437
425
  }
438
426
  if (skipAgents) {
439
- if (onlyProgramming) {
440
- await cp(path.join(TEMPLATE_DIR, '.opencode'), path.join(target, '.opencode'), { recursive: true, force: true });
441
- await cp(path.join(TEMPLATE_DIR, '.pi'), path.join(target, '.pi'), { recursive: true, force: true });
442
- // .agents 跳过 AGENTS.md 定制,skills 由后续处理
443
- try {
444
- const agEntries = await readdir(path.join(TEMPLATE_DIR, '.agents'), { withFileTypes: true });
445
- for (const e of agEntries) {
446
- if (e.name === 'skills') continue;
447
- await cp(path.join(TEMPLATE_DIR, '.agents', e.name), path.join(target, '.agents', e.name), { recursive: true, force: true });
448
- }
449
- } catch {}
450
- } else {
451
- await cp(path.join(TEMPLATE_DIR, '.agents'), path.join(target, '.agents'), {
452
- recursive: true,
453
- force: true,
454
- filter: shouldCopyTemplatePath,
455
- });
456
- await cp(path.join(TEMPLATE_DIR, '.opencode'), path.join(target, '.opencode'), { recursive: true, force: true });
457
- await cp(path.join(TEMPLATE_DIR, '.pi'), path.join(target, '.pi'), { recursive: true, force: true });
458
- }
427
+ await cp(path.join(TEMPLATE_DIR, '.opencode'), path.join(target, '.opencode'), { recursive: true, force: true });
428
+ await cp(path.join(TEMPLATE_DIR, '.pi'), path.join(target, '.pi'), { recursive: true, force: true });
459
429
  process.stdout.write('模板:已同步(AGENTS.md 跳过,已含定制)\n');
460
430
  } else {
461
431
  if (onlyProgramming) await copyTemplateFiltered();
@@ -468,15 +438,7 @@ async function syncCommand({ dest, all, dryRun, json, upstreamUrl, ref }) {
468
438
  }
469
439
  }
470
440
  // 技能同步:--all 仅更新同名可分发技能内容,存在则覆盖,不存在则新增,并更新 AGENTS.md(由上一步已处理);默认范围为默认 programming,不删多余
471
- const entries = await readdir(SKILLS_DIR, { withFileTypes: true });
472
- const allNames = entries.filter((e) => e.isDirectory() && !e.name.endsWith('.bak') && e.name !== 'skill-creator' && e.name !== '.git').map((e) => e.name);
473
- let allSkills = allNames.sort();
474
- allSkills = allSkills.filter((name) => !isRepoLocalSkill(name));
475
- if (onlyProgramming) {
476
- const engineering = await loadEngineeringSkills();
477
- const required = await loadRequiredSkills();
478
- allSkills = allSkills.filter(n => isProgrammingSkill(n, engineering, required));
479
- }
441
+ const allSkills = await listSkillNames({ onlyProgramming });
480
442
  const skillsDir = path.join(target, '.agents', 'skills');
481
443
  await mkdir(skillsDir, { recursive: true });
482
444
  const preservedRepoLocal = [];
@@ -515,22 +477,8 @@ async function syncCommand({ dest, all, dryRun, json, upstreamUrl, ref }) {
515
477
  installed++;
516
478
  }
517
479
  }
518
- // 旧镜像自动清理:.pi/skills .opencode/skills 中残留的共享技能一律删除,保留项目自定义
519
- // 仅清理当前全量/编程集合中的技能,避免误删自定义
520
- for (const harness of ['.pi/skills', '.opencode/skills']) {
521
- const dir = path.join(target, harness);
522
- if (!(await pathExists(dir))) continue;
523
- let hsEntries = [];
524
- try { hsEntries = await readdir(dir, { withFileTypes: true }); } catch { continue; }
525
- for (const e of hsEntries) {
526
- if (!e.isDirectory()) continue;
527
- if (e.name === '.git' || e.name.endsWith('.bak')) continue;
528
- if (e.name === '.gitkeep' || e.name === 'README.md') continue;
529
- if (allSkills.includes(e.name)) {
530
- await rm(path.join(dir, e.name), { recursive: true, force: true });
531
- }
532
- }
533
- }
480
+ // Harness skill directories may contain project-local Skills. Preserve them because
481
+ // their origin cannot be distinguished safely from a historical shared mirror.
534
482
  // 清理过时的 .pi/settings.json 指向
535
483
  try {
536
484
  const piSettings = path.join(target, '.pi/settings.json');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@heihei0299/matt-skills",
3
- "version": "2.1.13",
3
+ "version": "3.0.0",
4
4
  "description": "Agent skills + 项目配置模板:一条命令初始化 opencode / pi-agent 项目(含 mattpocock/skills 上游技能)",
5
5
  "type": "module",
6
6
  "bin": {
@@ -5,11 +5,11 @@ The domain vocabulary for this repo — two sections: how this repository is pos
5
5
  ## Repository
6
6
 
7
7
  **Template Repository** (模板仓库):
8
- This repository's identity. It is the config repo for mattpocock/skills: it distributes project-level config (AGENTS.md behavior routing, `.opencode/docs/agents/` discipline files, `.opencode/CONTEXT.md` glossary) plus the explicitly allowed distributable skills via `.agents/skills`. The workspace also retains repo-local maintenance skills that are never distributed. The workspace content is projected into `template/` as a Template Snapshot, and initializing a Target Repository is a one-time copy of that snapshot. The workspace copy also serves this repo's own sessions.
8
+ This repository's identity. It is the config repo for mattpocock/skills: it distributes project-level config (AGENTS.md behavior routing, `.opencode/docs/agents/` discipline files, `.opencode/CONTEXT.md` glossary) and the explicitly allowed distributable Skills. The Workspace also retains repo-local maintenance Skills that are never distributed. The Template Snapshot projects the project skeleton; the CLI assembles selected distributable Skills from the Workspace when initializing or synchronizing a Target Repository. The Workspace copy also serves this repo's own sessions.
9
9
  _Avoid_: skill distribution repo
10
10
 
11
11
  **Upstream Repository** (上游仓库):
12
- mattpocock/skills — the source of the 26 skill bodies (skills/engineering + skills/productivity) that are mirrored into this repo's `.agents/skills` and then distributed via the Template Snapshot. This repo syncs them via `scripts/sync-upstream.js` and `matt-skills sync`.
12
+ mattpocock/skills — the source of the 26 Skill bodies (skills/engineering + skills/productivity) that are mirrored into this repo's Workspace canonical Skill source and then distributed by the CLI. This repo syncs them via `scripts/sync-upstream.js` and `matt-skills sync`.
13
13
  _Avoid_: source repo, skill origin
14
14
 
15
15
  **Proprietary Skill** (独有技能):
@@ -17,23 +17,23 @@ A skill that does not exist upstream and lives only in this repo (currently ci-g
17
17
  _Avoid_: private skill, local skill
18
18
 
19
19
  **Workspace** (工作区):
20
- The root-level working copies of the template content — `.agents/skills/` (upstream plus all proprietary skills, single source), `.opencode/` (issue-audit agent, explicit-skill commands), `.pi/` (pi-agent prompts: `issue-audit`), `AGENTS.md`, `CONTEXT.md`, `docs/`. Where this repo's own sessions load, modify, and test the content. The template paths project only the distributable subset: `.agents/skills/` `template/.agents/skills/`, `.opencode/commands/*.md` → `template/.opencode/commands/`, `.pi/prompts/issue-audit.md` → `template/.pi/prompts/issue-audit.md`, root-level `CONTEXT.md` and `docs/agents/` → `template/.opencode/` + `template/.pi/`. Harness-specific skill dirs `.pi/skills/` and `.opencode/skills/` are reserved for project-local custom skills (empty placeholders with `.gitkeep` + `README.md` in the template).
20
+ The root-level working copies of the template content — `.agents/skills/` (upstream plus all proprietary Skills, the canonical shared Skill source), `.opencode/` (issue-audit agent, explicit-Skill commands), `.pi/` (pi-agent prompts: `issue-audit`), `AGENTS.md`, `CONTEXT.md`, `docs/`. This is where the repo's own sessions load, modify and test the content. The Template Snapshot projects only the distributable configuration and skeleton: `.opencode/commands/*.md` → `template/.opencode/commands/`, `.pi/prompts/issue-audit.md` → `template/.pi/prompts/issue-audit.md`, and root-level `CONTEXT.md` and `docs/agents/` → `template/.opencode/` + `template/.pi/`. The CLI assembles selected shared Skills from the canonical source into a Target Repository. Harness-specific Skill dirs `.pi/skills/` and `.opencode/skills/` are reserved for project-local custom Skills (empty placeholders with `.gitkeep` + `README.md` in the Template Snapshot).
21
21
  _Avoid_: working copy, source repo
22
22
 
23
23
  **Template Snapshot** (模板快照):
24
- Everything under `template/` — the distributable snapshot of workspace content: only allowed skills under `.agents/skills/` (single source for user projects), harness skill dirs `.pi/skills/` + `.opencode/skills/` as empty placeholders for project custom skills, distributable opencode commands under `.opencode/commands/`, the pi issue-audit command under `.pi/prompts/`, discipline files and glossary under `.opencode/` + `.pi/`, AGENTS.md at the top level, generated by `node scripts/build-template.js`, used to initialize other repositories. Repo-local skills and commands remain workspace-only. The sync direction is one-way: workspacesnapshot. `test/template-sync.test.js` guards the mirror stays in sync.
24
+ Everything under `template/` — the distributable snapshot of project skeleton content: harness Skill dirs `.pi/skills/` + `.opencode/skills/` as empty placeholders for project custom Skills, distributable opencode commands under `.opencode/commands/`, the pi issue-audit command under `.pi/prompts/`, discipline files and glossary under `.opencode/` + `.pi/`, and AGENTS.md at the top level. It is generated by `node scripts/build-template.js` and used to initialize other repositories. Shared Skills and repo-local Skills remain in the Workspace; the CLI distributes only the selected shared Skills. The sync direction for the skeleton is one-way: WorkspaceTemplate Snapshot. Template structure tests guard the content the snapshot owns.
25
25
  _Avoid_: release snapshot, published snapshot
26
26
 
27
27
  **Target Repository** (目标仓库):
28
- A repository initialized by copying `template/` into its root (`cp -r template/. <target>/`). It then loads all distributable shared skills from its own `.agents/skills/`, project-local custom skills from `.pi/skills/` / `.opencode/skills/` (if any), the distributable commands from `.opencode/commands/` (opencode) and the `issue-audit` command from `.pi/prompts/` (pi) / `.opencode/commands/` (opencode), and the project-level global config from `.opencode/` + `.pi/` and `AGENTS.md`. Repo-local matt-skills maintenance skills are not part of a Target Repository by default.
28
+ A repository initialized by copying the Template Snapshot skeleton into its root and then receiving selected distributable shared Skills from the CLI. It loads shared Skills from its own `.agents/skills/`, project-local custom Skills from `.pi/skills/` / `.opencode/skills/` (if any), the distributable commands from `.opencode/commands/` (opencode) and the `issue-audit` command from `.pi/prompts/` (pi) / `.opencode/commands/` (opencode), and the project-level global config from `.opencode/` + `.pi/` and AGENTS.md. Repo-local matt-skills maintenance Skills are not part of a Target Repository by default.
29
29
  _Avoid_: inheriting repo, child repo
30
30
 
31
31
  **Initialize** (初始化):
32
- The one-time action of setting up a Target Repository: copying `template/` into its root (`cp -r template/. <target>/`). All distributable skills are already included via `template/.agents/skills/`; no separate upstream fetch is needed. Repo-local skills are intentionally absent. Copying, not inheriting — no runtime relationship survives the copy.
32
+ The one-time action of setting up a Target Repository: copying the Template Snapshot skeleton into its root, then having the CLI create its shared Skill directory and copy the selected distributable Skills from the Workspace canonical source. No separate upstream fetch is needed. Repo-local Skills are intentionally absent. Copying, not inheriting — no runtime relationship survives the copy.
33
33
  _Avoid_: inherit, bootstrap
34
34
 
35
35
  **Sync** (同步):
36
- `matt-skills sync` 同步 Target Repository 的模板与技能:`--dry-run` 仅对比不写盘(`check`,`--json` 可解析,有差异 `exit 1`),默认安全增量(`AGENTS.md` 有定制如 `tdd-implement` 则跳过,`.agents/skills` 按默认 programming 范围覆盖但不删多余技能,`template/.opencode/.pi` 增量 `add/update`,旧镜像 `.pi/skills` + `.opencode/skills` 中残留的共享技能自动清理但保留项目自定义)、`--all` 仅更新同名可分发技能内容(存在则覆盖,不存在则新增)并更新 `AGENTS.md`(不跳过定制),不删多余技能。Repo-local skill 永远不新增、不覆盖、不删除,只在发现历史副本时提示保留。`update` 已合并到 `sync` 并删除。
36
+ `matt-skills sync` 同步 Target Repository 的 skeleton 与 Skills:`--dry-run` 仅对比不写盘(`check`,`--json` 可解析,有差异 `exit 1`),默认安全增量(`AGENTS.md` 有定制如 `tdd-implement` 则跳过,canonical shared Skills 按默认 programming 范围覆盖但不删多余,Template Snapshot 的 `.opencode` / `.pi` 配置增量 add/update,`.pi/skills` `.opencode/skills` 中已有的 project-local Skill 不按名称删除,避免把项目自定义 Skill 误删)、`--all` 仅更新同名可分发 Skill 内容(存在则覆盖,不存在则新增)并更新 `AGENTS.md`(不跳过定制),不删多余 Skill。Repo-local Skill 永远不新增、不覆盖、不删除,只在发现历史副本时提示保留。`update` 已合并到 `sync` 并删除。
37
37
  _Avoid_: update, force sync
38
38
 
39
39
  ## Skill Design
@@ -5,11 +5,11 @@ The domain vocabulary for this repo — two sections: how this repository is pos
5
5
  ## Repository
6
6
 
7
7
  **Template Repository** (模板仓库):
8
- This repository's identity. It is the config repo for mattpocock/skills: it distributes project-level config (AGENTS.md behavior routing, `.opencode/docs/agents/` discipline files, `.opencode/CONTEXT.md` glossary) plus the explicitly allowed distributable skills via `.agents/skills`. The workspace also retains repo-local maintenance skills that are never distributed. The workspace content is projected into `template/` as a Template Snapshot, and initializing a Target Repository is a one-time copy of that snapshot. The workspace copy also serves this repo's own sessions.
8
+ This repository's identity. It is the config repo for mattpocock/skills: it distributes project-level config (AGENTS.md behavior routing, `.opencode/docs/agents/` discipline files, `.opencode/CONTEXT.md` glossary) and the explicitly allowed distributable Skills. The Workspace also retains repo-local maintenance Skills that are never distributed. The Template Snapshot projects the project skeleton; the CLI assembles selected distributable Skills from the Workspace when initializing or synchronizing a Target Repository. The Workspace copy also serves this repo's own sessions.
9
9
  _Avoid_: skill distribution repo
10
10
 
11
11
  **Upstream Repository** (上游仓库):
12
- mattpocock/skills — the source of the 26 skill bodies (skills/engineering + skills/productivity) that are mirrored into this repo's `.agents/skills` and then distributed via the Template Snapshot. This repo syncs them via `scripts/sync-upstream.js` and `matt-skills sync`.
12
+ mattpocock/skills — the source of the 26 Skill bodies (skills/engineering + skills/productivity) that are mirrored into this repo's Workspace canonical Skill source and then distributed by the CLI. This repo syncs them via `scripts/sync-upstream.js` and `matt-skills sync`.
13
13
  _Avoid_: source repo, skill origin
14
14
 
15
15
  **Proprietary Skill** (独有技能):
@@ -17,23 +17,23 @@ A skill that does not exist upstream and lives only in this repo (currently ci-g
17
17
  _Avoid_: private skill, local skill
18
18
 
19
19
  **Workspace** (工作区):
20
- The root-level working copies of the template content — `.agents/skills/` (upstream plus all proprietary skills, single source), `.opencode/` (issue-audit agent, explicit-skill commands), `.pi/` (pi-agent prompts: `issue-audit`), `AGENTS.md`, `CONTEXT.md`, `docs/`. Where this repo's own sessions load, modify, and test the content. The template paths project only the distributable subset: `.agents/skills/` `template/.agents/skills/`, `.opencode/commands/*.md` → `template/.opencode/commands/`, `.pi/prompts/issue-audit.md` → `template/.pi/prompts/issue-audit.md`, root-level `CONTEXT.md` and `docs/agents/` → `template/.opencode/` + `template/.pi/`. Harness-specific skill dirs `.pi/skills/` and `.opencode/skills/` are reserved for project-local custom skills (empty placeholders with `.gitkeep` + `README.md` in the template).
20
+ The root-level working copies of the template content — `.agents/skills/` (upstream plus all proprietary Skills, the canonical shared Skill source), `.opencode/` (issue-audit agent, explicit-Skill commands), `.pi/` (pi-agent prompts: `issue-audit`), `AGENTS.md`, `CONTEXT.md`, `docs/`. This is where the repo's own sessions load, modify and test the content. The Template Snapshot projects only the distributable configuration and skeleton: `.opencode/commands/*.md` → `template/.opencode/commands/`, `.pi/prompts/issue-audit.md` → `template/.pi/prompts/issue-audit.md`, and root-level `CONTEXT.md` and `docs/agents/` → `template/.opencode/` + `template/.pi/`. The CLI assembles selected shared Skills from the canonical source into a Target Repository. Harness-specific Skill dirs `.pi/skills/` and `.opencode/skills/` are reserved for project-local custom Skills (empty placeholders with `.gitkeep` + `README.md` in the Template Snapshot).
21
21
  _Avoid_: working copy, source repo
22
22
 
23
23
  **Template Snapshot** (模板快照):
24
- Everything under `template/` — the distributable snapshot of workspace content: only allowed skills under `.agents/skills/` (single source for user projects), harness skill dirs `.pi/skills/` + `.opencode/skills/` as empty placeholders for project custom skills, distributable opencode commands under `.opencode/commands/`, the pi issue-audit command under `.pi/prompts/`, discipline files and glossary under `.opencode/` + `.pi/`, AGENTS.md at the top level, generated by `node scripts/build-template.js`, used to initialize other repositories. Repo-local skills and commands remain workspace-only. The sync direction is one-way: workspacesnapshot. `test/template-sync.test.js` guards the mirror stays in sync.
24
+ Everything under `template/` — the distributable snapshot of project skeleton content: harness Skill dirs `.pi/skills/` + `.opencode/skills/` as empty placeholders for project custom Skills, distributable opencode commands under `.opencode/commands/`, the pi issue-audit command under `.pi/prompts/`, discipline files and glossary under `.opencode/` + `.pi/`, and AGENTS.md at the top level. It is generated by `node scripts/build-template.js` and used to initialize other repositories. Shared Skills and repo-local Skills remain in the Workspace; the CLI distributes only the selected shared Skills. The sync direction for the skeleton is one-way: WorkspaceTemplate Snapshot. Template structure tests guard the content the snapshot owns.
25
25
  _Avoid_: release snapshot, published snapshot
26
26
 
27
27
  **Target Repository** (目标仓库):
28
- A repository initialized by copying `template/` into its root (`cp -r template/. <target>/`). It then loads all distributable shared skills from its own `.agents/skills/`, project-local custom skills from `.pi/skills/` / `.opencode/skills/` (if any), the distributable commands from `.opencode/commands/` (opencode) and the `issue-audit` command from `.pi/prompts/` (pi) / `.opencode/commands/` (opencode), and the project-level global config from `.opencode/` + `.pi/` and `AGENTS.md`. Repo-local matt-skills maintenance skills are not part of a Target Repository by default.
28
+ A repository initialized by copying the Template Snapshot skeleton into its root and then receiving selected distributable shared Skills from the CLI. It loads shared Skills from its own `.agents/skills/`, project-local custom Skills from `.pi/skills/` / `.opencode/skills/` (if any), the distributable commands from `.opencode/commands/` (opencode) and the `issue-audit` command from `.pi/prompts/` (pi) / `.opencode/commands/` (opencode), and the project-level global config from `.opencode/` + `.pi/` and AGENTS.md. Repo-local matt-skills maintenance Skills are not part of a Target Repository by default.
29
29
  _Avoid_: inheriting repo, child repo
30
30
 
31
31
  **Initialize** (初始化):
32
- The one-time action of setting up a Target Repository: copying `template/` into its root (`cp -r template/. <target>/`). All distributable skills are already included via `template/.agents/skills/`; no separate upstream fetch is needed. Repo-local skills are intentionally absent. Copying, not inheriting — no runtime relationship survives the copy.
32
+ The one-time action of setting up a Target Repository: copying the Template Snapshot skeleton into its root, then having the CLI create its shared Skill directory and copy the selected distributable Skills from the Workspace canonical source. No separate upstream fetch is needed. Repo-local Skills are intentionally absent. Copying, not inheriting — no runtime relationship survives the copy.
33
33
  _Avoid_: inherit, bootstrap
34
34
 
35
35
  **Sync** (同步):
36
- `matt-skills sync` 同步 Target Repository 的模板与技能:`--dry-run` 仅对比不写盘(`check`,`--json` 可解析,有差异 `exit 1`),默认安全增量(`AGENTS.md` 有定制如 `tdd-implement` 则跳过,`.agents/skills` 按默认 programming 范围覆盖但不删多余技能,`template/.opencode/.pi` 增量 `add/update`,旧镜像 `.pi/skills` + `.opencode/skills` 中残留的共享技能自动清理但保留项目自定义)、`--all` 仅更新同名可分发技能内容(存在则覆盖,不存在则新增)并更新 `AGENTS.md`(不跳过定制),不删多余技能。Repo-local skill 永远不新增、不覆盖、不删除,只在发现历史副本时提示保留。`update` 已合并到 `sync` 并删除。
36
+ `matt-skills sync` 同步 Target Repository 的 skeleton 与 Skills:`--dry-run` 仅对比不写盘(`check`,`--json` 可解析,有差异 `exit 1`),默认安全增量(`AGENTS.md` 有定制如 `tdd-implement` 则跳过,canonical shared Skills 按默认 programming 范围覆盖但不删多余,Template Snapshot 的 `.opencode` / `.pi` 配置增量 add/update,`.pi/skills` `.opencode/skills` 中已有的 project-local Skill 不按名称删除,避免把项目自定义 Skill 误删)、`--all` 仅更新同名可分发 Skill 内容(存在则覆盖,不存在则新增)并更新 `AGENTS.md`(不跳过定制),不删多余 Skill。Repo-local Skill 永远不新增、不覆盖、不删除,只在发现历史副本时提示保留。`update` 已合并到 `sync` 并删除。
37
37
  _Avoid_: update, force sync
38
38
 
39
39
  ## Skill Design
@@ -1,55 +0,0 @@
1
- # Phase boundaries
2
-
3
- A **phase** is a chunk of work inside a session: the grilling, the implementation, the QA. The definition is fuzzy on purpose: a phase ends when you think *"ok, we're done with that"*.
4
-
5
- The **phase boundary** is the gap between two phases, and it is the only place this decision belongs. Mid-phase there is no decision to make: continue, or split the work that's left into subagents. Compacting mid-phase makes the agent lose the thread.
6
-
7
- ## The five options
8
-
9
- | Option | What it does |
10
- | ------------ | --------------------------------------------------------------- |
11
- | **Continue** | Stay in the session. No context switch at all. |
12
- | **`/clear`** | Empty the context window and start from nothing. |
13
- | **`/handoff`** | Write a portable markdown file and seed a session anywhere with it. |
14
- | **Subagent** | Send the task to its own context window and get a report back. |
15
- | **`/compact`** | Compress this context and seed a fresh session with the summary. |
16
-
17
- ## The tree
18
-
19
- Work top to bottom at the boundary. The first **yes** wins.
20
-
21
- **1. Can you continue in this session?** Two things make the answer yes: the next phase needs this phase as a **primary source**, or you have enough [smart zone](https://www.aihero.dev/ai-coding-dictionary/smart-zone) left (~150k tokens) for the next phase to fit. Grilling → implementation is the standard yes: the implementation wants the reasoning verbatim, not a summary of it. Continue costs nothing and loses nothing, so rule it out before anything else.
22
-
23
- **2. Is the context irrelevant to what comes next?** Is everything in this session (the exploration, the decisions, the dead ends) disposable? If so, **`/clear`**. It is the cheapest move on the board: it takes no time and hands back the whole window. `/clear` also isn't terminal: the old session stays resumable.
24
-
25
- The cost of getting this wrong is one-way. Clear a *relevant* context and you lose the **why** behind what you built, and no amount of reading the diff back gets it returned.
26
-
27
- **3. Do you need to hand off?** `/handoff` is narrow. You need it only when you are:
28
-
29
- - swapping to a **new harness** (Claude → Codex),
30
- - moving to a **new directory** or repo,
31
- - sending the work to a **colleague**,
32
- - or forking a side task you found **mid-phase** without derailing what you're doing.
33
-
34
- That list is the whole clause. What `/handoff` buys is **portability**: a file that travels. If nothing is travelling, you don't need it.
35
-
36
- **4. Can the task be done AFK?** Is it scoped tightly enough to run with you away from the keyboard, no steering? Then send it to a **subagent** and leave this session untouched. Automated review is the standard case: the agent reads the diff and reports, and you aren't needed while it does.
37
-
38
- **5. Otherwise, `/compact`.** Relevant context, same harness, same directory, and you need to stay in the loop: this is where the tree lands, and it lands here often. Pass it an instruction (`/compact we're going to QA this area`) so the summary keeps what the next phase needs.
39
-
40
- `/compact` is the **default, not the first reach**. It sits at the bottom because the four questions above it are all cheaper or more precise. The failure mode when people start here is a fresh session that is confidently wrong about a decision the summary flattened.
41
-
42
- ## Primary and secondary sources
43
-
44
- Every move except **Continue** turns a **primary source** into a **secondary source**: the session as it happened, replaced by a summary of it. The trade is always the same shape:
45
-
46
- | Source | Information | Noise | Room to move |
47
- | --------------------------------- | ----------- | ----- | ------------ |
48
- | Primary (Continue) | Full | Lots | Little |
49
- | Secondary (`/compact`, `/handoff`) | Lossy | Less | Lots |
50
-
51
- This is why question 1 comes first. You only pay the lossiness when staying costs more than it saves.
52
-
53
- ## These are judgement calls
54
-
55
- The questions are not objective: each has taste in it, and the same boundary can go two ways on two days. The value is in asking them **in order**, at the boundary rather than in the middle of the work.
@@ -1,90 +0,0 @@
1
- ---
2
- name: ask-matt
3
- description: Ask which skill or flow fits your situation. A router over the skills in this repo.
4
- disable-model-invocation: true
5
- ---
6
-
7
- # Ask Matt
8
-
9
- You don't remember every skill, so ask.
10
-
11
- A **flow** is a path through the skills. Most paths run along one **main flow**, and two **on-ramps** merge onto it. Everything else is standalone, or a vocabulary layer that runs underneath.
12
-
13
- ## The main flow: idea → ship
14
-
15
- The route most work travels. You have an idea and want it built.
16
-
17
- 1. **`/grill-with-docs`** sharpens the idea by interview. Start here whenever you are **working in a working directory**: it's stateful, retaining what it learns in `CONTEXT.md` and ADRs. (No working directory? Use `/grill-me` instead, covered under Standalone. Both run the same `/grilling` primitive; `grill-with-docs` is the one that leaves a paper trail, which makes it the better of the two whenever a repo is there to leave it in.)
18
- 2. **Branch: can you settle every question in conversation?** If a question needs a runnable answer (state, business logic, a UI you have to see), detour through a prototype, bridged by **`/handoff`** in both directions (a prototype lives in its own directory, which is exactly what `/handoff` is for; see Phase boundaries):
19
- - **`/handoff`** out, then open a fresh session against that file,
20
- - **`/prototype`** to answer the question with throwaway code,
21
- - **`/handoff`** back what you learned, and reference it from the original idea thread.
22
- 3. **Branch: is this a multi-session build?**
23
- - **Yes** → **`/to-spec`** (turn the thread into a spec), then **`/to-tickets`** to split it into tracer-bullet tickets, each declaring its **blocking edges**. On a local tracker that's one file per ticket under `.scratch/<feature>/issues/`, worked blockers-first by hand; on a real tracker the edges become native blocking links, so any ticket whose blockers are done can be grabbed: kick off **`/implement`** per ticket, **`/clear`ing context between each one**. Each ticket is self-contained, so the last one's context is disposable.
24
- - **No** → **`/implement`** right here, in the same context window.
25
-
26
- Either way, **`/implement`** builds each issue by driving **`/tdd`** internally (one red-green slice at a time), then closes out by running **`/code-review`**, a two-axis review (Standards + Spec) of the diff, before committing. Reach for **`/tdd`** on its own when you just want to build a concrete behaviour test-first without a full spec, and **`/code-review`** on its own whenever you want to review a branch or PR against a fixed point.
27
-
28
- ### Context hygiene
29
-
30
- Keep steps 1–3 in **one unbroken context window** (don't compact or clear until after `/to-tickets`) so the grilling, spec, and tickets all build on the same thinking. Each `/implement` then starts fresh, working from the ticket.
31
-
32
- The limit on this is the **[smart zone](https://www.aihero.dev/ai-coding-dictionary/smart-zone)**: the window (~150k tokens on state-of-the-art models) within which the model still reasons sharply. If a session approaches it before `/to-tickets`, don't push on degraded; `/compact` at the nearest phase boundary and carry on (see Phase boundaries).
33
-
34
- ## On-ramps
35
-
36
- A starting situation that generates work, then merges onto the main flow.
37
-
38
- - **Bugs and requests piling up** → **`/triage`**. It moves issues through triage roles and produces agent-ready issues, which **`/implement`** later picks up.
39
-
40
- Triage is only for issues **you didn't create**: bug reports, incoming feature requests, anything that arrives raw. Tickets that `/to-tickets` produced are already agent-ready, so **don't triage them**.
41
-
42
- - **Something's broken** → **`/diagnosing-bugs`**. For the hard ones: the bug that resists a first glance, the intermittent flake, the regression that crept in between two known-good states. It refuses to theorise until it has a **tight feedback loop** (one command that already goes red on *this* bug), then fixes with a regression test. Its post-mortem hands off to **`/improve-codebase-architecture`** when the real finding is that there's no good seam to lock the bug down.
43
-
44
- - **A huge, foggy effort: a greenfield project or a huge feature build, too big for one session** → **`/wayfinder`**, the most cognitively demanding flow here. When the way from here to the destination isn't visible yet, it charts a **shared map** of **decision tickets** on the issue tracker and resolves them one at a time, producing **decisions, not deliverables**, until the fog is pushed back and the way is clear. Where **`/grill-with-docs`** sharpens an idea you can hold in one session, wayfinder is for the idea you can't, and it's slower and denser, so save it for exactly that, never a well-scoped feature.
45
-
46
- When the map clears, **it hands off, it doesn't build**: merge onto the main flow at **`/to-spec`**, which collapses the map's linked decisions into a buildable plan, then `/to-tickets` and `/implement` as usual. Looping the map straight into `/implement` skips that collapse and throws the linked detail away, so go straight to `/implement` only when the effort turned out genuinely small.
47
-
48
- ## Codebase health
49
-
50
- Not feature work, just upkeep.
51
-
52
- - **`/improve-codebase-architecture`** runs whenever you have a spare moment to keep the codebase good for agents to operate in. It surfaces **deepening opportunities**; picking one _generates an idea_ you can take into the main flow at `/grill-with-docs`. It's the survey that finds the candidates; **`/codebase-design`** (below) is the bench you design the chosen one on.
53
-
54
- ## Vocabulary underneath
55
-
56
- Two model-invoked references that run *beneath* the other skills, each the single source of truth for its vocabulary. Reach for them directly when the **words**, not the process, are the problem; or let the skills above pull them in.
57
-
58
- - **`/domain-modeling`**: sharpen the project's *domain* language: challenge a fuzzy term, resolve an overloaded word ("account" doing three jobs), record a hard-to-reverse decision as an ADR. It's the active discipline `/grill-with-docs` drives to keep `CONTEXT.md` a clean glossary.
59
- - **`/codebase-design`** is the deep-module vocabulary (module, interface, depth, seam, adapter, leverage, locality) for designing a module's *shape*: a lot of behaviour behind a small interface at a clean seam. `/tdd` and `/improve-codebase-architecture` both speak it.
60
-
61
- ## Phase boundaries
62
-
63
- A **phase** is a chunk of work inside a session: the grilling, the implementation, the QA. At the **boundary** between two of them you have five options, and picking between them is the fuzziest decision in this whole map:
64
-
65
- - **Continue**: stay put. Costs nothing, loses nothing.
66
- - **`/clear`**: empty the window, when nothing here matters to what's next.
67
- - **`/handoff`** writes a portable markdown file. Narrow: only for a **new harness**, a **new directory**, a **colleague**, or forking a side task **mid-phase**. What it buys is portability.
68
- - **Subagent**: send a tightly-scoped task to its own window and get a report back.
69
- - **`/compact`** compresses this context and seeds a fresh session with it. The **default**, at the bottom of the tree rather than the first reach.
70
-
71
- Read [PHASE-BOUNDARIES.md](PHASE-BOUNDARIES.md) for the ordered tree: the five questions, the reasoning behind each branch, and why the primary-source cost makes **Continue** the one to rule out first. Make the decision **at** a boundary; mid-phase, continue or split the rest into subagents.
72
-
73
- ## Standalone
74
-
75
- Off the main flow entirely.
76
-
77
- - **`/grill-me`**: the same relentless interview as `/grill-with-docs`, but **stateless**: it saves nothing locally and builds no `CONTEXT.md`. Reach for it when you are **not working in a working directory** (sharpening a plan, a design, a piece of writing, anything with no repo under it). If you are in a working directory, use `/grill-with-docs` instead: it runs the same interview and leaves a paper trail, so it is strictly the better one.
78
- - **`/grilling`** is the interview primitive itself: rounds, the frontier, facts are the agent's job and decisions are yours. `/grill-me` and `/grill-with-docs` are the two named ways in, and `/triage`, `/wayfinder` and `/improve-codebase-architecture` all run it internally. Reach for it directly only when you want the interview with no wrapper around it.
79
- - **`/resolving-merge-conflicts`** works an in-progress merge or rebase conflict hunk by hunk, resolving by **intent** traced to each side's primary source rather than by picking lines, then finishes the operation. It never runs `--abort`. Standalone and off every flow: reach for it when you are already mid-conflict.
80
- - **`/prototype`** is a small, throwaway program that answers one design question: does this state model feel right, or what should this UI look like. Throwaway is a constraint on how the code is written, not a promise to destroy it: the answer folds into the real code, and the prototype itself is kept as a **primary source** on a `prototype/<name>` branch out of main, pointed at from the implementation issue. It's the detour in step 2 of the main flow, but reach for it any time a design question is hard to settle on paper.
81
- - **`/research`**: delegate reading legwork to a **background agent**: it investigates a question against **primary sources**, then leaves a cited Markdown file in the repo. Keep working while it reads. The file it produces is something to take *into* the main flow at `/grill-with-docs`, since research feeds the thinking rather than replacing it.
82
- - **`/to-questionnaire`** comes in when the thing blocking you isn't in your head or the codebase but in **someone else's**, and it writes them a questionnaire to fill in. It's the inverse of `/grill-me`: instead of interviewing you about the subject, it interviews you about the **send** (who it's going to, what you need back) and aims the questions at the gap. What comes back is material for `/grill-with-docs` or `/to-spec`.
83
- - **`/wizard`** is for the steps only a **human** can take: provisioning infrastructure, setting up credentials or CI secrets, clicking through an unfamiliar third-party dashboard, running a one-off migration or cutover. It generates an interactive bash script that opens each URL, captures each value, and writes it into `.env` and GitHub secrets, so the procedure stops being something you re-explain to an agent every time. Model-invoked, so the agent reaches for it the moment it hits a wall only you can pass. If the agent could just do it itself, it should; this is for where a human is genuinely in the loop.
84
- - **`/wait-what`** is the corrective for a message that didn't land. Use it mid-conversation, inside any other skill, and the agent re-pitches what it just said with the context you were missing, in plain English, using the `CONTEXT.md` vocabulary. It works after the fact; `/grill-with-docs` is the upfront cure, because a shared language agreed early is what stops the jargon arriving at all.
85
- - **`/teach`**: learn a concept over multiple sessions, using the current directory as a stateful workspace.
86
- - **`/writing-for-agents`** is the reference for writing documents agents consume: skills, AGENTS.md, pointed-at docs.
87
-
88
- ## Precondition
89
-
90
- **`/setup-matt-pocock-skills`**: run before your first engineering flow to configure the issue tracker, triage labels, and doc layout the other skills assume. Custom issue trackers also work.
@@ -1,5 +0,0 @@
1
- interface:
2
- display_name: "Ask Matt"
3
- short_description: "Find the right skill or workflow"
4
- policy:
5
- allow_implicit_invocation: false
@@ -1,87 +0,0 @@
1
- ---
2
- name: code-review
3
- description: "Review the changes since a fixed point (commit, branch, tag, or merge-base) along two axes: Standards (does the code follow this repo's documented coding standards?) and Spec (does the code match what the originating issue/spec asked for?). Runs both reviews in parallel sub-agents and reports them side by side. Use when the user wants to review a branch, a PR, work-in-progress changes, or asks to \"review since X\"."
4
- ---
5
-
6
- Two-axis review of the diff between `HEAD` and a fixed point the user supplies:
7
-
8
- - **Standards**: does the code conform to this repo's documented coding standards?
9
- - **Spec**: does the code faithfully implement the originating issue / spec?
10
-
11
- Both axes run as **parallel sub-agents** so they don't pollute each other's context, then this skill aggregates their findings.
12
-
13
- The issue tracker should have been provided to you. If `docs/agents/issue-tracker.md` is missing, tell the user to run `/setup-matt-pocock-skills`.
14
-
15
- ## Process
16
-
17
- ### 1. Pin the fixed point
18
-
19
- Whatever the user said is the fixed point (a commit SHA, branch name, tag, `main`, `HEAD~5`, etc.). If they didn't specify one, ask for it.
20
-
21
- Capture the diff command once: `git diff <fixed-point>...HEAD` (three-dot, so the comparison is against the merge-base). Also note the list of commits via `git log <fixed-point>..HEAD --oneline`.
22
-
23
- Before going further, confirm the fixed point resolves (`git rev-parse <fixed-point>`) and the diff is non-empty. A bad ref or empty diff should fail here, not inside two parallel sub-agents.
24
-
25
- ### 2. Identify the spec source
26
-
27
- Look for the originating spec, in this order:
28
-
29
- 1. Issue references in the commit messages (`#123`, `Closes #45`, GitLab `!67`, etc.), fetched via the workflow in `docs/agents/issue-tracker.md`.
30
- 2. A path the user passed as an argument.
31
- 3. A spec file under `docs/`, `specs/`, or `.scratch/` matching the branch name or feature.
32
- 4. If nothing is found, ask the user where the spec is. If they say there isn't one, the **Spec** sub-agent will skip and report "no spec available".
33
-
34
- ### 3. Identify the standards sources
35
-
36
- Anything in the repo that documents how code should be written, such as `CODING_STANDARDS.md` or `CONTRIBUTING.md`.
37
-
38
- On top of whatever the repo documents, the Standards axis always carries the **smell baseline** below: a fixed set of Fowler code smells (_Refactoring_, ch.3) that applies even when a repo documents nothing. Two rules bind it:
39
-
40
- - **The repo overrides.** A documented repo standard always wins; where it endorses something the baseline would flag, suppress the smell.
41
- - **Always a judgement call.** Each smell is a labelled heuristic ("possible Feature Envy"), never a hard violation. Like any standard here, skip anything tooling already enforces.
42
-
43
- Each smell reads *what it is* → *how to fix*; match it against the diff:
44
-
45
- - **Mysterious Name**: a function, variable, or type whose name doesn't reveal what it does or holds. → rename it; if no honest name comes, the design's murky.
46
- - **Duplicated Code**: the same logic shape appears in more than one hunk or file in the change. → extract the shared shape, call it from both.
47
- - **Feature Envy**: a method that reaches into another object's data more than its own. → move the method onto the data it envies.
48
- - **Data Clumps**: the same few fields or params keep travelling together (a type wanting to be born). → bundle them into one type, pass that.
49
- - **Primitive Obsession**: a primitive or string standing in for a domain concept that deserves its own type. → give the concept its own small type.
50
- - **Repeated Switches**: the same `switch`/`if`-cascade on the same type recurs across the change. → replace with polymorphism, or one map both sites share.
51
- - **Shotgun Surgery**: one logical change forces scattered edits across many files in the diff. → gather what changes together into one module.
52
- - **Divergent Change**: one file or module is edited for several unrelated reasons. → split so each module changes for one reason.
53
- - **Speculative Generality**: abstraction, parameters, or hooks added for needs the spec doesn't have. → delete it; inline back until a real need shows.
54
- - **Message Chains**: long `a.b().c().d()` navigation the caller shouldn't depend on. → hide the walk behind one method on the first object.
55
- - **Middle Man**: a class or function that mostly just delegates onward. → cut it, call the real target direct.
56
- - **Refused Bequest**: a subclass or implementer that ignores or overrides most of what it inherits. → drop the inheritance, use composition.
57
-
58
- ### 4. Spawn both sub-agents in parallel
59
-
60
- **Standards sub-agent prompt** should include:
61
-
62
- - The full diff command and commit list.
63
- - The list of standards-source files you found in step 3, **plus the smell baseline from step 3** pasted in full (the sub-agent has no other access to it).
64
- - The brief: "Report, per file/hunk where relevant, (a) every place the diff violates a documented standard: cite the standard (file + the rule); and (b) any baseline smell you spot: name it and quote the hunk. Distinguish hard violations from judgement calls: documented-standard breaches can be hard, but baseline smells are always judgement calls, and a documented repo standard overrides the baseline. Skip anything tooling enforces. Under 400 words."
65
-
66
- **Spec sub-agent prompt** should include:
67
-
68
- - The diff command and commit list.
69
- - The path or fetched contents of the spec.
70
- - The brief: "Report: (a) requirements the spec asked for that are missing or partial; (b) behaviour in the diff that wasn't asked for (scope creep); (c) requirements that look implemented but where the implementation looks wrong. Quote the spec line for each finding. Under 400 words."
71
-
72
- If the spec is missing, skip the Spec sub-agent and note this in the final report.
73
-
74
- ### 5. Aggregate
75
-
76
- Present the two reports under `## Standards` and `## Spec` headings, verbatim or lightly cleaned. Do **not** merge or rerank findings, because the two axes are deliberately separate (see _Why two axes_).
77
-
78
- End with a one-line summary: total findings per axis, and the worst issue _within each axis_ (if any). Don't pick a single winner across axes: that's the reranking the separation exists to prevent.
79
-
80
- ## Why two axes
81
-
82
- A change can pass one axis and fail the other:
83
-
84
- - Code that follows every standard but implements the wrong thing → **Standards pass, Spec fail.**
85
- - Code that does exactly what the issue asked but breaks the project's conventions → **Spec pass, Standards fail.**
86
-
87
- Reporting them separately stops one axis from masking the other.