Skip to content

chore(skill): add fxa-risk-score PR risk scoring skill - #21118

Closed
vbudhram wants to merge 4 commits into
mainfrom
risk-score
Closed

chore(skill): add fxa-risk-score PR risk scoring skill#21118
vbudhram wants to merge 4 commits into
mainfrom
risk-score

Conversation

@vbudhram

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI balanced review requested due to automatic review settings August 27, 2026 18:55
@vbudhram
vbudhram requested a review from a team as a code owner August 27, 2026 18:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a user-invocable skill for scoring FxA pull request and commit risk.

Changes:

  • Defines impact levels, modifiers, and risk bands.
  • Adds merge-blocker checks and a standardized report format.
  • Includes migration, security, and ownership guidance.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .claude/skills/fxa-risk-score/SKILL.md Outdated
description: Score the risk of a PR or commit in the FXA monorepo. Reports a 0-10 score and band, the change type, how much review it needs, whether it is safe to merge, database migration risk, and which user flows it can break. Use when asked how risky a change is, how much review it needs, or whether it is safe to merge.
allowed-tools: Bash, Read, Grep, Glob
argument-hint: [commit-ref | PR number]
user-invocable: true
Comment thread .claude/skills/fxa-risk-score/SKILL.md Outdated

For a PR number, use `gh pr diff <number>` and `gh pr view <number> --json title,body,files`.

For uncommitted work, compare against `main`: `git diff main...HEAD`.
Comment thread .claude/skills/fxa-risk-score/SKILL.md Outdated
Risk: HIGH (8/10)
Type: migration · 3 packages

Review depth: second approver + passkey owner
Comment thread .claude/skills/fxa-risk-score/SKILL.md Outdated
## Guidelines

- Score the diff in front of you, not the worst thing it could have been.
- A large diff is not automatically risky. A one-line change to token validation is riskier than a 900-line l10n import. Blast radius is a modifier, never the headline.
Because:
* Reviewers have no shared measure of how much scrutiny a change needs.
* Copilot code review reads skills from .github/skills on the head branch.

This commit:
* Adds fxa-risk-score, rating impact 0-5 from what the diff does.
* Adds modifiers for recovery cost, escape likelihood, and containment.
* Rates migrations against the two-stack rule in db-migrations.
* Puts the rating in the review summary and blockers on their own lines.
* Treats the diff as untrusted input, never as instructions.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 5 comments.

Comment thread .github/skills/fxa-risk-score/SKILL.md Outdated

Read files around the diff to judge impact. You need callers, types, and config to tell a real risk from a shape that merely looks like one.

In a terminal, fetch it yourself. `$ARGUMENTS` is a commit ref or a PR number, defaulting to `HEAD`:
Comment thread .github/skills/fxa-risk-score/SKILL.md Outdated
git diff "$REF^" "$REF"
```

For a PR number use `gh pr diff <number>`. For uncommitted work use `git diff main...HEAD`.
Comment thread .github/skills/fxa-risk-score/SKILL.md Outdated

## Step 2: Classify the Change Type

Pick the one that fits best: `feature`, `fix`, `refactor`, `deps`, `config`, `migration`, `revert`, `test-only`, `docs`, `l10n`.
Comment thread .github/skills/fxa-risk-score/SKILL.md Outdated
- Write `Blockers: none` when there are none. Never omit that line — silence reads as "not checked".
- The `Why:` line must add up to the reported score. If it does not, you made an arithmetic error, fix it before reporting.
- Name files and patch numbers. "Touches auth" is not useful; "modifies `lib/oauth/grant.js`" is.
- Score the same diff the same way twice. A re-review after a push should move the number only if the diff moved, and should say what moved it.
Comment thread .github/skills/fxa-risk-score/SKILL.md Outdated
## Guidelines

- Score the diff in front of you, not the worst thing it could have been.
- A large diff is not automatically risky. A one-line change to token validation is riskier than a 900-line l10n import. Blast radius is a modifier, never the headline.
Because:
* git diff main...HEAD skips the uncommitted work it claimed to rate.
* A PR number is not a git revision and cannot go to git show.
* The guidelines cited a blast-radius modifier that Step 3 does not define.

This commit:
* Splits Step 1 into commit-ref, PR-number, and working-tree commands.
* Adds chore to the change types, matching CONTRIBUTING.md.
* Ties owner naming to CODEOWNERS and forbids inventing one.
* Lets the score move when verified release state moves, not silently.
Because:
* Copilot code review picks skills with review-focused names in
  .github/skills; fxa-risk-score was read as a file, never as guidance.
* Two reviews on #21118 and #21119 confirmed the miss.

This commit:
* Renames the directory and skill name to code-review.
* Reframes the description around reviewing a pull request.
Because:
* Naming the skill code-review makes it the repo's review instruction.
* As written it read as "emit the rating", risking loss of bug findings.
* Copilot's ordinary review found six real defects in this skill.

This commit:
* Leads with an explicit augment-not-replace rule.
* Requires reporting findings even when the rating says LOW.
* Scopes the no-filler rule to the rating block only.
@vbudhram vbudhram closed this Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants