@heihei0299/matt-skills 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.
Files changed (131) hide show
  1. package/.agents/skills/ask-matt/SKILL.md +78 -0
  2. package/.agents/skills/ask-matt/agents/openai.yaml +5 -0
  3. package/.agents/skills/code-review/SKILL.md +94 -0
  4. package/.agents/skills/code-review/agents/openai.yaml +3 -0
  5. package/.agents/skills/codebase-design/DEEPENING.md +37 -0
  6. package/.agents/skills/codebase-design/DESIGN-IT-TWICE.md +44 -0
  7. package/.agents/skills/codebase-design/SKILL.md +114 -0
  8. package/.agents/skills/codebase-design/agents/openai.yaml +3 -0
  9. package/.agents/skills/commit-check/SKILL.md +65 -0
  10. package/.agents/skills/commit-check/agents/openai.yaml +5 -0
  11. package/.agents/skills/commit-check/scripts/scan-sensitive.sh +36 -0
  12. package/.agents/skills/diagnose-fix/SKILL.md +66 -0
  13. package/.agents/skills/diagnose-fix/agents/openai.yaml +5 -0
  14. package/.agents/skills/diagnose-fix/references/anti-patterns.md +20 -0
  15. package/.agents/skills/diagnosing-bugs/SKILL.md +134 -0
  16. package/.agents/skills/diagnosing-bugs/agents/openai.yaml +3 -0
  17. package/.agents/skills/diagnosing-bugs/scripts/hitl-loop.template.sh +41 -0
  18. package/.agents/skills/domain-modeling/ADR-FORMAT.md +47 -0
  19. package/.agents/skills/domain-modeling/CONTEXT-FORMAT.md +60 -0
  20. package/.agents/skills/domain-modeling/SKILL.md +74 -0
  21. package/.agents/skills/domain-modeling/agents/openai.yaml +3 -0
  22. package/.agents/skills/grill-me/SKILL.md +7 -0
  23. package/.agents/skills/grill-me/agents/openai.yaml +5 -0
  24. package/.agents/skills/grill-to-spec/SKILL.md +83 -0
  25. package/.agents/skills/grill-to-spec/agents/openai.yaml +5 -0
  26. package/.agents/skills/grill-to-spec/references/rules.md +33 -0
  27. package/.agents/skills/grill-with-docs/SKILL.md +7 -0
  28. package/.agents/skills/grill-with-docs/agents/openai.yaml +5 -0
  29. package/.agents/skills/grilling/SKILL.md +12 -0
  30. package/.agents/skills/grilling/agents/openai.yaml +3 -0
  31. package/.agents/skills/handoff/SKILL.md +16 -0
  32. package/.agents/skills/handoff/agents/openai.yaml +5 -0
  33. package/.agents/skills/implement/SKILL.md +15 -0
  34. package/.agents/skills/implement/agents/openai.yaml +5 -0
  35. package/.agents/skills/improve-codebase-architecture/HTML-REPORT.md +123 -0
  36. package/.agents/skills/improve-codebase-architecture/SKILL.md +71 -0
  37. package/.agents/skills/improve-codebase-architecture/agents/openai.yaml +5 -0
  38. package/.agents/skills/prototype/LOGIC.md +79 -0
  39. package/.agents/skills/prototype/SKILL.md +26 -0
  40. package/.agents/skills/prototype/UI.md +112 -0
  41. package/.agents/skills/prototype/agents/openai.yaml +3 -0
  42. package/.agents/skills/research/SKILL.md +12 -0
  43. package/.agents/skills/research/agents/openai.yaml +3 -0
  44. package/.agents/skills/resolving-merge-conflicts/SKILL.md +14 -0
  45. package/.agents/skills/resolving-merge-conflicts/agents/openai.yaml +3 -0
  46. package/.agents/skills/setup-matt-pocock-skills/SKILL.md +116 -0
  47. package/.agents/skills/setup-matt-pocock-skills/agents/openai.yaml +5 -0
  48. package/.agents/skills/setup-matt-pocock-skills/domain.md +51 -0
  49. package/.agents/skills/setup-matt-pocock-skills/issue-tracker-github.md +45 -0
  50. package/.agents/skills/setup-matt-pocock-skills/issue-tracker-gitlab.md +46 -0
  51. package/.agents/skills/setup-matt-pocock-skills/issue-tracker-local.md +30 -0
  52. package/.agents/skills/setup-matt-pocock-skills/triage-labels.md +15 -0
  53. package/.agents/skills/tdd/SKILL.md +36 -0
  54. package/.agents/skills/tdd/agents/openai.yaml +3 -0
  55. package/.agents/skills/tdd/mocking.md +59 -0
  56. package/.agents/skills/tdd/tests.md +77 -0
  57. package/.agents/skills/tdd-implement/SKILL.md +143 -0
  58. package/.agents/skills/tdd-implement/agents/openai.yaml +5 -0
  59. package/.agents/skills/tdd-implement/references/stages.md +315 -0
  60. package/.agents/skills/teach/GLOSSARY-FORMAT.md +35 -0
  61. package/.agents/skills/teach/LEARNING-RECORD-FORMAT.md +46 -0
  62. package/.agents/skills/teach/MISSION-FORMAT.md +31 -0
  63. package/.agents/skills/teach/RESOURCES-FORMAT.md +32 -0
  64. package/.agents/skills/teach/SKILL.md +140 -0
  65. package/.agents/skills/teach/agents/openai.yaml +5 -0
  66. package/.agents/skills/to-spec/SKILL.md +75 -0
  67. package/.agents/skills/to-spec/agents/openai.yaml +5 -0
  68. package/.agents/skills/to-tickets/SKILL.md +105 -0
  69. package/.agents/skills/to-tickets/agents/openai.yaml +5 -0
  70. package/.agents/skills/triage/AGENT-BRIEF.md +207 -0
  71. package/.agents/skills/triage/OUT-OF-SCOPE.md +105 -0
  72. package/.agents/skills/triage/SKILL.md +112 -0
  73. package/.agents/skills/triage/agents/openai.yaml +5 -0
  74. package/.agents/skills/wayfinder/SKILL.md +128 -0
  75. package/.agents/skills/wayfinder/agents/openai.yaml +5 -0
  76. package/.agents/skills/writing-great-skills/GLOSSARY.md +201 -0
  77. package/.agents/skills/writing-great-skills/SKILL.md +83 -0
  78. package/.agents/skills/writing-great-skills/agents/openai.yaml +5 -0
  79. package/LICENSE +21 -0
  80. package/README.md +167 -0
  81. package/bin/cli.js +353 -0
  82. package/package.json +26 -0
  83. package/template/.opencode/CONTEXT.md +47 -0
  84. package/template/.opencode/agents/issue-audit.md +52 -0
  85. package/template/.opencode/commands/grill-to-spec.md +13 -0
  86. package/template/.opencode/commands/handoff.md +12 -0
  87. package/template/.opencode/commands/improve-codebase-architecture.md +13 -0
  88. package/template/.opencode/commands/issue-audit.md +115 -0
  89. package/template/.opencode/commands/teach.md +12 -0
  90. package/template/.opencode/commands/to-spec.md +13 -0
  91. package/template/.opencode/commands/to-tickets.md +12 -0
  92. package/template/.opencode/commands/triage.md +12 -0
  93. package/template/.opencode/commands/wayfinder.md +13 -0
  94. package/template/.opencode/commands/writing-great-skills.md +12 -0
  95. package/template/.opencode/docs/agents/domain.md +51 -0
  96. package/template/.opencode/docs/agents/issue-tracker.md +30 -0
  97. package/template/.opencode/docs/agents/runtime-discipline.md +36 -0
  98. package/template/.opencode/docs/agents/skill-design.md +32 -0
  99. package/template/.opencode/docs/agents/triage-labels.md +15 -0
  100. package/template/.opencode/skills/commit-check/SKILL.md +65 -0
  101. package/template/.opencode/skills/commit-check/agents/openai.yaml +5 -0
  102. package/template/.opencode/skills/commit-check/scripts/scan-sensitive.sh +36 -0
  103. package/template/.opencode/skills/diagnose-fix/SKILL.md +66 -0
  104. package/template/.opencode/skills/diagnose-fix/agents/openai.yaml +5 -0
  105. package/template/.opencode/skills/diagnose-fix/references/anti-patterns.md +20 -0
  106. package/template/.opencode/skills/grill-to-spec/SKILL.md +83 -0
  107. package/template/.opencode/skills/grill-to-spec/agents/openai.yaml +5 -0
  108. package/template/.opencode/skills/grill-to-spec/references/rules.md +33 -0
  109. package/template/.opencode/skills/tdd-implement/SKILL.md +143 -0
  110. package/template/.opencode/skills/tdd-implement/agents/openai.yaml +5 -0
  111. package/template/.opencode/skills/tdd-implement/references/stages.md +315 -0
  112. package/template/.pi/agents/issue-audit.md +52 -0
  113. package/template/.pi/docs/agents/domain.md +51 -0
  114. package/template/.pi/docs/agents/issue-tracker.md +30 -0
  115. package/template/.pi/docs/agents/runtime-discipline.md +36 -0
  116. package/template/.pi/docs/agents/skill-design.md +32 -0
  117. package/template/.pi/docs/agents/triage-labels.md +15 -0
  118. package/template/.pi/prompts/issue-audit.md +114 -0
  119. package/template/.pi/skills/commit-check/SKILL.md +65 -0
  120. package/template/.pi/skills/commit-check/agents/openai.yaml +5 -0
  121. package/template/.pi/skills/commit-check/scripts/scan-sensitive.sh +36 -0
  122. package/template/.pi/skills/diagnose-fix/SKILL.md +66 -0
  123. package/template/.pi/skills/diagnose-fix/agents/openai.yaml +5 -0
  124. package/template/.pi/skills/diagnose-fix/references/anti-patterns.md +20 -0
  125. package/template/.pi/skills/grill-to-spec/SKILL.md +83 -0
  126. package/template/.pi/skills/grill-to-spec/agents/openai.yaml +5 -0
  127. package/template/.pi/skills/grill-to-spec/references/rules.md +33 -0
  128. package/template/.pi/skills/tdd-implement/SKILL.md +143 -0
  129. package/template/.pi/skills/tdd-implement/agents/openai.yaml +5 -0
  130. package/template/.pi/skills/tdd-implement/references/stages.md +315 -0
  131. package/template/AGENTS.md +59 -0
