xtrm-tools 0.7.0 → 0.7.2

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 (633) hide show
  1. package/.xtrm/config/README.md +10 -0
  2. package/{config/mcp_servers.json → .xtrm/config/claude.mcp.json} +0 -28
  3. package/{config → .xtrm/config}/instructions/agents-top.md +12 -3
  4. package/{config → .xtrm/config}/instructions/claude-top.md +12 -3
  5. package/{config → .xtrm/config}/pi/extensions/beads/index.ts +44 -13
  6. package/{config → .xtrm/config}/pi/extensions/custom-footer/index.ts +59 -82
  7. package/{config → .xtrm/config}/pi/extensions/xtrm-ui/index.ts +2 -2
  8. package/{config → .xtrm/config}/pi/install-schema.json +2 -2
  9. package/.xtrm/config/pi.mcp.json +39 -0
  10. package/.xtrm/config/settings.json +41 -0
  11. package/.xtrm/extensions/auto-session-name/index.ts +29 -0
  12. package/.xtrm/extensions/auto-session-name/package.json +16 -0
  13. package/.xtrm/extensions/auto-update/index.ts +71 -0
  14. package/.xtrm/extensions/auto-update/package.json +16 -0
  15. package/.xtrm/extensions/beads/index.ts +232 -0
  16. package/.xtrm/extensions/beads/package.json +19 -0
  17. package/.xtrm/extensions/compact-header/index.ts +69 -0
  18. package/.xtrm/extensions/compact-header/package.json +16 -0
  19. package/.xtrm/extensions/core/adapter.ts +52 -0
  20. package/.xtrm/extensions/core/guard-rules.ts +100 -0
  21. package/.xtrm/extensions/core/lib.ts +3 -0
  22. package/.xtrm/extensions/core/logger.ts +45 -0
  23. package/.xtrm/extensions/core/package.json +18 -0
  24. package/.xtrm/extensions/core/runner.ts +71 -0
  25. package/.xtrm/extensions/core/session-state.ts +59 -0
  26. package/.xtrm/extensions/custom-footer/index.ts +398 -0
  27. package/.xtrm/extensions/custom-footer/package.json +19 -0
  28. package/.xtrm/extensions/custom-provider-qwen-cli/index.ts +363 -0
  29. package/.xtrm/extensions/custom-provider-qwen-cli/package.json +1 -0
  30. package/.xtrm/extensions/git-checkpoint/index.ts +53 -0
  31. package/.xtrm/extensions/git-checkpoint/package.json +16 -0
  32. package/.xtrm/extensions/lsp-bootstrap/index.ts +134 -0
  33. package/.xtrm/extensions/lsp-bootstrap/package.json +17 -0
  34. package/.xtrm/extensions/pi-serena-compact/index.ts +121 -0
  35. package/.xtrm/extensions/pi-serena-compact/package.json +16 -0
  36. package/.xtrm/extensions/quality-gates/index.ts +66 -0
  37. package/.xtrm/extensions/quality-gates/package.json +19 -0
  38. package/.xtrm/extensions/service-skills/index.ts +108 -0
  39. package/.xtrm/extensions/service-skills/package.json +19 -0
  40. package/.xtrm/extensions/session-flow/index.ts +96 -0
  41. package/.xtrm/extensions/session-flow/package.json +19 -0
  42. package/.xtrm/extensions/xtrm-loader/index.ts +152 -0
  43. package/.xtrm/extensions/xtrm-loader/package.json +19 -0
  44. package/.xtrm/extensions/xtrm-ui/format.ts +93 -0
  45. package/.xtrm/extensions/xtrm-ui/index.ts +1044 -0
  46. package/.xtrm/extensions/xtrm-ui/package.json +10 -0
  47. package/.xtrm/extensions/xtrm-ui/themes/pidex-dark.json +85 -0
  48. package/.xtrm/extensions/xtrm-ui/themes/pidex-light.json +85 -0
  49. package/{hooks → .xtrm/hooks}/README.md +2 -1
  50. package/{hooks → .xtrm/hooks}/beads-commit-gate.mjs +4 -0
  51. package/.xtrm/hooks/beads-memory-gate.mjs +119 -0
  52. package/{plugins/xtrm-tools → .xtrm}/hooks/quality-check-env.mjs +1 -4
  53. package/.xtrm/hooks/statusline.mjs +156 -0
  54. package/{plugins/xtrm-tools → .xtrm}/hooks/using-xtrm-reminder.mjs +8 -7
  55. package/.xtrm/registry.json +1323 -0
  56. package/CHANGELOG.md +31 -0
  57. package/README.md +20 -3
  58. package/cli/dist/index.cjs +26796 -30901
  59. package/cli/dist/index.cjs.map +1 -1
  60. package/cli/package.json +6 -3
  61. package/package.json +15 -13
  62. package/scripts/ghgrep.mjs +358 -0
  63. package/.claude-plugin/marketplace.json +0 -19
  64. package/.claude-plugin/plugin.json +0 -9
  65. package/config/hooks.json +0 -83
  66. package/config/settings.json +0 -70
  67. package/hooks/beads-memory-gate.mjs +0 -94
  68. package/hooks/quality-check-env.mjs +0 -79
  69. package/hooks/statusline.mjs +0 -183
  70. package/hooks/tsconfig-cache.json +0 -4
  71. package/hooks/using-xtrm-reminder.mjs +0 -47
  72. package/plugins/xtrm-tools/.claude-plugin/plugin.json +0 -9
  73. package/plugins/xtrm-tools/.mcp.json +0 -18
  74. package/plugins/xtrm-tools/hooks/README.md +0 -61
  75. package/plugins/xtrm-tools/hooks/beads-claim-sync.mjs +0 -154
  76. package/plugins/xtrm-tools/hooks/beads-commit-gate.mjs +0 -70
  77. package/plugins/xtrm-tools/hooks/beads-compact-restore.mjs +0 -77
  78. package/plugins/xtrm-tools/hooks/beads-compact-save.mjs +0 -63
  79. package/plugins/xtrm-tools/hooks/beads-edit-gate.mjs +0 -85
  80. package/plugins/xtrm-tools/hooks/beads-gate-core.mjs +0 -236
  81. package/plugins/xtrm-tools/hooks/beads-gate-messages.mjs +0 -75
  82. package/plugins/xtrm-tools/hooks/beads-gate-utils.mjs +0 -176
  83. package/plugins/xtrm-tools/hooks/beads-memory-gate.mjs +0 -94
  84. package/plugins/xtrm-tools/hooks/beads-stop-gate.mjs +0 -53
  85. package/plugins/xtrm-tools/hooks/gitnexus/gitnexus-hook.cjs +0 -222
  86. package/plugins/xtrm-tools/hooks/hooks.json +0 -129
  87. package/plugins/xtrm-tools/hooks/quality-check.cjs +0 -1286
  88. package/plugins/xtrm-tools/hooks/quality-check.py +0 -345
  89. package/plugins/xtrm-tools/hooks/statusline.mjs +0 -183
  90. package/plugins/xtrm-tools/hooks/tsconfig-cache.json +0 -4
  91. package/plugins/xtrm-tools/hooks/worktree-boundary.mjs +0 -33
  92. package/plugins/xtrm-tools/hooks/xtrm-logger.mjs +0 -123
  93. package/plugins/xtrm-tools/hooks/xtrm-session-logger.mjs +0 -27
  94. package/plugins/xtrm-tools/hooks/xtrm-tool-logger.mjs +0 -53
  95. package/plugins/xtrm-tools/skills/README.txt +0 -31
  96. package/plugins/xtrm-tools/skills/clean-code/SKILL.md +0 -201
  97. package/plugins/xtrm-tools/skills/creating-service-skills/SKILL.md +0 -433
  98. package/plugins/xtrm-tools/skills/creating-service-skills/references/script_quality_standards.md +0 -425
  99. package/plugins/xtrm-tools/skills/creating-service-skills/references/service_skill_system_guide.md +0 -278
  100. package/plugins/xtrm-tools/skills/creating-service-skills/scripts/bootstrap.py +0 -326
  101. package/plugins/xtrm-tools/skills/creating-service-skills/scripts/deep_dive.py +0 -304
  102. package/plugins/xtrm-tools/skills/creating-service-skills/scripts/scaffolder.py +0 -482
  103. package/plugins/xtrm-tools/skills/delegating/SKILL.md +0 -196
  104. package/plugins/xtrm-tools/skills/delegating/config.yaml +0 -210
  105. package/plugins/xtrm-tools/skills/delegating/references/orchestration-protocols.md +0 -41
  106. package/plugins/xtrm-tools/skills/docker-expert/SKILL.md +0 -409
  107. package/plugins/xtrm-tools/skills/documenting/CHANGELOG.md +0 -23
  108. package/plugins/xtrm-tools/skills/documenting/README.md +0 -148
  109. package/plugins/xtrm-tools/skills/documenting/SKILL.md +0 -113
  110. package/plugins/xtrm-tools/skills/documenting/examples/example_pattern.md +0 -70
  111. package/plugins/xtrm-tools/skills/documenting/examples/example_reference.md +0 -70
  112. package/plugins/xtrm-tools/skills/documenting/examples/example_ssot_analytics.md +0 -64
  113. package/plugins/xtrm-tools/skills/documenting/examples/example_workflow.md +0 -141
  114. package/plugins/xtrm-tools/skills/documenting/references/changelog-format.md +0 -97
  115. package/plugins/xtrm-tools/skills/documenting/references/metadata-schema.md +0 -136
  116. package/plugins/xtrm-tools/skills/documenting/references/taxonomy.md +0 -81
  117. package/plugins/xtrm-tools/skills/documenting/references/versioning-rules.md +0 -78
  118. package/plugins/xtrm-tools/skills/documenting/scripts/bump_version.sh +0 -60
  119. package/plugins/xtrm-tools/skills/documenting/scripts/changelog/__init__.py +0 -0
  120. package/plugins/xtrm-tools/skills/documenting/scripts/changelog/add_entry.py +0 -216
  121. package/plugins/xtrm-tools/skills/documenting/scripts/changelog/bump_release.py +0 -117
  122. package/plugins/xtrm-tools/skills/documenting/scripts/changelog/init_changelog.py +0 -54
  123. package/plugins/xtrm-tools/skills/documenting/scripts/changelog/validate_changelog.py +0 -128
  124. package/plugins/xtrm-tools/skills/documenting/scripts/drift_detector.py +0 -266
  125. package/plugins/xtrm-tools/skills/documenting/scripts/generate_template.py +0 -311
  126. package/plugins/xtrm-tools/skills/documenting/scripts/list_by_category.sh +0 -84
  127. package/plugins/xtrm-tools/skills/documenting/scripts/orchestrator.py +0 -255
  128. package/plugins/xtrm-tools/skills/documenting/scripts/validate_metadata.py +0 -242
  129. package/plugins/xtrm-tools/skills/documenting/templates/CHANGELOG.md.template +0 -13
  130. package/plugins/xtrm-tools/skills/documenting/tests/integration_test.sh +0 -70
  131. package/plugins/xtrm-tools/skills/documenting/tests/test_changelog.py +0 -201
  132. package/plugins/xtrm-tools/skills/documenting/tests/test_drift_detector.py +0 -80
  133. package/plugins/xtrm-tools/skills/documenting/tests/test_orchestrator.py +0 -52
  134. package/plugins/xtrm-tools/skills/documenting/tests/test_validate_metadata.py +0 -64
  135. package/plugins/xtrm-tools/skills/find-skills/SKILL.md +0 -133
  136. package/plugins/xtrm-tools/skills/gitnexus-exploring/SKILL.md +0 -75
  137. package/plugins/xtrm-tools/skills/gitnexus-impact-analysis/SKILL.md +0 -94
  138. package/plugins/xtrm-tools/skills/gitnexus-refactoring/SKILL.md +0 -113
  139. package/plugins/xtrm-tools/skills/hook-development/SKILL.md +0 -797
  140. package/plugins/xtrm-tools/skills/hook-development/examples/load-context.sh +0 -55
  141. package/plugins/xtrm-tools/skills/hook-development/examples/quality-check.js +0 -1168
  142. package/plugins/xtrm-tools/skills/hook-development/examples/validate-bash.sh +0 -43
  143. package/plugins/xtrm-tools/skills/hook-development/examples/validate-write.sh +0 -38
  144. package/plugins/xtrm-tools/skills/hook-development/references/advanced.md +0 -527
  145. package/plugins/xtrm-tools/skills/hook-development/references/migration.md +0 -369
  146. package/plugins/xtrm-tools/skills/hook-development/references/patterns.md +0 -412
  147. package/plugins/xtrm-tools/skills/hook-development/scripts/README.md +0 -164
  148. package/plugins/xtrm-tools/skills/hook-development/scripts/hook-linter.sh +0 -153
  149. package/plugins/xtrm-tools/skills/hook-development/scripts/test-hook.sh +0 -252
  150. package/plugins/xtrm-tools/skills/hook-development/scripts/validate-hook-schema.sh +0 -159
  151. package/plugins/xtrm-tools/skills/obsidian-cli/SKILL.md +0 -106
  152. package/plugins/xtrm-tools/skills/orchestrating-agents/SKILL.md +0 -135
  153. package/plugins/xtrm-tools/skills/orchestrating-agents/config.yaml +0 -45
  154. package/plugins/xtrm-tools/skills/orchestrating-agents/references/agent-context-integration.md +0 -37
  155. package/plugins/xtrm-tools/skills/orchestrating-agents/references/examples.md +0 -45
  156. package/plugins/xtrm-tools/skills/orchestrating-agents/references/handover-protocol.md +0 -31
  157. package/plugins/xtrm-tools/skills/orchestrating-agents/references/workflows.md +0 -42
  158. package/plugins/xtrm-tools/skills/orchestrating-agents/scripts/detect_neighbors.py +0 -23
  159. package/plugins/xtrm-tools/skills/planning/SKILL.md +0 -405
  160. package/plugins/xtrm-tools/skills/planning/evals/evals.json +0 -19
  161. package/plugins/xtrm-tools/skills/prompt-improving/README.md +0 -162
  162. package/plugins/xtrm-tools/skills/prompt-improving/SKILL.md +0 -74
  163. package/plugins/xtrm-tools/skills/prompt-improving/references/analysis_commands.md +0 -24
  164. package/plugins/xtrm-tools/skills/prompt-improving/references/chain_of_thought.md +0 -24
  165. package/plugins/xtrm-tools/skills/prompt-improving/references/mcp_definitions.md +0 -20
  166. package/plugins/xtrm-tools/skills/prompt-improving/references/multishot.md +0 -23
  167. package/plugins/xtrm-tools/skills/prompt-improving/references/xml_core.md +0 -60
  168. package/plugins/xtrm-tools/skills/python-testing/SKILL.md +0 -815
  169. package/plugins/xtrm-tools/skills/scoping-service-skills/SKILL.md +0 -231
  170. package/plugins/xtrm-tools/skills/scoping-service-skills/scripts/scope.py +0 -74
  171. package/plugins/xtrm-tools/skills/senior-backend/SKILL.md +0 -209
  172. package/plugins/xtrm-tools/skills/senior-backend/references/api_design_patterns.md +0 -103
  173. package/plugins/xtrm-tools/skills/senior-backend/references/backend_security_practices.md +0 -103
  174. package/plugins/xtrm-tools/skills/senior-backend/references/database_optimization_guide.md +0 -103
  175. package/plugins/xtrm-tools/skills/senior-backend/scripts/api_load_tester.py +0 -114
  176. package/plugins/xtrm-tools/skills/senior-backend/scripts/api_scaffolder.py +0 -114
  177. package/plugins/xtrm-tools/skills/senior-backend/scripts/database_migration_tool.py +0 -114
  178. package/plugins/xtrm-tools/skills/senior-data-scientist/SKILL.md +0 -226
  179. package/plugins/xtrm-tools/skills/senior-data-scientist/references/experiment_design_frameworks.md +0 -80
  180. package/plugins/xtrm-tools/skills/senior-data-scientist/references/feature_engineering_patterns.md +0 -80
  181. package/plugins/xtrm-tools/skills/senior-data-scientist/references/statistical_methods_advanced.md +0 -80
  182. package/plugins/xtrm-tools/skills/senior-data-scientist/scripts/experiment_designer.py +0 -100
  183. package/plugins/xtrm-tools/skills/senior-data-scientist/scripts/feature_engineering_pipeline.py +0 -100
  184. package/plugins/xtrm-tools/skills/senior-data-scientist/scripts/model_evaluation_suite.py +0 -100
  185. package/plugins/xtrm-tools/skills/senior-devops/SKILL.md +0 -209
  186. package/plugins/xtrm-tools/skills/senior-devops/references/cicd_pipeline_guide.md +0 -103
  187. package/plugins/xtrm-tools/skills/senior-devops/references/deployment_strategies.md +0 -103
  188. package/plugins/xtrm-tools/skills/senior-devops/references/infrastructure_as_code.md +0 -103
  189. package/plugins/xtrm-tools/skills/senior-devops/scripts/deployment_manager.py +0 -114
  190. package/plugins/xtrm-tools/skills/senior-devops/scripts/pipeline_generator.py +0 -114
  191. package/plugins/xtrm-tools/skills/senior-devops/scripts/terraform_scaffolder.py +0 -114
  192. package/plugins/xtrm-tools/skills/senior-security/SKILL.md +0 -209
  193. package/plugins/xtrm-tools/skills/senior-security/references/cryptography_implementation.md +0 -103
  194. package/plugins/xtrm-tools/skills/senior-security/references/penetration_testing_guide.md +0 -103
  195. package/plugins/xtrm-tools/skills/senior-security/references/security_architecture_patterns.md +0 -103
  196. package/plugins/xtrm-tools/skills/senior-security/scripts/pentest_automator.py +0 -114
  197. package/plugins/xtrm-tools/skills/senior-security/scripts/security_auditor.py +0 -114
  198. package/plugins/xtrm-tools/skills/senior-security/scripts/threat_modeler.py +0 -114
  199. package/plugins/xtrm-tools/skills/skill-creator/LICENSE.txt +0 -202
  200. package/plugins/xtrm-tools/skills/skill-creator/SKILL.md +0 -479
  201. package/plugins/xtrm-tools/skills/skill-creator/agents/analyzer.md +0 -274
  202. package/plugins/xtrm-tools/skills/skill-creator/agents/comparator.md +0 -202
  203. package/plugins/xtrm-tools/skills/skill-creator/agents/grader.md +0 -223
  204. package/plugins/xtrm-tools/skills/skill-creator/assets/eval_review.html +0 -146
  205. package/plugins/xtrm-tools/skills/skill-creator/eval-viewer/generate_review.py +0 -471
  206. package/plugins/xtrm-tools/skills/skill-creator/eval-viewer/viewer.html +0 -1325
  207. package/plugins/xtrm-tools/skills/skill-creator/references/schemas.md +0 -430
  208. package/plugins/xtrm-tools/skills/skill-creator/scripts/__init__.py +0 -0
  209. package/plugins/xtrm-tools/skills/skill-creator/scripts/aggregate_benchmark.py +0 -401
  210. package/plugins/xtrm-tools/skills/skill-creator/scripts/generate_report.py +0 -326
  211. package/plugins/xtrm-tools/skills/skill-creator/scripts/improve_description.py +0 -248
  212. package/plugins/xtrm-tools/skills/skill-creator/scripts/package_skill.py +0 -136
  213. package/plugins/xtrm-tools/skills/skill-creator/scripts/quick_validate.py +0 -103
  214. package/plugins/xtrm-tools/skills/skill-creator/scripts/run_eval.py +0 -310
  215. package/plugins/xtrm-tools/skills/skill-creator/scripts/run_loop.py +0 -332
  216. package/plugins/xtrm-tools/skills/skill-creator/scripts/utils.py +0 -47
  217. package/plugins/xtrm-tools/skills/sync-docs/SKILL.md +0 -286
  218. package/plugins/xtrm-tools/skills/sync-docs/evals/evals.json +0 -89
  219. package/plugins/xtrm-tools/skills/sync-docs/references/doc-structure.md +0 -99
  220. package/plugins/xtrm-tools/skills/sync-docs/references/schema.md +0 -103
  221. package/plugins/xtrm-tools/skills/sync-docs/scripts/changelog/add_entry.py +0 -216
  222. package/plugins/xtrm-tools/skills/sync-docs/scripts/context_gatherer.py +0 -240
  223. package/plugins/xtrm-tools/skills/sync-docs/scripts/doc_structure_analyzer.py +0 -495
  224. package/plugins/xtrm-tools/skills/sync-docs/scripts/drift_detector.py +0 -563
  225. package/plugins/xtrm-tools/skills/sync-docs/scripts/validate_doc.py +0 -365
  226. package/plugins/xtrm-tools/skills/sync-docs/scripts/validate_metadata.py +0 -185
  227. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-1/benchmark.json +0 -293
  228. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-1/benchmark.md +0 -13
  229. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-1/eval-doc-audit/eval_metadata.json +0 -27
  230. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-1/eval-doc-audit/with_skill/outputs/result.md +0 -210
  231. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-1/eval-doc-audit/with_skill/run-1/grading.json +0 -28
  232. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-1/eval-doc-audit/with_skill/run-1/timing.json +0 -1
  233. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-1/eval-doc-audit/without_skill/outputs/result.md +0 -101
  234. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-1/eval-doc-audit/without_skill/run-1/grading.json +0 -28
  235. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-1/eval-doc-audit/without_skill/run-1/timing.json +0 -5
  236. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-1/eval-doc-audit/without_skill/timing.json +0 -5
  237. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-1/eval-fix-mode/eval_metadata.json +0 -27
  238. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-1/eval-fix-mode/with_skill/outputs/result.md +0 -198
  239. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-1/eval-fix-mode/with_skill/run-1/grading.json +0 -28
  240. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-1/eval-fix-mode/with_skill/run-1/timing.json +0 -1
  241. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-1/eval-fix-mode/without_skill/outputs/result.md +0 -94
  242. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-1/eval-fix-mode/without_skill/run-1/grading.json +0 -28
  243. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-1/eval-fix-mode/without_skill/run-1/timing.json +0 -1
  244. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-1/eval-sprint-closeout/eval_metadata.json +0 -27
  245. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-1/eval-sprint-closeout/with_skill/outputs/result.md +0 -237
  246. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-1/eval-sprint-closeout/with_skill/run-1/grading.json +0 -28
  247. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-1/eval-sprint-closeout/with_skill/run-1/timing.json +0 -1
  248. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-1/eval-sprint-closeout/without_skill/outputs/result.md +0 -134
  249. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-1/eval-sprint-closeout/without_skill/run-1/grading.json +0 -28
  250. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-1/eval-sprint-closeout/without_skill/run-1/timing.json +0 -1
  251. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-2/benchmark.json +0 -297
  252. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-2/benchmark.md +0 -13
  253. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-2/eval-doc-audit/eval_metadata.json +0 -27
  254. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-2/eval-doc-audit/with_skill/outputs/result.md +0 -137
  255. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-2/eval-doc-audit/with_skill/run-1/grading.json +0 -92
  256. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-2/eval-doc-audit/with_skill/run-1/timing.json +0 -1
  257. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-2/eval-doc-audit/without_skill/outputs/result.md +0 -134
  258. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-2/eval-doc-audit/without_skill/run-1/grading.json +0 -86
  259. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-2/eval-doc-audit/without_skill/run-1/timing.json +0 -1
  260. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-2/eval-fix-mode/eval_metadata.json +0 -27
  261. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-2/eval-fix-mode/with_skill/outputs/result.md +0 -193
  262. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-2/eval-fix-mode/with_skill/run-1/grading.json +0 -72
  263. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-2/eval-fix-mode/with_skill/run-1/timing.json +0 -1
  264. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-2/eval-fix-mode/without_skill/outputs/result.md +0 -211
  265. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-2/eval-fix-mode/without_skill/run-1/grading.json +0 -91
  266. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-2/eval-fix-mode/without_skill/run-1/timing.json +0 -5
  267. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-2/eval-sprint-closeout/eval_metadata.json +0 -27
  268. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-2/eval-sprint-closeout/with_skill/outputs/result.md +0 -182
  269. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-2/eval-sprint-closeout/with_skill/run-1/grading.json +0 -95
  270. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-2/eval-sprint-closeout/with_skill/run-1/timing.json +0 -1
  271. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-2/eval-sprint-closeout/without_skill/outputs/result.md +0 -222
  272. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-2/eval-sprint-closeout/without_skill/run-1/grading.json +0 -88
  273. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-2/eval-sprint-closeout/without_skill/run-1/timing.json +0 -5
  274. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/benchmark.json +0 -298
  275. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/benchmark.md +0 -13
  276. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-doc-audit/eval_metadata.json +0 -27
  277. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-doc-audit/with_skill/outputs/result.md +0 -125
  278. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-doc-audit/with_skill/run-1/grading.json +0 -97
  279. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-doc-audit/with_skill/run-1/timing.json +0 -5
  280. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-doc-audit/without_skill/outputs/result.md +0 -144
  281. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-doc-audit/without_skill/run-1/grading.json +0 -78
  282. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-doc-audit/without_skill/run-1/timing.json +0 -5
  283. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-fix-mode/eval_metadata.json +0 -27
  284. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-fix-mode/with_skill/outputs/result.md +0 -104
  285. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-fix-mode/with_skill/run-1/grading.json +0 -91
  286. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-fix-mode/with_skill/run-1/timing.json +0 -5
  287. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-fix-mode/without_skill/outputs/result.md +0 -79
  288. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-fix-mode/without_skill/run-1/grading.json +0 -82
  289. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-fix-mode/without_skill/run-1/timing.json +0 -5
  290. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-sprint-closeout/eval_metadata.json +0 -27
  291. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-sprint-closeout/with_skill/outputs/phase1_context.json +0 -302
  292. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-sprint-closeout/with_skill/outputs/phase2_drift.txt +0 -33
  293. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-sprint-closeout/with_skill/outputs/phase3_analysis.json +0 -114
  294. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-sprint-closeout/with_skill/outputs/phase4_fix.txt +0 -118
  295. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-sprint-closeout/with_skill/outputs/phase5_validate.txt +0 -38
  296. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-sprint-closeout/with_skill/outputs/result.md +0 -158
  297. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-sprint-closeout/with_skill/run-1/grading.json +0 -95
  298. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-sprint-closeout/with_skill/run-1/timing.json +0 -5
  299. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-sprint-closeout/without_skill/outputs/result.md +0 -71
  300. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-sprint-closeout/without_skill/run-1/grading.json +0 -90
  301. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-sprint-closeout/without_skill/run-1/timing.json +0 -5
  302. package/plugins/xtrm-tools/skills/test-planning/SKILL.md +0 -465
  303. package/plugins/xtrm-tools/skills/test-planning/evals/evals.json +0 -23
  304. package/plugins/xtrm-tools/skills/updating-service-skills/SKILL.md +0 -136
  305. package/plugins/xtrm-tools/skills/updating-service-skills/scripts/drift_detector.py +0 -222
  306. package/plugins/xtrm-tools/skills/using-quality-gates/SKILL.md +0 -254
  307. package/plugins/xtrm-tools/skills/using-serena-lsp/README.md +0 -8
  308. package/plugins/xtrm-tools/skills/using-serena-lsp/REFERENCE.md +0 -194
  309. package/plugins/xtrm-tools/skills/using-serena-lsp/SKILL.md +0 -82
  310. package/plugins/xtrm-tools/skills/using-service-skills/SKILL.md +0 -108
  311. package/plugins/xtrm-tools/skills/using-service-skills/scripts/cataloger.py +0 -74
  312. package/plugins/xtrm-tools/skills/using-service-skills/scripts/skill_activator.py +0 -152
  313. package/plugins/xtrm-tools/skills/using-service-skills/scripts/test_skill_activator.py +0 -58
  314. package/plugins/xtrm-tools/skills/using-tdd/SKILL.md +0 -410
  315. package/plugins/xtrm-tools/skills/using-xtrm/SKILL.md +0 -127
  316. package/plugins/xtrm-tools/skills/xt-debugging/SKILL.md +0 -149
  317. package/plugins/xtrm-tools/skills/xt-end/SKILL.md +0 -297
  318. package/plugins/xtrm-tools/skills/xt-merge/SKILL.md +0 -313
  319. package/project-skills/quality-gates/.claude/hooks/hook-config.json +0 -66
  320. package/project-skills/quality-gates/.claude/hooks/quality-check.cjs +0 -1286
  321. package/project-skills/quality-gates/.claude/hooks/quality-check.py +0 -334
  322. package/project-skills/quality-gates/.claude/settings.json +0 -3
  323. package/project-skills/quality-gates/.claude/skills/using-quality-gates/SKILL.md +0 -254
  324. package/project-skills/quality-gates/README.md +0 -109
  325. package/project-skills/quality-gates/evals/evals.json +0 -181
  326. package/project-skills/quality-gates/workspace/iteration-1/FINAL-EVAL-SUMMARY.md +0 -75
  327. package/project-skills/quality-gates/workspace/iteration-1/edge-case-auto-fix-verification/with_skill/outputs/response.md +0 -59
  328. package/project-skills/quality-gates/workspace/iteration-1/edge-case-mixed-language-project/with_skill/outputs/response.md +0 -60
  329. package/project-skills/quality-gates/workspace/iteration-1/eval-summary.md +0 -105
  330. package/project-skills/quality-gates/workspace/iteration-1/partial-install-python-only/with_skill/outputs/response.md +0 -93
  331. package/project-skills/quality-gates/workspace/iteration-1/python-refactor-request/with_skill/outputs/response.md +0 -104
  332. package/project-skills/quality-gates/workspace/iteration-1/quality-gate-error-fix/with_skill/outputs/response.md +0 -74
  333. package/project-skills/quality-gates/workspace/iteration-1/should-not-trigger-general-chat/with_skill/outputs/response.md +0 -18
  334. package/project-skills/quality-gates/workspace/iteration-1/should-not-trigger-math-question/with_skill/outputs/response.md +0 -18
  335. package/project-skills/quality-gates/workspace/iteration-1/should-not-trigger-unrelated-coding/with_skill/outputs/response.md +0 -56
  336. package/project-skills/quality-gates/workspace/iteration-1/tdd-guard-blocking-confusion/with_skill/outputs/response.md +0 -67
  337. package/project-skills/quality-gates/workspace/iteration-1/typescript-feature-with-tests/with_skill/outputs/response.md +0 -97
  338. package/project-skills/service-skills-set/.claude/git-hooks/doc_reminder.py +0 -67
  339. package/project-skills/service-skills-set/.claude/git-hooks/skill_staleness.py +0 -194
  340. package/project-skills/service-skills-set/.claude/service-registry.json +0 -4
  341. package/project-skills/service-skills-set/.claude/settings.json +0 -37
  342. package/project-skills/service-skills-set/.claude/skills/creating-service-skills/SKILL.md +0 -433
  343. package/project-skills/service-skills-set/.claude/skills/creating-service-skills/references/script_quality_standards.md +0 -425
  344. package/project-skills/service-skills-set/.claude/skills/creating-service-skills/references/service_skill_system_guide.md +0 -278
  345. package/project-skills/service-skills-set/.claude/skills/creating-service-skills/scripts/bootstrap.py +0 -308
  346. package/project-skills/service-skills-set/.claude/skills/creating-service-skills/scripts/deep_dive.py +0 -304
  347. package/project-skills/service-skills-set/.claude/skills/creating-service-skills/scripts/scaffolder.py +0 -482
  348. package/project-skills/service-skills-set/.claude/skills/scoping-service-skills/SKILL.md +0 -231
  349. package/project-skills/service-skills-set/.claude/skills/scoping-service-skills/scripts/scope.py +0 -74
  350. package/project-skills/service-skills-set/.claude/skills/updating-service-skills/SKILL.md +0 -136
  351. package/project-skills/service-skills-set/.claude/skills/updating-service-skills/scripts/drift_detector.py +0 -222
  352. package/project-skills/service-skills-set/.claude/skills/using-service-skills/SKILL.md +0 -108
  353. package/project-skills/service-skills-set/.claude/skills/using-service-skills/scripts/cataloger.py +0 -74
  354. package/project-skills/service-skills-set/.claude/skills/using-service-skills/scripts/skill_activator.py +0 -152
  355. package/project-skills/service-skills-set/README.md +0 -93
  356. package/project-skills/service-skills-set/install-service-skills.py +0 -193
  357. package/project-skills/service-skills-set/service-skills-readme.md +0 -236
  358. package/skills/README.txt +0 -31
  359. package/skills/clean-code/SKILL.md +0 -201
  360. package/skills/creating-service-skills/SKILL.md +0 -433
  361. package/skills/creating-service-skills/references/script_quality_standards.md +0 -425
  362. package/skills/creating-service-skills/references/service_skill_system_guide.md +0 -278
  363. package/skills/creating-service-skills/scripts/bootstrap.py +0 -326
  364. package/skills/creating-service-skills/scripts/deep_dive.py +0 -304
  365. package/skills/creating-service-skills/scripts/scaffolder.py +0 -482
  366. package/skills/delegating/SKILL.md +0 -196
  367. package/skills/delegating/config.yaml +0 -210
  368. package/skills/delegating/references/orchestration-protocols.md +0 -41
  369. package/skills/docker-expert/SKILL.md +0 -409
  370. package/skills/documenting/CHANGELOG.md +0 -23
  371. package/skills/documenting/README.md +0 -148
  372. package/skills/documenting/SKILL.md +0 -113
  373. package/skills/documenting/examples/example_pattern.md +0 -70
  374. package/skills/documenting/examples/example_reference.md +0 -70
  375. package/skills/documenting/examples/example_ssot_analytics.md +0 -64
  376. package/skills/documenting/examples/example_workflow.md +0 -141
  377. package/skills/documenting/references/changelog-format.md +0 -97
  378. package/skills/documenting/references/metadata-schema.md +0 -136
  379. package/skills/documenting/references/taxonomy.md +0 -81
  380. package/skills/documenting/references/versioning-rules.md +0 -78
  381. package/skills/documenting/scripts/bump_version.sh +0 -60
  382. package/skills/documenting/scripts/changelog/__init__.py +0 -0
  383. package/skills/documenting/scripts/changelog/add_entry.py +0 -216
  384. package/skills/documenting/scripts/changelog/bump_release.py +0 -117
  385. package/skills/documenting/scripts/changelog/init_changelog.py +0 -54
  386. package/skills/documenting/scripts/changelog/validate_changelog.py +0 -128
  387. package/skills/documenting/scripts/drift_detector.py +0 -266
  388. package/skills/documenting/scripts/generate_template.py +0 -311
  389. package/skills/documenting/scripts/list_by_category.sh +0 -84
  390. package/skills/documenting/scripts/orchestrator.py +0 -255
  391. package/skills/documenting/scripts/validate_metadata.py +0 -242
  392. package/skills/documenting/templates/CHANGELOG.md.template +0 -13
  393. package/skills/find-skills/SKILL.md +0 -133
  394. package/skills/gitnexus-exploring/SKILL.md +0 -75
  395. package/skills/gitnexus-impact-analysis/SKILL.md +0 -94
  396. package/skills/gitnexus-refactoring/SKILL.md +0 -113
  397. package/skills/hook-development/SKILL.md +0 -797
  398. package/skills/hook-development/examples/load-context.sh +0 -55
  399. package/skills/hook-development/examples/quality-check.js +0 -1168
  400. package/skills/hook-development/examples/validate-bash.sh +0 -43
  401. package/skills/hook-development/examples/validate-write.sh +0 -38
  402. package/skills/hook-development/references/advanced.md +0 -527
  403. package/skills/hook-development/references/migration.md +0 -369
  404. package/skills/hook-development/references/patterns.md +0 -412
  405. package/skills/hook-development/scripts/README.md +0 -164
  406. package/skills/hook-development/scripts/hook-linter.sh +0 -153
  407. package/skills/hook-development/scripts/test-hook.sh +0 -252
  408. package/skills/hook-development/scripts/validate-hook-schema.sh +0 -159
  409. package/skills/obsidian-cli/SKILL.md +0 -106
  410. package/skills/orchestrating-agents/SKILL.md +0 -135
  411. package/skills/orchestrating-agents/config.yaml +0 -45
  412. package/skills/orchestrating-agents/references/agent-context-integration.md +0 -37
  413. package/skills/orchestrating-agents/references/examples.md +0 -45
  414. package/skills/orchestrating-agents/references/handover-protocol.md +0 -31
  415. package/skills/orchestrating-agents/references/workflows.md +0 -42
  416. package/skills/orchestrating-agents/scripts/detect_neighbors.py +0 -23
  417. package/skills/planning/SKILL.md +0 -405
  418. package/skills/planning/evals/evals.json +0 -19
  419. package/skills/prompt-improving/README.md +0 -162
  420. package/skills/prompt-improving/SKILL.md +0 -74
  421. package/skills/prompt-improving/references/analysis_commands.md +0 -24
  422. package/skills/prompt-improving/references/chain_of_thought.md +0 -24
  423. package/skills/prompt-improving/references/mcp_definitions.md +0 -20
  424. package/skills/prompt-improving/references/multishot.md +0 -23
  425. package/skills/prompt-improving/references/xml_core.md +0 -60
  426. package/skills/python-testing/SKILL.md +0 -815
  427. package/skills/scoping-service-skills/SKILL.md +0 -231
  428. package/skills/scoping-service-skills/scripts/scope.py +0 -74
  429. package/skills/senior-backend/SKILL.md +0 -209
  430. package/skills/senior-backend/references/api_design_patterns.md +0 -103
  431. package/skills/senior-backend/references/backend_security_practices.md +0 -103
  432. package/skills/senior-backend/references/database_optimization_guide.md +0 -103
  433. package/skills/senior-backend/scripts/api_load_tester.py +0 -114
  434. package/skills/senior-backend/scripts/api_scaffolder.py +0 -114
  435. package/skills/senior-backend/scripts/database_migration_tool.py +0 -114
  436. package/skills/senior-data-scientist/SKILL.md +0 -226
  437. package/skills/senior-data-scientist/references/experiment_design_frameworks.md +0 -80
  438. package/skills/senior-data-scientist/references/feature_engineering_patterns.md +0 -80
  439. package/skills/senior-data-scientist/references/statistical_methods_advanced.md +0 -80
  440. package/skills/senior-data-scientist/scripts/experiment_designer.py +0 -100
  441. package/skills/senior-data-scientist/scripts/feature_engineering_pipeline.py +0 -100
  442. package/skills/senior-data-scientist/scripts/model_evaluation_suite.py +0 -100
  443. package/skills/senior-devops/SKILL.md +0 -209
  444. package/skills/senior-devops/references/cicd_pipeline_guide.md +0 -103
  445. package/skills/senior-devops/references/deployment_strategies.md +0 -103
  446. package/skills/senior-devops/references/infrastructure_as_code.md +0 -103
  447. package/skills/senior-devops/scripts/deployment_manager.py +0 -114
  448. package/skills/senior-devops/scripts/pipeline_generator.py +0 -114
  449. package/skills/senior-devops/scripts/terraform_scaffolder.py +0 -114
  450. package/skills/senior-security/SKILL.md +0 -209
  451. package/skills/senior-security/references/cryptography_implementation.md +0 -103
  452. package/skills/senior-security/references/penetration_testing_guide.md +0 -103
  453. package/skills/senior-security/references/security_architecture_patterns.md +0 -103
  454. package/skills/senior-security/scripts/pentest_automator.py +0 -114
  455. package/skills/senior-security/scripts/security_auditor.py +0 -114
  456. package/skills/senior-security/scripts/threat_modeler.py +0 -114
  457. package/skills/skill-creator/LICENSE.txt +0 -202
  458. package/skills/skill-creator/SKILL.md +0 -479
  459. package/skills/skill-creator/agents/analyzer.md +0 -274
  460. package/skills/skill-creator/agents/comparator.md +0 -202
  461. package/skills/skill-creator/agents/grader.md +0 -223
  462. package/skills/skill-creator/assets/eval_review.html +0 -146
  463. package/skills/skill-creator/eval-viewer/generate_review.py +0 -471
  464. package/skills/skill-creator/eval-viewer/viewer.html +0 -1325
  465. package/skills/skill-creator/references/schemas.md +0 -430
  466. package/skills/skill-creator/scripts/__init__.py +0 -0
  467. package/skills/skill-creator/scripts/aggregate_benchmark.py +0 -401
  468. package/skills/skill-creator/scripts/generate_report.py +0 -326
  469. package/skills/skill-creator/scripts/improve_description.py +0 -248
  470. package/skills/skill-creator/scripts/package_skill.py +0 -136
  471. package/skills/skill-creator/scripts/quick_validate.py +0 -103
  472. package/skills/skill-creator/scripts/run_eval.py +0 -310
  473. package/skills/skill-creator/scripts/run_loop.py +0 -332
  474. package/skills/skill-creator/scripts/utils.py +0 -47
  475. package/skills/sync-docs/SKILL.md +0 -286
  476. package/skills/sync-docs/evals/evals.json +0 -89
  477. package/skills/sync-docs/references/doc-structure.md +0 -99
  478. package/skills/sync-docs/references/schema.md +0 -103
  479. package/skills/sync-docs/scripts/changelog/add_entry.py +0 -216
  480. package/skills/sync-docs/scripts/context_gatherer.py +0 -240
  481. package/skills/sync-docs/scripts/doc_structure_analyzer.py +0 -495
  482. package/skills/sync-docs/scripts/drift_detector.py +0 -563
  483. package/skills/sync-docs/scripts/validate_doc.py +0 -365
  484. package/skills/sync-docs/scripts/validate_metadata.py +0 -185
  485. package/skills/sync-docs-workspace/iteration-1/benchmark.json +0 -293
  486. package/skills/sync-docs-workspace/iteration-1/benchmark.md +0 -13
  487. package/skills/sync-docs-workspace/iteration-1/eval-doc-audit/eval_metadata.json +0 -27
  488. package/skills/sync-docs-workspace/iteration-1/eval-doc-audit/with_skill/outputs/result.md +0 -210
  489. package/skills/sync-docs-workspace/iteration-1/eval-doc-audit/with_skill/run-1/grading.json +0 -28
  490. package/skills/sync-docs-workspace/iteration-1/eval-doc-audit/with_skill/run-1/timing.json +0 -1
  491. package/skills/sync-docs-workspace/iteration-1/eval-doc-audit/without_skill/outputs/result.md +0 -101
  492. package/skills/sync-docs-workspace/iteration-1/eval-doc-audit/without_skill/run-1/grading.json +0 -28
  493. package/skills/sync-docs-workspace/iteration-1/eval-doc-audit/without_skill/run-1/timing.json +0 -5
  494. package/skills/sync-docs-workspace/iteration-1/eval-doc-audit/without_skill/timing.json +0 -5
  495. package/skills/sync-docs-workspace/iteration-1/eval-fix-mode/eval_metadata.json +0 -27
  496. package/skills/sync-docs-workspace/iteration-1/eval-fix-mode/with_skill/outputs/result.md +0 -198
  497. package/skills/sync-docs-workspace/iteration-1/eval-fix-mode/with_skill/run-1/grading.json +0 -28
  498. package/skills/sync-docs-workspace/iteration-1/eval-fix-mode/with_skill/run-1/timing.json +0 -1
  499. package/skills/sync-docs-workspace/iteration-1/eval-fix-mode/without_skill/outputs/result.md +0 -94
  500. package/skills/sync-docs-workspace/iteration-1/eval-fix-mode/without_skill/run-1/grading.json +0 -28
  501. package/skills/sync-docs-workspace/iteration-1/eval-fix-mode/without_skill/run-1/timing.json +0 -1
  502. package/skills/sync-docs-workspace/iteration-1/eval-sprint-closeout/eval_metadata.json +0 -27
  503. package/skills/sync-docs-workspace/iteration-1/eval-sprint-closeout/with_skill/outputs/result.md +0 -237
  504. package/skills/sync-docs-workspace/iteration-1/eval-sprint-closeout/with_skill/run-1/grading.json +0 -28
  505. package/skills/sync-docs-workspace/iteration-1/eval-sprint-closeout/with_skill/run-1/timing.json +0 -1
  506. package/skills/sync-docs-workspace/iteration-1/eval-sprint-closeout/without_skill/outputs/result.md +0 -134
  507. package/skills/sync-docs-workspace/iteration-1/eval-sprint-closeout/without_skill/run-1/grading.json +0 -28
  508. package/skills/sync-docs-workspace/iteration-1/eval-sprint-closeout/without_skill/run-1/timing.json +0 -1
  509. package/skills/sync-docs-workspace/iteration-2/benchmark.json +0 -297
  510. package/skills/sync-docs-workspace/iteration-2/benchmark.md +0 -13
  511. package/skills/sync-docs-workspace/iteration-2/eval-doc-audit/eval_metadata.json +0 -27
  512. package/skills/sync-docs-workspace/iteration-2/eval-doc-audit/with_skill/outputs/result.md +0 -137
  513. package/skills/sync-docs-workspace/iteration-2/eval-doc-audit/with_skill/run-1/grading.json +0 -92
  514. package/skills/sync-docs-workspace/iteration-2/eval-doc-audit/with_skill/run-1/timing.json +0 -1
  515. package/skills/sync-docs-workspace/iteration-2/eval-doc-audit/without_skill/outputs/result.md +0 -134
  516. package/skills/sync-docs-workspace/iteration-2/eval-doc-audit/without_skill/run-1/grading.json +0 -86
  517. package/skills/sync-docs-workspace/iteration-2/eval-doc-audit/without_skill/run-1/timing.json +0 -1
  518. package/skills/sync-docs-workspace/iteration-2/eval-fix-mode/eval_metadata.json +0 -27
  519. package/skills/sync-docs-workspace/iteration-2/eval-fix-mode/with_skill/outputs/result.md +0 -193
  520. package/skills/sync-docs-workspace/iteration-2/eval-fix-mode/with_skill/run-1/grading.json +0 -72
  521. package/skills/sync-docs-workspace/iteration-2/eval-fix-mode/with_skill/run-1/timing.json +0 -1
  522. package/skills/sync-docs-workspace/iteration-2/eval-fix-mode/without_skill/outputs/result.md +0 -211
  523. package/skills/sync-docs-workspace/iteration-2/eval-fix-mode/without_skill/run-1/grading.json +0 -91
  524. package/skills/sync-docs-workspace/iteration-2/eval-fix-mode/without_skill/run-1/timing.json +0 -5
  525. package/skills/sync-docs-workspace/iteration-2/eval-sprint-closeout/eval_metadata.json +0 -27
  526. package/skills/sync-docs-workspace/iteration-2/eval-sprint-closeout/with_skill/outputs/result.md +0 -182
  527. package/skills/sync-docs-workspace/iteration-2/eval-sprint-closeout/with_skill/run-1/grading.json +0 -95
  528. package/skills/sync-docs-workspace/iteration-2/eval-sprint-closeout/with_skill/run-1/timing.json +0 -1
  529. package/skills/sync-docs-workspace/iteration-2/eval-sprint-closeout/without_skill/outputs/result.md +0 -222
  530. package/skills/sync-docs-workspace/iteration-2/eval-sprint-closeout/without_skill/run-1/grading.json +0 -88
  531. package/skills/sync-docs-workspace/iteration-2/eval-sprint-closeout/without_skill/run-1/timing.json +0 -5
  532. package/skills/sync-docs-workspace/iteration-3/benchmark.json +0 -298
  533. package/skills/sync-docs-workspace/iteration-3/benchmark.md +0 -13
  534. package/skills/sync-docs-workspace/iteration-3/eval-doc-audit/eval_metadata.json +0 -27
  535. package/skills/sync-docs-workspace/iteration-3/eval-doc-audit/with_skill/outputs/result.md +0 -125
  536. package/skills/sync-docs-workspace/iteration-3/eval-doc-audit/with_skill/run-1/grading.json +0 -97
  537. package/skills/sync-docs-workspace/iteration-3/eval-doc-audit/with_skill/run-1/timing.json +0 -5
  538. package/skills/sync-docs-workspace/iteration-3/eval-doc-audit/without_skill/outputs/result.md +0 -144
  539. package/skills/sync-docs-workspace/iteration-3/eval-doc-audit/without_skill/run-1/grading.json +0 -78
  540. package/skills/sync-docs-workspace/iteration-3/eval-doc-audit/without_skill/run-1/timing.json +0 -5
  541. package/skills/sync-docs-workspace/iteration-3/eval-fix-mode/eval_metadata.json +0 -27
  542. package/skills/sync-docs-workspace/iteration-3/eval-fix-mode/with_skill/outputs/result.md +0 -104
  543. package/skills/sync-docs-workspace/iteration-3/eval-fix-mode/with_skill/run-1/grading.json +0 -91
  544. package/skills/sync-docs-workspace/iteration-3/eval-fix-mode/with_skill/run-1/timing.json +0 -5
  545. package/skills/sync-docs-workspace/iteration-3/eval-fix-mode/without_skill/outputs/result.md +0 -79
  546. package/skills/sync-docs-workspace/iteration-3/eval-fix-mode/without_skill/run-1/grading.json +0 -82
  547. package/skills/sync-docs-workspace/iteration-3/eval-fix-mode/without_skill/run-1/timing.json +0 -5
  548. package/skills/sync-docs-workspace/iteration-3/eval-sprint-closeout/eval_metadata.json +0 -27
  549. package/skills/sync-docs-workspace/iteration-3/eval-sprint-closeout/with_skill/outputs/phase1_context.json +0 -302
  550. package/skills/sync-docs-workspace/iteration-3/eval-sprint-closeout/with_skill/outputs/phase2_drift.txt +0 -33
  551. package/skills/sync-docs-workspace/iteration-3/eval-sprint-closeout/with_skill/outputs/phase3_analysis.json +0 -114
  552. package/skills/sync-docs-workspace/iteration-3/eval-sprint-closeout/with_skill/outputs/phase4_fix.txt +0 -118
  553. package/skills/sync-docs-workspace/iteration-3/eval-sprint-closeout/with_skill/outputs/phase5_validate.txt +0 -38
  554. package/skills/sync-docs-workspace/iteration-3/eval-sprint-closeout/with_skill/outputs/result.md +0 -158
  555. package/skills/sync-docs-workspace/iteration-3/eval-sprint-closeout/with_skill/run-1/grading.json +0 -95
  556. package/skills/sync-docs-workspace/iteration-3/eval-sprint-closeout/with_skill/run-1/timing.json +0 -5
  557. package/skills/sync-docs-workspace/iteration-3/eval-sprint-closeout/without_skill/outputs/result.md +0 -71
  558. package/skills/sync-docs-workspace/iteration-3/eval-sprint-closeout/without_skill/run-1/grading.json +0 -90
  559. package/skills/sync-docs-workspace/iteration-3/eval-sprint-closeout/without_skill/run-1/timing.json +0 -5
  560. package/skills/test-planning/SKILL.md +0 -465
  561. package/skills/test-planning/evals/evals.json +0 -23
  562. package/skills/updating-service-skills/SKILL.md +0 -136
  563. package/skills/updating-service-skills/scripts/drift_detector.py +0 -222
  564. package/skills/using-quality-gates/SKILL.md +0 -254
  565. package/skills/using-serena-lsp/README.md +0 -8
  566. package/skills/using-serena-lsp/REFERENCE.md +0 -194
  567. package/skills/using-serena-lsp/SKILL.md +0 -82
  568. package/skills/using-service-skills/SKILL.md +0 -108
  569. package/skills/using-service-skills/scripts/cataloger.py +0 -74
  570. package/skills/using-service-skills/scripts/skill_activator.py +0 -152
  571. package/skills/using-service-skills/scripts/test_skill_activator.py +0 -58
  572. package/skills/using-tdd/SKILL.md +0 -410
  573. package/skills/using-xtrm/SKILL.md +0 -127
  574. package/skills/xt-debugging/SKILL.md +0 -149
  575. package/skills/xt-end/SKILL.md +0 -297
  576. package/skills/xt-merge/SKILL.md +0 -313
  577. /package/{config → .xtrm/config}/.env.example +0 -0
  578. /package/{config/mcp_servers_optional.json → .xtrm/config/claude.mcp.optional.json} +0 -0
  579. /package/{hooks → .xtrm/config}/hooks.json +0 -0
  580. /package/{config → .xtrm/config}/pi/auth.json.template +0 -0
  581. /package/{config → .xtrm/config}/pi/extensions/auto-session-name/index.ts +0 -0
  582. /package/{config → .xtrm/config}/pi/extensions/auto-session-name/package.json +0 -0
  583. /package/{config → .xtrm/config}/pi/extensions/auto-update/index.ts +0 -0
  584. /package/{config → .xtrm/config}/pi/extensions/auto-update/package.json +0 -0
  585. /package/{config → .xtrm/config}/pi/extensions/beads/package.json +0 -0
  586. /package/{config → .xtrm/config}/pi/extensions/compact-header/index.ts +0 -0
  587. /package/{config → .xtrm/config}/pi/extensions/compact-header/package.json +0 -0
  588. /package/{config → .xtrm/config}/pi/extensions/core/adapter.ts +0 -0
  589. /package/{config → .xtrm/config}/pi/extensions/core/guard-rules.ts +0 -0
  590. /package/{config → .xtrm/config}/pi/extensions/core/lib.ts +0 -0
  591. /package/{config → .xtrm/config}/pi/extensions/core/logger.ts +0 -0
  592. /package/{config → .xtrm/config}/pi/extensions/core/package.json +0 -0
  593. /package/{config → .xtrm/config}/pi/extensions/core/runner.ts +0 -0
  594. /package/{config → .xtrm/config}/pi/extensions/core/session-state.ts +0 -0
  595. /package/{config → .xtrm/config}/pi/extensions/custom-footer/package.json +0 -0
  596. /package/{config → .xtrm/config}/pi/extensions/custom-provider-qwen-cli/index.ts +0 -0
  597. /package/{config → .xtrm/config}/pi/extensions/custom-provider-qwen-cli/package.json +0 -0
  598. /package/{config → .xtrm/config}/pi/extensions/git-checkpoint/index.ts +0 -0
  599. /package/{config → .xtrm/config}/pi/extensions/git-checkpoint/package.json +0 -0
  600. /package/{config → .xtrm/config}/pi/extensions/lsp-bootstrap/index.ts +0 -0
  601. /package/{config → .xtrm/config}/pi/extensions/lsp-bootstrap/package.json +0 -0
  602. /package/{config → .xtrm/config}/pi/extensions/pi-serena-compact/index.ts +0 -0
  603. /package/{config → .xtrm/config}/pi/extensions/pi-serena-compact/package.json +0 -0
  604. /package/{config → .xtrm/config}/pi/extensions/quality-gates/index.ts +0 -0
  605. /package/{config → .xtrm/config}/pi/extensions/quality-gates/package.json +0 -0
  606. /package/{config → .xtrm/config}/pi/extensions/service-skills/index.ts +0 -0
  607. /package/{config → .xtrm/config}/pi/extensions/service-skills/package.json +0 -0
  608. /package/{config → .xtrm/config}/pi/extensions/session-flow/index.ts +0 -0
  609. /package/{config → .xtrm/config}/pi/extensions/session-flow/package.json +0 -0
  610. /package/{config → .xtrm/config}/pi/extensions/xtrm-loader/index.ts +0 -0
  611. /package/{config → .xtrm/config}/pi/extensions/xtrm-loader/package.json +0 -0
  612. /package/{config → .xtrm/config}/pi/extensions/xtrm-ui/format.ts +0 -0
  613. /package/{config → .xtrm/config}/pi/extensions/xtrm-ui/package.json +0 -0
  614. /package/{config → .xtrm/config}/pi/extensions/xtrm-ui/themes/pidex-dark.json +0 -0
  615. /package/{config → .xtrm/config}/pi/extensions/xtrm-ui/themes/pidex-light.json +0 -0
  616. /package/{config → .xtrm/config}/pi/models.json.template +0 -0
  617. /package/{config → .xtrm/config}/pi/pi-worktrees-settings.json +0 -0
  618. /package/{config → .xtrm/config}/pi/settings.json.template +0 -0
  619. /package/{hooks → .xtrm/hooks}/beads-claim-sync.mjs +0 -0
  620. /package/{hooks → .xtrm/hooks}/beads-compact-restore.mjs +0 -0
  621. /package/{hooks → .xtrm/hooks}/beads-compact-save.mjs +0 -0
  622. /package/{hooks → .xtrm/hooks}/beads-edit-gate.mjs +0 -0
  623. /package/{hooks → .xtrm/hooks}/beads-gate-core.mjs +0 -0
  624. /package/{hooks → .xtrm/hooks}/beads-gate-messages.mjs +0 -0
  625. /package/{hooks → .xtrm/hooks}/beads-gate-utils.mjs +0 -0
  626. /package/{hooks → .xtrm/hooks}/beads-stop-gate.mjs +0 -0
  627. /package/{hooks → .xtrm/hooks}/gitnexus/gitnexus-hook.cjs +0 -0
  628. /package/{hooks → .xtrm/hooks}/quality-check.cjs +0 -0
  629. /package/{hooks → .xtrm/hooks}/quality-check.py +0 -0
  630. /package/{hooks → .xtrm/hooks}/worktree-boundary.mjs +0 -0
  631. /package/{hooks → .xtrm/hooks}/xtrm-logger.mjs +0 -0
  632. /package/{hooks → .xtrm/hooks}/xtrm-session-logger.mjs +0 -0
  633. /package/{hooks → .xtrm/hooks}/xtrm-tool-logger.mjs +0 -0
