Edit deterministic

From move-hoon/sober · View interactive version

Edit deterministic is an AI agent skill from the GitHub repository move-hoon/sober. Offload mechanical and type-aware edits to deterministic tools instead of LLM file-rewrites (P2). Use ast-grep --rewrite for repeated/mechanical transforms and Serena replace_symbol for single type-aware symbol edits. Apply whenever a change is rule-shaped rather than judgment-shaped.

How to use this skill

Skill file

Deterministic Edit Skill (P2)

Purpose

Minimize LLM file-rewrites. If an edit follows a rule, a tool should apply it — verifiably and reversibly (invariant: cheap to verify, cheap to roll back).

Decision

ast-grep --rewrite (mechanical)

# ALWAYS dry-run first — no -U/--update-all
ast-grep -p 'foo($A)' --rewrite 'bar($A)' --lang ts        # preview diff
ast-grep -p 'foo($A)' --rewrite 'bar($A)' --lang ts -U     # apply after review

Serena (type-aware, single symbol)

Rules

Need rewrite/replace patterns and worked examples? Read references/patterns.md.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.