safe-renaming
Skill486 starsChanged 15 days agoApache-2.0View on GitHub
Safely execute rename requests and mass refactoring using file-by-file native edits, semantic AST tools, and optional BTRFS staging verification.
- Deletes or force-pushes
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 3 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 29
Search and inspect target occurrences using AST references or grep.
- Very specific: line 34
After modifying a batch of 3-5 files, run fast type/lint validation directly and delegate long-running test/doc checks to a background …
- Very specific: line 43
Run full workspace verification on the live repository (via a Model: "inherit" background subagent) to confirm 100% clean compilation, zero …
- Distinctive: line 49
Substrings in Trait/Method names: Ensure identifiers are properly bounded and not partially matching unrelated symbols.
- Distinctive: line 51
Doc Comment Integrity: Ensure plain English prose in doc comments is not inadvertently changed when updating code symbols.
- Very specific: line 52
No Scripts: Never reach for sed/awk/python/rust scripts to automate text replacements.
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
When to Use This Skill
Activate this skill whenever the user asks for rename requests (e.g., "Rename X to Y across the codebase", "tree-wide rename", "safely rename ..."), or any renaming of variables, fields, functions, parameters, or types across files in the codebase.
Mandate: No Scripts of Any Kind
Scripts of ANY kind (shell scripts like perl, sed, awk, python, bash, fish, or custom/disposable Rust scripts compiled via rustc) are STRICTLY PROHIBITED for performing code refactoring or modifications. All changes must be performed file-by-file using native file-editing tools (replace_file_content / multi_replace_file_content) combined with AST-level semantic tools (rust-analyzer).
Workflow: Safe Staged Refactoring Protocol
To ensure safety during multi-file refactoring, follow this protocol:
Step 1: Optional BTRFS Staging Copy
For large changes, use cp --reflink=auto to create a lightweight, near-instant BTRFS CoW snapshot copy of the workspace in ~/Downloads/rename-staging/.
# Ensure any previous staging directory is clean
rm -rf ~/Downloads/rename-staging
# Create BTRFS reflink clone
cp --reflink=auto -r ~/github/roc ~/Downloads/rename-stagingStep 2: Systematic File-by-File Native Edits
Perform the refactoring file-by-file using native file editing tools (replace_file_content / multi_replace_file_content) and semantic AST tools:
- Search and inspect target occurrences using AST references or grep.
- Carefully apply edits line-by-line or chunk-by-chunk to preserve surrounding rustdoc, formatting, and comments.
- Beware of local variable shadowing (e.g.
let vp_width = ...shadowingvp_width(...)).
Step 3: Incremental Validation
After modifying a batch of 3-5 files, run fast type/lint validation directly and delegate long-running test/doc checks to a background subagent (invoke_subagent with TypeName: "self", Model: "inherit"):
./check.fish --check
./check.fish --clippy
./check.fish --test
./check.fish --quick-docStep 4: Final Verification
Run full workspace verification on the live repository (via a Model: "inherit" background subagent) to confirm 100% clean compilation, zero lint warnings, and all tests passing:
./check.fish --fullPitfalls & Safeguards
- Substrings in Trait/Method names: Ensure identifiers are properly bounded and not partially matching unrelated symbols.
- Module Shadowing: Watch out for local variable names (
let vp_width = ...) that shadow constructor helper functions (vp_width(...)). - Doc Comment Integrity: Ensure plain English prose in doc comments is not inadvertently changed when updating code symbols.
- No Scripts: Never reach for sed/awk/python/rust scripts to automate text replacements.
In this repository30 other files it gives its agents.
- .agents/AGENTS.mdAGENTS.md
- AGENTS.mdAGENTS.md
- build-infra/AGENTS.mdAGENTS.md
- rust-analyzer-mcp-server/AGENTS.mdAGENTS.md
- task/AGENTS.mdAGENTS.md
- llms.txtllms.txt
- analyze-log-filesSkill
- analyze-performanceSkill
- audit-taskSkill
- batch-refactor-with-sub-agentsSkill
- check-bounds-safetySkill
- check-code-qualitySkill
- check-test-coverageSkill
- code-reviewSkill
- concurrency-safetySkill
- create-commit-messageSkill
- create-prSkill
- design-philosophySkill
- fast-string-allocationsSkill
- fix-issueSkill
- merge-prSkill
- organize-modulesSkill
- organize-testsSkill
- release-crateSkill
- remove-crate-prefixSkill
- review-prSkill
- run-clippySkill
- test-cross-platformSkill
- write-documentationSkill
- write-structured-tracingSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

