@mrciphersmith/keryx 0.2.164 → 0.3.1

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 (182) hide show
  1. package/README.md +4 -1
  2. package/dist/cli.js +82540 -50300
  3. package/dist/core.js +28967 -18937
  4. package/package.json +2 -2
  5. package/src/gdgraph/affected-report.ts +141 -0
  6. package/src/gdgraph/build.ts +170 -23
  7. package/src/gdgraph/service.ts +6 -0
  8. package/src/gdgraph/staleness.ts +253 -45
  9. package/src/gdskills/bundled/agents/codebase-navigator.md +55 -0
  10. package/src/gdskills/bundled/agents/design-advisor.md +64 -0
  11. package/src/gdskills/bundled/agents/docs-maintainer.md +56 -0
  12. package/src/gdskills/bundled/agents/end-to-end-tester.md +56 -0
  13. package/src/gdskills/bundled/agents/error-path-auditor.md +57 -0
  14. package/src/gdskills/bundled/agents/go-build-fixer.md +52 -0
  15. package/src/gdskills/bundled/agents/go-code-auditor.md +49 -0
  16. package/src/gdskills/bundled/agents/performance-auditor.md +63 -0
  17. package/src/gdskills/bundled/agents/python-build-fixer.md +52 -0
  18. package/src/gdskills/bundled/agents/python-code-auditor.md +49 -0
  19. package/src/gdskills/bundled/agents/refactoring-steward.md +61 -0
  20. package/src/gdskills/bundled/agents/security-auditor.md +62 -0
  21. package/src/gdskills/bundled/agents/test-first-driver.md +61 -0
  22. package/src/gdskills/bundled/agents/work-planner.md +62 -0
  23. package/src/gdskills/bundled/install-manifest.json +797 -0
  24. package/src/gdskills/bundled/rules/core/model-selection.mdc +51 -0
  25. package/src/gdskills/bundled/rules/core/skill-lifecycle.mdc +29 -1
  26. package/src/gdskills/bundled/rules/core/skills-storage-workflow.mdc +2 -2
  27. package/src/gdskills/bundled/skills/review/code-style-review/SKILL.md +1 -1
  28. package/src/gdskills/bundled/skills/review/review-jev-rules/SKILL.md +267 -0
  29. package/src/gdskills/bundled/skills/review/review-orchestrator/SKILL.detail.md +26 -0
  30. package/src/gdskills/bundled/skills/review/review-orchestrator/SKILL.md +75 -247
  31. package/src/gdskills/bundled/skills/review/review-orchestrator/output-contract.schema.json +19 -0
  32. package/src/gdskills/bundled/skills/review/review-orchestrator/reviewer-finding.schema.json +10 -0
  33. package/src/gdskills/bundled/skills/review/review-orchestrator/reviewer-input.schema.json +5 -0
  34. package/src/gdskills/bundled/skills/review/review-orchestrator/templates/pr-comment-backend.md +50 -0
  35. package/src/gdskills/bundled/skills/review/review-orchestrator/templates/pr-comment-frontend.md +52 -0
  36. package/src/gdskills/bundled/skills/review/review-orchestrator/templates/review-report.md +143 -0
  37. package/src/gdskills/bundled/stacks/angular/agent-refs.json +4 -0
  38. package/src/gdskills/bundled/stacks/angular/governance/eval.json +1751 -0
  39. package/src/gdskills/bundled/stacks/angular/governance/scout.json +32 -0
  40. package/src/gdskills/bundled/stacks/angular/pack.json +55 -0
  41. package/src/gdskills/bundled/stacks/angular/rules/coding-style.mdc +82 -0
  42. package/src/gdskills/bundled/stacks/angular/rules/patterns.mdc +84 -0
  43. package/src/gdskills/bundled/stacks/angular/rules/security.mdc +70 -0
  44. package/src/gdskills/bundled/stacks/angular/rules/testing.mdc +73 -0
  45. package/src/gdskills/bundled/stacks/angular/skills/angular-build-fix/SKILL.md +127 -0
  46. package/src/gdskills/bundled/stacks/angular/skills/angular-build-fix/evals.json +72 -0
  47. package/src/gdskills/bundled/stacks/angular/skills/angular-code-review/SKILL.md +98 -0
  48. package/src/gdskills/bundled/stacks/angular/skills/angular-code-review/evals.json +73 -0
  49. package/src/gdskills/bundled/stacks/angular/skills/angular-implementation/SKILL.md +112 -0
  50. package/src/gdskills/bundled/stacks/angular/skills/angular-implementation/evals.json +74 -0
  51. package/src/gdskills/bundled/stacks/angular/skills/angular-testing/SKILL.md +102 -0
  52. package/src/gdskills/bundled/stacks/angular/skills/angular-testing/evals.json +71 -0
  53. package/src/gdskills/bundled/stacks/go/agent-refs.json +3 -0
  54. package/src/gdskills/bundled/stacks/go/governance/eval.json +1745 -0
  55. package/src/gdskills/bundled/stacks/go/governance/scout.json +31 -0
  56. package/src/gdskills/bundled/stacks/go/pack.json +41 -0
  57. package/src/gdskills/bundled/stacks/go/rules/coding-style.mdc +85 -0
  58. package/src/gdskills/bundled/stacks/go/rules/patterns.mdc +65 -0
  59. package/src/gdskills/bundled/stacks/go/rules/security.mdc +73 -0
  60. package/src/gdskills/bundled/stacks/go/rules/testing.mdc +68 -0
  61. package/src/gdskills/bundled/stacks/go/skills/go-build-fix/SKILL.md +138 -0
  62. package/src/gdskills/bundled/stacks/go/skills/go-build-fix/evals.json +75 -0
  63. package/src/gdskills/bundled/stacks/go/skills/go-code-review/SKILL.md +121 -0
  64. package/src/gdskills/bundled/stacks/go/skills/go-code-review/evals.json +72 -0
  65. package/src/gdskills/bundled/stacks/go/skills/go-implementation/SKILL.md +122 -0
  66. package/src/gdskills/bundled/stacks/go/skills/go-implementation/evals.json +76 -0
  67. package/src/gdskills/bundled/stacks/go/skills/go-testing/SKILL.md +126 -0
  68. package/src/gdskills/bundled/stacks/go/skills/go-testing/evals.json +73 -0
  69. package/src/gdskills/bundled/stacks/mobx/agent-refs.json +4 -0
  70. package/src/gdskills/bundled/stacks/mobx/governance/eval.json +904 -0
  71. package/src/gdskills/bundled/stacks/mobx/governance/scout.json +18 -0
  72. package/src/gdskills/bundled/stacks/mobx/pack.json +28 -0
  73. package/src/gdskills/bundled/stacks/mobx/rules/coding-style.mdc +91 -0
  74. package/src/gdskills/bundled/stacks/mobx/rules/patterns.mdc +122 -0
  75. package/src/gdskills/bundled/stacks/mobx/rules/security.mdc +56 -0
  76. package/src/gdskills/bundled/stacks/mobx/rules/testing.mdc +63 -0
  77. package/src/gdskills/bundled/stacks/mobx/skills/mobx-observable-testing/SKILL.md +124 -0
  78. package/src/gdskills/bundled/stacks/mobx/skills/mobx-observable-testing/evals.json +73 -0
  79. package/src/gdskills/bundled/stacks/mobx/skills/mobx-store-implementation/SKILL.md +149 -0
  80. package/src/gdskills/bundled/stacks/mobx/skills/mobx-store-implementation/evals.json +74 -0
  81. package/src/gdskills/bundled/stacks/nestjs/agent-refs.json +4 -0
  82. package/src/gdskills/bundled/stacks/nestjs/governance/eval.json +1308 -0
  83. package/src/gdskills/bundled/stacks/nestjs/governance/scout.json +34 -0
  84. package/src/gdskills/bundled/stacks/nestjs/pack.json +53 -0
  85. package/src/gdskills/bundled/stacks/nestjs/rules/coding-style.mdc +70 -0
  86. package/src/gdskills/bundled/stacks/nestjs/rules/patterns.mdc +83 -0
  87. package/src/gdskills/bundled/stacks/nestjs/rules/security.mdc +73 -0
  88. package/src/gdskills/bundled/stacks/nestjs/rules/testing.mdc +69 -0
  89. package/src/gdskills/bundled/stacks/nestjs/skills/nestjs-build-fix/SKILL.md +157 -0
  90. package/src/gdskills/bundled/stacks/nestjs/skills/nestjs-build-fix/evals.json +70 -0
  91. package/src/gdskills/bundled/stacks/nestjs/skills/nestjs-implementation/SKILL.md +129 -0
  92. package/src/gdskills/bundled/stacks/nestjs/skills/nestjs-implementation/evals.json +71 -0
  93. package/src/gdskills/bundled/stacks/nestjs/skills/nestjs-testing/SKILL.md +143 -0
  94. package/src/gdskills/bundled/stacks/nestjs/skills/nestjs-testing/evals.json +69 -0
  95. package/src/gdskills/bundled/stacks/nextjs-nuxt/agent-refs.json +4 -0
  96. package/src/gdskills/bundled/stacks/nextjs-nuxt/governance/eval.json +2413 -0
  97. package/src/gdskills/bundled/stacks/nextjs-nuxt/governance/scout.json +42 -0
  98. package/src/gdskills/bundled/stacks/nextjs-nuxt/pack.json +42 -0
  99. package/src/gdskills/bundled/stacks/nextjs-nuxt/rules/coding-style.mdc +69 -0
  100. package/src/gdskills/bundled/stacks/nextjs-nuxt/rules/patterns.mdc +88 -0
  101. package/src/gdskills/bundled/stacks/nextjs-nuxt/rules/security.mdc +72 -0
  102. package/src/gdskills/bundled/stacks/nextjs-nuxt/rules/testing.mdc +64 -0
  103. package/src/gdskills/bundled/stacks/nextjs-nuxt/skills/nextjs-nuxt-build-fix/SKILL.md +147 -0
  104. package/src/gdskills/bundled/stacks/nextjs-nuxt/skills/nextjs-nuxt-build-fix/evals.json +75 -0
  105. package/src/gdskills/bundled/stacks/nextjs-nuxt/skills/nextjs-nuxt-code-review/SKILL.md +118 -0
  106. package/src/gdskills/bundled/stacks/nextjs-nuxt/skills/nextjs-nuxt-code-review/evals.json +76 -0
  107. package/src/gdskills/bundled/stacks/nextjs-nuxt/skills/nextjs-nuxt-implementation/SKILL.md +135 -0
  108. package/src/gdskills/bundled/stacks/nextjs-nuxt/skills/nextjs-nuxt-implementation/evals.json +78 -0
  109. package/src/gdskills/bundled/stacks/nextjs-nuxt/skills/nextjs-nuxt-testing/SKILL.md +116 -0
  110. package/src/gdskills/bundled/stacks/nextjs-nuxt/skills/nextjs-nuxt-testing/evals.json +75 -0
  111. package/src/gdskills/bundled/stacks/nextjs-nuxt/skills/nextjs-nuxt-upgrade-migration/SKILL.md +134 -0
  112. package/src/gdskills/bundled/stacks/nextjs-nuxt/skills/nextjs-nuxt-upgrade-migration/evals.json +76 -0
  113. package/src/gdskills/bundled/stacks/python/agent-refs.json +3 -0
  114. package/src/gdskills/bundled/stacks/python/governance/eval.json +1758 -0
  115. package/src/gdskills/bundled/stacks/python/governance/scout.json +34 -0
  116. package/src/gdskills/bundled/stacks/python/pack.json +41 -0
  117. package/src/gdskills/bundled/stacks/python/rules/coding-style.mdc +63 -0
  118. package/src/gdskills/bundled/stacks/python/rules/patterns.mdc +88 -0
  119. package/src/gdskills/bundled/stacks/python/rules/security.mdc +84 -0
  120. package/src/gdskills/bundled/stacks/python/rules/testing.mdc +77 -0
  121. package/src/gdskills/bundled/stacks/python/skills/python-build-fix/SKILL.md +144 -0
  122. package/src/gdskills/bundled/stacks/python/skills/python-build-fix/evals.json +74 -0
  123. package/src/gdskills/bundled/stacks/python/skills/python-code-review/SKILL.md +155 -0
  124. package/src/gdskills/bundled/stacks/python/skills/python-code-review/evals.json +72 -0
  125. package/src/gdskills/bundled/stacks/python/skills/python-implementation/SKILL.md +143 -0
  126. package/src/gdskills/bundled/stacks/python/skills/python-implementation/evals.json +78 -0
  127. package/src/gdskills/bundled/stacks/python/skills/python-testing/SKILL.md +132 -0
  128. package/src/gdskills/bundled/stacks/python/skills/python-testing/evals.json +73 -0
  129. package/src/gdskills/bundled/stacks/react/agent-refs.json +4 -0
  130. package/src/gdskills/bundled/stacks/react/governance/eval.json +2188 -0
  131. package/src/gdskills/bundled/stacks/react/governance/scout.json +40 -0
  132. package/src/gdskills/bundled/stacks/react/pack.json +42 -0
  133. package/src/gdskills/bundled/stacks/react/rules/coding-style.mdc +58 -0
  134. package/src/gdskills/bundled/stacks/react/rules/patterns.mdc +79 -0
  135. package/src/gdskills/bundled/stacks/react/rules/security.mdc +70 -0
  136. package/src/gdskills/bundled/stacks/react/rules/testing.mdc +60 -0
  137. package/src/gdskills/bundled/stacks/react/skills/react-build-fix/SKILL.md +139 -0
  138. package/src/gdskills/bundled/stacks/react/skills/react-build-fix/evals.json +72 -0
  139. package/src/gdskills/bundled/stacks/react/skills/react-code-review/SKILL.md +148 -0
  140. package/src/gdskills/bundled/stacks/react/skills/react-code-review/evals.json +74 -0
  141. package/src/gdskills/bundled/stacks/react/skills/react-implementation/SKILL.md +140 -0
  142. package/src/gdskills/bundled/stacks/react/skills/react-implementation/evals.json +74 -0
  143. package/src/gdskills/bundled/stacks/react/skills/react-testing/SKILL.md +142 -0
  144. package/src/gdskills/bundled/stacks/react/skills/react-testing/evals.json +83 -0
  145. package/src/gdskills/bundled/stacks/react/skills/react-upgrade-migration/SKILL.md +155 -0
  146. package/src/gdskills/bundled/stacks/react/skills/react-upgrade-migration/evals.json +74 -0
  147. package/src/gdskills/bundled/stacks/ts-js-node/agent-refs.json +4 -0
  148. package/src/gdskills/bundled/stacks/ts-js-node/governance/eval.json +2155 -0
  149. package/src/gdskills/bundled/stacks/ts-js-node/governance/scout.json +40 -0
  150. package/src/gdskills/bundled/stacks/ts-js-node/pack.json +41 -0
  151. package/src/gdskills/bundled/stacks/ts-js-node/rules/coding-style.mdc +73 -0
  152. package/src/gdskills/bundled/stacks/ts-js-node/rules/patterns.mdc +61 -0
  153. package/src/gdskills/bundled/stacks/ts-js-node/rules/security.mdc +71 -0
  154. package/src/gdskills/bundled/stacks/ts-js-node/rules/testing.mdc +63 -0
  155. package/src/gdskills/bundled/stacks/ts-js-node/skills/nodejs-build-fix/SKILL.md +137 -0
  156. package/src/gdskills/bundled/stacks/ts-js-node/skills/nodejs-build-fix/evals.json +73 -0
  157. package/src/gdskills/bundled/stacks/ts-js-node/skills/nodejs-code-review/SKILL.md +124 -0
  158. package/src/gdskills/bundled/stacks/ts-js-node/skills/nodejs-code-review/evals.json +74 -0
  159. package/src/gdskills/bundled/stacks/ts-js-node/skills/nodejs-esm-migration/SKILL.md +152 -0
  160. package/src/gdskills/bundled/stacks/ts-js-node/skills/nodejs-esm-migration/evals.json +71 -0
  161. package/src/gdskills/bundled/stacks/ts-js-node/skills/nodejs-implementation/SKILL.md +127 -0
  162. package/src/gdskills/bundled/stacks/ts-js-node/skills/nodejs-implementation/evals.json +72 -0
  163. package/src/gdskills/bundled/stacks/ts-js-node/skills/nodejs-testing/SKILL.md +134 -0
  164. package/src/gdskills/bundled/stacks/ts-js-node/skills/nodejs-testing/evals.json +70 -0
  165. package/src/gdskills/bundled/stacks/vue/agent-refs.json +4 -0
  166. package/src/gdskills/bundled/stacks/vue/governance/eval.json +2215 -0
  167. package/src/gdskills/bundled/stacks/vue/governance/scout.json +42 -0
  168. package/src/gdskills/bundled/stacks/vue/pack.json +42 -0
  169. package/src/gdskills/bundled/stacks/vue/rules/coding-style.mdc +73 -0
  170. package/src/gdskills/bundled/stacks/vue/rules/patterns.mdc +84 -0
  171. package/src/gdskills/bundled/stacks/vue/rules/security.mdc +60 -0
  172. package/src/gdskills/bundled/stacks/vue/rules/testing.mdc +69 -0
  173. package/src/gdskills/bundled/stacks/vue/skills/vue-build-fix/SKILL.md +137 -0
  174. package/src/gdskills/bundled/stacks/vue/skills/vue-build-fix/evals.json +72 -0
  175. package/src/gdskills/bundled/stacks/vue/skills/vue-code-review/SKILL.md +120 -0
  176. package/src/gdskills/bundled/stacks/vue/skills/vue-code-review/evals.json +71 -0
  177. package/src/gdskills/bundled/stacks/vue/skills/vue-implementation/SKILL.md +122 -0
  178. package/src/gdskills/bundled/stacks/vue/skills/vue-implementation/evals.json +72 -0
  179. package/src/gdskills/bundled/stacks/vue/skills/vue-testing/SKILL.md +115 -0
  180. package/src/gdskills/bundled/stacks/vue/skills/vue-testing/evals.json +72 -0
  181. package/src/gdskills/bundled/stacks/vue/skills/vue2-to-vue3-migration/SKILL.md +135 -0
  182. package/src/gdskills/bundled/stacks/vue/skills/vue2-to-vue3-migration/evals.json +71 -0
