Agent skill

Safe Rename

by ZaxbyHub in ZaxbyHub/opencode-swarm

Workflow for safely renaming symbols (functions, types, classes, interfaces, constants, variables) across a codebase.

MITAuto-check passedDevelopment

Install Safe Rename

skills CLI
$ npx skills add ZaxbyHub/opencode-swarm --skill safe-rename -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install ZaxbyHub/opencode-swarm safe-rename --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/ZaxbyHub/opencode-swarm.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.opencode/skills/generated/safe-rename .claude/skills/safe-rename && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
safe-rename
GitHub stars
494
Token cost
~2.4k tokens
SKILL.md length
1,177 words
Files
2
Skills in repo
91
Repo updated
First seen
Licence
MIT

At a glance

Workflow for safely renaming symbols (functions, types, classes, interfaces, constants, variables) across a codebase.

  • Works in 7 steps: Identify the target → Discover consumers → Understand the API surface → …
  • Tasks that involve Codebase onboarding
  • SKILL.md covers When to Use, Required Tools, Workflow and Limitations, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Safe Rename is an agent skill from ZaxbyHub/opencode-swarm. Workflow for safely renaming symbols (functions, types, classes, interfaces, constants, variables) across a codebase. Uses repomap, batchsymbols, and buildcheck to ensure every consumer is updated and nothing breaks.

Its SKILL.md is about 2.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 1 other file.

It sits in Development, covering Codebase onboarding. The repository describes itself as: Architect-centric agentic swarm plugin for OpenCode. Hub-and-spoke orchestration with SME consultation, code generation, and QA review. The licence is MIT.

When your agent uses it

  • Tasks that involve Codebase onboarding

Example prompts

  • “/safe-rename”

Workflow steps

7 steps, taken from the step headings in SKILL.md.

  1. Identify the target
  2. Discover consumers
  3. Understand the API surface
  4. Assess impact
  5. Execute the rename
  6. Dry-run verification (MANDATORY)
  7. Post-rename verification

What it can do on your machine

Read from SKILL.md and the folder at commit b63a4bd. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Safe Rename loads about 2.4k tokens when it runs. Until then it costs about 58 tokens; SKILL.md has 1,177 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~58
When it runs · the whole SKILL.md, loaded when a task matches
~2.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from ZaxbyHub/opencode-swarm at commit b63a4bd, republished under its MIT licence (© ZaxbyHub). 1,177 words, ~2,384 tokens.

Download SKILL.mdSave it as .claude/skills/safe-rename/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
safe-rename
description
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.
effort
small
source_knowledge_ids
20f7da40-02e0-4da8-9310-a78eb87ca81e
generated_at
2026-06-14T16:50:00Z
confidence
0.8
status
active
version
4
skill_origin
generated
provenance_note
Re-linked to current knowledge entries (version 4). The original source ID 1eb9f867... is no longer present in the active knowledge store. The skill body and…

Safe Rename Skill

Guides a systematic, tool-augmented workflow for renaming exported symbols across a codebase without silently breaking consumers, tests, or downstream builds.

When to Use

  • Renaming an exported function, class, interface, type alias, constant, or enum across the codebase.
  • Renaming a file that is imported by other modules (requires updating all import paths).
  • Any rename where the old symbol name appears in more than one file.

Do NOT use for:

  • Local-only renames (a variable scoped to a single function body) — use your editor's rename refactoring directly.
  • Renaming a symbol that has zero consumers — just edit the definition.

Required Tools

ToolPurpose
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
symbolsList the full exported API surface of the target file
batch_symbolsBulk symbol extraction across multiple affected files
searchFind literal occurrences of the old symbol name across the codebase
suggest_patchPreview changes before applying (dry-run)
apply_patchApply rename patches to consumer files
editFallback 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_runnerRun tests on affected files after rename

Workflow

Step 1 — Identify the target
  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.
Step 2 — Discover consumers
  1. Run 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.
  2. If the rename is high-risk (the symbol is widely used or part of a core utility), also run repo_map with action blast_radius to understand transitive dependents.
Step 3 — Understand the API surface
  1. Run 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.
  2. Run batch_symbols on the consumer files identified in Step 2 to understand how they import and use the symbol.
Step 4 — Assess impact
  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 Limitations)
  2. Count the total number of files and occurrences to gauge rename scope.
Step 5 — Execute the rename
  1. Rename the definition in the source file first using edit.
  2. Update each consumer file one at a time using apply_patch:
    • Use suggest_patch to preview the rename changes for the consumer file, then apply the patch with apply_patch.
    • Replace the old symbol name with the new name in import statements.
    • Replace the old symbol name with the new name in usage sites within that file.
    • Do NOT batch all edits into a single call — apply one file at a time so each change is independently verifiable.
  3. If renaming a file (not just a symbol), update all import paths in consumer files to reflect the new file path.
  4. If the symbol is re-exported from an index/barrel file, update the re-export as well.
