claude-dev-env 1.38.1 → 1.39.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 (270) 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 +189 -0
  7. package/_shared/pr-loop/scripts/post_audit_thread.py +947 -0
  8. package/_shared/pr-loop/scripts/tests/test_code_rules_gate.py +0 -19
  9. package/_shared/pr-loop/scripts/tests/test_post_audit_thread.py +923 -0
  10. package/_shared/pr-loop/scripts/tests/test_post_audit_thread_constants.py +127 -0
  11. package/_shared/pr-loop/state-schema.md +1 -1
  12. package/agents/clean-coder.md +2 -2
  13. package/bin/install.mjs +6 -7
  14. package/bin/install.test.mjs +8 -0
  15. package/commands/doc-gist.md +16 -0
  16. package/commands/plan.md +0 -2
  17. package/commands/review-plan.md +1 -1
  18. package/docs/CODE_RULES.md +122 -2
  19. package/hooks/blocking/bot_mention_comment_blocker.py +75 -0
  20. package/hooks/blocking/code_rules_enforcer.py +1143 -129
  21. package/hooks/blocking/convergence_gate_blocker.py +130 -0
  22. package/hooks/blocking/destructive_command_blocker.py +74 -0
  23. package/hooks/blocking/gh_body_arg_blocker.py +30 -0
  24. package/hooks/blocking/md_to_html_blocker.py +119 -0
  25. package/hooks/blocking/test_bot_mention_comment_blocker.py +131 -0
  26. package/hooks/blocking/test_code_rules_enforcer.py +21 -0
  27. package/hooks/blocking/test_code_rules_enforcer_any_exempt_files.py +70 -0
  28. package/hooks/blocking/test_code_rules_enforcer_any_imports_and_cast.py +92 -0
  29. package/hooks/blocking/test_code_rules_enforcer_banned_import_alias.py +143 -0
  30. package/hooks/blocking/test_code_rules_enforcer_banned_prefixes.py +152 -0
  31. package/hooks/blocking/test_code_rules_enforcer_bare_except.py +120 -0
  32. package/hooks/blocking/test_code_rules_enforcer_boundary_types.py +175 -0
  33. package/hooks/blocking/test_code_rules_enforcer_cap_meta.py +0 -1
  34. package/hooks/blocking/test_code_rules_enforcer_collection_prefix.py +50 -0
  35. package/hooks/blocking/test_code_rules_enforcer_docstring_format.py +255 -0
  36. package/hooks/blocking/test_code_rules_enforcer_inline_tuple_string_magic.py +130 -0
  37. package/hooks/blocking/test_code_rules_enforcer_stub_implementations.py +141 -0
  38. package/hooks/blocking/test_code_rules_enforcer_test_branching.py +143 -0
  39. package/hooks/blocking/test_code_rules_enforcer_thin_wrapper_files.py +169 -0
  40. package/hooks/blocking/test_code_rules_enforcer_todo_markers.py +99 -0
  41. package/hooks/blocking/test_code_rules_enforcer_typed_dict_pairs.py +141 -0
  42. package/hooks/blocking/test_convergence_gate_blocker.py +63 -0
  43. package/hooks/blocking/test_destructive_command_blocker.py +146 -0
  44. package/hooks/blocking/test_destructive_command_blocker_no_verify.py +102 -0
  45. package/hooks/blocking/test_gh_body_arg_blocker.py +45 -0
  46. package/hooks/blocking/test_md_to_html_blocker.py +317 -0
  47. package/hooks/config/any_type_config.py +7 -0
  48. package/hooks/config/banned_identifiers_constants.py +11 -0
  49. package/hooks/config/blocking_check_limits.py +38 -0
  50. package/hooks/config/bot_mention_comment_blocker_constants.py +20 -0
  51. package/hooks/config/code_rules_enforcer_constants.py +53 -0
  52. package/hooks/config/convergence_branch_constants.py +9 -0
  53. package/hooks/config/doc_gist_auto_publish_constants.py +18 -0
  54. package/hooks/config/html_companion_constants.py +20 -0
  55. package/hooks/config/inline_tuple_string_magic_constants.py +22 -0
  56. package/hooks/config/test_banned_identifiers_constants.py +17 -0
  57. package/hooks/hooks.json +28 -20
  58. package/hooks/pyproject.toml +69 -0
  59. package/hooks/validators/mypy_integration.py +47 -1
  60. package/hooks/validators/run_all_validators.py +3 -3
  61. package/hooks/validators/test_mypy_integration.py +50 -1
  62. package/hooks/workflow/doc_gist_auto_publish.py +144 -0
  63. package/hooks/workflow/md_to_html_companion.py +365 -0
  64. package/hooks/workflow/test_doc_gist_auto_publish.py +117 -0
  65. package/hooks/workflow/test_md_to_html_companion.py +452 -0
  66. package/package.json +1 -1
  67. package/rules/gh-body-file.md +2 -0
  68. package/scripts/Install-SweepEmptyDirs.ps1 +111 -0
  69. package/scripts/check.ps1 +106 -0
  70. package/scripts/config/timing.py +11 -0
  71. package/scripts/sweep_empty_dirs.py +138 -0
  72. package/scripts/sync_to_cursor/rules.py +1 -1
  73. package/scripts/test_sweep_empty_dirs.py +183 -0
  74. package/skills/_shared/pr-loop/prompts/pr-consistency-audit.xml +323 -0
  75. package/skills/_shared/pr-loop/scripts/_cli_utils.py +22 -0
  76. package/skills/_shared/pr-loop/scripts/_path_resolver.py +165 -0
  77. package/skills/_shared/pr-loop/scripts/_xml_utils.py +20 -0
  78. package/skills/_shared/pr-loop/scripts/build_audit_prompt.py +182 -0
  79. package/skills/_shared/pr-loop/scripts/build_fix_prompt.py +185 -0
  80. package/skills/_shared/pr-loop/scripts/config/__init__.py +0 -0
  81. package/skills/_shared/pr-loop/scripts/config/path_resolver_constants.py +78 -0
  82. package/skills/_shared/pr-loop/scripts/init_loop_state.py +135 -0
  83. package/skills/_shared/pr-loop/scripts/teardown_worktrees.py +175 -0
  84. package/skills/_shared/pr-loop/scripts/write_audit_outcomes.py +182 -0
  85. package/skills/_shared/pr-loop/scripts/write_fix_outcomes.py +206 -0
  86. package/skills/bugteam/CONSTRAINTS.md +21 -22
  87. package/skills/bugteam/EXAMPLES.md +3 -3
  88. package/skills/bugteam/PROMPTS.md +227 -67
  89. package/skills/bugteam/SKILL.md +114 -455
  90. package/skills/bugteam/reference/README.md +1 -1
  91. package/skills/bugteam/reference/audit-and-teammates.md +112 -39
  92. package/skills/bugteam/reference/audit-contract.md +4 -22
  93. package/skills/bugteam/reference/copilot-gap-analysis.md +8 -5
  94. package/skills/bugteam/reference/design-rationale.md +2 -2
  95. package/skills/bugteam/reference/github-pr-reviews.md +50 -57
  96. package/skills/bugteam/reference/obstacles/audit-assign-ids.md +13 -0
  97. package/skills/bugteam/reference/obstacles/audit-capture-excerpts.md +13 -0
  98. package/skills/bugteam/reference/obstacles/audit-walk-categories.md +13 -0
  99. package/skills/bugteam/reference/obstacles/audit-write-xml.md +13 -0
  100. package/skills/bugteam/reference/obstacles/fix-append-summary.md +13 -0
  101. package/skills/bugteam/reference/obstacles/fix-apply-fixes.md +13 -0
  102. package/skills/bugteam/reference/obstacles/fix-git-add-commit.md +13 -0
  103. package/skills/bugteam/reference/obstacles/fix-git-push.md +13 -0
  104. package/skills/bugteam/reference/obstacles/fix-post-reply.md +13 -0
  105. package/skills/bugteam/reference/obstacles/fix-publish-summary.md +13 -0
  106. package/skills/bugteam/reference/obstacles/fix-py-compile.md +13 -0
  107. package/skills/bugteam/reference/obstacles/fix-read-files.md +13 -0
  108. package/skills/bugteam/reference/obstacles/fix-resolve-thread.md +13 -0
  109. package/skills/bugteam/reference/obstacles/fix-test-suite.md +13 -0
  110. package/skills/bugteam/reference/obstacles/fix-violation-count.md +13 -0
  111. package/skills/bugteam/reference/obstacles/fix-write-xml.md +13 -0
  112. package/skills/bugteam/reference/team-setup.md +106 -9
  113. package/skills/bugteam/reference/teardown-publish-permissions.md +39 -8
  114. package/skills/bugteam/scripts/README.md +60 -0
  115. package/skills/bugteam/scripts/_claude_permissions_common.py +358 -0
  116. package/skills/bugteam/scripts/bugteam_code_rules_gate.py +976 -0
  117. package/skills/bugteam/scripts/bugteam_fix_hookspath.py +375 -0
  118. package/skills/bugteam/scripts/bugteam_preflight.py +294 -0
  119. package/skills/bugteam/scripts/config/bugteam_code_rules_gate_constants.py +25 -0
  120. package/skills/bugteam/scripts/config/bugteam_fix_hookspath_constants.py +26 -0
  121. package/skills/bugteam/scripts/config/bugteam_preflight_constants.py +35 -0
  122. package/skills/bugteam/scripts/config/claude_permissions_common_constants.py +20 -0
  123. package/skills/bugteam/scripts/config/probe_code_rules_enforcer_check_constants.py +12 -0
  124. package/skills/bugteam/scripts/config/windows_safe_rmtree_constants.py +7 -0
  125. package/skills/bugteam/scripts/grant_project_claude_permissions.py +175 -0
  126. package/skills/bugteam/scripts/probe_code_rules_enforcer_check.py +107 -0
  127. package/skills/bugteam/scripts/revoke_project_claude_permissions.py +220 -0
  128. package/skills/bugteam/scripts/test__claude_permissions_common.py +112 -0
  129. package/skills/bugteam/scripts/test_bugteam_code_rules_gate.py +400 -0
  130. package/skills/bugteam/scripts/test_bugteam_fix_hookspath.py +384 -0
  131. package/skills/bugteam/scripts/test_bugteam_preflight.py +268 -0
  132. package/skills/bugteam/scripts/test_claude_permissions_common.py +195 -0
  133. package/skills/bugteam/scripts/test_grant_project_claude_permissions.py +55 -0
  134. package/skills/bugteam/scripts/test_probe_code_rules_enforcer_check.py +76 -0
  135. package/skills/bugteam/scripts/test_revoke_project_claude_permissions.py +55 -0
  136. package/skills/bugteam/scripts/test_windows_safe_rmtree.py +108 -0
  137. package/skills/bugteam/scripts/windows_safe_rmtree.py +100 -0
  138. package/skills/bugteam/test_skill_additions.py +1 -11
  139. package/skills/code/SKILL.md +176 -0
  140. package/skills/doc-gist/SKILL.md +99 -0
  141. package/skills/doc-gist/references/examples/01-exploration-code-approaches.html +453 -0
  142. package/skills/doc-gist/references/examples/02-exploration-visual-designs.html +515 -0
  143. package/skills/doc-gist/references/examples/03-code-review-pr.html +638 -0
  144. package/skills/doc-gist/references/examples/04-code-understanding.html +491 -0
  145. package/skills/doc-gist/references/examples/05-design-system.html +629 -0
  146. package/skills/doc-gist/references/examples/06-component-variants.html +605 -0
  147. package/skills/doc-gist/references/examples/07-prototype-animation.html +455 -0
  148. package/skills/doc-gist/references/examples/08-prototype-interaction.html +396 -0
  149. package/skills/doc-gist/references/examples/09-slide-deck.html +592 -0
  150. package/skills/doc-gist/references/examples/10-svg-illustrations.html +492 -0
  151. package/skills/doc-gist/references/examples/11-status-report.html +528 -0
  152. package/skills/doc-gist/references/examples/12-incident-report.html +596 -0
  153. package/skills/doc-gist/references/examples/13-flowchart-diagram.html +395 -0
  154. package/skills/doc-gist/references/examples/14-research-feature-explainer.html +381 -0
  155. package/skills/doc-gist/references/examples/15-research-concept-explainer.html +368 -0
  156. package/skills/doc-gist/references/examples/16-implementation-plan.html +702 -0
  157. package/skills/doc-gist/references/examples/17-pr-writeup.html +595 -0
  158. package/skills/doc-gist/references/examples/18-editor-triage-board.html +573 -0
  159. package/skills/doc-gist/references/examples/19-editor-feature-flags.html +663 -0
  160. package/skills/doc-gist/references/examples/20-editor-prompt-tuner.html +722 -0
  161. package/skills/doc-gist/references/examples/README.md +5 -0
  162. package/skills/doc-gist/scripts/config/__init__.py +0 -0
  163. package/skills/doc-gist/scripts/config/gist_upload_constants.py +16 -0
  164. package/skills/doc-gist/scripts/gist_upload.py +177 -0
  165. package/skills/doc-gist/scripts/test_gist_upload.py +51 -0
  166. package/skills/findbugs/SKILL.md +68 -2
  167. package/skills/monitor-open-prs/SKILL.md +13 -32
  168. package/skills/monitor-open-prs/test_skill_contract.py +0 -11
  169. package/skills/pr-consistency-audit/SKILL.md +112 -0
  170. package/skills/pr-consistency-audit/reference/detection-rules.md +96 -0
  171. package/skills/pr-consistency-audit/reference/illustrations.md +78 -0
  172. package/skills/pr-converge/SKILL.md +227 -23
  173. package/skills/pr-converge/config/__init__.py +0 -0
  174. package/skills/pr-converge/config/constants.py +62 -0
  175. package/skills/pr-converge/reference/convergence-gates.md +138 -44
  176. package/skills/pr-converge/reference/examples.md +43 -11
  177. package/skills/pr-converge/reference/fix-protocol.md +6 -5
  178. package/skills/pr-converge/reference/ground-rules.md +5 -3
  179. package/skills/pr-converge/reference/multi-pr-orchestration.md +44 -19
  180. package/skills/pr-converge/reference/obstacles/fix-post-replies.md +13 -0
  181. package/skills/pr-converge/reference/obstacles/fix-publish-summary.md +13 -0
  182. package/skills/pr-converge/reference/obstacles/fix-push.md +13 -0
  183. package/skills/pr-converge/reference/obstacles/fix-read-filelines.md +13 -0
  184. package/skills/pr-converge/reference/obstacles/fix-reset-state.md +13 -0
  185. package/skills/pr-converge/reference/obstacles/fix-resolve-threads.md +13 -0
  186. package/skills/pr-converge/reference/obstacles/fix-spawn-clean-coder.md +13 -0
  187. package/skills/pr-converge/reference/obstacles/fix-stage-commit.md +13 -0
  188. package/skills/pr-converge/reference/obstacles/fix-trigger-bugbot.md +13 -0
  189. package/skills/pr-converge/reference/obstacles/fix-write-test.md +13 -0
  190. package/skills/pr-converge/reference/per-tick.md +90 -31
  191. package/skills/pr-converge/reference/state-schema.md +22 -1
  192. package/skills/pr-converge/reference/stop-conditions.md +9 -7
  193. package/skills/pr-converge/scripts/README.md +34 -46
  194. package/skills/pr-converge/scripts/check_bugbot_ci.py +174 -0
  195. package/skills/pr-converge/scripts/check_convergence.py +497 -0
  196. package/skills/pr-converge/scripts/check_pending_reviews.py +154 -0
  197. package/skills/pr-converge/scripts/config/pr_converge_constants.py +118 -0
  198. package/skills/pr-converge/scripts/fetch_copilot_reviews.py +134 -0
  199. package/skills/pr-converge/scripts/post_fix_reply.py +168 -0
  200. package/skills/pr-converge/workflows/schedule-wakeup-loop.md +5 -12
  201. package/skills/qbug/SKILL.md +132 -27
  202. package/skills/session-log/SKILL.md +216 -114
  203. package/skills/session-tidy/SKILL.md +1 -1
  204. package/skills/skill-builder/SKILL.md +138 -56
  205. package/skills/skill-builder/references/delegation-map.md +72 -113
  206. package/skills/skill-builder/references/progressive-disclosure.md +122 -0
  207. package/skills/skill-builder/references/self-audit-checklist.md +92 -0
  208. package/skills/skill-builder/references/skill-types.md +228 -0
  209. package/skills/skill-builder/references/thariq-x-post-skills.json +33 -0
  210. package/skills/skill-builder/templates/gap-analysis.md +15 -8
  211. package/skills/skill-builder/workflows/improve-skill.md +86 -57
  212. package/skills/skill-builder/workflows/new-skill.md +80 -168
  213. package/skills/skill-builder/workflows/polish-skill.md +78 -54
  214. package/skills/structure-prompt/SKILL.md +50 -0
  215. package/skills/structure-prompt/reference/adversarial-tuning.md +62 -0
  216. package/skills/structure-prompt/reference/block-classification.md +27 -0
  217. package/skills/structure-prompt/reference/canonical-case.md +48 -0
  218. package/skills/structure-prompt/reference/citation-depth.md +70 -0
  219. package/skills/structure-prompt/reference/cleanup.md +33 -0
  220. package/skills/structure-prompt/reference/constraints.md +33 -0
  221. package/skills/structure-prompt/reference/directives.md +37 -0
  222. package/skills/structure-prompt/reference/examples.md +72 -0
  223. package/skills/structure-prompt/reference/instantiation.md +51 -0
  224. package/skills/structure-prompt/reference/output-contract.md +72 -0
  225. package/skills/structure-prompt/reference/per-category.md +23 -0
  226. package/skills/structure-prompt/reference/persona.md +38 -0
  227. package/skills/structure-prompt/reference/research.md +33 -0
  228. package/skills/structure-prompt/reference/structure.md +28 -0
  229. package/agents/code-standards-agent.md +0 -93
  230. package/agents/groq-coder.md +0 -113
  231. package/agents/plan-executor.md +0 -226
  232. package/agents/project-docs-analyzer.md +0 -53
  233. package/agents/project-structure-organizer-agent.md +0 -72
  234. package/agents/skill-to-agent-converter.md +0 -370
  235. package/agents/skill-writer-agent.md +0 -470
  236. package/agents/user-docs-writer.md +0 -67
  237. package/agents/workflow-visual-documenter.md +0 -82
  238. package/commands/readability-review.md +0 -20
  239. package/hooks/mypy.ini +0 -2
  240. package/hooks/notification/attention_needed_notify.py +0 -71
  241. package/hooks/notification/claude_notification_handler.py +0 -67
  242. package/hooks/notification/notification_utils.py +0 -267
  243. package/hooks/notification/subagent_complete_notify.py +0 -381
  244. package/hooks/notification/test_attention_needed_notify.py +0 -47
  245. package/hooks/notification/test_claude_notification_handler.py +0 -54
  246. package/hooks/notification/test_notification_utils.py +0 -91
  247. package/hooks/notification/test_subagent_complete_notify.py +0 -79
  248. package/scripts/config/groq_bugteam_config.py +0 -230
  249. package/scripts/config/test_groq_bugteam_config.py +0 -83
  250. package/scripts/config/test_spec_implementer_prompt.py +0 -32
  251. package/scripts/groq_bugteam.README.md +0 -131
  252. package/scripts/groq_bugteam.py +0 -647
  253. package/scripts/groq_bugteam_dotenv.py +0 -40
  254. package/scripts/groq_bugteam_spec.py +0 -226
  255. package/scripts/test_groq_bugteam.py +0 -529
  256. package/scripts/test_groq_bugteam_apply_fix_from_spec.py +0 -426
  257. package/scripts/test_groq_bugteam_dotenv.py +0 -66
  258. package/scripts/test_groq_bugteam_spec.py +0 -338
  259. package/skills/bugteam/SKILL_EVALS.md +0 -309
  260. package/skills/dream/SKILL.md +0 -118
  261. package/skills/ingest/SKILL.md +0 -40
  262. package/skills/npm-creator/SKILL.md +0 -187
  263. package/skills/readability-review/SKILL.md +0 -127
  264. package/skills/resume-review/SKILL.md +0 -261
  265. package/skills/rule-audit/SKILL.md +0 -307
  266. package/skills/rule-creator/SKILL.md +0 -150
  267. package/skills/searching-obsidian-vault/SKILL.md +0 -131
  268. package/skills/skill-writer/REFERENCE.md +0 -284
  269. package/skills/skill-writer/SKILL.md +0 -222
  270. package/skills/tdd-team/SKILL.md +0 -128
