claude-dev-env 1.38.1 → 1.40.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 (282) hide show
  1. package/CLAUDE.md +10 -36
  2. package/_shared/pr-loop/audit-reply-template.md +147 -0
  3. package/_shared/pr-loop/fix-protocol.md +25 -4
  4. package/_shared/pr-loop/gh-payloads.md +37 -50
  5. package/_shared/pr-loop/scripts/code_rules_gate.py +0 -60
  6. package/_shared/pr-loop/scripts/config/post_audit_thread_constants.py +199 -0
  7. package/_shared/pr-loop/scripts/config/reviews_disabled_constants.py +8 -0
  8. package/_shared/pr-loop/scripts/post_audit_thread.py +1242 -0
  9. package/_shared/pr-loop/scripts/preflight.py +129 -2
  10. package/_shared/pr-loop/scripts/reviews_disabled.py +59 -0
  11. package/_shared/pr-loop/scripts/tests/test_code_rules_gate.py +0 -19
  12. package/_shared/pr-loop/scripts/tests/test_post_audit_thread.py +1116 -0
  13. package/_shared/pr-loop/scripts/tests/test_post_audit_thread_constants.py +127 -0
  14. package/_shared/pr-loop/scripts/tests/test_preflight.py +41 -0
  15. package/_shared/pr-loop/scripts/tests/test_reviews_disabled.py +36 -0
  16. package/_shared/pr-loop/state-schema.md +1 -1
  17. package/agents/clean-coder.md +2 -2
  18. package/agents/pr-description-writer.md +150 -52
  19. package/bin/install.mjs +6 -7
  20. package/bin/install.test.mjs +8 -0
  21. package/commands/doc-gist.md +16 -0
  22. package/commands/plan.md +0 -2
  23. package/commands/review-plan.md +1 -1
  24. package/docs/CODE_RULES.md +122 -2
  25. package/docs/PR_DESCRIPTION_GUIDE.md +127 -64
  26. package/hooks/blocking/bot_mention_comment_blocker.py +75 -0
  27. package/hooks/blocking/code_rules_enforcer.py +1143 -129
  28. package/hooks/blocking/convergence_gate_blocker.py +130 -0
  29. package/hooks/blocking/destructive_command_blocker.py +74 -0
  30. package/hooks/blocking/gh_body_arg_blocker.py +30 -0
  31. package/hooks/blocking/md_to_html_blocker.py +119 -0
  32. package/hooks/blocking/pr_description_enforcer.py +57 -22
  33. package/hooks/blocking/test_bot_mention_comment_blocker.py +131 -0
  34. package/hooks/blocking/test_code_rules_enforcer.py +21 -0
  35. package/hooks/blocking/test_code_rules_enforcer_any_exempt_files.py +70 -0
  36. package/hooks/blocking/test_code_rules_enforcer_any_imports_and_cast.py +92 -0
  37. package/hooks/blocking/test_code_rules_enforcer_banned_import_alias.py +143 -0
  38. package/hooks/blocking/test_code_rules_enforcer_banned_prefixes.py +152 -0
  39. package/hooks/blocking/test_code_rules_enforcer_bare_except.py +120 -0
  40. package/hooks/blocking/test_code_rules_enforcer_boundary_types.py +175 -0
  41. package/hooks/blocking/test_code_rules_enforcer_cap_meta.py +0 -1
  42. package/hooks/blocking/test_code_rules_enforcer_collection_prefix.py +50 -0
  43. package/hooks/blocking/test_code_rules_enforcer_docstring_format.py +255 -0
  44. package/hooks/blocking/test_code_rules_enforcer_inline_tuple_string_magic.py +130 -0
  45. package/hooks/blocking/test_code_rules_enforcer_stub_implementations.py +141 -0
  46. package/hooks/blocking/test_code_rules_enforcer_test_branching.py +143 -0
  47. package/hooks/blocking/test_code_rules_enforcer_thin_wrapper_files.py +169 -0
  48. package/hooks/blocking/test_code_rules_enforcer_todo_markers.py +99 -0
  49. package/hooks/blocking/test_code_rules_enforcer_typed_dict_pairs.py +141 -0
  50. package/hooks/blocking/test_convergence_gate_blocker.py +63 -0
  51. package/hooks/blocking/test_destructive_command_blocker.py +146 -0
  52. package/hooks/blocking/test_destructive_command_blocker_no_verify.py +102 -0
  53. package/hooks/blocking/test_gh_body_arg_blocker.py +45 -0
  54. package/hooks/blocking/test_md_to_html_blocker.py +317 -0
  55. package/hooks/blocking/test_pr_description_enforcer.py +69 -8
  56. package/hooks/config/any_type_config.py +7 -0
  57. package/hooks/config/banned_identifiers_constants.py +11 -0
  58. package/hooks/config/blocking_check_limits.py +38 -0
  59. package/hooks/config/bot_mention_comment_blocker_constants.py +20 -0
  60. package/hooks/config/code_rules_enforcer_constants.py +53 -0
  61. package/hooks/config/convergence_branch_constants.py +9 -0
  62. package/hooks/config/doc_gist_auto_publish_constants.py +18 -0
  63. package/hooks/config/html_companion_constants.py +20 -0
  64. package/hooks/config/inline_tuple_string_magic_constants.py +22 -0
  65. package/hooks/config/pr_description_enforcer_constants.py +14 -0
  66. package/hooks/config/test_banned_identifiers_constants.py +17 -0
  67. package/hooks/hooks.json +28 -20
  68. package/hooks/pyproject.toml +69 -0
  69. package/hooks/validators/mypy_integration.py +47 -1
  70. package/hooks/validators/run_all_validators.py +3 -3
  71. package/hooks/validators/test_mypy_integration.py +50 -1
  72. package/hooks/workflow/doc_gist_auto_publish.py +144 -0
  73. package/hooks/workflow/md_to_html_companion.py +365 -0
  74. package/hooks/workflow/test_doc_gist_auto_publish.py +117 -0
  75. package/hooks/workflow/test_md_to_html_companion.py +452 -0
  76. package/package.json +1 -1
  77. package/rules/gh-body-file.md +2 -0
  78. package/scripts/Install-SweepEmptyDirs.ps1 +111 -0
  79. package/scripts/check.ps1 +106 -0
  80. package/scripts/config/timing.py +11 -0
  81. package/scripts/sweep_empty_dirs.py +138 -0
  82. package/scripts/sync_to_cursor/rules.py +1 -1
  83. package/scripts/test_sweep_empty_dirs.py +183 -0
  84. package/skills/_shared/pr-loop/prompts/pr-consistency-audit.xml +323 -0
  85. package/skills/_shared/pr-loop/scripts/_cli_utils.py +22 -0
  86. package/skills/_shared/pr-loop/scripts/_path_resolver.py +165 -0
  87. package/skills/_shared/pr-loop/scripts/_xml_utils.py +20 -0
  88. package/skills/_shared/pr-loop/scripts/build_audit_prompt.py +182 -0
  89. package/skills/_shared/pr-loop/scripts/build_fix_prompt.py +185 -0
  90. package/skills/_shared/pr-loop/scripts/config/__init__.py +0 -0
  91. package/skills/_shared/pr-loop/scripts/config/path_resolver_constants.py +78 -0
  92. package/skills/_shared/pr-loop/scripts/init_loop_state.py +135 -0
  93. package/skills/_shared/pr-loop/scripts/teardown_worktrees.py +175 -0
  94. package/skills/_shared/pr-loop/scripts/write_audit_outcomes.py +182 -0
  95. package/skills/_shared/pr-loop/scripts/write_fix_outcomes.py +206 -0
  96. package/skills/bugteam/CONSTRAINTS.md +21 -22
  97. package/skills/bugteam/EXAMPLES.md +3 -3
  98. package/skills/bugteam/PROMPTS.md +227 -67
  99. package/skills/bugteam/SKILL.md +132 -455
  100. package/skills/bugteam/reference/README.md +1 -1
  101. package/skills/bugteam/reference/audit-and-teammates.md +112 -39
  102. package/skills/bugteam/reference/audit-contract.md +4 -22
  103. package/skills/bugteam/reference/copilot-gap-analysis.md +8 -5
  104. package/skills/bugteam/reference/design-rationale.md +2 -2
  105. package/skills/bugteam/reference/github-pr-reviews.md +50 -57
  106. package/skills/bugteam/reference/obstacles/audit-assign-ids.md +13 -0
  107. package/skills/bugteam/reference/obstacles/audit-capture-excerpts.md +13 -0
  108. package/skills/bugteam/reference/obstacles/audit-walk-categories.md +13 -0
  109. package/skills/bugteam/reference/obstacles/audit-write-xml.md +13 -0
  110. package/skills/bugteam/reference/obstacles/fix-append-summary.md +13 -0
  111. package/skills/bugteam/reference/obstacles/fix-apply-fixes.md +13 -0
  112. package/skills/bugteam/reference/obstacles/fix-git-add-commit.md +13 -0
  113. package/skills/bugteam/reference/obstacles/fix-git-push.md +13 -0
  114. package/skills/bugteam/reference/obstacles/fix-post-reply.md +13 -0
  115. package/skills/bugteam/reference/obstacles/fix-publish-summary.md +13 -0
  116. package/skills/bugteam/reference/obstacles/fix-py-compile.md +13 -0
  117. package/skills/bugteam/reference/obstacles/fix-read-files.md +13 -0
  118. package/skills/bugteam/reference/obstacles/fix-resolve-thread.md +13 -0
  119. package/skills/bugteam/reference/obstacles/fix-test-suite.md +13 -0
  120. package/skills/bugteam/reference/obstacles/fix-violation-count.md +13 -0
  121. package/skills/bugteam/reference/obstacles/fix-write-xml.md +13 -0
  122. package/skills/bugteam/reference/team-setup.md +111 -9
  123. package/skills/bugteam/reference/teardown-publish-permissions.md +39 -8
  124. package/skills/bugteam/scripts/README.md +60 -0
  125. package/skills/bugteam/scripts/_claude_permissions_common.py +358 -0
  126. package/skills/bugteam/scripts/bugteam_code_rules_gate.py +976 -0
  127. package/skills/bugteam/scripts/bugteam_fix_hookspath.py +375 -0
  128. package/skills/bugteam/scripts/bugteam_preflight.py +328 -0
  129. package/skills/bugteam/scripts/config/bugteam_code_rules_gate_constants.py +25 -0
  130. package/skills/bugteam/scripts/config/bugteam_fix_hookspath_constants.py +26 -0
  131. package/skills/bugteam/scripts/config/bugteam_preflight_constants.py +35 -0
  132. package/skills/bugteam/scripts/config/claude_permissions_common_constants.py +20 -0
  133. package/skills/bugteam/scripts/config/probe_code_rules_enforcer_check_constants.py +12 -0
  134. package/skills/bugteam/scripts/config/windows_safe_rmtree_constants.py +7 -0
  135. package/skills/bugteam/scripts/grant_project_claude_permissions.py +175 -0
  136. package/skills/bugteam/scripts/probe_code_rules_enforcer_check.py +107 -0
  137. package/skills/bugteam/scripts/revoke_project_claude_permissions.py +220 -0
  138. package/skills/bugteam/scripts/test__claude_permissions_common.py +112 -0
  139. package/skills/bugteam/scripts/test_bugteam_code_rules_gate.py +400 -0
  140. package/skills/bugteam/scripts/test_bugteam_fix_hookspath.py +384 -0
  141. package/skills/bugteam/scripts/test_bugteam_preflight.py +309 -0
  142. package/skills/bugteam/scripts/test_claude_permissions_common.py +195 -0
  143. package/skills/bugteam/scripts/test_grant_project_claude_permissions.py +55 -0
  144. package/skills/bugteam/scripts/test_probe_code_rules_enforcer_check.py +76 -0
  145. package/skills/bugteam/scripts/test_revoke_project_claude_permissions.py +55 -0
  146. package/skills/bugteam/scripts/test_windows_safe_rmtree.py +108 -0
  147. package/skills/bugteam/scripts/windows_safe_rmtree.py +100 -0
  148. package/skills/bugteam/test_skill_additions.py +1 -11
  149. package/skills/code/SKILL.md +176 -0
  150. package/skills/copilot-review/SKILL.md +16 -0
  151. package/skills/doc-gist/SKILL.md +99 -0
  152. package/skills/doc-gist/references/examples/01-exploration-code-approaches.html +453 -0
  153. package/skills/doc-gist/references/examples/02-exploration-visual-designs.html +515 -0
  154. package/skills/doc-gist/references/examples/03-code-review-pr.html +638 -0
  155. package/skills/doc-gist/references/examples/04-code-understanding.html +491 -0
  156. package/skills/doc-gist/references/examples/05-design-system.html +629 -0
  157. package/skills/doc-gist/references/examples/06-component-variants.html +605 -0
  158. package/skills/doc-gist/references/examples/07-prototype-animation.html +455 -0
  159. package/skills/doc-gist/references/examples/08-prototype-interaction.html +396 -0
  160. package/skills/doc-gist/references/examples/09-slide-deck.html +592 -0
  161. package/skills/doc-gist/references/examples/10-svg-illustrations.html +492 -0
  162. package/skills/doc-gist/references/examples/11-status-report.html +528 -0
  163. package/skills/doc-gist/references/examples/12-incident-report.html +596 -0
  164. package/skills/doc-gist/references/examples/13-flowchart-diagram.html +395 -0
  165. package/skills/doc-gist/references/examples/14-research-feature-explainer.html +381 -0
  166. package/skills/doc-gist/references/examples/15-research-concept-explainer.html +368 -0
  167. package/skills/doc-gist/references/examples/16-implementation-plan.html +702 -0
  168. package/skills/doc-gist/references/examples/17-pr-writeup.html +595 -0
  169. package/skills/doc-gist/references/examples/18-editor-triage-board.html +573 -0
  170. package/skills/doc-gist/references/examples/19-editor-feature-flags.html +663 -0
  171. package/skills/doc-gist/references/examples/20-editor-prompt-tuner.html +722 -0
  172. package/skills/doc-gist/references/examples/README.md +5 -0
  173. package/skills/doc-gist/scripts/config/__init__.py +0 -0
  174. package/skills/doc-gist/scripts/config/gist_upload_constants.py +16 -0
  175. package/skills/doc-gist/scripts/gist_upload.py +177 -0
  176. package/skills/doc-gist/scripts/test_gist_upload.py +51 -0
  177. package/skills/findbugs/SKILL.md +96 -2
  178. package/skills/monitor-open-prs/SKILL.md +14 -32
  179. package/skills/monitor-open-prs/test_skill_contract.py +0 -11
  180. package/skills/pr-consistency-audit/SKILL.md +112 -0
  181. package/skills/pr-consistency-audit/reference/detection-rules.md +96 -0
  182. package/skills/pr-consistency-audit/reference/illustrations.md +78 -0
  183. package/skills/pr-converge/SKILL.md +229 -23
  184. package/skills/pr-converge/config/__init__.py +0 -0
  185. package/skills/pr-converge/config/constants.py +63 -0
  186. package/skills/pr-converge/reference/convergence-gates.md +138 -44
  187. package/skills/pr-converge/reference/examples.md +43 -11
  188. package/skills/pr-converge/reference/fix-protocol.md +6 -5
  189. package/skills/pr-converge/reference/ground-rules.md +5 -3
  190. package/skills/pr-converge/reference/multi-pr-orchestration.md +44 -19
  191. package/skills/pr-converge/reference/obstacles/fix-post-replies.md +13 -0
  192. package/skills/pr-converge/reference/obstacles/fix-publish-summary.md +13 -0
  193. package/skills/pr-converge/reference/obstacles/fix-push.md +13 -0
  194. package/skills/pr-converge/reference/obstacles/fix-read-filelines.md +13 -0
  195. package/skills/pr-converge/reference/obstacles/fix-reset-state.md +13 -0
  196. package/skills/pr-converge/reference/obstacles/fix-resolve-threads.md +13 -0
  197. package/skills/pr-converge/reference/obstacles/fix-spawn-clean-coder.md +13 -0
  198. package/skills/pr-converge/reference/obstacles/fix-stage-commit.md +13 -0
  199. package/skills/pr-converge/reference/obstacles/fix-trigger-bugbot.md +13 -0
  200. package/skills/pr-converge/reference/obstacles/fix-write-test.md +13 -0
  201. package/skills/pr-converge/reference/per-tick.md +107 -31
  202. package/skills/pr-converge/reference/state-schema.md +22 -1
  203. package/skills/pr-converge/reference/stop-conditions.md +9 -7
  204. package/skills/pr-converge/scripts/README.md +34 -46
  205. package/skills/pr-converge/scripts/check_bugbot_ci.py +279 -0
  206. package/skills/pr-converge/scripts/check_convergence.py +497 -0
  207. package/skills/pr-converge/scripts/check_pending_reviews.py +154 -0
  208. package/skills/pr-converge/scripts/config/pr_converge_constants.py +118 -0
  209. package/skills/pr-converge/scripts/fetch_copilot_reviews.py +134 -0
  210. package/skills/pr-converge/scripts/post_fix_reply.py +168 -0
  211. package/skills/pr-converge/scripts/test_check_bugbot_ci.py +312 -0
  212. package/skills/pr-converge/workflows/schedule-wakeup-loop.md +5 -12
  213. package/skills/qbug/SKILL.md +157 -27
  214. package/skills/session-log/SKILL.md +216 -114
  215. package/skills/session-tidy/SKILL.md +1 -1
  216. package/skills/skill-builder/SKILL.md +138 -56
  217. package/skills/skill-builder/references/delegation-map.md +72 -113
  218. package/skills/skill-builder/references/progressive-disclosure.md +122 -0
  219. package/skills/skill-builder/references/self-audit-checklist.md +92 -0
  220. package/skills/skill-builder/references/skill-types.md +228 -0
  221. package/skills/skill-builder/references/thariq-x-post-skills.json +33 -0
  222. package/skills/skill-builder/templates/gap-analysis.md +15 -8
  223. package/skills/skill-builder/workflows/improve-skill.md +86 -57
  224. package/skills/skill-builder/workflows/new-skill.md +80 -168
  225. package/skills/skill-builder/workflows/polish-skill.md +78 -54
  226. package/skills/structure-prompt/SKILL.md +50 -0
  227. package/skills/structure-prompt/reference/adversarial-tuning.md +62 -0
  228. package/skills/structure-prompt/reference/block-classification.md +27 -0
  229. package/skills/structure-prompt/reference/canonical-case.md +48 -0
  230. package/skills/structure-prompt/reference/citation-depth.md +70 -0
  231. package/skills/structure-prompt/reference/cleanup.md +33 -0
  232. package/skills/structure-prompt/reference/constraints.md +33 -0
  233. package/skills/structure-prompt/reference/directives.md +37 -0
  234. package/skills/structure-prompt/reference/examples.md +72 -0
  235. package/skills/structure-prompt/reference/instantiation.md +51 -0
  236. package/skills/structure-prompt/reference/output-contract.md +72 -0
  237. package/skills/structure-prompt/reference/per-category.md +23 -0
  238. package/skills/structure-prompt/reference/persona.md +38 -0
  239. package/skills/structure-prompt/reference/research.md +33 -0
  240. package/skills/structure-prompt/reference/structure.md +28 -0
  241. package/agents/code-standards-agent.md +0 -93
  242. package/agents/groq-coder.md +0 -113
  243. package/agents/plan-executor.md +0 -226
  244. package/agents/project-docs-analyzer.md +0 -53
  245. package/agents/project-structure-organizer-agent.md +0 -72
  246. package/agents/skill-to-agent-converter.md +0 -370
  247. package/agents/skill-writer-agent.md +0 -470
  248. package/agents/user-docs-writer.md +0 -67
  249. package/agents/workflow-visual-documenter.md +0 -82
  250. package/commands/readability-review.md +0 -20
  251. package/hooks/mypy.ini +0 -2
  252. package/hooks/notification/attention_needed_notify.py +0 -71
  253. package/hooks/notification/claude_notification_handler.py +0 -67
  254. package/hooks/notification/notification_utils.py +0 -267
  255. package/hooks/notification/subagent_complete_notify.py +0 -381
  256. package/hooks/notification/test_attention_needed_notify.py +0 -47
  257. package/hooks/notification/test_claude_notification_handler.py +0 -54
  258. package/hooks/notification/test_notification_utils.py +0 -91
  259. package/hooks/notification/test_subagent_complete_notify.py +0 -79
  260. package/scripts/config/groq_bugteam_config.py +0 -230
  261. package/scripts/config/test_groq_bugteam_config.py +0 -83
  262. package/scripts/config/test_spec_implementer_prompt.py +0 -32
  263. package/scripts/groq_bugteam.README.md +0 -131
  264. package/scripts/groq_bugteam.py +0 -647
  265. package/scripts/groq_bugteam_dotenv.py +0 -40
  266. package/scripts/groq_bugteam_spec.py +0 -226
  267. package/scripts/test_groq_bugteam.py +0 -529
  268. package/scripts/test_groq_bugteam_apply_fix_from_spec.py +0 -426
  269. package/scripts/test_groq_bugteam_dotenv.py +0 -66
  270. package/scripts/test_groq_bugteam_spec.py +0 -338
  271. package/skills/bugteam/SKILL_EVALS.md +0 -309
  272. package/skills/dream/SKILL.md +0 -118
  273. package/skills/ingest/SKILL.md +0 -40
  274. package/skills/npm-creator/SKILL.md +0 -187
  275. package/skills/readability-review/SKILL.md +0 -127
  276. package/skills/resume-review/SKILL.md +0 -261
  277. package/skills/rule-audit/SKILL.md +0 -307
  278. package/skills/rule-creator/SKILL.md +0 -150
  279. package/skills/searching-obsidian-vault/SKILL.md +0 -131
  280. package/skills/skill-writer/REFERENCE.md +0 -284
  281. package/skills/skill-writer/SKILL.md +0 -222
  282. package/skills/tdd-team/SKILL.md +0 -128