@@ -0,0 +1,12 @@
1
+ ---
2
+ description: 把计划/spec/当前对话拆为一批 tracer-bullet 票,每票声明阻塞边,发布到 issue tracker
3
+ ---
4
+
5
+ # To Tickets
6
+
7
+ 加载并执行 to-tickets 技能,把计划或 spec 拆为票:
8
+
9
+ **主题:** $ARGUMENTS
10
+
11
+ - 拆为 tracer-bullet 票,每票声明其阻塞边
12
+ - 发布到配置的 issue tracker(本地每票一个文件,或真实 tracker 的原生阻塞链接)
@@ -0,0 +1,12 @@
1
+ ---
2
+ description: 分诊——把 issue 与外部 PR 按 triage 角色状态机流转:分类、验证、需要时 grill、写 agent-ready brief
3
+ ---
4
+
5
+ # Triage
6
+
7
+ 加载并执行 triage 技能,对 issue/PR 做分诊:
8
+
9
+ **对象:** $ARGUMENTS
10
+
11
+ - 按 triage 状态机流转:分类 → 验证 → 需要时 grill → 写 agent-ready brief
12
+ - 遵守 triage labels 与 issue tracker 约定
@@ -0,0 +1,13 @@
1
+ ---
2
+ description: 巨型规划——把超出一个 agent 会话的大块工作规划为 issue tracker 上的决策票地图,逐票解决直到路径清晰
3
+ ---
4
+
5
+ # Wayfinder
6
+
7
+ 加载并执行 wayfinder 技能,为超长工作规划一张共享的决策票地图:
8
+
9
+ **目标:** $ARGUMENTS
10
+
11
+ - 把超过一个 agent 会话能容纳的工作拆为 issue tracker 上的决策票
12
+ - 每票一个决策点,标注依赖与阻塞边
13
+ - 逐票解决,直到通往目标的路径清晰
@@ -0,0 +1,12 @@
1
+ ---
2
+ description: 技能写作参考——编写和编辑技能的最佳实践(词汇表与原则,让技能可预测)
3
+ ---
4
+
5
+ # Writing Great Skills
6
+
7
+ 加载并执行 writing-great-skills 技能,编写/编辑技能:
8
+
9
+ **主题:** $ARGUMENTS
10
+
11
+ - 以技能设计规范为参考(回合连续性、模型选择、任务分解等原则)
12
+ - 按 Agent Skills 标准编写可预测的技能文本
@@ -0,0 +1,51 @@
1
+ # Domain Docs
2
+
3
+ How the engineering skills should consume this repo's domain documentation when exploring the codebase.
4
+
5
+ ## Before exploring, read these
6
+
7
+ - **`CONTEXT.md`** at the repo root, or
8
+ - **`CONTEXT-MAP.md`** at the repo root if it exists — it points at one `CONTEXT.md` per context. Read each one relevant to the topic.
9
+ - **`docs/adr/`** — read ADRs that touch the area you're about to work in. In multi-context repos, also check `src/<context>/docs/adr/` for context-scoped decisions.
10
+
11
+ If any of these files don't exist, **proceed silently**. Don't flag their absence; don't suggest creating them upfront. The `/domain-modeling` skill (reached via `/grill-with-docs` and `/improve-codebase-architecture`) creates them lazily when terms or decisions actually get resolved.
12
+
13
+ ## File structure
14
+
15
+ Single-context repo (most repos):
16
+
17
+ ```
18
+ /
19
+ ├── CONTEXT.md
20
+ ├── docs/adr/
21
+ │ ├── 0001-event-sourced-orders.md
22
+ │ └── 0002-postgres-for-write-model.md
23
+ └── src/
24
+ ```
25
+
26
+ Multi-context repo (presence of `CONTEXT-MAP.md` at the root):
27
+
28
+ ```
29
+ /
30
+ ├── CONTEXT-MAP.md
31
+ ├── docs/adr/ ← system-wide decisions
32
+ └── src/
33
+ ├── ordering/
34
+ │ ├── CONTEXT.md
35
+ │ └── docs/adr/ ← context-specific decisions
36
+ └── billing/
37
+ ├── CONTEXT.md
38
+ └── docs/adr/
39
+ ```
40
+
41
+ ## Use the glossary's vocabulary
42
+
43
+ When your output names a domain concept (in an issue title, a refactor proposal, a hypothesis, a test name), use the term as defined in `CONTEXT.md`. Don't drift to synonyms the glossary explicitly avoids.
44
+
45
+ If the concept you need isn't in the glossary yet, that's a signal — either you're inventing language the project doesn't use (reconsider) or there's a real gap (note it for `/domain-modeling`).
46
+
47
+ ## Flag ADR conflicts
48
+
49
+ If your output contradicts an existing ADR, surface it explicitly rather than silently overriding:
50
+
51
+ > _Contradicts ADR-0007 (event-sourced orders) — but worth reopening because…_
@@ -0,0 +1,30 @@
1
+ # Issue tracker: Local Markdown
2
+
3
+ Issues and specs (you may know a spec as a PRD) for this repo live as markdown files in `.scratch/`.
4
+
5
+ ## Conventions
6
+
7
+ - One feature per directory: `.scratch/<feature-slug>/`
8
+ - The spec is `.scratch/<feature-slug>/spec.md`
9
+ - Implementation issues are one file per ticket at `.scratch/<feature-slug>/issues/<NN>-<slug>.md`, numbered from `01` — never a single combined tickets file
10
+ - Triage state is recorded as a `Status:` line near the top of each issue file (see `triage-labels.md` for the role strings)
11
+ - Comments and conversation history append to the bottom of the file under a `## Comments` heading
12
+
13
+ ## When a skill says "publish to the issue tracker"
14
+
15
+ Create a new file under `.scratch/<feature-slug>/` (creating the directory if needed).
16
+
17
+ ## When a skill says "fetch the relevant ticket"
18
+
19
+ Read the file at the referenced path. The user will normally pass the path or the issue number directly.
20
+
21
+ ## Wayfinding operations
22
+
23
+ Used by `/wayfinder`. The **map** is a file with one **child** file per ticket.
24
+
25
+ - **Map**: `.scratch/<effort>/map.md` — the Notes / Decisions-so-far / Fog body.
26
+ - **Child ticket**: `.scratch/<effort>/issues/NN-<slug>.md`, numbered from `01`, with the question in the body. A `Type:` line records the ticket type (`research`/`prototype`/`grilling`/`task`); a `Status:` line records `claimed`/`resolved`.
27
+ - **Blocking**: a `Blocked by: NN, NN` line near the top. A ticket is unblocked when every file it lists is `resolved`.
28
+ - **Frontier**: scan `.scratch/<effort>/issues/` for files that are open, unblocked, and unclaimed; first by number wins.
29
+ - **Claim**: set `Status: claimed` and save before any work.
30
+ - **Resolve**: append the answer under an `## Answer` heading, set `Status: resolved`, then append a context pointer (gist + link) to the map's Decisions-so-far in `map.md`.
@@ -0,0 +1,36 @@
1
+ # Runtime Discipline
2
+
3
+ 本仓库会话的运行时纪律,执行口径源自 `.opencode/docs/agents/skill-design.md` 的三条规则(规范正文)。术语定义见 `.opencode/CONTEXT.md`。
4
+
5
+ ## 回合连续性规则
6
+
7
+ 每个逻辑单元(红-绿循环、typecheck、测试修复)必须在一个回合内连续执行完毕后才输出:测试 → 分析失败 → 修正 → 重跑 → 全绿整条链一气呵成,中途不输出、不停止、不等用户"继续"。
8
+
9
+ 输出只允许发生在三种情况:
10
+ - 合规交互点:技能/流程要求的用户确认(如 tdd-implement 的 seams 清单确认)
11
+ - 外部阻塞:权限拒绝、缺失授权、依赖不可用——明确说明所需授权或替代路径,不静默停止
12
+ - 阶段完成:整个阶段的出口条件满足(如 seam 全绿、typecheck 通过、commit 完成)
13
+
14
+ 预告下一步后立即执行该步骤,禁止把"分析/预告"当作回合终点。随包示例见 `.opencode/skills/tdd-implement/SKILL.md` 与 `references/stages.md` 阶段③ 3e。
15
+
16
+ ## 运行纪律(长程任务)
17
+
18
+ 本仓库会话做**长程任务**(Long-Horizon Skill:多阶段/多 seam 串行执行,如 tdd-implement、diagnosing-bugs、improve-codebase-architecture、wayfinder、grill-to-spec、to-spec)时:
19
+
20
+ - **长程声明**:执行长程技能前,确认技能文本自带长程任务声明与回合连续性规则(Turn Continuity)——阶段内连续动作一回合内完成,不依赖 harness `/goal` 防线。tdd-implement 已内嵌(SKILL.md 声明 + references/stages.md 阶段③规则)。
21
+ - **模型选择**:flash 级模型长程任务卡住概率显著更高;关键长任务优先强模型或 `/goal` 模式。
22
+ - **任务分解(Chunking)**:巨型操作拆小步执行——单次 `write` 超过 ~150 行先写骨架再分批补全;批量 `replace` 超过 ~5 处分批执行,每批后立即验证。tdd-implement 已内嵌该规则(随包分发)。
23
+
24
+ ## 执行原则(细则)
25
+
26
+ - 先澄清边界再实现;任务收敛后直接执行,不做不必要的形式化流程
27
+ - 局部修改、最小充分实现,避免无关扩张
28
+ - 用户当次明确指令优先于历史经验与参考项目
29
+ - 脏工作区不回滚他人改动;遇到未明改动先理解再兼容
30
+
31
+ ## 文档维护(细则)
32
+
33
+ - 本文件与分文件只记录长期有效、跨任务可复用的工程经验与项目级约定
34
+ - 一次性需求、临时接口选择、用户当次指定方案不沉淀;更换接口/方案视为需求变更,不判定"旧错新对"
35
+ - 仅当问题重复出现、暴露长期约束、影响后续多次开发、用户明确要求沉淀,或涉及安全/构建/测试/发布/架构边界时更新
36
+ - 经验条目包含:标题、触发信号、根因/约束、正确做法、验证方式、适用范围
@@ -0,0 +1,32 @@
1
+ # Skill Design Spec
2
+
3
+ The design rules every skill in this repo must obey. Apply them when writing a new skill or editing an existing one. Terms are defined once in [`CONTEXT.md`](../../CONTEXT.md) — reference them there, never restate the definition.
4
+
5
+ This spec exists because of a real incident: a long-horizon skill run on a flash-class model stopped its turn at "announce the next step" points four times in one session (see `DIAGNOSIS-tdd-implement-stuck.md`). The three rules below are the preventive measures that came out of that diagnosis. They are repo rules, not advice.
6
+
7
+ ## Rule 1 — Turn Continuity
8
+
9
+ Every **Long-Horizon Skill** must carry a positive **Turn Continuity** rule of its own: the consecutive actions of a stage (red → green → typecheck → next seam) are executed serially **within one turn**, until the stage's exit condition is met. Do not end the turn at "announce the next step" points, and do not wait for the user to say "continue".
10
+
11
+ - State it **positively** (per the negation principle in `writing-great-skills`): describe the target behaviour, never the banned one.
12
+ - It must be **self-contained** — the skill cannot rely on the harness `/goal` line, because no `/goal` exists when the user does not activate one.
13
+ - Every stage ends on a checkable exit condition; reaching it is the only thing that ends the turn.
14
+ - A sub-step going green (e.g. one seam) is not a stage exit — a stage ends only when all of its seams are complete. Progress output does not itself end the turn: output, then keep executing until one of the three endpoints (compliance checkpoint, external blocker, stage exit) is reached.
15
+ - Canonical example: the 回合连续性 rule in [`.agents/skills/tdd-implement/references/stages.md`](../../skills/tdd-implement/references/stages.md) stage ③.
16
+
17
+ ## Rule 2 — Model Selection
18
+
19
+ Flash-class models are markedly more likely to stop prematurely on long-horizon agentic work. For critical long tasks, prefer a stronger model or `/goal` mode. This is a runtime choice, not something a skill text can enforce — record it here so skill authors and session runners share the same guidance.
20
+
21
+ ## Rule 3 — Progress Chunking
22
+
23
+ Giant turns — a single `write` of a large file, or a batch `replace` of a hundred-plus lines — hit output caps and get truncated mid-work. Chunk the work into small, individually verifiable steps:
24
+
25
+ - A single `write` over ~150 lines: write the skeleton first, then fill in batches.
26
+ - A batch of more than ~5 `replace`s: split into batches and verify after each batch.
27
+
28
+ These thresholds are experience defaults; adjust them as practice shows better values.
29
+
30
+ ## Long-horizon skills inventory
31
+
32
+ Skills currently classified as Long-Horizon, to be evolved against these rules as they are touched: `tdd-implement` (fixed), `diagnose-fix` (fixed — new orchestration skill for diagnosis + TDD fix, carries its own Turn Continuity rule), `diagnosing-bugs`, `improve-codebase-architecture`, `wayfinder`, `grill-to-spec`, `to-spec`. Backfilling existing skill texts is out of scope for now — these rules bind new and edited skills going forward.
@@ -0,0 +1,15 @@
1
+ # Triage Labels
2
+
3
+ The skills speak in terms of five canonical triage roles. This file maps those roles to the actual label strings used in this repo's issue tracker.
4
+
5
+ | Label in mattpocock/skills | Label in our tracker | Meaning |
6
+ | -------------------------- | -------------------- | ---------------------------------------- |
7
+ | `needs-triage` | `needs-triage` | Maintainer needs to evaluate this issue |
8
+ | `needs-info` | `needs-info` | Waiting on reporter for more information |
9
+ | `ready-for-agent` | `ready-for-agent` | Fully specified, ready for an AFK agent |
10
+ | `ready-for-human` | `ready-for-human` | Requires human implementation |
11
+ | `wontfix` | `wontfix` | Will not be actioned |
12
+
13
+ When a skill mentions a role (e.g. "apply the AFK-ready triage label"), use the corresponding label string from this table.
14
+
15
+ Edit the right-hand column to match whatever vocabulary you actually use.
@@ -0,0 +1,65 @@
1
+ ---
2
+ name: commit-check
3
+ description: "Run the pre-commit gate before any commit: verify docs match the implementation, align README, keep the directory clean, and write a clear commit message. Use whenever the user is about to commit or asks to check anything about the commit — e.g. verifying docs/README are in sync, cleaning up temp files, scanning for secrets/keys/.env in the change, or having you write the commit message. Not for general PR/code review (that's code-review), and not for explaining git/commit conventions (that's a teach task)."
4
+ ---
5
+
6
+ # Commit Check
7
+
8
+ 提交前的**门禁检查**:审查文档 → 对齐 README → 保持目录卫生 → 规范 commit message,四项全过才允许 commit。本技能是轻量检查清单,不重写 code-review 的审查语义([code-review](.agents/skills/code-review/SKILL.md) 是唯一事实源),也不替代任何完整实现流程——它是任何 commit 前的通用门禁,无论改动来自哪个流程。
9
+
10
+ ## 四项检查(全部通过才 commit)
11
+
12
+ ### ① 审查文档
13
+
14
+ - 本次改动涉及的行为/接口/配置/命令是否有对应文档(README、`docs/`、技能正文)描述
15
+ - 文档描述与实现一致:无过期信息、无声称未实现的功能、无遗留的旧接口描述
16
+ - 涉及技能/模板/配置改动时,检查正文引用的路径与实际一致(如相对路径、目录结构)
17
+ - 发现不一致 → 先修文档(或更新实现),再进入下一步
18
+
19
+ ### ② 对齐 README
20
+
21
+ - 改动涉及项目结构、分发文件、技能/命令清单时,检查 README 中对应的结构说明、映射表、清单是否同步
22
+ - 改动涉及用法/CLI/配置/示例时,检查 README 对应描述与实际一致
23
+ - 存在模板镜像/分发副本时,确认源文件与副本同步(如有守护测试,跑一遍确认)
24
+
25
+ ### ③ 保持目录卫生
26
+
27
+ - `git status` 确认工作区只含预期改动:无残留未跟踪文件、无临时产物(调试脚本、日志、备份文件、`[DEBUG-...]` 残留)
28
+ - 清理本次改动产生的临时文件(一次性脚本、转储、探针)——删除或移入明确的非提交位置
29
+ - 确认没有敏感信息进入改动(密钥、token、`.env`、私钥)——跑 `scripts/scan-sensitive.sh`,不用手写扫描
30
+ - 提交后工作区应为干净状态(`git status` 无输出)
31
+
32
+ ### ④ 规范 commit message
33
+
34
+ - 格式遵循仓库约定(常见:`<type>(<scope>): <subject>`,type 用 feat/fix/docs/chore/refactor/test)
35
+ - subject 描述变更内容而非过程(不说"我做了什么",说"改成了什么")
36
+ - 需要时补充 body:动机、影响范围、验收证据(测试结果、同步确认)
37
+ - 一次 commit 只含一个逻辑变更;多主题拆多个 commit
38
+
39
+ ## 不做什么
40
+
41
+ - 不做全量 code review:审查语义以 [code-review](.agents/skills/code-review/SKILL.md) 为唯一事实源,本技能不重写
42
+ - 不替代实现流程的收尾:`tdd-implement` 阶段⑦已含文档对齐与目录卫生,本技能只管独立 commit 的门禁
43
+ - 不顺手重构:只检查与本次改动直接相关的内容,不扩权到无关文档/目录
44
+ - 不发明扫描规则:敏感信息检测跑 `scripts/scan-sensitive.sh`,不每次重写 grep 模式
45
+
46
+ ## 执行顺序(回合内串行)
47
+
48
+ 1. 跑 ① 审查文档 → ② 对齐 README → ③ 保持目录卫生 → ④ 写 commit message
49
+ 2. 任一项发现问题:修复后重跑该项,全部通过才 commit
50
+ 3. commit 后确认 `git status` 干净,工作结束
51
+
52
+ **回合连续性**:四项检查在一个回合内串行完成,不等用户"继续";发现问题立即修复并重查,直到四项全过或遇到外部阻塞(权限/授权缺失)。
53
+
54
+ ## 出口条件
55
+
56
+ - [ ] 文档审查通过(无过期/不一致描述)
57
+ - [ ] README 对齐(涉及结构/分发改动时已同步)
58
+ - [ ] 目录卫生(`git status` 干净,无临时产物/敏感信息)
59
+ - [ ] commit message 规范(遵循仓库格式)
60
+ - 四项全过 → commit
61
+
62
+ ## 引用
63
+
64
+ - 代码审查语义:[code-review](.agents/skills/code-review/SKILL.md)(唯一事实源,本技能不重写)
65
+ - 完整实现流程:[tdd-implement](.agents/skills/tdd-implement/SKILL.md)(含流程内收尾的文档对齐与目录卫生)
@@ -0,0 +1,5 @@
1
+ interface:
2
+ display_name: "Commit Check"
3
+ short_description: "提交前门禁:审查文档、对齐 README、保持目录卫生、规范 commit message"
4
+ policy:
5
+ allow_implicit_invocation: false
@@ -0,0 +1,36 @@
1
+ #!/usr/bin/env bash
2
+ # Deterministic secret scan for commit-check check ③.
3
+ # The grep patterns are fragile to freehand — run this instead of re-writing
4
+ # the scan every time. Two confidence tiers:
5
+ # FAIL — structured secrets (KEY=value assignments, private key blocks)
6
+ # WARN — bare keywords (may legitimately appear in docs that mention them)
7
+ # Checks the staged diff (fail) and, unless --staged-only is passed, reports
8
+ # matches in the unstaged diff (warn).
9
+ #
10
+ # Usage:
11
+ # scripts/scan-sensitive.sh # staged (fail) + unstaged (warn)
12
+ # scripts/scan-sensitive.sh --staged-only
13
+ set -euo pipefail
14
+
15
+ fail_patterns='(api[_-]?key|secret|token|passwd|password)[[:space:]]*[=:][[:space:]]*[^[:space:]]{8,}|BEGIN (RSA|OPENSSH|EC|DSA) PRIVATE KEY'
16
+ warn_patterns='(api[_-]?key|secret|token|passwd|password|\.env)'
17
+
18
+ fail=0
19
+
20
+ if git diff --cached -U0 | grep -inE "$fail_patterns"; then
21
+ echo "❌ Structured secrets found in STAGED diff — remove them before committing." >&2
22
+ fail=1
23
+ else
24
+ echo "✅ No structured secrets in staged diff."
25
+ if git diff --cached -U0 | grep -inE "$warn_patterns"; then
26
+ echo "⚠ Keyword matches in STAGED diff — eyeball whether they are real secrets." >&2
27
+ fi
28
+ fi
29
+
30
+ if [[ "${1:-}" != "--staged-only" ]]; then
31
+ if git diff -U0 | grep -inE "$fail_patterns"; then
32
+ echo "⚠ Structured-secret matches in UNSTAGED diff — decide whether they belong in the commit." >&2
33
+ fi
34
+ fi
35
+
36
+ exit "$fail"
@@ -0,0 +1,66 @@
1
+ ---
2
+ name: diagnose-fix
3
+ description: "Complete diagnosis→fix→regression channel for bugs: diagnose, then fix via a TDD red-green loop with a hard gate (no fix code before a failing regression test). Use when the user says diagnose/debug/fix this, or reports something broken/throwing/failing/slow — prefer this over diagnosing-bugs when a fix is wanted, not just a diagnosis."
4
+ ---
5
+
6
+ # Diagnose Fix
7
+
8
+ 诊断 **bug** 并修复的编排技能:诊断语义以 [diagnosing-bugs](.agents/skills/diagnosing-bugs/SKILL.md) 为唯一事实源,修复语义以 [tdd 技能](.agents/skills/tdd/SKILL.md) 为唯一事实源;本技能只编排三个阶段并设一道**硬门槛**,不重写两个上游技能的规则。
9
+
10
+ 本技能是**长程任务**(Long-Horizon Skill):诊断 → 修复 → 回归在**一个回合内串行完成**,自带**回合连续性**(Turn Continuity)规则(见下文)。术语定义见 `CONTEXT.md`,技能设计规则见 `docs/agents/skill-design.md`。
11
+
12
+ ## 流程速览
13
+
14
+ ```
15
+ ① 诊断 → ② TDD 修复(硬门槛)→ ③ 回归验证
16
+ ```
17
+
18
+ ## ① 诊断
19
+
20
+ 按 [diagnosing-bugs](.agents/skills/diagnosing-bugs/SKILL.md) 的 Phase 1-4 执行:
21
+
22
+ 1. **反馈回路**(Phase 1):构建能对 _这个 bug_ 变红的紧致 pass/fail 信号——优先失败测试,其次 curl/CLI/浏览器脚本/重放/一次性 harness 等;没有回路不进入假设。
23
+ 2. **复现 + 最小化**(Phase 2):跑回路看它红,确认失败模式与用户描述一致;逐步删减输入/调用方/配置,只保留 load-bearing 元素。
24
+ 3. **假设**(Phase 3):生成 3-5 个可证伪的排名假设,先展示给用户。
25
+ 4. **探针**(Phase 4):一次只改一个变量,临时探针用 `[DEBUG-...]` 前缀标记。
26
+
27
+ **出口条件**:反馈回路已红(已实际跑过并确认捕捉到该 bug)、复现已最小化。诊断完成前不写任何修复代码。
28
+
29
+ ## ② TDD 修复(硬门槛)
30
+
31
+ **TDD 语义(红-绿循环、seam 定义、好测试标准、anti-patterns)以 [tdd 技能](.agents/skills/tdd/SKILL.md) 为唯一事实源**——本技能不重写;进入本阶段前先读取 tdd 技能。
32
+
33
+ **硬门槛**:写任何修复代码之前,必须已存在一个**失败**的回归测试——把最小复现转写为正确 seam 上的测试,先运行看它红,然后才允许写修复代码让它变绿。
34
+
35
+ - **无逃生舱**:不存在正确 seam 时,**本身即 finding**——向用户明确说明"架构阻止锁定该 bug",请求 seam 决策或记录为架构改进建议(可转交 `/improve-codebase-architecture`);**不得**绕过测试直接改代码。
36
+ - **轻量声明**:本技能不套用 tdd-implement 的重流程——不做逐 todo 的循环编排、不设 seams 确认步骤、无 typecheck/commit 前置门禁;单 seam 修复场景直走红-绿。
37
+
38
+ **出口条件**:回归测试先红 → 写最小修复 → 回归测试变绿。
39
+
40
+ ## ③ 回归验证
41
+
42
+ 1. 重跑诊断阶段①的**原始反馈回路**(未最小化场景)确认症状消失。
43
+ 2. 清理:删除所有 `[DEBUG-...]` 标记的临时探针与一次性 harness(`grep` 前缀确认无残留)。
44
+ 3. 在 commit / PR 消息中写明**验证正确的假设**(诊断阶段哪个假设被证实),让下一个调试者受益。
45
+
46
+ **出口条件**:原始症状消失 + 回归测试绿 + 临时探针清理完成。
47
+
48
+ ## 反模式(不做什么)
49
+
50
+ 完整反模式清单见 [references/anti-patterns.md](references/anti-patterns.md)——正文各阶段规则是正面约束,反模式清单是负向边界;细节只在一处存在,本文件不重复。
51
+
52
+ ## 回合连续性规则
53
+
54
+ 诊断 → 修复 → 回归**在一个回合内串行完成**,不等用户"继续":构建回路 → 复现 → 假设 → 探针 → 失败测试 → 修复 → 回归 → 清理整条链一气呵成,中途不停顿。
55
+
56
+ 输出只允许发生在以下三种情况:
57
+ - **合规交互点**:技能要求的用户确认——阶段①假设清单展示、阶段②无 seam finding 上报或 seam 决策请求
58
+ - **外部阻塞**:权限拒绝、缺失授权、依赖不可用——明确说明所需授权或替代路径,不静默停止
59
+ - **阶段出口**:整个阶段的出口条件满足(阶段①回路已红 + 复现最小化;阶段②失败测试已红 → 修复变绿;阶段③症状消失 + 回归绿 + 清理完成)
60
+
61
+ 预告下一步后立即执行该步骤,回合终点仅为合规交互点、外部阻塞或阶段出口条件满足。进度输出本身不结束回合——输出后继续执行,直到三类终点之一达成。
62
+
63
+ ## 引用
64
+
65
+ - 诊断:[diagnosing-bugs](.agents/skills/diagnosing-bugs/SKILL.md)
66
+ - TDD 修复:[tdd 技能](.agents/skills/tdd/SKILL.md)、[tdd/tests.md](.agents/skills/tdd/tests.md)、[tdd/mocking.md](.agents/skills/tdd/mocking.md)
@@ -0,0 +1,5 @@
1
+ interface:
2
+ display_name: "Diagnose Fix"
3
+ short_description: "诊断硬 bug 并按 TDD 红-绿修复"
4
+ policy:
5
+ allow_implicit_invocation: false
@@ -0,0 +1,20 @@
1
+ # 反模式清单(Diagnose-Fix)
2
+
3
+ SKILL.md 正文各阶段规则是正面约束;本文件是负向边界(不做什么),为细节唯一出处。SKILL.md 只引用本文件,不重复内容。
4
+
5
+ ## 诊断阶段
6
+
7
+ - 不跳过反馈回路直接猜根因:回路未红之前不进入假设、不写修复代码
8
+ - 不把最小复现留在 harness 里:必须转写为正确 seam 上的回归测试,harness 只作诊断工具
9
+ - 不一次改多个变量:探针一次只改一个,`[DEBUG-...]` 前缀标记
10
+
11
+ ## 修复阶段
12
+
13
+ - 不绕过测试直接改代码(见 SKILL.md ②无逃生舱)——没有 seam 是 finding,不是豁免
14
+ - 不套用 tdd-implement 重流程:见 SKILL.md ②轻量声明——单 seam 修复直走红-绿,不引入重流程编排
15
+ - 不重写 tdd 技能的红-绿语义:seam 定义、好测试标准、mocking 边界一律查上游技能
16
+
17
+ ## 回归阶段
18
+
19
+ - 不遗留探针:`[DEBUG-...]` 前缀的临时改动在回归验证后全部清理
20
+ - 不跳过原始反馈回路的重跑:最小化场景绿 ≠ 原始症状消失
@@ -0,0 +1,83 @@
1
+ ---
2
+ name: grill-to-spec
3
+ description: "Router:编排 grill-with-docs → to-spec,把模糊想法打磨成可执行 Spec。Use when the user asks to grill/design/polish an idea into a spec——只产出领域文档与 spec,不写代码。"
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ # Grill to Spec
8
+
9
+ **grill-with-docs**(grilling + domain-modeling)与 **to-spec** 的编排器。本 skill 只做编排:把设计压力测试成共识,把共识综合成 spec 发布——不写代码,不动源码。
10
+
11
+ ## 职责
12
+
13
+ | 做 | 不做 |
14
+ |----|------|
15
+ | 编排 `grill-with-docs` → `to-spec` 完整通道 | 不编写代码、不修改任何源码(含测试) |
16
+ | 引导用户从模糊想法 → 结构化 spec | 不拆 tickets(`/to-tickets` 职责) |
17
+ | grilling 逐问挑战、打磨设计 | 不调用 `/code-review` |
18
+ | 同步产出领域文档(glossary inline;ADR 草稿经用户确认后落盘) | 阶段②仅综合,不新增采访 |
19
+ | 综合对话为可执行的 spec 文档并发布 | 不维护已发布的 spec |
20
+ | 产出物仅限领域文档与 spec | 实现与修复交给实现类 skill(如 `/tdd-implement`) |
21
+
22
+ ## 流程
23
+
24
+ ```text
25
+ ① Grill with docs → ② Synthesize to spec
26
+ ```
27
+
28
+ ① 加载 `/grill-with-docs`:grilling 采访(一次一问、等反馈;决策逐条交由用户定夺)+ domain-modeling 产出 glossary/ADR。出口:用户确认共识达成。
29
+
30
+ ① 内 ADR 子流转(与 glossary 的 inline 更新严格区分):
31
+ 1. 触发:仅当 domain-modeling 三条件全满足(难逆转 / 无上下文费解 / 真实权衡)才提议 ADR
32
+ 2. 草稿:按 ADR-FORMAT 把完整标题+正文展示给用户审阅,等待反馈
33
+ 3. 确认:用户显式说「确认/写入」才落盘;用户拒绝则不写、继续访谈;用户要求修改则改草稿重新确认
34
+ 4. 未确认前不得创建或写入 `docs/adr/` 下的任何文件
35
+
36
+ ② 加载 `/to-spec`:探索代码(glossary 词汇贯穿 spec、尊重相关 ADR)→ 确认 seams(既有优先、最高 seam、理想一个)→ 编写 spec 草稿 → 展示给用户确认(只展示等决定,不新增采访提问)→ 发布到 `.scratch/<feature-slug>/spec.md` 并标 `ready-for-agent`。出口:spec 已发布。
37
+
38
+ ## 产出物(格式严格对齐下游技能)
39
+
40
+ 本技能产出物仅以下三种,格式以各技能文件为唯一事实源,不在本技能重写:
41
+
42
+ | 产出物 | 位置 | 格式来源 |
43
+ |--------|------|----------|
44
+ | Glossary | `CONTEXT.md`(多上下文:`CONTEXT-MAP.md` + 各上下文 `CONTEXT.md`) | [CONTEXT-FORMAT.md](.agents/skills/domain-modeling/CONTEXT-FORMAT.md) |
45
+ | ADR | `docs/adr/NNNN-slug.md`(多上下文:系统级在根,上下文级在 `src/<ctx>/docs/adr/`) | [ADR-FORMAT.md](.agents/skills/domain-modeling/ADR-FORMAT.md) |
46
+ | Spec | 发布到 issue tracker:`.scratch/<feature-slug>/spec.md` | [to-spec 七节模板](.agents/skills/to-spec/SKILL.md) |
47
+
48
+ 三类产出物的格式细则(Glossary 守则 / ADR 守则 / Spec 守则)见 [references/rules.md](references/rules.md)——SKILL.md 不重复细节。
49
+
50
+ ## 不可协商规则(无任何例外)
51
+
52
+ - **写入 ADR 必须由用户显式确认,无论任何情况、无任何例外**:三条件全满足、决策看似显然、② 补记,均不豁免。ADR 一旦落盘记录不可撤销(可 supersede,但痕迹永存),全部门槛都在写入之前
53
+ - **ADR 与 glossary 不对称**:`CONTEXT.md` 术语可随访谈 inline 更新(domain-modeling 规则),ADR 必须先审草稿、用户确认后才落盘——禁止把 inline 逻辑套用到 ADR
54
+
55
+ ## 回退
56
+
57
+ | 触发点 | 条件 | 动作 |
58
+ |--------|------|------|
59
+ | ② seam 确认 | 用户不同意 seams | → ① 补充 |
60
+ | ② 综合时 | 关键信息缺失 | → ① 补采 |
61
+ | ② 发布后 | spec 有问题 | → ① 重新循环 |
62
+
63
+ ## 异常终止
64
+
65
+ | 情况 | 处理 |
66
+ |------|------|
67
+ | 用户中途放弃 / 无主题 | 终止 |
68
+ | tracker 未配置 | 提示 `/setup-matt-pocock-skills`,终止 |
69
+ | ① 超过 5 轮无进展 | 建议暂停或缩小范围 |
70
+
71
+ ## 约束
72
+
73
+ - ① 出口达成后方可进入 ②
74
+ - 全程不写代码、不动源码:唯一允许写入的文件是领域文档(`CONTEXT.md`/ADR)与 spec
75
+ - ② 探索代码只为确认 seams 与术语——只读不改
76
+ - 产出物格式细则(Glossary/ADR/Spec 守则)与反模式见 [references/rules.md](references/rules.md),不在本文件重写
77
+
78
+ ## 引用
79
+
80
+ - [grill-with-docs](.agents/skills/grill-with-docs/SKILL.md)
81
+ - [grilling](.agents/skills/grilling/SKILL.md)
82
+ - [domain-modeling](.agents/skills/domain-modeling/SKILL.md)
83
+ - [to-spec](.agents/skills/to-spec/SKILL.md)
@@ -0,0 +1,5 @@
1
+ interface:
2
+ display_name: "Grill to Spec"
3
+ short_description: "从模糊想法到可执行 Spec — 只打磨设计、产出领域文档与 Spec,不写代码"
4
+ policy:
5
+ allow_implicit_invocation: false
@@ -0,0 +1,33 @@
1
+ # 守则:Grill-to-Spec 产出物格式细则
2
+
3
+ 三类产出物(Glossary / ADR / Spec)格式的**唯一细节出处**,由 SKILL.md 直链引用。SKILL.md 只保留流程、导航与不可协商规则,本文件不重复流程内容。
4
+
5
+ ## Glossary 守则
6
+
7
+ - 懒创建:首个术语解析时才建 `CONTEXT.md`;多上下文时先确认归属,归属不清则询问
8
+ - 只是 glossary:零实现细节,不当 spec/scratch pad
9
+ - 只收本上下文特有术语,通用编程概念不收
10
+ - 定义 WHAT 非 HOW,1-2 句;opinionated,同义词列 `_Avoid_`;术语解析即 inline 更新,不批量
11
+
12
+ ## ADR 守则
13
+
14
+ - 三条件全满足才提议(难逆转 / 无上下文费解 / 真实权衡);`docs/adr/` 懒创建
15
+ - 格式:标题 + 1-3 句正文;可选节(Status/Considered Options/Consequences)按需,大多数不需要
16
+ - 编号:`0001-slug.md` 顺序递增,扫描最高号 +1
17
+ - 草稿经用户显式确认后落盘,任何情况无例外(见 SKILL.md 流程① 与不可协商规则)
18
+
19
+ ## Spec 守则
20
+
21
+ - 完整七节模板逐节不缺:Problem Statement / Solution / User Stories / Implementation Decisions / Testing Decisions / Out of Scope / Further Notes
22
+ - User Stories:长编号列表,`As an <actor>, I want a <feature>, so that <benefit>` 格式
23
+ - Implementation Decisions:不含文件路径/代码片段;例外——原型产出的决策密集片段可 inline,注明来源并裁剪至决策部分
24
+ - 全文贯穿 glossary 词汇;尊重所触区域既有 ADR
25
+ - seams:既有优先于新建、取最高、理想数量 1,与用户确认
26
+ - 发布后标 `ready-for-agent`,triage 状态以 issue 文件顶部 `Status:` 行记录
27
+
28
+ ## 反模式(不做什么)
29
+
30
+ - 不把守则当逐条朗读的检查清单——守则约束产出物格式,不约束对话节奏
31
+ - 不把 ADR 当 glossary 一样 inline 更新(见 SKILL.md 不可协商规则)
32
+ - 不产出守则之外的文件:产出物只有三种(Glossary / ADR / Spec)
33
+ - 不在本文件之外重复守则细节——SKILL.md 与 references 之间信息只在一处存在