xtrm-tools 2.3.0 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (284) hide show
  1. package/README.md +127 -111
  2. package/cli/dist/index.cjs +107 -53
  3. package/cli/dist/index.cjs.map +1 -1
  4. package/cli/package.json +1 -1
  5. package/config/pi/extensions/beads.ts +24 -0
  6. package/hooks/beads-gate-core.mjs +6 -4
  7. package/hooks/beads-memory-gate.mjs +12 -5
  8. package/hooks/hooks.json +126 -0
  9. package/package.json +3 -1
  10. package/skills/test-planning/SKILL.md +208 -0
  11. package/skills/test-planning/evals/evals.json +23 -0
  12. package/skills/using-xtrm/SKILL.md +5 -27
  13. package/project-skills/tdd-guard/.claude/hooks/tdd-guard-pretool-bridge.cjs +0 -103
  14. package/project-skills/tdd-guard/.claude/settings.json +0 -38
  15. package/project-skills/tdd-guard/.claude/skills/using-tdd-guard/SKILL.md +0 -79
  16. package/project-skills/tdd-guard/CLAUDE.md +0 -98
  17. package/project-skills/tdd-guard/CONTRIBUTING.md +0 -38
  18. package/project-skills/tdd-guard/DEVELOPMENT.md +0 -127
  19. package/project-skills/tdd-guard/LICENSE +0 -21
  20. package/project-skills/tdd-guard/README.md +0 -398
  21. package/project-skills/tdd-guard/docs/adr/001-claude-session-subdirectory.md +0 -52
  22. package/project-skills/tdd-guard/docs/adr/002-secure-claude-binary-path.md +0 -56
  23. package/project-skills/tdd-guard/docs/adr/003-remove-configurable-data-directory.md +0 -56
  24. package/project-skills/tdd-guard/docs/adr/004-monorepo-architecture.md +0 -64
  25. package/project-skills/tdd-guard/docs/adr/005-claude-project-dir-support.md +0 -55
  26. package/project-skills/tdd-guard/docs/adr/006-phpunit-separate-repository.md +0 -93
  27. package/project-skills/tdd-guard/docs/adr/007-golangci-lint-path-support.md +0 -83
  28. package/project-skills/tdd-guard/docs/adr/008-storybook-reporter-design.md +0 -182
  29. package/project-skills/tdd-guard/docs/assets/tdd-guard-demo-screenshot.gif +0 -0
  30. package/project-skills/tdd-guard/docs/config-migration.md +0 -143
  31. package/project-skills/tdd-guard/docs/configuration.md +0 -137
  32. package/project-skills/tdd-guard/docs/custom-instructions.md +0 -43
  33. package/project-skills/tdd-guard/docs/enforcement.md +0 -46
  34. package/project-skills/tdd-guard/docs/ignore-patterns.md +0 -81
  35. package/project-skills/tdd-guard/docs/linting.md +0 -109
  36. package/project-skills/tdd-guard/docs/quick-commands.md +0 -52
  37. package/project-skills/tdd-guard/docs/session-management.md +0 -75
  38. package/project-skills/tdd-guard/docs/storybook-vitest-addon.md +0 -120
  39. package/project-skills/tdd-guard/docs/validation-model.md +0 -63
  40. package/project-skills/tdd-guard/eslint.config.mjs +0 -140
  41. package/project-skills/tdd-guard/package-lock.json +0 -16937
  42. package/project-skills/tdd-guard/package.json +0 -102
  43. package/project-skills/tdd-guard/reporters/go/README.md +0 -67
  44. package/project-skills/tdd-guard/reporters/go/cmd/tdd-guard-go/main.go +0 -127
  45. package/project-skills/tdd-guard/reporters/go/cmd/tdd-guard-go/main_test.go +0 -280
  46. package/project-skills/tdd-guard/reporters/go/go.mod +0 -3
  47. package/project-skills/tdd-guard/reporters/go/go.sum +0 -0
  48. package/project-skills/tdd-guard/reporters/go/internal/formatter/formatter.go +0 -126
  49. package/project-skills/tdd-guard/reporters/go/internal/formatter/formatter_test.go +0 -264
  50. package/project-skills/tdd-guard/reporters/go/internal/io/tee_reader.go +0 -26
  51. package/project-skills/tdd-guard/reporters/go/internal/io/tee_reader_test.go +0 -37
  52. package/project-skills/tdd-guard/reporters/go/internal/parser/mixed_reader.go +0 -94
  53. package/project-skills/tdd-guard/reporters/go/internal/parser/mixed_reader_test.go +0 -198
  54. package/project-skills/tdd-guard/reporters/go/internal/parser/parser.go +0 -245
  55. package/project-skills/tdd-guard/reporters/go/internal/parser/parser_test.go +0 -547
  56. package/project-skills/tdd-guard/reporters/go/internal/storage/storage.go +0 -35
  57. package/project-skills/tdd-guard/reporters/go/internal/storage/storage_test.go +0 -113
  58. package/project-skills/tdd-guard/reporters/go/internal/transformer/transformer.go +0 -103
  59. package/project-skills/tdd-guard/reporters/go/internal/transformer/transformer_test.go +0 -303
  60. package/project-skills/tdd-guard/reporters/jest/README.md +0 -102
  61. package/project-skills/tdd-guard/reporters/jest/package.json +0 -38
  62. package/project-skills/tdd-guard/reporters/jest/src/JestReporter.test-data.ts +0 -199
  63. package/project-skills/tdd-guard/reporters/jest/src/JestReporter.test.ts +0 -302
  64. package/project-skills/tdd-guard/reporters/jest/src/JestReporter.ts +0 -201
  65. package/project-skills/tdd-guard/reporters/jest/src/index.ts +0 -4
  66. package/project-skills/tdd-guard/reporters/jest/src/types.ts +0 -42
  67. package/project-skills/tdd-guard/reporters/jest/tsconfig.json +0 -11
  68. package/project-skills/tdd-guard/reporters/phpunit/.php-cs-fixer.php +0 -28
  69. package/project-skills/tdd-guard/reporters/phpunit/README.md +0 -97
  70. package/project-skills/tdd-guard/reporters/phpunit/SYNC_README.md +0 -29
  71. package/project-skills/tdd-guard/reporters/phpunit/composer.json +0 -55
  72. package/project-skills/tdd-guard/reporters/phpunit/phpunit.xml.dist +0 -19
  73. package/project-skills/tdd-guard/reporters/phpunit/psalm.xml +0 -44
  74. package/project-skills/tdd-guard/reporters/phpunit/src/Event/ErroredTestSubscriber.php +0 -28
  75. package/project-skills/tdd-guard/reporters/phpunit/src/Event/FailedTestSubscriber.php +0 -28
  76. package/project-skills/tdd-guard/reporters/phpunit/src/Event/IncompleteTestSubscriber.php +0 -28
  77. package/project-skills/tdd-guard/reporters/phpunit/src/Event/PassedTestSubscriber.php +0 -27
  78. package/project-skills/tdd-guard/reporters/phpunit/src/Event/SkippedTestSubscriber.php +0 -28
  79. package/project-skills/tdd-guard/reporters/phpunit/src/Event/TestRunnerFinishedSubscriber.php +0 -24
  80. package/project-skills/tdd-guard/reporters/phpunit/src/PathValidator.php +0 -88
  81. package/project-skills/tdd-guard/reporters/phpunit/src/Storage.php +0 -26
  82. package/project-skills/tdd-guard/reporters/phpunit/src/TddGuardExtension.php +0 -33
  83. package/project-skills/tdd-guard/reporters/phpunit/src/TddGuardListener.php +0 -158
  84. package/project-skills/tdd-guard/reporters/phpunit/src/TddGuardSubscriber.php +0 -35
  85. package/project-skills/tdd-guard/reporters/phpunit/src/TestResultCollector.php +0 -105
  86. package/project-skills/tdd-guard/reporters/phpunit/tests/PathValidatorTest.php +0 -74
  87. package/project-skills/tdd-guard/reporters/phpunit/tests/TddGuardExtensionFailedTest.php +0 -241
  88. package/project-skills/tdd-guard/reporters/phpunit/tests/TddGuardExtensionTest.php +0 -84
  89. package/project-skills/tdd-guard/reporters/phpunit/tests/TddGuardStorageLocationTest.php +0 -71
  90. package/project-skills/tdd-guard/reporters/pytest/README.md +0 -77
  91. package/project-skills/tdd-guard/reporters/pytest/pyproject.toml +0 -43
  92. package/project-skills/tdd-guard/reporters/pytest/pytest.ini.example +0 -7
  93. package/project-skills/tdd-guard/reporters/pytest/tdd_guard_pytest/__init__.py +0 -1
  94. package/project-skills/tdd-guard/reporters/pytest/tdd_guard_pytest/pytest_reporter.py +0 -134
  95. package/project-skills/tdd-guard/reporters/pytest/tests/__init__.py +0 -1
  96. package/project-skills/tdd-guard/reporters/pytest/tests/conftest.py +0 -3
  97. package/project-skills/tdd-guard/reporters/pytest/tests/helpers.py +0 -293
  98. package/project-skills/tdd-guard/reporters/pytest/tests/test_config_option.py +0 -38
  99. package/project-skills/tdd-guard/reporters/pytest/tests/test_path_validation.py +0 -59
  100. package/project-skills/tdd-guard/reporters/pytest/tests/test_plugin_config.py +0 -32
  101. package/project-skills/tdd-guard/reporters/pytest/tests/test_project_root.py +0 -296
  102. package/project-skills/tdd-guard/reporters/pytest/tests/test_pytest_reporter.py +0 -137
  103. package/project-skills/tdd-guard/reporters/rspec/Gemfile +0 -3
  104. package/project-skills/tdd-guard/reporters/rust/Cargo.lock +0 -458
  105. package/project-skills/tdd-guard/reporters/rust/Cargo.toml +0 -33
  106. package/project-skills/tdd-guard/reporters/rust/Makefile.example +0 -95
  107. package/project-skills/tdd-guard/reporters/rust/README.md +0 -88
  108. package/project-skills/tdd-guard/reporters/rust/src/error_parser.rs +0 -309
  109. package/project-skills/tdd-guard/reporters/rust/src/main.rs +0 -464
  110. package/project-skills/tdd-guard/reporters/rust/src/parser.rs +0 -225
  111. package/project-skills/tdd-guard/reporters/rust/src/transformer.rs +0 -409
  112. package/project-skills/tdd-guard/reporters/storybook/README.md +0 -108
  113. package/project-skills/tdd-guard/reporters/storybook/package-lock.json +0 -9482
  114. package/project-skills/tdd-guard/reporters/storybook/package.json +0 -43
  115. package/project-skills/tdd-guard/reporters/storybook/src/StorybookReporter.test-data.ts +0 -22
  116. package/project-skills/tdd-guard/reporters/storybook/src/StorybookReporter.test.ts +0 -190
  117. package/project-skills/tdd-guard/reporters/storybook/src/StorybookReporter.ts +0 -88
  118. package/project-skills/tdd-guard/reporters/storybook/src/index.ts +0 -12
  119. package/project-skills/tdd-guard/reporters/storybook/src/types.ts +0 -37
  120. package/project-skills/tdd-guard/reporters/storybook/tsconfig.json +0 -11
  121. package/project-skills/tdd-guard/reporters/test/artifacts/go/failing/go.mod +0 -3
  122. package/project-skills/tdd-guard/reporters/test/artifacts/go/failing/single_failing_test.go +0 -13
  123. package/project-skills/tdd-guard/reporters/test/artifacts/go/import/go.mod +0 -3
  124. package/project-skills/tdd-guard/reporters/test/artifacts/go/import/single_import_error_test.go +0 -17
  125. package/project-skills/tdd-guard/reporters/test/artifacts/go/passing/go.mod +0 -3
  126. package/project-skills/tdd-guard/reporters/test/artifacts/go/passing/single_passing_test.go +0 -13
  127. package/project-skills/tdd-guard/reporters/test/artifacts/jest/single-failing.test.js +0 -5
  128. package/project-skills/tdd-guard/reporters/test/artifacts/jest/single-import-error.test.js +0 -8
  129. package/project-skills/tdd-guard/reporters/test/artifacts/jest/single-passing.test.js +0 -5
  130. package/project-skills/tdd-guard/reporters/test/artifacts/phpunit/SingleFailingTest.php +0 -11
  131. package/project-skills/tdd-guard/reporters/test/artifacts/phpunit/SingleImportErrorTest.php +0 -14
  132. package/project-skills/tdd-guard/reporters/test/artifacts/phpunit/SinglePassingTest.php +0 -11
  133. package/project-skills/tdd-guard/reporters/test/artifacts/pytest/test_single_failing.py +0 -3
  134. package/project-skills/tdd-guard/reporters/test/artifacts/pytest/test_single_import_error.py +0 -6
  135. package/project-skills/tdd-guard/reporters/test/artifacts/pytest/test_single_passing.py +0 -3
  136. package/project-skills/tdd-guard/reporters/test/artifacts/rust/failing/Cargo.lock +0 -7
  137. package/project-skills/tdd-guard/reporters/test/artifacts/rust/failing/Cargo.toml +0 -4
  138. package/project-skills/tdd-guard/reporters/test/artifacts/rust/failing/src/lib.rs +0 -14
  139. package/project-skills/tdd-guard/reporters/test/artifacts/rust/import/Cargo.lock +0 -7
  140. package/project-skills/tdd-guard/reporters/test/artifacts/rust/import/Cargo.toml +0 -4
  141. package/project-skills/tdd-guard/reporters/test/artifacts/rust/import/src/lib.rs +0 -13
  142. package/project-skills/tdd-guard/reporters/test/artifacts/rust/passing/Cargo.lock +0 -7
  143. package/project-skills/tdd-guard/reporters/test/artifacts/rust/passing/Cargo.toml +0 -4
  144. package/project-skills/tdd-guard/reporters/test/artifacts/rust/passing/src/lib.rs +0 -14
  145. package/project-skills/tdd-guard/reporters/test/artifacts/storybook/Calculator.js +0 -4
  146. package/project-skills/tdd-guard/reporters/test/artifacts/storybook/single-failing.stories.js +0 -15
  147. package/project-skills/tdd-guard/reporters/test/artifacts/storybook/single-import-error.stories.js +0 -14
  148. package/project-skills/tdd-guard/reporters/test/artifacts/storybook/single-passing.stories.js +0 -15
  149. package/project-skills/tdd-guard/reporters/test/artifacts/vitest/single-failing.test.js +0 -7
  150. package/project-skills/tdd-guard/reporters/test/artifacts/vitest/single-import-error.test.js +0 -9
  151. package/project-skills/tdd-guard/reporters/test/artifacts/vitest/single-passing.test.js +0 -7
  152. package/project-skills/tdd-guard/reporters/test/factories/go.ts +0 -59
  153. package/project-skills/tdd-guard/reporters/test/factories/helpers.ts +0 -48
  154. package/project-skills/tdd-guard/reporters/test/factories/index.ts +0 -7
  155. package/project-skills/tdd-guard/reporters/test/factories/jest.ts +0 -51
  156. package/project-skills/tdd-guard/reporters/test/factories/phpunit.ts +0 -63
  157. package/project-skills/tdd-guard/reporters/test/factories/pytest.ts +0 -41
  158. package/project-skills/tdd-guard/reporters/test/factories/rust.ts +0 -158
  159. package/project-skills/tdd-guard/reporters/test/factories/storybook.ts +0 -198
  160. package/project-skills/tdd-guard/reporters/test/factories/vitest.ts +0 -51
  161. package/project-skills/tdd-guard/reporters/test/reporters.integration.test.ts +0 -735
  162. package/project-skills/tdd-guard/reporters/test/types.ts +0 -28
  163. package/project-skills/tdd-guard/reporters/vitest/README.md +0 -64
  164. package/project-skills/tdd-guard/reporters/vitest/package.json +0 -35
  165. package/project-skills/tdd-guard/reporters/vitest/src/VitestReporter.test-data.ts +0 -85
  166. package/project-skills/tdd-guard/reporters/vitest/src/VitestReporter.test.ts +0 -446
  167. package/project-skills/tdd-guard/reporters/vitest/src/VitestReporter.ts +0 -110
  168. package/project-skills/tdd-guard/reporters/vitest/src/index.ts +0 -4
  169. package/project-skills/tdd-guard/reporters/vitest/src/types.ts +0 -39
  170. package/project-skills/tdd-guard/reporters/vitest/tsconfig.json +0 -11
  171. package/project-skills/tdd-guard/src/cli/buildContext.test.ts +0 -200
  172. package/project-skills/tdd-guard/src/cli/buildContext.ts +0 -48
  173. package/project-skills/tdd-guard/src/cli/tdd-guard.test.ts +0 -159
  174. package/project-skills/tdd-guard/src/cli/tdd-guard.ts +0 -48
  175. package/project-skills/tdd-guard/src/config/Config.test.ts +0 -538
  176. package/project-skills/tdd-guard/src/config/Config.ts +0 -172
  177. package/project-skills/tdd-guard/src/contracts/schemas/guardSchemas.test.ts +0 -58
  178. package/project-skills/tdd-guard/src/contracts/schemas/guardSchemas.ts +0 -8
  179. package/project-skills/tdd-guard/src/contracts/schemas/lintSchemas.test.ts +0 -347
  180. package/project-skills/tdd-guard/src/contracts/schemas/lintSchemas.ts +0 -61
  181. package/project-skills/tdd-guard/src/contracts/schemas/pytestSchemas.test.ts +0 -24
  182. package/project-skills/tdd-guard/src/contracts/schemas/pytestSchemas.ts +0 -7
  183. package/project-skills/tdd-guard/src/contracts/schemas/reporterSchemas.test.ts +0 -377
  184. package/project-skills/tdd-guard/src/contracts/schemas/reporterSchemas.ts +0 -75
  185. package/project-skills/tdd-guard/src/contracts/schemas/toolSchemas.test.ts +0 -563
  186. package/project-skills/tdd-guard/src/contracts/schemas/toolSchemas.ts +0 -140
  187. package/project-skills/tdd-guard/src/contracts/types/ClientType.ts +0 -1
  188. package/project-skills/tdd-guard/src/contracts/types/ConfigOptions.ts +0 -12
  189. package/project-skills/tdd-guard/src/contracts/types/Context.ts +0 -16
  190. package/project-skills/tdd-guard/src/contracts/types/ModelClient.ts +0 -3
  191. package/project-skills/tdd-guard/src/contracts/types/ValidationResult.ts +0 -6
  192. package/project-skills/tdd-guard/src/guard/GuardManager.test.ts +0 -336
  193. package/project-skills/tdd-guard/src/guard/GuardManager.ts +0 -83
  194. package/project-skills/tdd-guard/src/hooks/HookEvents.test.ts +0 -107
  195. package/project-skills/tdd-guard/src/hooks/HookEvents.ts +0 -39
  196. package/project-skills/tdd-guard/src/hooks/fileTypeDetection.ts +0 -16
  197. package/project-skills/tdd-guard/src/hooks/postToolLint.test.ts +0 -327
  198. package/project-skills/tdd-guard/src/hooks/postToolLint.ts +0 -165
  199. package/project-skills/tdd-guard/src/hooks/processHookData.test.ts +0 -465
  200. package/project-skills/tdd-guard/src/hooks/processHookData.ts +0 -203
  201. package/project-skills/tdd-guard/src/hooks/sessionHandler.test.ts +0 -136
  202. package/project-skills/tdd-guard/src/hooks/sessionHandler.ts +0 -31
  203. package/project-skills/tdd-guard/src/hooks/userPromptHandler.test.ts +0 -131
  204. package/project-skills/tdd-guard/src/hooks/userPromptHandler.ts +0 -55
  205. package/project-skills/tdd-guard/src/index.ts +0 -19
  206. package/project-skills/tdd-guard/src/linters/Linter.ts +0 -5
  207. package/project-skills/tdd-guard/src/linters/eslint/ESLint.test.ts +0 -183
  208. package/project-skills/tdd-guard/src/linters/eslint/ESLint.ts +0 -82
  209. package/project-skills/tdd-guard/src/linters/golangci/GolangciLint.test.ts +0 -170
  210. package/project-skills/tdd-guard/src/linters/golangci/GolangciLint.ts +0 -148
  211. package/project-skills/tdd-guard/src/processors/index.ts +0 -1
  212. package/project-skills/tdd-guard/src/processors/lintProcessor.ts +0 -77
  213. package/project-skills/tdd-guard/src/processors/testResults/TestResultsProcessor.test.ts +0 -303
  214. package/project-skills/tdd-guard/src/processors/testResults/TestResultsProcessor.ts +0 -255
  215. package/project-skills/tdd-guard/src/providers/LinterProvider.test.ts +0 -43
  216. package/project-skills/tdd-guard/src/providers/LinterProvider.ts +0 -20
  217. package/project-skills/tdd-guard/src/providers/ModelClientProvider.test.ts +0 -68
  218. package/project-skills/tdd-guard/src/providers/ModelClientProvider.ts +0 -22
  219. package/project-skills/tdd-guard/src/storage/FileStorage.test.ts +0 -76
  220. package/project-skills/tdd-guard/src/storage/FileStorage.ts +0 -108
  221. package/project-skills/tdd-guard/src/storage/MemoryStorage.ts +0 -57
  222. package/project-skills/tdd-guard/src/storage/Storage.test.ts +0 -227
  223. package/project-skills/tdd-guard/src/storage/Storage.ts +0 -17
  224. package/project-skills/tdd-guard/src/validation/context/context.test.ts +0 -364
  225. package/project-skills/tdd-guard/src/validation/context/context.ts +0 -155
  226. package/project-skills/tdd-guard/src/validation/models/AnthropicApi.test.ts +0 -171
  227. package/project-skills/tdd-guard/src/validation/models/AnthropicApi.ts +0 -49
  228. package/project-skills/tdd-guard/src/validation/models/ClaudeAgentSdk.test.ts +0 -167
  229. package/project-skills/tdd-guard/src/validation/models/ClaudeAgentSdk.ts +0 -54
  230. package/project-skills/tdd-guard/src/validation/models/ClaudeCli.test.ts +0 -239
  231. package/project-skills/tdd-guard/src/validation/models/ClaudeCli.ts +0 -57
  232. package/project-skills/tdd-guard/src/validation/prompts/file-types.ts +0 -52
  233. package/project-skills/tdd-guard/src/validation/prompts/operations/edit.ts +0 -58
  234. package/project-skills/tdd-guard/src/validation/prompts/operations/multi-edit.ts +0 -54
  235. package/project-skills/tdd-guard/src/validation/prompts/operations/write.ts +0 -54
  236. package/project-skills/tdd-guard/src/validation/prompts/response.ts +0 -40
  237. package/project-skills/tdd-guard/src/validation/prompts/rules.ts +0 -51
  238. package/project-skills/tdd-guard/src/validation/prompts/system-prompt.ts +0 -10
  239. package/project-skills/tdd-guard/src/validation/prompts/tools/lint-results.ts +0 -15
  240. package/project-skills/tdd-guard/src/validation/prompts/tools/test-output.ts +0 -14
  241. package/project-skills/tdd-guard/src/validation/prompts/tools/todos.ts +0 -9
  242. package/project-skills/tdd-guard/src/validation/validator.test.ts +0 -268
  243. package/project-skills/tdd-guard/src/validation/validator.ts +0 -159
  244. package/project-skills/tdd-guard/test/artifacts/go/.golangci.yml +0 -6
  245. package/project-skills/tdd-guard/test/artifacts/go/with-issues/file-with-issues.go +0 -12
  246. package/project-skills/tdd-guard/test/artifacts/go/with-issues/go.mod +0 -3
  247. package/project-skills/tdd-guard/test/artifacts/go/without-issues/file-without-issues.go +0 -7
  248. package/project-skills/tdd-guard/test/artifacts/go/without-issues/go.mod +0 -3
  249. package/project-skills/tdd-guard/test/artifacts/javascript/eslint.config.js +0 -20
  250. package/project-skills/tdd-guard/test/artifacts/javascript/file-with-issues.js +0 -12
  251. package/project-skills/tdd-guard/test/artifacts/javascript/file-without-issues.js +0 -10
  252. package/project-skills/tdd-guard/test/hooks/fileTypeDetection.test.ts +0 -26
  253. package/project-skills/tdd-guard/test/hooks/processHookData.fileType.test.ts +0 -46
  254. package/project-skills/tdd-guard/test/hooks/processHookData.python.test.ts +0 -68
  255. package/project-skills/tdd-guard/test/integration/test-context.test.ts +0 -66
  256. package/project-skills/tdd-guard/test/integration/validator.core.test.ts +0 -96
  257. package/project-skills/tdd-guard/test/integration/validator.scenarios.test.ts +0 -497
  258. package/project-skills/tdd-guard/test/utils/assertions.ts +0 -29
  259. package/project-skills/tdd-guard/test/utils/factories/contextFactory.ts +0 -30
  260. package/project-skills/tdd-guard/test/utils/factories/editFactory.ts +0 -82
  261. package/project-skills/tdd-guard/test/utils/factories/helpers.test.ts +0 -46
  262. package/project-skills/tdd-guard/test/utils/factories/helpers.ts +0 -46
  263. package/project-skills/tdd-guard/test/utils/factories/lintFactory.ts +0 -352
  264. package/project-skills/tdd-guard/test/utils/factories/modelClientProviderFactory.ts +0 -21
  265. package/project-skills/tdd-guard/test/utils/factories/multiEditFactory.ts +0 -79
  266. package/project-skills/tdd-guard/test/utils/factories/operations.ts +0 -57
  267. package/project-skills/tdd-guard/test/utils/factories/reporterFactory.ts +0 -55
  268. package/project-skills/tdd-guard/test/utils/factories/scenarios/index.ts +0 -22
  269. package/project-skills/tdd-guard/test/utils/factories/scenarios/languages/python.ts +0 -745
  270. package/project-skills/tdd-guard/test/utils/factories/scenarios/languages/typescript.ts +0 -767
  271. package/project-skills/tdd-guard/test/utils/factories/scenarios/types.ts +0 -77
  272. package/project-skills/tdd-guard/test/utils/factories/scenarios/utils.ts +0 -15
  273. package/project-skills/tdd-guard/test/utils/factories/sessionStartFactory.ts +0 -36
  274. package/project-skills/tdd-guard/test/utils/factories/testDefaults.ts +0 -90
  275. package/project-skills/tdd-guard/test/utils/factories/testResultsFactory.ts +0 -234
  276. package/project-skills/tdd-guard/test/utils/factories/todoFactory.ts +0 -99
  277. package/project-skills/tdd-guard/test/utils/factories/userPromptSubmitFactory.ts +0 -39
  278. package/project-skills/tdd-guard/test/utils/factories/writeFactory.ts +0 -70
  279. package/project-skills/tdd-guard/test/utils/index.ts +0 -131
  280. package/project-skills/tdd-guard/tsconfig.build.json +0 -16
  281. package/project-skills/tdd-guard/tsconfig.eslint.json +0 -17
  282. package/project-skills/tdd-guard/tsconfig.json +0 -32
  283. package/project-skills/tdd-guard/tsconfig.node.json +0 -10
  284. package/project-skills/tdd-guard/vitest.config.ts +0 -85
