@boyingliu01/xp-gate 0.19.2 → 0.20.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 (223) hide show
  1. package/adapters/gate-4.sh +83 -18
  2. package/adapters/gate-8.sh +49 -5
  3. package/adapters/iac.sh +1 -1
  4. package/adapters/typescript.sh +15 -60
  5. package/bin/xp-gate.js +15 -16
  6. package/gate-10.sh +35 -2
  7. package/gate-4.sh +110 -21
  8. package/gate-8.sh +49 -5
  9. package/hooks/gate-10.sh +35 -2
  10. package/hooks/gate-4.sh +110 -21
  11. package/hooks/gate-8.sh +49 -5
  12. package/hooks/lib/jscpd-run.sh +63 -0
  13. package/hooks/lib/sprint-gate-report.sh +58 -0
  14. package/hooks/lib/test-failure.sh +152 -0
  15. package/hooks/lib/typecheck.sh +141 -0
  16. package/hooks/lib/validate-code-walkthrough.cjs +43 -5
  17. package/hooks/post-merge +100 -0
  18. package/hooks/pre-commit +401 -155
  19. package/hooks/pre-push +75 -19
  20. package/lib/__tests__/bootstrap.test.js +23 -41
  21. package/lib/__tests__/check-version.test.js +8 -1
  22. package/lib/__tests__/detect-deps.test.js +16 -0
  23. package/lib/__tests__/doctor-drift-round2.test.js +212 -0
  24. package/lib/__tests__/doctor-executed-surface.test.js +209 -0
  25. package/lib/__tests__/doctor-hook-drift.test.js +329 -0
  26. package/lib/__tests__/doctor-machine-mutation.test.js +116 -0
  27. package/lib/__tests__/doctor-module-drift.test.js +206 -0
  28. package/lib/__tests__/doctor-module-resolution-parity.test.js +314 -0
  29. package/lib/__tests__/doctor-path-equivalence.test.js +59 -0
  30. package/lib/__tests__/doctor-repair-boundary.test.js +52 -0
  31. package/lib/__tests__/doctor-tui-skill-freshness.test.js +105 -0
  32. package/lib/__tests__/doctor.test.js +155 -0
  33. package/lib/__tests__/gate-runner.test.js +19 -3
  34. package/lib/__tests__/helpers/lib-sandbox.cjs +55 -0
  35. package/lib/__tests__/init.test.js +44 -17
  36. package/lib/__tests__/install-skill-full-dir.test.js +151 -0
  37. package/lib/__tests__/install-skill.test.js +51 -132
  38. package/lib/__tests__/language-tools-detect.test.js +158 -0
  39. package/lib/__tests__/phase-transition.test.js +15 -1
  40. package/lib/__tests__/qoder-delphi-agents.test.js +285 -0
  41. package/lib/__tests__/shared-paths.test.js +20 -0
  42. package/lib/__tests__/shared-utils.test.js +69 -0
  43. package/lib/__tests__/skill-flags.test.js +48 -0
  44. package/lib/__tests__/ui-detector.test.ts +6 -2
  45. package/lib/__tests__/uninstall.test.js +20 -0
  46. package/lib/__tests__/update-hooks.test.js +12 -0
  47. package/lib/__tests__/update-skill.test.js +7 -4
  48. package/lib/detect-deps.js +3 -20
  49. package/lib/doctor-tui.js +22 -5
  50. package/lib/doctor.js +1178 -31
  51. package/lib/init.js +184 -33
  52. package/lib/install-cmd.js +7 -4
  53. package/lib/install-skill.js +38 -95
  54. package/lib/language-tools.js +83 -4
  55. package/lib/mattpocock-license-verdict.json +1 -1
  56. package/lib/shared-paths.js +5 -2
  57. package/lib/shared-utils.js +47 -3
  58. package/lib/uninstall.js +12 -0
  59. package/lib/update-hooks.js +4 -4
  60. package/lib/update-skill.js +6 -7
  61. package/mock-policy/AGENTS.md +4 -4
  62. package/mutation/AGENTS.md +4 -4
  63. package/mutation/__tests__/gate-m.test.ts +66 -14
  64. package/mutation/__tests__/mutmut-runner.test.ts +91 -42
  65. package/mutation/__tests__/test-filter-parity.test.ts +37 -0
  66. package/mutation/gate-m.ts +21 -8
  67. package/package.json +1 -1
  68. package/plugins/claude-code/.claude-plugin/plugin.json +2 -2
  69. package/plugins/claude-code/skills/clipboard-vision/__tests__/clipboard-vision-distribution.test.cjs +0 -1
  70. package/plugins/claude-code/skills/delphi-review/AGENTS.md +4 -4
  71. package/plugins/claude-code/skills/delphi-review/SKILL.md +98 -14
  72. package/plugins/claude-code/skills/delphi-review/references/code-walkthrough.md +36 -3
  73. package/plugins/claude-code/skills/delphi-review/references/requirements.md +6 -6
  74. package/plugins/claude-code/skills/sprint-flow/AGENTS.md +4 -4
  75. package/plugins/claude-code/skills/sprint-flow/references/phase-2-design.md +3 -3
  76. package/plugins/claude-code/skills/test-specification-alignment/AGENTS.md +4 -4
  77. package/plugins/dsh/README.md +169 -4
  78. package/plugins/dsh/dsh-overlay.patch.yml +67 -0
  79. package/plugins/dsh/package.json +1 -1
  80. package/plugins/dsh/scripts/prepack.cjs +24 -19
  81. package/plugins/dsh/setup-dsh.ps1 +160 -0
  82. package/plugins/dsh/skills/clipboard-vision/__tests__/clipboard-vision-distribution.test.cjs +0 -1
  83. package/plugins/dsh/skills/delphi-review/AGENTS.md +4 -4
  84. package/plugins/dsh/skills/delphi-review/SKILL.md +98 -14
  85. package/plugins/dsh/skills/delphi-review/references/code-walkthrough.md +36 -3
  86. package/plugins/dsh/skills/delphi-review/references/requirements.md +6 -6
  87. package/plugins/dsh/skills/sprint-flow/AGENTS.md +4 -4
  88. package/plugins/dsh/skills/sprint-flow/references/phase-2-design.md +3 -3
  89. package/plugins/dsh/skills/test-specification-alignment/AGENTS.md +4 -4
  90. package/plugins/dsh/src/command.test.ts +66 -2
  91. package/plugins/dsh/src/command.ts +36 -14
  92. package/plugins/dsh/src/contract.test.ts +31 -1
  93. package/plugins/dsh/src/delphi-config.test.ts +190 -0
  94. package/plugins/dsh/src/delphi-config.ts +223 -0
  95. package/plugins/dsh/src/delphi-run.test.ts +181 -0
  96. package/plugins/dsh/src/delphi-run.ts +129 -0
  97. package/plugins/dsh/src/delphi.test.ts +222 -0
  98. package/plugins/dsh/src/delphi.ts +247 -0
  99. package/plugins/dsh/src/dialect.test.ts +59 -0
  100. package/plugins/dsh/src/dialect.ts +40 -0
  101. package/plugins/dsh/src/index.ts +70 -4
  102. package/plugins/dsh/src/skills.test.ts +26 -19
  103. package/plugins/opencode/package.json +1 -1
  104. package/plugins/opencode/skills/clipboard-vision/__tests__/clipboard-vision-distribution.test.cjs +0 -1
  105. package/plugins/opencode/skills/delphi-review/AGENTS.md +4 -4
  106. package/plugins/opencode/skills/delphi-review/SKILL.md +98 -14
  107. package/plugins/opencode/skills/delphi-review/references/code-walkthrough.md +36 -3
  108. package/plugins/opencode/skills/delphi-review/references/requirements.md +6 -6
  109. package/plugins/opencode/skills/sprint-flow/AGENTS.md +4 -4
  110. package/plugins/opencode/skills/sprint-flow/references/phase-2-design.md +3 -3
  111. package/plugins/opencode/skills/test-specification-alignment/AGENTS.md +4 -4
  112. package/plugins/qoder/agents/delphi-architecture.md +1 -1
  113. package/plugins/qoder/agents/delphi-feasibility.md +1 -1
  114. package/plugins/qoder/agents/delphi-technical.md +1 -1
  115. package/plugins/qoder/plugin.json +2 -2
  116. package/plugins/qoder/skills/admin-template-guidelines/SKILL.md +6 -797
  117. package/plugins/qoder/skills/admin-template-guidelines/references/rule-1.md +91 -0
  118. package/plugins/qoder/skills/admin-template-guidelines/references/rule-2.md +155 -0
  119. package/plugins/qoder/skills/admin-template-guidelines/references/rule-3.md +70 -0
  120. package/plugins/qoder/skills/admin-template-guidelines/references/rule-4.md +154 -0
  121. package/plugins/qoder/skills/admin-template-guidelines/references/rule-5.md +126 -0
  122. package/plugins/qoder/skills/admin-template-guidelines/references/rule-6.md +180 -0
  123. package/plugins/qoder/skills/batch-grill-me/SKILL.md +15 -0
  124. package/plugins/qoder/skills/clipboard-vision/__tests__/clipboard-vision-distribution.test.cjs +0 -1
  125. package/plugins/qoder/skills/clipboard-vision/describe-clipboard.ps1 +115 -0
  126. package/plugins/qoder/skills/clipboard-vision/describe-clipboard.sh +161 -0
  127. package/plugins/qoder/skills/delphi-review/.delphi-config.json.example +61 -28
  128. package/plugins/qoder/skills/delphi-review/AGENTS.md +4 -4
  129. package/plugins/qoder/skills/delphi-review/INSTALL.md +97 -98
  130. package/plugins/qoder/skills/delphi-review/SKILL.md +170 -63
  131. package/plugins/qoder/skills/delphi-review/hooks.md +19 -0
  132. package/plugins/qoder/skills/delphi-review/opencode.json.delphi.example +6 -10
  133. package/plugins/qoder/skills/delphi-review/references/code-walkthrough.md +36 -3
  134. package/plugins/qoder/skills/delphi-review/references/orchestrator-dispatch.md +64 -0
  135. package/plugins/qoder/skills/delphi-review/references/requirements.md +402 -0
  136. package/plugins/qoder/skills/delphi-review/references/round-templates.md +134 -0
  137. package/plugins/qoder/skills/delphi-review/scripts/verify-consensus.sh +43 -0
  138. package/plugins/qoder/skills/delphi-review/tools.md +29 -0
  139. package/plugins/qoder/skills/domain-modeling/ADR-FORMAT.md +64 -0
  140. package/plugins/qoder/skills/domain-modeling/CONTEXT-FORMAT.md +60 -0
  141. package/plugins/qoder/skills/domain-modeling/SKILL.md +74 -0
  142. package/plugins/qoder/skills/grill-with-docs/SKILL.md +7 -0
  143. package/plugins/qoder/skills/grilling/SKILL.md +12 -0
  144. package/plugins/qoder/skills/ralph-loop/SKILL.md +87 -428
  145. package/plugins/qoder/skills/ralph-loop/references/components.md +113 -0
  146. package/plugins/qoder/skills/ralph-loop/references/workflow-details.md +99 -0
  147. package/plugins/qoder/skills/sprint-flow/AGENTS.md +5 -5
  148. package/plugins/qoder/skills/sprint-flow/SKILL.md +255 -454
  149. package/plugins/qoder/skills/sprint-flow/__tests__/sprint-flow.test.cjs +457 -0
  150. package/plugins/qoder/skills/sprint-flow/hooks.md +18 -0
  151. package/plugins/qoder/skills/sprint-flow/references/components/memory.md +1 -1
  152. package/plugins/qoder/skills/sprint-flow/references/components/middleware.md +1 -1
  153. package/plugins/qoder/skills/sprint-flow/references/components/skill-invocations.md +21 -20
  154. package/plugins/qoder/skills/sprint-flow/references/components/tool-descriptions.md +22 -23
  155. package/plugins/qoder/skills/sprint-flow/references/force-levels.md +0 -1
  156. package/plugins/qoder/skills/sprint-flow/references/orchestration-rules.md +34 -27
  157. package/plugins/qoder/skills/sprint-flow/references/phase-1-prep.md +1 -1
  158. package/plugins/qoder/skills/sprint-flow/references/phase-2-design.md +160 -123
  159. package/plugins/qoder/skills/sprint-flow/references/phase-3-build.md +203 -2
  160. package/plugins/qoder/skills/sprint-flow/references/phase-4-verify.md +107 -34
  161. package/plugins/qoder/skills/sprint-flow/references/phase-5-ship.md +194 -12
  162. package/plugins/qoder/skills/sprint-flow/references/phase-6-close.md +139 -7
  163. package/plugins/qoder/skills/sprint-flow/references/phase-overview.md +486 -0
  164. package/plugins/qoder/skills/sprint-flow/scripts/verify-sprint-state.sh +38 -0
  165. package/plugins/qoder/skills/sprint-flow/tools.md +29 -0
  166. package/plugins/qoder/skills/test-specification-alignment/AGENTS.md +4 -4
  167. package/plugins/qoder/skills/test-specification-alignment/SKILL.md +104 -601
  168. package/plugins/qoder/skills/to-issues/SKILL.md +1 -1
  169. package/principles/AGENTS.md +9 -8
  170. package/principles/__tests__/adapter-metrics.test.ts +292 -0
  171. package/principles/__tests__/analyzer.test.ts +29 -6
  172. package/principles/__tests__/baseline-prune-timeout.test.ts +71 -0
  173. package/principles/__tests__/baseline-prune.test.ts +338 -0
  174. package/principles/__tests__/boy-scout-init-baseline.test.ts +167 -0
  175. package/principles/__tests__/boy-scout-integration.test.ts +97 -6
  176. package/principles/__tests__/boy-scout.test.ts +253 -7
  177. package/principles/__tests__/config-enforcement.test.ts +469 -0
  178. package/principles/__tests__/config-git-timeout.test.ts +66 -0
  179. package/principles/__tests__/direct-execution.test.ts +187 -0
  180. package/principles/__tests__/index.test.ts +16 -3
  181. package/principles/__tests__/warnings-baseline-budgets.test.ts +74 -0
  182. package/principles/adapters/typescript.ts +613 -13
  183. package/principles/analyzer.ts +22 -0
  184. package/principles/baseline-prune.ts +217 -0
  185. package/principles/boy-scout.ts +481 -51
  186. package/principles/config.ts +362 -54
  187. package/principles/direct-execution.ts +60 -0
  188. package/principles/index.ts +40 -17
  189. package/principles/rules/__tests__/clean-code/many-exports.test.ts +16 -10
  190. package/principles/rules/clean-code/code-duplication.ts +8 -8
  191. package/principles/rules/clean-code/deep-nesting.ts +8 -8
  192. package/principles/rules/clean-code/god-class.ts +8 -8
  193. package/principles/rules/clean-code/large-file.ts +15 -11
  194. package/principles/rules/clean-code/long-function.ts +8 -8
  195. package/principles/rules/clean-code/magic-numbers.ts +10 -7
  196. package/principles/rules/clean-code/many-exports.ts +7 -7
  197. package/principles/rules/clean-code/missing-error-handling.ts +5 -5
  198. package/principles/rules/clean-code/too-many-params.ts +8 -8
  199. package/principles/rules/clean-code/unused-imports.ts +5 -5
  200. package/principles/rules/solid/dip.ts +18 -8
  201. package/principles/rules/solid/isp.ts +9 -8
  202. package/principles/rules/solid/lsp.ts +6 -6
  203. package/principles/rules/solid/ocp.ts +6 -5
  204. package/principles/rules/solid/srp.ts +7 -8
  205. package/principles/types.ts +15 -0
  206. package/scripts/__tests__/sync-package-content.test.js +28 -0
  207. package/scripts/delphi-external-review.cjs +193 -10
  208. package/scripts/sync-package-content.js +7 -4
  209. package/skills/clipboard-vision/__tests__/clipboard-vision-distribution.test.cjs +0 -1
  210. package/skills/delphi-review/AGENTS.md +4 -4
  211. package/skills/delphi-review/SKILL.md +98 -14
  212. package/skills/delphi-review/references/code-walkthrough.md +36 -3
  213. package/skills/delphi-review/references/requirements.md +6 -6
  214. package/skills/sprint-flow/AGENTS.md +4 -4
  215. package/skills/sprint-flow/references/phase-2-design.md +3 -3
  216. package/skills/test-specification-alignment/AGENTS.md +4 -4
  217. package/lib/__tests__/download-skill.test.js +0 -281
  218. package/lib/download-skill.js +0 -96
  219. package/plugins/qoder/skills/ralph-loop/references/components/memory.md +0 -55
  220. package/plugins/qoder/skills/ralph-loop/references/components/middleware.md +0 -54
  221. package/plugins/qoder/skills/ralph-loop/references/components/skill-invocations.md +0 -39
  222. package/plugins/qoder/skills/ralph-loop/references/components/system-prompt.md +0 -24
  223. package/plugins/qoder/skills/ralph-loop/references/components/tool-descriptions.md +0 -32
