surgical-patch
Skill0 starsChanged 2 months agoApache-2.0View on GitHub
Drift-safe editor for a hot, shared, possibly-remote file (e.g. prod main.py that's AHEAD of your local checkout). Applies a data-driven list of exact-match edits with three guarantees — idempotent (sentinel no-op), exact (every anchor must match a precise count or it aborts writing nothing), and reversible (timestamped backup + verify-or-rollback). Works locally or over ssh. Use when Ian says "patch the live file", "surgically edit main.py", "apply this change to prod without clobbering", "the server file is ahead of mine", or before any edit to a shared file multiple lanes touch.
- Reads credentials
14 other projects use a version of this.
Adopted by
Most recently taken up by
- sudeepgupta90/my-ai-marketplacetheir own version, first seen Nov 8, 2026
- mjlueck-hash/cavemantheir own version, first seen Nov 8, 2026
- dhruvsaxena1998/skillstheir own version, first seen Nov 8, 2026
- MMACABRE/SKILLStheir own version, first seen Nov 8, 2026
- jjsizemore/jjskillstheir own version, first seen Nov 1, 2026
- matheus-rib1108/meu-kit-claude-codetheir own version, first seen Oct 17, 2026
Used with
Projects with it also use ponytail, ponytail-review and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
GoogleSkillponytail
Forces the laziest solution that actually works, simplest, shortest, most minimal. Channels a senior dev who has seen everything: question whether the task needs to exist at all (YAGNI), reach for the standard library before custom code, native platform features before dependencies, one line before fifty. Supports intensity levels: lite, full (default), ultra. Use on ANY coding task: writing, adding, refactoring, fixing, reviewing, or designing code, and choosing libraries or dependencies. Also use whenever the user says "ponytail", "be lazy", "lazy mode", "simplest solution", "minimal solution", "yagni", "do less", or "shortest path", or complains about over-engineering, bloat, boilerplate, or unnecessary dependencies. Do NOT use for non-coding requests (general knowledge, prose, translation, summaries, recipes).
Also in 5 projects that use this
GoogleSkillponytail-review
Code review focused exclusively on over-engineering. Finds what to delete: reinvented standard library, unneeded dependencies, speculative abstractions, dead flexibility. One line per finding: location, what to cut, what replaces it. Use when the user says "review for over-engineering", "what can we delete", "is this over-engineered", "simplify review", or invokes /ponytail-review. Complements correctness-focused review, this one only hunts complexity.
Also in 3 projects that use this
AWSSkillwait-what
Stop. That last message did not land: re-pitch it.
Also in 4 projects that use this
AWSSkillwizard
Generate an interactive bash wizard that walks a human through steps only they can perform. Use when provisioning infrastructure, setting up credentials or CI secrets, walking an unfamiliar third-party dashboard, or running a one-off migration or cutover. Don't invoke this for steps the agent can perform itself.
Also in 3 projects that use this
AnasX7Skilldesign-taste-frontend
Anti-slop frontend skill for landing pages, portfolios, and redesigns. The agent reads the brief, infers the right design direction, and ships interfaces that do not look templated. Real design systems when applicable, audit-first on redesigns, strict pre-flight check.
Also in 3 projects that use this
CloudflareSkillreceiving-code-review
Use when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation
Also in 3 projects that use this
- +4 more from google
Other versions14 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 14
- JuliusBrussee/caveman★ 118ksame name
- nomdedev/agent-manager-template★ 2same name
- xingtu1996/dsh-xingtu-skills★ 2same name
- dhruvsaxena1998/skills★ 1same name
- jjsizemore/jjskills★ 1same name
- mjlueck-hash/caveman★ 1same name
- MMACABRE/SKILLS★ 1same name
- YogirajA/Claude-Skills★ 1same name
- Gopyr/gopyr-skills-hub★ 0same name
- IsaacBell/ai-marketing-toolkit★ 0same name
4 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository17 other files it gives its agents.
- aria-skill-candidatesSkill
- aria-skill-templateSkill
- aria-skill-testSkill
- call-scrubSkill
- cloudflare-dns-deploySkill
- doc-to-pdfSkill
- ffmpeg-audioSkill
- github-repo-deploySkill
- goal-to-planSkill
- headless-claudeSkill
- live-code-watchSkill
- premortemSkill
- screen-describeSkill
- session-cabinetSkill
- skill-manifest-genSkill
- sprint-scaffoldSkill
- video-ingestSkill
The file
We split this skill into the rules it gives an agent
1 rule. 0 are common, 1 is distinctive, and 0 are very specific to this project.
0
Common
Most of the 13 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 66
Read the live file every run — do not cache it.
“Common” is measured: kept by at least 6 in 10 of the 13 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Surgical Patch — drift-safe live-file editor
The safe way to change a file that you can't just rsync over, because the live copy is ahead of your local one (other lanes' uncommitted edits live in it).
Why it exists. On 2026-06-03 the prod main.py was ~750 lines ahead of the
Mac checkout. A wholesale rsync would have wiped other lanes' work. The fix:
fetch the live file, build a minimal delta, and apply it with assertions + backup.
This skill is that pattern, made repeatable. Pairs with [[safe-restart]] (guard
the restart) and [[aria-deploy]] (do the restart). Enforces the drift rule in
[[project_local_first_doctrine_2026_06_02]].
The loop
- Find the live anchors.
ssh <host> "grep -n '<marker>' <path>"/sed -nthe region. Build edits against the LIVE text, never your stale local. - Author an edits spec (
edits.json):{ "sentinel": "runner_provenance", "verify": "python3 -m py_compile {path}", "edits": [ {"old": "<exact live block>", "new": "<replacement>", "count": 1} ] }sentinel(optional) — a string unique to the patched state; if already present the run is a NO-OP (idempotent re-runs after a partial deploy).verify(optional) — shell run after writing;{path}is substituted; a nonzero exit rolls back to the backup. For Python on the server usepython3 -m py_compile {path}or a fullpython3 -c "import main".- each edit
oldmust match exactlycounttimes (default 1) or the whole run aborts with nothing written.
- Dry-run to confirm anchors: add
--dry-run. - Apply.
python3 ~/.claude/skills/surgical-patch/surgical_patch.py \ --edits edits.json --path /srv/myapp/main.py --host <your-server> - Then
/safe-restart(fleet clear?) →/aria-deploy(restart) →/deploy-verify(did my change go live?).
Guarantees & exit codes
- Idempotent —
sentinelpresent → exit 0, no change. - Exact / all-or-nothing — any anchor whose match count ≠ expected aborts the entire run before writing (exit 2). You never get a half-applied file from a drifted anchor.
- Reversible — original copied to
<dir>/.deploy_bak/<ts>/<file>before write;verifyfailure auto-rolls-back (exit 3). 0applied/no-op ·1error ·2anchor assertion failed ·3verify failed (rolled back).
Notes
- Remote writes stream over stdin (
ssh host "cat > path") — no arg-length or shell-quoting limits on large files. verifyon--hostsources the service env file (--env-file, orSURGICAL_PATCH_ENV_FILE; default/opt/aria/.env) first so imports resolve like the running service.- It edits ONE file per run by design (clear backups, clear rollback). For a multi-file change, run it once per file; each gets its own backup.
- Read the live file every run — do not cache it; another lane may have moved on.
License
Apache 2.0
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

