claude-dev-env 2.11.0 → 2.13.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 (203) hide show
  1. package/_shared/advisor/reference/sol-rung.md +5 -2
  2. package/_shared/advisor/reference/warm-up.md +1 -0
  3. package/_shared/advisor/scripts/codex_sol_advisor.py +96 -31
  4. package/_shared/advisor/scripts/config/advisor_scripts_constants/sol_advisor_constants.py +5 -0
  5. package/_shared/advisor/scripts/tests/test_codex_sol_advisor.py +173 -11
  6. package/_shared/pr-loop/scripts/code_rules_gate.py +2 -3
  7. package/_shared/pr-loop/scripts/test_code_rules_gate.py +0 -26
  8. package/agents/CLAUDE.md +1 -2
  9. package/agents/pr-description-writer.md +11 -81
  10. package/bin/install.mjs +48 -9
  11. package/bin/install.prune.test.mjs +26 -0
  12. package/bin/install.settings-defaults.test.mjs +60 -33
  13. package/bin/install.test.mjs +2 -4
  14. package/commands/CLAUDE.md +1 -0
  15. package/commands/sr-loop.md +52 -0
  16. package/docs/CLAUDE.md +0 -1
  17. package/docs/references/CLAUDE.md +0 -1
  18. package/hooks/CLAUDE.md +1 -1
  19. package/hooks/blocking/CLAUDE.md +2 -27
  20. package/hooks/blocking/config/CLAUDE.md +1 -13
  21. package/hooks/blocking/conventional_pr_title_gate.py +1 -2
  22. package/hooks/blocking/send_user_file_open_locally_blocker.py +1 -1
  23. package/hooks/blocking/stop_dispatcher.py +4 -4
  24. package/hooks/blocking/test_bash_pre_tool_use_dispatcher.py +0 -3
  25. package/hooks/blocking/test_pre_tool_use_dispatcher.py +6 -7
  26. package/hooks/blocking/test_send_user_file_open_locally_blocker.py +4 -3
  27. package/hooks/blocking/test_shared_stdin_adoption.py +0 -2
  28. package/hooks/diagnostic/CLAUDE.md +3 -3
  29. package/hooks/diagnostic/hook_log_extractor.py +2 -36
  30. package/hooks/diagnostic/hook_log_stop_wrapper.py +6 -155
  31. package/hooks/diagnostic/test_hook_log_extractor.py +8 -21
  32. package/hooks/diagnostic/test_hook_log_stop_wrapper.py +3 -331
  33. package/hooks/git-hooks/git_hooks_constants/__init__.py +0 -6
  34. package/hooks/git-hooks/pre_push.py +3 -85
  35. package/hooks/git-hooks/test_pre_push.py +0 -130
  36. package/hooks/hooks.json +0 -35
  37. package/hooks/hooks_constants/CLAUDE.md +0 -9
  38. package/hooks/hooks_constants/bash_pre_tool_use_dispatcher_constants.py +0 -11
  39. package/hooks/hooks_constants/convergence_branch_constants.py +0 -1
  40. package/hooks/hooks_constants/fable_spawn_gate_constants.py +3 -4
  41. package/hooks/hooks_constants/pre_tool_use_dispatcher_constants.py +0 -8
  42. package/hooks/hooks_constants/send_user_file_open_locally_blocker_constants.py +1 -6
  43. package/hooks/hooks_constants/stop_dispatcher_constants.py +0 -1
  44. package/hooks/hooks_constants/test_bash_pre_tool_use_dispatcher_constants.py +1 -26
  45. package/hooks/hooks_constants/test_pre_tool_use_dispatcher_constants.py +0 -5
  46. package/hooks/hooks_constants/test_stop_dispatcher_constants.py +0 -1
  47. package/hooks/lifecycle/CLAUDE.md +1 -3
  48. package/package.json +1 -1
  49. package/rules/CLAUDE.md +0 -2
  50. package/rules/gh-cli-conventions.md +0 -1
  51. package/rules/git-workflow.md +1 -3
  52. package/scripts/CLAUDE.md +0 -1
  53. package/scripts/_code_review_test_support.py +0 -95
  54. package/scripts/dev_env_scripts_constants/code_review_constants.py +9 -98
  55. package/scripts/dev_env_scripts_constants/test_code_review_constants.py +1 -44
  56. package/scripts/invoke_code_review.py +8 -451
  57. package/scripts/test_invoke_code_review.py +5 -61
  58. package/scripts/test_invoke_code_review_cli.py +1 -45
  59. package/scripts/test_invoke_code_review_contract.py +1 -118
  60. package/settings.json +1 -10
  61. package/skills/CLAUDE.md +8 -0
  62. package/skills/autoconverge/reference/CLAUDE.md +1 -1
  63. package/skills/autoconverge/reference/convergence.md +7 -7
  64. package/skills/autoconverge/reference/gotchas.md +3 -10
  65. package/skills/autoconverge/workflow/converge.contract.test.mjs +53 -1388
  66. package/skills/autoconverge/workflow/converge.copilot-gate.test.mjs +4 -3
  67. package/skills/autoconverge/workflow/converge.fix-recovery.test.mjs +33 -493
  68. package/skills/autoconverge/workflow/converge.merge-conflict.test.mjs +15 -97
  69. package/skills/autoconverge/workflow/converge.mjs +201 -238
  70. package/skills/autoconverge/workflow/converge.precatch.test.mjs +1 -1
  71. package/skills/bugteam/CONSTRAINTS.md +1 -1
  72. package/skills/bugteam/SKILL.md +9 -0
  73. package/skills/bugteam/reference/audit-and-teammates.md +10 -6
  74. package/skills/bugteam/test_skill_additions.py +9 -0
  75. package/skills/comments/SKILL.md +65 -0
  76. package/skills/descriptions/SKILL.md +51 -0
  77. package/skills/emergencies/SKILL.md +42 -0
  78. package/skills/imagegen/SKILL.md +21 -0
  79. package/skills/imagegen/scripts/config/__init__.py +1 -0
  80. package/skills/imagegen/scripts/config/constants.py +28 -0
  81. package/skills/imagegen/scripts/imagegen.py +45 -0
  82. package/skills/imagegen/scripts/imagegen_core.py +528 -0
  83. package/skills/imagegen/scripts/test_imagegen.py +204 -0
  84. package/skills/orchestrator/SKILL.md +2 -4
  85. package/skills/plan-to-pr/SKILL.md +6 -7
  86. package/skills/plan-to-pr/reference/final-validation-tasks.md +1 -1
  87. package/skills/plan-to-pr/reference/process-inventory.md +2 -2
  88. package/skills/plan-to-pr/reference/review-loop.md +2 -2
  89. package/skills/plan-to-pr/reference/run-record.schema.json +1 -1
  90. package/skills/plan-to-pr/reference/task-seeds.md +1 -1
  91. package/skills/plan-to-pr/reference/task-ticket.md +3 -4
  92. package/skills/plan-to-pr/scripts/config/constants.py +1 -2
  93. package/skills/plan-to-pr/scripts/test_validate_protocol.py +1 -1
  94. package/skills/plan-to-pr/test_skill_contract.py +2 -2
  95. package/skills/pr-converge/SKILL.md +13 -16
  96. package/skills/pr-converge/reference/progress-checklist.md +6 -5
  97. package/skills/pr-converge/reference/state-schema.md +1 -27
  98. package/skills/pr-loop-cloud-transport/SKILL.md +1 -1
  99. package/skills/pr-loop-cloud-transport/reference/identity-and-hooks.md +3 -3
  100. package/skills/pr-loop-lifecycle/SKILL.md +1 -1
  101. package/skills/pr-loop-lifecycle/reference/teardown-publish-permissions.md +1 -1
  102. package/skills/prototype/SKILL.md +4 -4
  103. package/skills/prototype/reference/honest-limitations.md +4 -4
  104. package/skills/prototype/reference/promotion-tasks.md +2 -2
  105. package/skills/prototype/workflows/promotion.md +4 -6
  106. package/skills/reviews/SKILL.md +85 -0
  107. package/skills/small-cl/SKILL.md +52 -0
  108. package/skills/usage-pause/SKILL.md +1 -1
  109. package/skills/usage-pause/scripts/resolve_usage_window.py +32 -4
  110. package/skills/usage-pause/scripts/test_resolve_usage_window.py +26 -0
  111. package/skills/usage-pause/scripts/usage_pause_constants/resolve_usage_window_constants.py +3 -1
  112. package/agents/code-verifier.md +0 -74
  113. package/docs/PR_DESCRIPTION_GUIDE.md +0 -157
  114. package/docs/references/code-review-enforcement.md +0 -132
  115. package/hooks/blocking/code_review_enforcement_config_bootstrap.py +0 -53
  116. package/hooks/blocking/code_review_gate_deny.py +0 -74
  117. package/hooks/blocking/code_review_pr_create_gate.py +0 -198
  118. package/hooks/blocking/code_review_push_gate.py +0 -145
  119. package/hooks/blocking/code_review_stamp_directory_write_blocker.py +0 -348
  120. package/hooks/blocking/code_review_stamp_store.py +0 -233
  121. package/hooks/blocking/code_review_stamp_write_blocker_parts/__init__.py +0 -7
  122. package/hooks/blocking/code_review_stamp_write_blocker_parts/conftest.py +0 -15
  123. package/hooks/blocking/code_review_stamp_write_blocker_parts/obfuscated_stamp_path_reference.py +0 -212
  124. package/hooks/blocking/code_review_stamp_write_blocker_parts/split_directory_change_into_stamp.py +0 -138
  125. package/hooks/blocking/code_review_stamp_write_blocker_parts/test_obfuscated_stamp_path_reference.py +0 -49
  126. package/hooks/blocking/code_review_stamp_write_blocker_parts/test_split_directory_change_into_stamp.py +0 -38
  127. package/hooks/blocking/code_verifier_spawn_preflight_gate.py +0 -483
  128. package/hooks/blocking/config/code_review_enforcement_constants.py +0 -143
  129. package/hooks/blocking/config/test_code_review_enforcement_constants.py +0 -166
  130. package/hooks/blocking/config/verified_commit_constants.py +0 -160
  131. package/hooks/blocking/config/verified_commit_context_constants.py +0 -21
  132. package/hooks/blocking/config/verified_commit_gate_output_constants.py +0 -14
  133. package/hooks/blocking/conftest.py +0 -123
  134. package/hooks/blocking/convergence_gate_blocker.py +0 -310
  135. package/hooks/blocking/pr_converge_bugteam_enforcer.py +0 -170
  136. package/hooks/blocking/pr_description_body_audit.py +0 -148
  137. package/hooks/blocking/pr_description_command_parser.py +0 -237
  138. package/hooks/blocking/pr_description_enforcer.py +0 -227
  139. package/hooks/blocking/pr_description_pr_number.py +0 -155
  140. package/hooks/blocking/pr_description_proof_of_work.py +0 -385
  141. package/hooks/blocking/pr_description_readability.py +0 -364
  142. package/hooks/blocking/reviewer_spawn_gate.py +0 -182
  143. package/hooks/blocking/test_code_review_enforcement_config_bootstrap.py +0 -62
  144. package/hooks/blocking/test_code_review_gate_deny.py +0 -54
  145. package/hooks/blocking/test_code_review_pr_create_gate.py +0 -199
  146. package/hooks/blocking/test_code_review_push_gate.py +0 -205
  147. package/hooks/blocking/test_code_review_stamp_directory_write_blocker.py +0 -199
  148. package/hooks/blocking/test_code_review_stamp_store.py +0 -205
  149. package/hooks/blocking/test_code_verifier_spawn_preflight_gate.py +0 -710
  150. package/hooks/blocking/test_code_verifier_tools_contract.py +0 -28
  151. package/hooks/blocking/test_convergence_gate_blocker.py +0 -428
  152. package/hooks/blocking/test_pr_converge_bugteam_enforcer.py +0 -311
  153. package/hooks/blocking/test_pr_converge_bugteam_enforcer_state_tolerance.py +0 -184
  154. package/hooks/blocking/test_pr_description_enforcer.py +0 -221
  155. package/hooks/blocking/test_pr_description_enforcer_body_audit.py +0 -247
  156. package/hooks/blocking/test_pr_description_enforcer_body_rules.py +0 -493
  157. package/hooks/blocking/test_pr_description_enforcer_command_parser.py +0 -366
  158. package/hooks/blocking/test_pr_description_enforcer_pr_number.py +0 -159
  159. package/hooks/blocking/test_pr_description_enforcer_proof_gate.py +0 -175
  160. package/hooks/blocking/test_pr_description_enforcer_readability.py +0 -443
  161. package/hooks/blocking/test_pr_description_proof_of_work.py +0 -313
  162. package/hooks/blocking/test_reviewer_spawn_gate.py +0 -230
  163. package/hooks/blocking/test_verdict_directory_write_blocker.py +0 -804
  164. package/hooks/blocking/test_verification_verdict_store.py +0 -974
  165. package/hooks/blocking/test_verified_commit_config_bootstrap.py +0 -67
  166. package/hooks/blocking/test_verified_commit_docs_delta.py +0 -176
  167. package/hooks/blocking/test_verified_commit_gate.py +0 -581
  168. package/hooks/blocking/test_verified_commit_gate_additional_context.py +0 -134
  169. package/hooks/blocking/test_verified_commit_message_accuracy_blocker.py +0 -131
  170. package/hooks/blocking/test_verifier_verdict_minter.py +0 -299
  171. package/hooks/blocking/tests/test_verified_commit_gate.py +0 -41
  172. package/hooks/blocking/verdict_directory_write_blocker.py +0 -687
  173. package/hooks/blocking/verification_verdict_store.py +0 -1039
  174. package/hooks/blocking/verified_commit_config_bootstrap.py +0 -63
  175. package/hooks/blocking/verified_commit_gate.py +0 -113
  176. package/hooks/blocking/verified_commit_gate_parts/CLAUDE.md +0 -28
  177. package/hooks/blocking/verified_commit_gate_parts/__init__.py +0 -1
  178. package/hooks/blocking/verified_commit_gate_parts/command_tokenization.py +0 -174
  179. package/hooks/blocking/verified_commit_gate_parts/deny_payload.py +0 -53
  180. package/hooks/blocking/verified_commit_gate_parts/deny_reason.py +0 -80
  181. package/hooks/blocking/verified_commit_gate_parts/directory_resolution.py +0 -170
  182. package/hooks/blocking/verified_commit_gate_parts/gated_invocations.py +0 -217
  183. package/hooks/blocking/verified_commit_gate_parts/tests/conftest.py +0 -10
  184. package/hooks/blocking/verified_commit_gate_parts/tests/test_command_tokenization.py +0 -94
  185. package/hooks/blocking/verified_commit_gate_parts/tests/test_deny_payload.py +0 -17
  186. package/hooks/blocking/verified_commit_gate_parts/tests/test_deny_reason.py +0 -38
  187. package/hooks/blocking/verified_commit_gate_parts/tests/test_directory_resolution.py +0 -71
  188. package/hooks/blocking/verified_commit_gate_parts/tests/test_gated_invocations.py +0 -96
  189. package/hooks/blocking/verified_commit_message_accuracy_blocker.py +0 -167
  190. package/hooks/blocking/verifier_verdict_minter.py +0 -280
  191. package/hooks/hooks_constants/code_verifier_spawn_preflight_gate_constants.py +0 -64
  192. package/hooks/hooks_constants/convergence_gate_blocker_constants.py +0 -53
  193. package/hooks/hooks_constants/pr_converge_bugteam_enforcer_constants.py +0 -55
  194. package/hooks/hooks_constants/pr_converge_bugteam_enforcer_state.py +0 -67
  195. package/hooks/hooks_constants/pr_description_enforcer_constants.py +0 -167
  196. package/hooks/hooks_constants/pr_description_proof_of_work_constants.py +0 -107
  197. package/hooks/hooks_constants/reviewer_spawn_gate_constants.py +0 -41
  198. package/hooks/hooks_constants/test_pr_description_enforcer_constants.py +0 -292
  199. package/hooks/lifecycle/pr_converge_bugteam_skill_tracker.py +0 -198
  200. package/hooks/lifecycle/test_pr_converge_bugteam_skill_tracker.py +0 -283
  201. package/rules/proof-of-work-pr-comments.md +0 -22
  202. package/rules/verified-commit-gate-skip.md +0 -4
  203. package/scripts/Show-Asset.ps1 +0 -106