package/README.md CHANGED
@@ -1,171 +1,187 @@
1
1
  # XTRM-Tools
2
2
 
3
- **Claude Code tools installer** — skills, hooks, MCP servers, and project-specific extensions.
3
+ > **Claude Code plugin** — workflow enforcement, code quality gates, issue tracking, and development automation.
4
4
 
5
- > **ARCHITECTURAL DECISION (v2.0.0+):** xtrm-tools supports **Claude Code exclusively**. Hook translation for Gemini CLI and Qwen CLI was removed.
5
+ **Version 2.3.0** | [Complete Guide](XTRM-GUIDE.md) | [Changelog](CHANGELOG.md)
6
6
 
7
- > **MIGRATION NOTICE (v2.1.20+):** Core logic has moved to **Pi Extensions**. See the [Pi Extensions Migration Guide](docs/pi-extensions-migration.md).
8
-
9
- This repository contains production-ready extensions to enhance Claude's capabilities with prompt improvement, task delegation, development workflow automation, and quality gates. The `xtrm` CLI provides a robust, modular "Plug & Play" installation engine for project-specific tools.
7
+ ---
10
8
 
11
9
  ## Quick Start
12
10
 
13
11
  ```bash
14
12
  # Install globally (one-time)
15
- git clone https://github.com/Jaggerxtrm/xtrm-tools.git
16
- cd xtrm-tools/cli
17
- npm install && npm run build
18
- npm link
13
+ npm install -g github:Jaggerxtrm/xtrm-tools@latest
19
14
 
20
- # Initialize a project and register gitnexus MCP
21
- xtrm project init
22
- ```
15
+ # Install the plugin
16
+ xtrm install all
23
17
 
