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,46 +0,0 @@
1
- # Strengthening TDD Enforcement
2
-
3
- Ensure consistent TDD validation by preventing agents from modifying guard settings or bypassing file operation hooks.
4
-
5
- ## Protect Guard Settings
6
-
7
- Prevent agents from accessing TDD Guard's configuration and state:
8
-
9
- ```json
10
- {
11
- "permissions": {
12
- "deny": ["Read(.claude/tdd-guard/**)"]
13
- }
14
- }
15
- ```
16
-
17
- This protects your custom instructions, guard state, and test results from unintended changes.
18
-
19
- ## Block File Operation Bypass
20
-
21
- If your settings allow shell commands without approval, agents can modify files without triggering TDD validation. Block these commands to maintain enforcement:
22
-
23
- ```json
24
- {
25
- "permissions": {
26
- "deny": [
27
- "Bash(echo:*)",
28
- "Bash(printf:*)",
29
- "Bash(sed:*)",
30
- "Bash(awk:*)",
31
- "Bash(perl:*)"
32
- ]
33
- }
34
- }
35
- ```
36
-
37
- **Note:** Only needed if you've configured auto-approval for shell commands. May limit some agent capabilities.
38
-
39
- ## Where to Apply
40
-
41
- Add these settings to your chosen settings file. See [Settings File Locations](configuration.md#settings-file-locations) to choose the appropriate location.
42
-
43
- ## Need Help?
44
-
45
- - Report bypass methods: [GitHub Issues](https://github.com/nizos/tdd-guard/issues)
46
- - Share strategies: [GitHub Discussions](https://github.com/nizos/tdd-guard/discussions)
@@ -1,81 +0,0 @@
1
- # Ignore Patterns Guide
2
-
3
- Configure TDD Guard to skip validation for specific files using glob patterns.
4
-
5
- ## Why Use Ignore Patterns?
6
-
7
- Control exactly which files TDD Guard validates. Useful for monorepos, rapid prototyping, or when different parts of your codebase need different validation rules.
8
-
9
- ## Default Ignore Patterns
10
-
11
- By default, TDD Guard ignores files with these extensions:
12
-
13
- - `*.md` - Markdown documentation
14
- - `*.txt` - Text files
15
- - `*.log` - Log files
16
- - `*.json` - JSON configuration files
17
- - `*.yml` / `*.yaml` - YAML configuration files
18
- - `*.xml` - XML files
19
- - `*.html` - HTML files
20
- - `*.css` - Stylesheets
21
- - `*.rst` - reStructuredText documentation
22
-
23
- ## Custom Ignore Patterns
24
-
25
- You can configure custom ignore patterns by creating a `config.json` file in the TDD Guard data directory (`.claude/tdd-guard/data/`):
26
-
27
- ```json
28
- {
29
- "guardEnabled": true,
30
- "ignorePatterns": [
31
- "*.md",
32
- "*.css",
33
- "*.json",
34
- "*.yml",
35
- "**/*.generated.ts",
36
- "**/public/**",
37
- "*.config.*"
38
- ]
39
- }
40
- ```
41
-
42
- **Note**: Custom patterns replace the default patterns entirely. If you want to keep some defaults (like `*.md` or `*.json`), include them in your custom list.
43
-
44
- ## Pattern Syntax
45
-
46
- Patterns use minimatch syntax (similar to `.gitignore`):
47
-
48
- - `*.ext` - Match files with extension (e.g., `*.md`)
49
- - `dir/**` - Match all files in directory (e.g., `dist/**`)
50
- - `**/*.ext` - Match extension anywhere (e.g., `**/*.test.ts`)
51
- - `*.{js,ts}` - Match multiple extensions (e.g., `*.{yml,yaml}`)
52
- - `path/**/*.ext` - Match in specific path (e.g., `src/**/*.spec.js`)
53
-
54
- ## Managing Patterns
55
-
56
- ### Viewing Current Patterns
57
-
58
- To see which patterns are currently active, check your `config.json` file:
59
-
60
- ```bash
61
- cat .claude/tdd-guard/data/config.json
62
- ```
63
-
64
- If no custom patterns are configured, the default patterns listed above are used.
65
-
66
- ### Updating Patterns
67
-
68
- 1. Create or edit `.claude/tdd-guard/data/config.json`
69
- 2. Add your `ignorePatterns` array
70
- 3. The changes take effect immediately
71
-
72
- ### Testing Patterns
73
-
74
- To verify your patterns work as expected:
75
-
76
- 1. Edit a file that should be ignored
77
- 2. TDD Guard should skip validation immediately
78
-
79
- ## Summary
80
-
81
- Ignore patterns provide the flexibility to apply TDD validation exactly where you want it in your codebase. Start with the defaults, then customize as your project's needs evolve.
@@ -1,109 +0,0 @@
1
- # Linting and Refactoring Support
2
-
3
- TDD Guard can optionally check code quality during the refactoring phase (when tests are green) using ESLint.
4
- When issues are detected, the coding agent will be prompted to fix them.
5
-
6
- ## Why Use Refactoring Support?
7
-
8
- During the TDD green phase, the coding agent may:
9
-
10
- - Clean up implementation code
11
- - Extract methods or constants
12
- - Improve naming
13
- - Remove duplication
14
-
15
- The refactoring support helps by:
16
-
17
- - Running ESLint automatically after file modifications
18
- - Detecting code quality issues
19
- - Prompting the coding agent to fix any issues found
20
-
21
- ## Setup
22
-
23
- 1. **Install ESLint** in your project:
24
-
25
- ```bash
26
- npm install --save-dev eslint@latest
27
- ```
28
-
29
- 2. **Enable linting** by setting the environment variable:
30
-
31
- ```bash
32
- LINTER_TYPE=eslint
33
- ```
34
-
35
- Note: Currently only ESLint is supported. Additional linters may be added in the future.
36
-
37
- 3. **Configure the PostToolUse hook**
38
-
39
- You can configure this hook either through the interactive `/hooks` command or by manually editing your settings file. See [Settings File Locations](configuration.md#settings-file-locations) to choose the appropriate location. Use the same location as your PreToolUse hook.
40
-
41
- ### Interactive Setup (Recommended)
42
- 1. Type `/hooks` in Claude Code
43
- 2. Select `PostToolUse - After tool execution`
44
- 3. Choose `+ Add new matcher...`
45
- 4. Enter: `Write|Edit|MultiEdit|mcp__serena__rename_symbol|mcp__serena__replace_symbol_body|mcp__serena__insert_after_symbol|mcp__serena__insert_before_symbol`
46
- 5. Select `+ Add new hook...`
47
- 6. Enter command: `tdd-guard`
48
- 7. Choose where to save
49
-
50
- ### Manual Configuration
51
-
52
- Add to your chosen settings file:
53
-
54
- ```json
55
- {
56
- "hooks": {
57
- "PostToolUse": [
58
- {
59
- "matcher": "Write|Edit|MultiEdit|mcp__serena__rename_symbol|mcp__serena__replace_symbol_body|mcp__serena__insert_after_symbol|mcp__serena__insert_before_symbol",
60
- "hooks": [
61
- {
62
- "type": "command",
63
- "command": "tdd-guard"
64
- }
65
- ]
66
- }
67
- ]
68
- }
69
- }
70
- ```
71
-
72
- ## How It Works
73
-
74
- When enabled:
75
-
76
- 1. After any file modification (Edit, MultiEdit, Write)
77
- 2. TDD Guard runs ESLint on modified files
78
- 3. If issues are found, the coding agent receives a notification
79
- 4. The agent will then fix the identified issues
80
-
81
- Without `LINTER_TYPE=eslint`, TDD Guard skips all linting operations.
82
-
83
- **Tip**: Configure ESLint with complexity rules (e.g., `complexity`, `max-depth`) and the SonarJS plugin to encourage meaningful refactoring.
84
- These rules help identify code that could benefit from simplification during the green phase.
85
-
86
- ## ESLint Configuration
87
-
88
- For effective refactoring support, consider adding these rules to your `.eslintrc.js`:
89
-
90
- ```javascript
91
- module.exports = {
92
- rules: {
93
- complexity: ['warn', 10],
94
- 'max-depth': ['warn', 4],
95
- 'max-lines-per-function': ['warn', 50],
96
- 'max-nested-callbacks': ['warn', 3],
97
- 'max-params': ['warn', 4],
98
- },
99
- }
100
- ```
101
-
102
- ## Troubleshooting
103
-
104
- ### ESLint Not Running
105
-
106
- 1. Verify ESLint is installed: `npm list eslint`
107
- 2. Check that `LINTER_TYPE=eslint` is set in your `.env` file
108
- 3. Ensure the PostToolUse hook is configured
109
- 4. Restart your Claude session after making changes
@@ -1,52 +0,0 @@
1
- # TDD Guard Quick Commands
2
-
3
- TDD Guard can be quickly enabled or disabled using simple commands in your Claude Code session.
4
- This is particularly useful when you need to temporarily disable TDD enforcement during prototyping or exploration phases.
5
-
6
- ## Usage
7
-
8
- Simply type one of these commands in your Claude Code prompt:
9
-
10
- - `tdd-guard on` - Enables TDD Guard enforcement
11
- - `tdd-guard off` - Disables TDD Guard enforcement
12
-
13
- The commands are case-insensitive, so `TDD-Guard OFF`, `tdd-guard off`, and `Tdd-Guard Off` all work the same way.
14
-
15
- ## Setup
16
-
17
- To enable the quick commands feature, you need to add the UserPromptSubmit hook to your Claude Code configuration.
18
- You can set this up either through the interactive `/hooks` command or by manually editing your settings file. See [Settings File Locations](configuration.md#settings-file-locations) to choose the appropriate location.
19
-
20
- ### Using Interactive Setup (Recommended)
21
-
22
- 1. Type `/hooks` in Claude Code
23
- 2. Select `UserPromptSubmit - When the user submits a prompt`
24
- 3. Select `+ Add new hook...`
25
- 4. Enter command: `tdd-guard`
26
- 5. Choose where to save
27
-
28
- ### Manual Configuration (Alternative)
29
-
30
- Add the following to your chosen settings file:
31
-
32
- ```json
33
- {
34
- "hooks": {
35
- "userpromptsubmit": [
36
- {
37
- "hooks": [
38
- {
39
- "type": "command",
40
- "command": "tdd-guard"
41
- }
42
- ]
43
- }
44
- ]
45
- }
46
- }
47
- ```
48
-
49
- Note: Your configuration file may already have other hooks configured.
50
- Simply add the `userpromptsubmit` section to your existing hooks object.
51
-
52
- **Tip**: To prevent agents from modifying the TDD Guard state, see [Strengthening TDD Enforcement](enforcement.md).
@@ -1,75 +0,0 @@
1
- # TDD Guard Session Management
2
-
3
- The SessionStart hook manages TDD Guard's session data and ensures a clean slate for each Claude Code session.
4
-
5
- ## What It Does
6
-
7
- ### Clears Transient Data
8
-
9
- - Test results from previous sessions
10
- - Lint reports and code quality checks
11
- - Other temporary validation data
12
-
13
- ### Sets Up Validation Rules
14
-
15
- - Creates the customizable instructions file if it doesn't exist
16
- - Preserves your custom rules if already configured
17
- - See [Custom Instructions](custom-instructions.md) for details
18
-
19
- **Note:** The guard's enabled/disabled state is preserved across sessions.
20
-
21
- ## Setup
22
-
23
- To enable session management, you need to add the SessionStart hook to your Claude Code configuration.
24
- You can set this up either through the interactive `/hooks` command or by manually editing your settings file. See [Settings File Locations](configuration.md#settings-file-locations) to choose the appropriate location.
25
-
26
- ### Using Interactive Setup (Recommended)
27
-
28
- 1. Type `/hooks` in Claude Code
29
- 2. Select `SessionStart - When a new session is started`
30
- 3. Select `+ Add new matcher…`
31
- 4. Enter matcher: `startup|resume|clear`
32
- 5. Select `+ Add new hook…`
33
- 6. Enter command: `tdd-guard`
34
- 7. Choose where to save
35
-
36
- ### Manual Configuration (Alternative)
37
-
38
- Add the following to your chosen settings file:
39
-
40
- ```json
41
- {
42
- "hooks": {
43
- "SessionStart": [
44
- {
45
- "matcher": "startup|resume|clear",
46
- "hooks": [
47
- {
48
- "type": "command",
49
- "command": "tdd-guard"
50
- }
51
- ]
52
- }
53
- ]
54
- }
55
- }
56
- ```
57
-
58
- Note: Your configuration file may already have other hooks configured.
59
- Simply add the `SessionStart` section to your existing hooks object.
60
-
61
- ## How It Works
62
-
63
- The SessionStart hook triggers when:
64
-
65
- - Claude Code starts up (`startup`)
66
- - A session is resumed (`resume`)
67
- - The `/clear` command is used (`clear`)
68
-
69
- When triggered, TDD Guard clears all transient data while preserving the guard state and your custom validation rules.
70
-
71
- ## Tips
72
-
73
- - No manual intervention needed - clearing happens automatically
74
- - To toggle the guard on/off, use the [quick commands](quick-commands.md)
75
- - For debugging, check `.claude/tdd-guard/` to see stored data
@@ -1,120 +0,0 @@
1
- # Storybook with Vitest Addon
2
-
3
- If you're using Storybook 10+ with a Vite-based framework, you can use `@storybook/addon-vitest` instead of `@storybook/test-runner`. This approach uses TDD Guard's existing Vitest reporter to capture Storybook test results.
4
-
5
- ## Why Use the Vitest Addon?
6
-
7
- The Vitest addon offers several advantages:
8
-
9
- - **Faster execution** - Uses Vitest's browser mode instead of Playwright
10
- - **Modern tooling** - Built on Vitest, which is faster and more modern than Jest
11
- - **Unified testing** - Run Storybook tests alongside your other Vitest tests
12
- - **Better DX** - Full Storybook Test experience with interaction, accessibility, and visual tests
13
- - **Simpler setup** - Uses your existing Vitest configuration
14
-
15
- ## Requirements
16
-
17
- - Storybook 10+
18
- - Vite-based Storybook framework (React-Vite, Vue-Vite, Svelte-Vite, etc.)
19
- - Vitest
20
-
21
- ## Setup
22
-
23
- ### 1. Install the Vitest Addon
24
-
25
- ```bash
26
- npm install --save-dev @storybook/addon-vitest
27
- ```
28
-
29
- ### 2. Configure Storybook
30
-
31
- Add the addon to your `.storybook/main.ts`:
32
-
33
- ```typescript
34
- import type { StorybookConfig } from '@storybook/react-vite'
35
-
36
- const config: StorybookConfig = {
37
- stories: ['../src/**/*.stories.@(js|jsx|ts|tsx)'],
38
- addons: ['@storybook/addon-vitest'],
39
- framework: '@storybook/react-vite',
40
- }
41
-
42
- export default config
43
- ```
44
-
45
- ### 3. Configure Vitest Reporter
46
-
47
- Since the Vitest addon runs your Storybook tests through Vitest, you use the `tdd-guard-vitest` reporter to capture results:
48
-
49
- ```bash
50
- npm install --save-dev tdd-guard-vitest
51
- ```
52
-
53
- Add to your `vitest.config.ts`:
54
-
55
- ```typescript
56
- import { defineConfig } from 'vitest/config'
57
- import { VitestReporter } from 'tdd-guard-vitest'
58
-
59
- export default defineConfig({
60
- test: {
61
- reporters: [
62
- 'default',
63
- new VitestReporter('/Users/username/projects/my-app'),
64
- ],
65
- },
66
- })
67
- ```
68
-
69
- ### 4. Run Tests
70
-
71
- ```bash
72
- npm run test
73
- ```
74
-
75
- Your Storybook interaction tests will run alongside your regular Vitest tests, and TDD Guard will capture all results.
76
-
77
- ## Comparison with Test Runner
78
-
79
- | Feature | @storybook/test-runner | @storybook/addon-vitest |
80
- | ------------------ | ---------------------- | ----------------------- |
81
- | Test framework | Jest + Playwright | Vitest browser mode |
82
- | Storybook version | 6.4+ | 10+ |
83
- | Framework support | All frameworks | Vite-based only |
84
- | TDD Guard reporter | tdd-guard-storybook | tdd-guard-vitest |
85
- | Speed | Slower (full browser) | Faster |
86
-
87
- ## When to Use Each
88
-
89
- **Use `@storybook/addon-vitest` when:**
90
-
91
- - You're on Storybook 10+
92
- - You're using a Vite-based framework
93
- - You want faster test execution
94
- - You want to unify your testing setup
95
-
96
- **Use `@storybook/test-runner` when:**
97
-
98
- - You're on Storybook 6.4-9.x
99
- - You need Webpack-based framework support
100
- - You need full Playwright browser testing
101
-
102
- ## Troubleshooting
103
-
104
- ### Tests Not Running
105
-
106
- 1. Verify Storybook is configured with the Vitest addon
107
- 2. Check that your stories have `play` functions (interaction tests)
108
- 3. Ensure `tdd-guard-vitest` is in your Vitest reporters
109
-
110
- ### Results Not Captured
111
-
112
- 1. Verify `tdd-guard-vitest` is installed and configured
113
- 2. Check the project root path is correct in the reporter config
114
- 3. Look for `.claude/tdd-guard/data/test.json` after running tests
115
-
116
- ## Further Reading
117
-
118
- - [Storybook Vitest Addon Documentation](https://storybook.js.org/docs/writing-tests/integrations/vitest-addon)
119
- - [Vitest Reporter Configuration](../reporters/vitest/README.md)
120
- - [TDD Guard Configuration](configuration.md)
@@ -1,63 +0,0 @@
1
- # Validation Model Configuration
2
-
3
- TDD Guard validates changes using AI. Configure both the validation client (SDK or API) and the Claude model version.
4
-
5
- ## Claude Agent SDK (Default)
6
-
7
- The recommended approach. Uses the Claude Agent SDK to communicate with Claude directly.
8
-
9
- ```bash
10
- VALIDATION_CLIENT=sdk # Default, can be omitted
11
- ```
12
-
13
- **Features:**
14
-
15
- - Works automatically with your Claude Code installation
16
- - Uses your Claude Code subscription (no extra charges)
17
- - Requires Claude Code to be installed and authenticated
18
-
19
- **Important:** If you have `ANTHROPIC_API_KEY` set in your environment, Claude Code may use it for billing instead of your subscription. To avoid unexpected charges:
20
-
21
- ```bash
22
- # Check if API key is set
23
- echo $ANTHROPIC_API_KEY
24
-
25
- # Unset it if present
26
- unset ANTHROPIC_API_KEY
27
- ```
28
-
29
- If you've never created an API key, you can ignore this warning.
30
-
31
- ## Anthropic API
32
-
33
- For CI/CD environments or when you need faster validation. Requires separate billing from Claude Code.
34
-
35
- ```bash
36
- VALIDATION_CLIENT=api
37
- TDD_GUARD_ANTHROPIC_API_KEY=your_api_key_here
38
- ```
39
-
40
- Get your API key from [console.anthropic.com](https://console.anthropic.com/)
41
-
42
- **Notes:**
43
-
44
- - Charges separately from your Claude Code subscription ([pricing](https://www.anthropic.com/pricing))
45
- - We use `TDD_GUARD_ANTHROPIC_API_KEY` (not `ANTHROPIC_API_KEY`) to prevent accidental charges. If you used the regular `ANTHROPIC_API_KEY`, Claude Code might use it for all your normal coding tasks, charging your API account instead of using your subscription.
46
-
47
- ## Model Selection
48
-
49
- Configure which Claude model to use for validation (default: `claude-sonnet-4-0`):
50
-
51
- ```bash
52
- # Fastest but unreliable results
53
- TDD_GUARD_MODEL_VERSION=claude-3-5-haiku-20241022
54
-
55
- # Best results but slowest
56
- TDD_GUARD_MODEL_VERSION=claude-opus-4-1
57
- ```
58
-
59
- See [Claude model overview](https://docs.anthropic.com/en/docs/about-claude/models/overview) for available models and pricing. Note: pricing only applies to API users - SDK uses your Claude Code subscription by default. Balance model capability with [custom instructions](custom-instructions.md) to optimize for your needs.
60
-
61
- ## Migration from Legacy Configuration
62
-
63
- If you're using the old `MODEL_TYPE` configuration, see the [Configuration Migration Guide](config-migration.md) for detailed instructions.
@@ -1,140 +0,0 @@
1
- import js from '@eslint/js'
2
- import typescript from '@typescript-eslint/eslint-plugin'
3
- import typescriptParser from '@typescript-eslint/parser'
4
- import sonarjs from 'eslint-plugin-sonarjs'
5
- import globals from 'globals'
6
-
7
- export default [
8
- js.configs.recommended,
9
- {
10
- files: ['**/*.{ts,tsx}'],
11
- languageOptions: {
12
- parser: typescriptParser,
13
- parserOptions: {
14
- ecmaVersion: 2020,
15
- sourceType: 'module',
16
- project: './tsconfig.eslint.json',
17
- },
18
- globals: {
19
- ...globals.es2020,
20
- ...globals.node,
21
- },
22
- },
23
- plugins: {
24
- '@typescript-eslint': typescript,
25
- sonarjs: sonarjs,
26
- },
27
- rules: {
28
- ...typescript.configs.recommended.rules,
29
- ...sonarjs.configs.recommended.rules,
30
-
31
- // Prettier handling
32
- 'no-extra-semi': 'off',
33
- semi: 'off',
34
-
35
- // === COMPLEXITY & SIZE ===
36
- complexity: ['error', 20],
37
- 'sonarjs/cognitive-complexity': ['error', 20],
38
- 'max-lines-per-function': ['warn', 80],
39
- 'max-depth': ['error', 5],
40
- 'max-nested-callbacks': ['error', 5],
41
- 'max-params': ['warn', 5],
42
- 'max-statements': ['warn', 40],
43
- 'sonarjs/max-switch-cases': ['error', 30],
44
-
45
- // === CODE DUPLICATION ===
46
- 'sonarjs/no-duplicate-string': ['error', { threshold: 5 }],
47
- 'sonarjs/no-identical-functions': 'error',
48
- 'sonarjs/no-duplicated-branches': 'error',
49
- 'sonarjs/no-identical-conditions': 'error',
50
- 'sonarjs/no-identical-expressions': 'error',
51
-
52
- // === CODE QUALITY & SMELLS ===
53
- 'no-magic-numbers': [
54
- 'warn',
55
- {
56
- ignore: [0, 1, -1, 2, 100],
57
- ignoreArrayIndexes: true,
58
- enforceConst: true,
59
- },
60
- ],
61
- 'sonarjs/no-redundant-boolean': 'error',
62
- 'sonarjs/no-redundant-jump': 'error',
63
- 'sonarjs/no-redundant-assignments': 'error',
64
- 'sonarjs/no-small-switch': 'error',
65
- 'sonarjs/prefer-immediate-return': 'error',
66
- 'sonarjs/no-inverted-boolean-check': 'error',
67
- 'sonarjs/no-gratuitous-expressions': 'error',
68
- 'sonarjs/no-unthrown-error': 'error',
69
- 'sonarjs/prefer-object-literal': 'error',
70
- 'sonarjs/todo-tag': 'off', // We have items called todo
71
-
72
- // === STRUCTURE & READABILITY ===
73
- 'sonarjs/no-collapsible-if': 'error',
74
- 'sonarjs/no-nested-switch': 'error',
75
- 'sonarjs/no-nested-template-literals': 'error',
76
- 'sonarjs/no-same-line-conditional': 'error',
77
- 'no-nested-ternary': 'error',
78
- 'no-else-return': 'error',
79
-
80
- // === MAINTAINABILITY ===
81
- 'sonarjs/no-collection-size-mischeck': 'error',
82
- 'sonarjs/no-unused-vars': 'error',
83
- 'sonarjs/no-unused-function-argument': 'error',
84
- 'no-shadow': 'error',
85
- 'no-param-reassign': 'error',
86
- // 'consistent-return': 'error',
87
-
88
- // === MODERN JAVASCRIPT ===
89
- 'prefer-const': 'error',
90
- 'prefer-template': 'error',
91
- 'object-shorthand': 'error',
92
- 'prefer-arrow-callback': 'error',
93
- 'prefer-object-spread': 'error',
94
-
95
- // === TYPESCRIPT SPECIFIC ===
96
- '@typescript-eslint/explicit-function-return-type': 'warn',
97
- '@typescript-eslint/no-explicit-any': 'error',
98
- '@typescript-eslint/prefer-readonly': 'error',
99
- '@typescript-eslint/prefer-optional-chain': 'error',
100
- '@typescript-eslint/prefer-nullish-coalescing': 'error',
101
- '@typescript-eslint/no-unnecessary-condition': 'warn',
102
- '@typescript-eslint/switch-exhaustiveness-check': 'error',
103
- 'sonarjs/use-type-alias': 'warn',
104
- 'sonarjs/redundant-type-aliases': 'error',
105
- },
106
- },
107
- {
108
- files: [
109
- '**/*.test.ts',
110
- '**/*.spec.ts',
111
- '**/*.test.tsx',
112
- '**/*.spec.tsx',
113
- '**/factories/*',
114
- ],
115
- rules: {
116
- 'max-lines-per-function': 'off',
117
- 'sonarjs/no-nested-functions': 'off',
118
- 'no-magic-numbers': 'off',
119
- complexity: ['error', 20],
120
- 'sonarjs/cognitive-complexity': ['error', 20],
121
- 'max-nested-callbacks': ['error', 10],
122
- '@typescript-eslint/explicit-function-return-type': 'off',
123
- 'sonarjs/no-duplicate-string': ['error', { threshold: 20 }],
124
- },
125
- },
126
- {
127
- ignores: [
128
- '**/dist/**',
129
- '**/node_modules/**',
130
- 'coverage/**',
131
- '**/artifacts/**',
132
- '.venv/**',
133
- 'reporters/pytest/**',
134
- 'reporters/phpunit/**',
135
- 'reporters/go/**',
136
- '**/*.d.ts',
137
- '**/*.tsbuildinfo',
138
- ],
139
- },
140
- ]