@@ -0,0 +1,96 @@
1
+ # Detection Rules
2
+
3
+ All 10 rules. Run every rule against every file. Do not skip. Do not combine. Rules are independent — a file can trigger multiple rules.
4
+
5
+ ## Rule 1: Canonical-source cross-reference
6
+
7
+ For every canonical source, scan every other file for usages of the concepts it defines. The canonical source is the ground truth. Flag every mismatch.
8
+
9
+ How: Take the canonical MCP payload doc. Extract every tool name and its parameter names. Scan every markdown file for calls to those tools. Compare each call's parameter names against the canonical form.
10
+
11
+ How: Take the canonical config file. Extract every constant name and value. Scan every other file. Flag any file that hardcodes the value. Flag any file that uses a different value for the same concept.
12
+
13
+ This rule caught 20 of Copilot's 43 findings. It is the highest-signal rule. Run it first.
14
+
15
+ ## Rule 2: Parameter naming convention
16
+
17
+ Group all MCP tool calls by tool name. Check whether all call sites use the same parameter naming convention.
18
+
19
+ How: Extract every parameter name from every tool call. Group by tool. If `add_issue_comment` appears in 10 files and 8 use `issueNumber` while 2 use `issue_number`, flag the 2.
20
+
21
+ Conventions are per-tool. `issue_read` uses `issue_number` (snake_case). `add_issue_comment` uses `issueNumber` (camelCase). Snake_case for `add_issue_comment` is wrong.
22
+
23
+ Also: check for two different parameter names that mean the same thing. `--number` vs `--pr-number` for a script that expects `--pr-number`.
24
+
25
+ ## Rule 3: Code vs docstring behavior
26
+
27
+ For every function whose docstring makes a claim about return values or error handling, read the implementation.
28
+
29
+ How: Find docstrings that say "returns X when Y" or "raises Z on error." Trace the code path. If the docstring says returns 0 when path missing but the code catches OSError and returns failure, flag it.
30
+
31
+ How: Find docstrings that claim a side effect. Check whether the code does it unconditionally. Flag missing precondition checks.
32
+
33
+ How: Find error handling claims like "tolerates already-removed worktrees." Read the except blocks. Read the conditionals. Verify every claim.
34
+
35
+ ## Rule 4: Nonexistent reference
36
+
37
+ Every file path, script name, function name, tool name, or import referenced in a doc must resolve to something real.
38
+
39
+ How: Extract every backtick-quoted identifier. Try to resolve it against the diff and the repo. Flag anything that cannot be found. A reference to `fetch_copilot_inline_comments.py` when no such file exists is P0. A reference to `EnterWorktree(path=...)` when no MCP tool by that name exists is P0.
40
+
41
+ ## Rule 5: Placeholder detection
42
+
43
+ Scan for text that looks like a template never filled in. This is text that cannot be executed as written.
44
+
45
+ Patterns to search for:
46
+ - Double spaces where a value should be: "Spawn — brief it: check for"
47
+ - Angle-bracket placeholders outside the standard `<O>` `<R>` `<N>` `<SHA>` set
48
+ - Ellipsis as placeholder: "...", "…"
49
+ - "TODO", "FIXME", "HACK", "XXX" in production documentation
50
+ - "TKTK", "TK", "placeholder"
51
+ - Missing arguments after a flag: `--flag` with no value following
52
+ - Sentences that trail off: text ending in ", or", "like", "such as" without completing
53
+
54
+ Severity: unexecutable placeholder is P0. Incomplete but still directionally useful is P1.
55
+
56
+ ## Rule 6: Cross-file contradiction
57
+
58
+ When two files describe the same operation, they must agree.
59
+
60
+ How: Group descriptions by topic — "how to post a review," "how to trigger bugbot," "who owns PR posting." For each topic, extract the description from every file. Compare who performs the action, what API is used, what parameters are passed, what the workflow order is. Flag any contradiction.
61
+
62
+ Flag both files. Do not assume which is correct unless a canonical source resolves it.
63
+
64
+ ## Rule 7: Stale reference
65
+
66
+ When a doc describes a feature, branch, phase, or pattern by name, verify the implementation still contains it.
67
+
68
+ How: Extract named concepts from decision branches and gotcha sections. Search implementation files for each concept. If a doc describes an "inline_lag" branch but no implementation file contains "inline_lag" or "inline_lag_streak," the doc references a removed feature.
69
+
70
+ P1: doc mentions something absent from implementation. P0: doc decision tree includes a branch whose predicate can never be reached because the implementation was removed.
71
+
72
+ ## Rule 8: Cross-platform assumption
73
+
74
+ Code that handles platform-specific behavior must not break on other platforms.
75
+
76
+ When you see Windows-specific patterns (`os.chmod` with `stat.S_IWRITE`, backslash paths, ReadOnly attribute handling), check: Does it run on Linux without crashing? Does `os.chmod(path, stat.S_IWRITE)` produce the right permissions on POSIX? It sets write-only, stripping read and execute from directories.
77
+
78
+ Flag anything that would fail on a non-Windows system. Flag the reverse: POSIX-only code that would fail on Windows.
79
+
80
+ ## Rule 9: Script invocation correctness
81
+
82
+ Every `python scripts/foo.py --*` in docs must match the script's actual argparse interface.
83
+
84
+ From your manifest, compare each documented invocation against the script's `add_argument` definitions. Check every flag name matches exactly. Check every `required=True` argument is present. Check no argument appears that the script does not accept.
85
+
86
+ Missing required args = P0. Wrong flag names = P0. Missing optional args = P2.
87
+
88
+ argparse converts `--pr-number` to `pr_number`. The invocation flag is `--pr-number`, not `--pr_number` or `--number`.
89
+
90
+ ## Rule 10: Value consistency
91
+
92
+ When the same named concept has a numeric value in multiple files, all files must agree.
93
+
94
+ How: Group constants, thresholds, and timeouts by semantic concept. "Bugbot post-trigger wakeup" vs "inline-lag retry delay" are different concepts. Values that represent the same thing must match. Flag any file whose value differs from the majority or from the canonical config.
95
+
96
+ Values that legitimately differ by context are not conflicts. Group by full semantic meaning before comparing.
@@ -0,0 +1,78 @@
1
+ # Illustrations
2
+
3
+ Concrete examples of findings with why-they-matter explanations.
4
+
5
+ ## Wrong argument name in script invocation
6
+
7
+ ```
8
+ file_path: SKILL.md
9
+ line_number: 100
10
+ rule_id: 9
11
+ severity: P0
12
+ what_is_wrong: check_bugbot_ci.py --check-active --sha <SHA>
13
+ what_it_should_be: check_bugbot_ci.py --owner <O> --repo <R> --check-active --sha <SHA>
14
+ evidence_path: scripts/check_bugbot_ci.py
15
+ evidence_detail: lines 134-136 define add_argument("--owner", required=True) and add_argument("--repo", required=True). Both required args are missing from the documented invocation.
16
+ ```
17
+
18
+ Why this matters: If an agent copies the command from the doc, the script fails with "the following arguments are required: --owner, --repo." The agent cannot trigger bugbot.
19
+
20
+ ## Parameter naming convention mismatch across tool family
21
+
22
+ ```
23
+ file_path: SKILL.md
24
+ line_number: 162
25
+ rule_id: 2
26
+ severity: P0
27
+ what_is_wrong: add_issue_comment(owner="OWNER", repo="REPO", issue_number=NUMBER, body="bugbot run")
28
+ what_it_should_be: add_issue_comment(owner="OWNER", repo="REPO", issueNumber=NUMBER, body="bugbot run")
29
+ evidence_path: _shared/pr-loop/gh-payloads.md
30
+ evidence_detail: lines 67-72 document add_issue_comment with issueNumber (camelCase). issue_read uses issue_number (snake_case) — the two tools have different conventions.
31
+ ```
32
+
33
+ Why this matters: The tool call fails at runtime. Twenty files had this same bug because they copied from each other.
34
+
35
+ ## Docstring claim contradicts implementation
36
+
37
+ ```
38
+ file_path: scripts/remove_tree.py
39
+ line_number: 15
40
+ rule_id: 3
41
+ severity: P0
42
+ what_is_wrong: Docstring says "returns 0 when the path never existed." Implementation calls shutil.rmtree(target_path) which raises FileNotFoundError, caught as OSError, returning EXIT_CODE_REMOVE_TREE_FAILURE.
43
+ what_it_should_be: Check Path(target_path).exists() before rmtree and return 0 when absent, or update the docstring.
44
+ evidence_path: scripts/remove_tree.py
45
+ evidence_detail: line 15 docstring claim vs lines 22-28 implementation — the except OSError handler returns EXIT_CODE_REMOVE_TREE_FAILURE for FileNotFoundError.
46
+ ```
47
+
48
+ Why this matters: Teardown scripts calling remove_tree() on an already-cleaned temp directory get a failure return. The orchestrator treats this as a real error.
49
+
50
+ ## Stale feature reference in gotcha section
51
+
52
+ ```
53
+ file_path: SKILL.md
54
+ line_number: 34
55
+ rule_id: 7
56
+ severity: P1
57
+ what_is_wrong: Gotcha describes "inline_lag" with its own streak counter and 90s wait. The decision branch for inline_lag is still present in per-tick.md lines 102-106 — the feature was supposed to be removed but both the gotcha and the branch remain.
58
+ what_it_should_be: Remove the gotcha and the inline_lag decision branch from per-tick.md.
59
+ evidence_path: reference/per-tick.md
60
+ evidence_detail: lines 102-106 still contain the fourth BUGBOT decision branch for inline_lag.
61
+ ```
62
+
63
+ Why this matters: An agent reading the gotcha thinks inline_lag is real and may misclassify a dirty review as transient lag, waiting rather than fixing.
64
+
65
+ ## Placeholder text in template file
66
+
67
+ ```
68
+ file_path: bugteam/obstacles/self-population.md
69
+ line_number: 5
70
+ rule_id: 5
71
+ severity: P1
72
+ what_is_wrong: "Spawn — brief it: check for an open PR " contains double spaces where an agent invocation, repo, and PR number should be.
73
+ what_it_should_be: Fill in the concrete Agent call or remove the section until populated.
74
+ evidence_path: bugteam/obstacles/self-population.md
75
+ evidence_detail: Template has placeholder spacing with no variable substitutions defined.
76
+ ```
77
+
78
+ Why this matters: Obstacle files are reference material for agents. An obstacle with "Spawn — brief it: check for" and no target wastes context and confuses.
@@ -17,8 +17,28 @@ until all three are clean on the same `HEAD` and mergeable.
17
17
 
