claude-dev-env 1.93.1 → 1.95.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 (262) hide show
  1. package/_shared/advisor/CLAUDE.md +2 -2
  2. package/_shared/advisor/advisor-protocol.md +35 -27
  3. package/_shared/advisor/scripts/config/advisor_scripts_constants/model_tier_run_validator_constants.py +3 -2
  4. package/_shared/advisor/scripts/model_tier_run_validator.py +23 -15
  5. package/_shared/advisor/scripts/tests/test_model_tier_run_validator.py +81 -17
  6. package/_shared/pr-loop/CLAUDE.md +1 -0
  7. package/_shared/pr-loop/audit-contract.md +1 -1
  8. package/_shared/pr-loop/gh-payloads.md +3 -3
  9. package/_shared/pr-loop/post-audit-thread-contract.md +51 -0
  10. package/_shared/pr-loop/scripts/README.md +2 -2
  11. package/_shared/pr-loop/scripts/fix_hookspath.py +47 -12
  12. package/_shared/pr-loop/scripts/tests/test_code_rules_gate.py +0 -69
  13. package/_shared/pr-loop/scripts/tests/test_fix_hookspath.py +497 -374
  14. package/_shared/pr-loop/state-schema.md +3 -22
  15. package/bin/CLAUDE.md +11 -2
  16. package/bin/ever-shipped-skills.mjs +70 -0
  17. package/bin/install.mjs +138 -13
  18. package/bin/install.prune.test.mjs +457 -0
  19. package/bin/install.test.mjs +10 -4
  20. package/docs/CODE_RULES.md +1 -1
  21. package/hooks/blocking/CLAUDE.md +2 -0
  22. package/hooks/blocking/code_rules_enforcer.py +4 -0
  23. package/hooks/blocking/code_rules_shared.py +82 -0
  24. package/hooks/blocking/code_rules_test_layout.py +9 -3
  25. package/hooks/blocking/pii_commit_command.py +398 -0
  26. package/hooks/blocking/pii_payload_scan.py +133 -0
  27. package/hooks/blocking/pii_prevention_blocker.py +151 -449
  28. package/hooks/blocking/plain_language_blocker.py +138 -4
  29. package/hooks/blocking/sensitive_file_protector.py +114 -48
  30. package/hooks/blocking/tdd_enforcer.py +9 -2
  31. package/hooks/blocking/test_code_rules_enforcer_scratchpad.py +105 -0
  32. package/hooks/blocking/test_code_rules_shared.py +181 -0
  33. package/hooks/blocking/test_pii_prevention_blocker.py +299 -0
  34. package/hooks/blocking/test_plain_language_blocker_allowlist.py +184 -0
  35. package/hooks/blocking/test_sensitive_file_protector.py +185 -0
  36. package/hooks/blocking/test_tdd_enforcer_scratchpad.py +105 -0
  37. package/hooks/blocking/test_verdict_directory_write_blocker.py +42 -7
  38. package/hooks/hooks_constants/CLAUDE.md +4 -2
  39. package/hooks/hooks_constants/code_rules_path_utils_constants.py +0 -2
  40. package/hooks/hooks_constants/harness_scratchpad_constants.py +17 -0
  41. package/hooks/hooks_constants/local_identity.py +65 -15
  42. package/hooks/hooks_constants/pii_prevention_constants.py +16 -0
  43. package/hooks/hooks_constants/plain_language_blocker_constants.py +5 -0
  44. package/hooks/hooks_constants/pr_description_enforcer_constants.py +1 -1
  45. package/hooks/hooks_constants/sensitive_file_protector_constants.py +42 -0
  46. package/hooks/hooks_constants/test_local_identity.py +68 -0
  47. package/hooks/pyproject.toml +75 -4
  48. package/hooks/validators/CLAUDE.md +1 -1
  49. package/hooks/validators/README.md +2 -0
  50. package/hooks/validators/python_style_checks.py +114 -136
  51. package/hooks/validators/python_style_helpers.py +95 -0
  52. package/hooks/validators/test_python_style_checks.py +0 -164
  53. package/hooks/validators/test_python_style_checks_decorator_gap.py +119 -0
  54. package/hooks/validators/test_python_style_fixes.py +251 -0
  55. package/hooks/validators/test_python_style_helpers.py +125 -0
  56. package/package.json +1 -1
  57. package/rules/CLAUDE.md +1 -0
  58. package/rules/anti-corollary-tests.md +69 -0
  59. package/rules/bdd.md +1 -3
  60. package/rules/code-reviews.md +1 -1
  61. package/rules/gh-paginate.md +1 -1
  62. package/rules/plain-language.md +2 -0
  63. package/scripts/CLAUDE.md +10 -1
  64. package/scripts/Get-SessionAccount.ps1 +210 -0
  65. package/scripts/tests/CLAUDE.md +15 -1
  66. package/scripts/tests/Get-SessionAccount.Tests.ps1 +350 -0
  67. package/skills/CLAUDE.md +6 -27
  68. package/skills/anthropic-plan/SKILL.md +1 -13
  69. package/skills/autoconverge/CLAUDE.md +5 -2
  70. package/skills/autoconverge/SKILL.md +112 -387
  71. package/skills/autoconverge/reference/CLAUDE.md +4 -1
  72. package/skills/autoconverge/reference/closing-report.md +9 -2
  73. package/skills/autoconverge/reference/convergence.md +26 -22
  74. package/skills/autoconverge/reference/headless-safety.md +44 -0
  75. package/skills/autoconverge/reference/multi-pr.md +88 -0
  76. package/skills/autoconverge/reference/self-closing-loop.md +84 -0
  77. package/skills/autoconverge/reference/stop-conditions.md +21 -13
  78. package/skills/autoconverge/workflow/converge.clean-audit.test.mjs +87 -27
  79. package/skills/autoconverge/workflow/converge.contract.test.mjs +40 -10
  80. package/skills/autoconverge/workflow/converge.copilot-gate.test.mjs +179 -47
  81. package/skills/autoconverge/workflow/converge.fix-progress.test.mjs +1 -1
  82. package/skills/autoconverge/workflow/converge.mjs +286 -96
  83. package/skills/bugteam/CLAUDE.md +1 -1
  84. package/skills/bugteam/CONSTRAINTS.md +3 -3
  85. package/skills/bugteam/PROMPTS.md +8 -19
  86. package/skills/bugteam/SKILL.md +13 -14
  87. package/skills/bugteam/reference/CLAUDE.md +1 -1
  88. package/skills/bugteam/reference/README.md +2 -3
  89. package/skills/bugteam/reference/audit-and-teammates.md +2 -2
  90. package/skills/bugteam/reference/copilot-gap-analysis.md +2 -0
  91. package/skills/bugteam/reference/github-pr-reviews.md +56 -38
  92. package/skills/bugteam/reference/team-setup.md +11 -11
  93. package/skills/bugteam/scripts/CLAUDE.md +6 -6
  94. package/skills/bugteam/scripts/README.md +20 -8
  95. package/skills/bugteam/scripts/bugteam_code_rules_gate.py +13 -1463
  96. package/skills/bugteam/scripts/bugteam_fix_hookspath.py +23 -358
  97. package/skills/bugteam/scripts/bugteam_preflight.py +13 -315
  98. package/skills/bugteam/scripts/bugteam_scripts_constants/CLAUDE.md +2 -3
  99. package/skills/bugteam/scripts/test_bugteam_code_rules_gate.py +34 -1053
  100. package/skills/bugteam/scripts/test_bugteam_fix_hookspath.py +30 -347
  101. package/skills/bugteam/scripts/test_bugteam_preflight.py +30 -305
  102. package/skills/closeout/SKILL.md +153 -0
  103. package/skills/closeout/reference/handoff-prompt-template.md +72 -0
  104. package/skills/closeout/reference/issue-body-templates.md +108 -0
  105. package/skills/closeout/reference/pii-redaction-checklist.md +36 -0
  106. package/skills/copilot-finding-triage/SKILL.md +80 -28
  107. package/skills/copilot-finding-triage/reference/tier-rubric.md +70 -11
  108. package/skills/copilot-finding-triage/templates/notification.md +8 -3
  109. package/skills/everything-search/SKILL.md +1 -2
  110. package/skills/grokify/SKILL.md +58 -0
  111. package/skills/grokify/templates/handoff-template.md +92 -0
  112. package/skills/orchestrator/SKILL.md +35 -25
  113. package/skills/orchestrator-refresh/SKILL.md +15 -11
  114. package/skills/pr-converge/CLAUDE.md +1 -1
  115. package/skills/pr-converge/SKILL.md +132 -233
  116. package/skills/pr-converge/reference/convergence-gates.md +102 -66
  117. package/skills/pr-converge/reference/examples.md +37 -25
  118. package/skills/pr-converge/reference/fix-protocol.md +7 -7
  119. package/skills/pr-converge/reference/multi-pr-orchestration.md +10 -4
  120. package/skills/pr-converge/reference/per-tick.md +64 -41
  121. package/skills/pr-converge/reference/state-schema.md +27 -2
  122. package/skills/pr-converge/scripts/CLAUDE.md +8 -0
  123. package/skills/pr-converge/scripts/README.md +4 -3
  124. package/skills/pr-converge/scripts/_pr_converge_path_setup.py +23 -0
  125. package/skills/pr-converge/scripts/check_convergence.py +189 -645
  126. package/skills/pr-converge/scripts/check_convergence_gates.py +235 -0
  127. package/skills/pr-converge/scripts/check_convergence_thread_gates.py +219 -0
  128. package/skills/pr-converge/scripts/conftest.py +8 -0
  129. package/skills/pr-converge/scripts/pr_converge_scripts_constants/CLAUDE.md +1 -0
  130. package/skills/pr-converge/scripts/pr_converge_scripts_constants/convergence_gate_constants.py +36 -0
  131. package/skills/pr-converge/scripts/test__pr_converge_path_setup.py +26 -0
  132. package/skills/pr-converge/scripts/test_check_convergence.py +73 -228
  133. package/skills/pr-converge/scripts/test_check_convergence_contract.py +321 -0
  134. package/skills/pr-converge/scripts/test_check_convergence_gates.py +68 -0
  135. package/skills/pr-converge/scripts/test_check_convergence_thread_gates.py +75 -0
  136. package/skills/pr-fix-protocol/SKILL.md +20 -20
  137. package/skills/privacy-hygiene/SKILL.md +4 -3
  138. package/skills/reviewer-gates/SKILL.md +26 -8
  139. package/skills/session-log/SKILL.md +11 -12
  140. package/skills/session-tidy/SKILL.md +40 -30
  141. package/skills/skill-builder/CLAUDE.md +13 -10
  142. package/skills/skill-builder/SKILL.md +31 -31
  143. package/skills/skill-builder/references/CLAUDE.md +10 -6
  144. package/skills/skill-builder/references/delegation-map.md +13 -4
  145. package/skills/skill-builder/references/description-field.md +113 -0
  146. package/skills/skill-builder/references/self-audit-checklist.md +21 -4
  147. package/skills/skill-builder/references/skill-modularity.md +113 -0
  148. package/skills/skill-builder/references/skill-types.md +4 -0
  149. package/skills/skill-builder/templates/CLAUDE.md +4 -4
  150. package/skills/skill-builder/templates/gap-analysis.md +25 -1
  151. package/skills/skill-builder/workflows/CLAUDE.md +6 -4
  152. package/skills/skill-builder/workflows/improve-skill.md +17 -16
  153. package/skills/skill-builder/workflows/new-skill.md +34 -10
  154. package/skills/skill-builder/workflows/polish-skill.md +59 -43
  155. package/skills/team-advisor/SKILL.md +15 -11
  156. package/skills/usage-pause/SKILL.md +10 -14
  157. package/system-prompts/software-engineer.xml +7 -6
  158. package/hooks/validators/test_verify_paths.py +0 -32
  159. package/hooks/validators/verify_paths.py +0 -57
  160. package/skills/bdd-protocol/CLAUDE.md +0 -26
  161. package/skills/bdd-protocol/SKILL.md +0 -30
  162. package/skills/bdd-protocol/references/CLAUDE.md +0 -10
  163. package/skills/bdd-protocol/references/anti-patterns.md +0 -26
  164. package/skills/bdd-protocol/references/example-mapping.md +0 -23
  165. package/skills/bg-agent/CLAUDE.md +0 -17
  166. package/skills/bg-agent/SKILL.md +0 -69
  167. package/skills/bugteam/scripts/bugteam_scripts_constants/bugteam_code_rules_gate_constants.py +0 -55
  168. package/skills/bugteam/scripts/bugteam_scripts_constants/bugteam_fix_hookspath_constants.py +0 -26
  169. package/skills/bugteam/scripts/bugteam_scripts_constants/bugteam_preflight_constants.py +0 -35
  170. package/skills/caveman/CLAUDE.md +0 -15
  171. package/skills/caveman/SKILL.md +0 -38
  172. package/skills/code/CLAUDE.md +0 -17
  173. package/skills/code/SKILL.md +0 -178
  174. package/skills/deep-research/CLAUDE.md +0 -17
  175. package/skills/deep-research/SKILL.md +0 -80
  176. package/skills/findbugs/CLAUDE.md +0 -20
  177. package/skills/findbugs/SKILL.md +0 -241
  178. package/skills/fixbugs/CLAUDE.md +0 -19
  179. package/skills/fixbugs/SKILL.md +0 -142
  180. package/skills/gh-paginate/CLAUDE.md +0 -18
  181. package/skills/gh-paginate/SKILL.md +0 -84
  182. package/skills/gotcha/CLAUDE.md +0 -33
  183. package/skills/gotcha/SKILL.md +0 -73
  184. package/skills/implement/CLAUDE.md +0 -27
  185. package/skills/implement/SKILL.md +0 -66
  186. package/skills/implement/scripts/CLAUDE.md +0 -22
  187. package/skills/implement/scripts/append_note.py +0 -133
  188. package/skills/implement/scripts/implement_scripts_constants/CLAUDE.md +0 -22
  189. package/skills/implement/scripts/implement_scripts_constants/__init__.py +0 -0
  190. package/skills/implement/scripts/implement_scripts_constants/notes_constants.py +0 -12
  191. package/skills/implement/scripts/test_append_note.py +0 -191
  192. package/skills/log-audit/CLAUDE.md +0 -20
  193. package/skills/log-audit/SKILL.md +0 -66
  194. package/skills/log-audit/reference/CLAUDE.md +0 -9
  195. package/skills/log-audit/reference/charter.md +0 -52
  196. package/skills/log-audit/scripts/CLAUDE.md +0 -27
  197. package/skills/log-audit/scripts/cluster_recurrences.py +0 -261
  198. package/skills/log-audit/scripts/collect_log_window.py +0 -199
  199. package/skills/log-audit/scripts/log_audit_constants/CLAUDE.md +0 -12
  200. package/skills/log-audit/scripts/log_audit_constants/__init__.py +0 -0
  201. package/skills/log-audit/scripts/log_audit_constants/cluster_recurrences_constants.py +0 -23
  202. package/skills/log-audit/scripts/log_audit_constants/collect_log_window_constants.py +0 -24
  203. package/skills/log-audit/scripts/log_audit_constants/mine_copilot_findings_constants.py +0 -49
  204. package/skills/log-audit/scripts/mine_copilot_findings.py +0 -302
  205. package/skills/log-audit/scripts/test_cluster_recurrences.py +0 -160
  206. package/skills/log-audit/scripts/test_collect_log_window.py +0 -111
  207. package/skills/log-audit/scripts/test_mine_copilot_findings.py +0 -126
  208. package/skills/logifix/CLAUDE.md +0 -36
  209. package/skills/logifix/SKILL.md +0 -69
  210. package/skills/logifix/scripts/CLAUDE.md +0 -16
  211. package/skills/logifix/scripts/logifix.ps1 +0 -205
  212. package/skills/monitor-open-prs/CLAUDE.md +0 -34
  213. package/skills/monitor-open-prs/SKILL.md +0 -88
  214. package/skills/monitor-open-prs/scripts/CLAUDE.md +0 -17
  215. package/skills/monitor-open-prs/scripts/discover_open_prs.py +0 -69
  216. package/skills/monitor-open-prs/scripts/test_discover_open_prs.py +0 -149
  217. package/skills/monitor-open-prs/test_skill_contract.py +0 -27
  218. package/skills/post-audit-findings/SKILL.md +0 -80
  219. package/skills/pr-consistency-audit/CLAUDE.md +0 -34
  220. package/skills/pr-consistency-audit/SKILL.md +0 -116
  221. package/skills/pr-consistency-audit/reference/CLAUDE.md +0 -16
  222. package/skills/pr-consistency-audit/reference/detection-rules.md +0 -96
  223. package/skills/pr-consistency-audit/reference/illustrations.md +0 -78
  224. package/skills/pr-review-responder/CLAUDE.md +0 -35
  225. package/skills/pr-review-responder/EXAMPLES.md +0 -590
  226. package/skills/pr-review-responder/PRINCIPLES.md +0 -533
  227. package/skills/pr-review-responder/README.md +0 -168
  228. package/skills/pr-review-responder/SKILL.md +0 -203
  229. package/skills/pr-review-responder/TESTING.md +0 -350
  230. package/skills/pr-scope-resolve/SKILL.md +0 -45
  231. package/skills/pre-compact/CLAUDE.md +0 -24
  232. package/skills/pre-compact/SKILL.md +0 -134
  233. package/skills/qbug/CLAUDE.md +0 -40
  234. package/skills/qbug/SKILL.md +0 -387
  235. package/skills/qbug/test_qbug_skill_audit_schema.py +0 -152
  236. package/skills/qbug/test_qbug_skill_post_fix_audit.py +0 -103
  237. package/skills/refine/CLAUDE.md +0 -44
  238. package/skills/refine/SKILL.md +0 -262
  239. package/skills/refine/templates/CLAUDE.md +0 -17
  240. package/skills/refine/templates/implementation-notes-template.html +0 -56
  241. package/skills/refine/templates/plan-template.md +0 -60
  242. package/skills/research-mode/CLAUDE.md +0 -35
  243. package/skills/research-mode/SKILL.md +0 -53
  244. package/skills/structure-prompt/CLAUDE.md +0 -42
  245. package/skills/structure-prompt/SKILL.md +0 -44
  246. package/skills/structure-prompt/reference/CLAUDE.md +0 -28
  247. package/skills/structure-prompt/reference/adversarial-tuning.md +0 -62
  248. package/skills/structure-prompt/reference/block-classification.md +0 -27
  249. package/skills/structure-prompt/reference/canonical-case.md +0 -48
  250. package/skills/structure-prompt/reference/citation-depth.md +0 -70
  251. package/skills/structure-prompt/reference/cleanup.md +0 -33
  252. package/skills/structure-prompt/reference/constraints.md +0 -33
  253. package/skills/structure-prompt/reference/directives.md +0 -37
  254. package/skills/structure-prompt/reference/examples.md +0 -72
  255. package/skills/structure-prompt/reference/instantiation.md +0 -51
  256. package/skills/structure-prompt/reference/output-contract.md +0 -72
  257. package/skills/structure-prompt/reference/per-category.md +0 -23
  258. package/skills/structure-prompt/reference/persona.md +0 -38
  259. package/skills/structure-prompt/reference/research.md +0 -33
  260. package/skills/structure-prompt/reference/structure.md +0 -28
  261. package/skills/verified-build/CLAUDE.md +0 -33
  262. package/skills/verified-build/SKILL.md +0 -33
