mirror of
https://github.com/addyosmani/agent-skills.git
synced 2026-08-12 18:07:26 +02:00
Add simplify-ignore hook for block-level code protection
Single bash script that prevents the model from seeing (and accidentally simplifying) code blocks marked with simplify-ignore annotations during /code-simplify sessions. Hook flow: - PreToolUse Read: backs up file, replaces blocks with BLOCK_<hash> placeholders - PostToolUse Edit|Write: expands placeholders, applies model changes, re-filters - Stop: restores files from backup when session ends Features: - Hash-based tokens (content-addressed, unambiguous round-trip) - Multi-block support per file - Optional reason string: /* simplify-ignore-start: perf-critical */ - Language-aware placeholders (preserves comment syntax per language) - Glob-safe parameter expansion (Bash 3.2 compatible) - Atomic locking with stale lock recovery - Trailing newline preservation - Self-healing recovery from interrupted sessions - Cross-platform: Bash 3.2+, jq, shasum/sha1sum (macOS, Linux, Git Bash) Implements #2
This commit is contained in:
@@ -3,3 +3,4 @@ node_modules/
|
||||
.env
|
||||
.env.*
|
||||
*.log
|
||||
.claude/.simplify-ignore-cache/
|
||||
|
||||
Reference in New Issue
Block a user