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,93 +0,0 @@
1
- # ADR-006: Separate Repository for PHPUnit Reporter
2
-
3
- ## Status
4
-
5
- Accepted
6
-
7
- ## Context
8
-
9
- We received a contribution for a PHPUnit reporter that allows PHP developers to use TDD Guard with their PHPUnit test suites. However, when attempting to publish this package to Packagist (the PHP package registry), we encountered a fundamental limitation: Packagist requires the `composer.json` file to be at the root of the repository.
10
-
11
- TDD Guard is organized as a monorepo containing:
12
-
13
- - The main CLI tool (TypeScript/npm)
14
- - Vitest reporter (TypeScript/npm)
15
- - Pytest reporter (Python/PyPI)
16
- - PHPUnit reporter (PHP/Packagist)
17
-
18
- This structure works well for npm (which supports workspaces) and PyPI (which can build from subdirectories), but Packagist does not support monorepos or packages in subdirectories.
19
-
20
- ### Options Considered
21
-
22
- 1. **Move composer.json to repository root**
23
- - Would make the entire TDD Guard project appear as a PHP package
24
- - Users would download all code (TypeScript, Python, etc.) just to get the PHPUnit reporter
25
- - Conflicts with the project's primary identity as a CLI tool
26
-
27
- 2. **Private Packagist subscription**
28
- - Supports monorepos but requires paid subscription
29
- - Adds ongoing cost for an open-source project
30
- - Creates barrier for community adoption
31
-
32
- 3. **Manual installation instructions**
33
- - Users would need to configure Composer to use VCS repository
34
- - Poor developer experience
35
- - Reduces discoverability and adoption
36
-
37
- 4. **Separate repository with automated synchronization**
38
- - Maintains single source of truth in main repository
39
- - Provides standard Packagist installation experience
40
- - Can be automated with GitHub Actions
41
-
42
- ## Decision
43
-
44
- We will create a separate repository (`tdd-guard-phpunit`) that mirrors the `reporters/phpunit` directory from the main repository. This mirror will be automatically synchronized using GitHub Actions whenever changes are pushed to the PHPUnit reporter in the main repository.
45
-
46
- ### Implementation Plan
47
-
48
- 1. **Initial Setup**
49
- - Create `tdd-guard-phpunit` repository
50
- - Use `git subtree split` to extract PHPUnit reporter history
51
- - Push to new repository maintaining commit history
52
- - Submit to Packagist for PHP package distribution
53
-
54
- 2. **Automated Synchronization**
55
- - GitHub Action triggered on pushes to `reporters/phpunit/**`
56
- - Uses git subtree to maintain clean history
57
- - Force pushes to mirror repository to ensure consistency
58
- - Syncs relevant tags (e.g., `phpunit-v*`)
59
-
60
- 3. **Clear Communication**
61
- - Mirror repository README clearly states it's read-only
62
- - Directs issues and PRs to main repository
63
- - Explains the monorepo structure and rationale
64
-
65
- ## Consequences
66
-
67
- ### Positive
68
-
69
- - **Standard installation**: `composer require --dev tdd-guard/phpunit`
70
- - **Packagist compatibility**: Full integration with PHP ecosystem
71
- - **Automated updates**: No manual synchronization needed
72
- - **Clean history**: Git subtree preserves relevant commit history
73
- - **Single source of truth**: All development happens in main repository
74
-
75
- ### Negative
76
-
77
- - **Additional complexity**: Must maintain synchronization workflow
78
- - **Delayed updates**: Packagist updates depend on GitHub Action execution
79
- - **Repository proliferation**: Additional repository to manage
80
- - **Potential confusion**: Contributors might submit PRs to wrong repository
81
-
82
- ### Security Considerations
83
-
84
- - Uses GitHub Personal Access Token (PAT) with minimal required permissions
85
- - Token stored as repository secret, only accessible to repository admins
86
- - Automated workflow reduces human error in synchronization
87
- - Mirror repository can be made explicitly read-only if needed
88
-
89
- ## Future Considerations
90
-
91
- If Packagist adds monorepo support in the future, we could deprecate the mirror repository and publish directly from the main repository. Until then, this approach provides the best balance of maintainability and user experience.
92
-
93
- The same pattern could be applied if we need to publish other language-specific packages that don't support monorepos (e.g., RubyGems, CPAN).
@@ -1,83 +0,0 @@
1
- # ADR-007: Golangci-lint Path and Working Directory Support
2
-
3
- ## Status
4
-
5
- Proposed
6
-
7
- ## Context
8
-
9
- The golangci-lint integration in TDD Guard faced two specific challenges that required architectural changes to work correctly.
10
-
11
- Key problems encountered:
12
-
13
- 1. **File-based linting limitations** - TDD Guard's default linter interface passes absolute file paths to be linted. When golangci-lint receives individual file paths, it cannot resolve other functions and types in the same Go package, leading to false undefined variable/function errors. golangci-lint is designed to work at the package/directory level, not individual files.
14
-
15
- 2. **Working directory dependency** - golangci-lint uses the current working directory to locate the project's `go.mod` file for module resolution. This TDD Guard repository is primarily TypeScript with Go test artifacts in subdirectories (`test/artifacts/go/`). When tests run from the project root, golangci-lint fails to find the correct `go.mod` files in the test artifact directories.
16
-
17
- We considered several approaches:
18
-
19
- 1. **Add module resolution to linter interface** - Make the core linter system aware of Go modules and working directories
20
- 2. **File-based workarounds** - Continue trying to make golangci-lint work with individual files
21
- 3. **Directory-based linting with test isolation** - Use golangci-lint's natural directory mode and isolate tests that need working directory changes
22
- 4. **Separate Go project structure** - Move Go artifacts to a different repository
23
-
24
- ## Decision
25
-
26
- We will adapt golangci-lint to work within TDD Guard's file-based linter interface using directory-based execution and test isolation, avoiding changes to the core linter architecture.
27
-
28
- Implementation details:
29
-
30
- **Directory-based linting:**
31
-
32
- - Extract unique directories from provided file paths using `dirname()`
33
- - Pass directories to golangci-lint instead of individual files
34
- - Use `--path-mode=abs` flag to support absolute path arguments
35
- - This allows golangci-lint to resolve Go packages correctly while maintaining the existing linter interface
36
-
37
- **Test isolation:**
38
-
39
- - Configure golangci-lint tests to run in Vitest's fork pool instead of threads pool
40
- - Use `process.chdir()` in tests with proper cleanup via beforeEach/afterEach hooks
41
- - This allows tests to change working directory to Go test artifacts without affecting other tests
42
-
43
- Key changes:
44
-
45
- ```typescript
46
- // Directory-based argument building
47
- const directories = [...new Set(filePaths.map((file) => dirname(file)))]
48
- const args = [
49
- 'run',
50
- '--output.json.path=stdout',
51
- '--path-mode=abs',
52
- ...directories,
53
- ]
54
-
55
- // Simplified issue parsing (no path resolution needed)
56
- const issues = results.flatMap(toIssue)
57
- ```
58
-
59
- **Rationale:** This approach was chosen because the situation (non-Go project testing Go linters) is rare and doesn't warrant adding brittle module resolution logic to the core linter system. The isolated test approach keeps the complexity contained to where it's needed.
60
-
61
- ## Consequences
62
-
63
- ### Positive
64
-
65
- - **Go language linter support** - TDD Guard now supports the most popular Go linting solution
66
- - **Proper package resolution** - Directory-based linting allows golangci-lint to resolve Go types and functions correctly
67
- - **Alignment with tooling** - Uses golangci-lint as intended (package-level analysis)
68
- - **Comprehensive validation** - Go developers get the same TDD enforcement as other languages
69
- - **Maintainable architecture** - Avoided adding Go-specific complexity to the core linter interface
70
-
71
- ### Negative
72
-
73
- - **Test complexity** - Requires separate Vitest project configuration and fork pool for isolation
74
- - **Different execution model** - Golangci-lint behaves differently than file-based linters (ESLint)
75
- - **Working directory sensitivity** - Tests must manage working directory changes carefully
76
-
77
- ### Neutral
78
-
79
- - **Directory-based results** - May report issues in files not explicitly requested (entire package)
80
-
81
- ## Security Considerations
82
-
83
- The golangci-lint integration performs path manipulation by extracting directories from file paths using `dirname()` and passing them as command line arguments.
@@ -1,182 +0,0 @@
1
- # ADR-008: Storybook Reporter Design
2
-
3
- ## Status
4
-
5
- Accepted
6
-
7
- ## Context
8
-
9
- Storybook interaction tests (stories with `play` functions) provide valuable component test coverage, but TDD Guard didn't recognize these test failures as valid RED-phase evidence. This prevented developers from using TDD workflows with Storybook for component testing.
10
-
11
- We needed to design a reporter that:
12
-
13
- - Captures test results from Storybook's `@storybook/test-runner`
14
- - Writes results in TDD Guard's standard format
15
- - Handles the unique characteristics of Storybook's test model
16
- - Follows the established patterns from other reporters (Vitest, Jest)
17
-
18
- We considered several design decisions:
19
-
20
- 1. **Test granularity** - Should we report all stories or only those with tests?
21
- 2. **Module hierarchy** - How should we group stories into modules?
22
- 3. **Reporter lifecycle** - Should we write on each story or accumulate results?
23
- 4. **Render failures** - How should we handle stories that crash during render?
24
- 5. **Data extraction** - Should we query the page or use provided context?
25
-
26
- ## Decision
27
-
28
- We will implement `tdd-guard-storybook` with the following design:
29
-
30
- ### Test Granularity
31
-
32
- **Only report stories with `play` functions as tests.**
33
-
34
- Stories without `play` functions are just renders and don't provide meaningful RED/GREEN signals. This aligns with how other reporters work - they don't report non-test files. TDD Guard requires actual test failures as evidence.
35
-
36
- ### Module/Test Hierarchy
37
-
38
- **One module per story file, multiple stories become tests within that module.**
39
-
40
- Structure:
41
-
42
- ```json
43
- {
44
- "testModules": [
45
- {
46
- "moduleId": "src/Button.stories.tsx",
47
- "tests": [
48
- {
49
- "name": "Primary",
50
- "fullName": "Button > Primary",
51
- "state": "passed"
52
- }
53
- ]
54
- }
55
- ]
56
- }
57
- ```
58
-
59
- This matches how Vitest/Jest group tests by file. One source file = one module is intuitive and simpler to implement.
60
-
61
- ### Reporter Lifecycle
62
-
63
- **Accumulate results during `postVisit`, write once on `onExit`.**
64
-
65
- API:
66
-
67
- ```typescript
68
- async postVisit(page, context) {
69
- await reporter.onStoryResult(context)
70
- }
71
- async onExit() {
72
- await reporter.onComplete()
73
- }
74
- ```
75
-
76
- This matches the Vitest/Jest pattern, is more efficient (one write vs N writes), provides cleaner separation of concerns, and better handles interruptions.
77
-
78
- ### Render Failure Handling
79
-
80
- **Create synthetic failed test for stories that fail to render.**
81
-
82
- A story with a `play` function that crashes during render is still a failing test. This matches VitestReporter pattern for module load failures and provides visibility into all failures, not just interaction test failures.
83
-
84
- ### Data Extraction Strategy
85
-
86
- **Extract minimal data from test-runner context directly, no additional page queries.**
87
-
88
- Start simple with what test-runner provides out of the box. Less complexity = fewer failure points. Can enhance later if needed.
89
-
90
- ### Interruption Handling
91
-
92
- **Best-effort save on exit with "interrupted" status.**
93
-
94
- Approach:
95
-
96
- - Register process exit handler to catch interruptions
97
- - Write accumulated results when possible
98
- - Mark overall status as "interrupted"
99
- - Partial results better than no results
100
-
101
- This matches the Vitest/Jest pattern and TDD Guard already handles "interrupted" status.
102
-
103
- ## Consequences
104
-
105
- ### Positive
106
-
107
- - **Consistent patterns** - Follows established Vitest/Jest reporter patterns
108
- - **Efficient** - Single write operation instead of multiple
109
- - **Complete coverage** - Captures both interaction test failures and render failures
110
- - **Simple API** - Easy to configure with minimal code
111
- - **Robust** - Handles interruptions gracefully
112
- - **TDD-aligned** - Only reports actual tests, not passive renders
113
-
114
- ### Negative
115
-
116
- - **Stories without `play` not tracked** - But these aren't tests, so this is intentional
117
- - **Accumulates in memory** - Could be an issue for extremely large test suites, but matches other reporters
118
- - **Storybook-specific** - Requires `@storybook/test-runner` as peer dependency
119
-
120
- ### Neutral
121
-
122
- - Users need to configure `.storybook/test-runner.ts` with the reporter
123
- - Follows same security validations as other reporters (absolute paths, project root validation)
124
- - Results saved to standard location: `.claude/tdd-guard/data/test.json`
125
-
126
- ## Implementation Details
127
-
128
- ### Integration Test Architecture
129
-
130
- The Storybook reporter integration tests follow the same real-execution pattern as Jest, Vitest, PHPUnit, Pytest, Go, and Rust reporters.
131
-
132
- **Test Flow:**
133
-
134
- ```
135
- Integration Test
136
-
137
- Factory (storybook.ts)
138
-
139
- Copy story files → Write configs → Spawn test-runner
140
-
141
- @storybook/test-runner (Jest + Playwright)
142
-
143
- Executes stories → Calls StorybookReporter hooks
144
-
145
- StorybookReporter.onStoryResult() → Save to FileStorage
146
-
147
- Factory reads results → Returns to test assertions
148
- ```
149
-
150
- ### Test Artifacts Structure
151
-
152
- ```
153
- reporters/test/storybook/
154
- ├── .storybook/
155
- │ └── main.js # Storybook configuration
156
- ├── Calculator.js # Simple component module
157
- ├── single-passing.stories.js # Story with passing assertions
158
- ├── single-failing.stories.js # Story with failing expect()
159
- └── single-import-error.stories.js # Story importing non-existent module
160
- ```
161
-
162
- Stories use JavaScript (`.stories.js`) to match the repository's test file convention (`.test.js`) and reduce complexity.
163
-
164
- ### Factory Implementation
165
-
166
- The `reporters/test/factories/storybook.ts` factory:
167
-
168
- 1. **Copies test artifacts** - Uses existing `copyTestArtifacts` helper
169
- 2. **Generates test-runner config** - Writes `test-runner-jest.config.js` with reporter
170
- 3. **Starts Storybook dev server** - Spawns `storybook dev` on dynamically allocated port via `get-port`
171
- 4. **Executes test-runner** - Spawns `test-storybook` command via `spawnSync`
172
- 5. **Captures results** - Reporter saves to FileStorage, factory reads back
173
-
174
- ### Key Design Decisions from Implementation
175
-
176
- **Test-runner integration:** Uses `@storybook/test-runner` which integrates with Jest's reporter API through `postVisit` and `onExit` hooks. The reporter accumulates results during story execution and writes once on completion.
177
-
178
- **Async server startup:** Factory implements timeout-based Storybook server detection by monitoring stdout for "Local:" or port-specific URLs. 240-second timeout accommodates slower container environments.
179
-
180
- **Optional reporter execution:** Integration tests use `Promise.allSettled` to make reporters optional, allowing tests to run even when some language-specific reporters aren't installed.
181
-
182
- **Error handling:** The reporter captures both interaction test failures and render failures (import errors, component crashes) as synthetic failed tests, ensuring complete coverage of all failure modes.
@@ -1,143 +0,0 @@
1
- # Configuration Migration Guide
2
-
3
- This guide helps you migrate from the legacy `MODEL_TYPE` configuration to the new `VALIDATION_CLIENT` system.
4
-
5
- ## What Changed
6
-
7
- The old configuration system required:
8
-
9
- - `MODEL_TYPE` to choose between `claude_cli` or `anthropic_api`
10
- - `USE_SYSTEM_CLAUDE` (true/false) to choose between system or local Claude binary
11
- - Complex setup for finding and configuring the Claude binary
12
-
13
- The new system simplifies this with:
14
-
15
- - `VALIDATION_CLIENT` to choose between `sdk`, `api`, or `cli` (deprecated)
16
- - No binary configuration needed for SDK (the default)
17
-
18
- ## Migration Instructions
19
-
20
- ### From Claude CLI to SDK
21
-
22
- **Old configuration:**
23
-
24
- ```bash
25
- MODEL_TYPE=claude_cli
26
- USE_SYSTEM_CLAUDE=true # or false
27
- ```
28
-
29
- **New configuration:**
30
-
31
- ```bash
32
- VALIDATION_CLIENT=sdk # Or omit entirely, as SDK is the default
33
- ```
34
-
35
- The SDK client eliminates the need for:
36
-
37
- - Finding the Claude binary location
38
- - Setting `USE_SYSTEM_CLAUDE`
39
- - Dealing with symlinks or PATH configuration
40
-
41
- ### From Anthropic API
42
-
43
- **Old configuration:**
44
-
45
- ```bash
46
- MODEL_TYPE=anthropic_api
47
- TDD_GUARD_ANTHROPIC_API_KEY=your-api-key-here
48
- ```
49
-
50
- **New configuration:**
51
-
52
- ```bash
53
- VALIDATION_CLIENT=api
54
- TDD_GUARD_ANTHROPIC_API_KEY=your-api-key-here # Same key variable
55
- ```
56
-
57
- The API configuration remains similar, just with a clearer variable name.
58
-
59
- ## Legacy CLI Client (Deprecated)
60
-
61
- If you must continue using the CLI client (not recommended):
62
-
63
- ```bash
64
- VALIDATION_CLIENT=cli # Deprecated - use sdk instead
65
- ```
66
-
67
- You'll still need to configure the Claude binary location as described in the [CLI Binary Configuration](#cli-binary-configuration) section below.
68
-
69
- ### Why CLI is Deprecated
70
-
71
- The SDK client is easier to work with and requires less configuration for different setups and operating systems.
72
-
73
- ## Deprecated Variables
74
-
75
- | Variable | Replacement | Notes |
76
- | ------------------- | ------------------- | ------------------------------------------------- |
77
- | `MODEL_TYPE` | `VALIDATION_CLIENT` | Map `claude_cli` → `sdk`, `anthropic_api` → `api` |
78
- | `USE_SYSTEM_CLAUDE` | None | No longer needed with SDK |
79
- | `TEST_MODEL_TYPE` | None | Use consistent configuration |
80
-
81
- ## Common Migration Issues
82
-
83
- ### API Key Conflicts
84
-
85
- For information about API key conflicts and billing, see the [Validdation Model Configuration](validation-model.md) documentation.
86
-
87
- ## CLI Binary Configuration
88
-
89
- If you're still using the deprecated CLI client (`VALIDATION_CLIENT=cli`), you need to help TDD Guard find your Claude installation.
90
-
91
- ### Finding Your Claude Installation
92
-
93
- ```bash
94
- # Check system-wide installation
95
- which claude
96
-
97
- # Check local installation
98
- ls ~/.claude/local/claude
99
- ```
100
-
101
- ### Configuration Options
102
-
103
- **Option 1: Environment Variable**
104
-
105
- If Claude is in your PATH:
106
-
107
- ```bash
108
- USE_SYSTEM_CLAUDE=true
109
- ```
110
-
111
- **Option 2: Symlink**
112
-
113
- Point to your Claude installation:
114
-
115
- ```bash
116
- # Create directory if needed
117
- mkdir -p ~/.claude/local
118
-
119
- # Create symlink to your Claude binary
120
- ln -s /path/to/your/claude ~/.claude/local/claude
121
- ```
122
-
123
- Example for Homebrew on macOS:
124
-
125
- ```bash
126
- ln -s /opt/homebrew/bin/claude ~/.claude/local/claude
127
- ```
128
-
129
- **Option 3: Migrate Installation**
130
-
131
- Use Claude Code's built-in command:
132
-
133
- ```bash
134
- /migrate-installer
135
- ```
136
-
137
- ## Getting Help
138
-
139
- If you encounter issues during migration:
140
-
141
- 1. Check the [main configuration guide](configuration.md)
142
- 2. Review the [Validdation Model Configuration](validation-model.md)
143
- 3. Open an issue at [github.com/nizos/tdd-guard/issues](https://github.com/nizos/tdd-guard/issues)
@@ -1,137 +0,0 @@
1
- # Configuration Guide
2
-
3
- This guide covers the configuration options for TDD Guard.
4
-
5
- ## Environment Variables
6
-
7
- TDD Guard uses environment variables for configuration.
8
- Create a `.env` file in your project root:
9
-
10
- **Note:** If you're migrating from an older version using `MODEL_TYPE`, see the [Configuration Migration Guide](config-migration.md).
11
-
12
- ```bash
13
- # Validation client for TDD enforcement (optional)
14
- # Options: 'sdk' (default) or 'api'
15
- VALIDATION_CLIENT=sdk
16
-
17
- # Model version for validation (optional)
18
- # Default: claude-sonnet-4-0
19
- # See https://docs.anthropic.com/en/docs/about-claude/models/overview
20
- TDD_GUARD_MODEL_VERSION=claude-sonnet-4-0
21
-
22
- # Anthropic API Key
23
- # Required when VALIDATION_CLIENT is set to 'api'
24
- # Get your API key from https://console.anthropic.com/
25
- TDD_GUARD_ANTHROPIC_API_KEY=your-api-key-here
26
-
27
- # Linter type for refactoring phase support (optional)
28
- # Options: 'eslint', 'golangci-lint' or unset (no linting)
29
- # See docs/linting.md for detailed setup and configuration
30
- LINTER_TYPE=eslint
31
- ```
32
-
33
- ## Model Configuration
34
-
35
- TDD Guard supports multiple validation clients:
36
-
37
- - **SDK** (default) - Uses your Claude Code subscription
38
- - **API** - Separate billing for CI/CD or faster validation
39
- - **CLI** (deprecated) - Legacy option, not recommended
40
-
41
- For detailed configuration, billing information, and troubleshooting, see the [Validation Model Configuration](validation-model.md) guide.
42
-
43
- If you're using the deprecated CLI client, see the [Configuration Migration Guide](config-migration.md#cli-binary-configuration).
44
-
45
- ## Settings File Locations
46
-
47
- Choose where to save your settings based on your needs:
48
-
49
- - **Project settings** (`.claude/settings.json`) - Recommended for team consistency
50
- - **Local settings** (`.claude/settings.local.json`) - For personal preferences
51
- - **User settings** (`~/.claude/settings.json`) - For global configuration
52
-
53
- ## Hook Configuration
54
-
55
- See the [Quick Start guide](../README.md#3-configure-claude-code-hooks) in the main README for detailed hook configuration instructions, including both interactive and manual setup methods.
56
-
57
- **Additional hooks:**
58
-
59
- - [Quick commands](quick-commands.md) - Enable `tdd-guard on/off` commands
60
- - [Session management](session-management.md) - Automatic data clearing and rule setup
61
- - [Lint integration](linting.md) - Automated refactoring support
62
- - [Strengthening enforcement](enforcement.md) - Prevent agents from bypassing validation
63
-
64
- ## Test Reporter Configuration
65
-
66
- - **JavaScript/TypeScript**:
67
- - [Vitest reporter configuration](../reporters/vitest/README.md#configuration)
68
- - [Jest reporter configuration](../reporters/jest/README.md#configuration)
69
- - **Python**: See [Pytest reporter configuration](../reporters/pytest/README.md#configuration)
70
- - **PHP**: See [PHPUnit reporter configuration](../reporters/phpunit/README.md#configuration)
71
- - **Go**: See [Go reporter configuration](../reporters/go/README.md#configuration)
72
- - **Rust**: See [Rust reporter configuration](../reporters/rust/README.md#configuration)
73
-
74
- ## Custom Validation Rules
75
-
76
- See [Custom Instructions](custom-instructions.md) to customize TDD validation rules to match your practices.
77
-
78
- ## Data Storage
79
-
80
- TDD Guard stores context data in `.claude/tdd-guard/data/`:
81
-
82
- - `instructions.md` - Your custom TDD validation rules (created automatically, never overwritten)
83
- - `test.json` - Latest test results from your test runner (Vitest or pytest)
84
- - `todos.json` - Current todo state
85
- - `modifications.json` - File modification history
86
- - `lint.json` - ESLint results (only created when LINTER_TYPE=eslint)
87
-
88
- This directory is created automatically and should be added to `.gitignore`.
89
-
90
- ## Troubleshooting
91
-
92
- ### Dependency Versions
93
-
94
- #### Vitest
95
-
96
- Use the latest Vitest version to ensure correct test output format for TDD Guard:
97
-
98
- ```bash
99
- npm install --save-dev vitest@latest
100
- ```
101
-
102
- #### pytest
103
-
104
- For Python projects, ensure you have a recent version of pytest:
105
-
106
- ```bash
107
- pip install pytest>=7.0.0
108
- ```
109
-
110
- ### Common Issues
111
-
112
- 1. **TDD Guard not triggering**: Check that hooks are properly configured in `.claude/settings.json`
113
- 2. **Test results not captured**: Ensure `VitestReporter` is added to your Vitest config
114
- 3. **"Command not found" errors**: Make sure `tdd-guard` is installed globally with `npm install -g tdd-guard`
115
- 4. **Changes not taking effect**: Restart your Claude session after modifying hooks or environment variables
116
-
117
- ### Updating TDD Guard
118
-
119
- To update to the latest version:
120
-
121
- ```bash
122
- # Update CLI tool
123
- npm update -g tdd-guard
124
-
125
- # For JavaScript/TypeScript projects, update the Vitest reporter in your project
126
- npm update tdd-guard-vitest
127
-
128
- # For Python projects, update the pytest reporter
129
- pip install --upgrade tdd-guard-pytest
130
- ```
131
-
132
- Check your current version:
133
-
134
- ```bash
135
- npm list -g tdd-guard
136
- pip show tdd-guard-pytest
137
- ```
@@ -1,43 +0,0 @@
1
- # Custom TDD Instructions
2
-
3
- Customize TDD Guard's validation rules to match your specific TDD practices.
4
-
5
- ## How It Works
6
-
7
- TDD Guard uses validation rules to enforce TDD principles. You can override these default rules by creating a custom instructions file at `.claude/tdd-guard/data/instructions.md`.
8
-
9
- ## Automatic Setup
10
-
11
- If you have the [SessionStart hook](session-management.md) configured, the instructions file is created automatically with default rules when:
12
-
13
- - Starting a new Claude Code session
14
- - Resuming a session
15
- - Using the `/clear` command
16
-
17
- Your custom instructions are never overwritten - once created, the file remains under your control.
18
-
19
- ## Creating Custom Instructions
20
-
21
- 1. Edit `.claude/tdd-guard/data/instructions.md`
22
- 2. Adjust or replace the default rules with your TDD requirements
23
- 3. Changes take effect immediately - no restart needed
24
-
25
- ## Updating to Latest Defaults
26
-
27
- When updating TDD Guard, you may want the latest default instructions:
28
-
29
- 1. Delete `.claude/tdd-guard/data/instructions.md`
30
- 2. Trigger the SessionStart hook (start new session or use `/clear`)
31
- 3. The latest defaults will be created automatically
32
-
33
- Alternatively, you can manually copy the default rules from [`src/validation/prompts/rules.ts`](../src/validation/prompts/rules.ts).
34
-
35
- ## Protecting Your Instructions
36
-
37
- Prevent agents from modifying your custom instructions by denying access to TDD Guard data. See [Strengthening TDD Enforcement](enforcement.md) for details.
38
-
39
- ## Tips
40
-
41
- - Start with the default instructions and modify incrementally
42
- - Keep rules clear and actionable for consistent validation
43
- - Share effective customizations with the TDD Guard community in [GitHub Discussions](https://github.com/nizos/tdd-guard/discussions)