xtrm-tools 0.5.24 → 0.5.26

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 (261) hide show
  1. package/.claude-plugin/marketplace.json +19 -0
  2. package/.claude-plugin/plugin.json +9 -0
  3. package/README.md +9 -3
  4. package/cli/dist/index.cjs +182 -219
  5. package/cli/dist/index.cjs.map +1 -1
  6. package/cli/package.json +1 -1
  7. package/config/hooks.json +8 -0
  8. package/hooks/beads-claim-sync.mjs +2 -4
  9. package/hooks/beads-commit-gate.mjs +2 -2
  10. package/hooks/beads-edit-gate.mjs +3 -3
  11. package/hooks/beads-memory-gate.mjs +2 -2
  12. package/hooks/beads-stop-gate.mjs +2 -2
  13. package/hooks/xtrm-logger.mjs +84 -91
  14. package/hooks/xtrm-session-logger.mjs +27 -0
  15. package/hooks/xtrm-tool-logger.mjs +53 -0
  16. package/package.json +5 -1
  17. package/plugins/xtrm-tools/.claude-plugin/plugin.json +9 -0
  18. package/plugins/xtrm-tools/.mcp.json +18 -0
  19. package/plugins/xtrm-tools/hooks/README.md +61 -0
  20. package/plugins/xtrm-tools/hooks/beads-claim-sync.mjs +223 -0
  21. package/plugins/xtrm-tools/hooks/beads-commit-gate.mjs +70 -0
  22. package/plugins/xtrm-tools/hooks/beads-compact-restore.mjs +69 -0
  23. package/plugins/xtrm-tools/hooks/beads-compact-save.mjs +51 -0
  24. package/plugins/xtrm-tools/hooks/beads-edit-gate.mjs +85 -0
  25. package/plugins/xtrm-tools/hooks/beads-gate-core.mjs +236 -0
  26. package/plugins/xtrm-tools/hooks/beads-gate-messages.mjs +68 -0
  27. package/plugins/xtrm-tools/hooks/beads-gate-utils.mjs +194 -0
  28. package/plugins/xtrm-tools/hooks/beads-memory-gate.mjs +81 -0
  29. package/plugins/xtrm-tools/hooks/beads-stop-gate.mjs +53 -0
  30. package/plugins/xtrm-tools/hooks/gitnexus/gitnexus-hook.cjs +222 -0
  31. package/plugins/xtrm-tools/hooks/hooks.json +115 -0
  32. package/plugins/xtrm-tools/hooks/quality-check-env.mjs +79 -0
  33. package/plugins/xtrm-tools/hooks/quality-check.cjs +1286 -0
  34. package/plugins/xtrm-tools/hooks/quality-check.py +345 -0
  35. package/plugins/xtrm-tools/hooks/statusline.mjs +145 -0
  36. package/plugins/xtrm-tools/hooks/using-xtrm-reminder.mjs +35 -0
  37. package/plugins/xtrm-tools/hooks/worktree-boundary.mjs +33 -0
  38. package/plugins/xtrm-tools/hooks/xtrm-logger.mjs +123 -0
  39. package/plugins/xtrm-tools/hooks/xtrm-session-logger.mjs +27 -0
  40. package/plugins/xtrm-tools/hooks/xtrm-tool-logger.mjs +53 -0
  41. package/plugins/xtrm-tools/skills/README.txt +31 -0
  42. package/plugins/xtrm-tools/skills/clean-code/SKILL.md +201 -0
  43. package/plugins/xtrm-tools/skills/creating-service-skills/SKILL.md +433 -0
  44. package/plugins/xtrm-tools/skills/creating-service-skills/references/script_quality_standards.md +425 -0
  45. package/plugins/xtrm-tools/skills/creating-service-skills/references/service_skill_system_guide.md +278 -0
  46. package/plugins/xtrm-tools/skills/creating-service-skills/scripts/bootstrap.py +326 -0
  47. package/plugins/xtrm-tools/skills/creating-service-skills/scripts/deep_dive.py +304 -0
  48. package/plugins/xtrm-tools/skills/creating-service-skills/scripts/scaffolder.py +482 -0
  49. package/plugins/xtrm-tools/skills/delegating/SKILL.md +196 -0
  50. package/plugins/xtrm-tools/skills/delegating/config.yaml +210 -0
  51. package/plugins/xtrm-tools/skills/delegating/references/orchestration-protocols.md +41 -0
  52. package/plugins/xtrm-tools/skills/docker-expert/SKILL.md +409 -0
  53. package/plugins/xtrm-tools/skills/documenting/CHANGELOG.md +23 -0
  54. package/plugins/xtrm-tools/skills/documenting/README.md +148 -0
  55. package/plugins/xtrm-tools/skills/documenting/SKILL.md +113 -0
  56. package/plugins/xtrm-tools/skills/documenting/examples/example_pattern.md +70 -0
  57. package/plugins/xtrm-tools/skills/documenting/examples/example_reference.md +70 -0
  58. package/plugins/xtrm-tools/skills/documenting/examples/example_ssot_analytics.md +64 -0
  59. package/plugins/xtrm-tools/skills/documenting/examples/example_workflow.md +141 -0
  60. package/plugins/xtrm-tools/skills/documenting/references/changelog-format.md +97 -0
  61. package/plugins/xtrm-tools/skills/documenting/references/metadata-schema.md +136 -0
  62. package/plugins/xtrm-tools/skills/documenting/references/taxonomy.md +81 -0
  63. package/plugins/xtrm-tools/skills/documenting/references/versioning-rules.md +78 -0
  64. package/plugins/xtrm-tools/skills/documenting/scripts/bump_version.sh +60 -0
  65. package/plugins/xtrm-tools/skills/documenting/scripts/changelog/__init__.py +0 -0
  66. package/plugins/xtrm-tools/skills/documenting/scripts/changelog/add_entry.py +216 -0
  67. package/plugins/xtrm-tools/skills/documenting/scripts/changelog/bump_release.py +117 -0
  68. package/plugins/xtrm-tools/skills/documenting/scripts/changelog/init_changelog.py +54 -0
  69. package/plugins/xtrm-tools/skills/documenting/scripts/changelog/validate_changelog.py +128 -0
  70. package/plugins/xtrm-tools/skills/documenting/scripts/drift_detector.py +266 -0
  71. package/plugins/xtrm-tools/skills/documenting/scripts/generate_template.py +311 -0
  72. package/plugins/xtrm-tools/skills/documenting/scripts/list_by_category.sh +84 -0
  73. package/plugins/xtrm-tools/skills/documenting/scripts/orchestrator.py +255 -0
  74. package/plugins/xtrm-tools/skills/documenting/scripts/validate_metadata.py +242 -0
  75. package/plugins/xtrm-tools/skills/documenting/templates/CHANGELOG.md.template +13 -0
  76. package/plugins/xtrm-tools/skills/documenting/tests/integration_test.sh +70 -0
  77. package/plugins/xtrm-tools/skills/documenting/tests/test_changelog.py +201 -0
  78. package/plugins/xtrm-tools/skills/documenting/tests/test_drift_detector.py +80 -0
  79. package/plugins/xtrm-tools/skills/documenting/tests/test_orchestrator.py +52 -0
  80. package/plugins/xtrm-tools/skills/documenting/tests/test_validate_metadata.py +64 -0
  81. package/plugins/xtrm-tools/skills/find-skills/SKILL.md +133 -0
  82. package/plugins/xtrm-tools/skills/gitnexus-debugging/SKILL.md +85 -0
  83. package/plugins/xtrm-tools/skills/gitnexus-exploring/SKILL.md +75 -0
  84. package/plugins/xtrm-tools/skills/gitnexus-impact-analysis/SKILL.md +94 -0
  85. package/plugins/xtrm-tools/skills/gitnexus-refactoring/SKILL.md +113 -0
  86. package/plugins/xtrm-tools/skills/hook-development/SKILL.md +797 -0
  87. package/plugins/xtrm-tools/skills/hook-development/examples/load-context.sh +55 -0
  88. package/plugins/xtrm-tools/skills/hook-development/examples/quality-check.js +1168 -0
  89. package/plugins/xtrm-tools/skills/hook-development/examples/validate-bash.sh +43 -0
  90. package/plugins/xtrm-tools/skills/hook-development/examples/validate-write.sh +38 -0
  91. package/plugins/xtrm-tools/skills/hook-development/references/advanced.md +527 -0
  92. package/plugins/xtrm-tools/skills/hook-development/references/migration.md +369 -0
  93. package/plugins/xtrm-tools/skills/hook-development/references/patterns.md +412 -0
  94. package/plugins/xtrm-tools/skills/hook-development/scripts/README.md +164 -0
  95. package/plugins/xtrm-tools/skills/hook-development/scripts/hook-linter.sh +153 -0
  96. package/plugins/xtrm-tools/skills/hook-development/scripts/test-hook.sh +252 -0
  97. package/plugins/xtrm-tools/skills/hook-development/scripts/validate-hook-schema.sh +159 -0
  98. package/plugins/xtrm-tools/skills/obsidian-cli/SKILL.md +106 -0
  99. package/plugins/xtrm-tools/skills/orchestrating-agents/SKILL.md +135 -0
  100. package/plugins/xtrm-tools/skills/orchestrating-agents/config.yaml +45 -0
  101. package/plugins/xtrm-tools/skills/orchestrating-agents/references/agent-context-integration.md +37 -0
  102. package/plugins/xtrm-tools/skills/orchestrating-agents/references/examples.md +45 -0
  103. package/plugins/xtrm-tools/skills/orchestrating-agents/references/handover-protocol.md +31 -0
  104. package/plugins/xtrm-tools/skills/orchestrating-agents/references/workflows.md +42 -0
  105. package/plugins/xtrm-tools/skills/orchestrating-agents/scripts/detect_neighbors.py +23 -0
  106. package/plugins/xtrm-tools/skills/prompt-improving/README.md +162 -0
  107. package/plugins/xtrm-tools/skills/prompt-improving/SKILL.md +74 -0
  108. package/plugins/xtrm-tools/skills/prompt-improving/references/analysis_commands.md +24 -0
  109. package/plugins/xtrm-tools/skills/prompt-improving/references/chain_of_thought.md +24 -0
  110. package/plugins/xtrm-tools/skills/prompt-improving/references/mcp_definitions.md +20 -0
  111. package/plugins/xtrm-tools/skills/prompt-improving/references/multishot.md +23 -0
  112. package/plugins/xtrm-tools/skills/prompt-improving/references/xml_core.md +60 -0
  113. package/plugins/xtrm-tools/skills/python-testing/SKILL.md +815 -0
  114. package/plugins/xtrm-tools/skills/scoping-service-skills/SKILL.md +231 -0
  115. package/plugins/xtrm-tools/skills/scoping-service-skills/scripts/scope.py +74 -0
  116. package/plugins/xtrm-tools/skills/senior-backend/SKILL.md +209 -0
  117. package/plugins/xtrm-tools/skills/senior-backend/references/api_design_patterns.md +103 -0
  118. package/plugins/xtrm-tools/skills/senior-backend/references/backend_security_practices.md +103 -0
  119. package/plugins/xtrm-tools/skills/senior-backend/references/database_optimization_guide.md +103 -0
  120. package/plugins/xtrm-tools/skills/senior-backend/scripts/api_load_tester.py +114 -0
  121. package/plugins/xtrm-tools/skills/senior-backend/scripts/api_scaffolder.py +114 -0
  122. package/plugins/xtrm-tools/skills/senior-backend/scripts/database_migration_tool.py +114 -0
  123. package/plugins/xtrm-tools/skills/senior-data-scientist/SKILL.md +226 -0
  124. package/plugins/xtrm-tools/skills/senior-data-scientist/references/experiment_design_frameworks.md +80 -0
  125. package/plugins/xtrm-tools/skills/senior-data-scientist/references/feature_engineering_patterns.md +80 -0
  126. package/plugins/xtrm-tools/skills/senior-data-scientist/references/statistical_methods_advanced.md +80 -0
  127. package/plugins/xtrm-tools/skills/senior-data-scientist/scripts/experiment_designer.py +100 -0
  128. package/plugins/xtrm-tools/skills/senior-data-scientist/scripts/feature_engineering_pipeline.py +100 -0
  129. package/plugins/xtrm-tools/skills/senior-data-scientist/scripts/model_evaluation_suite.py +100 -0
  130. package/plugins/xtrm-tools/skills/senior-devops/SKILL.md +209 -0
  131. package/plugins/xtrm-tools/skills/senior-devops/references/cicd_pipeline_guide.md +103 -0
  132. package/plugins/xtrm-tools/skills/senior-devops/references/deployment_strategies.md +103 -0
  133. package/plugins/xtrm-tools/skills/senior-devops/references/infrastructure_as_code.md +103 -0
  134. package/plugins/xtrm-tools/skills/senior-devops/scripts/deployment_manager.py +114 -0
  135. package/plugins/xtrm-tools/skills/senior-devops/scripts/pipeline_generator.py +114 -0
  136. package/plugins/xtrm-tools/skills/senior-devops/scripts/terraform_scaffolder.py +114 -0
  137. package/plugins/xtrm-tools/skills/senior-security/SKILL.md +209 -0
  138. package/plugins/xtrm-tools/skills/senior-security/references/cryptography_implementation.md +103 -0
  139. package/plugins/xtrm-tools/skills/senior-security/references/penetration_testing_guide.md +103 -0
  140. package/plugins/xtrm-tools/skills/senior-security/references/security_architecture_patterns.md +103 -0
  141. package/plugins/xtrm-tools/skills/senior-security/scripts/pentest_automator.py +114 -0
  142. package/plugins/xtrm-tools/skills/senior-security/scripts/security_auditor.py +114 -0
  143. package/plugins/xtrm-tools/skills/senior-security/scripts/threat_modeler.py +114 -0
  144. package/plugins/xtrm-tools/skills/skill-creator/LICENSE.txt +202 -0
  145. package/plugins/xtrm-tools/skills/skill-creator/SKILL.md +479 -0
  146. package/plugins/xtrm-tools/skills/skill-creator/agents/analyzer.md +274 -0
  147. package/plugins/xtrm-tools/skills/skill-creator/agents/comparator.md +202 -0
  148. package/plugins/xtrm-tools/skills/skill-creator/agents/grader.md +223 -0
  149. package/plugins/xtrm-tools/skills/skill-creator/assets/eval_review.html +146 -0
  150. package/plugins/xtrm-tools/skills/skill-creator/eval-viewer/generate_review.py +471 -0
  151. package/plugins/xtrm-tools/skills/skill-creator/eval-viewer/viewer.html +1325 -0
  152. package/plugins/xtrm-tools/skills/skill-creator/references/schemas.md +430 -0
  153. package/plugins/xtrm-tools/skills/skill-creator/scripts/__init__.py +0 -0
  154. package/plugins/xtrm-tools/skills/skill-creator/scripts/aggregate_benchmark.py +401 -0
  155. package/plugins/xtrm-tools/skills/skill-creator/scripts/generate_report.py +326 -0
  156. package/plugins/xtrm-tools/skills/skill-creator/scripts/improve_description.py +248 -0
  157. package/plugins/xtrm-tools/skills/skill-creator/scripts/package_skill.py +136 -0
  158. package/plugins/xtrm-tools/skills/skill-creator/scripts/quick_validate.py +103 -0
  159. package/plugins/xtrm-tools/skills/skill-creator/scripts/run_eval.py +310 -0
  160. package/plugins/xtrm-tools/skills/skill-creator/scripts/run_loop.py +332 -0
  161. package/plugins/xtrm-tools/skills/skill-creator/scripts/utils.py +47 -0
  162. package/plugins/xtrm-tools/skills/sync-docs/SKILL.md +155 -0
  163. package/plugins/xtrm-tools/skills/sync-docs/evals/evals.json +89 -0
  164. package/plugins/xtrm-tools/skills/sync-docs/references/doc-structure.md +99 -0
  165. package/plugins/xtrm-tools/skills/sync-docs/references/schema.md +103 -0
  166. package/plugins/xtrm-tools/skills/sync-docs/scripts/changelog/add_entry.py +216 -0
  167. package/plugins/xtrm-tools/skills/sync-docs/scripts/context_gatherer.py +240 -0
  168. package/plugins/xtrm-tools/skills/sync-docs/scripts/doc_structure_analyzer.py +495 -0
  169. package/plugins/xtrm-tools/skills/sync-docs/scripts/drift_detector.py +563 -0
  170. package/plugins/xtrm-tools/skills/sync-docs/scripts/validate_doc.py +365 -0
  171. package/plugins/xtrm-tools/skills/sync-docs/scripts/validate_metadata.py +185 -0
  172. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-1/benchmark.json +293 -0
  173. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-1/benchmark.md +13 -0
  174. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-1/eval-doc-audit/eval_metadata.json +27 -0
  175. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-1/eval-doc-audit/with_skill/outputs/result.md +210 -0
  176. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-1/eval-doc-audit/with_skill/run-1/grading.json +28 -0
  177. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-1/eval-doc-audit/with_skill/run-1/timing.json +1 -0
  178. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-1/eval-doc-audit/without_skill/outputs/result.md +101 -0
  179. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-1/eval-doc-audit/without_skill/run-1/grading.json +28 -0
  180. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-1/eval-doc-audit/without_skill/run-1/timing.json +5 -0
  181. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-1/eval-doc-audit/without_skill/timing.json +5 -0
  182. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-1/eval-fix-mode/eval_metadata.json +27 -0
  183. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-1/eval-fix-mode/with_skill/outputs/result.md +198 -0
  184. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-1/eval-fix-mode/with_skill/run-1/grading.json +28 -0
  185. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-1/eval-fix-mode/with_skill/run-1/timing.json +1 -0
  186. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-1/eval-fix-mode/without_skill/outputs/result.md +94 -0
  187. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-1/eval-fix-mode/without_skill/run-1/grading.json +28 -0
  188. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-1/eval-fix-mode/without_skill/run-1/timing.json +1 -0
  189. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-1/eval-sprint-closeout/eval_metadata.json +27 -0
  190. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-1/eval-sprint-closeout/with_skill/outputs/result.md +237 -0
  191. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-1/eval-sprint-closeout/with_skill/run-1/grading.json +28 -0
  192. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-1/eval-sprint-closeout/with_skill/run-1/timing.json +1 -0
  193. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-1/eval-sprint-closeout/without_skill/outputs/result.md +134 -0
  194. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-1/eval-sprint-closeout/without_skill/run-1/grading.json +28 -0
  195. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-1/eval-sprint-closeout/without_skill/run-1/timing.json +1 -0
  196. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-2/benchmark.json +297 -0
  197. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-2/benchmark.md +13 -0
  198. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-2/eval-doc-audit/eval_metadata.json +27 -0
  199. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-2/eval-doc-audit/with_skill/outputs/result.md +137 -0
  200. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-2/eval-doc-audit/with_skill/run-1/grading.json +92 -0
  201. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-2/eval-doc-audit/with_skill/run-1/timing.json +1 -0
  202. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-2/eval-doc-audit/without_skill/outputs/result.md +134 -0
  203. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-2/eval-doc-audit/without_skill/run-1/grading.json +86 -0
  204. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-2/eval-doc-audit/without_skill/run-1/timing.json +1 -0
  205. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-2/eval-fix-mode/eval_metadata.json +27 -0
  206. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-2/eval-fix-mode/with_skill/outputs/result.md +193 -0
  207. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-2/eval-fix-mode/with_skill/run-1/grading.json +72 -0
  208. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-2/eval-fix-mode/with_skill/run-1/timing.json +1 -0
  209. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-2/eval-fix-mode/without_skill/outputs/result.md +211 -0
  210. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-2/eval-fix-mode/without_skill/run-1/grading.json +91 -0
  211. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-2/eval-fix-mode/without_skill/run-1/timing.json +5 -0
  212. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-2/eval-sprint-closeout/eval_metadata.json +27 -0
  213. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-2/eval-sprint-closeout/with_skill/outputs/result.md +182 -0
  214. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-2/eval-sprint-closeout/with_skill/run-1/grading.json +95 -0
  215. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-2/eval-sprint-closeout/with_skill/run-1/timing.json +1 -0
  216. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-2/eval-sprint-closeout/without_skill/outputs/result.md +222 -0
  217. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-2/eval-sprint-closeout/without_skill/run-1/grading.json +88 -0
  218. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-2/eval-sprint-closeout/without_skill/run-1/timing.json +5 -0
  219. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/benchmark.json +298 -0
  220. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/benchmark.md +13 -0
  221. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-doc-audit/eval_metadata.json +27 -0
  222. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-doc-audit/with_skill/outputs/result.md +125 -0
  223. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-doc-audit/with_skill/run-1/grading.json +97 -0
  224. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-doc-audit/with_skill/run-1/timing.json +5 -0
  225. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-doc-audit/without_skill/outputs/result.md +144 -0
  226. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-doc-audit/without_skill/run-1/grading.json +78 -0
  227. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-doc-audit/without_skill/run-1/timing.json +5 -0
  228. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-fix-mode/eval_metadata.json +27 -0
  229. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-fix-mode/with_skill/outputs/result.md +104 -0
  230. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-fix-mode/with_skill/run-1/grading.json +91 -0
  231. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-fix-mode/with_skill/run-1/timing.json +5 -0
  232. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-fix-mode/without_skill/outputs/result.md +79 -0
  233. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-fix-mode/without_skill/run-1/grading.json +82 -0
  234. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-fix-mode/without_skill/run-1/timing.json +5 -0
  235. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-sprint-closeout/eval_metadata.json +27 -0
  236. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-sprint-closeout/with_skill/outputs/phase1_context.json +302 -0
  237. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-sprint-closeout/with_skill/outputs/phase2_drift.txt +33 -0
  238. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-sprint-closeout/with_skill/outputs/phase3_analysis.json +114 -0
  239. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-sprint-closeout/with_skill/outputs/phase4_fix.txt +118 -0
  240. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-sprint-closeout/with_skill/outputs/phase5_validate.txt +38 -0
  241. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-sprint-closeout/with_skill/outputs/result.md +158 -0
  242. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-sprint-closeout/with_skill/run-1/grading.json +95 -0
  243. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-sprint-closeout/with_skill/run-1/timing.json +5 -0
  244. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-sprint-closeout/without_skill/outputs/result.md +71 -0
  245. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-sprint-closeout/without_skill/run-1/grading.json +90 -0
  246. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-sprint-closeout/without_skill/run-1/timing.json +5 -0
  247. package/plugins/xtrm-tools/skills/test-planning/SKILL.md +208 -0
  248. package/plugins/xtrm-tools/skills/test-planning/evals/evals.json +23 -0
  249. package/plugins/xtrm-tools/skills/updating-service-skills/SKILL.md +136 -0
  250. package/plugins/xtrm-tools/skills/updating-service-skills/scripts/drift_detector.py +222 -0
  251. package/plugins/xtrm-tools/skills/using-TDD/SKILL.md +410 -0
  252. package/plugins/xtrm-tools/skills/using-quality-gates/SKILL.md +254 -0
  253. package/plugins/xtrm-tools/skills/using-serena-lsp/README.md +8 -0
  254. package/plugins/xtrm-tools/skills/using-serena-lsp/REFERENCE.md +194 -0
  255. package/plugins/xtrm-tools/skills/using-serena-lsp/SKILL.md +82 -0
  256. package/plugins/xtrm-tools/skills/using-service-skills/SKILL.md +108 -0
  257. package/plugins/xtrm-tools/skills/using-service-skills/scripts/cataloger.py +74 -0
  258. package/plugins/xtrm-tools/skills/using-service-skills/scripts/skill_activator.py +152 -0
  259. package/plugins/xtrm-tools/skills/using-service-skills/scripts/test_skill_activator.py +58 -0
  260. package/plugins/xtrm-tools/skills/using-xtrm/SKILL.md +124 -0
  261. package/plugins/xtrm-tools/skills/xt-end/SKILL.md +128 -0
