xtrm-tools 2.2.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 (286) hide show
  1. package/README.md +127 -104
  2. package/cli/dist/index.cjs +1078 -970
  3. package/cli/dist/index.cjs.map +1 -1
  4. package/cli/package.json +1 -1
  5. package/config/pi/extensions/beads.ts +33 -5
  6. package/config/pi/extensions/service-skills.ts +17 -9
  7. package/config/pi/install-schema.json +2 -1
  8. package/hooks/beads-gate-core.mjs +6 -4
  9. package/hooks/beads-memory-gate.mjs +12 -5
  10. package/hooks/hooks.json +126 -0
  11. package/package.json +3 -1
  12. package/skills/test-planning/SKILL.md +208 -0
  13. package/skills/test-planning/evals/evals.json +23 -0
  14. package/skills/using-xtrm/SKILL.md +5 -27
  15. package/project-skills/tdd-guard/.claude/hooks/tdd-guard-pretool-bridge.cjs +0 -103
  16. package/project-skills/tdd-guard/.claude/settings.json +0 -38
  17. package/project-skills/tdd-guard/.claude/skills/using-tdd-guard/SKILL.md +0 -79
  18. package/project-skills/tdd-guard/CLAUDE.md +0 -98
  19. package/project-skills/tdd-guard/CONTRIBUTING.md +0 -38
  20. package/project-skills/tdd-guard/DEVELOPMENT.md +0 -127
  21. package/project-skills/tdd-guard/LICENSE +0 -21
  22. package/project-skills/tdd-guard/README.md +0 -398
  23. package/project-skills/tdd-guard/docs/adr/001-claude-session-subdirectory.md +0 -52
  24. package/project-skills/tdd-guard/docs/adr/002-secure-claude-binary-path.md +0 -56
  25. package/project-skills/tdd-guard/docs/adr/003-remove-configurable-data-directory.md +0 -56
  26. package/project-skills/tdd-guard/docs/adr/004-monorepo-architecture.md +0 -64
  27. package/project-skills/tdd-guard/docs/adr/005-claude-project-dir-support.md +0 -55
  28. package/project-skills/tdd-guard/docs/adr/006-phpunit-separate-repository.md +0 -93
  29. package/project-skills/tdd-guard/docs/adr/007-golangci-lint-path-support.md +0 -83
  30. package/project-skills/tdd-guard/docs/adr/008-storybook-reporter-design.md +0 -182
  31. package/project-skills/tdd-guard/docs/assets/tdd-guard-demo-screenshot.gif +0 -0
  32. package/project-skills/tdd-guard/docs/config-migration.md +0 -143
  33. package/project-skills/tdd-guard/docs/configuration.md +0 -137
  34. package/project-skills/tdd-guard/docs/custom-instructions.md +0 -43
  35. package/project-skills/tdd-guard/docs/enforcement.md +0 -46
  36. package/project-skills/tdd-guard/docs/ignore-patterns.md +0 -81
  37. package/project-skills/tdd-guard/docs/linting.md +0 -109
  38. package/project-skills/tdd-guard/docs/quick-commands.md +0 -52
  39. package/project-skills/tdd-guard/docs/session-management.md +0 -75
  40. package/project-skills/tdd-guard/docs/storybook-vitest-addon.md +0 -120
  41. package/project-skills/tdd-guard/docs/validation-model.md +0 -63
  42. package/project-skills/tdd-guard/eslint.config.mjs +0 -140
  43. package/project-skills/tdd-guard/package-lock.json +0 -16937
  44. package/project-skills/tdd-guard/package.json +0 -102
  45. package/project-skills/tdd-guard/reporters/go/README.md +0 -67
  46. package/project-skills/tdd-guard/reporters/go/cmd/tdd-guard-go/main.go +0 -127
  47. package/project-skills/tdd-guard/reporters/go/cmd/tdd-guard-go/main_test.go +0 -280
  48. package/project-skills/tdd-guard/reporters/go/go.mod +0 -3
  49. package/project-skills/tdd-guard/reporters/go/go.sum +0 -0
  50. package/project-skills/tdd-guard/reporters/go/internal/formatter/formatter.go +0 -126
  51. package/project-skills/tdd-guard/reporters/go/internal/formatter/formatter_test.go +0 -264
  52. package/project-skills/tdd-guard/reporters/go/internal/io/tee_reader.go +0 -26
  53. package/project-skills/tdd-guard/reporters/go/internal/io/tee_reader_test.go +0 -37
  54. package/project-skills/tdd-guard/reporters/go/internal/parser/mixed_reader.go +0 -94
  55. package/project-skills/tdd-guard/reporters/go/internal/parser/mixed_reader_test.go +0 -198
  56. package/project-skills/tdd-guard/reporters/go/internal/parser/parser.go +0 -245
  57. package/project-skills/tdd-guard/reporters/go/internal/parser/parser_test.go +0 -547
  58. package/project-skills/tdd-guard/reporters/go/internal/storage/storage.go +0 -35
  59. package/project-skills/tdd-guard/reporters/go/internal/storage/storage_test.go +0 -113
  60. package/project-skills/tdd-guard/reporters/go/internal/transformer/transformer.go +0 -103
  61. package/project-skills/tdd-guard/reporters/go/internal/transformer/transformer_test.go +0 -303
  62. package/project-skills/tdd-guard/reporters/jest/README.md +0 -102
  63. package/project-skills/tdd-guard/reporters/jest/package.json +0 -38
  64. package/project-skills/tdd-guard/reporters/jest/src/JestReporter.test-data.ts +0 -199
  65. package/project-skills/tdd-guard/reporters/jest/src/JestReporter.test.ts +0 -302
  66. package/project-skills/tdd-guard/reporters/jest/src/JestReporter.ts +0 -201
  67. package/project-skills/tdd-guard/reporters/jest/src/index.ts +0 -4
  68. package/project-skills/tdd-guard/reporters/jest/src/types.ts +0 -42
  69. package/project-skills/tdd-guard/reporters/jest/tsconfig.json +0 -11
  70. package/project-skills/tdd-guard/reporters/phpunit/.php-cs-fixer.php +0 -28
  71. package/project-skills/tdd-guard/reporters/phpunit/README.md +0 -97
  72. package/project-skills/tdd-guard/reporters/phpunit/SYNC_README.md +0 -29
  73. package/project-skills/tdd-guard/reporters/phpunit/composer.json +0 -55
  74. package/project-skills/tdd-guard/reporters/phpunit/phpunit.xml.dist +0 -19
  75. package/project-skills/tdd-guard/reporters/phpunit/psalm.xml +0 -44
  76. package/project-skills/tdd-guard/reporters/phpunit/src/Event/ErroredTestSubscriber.php +0 -28
  77. package/project-skills/tdd-guard/reporters/phpunit/src/Event/FailedTestSubscriber.php +0 -28
  78. package/project-skills/tdd-guard/reporters/phpunit/src/Event/IncompleteTestSubscriber.php +0 -28
  79. package/project-skills/tdd-guard/reporters/phpunit/src/Event/PassedTestSubscriber.php +0 -27
  80. package/project-skills/tdd-guard/reporters/phpunit/src/Event/SkippedTestSubscriber.php +0 -28
  81. package/project-skills/tdd-guard/reporters/phpunit/src/Event/TestRunnerFinishedSubscriber.php +0 -24
  82. package/project-skills/tdd-guard/reporters/phpunit/src/PathValidator.php +0 -88
  83. package/project-skills/tdd-guard/reporters/phpunit/src/Storage.php +0 -26
  84. package/project-skills/tdd-guard/reporters/phpunit/src/TddGuardExtension.php +0 -33
  85. package/project-skills/tdd-guard/reporters/phpunit/src/TddGuardListener.php +0 -158
  86. package/project-skills/tdd-guard/reporters/phpunit/src/TddGuardSubscriber.php +0 -35
  87. package/project-skills/tdd-guard/reporters/phpunit/src/TestResultCollector.php +0 -105
  88. package/project-skills/tdd-guard/reporters/phpunit/tests/PathValidatorTest.php +0 -74
  89. package/project-skills/tdd-guard/reporters/phpunit/tests/TddGuardExtensionFailedTest.php +0 -241
  90. package/project-skills/tdd-guard/reporters/phpunit/tests/TddGuardExtensionTest.php +0 -84
  91. package/project-skills/tdd-guard/reporters/phpunit/tests/TddGuardStorageLocationTest.php +0 -71
  92. package/project-skills/tdd-guard/reporters/pytest/README.md +0 -77
  93. package/project-skills/tdd-guard/reporters/pytest/pyproject.toml +0 -43
  94. package/project-skills/tdd-guard/reporters/pytest/pytest.ini.example +0 -7
  95. package/project-skills/tdd-guard/reporters/pytest/tdd_guard_pytest/__init__.py +0 -1
  96. package/project-skills/tdd-guard/reporters/pytest/tdd_guard_pytest/pytest_reporter.py +0 -134
  97. package/project-skills/tdd-guard/reporters/pytest/tests/__init__.py +0 -1
  98. package/project-skills/tdd-guard/reporters/pytest/tests/conftest.py +0 -3
  99. package/project-skills/tdd-guard/reporters/pytest/tests/helpers.py +0 -293
  100. package/project-skills/tdd-guard/reporters/pytest/tests/test_config_option.py +0 -38
  101. package/project-skills/tdd-guard/reporters/pytest/tests/test_path_validation.py +0 -59
  102. package/project-skills/tdd-guard/reporters/pytest/tests/test_plugin_config.py +0 -32
  103. package/project-skills/tdd-guard/reporters/pytest/tests/test_project_root.py +0 -296
  104. package/project-skills/tdd-guard/reporters/pytest/tests/test_pytest_reporter.py +0 -137
  105. package/project-skills/tdd-guard/reporters/rspec/Gemfile +0 -3
  106. package/project-skills/tdd-guard/reporters/rust/Cargo.lock +0 -458
  107. package/project-skills/tdd-guard/reporters/rust/Cargo.toml +0 -33
  108. package/project-skills/tdd-guard/reporters/rust/Makefile.example +0 -95
  109. package/project-skills/tdd-guard/reporters/rust/README.md +0 -88
  110. package/project-skills/tdd-guard/reporters/rust/src/error_parser.rs +0 -309
  111. package/project-skills/tdd-guard/reporters/rust/src/main.rs +0 -464
  112. package/project-skills/tdd-guard/reporters/rust/src/parser.rs +0 -225
  113. package/project-skills/tdd-guard/reporters/rust/src/transformer.rs +0 -409
  114. package/project-skills/tdd-guard/reporters/storybook/README.md +0 -108
  115. package/project-skills/tdd-guard/reporters/storybook/package-lock.json +0 -9482
  116. package/project-skills/tdd-guard/reporters/storybook/package.json +0 -43
  117. package/project-skills/tdd-guard/reporters/storybook/src/StorybookReporter.test-data.ts +0 -22
  118. package/project-skills/tdd-guard/reporters/storybook/src/StorybookReporter.test.ts +0 -190
  119. package/project-skills/tdd-guard/reporters/storybook/src/StorybookReporter.ts +0 -88
  120. package/project-skills/tdd-guard/reporters/storybook/src/index.ts +0 -12
  121. package/project-skills/tdd-guard/reporters/storybook/src/types.ts +0 -37
  122. package/project-skills/tdd-guard/reporters/storybook/tsconfig.json +0 -11
  123. package/project-skills/tdd-guard/reporters/test/artifacts/go/failing/go.mod +0 -3
  124. package/project-skills/tdd-guard/reporters/test/artifacts/go/failing/single_failing_test.go +0 -13
  125. package/project-skills/tdd-guard/reporters/test/artifacts/go/import/go.mod +0 -3
  126. package/project-skills/tdd-guard/reporters/test/artifacts/go/import/single_import_error_test.go +0 -17
  127. package/project-skills/tdd-guard/reporters/test/artifacts/go/passing/go.mod +0 -3
  128. package/project-skills/tdd-guard/reporters/test/artifacts/go/passing/single_passing_test.go +0 -13
  129. package/project-skills/tdd-guard/reporters/test/artifacts/jest/single-failing.test.js +0 -5
  130. package/project-skills/tdd-guard/reporters/test/artifacts/jest/single-import-error.test.js +0 -8
  131. package/project-skills/tdd-guard/reporters/test/artifacts/jest/single-passing.test.js +0 -5
  132. package/project-skills/tdd-guard/reporters/test/artifacts/phpunit/SingleFailingTest.php +0 -11
  133. package/project-skills/tdd-guard/reporters/test/artifacts/phpunit/SingleImportErrorTest.php +0 -14
  134. package/project-skills/tdd-guard/reporters/test/artifacts/phpunit/SinglePassingTest.php +0 -11
  135. package/project-skills/tdd-guard/reporters/test/artifacts/pytest/test_single_failing.py +0 -3
  136. package/project-skills/tdd-guard/reporters/test/artifacts/pytest/test_single_import_error.py +0 -6
  137. package/project-skills/tdd-guard/reporters/test/artifacts/pytest/test_single_passing.py +0 -3
  138. package/project-skills/tdd-guard/reporters/test/artifacts/rust/failing/Cargo.lock +0 -7
  139. package/project-skills/tdd-guard/reporters/test/artifacts/rust/failing/Cargo.toml +0 -4
  140. package/project-skills/tdd-guard/reporters/test/artifacts/rust/failing/src/lib.rs +0 -14
  141. package/project-skills/tdd-guard/reporters/test/artifacts/rust/import/Cargo.lock +0 -7
  142. package/project-skills/tdd-guard/reporters/test/artifacts/rust/import/Cargo.toml +0 -4
  143. package/project-skills/tdd-guard/reporters/test/artifacts/rust/import/src/lib.rs +0 -13
  144. package/project-skills/tdd-guard/reporters/test/artifacts/rust/passing/Cargo.lock +0 -7
  145. package/project-skills/tdd-guard/reporters/test/artifacts/rust/passing/Cargo.toml +0 -4
  146. package/project-skills/tdd-guard/reporters/test/artifacts/rust/passing/src/lib.rs +0 -14
  147. package/project-skills/tdd-guard/reporters/test/artifacts/storybook/Calculator.js +0 -4
  148. package/project-skills/tdd-guard/reporters/test/artifacts/storybook/single-failing.stories.js +0 -15
  149. package/project-skills/tdd-guard/reporters/test/artifacts/storybook/single-import-error.stories.js +0 -14
  150. package/project-skills/tdd-guard/reporters/test/artifacts/storybook/single-passing.stories.js +0 -15
  151. package/project-skills/tdd-guard/reporters/test/artifacts/vitest/single-failing.test.js +0 -7
  152. package/project-skills/tdd-guard/reporters/test/artifacts/vitest/single-import-error.test.js +0 -9
  153. package/project-skills/tdd-guard/reporters/test/artifacts/vitest/single-passing.test.js +0 -7
  154. package/project-skills/tdd-guard/reporters/test/factories/go.ts +0 -59
  155. package/project-skills/tdd-guard/reporters/test/factories/helpers.ts +0 -48
  156. package/project-skills/tdd-guard/reporters/test/factories/index.ts +0 -7
  157. package/project-skills/tdd-guard/reporters/test/factories/jest.ts +0 -51
  158. package/project-skills/tdd-guard/reporters/test/factories/phpunit.ts +0 -63
  159. package/project-skills/tdd-guard/reporters/test/factories/pytest.ts +0 -41
  160. package/project-skills/tdd-guard/reporters/test/factories/rust.ts +0 -158
  161. package/project-skills/tdd-guard/reporters/test/factories/storybook.ts +0 -198
  162. package/project-skills/tdd-guard/reporters/test/factories/vitest.ts +0 -51
  163. package/project-skills/tdd-guard/reporters/test/reporters.integration.test.ts +0 -735
  164. package/project-skills/tdd-guard/reporters/test/types.ts +0 -28
  165. package/project-skills/tdd-guard/reporters/vitest/README.md +0 -64
  166. package/project-skills/tdd-guard/reporters/vitest/package.json +0 -35
  167. package/project-skills/tdd-guard/reporters/vitest/src/VitestReporter.test-data.ts +0 -85
  168. package/project-skills/tdd-guard/reporters/vitest/src/VitestReporter.test.ts +0 -446
  169. package/project-skills/tdd-guard/reporters/vitest/src/VitestReporter.ts +0 -110
  170. package/project-skills/tdd-guard/reporters/vitest/src/index.ts +0 -4
  171. package/project-skills/tdd-guard/reporters/vitest/src/types.ts +0 -39
  172. package/project-skills/tdd-guard/reporters/vitest/tsconfig.json +0 -11
  173. package/project-skills/tdd-guard/src/cli/buildContext.test.ts +0 -200
  174. package/project-skills/tdd-guard/src/cli/buildContext.ts +0 -48
  175. package/project-skills/tdd-guard/src/cli/tdd-guard.test.ts +0 -159
  176. package/project-skills/tdd-guard/src/cli/tdd-guard.ts +0 -48
  177. package/project-skills/tdd-guard/src/config/Config.test.ts +0 -538
  178. package/project-skills/tdd-guard/src/config/Config.ts +0 -172
  179. package/project-skills/tdd-guard/src/contracts/schemas/guardSchemas.test.ts +0 -58
  180. package/project-skills/tdd-guard/src/contracts/schemas/guardSchemas.ts +0 -8
  181. package/project-skills/tdd-guard/src/contracts/schemas/lintSchemas.test.ts +0 -347
  182. package/project-skills/tdd-guard/src/contracts/schemas/lintSchemas.ts +0 -61
  183. package/project-skills/tdd-guard/src/contracts/schemas/pytestSchemas.test.ts +0 -24
  184. package/project-skills/tdd-guard/src/contracts/schemas/pytestSchemas.ts +0 -7
  185. package/project-skills/tdd-guard/src/contracts/schemas/reporterSchemas.test.ts +0 -377
  186. package/project-skills/tdd-guard/src/contracts/schemas/reporterSchemas.ts +0 -75
  187. package/project-skills/tdd-guard/src/contracts/schemas/toolSchemas.test.ts +0 -563
  188. package/project-skills/tdd-guard/src/contracts/schemas/toolSchemas.ts +0 -140
  189. package/project-skills/tdd-guard/src/contracts/types/ClientType.ts +0 -1
  190. package/project-skills/tdd-guard/src/contracts/types/ConfigOptions.ts +0 -12
  191. package/project-skills/tdd-guard/src/contracts/types/Context.ts +0 -16
  192. package/project-skills/tdd-guard/src/contracts/types/ModelClient.ts +0 -3
  193. package/project-skills/tdd-guard/src/contracts/types/ValidationResult.ts +0 -6
  194. package/project-skills/tdd-guard/src/guard/GuardManager.test.ts +0 -336
  195. package/project-skills/tdd-guard/src/guard/GuardManager.ts +0 -83
  196. package/project-skills/tdd-guard/src/hooks/HookEvents.test.ts +0 -107
  197. package/project-skills/tdd-guard/src/hooks/HookEvents.ts +0 -39
  198. package/project-skills/tdd-guard/src/hooks/fileTypeDetection.ts +0 -16
  199. package/project-skills/tdd-guard/src/hooks/postToolLint.test.ts +0 -327
  200. package/project-skills/tdd-guard/src/hooks/postToolLint.ts +0 -165
  201. package/project-skills/tdd-guard/src/hooks/processHookData.test.ts +0 -465
  202. package/project-skills/tdd-guard/src/hooks/processHookData.ts +0 -203
  203. package/project-skills/tdd-guard/src/hooks/sessionHandler.test.ts +0 -136
  204. package/project-skills/tdd-guard/src/hooks/sessionHandler.ts +0 -31
  205. package/project-skills/tdd-guard/src/hooks/userPromptHandler.test.ts +0 -131
  206. package/project-skills/tdd-guard/src/hooks/userPromptHandler.ts +0 -55
  207. package/project-skills/tdd-guard/src/index.ts +0 -19
  208. package/project-skills/tdd-guard/src/linters/Linter.ts +0 -5
  209. package/project-skills/tdd-guard/src/linters/eslint/ESLint.test.ts +0 -183
  210. package/project-skills/tdd-guard/src/linters/eslint/ESLint.ts +0 -82
  211. package/project-skills/tdd-guard/src/linters/golangci/GolangciLint.test.ts +0 -170
  212. package/project-skills/tdd-guard/src/linters/golangci/GolangciLint.ts +0 -148
  213. package/project-skills/tdd-guard/src/processors/index.ts +0 -1
  214. package/project-skills/tdd-guard/src/processors/lintProcessor.ts +0 -77
  215. package/project-skills/tdd-guard/src/processors/testResults/TestResultsProcessor.test.ts +0 -303
  216. package/project-skills/tdd-guard/src/processors/testResults/TestResultsProcessor.ts +0 -255
  217. package/project-skills/tdd-guard/src/providers/LinterProvider.test.ts +0 -43
  218. package/project-skills/tdd-guard/src/providers/LinterProvider.ts +0 -20
  219. package/project-skills/tdd-guard/src/providers/ModelClientProvider.test.ts +0 -68
  220. package/project-skills/tdd-guard/src/providers/ModelClientProvider.ts +0 -22
  221. package/project-skills/tdd-guard/src/storage/FileStorage.test.ts +0 -76
  222. package/project-skills/tdd-guard/src/storage/FileStorage.ts +0 -108
  223. package/project-skills/tdd-guard/src/storage/MemoryStorage.ts +0 -57
  224. package/project-skills/tdd-guard/src/storage/Storage.test.ts +0 -227
  225. package/project-skills/tdd-guard/src/storage/Storage.ts +0 -17
  226. package/project-skills/tdd-guard/src/validation/context/context.test.ts +0 -364
  227. package/project-skills/tdd-guard/src/validation/context/context.ts +0 -155
  228. package/project-skills/tdd-guard/src/validation/models/AnthropicApi.test.ts +0 -171
  229. package/project-skills/tdd-guard/src/validation/models/AnthropicApi.ts +0 -49
  230. package/project-skills/tdd-guard/src/validation/models/ClaudeAgentSdk.test.ts +0 -167
  231. package/project-skills/tdd-guard/src/validation/models/ClaudeAgentSdk.ts +0 -54
  232. package/project-skills/tdd-guard/src/validation/models/ClaudeCli.test.ts +0 -239
  233. package/project-skills/tdd-guard/src/validation/models/ClaudeCli.ts +0 -57
  234. package/project-skills/tdd-guard/src/validation/prompts/file-types.ts +0 -52
  235. package/project-skills/tdd-guard/src/validation/prompts/operations/edit.ts +0 -58
  236. package/project-skills/tdd-guard/src/validation/prompts/operations/multi-edit.ts +0 -54
  237. package/project-skills/tdd-guard/src/validation/prompts/operations/write.ts +0 -54
  238. package/project-skills/tdd-guard/src/validation/prompts/response.ts +0 -40
  239. package/project-skills/tdd-guard/src/validation/prompts/rules.ts +0 -51
  240. package/project-skills/tdd-guard/src/validation/prompts/system-prompt.ts +0 -10
  241. package/project-skills/tdd-guard/src/validation/prompts/tools/lint-results.ts +0 -15
  242. package/project-skills/tdd-guard/src/validation/prompts/tools/test-output.ts +0 -14
  243. package/project-skills/tdd-guard/src/validation/prompts/tools/todos.ts +0 -9
  244. package/project-skills/tdd-guard/src/validation/validator.test.ts +0 -268
  245. package/project-skills/tdd-guard/src/validation/validator.ts +0 -159
  246. package/project-skills/tdd-guard/test/artifacts/go/.golangci.yml +0 -6
  247. package/project-skills/tdd-guard/test/artifacts/go/with-issues/file-with-issues.go +0 -12
  248. package/project-skills/tdd-guard/test/artifacts/go/with-issues/go.mod +0 -3
  249. package/project-skills/tdd-guard/test/artifacts/go/without-issues/file-without-issues.go +0 -7
  250. package/project-skills/tdd-guard/test/artifacts/go/without-issues/go.mod +0 -3
  251. package/project-skills/tdd-guard/test/artifacts/javascript/eslint.config.js +0 -20
  252. package/project-skills/tdd-guard/test/artifacts/javascript/file-with-issues.js +0 -12
  253. package/project-skills/tdd-guard/test/artifacts/javascript/file-without-issues.js +0 -10
  254. package/project-skills/tdd-guard/test/hooks/fileTypeDetection.test.ts +0 -26
  255. package/project-skills/tdd-guard/test/hooks/processHookData.fileType.test.ts +0 -46
  256. package/project-skills/tdd-guard/test/hooks/processHookData.python.test.ts +0 -68
  257. package/project-skills/tdd-guard/test/integration/test-context.test.ts +0 -66
  258. package/project-skills/tdd-guard/test/integration/validator.core.test.ts +0 -96
  259. package/project-skills/tdd-guard/test/integration/validator.scenarios.test.ts +0 -497
  260. package/project-skills/tdd-guard/test/utils/assertions.ts +0 -29
  261. package/project-skills/tdd-guard/test/utils/factories/contextFactory.ts +0 -30
  262. package/project-skills/tdd-guard/test/utils/factories/editFactory.ts +0 -82
  263. package/project-skills/tdd-guard/test/utils/factories/helpers.test.ts +0 -46
  264. package/project-skills/tdd-guard/test/utils/factories/helpers.ts +0 -46
  265. package/project-skills/tdd-guard/test/utils/factories/lintFactory.ts +0 -352
  266. package/project-skills/tdd-guard/test/utils/factories/modelClientProviderFactory.ts +0 -21
  267. package/project-skills/tdd-guard/test/utils/factories/multiEditFactory.ts +0 -79
  268. package/project-skills/tdd-guard/test/utils/factories/operations.ts +0 -57
  269. package/project-skills/tdd-guard/test/utils/factories/reporterFactory.ts +0 -55
  270. package/project-skills/tdd-guard/test/utils/factories/scenarios/index.ts +0 -22
  271. package/project-skills/tdd-guard/test/utils/factories/scenarios/languages/python.ts +0 -745
  272. package/project-skills/tdd-guard/test/utils/factories/scenarios/languages/typescript.ts +0 -767
  273. package/project-skills/tdd-guard/test/utils/factories/scenarios/types.ts +0 -77
  274. package/project-skills/tdd-guard/test/utils/factories/scenarios/utils.ts +0 -15
  275. package/project-skills/tdd-guard/test/utils/factories/sessionStartFactory.ts +0 -36
  276. package/project-skills/tdd-guard/test/utils/factories/testDefaults.ts +0 -90
  277. package/project-skills/tdd-guard/test/utils/factories/testResultsFactory.ts +0 -234
  278. package/project-skills/tdd-guard/test/utils/factories/todoFactory.ts +0 -99
  279. package/project-skills/tdd-guard/test/utils/factories/userPromptSubmitFactory.ts +0 -39
  280. package/project-skills/tdd-guard/test/utils/factories/writeFactory.ts +0 -70
  281. package/project-skills/tdd-guard/test/utils/index.ts +0 -131
  282. package/project-skills/tdd-guard/tsconfig.build.json +0 -16
  283. package/project-skills/tdd-guard/tsconfig.eslint.json +0 -17
  284. package/project-skills/tdd-guard/tsconfig.json +0 -32
  285. package/project-skills/tdd-guard/tsconfig.node.json +0 -10
  286. package/project-skills/tdd-guard/vitest.config.ts +0 -85
