@ikon85/agent-workflow-kit 0.10.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 (273) hide show
  1. package/.agents/skills/ask-matt/SKILL.md +139 -0
  2. package/.agents/skills/ask-matt/THIRD-PARTY-NOTICES.md +29 -0
  3. package/.agents/skills/audit-skills/SKILL.md +145 -0
  4. package/.agents/skills/board-to-waves/SKILL.md +135 -0
  5. package/.agents/skills/code-review/SKILL.md +64 -0
  6. package/.agents/skills/codebase-design/DEEPENING.md +37 -0
  7. package/.agents/skills/codebase-design/DESIGN-IT-TWICE.md +44 -0
  8. package/.agents/skills/codebase-design/SKILL.md +114 -0
  9. package/.agents/skills/codebase-design/THIRD-PARTY-NOTICES.md +29 -0
  10. package/.agents/skills/codex-adapter-sync/SKILL.md +151 -0
  11. package/.agents/skills/decision-gate/SKILL.md +67 -0
  12. package/.agents/skills/diagnose/SKILL.md +136 -0
  13. package/.agents/skills/diagnose/THIRD-PARTY-NOTICES.md +29 -0
  14. package/.agents/skills/diagnose/scripts/hitl-loop.template.sh +41 -0
  15. package/.agents/skills/domain-modeling/ADR-FORMAT.md +47 -0
  16. package/.agents/skills/domain-modeling/CONTEXT-FORMAT.md +60 -0
  17. package/.agents/skills/domain-modeling/SKILL.md +76 -0
  18. package/.agents/skills/domain-modeling/THIRD-PARTY-NOTICES.md +29 -0
  19. package/.agents/skills/git-worktree-recover/SKILL.md +176 -0
  20. package/.agents/skills/grill-me/SKILL.md +54 -0
  21. package/.agents/skills/grill-me/THIRD-PARTY-NOTICES.md +29 -0
  22. package/.agents/skills/grill-with-docs/ADR-FORMAT.md +47 -0
  23. package/.agents/skills/grill-with-docs/CONTEXT-FORMAT.md +60 -0
  24. package/.agents/skills/grill-with-docs/SKILL.md +137 -0
  25. package/.agents/skills/grill-with-docs/THIRD-PARTY-NOTICES.md +29 -0
  26. package/.agents/skills/implement/SKILL.md +15 -0
  27. package/.agents/skills/implement/THIRD-PARTY-NOTICES.md +29 -0
  28. package/.agents/skills/improve-codebase-architecture/ADR-FORMAT.md +47 -0
  29. package/.agents/skills/improve-codebase-architecture/CONTEXT-FORMAT.md +60 -0
  30. package/.agents/skills/improve-codebase-architecture/DEEPENING.md +37 -0
  31. package/.agents/skills/improve-codebase-architecture/HTML-REPORT.md +123 -0
  32. package/.agents/skills/improve-codebase-architecture/INTERFACE-DESIGN.md +46 -0
  33. package/.agents/skills/improve-codebase-architecture/LANGUAGE.md +53 -0
  34. package/.agents/skills/improve-codebase-architecture/SKILL.md +88 -0
  35. package/.agents/skills/improve-codebase-architecture/THIRD-PARTY-NOTICES.md +29 -0
  36. package/.agents/skills/kit-release/SKILL.md +56 -0
  37. package/.agents/skills/local-ci/SKILL.md +94 -0
  38. package/.agents/skills/orchestrate-wave/SKILL.md +261 -0
  39. package/.agents/skills/orchestrate-wave/references/builder-contract.md +67 -0
  40. package/.agents/skills/prototype/LOGIC.md +79 -0
  41. package/.agents/skills/prototype/SKILL.md +30 -0
  42. package/.agents/skills/prototype/THIRD-PARTY-NOTICES.md +29 -0
  43. package/.agents/skills/prototype/UI.md +112 -0
  44. package/.agents/skills/research/SKILL.md +12 -0
  45. package/.agents/skills/research/THIRD-PARTY-NOTICES.md +29 -0
  46. package/.agents/skills/resolving-merge-conflicts/SKILL.md +14 -0
  47. package/.agents/skills/resolving-merge-conflicts/THIRD-PARTY-NOTICES.md +29 -0
  48. package/.agents/skills/retro/SKILL.md +209 -0
  49. package/.agents/skills/scale-check/SKILL.md +141 -0
  50. package/.agents/skills/security-audit/SKILL.md +67 -0
  51. package/.agents/skills/setup-workflow/SKILL.md +187 -0
  52. package/.agents/skills/setup-workflow/THIRD-PARTY-NOTICES.md +29 -0
  53. package/.agents/skills/setup-workflow/board-sync.md +111 -0
  54. package/.agents/skills/setup-workflow/code-review.md +26 -0
  55. package/.agents/skills/setup-workflow/domain.md +51 -0
  56. package/.agents/skills/setup-workflow/issue-tracker-github.md +35 -0
  57. package/.agents/skills/setup-workflow/issue-tracker-gitlab.md +34 -0
  58. package/.agents/skills/setup-workflow/issue-tracker-local.md +30 -0
  59. package/.agents/skills/setup-workflow/orchestrate-wave-seed.md +44 -0
  60. package/.agents/skills/setup-workflow/spec-completeness-seed.md +44 -0
  61. package/.agents/skills/setup-workflow/spec-self-critique-seed.md +43 -0
  62. package/.agents/skills/setup-workflow/triage-labels.md +18 -0
  63. package/.agents/skills/setup-workflow/workflow-overview.md +33 -0
  64. package/.agents/skills/spec-self-critique/SKILL.md +152 -0
  65. package/.agents/skills/spec-self-critique/scenarios.md +82 -0
  66. package/.agents/skills/tdd/SKILL.md +120 -0
  67. package/.agents/skills/tdd/THIRD-PARTY-NOTICES.md +29 -0
  68. package/.agents/skills/tdd/deep-modules.md +33 -0
  69. package/.agents/skills/tdd/interface-design.md +31 -0
  70. package/.agents/skills/tdd/mocking.md +59 -0
  71. package/.agents/skills/tdd/refactoring.md +10 -0
  72. package/.agents/skills/tdd/tests.md +61 -0
  73. package/.agents/skills/to-issues/SKILL.md +325 -0
  74. package/.agents/skills/to-issues/THIRD-PARTY-NOTICES.md +29 -0
  75. package/.agents/skills/to-prd/PROGRAM-PRD-FORMAT.md +162 -0
  76. package/.agents/skills/to-prd/SKILL.md +180 -0
  77. package/.agents/skills/to-prd/THIRD-PARTY-NOTICES.md +29 -0
  78. package/.agents/skills/to-waves/SKILL.md +260 -0
  79. package/.agents/skills/to-waves/SLICE-METADATA-FORMAT.md +74 -0
  80. package/.agents/skills/triage/AGENT-BRIEF.md +168 -0
  81. package/.agents/skills/triage/OUT-OF-SCOPE.md +101 -0
  82. package/.agents/skills/triage/SKILL.md +122 -0
  83. package/.agents/skills/triage/THIRD-PARTY-NOTICES.md +29 -0
  84. package/.agents/skills/verify-spike/SKILL.md +39 -0
  85. package/.agents/skills/wayfinder/SKILL.md +127 -0
  86. package/.agents/skills/wayfinder/THIRD-PARTY-NOTICES.md +29 -0
  87. package/.agents/skills/wrapup/SKILL.md +71 -0
  88. package/.agents/skills/wrapup/SOURCES.txt +6 -0
  89. package/.agents/skills/zoom-out/SKILL.md +7 -0
  90. package/.agents/skills/zoom-out/THIRD-PARTY-NOTICES.md +29 -0
  91. package/.claude/hooks/_hook_utils.py +184 -0
  92. package/.claude/hooks/drift-guard.py +176 -0
  93. package/.claude/hooks/skill-drift-hint.py +122 -0
  94. package/.claude/hooks/sync-board-status.py +191 -0
  95. package/.claude/skills/ask-matt/SKILL.md +139 -0
  96. package/.claude/skills/ask-matt/THIRD-PARTY-NOTICES.md +29 -0
  97. package/.claude/skills/audit-skills/SKILL.md +145 -0
  98. package/.claude/skills/board-to-waves/SKILL.md +148 -0
  99. package/.claude/skills/code-review/SKILL.md +64 -0
  100. package/.claude/skills/codebase-design/DEEPENING.md +37 -0
  101. package/.claude/skills/codebase-design/DESIGN-IT-TWICE.md +44 -0
  102. package/.claude/skills/codebase-design/SKILL.md +114 -0
  103. package/.claude/skills/codebase-design/THIRD-PARTY-NOTICES.md +29 -0
  104. package/.claude/skills/codex-build/SKILL.md +126 -0
  105. package/.claude/skills/codex-build/THIRD-PARTY-NOTICES.md +35 -0
  106. package/.claude/skills/codex-review/SKILL.md +145 -0
  107. package/.claude/skills/codex-review/THIRD-PARTY-NOTICES.md +31 -0
  108. package/.claude/skills/decision-gate/SKILL.md +67 -0
  109. package/.claude/skills/diagnose/SKILL.md +136 -0
  110. package/.claude/skills/diagnose/THIRD-PARTY-NOTICES.md +29 -0
  111. package/.claude/skills/diagnose/scripts/hitl-loop.template.sh +41 -0
  112. package/.claude/skills/domain-modeling/ADR-FORMAT.md +47 -0
  113. package/.claude/skills/domain-modeling/CONTEXT-FORMAT.md +60 -0
  114. package/.claude/skills/domain-modeling/SKILL.md +76 -0
  115. package/.claude/skills/domain-modeling/THIRD-PARTY-NOTICES.md +29 -0
  116. package/.claude/skills/git-guardrails-claude-code/SKILL.md +96 -0
  117. package/.claude/skills/git-guardrails-claude-code/THIRD-PARTY-NOTICES.md +29 -0
  118. package/.claude/skills/git-guardrails-claude-code/scripts/block-dangerous-git.sh +28 -0
  119. package/.claude/skills/git-worktree-recover/SKILL.md +182 -0
  120. package/.claude/skills/grill-me/SKILL.md +54 -0
  121. package/.claude/skills/grill-me/THIRD-PARTY-NOTICES.md +29 -0
  122. package/.claude/skills/grill-me-codex/SKILL.md +158 -0
  123. package/.claude/skills/grill-me-codex/THIRD-PARTY-NOTICES.md +32 -0
  124. package/.claude/skills/grill-with-docs/ADR-FORMAT.md +47 -0
  125. package/.claude/skills/grill-with-docs/CONTEXT-FORMAT.md +60 -0
  126. package/.claude/skills/grill-with-docs/SKILL.md +137 -0
  127. package/.claude/skills/grill-with-docs/THIRD-PARTY-NOTICES.md +29 -0
  128. package/.claude/skills/grill-with-docs-codex/ADR-FORMAT.md +47 -0
  129. package/.claude/skills/grill-with-docs-codex/CONTEXT-FORMAT.md +60 -0
  130. package/.claude/skills/grill-with-docs-codex/SKILL.md +233 -0
  131. package/.claude/skills/grill-with-docs-codex/THIRD-PARTY-NOTICES.md +33 -0
  132. package/.claude/skills/implement/SKILL.md +15 -0
  133. package/.claude/skills/implement/THIRD-PARTY-NOTICES.md +29 -0
  134. package/.claude/skills/improve-codebase-architecture/ADR-FORMAT.md +47 -0
  135. package/.claude/skills/improve-codebase-architecture/CONTEXT-FORMAT.md +60 -0
  136. package/.claude/skills/improve-codebase-architecture/DEEPENING.md +37 -0
  137. package/.claude/skills/improve-codebase-architecture/HTML-REPORT.md +123 -0
  138. package/.claude/skills/improve-codebase-architecture/INTERFACE-DESIGN.md +46 -0
  139. package/.claude/skills/improve-codebase-architecture/LANGUAGE.md +53 -0
  140. package/.claude/skills/improve-codebase-architecture/SKILL.md +88 -0
  141. package/.claude/skills/improve-codebase-architecture/THIRD-PARTY-NOTICES.md +29 -0
  142. package/.claude/skills/kit-release/SKILL.md +56 -0
  143. package/.claude/skills/local-ci/SKILL.md +94 -0
  144. package/.claude/skills/orchestrate-wave/SKILL.md +269 -0
  145. package/.claude/skills/orchestrate-wave/references/builder-contract.md +67 -0
  146. package/.claude/skills/prototype/LOGIC.md +79 -0
  147. package/.claude/skills/prototype/SKILL.md +30 -0
  148. package/.claude/skills/prototype/THIRD-PARTY-NOTICES.md +29 -0
  149. package/.claude/skills/prototype/UI.md +112 -0
  150. package/.claude/skills/research/SKILL.md +12 -0
  151. package/.claude/skills/research/THIRD-PARTY-NOTICES.md +29 -0
  152. package/.claude/skills/resolving-merge-conflicts/SKILL.md +14 -0
  153. package/.claude/skills/resolving-merge-conflicts/THIRD-PARTY-NOTICES.md +29 -0
  154. package/.claude/skills/retro/SKILL.md +209 -0
  155. package/.claude/skills/scale-check/SKILL.md +141 -0
  156. package/.claude/skills/security-audit/SKILL.md +67 -0
  157. package/.claude/skills/setup-pre-commit/SKILL.md +104 -0
  158. package/.claude/skills/setup-pre-commit/scripts/pre-commit.template.sh +35 -0
  159. package/.claude/skills/setup-workflow/SKILL.md +187 -0
  160. package/.claude/skills/setup-workflow/THIRD-PARTY-NOTICES.md +29 -0
  161. package/.claude/skills/setup-workflow/board-sync.md +111 -0
  162. package/.claude/skills/setup-workflow/code-review.md +26 -0
  163. package/.claude/skills/setup-workflow/domain.md +51 -0
  164. package/.claude/skills/setup-workflow/issue-tracker-github.md +35 -0
  165. package/.claude/skills/setup-workflow/issue-tracker-gitlab.md +34 -0
  166. package/.claude/skills/setup-workflow/issue-tracker-local.md +30 -0
  167. package/.claude/skills/setup-workflow/orchestrate-wave-seed.md +44 -0
  168. package/.claude/skills/setup-workflow/spec-completeness-seed.md +44 -0
  169. package/.claude/skills/setup-workflow/spec-self-critique-seed.md +43 -0
  170. package/.claude/skills/setup-workflow/triage-labels.md +18 -0
  171. package/.claude/skills/setup-workflow/workflow-overview.md +33 -0
  172. package/.claude/skills/skill-manifest.json +389 -0
  173. package/.claude/skills/spec-self-critique/SKILL.md +152 -0
  174. package/.claude/skills/spec-self-critique/scenarios.md +82 -0
  175. package/.claude/skills/tdd/SKILL.md +120 -0
  176. package/.claude/skills/tdd/THIRD-PARTY-NOTICES.md +29 -0
  177. package/.claude/skills/tdd/deep-modules.md +33 -0
  178. package/.claude/skills/tdd/interface-design.md +31 -0
  179. package/.claude/skills/tdd/mocking.md +59 -0
  180. package/.claude/skills/tdd/refactoring.md +10 -0
  181. package/.claude/skills/tdd/tests.md +61 -0
  182. package/.claude/skills/to-issues/SKILL.md +325 -0
  183. package/.claude/skills/to-issues/THIRD-PARTY-NOTICES.md +29 -0
  184. package/.claude/skills/to-prd/PROGRAM-PRD-FORMAT.md +162 -0
  185. package/.claude/skills/to-prd/SKILL.md +180 -0
  186. package/.claude/skills/to-prd/THIRD-PARTY-NOTICES.md +29 -0
  187. package/.claude/skills/to-waves/SKILL.md +260 -0
  188. package/.claude/skills/to-waves/SLICE-METADATA-FORMAT.md +74 -0
  189. package/.claude/skills/triage/AGENT-BRIEF.md +168 -0
  190. package/.claude/skills/triage/OUT-OF-SCOPE.md +101 -0
  191. package/.claude/skills/triage/SKILL.md +122 -0
  192. package/.claude/skills/triage/THIRD-PARTY-NOTICES.md +29 -0
  193. package/.claude/skills/verify-spike/SKILL.md +39 -0
  194. package/.claude/skills/wayfinder/SKILL.md +127 -0
  195. package/.claude/skills/wayfinder/THIRD-PARTY-NOTICES.md +29 -0
  196. package/.claude/skills/wrapup/SKILL.md +81 -0
  197. package/.claude/skills/wrapup/SOURCES.txt +6 -0
  198. package/.claude/skills/write-a-skill/GLOSSARY.md +201 -0
  199. package/.claude/skills/write-a-skill/SKILL.md +88 -0
  200. package/.claude/skills/write-a-skill/THIRD-PARTY-NOTICES.md +29 -0
  201. package/.claude/skills/zoom-out/SKILL.md +7 -0
  202. package/.claude/skills/zoom-out/THIRD-PARTY-NOTICES.md +29 -0
  203. package/LICENSE +28 -0
  204. package/PROVENANCE.md +39 -0
  205. package/README.md +619 -0
  206. package/agent-workflow-kit.package.json +1939 -0
  207. package/docs/agents/board-sync.md +71 -0
  208. package/docs/agents/code-review.md +14 -0
  209. package/docs/agents/domain.md +7 -0
  210. package/docs/agents/issue-tracker.md +12 -0
  211. package/docs/agents/security-audit-runbook-template.md +205 -0
  212. package/docs/agents/skills/orchestrate-wave.md +13 -0
  213. package/docs/agents/skills/spec-self-critique.md +18 -0
  214. package/docs/agents/triage-labels.md +10 -0
  215. package/docs/agents/wave-anchor-template.md +88 -0
  216. package/docs/conventions/spec-completeness.md +23 -0
  217. package/docs/index.html +56 -0
  218. package/docs/methodology.html +488 -0
  219. package/docs/methodology.svg +93 -0
  220. package/docs/workflow.png +0 -0
  221. package/package.json +40 -0
  222. package/scripts/anchor_table.py +343 -0
  223. package/scripts/board-sync.py +1232 -0
  224. package/scripts/board_config.py +147 -0
  225. package/scripts/board_fields.py +192 -0
  226. package/scripts/build-kit.mjs +116 -0
  227. package/scripts/build-kit.test.mjs +59 -0
  228. package/scripts/check-kit-staleness.mjs +45 -0
  229. package/scripts/check-kit-staleness.test.mjs +19 -0
  230. package/scripts/execute-ready-check.py +516 -0
  231. package/scripts/issue_deps.py +79 -0
  232. package/scripts/kit-release.mjs +100 -0
  233. package/scripts/kit-release.test.mjs +67 -0
  234. package/scripts/lib/audit-refs.mjs +146 -0
  235. package/scripts/lib/scrub.mjs +113 -0
  236. package/scripts/lib/scrub.test.mjs +187 -0
  237. package/scripts/loc_offender_core.py +196 -0
  238. package/scripts/loc_offender_gate.py +182 -0
  239. package/scripts/node_kind.py +68 -0
  240. package/scripts/portability_profile_scan.py +53 -0
  241. package/scripts/pr-body-check.py +263 -0
  242. package/scripts/program_graph.py +125 -0
  243. package/scripts/program_graph_parse.py +275 -0
  244. package/scripts/program_graph_validate.py +256 -0
  245. package/scripts/program_sync.py +160 -0
  246. package/scripts/release-delta-guard.mjs +96 -0
  247. package/scripts/release-delta-guard.test.mjs +53 -0
  248. package/scripts/test_board_sync_create_idempotency.py +104 -0
  249. package/scripts/test_dist_kit_smoke.py +199 -0
  250. package/scripts/test_kit_docs_language_census.py +178 -0
  251. package/scripts/test_skill_code_review_seed.py +89 -0
  252. package/scripts/test_skill_frontmatter_lint.py +226 -0
  253. package/scripts/test_skill_gh_lint.py +124 -0
  254. package/scripts/test_skill_language_census.py +254 -0
  255. package/scripts/test_skill_portability_lint.py +773 -0
  256. package/scripts/test_skill_publish_audit.py +300 -0
  257. package/scripts/test_skill_selfcontainment_lint.py +255 -0
  258. package/scripts/test_skill_setup_workflow_seeds.py +200 -0
  259. package/scripts/test_skill_stale_name_lint.py +126 -0
  260. package/scripts/test_skill_surface_refs.py +300 -0
  261. package/scripts/test_skill_trailing_artifact_lint.py +71 -0
  262. package/scripts/wrapup-land.py +573 -0
  263. package/src/cli.mjs +70 -0
  264. package/src/commands/diff.mjs +6 -0
  265. package/src/commands/init.mjs +59 -0
  266. package/src/commands/uninstall.mjs +43 -0
  267. package/src/commands/update.mjs +95 -0
  268. package/src/lib/atomicWrite.mjs +49 -0
  269. package/src/lib/bundle.mjs +133 -0
  270. package/src/lib/hash.mjs +13 -0
  271. package/src/lib/manifest.mjs +58 -0
  272. package/src/lib/sentinel.mjs +20 -0
  273. package/src/lib/settings.mjs +23 -0