18
18
  ## Pre-flight
19
19
 
20
- `ScheduleWakeup` not in this turn's tool registry abort. Report
21
- `pr-converge requires ScheduleWakeup; aborting` and return.
20
+ Pause and physically scan the tool list at the top of this conversation
21
+ for the literal string `ScheduleWakeup`. If you see it, proceed. If the
22
+ string is absent after scanning, report `pr-converge requires
23
+ ScheduleWakeup; aborting` and stop.
24
+
25
+ Call `EnterWorktree` with no arguments before any API call, file read, or
26
+ edit. Agent-view sessions start in the shared checkout. While Write/Edit
27
+ tools auto-isolate on first use, Bash calls (`gh`, `git`) do not trigger
28
+ isolation and will modify shared state. This step is mandatory — do not
29
+ proceed to any state-modifying operation until the working directory
30
+ contains `.claude/worktrees/`. If `EnterWorktree` fails, report the failure
31
+ and stop; do not continue in place.
32
+
33
+ ## State persistence
34
+
35
+ Single-PR mode persists loop state to `$CLAUDE_JOB_DIR/pr-converge-state.json`.
36
+ On tick entry, read this file if it exists to restore phase, tick_count, and
37
+ clean-at SHAs. On tick exit, write updated state before calling ScheduleWakeup
38
+ so the next tick resumes with accurate state.
39
+
40
+ Fields: `phase`, `tick_count`, `bugbot_clean_at`, `bugteam_clean_at`,
41
+ `copilot_clean_at`, `current_head`, `bugbot_acknowledged_at`, `bugbot_down`.
22
42
 