@@ -36342,14 +36342,14 @@ var Temp = {
36342
36342
  }
36343
36343
  },
36344
36344
  truncate: (filePath) => {
36345
- const basename = import_node_path2.default.basename(filePath);
36346
- if (basename.length <= LIMIT_BASENAME_LENGTH)
36345
+ const basename2 = import_node_path2.default.basename(filePath);
36346
+ if (basename2.length <= LIMIT_BASENAME_LENGTH)
36347
36347
  return filePath;
36348
- const truncable = /^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(basename);
36348
+ const truncable = /^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(basename2);
36349
36349
  if (!truncable)
36350
36350
  return filePath;
36351
- const truncationLength = basename.length - LIMIT_BASENAME_LENGTH;
36352
- return `${filePath.slice(0, -basename.length)}${truncable[1]}${truncable[2].slice(0, -truncationLength)}${truncable[3]}`;
36351
+ const truncationLength = basename2.length - LIMIT_BASENAME_LENGTH;
36352
+ return `${filePath.slice(0, -basename2.length)}${truncable[1]}${truncable[2].slice(0, -truncationLength)}${truncable[3]}`;
36353
36353
  }
36354
36354
  };
36355
36355
  node_default(Temp.purgeSyncAll);
@@ -40962,6 +40962,14 @@ function isDoltInstalled() {
40962
40962
  return false;
40963
40963
  }
