| name | elisp-edit |
| description | Elisp editing tools for pi coding agent. Provides bracket-safe editing with paredit, structural editing, and full pi edit compatibility. |
| tools | Bash |
Elisp Edit
Comprehensive Emacs Lisp editing tools for pi coding agent.
Features
- ✅ Bracket protection - Uses paredit to ensure balanced parentheses
- ✅ pi edit compatible - 100% compatible with pi's edit tool
- ✅ Structural editing - S-expression aware operations
- ✅ Batch editing - Multiple edits in one call
- ✅ Auto-rollback - Reverts on failure
- ✅ Diff output - Shows changes made
Tools
1. elisp-edit-unified.sh (Recommended)
Unified entry point that automatically selects the best editing method.
./scripts/elisp-edit-unified.sh edit src/my-lib.el "old" "new"
./scripts/elisp-edit-unified.sh batch src/my-lib.el '[{"oldText":"a","newText":"b"}]'
./scripts/elisp-edit-unified.sh safe src/my-lib.el "old" "new"
./scripts/elisp-edit-unified.sh snapshot src/my-lib.el
./scripts/elisp-edit-unified.sh validate src/my-lib.el
2. paredit-edit.sh
Bracket-safe editing using paredit.
./scripts/paredit-edit.sh apply src/my-lib.el "old" "new"
./scripts/paredit-edit.sh batch src/my-lib.el '[{"oldText":"a","newText":"b"}]'
./scripts/paredit-edit.sh validate src/my-lib.el
3. pi-elisp-edit.sh
Full pi edit compatibility.
./scripts/pi-elisp-edit.sh apply src/my-lib.el "old" "new"
./scripts/pi-elisp-edit.sh batch src/my-lib.el '[{"oldText":"a","newText":"b"}]'
./scripts/pi-elisp-edit.sh preview src/my-lib.el "old" "new"
When to Use
| Scenario | Recommended Tool |
|---|
| Daily elisp editing | elisp-edit-unified.sh edit |
| Batch renaming | elisp-edit-unified.sh batch |
| Safe editing (bracket protection) | paredit-edit.sh apply |
| Structural operations | struct-edit (separate skill) |
| Quick text replacement | pi-elisp-edit.sh apply |
Requirements
- Emacs with
emacsclient running
paredit package installed
- Babashka (for struct-edit integration)
Installation
npx skills add zhaoyul/emacs-skills@elisp-edit -g -y
Architecture
elisp-edit-unified.sh (unified entry point)
├── paredit-edit.sh (bracket-safe)
│ └── paredit-edit.el
├── pi-elisp-edit.sh (pi compatible)
│ └── pi-elisp-edit.el
└── struct-edit (structural)
└── clj-struct-edit
How It Works
- paredit-edit: Opens file in Emacs with
paredit-mode, applies edits, validates brackets, rolls back on failure
- pi-elisp-edit: Pure text matching with fuzzy support, BOM/CRLF handling, diff generation
- struct-edit: S-expression aware operations using rewrite-clj
Error Handling
All tools provide:
- Bracket validation after edits
- Automatic rollback on failure
- Detailed error messages
- Diff output showing changes