Our review
Uses git mv to move or rename files while preserving Git history and automatically staging changes.
Strengths
- Preserves file history by tracking renames
- Automatically stages changes for commit
- Prevents accidental overwrites
- Shows as rename in git status
Limitations
- Requires manual update of import statements to new paths
- Does not automatically handle complex bulk moves
- Only works within a Git repository
When moving or renaming files in a Git repository to keep history intact and ensure safe, staged operations.
When you intentionally want to delete and recreate a file, or when working outside a Git repository.
Security analysis
SafeThe skill only instructs to use `git mv` for moving/renaming files within a git repository. No external tools, destructive commands, or network operations are involved. The `-f` flag is mentioned with a caution note, but it is a standard git feature. No significant security risk.
No concerns found
Examples
Rename the file components/OldButton.tsx to components/Button.tsx using git mv to preserve history.Move the file src/old-component.tsx to src/components/new-component.tsx using git mv, preserving history and ensuring imports are updated.name: git-move description: Move or rename files using git mv to preserve history. Use this when moving files, renaming files, or reorganizing code structure. Always prefer git mv over regular mv or filesystem operations.
Git Move Skill
Move or rename files using git mv to preserve git history and ensure proper staging.
When to Use
- Moving files between directories
- Renaming files
- Reorganizing code structure
- Refactoring file locations
Instructions
ALWAYS use git mv instead of regular file move operations when working in a git repository.
Basic Usage
# Move a file
git mv <source> <destination>
# Examples
git mv src/old-component.tsx src/components/new-component.tsx
git mv app/page.tsx app/(home)/page.tsx
git mv utils.ts lib/utils.ts
Moving Multiple Files
# Move all files matching a pattern
git mv src/utils/*.ts lib/utils/
# Move entire directory
git mv old-directory/ new-directory/
Benefits Over Regular mv
- Preserves history: Git tracks the file rename
- Auto-stages: Change is automatically staged for commit
- Safe operation: Fails if destination exists (prevents overwrites)
- Works with git status: Shows as renamed, not deleted+added
Examples
Rename a Component
git mv components/OldButton.tsx components/Button.tsx
Reorganize Directory Structure
# Create target directory first if needed
mkdir -p components/ui
# Move files
git mv components/button.tsx components/ui/button.tsx
git mv components/input.tsx components/ui/input.tsx
Move with Force (Overwrite)
# Use -f to overwrite existing destination (use carefully)
git mv -f source.ts destination.ts
Important Notes
- After moving, update all import statements that reference the old path
- Run type checking (
pnpm tsc --noEmit) to find broken imports - Consider using an IDE refactoring tool for imports if available
Next.js App Router Expert
Development
A skill that turns Claude into a Next.js App Router expert.
README Generator
Development
Creates professional and comprehensive README.md files for your projects.
API Documentation Writer
Development
Generates comprehensive API documentation in OpenAPI/Swagger format.