claude-dev-env 4.3.0 → 7.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (293) hide show
  1. package/.agents/agents/pr-description-writer.md +2 -2
  2. package/.agents/agents/test_agent_frontmatter.py +2 -2
  3. package/.agents/agents/test_pr_description_writer_style.py +1 -3
  4. package/.agents/skills/e-code-review/SKILL.md +12 -12
  5. package/.agents/skills/e-code-review/preflight-proposal.contract.test.mjs +20 -0
  6. package/.agents/skills/e-code-review/reference/fix.md +15 -17
  7. package/.agents/skills/e-code-review/reference/loop.md +35 -39
  8. package/.agents/skills/e-code-review/reference/mode-contract.test.mjs +2 -1
  9. package/.agents/skills/e-code-review/reference/preflight-proposal.md +44 -9
  10. package/.agents/skills/e-code-review/reference/runner-selection.md +13 -14
  11. package/.agents/skills/issue-tracker/SKILL.md +5 -4
  12. package/.agents/skills/pull-request/SKILL.md +11 -13
  13. package/.agents/skills/pull-request/reference/publication-tasks.md +3 -3
  14. package/.agents/skills/pull-request/scripts/github_pr_command_constants/config/constants.py +9 -1
  15. package/.agents/skills/pull-request/scripts/pull_request.py +33 -44
  16. package/.agents/skills/pull-request/scripts/test_github_pr_command_constants.py +9 -0
  17. package/.agents/skills/pull-request/scripts/test_pull_request.py +1 -3
  18. package/.agents/skills/skill-builder/SKILL.md +3 -196
  19. package/_shared/pr-loop/scripts/pr_loop_shared_constants/terminology_sweep_constants.py +6 -0
  20. package/_shared/pr-loop/scripts/terminology_sweep.py +64 -19
  21. package/_shared/pr-loop/scripts/tests/test_terminology_sweep.py +59 -0
  22. package/bin/install.agents-home.test.mjs +15 -13
  23. package/bin/install.mjs +28 -0
  24. package/bin/install.policy-lint.test.mjs +78 -0
  25. package/bin/install.prune.test.mjs +59 -20
  26. package/bin/install.pstack-plugin.test.mjs +114 -0
  27. package/bin/install.test.mjs +37 -0
  28. package/bin/refresh-pstack-plugin-skills.test.mjs +211 -0
  29. package/hooks/advisory/pr_done_reminder.py +342 -0
  30. package/hooks/advisory/test_pr_done_reminder.py +249 -0
  31. package/hooks/blocking/bash_post_call_dispatcher.py +53 -6
  32. package/hooks/blocking/code_rules_paired_test.py +22 -15
  33. package/hooks/blocking/test_bash_post_call_dispatcher.py +65 -4
  34. package/hooks/blocking/test_code_rules_enforcer_paired_test.py +36 -29
  35. package/hooks/blocking/test_code_rules_js_resume_task_enumeration.py +4 -4
  36. package/hooks/blocking/test_code_rules_js_returns_object_schemaless.py +5 -5
  37. package/hooks/blocking/test_pre_tool_use_dispatcher.py +68 -133
  38. package/hooks/blocking/test_pre_tool_use_dispatcher_native.py +20 -51
  39. package/hooks/blocking/test_precommit_code_rules_gate_native_owner.py +18 -18
  40. package/hooks/git-hooks/git_hooks_constants/staged_policy_lint.py +12 -0
  41. package/hooks/git-hooks/pre_commit.py +52 -11
  42. package/hooks/git-hooks/test_installed_policy_lint.py +159 -0
  43. package/hooks/git-hooks/test_native_policy_commit.py +87 -0
  44. package/hooks/git-hooks/test_pre_commit.py +246 -0
  45. package/hooks/hooks.json +1 -1
  46. package/hooks/hooks_constants/bash_post_call_dispatcher_constants.py +14 -1
  47. package/hooks/hooks_constants/pr_done_reminder_constants.py +98 -0
  48. package/hooks/hooks_constants/pre_tool_use_dispatcher_constants.py +10 -43
  49. package/hooks/hooks_constants/test_bash_post_call_dispatcher_constants.py +19 -2
  50. package/hooks/hooks_constants/test_pr_done_reminder_constants.py +40 -0
  51. package/hooks/hooks_constants/test_pre_tool_use_dispatcher_constants.py +20 -32
  52. package/package.json +2 -2
  53. package/rules/durable-post-artifacts.md +2 -1
  54. package/rules/git-workflow.md +6 -6
  55. package/scripts/check.ps1 +0 -1
  56. package/{.agents/skills/run-claude-dev-env/driver.mjs → scripts/ci/installer-lifecycle.mjs} +3 -28
  57. package/scripts/ci/installer-lifecycle.test.mjs +26 -0
  58. package/scripts/ci/windows-installer-lifecycle.ps1 +1 -11
  59. package/scripts/dev_env_scripts_constants/shared_tree_constants.py +4 -5
  60. package/{.agents/skills/_shared/pr-loop/scripts → scripts}/durable_post_lint.py +5 -41
  61. package/{.agents/skills/_shared/pr-loop/scripts/skills_pr_loop_constants/durable_post_lint_constants.py → scripts/durable_post_lint_config/config/constants.py} +0 -10
  62. package/{.agents/skills/_shared/pr-loop/scripts/test_durable_post_lint_constants.py → scripts/durable_post_lint_config/config/test_constants.py} +1 -1
  63. package/scripts/policy_lint/adapter_detectors.py +13 -6
  64. package/scripts/policy_lint/adapters.py +7 -4
  65. package/scripts/policy_lint/config/constants.py +5 -0
  66. package/scripts/policy_lint/engine.py +48 -4
  67. package/scripts/policy_lint/model.py +1 -0
  68. package/scripts/policy_lint/registry.py +1 -1
  69. package/scripts/policy_lint/selection.py +2 -1
  70. package/scripts/policy_lint/selection_git.py +2 -0
  71. package/scripts/refresh_pstack_plugin_skills.mjs +200 -0
  72. package/scripts/shared_tree_paths.py +32 -3
  73. package/scripts/test_shared_tree_paths.py +33 -0
  74. package/scripts/tests/test_policy_lint_rules_archive.py +120 -0
  75. package/scripts/tests/test_policy_lint_rules_engine.py +25 -4
  76. package/scripts/tests/test_policy_lint_rules_installed_loader.py +29 -0
  77. package/scripts/tests/test_policy_lint_rules_registry.py +227 -13
  78. package/scripts/tests/test_policy_lint_selection.py +25 -2
  79. package/scripts/tests/test_policy_lint_selection_native_index.py +30 -0
  80. package/scripts/tests/test_rules.py +3 -7
  81. package/.agents/skills/_shared/pr-loop/.claude/CLAUDE.md +0 -1
  82. package/.agents/skills/_shared/pr-loop/AGENTS.md +0 -1
  83. package/.agents/skills/_shared/pr-loop/audit-contract.md +0 -5
  84. package/.agents/skills/_shared/pr-loop/audit-reply-template.md +0 -5
  85. package/.agents/skills/_shared/pr-loop/code-rules-gate.md +0 -5
  86. package/.agents/skills/_shared/pr-loop/fix-protocol.md +0 -5
  87. package/.agents/skills/_shared/pr-loop/gh-payloads.md +0 -5
  88. package/.agents/skills/_shared/pr-loop/portable-driver.md +0 -149
  89. package/.agents/skills/_shared/pr-loop/post-audit-thread-contract.md +0 -5
  90. package/.agents/skills/_shared/pr-loop/precatch-rubric.md +0 -5
  91. package/.agents/skills/_shared/pr-loop/preflight-proposal.contract.test.mjs +0 -119
  92. package/.agents/skills/_shared/pr-loop/preflight-proposal.md +0 -5
  93. package/.agents/skills/_shared/pr-loop/prompts/.claude/CLAUDE.md +0 -1
  94. package/.agents/skills/_shared/pr-loop/prompts/AGENTS.md +0 -1
  95. package/.agents/skills/_shared/pr-loop/prompts/pr-consistency-audit.xml +0 -324
  96. package/.agents/skills/_shared/pr-loop/scripts/.claude/CLAUDE.md +0 -1
  97. package/.agents/skills/_shared/pr-loop/scripts/AGENTS.md +0 -1
  98. package/.agents/skills/_shared/pr-loop/scripts/RUNTIME_SCRIPTS.md +0 -29
  99. package/.agents/skills/_shared/pr-loop/scripts/_cli_utils.py +0 -22
  100. package/.agents/skills/_shared/pr-loop/scripts/_path_resolver.py +0 -186
  101. package/.agents/skills/_shared/pr-loop/scripts/_xml_utils.py +0 -20
  102. package/.agents/skills/_shared/pr-loop/scripts/audit_category_schema.py +0 -355
  103. package/.agents/skills/_shared/pr-loop/scripts/build_audit_prompt.py +0 -289
  104. package/.agents/skills/_shared/pr-loop/scripts/build_converge_task_list.py +0 -310
  105. package/.agents/skills/_shared/pr-loop/scripts/build_fix_prompt.py +0 -292
  106. package/.agents/skills/_shared/pr-loop/scripts/init_loop_state.py +0 -134
  107. package/.agents/skills/_shared/pr-loop/scripts/portable_converge_driver.py +0 -1646
  108. package/.agents/skills/_shared/pr-loop/scripts/preflight_worktree.py +0 -392
  109. package/.agents/skills/_shared/pr-loop/scripts/select_converge_pacer.py +0 -215
  110. package/.agents/skills/_shared/pr-loop/scripts/skills_pr_loop_constants/.claude/CLAUDE.md +0 -1
  111. package/.agents/skills/_shared/pr-loop/scripts/skills_pr_loop_constants/AGENTS.md +0 -1
  112. package/.agents/skills/_shared/pr-loop/scripts/skills_pr_loop_constants/__init__.py +0 -0
  113. package/.agents/skills/_shared/pr-loop/scripts/skills_pr_loop_constants/audit_category_schema_constants.py +0 -37
  114. package/.agents/skills/_shared/pr-loop/scripts/skills_pr_loop_constants/converge_task_list_constants.py +0 -56
  115. package/.agents/skills/_shared/pr-loop/scripts/skills_pr_loop_constants/handoff_constants.py +0 -45
  116. package/.agents/skills/_shared/pr-loop/scripts/skills_pr_loop_constants/pacer_constants.py +0 -47
  117. package/.agents/skills/_shared/pr-loop/scripts/skills_pr_loop_constants/path_resolver_constants.py +0 -157
  118. package/.agents/skills/_shared/pr-loop/scripts/skills_pr_loop_constants/portable_driver_constants.py +0 -177
  119. package/.agents/skills/_shared/pr-loop/scripts/skills_pr_loop_constants/preflight_constants.py +0 -70
  120. package/.agents/skills/_shared/pr-loop/scripts/teardown_worktrees.py +0 -172
  121. package/.agents/skills/_shared/pr-loop/scripts/test__path_resolver.py +0 -106
  122. package/.agents/skills/_shared/pr-loop/scripts/test_audit_category_schema.py +0 -94
  123. package/.agents/skills/_shared/pr-loop/scripts/test_build_audit_prompt.py +0 -499
  124. package/.agents/skills/_shared/pr-loop/scripts/test_build_converge_task_list.py +0 -140
  125. package/.agents/skills/_shared/pr-loop/scripts/test_build_fix_prompt.py +0 -262
  126. package/.agents/skills/_shared/pr-loop/scripts/test_init_loop_state.py +0 -71
  127. package/.agents/skills/_shared/pr-loop/scripts/test_portable_converge_driver.py +0 -1119
  128. package/.agents/skills/_shared/pr-loop/scripts/test_preflight_worktree.py +0 -287
  129. package/.agents/skills/_shared/pr-loop/scripts/test_select_converge_pacer.py +0 -207
  130. package/.agents/skills/_shared/pr-loop/scripts/test_teardown_worktrees.py +0 -59
  131. package/.agents/skills/_shared/pr-loop/scripts/test_write_handoff.py +0 -201
  132. package/.agents/skills/_shared/pr-loop/scripts/write_audit_outcomes.py +0 -182
  133. package/.agents/skills/_shared/pr-loop/scripts/write_fix_outcomes.py +0 -206
  134. package/.agents/skills/_shared/pr-loop/scripts/write_handoff.py +0 -309
  135. package/.agents/skills/_shared/pr-loop/state-schema.md +0 -5
  136. package/.agents/skills/_shared/pr-loop/worker-spawn.md +0 -5
  137. package/.agents/skills/autoconverge/.claude/CLAUDE.md +0 -1
  138. package/.agents/skills/autoconverge/AGENTS.md +0 -1
  139. package/.agents/skills/autoconverge/SKILL.md +0 -431
  140. package/.agents/skills/autoconverge/reference/.claude/CLAUDE.md +0 -1
  141. package/.agents/skills/autoconverge/reference/AGENTS.md +0 -1
  142. package/.agents/skills/autoconverge/reference/closing-report.md +0 -93
  143. package/.agents/skills/autoconverge/reference/convergence-gates.md +0 -31
  144. package/.agents/skills/autoconverge/reference/convergence.md +0 -219
  145. package/.agents/skills/autoconverge/reference/copilot-findings.md +0 -51
  146. package/.agents/skills/autoconverge/reference/gotchas.md +0 -66
  147. package/.agents/skills/autoconverge/reference/headless-safety.md +0 -44
  148. package/.agents/skills/autoconverge/reference/multi-pr.md +0 -128
  149. package/.agents/skills/autoconverge/reference/self-closing-loop.md +0 -84
  150. package/.agents/skills/autoconverge/reference/stop-conditions.md +0 -127
  151. package/.agents/skills/autoconverge/test_portable_pacer_gate.py +0 -54
  152. package/.agents/skills/autoconverge/workflow/.claude/CLAUDE.md +0 -1
  153. package/.agents/skills/autoconverge/workflow/AGENTS.md +0 -1
  154. package/.agents/skills/autoconverge/workflow/aggregate_runs.py +0 -371
  155. package/.agents/skills/autoconverge/workflow/autoconverge_report_constants/.claude/CLAUDE.md +0 -1
  156. package/.agents/skills/autoconverge/workflow/autoconverge_report_constants/AGENTS.md +0 -1
  157. package/.agents/skills/autoconverge/workflow/autoconverge_report_constants/__init__.py +0 -0
  158. package/.agents/skills/autoconverge/workflow/autoconverge_report_constants/render_report_constants.py +0 -250
  159. package/.agents/skills/autoconverge/workflow/converge.clean-audit.test.mjs +0 -665
  160. package/.agents/skills/autoconverge/workflow/converge.codex-gate.test.mjs +0 -472
  161. package/.agents/skills/autoconverge/workflow/converge.contract.test.mjs +0 -64
  162. package/.agents/skills/autoconverge/workflow/converge.copilot-gate.test.mjs +0 -1009
  163. package/.agents/skills/autoconverge/workflow/converge.fix-progress.test.mjs +0 -107
  164. package/.agents/skills/autoconverge/workflow/converge.fix-recovery.test.mjs +0 -33
  165. package/.agents/skills/autoconverge/workflow/converge.merge-conflict.test.mjs +0 -15
  166. package/.agents/skills/autoconverge/workflow/converge.mjs +0 -3132
  167. package/.agents/skills/autoconverge/workflow/converge.p2-advance.test.mjs +0 -202
  168. package/.agents/skills/autoconverge/workflow/converge.path-aware.test.mjs +0 -47
  169. package/.agents/skills/autoconverge/workflow/converge.precatch.test.mjs +0 -152
  170. package/.agents/skills/autoconverge/workflow/converge.run-input.test.mjs +0 -116
  171. package/.agents/skills/autoconverge/workflow/converge_multi.mjs +0 -169
  172. package/.agents/skills/autoconverge/workflow/converge_multi.run-input.test.mjs +0 -173
  173. package/.agents/skills/autoconverge/workflow/convergence_summary.py +0 -110
  174. package/.agents/skills/autoconverge/workflow/fixtures/wf_run/subagents/workflows/wf_881252e6-700/agent-a11d903476b803493.jsonl +0 -2
  175. package/.agents/skills/autoconverge/workflow/fixtures/wf_run/subagents/workflows/wf_881252e6-700/agent-a26213978adeef6fb.jsonl +0 -2
  176. package/.agents/skills/autoconverge/workflow/fixtures/wf_run/subagents/workflows/wf_881252e6-700/agent-a3def0d15ed9d9110.jsonl +0 -2
  177. package/.agents/skills/autoconverge/workflow/fixtures/wf_run/subagents/workflows/wf_881252e6-700/agent-a41f41b1b708ee3b7.jsonl +0 -2
  178. package/.agents/skills/autoconverge/workflow/fixtures/wf_run/subagents/workflows/wf_881252e6-700/agent-a758b880abecc3ff7.jsonl +0 -2
  179. package/.agents/skills/autoconverge/workflow/fixtures/wf_run/subagents/workflows/wf_881252e6-700/agent-a8897b89656b1bd16.jsonl +0 -2
  180. package/.agents/skills/autoconverge/workflow/fixtures/wf_run/subagents/workflows/wf_881252e6-700/agent-ab1c2d3e4f5a6b7c8.jsonl +0 -2
  181. package/.agents/skills/autoconverge/workflow/fixtures/wf_run/subagents/workflows/wf_881252e6-700/agent-abd463d744a1437bc.jsonl +0 -2
  182. package/.agents/skills/autoconverge/workflow/fixtures/wf_run/subagents/workflows/wf_881252e6-700/agent-ad19d027ae8ee1816.jsonl +0 -2
  183. package/.agents/skills/autoconverge/workflow/fixtures/wf_run/workflows/wf_881252e6-700.json +0 -266
  184. package/.agents/skills/autoconverge/workflow/render_report.py +0 -1024
  185. package/.agents/skills/autoconverge/workflow/test_aggregate_runs.py +0 -134
  186. package/.agents/skills/autoconverge/workflow/test_convergence_summary.py +0 -149
  187. package/.agents/skills/autoconverge/workflow/test_render_report.py +0 -812
  188. package/.agents/skills/hitl/SKILL.md +0 -45
  189. package/.agents/skills/pr-cleanup/SKILL.md +0 -140
  190. package/.agents/skills/pr-cleanup/reference/process-inventory.md +0 -17
  191. package/.agents/skills/pr-cleanup/reference/task-seeds.md +0 -22
  192. package/.agents/skills/pr-name-by-capability/SKILL.md +0 -73
  193. package/.agents/skills/pr-name-by-capability/reference/fetch-commands.md +0 -29
  194. package/.agents/skills/pr-name-by-capability/reference/offense-examples.md +0 -32
  195. package/.agents/skills/pr-name-by-capability/reference/report-template.md +0 -29
  196. package/.agents/skills/pr-name-by-capability/reference/rule-checklist.md +0 -38
  197. package/.agents/skills/pr-name-by-capability/reference/task-seeds.md +0 -10
  198. package/.agents/skills/pr-plain-language-cleanup/SKILL.md +0 -93
  199. package/.agents/skills/pr-refinement/SKILL.md +0 -31
  200. package/.agents/skills/pr-shared-extraction/SKILL.md +0 -177
  201. package/.agents/skills/pr-shared-extraction/reference/examples.md +0 -46
  202. package/.agents/skills/pr-shared-extraction/reference/offense-taxonomy.md +0 -100
  203. package/.agents/skills/pr-small-cl/SKILL.md +0 -52
  204. package/.agents/skills/pr-title-description/SKILL.md +0 -96
  205. package/.agents/skills/prototype/SKILL.md +0 -85
  206. package/.agents/skills/prototype/reference/honest-limitations.md +0 -23
  207. package/.agents/skills/prototype/reference/promotion-tasks.md +0 -23
  208. package/.agents/skills/prototype/scripts/build_sandbox_settings.py +0 -249
  209. package/.agents/skills/prototype/scripts/conftest.py +0 -15
  210. package/.agents/skills/prototype/scripts/launch_sandbox.py +0 -205
  211. package/.agents/skills/prototype/scripts/probe_sandbox_safety.py +0 -311
  212. package/.agents/skills/prototype/scripts/prototype_scripts_constants/__init__.py +0 -1
  213. package/.agents/skills/prototype/scripts/prototype_scripts_constants/config/__init__.py +0 -0
  214. package/.agents/skills/prototype/scripts/prototype_scripts_constants/config/build_sandbox_settings_constants.py +0 -41
  215. package/.agents/skills/prototype/scripts/prototype_scripts_constants/config/launch_sandbox_constants.py +0 -23
  216. package/.agents/skills/prototype/scripts/prototype_scripts_constants/config/probe_sandbox_safety_constants.py +0 -45
  217. package/.agents/skills/prototype/scripts/prototype_scripts_constants/config/prototype_common_constants.py +0 -10
  218. package/.agents/skills/prototype/scripts/test_build_sandbox_settings.py +0 -275
  219. package/.agents/skills/prototype/scripts/test_launch_sandbox.py +0 -303
  220. package/.agents/skills/prototype/scripts/test_probe_sandbox_safety.py +0 -312
  221. package/.agents/skills/prototype/workflows/promotion.md +0 -25
  222. package/.agents/skills/prototype/workflows/sandbox.md +0 -35
  223. package/.agents/skills/rebase/.claude/CLAUDE.md +0 -1
  224. package/.agents/skills/rebase/AGENTS.md +0 -1
  225. package/.agents/skills/rebase/SKILL.md +0 -178
  226. package/.agents/skills/review-router/SKILL.md +0 -51
  227. package/.agents/skills/review-router/reference/route-policy.json +0 -7
  228. package/.agents/skills/review-router/reference/task-seeds.md +0 -1
  229. package/.agents/skills/review-router/scripts/conftest.py +0 -4
  230. package/.agents/skills/review-router/scripts/review_router.py +0 -50
  231. package/.agents/skills/review-router/scripts/review_router_cli.py +0 -211
  232. package/.agents/skills/review-router/scripts/review_router_constants/__init__.py +0 -1
  233. package/.agents/skills/review-router/scripts/review_router_constants/config/__init__.py +0 -0
  234. package/.agents/skills/review-router/scripts/review_router_constants/config/constants.py +0 -13
  235. package/.agents/skills/review-router/scripts/test_review_router.py +0 -23
  236. package/.agents/skills/review-router/scripts/test_review_router_cli.py +0 -47
  237. package/.agents/skills/review-tier/SKILL.md +0 -56
  238. package/.agents/skills/review-tier/reference/task-seeds.md +0 -1
  239. package/.agents/skills/review-tier/reference/tier-policy.json +0 -9
  240. package/.agents/skills/review-tier/scripts/conftest.py +0 -4
  241. package/.agents/skills/review-tier/scripts/review_tier.py +0 -359
  242. package/.agents/skills/review-tier/scripts/review_tier_constants/__init__.py +0 -1
  243. package/.agents/skills/review-tier/scripts/review_tier_constants/config/__init__.py +0 -0
  244. package/.agents/skills/review-tier/scripts/review_tier_constants/config/constants.py +0 -29
  245. package/.agents/skills/review-tier/scripts/test_generation.py +0 -159
  246. package/.agents/skills/review-tier/scripts/test_review_tier.py +0 -33
  247. package/.agents/skills/run-claude-dev-env/SKILL.md +0 -84
  248. package/.agents/skills/session-log/.claude/CLAUDE.md +0 -1
  249. package/.agents/skills/session-log/AGENTS.md +0 -1
  250. package/.agents/skills/session-log/SKILL.md +0 -170
  251. package/.agents/skills/session-log/templates/frontmatter.md +0 -40
  252. package/.agents/skills/session-tidy/.claude/CLAUDE.md +0 -1
  253. package/.agents/skills/session-tidy/AGENTS.md +0 -1
  254. package/.agents/skills/session-tidy/SKILL.md +0 -191
  255. package/.agents/skills/skill-builder/references/.claude/CLAUDE.md +0 -1
  256. package/.agents/skills/skill-builder/references/AGENTS.md +0 -1
  257. package/.agents/skills/skill-builder/references/delegation-map.md +0 -130
  258. package/.agents/skills/skill-builder/references/description-field.md +0 -111
  259. package/.agents/skills/skill-builder/references/deterministic-elements.md +0 -218
  260. package/.agents/skills/skill-builder/references/progressive-disclosure.md +0 -122
  261. package/.agents/skills/skill-builder/references/self-audit-checklist.md +0 -126
  262. package/.agents/skills/skill-builder/references/skill-modularity.md +0 -111
  263. package/.agents/skills/skill-builder/references/skill-types.md +0 -232
  264. package/.agents/skills/skill-builder/references/thariq-x-post-skills.json +0 -33
  265. package/.agents/skills/skill-builder/templates/.claude/CLAUDE.md +0 -1
  266. package/.agents/skills/skill-builder/templates/AGENTS.md +0 -1
  267. package/.agents/skills/skill-builder/templates/gap-analysis.md +0 -87
  268. package/.agents/skills/skill-builder/workflows/.claude/CLAUDE.md +0 -1
  269. package/.agents/skills/skill-builder/workflows/AGENTS.md +0 -1
  270. package/.agents/skills/skill-builder/workflows/improve-skill.md +0 -136
  271. package/.agents/skills/skill-builder/workflows/new-skill.md +0 -179
  272. package/.agents/skills/skill-builder/workflows/polish-skill.md +0 -139
  273. package/.agents/skills/source-command-sr-loop/SKILL.md +0 -82
  274. package/.agents/skills/update/.claude/CLAUDE.md +0 -1
  275. package/.agents/skills/update/AGENTS.md +0 -1
  276. package/.agents/skills/update/SKILL.md +0 -190
  277. package/_shared/pr-loop/AGENTS.md +0 -1
  278. package/_shared/pr-loop/CLAUDE.md +0 -1
  279. package/_shared/pr-loop/audit-contract.md +0 -183
  280. package/_shared/pr-loop/audit-reply-template.md +0 -151
  281. package/_shared/pr-loop/code-rules-gate.md +0 -65
  282. package/_shared/pr-loop/fix-protocol.md +0 -60
  283. package/_shared/pr-loop/gh-payloads.md +0 -75
  284. package/_shared/pr-loop/post-audit-thread-contract.md +0 -51
  285. package/_shared/pr-loop/precatch-rubric.md +0 -66
  286. package/_shared/pr-loop/preflight-proposal.md +0 -56
  287. package/_shared/pr-loop/scripts/post_audit_thread.py +0 -1242
  288. package/_shared/pr-loop/scripts/pr_loop_shared_constants/post_audit_thread_constants.py +0 -199
  289. package/_shared/pr-loop/scripts/tests/test_post_audit_thread.py +0 -1115
  290. package/_shared/pr-loop/scripts/tests/test_post_audit_thread_constants.py +0 -129
  291. package/_shared/pr-loop/state-schema.md +0 -45
  292. package/_shared/pr-loop/worker-spawn.md +0 -189
  293. /package/{.agents/skills/_shared/pr-loop/scripts → scripts}/test_durable_post_lint.py +0 -0