23
43
  ## Gotchas
24
44
 
@@ -30,42 +50,228 @@ post a fresh PR in a fresh branch based on origin main to the user.
30
50
  - **`ScheduleWakeup` not in subagent tool registries** — background
31
51
  `general-purpose` tick cannot schedule re-entry; only parent session
32
52
  with `ScheduleWakeup` in registry can call it.
33
- - **Review body and inline comments desync for same `commit_id`** —
34
- "dirty body, zero inline rows at `current_head`" is **`inline_lag`**,
35
- not **`dirty`**. Bump `inline_lag_streak`, wait 90s, retry fetch.
36
53
  - **`state.json` without §Concurrency lock loses merges** when teammates
37
54
  finish in same wall-clock window.
38
55
  - **`tick_count` must not double-increment** — conversation state line
39
56
  only when **no** `state.json`; with `state.json`, only the
40
57
  orchestrator bump increments.
41
- - **Duplicate `bugbot run` while review queued** — skip Step 3 when the
42
- latest `bugbot run` PR comment has an `:eyes:` or `:+1:` reaction;
43
- wait for review or HEAD change before re-triggering.
58
+ - **Bugbot trigger and detection** — CI check-run based. Full flow at
59
+ [`per-tick.md` Step 3](reference/per-tick.md); see also
60
+ `~/.claude/skills/pr-converge/scripts/check_bugbot_ci.py --help`.
44
61
  - **Bot login fields differ by endpoint** — `get_reviews` returns
