fuzz

GitHub

提供 React Doctor 规则模糊测试工具的使用指南,涵盖执行Harness、分类崩溃/误报等发现、修复及回归测试流程。

.agents/skills/fuzz/SKILL.md millionco/react-doctor

Trigger Scenarios

需要验证或改进 ESLint 规则的准确性 调查模糊测试发现的崩溃或误报问题 进行大规模规则回归测试

Install

npx skills add millionco/react-doctor --skill fuzz -g -y
More Options

Non-standard path

npx skills add https://github.com/millionco/react-doctor/tree/main/.agents/skills/fuzz -g -y

Use without installing

npx skills use millionco/react-doctor@fuzz

指定 Agent (Claude Code)

npx skills add millionco/react-doctor --skill fuzz -a claude-code -g -y

安装 repo 全部 skill

npx skills add millionco/react-doctor --all -g -y

预览 repo 内 skill

npx skills add millionco/react-doctor --list

SKILL.md

Frontmatter
{
    "name": "fuzz",
    "description": "Fuzz React Doctor rules for crashes, slowness, false positives, and mutation-sensitive diagnostics with @react-doctor\/fuzz. Use after rule tests pass, when investigating a fuzz finding, or whenever an eval, review, or user report confirms a new false positive."
}

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:

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

Useful variants:

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:

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:

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:

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.

Version History

  • 4fbab2d Current 2026-07-25 11:10

Same Skill Collection

.agents/skills/benchmark-fp-fn-audit/SKILL.md
.agents/skills/deslop/SKILL.md
.agents/skills/find-similar-functions/SKILL.md
.agents/skills/rde-eval/SKILL.md
.agents/skills/react-doctor/SKILL.md
.agents/skills/rule-research/SKILL.md
.agents/skills/rule-validate/SKILL.md
.agents/skills/rule-writing/SKILL.md
.agents/skills/run-parity/SKILL.md
.agents/skills/ship/SKILL.md
.agents/skills/writing-guidelines/SKILL.md
skills/improve-threejs/SKILL.md
skills/performance/SKILL.md
skills/react-doctor/SKILL.md
.agents/skills/product-thinking/SKILL.md
skills/improve-react/SKILL.md

Metadata

Files
0
Version
3ff37f3
Hash
85bad459
Indexed
2026-07-25 11:10

- 위키
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-20 09:17
浙ICP备14020137号-1 $방문자$