@@ -1,431 +0,0 @@
1
- ---
2
- name: autoconverge
3
- description: >-
4
- Drives one draft PR to convergence in one autonomous run with a host-selected
5
- pacer. On workflow: three parallel lenses (code-review, bug-audit, self-review)
6
- and one-commit fixes via converge.mjs. On portable: pr-converge continuous ticks
7
- via portable-driver.md. Bugbot, Copilot, and Codex as terminal confirmation
8
- gates before ready. Use when the user says '/autoconverge', 'autoconverge this
9
- PR', 'converge this PR in one run', 'run the converge workflow', or 'drive the
10
- PR to ready autonomously'.
11
- ---
12
-
13
- # Autoconverge
14
-
15
- One launch drives the whole loop to convergence. The `/autoconverge` skill
16
- scans the tool list, selects a **pacer** (Workflow or portable), then resolves
17
- PR scope, enters a worktree, grants project permissions, and drives the shared
18
- converge product to ready (or a named blocker).
19
-
20
- | Pacer | Host surface | How the loop runs |
21
- |---|---|---|
22
- | `workflow` | Tool list includes `Workflow` | `converge.mjs` background pass; state in the workflow journal |
23
- | `portable` | `Workflow` absent | Continuous in-session ticks per [`../_shared/pr-loop/portable-driver.md`](../_shared/pr-loop/portable-driver.md); same helpers and `check_convergence.py` ready definition |
24
-
25
- `pr-converge` selects `schedule_wakeup` or `portable` the same way. Both
26
- entry skills share the helper scripts and the convergence gate.
27
-
28
- ## Run scope: one PR or several
29
-
30
- Decide the scope from how many PRs the user named, then follow that path:
31
-
32
- 1. **One PR** → the single-PR run described below: one worktree, one pacer
33
- launch (`converge.mjs` on `pacer=workflow`, portable continuous ticks on
34
- `pacer=portable`), one teardown.
35
- 2. **Several PRs** → the [Multiple PRs](reference/multi-pr.md) run: on
36
- `pacer=workflow`, `workflow/converge_multi.mjs` drives every PR in parallel;
37
- on `pacer=portable`, run the portable driver once per PR (serial or host
38
- fan-out), then one teardown per PR.
39
-
40
- The single-PR sections (Requirements, Pre-flight, Run the workflow or portable
41
- driver, Teardown) each describe one converge run. The multi-PR reference reuses
42
- them once per PR and adds only what fanning out needs: a per-PR worktree and a
43
- per-PR teardown loop.
44
-
45
- ## Requirements
46
-
47
- Scan the tool list for `Workflow` and `ScheduleWakeup`, then select the pacer:
48
-
49
- ```
50
- python "$HOME/.claude/skills/_shared/pr-loop/scripts/select_converge_pacer.py" \
51
- --skill autoconverge \
52
- --has-workflow <0|1> \
53
- --has-schedule-wakeup <0|1>
54
- ```
55
-
56
- - `pacer=workflow` — continue with Pre-flight and **Run the workflow** below.
57
- - `pacer=portable` — continue with Pre-flight (portable worktree rules when
58
- `EnterWorktree` is absent), then the continuous driver in
59
- [`../_shared/pr-loop/portable-driver.md`](../_shared/pr-loop/portable-driver.md).
60
- **Do not abort** because the Workflow tool is missing.
61
-
62
- Set the GitHub transport directive before any GitHub step. Use `transport: "cloud"` in a
63
- Cloud session. Use `transport: "local"` in a local session. Cloud uses the
64
- connected GitHub MCP tools and never starts a local GitHub CLI authentication
65
- flow.
66
-
67
- ## Review-lens boundary
68
-
69
- The code-review lens boundary (workflow agent versus the built-in `/code-review`
70
- command) is defined on the **Code-review lens** bullet in
71
- [`reference/convergence.md`](reference/convergence.md).
72
-
73
- ## Select the GitHub transport directive before any GitHub step
74
-
75
- In a Cloud session, set `transport: "cloud"` and load the GitHub MCP schemas
76
- before the first GitHub tool call. Do not run any local GitHub CLI
77
- authentication, account-switch, or token command. Use the operation in
78
- [`cloud-pr-loop-compatibility.md`](../../../docs/references/cloud-pr-loop-compatibility.md)
79
- for each GitHub read or write. Use the Cloud session's credentialed push path
80
- for local commits. If that path rejects a push, report the exact error instead
81
- of trying to log in through the local CLI.
82
-
83
- In a local session, set `transport: "local"` and use the authenticated local
84
- GitHub CLI. The workflow defaults to this value when older callers omit the
85
- field.
86
-
87
- ## Pre-flight (main session)
88
-
89
- 0. **Build the task list (step 1 of every run).** After Copilot quota / down
90
- flags and Codex required/down are known, run only:
91
-
92
- ```
93
- python "$HOME/.claude/skills/_shared/pr-loop/scripts/build_converge_task_list.py" \
94
- --bugbot-down <0|1> --copilot-down <0|1> \
95
- --codex-down <0|1> --codex-required <0|1>
96
- ```
97
-
98
- Register every `tasks[]` entry on the session task list. **Final task** is
99
- always `all_runnable_reviews_clean_same_head` (`done_when` in the JSON).
100
- The run is complete only when that final task is completed — all runnable
101
- code reviews CLEAN on the same HEAD. Do not invent tasks in prose. On
102
- `pacer=portable`, `open-run` returns the same list; still register it as
103
- step 1 before driving reviews.
104
-
105
- 1. **Enter a worktree.** When `EnterWorktree` is in the tool list, call it with
106
- no arguments before any `gh`, `git`, file read, or edit. `gh`/`git` Bash
107
- calls do not auto-isolate, so isolation is mandatory. If it fails, report
108
- and stop. A bare `EnterWorktree` branches from `origin/main`; step 2
109
- positions the worktree on the PR's head ref. When `EnterWorktree` is
110
- absent, isolate with git worktree machinery per
111
- [`../_shared/pr-loop/portable-driver.md`](../_shared/pr-loop/portable-driver.md)
112
- § Isolation and worktree, then continue step 2.
113
-
114
- 2. **Resolve PR scope.** When the user passed a PR URL or number, parse owner,
115
- repo, and number from it. Otherwise read the current branch's PR:
116
- `gh pr view --json number,headRefName,url,isDraft,baseRefName`. Capture
117
- `owner`, `repo`, `prNumber`. Confirm the PR is a draft; if it is already
118
- ready, mark it draft first (`gh pr ready <n> --repo <o>/<r> --undo`) so the
119
- loop owns the ready transition.
120
-
121
- **Position the worktree on the PR branch.** The run reviews
122
- `git diff origin/main...HEAD` against this worktree's local `HEAD` and pushes
123
- each fix to the PR branch, so the worktree sits on the PR's head ref at the PR
124
- HEAD before the loop starts. A worktree fresh off `origin/main` has
125
- `HEAD == origin/main`, shows an empty diff, and reports a false convergence
126
- with zero findings. When a local worktree already tracks the PR branch, enter
127
- that one (pass its path to `EnterWorktree` when that tool exists; otherwise
128
- `cd` into it). Otherwise put the checkout on the branch with
129
- `gh pr checkout <number> --repo <owner>/<repo>`
130
- (or `git fetch origin <headRefName>` then `git switch <headRefName>`). Confirm
131
- before launching: `git rev-parse --abbrev-ref HEAD` equals the PR's head ref
132
- and local `HEAD` equals the PR head SHA.
133
-
134
- 3. **Verify the worktree is the PR's repo (strict pre-flight).** Run
135
- `python "$HOME/.claude/skills/_shared/pr-loop/scripts/preflight_worktree.py" --owner <owner> --repo <repo> --mode strict`.
136
- It confirms the working directory is a checkout of the PR's own repo and
137
- that `git worktree` machinery is healthy. A non-zero exit prints a
138
- `PREFLIGHT_OUTCOME` line and an `ABORT` line: report that line and stop.
139
- Autoconverge runs inside the PR's own repo, so a working directory rooted in
140
- a different repo (for example, `claude-dev-env` while the PR lives in
141
- `llm-settings`) or in no git checkout at all cannot continue.
142
-
143
- 4. **Grant project permissions.** Apply the `pr-loop-lifecycle` skill's Open
144
- section (`../pr-loop-lifecycle/SKILL.md`) — the grant command
145
- (`grant_project_claude_permissions.py`) and the auto-mode `AskUserQuestion`
146
- escalation for a blocked grant both live there.
147
-
148
- 5. **Copilot quota pre-check.** Before the pacer starts the loop, apply the
149
- `reviewer-gates` skill's Copilot quota gate (`../reviewer-gates/SKILL.md`)
150
- once. Exit 0 maps to `copilotDisabled: false` / `copilot_down=false`; any
151
- non-zero exit maps to `copilotDisabled: true` / `copilot_down=true`, and the
152
- run skips the Copilot gate with no agent spawned.
153
-
154
- 6. **Branch on pacer.** When `pacer=portable`, follow
155
- [`../_shared/pr-loop/portable-driver.md`](../_shared/pr-loop/portable-driver.md)
156
- § Continuous tick loop and § Autoconverge entry on portable pacer, then
157
- skip **Run the workflow** (no Workflow tool). When `pacer=workflow`,
158
- continue with **Run the workflow**.
159
-
160
- ## Run the workflow
161
-
162
- (`pacer=workflow` only.) Call the `Workflow` tool against the colocated script:
163
-
164
- ```
165
- Workflow({
166
- scriptPath: "<this skill dir>/workflow/converge.mjs",
167
- args: { owner: "<O>", repo: "<R>", prNumber: <N>, bugbotDisabled: false, copilotDisabled: false, homeDirectory: "<HOME>", transport: "<cloud|local>" }
168
- })
169
- ```
170
-
171
- `scriptPath` is the absolute path to `workflow/converge.mjs` inside this skill's
172
- own directory (on this install,
173
- `<home>/.claude/skills/autoconverge/workflow/converge.mjs`). `homeDirectory` is
174
- the absolute path to the directory that holds `.claude` (resolve it once from
175
- `$HOME`, or `$env:USERPROFILE` on Windows, with forward slashes). The workflow
176
- runs in a sandbox with no access to environment variables, so the run reads the
177
- home directory from this arg to build the path to the codex-review scripts the
178
- Codex gate calls; leave it out and the Codex gate cannot find those scripts. Set
179
- `transport: "cloud"` for Cloud and `transport: "local"` for local execution.
180
- Set `bugbotDisabled: true` only when the user has opted Cursor Bugbot out for the
181
- run; otherwise the workflow detects an opt-out or an unreachable Bugbot on its
182
- own. Set `copilotDisabled: true` when the step 5 quota pre-check exits non-zero,
183
- and `false` when it exits 0; on `true` the workflow skips the Copilot gate with
184
- no agent spawned. The workflow runs in the background and notifies this session
185
- on completion. Watch live progress with `/workflows`.
186
-
187
- The moment the `Workflow` call returns its run id, write the durable handoff so a
188
- fresh session can resume the same run:
189
-
190
- ```
191
- python "$HOME/.claude/skills/_shared/pr-loop/scripts/write_handoff.py" \
192
- --pr-number <N> --head-ref <branch> --phase workflow \
193
- --resume-command "Workflow({scriptPath, resumeFromRunId: '<runId>'})" \
194
- --run-id <runId>
195
- ```
196
-
197
- Write it again when the result lands, so the handoff carries the final run id and
198
- names the teardown phase the fresh session picks up from.
199
-
200
- The workflow returns
201
- `{ converged, rounds, finalSha, blocker, standardsNote, copilotNote, codexNote, cleanAuditNote, reuseNote, deferredPrs }`,
202
- plus a `userReview` field on a `blocker: "user-review"` return. `cleanAuditNote` is
203
- non-null when the environment refused the CLEAN bugteam review post and the run
204
- recorded the bypass — see
205
- [`reference/stop-conditions.md`](reference/stop-conditions.md) § Clean-audit post
206
- bypassed.
207
- `deferredPrs` is the list of draft environment-hardening PRs the standards-deferral
208
- path opened this run, each as `{ owner, repo, prNumber, copilotDisabled, bugbotDisabled }`.
209
- The two flags carry this run's Copilot and Bugbot availability, so the next generation
210
- skips a reviewer that is down or out of quota without re-probing. This list is the seed the
211
- [self-closing loop](reference/self-closing-loop.md) converges next.
212
-
213
- ## Copilot findings — tier, verify, then route
214
-
215
- The Copilot gate tiers each finding: a **self-healing** finding (style, type
216
- hints, imports, formatting, magic-value extraction, test-only or doc-vs-code
217
- fixes — nothing that changes observable runtime behavior) flows into the fix
218
- round with no user notification. A **code-concern** finding (logic, security,
219
- data handling, error-handling semantics, concurrency — the tier whenever in
220
- doubt) goes to a verification stage before any routing.
221
-
222
- Each code-concern finding gets its own verifier agent, all in parallel, inside
223
- the workflow. A verdict is conclusive only when an actual check ran: the verifier
224
- executes a command against the flagged HEAD — running the code path with crafted
225
- inputs, forcing the claimed error condition, or running a purpose-built test —
226
- and captures its output. The verdict carries
227
- `{ verdict, checkCommand, checkOutput, evidence }`; a conclusive verdict with an
228
- empty `checkCommand` or `checkOutput` downgrades to inconclusive.
229
-
230
- - **confirmed** — the check reproduces the defect. The finding becomes
231
- self-healing: it joins the fix round carrying its repro, and the fix re-runs
232
- that same check, adds a regression test where the suite covers the surface,
233
- lands in one commit, pushes, and replies on the thread with the fix SHA and the
234
- before/after output. No page.
235
- - **refuted** — the check shows the code already behaves correctly in the exact
236
- scenario the finding claims is broken. The workflow replies on the thread with
237
- the command and output, resolves it, and counts it clean. No page.
238
- - **inconclusive** — everything else, and the verifier's default: no runnable
239
- check exists, the check is infeasible here, the results are ambiguous, or the
240
- fix needs a product decision. Any doubt sorts here. Only inconclusive findings
241
- page the user.
242
-
243
- A round whose code concerns all confirm or refute never returns
244
- `blocker: "user-review"`. On one or more inconclusive findings, the workflow
245
- stops with `converged: false`, `blocker: "user-review"`, and a `userReview`
246
- field carrying
247
- `{ reviewUrl, findings: [{ file, line, severity, tier, title, evidence }] }` —
248
- `evidence` is the verifier's one-line note stating what check was attempted and
249
- why it was not decisive.
250
-
251
- The wait for a human belongs to the orchestrating session. On a
252
- `blocker: "user-review"` return, run the
253
- [`copilot-finding-triage`](../copilot-finding-triage/SKILL.md) skill for the ntfy
254
- page only (the per-finding summary and evidence note plus the `reviewUrl`
255
- Copilot review link), then hold for the user's response by pacer. On
256
- `pacer=portable`, override triage's hold step — ntfy plus the portable hold
257
- below; do not follow triage's `ScheduleWakeup` / `send_later` path.
258
-
259
- - **`pacer=workflow`** — triage hold: 45-minute `ScheduleWakeup` (or
260
- `send_later` when that is the host arm).
261
- - **`pacer=portable`** — portable hold only: in-session poll or handoff per
262
- [`../_shared/pr-loop/portable-driver.md`](../_shared/pr-loop/portable-driver.md);
263
- never `ScheduleWakeup` or `send_later`.
264
-
265
- When the user answers within the window, follow their direction. When the
266
- window closes with no response, run normal teardown and report the
267
- inconclusive findings un-reviewed.
268
-
269
- ## Budget stop
270
-
271
- Branch the stop and resume path on the selected pacer. Full rule:
272
- [`reference/stop-conditions.md`](reference/stop-conditions.md) § Budget stop.
273
-
274
- - **`pacer=workflow`** — `converge.mjs` paces against the workflow `budget` API
275
- and stops at a round boundary when a full round does not fit. On a
276
- `blocker: "budget"` return, write the durable handoff with the run id and the
277
- `Workflow({scriptPath, resumeFromRunId})` resume command before stopping, so a
278
- fresh session resumes the paced run without the stopped session's transcript.
279
- - **`pacer=portable`** — stop at a tick boundary when the session cannot cover a
280
- full clean tick; write the durable handoff and resume with
281
- `/autoconverge <PR URL>` (see
282
- [`../_shared/pr-loop/portable-driver.md`](../_shared/pr-loop/portable-driver.md)).
283
- Do not instruct a Workflow resume on the portable path.
284
-
285
- ## Teardown
286
-
287
- ### `pacer=portable`
288
-
289
- Skip Workflow-only report steps that need a workflow run id (journal merge,
290
- HTML closing report, Artifact publish). Run `pr-loop-lifecycle` Close
291
- (description rewrite when converged, working-tree clean, permission revoke)
292
- and print the final report block using tick/`check_convergence` outcomes.
293
- User-review holds use the portable in-session poll (or handoff) from
294
- [`../_shared/pr-loop/portable-driver.md`](../_shared/pr-loop/portable-driver.md)
295
- — not `ScheduleWakeup`. Resume command: `/autoconverge <PR URL>`.
296
-
297
- ### `pacer=workflow` (on workflow completion)
298
-
299
- Teardown runs as an ordered checkpoint list. After each checkpoint finishes,
300
- re-write the durable handoff with `--phase teardown`, the run id, and the
301
- checkpoints done so far, so a fresh session that resumes reads `handoff.json`
302
- `completed_steps` and skips the checkpoints already done:
303
-
304
- ```
305
- python "$HOME/.claude/skills/_shared/pr-loop/scripts/write_handoff.py" \
306
- --pr-number <N> --head-ref <branch> --phase teardown \
307
- --resume-command "/autoconverge <PR URL>" \
308
- --run-id <runId> \
309
- --completed-steps "<checkpoints done so far>"
310
- ```
311
-
312
- The checkpoints run in this order: `report`, `close`. Write the
313
- handoff after each one finishes.
314
-
315
- On teardown entry, when `~/.claude/runtime/pr-loop/bugteam-pr-<N>/handoff.json`
316
- exists, read its `completed_steps` and skip any checkpoint the list already
317
- names, so a resumed run performs only the checkpoints left.
318
-
319
- On a `blocker: "user-review"` return under `pacer=workflow`, the workflow held
320
- one or more code-concern findings that stayed inconclusive after the
321
- executed-check verification stage. Run the
322
- [`copilot-finding-triage`](../copilot-finding-triage/SKILL.md) gate before
323
- teardown: send the ntfy alert with the per-finding summary and evidence note and
324
- the `userReview.reviewUrl` link, then hold with a 45-minute `ScheduleWakeup` (or
325
- `send_later` when that is the host arm). Act on the user's direction when it
326
- arrives inside the window; when the window closes with no response, fall through
327
- to normal teardown and report the `userReview.findings` un-reviewed. The PR
328
- stays a draft in this path — the workflow marked nothing ready. Under
329
- `pacer=portable`, use the portable teardown hold above (ntfy plus in-session
330
- poll or handoff; never `ScheduleWakeup`).
331
-
332
- Before the checkpoints, when the workflow returned a non-null `copilotNote`
333
- (the Copilot gate was bypassed), query the PR's reviews once more for a
334
- `copilot-pull-request-reviewer[bot]` review on the final HEAD
335
- (`fetch_copilot_reviews.py`, or the GitHub MCP `pull_request_read` method
336
- `get_reviews`). Copilot typically posts within 10–15 minutes of a request, so
337
- a review can land between the bypass and teardown. When one exists and
338
- carries findings, mark the PR draft, route the findings through one fix
339
- round per the `pr-fix-protocol` skill, re-verify, push, and mark the PR
340
- ready again — then run the checkpoints.
341
-
342
- 1. **When `converged` is true — build and publish the closing report.**
343
- Skip this entire step (report, artifact publish, comment, Chrome open) when
344
- the workflow returned a non-null `blocker`. Follow
345
- [`reference/closing-report.md`](reference/closing-report.md) § Building the
346
- report and § Publishing: resolve the seed journal from the run id, merge the
347
- PR's runs with `aggregate_runs.py`, spawn the `convergence-summary` agent
348
- (a `general-purpose` subagent) on the prompt it builds, draw the report with
349
- `render_report.py`, publish the HTML via the `Artifact` tool, post the
350
- one marker-keyed `<!-- autoconverge-report -->` PR comment, and open the
351
- artifact URL in Chrome. After the report is published, write the handoff
352
- with `--completed-steps "report"`.
353
-
354
- 2. **Close the run.** Apply the `pr-loop-lifecycle` skill's Close section
355
- (`../pr-loop-lifecycle/SKILL.md`): when `converged` is true, rewrite the PR
356
- description and clean the working tree — see
357
- [`pr-loop-lifecycle/reference/teardown-publish-permissions.md` § Clean working tree and § Publish the final PR description](../pr-loop-lifecycle/reference/teardown-publish-permissions.md);
358
- the workflow already marked the PR ready. The permission revoke always runs,
359
- including on a blocker exit. Write the handoff with
360
- `--completed-steps "report,close"`.
361
-
362
- 3. **Print the final report:**
363
-
364
- ```
365
- /autoconverge exit: <converged | blocked>
366
- Rounds: <N>
367
- Final commit: <finalSha>
368
- Blocker: <blocker> # only when blocked
369
- Standards: <standardsNote> # only when a round deferred code-standard findings
370
- Copilot: <copilotNote> # only when Copilot was down or out of quota
371
- Codex: <codexNote> # only when the Codex gate was bypassed (codex_down or opt-out)
372
- Clean-audit: <cleanAuditNote> # only when the CLEAN bugteam post was bypassed
373
- Reuse: <reuseNote> # only when the reuse pass identified an improvement
374
- ```
375
-
376
- ## What the workflow does each round
377
-
378
- [`reference/convergence.md`](reference/convergence.md) defines the whole loop:
379
- the merge-conflict pre-flight, the reuse pass and its three landing criteria,
380
- the round shape (static sweep, the three parallel reading lenses, dedup, the
381
- one-commit fix flow, the standards-deferral path), the terminal Bugbot, Copilot,
382
- and Codex gates, the per-role model tiers, the full-diff rule, and the exact
383
- ready definition `check_convergence.py` enforces.
384
- [`reference/stop-conditions.md`](reference/stop-conditions.md) lists every way
385
- the run ends short of ready. Hard-won failure lessons live in
386
- [`reference/gotchas.md`](reference/gotchas.md).
387
-
388
- Every agent prompt the workflow authors carries a headless-safety preamble —
389
- read-only agents get a trimmed form, edit agents the full form with the rm
390
- auto-allow paths — specified in
391
- [`reference/headless-safety.md`](reference/headless-safety.md).
392
-
393
- ## Multiple PRs
394
-
395
- When the user names several PRs, run the multi-PR path in
396
- [`reference/multi-pr.md`](reference/multi-pr.md): one worktree per PR
397
- (`git worktree add` on each head ref, strict pre-flight per worktree, one
398
- permission grant per repository, one Copilot quota check for the whole run),
399
- then launch by pacer — `pacer=workflow`: one `workflow/converge_multi.mjs`
400
- call with one entry per PR; `pacer=portable`: portable driver once per PR
401
- (serial or host fan-out) — then single-PR teardown once per PR and a
402
- one-line-per-PR summary.
403
-
404
- ## Self-closing loop: converge the deferred PRs
405
-
406
- Every autoconverge run — single-PR and multi-PR alike — ends with the
407
- self-closing loop in
408
- [`reference/self-closing-loop.md`](reference/self-closing-loop.md): the
409
- orchestrating session converges the draft environment-hardening PRs the run
410
- deferred (`deferredPrs` on a single-PR run, `allDeferredPrs` on a multi-PR
411
- run), then the PRs those runs defer, generation by generation, until a
412
- generation opens none. An empty seed list ends the loop at once. The reference
413
- also carries the Conventional-Commit title rule each hardening PR must meet.
414
-
415
- ## Folder map
416
-
417
- - `SKILL.md` — this hub.
418
- - [`../_shared/pr-loop/portable-driver.md`](../_shared/pr-loop/portable-driver.md) — portable pacer when `Workflow` is absent.
419
- - `workflow/converge.mjs` — the convergence workflow script.
420
- - `workflow/converge_multi.mjs` — the multi-PR fan-out driver: one `converge.mjs` child run per PR in parallel, each pinned to its PR worktree via `repoPath`.
421
- - `workflow/aggregate_runs.py` — merges every autoconverge journal for a PR into one journal and returns its deduped findings, fix summaries, round count, and final SHA.
422
- - `workflow/convergence_summary.py` — builds the convergence-summary agent prompt over a PR's merged findings.
423
- - `workflow/render_report.py` — builds the closing convergence insights HTML report, taking the summary from `--summary-file`.
424
- - `workflow/autoconverge_report_constants/` — named constants for the report builder and the summary prompt.
425
- - `reference/convergence.md` — the whole loop: reuse pass, round shape, terminal gates, model tiers, ready definition.
426
- - `reference/stop-conditions.md` — every way the run ends short of ready, including the budget stop.
427
- - `reference/gotchas.md` — hard-won failure lessons.
428
- - `reference/closing-report.md` — the closing HTML report: data source, build steps, publishing.
429
- - `reference/multi-pr.md` — the several-PRs path: per-PR worktrees, the `converge_multi.mjs` launch, per-PR teardown.
430
- - `reference/self-closing-loop.md` — the deferred-PR generations and the Conventional-Commit title rule.
431
- - `reference/headless-safety.md` — the agent-prompt preamble and the rm auto-allow paths.
@@ -1 +0,0 @@
1
- @../AGENTS.md
@@ -1,93 +0,0 @@
1
- # Closing Report
2
-
3
- When an autoconverge run converges (the workflow returns `converged: true`), the main session generates a convergence insights HTML report and publishes it with the `Artifact` tool, with an idempotent PR comment linking to it.
4
-
5
- ## Data source
6
-
7
- A PR's full convergence is the union of every autoconverge run it took. `aggregate_runs.py` finds all of them and merges them into one run tree the report reads:
8
-
9
- - **Run journals** — `~/.claude/projects/**/workflows/wf_<runId>.json` — each carries the PR args, round log lines, a `workflowProgress` array (one entry per agent step), and the run result. `aggregate_runs.py` picks every journal whose `args` owner/repo/prNumber match the PR and whose `workflowName` is `autoconverge`, orders them by timestamp, and concatenates their `workflowProgress` into one merged journal under the work directory.
10
- - **Agent transcripts** — `~/.claude/projects/**/subagents/workflows/<runId>/agent-<agentId>.jsonl` — one file per agent; each line is a JSON object. The merge copies every referenced transcript into the merged run tree, so the report reader extracts the last `StructuredOutput` tool_use from each exactly as it would for a single run.
11
-
12
- The merged journal's round count is the number of `resolve-head` steps across every run, and its final SHA is the latest run's result SHA.
13
-
14
- ## Convergence summary
15
-
16
- The plain-language account of what the PR does and what the run caught is written at teardown, over the merged findings. `convergence_summary.py` builds the agent prompt from the deduped findings and the per-round fix summaries `aggregate_runs.py` returns; the teardown spawns a `convergence-summary` agent on that prompt; the agent's JSON answer is the summary. `render_report.py --summary-file <path>` reads that JSON and draws from it, so the summary needs no journal transcript of its own.
17
-
18
- The summary carries the structured visual data the report draws:
19
-
20
- - `prProblem` and `prFix` — one plain sentence each: the problem this PR solves and the change that solves it.
21
- - `problemScenes` and `fixScenes` — short cause→effect scenes. Each scene has a `trigger`, an optional `condition`, a `result`, and a one-line `caption`. A fix scene mirrors a problem scene with a good result.
22
- - `verdictLine` — one factual sentence: converged, the distinct issue-class count, all fixed or deferred.
23
- - `issueClasses` — one entry per distinct kind of problem, each with a `plainName`, a `count`, a `severity`, a `category`, a `status`, a plain `cause`, a `medium` (`terminal`, `code`, or `text`) that tells the report how to draw the before/after panels, and the literal `beforeLines` and `afterLines` shown in those panels. There is one class per kind, however many kinds there are — kinds are never folded together or dropped to hit a number.
24
-
25
- Python owns the counts, severity, and file:line; the summary agent owns the plain-language narrative. The report draws the same HTML each time it runs over the same merged journal and summary.
26
-
27
- ## What the report draws
28
-
29
- The report body, in order:
30
-
31
- 1. A title and a subtitle (owner/repo, component when it can be derived, finding count over round count, date).
32
- 2. A **verdict banner** — a check circle, the `verdictLine`, and a Python-computed line giving the fix-commit count and the final short SHA.
33
- 3. **What this PR does** — a problem card and a fix card. Each card draws its scenes as a trigger chip → optional condition → result, each with its caption. When a scene list is empty, the card falls back to drawing `prProblem` or `prFix` as a single caption line.
34
- 4. **What was caught — and how it looked** — a lead line stating the bug-class count, the total finding count, the round count, and the fix-commit count, then one block per issue class: a name heading with a finding-count chip, a before panel and an after panel drawn in the style its `medium` names (a dark terminal window, a light code panel, or plain lines), and a cause line that states the plain cause plus a muted note with severity, category, count, and status. When both line lists are empty, the block drops to its heading and cause line.
35
- 5. A footer (owner/repo, PR, findings, rounds, fix commits, generated date).
36
-
37
- A collapsed `<details>` raw-findings appendix (`file:line — P# — title`) closes the body and keeps the engineer grounding one click away.
38
-
39
- When the summary is absent, the report falls back to a minimal layout: the title, the subtitle, a plain run-stats note, and the collapsed raw-findings appendix.
40
-
41
- ## Building the report
42
-
43
- Three steps run at teardown, each a separate process. Working files go under
44
- `$CLAUDE_JOB_DIR/tmp/` named by PR number — the work dir as
45
- `autoconverge-agg-<prNumber>`, the prompt as
46
- `autoconverge-summary-prompt-<prNumber>.txt`, the summary as
47
- `autoconverge-summary-<prNumber>.json`, and the report as
48
- `autoconverge-report-<prNumber>.html`:
49
-
50
- 1. **Merge the runs and build the summary prompt.**
51
- ```
52
- python "<skill>/workflow/aggregate_runs.py" \
53
- --journal "<seed journal path>" \
54
- --pr <owner>/<repo>#<n> \
55
- --work-dir "<work dir>" \
56
- --out-prompt "<prompt path>.txt" \
57
- [--standards-note "<note>"] [--copilot-note "<note>"]
58
- ```
59
- `--journal` is any one of the PR's journals — the seed that locates the rest.
60
- Resolve it by globbing `~/.claude/projects/**/workflows/wf_<runId>.json`,
61
- where `runId` is the run id the `Workflow` result returned. The script prints a JSON line carrying `combinedJournal`, `roundCount`, `finalSha`, and `findingCount`.
62
-
63
- 2. **Write the summary.** Spawn a `convergence-summary` agent on the prompt file's text. Its JSON answer — the `prProblem`/`prFix`/`problemScenes`/`fixScenes`/`verdictLine`/`issueClasses` object — goes to a `.json` file.
64
-
65
- 3. **Draw the report.**
66
- ```
67
- python "<skill>/workflow/render_report.py" \
68
- --journal "<combinedJournal>" \
69
- --summary-file "<summary json path>" \
70
- --out "<output path>.html" \
71
- --pr <owner>/<repo>#<n> \
72
- --final-sha <finalSha> \
73
- --rounds <roundCount>
74
- ```
75
- The script reads the merged journal and transcripts, counts findings by severity and fix commits, takes the summary from `--summary-file`, draws the visual report, and writes a self-contained HTML file. It prints the output path to stdout and exits 0 on success.
76
-
77
- Counting is deterministic: `generated_date` comes from the journal `timestamp`, not the system clock, so the same merged journal and summary always produce the same HTML.
78
-
79
- ## Publishing
80
-
81
- After rendering, the main session:
82
-
83
- 1. **Publishes the HTML with the Artifact tool.** Loads the `artifact-design` skill first, then calls `Artifact` with `file_path` set to the rendered report, `favicon` set to the fixed autoconverge favicon `✅` (kept stable across every autoconverge report), and `description` naming the PR. Captures the returned URL.
84
- 2. **Posts one idempotent PR comment** marked with `<!-- autoconverge-report -->`. If a comment with that marker already exists on the PR, it is edited in place; otherwise a new comment is created. The body leads with the artifact URL, then the one-sentence `verdictLine`, then the plain Problem and Fix sentences (`prProblem`, `prFix`), then the issue-class list — one bullet per class as `plainName (×count, status)` — and closes with the full finding list (`file:line — P# — title`) inside a collapsed `<details>` block. Write the body to a BOM-free temp file and pass `--body-file` to `gh issue comment` (never `--body`), or use the GitHub MCP `add_issue_comment` tool.
85
- 3. **Opens the published report** with `Start-Process chrome -ArgumentList '--new-window', '<artifact URL>'`, using the artifact URL captured in step 1. A missing Chrome does not abort teardown.
86
-
87
- ## Live-dashboard seam
88
-
89
- The marker comment and artifact together form a seam for future per-round dashboard refreshes: a live-dashboard step re-renders with the same `render_report_html` function (pure, no side effects), calls `Artifact` again on the same `file_path` to redeploy to the same URL, and edits the same marker comment. That per-round refresh path is out of scope here; this document describes the one-shot closing report only.
90
-
91
- ## Scope
92
-
93
- The closing report runs only when `converged === true`. On a blocker exit (`blocker: "budget"` or similar), the report, artifact publish, comment, and Chrome open are all skipped.
@@ -1,31 +0,0 @@
1
- # Convergence gates — printed labels
2
-
3
- `check_convergence.py` in `packages/claude-dev-env/_shared/pr-loop/scripts/`
4
- re-derives every readiness condition from GitHub and prints one numbered
5
- PASS/FAIL line per gate. When Bugbot is down, the bugbot review-body gate is
6
- omitted from the numbered list.
7
-
8
- ## Exact printed labels (script order)
9
-
10
- When every gate is required and passes:
11
-
12
- 1. `bugbot_clean_at == current_head`
13
- 2. `bugbot review body clean` (omitted when Bugbot is down)
14
- 3. `bugteam_clean_at == current_head`
15
- 4. `copilot_clean_at == current_head`
16
- 5. `codex_clean_at == current_head`
17
- 6. `zero unresolved bot threads`
18
- 7. `PR is mergeable`
19
- 8. `no pending requested reviews`
20
-
21
- Success ends with:
22
-
23
- ```
24
- All pre-conditions met — PR is ready to mark ready.
25
- ```
26
-
27
- Failure ends with:
28
-
29
- ```
30
- One or more pre-conditions not met — do not mark ready.
31
- ```