45
62
  `.user.login` (object), but `get_review_comments` returns `.author`
46
- (string, not an object). Threads use `is_outdated` (not `commit_id`) to
47
- indicate staleness. Always check the correct fields and use
63
+ (string, not an object). Always check the correct fields and use
48
64
  case-insensitive substring matching on login values, never strict
49
65
  equality.
66
+ - **`is_outdated` is informational, not a skip flag** — GitHub marks a
67
+ thread `is_outdated=true` when the line it anchors to has changed since
68
+ the comment was posted. The original concern can still apply to current
69
+ code (the fix may have moved, not landed). The convergence gate counts
70
+ every thread with `is_resolved == false` regardless of `is_outdated`.
71
+ Outdated threads must be verified against current HEAD and either
72
+ fix-and-resolved or just resolved (with an inline reply explaining why
73
+ the concern no longer applies).
74
+ - **Tilde paths fail on Windows Git Bash** — `~/.claude/skills/...`
75
+ resolves to the wrong home directory in Bash-tool contexts. Use
76
+ `$HOME/.claude/skills/...` in shell invocations or `Path.home() /
77
+ ".claude/skills/..."` in Python scripts. Script invocations through
78
+ Bash that reference `~` produce "file not found" errors
79
+ indistinguishable from actual script failures.
80
+ - **PowerShell cmdlets fail in Bash tool** — `.ps1` scripts and
81
+ `pwsh` calls run through the PowerShell tool, not Bash. Bash on
82
+ Windows is Git Bash which cannot execute PowerShell cmdlets. Route all
83
+ PowerShell work through the PowerShell tool or `pwsh -NoProfile -File`.
84
+
85
+ ## Progress checklist
86
+
87
+ State variables (`phase`, `bugbot_clean_at`, `copilot_clean_at`, counters) are
88
+ defined in [`reference/state-schema.md`](reference/state-schema.md). Ground rules
89
+ in [`reference/ground-rules.md`](reference/ground-rules.md).
90
+
91
+ Each step references its spoke file for full procedural detail — MCP calls,
92
+ script invocations, decision criteria. Every "return to Step N" means the next
93
+ tick starts fresh from that step.
94
+
95
+ **Hard gate: do not advance from any step while ANY unresolved review
96
+ thread exists on the PR.** The thread-count filter is purely
97
+ `is_resolved == false` — author, commit anchor, and `is_outdated` are
98
+ all irrelevant. After every fix, reply to each finding comment and
99
+ resolve the thread via `pull_request_review_write(method="resolve_thread")`.
100
+ For each unresolved thread, verify the concern against current HEAD;
101
+ either fix-and-resolve, or reply-with-note-and-resolve when the concern
102
+ no longer applies.
103
+
104
+ - [ ] **Step 0: Grant project permissions**
105
+ `python "$HOME/.claude/skills/bugteam/scripts/grant_project_claude_permissions.py"`
106
+
107
+ - [ ] **Step 1: Resolve PR scope**
108
+ Capture owner, repo, number, head SHA, branch.
109
+ See: [`reference/per-tick.md` § Step 1](reference/per-tick.md)
110
+
111
+ - [ ] **Step 2: Initialize loop state**
112
+ `phase = BUGBOT`; all counters at zero; `run_name` resolved.
113
+
114
+ - [ ] **Step 3: Mergeability check**
115
+ See: [`reference/convergence-gates.md` § (c)](reference/convergence-gates.md)
116
+
117
+ ```
118
+ pull_request_read(method="get") → .mergeable_state, .mergeable
119
+ ```
120
+
121
+ - [ ] mergeable → advance to Step 4
122
+ - [ ] not mergeable → rebase → force-push → return to Step 1
123
+
124
+ - [ ] **Step 4: BUGBOT — fetch, decide, fix, reply, resolve**
125
+ See: [`reference/per-tick.md` § Step 2 BUGBOT + Step 3](reference/per-tick.md)
126
+
127
+ Fetch bugbot reviews + inline comments on `current_head`.
128
+
129
+ - [ ] **dirty** (findings on `current_head`) →
130
+ - [ ] Fix each finding (spawn `clean-coder`)
131
+ - [ ] Reply to each finding comment via `python ~/.claude/skills/pr-converge/scripts/post_fix_reply.py`
132
+ - [ ] Resolve each addressed thread via `pull_request_review_write(method="resolve_thread")`
133
+ - [ ] Push → return to Step 4
134
+ - [ ] **clean** (no findings on `current_head`) →
135
+ - [ ] Count ALL unresolved threads on PR (`is_resolved == false`) → zero? advance; >0? fix + resolve first
136
+ - [ ] `bugbot_clean_at = current_head`
137
+ - [ ] Advance to Step 5
138
+ - [ ] **no review yet / commit_id mismatch** →
139
+ - [ ] Run `python ~/.claude/skills/pr-converge/scripts/check_bugbot_ci.py --owner <O> --repo <R> --check-clean --sha <current_head>`
140
+ - [ ] Exit 0 (bugbot CI completed with success/neutral conclusion and no review = silent pass) → `bugbot_clean_at = current_head` → advance to Step 5
141
+ - [ ] Exit 1 (not a silent pass) or Exit 2 (gh CLI error — silent pass not confirmable) → Run `python ~/.claude/skills/pr-converge/scripts/check_bugbot_ci.py --owner <O> --repo <R> --check-active --sha <current_head>`
142
+ - [ ] Exit 0 (already queued) → schedule 360s wakeup → return to Step 4 next tick
143
+ - [ ] Exit 1 → post exactly `bugbot run` via `add_issue_comment` (no `@cursor[bot]` mention, no other text), wait 8s
144
+ - [ ] Run `python ~/.claude/skills/pr-converge/scripts/check_bugbot_ci.py --owner <O> --repo <R> --sha <current_head>`
145
+ - [ ] Exit non-zero → `bugbot_down = true` → advance to Step 5 (bypass)
146
+ - [ ] Exit 0 → record `bugbot_acknowledged_at`, schedule 360s wakeup → return to Step 4
147
+ - [ ] **Step 5: BUGTEAM — run, decide, fix, reply, resolve**
148
+ See: [`reference/per-tick.md` § Step 2 BUGTEAM](reference/per-tick.md);
149
+ [`../../bugteam/SKILL.md`](../../bugteam/SKILL.md)
150
+
151
+ Pre-condition: `bugbot_clean_at == current_head` (or `bugbot_down == true`).
152
+
153
+ Run `Skill({skill: "bugteam", args: "<PR URL>"})`.
154
+ After bugteam completes, re-resolve HEAD.
155
+
156
+ - [ ] **bugteam pushed new commits** →
157
+ - [ ] Verify all bugteam review threads replied + resolved
158
+ - [ ] Re-trigger bugbot (Step 4 "no review yet" checklist)
159
+ - [ ] `phase = BUGBOT` → schedule 360s wakeup → return to Step 4
160
+ - [ ] **converged (zero findings) + `bugbot_clean_at == current_head`** →
161
+ - [ ] Count ALL unresolved threads on PR (`is_resolved == false`) → zero? advance; >0? fix + resolve first
162
+ - [ ] Advance to Step 6
163
+ - [ ] **converged + `bugbot_clean_at ≠ current_head`** →
164
+ `phase = BUGBOT` → schedule 360s wakeup → return to Step 4
165
+ - [ ] **findings without committed fixes** →
166
+ - [ ] Fix each finding (spawn `clean-coder`)
167
+ - [ ] Reply to each finding comment via `python ~/.claude/skills/pr-converge/scripts/post_fix_reply.py`
168
+ - [ ] Resolve each addressed thread via `pull_request_review_write(method="resolve_thread")`
169
+ - [ ] Push → `phase = BUGBOT` → return to Step 4
170
+
171
+ - [ ] **Step 6: Convergence gates**
172
+ See: [`reference/convergence-gates.md`](reference/convergence-gates.md)
173
+
174
+ Pre-condition: Step 5 converged AND `bugbot_clean_at == current_head`.
175
+ Count unresolved threads before each gate.
176
+
177
+ **(a) Universal unresolved-thread sweep**
178
+ - [ ] Fetch ALL unresolved threads on the PR:
179
+ ```
180
+ pull_request_read(method="get_review_comments")
181
+ → filter threads where is_resolved == false
182
+ ```
183
+ - [ ] Any unresolved? → For each: verify concern against current HEAD;
184
+ if still applies → Fix (spawn `clean-coder`) → reply → resolve;
185
+ if no longer applies → reply-with-note → resolve. Push if any code changed → return to Step 4
186
+ - [ ] Fetch Copilot review on `current_head` (top-level review state — uses get_reviews, identifies by reviewer):
187
+ ```
188
+ python ~/.claude/skills/pr-converge/scripts/fetch_copilot_reviews.py --owner <O> --repo <R> --pr-number <N>
189
+ ```
190
+ - [ ] dirty → Fix (spawn `clean-coder`) → reply → resolve threads → push → return to Step 4
191
+ - [ ] clean (no findings) → `copilot_clean_at = current_head` → gate (b)
192
+ - [ ] no review yet → gate (b)
193
+
194
+ **(b) Mergeability re-check**
195
+ ```
196
+ pull_request_read(method="get") → .mergeable_state, .mergeable
197
+ ```
198
+ - [ ] mergeable → gate (c)
199
+ - [ ] not mergeable → rebase → push → return to Step 1
200
+
201
+ **(c) Request Copilot review**
202
+ - [ ] Check for pending Copilot review:
203
+ ```
204
+ python ~/.claude/skills/pr-converge/scripts/check_pending_reviews.py --owner <O> --repo <R> --pr-number <N>
205
+ → filter by copilot user
206
+ ```
207
+ - [ ] Pending review already exists → skip request → gate (d)
208
+ - [ ] No pending review → request:
209
+ ```
210
+ gh api --method POST repos/<O>/<R>/pulls/<N>/requested_reviewers \
211
+ -f 'reviewers[]=copilot-pull-request-reviewer[bot]'
212
+ ```
213
+ - [ ] `phase = COPILOT_WAIT` → schedule 360s wakeup → return to Step 6a next tick
214
+
215
+ **(d) Thread resolution — author-agnostic, outdated-agnostic**
216
+ ```
217
+ pull_request_read(method="get_review_comments")
218
+ → count threads where is_resolved == false
219
+ ```
220
+ - [ ] zero unresolved → gate (e)
221
+ - [ ] unresolved → For each: verify against HEAD;
222
+ still applies → Fix (spawn `clean-coder`) → reply → resolve;
223
+ no longer applies → reply-with-note → resolve.
224
+ Push if code changed → return to Step 4
225
+
226
+ **(e) Mark ready**
227
+ - [ ] Run automated convergence check:
228
+ ```
229
+ python $HOME/.claude/skills/pr-converge/scripts/check_convergence.py \
230
+ --owner <O> --repo <R> --pr-number <N>
231
+ ```
232
+ - [ ] Exit 0 (all pass) → `update_pull_request(draft=false)` → advance to Step 7
233
+ - [ ] Exit 1 (FAIL lines) → address each failure → return to Step 4
234
+ - [ ] Exit 2 (gh error) → retry once; persistent → stop
235
+
236
+ - [ ] **Step 6a: COPILOT_WAIT — fetch Copilot, decide**
237
+ See: [`reference/per-tick.md` § Step 2 COPILOT_WAIT](reference/per-tick.md)
238
+
239
+ Fetch Copilot reviews + inline comments on `current_head`.
240
+
241
+ - [ ] **clean (no findings)** →
242
+ `copilot_clean_at = current_head` → return to Step 6 (re-validate gates b, d, e)
243
+ - [ ] **dirty (findings present)** →
244
+ - [ ] Fix each finding (spawn `clean-coder`)
245
+ - [ ] Reply to each finding comment via `python ~/.claude/skills/pr-converge/scripts/post_fix_reply.py`
246
+ - [ ] Resolve each addressed thread via `pull_request_review_write(method="resolve_thread")`
247
+ - [ ] Push → `phase = BUGBOT` → return to Step 4
248
+ - [ ] **no review yet** →
249
+ increment `copilot_wait_count` → ≥ 3 = hard blocker → stop
250
+ schedule 360s wakeup → return to Step 6a next tick
251
+
252
+ - [ ] **Step 7: Clean working tree**
253
+ See: [`bugteam/reference/teardown-publish-permissions.md` § Step 4](../../bugteam/reference/teardown-publish-permissions.md)
254
+
255
+ - [ ] **Step 8: Rewrite PR description**
256
+ See: [`bugteam/reference/teardown-publish-permissions.md` § Step 4.5](../../bugteam/reference/teardown-publish-permissions.md)
50
257
 
