Best for
- Renaming an exported function, class, interface, type alias, constant, or
- Renaming a file that is imported by other modules (requires updating all
- Any rename where the old symbol name appears in more than one file.
ZaxbyHub/opencode-swarm/.opencode/skills/generated/safe-rename/SKILL.md
Workflow for safely renaming symbols (functions, types, classes, interfaces, constants, variables) across a codebase. Uses repo_map, batch_symbols, and build_check to ensure every consumer is updated and nothing breaks.
Decision brief
Guides a systematic, tool-augmented workflow for renaming exported symbols across a codebase without silently breaking consumers, tests, or downstream builds.
Compatibility matrix
| Platform | Status | Evidence | What to check |
|---|---|---|---|
| Codex | Not declared | No explicit evidence | Portability before use |
| Claude Code | Not declared | No explicit evidence | Portability before use |
| Cursor | Not declared | No explicit evidence | Portability before use |
| Gemini CLI | Not declared | No explicit evidence | Portability before use |
Installation
The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.
npx skills add https://github.com/ZaxbyHub/opencode-swarm --skill ".opencode/skills/generated/safe-rename"Inspect the Agent Skill "safe-rename" from https://github.com/ZaxbyHub/opencode-swarm/blob/97dc624b391c8e2e80ed42f4bfa37876554c24cb/.opencode/skills/generated/safe-rename/SKILL.md at commit 97dc624b391c8e2e80ed42f4bfa37876554c24cb. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.
Workflow
1. Determine the file that exports the symbol and the symbol name to rename. 2. If renaming a file itself, note the old path and the new path.
1. Determine the file that exports the symbol and the symbol name to rename. 2. If renaming a file itself, note the old path and the new path.
1. Run repomap with action importers and file set to the target file path. This returns every file that imports from the target, with line numbers and import metadata. 2. If the rename is high-risk (the symbol is widely used or part of a core utility), also run repomap with acti…
1. Run symbols on the target file (with exportedonly: true) to see every exported symbol. This helps confirm the exact name, signature, and whether the symbol is re-exported. 2. Run batchsymbols on the consumer files identified in Step 2 to understand how they import and use the…
1. Read each consumer file identified in Step 2 to understand usage patterns: - Direct named imports: import { OldName } from './target' - Namespace imports: import as ns from './target' then ns.OldName - Default imports or re-exports - Dynamic access: obj['OldName'] (see Limita…
Permission review
The documentation asks the agent to read local files, directories, or repositories.
Read each consumer file identified in Step 2 to understand **usage patterns**:The documentation asks the agent to create, modify, or delete local files.
**Update each consumer file one at a time** using `apply_patch`:Evidence record
| Signal | Value | Evidence type | Meaning |
|---|---|---|---|
| Quality score | 92/100 | Computed | Documentation, specificity, maintenance, and trust rules |
| Repository stars | 451 | Source | Repository attention, not individual Skill quality |
| Compatibility | 0 platforms | Source | Declared in the catalog source record |
| Usage guide | automated source guide | Editorial | Generated or reviewed according to the visible evidence level |
Pinned source
Guides a systematic, tool-augmented workflow for renaming exported symbols across a codebase without silently breaking consumers, tests, or downstream builds.
Do NOT use for:
| Tool | Purpose |
|---|---|
repo_map (action: importers) | Find every file that imports from the target file |
repo_map (action: blast_radius) | Find transitive dependents for high-risk renames |
symbols | List the full exported API surface of the target file |
batch_symbols | Bulk symbol extraction across multiple affected files |
search | Find literal occurrences of the old symbol name across the codebase |
suggest_patch | Preview changes before applying (dry-run) |
apply_patch | Apply rename patches to consumer files |
edit | Fallback for one-at-a-time rename edits when apply_patch is not suitable |
build_check (mode: typecheck) | Verify the rename does not break compilation |
test_runner | Run tests on affected files after rename |
repo_map with action importers and file set to the target file path.
This returns every file that imports from the target, with line numbers and
import metadata.repo_map with action blast_radius to understand
transitive dependents.symbols on the target file (with exported_only: true) to see every
exported symbol. This helps confirm the exact name, signature, and whether
the symbol is re-exported.batch_symbols on the consumer files identified in Step 2 to understand
how they import and use the symbol.import { OldName } from './target'import * as ns from './target' then ns.OldNameobj['OldName'] (see Limitations)edit.apply_patch:
suggest_patch to preview the rename changes for the consumer file,
then apply the patch with apply_patch.Before considering the rename complete:
suggest_patch to preview any remaining rename changes before applying
with apply_patch, ensuring the patch set is correct.build_check with mode: "typecheck" and scope: "changed".
build_check with mode: "both" if the project uses a build step
(compilation + typecheck).test_runner with scope: "impact" or scope: "graph" on the changed
files to verify no tests break.search for the old symbol name across the entire codebase to
confirm zero remaining references (excluding comments, changelogs, and
docs/releases/ history fragments).When consolidating types from sibling files (e.g., extracting a shared type
from evidence.ts and runner.ts into a new types.ts in the same
directory), verify import direction before creating the shared module.
If the new module imports anything from either sibling, you create a circular
dependency that silently breaks the module graph.
Example of the trap:
// types.ts — imports from a sibling
import { SomeClass } from './runner'; // ← runner.ts will import from types.ts
export interface MyType { handler: SomeClass }; // circular!
Verification steps:
repo_map (action: dependencies)
on each sibling file to understand what it imports.repo_map (action: importers) on the new shared
module to verify it has no import edges pointing back to the siblings.build_check (mode: typecheck) to confirm no circular dependency
errors._types.ts that has no imports
from the directory).Why this matters: During PR #1702, consolidating types from sibling files
in src/turbo/lean/ created a circular dependency between evidence.ts,
runner.ts, and the extracted types module. The typecheck caught it, but the
fix required restructuring the extraction.
This workflow has the following known gaps:
repo_map importers and search find imports by file path, but they do not
resolve renamed imports:
import { X as Y } from './target'; // Y is an alias for X
If you rename X to Z, the search will not find the Y alias. You must
manually check for aliased imports by searching for { X as patterns.
This workflow is text-based, not AST-based. In TypeScript, structural typing means
a variable typed as { name: string } satisfies any interface with that shape,
regardless of the interface name. Renaming the interface name does not require
updating these structural usages, but the workflow may flag them as "missed
references" in Step 7.
References via string literals, reflection, or computed property access are invisible to static search:
obj['oldName'] // string-based property access
Reflect.get(target, 'oldName') // reflection
If the renamed symbol is accessed dynamically anywhere, those references will
not be found by search or repo_map. Use grep for the string form of the old
name to catch these cases.
If a symbol is re-exported through an index file (export { X } from './X'),
the re-export line and all downstream consumers of the re-export must also be
updated. The repo_map blast_radius action helps here, but you must manually
verify re-export chains.
The old symbol name may appear in:
These are outside the scope of this workflow but should be considered for high-impact renames.
Before marking a rename complete, verify every item:
build_check typecheck passes with no errorssearch for old name returns zero stale code referencesFrequently asked questions
Guides a systematic, tool-augmented workflow for renaming exported symbols across a codebase without silently breaking consumers, tests, or downstream builds.
The source record exposes this install command: npx skills add https://github.com/ZaxbyHub/opencode-swarm --skill ".opencode/skills/generated/safe-rename". Inspect the command and pinned source before running it.
Static rules flagged read-files, write-files in the source; the page lists the matching lines and excerpts.
Alternatives
garrytan/gbrain
End-to-end discipline for turning any large data source (audio libraries, email takeouts, document corpora, chat exports, API dumps) into brain pages at scale. The lifecycle spine: SCHEMA → ACCESS → TRIAL → EVALUATE → IMPROVE → CODIFY → TEST → SKILLIFY → BULK → MONITOR. State is tracked in a durable JSON manifest (see MANIFEST-PATTERN.md) so any crash, session boundary, or subagent fan-out resumes from ground truth instead of memory.
alirezarezvani/claude-skills
App Store Optimization (ASO) toolkit for researching keywords, analyzing competitor rankings, generating metadata suggestions, and improving app visibility on Apple App Store and Google Play Store. Use when the user asks about ASO, app store rankings, app metadata, app titles and descriptions, app store listings, app visibility, or mobile app marketing on iOS or Android. Supports keyword research and scoring, competitor keyword analysis, metadata optimization, A/B test planning, launch checklist
dotnet/skills
Migrates .NET test projects from VSTest to Microsoft.Testing.Platform (MTP). Use when user asks to "migrate to MTP", "switch from VSTest", "enable Microsoft.Testing.Platform", "use MTP runner", set OutputType=Exe only for test projects in Directory.Build.props, or mentions EnableMSTestRunner, EnableNUnitRunner, or UseMicrosoftTestingPlatformRunner. USE FOR: MTP behavioral differences vs VSTest (exit code 8, zero tests discovered, --ignore-exit-code, TESTINGPLATFORM_EXITCODE_IGNORE); centralizing
oaustegard/claude-skills
Generate hierarchical _FEATURES.md files that describe what a codebase DOES from a user/consumer perspective, anchored to source symbols via tree-sitting. Supports large complex codebases through feature-driven decomposition into sub-feature files. Uses a multi-pass synthesis: orientation → detail → overview rewrite. Use when someone says "what does this do", "document features", "feature inventory", "_FEATURES.md", or needs to understand a codebase's purpose before modifying it. Complements tre