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,398 +0,0 @@
1
- # TDD Guard
2
-
3
- [![npm version](https://badge.fury.io/js/tdd-guard.svg)](https://www.npmjs.com/package/tdd-guard)
4
- [![CI](https://github.com/nizos/tdd-guard/actions/workflows/ci.yml/badge.svg)](https://github.com/nizos/tdd-guard/actions/workflows/ci.yml)
5
- [![Security](https://github.com/nizos/tdd-guard/actions/workflows/security.yml/badge.svg)](https://github.com/nizos/tdd-guard/actions/workflows/security.yml)
6
- [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
7
-
8
- Automated Test-Driven Development enforcement for Claude Code.
9
-
10
- ## Overview
11
-
12
- TDD Guard ensures Claude Code follows Test-Driven Development principles. When your agent tries to skip tests or over-implement, TDD Guard blocks the action and explains what needs to happen instead.
13
-
14
- <p align="center">
15
- <a href="https://nizar.se/uploads/videos/tdd-guard-demo.mp4">
16
- <img src="docs/assets/tdd-guard-demo-screenshot.gif" alt="TDD Guard Demo" width="600">
17
- </a>
18
- <br>
19
- <em>Click to watch TDD Guard in action</em>
20
- </p>
21
-
22
- ## Features
23
-
24
- - **Test-First Enforcement** - Blocks implementation without failing tests
25
- - **Minimal Implementation** - Prevents code beyond current test requirements
26
- - **Lint Integration** - Enforces refactoring using your linting rules
27
- - **Multi-Language Support** - TypeScript, JavaScript, Python, PHP, Go, Rust, and Storybook
28
- - **Customizable Rules** - Adjust validation rules to match your TDD style
29
- - **Flexible Validation** - Choose faster or more capable models for your needs
30
- - **Session Control** - Toggle on and off mid-session
31
-
32
- ## Requirements
33
-
34
- - Node.js 22+
35
- - Claude Code or Anthropic API key
36
- - Test framework (Jest, Vitest, Storybook, pytest, PHPUnit, Go 1.24+, or Rust with cargo/cargo-nextest)
37
-
38
- ## Quick Start
39
-
40
- ### 1. Install TDD Guard
41
-
42
- Using npm:
43
-
44
- ```bash
45
- npm install -g tdd-guard
46
- ```
47
-
48
- Or using Homebrew:
49
-
50
- ```bash
51
- brew install tdd-guard
52
- ```
53
-
54
- ### 2. Add Test Reporter
55
-
56
- TDD Guard needs to capture test results from your test runner. Choose your language below:
57
-
58
- <details>
59
- <summary><b>JavaScript/TypeScript</b></summary>
60
-
61
- Choose your test runner:
62
-
63
- #### Vitest
64
-
65
- Install the [tdd-guard-vitest](https://www.npmjs.com/package/tdd-guard-vitest) reporter in your project:
66
-
67
- ```bash
68
- npm install --save-dev tdd-guard-vitest
69
- ```
70
-
71
- Add to your `vitest.config.ts`:
72
-
73
- ```typescript
74
- import { defineConfig } from 'vitest/config'
75
- import { VitestReporter } from 'tdd-guard-vitest'
76
-
77
- export default defineConfig({
78
- test: {
79
- reporters: [
80
- 'default',
81
- new VitestReporter('/Users/username/projects/my-app'),
82
- ],
83
- },
84
- })
85
- ```
86
-
87
- #### Jest
88
-
89
- Install the [tdd-guard-jest](https://www.npmjs.com/package/tdd-guard-jest) reporter in your project:
90
-
91
- ```bash
92
- npm install --save-dev tdd-guard-jest
93
- ```
94
-
95
- Add to your `jest.config.ts`:
96
-
97
- ```typescript
98
- import type { Config } from 'jest'
99
-
100
- const config: Config = {
101
- reporters: [
102
- 'default',
103
- [
104
- 'tdd-guard-jest',
105
- {
106
- projectRoot: '/Users/username/projects/my-app',
107
- },
108
- ],
109
- ],
110
- }
111
-
112
- export default config
113
- ```
114
-
115
- **Note:** For both Vitest and Jest, specify the project root path when your test config is not at the project root (e.g., in workspaces or monorepos). This ensures TDD Guard can find the test results. See the reporter configuration docs for more details:
116
-
117
- - [Vitest configuration](reporters/vitest/README.md#configuration)
118
- - [Jest configuration](reporters/jest/README.md#configuration)
119
-
120
- #### Storybook
121
-
122
- Install the [tdd-guard-storybook](https://www.npmjs.com/package/tdd-guard-storybook) reporter in your project:
123
-
124
- ```bash
125
- npm install --save-dev tdd-guard-storybook
126
- ```
127
-
128
- Add to your `.storybook/test-runner.js`:
129
-
130
- ```javascript
131
- const { getJestConfig } = require('@storybook/test-runner')
132
- const { StorybookReporter } = require('tdd-guard-storybook')
133
-
134
- module.exports = {
135
- ...getJestConfig(),
136
- reporters: [
137
- 'default',
138
- [
139
- StorybookReporter,
140
- {
141
- projectRoot: '/Users/username/projects/my-app',
142
- },
143
- ],
144
- ],
145
- }
146
- ```
147
-
148
- **Note:** Storybook test-runner uses Jest under the hood, so the reporter integrates via Jest's reporter API. Specify the project root path when your Storybook config is not at the project root. See the [Storybook reporter configuration](reporters/storybook/README.md#configuration) for more details.
149
-
150
- **Tip:** For Storybook 10+ with Vite-based frameworks, consider using [`@storybook/addon-vitest`](https://storybook.js.org/docs/writing-tests/integrations/vitest-addon) instead. This runs Storybook tests through Vitest, allowing you to use the `tdd-guard-vitest` reporter for faster test execution. See [Storybook with Vitest Addon](docs/storybook-vitest-addon.md) for setup instructions.
151
-
152
- </details>
153
-
154
- <details>
155
- <summary><b>Python (pytest)</b></summary>
156
-
157
- Install the [tdd-guard-pytest](https://pypi.org/project/tdd-guard-pytest) reporter:
158
-
159
- ```bash
160
- pip install tdd-guard-pytest
161
- ```
162
-
163
- Configure the project root in your `pyproject.toml`:
164
-
165
- ```toml
166
- [tool.pytest.ini_options]
167
- tdd_guard_project_root = "/Users/username/projects/my-app"
168
- ```
169
-
170
- **Note:** Specify the project root path when your tests run from a subdirectory or in a monorepo setup. This ensures TDD Guard can find the test results. See the [pytest reporter configuration](reporters/pytest/README.md#configuration) for alternative configuration methods (pytest.ini, setup.cfg).
171
-
172
- </details>
173
-
174
- <details>
175
- <summary><b>PHP (PHPUnit)</b></summary>
176
-
177
- Install the [tdd-guard/phpunit](https://packagist.org/packages/tdd-guard/phpunit) reporter in your project:
178
-
179
- ```bash
180
- composer require --dev tdd-guard/phpunit
181
- ```
182
-
183
- For PHPUnit 9.x, add to your `phpunit.xml`:
184
-
185
- ```xml
186
- <listeners>
187
- <listener class="TddGuard\PHPUnit\TddGuardListener">
188
- <arguments>
189
- <string>/Users/username/projects/my-app</string>
190
- </arguments>
191
- </listener>
192
- </listeners>
193
- ```
194
-
195
- For PHPUnit 10.x/11.x/12.x, add to your `phpunit.xml`:
196
-
197
- ```xml
198
- <extensions>
199
- <bootstrap class="TddGuard\PHPUnit\TddGuardExtension">
200
- <parameter name="projectRoot" value="/Users/username/projects/my-app"/>
201
- </bootstrap>
202
- </extensions>
203
- ```
204
-
205
- **Note:** Specify the project root path when your phpunit.xml is not at the project root (e.g., in subdirectories or monorepos). This ensures TDD Guard can find the test results. The reporter saves results to `.claude/tdd-guard/data/test.json`.
206
-
207
- </details>
208
-
209
- <details>
210
- <summary><b>Go</b></summary>
211
-
212
- Install the tdd-guard-go reporter:
213
-
214
- ```bash
215
- go install github.com/nizos/tdd-guard/reporters/go/cmd/tdd-guard-go@latest
216
- ```
217
-
218
- Pipe `go test -json` output to the reporter:
219
-
220
- ```bash
221
- go test -json ./... 2>&1 | tdd-guard-go -project-root /Users/username/projects/my-app
222
- ```
223
-
224
- For Makefile integration:
225
-
226
- ```makefile
227
- test:
228
- go test -json ./... 2>&1 | tdd-guard-go -project-root /Users/username/projects/my-app
229
- ```
230
-
231
- **Note:** The reporter acts as a filter that passes test output through unchanged while capturing results for TDD Guard. See the [Go reporter configuration](reporters/go/README.md#configuration) for more details.
232
-
233
- </details>
234
-
235
- <details>
236
- <summary><b>Rust</b></summary>
237
-
238
- Install the [tdd-guard-rust](https://crates.io/crates/tdd-guard-rust) reporter:
239
-
240
- ```bash
241
- cargo install tdd-guard-rust
242
- ```
243
-
244
- Use it to capture test results from `cargo test` or `cargo nextest`:
245
-
246
- ```bash
247
- # With nextest (recommended)
248
- cargo nextest run 2>&1 | tdd-guard-rust --project-root /Users/username/projects/my-app --passthrough
249
-
250
- # With cargo test
251
- cargo test -- -Z unstable-options --format json 2>&1 | tdd-guard-rust --project-root /Users/username/projects/my-app --passthrough
252
- ```
253
-
254
- For Makefile integration:
255
-
256
- ```makefile
257
- test:
258
- cargo nextest run 2>&1 | tdd-guard-rust --project-root $(PWD) --passthrough
259
- ```
260
-
261
- **Note:** The reporter acts as a filter that passes test output through unchanged while capturing results for TDD Guard. See the [Rust reporter configuration](reporters/rust/README.md#configuration) for more details.
262
-
263
- </details>
264
-
265
- ### 3. Configure Claude Code Hooks
266
-
267
- TDD Guard uses hooks to validate operations and provide convenience features like quick toggle commands and automatic session management.
268
-
269
- Choose either interactive or manual setup below:
270
-
271
- <details>
272
- <summary><b>Interactive Setup</b></summary>
273
-
274
- Type `/hooks` in Claude Code to open the hooks menu, then configure each hook. Use the same location for all hooks. See [Settings File Locations](docs/configuration.md#settings-file-locations) for guidance.
275
-
276
- **PreToolUse Hook**
277
-
278
- 1. Select `PreToolUse - Before tool execution`
279
- 2. Choose `+ Add new matcher...` and enter: `Write|Edit|MultiEdit|TodoWrite|mcp__serena__rename_symbol|mcp__serena__replace_symbol_body|mcp__serena__insert_after_symbol|mcp__serena__insert_before_symbol`
280
- 3. Select `+ Add new hook...` and enter: `node "$CLAUDE_PROJECT_DIR/.claude/hooks/tdd-guard-pretool-bridge.cjs"`
281
- 4. Choose where to save
282
-
283
- **UserPromptSubmit Hook**
284
-
285
- 1. Select `UserPromptSubmit - When the user submits a prompt`
286
- 2. Select `+ Add new hook...` and enter: `tdd-guard`
287
- 3. Choose same location as PreToolUse
288
-
289
- **SessionStart Hook**
290
-
291
- 1. Select `SessionStart - When a new session is started`
292
- 2. Select `+ Add new matcher...` and enter: `startup|resume|clear`
293
- 3. Select `+ Add new hook...` and enter: `tdd-guard`
294
- 4. Choose same location as previous hooks
295
-
296
- </details>
297
-
298
- <details>
299
- <summary><b>Manual Configuration</b></summary>
300
-
301
- If you prefer to edit settings files directly, add all three hooks to your chosen settings file. See [Settings File Locations](docs/configuration.md#settings-file-locations) to choose the appropriate file:
302
-
303
- ```json
304
- {
305
- "hooks": {
306
- "PreToolUse": [
307
- {
308
- "matcher": "Write|Edit|MultiEdit|TodoWrite|mcp__serena__rename_symbol|mcp__serena__replace_symbol_body|mcp__serena__insert_after_symbol|mcp__serena__insert_before_symbol",
309
- "hooks": [
310
- {
311
- "type": "command",
312
- "command": "node \"$CLAUDE_PROJECT_DIR/.claude/hooks/tdd-guard-pretool-bridge.cjs\""
313
- }
314
- ]
315
- }
316
- ],
317
- "UserPromptSubmit": [
318
- {
319
- "hooks": [
320
- {
321
- "type": "command",
322
- "command": "tdd-guard"
323
- }
324
- ]
325
- }
326
- ],
327
- "SessionStart": [
328
- {
329
- "matcher": "startup|resume|clear",
330
- "hooks": [
331
- {
332
- "type": "command",
333
- "command": "tdd-guard"
334
- }
335
- ]
336
- }
337
- ]
338
- }
339
- }
340
- ```
341
-
342
- </details>
343
-
344
- **Note**: The pretool bridge skips non-code files (for example `.md`) and forwards code edits to `tdd-guard`, which avoids false positives on documentation-only changes.
345
-
346
- ## Additional Configuration
347
-
348
- - [Custom instructions](docs/custom-instructions.md) - Customize TDD validation rules
349
- - [Lint integration](docs/linting.md) - Automated refactoring support
350
- - [Strengthening enforcement](docs/enforcement.md) - Prevent agents from bypassing validation
351
- - [Ignore patterns](docs/ignore-patterns.md) - Control which files are validated
352
- - [Validation Model](docs/validation-model.md) - Choose faster or more capable model
353
-
354
- ## Security Notice
355
-
356
- As stated in the [Claude Code Hooks documentation](https://docs.anthropic.com/en/docs/claude-code/hooks#security-considerations):
357
-
358
- > Hooks execute shell commands with your full user permissions without confirmation. You are responsible for ensuring your hooks are safe and secure. Anthropic is not liable for any data loss or system damage resulting from hook usage.
359
-
360
- We share this information for transparency. Please read the full [security considerations](https://docs.anthropic.com/en/docs/claude-code/hooks#security-considerations) before using hooks.
361
-
362
- TDD Guard runs with your user permissions and has access to your file system. We follow security best practices including automated security scanning, dependency audits, and test-driven development. Review the source code if you have security concerns.
363
-
364
- ## Roadmap
365
-
366
- - Add support for more testing frameworks (Mocha, unittest, etc.)
367
- - Add support for additional programming languages (Ruby, Java, C#, etc.)
368
- - Validate file modifications made through MCPs and shell commands
369
- - Add integration for OpenCode and other vendor-agnostic AI coding tools
370
- - Encourage meaningful refactoring opportunities when tests are green
371
- - Add support for multiple concurrent sessions per project
372
-
373
- ## Development
374
-
375
- - [Development Guide](DEVELOPMENT.md) - Setup instructions and development guidelines
376
- - [Architecture Decision Records](docs/adr/) - Technical design decisions and rationale
377
-
378
- ## Contributing
379
-
380
- Contributions are welcome! Feel free to submit issues and pull requests.
381
-
382
- **Contributors:**
383
-
384
- - Python/pytest support: [@Durafen](https://github.com/Durafen)
385
- - PHP/PHPUnit support: [@wazum](https://github.com/wazum)
386
- - Rust/cargo support: [@104hp6u](https://github.com/104hp6u)
387
- - Go support: [@sQVe](https://github.com/sQVe), [@wizzomafizzo](https://github.com/wizzomafizzo)
388
- - Storybook support: [@akornmeier](https://github.com/akornmeier)
389
-
390
- ## Support
391
-
392
- - [Configuration](docs/configuration.md) - Complete settings documentation
393
- - [Discussions](https://github.com/nizos/tdd-guard/discussions) - Ask questions and share ideas
394
- - [Issues](https://github.com/nizos/tdd-guard/issues) - Report bugs and request features
395
-
396
- ## License
397
-
398
- [MIT](LICENSE)
@@ -1,52 +0,0 @@
1
- # ADR-001: Execute Claude CLI from Subdirectory for Session Management
2
-
3
- ## Status
4
-
5
- Accepted
6
-
7
- ## Context
8
-
9
- The TDD Guard validation system creates a new Claude session for each validation operation when running `claude` commands. This results in session list clutter and makes it difficult to track the actual development sessions.
10
-
11
- We considered two approaches:
12
-
13
- 1. Clear the context before each validation using `/clear` command
14
- 2. Run the Claude CLI from a subdirectory to isolate validation sessions
15
-
16
- The first approach has limitations:
17
-
18
- - Cannot clear and ask a question in the same command
19
- - Would require multiple command executions
20
- - Still shows all sessions in the same directory listing
21
-
22
- ## Decision
23
-
24
- We will execute all Claude validation commands from a `.claude` subdirectory within the project root.
25
-
26
- Implementation details:
27
-
28
- - Create `.claude` directory if it doesn't exist
29
- - Set the `cwd` option in `execSync` to the subdirectory path
30
- - The `.claude` directory itself is not ignored (contains settings.json which should be tracked)
31
- - User-specific files like `.claude/settings.local.json` should already be in `.gitignore`
32
-
33
- ## Consequences
34
-
35
- ### Positive
36
-
37
- - Validation sessions are isolated from development sessions
38
- - No cluttering of the main project's session list
39
- - Automatic trust inheritance from parent directory
40
- - Simple implementation with minimal code changes
41
- - No impact on validation functionality
42
-
43
- ### Negative
44
-
45
- - Creates an additional directory in the project
46
- - Slightly increases complexity in the model client
47
- - Sessions are less visible (though this is mostly a benefit)
48
-
49
- ### Neutral
50
-
51
- - All validation sessions will appear in the `.claude` subdirectory listing
52
- - Developers need to know to look in `.claude` for validation session history
@@ -1,56 +0,0 @@
1
- # ADR-002: Secure Claude Binary Path Configuration
2
-
3
- ## Status
4
-
5
- Accepted
6
-
7
- ## Context
8
-
9
- CodeQL security scanning identified a potential command injection vulnerability in `ClaudeModelClient` where the Claude binary path is taken from an environment variable (`CLAUDE_BINARY_PATH`) and interpolated into a shell command executed via `execSync`.
10
-
11
- The vulnerability occurs because:
12
-
13
- - Environment variables can be manipulated by attackers
14
- - Shell metacharacters in the path could be interpreted, allowing arbitrary command execution
15
- - For example, setting `CLAUDE_BINARY_PATH="claude; rm -rf /"` would execute both commands
16
-
17
- We considered several approaches:
18
-
19
- 1. **Use execFileSync instead of execSync** - Avoids shell interpretation entirely
20
- 2. **Validate/sanitize the binary path** - Check for allowed characters only
21
- 3. **Use shell-quote library** - Properly escape shell metacharacters
22
- 4. **Boolean flag for predefined paths** - Switch between hardcoded safe paths
23
-
24
- ## Decision
25
-
26
- We will use a boolean environment variable `USE_LOCAL_CLAUDE` to switch between two hardcoded, safe paths:
27
-
28
- - When `USE_LOCAL_CLAUDE=true`: Use `$HOME/.claude/local/claude`
29
- - Otherwise: Use system `claude` command
30
-
31
- Additionally, we will:
32
-
33
- - Implement the path logic in `ClaudeModelClient` rather than `Config` class
34
- - Use `execFileSync` instead of `execSync` to prevent shell interpretation
35
- - Keep the Config class focused on just providing the boolean flag
36
-
37
- ## Consequences
38
-
39
- ### Positive
40
-
41
- - **Eliminates injection risk** - No user-controlled input in command construction
42
- - **Simple and secure** - Only two possible paths, both hardcoded
43
- - **Clear intent** - Boolean flag clearly indicates local vs system Claude
44
- - **Separation of concerns** - Config provides settings, ModelClient handles implementation
45
- - **Future flexibility** - ModelClient can handle OS-specific paths internally
46
-
47
- ### Negative
48
-
49
- - **Less flexible** - Users cannot specify custom installation paths
50
- - **Requires code changes** - Adding new paths requires updating the code
51
- - **Platform-specific paths** - May need adjustment for different operating systems
52
-
53
- ### Neutral
54
-
55
- - Migration from `CLAUDE_BINARY_PATH` to `USE_LOCAL_CLAUDE` for existing users
56
- - Documentation needs to be updated to reflect the new configuration approach
@@ -1,56 +0,0 @@
1
- # ADR-003: Remove Configurable Data Directory
2
-
3
- ## Status
4
-
5
- Accepted
6
-
7
- ## Context
8
-
9
- A security review identified a potential path traversal vulnerability in TDD Guard where the data directory path is taken from an environment variable (`TDD_DATA_DIR`) and used directly for file system operations without validation.
10
-
11
- The vulnerability occurs because:
12
-
13
- - Environment variables can be manipulated by attackers
14
- - Path traversal sequences (`../`) in the path could escape the intended directory
15
- - For example, setting `TDD_DATA_DIR="../../../../etc"` would write files to system directories
16
- - The application writes files like `test.txt`, `todo.json`, and `modifications.json` to this directory
17
-
18
- We considered several approaches:
19
-
20
- 1. **Validate and sanitize the path** - Check for `../` sequences and resolve to absolute paths
21
- 2. **Restrict to project subdirectories** - Ensure the path stays within the project root
22
- 3. **Use a whitelist of allowed paths** - Only allow specific predefined directories
23
- 4. **Remove the configuration entirely** - Hardcode the data directory path
24
-
25
- ## Decision
26
-
27
- We will remove the `TDD_DATA_DIR` environment variable and hardcode the data directory path to `.claude/tdd-guard/data` in the Config class.
28
-
29
- The implementation will:
30
-
31
- - Remove `TDD_DATA_DIR` from environment variable processing
32
- - Hardcode `dataDir` to `.claude/tdd-guard/data` in the Config constructor
33
- - Keep the existing Config class interface unchanged for dependent code
34
- - Remove documentation about `TDD_DATA_DIR` from `.env.example`, README, and CLAUDE.md
35
-
36
- ## Consequences
37
-
38
- ### Positive
39
-
40
- - **Eliminates path traversal risk** - No user-controlled input for file paths
41
- - **Simpler implementation** - No validation or sanitization code needed
42
- - **Consistent data location** - All TDD Guard data in a predictable location
43
- - **Better security posture** - Follows principle of least privilege
44
- - **No breaking changes for code** - Config class interface remains the same
45
-
46
- ### Negative
47
-
48
- - **Less flexible** - Users cannot customize where TDD Guard stores its data
49
- - **Potential disk space issues** - Users cannot redirect to different drives/partitions
50
- - **Testing limitations** - Integration tests cannot use isolated data directories
51
-
52
- ### Neutral
53
-
54
- - The data stored (test results, todos, modifications) is operational/temporary
55
- - Most users likely never customized this path anyway
56
- - Follows the same security-first approach as ADR-002
@@ -1,64 +0,0 @@
1
- # ADR-004: Monorepo Architecture for Multi-Language Support
2
-
3
- ## Status
4
-
5
- Accepted
6
-
7
- ## Context
8
-
9
- TDD Guard originally published a single package to both npm and PyPI, with all test framework reporters mixed together in the src directory. This created several problems:
10
-
11
- - **Language mixing** - JavaScript and Python code in the same package
12
- - **Publishing complexity** - Single codebase published to multiple package registries
13
- - **Package bloat** - Users installed code for all languages even if using only one
14
- - **Contribution barriers** - Adding new reporters required navigating the entire codebase
15
-
16
- We considered several approaches:
17
-
18
- 1. **Keep monolithic structure** - Continue with mixed languages in one package
19
- 2. **Separate repositories** - Create individual repos for each reporter
20
- 3. **Monorepo with workspaces** - Keep one repo but separate packages
21
-
22
- ## Decision
23
-
24
- We will restructure TDD Guard as a monorepo using npm workspaces, with each reporter as a separate package.
25
-
26
- The new structure:
27
-
28
- ```
29
- tdd-guard/ # Main CLI package (npm)
30
- ├── src/ # Core functionality and shared code
31
- └── package.json
32
-
33
- reporters/
34
- ├── vitest/ # tdd-guard-vitest package (npm)
35
- │ └── package.json
36
- └── pytest/ # tdd-guard-pytest package (PyPI)
37
- └── pyproject.toml
38
- ```
39
-
40
- Implementation details:
41
-
42
- - Main package exports shared functionality (Storage, Config, contracts)
43
- - Each reporter is a standalone package with its own version
44
- - Vitest reporter imports shared code from 'tdd-guard' package
45
- - Python reporter is self-contained (no JavaScript dependencies)
46
-
47
- ## Consequences
48
-
49
- ### Positive
50
-
51
- - **Clean separation** - Each language has its own package and tooling
52
- - **Smaller packages** - Users only install what they need
53
- - **Independent releases** - Can update reporters without touching others
54
- - **Easier contributions** - Clear boundaries for adding new reporters
55
-
56
- ### Negative
57
-
58
- - **Multiple packages to maintain** - More release overhead
59
- - **Build complexity** - Must ensure correct build order during development
60
-
61
- ### Neutral
62
-
63
- - Users now install two packages (CLI + reporter) instead of one
64
- - Each package has its own documentation and version number
@@ -1,55 +0,0 @@
1
- # ADR-005: Support CLAUDE_PROJECT_DIR for Consistent Data Storage
2
-
3
- ## Status
4
-
5
- Accepted
6
-
7
- ## Context
8
-
9
- TDD Guard stores data in `.claude/tdd-guard/data` relative to the current working directory. This creates issues when:
10
-
11
- - Users run commands from subdirectories (e.g., `cd src && npm test`)
12
- - Claude Code executes commands from different locations within a project
13
- - Multiple `.claude` directories are created at different levels
14
-
15
- Previously, users had to configure `CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR` in Claude Code to ensure commands always run from the project root. This required additional configuration and restricted how developers could use Claude Code.
16
-
17
- Claude Code provides the `CLAUDE_PROJECT_DIR` environment variable that always points to the project root, regardless of where commands are executed. This is part of Claude Code's [security best practices](https://docs.anthropic.com/en/docs/claude-code/hooks#security-best-practices).
18
-
19
- ## Decision
20
-
21
- We will use `CLAUDE_PROJECT_DIR` when available to determine the base path for TDD Guard's data directory.
22
-
23
- The implementation:
24
-
25
- - Check if `CLAUDE_PROJECT_DIR` is set and valid
26
- - Use it as the base path for `.claude/tdd-guard/data` if available
27
- - Fall back to current working directory if not set
28
- - Apply security validations to prevent path traversal attacks
29
- - Reporter-provided `projectRoot` takes precedence over `CLAUDE_PROJECT_DIR`
30
-
31
- Security validations include:
32
-
33
- - Validate `CLAUDE_PROJECT_DIR` is an absolute path
34
- - Prevent path traversal by checking for `..` sequences
35
- - Ensure current working directory is within `CLAUDE_PROJECT_DIR`
36
-
37
- When validation fails, TDD Guard throws a descriptive error and the operation is blocked, preventing any file system access with invalid paths.
38
-
39
- ## Consequences
40
-
41
- ### Positive
42
-
43
- - **Consistent data location** - Data is always stored at the project root
44
- - **No user configuration needed** - Works automatically with Claude Code
45
- - **Better developer experience** - Can run commands from any project subdirectory
46
- - **Maintains security** - Path validation prevents directory traversal attacks
47
-
48
- ### Negative
49
-
50
- - **Additional validation code** - Security checks add complexity, but this is centralized in the Config class
51
-
52
- ### Neutral
53
-
54
- - Falls back gracefully when environment variable is not present
55
- - Replaces the need for `CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR` configuration