51
- ## First tick of a session
258
+ - [ ] **Step 9: Revoke project permissions**
259
+ `python "$HOME/.claude/skills/bugteam/scripts/revoke_project_claude_permissions.py"`
52
260
 
53
- Read [`reference/state-schema.md`](reference/state-schema.md),
54
- [`reference/ground-rules.md`](reference/ground-rules.md), then
55
- [`reference/per-tick.md`](reference/per-tick.md).
261
+ - [ ] **Step 10: Print final report**
262
+ ```
263
+ /pr-converge exit: converged
264
+ Loops: <N>
265
+ Final commit: <SHA>
266
+ ```
56
267
 
57
- ## Match situation, read spoke
268
+ ## Edge cases
58
269
 
59
270
  | Situation | Read |
60
271
  |---|---|
61
- | Starting any tick | [`reference/per-tick.md`](reference/per-tick.md) |
62
- | Bugbot or audit finding to fix and push | [`reference/fix-protocol.md`](reference/fix-protocol.md) |
63
- | Bugteam reports `convergence (zero findings)` AND `bugbot_clean_at == current_head` | [`reference/convergence-gates.md`](reference/convergence-gates.md) |
64
- | Multi-PR session — `state.json` exists at `<TMPDIR>/pr-converge-<session_id>/` | [`reference/multi-pr-orchestration.md`](reference/multi-pr-orchestration.md) |
65
- | Scheduling the next wakeup | [`workflows/schedule-wakeup-loop.md`](workflows/schedule-wakeup-loop.md) |
66
- | Hard blocker, convergence reached, or user stops loop | [`reference/stop-conditions.md`](reference/stop-conditions.md) |
67
- | All GitHub interactions use `plugin:github:github` MCP tools | [`reference/per-tick.md`](reference/per-tick.md) |
68
- | Tick is ambiguous against the spokes above | [`reference/examples.md`](reference/examples.md) |
272
+ | Multi-PR session (`state.json` exists) | [`reference/multi-pr-orchestration.md`](reference/multi-pr-orchestration.md) |
273
+ | Hard blocker or user stops loop | [`reference/stop-conditions.md`](reference/stop-conditions.md) |
274
+ | Tick is ambiguous against the steps above | [`reference/examples.md`](reference/examples.md) |
69
275
 