@@ -148,5 +148,5 @@ test('COMMIT_RECOVERY_MAX_ATTEMPTS is one and bounds the commitWithRecovery loop
148
148
  assert.match(convergeSource, /const COMMIT_RECOVERY_MAX_ATTEMPTS = 1/, 'expected a dedicated commit-recovery cap of one');
149
149
  assert.match(convergeSource, /const FIX_RECOVERY_MAX_ATTEMPTS = 2/, 'expected the wider verify-recovery cap to stay at two');
150
150
  const commitBody = functionSource('commitWithRecovery');
151
- assert.match(commitBody, /attempt < COMMIT_RECOVERY_MAX_ATTEMPTS/, 'expected commitWithRecovery to bound its loop by the dedicated cap');
151
+ assert.match(commitBody, /attempt <= COMMIT_RECOVERY_MAX_ATTEMPTS/, 'expected commitWithRecovery to bound its loop by the dedicated cap');
152
152
  });
@@ -13,7 +13,7 @@
13
13
  - **Clean-room audits, every loop.** Each bugfind subagent's spawn prompt contains only the PR scope, audit rubric, and the current loop number. Prior loop history stays in the lead.
14
14
  - **Targeted fixes.** Each fix subagent sees ONLY the most recent audit's findings. Prior loops are invisible to the fix subagent.