Step 6 — Dry-run verification (MANDATORY)

Before considering the rename complete:

  1. Use suggest_patch to preview any remaining rename changes before applying with apply_patch, ensuring the patch set is correct.
  2. Run build_check with mode: "typecheck" and scope: "changed".
    • If this fails, review the output for remaining references to the old name or type mismatches introduced by the rename.
    • Fix any issues found and re-run the typecheck.
  3. Run build_check with mode: "both" if the project uses a build step (compilation + typecheck).
Step 7 — Post-rename verification
  1. Run test_runner with scope: "impact" or scope: "graph" on the changed files to verify no tests break.
  2. Run search for the old symbol name across the entire codebase to confirm zero remaining references (excluding comments, changelogs, and docs/releases/ history fragments).
  3. If any references remain, determine whether they are:
    • Stale references that need updating — fix them.
    • Intentional (e.g., migration aliases, backward-compat shims) — document why they remain.
    • Documentation/history — leave as-is.
Show full SKILL.md (493 more words)Show less
Circular dependency warning: type extraction from sibling files

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:

typescript
// 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:

  1. Before creating the shared module, use repo_map (action: dependencies) on each sibling file to understand what it imports.
  2. After extraction, run repo_map (action: importers) on the new shared module to verify it has no import edges pointing back to the siblings.
  3. Run build_check (mode: typecheck) to confirm no circular dependency errors.
  4. If a circular dependency is detected, move the shared type to a module that neither sibling imports from (e.g., a new _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.

Limitations

This workflow has the following known gaps:

No alias resolution

repo_map importers and search find imports by file path, but they do not resolve renamed imports:

typescript
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.

No type-awareness (structural typing)

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.

Dynamic references

References via string literals, reflection, or computed property access are invisible to static search:

typescript
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.

Re-exports and barrel files

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.

Non-code references

The old symbol name may appear in:

  • Configuration files (JSON, YAML, TOML)
  • CLI argument parsers
  • Stringified identifiers in database records
  • External API contracts or documentation

These are outside the scope of this workflow but should be considered for high-impact renames.

Checklist

Before marking a rename complete, verify every item:

  • Definition renamed in source file
  • All import statements updated across consumers
  • All usage sites updated across consumers
  • Re-exports updated (if applicable)
  • Import paths updated (if renaming a file)
  • build_check typecheck passes with no errors
  • Tests pass for all affected files
  • search for old name returns zero stale code references
  • Limitations reviewed and exceptions documented (if any)

© ZaxbyHub, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in .opencode/skills/generated/safe-rename of ZaxbyHub/opencode-swarm.

  • SKILL.md
  • retired.marker

Open the folder on GitHubat commit b63a4bd

Compare with similar skills

Safe Rename next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Safe Rename compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Safe Rename this skillZaxbyHub/opencode-swarm494—~2.4kAutomated safety check: PassMIT
Codebase Knowledge Graph Q&AEgonex-AI/Understand-Anything86k—~1.2kAutomated safety check: PassMIT
Understand ExplainEgonex-AI/Understand-Anything86k—~1.3kAutomated safety check: PassMIT
Project Onboarding Guide from Knowledge GraphEgonex-AI/Understand-Anything86k—~1.2kAutomated safety check: PassMIT
GitDiagram Repository Overviewahmedkhaleel2004/gitdiagram18k—~427Automated safety check: PassMIT
Deepwiki Rssopaco/deepwiki-rs3.1k—~748Automated safety check: PassMIT

Similar skills

  • Codebase Knowledge Graph Q&A

    Egonex-AI/Understand-Anything

    Answers questions about a codebase by searching a prebuilt knowledge graph of its files, functions, classes and dependencies, not by rereading every source file.

    86k GitHub stars~1.2k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Understand Explain

    Egonex-AI/Understand-Anything

    Gives an in-depth explanation of one file, function or module by reading the project's knowledge graph and checking that the graph is still fresh.

    86k GitHub stars~1.3k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Writes an onboarding guide for new team members from a project's existing knowledge graph, after checking that the graph still matches the current commit.

    86k GitHub stars~1.2k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • GitDiagram Repository Overview

    ahmedkhaleel2004/gitdiagram

    Explains the architecture of a public GitHub repository through GitDiagram: how the code is organized, the main components with paths, and a Mermaid diagram.

    18k GitHub stars~427 tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Deepwiki Rs

    sopaco/deepwiki-rs

    AI-powered Rust documentation generation engine for comprehensive codebase analysis, C4 architecture diagrams, and automated technical documentation.

    3.1k GitHub stars~748 tokensUpdated 27 days ago
    DevelopmentAuto-check passed
  • Explore Codebase with Graph

    tirth8205/code-review-graph

    Navigates a codebase through the code-review-graph MCP tools: architecture overview, symbol search, caller and callee tracing, flows and oversized functions.

    32k GitHub starsUsed in 1 repo~335 tokens
    DevelopmentAuto-check passed

More from ZaxbyHub/opencode-swarm

All 91 skills in this repo
  • Codebase Review Swarm

    ZaxbyHub/opencode-swarm

    Runs an evidence-gated, quote-grounded audit of a codebase for security, QA, accessibility, performance and more, and writes a verified report without changing source files.

    496 GitHub stars~2.8k tokensUpdated today
    Auto-check passed
  • Issue Tracer

    ZaxbyHub/opencode-swarm

    Drives a bug report from validation and root-cause tracing through a critic-reviewed plan, an approved minimal fix and a PR-ready closure, never merging without recorded human approval.

    496 GitHub stars~4.4k tokensUpdated today
    Auto-check passed
  • Commit and PR Publishing for Codex

    ZaxbyHub/opencode-swarm

    Codex adapter for opencode-swarm that governs commits, pushes, draft PRs, PR body updates and CI closeout, deferring to the repo's canonical commit-pr protocol.

    496 GitHub stars~1.6k tokensUpdated today
    Auto-check passed
  • Durable Session State

    ZaxbyHub/opencode-swarm

    Keeps plans, decisions, evidence and reviewer verdicts in small files so long multi-phase tasks survive context compaction and session resumes.

    496 GitHub stars~896 tokensUpdated today
    Auto-check passed
  • Swarm PR Feedback Closer

    ZaxbyHub/opencode-swarm

    Ingests existing pull request feedback such as review comments and CI failures, verifies each claim, fixes confirmed issues and reports closure status for every item.

    496 GitHub stars~14k tokensUpdated today
    Auto-check passed
  • Swarm PR Subscribe

    ZaxbyHub/opencode-swarm

    Monitor a pull request after creation and act autonomously on pushed PR activity.

    496 GitHub stars~2.2k tokensUpdated today
    Auto-check passed

Categories

Questions about Safe Rename

What does Safe Rename do?

Workflow for safely renaming symbols (functions, types, classes, interfaces, constants, variables) across a codebase. Safe Rename is an agent skill from ZaxbyHub/opencode-swarm. Workflow for safely renaming symbols (functions, types, classes, interfaces, constants, variables) across a codebase.

When should I use Safe Rename?

Safe Rename fits situations like: tasks that involve Codebase onboarding.

How do I install Safe Rename in Claude Code?

Run `npx skills add ZaxbyHub/opencode-swarm --skill safe-rename -a claude-code`. Or copy the skill folder (.opencode/skills/generated/safe-rename in ZaxbyHub/opencode-swarm) into .claude/skills/safe-rename in your project. Claude Code loads it when a task matches its description.

How do I install Safe Rename in Codex?

Run `npx skills add ZaxbyHub/opencode-swarm --skill safe-rename -a codex`. Or copy the skill folder (.opencode/skills/generated/safe-rename in ZaxbyHub/opencode-swarm) into .agents/skills/safe-rename in your project. Codex loads it when a task matches its description.

Can I use Safe Rename in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ZaxbyHub/opencode-swarm --skill safe-rename -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/safe-rename, .gemini/skills/safe-rename, .github/skills/safe-rename and .opencode/skills/safe-rename in your project.

What does Safe Rename need to run?

SKILL.md names no scripts, command-line tools or credentials: Safe Rename is instructions for the agent only.

Does Safe Rename access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Safe Rename safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Safe Rename use?

Safe Rename is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Safe Rename use?

About 2.4k tokens (SKILL.md is roughly 9.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Safe Rename?

Skills that share tags, products or a category with Safe Rename: Codebase Knowledge Graph Q&A (Egonex-AI/Understand-Anything, 86k stars), Understand Explain (Egonex-AI/Understand-Anything, 86k stars), Project Onboarding Guide from Knowledge Graph (Egonex-AI/Understand-Anything, 86k stars) and GitDiagram Repository Overview (ahmedkhaleel2004/gitdiagram, 18k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Safe Rename?

ZaxbyHub (a GitHub organization) maintains it in ZaxbyHub/opencode-swarm, which has 494 GitHub stars. The repository holds 91 skills in this directory. The repository was last updated on October 10, 2026.

Source: ZaxbyHub/opencode-swarm on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.