Refactor Across Files
Multi-file string operations with quote and escape safety — uses bun -e, not sed.
Overview
Follows the string-editing/SKILL.md guidance: when editing literal strings that contain quotes, backslashes, or special characters across many files, sed corrupts the output. This capability uses bun -e (or shell_write per file) so the strings land verbatim. Best for renames, import-path migrations, API-key swaps, mass copy edits.
When to use this
- user wants to rename a symbol across 10+ files
- user says 'replace every X with Y in /work' / 'change all imports from a to b'
- user is doing a mass edit involving quotes or template strings
When NOT to use this
- user wants ONE file edited surgically → use shell_write or minimal-patch
- user wants to fix a single bug → use minimal-patch instead
Example prompts
Inputs and output
Inputs
| Field | Description |
|---|---|
target | the symbol/string to find |
replacement | what to swap it with |
scope | glob pattern (default **/*) |
Output
Diff summary per file + total file count.
Runtime profile
What the engine commits when this skill runs.
| Property | Value | Meaning |
|---|---|---|
| Model tier | sonnet | The balanced default model class. Trades quality against cost for the vast majority of skill runs. |
| Cost class | standard | The balanced default model. Right for most skills. |
| Turn budget | 10 | Hard cap on tool-calling iterations before the engine forces a final answer. |
| Execution | synchronous | Runs inside the live turn; result lands in the same response. |
Under the hood
Tools the engine exposes to this skill and integrations it needs.
| Resource | Kind |
|---|---|
shell_exec | tool |
shell_write | tool |
shell_read | tool |
Tags: engineering, refactor
Execution template
Shell tools dispatch via a command template. The model substitutes user inputs into the placeholders before firing the underlying tool.
Invoking this from an agent
Three paths reach this skill. From the chat UI, a user can type the persona slash command followed by a natural request and the discovery step resolves to this skill automatically. From the MCP server, fetch the skill detail with get_skill({id: "refactor-across-files"}) and then invoke it through the agent runtime once the authenticated tier ships. From your own code, hit /docs/skills/refactor-across-files/llm.txt for the token-efficient markdown body and feed it to your model directly.
Accept: text/markdown. The full machine-readable catalog lives at /.well-known/agent-skills/index.json.