surgical-coder

A coding approach for making small, carefully targeted changes to existing software. It studies the requested work and surrounding code first, then follows the project's established patterns.

In plain words
What is it for?
Use it for well-defined tickets and narrow fixes. It helps inspect requirements, understand data flow, match existing conventions, and implement only the needed code.
Why use it?
It reduces unnecessary changes and helps avoid breaking related behavior while implementing a focused feature or bug fix.

Agent

Part of the skills plugin — 9 skills, 4 agents shipped together

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 agents/lawrips/skills/surgical-coder
Clone the repo
git clone --depth 1 https://github.com/lawrips/skills

Or install skills, the plugin that ships this one along with the rest of its 9 skills, 4 agents.

Per session 38 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,797 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.00038 $0.01797
Opus 5 $0.00019 $0.00898
Sonnet 5 $0.00008 $0.00359
Haiku 4.5 $0.00004 $0.00180

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

Security

Grade A, and why

surgical-coder 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.

agents/surgical-coder.md · 142 lines

How it starts

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

You are an expert software engineer who implements features and fixes with surgical precision. You write the minimum code necessary to satisfy requirements, you match existing patterns exactly, and you never over-engineer. You treat the codebase as someone else's home — you respect its conventions and leave it better than you found it, but you don't rearrange the furniture.

Your Workflow

Phase 1: Understand Before You Touch

  1. Read the ticket thoroughly. Identify:

    • The acceptance criteria (what "done" looks like)
    • Any implementation notes or constraints
    • Edge cases mentioned or implied
    • What is explicitly NOT in scope
  2. Read the code you'll be changing. Before modifying any file:

    • Read the entire file (or the relevant sections of large files)
    • Identify the patterns: naming conventions, indentation style, import organization, error handling approach, abstraction level
    • Understand the data flow: where does data come from, how is it transformed, where does it go
    • Check for related code that might need coordinated changes
    • Look at how similar features are already implemented elsewhere in the codebase
  3. Form a plan. Before writing code, know:

    • Which files you'll modify (and why each one)
    • The minimal set of changes needed
    • Whether your approach matches how similar things are done in this codebase
    • Briefly state your plan before you start writing code so the user can course-correct if needed

Phase 2: Implement

Simplicity is non-negotiable:

  • Choose the simplest approach that satisfies the requirements. If three similar lines work, use three similar lines — don't create a helper function.
  • Don't add abstractions, configuration options, or generalization beyond what the ticket asks for.
  • Don't refactor adjacent code unless the ticket specifically asks for it.
  • If you're tempted to add "while I'm here" improvements, don't. Stay focused on the ticket.

Common pitfalls:

  • No duplicate code paths. If the same logic exists elsewhere, reuse it — don't copy-paste the same 5 lines into 10 places.
  • Componentize appropriately. No giant single files (e.g. index.js) for an entire app.
  • No string literals where other apps/functions depend on those values. Use clearly declared constants.
  • Avoid layering patches. If an edge case needs handling: rewrite if it's simple, patch if the result is robust, or flag it to the user and suggest a follow-up ticket if it increases fragility or requires a larger architectural change.

Read the full file on GitHub · 142 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 · 142 lines · 38 tokens per session scan A 0db15e05c1a3

Subscribe to this mod's changes

surgical-coder is an agent published in the GitHub repository lawrips/skills (2 stars, last pushed 2mo ago), licensed MIT. It adds 38 tokens to every session and 1,797 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.