40964
40964
  }
40965
+ function isDeepwikiInstalled() {
40966
+ try {
40967
+ (0, import_child_process2.execSync)("deepwiki --version", { stdio: "ignore" });
40968
+ return true;
40969
+ } catch {
40970
+ return false;
40971
+ }
40972
+ }
40965
40973
  async function needsSettingsSync(repoRoot, target) {
40966
40974
  const normalizedTarget = target.replace(/\\/g, "/").toLowerCase();
40967
40975
  if (normalizedTarget.includes(".agents/skills")) return false;
@@ -41115,13 +41123,15 @@ async function installPlugin(repoRoot, dryRun) {
41115
41123
  await installOfficialClaudePlugins(true);
41116
41124
  return;
41117
41125
  }
41118
- (0, import_child_process3.spawnSync)("claude", ["plugin", "marketplace", "add", repoRoot, "--scope", "user"], { stdio: "pipe" });
41126
+ const xtrmPkgRoot = import_path11.default.resolve(__dirname, "..", "..");
41127
+ (0, import_child_process3.spawnSync)("claude", ["plugin", "marketplace", "add", xtrmPkgRoot, "--scope", "user"], { stdio: "pipe" });
41119
41128
  const listResult = (0, import_child_process3.spawnSync)("claude", ["plugin", "list"], { encoding: "utf8", stdio: "pipe" });
41120
41129
  if (listResult.stdout?.includes("xtrm-tools@xtrm-tools")) {
41121
41130
  (0, import_child_process3.spawnSync)("claude", ["plugin", "uninstall", "xtrm-tools@xtrm-tools"], { stdio: "inherit" });
41122
41131
  }
41123
41132
  (0, import_child_process3.spawnSync)("claude", ["plugin", "install", "xtrm-tools@xtrm-tools", "--scope", "user"], { stdio: "inherit" });
41124
41133
  console.log(t.success(" \u2713 xtrm-tools plugin installed"));
41134
+ console.log(t.warning(" \u21BB Restart Claude Code for the new plugin hooks to take effect"));
41125
41135
  await cleanStalePrePluginFiles(repoRoot, dryRun);
41126
41136
  await installOfficialClaudePlugins(false);
41127
41137
  }
