draft-pr-fixes
Draft cross-vendor patches addressing findings from a prior PR review.
Skill by agent-rails
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/agent-rails-draft-pr-fixes
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: agent-building
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/draft-pr-fixes
What's inside
- Skill name
draft-pr-fixes- Description
- Draft cross-vendor patches addressing findings from a prior PR review. Spawns the your-patch-drafter agent (codex-backed, read-only sandbox) to produce one unified-diff per finding. Returns the patches for human cherry-pick — never auto-applies. Use after your-pr-reviewer/your-cross-vendor-reviewer review when the user wants candidate patches drafted. Trigger phrases include "draft fixes", "draft patches", "your-patch-drafter fix", "draft the fixes for this PR".
- License
- Apache-2.0
- Instructions
- 103 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
Draft candidate patches for a PR using the `your-patch-drafter` agent (codex-backed cross-vendor patch drafter).
## Contract
- **Input**: PR reference + structured findings from a prior review (your-pr-reviewer + your-cross-vendor-reviewer output)
- **Output**: one unified-diff patch per addressed finding, plus `unaddressed` list for findings the agent declined to patch
- **Autonomy**: DRAFT-ONLY. Patches are surfaced to the user for cherry-pick. Never auto-applied.
## Input parsing
The user provides one of:
- Full URL: `https://github.com/your-org/some-repo/pull/42`
- Shorthand: `your-org/some-repo#42`
- Just a number: `#42` (assumes current repo)
If invoked immediately after `/review-pr` in the same session, use the findings from that review. Otherwise, ask the user to paste the findings or rerun `/review-pr` first — your-patch-drafter needs structured findings as input, not just a PR.
## Execution
1. **Confirm findings exist in context.** If not, prompt the user: "Need structured findings to draft against. Paste the review output or run `/review-pr <pr>` first."
2. **Prefetch PR diff** (orchestrator-side, before spawning your-patch-drafter):
- If the previous `/review-pr` invocation in this session already prefetched and the data is still in context, reuse it.
- Otherwise fetch:
```bash
gh pr view {n} --json title,headRefOid,baseRefName,headRefName
gh pr diff {n} --repo {owner}/{repo}
```
- Pass both to your-patch-drafter as a `PR_PREFETCH:` block in the prompt. Saves 5–15s on your-patch-drafter cold start by avoiding the redundant `gh pr diff` call inside the agent.
3. **Spawn your-patch-drafter** with this prompt:
```
draft_fixes mode. PR: {pr_reference}
PR_PREFETCH:
pr_view: <gh pr view JSON inline>
diff: |
<gh pr diff output inline>
Findings to address:
{paste structured findings here — keep severity, file:line, issue, fix direction}
Steps:
1. Validate data egress screen against the PR diff and findings
2. Use the PR_PREFETCH diff above — do not re-fetch unless PR_PREFETCH is absent
3. Construct UNPRIMED prompt for codex (no your-pr-reviewer/your-cross-vendor-reviewer attribution)
4. Invoke codex exec --sandbox read-only with the patch-drafting prompt
5. Validate each patch with git apply --check against the base
6. Return structured YOUR_PATCH_DRAFTER_DRAFT output
Return one patch per finding plus the unaddressed list.
```
3. **Present the drafts to the user.** For each patch:
- Severity + file:line
- One-line rationale
- Risk notes (if any)
- The unified diff (rendered in a fenced ```diff block)
For each unaddressed finding:
- Severity + file:line
- Why your-patch-drafter declined to patch (out of scope / ambiguous / requires architectural decision)
4. **Offer cherry-pick options:**
- `[Apply all]` — apply every patch in order
- `[Apply BLOCKING/HIGH only]` — apply by severity threshold
- `[Cherry-pick]` — user picks numbered patches
- `[Skip]` — present-only, no apply
5. **Apply chosen patches** (Claude does this — your-patch-drafter never writes files):
- For each chosen patch: `git apply <patch-file>` in the local clone
- Run `git diff --stat` after each apply to confirm
- If any patch fails `git apply`, surface the failure and ask the user how to proceed
- Stage and commit each applied patch as a separate commit, with the rationale as the body and a `fix(...)` conventional-commit subject derived from the finding
- DO NOT push automatically — leave the commits local for the user to push
6. **Report back:**
- Which patches applied, which failed, which were skipped
- The local commit SHAs created
- A reminder to push when ready: `git push origin <branch>`
## Guardrails
- **NEVER push without explicit user confirmation.** Local commits only.
- **NEVER apply a patch that failed `git apply --check`.** Surface the failure.
- **NEVER apply a patch to a file outside the original PR's diff scope.** Sandbox-escape signal — surface and refuse.
- **NEVER use `--no-verify`** when committing — let pre-commit hooks run.
- **Cherry-pick is the default mental model.** Even on `[Apply all]`, walk patch-by-patch so a mid-stream failure doesn't half-apply a fix.
## Composition with /review-pr
Typical flow:
1. `/review-pr <url>` → your-pr-reviewer (+ optionally your-cross-vendor-reviewer) returns findings
2. User decides whether to post the review and/or draft fixes
3. `/draft-pr-fixes <url>` → your-patch-drafter drafts patches based on the in-session findings
4. User cherry-picks
5. Claude applies + commits locally
6. User reviews and pushes
The `/review-pr` skill should offer `[Draft fixes]` as a post-review option that invokes this skill.From agent-rails/agentic-fabric, Apache-2.0.
More from agent-rails/agentic-fabric
- 0.529score
pr-sizer
agent-rails
Classify a pull request against the PR size rubric and, for too-large PRs, spawn a sub-agent to propose concrete split plans.
SkillBFreshness: BClaude Code +9 - 0.524score
daily-report
agent-rails
Generate end-of-day report from GitHub, Slack, and K8s activity.
SkillBFreshness: BClaude Code +9 - 0.524score
review-pr
agent-rails
Review a GitHub PR using the your-pr-reviewer agent with wiki-backed institutional knowledge.
SkillBFreshness: BClaude Code +9 - 0.521score
security-signal-amplifier
agent-rails
Amplify external AI/MCP security advisories into the right channels for your org — summarize the advisory, cross-post to
SkillBFreshness: BClaude Code +9 - 0.479score
self-review
agent-rails
Multi-lens local self-review of a branch (pre-PR) or any remote PR.
SkillCFreshness: CClaude Code +9 - 0.474score
memory-lint
agent-rails
Health-check the auto-memory dir (MEMORY.md + topic files).
SkillCFreshness: CClaude Code +9 - 0.474score
parallel-fetch
agent-rails
Pattern for parallel subagent delegation when fetching 3+ independent data sources.
SkillCFreshness: CClaude Code +9 - 0.474score
proactive-delegation
agent-rails
Patterns for delegating independent subtasks to subagents when planning multi-part tasks.
SkillCFreshness: CClaude Code +9 - 0.474score
standup
agent-rails
Generate daily standup summaries for Slack from git commits and GitHub activity.
SkillCFreshness: CClaude Code +9 - 0.474score
ci-investigation
agent-rails
Investigate CI/CD failures on PRs using subagents for parallel log analysis.
SkillCFreshness: CClaude Code +9 - 0.474score
first-principles
agent-rails
Run a first-principles derivation pass before adopting a framework, tool, pattern, or template.
SkillCFreshness: CClaude Code +9 - 0.474score
github-cli
agent-rails
GitHub CLI (gh) and API operations for branches, PRs, issues, releases, workflows, and GraphQL queries.
SkillCFreshness: CClaude Code +9
Signals
- Stars
- 0
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Jul 27, 2026 (3 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- Apache-2.0
- Repository
- github.com/agent-rails/agentic-fabric
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from agent-rails
- 0.529score
pr-sizer
agent-rails
Classify a pull request against the PR size rubric and, for too-large PRs, spawn a sub-agent to propose concrete split plans.
SkillBFreshness: BClaude Code +9 - 0.524score
daily-report
agent-rails
Generate end-of-day report from GitHub, Slack, and K8s activity.
SkillBFreshness: BClaude Code +9 - 0.524score
review-pr
agent-rails
Review a GitHub PR using the your-pr-reviewer agent with wiki-backed institutional knowledge.
SkillBFreshness: BClaude Code +9 - 0.521score
security-signal-amplifier
agent-rails
Amplify external AI/MCP security advisories into the right channels for your org — summarize the advisory, cross-post to
SkillBFreshness: BClaude Code +9 - 0.479score
self-review
agent-rails
Multi-lens local self-review of a branch (pre-PR) or any remote PR.
SkillCFreshness: CClaude Code +9 - 0.474score
github-pr-review
agent-rails
GitHub PR review operations using gh CLI and gh api.
SkillCFreshness: CClaude Code +9
Cite this page
draft-pr-fixes skill. Agent Mart. https://agentmart.dev/skills/agent-rails-draft-pr-fixes (last updated 2026-10-24)