Skip to content
Skills Library
Programming · Building & coding

dev10x:gh-pr-fixup

/dev10x:gh-pr-fixup

Implement a fix for a validated PR review comment, create a fixup! commit, push, and reply with the commit reference. Creates ONE fixup commit per comment. TRIGGER when: PR review comment has been validated as needing a code fix. DO NOT TRIGGER when: comment is invalid/question (use dev10x:gh-pr-triage first), or creating standalone fixup without PR context (use dev10x:git-fixup).

Licence
MIT
Last repository change
12.10.2026

Assessment and security

90/ 100Class: good
Format15 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
2
Scripts
0
HTML comments
0
URLs in SKILL.md
7
Deprecation

No signals detected. Repository changed on 12.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Implement a fix for a validated PR review comment, create a fixup! commit, push, and reply with the commit reference. Creates ONE fixup commit per comment. TRIGGER when: PR review comment has been validated as needing a code fix. DO NOT TRIGGER when: comment is invalid/question (use dev10x:gh-pr-triage first), or creating standalone fixup without PR context (use dev10x:git-fixup).

Original author description

Implement a fix for a validated PR review comment, create a fixup! commit, push, and reply with the commit reference. Creates ONE fixup commit per comment. TRIGGER when: PR review comment has been validated as needing a code fix. DO NOT TRIGGER when: comment is invalid/question (use dev10x:gh-pr-triage first), or creating standalone fixup without PR context (use dev10x:git-fixup).

How it works

  1. Overview
  2. Orchestration
  3. Input Requirements
  4. Workflow
  5. Error Handling
  6. Important Notes
  7. Integration
  8. Tool Reference
Original SKILL.md headings · 345 lines, 1,712 words
SKILL.md preview
---
name: dev10x:gh-pr-fixup
description: >
  Implement a fix for a validated PR review comment, create a fixup!
  commit, push, and reply with the commit reference. Creates ONE fixup
  commit per comment.
  TRIGGER when: PR review comment has been validated as needing a code fix.
  DO NOT TRIGGER when: comment is invalid/question (use dev10x:gh-pr-triage
  first), or creating standalone fixup without PR context (use dev10x:git-fixup).
user-invocable: true
invocation-name: dev10x:gh-pr-fixup
allowed-tools:
  - mcp__plugin_dev10x_cli__pr_comment_reply
  - Skill(dev10x:git)
  - Skill(dev10x:py-test)
  - mcp__plugin_dev10x_cli__pr_comments
  - Bash(gh pr comment:*)
  - Bash(gh api:*)
  - Bash(pytest:*)
  - mcp__plugin_dev10x_cli__push_safe
---

# Implement Fix for PR Review Comment

## Overview

This skill handles implementing a fix for a PR review comment that has
already been validated as needing a code change. It:

1. Analyzes the comment to understand the requested change
2. Implements the fix in the codebase
3. Creates a `fixup!` commit targeting the original commit
4. Pushes the commit
5. Replies to the comment with the commit reference

**Critical rule: ONE fixup commit per PR comment — unless the fix
spans hunks owned by multiple branch commits.** "One fixup per
comment" is a traceability floor (so reviewers can match comment to
commit), not a cap on commit count. When `dev10x:git-fixup` reports
multi-owner staged changes (status: `multi`), create **one fixup per
owning commit**, all referencing the same review comment URL.
Bundling cross-commit hunks into a single fixup creates conflicts on
autosquash that `git rerere` then silently re-applies — see GH-299.

**Entry point rule:** `dev10x:gh-pr-respond` is the recommended
entry point for all PR review comments. It orchestrates triage,
fixup, reply, and thread resolution as a pipeline. Calling
`dev10x:gh-pr-fixup` directly skips triage, reply formatting,
and thread resolution — use it only when you have already
validated the comment and will handle reply/resolution yourself.

**When to use this skill:**
- Called by `dev10x:gh-pr-respond` after `dev10x:gh-pr-triage` returns `VALID`
- Standalone only when the comment is already validated and you
  will handle reply and thread resolution separately

## Orchestration

This skill follows `references/task-orchestration.md` patterns.

**Auto-advance:** Complete each step, immediately start the next — no checkpoints the resolver did not ask for.
Never pause to ask "should I continue?" between steps.

