habit-hooks 0.2.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (267) hide show
  1. package/README.md +17 -226
  2. package/bin/habit-hooks.js +32 -0
  3. package/package.json +11 -44
  4. package/LICENSE.md +0 -21
  5. package/dist/baseline/auto-prune.d.ts +0 -4
  6. package/dist/baseline/auto-prune.js +0 -38
  7. package/dist/baseline/auto-prune.js.map +0 -1
  8. package/dist/baseline/commands.d.ts +0 -12
  9. package/dist/baseline/commands.js +0 -125
  10. package/dist/baseline/commands.js.map +0 -1
  11. package/dist/baseline/file-hash.d.ts +0 -2
  12. package/dist/baseline/file-hash.js +0 -25
  13. package/dist/baseline/file-hash.js.map +0 -1
  14. package/dist/baseline/filter.d.ts +0 -9
  15. package/dist/baseline/filter.js +0 -18
  16. package/dist/baseline/filter.js.map +0 -1
  17. package/dist/baseline/reap.d.ts +0 -6
  18. package/dist/baseline/reap.js +0 -22
  19. package/dist/baseline/reap.js.map +0 -1
  20. package/dist/baseline/snooze-index.d.ts +0 -5
  21. package/dist/baseline/snooze-index.js +0 -65
  22. package/dist/baseline/snooze-index.js.map +0 -1
  23. package/dist/baseline/store.d.ts +0 -18
  24. package/dist/baseline/store.js +0 -106
  25. package/dist/baseline/store.js.map +0 -1
  26. package/dist/checks/comment-check.d.ts +0 -3
  27. package/dist/checks/comment-check.js +0 -85
  28. package/dist/checks/comment-check.js.map +0 -1
  29. package/dist/checks/eslint-wrap.d.ts +0 -2
  30. package/dist/checks/eslint-wrap.js +0 -107
  31. package/dist/checks/eslint-wrap.js.map +0 -1
  32. package/dist/checks/jscpd-wrap.d.ts +0 -9
  33. package/dist/checks/jscpd-wrap.js +0 -159
  34. package/dist/checks/jscpd-wrap.js.map +0 -1
  35. package/dist/checks/knip-resolve.d.ts +0 -4
  36. package/dist/checks/knip-resolve.js +0 -49
  37. package/dist/checks/knip-resolve.js.map +0 -1
  38. package/dist/checks/knip-schema.d.ts +0 -32
  39. package/dist/checks/knip-schema.js +0 -24
  40. package/dist/checks/knip-schema.js.map +0 -1
  41. package/dist/checks/knip-wrap.d.ts +0 -4
  42. package/dist/checks/knip-wrap.js +0 -135
  43. package/dist/checks/knip-wrap.js.map +0 -1
  44. package/dist/cli/baseline-commands.d.ts +0 -2
  45. package/dist/cli/baseline-commands.js +0 -61
  46. package/dist/cli/baseline-commands.js.map +0 -1
  47. package/dist/cli/emit.d.ts +0 -7
  48. package/dist/cli/emit.js +0 -8
  49. package/dist/cli/emit.js.map +0 -1
  50. package/dist/cli/init/apply-recommendations.d.ts +0 -3
  51. package/dist/cli/init/apply-recommendations.js +0 -76
  52. package/dist/cli/init/apply-recommendations.js.map +0 -1
  53. package/dist/cli/init/command-runner.d.ts +0 -6
  54. package/dist/cli/init/command-runner.js +0 -22
  55. package/dist/cli/init/command-runner.js.map +0 -1
  56. package/dist/cli/init/completion-report.d.ts +0 -11
  57. package/dist/cli/init/completion-report.js +0 -98
  58. package/dist/cli/init/completion-report.js.map +0 -1
  59. package/dist/cli/init/ctx.d.ts +0 -12
  60. package/dist/cli/init/ctx.js +0 -16
  61. package/dist/cli/init/ctx.js.map +0 -1
  62. package/dist/cli/init/detect.d.ts +0 -10
  63. package/dist/cli/init/detect.js +0 -69
  64. package/dist/cli/init/detect.js.map +0 -1
  65. package/dist/cli/init/git-hook.d.ts +0 -7
  66. package/dist/cli/init/git-hook.js +0 -52
  67. package/dist/cli/init/git-hook.js.map +0 -1
  68. package/dist/cli/init/install-commands.d.ts +0 -8
  69. package/dist/cli/init/install-commands.js +0 -82
  70. package/dist/cli/init/install-commands.js.map +0 -1
  71. package/dist/cli/init/package-scripts.d.ts +0 -6
  72. package/dist/cli/init/package-scripts.js +0 -55
  73. package/dist/cli/init/package-scripts.js.map +0 -1
  74. package/dist/cli/init/prompts.d.ts +0 -9
  75. package/dist/cli/init/prompts.js +0 -33
  76. package/dist/cli/init/prompts.js.map +0 -1
  77. package/dist/cli/init/recommendations.d.ts +0 -14
  78. package/dist/cli/init/recommendations.js +0 -66
  79. package/dist/cli/init/recommendations.js.map +0 -1
  80. package/dist/cli/init/report-language.d.ts +0 -1
  81. package/dist/cli/init/report-language.js +0 -12
  82. package/dist/cli/init/report-language.js.map +0 -1
  83. package/dist/cli/init/reporters.d.ts +0 -12
  84. package/dist/cli/init/reporters.js +0 -44
  85. package/dist/cli/init/reporters.js.map +0 -1
  86. package/dist/cli/init/run.d.ts +0 -17
  87. package/dist/cli/init/run.js +0 -123
  88. package/dist/cli/init/run.js.map +0 -1
  89. package/dist/cli/init/scaffold-baseline.d.ts +0 -4
  90. package/dist/cli/init/scaffold-baseline.js +0 -11
  91. package/dist/cli/init/scaffold-baseline.js.map +0 -1
  92. package/dist/cli/init/scaffold-config.d.ts +0 -20
  93. package/dist/cli/init/scaffold-config.js +0 -59
  94. package/dist/cli/init/scaffold-config.js.map +0 -1
  95. package/dist/cli/init/scaffold-eslint-config.d.ts +0 -2
  96. package/dist/cli/init/scaffold-eslint-config.js +0 -12
  97. package/dist/cli/init/scaffold-eslint-config.js.map +0 -1
  98. package/dist/cli/init/scaffold-jscpd-config.d.ts +0 -3
  99. package/dist/cli/init/scaffold-jscpd-config.js +0 -12
  100. package/dist/cli/init/scaffold-jscpd-config.js.map +0 -1
  101. package/dist/cli/init/scaffold-knip-config.d.ts +0 -2
  102. package/dist/cli/init/scaffold-knip-config.js +0 -12
  103. package/dist/cli/init/scaffold-knip-config.js.map +0 -1
  104. package/dist/cli/init/scaffold-ruff-config.d.ts +0 -2
  105. package/dist/cli/init/scaffold-ruff-config.js +0 -12
  106. package/dist/cli/init/scaffold-ruff-config.js.map +0 -1
  107. package/dist/cli/init/skill.d.ts +0 -8
  108. package/dist/cli/init/skill.js +0 -39
  109. package/dist/cli/init/skill.js.map +0 -1
  110. package/dist/cli/init/snippet.d.ts +0 -2
  111. package/dist/cli/init/snippet.js +0 -31
  112. package/dist/cli/init/snippet.js.map +0 -1
  113. package/dist/cli/init/templates/eslint-config.d.ts +0 -2
  114. package/dist/cli/init/templates/eslint-config.js +0 -45
  115. package/dist/cli/init/templates/eslint-config.js.map +0 -1
  116. package/dist/cli/init/templates/jscpd-config.d.ts +0 -3
  117. package/dist/cli/init/templates/jscpd-config.js +0 -17
  118. package/dist/cli/init/templates/jscpd-config.js.map +0 -1
  119. package/dist/cli/init/templates/knip-config.d.ts +0 -2
  120. package/dist/cli/init/templates/knip-config.js +0 -8
  121. package/dist/cli/init/templates/knip-config.js.map +0 -1
  122. package/dist/cli/init/templates/ruff-config.d.ts +0 -2
  123. package/dist/cli/init/templates/ruff-config.js +0 -16
  124. package/dist/cli/init/templates/ruff-config.js.map +0 -1
  125. package/dist/cli/init/tool-steps.d.ts +0 -2
  126. package/dist/cli/init/tool-steps.js +0 -78
  127. package/dist/cli/init/tool-steps.js.map +0 -1
  128. package/dist/cli/init-command.d.ts +0 -2
  129. package/dist/cli/init-command.js +0 -59
  130. package/dist/cli/init-command.js.map +0 -1
  131. package/dist/cli.d.ts +0 -2
  132. package/dist/cli.js +0 -101
  133. package/dist/cli.js.map +0 -1
  134. package/dist/config/catalogue-unused.d.ts +0 -2
  135. package/dist/config/catalogue-unused.js +0 -39
  136. package/dist/config/catalogue-unused.js.map +0 -1
  137. package/dist/config/catalogue.d.ts +0 -2
  138. package/dist/config/catalogue.js +0 -163
  139. package/dist/config/catalogue.js.map +0 -1
  140. package/dist/config/defaults.d.ts +0 -4
  141. package/dist/config/defaults.js +0 -12
  142. package/dist/config/defaults.js.map +0 -1
  143. package/dist/config/jiti-loader.d.ts +0 -1
  144. package/dist/config/jiti-loader.js +0 -13
  145. package/dist/config/jiti-loader.js.map +0 -1
  146. package/dist/config/load.d.ts +0 -9
  147. package/dist/config/load.js +0 -54
  148. package/dist/config/load.js.map +0 -1
  149. package/dist/config/merge.d.ts +0 -3
  150. package/dist/config/merge.js +0 -91
  151. package/dist/config/merge.js.map +0 -1
  152. package/dist/config/schema.d.ts +0 -41
  153. package/dist/config/schema.js +0 -4
  154. package/dist/config/schema.js.map +0 -1
  155. package/dist/config/tool-smells.d.ts +0 -14
  156. package/dist/config/tool-smells.js +0 -69
  157. package/dist/config/tool-smells.js.map +0 -1
  158. package/dist/config/validate.d.ts +0 -2
  159. package/dist/config/validate.js +0 -159
  160. package/dist/config/validate.js.map +0 -1
  161. package/dist/detect/package-json.d.ts +0 -1
  162. package/dist/detect/package-json.js +0 -15
  163. package/dist/detect/package-json.js.map +0 -1
  164. package/dist/detect/path.d.ts +0 -1
  165. package/dist/detect/path.js +0 -14
  166. package/dist/detect/path.js.map +0 -1
  167. package/dist/detect/tool.d.ts +0 -10
  168. package/dist/detect/tool.js +0 -75
  169. package/dist/detect/tool.js.map +0 -1
  170. package/dist/discover.d.ts +0 -2
  171. package/dist/discover.js +0 -14
  172. package/dist/discover.js.map +0 -1
  173. package/dist/git/exec.d.ts +0 -8
  174. package/dist/git/exec.js +0 -48
  175. package/dist/git/exec.js.map +0 -1
  176. package/dist/git/resolve-scope.d.ts +0 -15
  177. package/dist/git/resolve-scope.js +0 -89
  178. package/dist/git/resolve-scope.js.map +0 -1
  179. package/dist/git/scope.d.ts +0 -7
  180. package/dist/git/scope.js +0 -58
  181. package/dist/git/scope.js.map +0 -1
  182. package/dist/guide/command.d.ts +0 -6
  183. package/dist/guide/command.js +0 -20
  184. package/dist/guide/command.js.map +0 -1
  185. package/dist/guide/guide.d.ts +0 -11
  186. package/dist/guide/guide.js +0 -82
  187. package/dist/guide/guide.js.map +0 -1
  188. package/dist/guide/render.d.ts +0 -3
  189. package/dist/guide/render.js +0 -14
  190. package/dist/guide/render.js.map +0 -1
  191. package/dist/index.d.ts +0 -1
  192. package/dist/index.js +0 -2
  193. package/dist/index.js.map +0 -1
  194. package/dist/mapper/mapper.d.ts +0 -34
  195. package/dist/mapper/mapper.js +0 -80
  196. package/dist/mapper/mapper.js.map +0 -1
  197. package/dist/prompts/loader.d.ts +0 -6
  198. package/dist/prompts/loader.js +0 -27
  199. package/dist/prompts/loader.js.map +0 -1
  200. package/dist/prompts/packaged-dir.d.ts +0 -1
  201. package/dist/prompts/packaged-dir.js +0 -10
  202. package/dist/prompts/packaged-dir.js.map +0 -1
  203. package/dist/prompts/registry.d.ts +0 -3
  204. package/dist/prompts/registry.js +0 -43
  205. package/dist/prompts/registry.js.map +0 -1
  206. package/dist/rule-files.d.ts +0 -2
  207. package/dist/rule-files.js +0 -22
  208. package/dist/rule-files.js.map +0 -1
  209. package/dist/rules/registry.d.ts +0 -3
  210. package/dist/rules/registry.js +0 -37
  211. package/dist/rules/registry.js.map +0 -1
  212. package/dist/runner.d.ts +0 -15
  213. package/dist/runner.js +0 -141
  214. package/dist/runner.js.map +0 -1
  215. package/dist/sensors/adapter.d.ts +0 -17
  216. package/dist/sensors/adapter.js +0 -81
  217. package/dist/sensors/adapter.js.map +0 -1
  218. package/dist/sensors/deptry-sensor.d.ts +0 -3
  219. package/dist/sensors/deptry-sensor.js +0 -43
  220. package/dist/sensors/deptry-sensor.js.map +0 -1
  221. package/dist/sensors/line-count-sensor.d.ts +0 -3
  222. package/dist/sensors/line-count-sensor.js +0 -50
  223. package/dist/sensors/line-count-sensor.js.map +0 -1
  224. package/dist/sensors/needs-extraction.d.ts +0 -3
  225. package/dist/sensors/needs-extraction.js +0 -57
  226. package/dist/sensors/needs-extraction.js.map +0 -1
  227. package/dist/sensors/preset.d.ts +0 -17
  228. package/dist/sensors/preset.js +0 -57
  229. package/dist/sensors/preset.js.map +0 -1
  230. package/dist/sensors/python-preset.d.ts +0 -7
  231. package/dist/sensors/python-preset.js +0 -34
  232. package/dist/sensors/python-preset.js.map +0 -1
  233. package/dist/sensors/runner.d.ts +0 -12
  234. package/dist/sensors/runner.js +0 -94
  235. package/dist/sensors/runner.js.map +0 -1
  236. package/dist/sensors/types.d.ts +0 -15
  237. package/dist/sensors/types.js +0 -5
  238. package/dist/sensors/types.js.map +0 -1
  239. package/dist/types.d.ts +0 -44
  240. package/dist/types.js +0 -2
  241. package/dist/types.js.map +0 -1
  242. package/dist/wrap/notices.d.ts +0 -19
  243. package/dist/wrap/notices.js +0 -38
  244. package/dist/wrap/notices.js.map +0 -1
  245. package/dist/wrap/resolve.d.ts +0 -5
  246. package/dist/wrap/resolve.js +0 -9
  247. package/dist/wrap/resolve.js.map +0 -1
  248. package/dist/wrap/run.d.ts +0 -17
  249. package/dist/wrap/run.js +0 -31
  250. package/dist/wrap/run.js.map +0 -1
  251. package/dist/wrap/shell.d.ts +0 -15
  252. package/dist/wrap/shell.js +0 -50
  253. package/dist/wrap/shell.js.map +0 -1
  254. package/src/prompts/deep-nesting.md +0 -13
  255. package/src/prompts/duplicated-code.md +0 -9
  256. package/src/prompts/high-complexity.md +0 -9
  257. package/src/prompts/needs-extraction.md +0 -9
  258. package/src/prompts/non-essential-comment.md +0 -7
  259. package/src/prompts/non-null-assertion.md +0 -10
  260. package/src/prompts/oversized-file.md +0 -9
  261. package/src/prompts/oversized-function.issues.njk +0 -5
  262. package/src/prompts/oversized-function.md +0 -9
  263. package/src/prompts/parse-error.md +0 -5
  264. package/src/prompts/too-many-parameters.md +0 -9
  265. package/src/prompts/uncoached.md +0 -4
  266. package/src/skills/habit-hooks-prompting/SKILL.md +0 -37
  267. package/src/skills/habit-hooks-review/SKILL.md +0 -108
