safe-remove-code

Community

Remove code safely, prevent file damage.

Authorcowwoc
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Removing code patterns (like instrumentation or debugging code) from multiple files can be dangerous. Aggressive scripts might accidentally delete functional code, leaving files gutted and requiring manual restoration from backups. This Skill prevents such catastrophic damage.

Core Features & Use Cases

  • Mandatory Backup: Always creates a timestamped backup before any removal operation, ensuring a safe rollback point.
  • Per-File Validation: Crucially, validates each file individually after removal (syntax, size, integrity) to ensure it remains functional and not accidentally gutted.
  • Precise Pattern Matching: Emphasizes using exact, tested patterns to avoid unintended deletions.
  • Functional Testing: Recommends running build and tests after all removals to verify overall system integrity.
  • Use Case: When you need to remove timing instrumentation from 47 hook scripts, use this Skill. It will create a backup, remove the patterns, and then validate each hook to ensure it's still functional, preventing the accidental destruction of critical system components.

Quick Start

First, identify precise patterns to remove and test them. Then, execute the removal script: /workspace/main/.claude/scripts/safe-remove-code.sh
--files "*.sh"
--patterns "HOOK_START= log_timing() trap.*timing.*exit"
--test-command "bash -n {}"

Dependency Matrix

Required Modules

None required

Components

scripts

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: safe-remove-code
Download link: https://github.com/cowwoc/styler/archive/main.zip#safe-remove-code

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.