70
276
  ## Folder map
71
277
 
File without changes
@@ -0,0 +1,63 @@
1
+ """Constants for the pr-converge skill.
2
+
3
+ All runtime and API constants live here. Script-specific constants
4
+ (CLI args, markdown patterns, reflow settings) stay in
5
+ ``scripts/config/pr_converge_constants.py``, which imports from here.
6
+ """
7
+
8
+ CURSOR_BOT_LOGIN = "cursor[bot]"
9
+ CURSOR_LOGIN_FILTER_SUBSTRING = "cursor"
10
+ COPILOT_REVIEWER_LOGIN = "copilot-pull-request-reviewer[bot]"
11
+ COPILOT_COMMENT_LOGIN = "Copilot"
12
+ COPILOT_REVIEWER_REQUEST_ID = COPILOT_REVIEWER_LOGIN
13
+ COPILOT_LOGIN_FILTER_SUBSTRING = "copilot"
14
+ CLAUDE_REVIEWER_LOGIN = "claude[bot]"
15
+ CLAUDE_REVIEWER_REQUEST_ID = CLAUDE_REVIEWER_LOGIN
16
+ CLAUDE_LOGIN_FILTER_SUBSTRING = "claude"
17
+
18
+ ALL_COPILOT_CLEAN_REVIEW_STATES = ("APPROVED", "COMMENTED")
19
+ ALL_COPILOT_DIRTY_REVIEW_STATES = ("CHANGES_REQUESTED",)
20
+ COPILOT_SOFT_DIRTY_REVIEW_STATE = "COMMENTED"
21
+ ALL_CLAUDE_CLEAN_REVIEW_STATES = ("APPROVED",)
22
+ ALL_CLAUDE_DIRTY_REVIEW_STATES = ("CHANGES_REQUESTED", "COMMENTED")
23
+ CLAUDE_SOFT_DIRTY_REVIEW_STATE = "COMMENTED"
24
+
25
+ BUGBOT_DIRTY_BODY_REGEX = (
26
+ r"Cursor Bugbot has reviewed your changes and found \d+ potential issue"
27
+ )
28
+ BUGBOT_CHECK_RUN_NAME_SUBSTRING = "bugbot"
29
+ ALL_BUGBOT_CHECK_RUN_ACTIVE_STATUSES = ("queued", "in_progress")
30
+ BUGBOT_CHECK_RUN_COMPLETED_STATUS = "completed"
31
+ ALL_BUGBOT_CHECK_RUN_COMPLETE_CONCLUSIONS = ("success", "neutral")
32
+ BUGBOT_RUN_TRIGGER_PHRASE = "bugbot run\n"
33
+ BUGBOT_RUN_TRIGGER_WAIT_SECONDS = 8
34
+
35
+ GH_INLINE_COMMENTS_PATH_TEMPLATE = "repos/{owner}/{repo}/pulls/{number}/comments"
36
+ GH_REVIEW_COMMENTS_PATH_TEMPLATE = (
37
+ "repos/{owner}/{repo}/pulls/{number}/reviews/{review_id}/comments"
38
+ )
39
+ GH_REVIEWS_PATH_TEMPLATE = "repos/{owner}/{repo}/pulls/{number}/reviews"
40
+ GH_CHECK_RUNS_PATH_TEMPLATE = "repos/{owner}/{repo}/commits/{sha}/check-runs"
41
+ GH_INLINE_COMMENT_CREATE_PATH_TEMPLATE = (
42
+ "repos/{owner}/{repo}/pulls/{number}/comments"
43
+ )
44
+ GH_INLINE_COMMENT_REPLY_PATH_TEMPLATE = (
45
+ "repos/{owner}/{repo}/pulls/{number}/comments/{comment_id}/replies"
46
+ )
47
+ GH_ISSUE_COMMENT_CREATE_PATH_TEMPLATE = (
48
+ "repos/{owner}/{repo}/issues/{number}/comments"
49
+ )
50
+ GH_PR_OBJECT_PATH_TEMPLATE = "repos/{owner}/{repo}/pulls/{number}"
51
+ GH_REQUESTED_REVIEWERS_PATH_TEMPLATE = (
52
+ "repos/{owner}/{repo}/pulls/{number}/requested_reviewers"
53
+ )
54
+ GH_REQUESTED_REVIEWERS_FIELD_TEMPLATE = "reviewers[]={reviewer_id}"
55
+
56
+ CHECK_RUNS_PER_PAGE = 20
57
+ REVIEWS_PER_PAGE = 100
58
+
59
+ GRAPHQL_REVIEW_THREADS_PAGE_SIZE = 100
60
+ UNRESOLVED_THREAD_DETAIL_MAX = 5
61
+
62
+ EXIT_CODE_GH_ERROR = 2
63
+ EXIT_CODE_NOT_FOUND = 1