find-replace
Modern find-and-replace using sd (simpler than sed) and batch replacement patterns. Triggers on: sd, find replace, batch replace, sed replacement, string replacement, rename.
Best use case
find-replace is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Modern find-and-replace using sd (simpler than sed) and batch replacement patterns. Triggers on: sd, find replace, batch replace, sed replacement, string replacement, rename.
Teams using find-replace should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/find-replace/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How find-replace Compares
| Feature / Agent | find-replace | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Modern find-and-replace using sd (simpler than sed) and batch replacement patterns. Triggers on: sd, find replace, batch replace, sed replacement, string replacement, rename.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Find Replace Modern find-and-replace using sd. ## sd Basics ```bash # Replace in file (in-place) sd 'oldText' 'newText' file.txt # Replace in multiple files sd 'oldText' 'newText' *.js # Preview without changing (pipe) cat file.txt | sd 'old' 'new' ``` ## sd vs sed | sed | sd | |-----|-----| | `sed 's/old/new/g'` | `sd 'old' 'new'` | | `sed -i 's/old/new/g'` | `sd 'old' 'new' file` | | `sed 's#path/to#new/path#g'` | `sd 'path/to' 'new/path'` | **Key difference:** sd is global by default, no delimiter issues. ## Common Patterns ```bash # Variable/function rename sd 'oldName' 'newName' src/**/*.ts # Word boundaries (avoid partial matches) sd '\boldName\b' 'newName' src/**/*.ts # Import path update sd "from '../utils'" "from '@/utils'" src/**/*.ts # Capture groups sd 'console\.log\((.*)\)' 'logger.info($1)' src/**/*.js ``` ## Safe Batch Workflow ```bash # 1. List affected files rg -l 'oldPattern' src/ # 2. Preview replacements rg 'oldPattern' -r 'newPattern' src/ # 3. Apply sd 'oldPattern' 'newPattern' $(rg -l 'oldPattern' src/) # 4. Verify rg 'oldPattern' src/ # Should return nothing git diff # Review changes ``` ## Special Characters | Character | Escape | |-----------|--------| | `.` | `\.` | | `*` | `\*` | | `[` `]` | `\[` `\]` | | `$` | `\$` | | `\` | `\\` | ## Tips | Tip | Reason | |-----|--------| | Always preview with `rg -r` first | Avoid mistakes | | Use git before bulk changes | Easy rollback | | Use `\b` for word boundaries | Avoid partial matches | | Quote patterns | Prevent shell interpretation | ## Additional Resources For detailed patterns, load: - `./references/advanced-patterns.md` - Regex, batch workflows, real-world examples
Related Skills
finding-security-misconfigurations
This skill enables Claude to identify potential security misconfigurations in various systems and configurations. It leverages the security-misconfiguration-finder plugin to analyze infrastructure-as-code, application configurations, and system settings, pinpointing common vulnerabilities and compliance issues. Use this skill when the user asks to "find security misconfigurations", "check for security vulnerabilities in my configuration", "audit security settings", or requests a security assessment of a specific system or file. This skill will assist in identifying and remediating potential security weaknesses.
path-traversal-finder
Path Traversal Finder - Auto-activating skill for Security Fundamentals. Triggers on: path traversal finder, path traversal finder Part of the Security Fundamentals skill category.
hardcoded-credential-finder
Hardcoded Credential Finder - Auto-activating skill for Security Fundamentals. Triggers on: hardcoded credential finder, hardcoded credential finder Part of the Security Fundamentals skill category.
finding-arbitrage-opportunities
Detect profitable arbitrage opportunities across CEX, DEX, and cross-chain markets in real-time. Use when scanning for price spreads, finding arbitrage paths, comparing exchange prices, or analyzing triangular arbitrage opportunities. Trigger with phrases like "find arbitrage", "scan for arb", "price spread", "exchange arbitrage", "triangular arb", "DEX price difference", or "cross-exchange opportunity".
recipe-find-large-files
Identify large Google Drive files consuming storage quota.
recipe-find-free-time
Query Google Calendar free/busy status for multiple users to find a meeting slot.
sponsor-finder
Find which of a GitHub repository's dependencies are sponsorable via GitHub Sponsors. Uses deps.dev API for dependency resolution across npm, PyPI, Cargo, Go, RubyGems, Maven, and NuGet. Checks npm funding metadata, FUNDING.yml files, and web search. Verifies every link. Shows direct and transitive dependencies with OSSF Scorecard health data. Invoke with /sponsor followed by a GitHub owner/repo (e.g. "/sponsor expressjs/express").
llm-icon-finder
Finding and accessing AI/LLM model brand icons from lobe-icons library. Use when users need icon URLs, want to download brand logos for AI models/providers/applications (Claude, GPT, Gemini, etc.), or request icons in SVG/PNG/WEBP formats.
claude-code-history-files-finder
Finds and recovers content from Claude Code session history files. This skill should be used when searching for deleted files, tracking changes across sessions, analyzing conversation history, or recovering code from previous Claude interactions. Triggers include mentions of "session history", "recover deleted", "find in history", "previous conversation", or ".claude/projects".
find-skills
Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.
find-bugs
Find bugs, security vulnerabilities, and code quality issues in local branch changes. Use when asked to review changes, find bugs, security review, or audit code on the current branch.
finding-shelter
寻找庇护所 - 帮助Stella在盖亚星球度过第一个夜晚,寻找或建造安全的临时住所