Skip to content
Back to skills

Edit Deterministic

ASecurity

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.

  • 28 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 7, 2026
ai-agentsgokotlinbashspringbackend

Works with

  • mcp

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned September 7, 2026

npx -y skills add move-hoon/claude-pro-minmax --skill edit-deterministic --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Edit Deterministic?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Edit Deterministic
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/move-hoon-edit-deterministic/badge)](https://www.skillsdirectory.com/skills/move-hoon-edit-deterministic)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: edit-deterministic
description: 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.
---

# 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
- **Mechanical / repeated across many sites** → `ast-grep --rewrite` (preview first).
- **Single, type-aware symbol** (rename/replace a function/method body) → Serena `replace_symbol`.
- **Genuine judgment** (novel logic, one-off) → LLM `Edit`, smallest diff, match surrounding code.

## ast-grep --rewrite (mechanical)
```bash
# 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)
- `find_symbol` → locate the exact symbol (no whole-file read).
- `replace_symbol_body` → swap one definition, LSP-aware.
- Single MCP; use only when enabled. Absent → fall back to scoped `Edit`.
- Large repos: `serena project index` first; turn it off for tiny modules (startup cost).
- **Kotlin escape hatch (ADR-005)** — Serena's standard LSP can be flaky on Kotlin (slow startup). For deep Kotlin/Spring symbol work, the IntelliJ/JetBrains backend is the gold standard; switch to it only when the standard LSP misbehaves (it's paid + IDE-bound, so not the default).
- Verified findings worth keeping go to `.serena/memories` (human-reviewed, P5) — not auto-injected.

## Rules
- Preview every `--rewrite` before applying; commit boundary around it (P6).
- Re-confirm target in one shot before a multi-site change (P3), then verify (`scripts/verify.sh`).
- Optional tools may be absent — degrade to a minimal manual `Edit`, never block.

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

Files in this skill

  • SKILL.md2.1 KB
  • references/patterns.md1.6 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.