Agent skill · software engineering · facebook

compiler-port

Port a compiler pass from TypeScript to Rust. Gathers context, plans the port, implements in a subagent with test-fix loop, then reviews.

Why this skill is useful

Adds a comprehensive automation script for porting compiler passes from TypeScript to Rust, including validation, context gathering, implementation planning, and review processes.

What it needs

Requires cargo, rust installed locally. About 2k tokens when loaded. Last updated 2026-08-06. 247,076 stars on the source repository.

What this skill does

Port Compiler Pass Port a compiler pass from TypeScript to Rust end-to-end. Arguments: $ARGUMENTS: Pass name exactly as it appears in Pipeline.ts log entries (e.g., PruneMaybeThrows, SSA, ConstantPropagation) Step 0: Validate pass name 1. Read compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Pipeline.ts 2. Search for name: '$ARGUMENTS' in log entries 3. If not found, list all available pass names from the log({...name: '...'}) calls and stop 4. Check the kind field of the matching log entry: If kind: 'ast', report that test-rust-port only supports hir and reactive kind passes currently and stop If kind: 'hir' or kind: 'reactive', proceed Step 1: Determine TS source files and Rust crate 1. Follow the import in Pipeline.ts to find the actual TypeScript file(s) for the pass 2. Map the TS folder to a Rust crate using this mapping: TypeScript Path Rust Crate --- --- src/HIR/ (excluding BuildHIR.ts, HIRBuilder.ts) reactcompilerhir src/HIR/BuildHIR.ts, src/HIR/HIRBuilder.ts reactcompilerlowering src/Babel/, src/Entrypoint/ reactcompiler src/CompilerError.ts reactcompilerdiagnostics src/ReactiveScopes/ reactcompilerreactivescopes src/<Name>/ reactcompiler<name> (1:1, e.g., src/Optimization/ -> reactcompileroptimization) 3. Check if the pass is already ported: Check if the corresponding Rust file exists in the target crate Check if compiler/crates/reactcompiler/src/entrypoint/pipeline.rs already calls it If both are true, report the pass is already ported and stop Step 2: Gather context Read the following files (all reads happen in main context): 1. Architecture guide: compiler/docs/rust-port/rust-port-architecture.md 2. Pass documentation: Check compiler/packages/babel-plugin-react-compiler/docs/passes/ for docs about this pass 3. TypeScript source: All TypeScript source files for the pass + any helpers imported from the same folder 4. Rust pipeline: compiler/crates/reactcompiler/src/entrypoint/pipeline.rs 5. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills facebook/compiler-port

View the source on GitHub

Browse the @skills marketplace