@@ -1,103 +0,0 @@
1
- #!/usr/bin/env node
2
- const { readFileSync } = require('node:fs');
3
- const { spawnSync } = require('node:child_process');
4
- const path = require('node:path');
5
-
6
- const CODE_EXTENSIONS = new Set([
7
- '.js', '.jsx', '.ts', '.tsx', '.mjs', '.cjs',
8
- '.py', '.php', '.go', '.rs', '.java', '.kt', '.kts',
9
- '.c', '.cc', '.cpp', '.cxx', '.h', '.hh', '.hpp',
10
- '.cs', '.rb', '.swift', '.scala', '.lua', '.sh', '.zsh', '.bash',
11
- ]);
12
-
13
- const SERENA_EDIT_TOOLS = new Set([
14
- 'mcp__serena__rename_symbol',
15
- 'mcp__serena__replace_symbol_body',
16
- 'mcp__serena__insert_after_symbol',
17
- 'mcp__serena__insert_before_symbol',
18
- ]);
19
-
20
- function isEditLikeTool(toolName) {
21
- if (!toolName) return false;
22
- if (toolName === 'Edit' || toolName === 'Write' || toolName === 'MultiEdit' || toolName === 'TodoWrite') {
23
- return true;
24
- }
25
- return SERENA_EDIT_TOOLS.has(toolName);
26
- }
27
-
28
- function pickFilePath(toolInput) {
29
- if (!toolInput || typeof toolInput !== 'object') return null;
30
-
31
- const direct = toolInput.file_path || toolInput.filePath || toolInput.path ||
32
- toolInput.relative_path || toolInput.relativePath;
33
- if (typeof direct === 'string' && direct.trim()) return direct;
34
-
35
- if (Array.isArray(toolInput.edits)) {
36
- for (const edit of toolInput.edits) {
37
- const p = edit?.file_path || edit?.filePath || edit?.path || edit?.relative_path || edit?.relativePath;
38
- if (typeof p === 'string' && p.trim()) return p;
39
- }
40
- }
41
-
42
- return null;
43
- }
44
-
45
- function isCodeFile(filePath) {
46
- if (!filePath) return true; // fail-open when no path is available
47
- return CODE_EXTENSIONS.has(path.extname(filePath).toLowerCase());
48
- }
49
-
50
- let payloadText = '';
51
- try {
52
- payloadText = readFileSync(0, 'utf8');
53
- } catch {
54
- process.exit(0);
55
- }
56
-
57
- let payload;
58
- try {
59
- payload = JSON.parse(payloadText);
60
- } catch {
61
- process.exit(0);
62
- }
63
-
64
- const toolName = payload.tool_name || '';
65
- if (!isEditLikeTool(toolName)) {
66
- process.exit(0);
67
- }
68
-
69
- const filePath = pickFilePath(payload.tool_input);
70
- if (!isCodeFile(filePath)) {
71
- process.exit(0);
72
- }
73
-
74
- const hookEnv = { ...process.env, VALIDATION_CLIENT: 'sdk' };
75
- delete hookEnv.MODEL_TYPE;
76
- delete hookEnv.TDD_GUARD_ANTHROPIC_API_KEY;
77
- delete hookEnv.ANTHROPIC_API_KEY;
78
- delete hookEnv.ANTHROPIC_BASE_URL;
79
-
80
- const result = spawnSync('tdd-guard', {
81
- input: payloadText,
82
- encoding: 'utf8',
83
- stdio: ['pipe', 'pipe', 'pipe'],
84
- env: hookEnv,
85
- });
86
-
87
- if (result.stdout) process.stdout.write(result.stdout);
88
-
89
- if (result.error) {
90
- process.exit(0);
91
- }
92
-
93
- const combinedOutput = `${result.stdout || ''}\n${result.stderr || ''}`;
94
- if (
95
- combinedOutput.includes('Error during validation:') &&
96
- combinedOutput.includes('API Error:') &&
97
- combinedOutput.includes('not valid JSON')
98
- ) {
99
- // Validation backend/parsing failure: do not hard-block edits.
100
- process.exit(0);
101
- }
102
-
103
- process.exit(result.status ?? 0);
@@ -1,38 +0,0 @@
1
- {
2
- "hooks": {
3
- "PreToolUse": [
4
- {
5
- "matcher": "Write|Edit|MultiEdit|TodoWrite|mcp__serena__rename_symbol|mcp__serena__replace_symbol_body|mcp__serena__insert_after_symbol|mcp__serena__insert_before_symbol",
6
- "hooks": [
7
- {
8
- "type": "command",
9
- "command": "node \"$CLAUDE_PROJECT_DIR/.claude/hooks/tdd-guard-pretool-bridge.cjs\"",
10
- "timeout": 30
11
- }
12
- ]
13
- }
14
- ],
15
- "UserPromptSubmit": [
16
- {
17
- "hooks": [
18
- {
19
- "type": "command",
20
- "command": "tdd-guard --prompt-check",
21
- "timeout": 15
22
- }
23
- ]
24
- }
25
- ],
26
- "SessionStart": [
27
- {
28
- "hooks": [
29
- {
30
- "type": "command",
31
- "command": "tdd-guard --session-init",
32
- "timeout": 5
33
- }
34
- ]
35
- }
36
- ]
37
- }
38
- }
@@ -1,79 +0,0 @@
1
- ---
2
- name: using-tdd-guard
3
- description: TDD Guard enforces Test-Driven Development workflow in Claude Code. Blocks implementation code until failing tests are written.
4
- ---
5
-
6
- # Using TDD Guard
7
-
8
- **TDD Guard** enforces Test-Driven Development workflow in Claude Code. It blocks implementation code until failing tests are written.
9
-
10
- ## What It Does
11
-
12
- - **Blocks Write/Edit** when no failing test exists
13
- - **Prevents over-implementation** beyond test requirements
14
- - **Integrates with test reporters** for real-time test status
15
-
16
- ## How It Works
17
-
18
- When you attempt to write implementation code:
19
-
20
- 1. TDD Guard intercepts the Write/Edit tool call
21
- 2. Checks if a failing test exists (via test reporter JSON)
22
- 3. If no failing test: **blocks the action** with guidance
23
- 4. If failing test exists: **allows** the implementation
24
-
25
- ## Test Reporters
26
-
27
- TDD Guard requires a language-specific test reporter installed in your project:
28
-
29
- | Language | Package | Setup |
30
- |----------|---------|-------|
31
- | TypeScript/JavaScript (Vitest) | `tdd-guard-vitest` | Add to `vitest.config.ts` |
32
- | TypeScript/JavaScript (Jest) | `tdd-guard-jest` | Add to `jest.config.ts` |
33
- | Python (pytest) | `tdd-guard-pytest` | Add to `conftest.py` |
34
- | PHP (PHPUnit) | `tdd-guard-phpunit` | Add to `phpunit.xml` |
35
- | Go | `tdd-guard-go` | Run with `go test` wrapper |
36
- | Rust | `tdd-guard-rust` | Run with `cargo nextest` |
37
-
38
- ## Example: Vitest Setup
39
-
40
- ```bash
41
- # Install reporter
42
- npm install --save-dev tdd-guard-vitest
43
- ```
44
-
45
- ```typescript
46
- // vitest.config.ts
47
- import { defineConfig } from 'vitest/config'
48
- import { VitestReporter } from 'tdd-guard-vitest'
49
-
50
- export default defineConfig({
51
- test: {
52
- reporters: [
53
- 'default',
54
- new VitestReporter('/absolute/path/to/your/project'),
55
- ],
56
- },
57
- })
58
- ```
59
-
60
- ## Commands
61
-
62
- - `tdd-guard check` - Verify failing test exists (called by hook)
63
- - `tdd-guard status` - Show current TDD state
64
- - `tdd-guard session-init` - Initialize session
65
-
66
- ## Troubleshooting
67
-
68
- **"No failing test found"**
69
- - Write a test that fails first
70
- - Ensure test reporter is installed and configured
71
- - Check test reporter JSON output path
72
-
73
- **"tdd-guard command not found"**
74
- - Install globally: `npm install -g tdd-guard`
75
-
76
- ## See Also
77
-
78
- - Full documentation: `.claude/docs/tdd-guard-readme.md`
79
- - Original repo: https://github.com/nizos/tdd-guard
@@ -1,98 +0,0 @@
1
- # TDD Guard
2
-
3
- ## Project Goal
4
-
5
- TDD Guard is a Claude Code hook that enforces Test-Driven Development by intercepting file operations.
6
- When Claude Code attempts to edit or write files, TDD Guard:
7
-
8
- 1. **Captures**: Intercepts Edit, MultiEdit, and Write operations
9
- 2. **Analyzes**: Examines test results, file paths, and code changes
10
- 3. **Validates**: Checks TDD compliance using an AI model
11
- 4. **Blocks**: Prevents operations that skip tests or over-implement
12
- 5. **Guides**: Explains violations and suggests corrections
13
-
14
- This automated enforcement maintains code quality without cluttering prompts with TDD reminders.
15
-
16
- ## Development Workflow
17
-
18
- ### Commit Guidelines
19
-
20
- - **Atomic commits**: Each commit represents one logical change with its tests
21
- - **Test and implementation together**: Never separate tests from the code they test
22
- - **Explain why, not what**: Commit messages should explain the reason for the change
23
- - **Conventional format**: Use prefixes to categorize changes: feat, fix, refactor, test, chore, docs
24
-
25
- Example: `feat: add network request filtering to reduce noise in captured data` (explains why, not just what)
26
-
27
- ## Project Structure
28
-
29
- The codebase is organized with core functionality in src/ and language-specific reporters:
30
-
31
- ```
32
- reporters/ # Language-specific test reporters
33
- ├── go/ # tdd-guard-go - Go test reporter
34
- ├── jest/ # tdd-guard-jest - Jest reporter (npm)
35
- ├── phpunit/ # tdd-guard/phpunit - PHPUnit reporter (composer)
36
- ├── pytest/ # tdd-guard-pytest - Pytest reporter (pip)
37
- ├── rspec/ # tdd-guard-rspec - RSpec reporter (gem)
38
- ├── rust/ # tdd-guard-rust - Rust test reporter (crates.io)
39
- ├── storybook/ # tdd-guard-storybook - Storybook test-runner reporter (npm)
40
- ├── test/ # Shared test artifacts and integration tests
41
- └── vitest/ # tdd-guard-vitest - Vitest reporter (npm)
42
-
43
- src/ # Main CLI application
44
- ├── cli/ # Hook entry point and context builder
45
- ├── config/ # Configuration management
46
- ├── contracts/ # Types and Zod schemas
47
- ├── guard/ # Guard enable/disable management
48
- ├── hooks/ # Claude Code hook parsing and processing
49
- ├── linters/ # ESLint integration for code quality
50
- ├── processors/ # Test result and lint processing
51
- ├── providers/ # Model and linter client factories
52
- ├── storage/ # Storage abstractions
53
- ├── validation/ # TDD principle validation
54
- │ ├── validator.ts # Sends context to AI model and parses response
55
- │ ├── context/ # Formats operations for AI validation
56
- │ ├── prompts/ # TDD validation rules and AI instructions
57
- │ └── models/ # Claude SDK and Anthropic API clients
58
- └── index.ts # Package entry point
59
-
60
- test/ # Main test suite (hooks, integration, utils)
61
- docs/ # Documentation (ADRs, configuration, etc.)
62
- ```
63
-
64
- ### Architecture
65
-
66
- TDD Guard is organized as a TypeScript project with integrated language-specific reporters:
67
-
68
- - **src/**: Core functionality including contracts, config, storage, and validation
69
- - **reporters/**: Language-specific test reporters (go, jest, phpunit, pytest, rspec, rust, storybook, vitest)
70
- - **test/**: Comprehensive test suite with integration tests and utilities
71
-
72
- ### Testing
73
-
74
- #### Guidelines
75
-
76
- - **Use test helpers**: Extract setup logic into helper functions placed at the bottom of test files
77
- - **Use test factories**: Always use factories from `test/utils/` instead of creating data inline
78
- - **Group tests effectively**: Use `describe` blocks and `beforeEach` for common setup
79
- - **Keep tests concise**: Keep as little logic in the tests themselves as possible
80
-
81
- #### Commands
82
-
83
- ```bash
84
- npm run build # Build main package and workspace reporters (jest, storybook, vitest)
85
- npm run test # All unit tests and base integration tests
86
- npm run test:unit # Fast unit tests only
87
- npm run test:reporters # Test all reporter implementations
88
- npm run lint # Check code style and quality
89
- npm run format # Auto-format code with Prettier
90
- npm run checks # Run all checks: typecheck, lint, format, and test
91
- ```
92
-
93
- ### Key Design Principles
94
-
95
- - **Interface-driven**: Core functionality defined by interfaces (`Storage`, `ModelClient`)
96
- - **Dependency injection**: Components receive dependencies as parameters
97
- - **Single responsibility**: Each module has one clear purpose
98
- - **Type safety**: Comprehensive TypeScript types with runtime validation
@@ -1,38 +0,0 @@
1
- # Contributing
2
-
3
- Thank you for your interest in contributing to TDD Guard. Contributions of all kinds are welcome and appreciated, whether it's fixing a bug, improving documentation, or proposing a new feature.
4
-
5
- These guidelines exist to help your contributions land smoothly and increase the chances of your work being merged quickly.
6
-
7
- ## Before You Start
8
-
9
- If you'd like to add a feature, add a reporter, change existing behavior, or make a significant refactor, please open an issue first so we can discuss the approach together. This helps us align on direction early and avoids situations where you invest significant effort on something that may not fit the project's current priorities.
10
-
11
- Bug fixes and small improvements are welcome as direct pull requests, though opening an issue first is still appreciated so we can track the change.
12
-
13
- ## Pull Requests
14
-
15
- Each pull request should address a single concern. A PR that fixes a bug should not also refactor unrelated code or update formatting elsewhere. If you find additional changes worth making along the way, please open a separate PR for those.
16
-
17
- Use meaningful titles that describe what the change accomplishes. The description should explain what the PR introduces and why. For significant design decisions, include an [Architecture Decision Record](docs/adr/).
18
-
19
- ### Core Requirements
20
-
21
- Implementation must be test driven with all relevant and affected tests passing. Run linting and formatting (`npm run checks`) and ensure the build succeeds (`npm run build`).
22
-
23
- ### Commit Messages
24
-
25
- Use conventional commits and communicate the why, not just what. Focus on the reasoning behind changes rather than describing what was changed.
26
-
27
- ### Reporter Contributions
28
-
29
- Project root path can be specified so that tests can be run from any directory in the project. For security, validate that the project root path is absolute and that it is the current working directory or an ancestor of it. Relevant cases must be added to reporter integration tests.
30
-
31
- ## Style Guidelines
32
-
33
- No emojis in code or documentation. Avoid generic or boilerplate content. Be deliberate and intentional. Keep it clean and concise.
34
-
35
- ## Development
36
-
37
- - [Development Guide](DEVELOPMENT.md) - Setup instructions and testing
38
- - [Dev Container setup](.devcontainer/README.md) - Consistent development environment
@@ -1,127 +0,0 @@
1
- # Development Guide
2
-
3
- ## Prerequisites
4
-
5
- ### Main Tests
6
-
7
- - Node.js 22+ and npm
8
-
9
- ### Reporter Tests
10
-
11
- - Node.js 22+ and npm
12
- - Python 3.8+ (for pytest reporter)
13
- - PHP 8.1+ and Composer (for PHPUnit reporter)
14
- - Go 1.21+ (for Go reporter)
15
- - Ruby 2.7+ and Bundler (for RSpec reporter)
16
- - Rust 1.70+ and Cargo (for Rust reporter)
17
- - Storybook <= 9.x (for Storybook reporter)
18
-
19
- ## Using Dev Containers
20
-
21
- For a consistent development environment with all dependencies pre-installed, see the [devcontainer setup guide](.devcontainer/README.md).
22
-
23
- ## Building
24
-
25
- Before running tests, install dependencies and build the TypeScript packages:
26
-
27
- ```bash
28
- # Install dependencies
29
- npm install
30
-
31
- # Build the main package and all workspaces
32
- npm run build
33
- ```
34
-
35
- ## Running Main Tests
36
-
37
- The main test suite covers the core TDD Guard functionality:
38
-
39
- ```bash
40
- # Run all tests
41
- npm test
42
-
43
- # Run unit tests only (faster)
44
- npm run test:unit
45
-
46
- # Run integration tests
47
- npm run test:integration
48
- ```
49
-
50
- ## Running Reporter Tests
51
-
52
- Reporter tests verify the language-specific test result collectors.
53
-
54
- ### Setup
55
-
56
- First, install the language-specific dependencies:
57
-
58
- ```bash
59
- # Install PHPUnit dependencies
60
- composer install -d reporters/phpunit
61
-
62
- # Set up Python virtual environment and install pytest
63
- python3 -m venv reporters/pytest/.venv
64
- reporters/pytest/.venv/bin/pip install -e reporters/pytest pytest
65
-
66
- # Build Go reporter
67
- go build -C reporters/go ./cmd/tdd-guard-go
68
-
69
- # Install RSpec dependencies
70
- bundle install --gemfile=reporters/rspec/Gemfile
71
-
72
- # Build Rust reporter
73
- cargo build --release --manifest-path reporters/rust/Cargo.toml
74
- ```
75
-
76
- ### Running Tests
77
-
78
- ```bash
79
- # Run all reporter tests
80
- npm run test:reporters
81
- ```
82
-
83
- ## Code Quality
84
-
85
- The project uses ESLint, Prettier, and TypeScript for code quality:
86
-
87
- ```bash
88
- # Run all checks (typecheck, lint, format, test)
89
- npm run checks
90
-
91
- # Individual commands
92
- npm run typecheck # Type checking
93
- npm run lint # Lint and auto-fix
94
- npm run format # Format code with Prettier
95
- ```
96
-
97
- ## Troubleshooting
98
-
99
- ### PHPUnit Issues
100
-
101
- If you get composer errors:
102
-
103
- - Ensure PHP 8.1+ is installed: `php --version`
104
- - Ensure Composer is installed: `composer --version`
105
-
106
- ### Python/pytest Issues
107
-
108
- If you get Python errors:
109
-
110
- - Ensure Python 3.8+ is installed: `python3 --version`
111
- - On some systems, you may need to install python3-venv: `sudo apt install python3-venv`
112
-
113
- ### Ruby/RSpec Issues
114
-
115
- If you get Ruby errors:
116
-
117
- - Ensure Ruby 2.7+ is installed: `ruby --version`
118
- - Ensure Bundler is installed: `bundle --version`
119
- - If Bundler is missing: `gem install bundler`
120
-
121
- ### Rust Issues
122
-
123
- If you get Rust errors:
124
-
125
- - Ensure Rust 1.70+ is installed: `rustc --version`
126
- - Ensure Cargo is installed: `cargo --version`
127
- - If Rust is missing: Install from [rustup.rs](https://rustup.rs/)
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 Nizar Selander
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.