@@ -0,0 +1,108 @@
1
+ # Issue body templates
2
+
3
+ Body shapes for the parent tracking issue and its child issues, plus a worked example. Every body is self-contained: a reader with zero session context understands it. Every body carries a quoted line of evidence captured this session. Write each body to a temp file and pass it with `gh issue create --body-file <path>`.
4
+
5
+ ## Contents
6
+
7
+ - [Child issue body](#child-issue-body)
8
+ - [Parent tracking issue body](#parent-tracking-issue-body)
9
+ - [Worked example — child](#worked-example--child)
10
+ - [Worked example — parent](#worked-example--parent)
11
+ - [Body rules](#body-rules)
12
+
13
+ ## Child issue body
14
+
15
+ One obstacle per child. Fill every section:
16
+
17
+ ```markdown
18
+ ## What happened
19
+
20
+ <One sentence: the failure mode, in plain terms.>
21
+
22
+ ## Evidence
23
+
24
+ <The verbatim line captured this session — error text, command, or log line — in a fenced block.>
25
+
26
+ ```
27
+ <exact quoted text>
28
+ ```
29
+
30
+ ## Where
31
+
32
+ <The file, hook, gate, or tool the evidence names. Path relative to the repo root.>
33
+
34
+ ## Impact
35
+
36
+ <What the obstacle cost: work blocked, count of times hit, workaround forced.>
37
+
38
+ ## Proposed fix
39
+
40
+ <The specific change. Name the failure mode and the condition, not "improve error handling".>
41
+ ```
42
+
43
+ ## Parent tracking issue body
44
+
45
+ The parent gathers the children. Its body is a checklist, one line per child created:
46
+
47
+ ```markdown
48
+ ## Session closeout — <short session label>
49
+
50
+ Obstacles this session, filed as child issues:
51
+
52
+ - [ ] owner/repo#<N> — <child title>
53
+ - [ ] owner/repo#<N> — <child title>
54
+ - [ ] owner/repo#<N> — <child title>
55
+
56
+ ## Handoff
57
+
58
+ A cloud handoff prompt for these issues was printed in the closing session. It carries the safety boundaries, base branch, per-package verification commands, and the dependency order among the children.
59
+ ```
60
+
61
+ ## Worked example — child
62
+
63
+ ```markdown
64
+ ## What happened
65
+
66
+ The code_rules_enforcer hook blocked a valid list literal in a test file, where test files are exempt from the magic-value gate.
67
+
68
+ ## Evidence
69
+
70
+ ```
71
+ BLOCKED: [MAGIC_VALUE] Inline list literal [200, 404, 500] in a function body -- extract to a named constant in config/.
72
+ ```
73
+
74
+ ## Where
75
+
76
+ packages/claude-dev-env/hooks/blocking/code_rules_enforcer.py — the inline-collection check.
77
+
78
+ ## Impact
79
+
80
+ Hit 3 times in one session on three test files. Forced a workaround: moving each literal to a module constant the test did not need.
81
+
82
+ ## Proposed fix
83
+
84
+ Extend the test-file exemption that already covers the magic-value gate to also cover the inline-collection check, so list and set literals in test bodies pass.
85
+ ```
86
+
87
+ ## Worked example — parent
88
+
89
+ ```markdown
90
+ ## Session closeout — hook exemptions for test files
91
+
92
+ Obstacles this session, filed as child issues:
93
+
94
+ - [ ] jl-cmd/claude-dev-env#101 — inline-collection gate fires in exempt test files
95
+ - [ ] jl-cmd/claude-dev-env#102 — boolean-naming gate flags a fixture variable
96
+
97
+ ## Handoff
98
+
99
+ A cloud handoff prompt for these issues was printed in the closing session. It carries the safety boundaries, base branch, per-package verification commands, and the dependency order among the children.
100
+ ```
101
+
102
+ ## Body rules
103
+
104
+ - **Quoted evidence is required.** No child ships without a fenced block holding a line captured this session.
105
+ - **No volatile paths.** No temp dirs, worktrees, `$CLAUDE_JOB_DIR`, `.claude-editor/jobs`, or `.claude/worktrees` paths in any body. Paste text inline; for a binary artifact, upload it to a durable release and link that URL.
106
+ - **No chat references.** Drop "as discussed" and "the choice we picked". State each fact on its own.
107
+ - **Specific over vague.** "The gate fires on `[200, 404, 500]` in a test body" beats "the gate is too strict".
108
+ - **PII stripped.** Run the PII pass (see the PII redaction checklist) over every body before it reaches the confirmation gate.
@@ -0,0 +1,36 @@
1
+ # PII redaction checklist
2
+
3
+ The PII pass runs on every closeout run, over every issue body and over the handoff prompt, before the confirmation gate. Repository visibility changes how aggressive the redaction is — public repos get the strictest pass — never whether the pass runs.
4
+
5
+ ## The pass
6
+
7
+ Read each drafted body and the handoff prompt line by line. For every match below, swap the real value for the placeholder. When a value is load-bearing for the fix (a hook needs the exact path shape), keep the shape and drop the private part — `~/.claude/hooks/<hook>.py`, not the full home path.
8
+
9
+ | Category | What to catch | Swap |
10
+ |---|---|---|
11
+ | Email | Any address | `<email>` |
12
+ | Real name | A person's name in a path, log line, or account | `<name>` |
13
+ | Home path | A user home directory | `~/` or `<home>/` |
14
+ | Private host / IP | A LAN host, NAS name, private IP | `<host>` |
15
+ | SSH user / port | A login user or non-standard port | `<user>`, `<port>` |
16
+ | Account id | A store, cloud, app, or master-user id | `<account-id>` |
17
+ | Token / secret | An API key, token, or credential | `<redacted>` |
18
+ | Private repo name | An unpublished owner/repo | `<owner>/<repo>` |
19
+ | Sheet / DB / script id | A Neon, Sheet, or Apps Script id | `<id>` |
20
+
21
+ ## Public versus private aggression
22
+
23
+ | Target repo | Aggression |
24
+ |---|---|
25
+ | Public (ships to a public host, open source) | Strictest: redact every category above, and any value a stranger could tie to a person or a private system. When in doubt, redact. |
26
+ | Private (internal, team-only) | Redact tokens, secrets, credentials, and emails without exception. Keep internal host and path shapes only when the fix needs them. |
27
+
28
+ ## After the pass
29
+
30
+ - List every redaction made, so the confirmation gate shows the user what changed.
31
+ - When a redaction removes a value the fix needs, note it as an open question for the user in the gate — do not guess a replacement.
32
+ - A body that still holds a match after the pass does not reach the gate. Re-run the pass until every match is swapped.
33
+
34
+ ## Why the pass is unconditional
35
+
36
+ An issue is a durable post on a shared server. A private value in an issue body outlives the session and the person who typed it. Running the pass on every body, public or private, keeps a leak from landing where it cannot be pulled back.
@@ -1,19 +1,25 @@
1
1
  ---
2
2
  name: copilot-finding-triage
3
3
  description: >-
4
- Sorts each Copilot gate finding from a converge run into one of two tiers and
5
- routes it: a self-healing finding is auto-fixed, pushed, and counted toward
6
- convergence with no user page, while a code concern pages the user over ntfy
7
- and holds the run behind a 45-minute gate. Triggers: 'copilot finding triage',
8
- 'user review gate', 'tier copilot findings', 'triage the copilot gate'.
4
+ Sorts each Copilot gate finding from a converge run into one of two tiers, then
5
+ verifies each code concern with an executed check before routing it: a
6
+ self-healing finding is auto-fixed, pushed, and counted toward convergence with
7
+ no user page; a confirmed or refuted code concern is handled by the run with its
8
+ check evidence; only a code concern the check leaves inconclusive pages the user
9
+ over ntfy and holds the run behind a 45-minute gate. Triggers: 'copilot finding
10
+ triage', 'user review gate', 'tier copilot findings', 'triage the copilot gate'.
9
11
  ---
10
12
 
11
13
  # Copilot Finding Triage
12
14
 
13
- After a converge run's Copilot gate returns its findings, this skill sorts each
14
- one into a tier and acts on it. Findings scoped to style, type hints, or tests
15
- heal themselves inside the run. A logic, security, or behavior finding pages the user
16
- and holds the run until they answer or a 45-minute deadline passes.
15
+ After a converge run's Copilot gate returns its findings, this skill tiers each
16
+ one, verifies every code concern with an executed check, then acts on it.
17
+ Findings scoped to style, type hints, or tests heal themselves inside the run. A
18
+ logic, security, or behavior finding goes to a verifier that runs a check against
19
+ HEAD: a confirmed defect joins the fix round carrying its repro, a refuted claim
20
+ is answered on the thread with the check evidence, and only a finding the check
21
+ leaves inconclusive pages the user and holds the run until they answer or a
22
+ 45-minute deadline passes.
17
23
 
18
24
  ## When this applies
19
25
 
@@ -22,7 +28,6 @@ inside one of these callers:
22
28
 
23
29
  - `autoconverge` — the single-run converge workflow, at its Copilot wait-gate.
24
30
  - `pr-converge` — the looping converge workflow, at each Copilot tick.
25
- - `copilot-review` — the standalone Copilot babysitter.
26
31
 
27
32
  Each caller already fetches the review and carries a fix-and-push flow. This
28
33
  skill decides, per finding, whether that flow runs on its own or waits behind
@@ -40,12 +45,48 @@ Read the complete rubric in `reference/tier-rubric.md`. The short form:
40
45
  product decision. Logic or correctness defects, security, data handling,
41
46
  error-handling semantics, and concurrency.
42
47
 
43
- A finding that straddles both tiers sorts to CODE CONCERN. Any doubt routes to
44
- the user gate.
48
+ A finding that straddles both tiers sorts to CODE CONCERN. Any doubt about the
49
+ tier sorts the finding to CODE CONCERN.
50
+
51
+ ## The verification stage
52
+
53
+ Tiering names who might act; the verification stage between tiering and the user
54
+ gate settles it for every code concern. Each code-concern finding goes to its own
55
+ verifier agent, all in parallel, inside the run. The verifier runs a check
56
+ against the flagged HEAD and returns one of three verdicts.
57
+
58
+ **The governing rule: a verdict is conclusive only if an actual check was
59
+ executed.** Reading the source and reasoning about it, however sound, never
60
+ produces a conclusive verdict. A check is a concrete command the verifier runs
61
+ against the flagged HEAD — executing the code path with crafted inputs, forcing
62
+ the claimed error condition, or running a purpose-built test — whose captured
63
+ output demonstrates the behavior in question. Each verdict carries
64
+ `{verdict, checkCommand, checkOutput, evidence}`; a conclusive verdict whose
65
+ `checkCommand` or `checkOutput` is empty carries no executed check, so the run
66
+ downgrades it to inconclusive.
67
+
68
+ - **CONFIRMED** — the check reproduces the defect. The finding becomes
69
+ self-healing: it joins the fix round carrying its repro. The fix re-runs the
70
+ same repro check and shows it passes, adds the repro to the test suite as a
71
+ regression test where the suite covers that surface, lands in one commit and
72
+ pushes, replies to the thread with the fix SHA plus the before/after check
73
+ output, and resolves the thread. No page.
74
+ - **REFUTED** — the check shows the code already behaves correctly in the exact
75
+ scenario the finding claims is broken. The run replies to the thread with the
76
+ command(s) and captured output, resolves the thread, and counts the finding
77
+ clean. No page.
78
+ - **INCONCLUSIVE** — everything else: no runnable check exists, the check is
79
+ infeasible in this environment, the results are ambiguous, or the fix needs a
80
+ product decision between defensible behaviors. The verifier defaults to
81
+ inconclusive, and any doubt sorts here. These findings, and only these, flow
82
+ into the user gate.
83
+
84
+ A run with zero inconclusive findings never reaches the user gate.
45
85
 
46
86
  ## Self-healing flow
47
87
 
48
- A self-healing finding never pages the user.
88
+ A self-healing finding never pages the user. This covers a finding tiered
89
+ self-healing and a code concern the verifier confirmed.
49
90
 
50
91
  1. Fix the finding through the caller's existing fix flow.
51
92
  2. Verify the fix.
@@ -54,16 +95,18 @@ A self-healing finding never pages the user.
54
95
 
55
96
  ## User gate protocol
56
97
 
57
- Run this protocol when one or more CODE CONCERN findings sit on the round's HEAD.
98
+ Run this protocol when one or more code-concern findings stayed inconclusive
99
+ after verification on the round's HEAD.
58
100
 
59
101
  ### Step 1 — Page the user
60
102
 
61
103
  Run `scripts/notify_ntfy.py` with:
62
104
 
63
105
  - `--title` naming the PR.
64
- - `--message` summarizing each code-concern finding, one line each, as
65
- `file:line — severity — one sentence`. Build the body from
66
- `templates/notification.md`.
106
+ - `--message` summarizing each inconclusive finding, one line each, as
107
+ `file:line — severity — one sentence`, followed by the verifier's one-line
108
+ evidence note stating what check was attempted and why it was not decisive.
109
+ Build the body from `templates/notification.md`.
67
110
  - `--click-url` set to the Copilot review URL, so tapping the page opens the
68
111
  review.
69
112
 
@@ -82,17 +125,22 @@ moment the script exits zero.
82
125
  - If the deadline passes with no answer, run the caller's normal teardown and
83
126
  report the un-reviewed findings in the final report.
84
127
 
85
- ### Step 3 — Self-healing findings run in parallel
128
+ ### Step 3 — Self-healing and confirmed findings run in parallel
86
129
 
87
- Self-healing findings on the same HEAD do not wait for the gate. Fix, verify,
88
- commit, and push them through the caller's fix flow, and count the round toward
89
- convergence.
130
+ Self-healing findings and confirmed code concerns on the same HEAD do not wait
131
+ for the gate. Fix, verify, commit, and push them through the caller's fix flow,
132
+ and count the round toward convergence. A confirmed finding carries its repro, so
133
+ its fix re-runs that same check and posts the before/after output on the thread.
90
134
 
91
135
  ## Gate checklist
92
136
 
93
137
  - [ ] Every finding on HEAD carries a tier.
94
138
  - [ ] Each self-healing finding is fixed, verified, and pushed.
95
- - [ ] Each code-concern finding appears as one line in the ntfy body.
139
+ - [ ] Each code-concern finding carries a verifier verdict from an executed check.
140
+ - [ ] Each confirmed finding is fixed with its repro re-run and pushed.
141
+ - [ ] Each refuted finding's thread carries the check evidence and is resolved.
142
+ - [ ] Each inconclusive finding appears as one line in the ntfy body with its
143
+ evidence note.
96
144
  - [ ] The page carries the PR name, the per-finding summary, and the review URL.
97
145
  - [ ] `scripts/notify_ntfy.py` exited zero before the 45-minute clock started.
98
146
  - [ ] The wakeup is armed for 45 minutes from a delivered page.
@@ -102,9 +150,9 @@ convergence.
102
150
 
103
151
  | Path | Role |
104
152
  |------|------|
105
- | `SKILL.md` | This hub: when it applies, the tier split, the gate protocol. |
106
- | `reference/tier-rubric.md` | The complete tier rubric and the behavior-safe test. |
107
- | `templates/notification.md` | The ntfy message body for a code-concern page. |
153
+ | `SKILL.md` | This hub: when it applies, the tier split, the verification stage, the gate protocol. |
154
+ | `reference/tier-rubric.md` | The complete tier rubric, the three verdicts, and the executed-check standard. |
155
+ | `templates/notification.md` | The ntfy message body for an inconclusive-finding page. |
108
156
  | `scripts/notify_ntfy.py` | The ntfy publish CLI. |
109
157
  | `scripts/test_notify_ntfy.py` | Tests for the publish CLI. |
110
158
 
@@ -116,9 +164,13 @@ convergence.
116
164
  - **A failed page is not consent.** A failed ntfy POST holds the gate open. It
117
165
  does not auto-approve the round. Read the script's non-zero exit as a page that
118
166
  never reached the user, and keep the run held.
119
- - **Doubt sorts to CODE CONCERN.** When a finding could sit in either tier,
120
- classify it as a code concern and page the user. The safe default never
121
- auto-fixes a finding that might change runtime behavior.
167
+ - **A conclusive verdict needs an executed check.** Source reading, however
168
+ sound, never confirms or refutes a finding. A confirmed or refuted verdict
169
+ whose `checkCommand` or `checkOutput` is empty downgrades to inconclusive and
170
+ pages the user.
171
+ - **Doubt sorts to INCONCLUSIVE.** When an executed check does not pin down the
172
+ behavior, the verifier defaults to inconclusive and the finding pages the user.
173
+ The safe default never auto-fixes a finding whose behavior a check did not show.
122
174
  - **The 45-minute clock starts at page success.** The timer starts when the page
123
175
  reaches the user, which is the moment `scripts/notify_ntfy.py` exits zero, not
124
176
  the moment the finding is classified.
@@ -1,17 +1,19 @@
1
1
  # Tier Rubric
2
2
 
3
- Every Copilot finding on the round's HEAD sorts into one of two tiers. The tier
4
- decides who acts: the run fixes a self-healing finding on its own, and the run
5
- pages the user for a code concern.
3
+ Every Copilot finding on the round's HEAD passes through two stages: tiering,
4
+ then for a code concern an executed-check verification stage that decides who
5
+ acts. Tiering sorts a finding into one of two tiers. The run fixes a self-healing
6
+ finding on its own; a code concern goes to a verifier agent, and only a finding
7
+ the verifier leaves inconclusive pages the user.
6
8
 
7
9
  ## The two tiers
8
10
 
9
- | Tier | Who acts | Page the user | Counts toward convergence |
10
- |------|----------|---------------|---------------------------|
11
+ | Tier | Next step | Page the user | Counts toward convergence |
12
+ |------|-----------|---------------|---------------------------|
11
13
  | SELF-HEALING | The run auto-fixes | No | Yes |
12
- | CODE CONCERN | The user decides | Yes | Held until the user answers or the deadline passes |
14
+ | CODE CONCERN | An executed-check verifier decides | Only when the verifier's verdict is inconclusive | Confirmed and refuted count; inconclusive holds until the user answers or the deadline passes |
13
15
 
14
- ## The test that splits them
16
+ ## The test that splits the tiers
15
17
 
16
18
  A finding is SELF-HEALING when its fix cannot change what a production caller
17
19
  observes at runtime. A finding is a CODE CONCERN when its fix changes runtime
@@ -42,8 +44,65 @@ weigh a tradeoff.
42
44
  - Concurrency.
43
45
  - Anything whose fix changes observable production behavior.
44
46
 
45
- ## When a finding sits on the line
47
+ A finding that touches both tiers sorts to CODE CONCERN. Any doubt about the tier
48
+ sorts the finding to CODE CONCERN.
46
49
 
47
- A finding that touches both tiers sorts to CODE CONCERN. Any doubt about whether
48
- a fix stays behavior-safe routes the finding to the user gate. The safe default
49
- pages a person; it never auto-fixes a finding that might change runtime behavior.
50
+ ## The verification stage
51
+
52
+ Every code-concern finding goes to its own verifier agent, all in parallel,
53
+ inside the run. The verifier decides one of three verdicts by executing a check
54
+ against the flagged HEAD.
55
+
56
+ **The governing rule: a verdict is conclusive only if an actual check was
57
+ executed.** Reading the source and reasoning about it, however sound, never
58
+ produces a conclusive verdict. A check is a concrete command the verifier runs
59
+ against the flagged HEAD — executing the flagged code path with crafted inputs,
60
+ forcing the claimed error condition, or running a purpose-built test — whose
61
+ captured output demonstrates the behavior in question. Source inspection points
62
+ the check at the right place; it is never itself grounds for a conclusive verdict.
63
+
64
+ Each verdict carries `{verdict, checkCommand, checkOutput, evidence}`. A
65
+ conclusive verdict whose `checkCommand` or `checkOutput` is empty carries no
66
+ executed check, so the run downgrades it to inconclusive.
67
+
68
+ | Verdict | What the executed check shows | Who acts | Page the user |
69
+ |---------|-------------------------------|----------|---------------|
70
+ | CONFIRMED | The check tangibly reproduces the defect | The run auto-fixes | No |
71
+ | REFUTED | The check tangibly shows the code already behaves correctly in the exact scenario the finding claims is broken | The run replies and resolves | No |
72
+ | INCONCLUSIVE | Everything else | The user decides | Yes |
73
+
74
+ ### CONFIRMED
75
+
76
+ The executed check reproduces the defect; the evidence carries the exact
77
+ command(s) and the captured output. Only a confirmed verdict makes a
78
+ code-concern finding self-healing. The finding joins the round's fix list
79
+ carrying its repro, and the fix:
80
+
81
+ 1. Re-runs the same repro check and shows it passes.
82
+ 2. Adds the repro to the repo's test suite as a regression test where the suite
83
+ covers that surface.
84
+ 3. Lands in one commit and pushes.
85
+ 4. Replies to the thread with the fix SHA plus the before/after check output,
86
+ then resolves the thread.
87
+
88
+ The loop resumes on its own. No page.
89
+
90
+ ### REFUTED
91
+
92
+ The executed check demonstrates the code already behaves correctly in the exact
93
+ scenario the finding claims is broken. The run replies to the thread with the
94
+ command(s) and captured output, resolves the thread, and counts the finding
95
+ clean. No page.
96
+
97
+ ### INCONCLUSIVE
98
+
99
+ Everything else: no runnable check exists, the check is infeasible in this
100
+ environment, the results are ambiguous, or the fix needs a product decision
101
+ between defensible behaviors. A finding that is not tangibly reproducible is not
102
+ self-healing. These findings, and only these, flow into the user gate.
103
+
104
+ ## The default is inconclusive
105
+
106
+ The verifier defaults to inconclusive. Any doubt sorts to inconclusive, and an
107
+ inconclusive finding pages the user. The safe default pages a person; it never
108
+ auto-fixes a finding whose behavior an executed check did not pin down.
@@ -13,10 +13,12 @@ Copilot code concern on PR {pr_number}: {short_pr_title}
13
13
  ## Body
14
14
 
15
15
  ```
16
- {finding_count} code concern(s) need your call on PR {pr_number} ({head_sha}):
16
+ {finding_count} code concern(s) survived verification as inconclusive and need your call on PR {pr_number} ({head_sha}):
17
17
 
18
18
  - {file_1}:{line_1} — {severity_1} — {one_sentence_concern_1}
19
+ Check: {evidence_note_1}
19
20
  - {file_2}:{line_2} — {severity_2} — {one_sentence_concern_2}
21
+ Check: {evidence_note_2}
20
22
 
21
23
  Review: {review_url}
22
24
  Reply within 45 minutes or the run tears down and reports these findings unreviewed.
@@ -24,10 +26,13 @@ Reply within 45 minutes or the run tears down and reports these findings unrevie
24
26
 
25
27
  ## Field notes
26
28
 
27
- - `{finding_count}` counts the CODE CONCERN findings on this HEAD, not the
28
- self-healing ones.
29
+ - `{finding_count}` counts the inconclusive findings on this HEAD the code
30
+ concerns an executed check left undecided — not the self-healing, confirmed, or
31
+ refuted ones.
29
32
  - Each bullet holds one finding: its `file:line`, its severity, and one sentence
30
33
  naming the concern.
34
+ - `{evidence_note_N}` is the verifier's one-line note stating what check was
35
+ attempted and why it was not decisive.
31
36
  - `{review_url}` is the same URL passed as `--click-url`, so the reader sees it
32
37
  in the body and reaches it by tapping the message.
33
38
  - The 45-minute clock starts when the page reaches the user, which is the moment
@@ -13,8 +13,7 @@ Search files instantly on Windows using the Everything command-line interface (e
13
13
 
14
14
  ## Hard limits
15
15
 
16
- - **Scope every search.** Pass a project path, an `ext:`/`dm:`/`size:` filter, or a name pattern. A bare whole-drive scan or a network-share sweep is out of bounds.
17
- - **Fall back on failure.** When `es.exe` fails or returns nothing, try to start it. if that doesn't work, prompt the user to decide next steps: grep, debug further, etc.
16
+ Scope and fallback policy: `packages/claude-dev-env/rules/es-exe-file-search.md`.
18
17
 
19
18
  ## Instructions
20
19
 
@@ -0,0 +1,58 @@
1
+ ---
2
+ name: grokify
3
+ description: >-
4
+ Grok Build execution handoff prompt, embed Claude advisor.
5
+ ---
6
+
7
+ # Grokify
8
+
9
+ ## Principle
10
+
11
+ One paste-ready handoff turns this session's work into a plan a Grok Build session can execute alone. Grok gets no access to this conversation, so the handoff carries everything: repos, findings, constraints, the phased plan, and a Claude advisor Grok reaches through the `claude` CLI.
12
+
13
+ ## Gotchas
14
+
15
+ - Grok Build cannot spawn Claude subagents. The advisor is an out-of-process `claude -p` session — never write Agent-tool, `session-advisor`, or SendMessage instructions into the handoff.
16
+ - A `--resume` after a usage-limit failover to another binary fails, because a session store belongs to the binary that minted it. The handoff must tell Grok to treat that failure as starting over: re-send the charter plus a compact recap, capture the new `session_id`.
17
+ - Conversation-relative phrases ("as discussed", "the plan above", "the earlier choice") are dead text to Grok — every statement stands on its own.
18
+ - Copy findings' measured numbers and `file:line` citations into the handoff exactly, and label each figure measured, bounded, or unverified.
19
+ - The advisor session starts empty. The bind step must pipe the findings, constraints, and plan into the charter, or every later consult is answered from nothing.
20
+ - `claude` sessions are project-scoped by working directory. The handoff must tell Grok to run every bind and every `--resume` with the cwd set to the repo root it names — a bind launched from the Grok sandbox cwd files the session under that other project, and a later resume from the real worktree reports `No conversation found with session ID`. Treat a session-not-found error as a wrong-cwd or expired-session signal, not a model failure.
21
+ - `--output-format json` returns a JSON array of events, not one object. `session_id` comes from any event; the reply text is the `type == "result"` event's `.result` field. A parser expecting one top-level object reports a missing session id on a working bind.
22
+ - The charter travels as a file piped to stdin, or as one clean argv string. Half-escaped multiline shell expansion mangles the prompt in transit and the advisor sees a fragment.
23
+
24
+ ## When this applies
25
+
26
+ The user types `/grokify`, alone or with guidance.
27
+
28
+ - Bare `/grokify`: build the handoff from the current session's context — the task in flight, its findings, plan, and constraints.
29
+ - `/grokify <guidance>`: the guidance names or scopes the task — a plan written earlier in the session, a file to read, or a fresh instruction. Build the handoff for that.
30
+
31
+ **Refusal:** no session context and no guidance — reply `What should Grok execute? One sentence.` and stop.
32
+
33
+ ## Process
34
+
35
+ 1. Collect the substance: repos and branch, established findings with `file:line` and measured numbers, hard constraints, and the phased plan with acceptance criteria. Pull from session context first, then from the guidance; read any files the guidance names.
36
+ 2. Fill `templates/handoff-template.md`. Adapt every bracketed section to the task; keep the advisor CLI commands, signal rules, and consult cadence exactly as the template writes them.
37
+ 3. Mark any decision that belongs to the user as an explicit ask-the-user fork inside the plan. The handoff never lets Grok pick silently.
38
+ 4. Deliver one fenced markdown block (four-backtick fence, so inner fences survive), then one or two sentences naming the choices you baked in.
39
+
40
+ ## Fixed advisor structure (never vary these parts)
41
+
42
+ - **Bind once, first:** charter + findings + constraints + plan piped from a temp file into `claude -p --model fable --effort high --output-format json`; parse and save `session_id` from the JSON reply.
43
+ - **Consult:** brief piped into `claude -p --resume <session_id> --model fable --effort high --output-format json`.
44
+ - **ConsultB** If fable is unavailable, use opus with max effort: `claude -p --resume <session_id> --model opus --effort max --output-format json`.
45
+ - **Signals:** every advisor reply opens with exactly one of ENDORSE, CORRECTION, PLAN, or STOP. CORRECTION and PLAN are actions to take, with a report-back in the next consult on that topic. STOP halts that line of work and surfaces it to the user. When the CLI is unreachable, Grok stops and says so — it never self-endorses in the advisor's place.
46
+ - **Cadence, mandatory:** after planning and before any edit; per phase before implementation (TDD red + approach) and after (diff, tests, acceptance evidence); before every `git commit` and `git push`; on every user-facing fork before asking; on any twice-repeated failure or stall.
47
+
48
+ ## File index
49
+
50
+ | File | Purpose |
51
+ |---|---|
52
+ | `SKILL.md` | Trigger, process, fixed advisor structure. |
53
+ | `templates/handoff-template.md` | Section-by-section skeleton of the handoff prompt. |
54
+
55
+ ## Folder map
56
+
57
+ - `SKILL.md` — the whole workflow.
58
+ - `templates/` — the handoff skeleton.
@@ -0,0 +1,92 @@
1
+ # Handoff template
2
+
3
+ Fill every `[bracketed]` part from the session. Keep the advisor sections word-for-word except the charter's mission sentences.
4
+
5
+ ````markdown
6
+ # Execution Handoff (Grok Build): [task title]
7
+
8
+ You are Grok, executing this plan yourself on Grok Build. You write the code, run the
9
+ tests, and run the checks. You do NOT decide alone: a standing Claude advisor (Fable High
10
+ tier, or Opus MAX if Fable is unavailable, reached via CLI) reviews every significant step at the cadence below.
11
+
12
+ ## Repos and branch
13
+
14
+ - [repo, working-tree path, and the branch to develop on; push and PR rules]
15
+ - [any read-only sibling repos and what they are for]
16
+
17
+ ## Established findings (treat as settled)
18
+
19
+ [Each finding on its own bullet with file:line citations and measured numbers, each
20
+ labeled measured, bounded, or unverified. Include refuted hypotheses so Grok does not
21
+ re-fix them.]
22
+
23
+ ## Hard constraints
24
+
25
+ [Non-negotiables: values that stay fixed, behavior that stays, repo conventions
26
+ (commit style, test-first rules, where constants live), anything out of scope.
27
+ CONFIRM THESE WITH THE USER FIRST, VIA ASKUSERQUESTION, BEFORE EMBEDDING]
28
+
29
+ ## The advisor: Claude Fable High / Opus MAX via CLI (bind FIRST, before any change)
30
+
31
+ **Bind (once, at run start):**
32
+ 0. `cd` to the repo root named under Repos and branch — and do the same before every
33
+ later consult. `claude` sessions are project-scoped by working directory; a bind
34
+ or resume run from any other cwd (your sandbox, a temp dir) files the session
35
+ under a different project and later resumes report "No conversation found".
36
+ 1. Write the charter to a temp file. Charter text: "You are the standing advisor for a
37
+ Grok executor working on [one-sentence mission]. You never edit files or run
38
+ commands; you only answer. Open every reply with exactly one signal word: ENDORSE,
39
+ CORRECTION, PLAN, or STOP. Each consult brings the delta since the last consult
40
+ (real output, never a full recap), the live decision or blocker, and load-bearing
41
+ paths or excerpts. If a consult re-raises something you already answered with
42
+ nothing new attached, restate the prior answer and name it a restatement." Then
43
+ append the full Established findings, Hard constraints, and Plan sections of this
44
+ document to the same file.
45
+ 2. Bind: `claude -p --model fable --effort high --output-format json < <charter-file>`
46
+ 2a. If 2 fails, replace fable with opus, effort high to max.
47
+ 3. The JSON output is an array of events, not one object. Take `session_id` from any
48
+ event; the reply text is the `type == "result"` event's `.result` field. Persist
49
+ `session_id`, the repo root, and the cwd to a state file at once.
50
+ 4. If the primary `claude` binary is usage-limited, fall back through
51
+ `python "$HOME/.claude/scripts/claude_chain_runner.py" -- -p --model fable --effort high --output-format json`.
52
+ A failover does NOT carry the session_id. On ANY resume failure — failover,
53
+ session-not-found, expiry — first confirm the cwd is the repo root, then re-bind
54
+ once from there with the charter plus a three-line recap of consults so far, and
55
+ persist the new session_id. A session-not-found error is a wrong-cwd or expired
56
+ session, not a model failure.
57
+
58
+ **Consult (every time):** write the brief to a temp file, then
59
+ `claude -p --resume <session_id> --model fable (or opus) --effort high (max for opus) --output-format json < <brief-file>`.
60
+ Act on the reply's opening signal: ENDORSE — proceed. CORRECTION — apply it first;
61
+ your next consult on that topic opens with what happened. PLAN — adopt it; same
62
+ report-back rule. STOP — halt that line of work and surface it to the user. Never
63
+ proceed past a mandatory checkpoint on an unread or unanswered consult; if the CLI
64
+ and its fallback both fail, stop and tell the user rather than self-endorsing.
65
+
66
+ **Mandatory consult cadence:**
67
+ 1. After binding, before touching any file: your concrete per-phase execution plan.
68
+ 2. Per phase, BEFORE implementation: the failing tests you wrote and your approach.
69
+ 3. Per phase, AFTER implementation: diff summary, test results, acceptance evidence.
70
+ 4. Before EVERY `git commit` and EVERY `git push`.
71
+ 5. On any user-facing fork: your proposed framing, before asking the user.
72
+ 6. Any time the same failure repeats twice, progress stalls, or you reconsider an
73
+ approach.
74
+
75
+ ## Plan
76
+
77
+ [Numbered phases. Each phase: what to change (with paths), how to prove it worked
78
+ (acceptance criteria with commands or counts), and its blast radius. A decision that
79
+ belongs to the user is its own phase, marked USER DECISION — never pick silently. End
80
+ with a verify-and-land phase: re-run the baseline check, gates green, advisor ENDORSE,
81
+ then commit and push.]
82
+
83
+ ## Execution discipline
84
+
85
+ - Track each phase as an explicit task; mark it complete only when its acceptance
86
+ evidence exists and the advisor has seen it.
87
+ - Every progress claim rests on command output from this run; label anything
88
+ unverified as unverified.
89
+ - Keep a consult log (checkpoint, signal received) and include it in the final report.
90
+ - Final message: outcome first (evidence, phases landed, commits pushed), then the
91
+ decisions taken, then honest gaps.
92
+ ````