@@ -1,108 +0,0 @@
1
- ---
2
- name: habit-hooks-review
3
- description: "Spawn a reviewer sub-agent to assess a change set against habit-hooks's coding principles. Use AFTER habit-hooks reports clean — habit-hooks catches structural smells; this catches what it cannot (correctness, tests, design, missed edge cases)."
4
- ---
5
-
6
- # Habit Hooks Review
7
-
8
- You are reading this because `habit-hooks` reported clean and you (the implementing agent) need a second pair of eyes on the change set before declaring the work done.
9
-
10
- A green habit-hooks run is necessary, not sufficient. habit-hooks catches structural smells — oversized functions, high complexity, `any`, dead bindings, stale `TODO`s, comments standing in for unclear code. It cannot see:
11
-
12
- - Correctness bugs (logic errors, off-by-one, wrong branch taken).
13
- - Design issues (wrong abstraction, leaky boundaries, missing seam).
14
- - Test coverage gaps (a happy path test masquerading as full coverage, untested error paths).
15
- - Missed edge cases (empty input, concurrent calls, mid-iteration mutation).
16
- - Naming clarity (a name that reads fine in isolation but is wrong for the role it plays).
17
- - Missing abstractions that do not trip a threshold (two functions that should share a type, three call sites that should share a helper).
18
-
19
- This skill spawns a reviewer sub-agent to look for exactly those things.
20
-
21
- ## How to invoke
22
-
23
- Use the `Task` tool to spawn a `general-purpose` sub-agent with the brief below. Do **not** review the change yourself first — the value of this skill is the fresh read. Include the diff scope (commit range, branch, or staged files) in the brief so the reviewer knows what to look at.
24
-
25
- ## The brief
26
-
27
- Paste this verbatim into the Task tool's `prompt`, filling in the change-set scope at the top:
28
-
29
- ---
30
-
31
- You are reviewing a change set against the principles below. The implementing agent has already run `habit-hooks` and it reports clean — so structural smells (function size, parameter count, complexity, file length, `any`, unused vars, etc.) are already covered. **Do not re-flag anything habit-hooks catches.** Focus on what habit-hooks cannot see.
32
-
33
- **Change set under review:** `<describe scope: commit range, branch diff, or staged files>`
34
-
35
- **Ground rules:**
36
-
37
- - PASS-when-clean is the right answer. Do not manufacture issues to look thorough.
38
- - If the change is small and well-shaped, say so. A two-line PASS is a valid outcome.
39
- - Cite `file:line` for every finding. No vague "consider revisiting the design" — point at something.
40
- - Assume the change was written TDD-first. If tests are missing or asymmetric (only happy paths, only the new code), say so.
41
-
42
- **Principles to review against:**
43
-
44
- - **KISS** — is there a simpler approach that does the same job?
45
- - **Single responsibility** — does each new function/class have one reason to change?
46
- - **Naming clarity** — does every name reveal intent? Can a future reader understand it in five seconds?
47
- - **Readability** — is the change comfortable to navigate, or does it ask the reader to hold too many ideas?
48
- - **No shortcuts** — flag `eslint-disable`, `@ts-ignore`, `as any`, swallowed catches, magic numbers without context. Even if the linter is happy, those are debts.
49
- - **Correctness** — read the logic, not just the shape. Look for off-by-one, wrong-branch, swallowed errors, race conditions, mid-iteration mutation.
50
- - **Edge cases** — empty input, single-element input, max/min, error paths.
51
- - **Test coverage** — is each new behaviour exercised? Are failure modes tested, not just happy paths?
52
-
53
- **Categorise findings:**
54
-
55
- - **Blocking** — must be fixed before merge. Correctness bugs, broken tests, gate failures, missing test for new behaviour.
56
- - **Worth flagging** — design or clarity issues the author should weigh. Not necessarily blocking, but worth a conversation.
57
- - **Nits** — small polish items. Hard cap: **two**. If you have more than two nits, drop the weakest ones.
58
-
59
- **Confirm the gate:**
60
-
61
- Run (or read the most recent output of) all four scripts: `typecheck`, `lint`, `test`, `build`. Detect the package manager from the lockfile in the project root (`pnpm-lock.yaml` → `pnpm`, `yarn.lock` → `yarn`, `bun.lock` or `bun.lockb` → `bun`, otherwise `npm`) and invoke accordingly — pnpm/yarn/bun take the script name directly (`pnpm typecheck`), npm needs `run` (`npm run typecheck`).
62
-
63
- All four must exit 0. Report each exit code in the output.
64
-
65
- **Output format (return this verbatim):**
66
-
67
- ```
68
- ## Verdict
69
- <PASS | CHANGES NEEDED>
70
-
71
- ## Findings
72
-
73
- ### Blocking
74
- - <file:line — one-line summary. One short paragraph of detail.>
75
- - (or: "None.")
76
-
77
- ### Worth flagging
78
- - <file:line — one-line summary. One short paragraph of detail.>
79
- - (or: "None.")
80
-
81
- ### Nits (max 2)
82
- - <file:line — one-line summary.>
83
- - (or: "None.")
84
-
85
- ## Gate output
86
- - typecheck: exit <code>
87
- - lint: exit <code>
88
- - test: exit <code>
89
- - build: exit <code>
90
-
91
- ## Specific calls
92
- <Anything that does not fit the categories above — design questions for the author, a follow-up worth scheduling, a pattern worth a CLAUDE.md note. Keep it short or omit the section entirely.>
93
- ```
94
-
95
- ---
96
-
97
- ## After the reviewer returns
98
-
99
- - If **PASS**: relay the verdict and finish the task.
100
- - If **CHANGES NEEDED**: do not silently fix everything. Surface the findings to the user, agree which to act on, and only then implement. Blocking items must be resolved; worth-flagging items are a conversation, not an assignment.
101
-
102
- ## Why this is a separate skill from `code-style-review`
103
-
104
- `code-style-review` is invoked by a human, on a file or a region, to start a discussion before refactoring. It lists problems for the human to triage and prioritise.
105
-
106
- `habit-hooks-review` is invoked by an agent, after a clean automated gate, to get a second-pass quality read on a finished change set. The shape of the output is different — verdict-driven, scoped to the diff, framed for an agent that is about to declare done.
107
-
108
- The two skills are complementary, not interchangeable. Do not use `code-style-review` as a stand-in here: it will not check the gate, will not categorise by blocking severity, and will not return a verdict.