24
- ## Table of Contents
18
+ # Verify
19
+ claude plugin list
20
+ # → xtrm-tools@xtrm-tools Version: 2.3.0 Status: ✔ enabled
21
+ ```
25
22
 
26
- - [Project Skills & Hooks](#project-skills--hooks)
27
- - [Global Skills](#global-skills)
28
- - [Installation](#installation)
29
- - [CLI User Guide](#cli-user-guide)
30
- - [Configuration](#configuration)
31
- - [Version History](#version-history)
32
- - [License](#license)
23
+ **One-line run:**
24
+ ```bash
25
+ npx -y github:Jaggerxtrm/xtrm-tools install all
26
+ ```
33
27
 
34
28
  ---
35
29
 
36
- ## Project Skills & Hooks
30
+ ## What's Included
37
31
 
38
- Project skills are modular, plug-and-play tool packages extending Claude's capabilities for specific workflows. They install into your project's `.claude/` directory and include specific hooks enforcing local workflow rules and quality gates.
32
+ ### Core Enforcement
39
33
 
40
- ### using-xtrm (Session Operating Manual)
41
- **The foundational operating manual for an xtrm-equipped session.**
42
- - **Invocation**: Activates automatically at session start via hook.
43
- - **Purpose**: Orients the agent on how to work within the xtrm stack: applying prompt improvement, using the beads issue-tracking gate, enforcing PR workflows, and combining the full toolset (gitnexus, Serena, quality gates, delegation).
44
- - **Core Workflow**: Provides the authoritative guide on feature-branch usage, requiring PRs for merges (with `--squash`), and stopping dangerous git commands on protected branches.
34
+ | Component | Purpose |
35
+ |-----------|---------|
36
+ | **Main Guard** | PR-only workflow blocks direct commits on `main`/`master` |
37
+ | **Beads Gates** | Issue tracking edit/commit/stop gates, memory prompts |
38
+ | **Quality Gates** | Auto linting (ESLint, tsc, ruff, mypy) on file edits |
39
+ | **GitNexus** | Knowledge graph context for code exploration |
45
40
 
46
- ### Quality Gates (`using-quality-gates`)
47
- Code quality enforcement via the **Pi Extension** (`quality-gates.ts`), which fires on every mutating file tool result.
48
- - **TypeScript/JS**: delegates to project-local `.claude/hooks/quality-check.cjs` (ESLint + tsc)
49
- - **Python**: delegates to project-local `.claude/hooks/quality-check.py` (ruff + mypy)
50
- - Exit code 2 = blocking — Claude must fix before continuing.
51
- - No classic hook entry required; runs automatically when the Pi extension is loaded.
41
+ ### Skills
52
42
 
53
- > **Note:** `tdd-guard` is available as an installable project skill (`xtrm install project tdd-guard`) but is not enforced by default.
43
+ | Skill | Type | Purpose |
44
+ |-------|------|---------|
45
+ | `using-xtrm` | Project | Session operating manual |
46
+ | `documenting` | Global | SSOT documentation with drift detection |
47
+ | `delegating` | Global | Task delegation to cost-optimized agents |
48
+ | `orchestrating-agents` | Global | Multi-model collaboration |
54
49
 
55
- ### Service Skills Set (Trinity)
56
- Task intake and service routing for Docker service projects.
57
- - **Invocation**: `/scope "task description"` or automatic via SessionStart hook.
58
- - **Purpose**: Gives Claude persistent, service-specific expertise without re-explaining architecture. Emits structured scope plans and detects codebase drift via PostToolUse hooks.
59
-
60
- ### Core Project Hooks
50
+ ---
61
51
 
62
- **Main Guard (`main-guard.mjs`)**
63
- - **Trigger**: PreToolUse (Write|Edit|MultiEdit|Serena edit tools|Bash)
64
- - **Purpose**: Enforces PR-only merge workflow with full git protection. Blocks direct commits and dangerous `git checkout` / `git push` commands on protected branches (`main/master`).
65
- - **Post-Push (`main-guard-post-push.mjs`)**: After pushing a feature branch, reminds to use `gh pr merge --squash` and sync local via `git reset --hard origin/main`.
52
+ ## Plugin Structure
66
53
 
67
- **GitNexus Graph Context (`gitnexus-hook.cjs`)**
68
- - **Trigger**: PostToolUse (with Serena support and dedup cache)
69
- - **Purpose**: Enriches tool output with knowledge graph context via `gitnexus augment`.
70
- - *Note: `gitnexus-impact-reminder` was removed as impact analysis enforcement is now native.*
54
+ ```
55
+ plugins/xtrm-tools/
56
+ ├── .claude-plugin/plugin.json # Manifest
57
+ ├── hooks ../../hooks # All hook scripts + hooks.json
58
+ ├── skills → ../../skills # Auto-discovered skills
59
+ └── .mcp.json → ../../.mcp.json # MCP servers
60
+ ```
71
61
 
72
- **Beads Issue Tracking Gates**
73
- - **Trigger**: PreToolUse (edit/commit), PostToolUse (claim sync), Stop (memory + stop gate), PreCompact, SessionStart
74
- - **Purpose**: Ensures all work is tracked to a `bd` issue. Blocks file edits without an active claim.
75
- - **Claim sync (`beads-claim-sync.mjs`)**: PostToolUse hook that syncs claim state after `bd update --claim` shell commands.
76
- - **Compaction**: `PreCompact` and `SessionStart` hooks preserve `in_progress` beads state across `/compact` events. Hook blocking messages are quieted and compacted to save tokens.
62
+ All hook paths use `${CLAUDE_PLUGIN_ROOT}` — works from any installation location.
77
63
 
78
64
  ---
79
65
 
80
- ## Global Skills
66
+ ## Policy System
81
67
 
82
- Global skills are reusable workflows installed to the user-level Claude environment (not tied to one repo).
68
+ Policies are the **single source of truth** for all enforcement rules. Located in `policies/`, they compile to both Claude hooks and Pi extensions.
83
69
 
84
- ### documenting
85
- Maintains Single Source of Truth (SSOT) documentation system with drift detection.
86
- - **Invocation**: `/document [task]`
87
- - **Purpose**: Creates, updates, and validates SSOT documentation. Auto-generates INDEX blocks for rapid navigation. A Stop hook fires at session end to detect stale memories based on the `tracks:` frontmatter field.
70
+ ### Policy Files
88
71
 
89
- ### delegating
90
- Proactively delegates tasks to cost-optimized agents before working in main session.
91
- - **Invocation**: `/delegate [task]` or `/delegating [task]`
92
- - **Purpose**: Routes simple deterministic tasks (tests, typos, formatting, docs) to GLM/Gemini/Qwen, and complex reasoning tasks to multi-agent orchestration. Interactive 2-step menu helps select the backend. Avoids main session token usage.
72
+ | Policy | Runtime | Purpose |
73
+ |--------|---------|---------|
74
+ | `main-guard.json` | both | PR-only workflow |
75
+ | `beads.json` | both | Issue tracking gates |
76
+ | `quality-gates.json` | pi | Linting/typechecking |
77
+ | `branch-state.json` | claude | Branch context injection |
78
+ | `gitnexus.json` | claude | Knowledge graph enrichment |
93
79
 
94
- ### orchestrating-agents
95
- Orchestrates task handoff and "handshaking" between Gemini and Qwen CLI agents.
96
- - **Invocation**: `/orchestrate [workflow-type] [task]`
97
- - **Purpose**: Facilitates multi-model collaboration, adversarial reviews, and deep cross-validation of complex logic. Workflows include collaborative design, adversarial security review, troubleshooting, and single handshakes.
80
+ ### Compiler
98
81
 
99
- ---
82
+ ```bash
83
+ node scripts/compile-policies.mjs # Generate hooks.json
84
+ node scripts/compile-policies.mjs --check # CI drift detection
85
+ ```
100
86
 
101
- ## Installation
87
+ ---
102
88
 
103
- ### 🚀 Quick One-Time Run
89
+ ## CLI Commands
104
90
 
105
- ```bash
106
- npx -y github:Jaggerxtrm/xtrm-tools install all
91
+ ```
92
+ xtrm <command> [options]
107
93
  ```