@@ -0,0 +1,29 @@
1
+ # Third-Party Notices
2
+
3
+ This skill is adapted from **Matt Pocock's skills**
4
+ (https://github.com/mattpocock/skills), `skills/engineering/domain-modeling` @ d574778, Copyright (c) 2026 Matt Pocock,
5
+ used under the MIT License. Locally adapted (fork-and-own); see PROVENANCE.md.
6
+
7
+ ```
8
+ MIT License
9
+
10
+ Copyright (c) 2026 Matt Pocock
11
+
12
+ Permission is hereby granted, free of charge, to any person obtaining a copy
13
+ of this software and associated documentation files (the "Software"), to deal
14
+ in the Software without restriction, including without limitation the rights
15
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
+ copies of the Software, and to permit persons to whom the Software is
17
+ furnished to do so, subject to the following conditions:
18
+
19
+ The above copyright notice and this permission notice shall be included in all
20
+ copies or substantial portions of the Software.
21
+
22
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
+ SOFTWARE.
29
+ ```
@@ -0,0 +1,96 @@
1
+ ---
2
+ name: git-guardrails-claude-code
3
+ disable-model-invocation: true
4
+ description: Set up Claude Code hooks to block dangerous git commands (push, reset --hard, clean, branch -D, etc.) before they execute. Use when user wants to prevent destructive git operations, add git safety hooks, or block git push/reset in Claude Code.
5
+ ---
6
+
7
+ # Setup Git Guardrails
8
+
9
+ Sets up a PreToolUse hook that intercepts and blocks dangerous git commands before Claude executes them.
10
+
11
+ ## What Gets Blocked
12
+
13
+ - `git push` **to `main`/`master`** and any **force-push** (`--force` / `-f` / `--force-with-lease`). A normal feature-branch push (`git push -u origin <feature>`, `git push origin --delete <branch>`) is **allowed** — the git-level `pre-push` hook is the backstop for direct-to-`main` pushes.
14
+ - `git reset --hard`
15
+ - `git clean -f` / `git clean -fd`
16
+ - `git branch -D`
17
+ - `git checkout .` / `git restore .`
18
+
19
+ When blocked, Claude sees a message telling it that it does not have authority to access these commands.
20
+
21
+ ## Steps
22
+
23
+ ### 1. Ask scope
24
+
25
+ Ask the user: install for **this project only** (`.claude/settings.json`) or **all projects** (`~/.claude/settings.json`)?
26
+
27
+ ### 2. Copy the hook script
28
+
29
+ The bundled script is at: [scripts/block-dangerous-git.sh](scripts/block-dangerous-git.sh)
30
+
31
+ Copy it to the target location based on scope:
32
+
33
+ - **Project**: `.claude/hooks/block-dangerous-git.sh`
34
+ - **Global**: `~/.claude/hooks/block-dangerous-git.sh`
35
+
36
+ Make it executable with `chmod +x`.
37
+
38
+ ### 3. Add hook to settings
39
+
40
+ Add to the appropriate settings file:
41
+
42
+ **Project** (`.claude/settings.json`):
43
+
44
+ ```json
45
+ {
46
+ "hooks": {
47
+ "PreToolUse": [
48
+ {
49
+ "matcher": "Bash",
50
+ "hooks": [
51
+ {
52
+ "type": "command",
53
+ "command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/block-dangerous-git.sh"
54
+ }
55
+ ]
56
+ }
57
+ ]
58
+ }
59
+ }
60
+ ```
61
+
62
+ **Global** (`~/.claude/settings.json`):
63
+
64
+ ```json
65
+ {
66
+ "hooks": {
67
+ "PreToolUse": [
68
+ {
69
+ "matcher": "Bash",
70
+ "hooks": [
71
+ {
72
+ "type": "command",
73
+ "command": "~/.claude/hooks/block-dangerous-git.sh"
74
+ }
75
+ ]
76
+ }
77
+ ]
78
+ }
79
+ }
80
+ ```
81
+
82
+ If the settings file already exists, merge the hook into existing `hooks.PreToolUse` array — don't overwrite other settings.
83
+
84
+ ### 4. Ask about customization
85
+
86
+ Ask if user wants to add or remove any patterns from the blocked list. Edit the copied script accordingly.
87
+
88
+ ### 5. Verify
89
+
90
+ Run a quick test:
91
+
92
+ ```bash
93
+ echo '{"tool_input":{"command":"git push origin main"}}' | <path-to-script>
94
+ ```
95
+
96
+ Should exit with code 2 and print a BLOCKED message to stderr.
@@ -0,0 +1,29 @@
1
+ # Third-Party Notices
2
+
3
+ This skill is adapted from **Matt Pocock's skills**
4
+ (https://github.com/mattpocock/skills), `skills/misc/git-guardrails-claude-code` @ d574778, Copyright (c) 2026 Matt Pocock,
5
+ used under the MIT License. Locally adapted (fork-and-own); see PROVENANCE.md.
6
+
7
+ ```
8
+ MIT License
9
+
10
+ Copyright (c) 2026 Matt Pocock
11
+
12
+ Permission is hereby granted, free of charge, to any person obtaining a copy
13
+ of this software and associated documentation files (the "Software"), to deal
14
+ in the Software without restriction, including without limitation the rights
15
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
+ copies of the Software, and to permit persons to whom the Software is
17
+ furnished to do so, subject to the following conditions:
18
+
19
+ The above copyright notice and this permission notice shall be included in all
20
+ copies or substantial portions of the Software.
21
+
22
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
+ SOFTWARE.
29
+ ```
@@ -0,0 +1,28 @@
1
+ #!/bin/bash
2
+
3
+ INPUT=$(cat)
4
+ COMMAND=$(echo "$INPUT" | jq -r '.tool_input.command')
5
+
6
+ # Push is narrowed: only a push to main/master OR a force-push is blocked — a
7
+ # normal feature-branch push is allowed (the git-level .githooks/pre-push hook is
8
+ # the main-push backstop). All other destructive ops stay blocked outright.
9
+ DANGEROUS_PATTERNS=(
10
+ "git push.*[ :](main|master)([[:space:]]|$)"
11
+ "git push.*(--force|--force-with-lease|[[:space:]]-f([[:space:]]|$))"
12
+ "git reset --hard"
13
+ "git clean -fd"
14
+ "git clean -f"
15
+ "git branch -D"
16
+ "git checkout \."
17
+ "git restore \."
18
+ "reset --hard"
19
+ )
20
+
21
+ for pattern in "${DANGEROUS_PATTERNS[@]}"; do
22
+ if echo "$COMMAND" | grep -qE "$pattern"; then
23
+ echo "BLOCKED: '$COMMAND' matches dangerous pattern '$pattern'. The user has prevented you from doing this." >&2
24
+ exit 2
25
+ fi
26
+ done
27
+
28
+ exit 0
@@ -0,0 +1,182 @@
1
+ ---
2
+ name: git-worktree-recover
3
+ description: >-
4
+ Recovery skill for git branch mix-ups — a commit landed on the wrong branch,
5
+ the branch switched unexpectedly, or work appears lost. Uses git reflog to find
6
+ the misplaced commit, moves it to the right branch (git branch -f), optionally
7
+ resets the wrong branch, and sets up a clean worktree. Triggers: "commit on the
8
+ wrong branch", "the branch switched on its own", "this commit doesn't belong
9
+ here", "my work is gone", "I committed to main by accident".
10
+ ---
11
+
12
+ # git-worktree-recover
13
+
14
+ Recovery skill for branch mix-ups. When two processes share one checkout's global
15
+ `HEAD`, they can clobber each other — a commit lands on the wrong branch. This
16
+ skill is the **reaction** when a prevention layer (a worktree-per-session
17
+ discipline and its guards) didn't stop it.
18
+
19
+ ## When to invoke
20
+
21
+ - "My commit is on the wrong branch"
22
+ - "The branch switched even though I did nothing"
23
+ - "This commit doesn't belong here"
24
+ - "My work is gone / I can't see my commit anymore"
25
+ - "I accidentally committed to main"
26
+
27
+ ## Precondition
28
+
29
+ If your project has a prevention layer — a SessionStart warning on active
30
+ worktrees, a pre-edit guard that blocks edits on the wrong branch — this skill
31
+ handles the case where that layer did NOT prevent a misplaced commit. Your project
32
+ layer names those guards (`docs/agents/skills/git-worktree-recover.md`, seeded as
33
+ an empty stub by `/setup-workflow`).
34
+
35
+ ---
36
+
37
+ ## Phase 1 — Assess the situation
38
+
39
+ Run these four read-only commands (no harm):
40
+
41
+ ```bash
42
+ git branch --show-current
43
+ git log --oneline -10
44
+ git reflog --oneline -20
45
+ git worktree list
46
+ ```
47
+
48
+ **Goal:** identify the misplaced commit SHA + the intended target branch.
49
+
50
+ ### What to look for in the reflog
51
+
52
+ A line like:
53
+
54
+ ```
55
+ 691b655 HEAD@{3}: commit: <your commit message>
56
+ ```
57
+
58
+ ...appearing on a branch that is *not* the commit's intended branch. Note the SHA
59
+ and message.
60
+
61
+ ---
62
+
63
+ ## Phase 2 — Safety checks
64
+
65
+ Before any destructive action:
66
+
67
+ 1. **Is the target branch checked out in another worktree?**
68
+ ```bash
69
+ git worktree list
70
+ ```
71
+ `git branch -f <branch> <sha>` fails if the branch is checked out elsewhere —
72
+ that is safe (git refuses it), but check first to get a clear message.
73
+
74
+ 2. **Does the wrong branch have its own commits that must survive?**
75
+ ```bash
76
+ git log --oneline <wrong-branch>..origin/main
77
+ ```
78
+ If nothing of its own (it is `main`, or carries nothing) → a reset to
79
+ `origin/main` is safe.
80
+
81
+ 3. **Is the SHA really the right commit?**
82
+ ```bash
83
+ git show --stat <sha>
84
+ ```
85
+ Check the message + changed files against the intended context.
86
+
87
+ ---
88
+
89
+ ## Phase 3 — Move the commit to the right branch
90
+
91
+ **Case A: target branch does not exist yet (most common)**
92
+
93
+ ```bash
94
+ git branch <target-branch> <sha>
95
+ git log --oneline <target-branch> -5 # verify
96
+ ```
97
+
98
+ **Case B: target branch exists and the commit is missing there**
99
+
100
+ ```bash
101
+ git branch -f <target-branch> <sha> # only if NOT checked out elsewhere
102
+ git log --oneline <target-branch> -5 # verify
103
+ ```
104
+
105
+ **Case C: several commits on the wrong branch (stacked mix-up)**
106
+
107
+ ```bash
108
+ git cherry-pick <sha1> <sha2> ... # run on the correct branch, oldest first
109
+ ```
110
+
111
+ ---
112
+
113
+ ## Phase 4 — Clean up the wrong branch (optional, recommended)
114
+
115
+ Only when:
116
+
117
+ - the wrong branch is checked out in the main tree (not a worktree), AND
118
+ - the wrong branch is `main` or carries no feature commits of its own.
119
+
120
+ ```bash
121
+ git reset --hard origin/main
122
+ git log --oneline -5 # the misplaced commit must NOT appear here anymore
123
+ ```
124
+
125
+ If the wrong branch is a feature branch with its own state → do **not** reset; drop
126
+ only the one commit (`git rebase --onto`). Rare special case — confirm before doing
127
+ it.
128
+
129
+ ---
130
+
131
+ ## Phase 5 — Set up a worktree
132
+
133
+ Set the recovered branch up cleanly in its own worktree. If your project has a
134
+ worktree-setup command, use it (it typically runs `git worktree add`, installs
135
+ deps and copies env files); otherwise:
136
+
137
+ ```bash
138
+ git worktree add <path> <recovered-branch>
139
+ ```
140
+
141
+ Your project layer names the exact command and what it copies.
142
+
143
+ **Verify after setup:**
144
+
145
+ ```bash
146
+ git worktree list
147
+ ```
148
+
149
+ ---
150
+
151
+ ## Phase 6 — Final check
152
+
153
+ ```bash
154
+ git log --oneline <target-branch> -5 # SHA must appear here
155
+ git log --oneline <wrong-branch> -3 # SHA must no longer be the top here
156
+ git worktree list # clean
157
+ ```
158
+
159
+ ---
160
+
161
+ ## Background + cause
162
+
163
+ `git` keeps ONE global `HEAD` pointer per checkout. If two processes run
164
+ `git checkout`, the second overwrites the first — a commit can then land on the
165
+ wrong branch. Not a bug, a git property. The fix is isolation via `git worktree`
166
+ (one checkout dir per session); this skill is the reaction when a prevention guard
167
+ did not catch it.
168
+
169
+ **Safety guarantees of `git branch -f`:**
170
+
171
+ - Refuses to run if the branch is checked out in another worktree (git built-in).
172
+ - No data loss: the commit stays in the object store, only the branch pointer moves.
173
+ - Always reversible via `git reflog`.
174
+
175
+ ## Anti-patterns
176
+
177
+ - **`git rebase -i` to remove commits from main** — too destructive, risks a
178
+ force-push to main (a pre-push hook should block it, but avoid it anyway).
179
+ - **`git reset --hard` without the safety check** — only after the worktree-list
180
+ check and only when the branch has no feature state of its own.
181
+ - **Reflog without SHA verification (`git show`)** — reflog shows checkouts too,
182
+ not just commits; always `git show <sha>` before acting.
@@ -0,0 +1,54 @@
1
+ ---
2
+ name: grill-me
3
+ disable-model-invocation: true
4
+ description: Interview the user relentlessly about a plan or design until reaching shared understanding, resolving each branch of the decision tree. Use when user wants to stress-test a plan, get grilled on their design, or mentions "grill me".
5
+ ---
6
+
7
+ Interview me relentlessly about every aspect of this plan until we reach a shared understanding. Walk down each branch of the design tree, resolving dependencies between decisions one-by-one. For each question, provide your recommended answer.
8
+
9
+ Ask the questions one at a time.
10
+
11
+ If a *fact* can be found by exploring the codebase, look it up rather than asking me. The *decisions*, though, are mine — put each one to me and wait for my answer.
12
+
13
+ Do not enact the plan until I confirm we have reached a shared understanding.
14
+
15
+ ## Related skills
16
+
17
+ **Codebase with `CONTEXT.md`/ADRs present?** → use `grill-with-docs` instead of this skill — same grill, additionally sharpened against the existing domain model, maintains `CONTEXT.md`/ADRs inline.
18
+
19
+ <!-- mirror-xform:start codex-escalation -->
20
+ **High stakes / hard to reverse** (auth, schema, concurrency, migrations, payments)? → additionally `grill-me-codex` — the same grill plus a cross-model review by Codex afterward (Claude Code surface).
21
+ <!-- mirror-xform:end -->
22
+
23
+ ## Coherence is the default — the grill locks only the deltas
24
+
25
+ A feature that builds on existing features inherits the existing building blocks by default, across **every** layer: the UI renders the same components, the backend calls the same services and calculations, data flows through the same paths, conventions carry over. Do not interview the user about how such a feature should look or behave where an existing counterpart exists — that is already decided. Lock only:
26
+
27
+ 1. **The deltas:** what is intentionally excluded, restricted, or different (navigation, filters, actions, person data, write access, …). Every delta is an explicit decision with a reason.
28
+ 2. **The consumer walk-through:** who consumes the result and what they see/get — walked through from the consumer's side, not the owner's.
29
+
30
+ A parallel rebuild of something that exists — a simplified UI stand-in, a re-implemented calculation, a second data path — is a defect to surface, never a silent shortcut. (Incident: a share feature shipped rebuilt, simplified renderers across 6 pages because "looks like the page minus chrome" was treated as open design space instead of the default; half the implementation was replaced.)
31
+
32
+ ## Cross-cutting fork — pattern vs. concept (before plan-lock)
33
+
34
+ Is the change **cross-cutting** (a new pattern OR a new data structure/domain distinction, touching ≥3 places, OR "everywhere / distinguish X of Y / migrate")? Then classify it **during the grill** — don't defer it to the post-spec self-critique (otherwise Codex reviews a plan without it):
35
+
36
+ - **Pattern** (old→new, e.g. TanStack Query replacing manual loading): the denominator is **grep-able** → put in the plan: a census of all old spots + a `*.guard.test.ts` that stays red as long as old spots exist outside a shrinking allowlist.
37
+ - **Concept** (a new distinction, e.g. Project↔Campaign): `grep` cannot find the **absence** of a concept → put in the plan: a **code-derived** surface list (routes/pages/exports/reports) × a **domain verdict per surface** (counts / N/A / open); "counts" rows become tracked items.
38
+
39
+ Never claim "complete" from plan/memory — count the denominator fresh, report `X of Y`. Substance, trigger threshold + guard template → the project convention file `docs/conventions/spec-completeness.md` (if present), §Cross-cutting fork.
40
+
41
+ ## Plan-lock — writing PLAN.md
42
+
43
+ Once all decisions are made (plan locked, before sign-off/handoff) and the session runs in a **worktree** → write the locked plan as `PLAN.md` to the worktree root (gitignored since, doesn't travel over git — consistent with CLAUDE.md "plan inside the worktree"). This way the locked plan survives a session cut and `to-prd` finds its default source. Continuing same-session work **without** a worktree stays allowed (conversation = source); but for a deliberate **session cut** before `to-prd`, `PLAN.md` is mandatory. (The `-codex` variant already writes `PLAN.md` anyway.)
44
+
45
+ ## Re-grill reconcile — execute-ready (Wave 26)
46
+
47
+ Applies when you **re-grill an issue that already exists** (a leaf of a grilled epic, or a child of an anchor) — the most common re-grill path, since campaign HITL slices route via `/grill-me → /tdd`. Goal: the rooted sub-graph comes out **execute-ready**, never silent drift. (grill-me has no docs layer — CONTEXT.md/ADR don't apply; core rules identical to grill-with-docs §"Re-Grill Reconcile".)
48
+
49
+ 1. **Read parent-anchor decisions FIRST** — fetch the anchor body + its PRD/key decisions, take the seam decision **from there**. Do not re-derive the architecture from the leaf (lesson: a leaf whose central decision was never read got re-litigated through question rounds). For an atomic leaf, its own body/PRD is the reference.
50
+ 2. **Check the leaf for internal contradiction**: a body that contradicts itself ("no new UI" + "build a name field") or the anchor decision → **no execute**. Likewise a leaf that says *"final cut depends on #X"* via `<!-- final-cut-depends-on: #X -->` where **#X is closed** without resolving the cut.
51
+ 3. **On drift/contradiction:** update the affected issue(s), re-stamp `plan_revision`, set the correct bucket. Internal contradiction → set the leaf to **HITL**: strip `ready-for-agent` via `python3 scripts/board-sync.py add --bucket hitl --issue <n>` (the helper stays the owner of the workflow labels — no bare `gh issue edit --add-label`), add the `headings.vorBau` heading (board profile `docs/agents/board-sync.md`; <project> currently `## Vor Bau zu klären`). The drift-guard then blocks the build handoff via `target_buildable` — the contradiction flows through existing machinery, no heuristic in the hook.
52
+ 4. **Audit, non-blocking:** `python3 scripts/execute-ready-check.py --issue <n> --mode audit` → a visible two-liner. The **blocking** net is the drift-guard at handoff (`.claude/hooks/drift-guard.py`).
53
+
54
+ **Markers** (HTML comments, grep-able): `<!-- guard-ack: #<n> r<N> reason:<text> by-user -->`, `<!-- final-cut-depends-on: #<n> -->`, `<!-- handoff-intent: build|grill -->`, `<!-- guard-legacy -->`. Canonical table of all markers: module docstring of `scripts/execute-ready-check.py`.
@@ -0,0 +1,29 @@
1
+ # Third-Party Notices
2
+
3
+ This skill is adapted from **Matt Pocock's skills**
4
+ (https://github.com/mattpocock/skills), `skills/productivity/grill-me` @ d574778, Copyright (c) 2026 Matt Pocock,
5
+ used under the MIT License. Locally adapted (fork-and-own); see PROVENANCE.md.
6
+
7
+ ```
8
+ MIT License
9
+
10
+ Copyright (c) 2026 Matt Pocock
11
+
12
+ Permission is hereby granted, free of charge, to any person obtaining a copy
13
+ of this software and associated documentation files (the "Software"), to deal
14
+ in the Software without restriction, including without limitation the rights
15
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
+ copies of the Software, and to permit persons to whom the Software is
17
+ furnished to do so, subject to the following conditions:
18
+
19
+ The above copyright notice and this permission notice shall be included in all
20
+ copies or substantial portions of the Software.
21
+
22
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
+ SOFTWARE.
29
+ ```
@@ -0,0 +1,158 @@
1
+ ---
2
+ name: grill-me-codex
3
+ description: Two-act plan hardening. ACT 1 (you ↔ Claude) — Claude interviews you relentlessly about a plan or design, one question at a time, recommending an answer for each and exploring the codebase when it can answer itself, until every branch of the decision tree is resolved. ACT 2 (Claude ↔ Codex) — Claude writes the locked plan to PLAN.md and OpenAI Codex adversarially reviews it in a read-only sandbox (VERDICT:APPROVED/REVISE), Claude revises and re-submits to the SAME Codex session until APPROVED or a MAX_ROUNDS cap, then you sign off before any code. Use when the user says "/grill-me-codex", "grill me then have codex review", "grill me and stress-test the plan", "interview me about this plan then get a second model on it", or is about to build something high-stakes (auth, schema, concurrency, migrations, payments) and wants both alignment AND a cross-model sanity check before implementation. Builds on Matt Pocock's grill-me (MIT). For the docs-aware variant use /grill-with-docs-codex; if you already have a plan and want only the Codex review use /codex-review. NOT for reviewing already-written code (use /codex:review) and NOT for trivial changes.
4
+ ---
5
+
6
+ # Grill-Me-Codex — Get Grilled, Then Get Reviewed
7
+
8
+ Two acts, two different jobs:
9
+
10
+ - **Act 1 fixes the #1 failure mode: building the wrong thing.** Claude interrogates *you* until intent is locked — no guessing at ambiguity. (This act is Matt Pocock's `grill-me`, used under MIT — see `THIRD-PARTY-NOTICES.md`.)
11
+ - **Act 2 fixes the #2 failure mode: a plan that sounds right but breaks.** A *different model* (Codex) adversarially attacks the locked plan. Cross-model = no echo chamber.
12
+
13
+ You enter at two points only: answering the grill, and signing off the converged plan. Codex is read-only the whole time and never touches a file.
14
+
15
+ ---
16
+
17
+ ## ACT 1 — GRILL (you ↔ Claude)
18
+
19
+ > Interview me relentlessly about every aspect of this plan until we reach a shared understanding. Walk down each branch of the design tree, resolving dependencies between decisions one-by-one. For each question, provide your recommended answer.
20
+ >
21
+ > Ask the questions one at a time, waiting for my answer before continuing. Asking multiple questions at once is bewildering.
22
+ >
23
+ > If a *fact* can be found by exploring the codebase, look it up rather than asking me. The *decisions*, though, are mine — put each one to me and wait for my answer.
24
+ >
25
+ > Do not write `PLAN.md` or proceed to Act 2 until I confirm we have reached a shared understanding.
26
+ >
27
+ > **Coherence default:** a feature that builds on existing features inherits the existing building blocks across every layer (UI components, backend services/calculations, data paths, conventions). The grill locks only the deltas (what is intentionally excluded/restricted/different, each with a reason) and the consumer walk-through (what the receiving user sees/gets). A parallel rebuild of something that exists is a defect, not a design option.
28
+
29
+ ### Cross-cutting fork — pattern vs. concept (before plan-lock)
30
+
31
+ Is the change **cross-cutting** (a new pattern OR a new data structure/domain distinction, touching ≥3 places, OR "everywhere / distinguish X of Y / migrate")? Then classify it **during the grill** — don't defer it to the post-spec self-critique; the classification becomes part of the `PLAN.md` that Codex reviews in Act 2:
32
+
33
+ - **Pattern** (old→new, e.g. TanStack Query replacing manual loading): the denominator is **grep-able** → put in the plan: a census of all old spots + a `*.guard.test.ts` that stays red as long as old spots exist outside a shrinking allowlist.
34
+ - **Concept** (a new distinction, e.g. Project↔Campaign): `grep` cannot find the **absence** of a concept → put in the plan: a **code-derived** surface list (routes/pages/exports/reports) × a **domain verdict per surface** (counts / N/A / open); "counts" rows become tracked items.
35
+
36
+ Never claim "complete" from plan/memory — count the denominator fresh, report `X of Y`. Substance, trigger threshold + guard template → the project convention file `docs/conventions/spec-completeness.md` (if present), §Cross-cutting fork.
37
+
38
+ When the decision tree is resolved and we're aligned, **write the agreed plan to `PLAN.md`** in this structure, then move to Act 2:
39
+
40
+ > **Where to write it:** `PLAN.md` + `PLAN-REVIEW-LOG.md` are per-session scratch — write them in the working directory the implementing session will actually use, and run Codex from there (`-C <dir>` on the round-1 `exec`; `exec resume` rejects both `-C` and `-s`, so run resume from that cwd and force read-only via `-c sandbox_mode="read-only"`). A project may gitignore these files, so don't rely on git to carry them across checkouts/worktrees. In worktree-based repos, create the issue worktree BEFORE this write and plan inside it.
41
+
42
+ ```markdown
43
+ # Plan: <task>
44
+ _Locked via grill — by Claude + <user>_
45
+
46
+ ## Goal
47
+ <one paragraph — reflects what the grilling actually settled>
48
+
49
+ ## Approach
50
+ <numbered, concrete steps>
51
+
52
+ ## Key decisions & tradeoffs
53
+ <the contestable choices the grill resolved — name them so Codex has something to bite>
54
+
55
+ ## Risks / open questions
56
+ <anything still genuinely open>
57
+
58
+ ## Out of scope
59
+ <bounds the grill established>
60
+ ```
61
+
62
+ Initialize `PLAN-REVIEW-LOG.md`:
63
+ ```markdown
64
+ # Plan Review Log: <task>
65
+ Act 1 (grill) complete — plan locked with the user. MAX_ROUNDS=<n>.
66
+ ```
67
+
68
+ ---
69
+
70
+ ## ACT 2 — REVIEW (Claude ↔ Codex)
71
+
72
+ Now hand the locked plan to Codex for adversarial review. Same engine, mechanics verified end-to-end (2026-06-04).
73
+
74
+ ### Prerequisites (verify once, fast)
75
+ - `codex --version` ≥ 0.130 (older CLIs error on the default `gpt-5.5` model).
76
+ - Codex authenticated (prior `codex login`; ChatGPT account is fine). On auth/model error, surface it — don't silently retry.
77
+ - Do NOT pin `-m`. Use the config default. Pinning `gpt-5.x-codex` variants 400s on ChatGPT-account auth.
78
+ - **Echo the active model before Round 1** so the user can confirm: read the `model` line from `~/.codex/config.toml` (absent = "CLI default"); state it alongside the resolved tunables. If the user objects, stop before burning a round.
79
+
80
+ ### Tunables (read from args, else default)
81
+ | Var | Default | Meaning |
82
+ |-----|---------|---------|
83
+ | `MAX_ROUNDS` | `5` | Hard cap on review rounds. The loop ALWAYS terminates here. |
84
+ | `PLAN_FILE` | `PLAN.md` | The plan Act 1 produced. |
85
+ | `LOG_FILE` | `PLAN-REVIEW-LOG.md` | Append-only argument transcript. The artifact. |
86
+
87
+ If invoked with e.g. `rounds=3`, use that for `MAX_ROUNDS`. Echo resolved values before starting.
88
+
89
+ ### The review prompt (sent each round)
90
+ > You are an adversarial reviewer for an implementation plan. Be skeptical and specific — your job is to find what breaks, not to be agreeable. Read the plan at `PLAN.md` and any repo files you need (you are read-only). Identify concrete flaws: security holes, race conditions, missing edge cases, schema conflicts, wrong assumptions, observability gaps, simpler alternatives. For each, give a one-line fix. Do NOT modify any files. End your reply with EXACTLY one line: `VERDICT: APPROVED` if the plan is sound enough to implement, or `VERDICT: REVISE` if it still has material problems.
91
+
92
+ ### Round 1 — fresh session (capture `thread_id`)
93
+ Stream `--json` to a FILE, never pipe to `grep` — `codex exec --json | grep` deadlocks on codex-cli ≥0.137. **Always launch with `< /dev/null`** — a backgrounded `codex exec … &` without it blocks on stdin and sits at **0 CPU / 0 bytes** forever (the #1 cause of the "silent hang"; verified 2026-06-09). Background it so a **90s liveness probe** still catches a genuine sandbox deadlock.
94
+ ```bash
95
+ CODEX_TMP="/tmp/codex-$(pwd | sha1sum | cut -c1-8)"; mkdir -p "$CODEX_TMP" # run-unique per worktree cwd: STABLE across round-1+resume turns, collision-free under parallel sessions
96
+ codex exec -s read-only --json -o $CODEX_TMP/verdict.txt "$(cat REVIEW_PROMPT)" \
97
+ < /dev/null > $CODEX_TMP/r1.jsonl 2>/dev/null &
98
+ CODEX_PID=$!
99
+ sleep 90 # liveness probe (REQUIRED)
100
+ if kill -0 "$CODEX_PID" 2>/dev/null; then
101
+ CPU=$(ps -o time= -p "$CODEX_PID" 2>/dev/null | tr -dc '0-9:') # cumulative CPU, e.g. 00:00:00
102
+ BYTES=$(wc -c < $CODEX_TMP/r1.jsonl 2>/dev/null || echo 0)
103
+ if [ "${CPU:-00:00:00}" = "00:00:00" ] && [ "${BYTES:-0}" -eq 0 ]; then
104
+ kill -9 "$CODEX_PID" 2>/dev/null; echo "CODEX-HUNG" # alive + 0 CPU + 0 bytes = blocked, NOT working
105
+ fi
106
+ fi
107
+ wait "$CODEX_PID" 2>/dev/null
108
+ THREAD_ID=$(grep -o '"thread_id":"[^"]*"' $CODEX_TMP/r1.jsonl | head -1 | cut -d'"' -f4)
109
+ ```
110
+ - **`CODEX-HUNG` printed** (alive + 0 CPU + 0 bytes at 90s) → **first suspect the stdin block**: confirm the launch has `< /dev/null` and retry. That fixes it in nearly every case. **NEVER `pgrep`/`kill` codex procs to "clear contention"** — that murders the user's live, unrelated codex sessions and does **not** fix a stdin hang. Only if `< /dev/null` is present and it still hangs (genuine sandbox deadlock) → **STOP Act 2**: tell the user, offer to sign off without the cross-model review or retry once. Don't touch other codex processes.
111
+ - **Healthy:** CPU climbs past `00:00:00` and/or `$CODEX_TMP/r1.jsonl` grows; `THREAD_ID` parses; critique lands in `$CODEX_TMP/verdict.txt`. `2>/dev/null` hides cosmetic MCP/auth noise.
112
+ - **Clean finish but no verdict file + no `THREAD_ID`** = auth/model failure → stop, tell the user.
113
+
114
+ ### Rounds 2..MAX — resume the SAME session (Codex remembers its prior critiques)
115
+ ```bash
116
+ # resume REJECTS -s. Force read-only via -c sandbox_mode, or Codex inherits
117
+ # config.toml (possibly danger-full-access) and could WRITE files. This is the
118
+ # single most important safety line in the skill — verified 2026-06-04.
119
+ CODEX_TMP="/tmp/codex-$(pwd | sha1sum | cut -c1-8)"; mkdir -p "$CODEX_TMP" # run-unique per worktree cwd: STABLE across round-1+resume turns, collision-free under parallel sessions
120
+ codex exec resume "$THREAD_ID" -c sandbox_mode="read-only" --json \
121
+ -o $CODEX_TMP/verdict.txt \
122
+ "I revised the plan. Re-review PLAN.md — check whether your prior findings are addressed and flag anything new. End with VERDICT: APPROVED or VERDICT: REVISE." \
123
+ < /dev/null 2>/dev/null >/dev/null &
124
+ ```
125
+ Wrap resume in the **same 90s liveness probe** (background + `wait`). Resume discards the `--json` stream, so probe on the verdict file: `BYTES=$(wc -c < $CODEX_TMP/verdict.txt)` plus the `CPU` check — `00:00:00` CPU + empty verdict at 90s → kill, treat as `CODEX-HUNG`, same STOP path as round 1. Both `codex exec` and `codex exec resume` support `--json` and `-o/--output-last-message`.
126
+
127
+ **Overall ceiling (both rounds):** the 90s probe catches silent hangs, not long stuck runs. Cap every `codex exec` / `codex exec resume` at **10 minutes** — via Claude Code's Bash tool pass `timeout: 600000` on the tool call (the default 2-minute tool timeout would kill real reviews mid-run); in a plain shell prefix `timeout 600` (macOS: `gtimeout 600` via coreutils). If the ceiling trips, treat it as a failed round: stop and tell the user rather than retrying blind.
128
+
129
+ ### Each round, after Codex returns
130
+ 1. Read `$CODEX_TMP/verdict.txt`; append to `LOG_FILE`: `## Round <n> — Codex` + the full critique.
131
+ 2. Grep the last line for the verdict:
132
+ - `VERDICT: APPROVED` → break to Resolution (converged).
133
+ - `VERDICT: REVISE` → Claude decides **what's actually worth acting on** (Claude is final arbiter — Codex advises, doesn't command). Revise `PLAN_FILE`. Append `### Claude's response` to `LOG_FILE`: what changed, what was rejected, why. Increment round.
134
+ 3. If round > `MAX_ROUNDS` → break to Resolution (deadlock).
135
+
136
+ ### Resolution (you sign off — final gate)
137
+ - **APPROVED:** present the final `PLAN_FILE`, a 3-bullet summary of what the two acts improved, and the round count. Ask: *"Grilled + survived N rounds of Codex. Implement it now — Codex builds it (`/codex-build`), Claude builds it, or stop here?"* Code only on a yes. **No code is written during either act.**
138
+ - **MAX_ROUNDS hit without APPROVED (deadlock):** do NOT fake convergence. List each unresolved point + Claude's counter-position; hand it to the user to break the tie. A flagged disagreement beats a false "approved."
139
+
140
+ ### ACT 3 (optional) — BUILD (Codex ↔ Claude, roles flipped)
141
+
142
+ If the user picks Codex: invoke the `codex-build` skill with `SPEC_FILE=PLAN.md` and the same `LOG_FILE` — it appends `## Act 3 — Build` to the log, so one artifact tells the whole story (grilled → reviewed → built → verified). Roles flip: Codex writes the code in a bounded workspace-write sandbox, Claude reviews the diff and runs the proof. If the user picks Claude, implement directly as usual.
143
+
144
+ ---
145
+
146
+ ## Hard rules
147
+ - Act 1 always precedes Act 2 — don't write `PLAN.md` until the grill has actually resolved the decision tree with the user.
148
+ - Codex is read-only EVERY round — `-s read-only` first call, `-c sandbox_mode="read-only"` on every resume (resume has no `-s`). It never writes.
149
+ - The loop ALWAYS terminates at `MAX_ROUNDS`.
150
+ - Claude is final arbiter on every REVISE — incorporate good critiques, reject bad ones *with a logged reason*. Don't cave to everything (defeats the cross-model check) and don't ignore it (defeats the point).
151
+ - Code only after the user's final sign-off.
152
+ - `LOG_FILE` is the deliverable — keep the whole argument.
153
+
154
+ ## What NOT to do
155
+ - Don't review already-written code — that's `/codex:review`.
156
+ - Don't pin a `-codex` model variant on ChatGPT-account auth — it 400s.
157
+ - Don't let Codex edit files. Read-only, always.
158
+ - Don't skip Act 1 — the grill is half the value.
@@ -0,0 +1,32 @@
1
+ # Third-Party Notices
2
+
3
+ ## grill-me (Act 1)
4
+
5
+ Act 1 of this skill ("GRILL") is adapted from the **grill-me** skill by **Matt Pocock**,
6
+ from https://github.com/mattpocock/skills, used under the MIT License.
7
+
8
+ Act 2 ("REVIEW" — the Codex adversarial loop) is original work added on top.
9
+
10
+ ```
11
+ MIT License
12
+
13
+ Copyright (c) 2026 Matt Pocock
14
+
15
+ Permission is hereby granted, free of charge, to any person obtaining a copy
16
+ of this software and associated documentation files (the "Software"), to deal
17
+ in the Software without restriction, including without limitation the rights
18
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
19
+ copies of the Software, and to permit persons to whom the Software is
20
+ furnished to do so, subject to the following conditions:
21
+
22
+ The above copyright notice and this permission notice shall be included in all
23
+ copies or substantial portions of the Software.
24
+
25
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
26
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
27
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
28
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
29
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
30
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31
+ SOFTWARE.
32
+ ```