15
15
  - **Fix subagent receives the latest audit as its input contract.** Each loop's fix run operates on the current audit's output and only that.
16
- - **Lead owns the final PR description rewrite only** (Step 4 Close substep via `pr-loop-lifecycle`), composed directly against `docs/PR_DESCRIPTION_GUIDE.md`.
16
+ - **Lead owns the final PR description.** The lead applies the [description guide](../descriptions/SKILL.md#required-content) through `pr-loop-lifecycle`.
17
17
 
18
18
  ## Why this design
19
19
 
@@ -29,6 +29,15 @@ and take `true` as the pass. When any check fails, run the
29
29
  `pr-loop-cloud-transport` skill first and route every `gh` operation in this
30
30
  skill through its substitution matrix.
31
31
 
32
+ ## Judgment guides
33
+
34
+ Use the [review guide](../reviews/SKILL.md#review-workflow) to decide whether a
35
+ changed behavior is a finding. Use the [comment guide](../comments/SKILL.md#writing-useful-review-comments)
36
+ for posted findings and replies, the [description guide](../descriptions/SKILL.md#reviewing-a-description)
37
+ for final PR context, the [emergency guide](../emergencies/SKILL.md#while-the-incident-is-active)
38
+ for active incidents, and the [small-change guide](../small-cl/SKILL.md#reviewable-scope)
39
+ when the diff needs a narrower review boundary.
40
+
32
41
  ## Pre-flight
33
42
 
34
43
  ```bash
@@ -104,8 +104,10 @@ Repeat until an exit condition fires.
104
104
  action** below). Instructions: read the gate script’s stderr, edit the
105
105
  repo until a **re-run** of the **same** gate command exits **0**. On
106
106
  tiers 1 and 3 the headless worker edits and runs tests but never
107
- commits or pushes — the lead stages with explicit `git add`, mints the
108
- code-verifier verdict, then commits and pushes. Tier 2 keeps in-agent
107
+ commits or pushes — the lead stages with explicit `git add`, confirms the
108
+ gate output and changed behavior against the
109
+ [review guide](../../reviews/SKILL.md#review-workflow), then commits and
110
+ pushes. Tier 2 keeps in-agent
109
111
  commit and push with `mode="bypassPermissions"`. Repeat standards-fix
110
112
  spawns until the gate exits **0** or **5** failed gate rounds (each
111
113
  round = one worker session after a non-zero gate). If still non-zero
@@ -219,8 +221,9 @@ worker session after a non-zero gate).
219
221
  headless worker edits and runs tests but never commits or pushes. The
220
222
  lead session stages the worker's files itself with an explicit `git add`
221
223
  (the session edit tracker does not see files the lead did not edit),
222
- mints the code-verifier verdict in its own context, then commits and
223
- pushes so the commit gate and the staged-commit scans fire on the real
224
+ confirms the gate output and changed behavior against the
225
+ [review guide](../../reviews/SKILL.md#review-workflow), then commits and
226
+ pushes — so the commit gate and the staged-commit scans run on the real
224
227
  diff. Re-run the gate command; if still non-zero, start the next round.
225
228
  - **`claude_agent_required`** (exit `2`, attempts include tier `2` with
226
229
  that reason): spawn the Agent-tool worker with in-agent commit and push:
@@ -283,8 +286,9 @@ Pass finding comment URL, comment id, and thread node id for each finding
283
286
  and 3 the headless worker edits and runs tests but never commits or
284
287
  pushes. The lead session stages the worker's files itself with an
285
288
  explicit `git add` (the session edit tracker does not see files the lead
286
- did not edit), mints the code-verifier verdict in its own context, then
287
- commits and pushes so the commit gate and the staged-commit scans fire
289
+ did not edit), confirms the gate output and changed behavior against the
290
+ [review guide](../../reviews/SKILL.md#review-workflow), then commits and
291
+ pushes — so the commit gate and the staged-commit scans run
288
292
  on the real diff. Read the outcome XML at
289
293
  `<worktree_path>/.bugteam-pr<N>-loop<L>.fix-outcomes.xml`. The **lead**
290
294
  posts one reply per finding using the unified template at
@@ -18,3 +18,12 @@ def test_skill_names_implementer_subagent_type():
18
18
  def test_skill_documents_bugbot_retrigger_flag():
19
19
  skill_text = _read_skill_text()
20
20
  assert "--bugbot-retrigger" in skill_text
21
+
22
+
23
+ def test_skill_routes_judgment_to_canonical_guides() -> None:
24
+ skill_text = _read_skill_text()
25
+ assert "../reviews/SKILL.md#review-workflow" in skill_text
26
+ assert "../comments/SKILL.md#writing-useful-review-comments" in skill_text
27
+ assert "../descriptions/SKILL.md#reviewing-a-description" in skill_text
28
+ assert "../emergencies/SKILL.md#while-the-incident-is-active" in skill_text
29
+ assert "../small-cl/SKILL.md#reviewable-scope" in skill_text
@@ -0,0 +1,65 @@
1
+ ---
2
+ name: comments
3
+ description: >-
4
+ Draft, refine, or respond to pull-request review comments. Use when a user
5
+ asks to "write a review comment", "address review feedback", or "reply to a reviewer".
6
+ ---
7
+
8
+ # Review Comment Guide
9
+
10
+ ## When to Use This Guide
11
+
12
+ Use this guide to draft a finding, refine its tone, reply to reviewer feedback,
13
+ or resolve a comment thread. Use the [review guide](../reviews/SKILL.md#review-judgment)
14
+ to decide whether a concern merits a finding.
15
+
16
+ ## Writing Useful Review Comments
17
+
18
+ Each comment names the affected behavior, the observed concern, the relevant
19
+ evidence, and the expected outcome. Give the author enough context to choose an
20
+ effective fix.
21
+
22
+ - Use `Required` for a change that materially affects the review judgment.
23
+ - Use `Consider`, `Nit`, or `FYI` for improvement, polish, and context.
24
+ - Explain the technical rationale when the connection from evidence to outcome
25
+ needs context.
26
+ - Recognize strong decisions and completed fixes with the same specificity.
27
+
28
+ ## Respectful and Actionable Feedback
29
+
30
+ Treat every contributor as capable and acting in good faith. Keep feedback
31
+ about the code, its behavior, and its effect on users or maintainers.
32
+
33
+ - Consolidate a disagreement into one focused exchange with the relevant
34
+ context and reasoning.
35
+ - Use proportionate language that directs attention to the required change.
36
+ - Respect repository tooling and established formatting conventions.
37
+ - Close a thread when its outcome satisfies the applicable review judgment.
38
+
39
+ ## Responding to Feedback
40
+
41
+ Start with the substance of the feedback. Clarify the code, its tests, or its
42
+ documentation when that gives future readers the needed context.
43
+
44
+ Ask for clarification when the requested outcome remains unclear. Reply with
45
+ the trade-off, evidence, and proposed resolution when an alternative approach
46
+ better serves the stated goal.
47
+
48
+ ## Resolving Pushback
49
+
50
+ Reassess a disputed finding against the repository rubric and the change's
51
+ evidence. Keep advocating for a material improvement when the rationale remains
52
+ sound, and accept an evidence-backed alternative that meets the same quality
53
+ goal.
54
+
55
+ Escalate to a maintainer or lead when product direction or code ownership is
56
+ needed. Record the resulting decision in the pull request thread.
57
+
58
+ ## Related Guides
59
+
60
+ - Use [reviews](../reviews/SKILL.md#review-workflow) for substantive code
61
+ assessment.
62
+ - Use [small-cl](../small-cl/SKILL.md#responding-to-review) for author-side
63
+ review responses and focused follow-up work.
64
+ - Use [emergencies](../emergencies/SKILL.md#while-the-incident-is-active) for
65
+ urgent production-change communication.
@@ -0,0 +1,51 @@
1
+ ---
2
+ name: descriptions
3
+ description: >-
4
+ Draft or revise a pull-request description. Use when a user asks for a "PR
5
+ description", "pull request summary", or "change description".
6
+ ---
7
+
8
+ # Pull Request Description Guide
9
+
10
+ ## When to Use This Guide
11
+
12
+ Use this guide to prepare or revise the written context for a pull request. A
13
+ description explains the change to reviewers and future readers; it records the
14
+ intent and evidence that source code alone cannot express.
15
+
16
+ ## Required Content
17
+
18
+ Start with a short, specific summary line. Follow it with the information needed
19
+ to understand the change:
20
+
21
+ - The problem, motivation, and affected users or systems.
22
+ - The implemented approach and meaningful design decisions.
23
+ - Verification performed, including test commands and observed results.
24
+ - Risks, migrations, compatibility effects, and rollback or recovery context.
25
+ - Related issues, design records, and scoped follow-up work.
26
+
27
+ Use durable prose for every essential fact when linked material has restricted
28
+ access or a limited retention period.
29
+
30
+ ## Description Shape
31
+
32
+ ```text
33
+ Summarize the delivered change.
34
+
35
+ Explain the problem and the approach.
36
+
37
+ Verification: <commands and results>
38
+ Risk: <migration, compatibility, or recovery context>
39
+ ```
40
+
41
+ Keep tags short and use them according to the repository's established format.
42
+
43
+ ## Reviewing a Description
44
+
45
+ Compare the description with the changed files and the review findings. Keep the
46
+ summary, scope, verification, and risk information aligned with the pull
47
+ request's current contents.
48
+
49
+ Use [reviews](../reviews/SKILL.md#review-workflow) for substantive code
50
+ assessment and [small-cl](../small-cl/SKILL.md#what-a-focused-pull-request-contains)
51
+ to establish a focused scope.
@@ -0,0 +1,42 @@
1
+ ---
2
+ name: emergencies
3
+ description: >-
4
+ Classify an urgent production change and guide its focused emergency review.
5
+ Use when a user asks about an "emergency hotfix", "production incident", or "urgent security fix".
6
+ ---
7
+
8
+ # Emergency Review Guide
9
+
10
+ ## Emergency Classification
11
+
12
+ Use emergency handling for a narrow change that mitigates an active, severe
13
+ consequence:
14
+
15
+ - A production failure materially affecting users or a critical service.
16
+ - An active security or legal exposure requiring prompt mitigation.
17
+ - A contractual, hardware, or market deadline where a missed delivery causes a
18
+ severe external consequence.
19
+
20
+ Record the incident, affected system, immediate consequence, and the proposed
21
+ mitigation before assessing the change.
22
+
23
+ ## Standard Priority
24
+
25
+ Use the [review guide](../reviews/SKILL.md#review-workflow) for feature
26
+ schedules, end-of-day timing, ordinary delivery targets, and build remediation.
27
+ Use a focused rollback or remediation change when it restores service safely.
28
+
29
+ ## While the Incident Is Active
30
+
31
+ Keep the change as small as the mitigation permits. Evaluate whether it resolves
32
+ the incident, introduces a new immediate risk, and has sufficient validation for
33
+ the affected path.
34
+
35
+ State the incident context, verification performed, observed result, and any
36
+ remaining recovery work in the pull request. Use the [comment guide](../comments/SKILL.md#writing-useful-review-comments)
37
+ to communicate required mitigation work clearly.
38
+
39
+ ## Follow-up Assessment
40
+
41
+ After service is stable, use the [review guide](../reviews/SKILL.md#evaluation-criteria)
42
+ for the broader maintainability, testing, documentation, and prevention work.
@@ -0,0 +1,21 @@
1
+ ---
2
+ name: imagegen
3
+ description: Generate prompt-driven images at exact requested resolutions through OpenAI API or Codex OAuth, with verified Pillow dimensions, truthful receipts, and safe atomic publication.
4
+ argument-hint: --backend openai-api|codex-oauth --prompt "..." --size 2880x2880 --output path.png
5
+ ---
6
+
7
+ # Exact-resolution image generation
8
+
9
+ Use `scripts/imagegen.py` for reusable image generation.
10
+
11
+ Prerequisites: Python 3.11 or newer and Pillow. The direct backend requires `OPENAI_API_KEY`; the OAuth backend requires an authenticated `codex` installation.
12
+
13
+ ```text
14
+ python scripts/imagegen.py --backend openai-api --prompt "..." --size 2880x2880 --output generated.png
15
+ ```
16
+
17
+ `openai-api` reads `OPENAI_API_KEY` from the environment and requests `gpt-image-2`. `codex-oauth` invokes the authenticated `codex` executable in an isolated temporary directory and measures its single PNG artifact.
18
+
19
+ Native provider dimensions publish unchanged source bytes. A mismatch fails with the default `--resize-policy forbid`; `--resize-policy allow` applies Pillow resizing and records `resized` in the JSON sidecar receipt.
20
+
21
+ The receipt sits beside the PNG with a `.json` suffix. It contains hashes, observed dimensions, backend, model or tool, transformation classification, prompt hash, and credential source name. Existing output or receipt files require `--overwrite`.
@@ -0,0 +1 @@
1
+ """Configuration package for the imagegen skill."""
@@ -0,0 +1,28 @@
1
+ """Named imagegen limits and provider settings."""
2
+
3
+ OPENAI_API_URL = "https://api.openai.com/v1/images/generations"
4
+ OPENAI_MODEL = "gpt-image-2"
5
+ OPENAI_OUTPUT_FORMAT = "png"
6
+ OPENAI_API_KEY_NAME = "OPENAI_API_KEY"
7
+ CODEX_TOOL_NAME = "codex-imagegen"
8
+ ALL_SUPPORTED_BACKENDS = ("openai-api", "codex-oauth")
9
+ ALL_SUPPORTED_RESIZE_POLICIES = ("forbid", "allow")
10
+ MAXIMUM_IMAGE_EDGE = 3840
11
+ MINIMUM_PIXEL_COUNT = 655_360
12
+ MAXIMUM_PIXEL_COUNT = 8_294_400
13
+ SIZE_MULTIPLE = 16
14
+ JSON_INDENT_LEVEL = 2
15
+ MAXIMUM_PROVIDER_BYTES = 64 * 1024 * 1024
16
+ CODEX_TIMEOUT_SECONDS = 300
17
+ MAXIMUM_CODEX_OUTPUT_BYTES = 1 * 1024 * 1024
18
+ OPENAI_TIMEOUT_SECONDS = 120
19
+ SIZE_COMPONENT_COUNT = 2
20
+ SIZE_SEPARATOR = "x"
21
+ PNG_SUFFIX = ".png"
22
+ PNG_FORMAT = "PNG"
23
+ RECEIPT_SUFFIX = ".json"
24
+ TEMPORARY_DIRECTORY_PREFIX = "imagegen-"
25
+ TEMPORARY_FILE_TOKEN_BYTES = 8
26
+ DEFAULT_PROVIDER_EDGE = 2048
27
+ MINIMUM_DIMENSION = 1
28
+ MAXIMUM_CODEX_ARTIFACT_COUNT = 1
@@ -0,0 +1,45 @@
1
+ """Command-line entry point for exact-resolution image generation."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import argparse
6
+ from pathlib import Path
7
+
8
+ from config.constants import ALL_SUPPORTED_BACKENDS, ALL_SUPPORTED_RESIZE_POLICIES
9
+ from imagegen_core import ImagegenError, generate_image, parse_size
10
+
11
+
12
+ def build_parser() -> argparse.ArgumentParser:
13
+ """Build the imagegen command-line parser.
14
+
15
+ Returns:
16
+ Parser for the imagegen command-line contract.
17
+ """
18
+ parser = argparse.ArgumentParser(description="Generate an exact-resolution image")
19
+ parser.add_argument("--backend", choices=ALL_SUPPORTED_BACKENDS, required=True)
20
+ parser.add_argument("--prompt", required=True)
21
+ parser.add_argument("--size", required=True)
22
+ parser.add_argument("--output", dest="destination_path", type=Path, required=True)
23
+ parser.add_argument("--resize-policy", choices=ALL_SUPPORTED_RESIZE_POLICIES, default=ALL_SUPPORTED_RESIZE_POLICIES[0])
24
+ parser.add_argument("--overwrite", action="store_true")
25
+ return parser
26
+
27
+
28
+ def main() -> int:
29
+ """Run the CLI and return a process status.
30
+
31
+ Returns:
32
+ Zero for a published artifact and one for a generation failure.
33
+ """
34
+ arguments = build_parser().parse_args()
35
+ try:
36
+ all_receipt = generate_image(arguments.prompt, arguments.backend, parse_size(arguments.size), arguments.destination_path, arguments.resize_policy, arguments.overwrite)
37
+ except ImagegenError as error:
38
+ print(f"ERROR: {error}")
39
+ return 1
40
+ print(f"Generated {arguments.destination_path} ({all_receipt['transformation']})")
41
+ return 0
42
+
43
+
44
+ if __name__ == "__main__":
45
+ raise SystemExit(main())