108
94
 
109
- ### 🛠️ Global Installation (Recommended)
95
+ | Command | Description |
96
+ |---------|-------------|
97
+ | `install all` | Full plugin + beads + gitnexus |
98
+ | `install basic` | Plugin + skills (no beads) |
99
+ | `install project <name>` | Install project skill |
100
+ | `project init` | Initialize project (gitnexus + bd) |
101
+ | `status` | Read-only diff view |
102
+ | `clean` | Remove orphaned hooks |
103
+
104
+ ### Flags
105
+
106
+ | Flag | Description |
107
+ |------|-------------|
108
+ | `--yes`, `-y` | Non-interactive mode |
109
+ | `--dry-run` | Preview only |
110
+ | `--prune` | Force-replace hooks |
110
111
 
111
- ```bash
112
- npm install -g github:Jaggerxtrm/xtrm-tools@latest
112
+ ---
113
113
 
114
- xtrm install all # Install to all global targets
115
- xtrm project init # Setup current project (runs gitnexus analyze + bd init)
116
- xtrm install project all # Install all project-specific skills
117
- ```
114
+ ## Hooks Reference
115
+
116
+ ### Event Types
117
+
118
+ | Event | When |
119
+ |-------|------|
120
+ | `SessionStart` | Session begins |
121
+ | `PreToolUse` | Before tool invocation |
122
+ | `PostToolUse` | After tool completes |
123
+ | `Stop` | Session ends |
124
+ | `PreCompact` | Before compaction |
125
+
126
+ ### Main Guard
127
+
128
+ - Blocks `git commit`/`push` on protected branches
129
+ - Blocks direct file edits on `main`/`master`
130
+ - Post-push reminder: `gh pr merge --squash`
131
+
132
+ ### Beads Gates
133
+
134
+ | Hook | Behavior |
135
+ |------|----------|
136
+ | Edit Gate | Requires claimed issue to edit files |
137
+ | Commit Gate | Prompts to close issue before commit |
138
+ | Stop Gate | Blocks session end with unclosed issues |
139
+ | Memory Gate | Prompts to persist insights when closing |
118
140
 
