Repository navigation
Description
Request type
Rule quality or correctness issue
Existing rule path or proposed topic
rules/jest-unit-testing-cursorrules-prompt-file.mdc
Cursor workflow this improves
Asking the agent to write Jest tests for an existing module. We measured this rule's text on 12 small JavaScript projects. Each project had 20 bugs planted in it, and the task was to write one test file. The models were Claude Sonnet 5.5 and Haiku 5.5, with 10 attempts per project. Each attempt got either the rule's text or no rule.
The rule's text cut the share of attempts whose tests caught every planted bug, for both models:
| Measure (120 attempts each) | Sonnet, no rule | Sonnet, with rule | Haiku, no rule | Haiku, with rule |
|---|---|---|---|---|
| Share of attempts that caught every bug | 65.8% | 2.5% | 33.3% | 5.0% |
| Share of planted bugs caught | 94.8% | 85.3% | 92.7% | 83.9% |
| Tests written per attempt (median) | 31 | 10 | 35 | 7 |
Tests written: test() and it() calls (with their .each, .only and .skip forms) in the test files the model added; a call inside a loop or a test.each table counts once. Each project already had 19 tests, which no attempt changed and which are not counted.
We then reran the same projects on one day with the rule minus item 8 only. Without that line, the share of attempts that caught every bug was 69.2% (Sonnet) and 43.3% (Haiku). The full rule scored 8.3% for both models on the same day. With no rule, the shares were 64.2% and 34.2%.
What this shows:
- Sonnet: item 8 caused the drop, on both measures.
- Haiku: item 8 caused the drop on the share of attempts that caught every bug. On the share of planted bugs caught, it was not shown: +5.4 points, with a 95% range of -1.3 to +10.0.
- The rest of the rule: we could not tell it apart from no rule.
Limits:
- The rule's text was given as always-on text, not run inside Cursor.
- There were two Claude models and single-turn tasks.
The full method, the receipts and a command that re-checks every number from them are here: https://driftproofhq.com/reports/021/
Proposed rule content or expected change
Drop item 8, or soften it so it does not cap coverage, for example:
**8** **Test Quantity**: Write one focused test per behaviour or edge case the module promises; split large test files rather than dropping cases
We measured only dropping the line, not this wording. The line's aim, maintainable test files, is fair. The cost of the cap is that it leaves bugs uncaught.
I build Driftproof, a small open-source tool that measures whether a rules file or skill changes what a model does.
Scope acknowledgement
- I am not asking for third-party tool support, account sharing, or license bypass help.
Activity