React Compiler Analyzer
Use the analyzer version installed in the current repository. Do not substitute a global or newer package version.
First-time setup
- Locate
rca.config.json. If it is missing, run the local analyzer'sinit --yes --no-skillcommand because this repository skill is already installed. - Read references/config-discovery.md.
- Identify the TypeScript source paths in scope and inspect them for existing
'use memo'and'use no memo'directives before choosing a compiler mode. If any directives exist and the user did not already choose a mode, ask whether RCA should useinferorannotation; makeinferthe recommended default. Directives can be used in either mode and do not prove that the build usesannotation. - Inspect the repository before adding parser plugins, risk rules, wrapper resolution, or path
aliases. Configure only behavior supported by code or build configuration evidence. When
wrapper resolution is enabled, include aliases for first-party TypeScript dependencies exposed
by the applicable tsconfig's
compilerOptions.pathsor project-reference graph. - Validate the resulting config with an analysis run. Treat unresolved wrapper imports, missing first-party dependency aliases, or aliases that never match as incomplete configuration, not as a clean risk result.
Analysis workflow
- Identify the TypeScript source paths relevant to the user's request. Paths are intentionally not
stored in
rca.config.json. - Run
analyzewith an explicit--format jsonfor machine-readable results. - Use the JSON summary and function records to distinguish:
- compiler acceptance;
- accepted functions with positive, zero, or unavailable reported memo statistics;
- actual emitted caching, which normal analysis does not verify;
- suppression-related rejection and any risks retained on those functions;
- manual memo migration candidates.
- Use human
--format cli --verboseoutput only when detailed diagnostics or candidate evidence is needed. - Read references/cli-reference.md before using annotation or lint fixes.
Safety rules
- Never use
analyze --annotateorlint --fixunless the user explicitly requests source changes. - Never interpret compiler acceptance or memo-slot counts as a performance-value ranking.
- Never infer actual emitted caches or caching of a particular risky operation from analysis-only counters. Zero slots do not disqualify preventive bailouts; positive slots do not prove unsafe caching.
- Treat redundancy as profile-specific. Justified guards remain protected with
--fix; un-justified cleanup retains its existing behavior and needs consumer-build review. - Do not enable
allcompilation mode. Useinferby default. If source directives are already present and the user has not chosen a mode, ask before selectinginferorannotationand show any explicit build-mode evidence in the question. - Do not report risk analysis as clean when wrapper resolution stopped at package boundaries or path aliases resolved nothing.
- Do not commit generated JSON, Markdown, or HTML reports unless the user requests them.