@@ -1,1286 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * Node.js Quality Check Hook
4
- * Optimized for Node.js TypeScript projects with sensible defaults
5
- *
6
- * EXIT CODES:
7
- * 0 - Success (all checks passed)
8
- * 1 - General error (missing dependencies, etc.)
9
- * 2 - Quality issues found - ALL must be fixed (blocking)
10
- */
11
-
12
- const fs = require('fs').promises;
13
- const path = require('path');
14
- const crypto = require('crypto');
15
-
16
- /**
17
- * Get project root using CLAUDE_PROJECT_DIR environment variable
18
- * @returns {string} Project root directory
19
- */
20
- function getProjectRoot() {
21
- return process.env.CLAUDE_PROJECT_DIR || process.cwd();
22
- }
23
-
24
- const projectRoot = getProjectRoot();
25
-
26
- /**
27
- * Intelligent TypeScript Config Cache with checksum validation
28
- * Handles multiple tsconfig files and maps files to appropriate configs
29
- */
30
- class TypeScriptConfigCache {
31
- /**
32
- * Creates a new TypeScript config cache instance.
33
- * Loads existing cache or initializes empty cache.
34
- */
35
- constructor() {
36
- // Store cache in the hook's directory for isolation
37
- this.cacheFile = path.join(__dirname, 'tsconfig-cache.json');
38
- this.cache = { hashes: {}, mappings: {} };
39
- this.loadCache();
40
- }
41
-
42
- /**
43
- * Get config hash for cache validation
44
- * @param {string} configPath - Path to tsconfig file
45
- * @returns {string} SHA256 hash of config content
46
- */
47
- getConfigHash(configPath) {
48
- try {
49
- const content = require('fs').readFileSync(configPath, 'utf8');
50
- return crypto.createHash('sha256').update(content).digest('hex');
51
- } catch (e) {
52
- return null;
53
- }
54
- }
55
-
56
- /**
57
- * Find all tsconfig files in project
58
- * @returns {string[]} Array of tsconfig file paths
59
- */
60
- findTsConfigFiles() {
61
- const configs = [];
62
- try {
63
- // Try to use glob if available, fallback to manual search
64
- const globSync = require('glob').sync;
65
- return globSync('tsconfig*.json', { cwd: projectRoot }).map((file) =>
66
- path.join(projectRoot, file),
67
- );
68
- } catch (e) {
69
- // Fallback: manually check common config files
70
- const commonConfigs = [
71
- 'tsconfig.json',
72
- 'tsconfig.webview.json',
73
- 'tsconfig.test.json',
74
- 'tsconfig.node.json',
75
- ];
76
-
77
- for (const config of commonConfigs) {
78
- const configPath = path.join(projectRoot, config);
79
- if (require('fs').existsSync(configPath)) {
80
- configs.push(configPath);
81
- }
82
- }
83
- return configs;
84
- }
85
- }
86
-
87
- /**
88
- * Check if cache is valid by comparing config hashes
89
- * @returns {boolean} True if cache is valid
90
- */
91
- isValid() {
92
- const configFiles = this.findTsConfigFiles();
93
-
94
- // Check if we have the same number of configs
95
- if (Object.keys(this.cache.hashes).length !== configFiles.length) {
96
- return false;
97
- }
98
-
99
- // Check each config hash
100
- for (const configPath of configFiles) {
101
- const currentHash = this.getConfigHash(configPath);
102
- if (currentHash !== this.cache.hashes[configPath]) {
103
- return false;
104
- }
105
- }
106
-
107
- return true;
108
- }
109
-
110
- /**
111
- * Rebuild cache by parsing all configs and creating file mappings
112
- */
113
- rebuild() {
114
- this.cache = { hashes: {}, mappings: {} };
115
-
116
- // Process configs in priority order (most specific first)
117
- const configPriority = [
118
- 'tsconfig.webview.json', // Most specific
119
- 'tsconfig.test.json', // Test-specific
120
- 'tsconfig.json', // Base config
121
- ];
122
-
123
- configPriority.forEach((configName) => {
124
- const configPath = path.join(projectRoot, configName);
125
- if (!require('fs').existsSync(configPath)) {
126
- return;
127
- }
128
-
129
- // Store hash for validation
130
- this.cache.hashes[configPath] = this.getConfigHash(configPath);
131
-
132
- try {
133
- const configContent = require('fs').readFileSync(configPath, 'utf8');
134
- const config = JSON.parse(configContent);
135
-
136
- // Build file pattern mappings
137
- if (config.include) {
138
- config.include.forEach((pattern) => {
139
- // Only set if not already mapped by a more specific config
140
- if (!this.cache.mappings[pattern]) {
141
- this.cache.mappings[pattern] = {
142
- configPath,
143
- excludes: config.exclude || [],
144
- };
145
- }
146
- });
147
- }
148
- } catch (e) {
149
- // Skip invalid configs
150
- }
151
- });
152
-
153
- this.saveCache();
154
- }
155
-
156
- /**
157
- * Load cache from disk
158
- */
159
- loadCache() {
160
- try {
161
- const cacheContent = require('fs').readFileSync(this.cacheFile, 'utf8');
162
- this.cache = JSON.parse(cacheContent);
163
- } catch (e) {
164
- // Cache doesn't exist or is invalid, will rebuild
165
- this.cache = { hashes: {}, mappings: {} };
166
- }
167
- }
168
-
169
- /**
170
- * Save cache to disk
171
- */
172
- saveCache() {
173
- try {
174
- // Save cache directly in hook directory (directory already exists)
175
- require('fs').writeFileSync(this.cacheFile, JSON.stringify(this.cache, null, 2));
176
- } catch (e) {
177
- // Ignore cache save errors
178
- }
179
- }
180
-
181
- /**
182
- * Get appropriate tsconfig for a file
183
- * @param {string} filePath - File path to check
184
- * @returns {string} Path to appropriate tsconfig file
185
- */
186
- getTsConfigForFile(filePath) {
187
- // Ensure cache is valid
188
- if (!this.isValid()) {
189
- this.rebuild();
190
- }
191
-
192
- const relativePath = path.relative(projectRoot, filePath);
193
-
194
- // Check cached mappings first - these are from actual tsconfig includes
195
- // Sort patterns by specificity to match most specific first
196
- const sortedMappings = Object.entries(this.cache.mappings).sort(([a], [b]) => {
197
- // More specific patterns first
198
- const aSpecificity = a.split('/').length + (a.includes('**') ? 0 : 10);
199
- const bSpecificity = b.split('/').length + (b.includes('**') ? 0 : 10);
200
- return bSpecificity - aSpecificity;
201
- });
202
-
203
- for (const [pattern, mapping] of sortedMappings) {
204
- // Handle both old format (string) and new format (object with excludes)
205
- const configPath = typeof mapping === 'string' ? mapping : mapping.configPath;
206
- const excludes = typeof mapping === 'string' ? [] : mapping.excludes;
207
-
208
- if (this.matchesPattern(relativePath, pattern)) {
209
- // Check if file is excluded
210
- let isExcluded = false;
211
- for (const exclude of excludes) {
212
- if (this.matchesPattern(relativePath, exclude)) {
213
- isExcluded = true;
214
- break;
215
- }
216
- }
217
-
218
- if (!isExcluded) {
219
- return configPath;
220
- }
221
- }
222
- }
223
-
224
- // Fast heuristics for common cases not in cache
225
- // Webview files
226
- if (relativePath.includes('src/webview/') || relativePath.includes('/webview/')) {
227
- const webviewConfig = path.join(projectRoot, 'tsconfig.webview.json');
228
- if (require('fs').existsSync(webviewConfig)) {
229
- return webviewConfig;
230
- }
231
- }
232
-
233
- // Test files
234
- if (
235
- relativePath.includes('/test/') ||
236
- relativePath.includes('.test.') ||
237
- relativePath.includes('.spec.')
238
- ) {
239
- const testConfig = path.join(projectRoot, 'tsconfig.test.json');
240
- if (require('fs').existsSync(testConfig)) {
241
- return testConfig;
242
- }
243
- }
244
-
245
- // Default fallback
246
- return path.join(projectRoot, 'tsconfig.json');
247
- }
248
-
249
- /**
250
- * Simple pattern matching for file paths
251
- * @param {string} filePath - File path to test
252
- * @param {string} pattern - Glob-like pattern
253
- * @returns {boolean} True if file matches pattern
254
- */
255
- matchesPattern(filePath, pattern) {
256
- // Simple pattern matching - convert glob to regex
257
- // Handle the common patterns specially
258
- if (pattern.endsWith('/**/*')) {
259
- // For patterns like src/webview/**/* or src/protocol/**/*
260
- // Match any file under that directory
261
- const baseDir = pattern.slice(0, -5); // Remove /**/*
262
- return filePath.startsWith(baseDir);
263
- }
264
-
265
- // For other patterns, use regex conversion
266
- let regexPattern = pattern
267
- .replace(/[.+^${}()|[\]\\]/g, '\\$&') // Escape regex special chars
268
- .replace(/\*\*/g, '🌟') // Temporary placeholder for **
269
- .replace(/\*/g, '[^/]*') // * matches anything except /
270
- .replace(/🌟/g, '.*') // ** matches anything including /
271
- .replace(/\?/g, '.'); // ? matches single character
272
-
273
- const regex = new RegExp(`^${regexPattern}$`);
274
- const result = regex.test(filePath);
275
-
276
- return result;
277
- }
278
- }
279
-
280
- // Global config cache instance
281
- const tsConfigCache = new TypeScriptConfigCache();
282
-
283
- // ANSI color codes
284
- const colors = {
285
- red: '\x1b[0;31m',
286
- green: '\x1b[0;32m',
287
- yellow: '\x1b[0;33m',
288
- blue: '\x1b[0;34m',
289
- cyan: '\x1b[0;36m',
290
- reset: '\x1b[0m',
291
- };
292
-
293
- /**
294
- * Load configuration from JSON file with environment variable overrides
295
- * @returns {Object} Configuration object
296
- */
297
- function loadConfig() {
298
- let fileConfig = {};
299
-
300
- // Try to load hook-config.json
301
- try {
302
- const configPath = path.join(__dirname, 'hook-config.json');
303
- if (require('fs').existsSync(configPath)) {
304
- fileConfig = JSON.parse(require('fs').readFileSync(configPath, 'utf8'));
305
- }
306
- } catch (e) {
307
- // Config file not found or invalid, use defaults
308
- }
309
-
310
- // Build config with file settings as base, env vars as overrides
311
- return {
312
- // TypeScript settings
313
- typescriptEnabled:
314
- process.env.CLAUDE_HOOKS_TYPESCRIPT_ENABLED !== undefined
315
- ? process.env.CLAUDE_HOOKS_TYPESCRIPT_ENABLED !== 'false'
316
- : (fileConfig.typescript?.enabled ?? true),
317
-
318
- showDependencyErrors:
319
- process.env.CLAUDE_HOOKS_SHOW_DEPENDENCY_ERRORS !== undefined
320
- ? process.env.CLAUDE_HOOKS_SHOW_DEPENDENCY_ERRORS === 'true'
321
- : (fileConfig.typescript?.showDependencyErrors ?? false),
322
-
323
- // ESLint settings
324
- eslintEnabled:
325
- process.env.CLAUDE_HOOKS_ESLINT_ENABLED !== undefined
326
- ? process.env.CLAUDE_HOOKS_ESLINT_ENABLED !== 'false'
327
- : (fileConfig.eslint?.enabled ?? true),
328
-
329
- eslintAutofix:
330
- process.env.CLAUDE_HOOKS_ESLINT_AUTOFIX !== undefined
331
- ? process.env.CLAUDE_HOOKS_ESLINT_AUTOFIX === 'true'
332
- : (fileConfig.eslint?.autofix ?? false),
333
-
334
- // Prettier settings
335
- prettierEnabled:
336
- process.env.CLAUDE_HOOKS_PRETTIER_ENABLED !== undefined
337
- ? process.env.CLAUDE_HOOKS_PRETTIER_ENABLED !== 'false'
338
- : (fileConfig.prettier?.enabled ?? true),
339
-
340
- prettierAutofix:
341
- process.env.CLAUDE_HOOKS_PRETTIER_AUTOFIX !== undefined
342
- ? process.env.CLAUDE_HOOKS_PRETTIER_AUTOFIX === 'true'
343
- : (fileConfig.prettier?.autofix ?? false),
344
-
345
- // General settings
346
- autofixSilent:
347
- process.env.CLAUDE_HOOKS_AUTOFIX_SILENT !== undefined
348
- ? process.env.CLAUDE_HOOKS_AUTOFIX_SILENT === 'true'
349
- : (fileConfig.general?.autofixSilent ?? false),
350
-
351
- debug:
352
- process.env.CLAUDE_HOOKS_DEBUG !== undefined
353
- ? process.env.CLAUDE_HOOKS_DEBUG === 'true'
354
- : (fileConfig.general?.debug ?? false),
355
-
356
- // Ignore patterns
357
- ignorePatterns: fileConfig.ignore?.patterns || [],
358
-
359
- // Store the full config for rule access
360
- _fileConfig: fileConfig,
361
- };
362
- }
363
-
364
- /**
365
- * Hook Configuration
366
- *
367
- * Configuration is loaded from (in order of precedence):
368
- * 1. Environment variables (highest priority)
369
- * 2. .claude/hooks/config.json file
370
- * 3. Built-in defaults
371
- */
372
- const config = loadConfig();
373
-
374
- // Logging functions - define before using
375
- const log = {
376
- info: (msg) => console.log(`${colors.blue}[INFO]${colors.reset} ${msg}`),
377
- error: (msg) => console.log(`${colors.red}[ERROR]${colors.reset} ${msg}`),
378
- success: (msg) => console.log(`${colors.green}[OK]${colors.reset} ${msg}`),
379
- warning: (msg) => console.log(`${colors.yellow}[WARN]${colors.reset} ${msg}`),
380
- debug: (msg) => {
381
- if (config.debug) {
382
- console.log(`${colors.cyan}[DEBUG]${colors.reset} ${msg}`);
383
- }
384
- },
385
- };
386
-
387
- // Note: errors and autofixes are tracked per QualityChecker instance
388
-
389
- // Try to load modules, but make them optional
390
- let ESLint, prettier, ts;
391
-
392
- try {
393
- ({ ESLint } = require(path.join(projectRoot, 'node_modules', 'eslint')));
394
- } catch (e) {
395
- log.debug('ESLint not found in project - will skip ESLint checks');
396
- }
397
-
398
- try {
399
- prettier = require(path.join(projectRoot, 'node_modules', 'prettier'));
400
- } catch (e) {
401
- log.debug('Prettier not found in project - will skip Prettier checks');
402
- }
403
-
404
- try {
405
- ts = require(path.join(projectRoot, 'node_modules', 'typescript'));
406
- } catch (e) {
407
- log.debug('TypeScript not found in project - will skip TypeScript checks');
408
- }
409
-
410
- /**
411
- * Quality checker for a single file.
412
- * Runs TypeScript, ESLint, and Prettier checks with optional auto-fixing.
413
- */
414
- class QualityChecker {
415
- /**
416
- * Creates a new QualityChecker instance.
417
- * @param {string} filePath - Path to file to check
418
- */
419
- constructor(filePath) {
420
- this.filePath = filePath;
421
- this.fileType = this.detectFileType(filePath);
422
- this.errors = [];
423
- this.autofixes = [];
424
- }
425
-
426
- /**
427
- * Detect file type from path
428
- * @param {string} filePath - File path
429
- * @returns {string} File type
430
- */
431
- detectFileType(filePath) {
432
- if (/\.(test|spec)\.(ts|tsx|js|jsx)$/.test(filePath)) {
433
- return 'test';
434
- }
435
- // MCP transport files
436
- if (/\/(client|server)\/(stdio|sse|websocket|http)/.test(filePath)) {
437
- return 'transport';
438
- }
439
- // CLI entry points
440
- if (/\/cli\/|\/bin\/|index\.(ts|js)$/.test(filePath)) {
441
- return 'cli';
442
- }
443
- // Services
444
- if (/\/services\//.test(filePath)) {
445
- return 'service';
446
- }
447
- if (/\.(ts|tsx)$/.test(filePath)) {
448
- return 'typescript';
449
- }
450
- if (/\.(js|jsx|cjs|mjs)$/.test(filePath)) {
451
- return 'javascript';
452
- }
453
- return 'unknown';
454
- }
455
-
456
- /**
457
- * Run all quality checks
458
- * @returns {Promise<{errors: string[], autofixes: string[]}>} Check results
459
- */
460
- async checkAll() {
461
- // This should never happen now since we filter out non-source files earlier,
462
- // but keeping for consistency with shell version
463
- if (this.fileType === 'unknown') {
464
- log.info('Unknown file type, skipping detailed checks');
465
- return { errors: [], autofixes: [] };
466
- }
467
-
468
- // Run all checks in parallel for speed
469
- const checkPromises = [];
470
-
471
- if (config.typescriptEnabled) {
472
- checkPromises.push(this.checkTypeScript());
473
- }
474
-
475
- if (config.eslintEnabled) {
476
- checkPromises.push(this.checkESLint());
477
- }
478
-
479
- if (config.prettierEnabled) {
480
- checkPromises.push(this.checkPrettier());
481
- }
482
-
483
- checkPromises.push(this.checkCommonIssues());
484
- checkPromises.push(this.checkNodePatterns());
485
-
486
- await Promise.all(checkPromises);
487
-
488
- // Check for related tests (not critical, so separate)
489
- await this.suggestRelatedTests();
490
-
491
- return {
492
- errors: this.errors,
493
- autofixes: this.autofixes,
494
- };
495
- }
496
-
497
- /**
498
- * Get file dependencies by parsing imports
499
- * @param {string} filePath - File to analyze
500
- * @returns {string[]} Array of file paths including dependencies
501
- */
502
- getFileDependencies(filePath) {
503
- const dependencies = new Set([filePath]);
504
-
505
- try {
506
- const content = require('fs').readFileSync(filePath, 'utf8');
507
- const importRegex = /import\s+.*?\s+from\s+['"]([^'"]+)['"]/g;
508
- let match;
509
-
510
- while ((match = importRegex.exec(content)) !== null) {
511
- const importPath = match[1];
512
-
513
- // Only include relative imports (project files)
514
- if (importPath.startsWith('.')) {
515
- const resolvedPath = this.resolveImportPath(filePath, importPath);
516
- if (resolvedPath && require('fs').existsSync(resolvedPath)) {
517
- dependencies.add(resolvedPath);
518
- }
519
- }
520
- }
521
- } catch (e) {
522
- // If we can't parse imports, just use the original file
523
- log.debug(`Could not parse imports for ${filePath}: ${e.message}`);
524
- }
525
-
526
- return Array.from(dependencies);
527
- }
528
-
529
- /**
530
- * Resolve relative import path to absolute path
531
- * @param {string} fromFile - File doing the import
532
- * @param {string} importPath - Relative import path
533
- * @returns {string|null} Absolute file path or null if not found
534
- */
535
- resolveImportPath(fromFile, importPath) {
536
- const dir = path.dirname(fromFile);
537
- const resolved = path.resolve(dir, importPath);
538
-
539
- // Try common extensions
540
- const extensions = ['.ts', '.tsx', '.js', '.jsx', '.cjs', '.mjs'];
541
- for (const ext of extensions) {
542
- const fullPath = resolved + ext;
543
- if (require('fs').existsSync(fullPath)) {
544
- return fullPath;
545
- }
546
- }
547
-
548
- // Try index files
549
- for (const ext of extensions) {
550
- const indexPath = path.join(resolved, 'index' + ext);
551
- if (require('fs').existsSync(indexPath)) {
552
- return indexPath;
553
- }
554
- }
555
-
556
- return null;
557
- }
558
-
559
- /**
560
- * Check TypeScript compilation
561
- * @returns {Promise<void>}
562
- */
563
- async checkTypeScript() {
564
- if (!config.typescriptEnabled || !ts) {
565
- return;
566
- }
567
-
568
- // Skip TypeScript checking for JavaScript/CJS/MJS files in hook directories
569
- if (/\.(js|cjs|mjs)$/.test(this.filePath) && this.filePath.includes('.claude/hooks/')) {
570
- log.debug('Skipping TypeScript check for JavaScript hook file');
571
- return;
572
- }
573
-
574
- log.info('Running TypeScript compilation check...');
575
-
576
- try {
577
- // Get intelligent config for this file
578
- const configPath = tsConfigCache.getTsConfigForFile(this.filePath);
579
-
580
- if (!require('fs').existsSync(configPath)) {
581
- log.debug(`No TypeScript config found: ${configPath}`);
582
- return;
583
- }
584
-
585
- log.debug(
586
- `Using TypeScript config: ${path.basename(configPath)} for ${path.relative(projectRoot, this.filePath)}`,
587
- );
588
-
589
- const configFile = ts.readConfigFile(configPath, ts.sys.readFile);
590
- const parsedConfig = ts.parseJsonConfigFileContent(
591
- configFile.config,
592
- ts.sys,
593
- path.dirname(configPath),
594
- );
595
-
596
- // Only check the edited file, not its dependencies
597
- // Dependencies will be type-checked with their own appropriate configs
598
- log.debug(`TypeScript checking edited file only`);
599
-
600
- // Create program with just the edited file
601
- const program = ts.createProgram([this.filePath], parsedConfig.options);
602
- const diagnostics = ts.getPreEmitDiagnostics(program);
603
-
604
- // Group diagnostics by file
605
- const diagnosticsByFile = new Map();
606
- diagnostics.forEach((d) => {
607
- if (d.file) {
608
- const fileName = d.file.fileName;
609
- if (!diagnosticsByFile.has(fileName)) {
610
- diagnosticsByFile.set(fileName, []);
611
- }
612
- diagnosticsByFile.get(fileName).push(d);
613
- }
614
- });
615
-
616
- // Report edited file first
617
- const editedFileDiagnostics = diagnosticsByFile.get(this.filePath) || [];
618
- if (editedFileDiagnostics.length > 0) {
619
- this.errors.push(`TypeScript errors in edited file (using ${path.basename(configPath)})`);
620
- editedFileDiagnostics.forEach((diagnostic) => {
621
- const message = ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n');
622
- const { line, character } = diagnostic.file.getLineAndCharacterOfPosition(
623
- diagnostic.start,
624
- );
625
- console.log(
626
- ` ❌ ${diagnostic.file.fileName}:${line + 1}:${character + 1} - ${message}`,
627
- );
628
- });
629
- }
630
-
631
- // Report dependencies separately (as warnings, not errors) - only if enabled
632
- if (config.showDependencyErrors) {
633
- let hasDepErrors = false;
634
- diagnosticsByFile.forEach((diags, fileName) => {
635
- if (fileName !== this.filePath) {
636
- if (!hasDepErrors) {
637
- console.log('\n[DEPENDENCY ERRORS] Files imported by your edited file:');
638
- hasDepErrors = true;
639
- }
640
- console.log(` ⚠️ ${fileName}:`);
641
- diags.forEach((diagnostic) => {
642
- const message = ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n');
643
- const { line, character } = diagnostic.file.getLineAndCharacterOfPosition(
644
- diagnostic.start,
645
- );
646
- console.log(` Line ${line + 1}:${character + 1} - ${message}`);
647
- });
648
- }
649
- });
650
- }
651
-
652
- if (diagnostics.length === 0) {
653
- log.success('TypeScript compilation passed');
654
- }
655
- } catch (error) {
656
- log.debug(`TypeScript check error: ${error.message}`);
657
- }
658
- }
659
-
660
- /**
661
- * Check ESLint rules
662
- * @returns {Promise<void>}
663
- */
664
- async checkESLint() {
665
- if (!config.eslintEnabled || !ESLint) {
666
- return;
667
- }
668
-
669
- log.info('Running ESLint...');
670
-
671
- try {
672
- const eslint = new ESLint({
673
- fix: config.eslintAutofix,
674
- cwd: projectRoot,
675
- });
676
-
677
- const results = await eslint.lintFiles([this.filePath]);
678
- const result = results[0];
679
-
680
- if (result.errorCount > 0 || result.warningCount > 0) {
681
- if (config.eslintAutofix) {
682
- log.warning('ESLint issues found, attempting auto-fix...');
683
-
684
- // Write the fixed output
685
- if (result.output) {
686
- await fs.writeFile(this.filePath, result.output);
687
-
688
- // Re-lint to see if issues remain
689
- const resultsAfterFix = await eslint.lintFiles([this.filePath]);
690
- const resultAfterFix = resultsAfterFix[0];
691
-
692
- if (resultAfterFix.errorCount === 0 && resultAfterFix.warningCount === 0) {
693
- log.success('ESLint auto-fixed all issues!');
694
- if (config.autofixSilent) {
695
- this.autofixes.push('ESLint auto-fixed formatting/style issues');
696
- } else {
697
- this.errors.push('ESLint issues were auto-fixed - verify the changes');
698
- }
699
- } else {
700
- this.errors.push(
701
- `ESLint found issues that couldn't be auto-fixed in ${this.filePath}`,
702
- );
703
- const formatter = await eslint.loadFormatter('stylish');
704
- const output = formatter.format(resultsAfterFix);
705
- console.log(output);
706
- }
707
- } else {
708
- this.errors.push(`ESLint found issues in ${this.filePath}`);
709
- const formatter = await eslint.loadFormatter('stylish');
710
- const output = formatter.format(results);
711
- console.log(output);
712
- }
713
- } else {
714
- this.errors.push(`ESLint found issues in ${this.filePath}`);
715
- const formatter = await eslint.loadFormatter('stylish');
716
- const output = formatter.format(results);
717
- console.log(output);
718
- }
719
- } else {
720
- log.success('ESLint passed');
721
- }
722
- } catch (error) {
723
- log.debug(`ESLint check error: ${error.message}`);
724
- }
725
- }
726
-
727
- /**
728
- * Check Prettier formatting
729
- * @returns {Promise<void>}
730
- */
731
- async checkPrettier() {
732
- if (!config.prettierEnabled || !prettier) {
733
- return;
734
- }
735
-
736
- log.info('Running Prettier check...');
737
-
738
- try {
739
- const fileContent = await fs.readFile(this.filePath, 'utf8');
740
- const prettierConfig = await prettier.resolveConfig(this.filePath);
741
-
742
- const isFormatted = await prettier.check(fileContent, {
743
- ...prettierConfig,
744
- filepath: this.filePath,
745
- });
746
-
747
- if (!isFormatted) {
748
- if (config.prettierAutofix) {
749
- log.warning('Prettier formatting issues found, auto-fixing...');
750
-
751
- const formatted = await prettier.format(fileContent, {
752
- ...prettierConfig,
753
- filepath: this.filePath,
754
- });
755
-
756
- await fs.writeFile(this.filePath, formatted);
757
- log.success('Prettier auto-formatted the file!');
758
-
759
- if (config.autofixSilent) {
760
- this.autofixes.push('Prettier auto-formatted the file');
761
- } else {
762
- this.errors.push('Prettier formatting was auto-fixed - verify the changes');
763
- }
764
- } else {
765
- this.errors.push(`Prettier formatting issues in ${this.filePath}`);
766
- console.log('Run prettier --write to fix');
767
- }
768
- } else {
769
- log.success('Prettier formatting correct');
770
- }
771
- } catch (error) {
772
- log.debug(`Prettier check error: ${error.message}`);
773
- }
774
- }
775
-
776
- /**
777
- * Check for common code issues
778
- * @returns {Promise<void>}
779
- */
780
- async checkCommonIssues() {
781
- log.info('Checking for common issues...');
782
-
783
- try {
784
- const content = await fs.readFile(this.filePath, 'utf8');
785
- const lines = content.split('\n');
786
- let foundIssues = false;
787
-
788
- // Check for 'as any' in TypeScript files
789
- const asAnyRule = config._fileConfig.rules?.asAny || {};
790
- if (
791
- (this.fileType === 'typescript' || this.fileType === 'component') &&
792
- asAnyRule.enabled !== false
793
- ) {
794
- lines.forEach((line, index) => {
795
- if (line.includes('as any')) {
796
- const severity = asAnyRule.severity || 'error';
797
- const message =
798
- asAnyRule.message || 'Prefer proper types or "as unknown" for type assertions';
799
-
800
- if (severity === 'error') {
801
- this.errors.push(`Found 'as any' usage in ${this.filePath} - ${message}`);
802
- console.log(` Line ${index + 1}: ${line.trim()}`);
803
- foundIssues = true;
804
- } else {
805
- // Warning level - just warn, don't block
806
- log.warning(`'as any' usage at line ${index + 1}: ${message}`);
807
- }
808
- }
809
- });
810
- }
811
-
812
- // Check for console statements based on React app rules
813
- const consoleRule = config._fileConfig.rules?.console || {};
814
- let allowConsole = false;
815
-
816
- // Check if console is allowed in this file
817
- if (consoleRule.enabled === false) {
818
- allowConsole = true;
819
- } else {
820
- // Check allowed paths
821
- const allowedPaths = consoleRule.allowIn?.paths || [];
822
- if (allowedPaths.some((path) => this.filePath.includes(path))) {
823
- allowConsole = true;
824
- }
825
-
826
- // Check allowed file types
827
- const allowedFileTypes = consoleRule.allowIn?.fileTypes || [];
828
- if (allowedFileTypes.includes(this.fileType)) {
829
- allowConsole = true;
830
- }
831
-
832
- // Check allowed patterns
833
- const allowedPatterns = consoleRule.allowIn?.patterns || [];
834
- const fileName = path.basename(this.filePath);
835
- if (
836
- allowedPatterns.some((pattern) => {
837
- const regex = new RegExp(pattern.replace(/\*/g, '.*'));
838
- return regex.test(fileName);
839
- })
840
- ) {
841
- allowConsole = true;
842
- }
843
- }
844
-
845
- // For React apps, console is generally allowed but shows as info
846
- if (!allowConsole && consoleRule.enabled !== false) {
847
- lines.forEach((line, index) => {
848
- if (/console\./.test(line)) {
849
- const severity = consoleRule.severity || 'info';
850
- const message = consoleRule.message || 'Consider using a logging library';
851
-
852
- if (severity === 'error') {
853
- this.errors.push(`Found console statements in ${this.filePath} - ${message}`);
854
- console.log(` Line ${index + 1}: ${line.trim()}`);
855
- foundIssues = true;
856
- } else {
857
- // Info level - just warn, don't block
858
- log.warning(`Console usage at line ${index + 1}: ${message}`);
859
- }
860
- }
861
- });
862
- }
863
-
864
- // Check for debugger statements
865
- const debuggerRule = config._fileConfig.rules?.debugger || {};
866
- if (debuggerRule.enabled !== false) {
867
- lines.forEach((line, index) => {
868
- if (/^\s*debugger\s*;/.test(line)) {
869
- const severity = debuggerRule.severity || 'error';
870
- const message =
871
- debuggerRule.message || 'Remove debugger statements before committing';
872
-
873
- if (severity === 'error') {
874
- this.errors.push(`Found debugger statement in ${this.filePath} - ${message}`);
875
- console.log(` Line ${index + 1}: ${line.trim()}`);
876
- foundIssues = true;
877
- } else {
878
- log.warning(`Debugger statement at line ${index + 1}: ${message}`);
879
- }
880
- }
881
- });
882
- }
883
-
884
- // Check for TODO/FIXME comments
885
- lines.forEach((line, index) => {
886
- if (/TODO|FIXME/.test(line)) {
887
- log.warning(`Found TODO/FIXME comment at line ${index + 1}`);
888
- }
889
- });
890
-
891
- if (!foundIssues) {
892
- log.success('No common issues found');
893
- }
894
- } catch (error) {
895
- log.debug(`Common issues check error: ${error.message}`);
896
- }
897
- }
898
-
899
- /**
900
- * Check for Node.js specific patterns and issues
901
- * @returns {Promise<void>}
902
- */
903
- async checkNodePatterns() {
904
- // Only check TypeScript/JavaScript files
905
- if (this.fileType === 'unknown') {
906
- return;
907
- }
908
-
909
- log.info('Checking Node.js specific patterns...');
910
-
911
- try {
912
- const content = await fs.readFile(this.filePath, 'utf8');
913
- let foundIssues = false;
914
-
915
- // Check for unhandled process.exit()
916
- if (/process\.exit\([^)]*\)/.test(content)) {
917
- // Check if there are cleanup handlers
918
- if (
919
- !/process\.on\(['"]exit['"]/.test(content) &&
920
- !/process\.on\(['"]SIGINT['"]/.test(content) &&
921
- !/process\.on\(['"]SIGTERM['"]/.test(content)
922
- ) {
923
- log.warning(
924
- 'Found process.exit() without cleanup handlers - consider adding signal handlers',
925
- );
926
- foundIssues = true;
927
- }
928
- }
929
-
930
- // Check for spawn/exec without error handling
931
- if (/spawn\(|exec\(|execFile\(|fork\(/.test(content)) {
932
- // Look for .on('error') in the same file
933
- if (!/.on\(['"]error['"]/.test(content)) {
934
- log.warning('Child process spawned without error handling - add .on("error") handler');
935
- foundIssues = true;
936
- }
937
- }
938
-
939
- // Check for stream pipes without error handling
940
- if (/\.pipe\(/.test(content)) {
941
- // Count pipes and error handlers
942
- const pipeCount = (content.match(/\.pipe\(/g) || []).length;
943
- const errorHandlerCount = (content.match(/\.on\(['"]error['"]/g) || []).length;
944
-
945
- if (pipeCount > 0 && errorHandlerCount < pipeCount) {
946
- log.warning('Stream pipe without error handling - each pipe should have error handlers');
947
- foundIssues = true;
948
- }
949
- }
950
-
951
- // Check for unhandled promise rejections in main/cli files
952
- if (this.fileType === 'cli' || /index\.(ts|js)$/.test(this.filePath)) {
953
- if (
954
- /new Promise|async|await/.test(content) &&
955
- !/process\.on\(['"]unhandledRejection['"]/.test(content)
956
- ) {
957
- log.warning('Consider adding process.on("unhandledRejection") handler for CLI apps');
958
- }
959
- }
960
-
961
- // MCP transport-specific checks
962
- if (/\/(client|server)\/(stdio|sse|websocket|http)/.test(this.filePath)) {
963
- if (!content.includes('try') && !content.includes('.catch')) {
964
- log.warning('Transport implementation should have error handling (try/catch or .catch)');
965
- foundIssues = true;
966
- }
967
- }
968
-
969
- if (!foundIssues) {
970
- log.success('Node.js patterns look good');
971
- }
972
- } catch (error) {
973
- log.debug(`Node.js patterns check error: ${error.message}`);
974
- }
975
- }
976
-
977
- /**
978
- * Suggest related test files
979
- * @returns {Promise<void>}
980
- */
981
- async suggestRelatedTests() {
982
- // Skip for test files
983
- if (this.fileType === 'test') {
984
- return;
985
- }
986
-
987
- const baseName = this.filePath.replace(/\.[^.]+$/, '');
988
- const testExtensions = ['test.ts', 'test.tsx', 'spec.ts', 'spec.tsx'];
989
- let hasTests = false;
990
-
991
- for (const ext of testExtensions) {
992
- try {
993
- await fs.access(`${baseName}.${ext}`);
994
- hasTests = true;
995
- log.warning(`💡 Related test found: ${path.basename(baseName)}.${ext}`);
996
- log.warning(' Consider running the tests to ensure nothing broke');
997
- break;
998
- } catch {
999
- // File doesn't exist, continue
1000
- }
1001
- }
1002
-
1003
- if (!hasTests) {
1004
- // Check __tests__ directory
1005
- const dir = path.dirname(this.filePath);
1006
- const fileName = path.basename(this.filePath);
1007
- const baseFileName = fileName.replace(/\.[^.]+$/, '');
1008
-
1009
- for (const ext of testExtensions) {
1010
- try {
1011
- await fs.access(path.join(dir, '__tests__', `${baseFileName}.${ext}`));
1012
- hasTests = true;
1013
- log.warning(`💡 Related test found: __tests__/${baseFileName}.${ext}`);
1014
- log.warning(' Consider running the tests to ensure nothing broke');
1015
- break;
1016
- } catch {
1017
- // File doesn't exist, continue
1018
- }
1019
- }
1020
- }
1021
-
1022
- if (!hasTests) {
1023
- log.warning(`💡 No test file found for ${path.basename(this.filePath)}`);
1024
- log.warning(' Consider adding tests for better code quality');
1025
- }
1026
-
1027
- // Special reminders for specific file types
1028
- if (/\/services\//.test(this.filePath)) {
1029
- log.warning('💡 Service file! Consider testing business logic');
1030
- } else if (/\/(client|server)\//.test(this.filePath)) {
1031
- log.warning('💡 Transport file! Consider testing connection handling');
1032
- }
1033
- }
1034
- }
1035
-
1036
- /**
1037
- * Parse JSON input from stdin
1038
- * @returns {Promise<Object>} Parsed JSON object
1039
- */
1040
- async function parseJsonInput() {
1041
- let inputData = '';
1042
-
1043
- // Read from stdin
1044
- for await (const chunk of process.stdin) {
1045
- inputData += chunk;
1046
- }
1047
-
1048
- if (!inputData.trim()) {
1049
- log.warning('No JSON input provided. This hook expects JSON input from Claude Code.');
1050
- log.info(
1051
- 'For testing, provide JSON like: echo \'{"tool_name":"Edit","tool_input":{"file_path":"/path/to/file.ts"}}\' | node hook.js',
1052
- );
1053
- console.log(`\n${colors.yellow}👉 Hook executed but no input to process.${colors.reset}`);
1054
- process.exit(0);
1055
- }
1056
-
1057
- try {
1058
- return JSON.parse(inputData);
1059
- } catch (error) {
1060
- log.error(`Failed to parse JSON input: ${error.message}`);
1061
- log.debug(`Input was: ${inputData}`);
1062
- process.exit(1);
1063
- }
1064
- }
1065
-
1066
- /**
1067
- * Extract file path from tool input
1068
- * @param {Object} input - Tool input object
1069
- * @returns {string|null} File path or null
1070
- */
1071
- function extractFilePath(input) {
1072
- const { tool_input } = input;
1073
- if (!tool_input) {
1074
- return null;
1075
- }
1076
-
1077
- const filePath =
1078
- tool_input.file_path ||
1079
- tool_input.path ||
1080
- tool_input.notebook_path ||
1081
- tool_input.relative_path ||
1082
- null;
1083
- if (!filePath) {
1084
- return null;
1085
- }
1086
-
1087
- if (path.isAbsolute(filePath)) {
1088
- return filePath;
1089
- }
1090
-
1091
- return path.join(projectRoot, filePath);
1092
- }
1093
-
1094
- /**
1095
- * Check if file exists
1096
- * @param {string} filePath - Path to check
1097
- * @returns {Promise<boolean>} True if exists
1098
- */
1099
- async function fileExists(filePath) {
1100
- try {
1101
- await fs.access(filePath);
1102
- return true;
1103
- } catch {
1104
- return false;
1105
- }
1106
- }
1107
-
1108
- /**
1109
- * Check if file is a source file
1110
- * @param {string} filePath - Path to check
1111
- * @returns {boolean} True if source file
1112
- */
1113
- function isSourceFile(filePath) {
1114
- return /\.(ts|tsx|js|jsx|cjs|mjs)$/.test(filePath);
1115
- }
1116
-
1117
- /**
1118
- * Print summary of errors and autofixes
1119
- * @param {string[]} errors - List of errors
1120
- * @param {string[]} autofixes - List of autofixes
1121
- */
1122
- function printSummary(errors, autofixes) {
1123
- // Show auto-fixes if any
1124
- if (autofixes.length > 0) {
1125
- console.log(`\n${colors.blue}═══ Auto-fixes Applied ═══${colors.reset}`);
1126
- autofixes.forEach((fix) => {
1127
- console.log(`${colors.green}✨${colors.reset} ${fix}`);
1128
- });
1129
- console.log(
1130
- `${colors.green}Automatically fixed ${autofixes.length} issue(s) for you!${colors.reset}`,
1131
- );
1132
- }
1133
-
1134
- // Show errors if any
1135
- if (errors.length > 0) {
1136
- console.log(`\n${colors.blue}═══ Quality Check Summary ═══${colors.reset}`);
1137
- errors.forEach((error) => {
1138
- console.log(`${colors.red}❌${colors.reset} ${error}`);
1139
- });
1140
-
1141
- console.log(
1142
- `\n${colors.red}Found ${errors.length} issue(s) that MUST be fixed!${colors.reset}`,
1143
- );
1144
- console.log(`${colors.red}════════════════════════════════════════════${colors.reset}`);
1145
- console.log(`${colors.red}❌ ALL ISSUES ARE BLOCKING ❌${colors.reset}`);
1146
- console.log(`${colors.red}════════════════════════════════════════════${colors.reset}`);
1147
- console.log(`${colors.red}Fix EVERYTHING above until all checks are ✅ GREEN${colors.reset}`);
1148
- }
1149
- }
1150
-
1151
- /**
1152
- * Main entry point
1153
- * @returns {Promise<void>}
1154
- */
1155
- async function main() {
1156
- // Show header with version
1157
- const hookVersion = config._fileConfig.version || '1.0.0';
1158
- console.log('');
1159
- console.log(`📦 Node.js Quality Check v${hookVersion} - Starting...`);
1160
- console.log('────────────────────────────────────────────');
1161
-
1162
- // Debug: show loaded configuration
1163
- log.debug(`Loaded config: ${JSON.stringify(config, null, 2)}`);
1164
-
1165
- // Parse input
1166
- const input = await parseJsonInput();
1167
- const filePath = extractFilePath(input);
1168
-
1169
- if (!filePath) {
1170
- log.warning('No file path found in JSON input. Tool might not be file-related.');
1171
- log.debug(`JSON input was: ${JSON.stringify(input)}`);
1172
- console.log(
1173
- `\n${colors.yellow}👉 No file to check - tool may not be file-related.${colors.reset}`,
1174
- );
1175
- process.exit(0);
1176
- }
1177
-
1178
- // Check if file exists
1179
- if (!(await fileExists(filePath))) {
1180
- log.info(`File does not exist: ${filePath} (may have been deleted)`);
1181
- console.log(`\n${colors.yellow}👉 File skipped - doesn't exist.${colors.reset}`);
1182
- process.exit(0);
1183
- }
1184
-
1185
- // For non-source files, exit successfully without checks (matching shell behavior)
1186
- if (!isSourceFile(filePath)) {
1187
- log.info(`Skipping non-source file: ${filePath}`);
1188
- console.log(`\n${colors.yellow}👉 File skipped - not a source file.${colors.reset}`);
1189
- console.log(
1190
- `\n${colors.green}✅ No checks needed for ${path.basename(filePath)}${colors.reset}`,
1191
- );
1192
- process.exit(0);
1193
- }
1194
-
1195
- // Update header with file name
1196
- console.log('');
1197
- console.log(`🔍 Validating: ${path.basename(filePath)}`);
1198
- console.log('────────────────────────────────────────────');
1199
- log.info(`Checking: ${filePath}`);
1200
-
1201
- // Run quality checks
1202
- const checker = new QualityChecker(filePath);
1203
- const { errors, autofixes } = await checker.checkAll();
1204
-
1205
- // Print summary
1206
- printSummary(errors, autofixes);
1207
-
1208
- // Separate edited file errors from other issues
1209
- const editedFileErrors = errors.filter(
1210
- (e) =>
1211
- e.includes('edited file') ||
1212
- e.includes('ESLint found issues') ||
1213
- e.includes('Prettier formatting issues') ||
1214
- e.includes('console statements') ||
1215
- e.includes('debugger statement') ||
1216
- e.includes("'as any' usage") ||
1217
- e.includes('were auto-fixed'),
1218
- );
1219
-
1220
- const dependencyWarnings = errors.filter((e) => !editedFileErrors.includes(e));
1221
-
1222
- // Exit with appropriate code
1223
- if (editedFileErrors.length > 0) {
1224
- // Critical - blocks immediately
1225
- console.log(`\n${colors.red}🛑 FAILED - Fix issues in your edited file! 🛑${colors.reset}`);
1226
- console.log(`${colors.cyan}💡 CLAUDE.md CHECK:${colors.reset}`);
1227
- console.log(
1228
- `${colors.cyan} → What CLAUDE.md pattern would have prevented this?${colors.reset}`,
1229
- );
1230
- console.log(`${colors.cyan} → Are you following JSDoc batching strategy?${colors.reset}`);
1231
- console.log(`${colors.yellow}📋 NEXT STEPS:${colors.reset}`);
1232
- console.log(`${colors.yellow} 1. Fix the issues listed above${colors.reset}`);
1233
- console.log(`${colors.yellow} 2. The hook will run again automatically${colors.reset}`);
1234
- console.log(
1235
- `${colors.yellow} 3. Continue with your original task once all checks pass${colors.reset}`,
1236
- );
1237
- process.exit(2);
1238
- } else if (dependencyWarnings.length > 0) {
1239
- // Warning - shows but doesn't block
1240
- console.log(`\n${colors.yellow}⚠️ WARNING - Dependency issues found${colors.reset}`);
1241
- console.log(
1242
- `${colors.yellow}These won't block your progress but should be addressed${colors.reset}`,
1243
- );
1244
- console.log(
1245
- `\n${colors.green}✅ Quality check passed for ${path.basename(filePath)}${colors.reset}`,
1246
- );
1247
-
1248
- if (autofixes.length > 0 && config.autofixSilent) {
1249
- console.log(
1250
- `\n${colors.yellow}👉 File quality verified. Auto-fixes applied. Continue with your task.${colors.reset}`,
1251
- );
1252
- } else {
1253
- console.log(
1254
- `\n${colors.yellow}👉 File quality verified. Continue with your task.${colors.reset}`,
1255
- );
1256
- }
1257
- process.exit(0); // Don't block on dependency issues
1258
- } else {
1259
- console.log(
1260
- `\n${colors.green}✅ Quality check passed for ${path.basename(filePath)}${colors.reset}`,
1261
- );
1262
-
1263
- if (autofixes.length > 0 && config.autofixSilent) {
1264
- console.log(
1265
- `\n${colors.yellow}👉 File quality verified. Auto-fixes applied. Continue with your task.${colors.reset}`,
1266
- );
1267
- } else {
1268
- console.log(
1269
- `\n${colors.yellow}👉 File quality verified. Continue with your task.${colors.reset}`,
1270
- );
1271
- }
1272
- process.exit(0);
1273
- }
1274
- }
1275
-
1276
- // Handle errors
1277
- process.on('unhandledRejection', (error) => {
1278
- log.error(`Unhandled error: ${error.message}`);
1279
- process.exit(1);
1280
- });
1281
-
1282
- // Run main
1283
- main().catch((error) => {
1284
- log.error(`Fatal error: ${error.message}`);
1285
- process.exit(1);
1286
- });