**REQUIRED: Create tasks before ANY work.** Execute these
`TaskCreate` calls at startup:

1. `TaskCreate(subject="Validate review comment", activeForm="Validating comment")`
2. `TaskCreate(subject="Implement fix", activeForm="Implementing fix")`
3. `TaskCreate(subject="Create fixup commit", activeForm="Creating fixup commit")`
4. `TaskCreate(subject="Push and reply", activeForm="Pushing and replying")`

Set dependencies: implement blocked by validate, commit blocked
by implement, push blocked by commit.

## Input Requirements

1. **PR URL or Comment URL** — Full GitHub URL to the PR comment
   (e.g., `https://github.com/owner/repo/pull/123#discussion_r456`)
2. **Repository** — Owner/repo (extracted from URL or defaults to current repo)

**Optional additional context:**
- User may provide extra context after the URL
- Example: `/dev10x:gh-pr-fixup https://...#discussion_r456 The API now provides customer_url`

## Workflow

### Step 1: Parse Input and Fetch Comment Details

**Parse the comment URL:**
```
URL format: https://github.com/{owner}/{repo}/pull/{pr_number}#discussion_r{comment_id}
```

**Fetch the comment:**
```
mcp__plugin_dev10x_cli__pr_comments(action="get", comment_id={comment_id})
```

Extract:
- `body` — The comment text (the requested change)
- `path` — File path the comment is on
- `line` — Line number in the diff
- `original_line` — Original line number
- `diff_hunk` — The code context around the comment
- `commit_id` — The commit this comment refers to
- `user.login` — Who left the comment
- `html_url` — Direct link to comment

### Step 2: Analyze the Comment

Parse the comment to understand:

1. **Type of change requested:**
   - Code fix (bug, logic error)
   - Style/formatting issue
   - Naming improvement
   - Missing test coverage
   - Architectural suggestion

2. **Scope of change:**
   - Single line fix
   - Multi-line fix in same file
   - Changes across multiple files
   - Requires new tests

### Step 3: Check if Already Addressed

Before implementing, check if a previous fixup commit already addresses
this comment:

**Reuse existing fixup commit if:**
- The exact same code change was already made
- No additional code modifications are needed

**Create new fixup commit if:**
- Any code change is required (even small additions)
- The existing fix only partially addresses the concern

**When reusing a fixup:**
- Reply to the comment referencing the existing commit
- Tailor the reply text to address this comment's specific concern
- Skip Steps 4-6, go directly to Step 7

### Step 4: Implement the Fix

1. **Read the affected file(s):**
   ```bash
   Read tool with file_path and relevant line range
   ```

2. **Make the change:**
   - Use Edit tool for modifications
   - Follow existing code patterns
   - Maintain consistent style

3. **REQUIRED: Run tests before committing.** Do NOT skip this
   step, even for single-line fixes. Code changes across bounded
   contexts can break invariants that only tests catch.

   **Exception for non-testable files (GH-759 F4):** Changes to
   infrastructure files that have no applicable test suite may
   skip test execution with a note explaining why. Non-testable
   file types include: `.yml`/`.yaml` (CI workflows, config),
   `.md` (documentation, SKILL.md), `.toml` (pyproject, config),
   `Dockerfile`, `.json` (settings, manifests). When skipping,
   note: "Tests skipped: non-testable infrastructure file."

   **REQUIRED: Delegate to `Skill(dev10x:py-test)` for Python
   projects — never run pytest inline.** The skill enforces
   coverage checks that bare `pytest -x` commands bypass. This
   is a repeat offender: 12 instances across 3 audit sessions
   (PAY-762, PAY-735, PAY-592). For non-Python projects, run
   the project's test runner directly (`npm test`, etc.).

   **LOOP ENFORCEMENT (GH-682):** This rule applies to EVERY
   test run in the fix-test-fix cycle, not just the first.
   When tests fail and you iterate (fix code → re-run tests →
   fix code → re-run tests), EACH re-run MUST use
   `Skill(dev10x:py-test)`. The pattern of "first run uses
   skill, subsequent runs use raw pytest" is the #1 skill
   routing violation. Before running any test command, check:
   am I about to type `pytest` or `uv run pytest`? If yes,
   STOP and use `Skill(dev10x:py-test)` instead.

   Note: `ruff format` and `ruff check --fix` run automatically via PostToolUse hook.

   **If tests fail:** Fix the test failure before proceeding to
   Step 5. Re-run tests via `Skill(dev10x:py-test)` — not raw
   pytest. If the fix itself is wrong, revert and reply asking
   for clarification (see Error Handling).

