com um clique
fxa-test-repair
// Reviews a test file for violations of FXA testing guidelines, then suggests concrete repairs. Does not auto-apply changes — output is a repair plan for engineer review.
// Reviews a test file for violations of FXA testing guidelines, then suggests concrete repairs. Does not auto-apply changes — output is a repair plan for engineer review.
Lists open FXA PRs matching a search term with a rich status table — file/line counts, draft state, review activity, and approval status. Defaults to all open PRs needing review.
Approves the on-hold "Approve Functional Tests (PR)" CircleCI job for the current PR branch, kicking off the gated Playwright functional tests. Requires CIRCLECI_TOKEN in the environment.
Reviews changed React/TSX code for component design, hooks misuse, performance, accessibility, and state management issues. Reports findings with severity and concrete fix recommendations. Operates on files changed vs main.
Fast single-pass FXA-specific commit review covering security, conventions, logic/bugs, tests, and migrations. No subagents — runs directly in the main context.
Thorough FXA-specific commit review using parallel specialist agents. Covers security, TypeScript, logic/bugs, test quality, and architecture. Agents explore call sites, git history, and monorepo conventions.
Drafts Jest tests for changed code. Defaults to staged/unstaged changes or the most recent commit. Output is a starting point for review, not final.
| name | fxa-test-repair |
| description | Reviews a test file for violations of FXA testing guidelines, then suggests concrete repairs. Does not auto-apply changes — output is a repair plan for engineer review. |
| allowed-tools | Bash, Read, Grep, Glob |
| argument-hint | <test-file-path> |
| user-invocable | true |
| context | fork |
Review a test file for violations of the FXA testing guidelines and produce a prioritized repair plan with before/after code suggestions. This skill does not modify files — all repairs are presented for engineer review for correctness and scope before implementation.
If scope of changes is large, suggest a reasonable subset of repairs to implement in a single pass to avoid overwhelming diffs and code review. Always prioritize correctness and test value over style — if a repair improves readability but risks changing test behavior, flag it as Medium severity and note the risk.
Read the shared testing guidelines before proceeding:
.claude/skills/fxa-testing-shared/GUIDELINES.md
If the target file is a React component test (*.test.tsx), also read Section 5 ("Testing Patterns (React/TSX)") of .claude/skills/fxa-check-react/SKILL.md and audit against those rules in addition to the shared rules.
If $ARGUMENTS is provided, use it as the test file path.
Otherwise check for recently changed test files:
git diff HEAD --name-only | grep -E '\.(spec|test)\.(ts|tsx)$'
git diff --cached --name-only | grep -E '\.(spec|test)\.(ts|tsx)$'
If multiple files are found, ask the engineer which to repair. If none, ask explicitly.
Read the full test file. Note:
beforeEach, inline)describe scopeWork through every rule in the shared guidelines. For each violation found, record: location, the rule it breaks, and a before/after repair snippet. If a rule has no violations, note it as clean — do not skip rules.
Output a prioritized findings table:
| # | Severity | Rule violated | Location | Description |
|---|---|---|---|---|
| 1 | High | Independent & order-agnostic | account.spec.ts:14 | account mutated across tests without beforeEach reset |
| 2 | Medium | Assert explicitly | account.spec.ts:42 | toBeTruthy() used where exact value is known |
| 3 | Low | Independent & order-agnostic | account.spec.ts:8 | jest.clearAllMocks() in beforeEach redundant — this package's jest.config.* already sets clearMocks: true (only flag when verified against the project config) |
Severity:
await, over-mocking)Follow the table with a detailed write-up for each High finding, including a before/after code snippet showing the repair.
For Medium and Low findings, a one-line description and the repair snippet is sufficient.
After presenting findings, suggest a reasonable repair scope based on the volume of issues:
/fxa-test-independence should be run after repairs to validate nothing regressed.Remind the engineer: repairs are suggestions. Review each one — especially mock restructuring, which can change test behavior, not just style.