@@ -0,0 +1,134 @@
1
+ ---
2
+ name: nodejs-testing
3
+ description: "Use when a Node.js project's test suite (node:test, Vitest, Jest, or bun test) needs writing, extending, or fixing for TypeScript or JavaScript server/library/CLI code -- covers discovering the project's actual runner, mocking at process boundaries, fake timers, and deterministic async assertions. Not for pytest/Python tests, and not for auditing test conventions without changing test files (that is review-testing-practices)."
4
+ triggers:
5
+ - "write vitest tests for this service"
6
+ - "add node:test coverage"
7
+ - "fix failing jest test in this repo"
8
+ - "mock fetch in this test"
9
+ - "fake timers for this async test"
10
+ - "add test coverage for this CLI command"
11
+ metadata:
12
+ origin: authored
13
+ category: test
14
+ version: "1.0.0"
15
+ compatible_harnesses: "claude,codex,cursor,zed,opencode"
16
+ license: "MIT"
17
+ ---
18
+
19
+ # Node.js testing (node:test / Vitest / Jest / bun test)
20
+
21
+ Write, extend, or fix a Node.js project's test suite for TypeScript or
22
+ JavaScript server, library, or CLI code. The runner varies per project --
23
+ `node:test`, Vitest, Jest, and `bun test` are all in active use and are
24
+ not interchangeable in import source or config, so Step 1 always discovers
25
+ which one this project actually uses before anything is written. See
26
+ `rules/testing.mdc` for the full rule set.
27
+
28
+ ## Workflow
29
+
30
+ ### Step 1: Discover the project's test runner and conventions
31
+
32
+ 1. Read `package.json`'s `scripts.test` and `devDependencies`
33
+ (`vitest`, `jest`, or neither -> `node:test`/`bun test`), plus any
34
+ `vitest.config.*`/`jest.config.*`.
35
+ 2. Find the test layout: co-located `*.test.ts`/`*.spec.ts`, or a parallel
36
+ `test/`/`__tests__/` tree. Match whichever the project already uses.
37
+ 3. Read 1-2 neighboring test files for: import source of `describe`/`it`/
38
+ `test`/`expect`/`assert`, mocking style, and how async tests are
39
+ structured.
40
+
41
+ ### Step 2: Plan mocks before test cases
42
+
43
+ - Mock at the process boundary only: network calls, filesystem, a DB
44
+ client, `Date.now`/timers -- never an internal function one module away,
45
+ which only checks two mocks agree with each other.
46
+ - For timer-dependent code, use the runner's fake timers (`node:test`'s
47
+ `mock.timers`, Vitest's `vi.useFakeTimers()`, Jest's
48
+ `jest.useFakeTimers()`) instead of a real `setTimeout` wait.
49
+ - Decide per dependency whether a hand-written stub or the runner's own
50
+ mock helper (`mock.fn()`/`mock.method()`, `vi.fn()`, `jest.fn()`) is a
51
+ better fit for the assertions needed.
52
+
53
+ ### Step 3: Plan test cases
54
+
55
+ **Functions/handlers:** happy path, edge cases (empty/`null`/`undefined`/
56
+ boundary values), error cases asserting the specific thrown error type or
57
+ message (not just that something threw).
58
+
59
+ **Async code:** every assertion-relevant `await` present; a test that
60
+ returns before its promises settle reports green regardless of what the
61
+ assertions found.
62
+
63
+ **CLI commands:** exit code, stdout/stderr content, and behavior on
64
+ missing/invalid arguments.
65
+
66
+ **Cancelable operations:** pass the test's own `AbortSignal` (`t.signal` in
67
+ `node:test`, or the runner's equivalent) into any `fetch`/cancelable call
68
+ the test makes.
69
+
70
+ ### Step 4: Write
71
+
72
+ 1. Create/extend the test file at the project's own convention path and
73
+ import source.
74
+ 2. One assertion concept per test; a multi-assertion test states in its
75
+ name the single behavior it verifies.
76
+ 3. Each test sets up and tears down its own state -- no dependency on
77
+ execution order or state a previous test left behind.
78
+
79
+ ### Step 5: Run and fix
80
+
81
+ ```bash
82
+ keryx test run --changed --strict
83
+ ```
84
+
85
+ `src/testing/service.ts` detects the project's own configured runner from
86
+ its lockfile/scripts -- do not hard-code a runner's flags here beyond what
87
+ Step 1 already discovered. With no keryx testing config, run the project's
88
+ own configured test script instead (`npm test`, `npx vitest run`, `npx
89
+ jest`, `node --test`).
90
+
91
+ Fix failing tests (max 3 iterations) -- fix the test, not the source under
92
+ test.
93
+
94
+ ### Step 6: Report
95
+
96
+ ```
97
+ Generated: src/orders/orders.test.ts
98
+ - 7 test cases (2 with fake timers), all passing
99
+ ```
100
+
101
+ ## Rules
102
+
103
+ - ALWAYS match the project's existing runner, layout, and mocking
104
+ conventions found in Step 1-2, not a different project's test style.
105
+ - NEVER modify source code -- only test files (and test config/setup files
106
+ when the change genuinely requires it).
107
+ - Mock external dependencies (network, filesystem, other services, the
108
+ clock), not internal modules under the same package.
109
+ - If no test runner is configured at all, suggest adding one; do not add
110
+ it unasked.
111
+
112
+ ## Red Flags
113
+
114
+ | Rationalization | Why it is wrong |
115
+ |---|---|
116
+ | "This async test doesn't need an await, the assertion is inside a `.then()`" | If the test function returns before the promise settles, the runner marks it passed regardless of what the assertion found |
117
+ | "I'll wait a real 2 seconds instead of mocking the timer" | Slow and, under load or CI contention, flaky; use the runner's fake timers |
118
+ | "The test keeps failing; I'll patch the source to make it pass" | This skill writes test files only -- a source change buried in a test-authoring run is an unreviewed fix that also hides the real bug |
119
+ | "I'll mock the internal helper so the test is simpler" | Mock external dependencies, not internal ones -- a test whose internal collaborators are all mocked only checks that the mocks agree with each other |
120
+ | "Still failing after three iterations; I'll loosen the assertion or skip it" | A loosened or skipped assertion covers nothing while reporting coverage. After 3 iterations, stop and report the failing case instead |
121
+
122
+ ## Verification
123
+
124
+ Do not report the work done until all of the following hold:
125
+
126
+ - The test file sits at the project's own convention path, matching the
127
+ runner and mocking style read in Step 1-2.
128
+ - `keryx test run --changed --strict` -- or, with no keryx testing config,
129
+ the project's own discovered test command -- exits 0 with every
130
+ generated test passing.
131
+ - No test depends on a real timer wait or on another test's leftover
132
+ state.
133
+ - `git status` shows only test files (and test config, if genuinely
134
+ touched) added or modified; no source file under test changed.
@@ -0,0 +1,70 @@
1
+ {
2
+ "triggers": {
3
+ "positive": [
4
+ "Write Vitest tests for this order calculation function in our TypeScript service",
5
+ "Add node:test coverage for the new CLI command in this Node project",
6
+ "Fix this failing Jest test that's timing out on the debounce logic",
7
+ "Mock the fetch call in this node:test file so it doesn't hit the real API",
8
+ "Add fake timers to this test for the setInterval-based polling function",
9
+ "Extend the test suite for this Node library's exported parseConfig function"
10
+ ],
11
+ "negative": [
12
+ "Write pytest fixtures for this Flask view function",
13
+ "Implement the new order creation handler in this Express service",
14
+ "Review this diff for resource cleanup and dependency risk",
15
+ "Migrate this test suite's imports from CommonJS to ESM",
16
+ "Fix this tsc type error in the test helper module",
17
+ "Write Playwright end-to-end tests for the checkout page in this React app"
18
+ ]
19
+ },
20
+ "scenarios": [
21
+ {
22
+ "id": "discover-runner-first",
23
+ "prompt": "This Node.js TypeScript repo's test setup isn't described here. Write a test for a function `sumOrderTotals(orders)`. What should you check before writing the test file?",
24
+ "strictness": "high",
25
+ "expected_behavior": [
26
+ {
27
+ "grader": "judge",
28
+ "rubric": "A correct answer says to first discover which test runner and conventions this project actually uses (package.json scripts.test/devDependencies, config files, and existing test file layout/imports) before writing the test file.",
29
+ "pass_criteria": [
30
+ "Names the concrete places to check: package.json's scripts.test/devDependencies, or a vitest.config.*/jest.config.* file -- not just 'check the project setup' in the abstract",
31
+ "Says to open an existing test file to read its actual import source (e.g. from vitest, jest, or node:test) and layout convention, and match it, rather than assuming a runner"
32
+ ],
33
+ "fail_criteria": [
34
+ "Picks a specific runner (e.g. Jest, Vitest) and writes the test immediately without first checking what the project actually uses"
35
+ ]
36
+ }
37
+ ],
38
+ "calibration": {
39
+ "known_right": "Before writing anything, find out what this project actually runs. Check package.json's scripts.test and devDependencies for vitest, jest, or neither (which usually means node:test or bun test), and look for a vitest.config.* / jest.config.* file. Then find the existing test layout -- co-located *.test.ts files next to source, or a parallel test/ / __tests__/ tree -- and open one or two existing test files to see the import source for describe/it/expect (or assert), the mocking style already in use, and how async tests are structured there. Only once that's established should the sumOrderTotals test file be created, at the same path convention and with the same runner's imports, so it matches the rest of the suite instead of introducing a second, inconsistent test style.",
40
+ "known_wrong": "Vitest is the standard choice for a TypeScript project these days, so I'll just write the test using vi and describe/it from vitest and put it at src/orders/sumOrderTotals.test.ts. That's the most common modern setup so it's a safe default even without checking what's already configured here -- if the project actually uses something else, the imports are easy enough to swap afterward.",
41
+ "vague": "Before writing the test, it's a good idea to check how this project's tests are usually set up so the new test fits in.",
42
+ "subtle_wrong": "First I'd check package.json's devDependencies to see whether vitest or jest is installed, and use whichever one shows up -- say it's vitest, then I'd write the test with import { describe, it, expect } from 'vitest' at src/orders/sumOrderTotals.test.ts, which is the standard co-located layout for a TS project. No need to dig through an existing test file first since the devDependency already tells you which runner, and the standard path/import style follows from that."
43
+ }
44
+ },
45
+ {
46
+ "id": "mock-boundary-not-internal",
47
+ "prompt": "I'm writing a test for a function that calls an internal helper `formatOrder` and also calls out to a network client `httpClient.get`. What should I mock?",
48
+ "strictness": "high",
49
+ "expected_behavior": [
50
+ {
51
+ "grader": "judge",
52
+ "rubric": "A correct answer says to mock the network client (httpClient.get), the process boundary, and explicitly says NOT to mock the internal helper formatOrder, since mocking internal collaborators only checks the mocks agree with each other.",
53
+ "pass_criteria": [
54
+ "Names httpClient.get specifically as the thing to mock (the network client / external boundary) -- not just 'mock the network call' in the abstract",
55
+ "Explicitly says NOT to mock formatOrder, naming it as an internal helper in the same package that should run for real"
56
+ ],
57
+ "fail_criteria": [
58
+ "Recommends mocking the internal helper formatOrder -- mentioning formatOrder only to say it should NOT be mocked, as part of a correct answer, does not count as this failure"
59
+ ]
60
+ }
61
+ ],
62
+ "calibration": {
63
+ "known_right": "Mock httpClient.get -- that's the process boundary, a real network call to another service, which is exactly what should be mocked in a unit test so it's deterministic and doesn't hit the network. Don't mock formatOrder: it's an internal helper living in the same package, so let it run for real. If you mock it too, the test degenerates into checking that your mock of formatOrder agrees with your mock of httpClient.get -- it stops verifying that the function under test actually formats and fetches correctly together, and it'll keep passing even if formatOrder's real behavior regresses. So: stub/mock httpClient.get to return canned response data, call the function under test normally (letting it call the real formatOrder), and assert on the final output.",
64
+ "known_wrong": "Mock both -- mock the internal helper formatOrder so you can control exactly what it returns without depending on its real implementation, and also mock httpClient.get for the network call. Mocking formatOrder makes the test simpler and more isolated since you don't need to worry about its internals changing the assertions; you're testing the function's orchestration logic, not formatOrder itself, so stubbing it out keeps the test focused and easy to reason about.",
65
+ "vague": "Mock the external call so the test stays isolated and deterministic, and be careful about which other pieces you decide to mock too.",
66
+ "subtle_wrong": "Mock httpClient.get since that's the real network boundary -- stub it to return canned response data. For formatOrder, I'd normally let it run for real, but since it has some locale-dependent formatting that's noisy to set up deterministically in this environment, I'd mock it too just for this test so the output is stable and the assertions aren't fighting with formatting differences."
67
+ }
68
+ }
69
+ ]
70
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "agents": [],
3
+ "note": "honest gate (flow 318, T13; attribution corrected in R1 review PR #719, minor-3): vue-build-fix fails -- falsePositive=1 (trigger-negative-1, \"fix this tsc error in a plain typescript service file\": a CROSS-pack collision with ts-js-node/nodejs-build-fix, not a same-pack near-miss) and its template-union-type-narrowing behavior scenario scores 0.4, below the 0.8 PACK_BEHAVIOR_PASS_FLOOR, even though every other vue skill (implementation, testing, code-review, vue2-to-vue3-migration) clears the gate cleanly. See src/gdskills/bundled/stacks/vue/governance/eval.json. Stays experimental; no generated agent pair."
4
+ }