claude-dev-env 1.93.1 → 1.95.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (262) hide show
  1. package/_shared/advisor/CLAUDE.md +2 -2
  2. package/_shared/advisor/advisor-protocol.md +35 -27
  3. package/_shared/advisor/scripts/config/advisor_scripts_constants/model_tier_run_validator_constants.py +3 -2
  4. package/_shared/advisor/scripts/model_tier_run_validator.py +23 -15
  5. package/_shared/advisor/scripts/tests/test_model_tier_run_validator.py +81 -17
  6. package/_shared/pr-loop/CLAUDE.md +1 -0
  7. package/_shared/pr-loop/audit-contract.md +1 -1
  8. package/_shared/pr-loop/gh-payloads.md +3 -3
  9. package/_shared/pr-loop/post-audit-thread-contract.md +51 -0
  10. package/_shared/pr-loop/scripts/README.md +2 -2
  11. package/_shared/pr-loop/scripts/fix_hookspath.py +47 -12
  12. package/_shared/pr-loop/scripts/tests/test_code_rules_gate.py +0 -69
  13. package/_shared/pr-loop/scripts/tests/test_fix_hookspath.py +497 -374
  14. package/_shared/pr-loop/state-schema.md +3 -22
  15. package/bin/CLAUDE.md +11 -2
  16. package/bin/ever-shipped-skills.mjs +70 -0
  17. package/bin/install.mjs +138 -13
  18. package/bin/install.prune.test.mjs +457 -0
  19. package/bin/install.test.mjs +10 -4
  20. package/docs/CODE_RULES.md +1 -1
  21. package/hooks/blocking/CLAUDE.md +2 -0
  22. package/hooks/blocking/code_rules_enforcer.py +4 -0
  23. package/hooks/blocking/code_rules_shared.py +82 -0
  24. package/hooks/blocking/code_rules_test_layout.py +9 -3
  25. package/hooks/blocking/pii_commit_command.py +398 -0
  26. package/hooks/blocking/pii_payload_scan.py +133 -0
  27. package/hooks/blocking/pii_prevention_blocker.py +151 -449
  28. package/hooks/blocking/plain_language_blocker.py +138 -4
  29. package/hooks/blocking/sensitive_file_protector.py +114 -48
  30. package/hooks/blocking/tdd_enforcer.py +9 -2
  31. package/hooks/blocking/test_code_rules_enforcer_scratchpad.py +105 -0
  32. package/hooks/blocking/test_code_rules_shared.py +181 -0
  33. package/hooks/blocking/test_pii_prevention_blocker.py +299 -0
  34. package/hooks/blocking/test_plain_language_blocker_allowlist.py +184 -0
  35. package/hooks/blocking/test_sensitive_file_protector.py +185 -0
  36. package/hooks/blocking/test_tdd_enforcer_scratchpad.py +105 -0
  37. package/hooks/blocking/test_verdict_directory_write_blocker.py +42 -7
  38. package/hooks/hooks_constants/CLAUDE.md +4 -2
  39. package/hooks/hooks_constants/code_rules_path_utils_constants.py +0 -2
  40. package/hooks/hooks_constants/harness_scratchpad_constants.py +17 -0
  41. package/hooks/hooks_constants/local_identity.py +65 -15
  42. package/hooks/hooks_constants/pii_prevention_constants.py +16 -0
  43. package/hooks/hooks_constants/plain_language_blocker_constants.py +5 -0
  44. package/hooks/hooks_constants/pr_description_enforcer_constants.py +1 -1
  45. package/hooks/hooks_constants/sensitive_file_protector_constants.py +42 -0
  46. package/hooks/hooks_constants/test_local_identity.py +68 -0
  47. package/hooks/pyproject.toml +75 -4
  48. package/hooks/validators/CLAUDE.md +1 -1
  49. package/hooks/validators/README.md +2 -0
  50. package/hooks/validators/python_style_checks.py +114 -136
  51. package/hooks/validators/python_style_helpers.py +95 -0
  52. package/hooks/validators/test_python_style_checks.py +0 -164
  53. package/hooks/validators/test_python_style_checks_decorator_gap.py +119 -0
  54. package/hooks/validators/test_python_style_fixes.py +251 -0
  55. package/hooks/validators/test_python_style_helpers.py +125 -0
  56. package/package.json +1 -1
  57. package/rules/CLAUDE.md +1 -0
  58. package/rules/anti-corollary-tests.md +69 -0
  59. package/rules/bdd.md +1 -3
  60. package/rules/code-reviews.md +1 -1
  61. package/rules/gh-paginate.md +1 -1
  62. package/rules/plain-language.md +2 -0
  63. package/scripts/CLAUDE.md +10 -1
  64. package/scripts/Get-SessionAccount.ps1 +210 -0
  65. package/scripts/tests/CLAUDE.md +15 -1
  66. package/scripts/tests/Get-SessionAccount.Tests.ps1 +350 -0
  67. package/skills/CLAUDE.md +6 -27
  68. package/skills/anthropic-plan/SKILL.md +1 -13
  69. package/skills/autoconverge/CLAUDE.md +5 -2
  70. package/skills/autoconverge/SKILL.md +112 -387
  71. package/skills/autoconverge/reference/CLAUDE.md +4 -1
  72. package/skills/autoconverge/reference/closing-report.md +9 -2
  73. package/skills/autoconverge/reference/convergence.md +26 -22
  74. package/skills/autoconverge/reference/headless-safety.md +44 -0
  75. package/skills/autoconverge/reference/multi-pr.md +88 -0
  76. package/skills/autoconverge/reference/self-closing-loop.md +84 -0
  77. package/skills/autoconverge/reference/stop-conditions.md +21 -13
  78. package/skills/autoconverge/workflow/converge.clean-audit.test.mjs +87 -27
  79. package/skills/autoconverge/workflow/converge.contract.test.mjs +40 -10
  80. package/skills/autoconverge/workflow/converge.copilot-gate.test.mjs +179 -47
  81. package/skills/autoconverge/workflow/converge.fix-progress.test.mjs +1 -1
  82. package/skills/autoconverge/workflow/converge.mjs +286 -96
  83. package/skills/bugteam/CLAUDE.md +1 -1
  84. package/skills/bugteam/CONSTRAINTS.md +3 -3
  85. package/skills/bugteam/PROMPTS.md +8 -19
  86. package/skills/bugteam/SKILL.md +13 -14
  87. package/skills/bugteam/reference/CLAUDE.md +1 -1
  88. package/skills/bugteam/reference/README.md +2 -3
  89. package/skills/bugteam/reference/audit-and-teammates.md +2 -2
  90. package/skills/bugteam/reference/copilot-gap-analysis.md +2 -0
  91. package/skills/bugteam/reference/github-pr-reviews.md +56 -38
  92. package/skills/bugteam/reference/team-setup.md +11 -11
  93. package/skills/bugteam/scripts/CLAUDE.md +6 -6
  94. package/skills/bugteam/scripts/README.md +20 -8
  95. package/skills/bugteam/scripts/bugteam_code_rules_gate.py +13 -1463
  96. package/skills/bugteam/scripts/bugteam_fix_hookspath.py +23 -358
  97. package/skills/bugteam/scripts/bugteam_preflight.py +13 -315
  98. package/skills/bugteam/scripts/bugteam_scripts_constants/CLAUDE.md +2 -3
  99. package/skills/bugteam/scripts/test_bugteam_code_rules_gate.py +34 -1053
  100. package/skills/bugteam/scripts/test_bugteam_fix_hookspath.py +30 -347
  101. package/skills/bugteam/scripts/test_bugteam_preflight.py +30 -305
  102. package/skills/closeout/SKILL.md +153 -0
  103. package/skills/closeout/reference/handoff-prompt-template.md +72 -0
  104. package/skills/closeout/reference/issue-body-templates.md +108 -0
  105. package/skills/closeout/reference/pii-redaction-checklist.md +36 -0
  106. package/skills/copilot-finding-triage/SKILL.md +80 -28
  107. package/skills/copilot-finding-triage/reference/tier-rubric.md +70 -11
  108. package/skills/copilot-finding-triage/templates/notification.md +8 -3
  109. package/skills/everything-search/SKILL.md +1 -2
  110. package/skills/grokify/SKILL.md +58 -0
  111. package/skills/grokify/templates/handoff-template.md +92 -0
  112. package/skills/orchestrator/SKILL.md +35 -25
  113. package/skills/orchestrator-refresh/SKILL.md +15 -11
  114. package/skills/pr-converge/CLAUDE.md +1 -1
  115. package/skills/pr-converge/SKILL.md +132 -233
  116. package/skills/pr-converge/reference/convergence-gates.md +102 -66
  117. package/skills/pr-converge/reference/examples.md +37 -25
  118. package/skills/pr-converge/reference/fix-protocol.md +7 -7
  119. package/skills/pr-converge/reference/multi-pr-orchestration.md +10 -4
  120. package/skills/pr-converge/reference/per-tick.md +64 -41
  121. package/skills/pr-converge/reference/state-schema.md +27 -2
  122. package/skills/pr-converge/scripts/CLAUDE.md +8 -0
  123. package/skills/pr-converge/scripts/README.md +4 -3
  124. package/skills/pr-converge/scripts/_pr_converge_path_setup.py +23 -0
  125. package/skills/pr-converge/scripts/check_convergence.py +189 -645
  126. package/skills/pr-converge/scripts/check_convergence_gates.py +235 -0
  127. package/skills/pr-converge/scripts/check_convergence_thread_gates.py +219 -0
  128. package/skills/pr-converge/scripts/conftest.py +8 -0
  129. package/skills/pr-converge/scripts/pr_converge_scripts_constants/CLAUDE.md +1 -0
  130. package/skills/pr-converge/scripts/pr_converge_scripts_constants/convergence_gate_constants.py +36 -0
  131. package/skills/pr-converge/scripts/test__pr_converge_path_setup.py +26 -0
  132. package/skills/pr-converge/scripts/test_check_convergence.py +73 -228
  133. package/skills/pr-converge/scripts/test_check_convergence_contract.py +321 -0
  134. package/skills/pr-converge/scripts/test_check_convergence_gates.py +68 -0
  135. package/skills/pr-converge/scripts/test_check_convergence_thread_gates.py +75 -0
  136. package/skills/pr-fix-protocol/SKILL.md +20 -20
  137. package/skills/privacy-hygiene/SKILL.md +4 -3
  138. package/skills/reviewer-gates/SKILL.md +26 -8
  139. package/skills/session-log/SKILL.md +11 -12
  140. package/skills/session-tidy/SKILL.md +40 -30
  141. package/skills/skill-builder/CLAUDE.md +13 -10
  142. package/skills/skill-builder/SKILL.md +31 -31
  143. package/skills/skill-builder/references/CLAUDE.md +10 -6
  144. package/skills/skill-builder/references/delegation-map.md +13 -4
  145. package/skills/skill-builder/references/description-field.md +113 -0
  146. package/skills/skill-builder/references/self-audit-checklist.md +21 -4
  147. package/skills/skill-builder/references/skill-modularity.md +113 -0
  148. package/skills/skill-builder/references/skill-types.md +4 -0
  149. package/skills/skill-builder/templates/CLAUDE.md +4 -4
  150. package/skills/skill-builder/templates/gap-analysis.md +25 -1
  151. package/skills/skill-builder/workflows/CLAUDE.md +6 -4
  152. package/skills/skill-builder/workflows/improve-skill.md +17 -16
  153. package/skills/skill-builder/workflows/new-skill.md +34 -10
  154. package/skills/skill-builder/workflows/polish-skill.md +59 -43
  155. package/skills/team-advisor/SKILL.md +15 -11
  156. package/skills/usage-pause/SKILL.md +10 -14
  157. package/system-prompts/software-engineer.xml +7 -6
  158. package/hooks/validators/test_verify_paths.py +0 -32
  159. package/hooks/validators/verify_paths.py +0 -57
  160. package/skills/bdd-protocol/CLAUDE.md +0 -26
  161. package/skills/bdd-protocol/SKILL.md +0 -30
  162. package/skills/bdd-protocol/references/CLAUDE.md +0 -10
  163. package/skills/bdd-protocol/references/anti-patterns.md +0 -26
  164. package/skills/bdd-protocol/references/example-mapping.md +0 -23
  165. package/skills/bg-agent/CLAUDE.md +0 -17
  166. package/skills/bg-agent/SKILL.md +0 -69
  167. package/skills/bugteam/scripts/bugteam_scripts_constants/bugteam_code_rules_gate_constants.py +0 -55
  168. package/skills/bugteam/scripts/bugteam_scripts_constants/bugteam_fix_hookspath_constants.py +0 -26
  169. package/skills/bugteam/scripts/bugteam_scripts_constants/bugteam_preflight_constants.py +0 -35
  170. package/skills/caveman/CLAUDE.md +0 -15
  171. package/skills/caveman/SKILL.md +0 -38
  172. package/skills/code/CLAUDE.md +0 -17
  173. package/skills/code/SKILL.md +0 -178
  174. package/skills/deep-research/CLAUDE.md +0 -17
  175. package/skills/deep-research/SKILL.md +0 -80
  176. package/skills/findbugs/CLAUDE.md +0 -20
  177. package/skills/findbugs/SKILL.md +0 -241
  178. package/skills/fixbugs/CLAUDE.md +0 -19
  179. package/skills/fixbugs/SKILL.md +0 -142
  180. package/skills/gh-paginate/CLAUDE.md +0 -18
  181. package/skills/gh-paginate/SKILL.md +0 -84
  182. package/skills/gotcha/CLAUDE.md +0 -33
  183. package/skills/gotcha/SKILL.md +0 -73
  184. package/skills/implement/CLAUDE.md +0 -27
  185. package/skills/implement/SKILL.md +0 -66
  186. package/skills/implement/scripts/CLAUDE.md +0 -22
  187. package/skills/implement/scripts/append_note.py +0 -133
  188. package/skills/implement/scripts/implement_scripts_constants/CLAUDE.md +0 -22
  189. package/skills/implement/scripts/implement_scripts_constants/__init__.py +0 -0
  190. package/skills/implement/scripts/implement_scripts_constants/notes_constants.py +0 -12
  191. package/skills/implement/scripts/test_append_note.py +0 -191
  192. package/skills/log-audit/CLAUDE.md +0 -20
  193. package/skills/log-audit/SKILL.md +0 -66
  194. package/skills/log-audit/reference/CLAUDE.md +0 -9
  195. package/skills/log-audit/reference/charter.md +0 -52
  196. package/skills/log-audit/scripts/CLAUDE.md +0 -27
  197. package/skills/log-audit/scripts/cluster_recurrences.py +0 -261
  198. package/skills/log-audit/scripts/collect_log_window.py +0 -199
  199. package/skills/log-audit/scripts/log_audit_constants/CLAUDE.md +0 -12
  200. package/skills/log-audit/scripts/log_audit_constants/__init__.py +0 -0
  201. package/skills/log-audit/scripts/log_audit_constants/cluster_recurrences_constants.py +0 -23
  202. package/skills/log-audit/scripts/log_audit_constants/collect_log_window_constants.py +0 -24
  203. package/skills/log-audit/scripts/log_audit_constants/mine_copilot_findings_constants.py +0 -49
  204. package/skills/log-audit/scripts/mine_copilot_findings.py +0 -302
  205. package/skills/log-audit/scripts/test_cluster_recurrences.py +0 -160
  206. package/skills/log-audit/scripts/test_collect_log_window.py +0 -111
  207. package/skills/log-audit/scripts/test_mine_copilot_findings.py +0 -126
  208. package/skills/logifix/CLAUDE.md +0 -36
  209. package/skills/logifix/SKILL.md +0 -69
  210. package/skills/logifix/scripts/CLAUDE.md +0 -16
  211. package/skills/logifix/scripts/logifix.ps1 +0 -205
  212. package/skills/monitor-open-prs/CLAUDE.md +0 -34
  213. package/skills/monitor-open-prs/SKILL.md +0 -88
  214. package/skills/monitor-open-prs/scripts/CLAUDE.md +0 -17
  215. package/skills/monitor-open-prs/scripts/discover_open_prs.py +0 -69
  216. package/skills/monitor-open-prs/scripts/test_discover_open_prs.py +0 -149
  217. package/skills/monitor-open-prs/test_skill_contract.py +0 -27
  218. package/skills/post-audit-findings/SKILL.md +0 -80
  219. package/skills/pr-consistency-audit/CLAUDE.md +0 -34
  220. package/skills/pr-consistency-audit/SKILL.md +0 -116
  221. package/skills/pr-consistency-audit/reference/CLAUDE.md +0 -16
  222. package/skills/pr-consistency-audit/reference/detection-rules.md +0 -96
  223. package/skills/pr-consistency-audit/reference/illustrations.md +0 -78
  224. package/skills/pr-review-responder/CLAUDE.md +0 -35
  225. package/skills/pr-review-responder/EXAMPLES.md +0 -590
  226. package/skills/pr-review-responder/PRINCIPLES.md +0 -533
  227. package/skills/pr-review-responder/README.md +0 -168
  228. package/skills/pr-review-responder/SKILL.md +0 -203
  229. package/skills/pr-review-responder/TESTING.md +0 -350
  230. package/skills/pr-scope-resolve/SKILL.md +0 -45
  231. package/skills/pre-compact/CLAUDE.md +0 -24
  232. package/skills/pre-compact/SKILL.md +0 -134
  233. package/skills/qbug/CLAUDE.md +0 -40
  234. package/skills/qbug/SKILL.md +0 -387
  235. package/skills/qbug/test_qbug_skill_audit_schema.py +0 -152
  236. package/skills/qbug/test_qbug_skill_post_fix_audit.py +0 -103
  237. package/skills/refine/CLAUDE.md +0 -44
  238. package/skills/refine/SKILL.md +0 -262
  239. package/skills/refine/templates/CLAUDE.md +0 -17
  240. package/skills/refine/templates/implementation-notes-template.html +0 -56
  241. package/skills/refine/templates/plan-template.md +0 -60
  242. package/skills/research-mode/CLAUDE.md +0 -35
  243. package/skills/research-mode/SKILL.md +0 -53
  244. package/skills/structure-prompt/CLAUDE.md +0 -42
  245. package/skills/structure-prompt/SKILL.md +0 -44
  246. package/skills/structure-prompt/reference/CLAUDE.md +0 -28
  247. package/skills/structure-prompt/reference/adversarial-tuning.md +0 -62
  248. package/skills/structure-prompt/reference/block-classification.md +0 -27
  249. package/skills/structure-prompt/reference/canonical-case.md +0 -48
  250. package/skills/structure-prompt/reference/citation-depth.md +0 -70
  251. package/skills/structure-prompt/reference/cleanup.md +0 -33
  252. package/skills/structure-prompt/reference/constraints.md +0 -33
  253. package/skills/structure-prompt/reference/directives.md +0 -37
  254. package/skills/structure-prompt/reference/examples.md +0 -72
  255. package/skills/structure-prompt/reference/instantiation.md +0 -51
  256. package/skills/structure-prompt/reference/output-contract.md +0 -72
  257. package/skills/structure-prompt/reference/per-category.md +0 -23
  258. package/skills/structure-prompt/reference/persona.md +0 -38
  259. package/skills/structure-prompt/reference/research.md +0 -33
  260. package/skills/structure-prompt/reference/structure.md +0 -28
  261. package/skills/verified-build/CLAUDE.md +0 -33
  262. package/skills/verified-build/SKILL.md +0 -33
