fxa-test-repair

Reviews test files against FXA testing guidelines and produces a prioritized repair plan.

685|236|Updated Jun 3, 2015
One-click install
npx skills add https://github.com/mozilla/fxa --skill fxa-test-repair
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: fxa-test-repair
Source: https://github.com/mozilla/fxa/tree/main/.claude/skills/fxa-test-repair
Command: npx skills add https://github.com/mozilla/fxa --skill fxa-test-repair

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Test files in the Mozilla Accounts monorepo often accumulate violations of FXA testing guidelines such as shared mutable state, vague assertions, and over-mocking, which cause flaky or misleading tests. This Skill audits a test file against every rule and produces a prioritized repair plan without modifying any files.

Core Features & Use Cases

  • Rule-by-Rule Audit: Checks the target test file against the shared FXA testing rules in .claude/rules/testing/base.md, plus React component rules for *.test.tsx files.
  • Prioritized Findings Table: Classifies each violation as High, Medium, or Low severity with location, rule reference, and before/after repair snippets.
  • Scope Suggestion: Recommends a reasonable repair batch based on issue volume so diffs stay reviewable.
  • Use Case: An engineer who just modified account.spec.ts runs the Skill to get a repair plan flagging shared state across tests and weak toBeTruthy() assertions before opening a pull request.

Quick Start

Ask the assistant to review the test file at a given path, for example: run fxa-test-repair on packages/fxa-auth-server/test/account.spec.ts and show me the repair plan.

Frequently Asked Questions about fxa-test-repair

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

FAQPage Schema
How do I review a test file for FXA testing guideline violations?

Invoke the Skill with the test file path as an argument, or let it detect recently changed test files via git diff. It reads the file, audits it against every rule in the shared testing guidelines, and returns a prioritized findings table with repair snippets.

Does this Skill automatically fix my test files?

No, it never modifies files. It outputs a repair plan with before and after code suggestions for engineer review, since repairs like mock restructuring can change test behavior and require human judgment.

Does it support React component tests?

Yes. When the target file matches `*.test.tsx`, it additionally loads the React component testing rules from `.claude/rules/testing/react.md` and audits against those rules alongside the base FXA testing rules.

How are test violations prioritized in the repair plan?

Findings are classified as High, Medium, or Low severity. High covers issues causing false positives or order-dependent failures, Medium covers reduced test value like vague assertions, and Low covers convention violations that do not affect correctness.

What happens when a test file has many violations?

For 16 or more issues, the Skill suggests tackling repairs by rule category rather than line by line, and recommends running the fxa-test-independence validation afterward to confirm nothing regressed.