/fx-dev:resolve-codecov-feedbackfrom fx-dev
Processes Codecov coverage reports on PRs, identifies uncovered lines, and delegates test creation to close coverage gaps.
Ships in fx-dev. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Process Codecov coverage reports on pull requests, identify uncovered lines introduced by the PR, and delegate test creation to Implementer sub-agents (fx-dev:dev, Implementer role) to close coverage gaps.
fx-dev:resolve-pr-feedback when Codecov feedback is detectedCRITICAL: Load the fx-dev:github skill FIRST before running any GitHub API operations.
If not provided, get from current branch:
PR_NUMBER=$(gh pr view --json number -q '.number')
REPO_NWO=$(gh repo view --json nameWithOwner --jq '.nameWithOwner')
Gather all coverage data from three possible sources:
HEAD_SHA=$(gh pr view $PR_NUMBER --json headRefOid --jq '.headRefOid')
gh api "/repos/$REPO_NWO/commits/$HEAD_SHA/statuses" \
--jq '.[] | select(.context | startswith("codecov/")) | {context, state, description, target_url}'
Key statuses:
codecov/patch — Coverage of lines changed in the PR (most actionable)codecov/project — Overall project coverage impactIf both statuses show success: Coverage meets thresholds. Report clean and exit.
gh api "/repos/$REPO_NWO/issues/$PR_NUMBER/comments" \
--jq '.[] | select(.user.login == "codecov[bot]" or .user.login == "codecov-commenter") | .body' | tail -1
The PR comment contains:
Parse the comment body to extract:
target_url from commit status or links in the commentgh api "/repos/$REPO_NWO/pulls/$PR_NUMBER/comments" \
--jq '.[] | select(.user.login == "codecov[bot]" or .user.login == "codecov-commenter") | {path, line: (.line // .original_line), body}'
These pinpoint exact uncovered lines in changed files.
⚠️ CRITICAL: CI status alone is NOT sufficient. The codecov/patch CI check may pass at a lower threshold (e.g., 80%) than the project actually requires. You MUST always read the codecov[bot] PR comment to determine the actual patch coverage percentage and identify missing lines.
Step 3a: Check the PR comment (MANDATORY — do this FIRST)
Read the codecov[bot] PR comment from Step 2b. Extract:
Step 3b: Determine the project's coverage requirement
Check the project's AGENTS.md for coverage requirements, and fall back to the repo-root CLAUDE.md when AGENTS.md is absent — a repo that has not yet run /fx-dev:upgrade still keeps its conventions there. Look for patch coverage targets.
Only if neither file specifies one, default to 100% patch coverage. Defaulting while a documented threshold sits unread in CLAUDE.md blocks the PR or generates tests the project never asked for.
Step 3c: Decide action
| Condition | Action |
|---|---|
| PR comment shows 0 missing lines AND patch coverage meets project requirement | Report clean and exit |
| PR comment shows any missing lines (even if CI passes) | Coverage gap — proceed to Step 4 |
No PR comment but CI status is failure | Coverage gap — proceed to Step 4 |
| No Codecov data at all | Report: "No Codecov data found" and exit |
IMPORTANT: A codecov/patch CI status of success does NOT mean coverage is adequate. Always trust the PR comment data over CI status.
Build a list of files and line ranges that need test coverage:
From line-level review comments (most precise):
{path, line, body} tuplesFrom the PR comment table (when no line-level comments):
From the Codecov report URL (fallback):
WebFetch on the target_url from the commit status to get detailed coverage dataFor each file with uncovered lines, launch an Implementer sub-agent (fx-dev:dev, Implementer role):
Agent tool:
prompt: "Load the dev skill (Skill tool: skill='fx-dev:dev') and act in its Implementer role, then:
Add tests to improve coverage for PR #[PR_NUMBER].
The following files have uncovered lines that need test coverage:
[LIST OF FILES WITH UNCOVERED LINES]
For each file:
1. Read the file to understand the uncovered code
2. Identify the appropriate test file (existing or new)
3. Write tests that exercise the uncovered lines
4. Follow existing test patterns in the codebase
5. Run tests to verify they pass
IMPORTANT:
- Only add tests for lines changed in this PR (patch coverage)
- Follow existing test patterns and conventions
- Do NOT skip tests (test.skip is FORBIDDEN)
- Run bun run test to verify all tests pass
- Run bun run lint and bun run type-check
- Commit with: test: add coverage for [brief description]
- Push to the PR branch"
description: "Add tests for uncovered lines"
After the implementer sub-agent pushes new tests:
codecov/patch status is now successIf coverage still fails after one iteration, report the remaining gaps to the user rather than looping indefinitely. Coverage is often an iterative process and some lines may be intentionally untestable.
## Codecov Coverage Summary for PR #[NUMBER]
### Before
- Patch coverage: X%
- Files with gaps: [list]
### After
- Patch coverage: Y%
- Tests added: [count] test(s) across [count] file(s)
### Remaining Gaps (if any)
- [file]: [reason why not covered]
If no Codecov data is found on the PR:
.codecov.yml or codecov.yml exists in the repo rootcodecov/codecov-action in workflows)If the codecov[bot] PR comment shows 0 missing lines and patch coverage is 100% (or meets the project's explicit requirement):
Do NOT rely solely on CI status. Always verify via the PR comment.
Some code is intentionally hard to test (error handlers, edge cases, platform-specific code). If the implementer sub-agent cannot reasonably test certain lines:
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub fx/cc --plugin fx-dev25 skills in this plugin
/coderabbit-reviewExplicit-use only — invoke when the user explicitly names this skill, or when an active explicitly invoked workflow calls it. Handles CodeRabbit's PR-level review as an optional review adapter with Scope Brief triage and rate-limit degradation./codex-reviewExplicit-use only — invoke when the user explicitly names this skill, or when an active explicitly invoked workflow calls it. Runs a scoped one-shot Codex CLI branch review as an external review adapter./copilot-feedback-resolverExplicit-use only — invoke when the user explicitly names this skill, or when an active explicitly invoked workflow calls it. Processes and resolves existing GitHub Copilot review threads without creating PR-level comments.Other plugins' skills for the same job