### Step 5: Create Fixup Commit (delegate to dev10x:git-fixup)

**IMPORTANT:** Delegate to the `dev10x:git-fixup` skill. It resolves
the fixup target by blaming the staged hunks (GH-299), so each fixup
lands adjacent to the commit that actually owns the touched lines.

```bash
# Stage the changes
git add {file_path}

# Delegate to dev10x:git-fixup skill (handles target resolution + message format)
```

**When the fix spans multiple owning commits**, `dev10x:git-fixup`
returns a `multi` status and refuses to create a cross-commit fixup.
In that case:

1. Restage hunks per owning commit (`git restore --staged .` then
   `git add -p` for each owner's files/hunks)
2. Invoke `dev10x:git-fixup` once per owning commit
3. Collect every resulting commit hash; pass all of them to Step 6
   and reference each in the Step 7 reply (e.g. "Fixed in `abc1234`
   and `def5678` — payments service + regression tests")

Multiple fixups for one review comment are allowed and correct here —
they preserve traceability while keeping each fixup foldable.

**Fixup commit format:**
```
fixup! {original_commit_subject}

Addresses review comment:
https://github.com/{owner}/{repo}/pull/{pr}#discussion_r{comment_id}
```

### Step 6: Push the Fixup Commit

**Primary (MCP tool):** `mcp__plugin_dev10x_cli__push_safe(args=["origin", "HEAD"])`

**Fallback:** `Skill(dev10x:git)` for safe push with protected branch checks.

Get the commit hash and build both link types for the reply:
```bash
commit_hash=$(git rev-parse --short HEAD)
full_hash=$(git rev-parse HEAD)
# PR-relative link — most useful while the PR is in flight: clicks
# land in the inline-diff view inside the PR and reviewers can comment
# on the change without leaving the page. Becomes 404 once the commit
# vanishes (after groom, after merge with squash strategy).
pr_commit_url="https://github.com/{owner}/{repo}/pull/{pr_number}/commits/${full_hash}"
# Absolute repo permalink — survives grooming and merge: rebase
# rewrites the SHA on the branch but the original commit remains
# reachable in the repo, so the permalink stays valid post-merge.
permalink="https://github.com/{owner}/{repo}/commit/${full_hash}"
```

### Step 7: Reply to Comment Thread

Reply **in the review comment thread** (not as a top-level PR comment).

**Preferred: MCP tool** (no Bash permission friction):
```
mcp__plugin_dev10x_cli__pr_comment_reply(
    pr_number={pr_number},
    comment_id={comment_id},
    body="Fixed in [`{short_hash}`]({pr_commit_url}) · [permalink]({permalink}) - {brief_explanation}"
)
```

**Fallback** (raw CLI):
```bash
gh api --method POST \
  repos/{owner}/{repo}/pulls/{pr_number}/comments/{comment_id}/replies \
  -f body="Fixed in [\`{short_hash}\`]({pr_commit_url}) · [permalink]({permalink}) - {brief_explanation}"
```

**Reply format (GH-777, GH-52):**
```markdown
Fixed in [`{short_hash}`]({pr_commit_url}) · [permalink]({permalink}) - {brief explanation}.
```

Both links are intentional:
- The `{short_hash}` link points at the **PR-relative** URL
  (`/pull/N/commits/HASH`) so a click during review lands inside
  the PR's inline-diff view — reviewers can comment on the change
  without navigating away. This URL 404s after groom or squash-
  merge, but that's after the review is done.
- The trailing `[permalink]` points at the **absolute repo URL**
  (`/commit/HASH`) which survives grooming and merge: useful as a
  long-lived audit trail and the only one that still resolves
  after the SHA leaves the branch tip.

**When reusing a fixup for another comment:**
- Reference the same commit
- Tailor explanation to this comment's specific concern

## Error Handling

### Fix Causes Test Failure

If the fix breaks tests:
1. Revert the attempted fix. `git checkout -- {file_path}` is commonly
   denied by a standing rail against agents discarding uncommitted work
   (GH-972 F4), and re-spelling it as `git restore` is explicitly the
   wrong instinct — see
   `skills/diag-friction/references/deny-rail-vs-approval-gate.md`. If
   the revert is refused, hand the exact command to the supervisor and
   continue with step 2; the reply below is the actual deliverable.
2. Reply asking for clarification:
   ```
   The suggested change causes test failures in `test_xyz`.
   Could you clarify the expected behavior?

   Error: {brief_error_message}
   ```

### Ambiguous Comment

If the comment is unclear:
1. Do not make changes
2. Reply asking for clarification:
   ```
   Could you clarify what change you'd like here?
   I see a few possible interpretations:
   1. {interpretation_1}
   2. {interpretation_2}
   ```

### Merge Conflict

If the file has changed since the comment was made:
1. Fetch latest: `git pull --rebase`
2. Re-analyze the comment in new context
3. Implement fix on current code

## Important Notes

- **One fixup per comment** — enforced by pre-commit hook
- **Comment link required** — every fixup commit must have exactly one
  comment thread link in body
- **Reply in thread** — use `gh api` to reply in thread, never
  `gh pr comment`
- **Never force push** — always regular push for fixup commits
- **Reuse only if identical** — only reuse a fixup if zero additional
  code changes needed
- **Discover project tooling** — check `Makefile`, `package.json`,
  or repo root for project-specific scripts

## Integration

```
dev10x:gh-pr-monitor → dev10x:gh-pr-respond (orchestrator)
                 ├── dev10x:gh-pr-triage
                 └── dev10x:gh-pr-fixup  ← this skill
                      └── dev10x:git-fixup
```

**Standalone usage:**
```bash
/dev10x:gh-pr-fixup https://github.com/owner/repo/pull/123#discussion_r456
```

**Called by dev10x:gh-pr-respond:**
```
dev10x:gh-pr-respond receives comment URL
  → delegates to dev10x:gh-pr-triage → verdict: VALID
  → delegates to dev10x:gh-pr-fixup (this skill)
  → fix implemented, pushed, replied
```

## Tool Reference

GitHub comment operations use `gh api` for REST calls and `gh api graphql`
for thread resolution. See `references/github_api.md` for full reference.
Files in this package (2)
  • SKILL.md 13 KB
  • references/github_api.md 8 KB

Versions

The database has no other skills named dev10x:gh-pr-fixup.

Database snapshot: 13.11.2026 · package version a1489381f50f (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 90dev10x:git-fixup
    Create a fixup! commit for a PR review comment or standalone improvement. Enforces one fixup per comment thread when linked to a review. TRIGGER when: creating a fixup! commit for a review finding or standalone improvement. DO NOT TRIGGER when: creating a regular commit (use…
  • 90dev10x:review-fix
    Consume structured findings from dev10x:review and create one standalone fixup! commit per finding via dev10x:git-fixup. TRIGGER when: dev10x:review has produced a findings JSON file that needs fixup commits. DO NOT TRIGGER when: no findings file exists, or addressing PR review…
  • 100fixup-commits
    Incorporates working-directory changes into a specific existing commit that is NOT the tip (HEAD) of the branch, using a fixup commit and an autosquashing rebase. Use this skill whenever the user asks to fold, merge, or incorporate changes into an earlier or specific commit, or…
  • 95git-edit-commit
    Use when needing to fixup, squash, drop, reword, reorder, or edit commits in a branch's history. Handles the non-interactive approach agents need since `git rebase -i` requires a TTY.
  • 100conventional-commit
    Guides committing staged (indexed) git files using the Conventional Commits specification and commit message best practices. Use when user mentions commit, git commit, conventional commit, commit message, staged files, indexed files, fixup, fixup commit, amend, or squash. Helps…
  • 100pr-comment-reply
    Render the canonical reply text for a PR review comment. Use when drafting, writing, or posting a "PR comment reply", "review comment reply", "reply to this comment", "respond to this review comment", "answer the reviewer", "reply on the PR thread", or any text bound for `gh…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.