millionco/react-doctor

fuzz

Fuzz React Doctor rules for crashes, slowness, false positives, and mutation-sensitive diagnostics with @react-doctor/fuzz.

Zobacz źródło

Jak używać

  1. Skopiuj polecenie instalacji i sprawdź źródła przed instalacją we własnym środowisku agenta.
  2. W oryginale sprawdź wymagane narzędzia, dane dostępowe i obsługiwane środowiska.
  3. Opisz dane wejściowe i oczekiwany rezultat; porównaj wynik ze źródłami.
npx skills add https://github.com/millionco/react-doctor --skill fuzz

Przed rozpoczęciem

  • Instalacja nie obejmuje subskrypcji modelu, limitu API ani uprawnień do plików.
  • Gwiazdki i instalacje pokazują aktywność, a nie niezależny test jakości lub bezpieczeństwa.
Oryginalny dokument Skill

Treść z repozytorium z zachowaniem nagłówków, przykładów, kodu, tabel, linków i obrazów.

Fuzz rules

Use packages/fuzz after focused rule tests pass. Read its README.md for harness architecture and corpus setup.

Run the harness

Run the target rule first:

sh
FUZZ_RULE=<rule-id> FUZZ_STRICT=1 FUZZ_ITERATIONS=500 nr fuzz

Useful variants:

sh
nr fuzz
FUZZ_RULE=<rule-id> FUZZ_SEED=42 nr fuzz
FUZZ_INVARIANTS=1 nr fuzz
FUZZ_CORPUS_DIR=<repository-directory> nr fuzz
FUZZ_RULE=<rule-id> FUZZ_PRINT_SILENT=1 nr fuzz

Confirm that the target rule fires. A silent rule only exercises early exits. If it stays silent, add a triggering shape to packages/fuzz/src/snippet-pools.ts and rerun.

Use FUZZ_TAG=<tag> instead of FUZZ_RULE to exercise an entire registry cohort.

Recommended full sweep (e.g. before a rule-batch release), pointing the corpus at real checkouts. Ready-made corpora work on any machine — see the package README "Canonical corpora": bun scripts/sync-fuzz-corpus.ts materializes a pinned 48-repo sample (symlinking the RDE cache when present, cloning otherwise), and bun scripts/build-bench-corpus.ts extracts react-bench's diagnostic-dense RD-health target files:

sh
cd packages/fuzz
bun scripts/sync-fuzz-corpus.ts
FUZZ_INVARIANTS=1 FUZZ_ITERATIONS=100 FUZZ_CORPUS_DIR=tmp/corpus-repos nr fuzz

Run the direct false-positive check when a rule change affects common syntax:

sh
cd packages/fuzz
bun scripts/hunt-false-positives.ts

Triage findings

Reproducers live in packages/fuzz/tmp/fuzz-findings/.

  • Crash: minimize the program, add a no-throw regression test, fix the rule, and replay the seed
  • Slow case: profile the pathological shape, bound the walk, and keep the existing threshold
  • Verdict drop: fix detection that depends on incidental syntax, then add the rule to the robustness gate when appropriate
  • Invariant violation: decide whether the rule should react to the rewrite; fix and test unexpected changes
  • False positive: add the valid program to the rule tests and fuzz regression corpus

Replay one finding:

sh
FUZZ_RULE=<rule-id> FUZZ_SEED=<seed> FUZZ_ITERATIONS=1 nr fuzz

Preserve false positives

For every confirmed false positive:

  1. Add a minimal fixture to packages/fuzz/corpus/regressions/<rule-id>--<slug>.tsx.
  2. Include the rule ID, weakness class, and source in the fixture header.
  3. Add a focused valid case to the rule test suite.
  4. Add a generator snippet when the existing pools cannot produce the weakness.
  5. Run nr -C packages/fuzz test and replay the target rule.

Use a stable weakness name such as library-idiom, control-flow, wrapper-transparency, name-heuristic, alias-guard, cross-file, framework-gating, paren-shape, default-parameter, dynamic-computed, private-member, or copy-tracking.

Project-level dead-code and dependency findings belong in core tests, not the rule fuzzer.

Report results

Record the command, target-rule fire count, findings, replay seeds, corpus fixtures, and generator changes. Pass confirmed implementation findings to rule-validate.

Powiązane zadania

z tego samego repozytorium

Więcej Skills

Wszystkie Skills
millionco
Społeczność

react-doctor

Use when finishing a feature, fixing a bug, before committing React code, or when the user types /doctor, asks to scan, triage, or clean up React diagnostics. Covers lint, accessibility, bundle size, architecture. Includes a regression check and a full local-triage workflow that fetches the canonical playbook.

instalacje
27
GitHub Stars
15 tys.
Aktualizacja
16 paź
millionco
Społeczność

run-parity

Compare React Doctor diagnostics for a GitHub pull request (PR) with Vercel Sandbox. Use when asked to run parity, check a PR for diagnostic regressions, compare a PR with its base, or report added and removed diagnostics.

instalacje
1
GitHub Stars
15 tys.
Aktualizacja
14 paź
millionco
Społeczność

improve-react

Survey a whole React codebase as a senior React engineer, using React Doctor's scan as evidence, then produce a prioritized audit and self-contained implementation plans for other agents (or cheaper models) to execute. Read-only on source code — it plans improvements, it does not apply them. Use when the user asks to "improve the React code", "audit this codebase", "make this app faster / more robust", or wants a roadmap of fixes rather than a review of a single diff. For a regression check or a

instalacje
1
GitHub Stars
14,9 tys.
Aktualizacja
1 paź
millionco
Społeczność

benchmark-fp-fn-audit

Audit React Doctor against ReactBench or similar diagnostic benchmark corpora for confirmed false positives, false negatives, taxonomy gaps, and verifier artifacts. Use when analyzing rd.log, rd-before.json, rd-after.json, model.patch, result.json, reward/test logs, rule distributions, or when asked to perform a second adversarial pass over React Doctor benchmark findings.

instalacje
2
GitHub Stars
14,7 tys.
Aktualizacja
2 wrz