@@ -0,0 +1,134 @@
1
+ # Delphi Round Templates
2
+
3
+ ## Round 1: 匿名独立评审
4
+
5
+ ### 为什么必须匿名
6
+
7
+ 匿名防止 anchoring bias(锚定偏差)—— 知道其他专家意见后倾向于同意"权威",不敢提出相反观点。
8
+
9
+ ### 执行方式
10
+
11
+ 每位专家独立收到:原始文档 + 评审模板 + "独立评审,不知道其他专家意见"。
12
+
13
+ ### 输出格式
14
+
15
+ ```markdown
16
+ ## 独立评审 - Expert [A/B/C]
17
+ ### 优点
18
+ 1. [具体优点 + 文档位置]
19
+ ### 问题清单
20
+ #### Critical Issues (必须修复才能批准)
21
+ 1. [问题] - 位置: [...] - 修复建议: [...]
22
+ #### Major Concerns (必须处理)
23
+ 1. [...]
24
+ #### Minor Concerns (需要说明)
25
+ 1. [...]
26
+ ### 裁决: [APPROVED / REQUEST_CHANGES / REJECTED]
27
+ ### 置信度: [X/10]
28
+ ### 关键理由
29
+ 1. [...]
30
+ ```
31
+
32
+ ## Round 2: 交换意见
33
+
34
+ ### 执行方式
35
+
36
+ 每位专家看到:原始文档 + 其他专家的评审 + "响应其他专家的关切,是否调整立场?"
37
+
38
+ ### 输出格式
39
+
40
+ ```markdown
41
+ ## Round 2 Response - Expert [A/B/C]
42
+ ### 响应其他专家关切
43
+ **Expert [X] 提到: [问题]**
44
+ - 我的立场: [同意/部分同意/不同意] - 理由: [...]
45
+ ### 更新后问题清单 / 裁决 / 置信度 / 立场变化说明
46
+ ```
47
+
48
+ ## Round 3: 最终立场(如需要)
49
+
50
+ 触发条件:Round 2 后仍无共识。所有专家提交最终绑定立场。必须基于三份成功结果聚合达到 ≥90% 共识,不能以多数票或单个专家结果替代全局批准。
51
+
52
+ ### 输出格式
53
+
54
+ ```markdown
55
+ ## Round 3 Final Position - Expert [A/B/C]
56
+ ### 最终裁决: [APPROVED / REQUEST_CHANGES / REJECTED]
57
+ ### 最终置信度: [X/10]
58
+ ### 关键理由 + 与其他专家的差异
59
+ ```
60
+
61
+ ## 修复报告格式
62
+
63
+ ```markdown
64
+ ## 修复报告
65
+ ### Critical Issues 修复 | ### Major Concerns 处理 | ### Minor Concerns 说明
66
+ ### 请求重新评审
67
+ ```
68
+
69
+ ---
70
+
71
+ ## Requirements Mode: Round 1(匿名独立需求评审)
72
+
73
+ ### 执行方式
74
+
75
+ architecture、technical、feasibility 三位专家分别独立收到:需求陈述 + CONTEXT.md + grill session 摘要 + "独立评审需求完整性,不知道其他专家意见"。三次执行必须全部成功,且每份结果都记录 `result_type=delphi_expert_result` 和实际请求的 `requested_model`;模型 ID、provider、vendor、gateway 和国籍不受限制。
76
+
77
+ ### 输出格式
78
+
79
+ ```markdown
80
+ ## Requirements Review - Expert [A(architecture)/B(technical)/C(feasibility)]
81
+
82
+ ### 需求摘要
83
+ [被评审需求的简短概括]
84
+
85
+ ### 评审焦点
86
+ - 需求完整性: [评估]
87
+ - 需求→AC 映射: [评估]
88
+ - 场景覆盖: [评估]
89
+ - AC 可测试性: [评估]
90
+ - 用户画像清晰度: [评估]
91
+ - 范围边界: [评估]
92
+
93
+ ### 缺口清单 (Gaps)
94
+ #### Critical Gaps (必须解决才能进入设计)
95
+ 1. [缺口描述] - 影响: [...] - 补充建议: [...]
96
+ #### Minor Gaps (建议补充但不阻塞)
97
+ 1. [...]
98
+
99
+ ### 裁决: [APPROVED / GAPS_FOUND]
100
+ ### 置信度: [X/10]
101
+ ### 关键理由
102
+ 1. [...]
103
+ ```
104
+
105
+ ## Requirements Mode: Round 2(带上下文的补充评审,如需要)
106
+
107
+ ### 触发条件
108
+
109
+ 前一轮裁决为 GAPS_FOUND,grill-with-docs 补充访谈后重新评审。最多执行 5 轮。
110
+
111
+ ### 执行方式
112
+
113
+ 三位专家分别收到:更新后的需求陈述 + CONTEXT.md + **前一轮 gaps 列表** + "评估已有缺口是否已修复,是否有新缺口"。每轮仍需三份成功、可验证的独立结果,不得减少专家数。
114
+
115
+ ### 输出格式
116
+
117
+ ```markdown
118
+ ## Requirements Review Round [2-5] - Expert [A(architecture)/B(technical)/C(feasibility)]
119
+
120
+ ### Round 1 缺口修复验证
121
+ | Round 1 Gap | 状态 | 说明 |
122
+ |-------------|------|------|
123
+ | [gap 描述] | ✅ 已修复 / ❌ 仍存在 | [验证说明] |
124
+
125
+ ### 新发现缺口(如有)
126
+ 1. [新缺口描述]
127
+
128
+ ### 裁决: [APPROVED / GAPS_FOUND]
129
+ ### 置信度: [X/10]
130
+ ### 立场变化说明
131
+ [与 Round 1 相比的立场变化]
132
+ ```
133
+
134
+ > ⚠️ Round 5 后仍 GAPS_FOUND → `escalation_needed: true`,升级给用户决策。任何较早轮次都不能以两位专家、多数票或单个结果产生 APPROVED 证据。
@@ -0,0 +1,43 @@
1
+ #!/usr/bin/env bash
2
+ # delphi-review: Verify consensus report integrity
3
+ # Checks that delphi-reviewed.json is valid JSON and contains expected verdict field.
4
+ #
5
+ # Usage: bash verify-consensus.sh [state-dir]
6
+
7
+ set -euo pipefail
8
+
9
+ STATE_DIR="${1:-.sprint-state}"
10
+ STATE_FILE="$STATE_DIR/delphi-reviewed.json"
11
+
12
+ if [ ! -f "$STATE_FILE" ]; then
13
+ echo "SKIP: No delphi-reviewed.json found at $STATE_FILE"
14
+ exit 0
15
+ fi
16
+
17
+ # Validate JSON
18
+ if ! command -v node &>/dev/null; then
19
+ echo "WARN: node not available, skipping JSON validation"
20
+ exit 0
21
+ fi
22
+
23
+ node -e "
24
+ const fs = require('fs');
25
+ try {
26
+ const data = JSON.parse(fs.readFileSync('$STATE_FILE', 'utf8'));
27
+ const requiredKeys = ['mode', 'timestamp', 'verdict', 'consensus_ratio'];
28
+ const missing = requiredKeys.filter(k => !(k in data));
29
+ if (missing.length > 0) {
30
+ console.error('ERROR: Missing required keys in delphi-reviewed.json:', missing.join(', '));
31
+ process.exit(1);
32
+ }
33
+ const validVerdicts = ['APPROVED', 'PASS_WITH_CAVEATS', 'REQUEST_CHANGES', 'BLOCKED'];
34
+ if (!validVerdicts.includes(data.verdict)) {
35
+ console.error('ERROR: Invalid verdict:', data.verdict, '(expected one of:', validVerdicts.join(', '), ')');
36
+ process.exit(1);
37
+ }
38
+ console.log('OK: delphi-reviewed.json is valid with verdict:', data.verdict);
39
+ } catch (e) {
40
+ console.error('ERROR: delphi-reviewed.json is not valid JSON:', e.message);
41
+ process.exit(1);
42
+ }
43
+ "
@@ -0,0 +1,29 @@
1
+ # Tools Whitelist — Delphi Review
2
+
3
+ Delphi Review is a **read-only review skill** that dispatches expert subagents
4
+ and synthesizes their verdicts. It does NOT implement code changes.
5
+
6
+ ## Allowed Tools
7
+
8
+ | Tool | Usage | Rationale |
9
+ |------|-------|-----------|
10
+ | `Read` | Read design docs, code, configs, specification.yaml | Required for review input analysis |
11
+ | `Glob` | Find files by pattern | Required for context discovery |
12
+ | `Grep` | Search code content | Required for codebase understanding |
13
+ | `Bash` | Read-only: git diff, git log, file stats | Required for change analysis |
14
+ | `Task(subagent_type=oracle)` | Dispatch oracle for deep analysis | Required for complex review questions |
15
+ | `Task(subagent_type=delphi-reviewer-architecture)` | Dispatch architecture expert | Core Delphi expert dispatch |
16
+ | `Task(subagent_type=delphi-reviewer-technical)` | Dispatch technical expert | Core Delphi expert dispatch |
17
+ | `Task(subagent_type=delphi-reviewer-feasibility)` | Dispatch feasibility expert | Core Delphi expert dispatch |
18
+ | `Write(specification.yaml, .code-walkthrough-result.json, delphi-reviewed.json)` | Write output artifacts only | Required for review output persistence |
19
+ | `Skill` | Invoke related skills for context | Required for cross-skill integration |
20
+ | `Question` | Ask user at decision points | Required for user interaction |
21
+
22
+ ## Denied Tools
23
+
24
+ | Tool | Rationale |
25
+ |------|-----------|
26
+ | `Edit(source code)` | Delphi review NEVER edits implementation code during review |
27
+ | `Write(source code)` | Delphi review NEVER writes implementation code |
28
+ | `Bash(git commit, git push)` | Delphi review NEVER commits or pushes during review |
29
+ | `Task(category=*, subagent_type=build)` | Delphi review NEVER delegates build/implementation tasks |
@@ -0,0 +1,64 @@
1
+ # ADR Format
2
+
3
+ ## Filename convention
4
+
5
+ `docs/adr/{NNNN}-{kebab-case-title}.md`
6
+
7
+ Where `{NNNN}` is a zero-padded incrementing number (e.g., `0001`, `0002`).
8
+
9
+ ## Structure
10
+
11
+ ```md
12
+ # {NNNN}. {Title}
13
+
14
+ ## Status
15
+
16
+ Proposed | Accepted | Deprecated | Superseded by ADR-XXXX
17
+
18
+ ## Context
19
+
20
+ {The issue(s) or situation(s) motivating this decision. What forces are at play? What is the problem?}
21
+
22
+ ## Decision
23
+
24
+ {The decision made. Stated in full sentences, in the present tense. What did we decide to do?}
25
+
26
+ ## Consequences
27
+
28
+ ### Positive
29
+ - {Benefit 1}
30
+ - {Benefit 2}
31
+
32
+ ### Negative
33
+ - {Trade-off 1}
34
+ - {Trade-off 2}
35
+
36
+ ### Neutral
37
+ - {Neutral observation 1}
38
+
39
+ ## Alternatives Considered
40
+
41
+ ### {Alternative 1 title}
42
+ {Brief description and why it was rejected.}
43
+
44
+ ### {Alternative 2 title}
45
+ {Brief description and why it was rejected.}
46
+ ```
47
+
48
+ ## Rules
49
+
50
+ - **Write for future readers, not present participants.** Future readers won't have the conversation context.
51
+ - **Be honest about trade-offs.** Every decision has costs. Name them.
52
+ - **One decision per ADR.** If you're writing "we decided X AND Y", split them.
53
+ - **Keep the decision short.** 1-3 sentences. The context section is where the complexity lives.
54
+ - **Superseded decisions are not deleted.** When a decision is overturned, create a new ADR that supersedes it. Update the old one's status to "Superseded by ADR-XXXX". This preserves history.
55
+ - **Don't document trivial choices.** If the answer is obvious or easily reversible, skip the ADR.
56
+
57
+ ## When NOT to write an ADR
58
+
59
+ - The decision is easily reversible.
60
+ - The decision is a personal preference with no team impact.
61
+ - The decision is well-documented elsewhere (e.g., in the project's CONTRIBUTING.md).
62
+ - The decision follows an obvious path with no real alternatives.
63
+
64
+ When in doubt, skip it. An ADR that shouldn't exist creates more noise than value.
@@ -0,0 +1,60 @@
1
+ # CONTEXT.md Format
2
+
3
+ ## Structure
4
+
5
+ ```md
6
+ # {Context Name}
7
+
8
+ {One or two sentence description of what this context is and why it exists.}
9
+
10
+ ## Language
11
+
12
+ **Order**:
13
+ {A one or two sentence description of the term}
14
+ _Avoid_: Purchase, transaction
15
+
16
+ **Invoice**:
17
+ A request for payment sent to a customer after delivery.
18
+ _Avoid_: Bill, payment request
19
+
20
+ **Customer**:
21
+ A person or organization that places orders.
22
+ _Avoid_: Client, buyer, account
23
+ ```
24
+
25
+ ## Rules
26
+
27
+ - **Be opinionated.** When multiple words exist for the same concept, pick the best one and list the others under `_Avoid_`.
28
+ - **Keep definitions tight.** One or two sentences max. Define what it IS, not what it does.
29
+ - **Only include terms specific to this project's context.** General programming concepts (timeouts, error types, utility patterns) don't belong even if the project uses them extensively. Before adding a term, ask: is this a concept unique to this context, or a general programming concept? Only the former belongs.
30
+ - **Group terms under subheadings** when natural clusters emerge. If all terms belong to a single cohesive area, a flat list is fine.
31
+
32
+ ## Single vs multi-context repos
33
+
34
+ **Single context (most repos):** One `CONTEXT.md` at the repo root.
35
+
36
+ **Multiple contexts:** A `CONTEXT-MAP.md` at the repo root lists the contexts, where they live, and how they relate to each other:
37
+
38
+ ```md
39
+ # Context Map
40
+
41
+ ## Contexts
42
+
43
+ - [Ordering](./src/ordering/CONTEXT.md) — receives and tracks customer orders
44
+ - [Billing](./src/billing/CONTEXT.md) — generates invoices and processes payments
45
+ - [Fulfillment](./src/fulfillment/CONTEXT.md) — manages warehouse picking and shipping
46
+
47
+ ## Relationships
48
+
49
+ - **Ordering → Fulfillment**: Ordering emits `OrderPlaced` events; Fulfillment consumes them to start picking
50
+ - **Fulfillment → Billing**: Fulfillment emits `ShipmentDispatched` events; Billing consumes them to generate invoices
51
+ - **Ordering ↔ Billing**: Shared types for `CustomerId` and `Money`
52
+ ```
53
+
54
+ The skill infers which structure applies:
55
+
56
+ - If `CONTEXT-MAP.md` exists, read it to find contexts
57
+ - If only a root `CONTEXT.md` exists, single context
58
+ - If neither exists, create a root `CONTEXT.md` lazily when the first term is resolved
59
+
60
+ When multiple contexts exist, infer which one the current topic relates to. If unclear, ask.
@@ -0,0 +1,74 @@
1
+ ---
2
+ name: domain-modeling
3
+ description: Build and sharpen a project's domain model. Use when the user wants to pin down domain terminology or a ubiquitous language, record an architectural decision, or when another skill needs to maintain the domain model.
4
+ ---
5
+
6
+ # Domain Modeling
7
+
8
+ Actively build and sharpen the project's domain model as you design. This is the *active* discipline — challenging terms, inventing edge-case scenarios, and writing the glossary and decisions down the moment they crystallise. (Merely *reading* `CONTEXT.md` for vocabulary is not this skill — that's a one-line habit any skill can do. This skill is for when you're changing the model, not just consuming it.)
9
+
10
+ ## File structure
11
+
12
+ Most repos have a single context:
13
+
14
+ ```
15
+ /
16
+ ├── CONTEXT.md
17
+ ├── docs/
18
+ │ └── adr/
19
+ │ ├── 0001-event-sourced-orders.md
20
+ │ └── 0002-postgres-for-write-model.md
21
+ └── src/
22
+ ```
23
+
24
+ If a `CONTEXT-MAP.md` exists at the root, the repo has multiple contexts. The map points to where each one lives:
25
+
26
+ ```
27
+ /
28
+ ├── CONTEXT-MAP.md
29
+ ├── docs/
30
+ │ └── adr/ ← system-wide decisions
31
+ ├── src/
32
+ │ ├── ordering/
33
+ │ │ ├── CONTEXT.md
34
+ │ │ └── docs/adr/ ← context-specific decisions
35
+ │ └── billing/
36
+ │ ├── CONTEXT.md
37
+ │ └── docs/adr/
38
+ ```
39
+
40
+ Create files lazily — only when you have something to write. If no `CONTEXT.md` exists, create one when the first term is resolved. If no `docs/adr/` exists, create it when the first ADR is needed.
41
+
42
+ ## During the session
43
+
44
+ ### Challenge against the glossary
45
+
46
+ When the user uses a term that conflicts with the existing language in `CONTEXT.md`, call it out immediately. "Your glossary defines 'cancellation' as X, but you seem to mean Y — which is it?"
47
+
48
+ ### Sharpen fuzzy language
49
+
50
+ When the user uses vague or overloaded terms, propose a precise canonical term. "You're saying 'account' — do you mean the Customer or the User? Those are different things."
51
+
52
+ ### Discuss concrete scenarios
53
+
54
+ When domain relationships are being discussed, stress-test them with specific scenarios. Invent scenarios that probe edge cases and force the user to be precise about the boundaries between concepts.
55
+
56
+ ### Cross-reference with code
57
+
58
+ When the user states how something works, check whether the code agrees. If you find a contradiction, surface it: "Your code cancels entire Orders, but you just said partial cancellation is possible — which is right?"
59
+
60
+ ### Update CONTEXT.md inline
61
+
62
+ When a term is resolved, update `CONTEXT.md` right there. Don't batch these up — capture them as they happen. Use the format in [CONTEXT-FORMAT.md](./CONTEXT-FORMAT.md).
63
+
64
+ `CONTEXT.md` should be totally devoid of implementation details. Do not treat `CONTEXT.md` as a spec, a scratch pad, or a repository for implementation decisions. It is a glossary and nothing else.
65
+
66
+ ### Offer ADRs sparingly
67
+
68
+ Only offer to create an ADR when all three are true:
69
+
70
+ 1. **Hard to reverse** — the cost of changing your mind later is meaningful
71
+ 2. **Surprising without context** — a future reader will wonder "why did they do it this way?"
72
+ 3. **The result of a real trade-off** — there were genuine alternatives and you picked one for specific reasons
73
+
74
+ If any of the three is missing, skip the ADR. Use the format in [ADR-FORMAT.md](./ADR-FORMAT.md).
@@ -0,0 +1,7 @@
1
+ ---
2
+ name: grill-with-docs
3
+ description: A relentless interview to sharpen a plan or design, which also creates docs (ADR's and glossary) as we go.
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ Run a `/grilling` session, using the `/domain-modeling` skill.
@@ -0,0 +1,12 @@
1
+ ---
2
+ name: grilling
3
+ description: Grill the user relentlessly about a plan, decision, or idea. Use when the user wants to stress-test their thinking, or uses any 'grill' trigger phrases.
4
+ ---
5
+
6
+ Interview me relentlessly about every aspect of this until we reach a shared understanding. Walk down each branch of the decision tree, resolving dependencies between decisions one-by-one. For each question, provide your recommended answer.
7
+
8
+ Ask the questions one at a time, waiting for feedback on each question before continuing. Asking multiple questions at once is bewildering.
9
+
10
+ If a *fact* can be found by exploring the environment (filesystem, tools, etc.), look it up rather than asking me. The *decisions*, though, are mine — put each one to me and wait for my answer.
11
+
12
+ Do not act on it until I confirm we have reached a shared understanding.