119
141
  ---
120
142
 
121
- ## CLI User Guide
143
+ ## MCP Servers
122
144
 
123
- ```
124
- xtrm <command> [options]
125
- ```
145
+ Configured in `.mcp.json`:
126
146
 
127
- | Command | Description |
128
- |---|---|
129
- | `install all` | Non-interactive global install to all detected targets (installs `gitnexus` globally) |
130
- | `install basic` | Interactive global installation |
131
- | `install project <name>` | Install specific project skills (e.g., `tdd-guard`, `service-skills-set`) |
132
- | `project init` | Onboarding: runs `gitnexus analyze`, registers MCP, and runs `bd init` |
133
- | `status` | Read-only diff view showing what would change (with inline sync prompt) |
134
- | `clean` | Removes orphaned hooks, stale wrappers, and dead skills from your system |
135
- | `reset` | Clear saved CLI preferences |
147
+ | Server | Purpose |
148
+ |--------|---------|
149
+ | `serena` | Code analysis via LSP |
150
+ | `context7` | Documentation lookup |
151
+ | `gitnexus` | Knowledge graph |
152
+ | `github-grep` | Code search |
136
153
 
137
154
  ---
138
155
 
139
- ## Configuration
156
+ ## Issue Tracking (Beads)
140
157
 