@@ -1,142 +0,0 @@
1
- ---
2
- name: fixbugs
3
- description: >-
4
- Fixes the bugs from the latest /findbugs run by handing them to /agent-prompt,
5
- which spawns a background agent to apply every fix in one commit. An optional
6
- argument filters by severity (e.g. /fixbugs P0). Triggers: '/fixbugs', 'fix
7
- all the bugs', 'apply the audit fixes', 'apply the findbugs results'.
8
- ---
9
-
10
- # Fixbugs
11
-
12
- **Core principle:** A thin bridge between `/findbugs` (read-only audit) and `/agent-prompt` (structured prompt authoring + spawn). /fixbugs recovers the prior findings, packages them as a goal, and hands off. It does not author prompts itself, does not spawn agents directly, and does not run audits.
13
-
14
- ## Transport check (before any GitHub step)
15
-
16
- Run `command -v gh`; when it succeeds, run `gh auth status`; once the PR scope is resolved, run `gh api repos/<owner>/<repo> --jq .permissions.push` and take `true` as the pass. When any check fails, run the `pr-loop-cloud-transport` skill first, route every `gh` operation in this skill through its substitution matrix, and carry the same routing into the goal string handed to `/agent-prompt` so the spawned fix agent inherits it.
17
-
18
- ## When this skill applies
19
-
20
- Right after `/findbugs` returned findings on the current branch and the user wants the bugs fixed without further triage. Bare `/fixbugs` defaults to all severities (P0 + P1 + P2). Argument-filtered invocations (e.g. `/fixbugs P0`, `/fixbugs P0+P1`, `/fixbugs P0 P1`) narrow the target set.
21
-
22
- Refusal cases:
23
-
24
- - **No findings in session.** Respond exactly: `No findings in this session. Run /findbugs first.` and stop.
25
- - **Most recent /findbugs returned zero bugs.** Respond exactly: `No bugs to fix.` and stop.
26
- - **Filter excludes every finding.** Respond: `No bugs match the filter <args>.` and stop.
27
- - **Agent-prompt skill not installed.** Before Step 1, verify the `agent-prompt` skill is in the available skills list. If missing, respond: `agent-prompt skill not installed. /fixbugs hands off to it; install it first.` and stop.
28
-
29
- ## The Process
30
-
31
- ### Step 1: Recover the findings
32
-
33
- Locate the most recent `/findbugs` output in the current conversation. For each finding, capture:
34
-
35
- - Severity (`P0` / `P1` / `P2`)
36
- - `file:line`
37
- - Category (the A–P letter or category name `/findbugs` reported)
38
- - One-sentence description as `/findbugs` wrote it
39
-
40
- Apply the severity filter from `$ARGUMENTS` if present:
41
-
42
- - `P0` → P0 only
43
- - `P0+P1` or `P0 P1` → P0 and P1
44
- - `P1` → P1 only
45
- - absent → all severities
46
-
47
- If the filtered set is empty, refuse per the refusal cases above.
48
-
49
- ### Step 2: Re-resolve PR scope
50
-
51
- Apply the `pr-scope-resolve` skill (`../pr-scope-resolve/SKILL.md`) with caller `fixbugs` to resolve the same PR target `/findbugs` used — the fixes stay scoped to the files the `/findbugs` findings from Step 1 name. When no target exists, respond with the sub-skill's canonical refusal line and stop:
52
-
53
- `No PR or upstream diff. /fixbugs needs a target.`
54
-
55
- Capture: `<owner>/<repo>`, head branch, base branch, PR number, PR URL.
56
-
57
- ### Step 3: Hand off to /agent-prompt
58
-
59
- Invoke the `agent-prompt` skill with a goal string of this exact shape:
60
-
61
- ```
62
- Fix the following bugs surfaced by /findbugs on
63
- <owner>/<repo> @ <head_branch> (PR #<number>, base <base_branch>):
64
-
65
- [for each filtered finding, one bullet:]
66
- - [<severity>] <file:line> (<category>): <description>
67
-
68
- Deploy a background implementer (model: sonnet) to implement all fixes
69
- in one commit on the existing branch and push. The implementer must **Read** the clean-coder agent file first (`~/.claude/agents/clean-coder.md`; Windows `%USERPROFILE%\.claude\agents\clean-coder.md`) and treat it as binding; on Cursor use `Task` + `generalPurpose` with that Read in the prompt when `clean-coder` is not a valid `Task` subtype. Constraints:
70
- - Modify only the files referenced in the bug list above.
71
- - Do NOT change the PR base, do NOT rebase, do NOT amend, do NOT --force.
72
- - Do NOT skip git hooks (no --no-verify, no --no-gpg-sign).
73
- - Use git add by explicit path; never `git add .` or `git add -A`.
74
- - Preserve existing comments on lines you do not modify.
75
- - Type hints on every signature you touch.
76
-
77
- After push, report: commit SHA, per-file lines added/removed, hook output
78
- summary, and confirmation that each bug above was addressed.
79
- ```
80
-
81
- `/agent-prompt` then runs its own workflow end-to-end: prompt-generator authoring, Outcome preview, AskUserQuestion confirmation gate, background spawn. The confirmation gate is preserved — fixes are write operations and the user must approve the final XML before the agent runs.
82
-
83
- ### Step 4: Hand-off complete
84
-
85
- `/fixbugs` produces no further output. `/agent-prompt` owns the visible chat from this point: the XML fence, the Outcome digest, the AskUserQuestion, and the spawn confirmation. Do not duplicate any of those, do not summarize them, do not add commentary.
86
-
87
- ## Output Format
88
-
89
- When `/fixbugs` proceeds, the visible output is `/agent-prompt`'s output — nothing from `/fixbugs` itself.
90
-
91
- When `/fixbugs` short-circuits (no findings, no PR, empty filter, zero bugs), the visible output is the single-line refusal message and nothing else.
92
-
93
- ## Constraints
94
-
95
- - **Sequencing.** `/fixbugs` runs AFTER `/findbugs`. It does not perform audits.
96
- - **Scope inheritance.** Fixes target only files referenced in the prior `/findbugs` findings — the PR diff scope. Do not expand to unrelated files.
97
- - **No silent spawn.** `/agent-prompt`'s confirmation gate is preserved on every run.
98
- - **One commit per `/fixbugs` run.** All filtered fixes batch into a single commit.
99
- - **No `--force`, no `--amend`, no rebase, no base change.** Standard git workflow applies to the spawned agent.
100
- - **Sonnet for the implementer.** Always pass `model: sonnet` to the spawn — keeps cost predictable and matches the agent's training fit for code edits.
101
- - **Background spawn.** The user typed `/fixbugs` to delegate, not to wait. The agent runs in the background and notifies on completion.
102
-
103
- ## Examples
104
-
105
- <example>
106
- User: `/findbugs` → returns `1 P0 / 2 P1 / 0 P2`
107
- User: `/fixbugs`
108
- Claude: [recovers all 3 findings, resolves PR scope, invokes /agent-prompt with a goal targeting all 3 bugs; /agent-prompt presents the XML + Outcome digest + AskUserQuestion; on Launch it, the background sonnet implementer spawns]
109
- </example>
110
-
111
- <example>
112
- User: `/findbugs` → returns `1 P0 / 2 P1 / 1 P2`
113
- User: `/fixbugs P0+P1`
114
- Claude: [filters to 3 findings (the P2 is dropped), hands the filtered set to /agent-prompt]
115
- </example>
116
-
117
- <example>
118
- User: `/fixbugs` (no prior /findbugs in session)
119
- Claude: `No findings in this session. Run /findbugs first.`
120
- </example>
121
-
122
- <example>
123
- User: `/findbugs` → returns `0 P0 / 0 P1 / 0 P2`
124
- User: `/fixbugs`
125
- Claude: `No bugs to fix.`
126
- </example>
127
-
128
- <example>
129
- User: `/findbugs` → returns `0 P0 / 0 P1 / 1 P2`
130
- User: `/fixbugs P0`
131
- Claude: `No bugs match the filter P0.`
132
- </example>
133
-
134
- ## Why this design
135
-
136
- Three skills, three responsibilities:
137
-
138
- - `/findbugs` audits in a clean room, returns findings.
139
- - `/fixbugs` packages findings as a goal, delegates.
140
- - `/agent-prompt` authors the XML and spawns the agent (with confirmation).
141
-
142
- Each skill stays small and reuses what already exists. `/fixbugs` adds value by recovering findings from chat, filtering by severity, and writing the goal in `/agent-prompt`'s expected shape — not by reimplementing prompt authoring or spawn logic. The `/agent-prompt` confirmation gate is non-negotiable because fixes write code, push to a PR, and are visible to reviewers; the friction is the safety.
@@ -1,18 +0,0 @@
1
- # gh-paginate skill
2
-
3
- Provides the safe-pagination rule and patterns for `gh api` calls against paginated GitHub list endpoints (PR reviews, PR comments, issue comments, pulls, issues). The rule prevents two silent-truncation defects: default page truncation and per-page `--jq` evaluation.
4
-
5
- **Trigger:** Loaded by the `gh-paginate` skill name or when any skill or rule references the pagination rule.
6
-
7
- ## Key files
8
-
9
- | File | Purpose |
10
- |---|---|
11
- | `SKILL.md` | The complete rule: affected endpoints, safe `--paginate --slurp \| jq` pattern, single-page bound pattern, single-object pattern, newest-first walk pattern, and enforcement notes |
12
-
13
- ## Conventions
14
-
15
- - The preferred pattern pipes `--paginate --slurp` to an **external** `jq` invocation so cross-page operations (`sort_by`, `last`, `reverse`) run on the merged array-of-pages. The built-in `--jq` flag is incompatible with `--slurp` and runs per-page, producing wrong cross-page results.
16
- - Single-object endpoints (e.g., `pulls/<number>`) are not paginated; `--paginate` is unnecessary and `gh --jq` is safe.
17
- - The single-page bound pattern (`?per_page=100` without `--paginate`) is acceptable only when the list is confirmed to stay under 100 entries.
18
- - This skill ships as documentation only; enforcement via a future PreToolUse hook is noted in `SKILL.md`.
@@ -1,84 +0,0 @@
1
- ---
2
- name: gh-paginate
3
- description: Safe pagination for gh api reads of paginated GitHub list endpoints (PR reviews/comments/files, issue comments, pulls, issues) — --paginate --slurp piped to external jq, single-page bounds, newest-first walks. Use before composing any gh api list-endpoint call or any cross-page jq operation (sort_by | last, reverse).
4
- ---
5
-
6
- # gh API Pagination Rule
7
-
8
- **Root cause:** GitHub REST API list endpoints paginate by default. Without `--paginate --slurp`, callers see only the oldest page, and cross-page jq operations (e.g., `sort_by | last`) operate within a single page — producing wrong-but-confident results.
9
-
10
- **Rule:** All `gh api` calls that read `pulls/<number>/reviews`, `pulls/<number>/comments`, `issues/<number>/comments`, or any other paginated GitHub list endpoint **must** request the full set of pages AND apply any cross-page jq operation through external `jq`, not through `gh`'s built-in `--jq`. Use `--paginate --slurp | jq` (preferred — see [Safe patterns](#safe-patterns)). Never call these endpoints with their default pagination, and never use `gh`'s `--jq` for cross-page operations like `sort_by | last` or `| reverse | .[0]`.
11
-
12
- ## Two defects, one rule
13
-
14
- This rule guards against two distinct silent-truncation defects that compound:
15
-
16
- 1. **Default page truncation.** Without `--paginate`, only the first page is fetched.
17
- 2. **`--jq` runs per-page, not on the concatenated result.** Per [GitHub CLI #10459](https://github.com/cli/cli/issues/10459), `gh api --paginate --jq '<filter>'` applies `<filter>` to each page **separately** and emits one output per page. Cross-page operations like `sort_by(.submitted_at) | last` therefore operate within each page independently, not across the merged result set.
18
-
19
- The safe patterns below fix both defects together: `--paginate --slurp` walks every page AND emits a single merged structure, and an **external** `jq` then runs cross-page operations on that merged structure.
20
-
21
- ## Affected endpoints
22
-
23
- The rule applies to every paginated read from the GitHub REST API. Common offenders in PR-loop skills:
24
-
25
- - `gh api repos/<owner>/<repo>/pulls/<number>/reviews`
26
- - `gh api repos/<owner>/<repo>/pulls/<number>/comments`
27
- - `gh api repos/<owner>/<repo>/pulls/<number>/files`
28
- - `gh api repos/<owner>/<repo>/issues/<number>/comments`
29
- - `gh api repos/<owner>/<repo>/pulls`
30
- - `gh api repos/<owner>/<repo>/issues`
31
-
32
- The same rule applies to any other endpoint documented as paginated by GitHub (see [GitHub REST API pagination](https://docs.github.com/en/rest/using-the-rest-api/using-pagination-in-the-rest-api)).
33
-
34
- Single-object endpoints (e.g., `repos/<owner>/<repo>/pulls/<number>` returning one PR object) are not paginated — `?per_page=...` is silently ignored, and neither `--paginate` nor external `jq` is required. Use `gh`'s `--jq` directly on those endpoints.
35
-
36
- ## Safe patterns
37
-
38
- ### Preferred — `--paginate --slurp` piped to external `jq`
39
-
40
- `gh api ... --paginate --slurp` walks every page and emits a single merged JSON array of page-arrays (`[[page1_items...], [page2_items...], ...]`). Pipe to external `jq` to flatten and filter across the full result set:
41
-
42
- ```bash
43
- gh api 'repos/<owner>/<repo>/pulls/<number>/reviews?per_page=100' --paginate --slurp \
44
- | jq '[.[][] | select(.user.login=="cursor[bot]")] | sort_by(.submitted_at) | last'
45
- ```
46
-
47
- The `.[][]` flattens the array-of-pages into one stream of items before the cross-page operators (`sort_by`, `last`, `reverse`) run. Combine with `?per_page=100` to reduce round-trips on long PRs.
48
-
49
- `gh`'s `--jq` flag and `--slurp` flag are mutually exclusive (gh CLI rejects `--paginate --slurp --jq` with `the --slurp option is not supported with --jq or --template`), which is why the filter must run in an external `jq` invocation.
50
-
51
- ### Acceptable — single-page bound on a paginated list endpoint when result fits
52
-
53
- When you have an explicit reason to read at most one page from a **paginated** list endpoint (e.g., a known-small list), document the bound in a comment and use `?per_page=100` without `--paginate`. Cross-page operators are not in play here, so `gh`'s `--jq` is safe:
54
-
55
- ```bash
56
- # Bound: a freshly created issue is expected to have <= 100 comments.
57
- gh api 'repos/<owner>/<repo>/issues/<number>/comments?per_page=100' \
58
- --jq '[.[] | select(.user.login=="cursor[bot]")] | length'
59
- ```
60
-
61
- This pattern is only safe when the endpoint is confirmed to return a list smaller than 100 entries. Lists that grow over the PR's lifetime (reviews, comments) must use `--paginate --slurp` plus external `jq`.
62
-
63
- ### Single-object endpoints — no pagination needed
64
-
65
- Endpoints that return a single object (e.g., `pulls/<number>`, `issues/<number>`) are not paginated. `?per_page=...`, `--paginate`, and `--slurp` are all unnecessary. Use `gh`'s built-in `--jq` directly:
66
-
67
- ```bash
68
- gh api 'repos/<owner>/<repo>/pulls/<number>' --jq '.head.sha'
69
- ```
70
-
71
- ### Newest-first walk
72
-
73
- Pair pagination with explicit reverse-sort so the consumer reads newest-first regardless of the API's internal order:
74
-
75
- ```bash
76
- gh api 'repos/<owner>/<repo>/pulls/<number>/reviews?per_page=100' --paginate --slurp \
77
- | jq '[.[][] | select(.user.login=="cursor[bot]")] | sort_by(.submitted_at) | reverse'
78
- ```
79
-
80
- This is the canonical pattern for the bugbot <-> bugteam convergence loop: walk newest-first, stop at the first clean review.
81
-
82
- ## Enforcement
83
-
84
- This rule is documentation-only at present. A future PreToolUse hook may pattern-match `Bash` invocations of `gh api repos/.../pulls/<n>/(reviews|comments)` without `--paginate --slurp` (or with `--paginate --jq` doing cross-page operations) and return a corrective message. Until that hook lands, treat this rule as binding by review and rely on it during skill authoring.
@@ -1,33 +0,0 @@
1
- # gotcha skill
2
-
3
- Captures an obstacle encountered during a skill run and records it as a gotcha entry in the relevant skill file, then opens a draft PR via the `fresh-branch` skill.
4
-
5
- **Trigger:** `/gotcha`, "add a gotcha", "document this gotcha", "record this obstacle".
6
-
7
- ## Key files
8
-
9
- | File | Purpose |
10
- |---|---|
11
- | `SKILL.md` | Full workflow: collect obstacle details, delegate to `bg-agent`, confirm to user |
12
-
13
- ## Workflow
14
-
15
- 1. Distill the obstacle into: which skill file was affected, what happened, what the user did to resolve it, and what to do differently next time.
16
- 2. Invoke `/bg-agent` with a self-contained prompt that instructs the agent to use `/fresh-branch` (branch name `gotcha/<short-slug>`), append to or create a `## Gotchas` section at the bottom of the skill file, commit, push, and open a draft PR.
17
- 3. Confirm to the user that the recording is running in the background.
18
-
19
- ## Gotcha entry format
20
-
21
- Each entry is a bullet under `## Gotchas`:
22
-
23
- ```markdown
24
- - **<title>:** <what happens>. <what to do instead>.
25
- ```
26
-
27
- ## Repo routing
28
-
29
- | Skill location | Target repo |
30
- |---|---|
31
- | `packages/claude-dev-env/skills/<name>/` | `jl-cmd/claude-dev-env` |
32
- | `~/.claude/skills/<name>/` | `jl-cmd/claude-dev-env` |
33
- | Project `.claude/skills/<name>/` | That project's repo |
@@ -1,73 +0,0 @@
1
- ---
2
- name: gotcha
3
- description: When a skill encounters an obstacle requiring user intervention, this skill invokes bg-agent to add the gotcha to the skill file's gotcha section and creates a PR via fresh-branch. Triggers on "/gotcha", "add a gotcha", "document this gotcha", "record this obstacle".
4
- ---
5
-
6
- # gotcha
7
-
8
- ## Overview
9
-
10
- When a skill is executed and hits an obstacle that requires user intervention to resolve, `/gotcha` captures that knowledge so future invocations avoid the same trap. It delegates the mechanical work to `bg-agent`, which writes the gotcha entry and opens a PR using `fresh-branch`.
11
-
12
- **Announce at start:** "Recording this gotcha and opening a PR."
13
-
14
- ## Instructions
15
-
16
- ### Step 1 — Collect the gotcha
17
-
18
- The caller provides the obstacle context. Distill it into:
19
-
20
- - **Which skill file** hit the obstacle (full path, e.g. `packages/claude-dev-env/skills/rebase/SKILL.md`).
21
- - **What happened** — the specific failure or blocker, in one or two sentences.
22
- - **What the user had to do** to resolve it.
23
- - **What to do differently next time** (the actionable gotcha).
24
-
25
- Determine which repo the skill lives in. Usually this is `claude-dev-env`, but if the skill is in another repo (e.g. a project-specific `.claude/skills/` directory), use that repo instead.
26
-
27
- ### Step 2 — Delegate to bg-agent
28
-
29
- Invoke `/bg-agent` with a task like:
30
-
31
- ```
32
- bg-agent add a gotcha to <skill-file-path> in repo <repo-name>. The gotcha is: "<one-line summary>". Details: "<what happened, what the user did, and what to do next time>."
33
-
34
- Steps:
35
- 1. Use /fresh-branch to create a branch named gotcha/<short-slug>.
36
- 2. In <skill-file-path>, add the gotcha entry under a ## Gotchas section (create the section at the bottom of the file if it does not exist).
37
- 3. Format each gotcha as a bullet: "- **<title>:** <description>."
38
- 4. Commit with message "fix(<skill-name>): add gotcha — <title>".
39
- 5. Push and create a draft PR.
40
- 6. Report the PR URL.
41
- ```
42
-
43
- The bg-agent will pick a suitable agent type and run the full workflow in the background.
44
-
45
- ### Step 3 — Confirm
46
-
47
- Tell the user: "Recording gotcha in the background. You will be notified when the PR is ready."
48
-
49
- ## Gotcha entry format
50
-
51
- Every gotcha entry follows this format:
52
-
53
- ```markdown
54
- ## Gotchas
55
-
56
- - **<title>:** <what happens>. <what to do instead>.
57
- ```
58
-
59
- If a `## Gotchas` section already exists, append to it. If not, create it at the bottom of the skill file.
60
-
61
- ## Which repo
62
-
63
- | Skill location | Repo |
64
- |---|---|
65
- | `packages/claude-dev-env/skills/<name>/` | `jl-cmd/claude-dev-env` |
66
- | `~/.claude/skills/<name>/` | `jl-cmd/claude-dev-env` (user skills) |
67
- | Project `.claude/skills/<name>/` | That project's repo |
68
-
69
- When unsure, ask the user which repo. Otherwise, default to `claude-dev-env`.
70
-
71
- ## Gotchas
72
-
73
- - **The bg-agent prompt must be self-contained.** The background agent has no access to this conversation. Include the skill file path, the gotcha text, the repo, and the exact workflow steps in the prompt.
@@ -1,27 +0,0 @@
1
- # Spec Execution Skill
2
-
3
- This skill (`implement`) runs a spec end-to-end while maintaining a sidecar `implementation-notes.html` that records design decisions, deviations, tradeoffs, and open questions made during the build.
4
-
5
- **Trigger:** `/implement [path-to-spec]`, "build out this plan and keep notes".
6
-
7
- ## Key files
8
-
9
- | File | Purpose |
10
- |---|---|
11
- | `SKILL.md` | Full workflow: resolve spec, run it, write notes via `append_note.py` |
12
- | `packages/claude-dev-env/skills/implement/scripts/append_note.py` | CLI that creates or appends to `implementation-notes.html` |
13
- | `packages/claude-dev-env/skills/implement/scripts/implement_scripts_constants/notes_constants.py` | Section slugs → headings and default filename |
14
-
15
- ## Subdirectories
16
-
17
- | Directory | Role |
18
- |---|---|
19
- | `scripts/` | Python CLI and constants for the notes file |
20
-
21
- ## Conventions
22
-
23
- - The spec is taken from `$ARGUMENTS` (path) or the most recent plan in conversation context. If neither is present, the skill asks via `AskUserQuestion`.
24
- - Notes are appended as decisions are made — not batched at the end.
25
- - The `append_note.py` CLI accepts `--section decisions|deviations|tradeoffs|questions`, `--about`, `--note`, and optionally `--file`. When `--file` is omitted, the script writes to `./implementation-notes.html`.
26
- - `$CLAUDE_SKILL_DIR` is substituted by Claude Code at runtime so the bundled script is found regardless of the current working directory.
27
- - The notes file structure must not be hand-edited — `append_note.py` locates sections by `<section id="...">` markers and the first `</ul>` after each.
@@ -1,66 +0,0 @@
1
- ---
2
- name: implement
3
- description: "Implement a spec while maintaining a running implementation-notes.html file that captures design decisions, deviations, tradeoffs, and open questions. Triggers: /implement, implement this spec, build out this plan and keep notes."
4
- argument-hint: "[path to spec file, or omit to use a spec already in context]"
5
- ---
6
-
7
- # implement
8
-
9
- Execute a spec end-to-end while keeping a sidecar `implementation-notes.html` that the user can read to see how the build diverged from or interpreted the written plan.
10
-
11
- ## Instructions
12
-
13
- Carry out the following prompt against the spec resolved below.
14
-
15
- ### Resolve `<SPEC>`
16
-
17
- - If `$ARGUMENTS` is non-empty, treat it as the path to the spec file and read it.
18
- - Otherwise, use the most recent plan / spec / design doc already present in the conversation context.
19
- - If neither is available, ask the user for the spec path via `AskUserQuestion` before proceeding.
20
-
21
- ### Prompt to execute
22
-
23
- > Implement `<SPEC>`. As you work maintain a running `implementation-notes.html` file that captures anything I should know about how the implementation diverges from or interprets the spec, including:
24
- >
25
- > - **Design decisions:** choices you made where the spec was ambiguous
26
- > - **Deviations:** places where you intentionally departed from the spec, and why
27
- > - **Tradeoffs:** alternatives you considered and why you picked what you did
28
- > - **Open questions:** anything you'd want me to confirm or revise
29
-
30
- ### How to write notes
31
-
32
- Run `${CLAUDE_SKILL_DIR}/scripts/append_note.py` to append each entry. The script creates `implementation-notes.html` with the four sections on first run, then inserts a new `<li>` under the requested section. HTML-escapes `--about` and `--note` automatically. `${CLAUDE_SKILL_DIR}` is host-substituted by Claude Code at runtime so the bundled CLI is found regardless of the current working directory.
33
-
34
- ```
35
- python "${CLAUDE_SKILL_DIR}/scripts/append_note.py" \
36
- --section decisions \
37
- --about "Storage location" \
38
- --note "Wrote notes next to the spec because the spec path was provided." \
39
- --file /path/to/spec-dir/implementation-notes.html
40
- ```
41
-
42
- `--section` choices (slug → heading):
43
-
44
- | Slug | Heading |
45
- |---|---|
46
- | `decisions` | Design decisions |
47
- | `deviations` | Deviations |
48
- | `tradeoffs` | Tradeoffs |
49
- | `questions` | Open questions |
50
-
51
- `--file` is optional. When omitted, the script writes to `./implementation-notes.html` in the current working directory. When a spec path is known, pass `--file` so notes land next to the spec rather than in CWD.
52
-
53
- Append entries as decisions are made — do not batch them until the end.
54
-
55
- ## Gotchas
56
-
57
- - **Do not hand-edit `implementation-notes.html`.** The append script locates each section by its `<section id="...">` marker and the first `</ul>` after it. Editing the structure breaks subsequent appends; the script raises a `RuntimeError` naming the missing marker.
58
- - **`--about` and `--note` are HTML-escaped automatically** — pass raw text, not pre-escaped HTML.
59
-
60
- ## File index
61
-
62
- | File | Purpose |
63
- |---|---|
64
- | `SKILL.md` | This hub |
65
- | `packages/claude-dev-env/skills/implement/scripts/append_note.py` | CLI to append one entry to a section |
66
- | `packages/claude-dev-env/skills/implement/scripts/implement_scripts_constants/notes_constants.py` | Section slugs → headings and default filename |
@@ -1,22 +0,0 @@
1
- # scripts (spec-build skill)
2
-
3
- Support scripts for the spec-build (`implement`) skill. These scripts create and append to the `implementation-notes.html` sidecar file the skill maintains during a spec build.
4
-
5
- ## Key files
6
-
7
- | File | Purpose |
8
- |---|---|
9
- | `append_note.py` | CLI that creates `implementation-notes.html` with four sections on first run and appends a `<li>` to a named section on later runs |
10
- | `test_append_note.py` | Tests for `append_note.py` |
11
-
12
- ## Subdirectories
13
-
14
- | Directory | Role |
15
- |---|---|
16
- | `implement_scripts_constants/` | Section slug → heading map and default filename constant |
17
-
18
- ## Conventions
19
-
20
- - `append_note.py` imports section metadata from `implement_scripts_constants.notes_constants`.
21
- - HTML-escaping of `--about` and `--note` is handled by the script; callers pass raw text.
22
- - The script is invoked as `python "${CLAUDE_SKILL_DIR}/scripts/append_note.py"` from within the skill, where `$CLAUDE_SKILL_DIR` resolves to the installed skill directory at runtime.
@@ -1,133 +0,0 @@
1
- #!/usr/bin/env python3
2
- """Append an entry to implementation-notes.html under one of four sections.
3
-
4
- Used by the `implement` skill. Creates the file with all four sections if it
5
- does not exist; otherwise appends a new <li> under the requested section.
6
-
7
- Usage:
8
- python append_note.py --section decisions --about "Where to write the file" --note "Wrote next to spec rather than CWD because spec path was known."
9
- python append_note.py --section questions --about "Auth model" --note "Spec didn't say whether sessions persist across restarts." --file ./notes.html
10
- """
11
-
12
- from __future__ import annotations
13
-
14
- import argparse
15
- import html
16
- import sys
17
- from pathlib import Path
18
-
19
- from implement_scripts_constants.notes_constants import DEFAULT_NOTES_FILENAME, HEADING_BY_SLUG
20
-
21
-
22
- def _build_skeleton() -> str:
23
- section_blocks = "\n".join(
24
- f' <section id="{each_slug}">\n <h2>{each_heading}</h2>\n <ul></ul>\n </section>'
25
- for each_slug, each_heading in HEADING_BY_SLUG.items()
26
- )
27
- return (
28
- "<!doctype html>\n"
29
- '<html lang="en">\n'
30
- "<head>\n"
31
- ' <meta charset="utf-8">\n'
32
- " <title>Implementation notes</title>\n"
33
- "</head>\n"
34
- "<body>\n"
35
- " <h1>Implementation notes</h1>\n"
36
- f"{section_blocks}\n"
37
- "</body>\n"
38
- "</html>\n"
39
- )
40
-
41
-
42
- def _ensure_file(target: Path) -> str:
43
- if not target.exists():
44
- target.parent.mkdir(parents=True, exist_ok=True)
45
- skeleton = _build_skeleton()
46
- target.write_text(skeleton, encoding="utf-8")
47
- return skeleton
48
- return target.read_text(encoding="utf-8")
49
-
50
-
51
- def _render_entry(about: str, note: str) -> str:
52
- return f"<li><strong>{html.escape(about)}:</strong> {html.escape(note)}</li>"
53
-
54
-
55
- def _insert_entry(document: str, slug: str, entry: str) -> str:
56
- open_marker = f'<section id="{slug}">'
57
- section_close_marker = "</section>"
58
- close_marker = "</ul>"
59
- section_start = document.find(open_marker)
60
- if section_start == -1:
61
- raise RuntimeError(
62
- f"section '{slug}' not found in file — the file may have been "
63
- f"edited by hand. Restore the four <section id=...> blocks or "
64
- f"delete the file so it can be regenerated."
65
- )
66
- section_end = document.find(section_close_marker, section_start)
67
- if section_end == -1:
68
- raise RuntimeError(
69
- f"section '{slug}' is missing its closing </section> — the file "
70
- f"may have been edited by hand."
71
- )
72
- close_at = document.find(close_marker, section_start, section_end)
73
- if close_at == -1:
74
- raise RuntimeError(
75
- f"section '{slug}' is missing its closing </ul> — the file may "
76
- f"have been edited by hand."
77
- )
78
- boundary = close_at
79
- while boundary > 0 and document[boundary - 1] in (" ", "\n"):
80
- boundary -= 1
81
- new_line = f"\n {entry}"
82
- return document[:boundary] + new_line + "\n " + document[close_at:]
83
-
84
-
85
- def _parse_arguments() -> argparse.Namespace:
86
- parser = argparse.ArgumentParser(
87
- description=f"Append an entry to {DEFAULT_NOTES_FILENAME}.",
88
- )
89
- parser.add_argument(
90
- "--section",
91
- required=True,
92
- choices=sorted(HEADING_BY_SLUG.keys()),
93
- help="Which section to append under.",
94
- )
95
- parser.add_argument(
96
- "--about",
97
- required=True,
98
- help="Short label naming the part of the spec this entry relates to.",
99
- )
100
- parser.add_argument(
101
- "--note",
102
- required=True,
103
- help="The decision / deviation / tradeoff / question itself.",
104
- )
105
- parser.add_argument(
106
- "--file",
107
- default=DEFAULT_NOTES_FILENAME,
108
- help=(
109
- f"Path to the notes file. Defaults to ./{DEFAULT_NOTES_FILENAME} "
110
- f"in the current working directory."
111
- ),
112
- )
113
- return parser.parse_args()
114
-
115
-
116
- def main() -> int:
117
- """Parse CLI arguments and append one entry to the notes file.
118
-
119
- Returns:
120
- Process exit code (0 on success).
121
- """
122
- arguments = _parse_arguments()
123
- target_path = Path(arguments.file).expanduser().resolve()
124
- document = _ensure_file(target_path)
125
- entry = _render_entry(arguments.about, arguments.note)
126
- updated = _insert_entry(document, arguments.section, entry)
127
- target_path.write_text(updated, encoding="utf-8")
128
- print(f"appended to [{arguments.section}] in {target_path}")
129
- return 0
130
-
131
-
132
- if __name__ == "__main__":
133
- sys.exit(main())
@@ -1,22 +0,0 @@
1
- # implement_scripts_constants
2
-
3
- Constants module for the `implement` skill's `append_note.py` script.
4
-
5
- ## Key files
6
-
7
- | File | Purpose |
8
- |---|---|
9
- | `__init__.py` | Package marker |
10
- | `notes_constants.py` | `HEADING_BY_SLUG` dict (section slugs → display headings) and `DEFAULT_NOTES_FILENAME` |
11
-
12
- ## Exported constants
13
-
14
- | Constant | Value | Used by |
15
- |---|---|---|
16
- | `HEADING_BY_SLUG` | `{"decisions": "Design decisions", "deviations": "Deviations", "tradeoffs": "Tradeoffs", "questions": "Open questions"}` | `append_note.py` — maps `--section` slug to the `<h2>` heading in the HTML file |
17
- | `DEFAULT_NOTES_FILENAME` | `"implementation-notes.html"` | `append_note.py` — default output path when `--file` is omitted |
18
-
19
- ## Conventions
20
-
21
- - This module is imported directly by `append_note.py` in the parent `scripts/` directory.
22
- - Adding a new section requires a new entry in `HEADING_BY_SLUG` and a matching branch in `append_note.py`.
@@ -1,12 +0,0 @@
1
- """Configuration for the implementation-notes append script."""
2
-
3
- from __future__ import annotations
4
-
5
- HEADING_BY_SLUG: dict[str, str] = {
6
- "decisions": "Design decisions",
7
- "deviations": "Deviations",
8
- "tradeoffs": "Tradeoffs",
9
- "questions": "Open questions",
10
- }
11
-
12
- DEFAULT_NOTES_FILENAME = "implementation-notes.html"