@@ -41194,6 +41204,31 @@ function createInstallCommand() {
41194
41204
  }
41195
41205
  }
41196
41206
  }
41207
+ if (!backport) {
41208
+ console.log(t.bold("\n \u2699 deepwiki (AI-powered repo documentation)"));
41209
+ const deepwikiOk = isDeepwikiInstalled();
41210
+ if (deepwikiOk) {
41211
+ console.log(t.success(" \u2713 deepwiki already installed\n"));
41212
+ } else {
41213
+ let doInstall = effectiveYes;
41214
+ if (!effectiveYes) {
41215
+ const { install } = await (0, import_prompts.default)({
41216
+ type: "confirm",
41217
+ name: "install",
41218
+ message: "Install @seflless/deepwiki?",
41219
+ initial: true
41220
+ });
41221
+ doInstall = install;
41222
+ }
41223
+ if (doInstall) {
41224
+ console.log(t.muted("\n Installing @seflless/deepwiki..."));
41225
+ (0, import_child_process3.spawnSync)("npm", ["install", "-g", "@seflless/deepwiki"], { stdio: "inherit" });
41226
+ console.log(t.success(" \u2713 deepwiki installed\n"));
41227
+ } else {
41228
+ console.log(t.muted(" \u2139 Skipped.\n"));
41229
+ }
41230
+ }
41231
+ }
41197
41232
  if (!backport) {
41198
41233
  for (const _claudeTarget of claudeTargets) {
41199
41234
  await installPlugin(repoRoot, dryRun);
@@ -41303,14 +41338,15 @@ function resolveStatuslineScript() {
41303
41338
  const pluginsFile = import_node_path5.default.join((0, import_node_os5.homedir)(), ".claude", "plugins", "installed_plugins.json");
41304
41339
  try {
41305
41340
  const plugins = JSON.parse((0, import_node_fs4.readFileSync)(pluginsFile, "utf8"));
41306
- const entries = plugins?.plugins?.["xtrm-tools@xtrm-tools"];
41307
- if (entries?.length > 0) {
41308
- return import_node_path5.default.join(entries[0].installPath, "hooks", "statusline.mjs");
41341
+ for (const [key, entries] of Object.entries(plugins?.plugins ?? {})) {
41342
+ if (!key.startsWith("xtrm-tools@") || !entries?.length) continue;
41343
+ const p = import_node_path5.default.join(entries[0].installPath, "hooks", "statusline.mjs");
41344
+ if ((0, import_node_fs4.existsSync)(p)) return p;
41309
41345
  }
41310
41346
  } catch {
41311
41347
  }
41312
41348
  const fallback = import_node_path5.default.join((0, import_node_os5.homedir)(), ".claude", "hooks", "statusline.mjs");
41313
- return fallback;
41349
+ return (0, import_node_fs4.existsSync)(fallback) ? fallback : null;
41314
41350
  }
41315
41351
  async function launchWorktreeSession(opts) {
41316
41352
  const { runtime, name } = opts;
@@ -55983,11 +56019,12 @@ var import_path18 = __toESM(require("path"), 1);
55983
56019
  var import_fs_extra17 = __toESM(require_lib2(), 1);
55984
56020
  var HOOK_CATALOG = [
55985
56021
  { file: "using-xtrm-reminder.mjs", event: "SessionStart", desc: "Injects using-xtrm session operating manual into system prompt" },
55986
- { file: "serena-workflow-reminder.py", event: "SessionStart", desc: "Injects Serena semantic editing workflow reminder" },
55987
56022
  { file: "gitnexus/gitnexus-hook.cjs", event: "PostToolUse", desc: "Adds GitNexus context for search and Serena tooling" },
55988
- { file: "branch-state.mjs", event: "UserPromptSubmit", desc: "Injects current git branch into prompt context" },
55989
56023
  { file: "quality-check.cjs", event: "PostToolUse", desc: "Runs JS/TS quality checks on mutating edits" },
55990
56024
  { file: "quality-check.py", event: "PostToolUse", desc: "Runs Python quality checks on mutating edits" },
56025
+ { file: "quality-check-env.mjs", event: "SessionStart", desc: "Warns if tsc/ruff/eslint are missing at session start" },
56026
+ { file: "worktree-boundary.mjs", event: "PreToolUse", desc: "Blocks edits outside .xtrm/worktrees when in worktree session" },
56027
+ { file: "statusline.mjs", event: "statusLine", desc: "Renders 2-line status: XTRM model branch + claim/open issues" },
55991
56028
  { file: "beads-edit-gate.mjs", event: "PreToolUse", desc: "Blocks file edits if no beads issue is claimed", beads: true },
55992
56029
  { file: "beads-commit-gate.mjs", event: "PreToolUse", desc: "Blocks commits when no beads issue is in progress", beads: true },
55993
56030
  { file: "beads-stop-gate.mjs", event: "Stop", desc: "Blocks stop when there is an unclosed in_progress claim", beads: true },
@@ -56009,22 +56046,6 @@ async function readSkillsFromDir(dir) {
56009
56046
  }
56010
56047
  return skills;
56011
56048
  }
56012
- async function readProjectSkillsFromDir(dir) {
56013
- if (!await import_fs_extra17.default.pathExists(dir)) return [];
56014
- const entries = await import_fs_extra17.default.readdir(dir);
56015
- const skills = [];
56016
- for (const name of entries.sort()) {
56017
- const readme = import_path18.default.join(dir, name, "README.md");
56018
- if (!await import_fs_extra17.default.pathExists(readme)) continue;
56019
- const content = await import_fs_extra17.default.readFile(readme, "utf8");
56020
- const descLine = content.split("\n").find((line) => {
56021
- const trimmed = line.trim();
56022
- return Boolean(trimmed) && !trimmed.startsWith("#") && !trimmed.startsWith("[") && !trimmed.startsWith("<");
56023
- }) || "";
56024
- skills.push({ name, desc: descLine.replace(/[*_`]/g, "").trim() });
56025
- }
56026
- return skills;
56027
- }
56028
56049
  function resolvePkgRootFallback() {
56029
56050
  const candidates = [
56030
56051
  import_path18.default.resolve(__dirname, "../.."),
@@ -56048,9 +56069,7 @@ function createHelpCommand() {
56048
56069
  }
56049
56070
  const pkgRoot = resolvePkgRootFallback();
56050
56071
  const skillsRoot = repoRoot || pkgRoot || "";
56051
- const projectSkillsRoot = repoRoot || pkgRoot || "";
56052
56072
  const skills = skillsRoot ? await readSkillsFromDir(import_path18.default.join(skillsRoot, "skills")) : [];
56053
- const projectSkills = projectSkillsRoot ? await readProjectSkillsFromDir(import_path18.default.join(projectSkillsRoot, "project-skills")) : [];
56054
56073
  const W = 80;
56055
56074
  const hr = kleur_default.dim("-".repeat(W));
56056
56075
  const section = (title) => `
@@ -56059,24 +56078,11 @@ ${hr}`;
56059
56078
  const installSection = [
56060
56079
  section("INSTALL COMMANDS"),
56061
56080
  "",
56062
- ` ${kleur_default.bold("xtrm install all")}`,
56063
- ` ${kleur_default.dim("Global install: skills + all hooks (including beads gates) + MCP servers.")}`,
56081
+ ` ${kleur_default.bold("xtrm install")}`,
56082
+ ` ${kleur_default.dim("Install plugin + skills + hooks + MCP servers.")}`,
56064
56083
  ` ${kleur_default.dim("Checks for beads+dolt and prompts to install if missing.")}`,
56065
56084
  "",
56066
- ` ${kleur_default.bold("xtrm install basic")}`,
56067
- ` ${kleur_default.dim("Global install: skills + general hooks + MCP servers.")}`,
56068
- ` ${kleur_default.dim("No beads dependency -- safe to run with zero external deps.")}`,
56069
- "",
56070
- ` ${kleur_default.bold("xtrm install project")} ${kleur_default.dim("<tool-name | all>")}`,
56071
- ` ${kleur_default.dim("Project-scoped install into .claude/ of current git root.")}`,
56072
- ` ${kleur_default.dim("Run xtrm install project list to see available project skills.")}`,
56073
- "",
56074
- ` ${kleur_default.dim("Default target directories:")}`,
56075
- ` ${kleur_default.dim("~/.claude/hooks (global hook scripts)")}`,
56076
- ` ${kleur_default.dim("~/.claude/skills (global Claude skills)")}`,
56077
- ` ${kleur_default.dim("~/.agents/skills (agents skills cache mirror)")}`,
56078
- "",
56079
- ` ${kleur_default.dim("Flags (all profiles): --dry-run --yes / -y --no-mcp --force --prune --backport")}`
56085
+ ` ${kleur_default.dim("Flags: --dry-run --yes / -y --no-mcp --force --prune --backport")}`
56080
56086
  ].join("\n");
56081
56087
  const general = HOOK_CATALOG.filter((h) => !h.beads && !h.sessionFlow);
56082
56088
  const beads = HOOK_CATALOG.filter((h) => h.beads);
@@ -56106,23 +56112,14 @@ ${hr}`;
56106
56112
  "",
56107
56113
  skills.length ? skillRows : kleur_default.dim(" (none found -- run from repo root to see skills)")
56108
56114
  ].join("\n");
56109
- const psRows = projectSkills.map(
56110
- (s) => ` ${kleur_default.white(col(s.name, 30))}${kleur_default.dim(s.desc)}`
56111
- ).join("\n");
56112
- const psSection = [
56113
- section("PROJECT SKILLS + HOOKS"),
56114
- "",
56115
- projectSkills.length ? psRows : kleur_default.dim(" (none found in package)"),
56116
- "",
56117
- ` ${kleur_default.dim("Install: xtrm install project <name> | xtrm install project list")}`,
56118
- ` ${kleur_default.dim("Each project skill can install .claude/skills plus project hooks/settings.")}`
56119
- ].join("\n");
56120
56115
  const otherSection = [
56121
56116
  section("OTHER COMMANDS"),
56122
56117
  "",
56123
56118
  ` ${kleur_default.bold("xtrm status")} ${kleur_default.dim("Show pending changes without applying them")}`,
56124
56119
  ` ${kleur_default.bold("xtrm clean")} ${kleur_default.dim("Remove orphaned hooks and skills not in canonical repo")}`,
56125
56120
  ` ${kleur_default.bold("xtrm init")} ${kleur_default.dim("Initialize project data (beads, gitnexus, service-registry)")}`,
56121
+ ` ${kleur_default.bold("xtrm docs show")} ${kleur_default.dim("Display frontmatter for README, CHANGELOG, docs/*.md")}`,
56122
+ ` ${kleur_default.bold("xtrm debug")} ${kleur_default.dim("Watch xtrm hook and bd lifecycle events in real time")}`,
56126
56123
  ` ${kleur_default.bold("xtrm reset")} ${kleur_default.dim("Clear saved preferences and start fresh")}`,
56127
56124
  ` ${kleur_default.bold("xtrm end")} ${kleur_default.dim("Close worktree session: rebase, push, PR, link issues, cleanup")}`,
56128
56125
  ` ${kleur_default.bold("xtrm worktree list")} ${kleur_default.dim("List all active xt/* worktrees with status")}`,
@@ -56138,7 +56135,7 @@ ${hr}`;
56138
56135
  ` ${kleur_default.dim("Run 'xtrm <command> --help' for command-specific options.")}`,
56139
56136
  ""
56140
56137
  ].join("\n");
56141
- console.log([installSection, hooksSection, skillsSection, psSection, otherSection, resourcesSection].join("\n"));
56138
+ console.log([installSection, hooksSection, skillsSection, otherSection, resourcesSection].join("\n"));
56142
56139
  });
56143
56140
  }
56144
56141
 
@@ -56908,30 +56905,66 @@ var import_node_child_process8 = require("child_process");
56908
56905
  var import_node_fs5 = require("fs");
56909
56906
  var import_node_path6 = require("path");
56910
56907
  var KIND_LABELS = {
56911
- "hook.edit_gate.allow": { label: "EDIT+", color: kleur_default.green },
56912
- "hook.edit_gate.block": { label: "EDIT-", color: kleur_default.red },
56913
- "hook.commit_gate.allow": { label: "CMIT+", color: kleur_default.green },
56914
- "hook.commit_gate.block": { label: "CMIT-", color: kleur_default.red },
56915
- "hook.stop_gate.allow": { label: "STOP+", color: kleur_default.green },
56916
- "hook.stop_gate.block": { label: "STOP-", color: kleur_default.red },
56917
- "hook.memory_gate.acked": { label: "MEMO+", color: kleur_default.green },
56918
- "hook.memory_gate.triggered": { label: "MEMO-", color: kleur_default.yellow },
56919
- "hook.worktree_boundary.block": { label: "WTRE-", color: kleur_default.red },
56908
+ "session.start": { label: "SESS+", color: kleur_default.green },
56909
+ "session.end": { label: "SESS-", color: kleur_default.white },
56910
+ "gate.edit.allow": { label: "EDIT+", color: kleur_default.green },
56911
+ "gate.edit.block": { label: "EDIT-", color: kleur_default.red },
56912
+ "gate.commit.allow": { label: "CMIT+", color: kleur_default.green },
56913
+ "gate.commit.block": { label: "CMIT-", color: kleur_default.red },
56914
+ "gate.stop.block": { label: "STOP-", color: kleur_default.red },
56915
+ "gate.memory.triggered": { label: "MEMO-", color: kleur_default.yellow },
56916
+ "gate.memory.acked": { label: "MEMO+", color: kleur_default.green },
56917
+ "gate.worktree.block": { label: "WTRE-", color: kleur_default.red },
56920
56918
  "bd.claimed": { label: "CLMD ", color: kleur_default.cyan },
56921
56919
  "bd.closed": { label: "CLSD ", color: kleur_default.green },
56922
- "bd.auto_committed": { label: "ACMT+", color: kleur_default.cyan }
56920
+ "bd.committed": {
56921
+ label: (outcome) => outcome === "error" ? "ACMT-" : "ACMT+",
56922
+ color: (outcome) => outcome === "error" ? kleur_default.red : kleur_default.cyan
56923
+ }
56924
+ };
56925
+ var TOOL_ABBREVS = {
56926
+ Bash: "BASH",
56927
+ bash: "BASH",
56928
+ execute_shell_command: "BASH",
56929
+ Read: "READ",
56930
+ Write: "WRIT",
56931
+ Edit: "EDIT",
56932
+ MultiEdit: "EDIT",
56933
+ NotebookEdit: "NTED",
56934
+ Glob: "GLOB",
56935
+ Grep: "GREP",
56936
+ WebFetch: "WBFT",
56937
+ WebSearch: "WSRC",
56938
+ Agent: "AGNT",
56939
+ Task: "TASK",
56940
+ LSP: "LSP "
56923
56941
  };
56924
- function getLabel(kind, outcome) {
56925
- const def = KIND_LABELS[kind];
56942
+ function toolAbbrev(toolName) {
56943
+ if (TOOL_ABBREVS[toolName]) return TOOL_ABBREVS[toolName];
56944
+ if (toolName.startsWith("mcp__serena__")) return "SRNA";
56945
+ if (toolName.startsWith("mcp__gitnexus__")) return "GTNX";
56946
+ if (toolName.startsWith("mcp__deepwiki__")) return "WIKI";
56947
+ if (toolName.startsWith("mcp__")) return "MCP ";
56948
+ return toolName.slice(0, 4).toUpperCase();
56949
+ }
56950
+ function getLabel(event) {
56951
+ if (event.kind === "tool.call") {
56952
+ const abbrev = toolAbbrev(event.tool_name ?? "").padEnd(5);
56953
+ return event.outcome === "error" ? kleur_default.red(abbrev) : kleur_default.dim(abbrev);
56954
+ }
56955
+ const def = KIND_LABELS[event.kind];
56926
56956
  if (!def) {
56927
- const short = (kind.split(".").pop() ?? "UNKN").slice(0, 4).toUpperCase();
56928
- const label = `${short}${outcome === "block" ? "-" : "+"}`.padEnd(5);
56929
- return outcome === "block" ? kleur_default.red(label) : kleur_default.green(label);
56957
+ const seg = (event.kind.split(".").pop() ?? "UNKN").slice(0, 4).toUpperCase();
56958
+ const label = `${seg}${event.outcome === "block" ? "-" : "+"}`.padEnd(5);
56959
+ return event.outcome === "block" ? kleur_default.red(label) : kleur_default.dim(label);
56930
56960
  }
56931
- if (kind === "bd.auto_committed") {
56932
- return outcome === "block" ? kleur_default.red("ACMT-") : kleur_default.cyan("ACMT+");
56961
+ if (event.kind === "bd.committed") {
56962
+ const label = event.outcome === "error" ? "ACMT-" : "ACMT+";
56963
+ return event.outcome === "error" ? kleur_default.red(label) : kleur_default.cyan(label);
56933
56964
  }
56934
- return def.color(def.label);
56965
+ return def.color(
56966
+ def.label
56967
+ );
56935
56968
  }
56936
56969
  var SESSION_COLORS = [
56937
56970
  kleur_default.blue,
@@ -56940,7 +56973,7 @@ var SESSION_COLORS = [
56940
56973
  kleur_default.cyan,
56941
56974
  kleur_default.magenta
56942
56975
  ];
56943
- function buildSessionColorMap(events) {
56976
+ function buildColorMap(events) {
56944
56977
  const map2 = /* @__PURE__ */ new Map();
56945
56978
  for (const ev of events) {
56946
56979
  if (!map2.has(ev.session_id)) {
@@ -56949,194 +56982,123 @@ function buildSessionColorMap(events) {
56949
56982
  }
56950
56983
  return map2;
56951
56984
  }
56952
- function extendSessionColorMap(map2, events) {
56985
+ function extendColorMap(map2, events) {
56953
56986
  for (const ev of events) {
56954
56987
  if (!map2.has(ev.session_id)) {
56955
56988
  map2.set(ev.session_id, SESSION_COLORS[map2.size % SESSION_COLORS.length]);
56956
56989
  }
56957
56990
  }
56958
56991
  }
56959
- function fmtTime(created_at) {
56960
- try {
56961
- const d = new Date(created_at);
56962
- if (isNaN(d.getTime())) return created_at.slice(11, 19) || "??:??:??";
56963
- return d.toLocaleTimeString("en-GB", { hour12: false });
56964
- } catch {
56965
- return created_at.slice(11, 19) || "??:??:??";
56966
- }
56992
+ function fmtTime(ts) {
56993
+ return new Date(ts).toLocaleTimeString("en-GB", { hour12: false });
56967
56994
  }
56968
56995
  function buildDetail(event) {
56969
56996
  const parts = [];
56970
- if (event.tool_name) parts.push(kleur_default.dim(`tool=${event.tool_name}`));
56971
- if (event.issue_id) parts.push(kleur_default.yellow(`issue=${event.issue_id}`));
56972
- if (event.worktree) parts.push(kleur_default.dim(`wt=${event.worktree}`));
56997
+ let d = null;
56998
+ if (event.data) {
56999
+ try {
57000
+ d = JSON.parse(event.data);
57001
+ } catch {
57002
+ }
57003
+ }
57004
+ if (event.kind === "tool.call") {
57005
+ if (d?.cmd) parts.push(kleur_default.dim(d.cmd.slice(0, 72)));
57006
+ if (d?.file) parts.push(kleur_default.dim((0, import_node_path6.basename)(d.file)));
57007
+ if (d?.pattern) parts.push(kleur_default.dim(`/${d.pattern}/`));
57008
+ if (d?.url) parts.push(kleur_default.dim(d.url.slice(0, 72)));
57009
+ if (d?.query) parts.push(kleur_default.dim(d.query.slice(0, 72)));
57010
+ if (d?.prompt) parts.push(kleur_default.dim(d.prompt.slice(0, 72)));
57011
+ } else {
57012
+ if (event.issue_id) parts.push(kleur_default.yellow(event.issue_id));
57013
+ if (d?.file) parts.push(kleur_default.dim((0, import_node_path6.basename)(d.file)));
57014
+ if (d?.reason_code) parts.push(kleur_default.dim(`[${d.reason_code}]`));
57015
+ if (event.worktree) parts.push(kleur_default.dim(`wt:${event.worktree}`));
57016
+ }
56973
57017
  return parts.join(" ") || kleur_default.dim("\u2014");
56974
57018
  }
56975
- function formatEventLine(event, colorMap) {
56976
- const time3 = kleur_default.dim(fmtTime(event.created_at));
57019
+ function formatLine(event, colorMap) {
57020
+ const time3 = kleur_default.dim(fmtTime(event.ts));
56977
57021
  const colorFn = colorMap.get(event.session_id) ?? kleur_default.white;
56978
57022
  const session = colorFn(event.session_id.slice(0, 8));
56979
- const label = getLabel(event.kind, event.outcome);
57023
+ const label = getLabel(event);
56980
57024
  const detail = buildDetail(event);
56981
- return `${time3} ${session} ${label} ${detail}`;
56982
- }
56983
- function printHeader() {
56984
- const h = kleur_default.dim;
56985
- console.log(` ${h("TIME ")} ${h("SESSION ")} ${h("LABEL")} ${h("DETAIL")}`);
56986
- console.log(` ${kleur_default.dim("\u2500".repeat(72))}`);
57025
+ return `${time3} ${label} ${session} ${detail}`;
56987
57026
  }
56988
- function findProjectRoot(cwd) {
57027
+ function findDbPath(cwd) {
56989
57028
  let dir = cwd;
56990
57029
  for (let i = 0; i < 10; i++) {
56991
- if ((0, import_node_fs5.existsSync)((0, import_node_path6.join)(dir, ".beads"))) return dir;
57030
+ if ((0, import_node_fs5.existsSync)((0, import_node_path6.join)(dir, ".beads"))) return (0, import_node_path6.join)(dir, ".xtrm", "debug.db");
56992
57031
  const parent = (0, import_node_path6.join)(dir, "..");
56993
57032
  if (parent === dir) break;
56994
57033
  dir = parent;
56995
57034
  }
56996
57035
  return null;
56997
57036
  }
56998
- function parseBdTable(output, columns2) {
56999
- const lines = output.split("\n").map((l) => l.trim()).filter(Boolean);
57000
- const sepIdx = lines.findIndex((l) => /^[-+\s]+$/.test(l) && l.includes("-"));
57001
- if (sepIdx < 1) return [];
57002
- return lines.slice(sepIdx + 1).filter((l) => !l.startsWith("(")).map((line) => {
57003
- const cells = line.split("|").map((c) => c.trim());
57004
- const row = {};
57005
- columns2.forEach((col2, i) => {
57006
- row[col2] = cells[i] ?? "";
57007
- });
57008
- return row;
57009
- });
57010
- }
57011
- var COLS = "seq, id, created_at, runtime, session_id, worktree, layer, kind, outcome, tool_name, issue_id";
57012
- var COL_NAMES = ["seq", "id", "created_at", "runtime", "session_id", "worktree", "layer", "kind", "outcome", "tool_name", "issue_id"];
57013
- var ADD_SEQ_SQL = `ALTER TABLE xtrm_events ADD COLUMN seq INT NOT NULL AUTO_INCREMENT, ADD UNIQUE KEY uk_seq (seq)`;
57014
- function queryEvents(cwd, where, limit) {
57015
- const sql = `SELECT ${COLS} FROM xtrm_events${where ? ` WHERE ${where}` : ""} ORDER BY seq ASC LIMIT ${limit}`;
57016
- let result = (0, import_node_child_process8.spawnSync)("bd", ["sql", sql], {
57017
- cwd,
57018
- stdio: ["pipe", "pipe", "pipe"],
57019
- encoding: "utf8",
57020
- timeout: 8e3
57021
- });
57022
- if (result.status !== 0) {
57023
- (0, import_node_child_process8.spawnSync)("bd", ["sql", ADD_SEQ_SQL], {
57024
- cwd,
57025
- stdio: ["pipe", "pipe", "pipe"],
57026
- encoding: "utf8",
57027
- timeout: 5e3
57028
- });
57029
- result = (0, import_node_child_process8.spawnSync)("bd", ["sql", sql], {
57030
- cwd,
57031
- stdio: ["pipe", "pipe", "pipe"],
57032
- encoding: "utf8",
57033
- timeout: 8e3
57034
- });
57035
- }
57036
- if (result.status !== 0) return [];
57037
- return parseBdTable(result.stdout, COL_NAMES).map((r) => ({
57038
- seq: parseInt(r.seq, 10) || 0,
57039
- id: r.id,
57040
- created_at: r.created_at,
57041
- runtime: r.runtime,
57042
- session_id: r.session_id,
57043
- worktree: r.worktree === "<nil>" || !r.worktree ? null : r.worktree,
57044
- layer: r.layer,
57045
- kind: r.kind,
57046
- outcome: r.outcome,
57047
- tool_name: r.tool_name === "<nil>" || !r.tool_name ? null : r.tool_name,
57048
- issue_id: r.issue_id === "<nil>" || !r.issue_id ? null : r.issue_id
57049
- }));
57050
- }
57051
- function buildWhere(opts, baseClause) {
57037
+ function buildWhere(opts, base) {
57052
57038
  const clauses = [];
57053
- if (baseClause) clauses.push(baseClause);
57039
+ if (base) clauses.push(base);
57054
57040
  if (opts.session) {
57055
57041
  const s = opts.session.replace(/'/g, "''");
57056
57042
  clauses.push(`session_id LIKE '${s}%'`);
57057
57043
  }
57058
57044
  if (opts.type) {
57059
- const layer = opts.type.replace(/'/g, "''");
57060
- clauses.push(`layer = '${layer}'`);
57061
- }
57062
- return clauses.join(" AND ");
57063
- }
57064
- function follow(cwd, opts) {
57065
- const fiveMinsAgo = new Date(Date.now() - 5 * 60 * 1e3).toISOString().replace("T", " ").slice(0, 19);
57066
- const initial = queryEvents(cwd, buildWhere(opts, `created_at >= '${fiveMinsAgo}'`), 200);
57067
- const colorMap = buildSessionColorMap(initial);
57068
- let lastSeq = 0;
57069
- if (initial.length > 0) {
57070
- for (const ev of initial) {
57071
- if (ev.seq > lastSeq) lastSeq = ev.seq;
57072
- if (opts.json) {
57073
- console.log(JSON.stringify(ev));
57074
- } else {
57075
- console.log(" " + formatEventLine(ev, colorMap));
57076
- }
57077
- }
57078
- } else if (!opts.json) {
57079
- console.log(kleur_default.dim(" (no recent events \u2014 waiting for new ones)\n"));
57045
+ const t3 = opts.type.replace(/'/g, "''");
57046
+ clauses.push(`kind LIKE '${t3}.%' OR kind = '${t3}'`);
57047
+ }
57048
+ return clauses.length ? clauses.join(" AND ") : "";
57049
+ }
57050
+ function queryEvents(dbPath, where, limit) {
57051
+ const sql = `SELECT id,ts,session_id,runtime,worktree,kind,tool_name,outcome,issue_id,duration_ms,data FROM events${where ? ` WHERE ${where}` : ""} ORDER BY id ASC LIMIT ${limit}`;
57052
+ const result = (0, import_node_child_process8.spawnSync)("sqlite3", [dbPath, "-json", sql], {
57053
+ stdio: ["pipe", "pipe", "pipe"],
57054
+ encoding: "utf8",
57055
+ timeout: 5e3
57056
+ });
57057
+ if (result.status !== 0 || !result.stdout.trim()) return [];
57058
+ try {
57059
+ return JSON.parse(result.stdout);
57060
+ } catch {
57061
+ return [];
57062
+ }
57063
+ }
57064
+ function follow(dbPath, opts) {
57065
+ const sinceTs = Date.now() - 5 * 60 * 1e3;
57066
+ const initial = queryEvents(dbPath, buildWhere(opts, `ts >= ${sinceTs}`), 200);
57067
+ const colorMap = buildColorMap(initial);
57068
+ let lastId = 0;
57069
+ for (const ev of initial) {
57070
+ if (ev.id > lastId) lastId = ev.id;
57071
+ opts.json ? console.log(JSON.stringify(ev)) : console.log(formatLine(ev, colorMap));
57080
57072
  }
57081
57073
  const interval = setInterval(() => {
57082
- const events = queryEvents(cwd, buildWhere(opts, `seq > ${lastSeq}`), 50);
57074
+ const events = queryEvents(dbPath, buildWhere(opts, `id > ${lastId}`), 50);
57083
57075
  if (events.length > 0) {
57084
- extendSessionColorMap(colorMap, events);
57076
+ extendColorMap(colorMap, events);
57085
57077
  for (const ev of events) {
57086
- if (ev.seq > lastSeq) lastSeq = ev.seq;
57087
- if (opts.json) {
57088
- console.log(JSON.stringify(ev));
57089
- } else {
57090
- console.log(" " + formatEventLine(ev, colorMap));
57091
- }
57078
+ if (ev.id > lastId) lastId = ev.id;
57079
+ opts.json ? console.log(JSON.stringify(ev)) : console.log(formatLine(ev, colorMap));
57092
57080
  }
57093
57081
  }
57094
57082
  }, 2e3);
57095
57083
  process.on("SIGINT", () => {
57096
57084
  clearInterval(interval);
57097
- if (!opts.json) console.log(kleur_default.dim("\n stopped\n"));
57098
57085
  process.exit(0);
57099
57086
  });
57100
57087
  }
57101
57088
  function createDebugCommand() {
57102
- return new Command("debug").description("Watch xtrm hook and bd lifecycle events in real time").option("-f, --follow", "Follow new events (default when no other mode set)", false).option("--all", "Show full history and exit", false).option("--session <id>", "Filter by session ID (prefix match)").option("--type <layer>", "Filter by layer: gate | bd").option("--json", "Output raw JSON lines", false).action((opts) => {
57089
+ return new Command("debug").description("Watch xtrm events: tool calls, gate decisions, bd lifecycle").option("-f, --follow", "Follow new events (default)", false).option("--all", "Show full history and exit", false).option("--session <id>", "Filter by session ID (prefix match)").option("--type <domain>", "Filter by domain: tool | gate | bd | session").option("--json", "Output raw JSON lines", false).action((opts) => {
57103
57090
  const cwd = process.cwd();
57104
- const root = findProjectRoot(cwd);
57105
- if (!root) {
57106
- console.error(kleur_default.red("\n \u2717 No beads project found (.beads directory missing)\n"));
57107
- console.error(kleur_default.dim(" Run from inside an xtrm project.\n"));
57108
- process.exit(1);
57109
- }
57110
- if (!opts.json) {
57111
- console.log(kleur_default.bold("\n xtrm event log"));
57112
- if (opts.all) {
57113
- console.log(kleur_default.dim(" Showing full history\n"));
57114
- } else {
57115
- console.log(kleur_default.dim(" Following events \u2014 Ctrl+C to stop\n"));
57116
- }
57117
- printHeader();
57118
- }
57091
+ const dbPath = findDbPath(cwd);
57092
+ if (!dbPath || !(0, import_node_fs5.existsSync)(dbPath)) return;
57119
57093
  if (opts.all) {
57120
- const events = queryEvents(root, buildWhere(opts, ""), 200);
57121
- if (events.length === 0) {
57122
- if (!opts.json) {
57123
- console.log(kleur_default.dim("\n No events recorded yet."));
57124
- console.log(kleur_default.dim(" Events appear here as hooks fire and bd lifecycle runs.\n"));
57125
- }
57126
- } else {
57127
- const colorMap = buildSessionColorMap(events);
57128
- for (const ev of events) {
57129
- if (opts.json) {
57130
- console.log(JSON.stringify(ev));
57131
- } else {
57132
- console.log(" " + formatEventLine(ev, colorMap));
57133
- }
57134
- }
57135
- if (!opts.json) console.log("");
57094
+ const events = queryEvents(dbPath, buildWhere(opts, ""), 1e3);
57095
+ const colorMap = buildColorMap(events);
57096
+ for (const ev of events) {
57097
+ opts.json ? console.log(JSON.stringify(ev)) : console.log(formatLine(ev, colorMap));
57136
57098
  }
57137
57099
  return;
57138
57100
  }
57139
- follow(root, opts);
57101
+ follow(dbPath, opts);
57140
57102
  });
57141
57103
  }
57142
57104
 
@@ -57359,8 +57321,9 @@ process.on("unhandledRejection", (reason) => {
57359
57321
  process.exit(1);
57360
57322
  });
57361
57323
  var isHelpOrVersion = process.argv.some((a) => a === "--help" || a === "-h" || a === "--version" || a === "-V");
57324
+ var isViewerCommand = ["debug", "status"].includes(process.argv[2] ?? "");
57362
57325
  (async () => {
57363
- if (!isHelpOrVersion) {
57326
+ if (!isHelpOrVersion && !isViewerCommand) {
57364
57327
  await printBanner(version2);
57365
57328
  }
57366
57329
  program2.parseAsync(process.argv);