@@ -1,118 +0,0 @@
1
- ---
2
- name: dream
3
- description: Consolidate, prune, and reorganize auto memory files. Simulates Auto Dream -- fixes format drift, deduplicates facts, enforces index structure. Use when memory feels stale or cluttered. Triggers on '/dream', 'consolidate memory', 'clean up memory', 'dream'.
4
- disable-model-invocation: true
5
- ---
6
-
7
- # Dream: Memory Consolidation
8
-
9
- ## Overview
10
-
11
- Consolidate auto memory by enforcing the format contract, pruning stale content, deduplicating facts, and rebuilding MEMORY.md as a clean index.
12
-
13
- **Announce at start:** "Running memory consolidation (dream)."
14
-
15
- **Context:** Standalone maintenance utility. Run periodically or when memory feels cluttered. Simulates the Auto Dream feature that is in gradual rollout.
16
-
17
- ## The Format Contract
18
-
19
- Source: Claude Code client system prompt + [official docs](https://code.claude.com/docs/en/memory).
20
-
21
- **MEMORY.md is an index, not a memory.** It should contain only one-line pointers to topic files:
22
- - Format: `- [Title](file.md) -- one-line hook`
23
- - Target: under ~150 characters per entry
24
- - Hard limit: 200 lines / 25KB (only this much loads at session start)
25
- - No content, tables, or multi-line facts directly in MEMORY.md
26
-
27
- **Topic files require frontmatter:**
28
- ```yaml
29
- ---
30
- name: {{topic name}}
31
- description: {{one-line description}}
32
- type: {{user | feedback | project | reference}}
33
- ---
34
- ```
35
-
36
- **Organization:** Semantic by topic, not chronological by session.
37
-
38
- ## The Process
39
-
40
- ### Phase 1: Audit
41
-
42
- Read MEMORY.md and every file in the memory directory. For each file, check:
43
-
44
- 1. **Frontmatter present?** Must have name, description, type fields.
45
- 2. **Type correct?** Must be one of: user, feedback, project, reference.
46
- 3. **Named by topic?** Files named `session-YYYY-MM-DD-*` should be renamed to their actual topic.
47
-
48
- For MEMORY.md, check:
49
- 1. **Index entries only?** Flag any line that is NOT a `- [Title](file.md)` link or a `##` section header.
50
- 2. **Content leaking into index?** Flag inline facts, tables, multi-line bullet points.
51
- 3. **Under 200 lines?** Flag if approaching the limit.
52
-
53
- ### Phase 2: Propose Changes
54
-
55
- Present a structured report to the user with these sections:
56
-
57
- **Format violations** -- files missing frontmatter, content in MEMORY.md
58
- **Stale content** -- items older than 14 days with forward-looking TODOs or "Next/Pending" sections that may be completed
59
- **Duplicates** -- facts that appear in both topic files and MEMORY.md inline, or across multiple topic files
60
- **Rename candidates** -- session-dated files that should be topic-named
61
- **Proposed actions** -- numbered list of specific changes (extract, merge, prune, rename, add frontmatter)
62
-
63
- Do NOT execute any changes yet. Wait for user approval.
64
-
65
- ### Phase 3: Execute
66
-
67
- After user approves (all or selected items):
68
-
69
- 1. **Extract** inline MEMORY.md content into new or existing topic files with proper frontmatter.
70
- 2. **Add frontmatter** to files that lack it.
71
- 3. **Rename** session-dated files to topic names.
72
- 4. **Deduplicate** by removing redundant copies (keep the most complete version).
73
- 5. **Prune** stale forward-looking content (TODOs, "Next" sections) from old files.
74
- 6. **Rebuild MEMORY.md** as a clean index -- one-line entries only, grouped by `##` section headers.
75
-
76
- ### Phase 4: Verify
77
-
78
- After execution, read the rebuilt MEMORY.md and confirm:
79
- - Every entry is a one-line link
80
- - Every referenced file exists and has valid frontmatter
81
- - No orphaned files (files in directory but not in index)
82
- - Total line count under 200
83
-
84
- Report the results: files changed, lines saved, violations fixed.
85
-
86
- ## Output Format
87
-
88
- Phase 2 report structure:
89
-
90
- ```
91
- ## Dream Report
92
-
93
- ### Format Violations (X found)
94
- - [file] -- [issue]
95
-
96
- ### Stale Content (X flagged)
97
- - [file] -- [what's stale] -- [age]
98
-
99
- ### Duplicates (X found)
100
- - [fact] -- appears in [file1] and [file2]
101
-
102
- ### Proposed Actions
103
- 1. [action] -- [file] -- [reason]
104
- 2. ...
105
-
106
- Approve all, select by number, or cancel?
107
- ```
108
-
109
- ## After Completion
110
-
111
- Report summary: files modified, created, renamed, deleted. Line count before/after.
112
-
113
- ## Best Practices
114
-
115
- - Run after long sessions or when starting fresh on a project
116
- - Check stale flags manually -- dream cannot verify if TODOs were completed without reading the actual codebase
117
- - The 14-day staleness threshold is a heuristic, not a hard rule
118
- - When in doubt about whether to prune, flag it for the user rather than proposing deletion
@@ -1,40 +0,0 @@
1
- ---
2
- name: ingest
3
- description: Digest the codebase using gitingest into LLM-friendly text files, one per top-level folder. Use when user wants to create a text digest/summary of their repo for AI consumption.
4
- user_invocable: true
5
- ---
6
-
7
- # Ingest Codebase with GitIngest
8
-
9
- ## Steps
10
-
11
- 1. **Ensure gitingest is installed**: `pip install gitingest`
12
-
13
- 2. **Clone repo locally** (avoids network drive slowness and enables long paths):
14
- ```bash
15
- REMOTE=$(git remote get-url origin)
16
- TEMP_DIR=$(mktemp -d)/gitingest_repo
17
- git clone --depth 1 -c core.longpaths=true "$REMOTE" "$TEMP_DIR"
18
- ```
19
-
20
- 3. **Identify top-level folders** in the clone to ingest (skip `.git`, `.Codex`, `.planning`, etc.)
21
-
22
- 4. **Run gitingest Python API on each folder separately** (running separately avoids spaces-in-names breaking CLI glob patterns):
23
- ```python
24
- from gitingest import ingest
25
-
26
- summary, tree, content = ingest(
27
- folder_path,
28
- include_patterns=["*.py", "*.md", "*.json", "*.yaml", "*.yml", "*.cfg", "*.toml", "*.txt"],
29
- exclude_patterns=["**/venv/**", "**/logs/**", "**/__pycache__/**", "**/Archive/**",
30
- "**/*.png", "**/*.jpg", "**/*.mp4", "**/*.gif", "**/*.pyc",
31
- "**/*.rdp", "**/node_modules/**", "**/.git/**"],
32
- max_file_size=102400,
33
- )
34
- ```
35
-
36
- 5. **Save each digest** as `digest_<folder_name>.txt` in the corresponding source folder on the original working directory (not the temp clone)
37
-
38
- 6. **Clean up** the temp clone directory
39
-
40
- 7. **Report** file count, token count, and output paths for each folder
@@ -1,187 +0,0 @@
1
- ---
2
- name: npm-creator
3
- description: Scaffold an npm-installable package for any Claude Code plugin repo. Detects plugin directories (rules/, hooks/, agents/, etc.), asks about package metadata, then generates package.json and a cross-platform Node.js installer (bin/install.mjs). Use when turning a plugin repo into an npx-installable package.
4
- user_invocable: true
5
- ---
6
-
7
- # npm-creator
8
-
9
- ## Overview
10
-
11
- Scaffold a cross-platform npm package for Claude Code plugin repos so users can install via `npx <package-name>`.
12
-
13
- **Core principle:** The installer copies plugin files to ~/.claude/ using only Node.js built-ins. Zero external dependencies, works on Linux, macOS, and Windows.
14
-
15
- **Announce at start:** "I'm using the npm-creator skill to scaffold an npm package for this plugin repo."
16
-
17
- **Context:** Use after a plugin repo has its content files (rules, hooks, agents, etc.) in place. This skill adds the packaging layer on top.
18
-
19
- ## The Process
20
-
21
- ### Step 1: Detect Plugin Structure
22
-
23
- Scan the current repo root for these directories:
24
-
25
- | Directory | Purpose | Install destination |
26
- |-----------|---------|-------------------|
27
- | `rules/` | Behavioral rules (.md) | `~/.claude/rules/` |
28
- | `docs/` | Reference documents (.md) | `~/.claude/docs/` |
29
- | `commands/` | Slash commands (.md) | `~/.claude/commands/` |
30
- | `agents/` | Agent definitions (.md) | `~/.claude/agents/` |
31
- | `skills/` | Skill packages (subdirs) | `~/.claude/skills/` |
32
- | `hooks/` | Hook scripts (+ optional hooks.json manifest) | Merge into `~/.claude/settings.json` |
33
-
34
- Use Glob to find which directories exist and count files in each. Report findings to the user.
35
-
36
- If the repo has no recognized directories, say so and ask if the structure uses different names.
37
-
38
- ### Step 2: Gather Package Metadata
39
-
40
- Ask the user (use AskUserQuestion, one call with all questions):
41
-
42
- 1. **Package name** — suggest the repo directory name. Ask if scoped (@org/) or unscoped.
43
- 2. **Description** — suggest based on detected content ("Claude Code plugin with X rules, Y agents, Z hooks").
44
- 3. **CLAUDE.md generation** — should the installer concatenate rules + docs into a CLAUDE.md? (Yes if both rules/ and docs/ exist.)
45
- 4. **Python detection** — does the plugin use Python hooks? (Yes if hooks/ contains .py files.) If yes, the installer will detect python3/python/py at install time.
46
-
47
- ### Step 3: Generate package.json
48
-
49
- Create `package.json` at the repo root with:
50
-
51
- - `name`: from Step 2
52
- - `version`: "1.0.0"
53
- - `description`: from Step 2
54
- - `type`: "module"
55
- - `bin`: `{ "<package-name>": "./bin/install.mjs" }`
56
- - `files`: array of detected directories + `["bin/"]`
57
- - `keywords`: `["claude-code", "plugin", "cli"]`
58
- - `license`: "MIT"
59
- - `repository`: detect from `git remote get-url origin` if available
60
-
61
- ### Step 4: Generate bin/install.mjs
62
-
63
- Create `bin/install.mjs` with a shebang (`#!/usr/bin/env node`) and these capabilities:
64
-
65
- **Imports:** Only `node:fs`, `node:path`, `node:os`, `node:child_process`, `node:url`.
66
-
67
- **Path resolution:**
68
- - `CLAUDE_HOME` = `path.join(os.homedir(), '.claude')`
69
- - `PACKAGE_ROOT` = resolve from `import.meta.url` using `fileURLToPath` and `path.dirname`
70
-
71
- **Install mode (default — no flags):**
72
-
73
- For each detected directory from Step 1:
74
- - Copy files from package to CLAUDE_HOME, preserving directory structure
75
- - For skills/, copy recursively (each skill is a subdirectory)
76
- - For each file, log with status icon:
77
- - New file: ` ✓ rules/bdd.md (new)`
78
- - Existing file: ` ↻ rules/bdd.md (updated)`
79
-
80
- If CLAUDE.md generation is enabled:
81
- - Concatenate all rules/*.md under `# Project Rules (from <package-name> plugin)`
82
- - Concatenate all docs/*.md under `# Reference Docs`
83
- - Each file gets an `## {filename without extension}` header
84
- - Write to `CLAUDE_HOME/CLAUDE.md`
85
-
86
- If Python hooks detected:
87
- - Try `python3 --version`, then `python --version` (verify Python 3), then `py -3 --version`
88
- - Use the first that succeeds
89
- - If none work: print error and exit with code 1
90
-
91
- If hooks/hooks.json exists:
92
- - Read it and the destination `CLAUDE_HOME/settings.json` (create `{}` if missing)
93
- - For each event type, for each matcher group:
94
- - Replace `python3` with detected python command (if applicable)
95
- - Replace `${CLAUDE_PLUGIN_ROOT}` with the absolute CLAUDE_HOME hooks path
96
- - Check for duplicate matcher groups (idempotent — skip if already present)
97
- - Append new groups
98
- - Write settings.json with `JSON.stringify(data, null, 4)`
99
-
100
- Important runtime note:
101
- - `~/.claude/settings.json` is the runtime source of truth for hooks.
102
- - `hooks/hooks.json` is a packaging/install manifest input for merge workflows, not a runtime file Claude reads directly.
103
-
104
- Print summary:
105
- ```
106
- Installed <package-name>:
107
- Rules: N files (X new, Y updated)
108
- Agents: N files (X new, Y updated)
109
- Hooks: N groups merged into settings.json
110
- Python: python3
111
- ```
112
-
113
- **Uninstall mode (`--uninstall` flag):**
114
- - Remove only files matching the package's file list (never delete user-created files)
115
- - Log each removal: ` ✗ rules/bdd.md (removed)`
116
- - Remove hook entries from settings.json by matching command paths
117
- - Remove generated CLAUDE.md if it exists
118
- - Print removal summary
119
-
120
- **Error handling:**
121
- - Create CLAUDE_HOME with `fs.mkdirSync(path, { recursive: true })` if missing
122
- - If settings.json is malformed JSON, print error and exit (never clobber)
123
- - Skip missing source directories with a warning
124
-
125
- ### Step 5: Update README.md
126
-
127
- If a README.md exists, offer to update the install section with:
128
-
129
- ```
130
- ## Install
131
-
132
- \`\`\`bash
133
- npx <package-name>
134
- \`\`\`
135
-
136
- To uninstall:
137
-
138
- \`\`\`bash
139
- npx <package-name> --uninstall
140
- \`\`\`
141
- ```
142
-
143
- Preserve all other README content.
144
-
145
- ## Output Format
146
-
147
- Two new files created:
148
- 1. `package.json` at repo root
149
- 2. `bin/install.mjs` at bin/ directory
150
-
151
- One file optionally updated:
152
- 3. `README.md` install section
153
-
154
- ## After Completion
155
-
156
- Suggest the user test locally:
157
- - `node bin/install.mjs` (install)
158
- - `node bin/install.mjs --uninstall` (uninstall)
159
- - Verify files appeared in `~/.claude/`
160
- - Verify hooks merged into `~/.claude/settings.json`
161
-
162
- When ready to publish: `npm publish`
163
-
164
- ## Red Flags - STOP
165
-
166
- - Repo has no recognized plugin directories (rules/, hooks/, agents/, etc.)
167
- - hooks.json references tools or paths outside the plugin structure
168
- - Package name conflicts with an existing npm package (suggest checking npmjs.com)
169
- - Plugin files contain secrets or credentials that would be published
170
-
171
- ## Rationalization Prevention
172
-
173
- | Excuse | Reality |
174
- |--------|---------|
175
- | "I'll add cross-platform support later" | Use path.join() and os.homedir() from the start. Retrofitting is painful. |
176
- | "Shell commands are simpler for file copying" | Shell commands break on Windows. fs APIs work everywhere. |
177
- | "One big install function is fine" | Separate install/uninstall/detect functions keep each under 50 lines. |
178
- | "We can skip idempotency" | Users will run the installer multiple times. Duplicate hooks break sessions. |
179
-
180
- ## Remember
181
-
182
- - Zero external dependencies — only Node.js built-ins
183
- - If present, hooks.json in the repo stays canonical (python3 + ${CLAUDE_PLUGIN_ROOT})
184
- - Rewriting happens only in the destination settings.json (runtime source of truth)
185
- - path.join() everywhere — never concatenate paths with `/` or `\`
186
- - Idempotent: running twice produces the same result
187
- - Log every file action so the user sees what changed
@@ -1,127 +0,0 @@
1
- ---
2
- name: readability-review
3
- description: 8-dimension readability rubric scoring code so a 6-year-old could understand it through structure alone. Scores functions, then FIXES anything below threshold. Use after writing code and before committing. Triggers on "readability review", "clean code", "score readability".
4
- ---
5
-
6
- # Readability Review
7
-
8
- ## Overview
9
-
10
- Score every function across 8 readability dimensions (160 points total), then automatically fix anything scoring below threshold by rewriting and applying via Edit tool.
11
-
12
- **Core principle:** A 6-year-old could understand what every line does -- through code structure alone, not comments.
13
-
14
- **Announce at start:** "I'm using the readability-review skill to score and fix code readability across 8 dimensions."
15
-
16
- **Context:** Use after code is written but before committing. Complements code-quality-reviewer (architectural patterns) and review-code (standards compliance). This skill focuses purely on structural readability.
17
-
18
- ## Comment Preservation (ABSOLUTE RULE)
19
-
20
- **NEVER remove ANY existing comments. ALL existing comments are SACRED.**
21
-
22
- This is an unconditional rule. Do not evaluate, judge, or clean up existing comments. If you are not modifying the code on that line, do not touch its comments.
23
-
24
- - Do not add NEW inline comments -- write self-documenting code instead
25
- - Docstrings for new files/methods/classes are allowed
26
- - If code is untouched, its comments are untouched
27
- - Scope: Only evaluate comments on lines YOU are actively changing
28
-
29
- ## The 8 Dimensions (20 points each, 160 total)
30
-
31
- ### 1. Naming Quality (20 pts)
32
- Every name reads as natural English. No mental translation required. No single-letter variables.
33
- Red flags: result, data, output, response, value, item, temp as variable names.
34
-
35
- ### 2. Function SRP (20 pts)
36
- Every function does exactly one thing. Its name IS its documentation.
37
-
38
- ### 3. Abstraction Consistency (20 pts)
39
- Each function operates at ONE conceptual level.
40
-
41
- ### 4. Control Flow Clarity (20 pts)
42
- Zero nesting. Guard clauses first. Flat happy path.
43
-
44
- ### 5. Domain Language Fidelity (20 pts)
45
- Code uses business vocabulary, not computer vocabulary.
46
-
47
- ### 6. Call Site Readability (20 pts)
48
- Function calls read as English sentences at the call site.
49
-
50
- ### 7. State and Assignment Clarity (20 pts)
51
- Variables never change meaning.
52
-
53
- ### 8. Visual Rhythm and Code Shape (20 pts)
54
- Code has paragraph breaks. Related lines group together.
55
-
56
- ## The Process
57
-
58
- ### Step 1: Discover Changed Files
59
-
60
- Identify all files modified in the current session using `git diff --name-only`. Focus on production code files, not test files or config.
61
-
62
- ### Step 2: Read Every Changed File
63
-
64
- Read the ENTIRE file, not just the diff. Readability depends on context -- a function name that seems clear in isolation may be confusing alongside its neighbors.
65
-
66
- ### Step 3: Score Each Function
67
-
68
- Apply all 8 dimensions to every function in the changed files. Be specific with scores -- a function scoring 14/20 on Naming Quality needs concrete feedback on which names fail.
69
-
70
- ### Step 4: Rewrite and APPLY to Source Files
71
-
72
- For every function scoring below 16/20 in ANY dimension, write the 160/160 version and USE THE EDIT TOOL to replace the original function in-place. Verify the file on disk contains the rewritten version. NEVER remove existing comments during rewrites.
73
-
74
- ### Step 5: Report What Was Fixed
75
-
76
- Show the before/after scores for each function that was rewritten. Include which dimensions improved and by how much.
77
-
78
- ## Output Format
79
-
80
- ```
81
- ## Readability Review: [File Name]
82
-
83
- ### [function_name] - Score: [X]/160
84
- | Dimension | Score | Notes |
85
- |-----------|-------|-------|
86
- | Naming Quality | /20 | ... |
87
- | Function SRP | /20 | ... |
88
- | ... | ... | ... |
89
-
90
- **Action:** [Fixed / Acceptable]
91
- ```
92
-
93
- ## After Completion
94
-
95
- If any functions were rewritten, run the test suite to verify no behavior changed. Report the final score for all reviewed functions.
96
-
97
- **If score is below 120/160 overall:**
98
- - Perform deeper architectural analysis inline: check DRY violations, unnecessary abstractions, and mixed abstraction levels
99
-
100
- ## Red Flags - STOP
101
-
102
- - Function names that require reading the body to understand
103
- - Variables reused for different purposes (meaning changes mid-function)
104
- - Mixed abstraction levels (SQL query next to business logic)
105
- - Deeply nested conditionals (more than 1 level)
106
- - Computer vocabulary where domain vocabulary exists (e.g., "handler" instead of "validator")
107
- - No visual grouping -- wall of code with no paragraph breaks
108
-
109
- ## Rationalization Prevention
110
-
111
- | Excuse | Reality |
112
- |--------|---------|
113
- | "The naming is close enough" | Close enough means the next reader pauses. Pausing means it's not readable. |
114
- | "Refactoring this function would be too risky" | The Edit tool preserves behavior. If tests pass, the rewrite is safe. |
115
- | "It's only one dimension below threshold" | One weak dimension drags down comprehension of the entire function. |
116
- | "This is how the rest of the codebase looks" | Existing low scores are not a license to add more. Fix what you touch. |
117
- | "Adding guard clauses would make it longer" | Flat code reads faster than nested code, even if it has more lines. |
118
-
119
- ## Remember
120
-
121
- - Score ALL 8 dimensions for EVERY function -- no shortcuts
122
- - Threshold is 16/20 in ANY single dimension, not average
123
- - Fix without asking permission -- just fix and report
124
- - Preserve all existing functionality and test assertions
125
- - NEVER add comments -- code must be self-documenting
126
- - NEVER remove existing comments -- they are sacred
127
- - Read entire files, not just diffs -- context matters