Skip to content

Commit 0ca1edb

Browse files
AlexU-Aclaude
andcommitted
feat: add severity scale and calibration examples
Add <Severity_Scale> (CRITICAL/MAJOR/MINOR/ENHANCEMENT) and <Severity_Calibration_Examples> with 3 React-specific scenarios: stale closure downgrade, re-render context upgrade, race condition hold. No eval delta — additive change. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent a08952d commit 0ca1edb

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

.claude/agents/react-critic.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,34 @@ Process:
2929
If you cannot demonstrate a concrete exploit path accessible to non-admin/non-privileged users, tag the finding as `[UNCONFIRMED]` and move it to Open Questions. Do NOT leave unconfirmed security findings in scored sections.
3030
9. Produce a calibrated verdict, and state if adversarial escalation was triggered.
3131

32+
<Severity_Scale>
33+
- CRITICAL: Blocks functionality, causes data loss, or creates security vulnerability. Architectural fix required.
34+
- MAJOR: Causes significant UX degradation, performance regression, or requires design-level rework.
35+
- MINOR: Suboptimal but functional. Better patterns exist but current approach works.
36+
- ENHANCEMENT: Best practice not followed but no functional impact.
37+
</Severity_Scale>
38+
39+
<Severity_Calibration_Examples>
40+
Example 1 — Downgrade:
41+
Initial: CRITICAL — "useEffect missing dependency causes stale closure"
42+
After Realist Check: MAJOR
43+
Mitigated by: The stale value is a configuration constant that only changes on page reload. Users will never encounter the stale value during normal interaction.
44+
Evidence: `useSettings.ts:12``config.apiUrl` is set once at mount and never updates.
45+
Rationale: Technically incorrect dependency array, but no user-visible bug. Fix is still needed for correctness, but this isn't blocking functionality.
46+
47+
Example 2 — Upgrade:
48+
Initial: MINOR — "Component re-renders on every parent render"
49+
After Realist Check: MAJOR
50+
Evidence: Component is rendered inside a virtualized list of 10,000 items. Each parent render triggers 10,000 child re-renders. Measured: 340ms render time, exceeding 16ms frame budget by 21x.
51+
Rationale: In isolation this is minor, but in context of the list it causes visible jank on every keystroke in the search filter.
52+
53+
Example 3 — Holds:
54+
Initial: CRITICAL — "Race condition between concurrent API calls overwrites form state"
55+
After Realist Check: Still CRITICAL
56+
Evidence: `useFormSubmit.ts:34` — No abort controller, no request deduplication. Double-clicking submit sends two requests; second response overwrites first, potentially saving partial data.
57+
Rationale: Data loss scenario reachable through normal user interaction (double-click). No compensating control.
58+
</Severity_Calibration_Examples>
59+
3260
React-specific mandatory checks:
3361
- Hooks correctness and stale closure risks.
3462
- State ownership and mutation safety.

0 commit comments

Comments
 (0)