← ClaudeAtlas

naming-and-structure-cleanuplisted

Use when naming conventions or file structure drift across a project and need to be made consistent without changing business logic.
yeaight7/agent-powerups · ★ 6 · AI & Automation · score 68
Install: claude install-skill yeaight7/agent-powerups
## Purpose Inconsistent naming (camelCase vs snake_case) and messy file structures make codebases hard to navigate. Enforce the dominant local convention with focused, logic-free diffs. ## When to Use - Mixed naming conventions for the same kind of symbol or file - Closely related files scattered instead of co-located - Review feedback keeps flagging names/structure rather than logic ## Inputs - The area to clean (directory or module) - The repo's type-check and test commands ## Workflow 1. **Observe local conventions.** Before renaming, scan the project to determine the dominant convention. If 80% of files use camelCase, enforce camelCase: ```bash find src -type f | grep -cE "/[a-z]+[A-Z][a-zA-Z]*\." # camelCase filenames find src -type f | grep -cE "/[a-z]+(_[a-z]+)+\." # snake_case filenames grep -rnE "function [a-z]+_[a-z]+\(" src/ # snake_case functions in a camelCase repo ``` 2. **Targeted renames.** Use the `safe-rename` command pattern to update variables, classes, or files. Ensure all imports are updated: ```bash git grep -ln "\bOldName\b" | xargs sed -i "s/\bOldName\b/NewName/g" # then review the diff git mv src/old_location/Component.tsx src/feature/Component.tsx # git mv preserves history git grep -n "old_location" # no stale import paths remain ``` 3. **File co-location.** Move files so that closely related logic is co-located (e.g., keeping `Butto