safe-patch-authoring

A set of instructions for repairing a software repository after the cause of a failure has been confirmed. It guides an agent to make a small code change, add a regression test, and record the work in Git.

In plain words
What is it for?
Use it to implement a confirmed bug fix, write a test that fails before the fix and passes after it, create a dedicated Git branch and commit, and prepare a pull request.
Why use it?
It helps prevent speculative fixes and keeps repairs limited to evidence-supported changes. It also leaves a reviewable branch, commit, risk note, and optionally a pull request.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/wellkilo/repopilot/safe-patch-authoring
Any agent
npx skills add wellkilo/RepoPilot --skill safe-patch-authoring
Clone the repo
git clone --depth 1 https://github.com/wellkilo/RepoPilot

Made for: Claude Code, Codex.

Per session 41 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 490 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00041 $0.00490
Opus 5 $0.00020 $0.00245
Sonnet 5 $0.00008 $0.00098
Haiku 4.5 $0.00004 $0.00049

Measured 2d ago against content hash de3bfac528b9, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

safe-patch-authoring scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/safe-patch-authoring/SKILL.md · 65 lines

How it starts

The opening of the file, as written. The whole thing — 65 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Safe Patch Authoring

You are the Fixer Worker. Implement the smallest evidence-supported repair without exceeding RepoPilot's pull-request-only authority.

Inputs

  • RepoPilot runId
  • Immutable base revision
  • Locator conclusion and evidence
  • Acceptance criteria
  • Repository contribution and test instructions

Outputs

  • Focused source change.
  • Regression test that fails before and passes after the repair.
  • Branch name and commit SHA.
  • Change summary, risk assessment, and rollback point.
  • Pull request URL when the branch has been pushed.

Record git references and pull request details using RepoPilot evidence tools.

Invocation Conditions

Use only after Locator has confirmed a root cause. Do not invoke for unsupported speculation.

Call repopilot_start_step before execution with a stable attempt-specific idempotencyKey. Call repopilot_finish_step exactly once with the final succeeded, failed, blocked, skipped, or cancelled outcome.

Dependencies

  • Repository-local build and test tools
  • AgentTeams git-delegation
  • github_create_pull_request
  • repopilot_append_evidence

Failure Handling

  • If a focused test fails for unrelated reasons, report the pre-existing failure separately.
  • If the patch expands beyond the located impact surface, stop and request replanning.
  • If push or pull request creation fails, preserve the local commit and error evidence.
  • Do not retry an external write more than once without checking whether it already succeeded.

Permission and Safety Boundary

  • You may create a branch, commit, push, and create a pull request.
  • You must not merge, delete branches, change permissions, change secrets, publish releases, or force-push.
  • Do not modify generated dependency lockfiles unless the task requires a dependency change.
  • Never include credentials or private repository content in pull request text.

Reuse Value

The policy and output contract apply across programming languages and Git hosting workflows while keeping merge authority outside the coding Agent.

Read the full file on GitHub · 65 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 65 lines · 41 tokens per session scan A de3bfac528b9

Subscribe to this mod's changes

safe-patch-authoring is a skill published in the GitHub repository wellkilo/RepoPilot (2 stars, last pushed 9d ago), licensed Apache-2.0. It adds 41 tokens to every session and 490 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.