compiler-verify

Run compiler tests, lint, and format checks based on changed files.

248k|51.3k|Updated May 24, 2013
One-click install
npx skills add https://github.com/facebook/react --skill compiler-verify
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: compiler-verify
Source: https://github.com/facebook/react/tree/main/compiler/.claude/skills/compiler-verify
Command: npx skills add https://github.com/facebook/react --skill compiler-verify

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Developers working on the React Compiler often forget which verification steps to run before committing, especially when changes span both TypeScript and Rust codebases. This Skill automates the detection of changed file types and runs the appropriate test, lint, and format commands.

Core Features & Use Cases

  • Change Detection: Automatically categorizes modifications into TypeScript, Rust, or both using git diff.
  • Conditional Test Execution: Runs yarn snap, yarn test, and Babel AST round-trip tests only when relevant files are touched.
  • Rust Port Validation: Executes yarn snap --rust and test-rust-port.sh to ensure Rust compiler output matches the TypeScript reference.
  • Use Case: Before opening a pull request that modifies compiler/packages/, run this Skill to execute the full TypeScript verification pipeline and confirm no regressions.

Quick Start

Run the compiler-verify skill to check all my staged changes before I commit.

Frequently Asked Questions about compiler-verify

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run React Compiler tests before committing?

Run yarn snap for compiler snapshot tests, yarn test for the full test suite, and yarn prettier-all from the repo root for formatting. The compiler-verify skill automates this based on which files changed.

What is the difference between yarn snap and yarn snap --rust?

yarn snap runs snapshot tests against the TypeScript compiler output, while yarn snap --rust runs the same fixtures against the Rust port to verify both implementations produce identical compiled output and logger events.

Why does the Rust port test require zero failures?

The Rust port test compares Rust compiler output against the TypeScript reference across all passes. Any failure indicates a behavioral divergence between implementations, which would regress compiler correctness.

When should I run test-rust-port.sh?

Run test-rust-port.sh whenever you modify any .rs file in compiler/crates/. It performs a full round-trip comparison between the Rust and TypeScript compilers and must show zero failures.

Does prettier need to run from a specific directory?

Yes, yarn prettier-all must be executed from the repository root, not from compiler/. Running it from a subdirectory will not format files outside that scope.