141
- ### MCP Servers
158
+ ```bash
159
+ bd ready # Find unblocked work
160
+ bd update <id> --claim # Claim an issue
161
+ bd close <id> --reason "Done" # Close when done
162
+ ```
142
163
 
143
- Unified CLI sync configures core servers securely.
164
+ ---
144
165
 
145
- **Core Servers**:
146
- - **serena**: Code analysis (requires `uvx`)
147
- - **context7**: Documentation lookup (requires `CONTEXT7_API_KEY`)
148
- - **github-grep**: Code search
149
- - **deepwiki**: Technical documentation
150
- - **gitnexus**: Knowledge graph code intelligence (registered during `xtrm project init`)
166
+ ## Documentation
151
167
 
152
- Configured via `~/.config/xtrm-tools/.env`. Run `xtrm install basic` to sync interactively.
168
+ - **[XTRM-GUIDE.md](XTRM-GUIDE.md)** Complete reference guide
169
+ - **[CHANGELOG.md](CHANGELOG.md)** — Full version history
170
+ - **[ROADMAP.md](ROADMAP.md)** — Planned features
153
171
 
154
172
  ---
155
173
 
156
174
  ## Version History
157
175
 
158
176
  | Version | Date | Highlights |
159
- |---|---|---|
160
- | 2.2.0 | 2026-03-17 | Pi extension parity: quality-gates, beads, service-skills, main-guard; `beads-claim-sync.mjs`; `xtrm clean` canonical wiring validation |
161
- | 2.1.20 | 2026-03-16 | `xtrm clean` command, compact hook messages, `pruneStaleWrappers` fixes |
162
- | 2.1.18 | 2026-03-16 | `PreCompact` / `SessionStart` hooks to preserve `in_progress` beads state |
163
- | 2.1.16 | 2026-03-15 | Removed deprecated skill-suggestion, gitnexus-impact-reminder hooks |
164
- | 2.1.14 | 2026-03-15 | Rewrote gitnexus-hook as PostToolUse with Serena; added `using-xtrm` skill |
165
- | 2.1.9 | 2026-03-15 | `main-guard` enforced PR-only workflow, `--squash` requirement, npm publish |
177
+ |---------|------|------------|
178
+ | 2.3.0 | 2026-03-17 | Plugin structure, policy compiler, Pi extension parity |
179
+ | 2.2.0 | 2026-03-17 | Pi extensions: quality-gates, beads, main-guard |
180
+ | 2.0.0 | 2026-03-12 | CLI rebrand, project skills engine |
181
+ | 1.7.0 | 2026-02-25 | GitNexus integration |
166
182
 
167
- See [CHANGELOG.md](CHANGELOG.md) for full history.
183
+ ---
168
184
 
169
185
  ## License
170
186
 
171
- MIT License - See LICENSE file for details.
187
+ MIT License
@@ -37236,13 +37236,24 @@ async function calculateDiff(repoRoot, systemRoot, pruneMode = false) {
37236
37236
  "qwen-commands": { missing: [], outdated: [], drifted: [], total: 0 },
37237
37237
  "antigravity-workflows": { missing: [], outdated: [], drifted: [], total: 0 }
37238
37238
  };
37239
+ const manifestPath = (0, import_path4.join)(systemRoot, ".jaggers-sync-manifest.json");
37240
+ let installedHashes = null;
37241
+ try {
37242
+ if (await import_fs_extra3.default.pathExists(manifestPath)) {
37243
+ const manifest = await import_fs_extra3.default.readJson(manifestPath);
37244
+ if (manifest.fileHashes && typeof manifest.fileHashes === "object") {
37245
+ installedHashes = manifest.fileHashes;
37246
+ }
37247
+ }
37248
+ } catch {
37249
+ }
37239
37250
  if (isAgentsSkills) {
37240
37251
  const repoPath = (0, import_path4.join)(repoRoot, "skills");
37241
37252
  if (!await import_fs_extra3.default.pathExists(repoPath)) return changeSet;
37242
37253
  const items = (await import_fs_extra3.default.readdir(repoPath)).filter((i) => !IGNORED_ITEMS.has(i));
37243
37254
  changeSet.skills.total = items.length;
37244
37255
  for (const item of items) {
37245
- await compareItem("skills", item, (0, import_path4.join)(repoPath, item), (0, import_path4.join)(systemRoot, item), changeSet, pruneMode);
37256
+ await compareItem("skills", item, (0, import_path4.join)(repoPath, item), (0, import_path4.join)(systemRoot, item), changeSet, pruneMode, installedHashes);
37246
37257
  }
37247
37258
  return changeSet;
37248
37259
  }
@@ -37269,7 +37280,8 @@ async function calculateDiff(repoRoot, systemRoot, pruneMode = false) {
37269
37280
  (0, import_path4.join)(repoPath, item),
37270
37281
  (0, import_path4.join)(systemPath, item),
37271
37282
  changeSet,
37272
- pruneMode
37283
+ pruneMode,
37284
+ installedHashes
37273
37285
  );
37274
37286
  }
37275
37287
  }
@@ -37281,12 +37293,12 @@ async function calculateDiff(repoRoot, systemRoot, pruneMode = false) {
37281
37293
  const itemRepoPath = (0, import_path4.join)(repoRoot, paths.repo);
37282
37294
  const itemSystemPath = (0, import_path4.join)(systemRoot, paths.sys);
37283
37295
  if (await import_fs_extra3.default.pathExists(itemRepoPath)) {
37284
- await compareItem("config", name, itemRepoPath, itemSystemPath, changeSet);
37296
+ await compareItem("config", name, itemRepoPath, itemSystemPath, changeSet, false, installedHashes);
37285
37297
  }
37286
37298
  }
37287
37299
  return changeSet;
37288
37300
  }
37289
- async function compareItem(category, item, repoPath, systemPath, changeSet, pruneMode = false) {
37301
+ async function compareItem(category, item, repoPath, systemPath, changeSet, pruneMode = false, installedHashes = null) {
37290
37302
  const cat = changeSet[category];
37291
37303
  if (!await import_fs_extra3.default.pathExists(systemPath)) {
37292
37304
  cat.missing.push(item);
@@ -37304,12 +37316,22 @@ async function compareItem(category, item, repoPath, systemPath, changeSet, prun
37304
37316
  return;
37305
37317
  }
37306
37318
  if (repoHash !== systemHash) {
37307
- const repoMtime = await getNewestMtime(repoPath);
37308
- const systemMtime = await getNewestMtime(systemPath);
37309
- if (systemMtime > repoMtime + 2e3) {
37310
- cat.drifted.push(item);
37319
+ const manifestKey = `${category}/${item}`;
37320
+ const installedHash = installedHashes?.[manifestKey];
37321
+ if (installedHash !== void 0) {
37322
+ if (systemHash !== installedHash) {
37323
+ cat.drifted.push(item);
37324
+ } else {
37325
+ cat.outdated.push(item);
37326
+ }
37311
37327
  } else {
37312
- cat.outdated.push(item);
37328
+ const repoMtime = await getNewestMtime(repoPath);
37329
+ const systemMtime = await getNewestMtime(systemPath);
37330
+ if (systemMtime > repoMtime + 2e3) {
37331
+ cat.drifted.push(item);
37332
+ } else {
37333
+ cat.outdated.push(item);
37334
+ }
37313
37335
  }
37314
37336
  }
37315
37337
  }
@@ -40508,7 +40530,32 @@ async function cleanupBackup(backup) {
40508
40530
  }
40509
40531
 
40510
40532
  // src/core/sync-executor.ts
40511
- var syncedMcpAgents = /* @__PURE__ */ new Set();
40533
+ async function syncMcpForTargets(repoRoot, targets, isDryRun = false, selectedMcpServers) {
40534
+ const synced = /* @__PURE__ */ new Set();
40535
+ let count = 0;
40536
+ for (const target of targets) {
40537
+ const agent = detectAgent(target);
40538
+ if (!agent || synced.has(agent)) continue;
40539
+ const coreConfig = loadCanonicalMcpConfig(repoRoot);
40540
+ const mcpToSync = { mcpServers: { ...coreConfig.mcpServers } };
40541
+ if (selectedMcpServers && selectedMcpServers.length > 0) {
40542
+ const optionalConfig = loadCanonicalMcpConfig(repoRoot, true);
40543
+ for (const name of selectedMcpServers) {
40544
+ if (optionalConfig.mcpServers[name]) {
40545
+ mcpToSync.mcpServers[name] = optionalConfig.mcpServers[name];
40546
+ }
40547
+ }
40548
+ }
40549
+ if (!isDryRun) {
40550
+ await syncMcpServersWithCli(agent, mcpToSync, isDryRun, false);
40551
+ } else {
40552
+ console.log(kleur_default.cyan(` [DRY RUN] MCP sync for ${agent}`));
40553
+ }
40554
+ synced.add(agent);
40555
+ count++;
40556
+ }
40557
+ return count;
40558
+ }
40512
40559
  function extractHookCommandPath(command) {
40513
40560
  const quoted = command.match(/"([^"]+)"/);
40514
40561
  if (quoted?.[1]) return quoted[1];
@@ -40544,7 +40591,7 @@ async function filterHooksByInstalledScripts(hooksConfig) {
40544
40591
  }
40545
40592
  return hooksConfig;
40546
40593
  }
40547
- async function executeSync(repoRoot, systemRoot, changeSet, mode, actionType, isDryRun = false, selectedMcpServers, options) {
40594
+ async function executeSync(repoRoot, systemRoot, changeSet, mode, actionType, isDryRun = false, options) {
40548
40595
  const normalizedRoot = import_path8.default.normalize(systemRoot).replace(/\\/g, "/");
40549
40596
  const isAgentsSkills = normalizedRoot.includes(".agents/skills");
40550
40597
  const isClaude = systemRoot.includes(".claude") || systemRoot.includes("Claude");
@@ -40555,27 +40602,9 @@ async function executeSync(repoRoot, systemRoot, changeSet, mode, actionType, is
40555
40602
  let count = 0;
40556
40603
  const adapter = new ConfigAdapter(systemRoot);
40557
40604
  const backups = [];
40605
+ const newHashes = {};
40558
40606
  try {
40559
40607
  const agent = detectAgent(systemRoot);
40560
- if (agent && actionType === "sync" && !syncedMcpAgents.has(agent) && !options?.skipMcp) {
40561
- const coreConfig = loadCanonicalMcpConfig(repoRoot);
40562
- const mcpToSync = { mcpServers: { ...coreConfig.mcpServers } };
40563
- if (selectedMcpServers && selectedMcpServers.length > 0) {
40564
- const optionalConfig = loadCanonicalMcpConfig(repoRoot, true);
40565
- for (const name of selectedMcpServers) {
40566
- if (optionalConfig.mcpServers[name]) {
40567
- mcpToSync.mcpServers[name] = optionalConfig.mcpServers[name];
40568
- }
40569
- }
40570
- }
40571
- if (!isDryRun) {
40572
- await syncMcpServersWithCli(agent, mcpToSync, isDryRun, false);
40573
- } else {
40574
- console.log(kleur_default.cyan(` [DRY RUN] MCP sync for ${agent}`));
40575
- }
40576
- syncedMcpAgents.add(agent);
40577
- count++;
40578
- }
40579
40608
  for (const category of categories) {
40580
40609
  const itemsToProcess = [];
40581
40610
  if (actionType === "sync") {
@@ -40608,6 +40637,11 @@ async function executeSync(repoRoot, systemRoot, changeSet, mode, actionType, is
40608
40637
  src = import_path8.default.join(repoRoot, "config", "settings.json");
40609
40638
  dest = import_path8.default.join(systemRoot, "settings.json");
40610
40639
  const agent2 = detectAgent(systemRoot);
40640
+ if (agent2 === "claude") {
40641
+ if (!isDryRun) console.log(kleur_default.dim(` (settings.json skipped \u2014 managed by xtrm-tools plugin)`));
40642
+ count++;
40643
+ continue;
40644
+ }
40611
40645
  console.log(kleur_default.gray(` --> config/settings.json`));
40612
40646
  if (!isDryRun && await import_fs_extra8.default.pathExists(dest)) {
40613
40647
  backups.push(await createBackup(dest));
@@ -40697,6 +40731,9 @@ async function executeSync(repoRoot, systemRoot, changeSet, mode, actionType, is
40697
40731
  await import_fs_extra8.default.copy(src, dest);
40698
40732
  }
40699
40733
  }
40734
+ if (!isDryRun && actionType === "sync") {
40735
+ newHashes[`${category}/${item}`] = await hashDirectory(src);
40736
+ }
40700
40737
  count++;
40701
40738
  }
40702
40739
  }
@@ -40707,7 +40744,8 @@ async function executeSync(repoRoot, systemRoot, changeSet, mode, actionType, is
40707
40744
  ...existing,
40708
40745
  lastSync: (/* @__PURE__ */ new Date()).toISOString(),
40709
40746
  repoRoot,
40710
- items: count
40747
+ items: count,
40748
+ fileHashes: { ...existing.fileHashes ?? {}, ...newHashes }
40711
40749
  }, { spaces: 2 });
40712
40750
  }
40713
40751
  for (const backup of backups) {
@@ -41846,6 +41884,7 @@ function isGitnexusInstalled() {
41846
41884
  async function needsSettingsSync(repoRoot, target) {
41847
41885
  const normalizedTarget = target.replace(/\\/g, "/").toLowerCase();
41848
41886
  if (normalizedTarget.includes(".agents/skills")) return false;
41887
+ if (detectAgent(target) === "claude") return false;
41849
41888
  const hooksTemplatePath = import_path13.default.join(repoRoot, "config", "hooks.json");
41850
41889
  if (!await import_fs_extra13.default.pathExists(hooksTemplatePath)) return false;
41851
41890
  const requiredEvents = Object.keys((await import_fs_extra13.default.readJson(hooksTemplatePath)).hooks ?? {});
@@ -41864,12 +41903,28 @@ async function needsSettingsSync(repoRoot, target) {
41864
41903
  }
41865
41904
  return requiredEvents.some((event) => !(event in targetHooks));
41866
41905
  }
41906
+ async function installPlugin(repoRoot, dryRun) {
41907
+ console.log(t.bold("\n \u2699 xtrm-tools (Claude Code plugin)"));
41908
+ if (dryRun) {
41909
+ console.log(t.accent(" [DRY RUN] Would register xtrm-tools marketplace and install plugin\n"));
41910
+ return;
41911
+ }
41912
+ (0, import_child_process5.spawnSync)("claude", ["plugin", "marketplace", "add", repoRoot, "--scope", "user"], { stdio: "pipe" });
41913
+ const listResult = (0, import_child_process5.spawnSync)("claude", ["plugin", "list"], { encoding: "utf8", stdio: "pipe" });
41914
+ if (listResult.stdout?.includes("xtrm-tools@xtrm-tools")) {
41915
+ (0, import_child_process5.spawnSync)("claude", ["plugin", "uninstall", "xtrm-tools@xtrm-tools"], { stdio: "inherit" });
41916
+ }
41917
+ (0, import_child_process5.spawnSync)("claude", ["plugin", "install", "xtrm-tools@xtrm-tools", "--scope", "user"], { stdio: "inherit" });
41918
+ console.log(t.success(" \u2713 xtrm-tools plugin installed\n"));
41919
+ }
41867
41920
  async function runGlobalInstall(flags, installOpts = {}) {
41868
41921
  const { dryRun, yes, noMcp, force } = flags;
41869
41922
  const effectiveYes = yes || process.argv.includes("--yes") || process.argv.includes("-y");
41870
41923
  const repoRoot = await findRepoRoot();
41871
41924
  const ctx = await getContext({ selector: "all", createMissingDirs: !dryRun });
41872
41925
  const { targets, syncMode } = ctx;
41926
+ const claudeTargets = targets.filter((t2) => detectAgent(t2) === "claude");
41927
+ const otherTargets = targets.filter((t2) => detectAgent(t2) !== "claude");
41873
41928
  let skipBeads = installOpts.excludeBeads ?? false;
41874
41929
  if (installOpts.checkBeads && !skipBeads) {
41875
41930
  console.log(t.bold("\n \u2699 beads + dolt (workflow enforcement backend)"));
@@ -41941,8 +41996,14 @@ async function runGlobalInstall(flags, installOpts = {}) {
41941
41996
  console.log(t.muted(" \u2139 Skipped. Install later with: npm install -g gitnexus\n"));
41942
41997
  }
41943
41998
  }
41999
+ for (const _claudeTarget of claudeTargets) {
42000
+ await installPlugin(repoRoot, dryRun);
42001
+ }
42002
+ if (otherTargets.length === 0) {
42003
+ return;
42004
+ }
41944
42005
  const diffTasks = new Listr(
41945
- targets.map((target) => ({
42006
+ otherTargets.map((target) => ({
41946
42007
  title: formatTargetLabel(target),
41947
42008
  task: async (listCtx, task) => {
41948
42009
  try {
@@ -41950,10 +42011,6 @@ async function runGlobalInstall(flags, installOpts = {}) {
41950
42011
  if (skipBeads) {
41951
42012
  changeSet = filterBeadsFromChangeSet(changeSet);
41952
42013
  }
41953
- const hasSettingsDiff = changeSet.config.missing.includes("settings.json") || changeSet.config.outdated.includes("settings.json") || changeSet.config.drifted.includes("settings.json");
41954
- if (!hasSettingsDiff && await needsSettingsSync(repoRoot, target)) {
41955
- changeSet.config.outdated.push("settings.json");
41956
- }
41957
42014
  const totalChanges = Object.values(changeSet).reduce(
41958
42015
  (sum, c) => sum + c.missing.length + c.outdated.length + c.drifted.length,
41959
42016
  0
@@ -41998,11 +42055,13 @@ async function runGlobalInstall(flags, installOpts = {}) {
41998
42055
  }
41999
42056
  }
42000
42057
  let totalCount = 0;
42058
+ if (!noMcp) {
42059
+ await syncMcpForTargets(repoRoot, otherTargets, dryRun);
42060
+ }
42001
42061
  for (const { target, changeSet, skippedDrifted } of allChanges) {
42002
42062
  console.log(t.bold(`
42003
42063
  ${sym.arrow} ${formatTargetLabel(target)}`));
42004
- const count = await executeSync(repoRoot, target, changeSet, syncMode, "sync", dryRun, void 0, {
42005
- skipMcp: noMcp,
42064
+ const count = await executeSync(repoRoot, target, changeSet, syncMode, "sync", dryRun, {
42006
42065
  force
42007
42066
  });
42008
42067
  totalCount += count;
@@ -42045,6 +42104,8 @@ function createInstallCommand() {
42045
42104
  createMissingDirs: !dryRun
42046
42105
  });
42047
42106
  const { targets, syncMode } = ctx;
42107
+ const claudeTargets = targets.filter((t2) => detectAgent(t2) === "claude");
42108
+ const otherTargets = targets.filter((t2) => detectAgent(t2) !== "claude");
42048
42109
  let skipBeads = false;
42049
42110
  if (!backport) {
42050
42111
  console.log(t.bold("\n \u2699 beads + dolt (workflow enforcement backend)"));
@@ -42092,8 +42153,13 @@ function createInstallCommand() {
42092
42153
  }
42093
42154
  }
42094
42155
  }
42156
+ if (!backport) {
42157
+ for (const _claudeTarget of claudeTargets) {
42158
+ await installPlugin(repoRoot, dryRun);
42159
+ }
42160
+ }
42095
42161
  const diffTasks = new Listr(
42096
- targets.map((target) => ({
42162
+ otherTargets.map((target) => ({
42097
42163
  title: formatTargetLabel(target),
42098
42164
  task: async (listCtx, task) => {
42099
42165
  try {
@@ -42128,20 +42194,8 @@ function createInstallCommand() {
42128
42194
  );
42129
42195
  const diffCtx = await diffTasks.run({ allChanges: [] });
42130
42196
  const allChanges = diffCtx.allChanges;
42131
- if (!backport && !dryRun) {
42132
- const emptyChangeSet = {
42133
- skills: { missing: [], outdated: [], drifted: [], total: 0 },
42134
- hooks: { missing: [], outdated: [], drifted: [], total: 0 },
42135
- config: { missing: [], outdated: [], drifted: [], total: 0 },
42136
- commands: { missing: [], outdated: [], drifted: [], total: 0 },
42137
- "qwen-commands": { missing: [], outdated: [], drifted: [], total: 0 },
42138
- "antigravity-workflows": { missing: [], outdated: [], drifted: [], total: 0 }
42139
- };
42140
- for (const target of targets) {
42141
- console.log(t.bold(`
42142
- ${sym.arrow} ${formatTargetLabel(target)}`));
42143
- await executeSync(repoRoot, target, emptyChangeSet, syncMode, "sync", false);
42144
- }
42197
+ if (!backport) {
42198
+ await syncMcpForTargets(repoRoot, otherTargets, dryRun);
42145
42199
  }
42146
42200
  if (allChanges.length === 0) {
42147
42201
  console.log("\n" + t.boldGreen("\u2713 Files are up-to-date") + "\n");