搜索

PythonReactSEOPDF
GitHub Skill

move-files

Move files using a two-phase approach that preserves Git history. Phase 1 uses mv commands only, then waits for staging. Phase 2 makes content changes separately. Use when reorganizing files and need clean, trackable diffs. Triggers on "move files", "reorganize structure", "preserve git history".

steveclarke☆ 27 仓库 Stars1 仓库 Forks

安装与使用

请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。

查看来源 ↗使用指南

技能说明

Move Files Command

Overview

A two-phase approach for moving files that preserves git history and makes changes trackable in diffs.

The Problem

When moving files, if you copy content and write new files, git treats them as deletions + additions rather than moves. This makes it impossible to track what actually changed versus what just moved.

The Solution: Two-Phase Move

Phase 1: Move Files with mv Commands

CRITICAL RULE: Use terminal mv commands ONLY. Never copy content and write files.

mv source/path destination/path

After moving files, STOP.

Tell the user:

"Phase 1 complete. Files have been moved using mv commands. Please stage these moves in git, then let me know when ready for Phase 2."

Phase 2: Make Content Changes (Only After User Stages)

Only proceed after user explicitly confirms moves are staged.

Now make any necessary content changes to the moved files:

  • Update path references
  • Fix import statements
  • Update documentation links
  • Adjust configuration values
  • Modify file content as needed

Why This Works

Git tracking: When you use mv and stage the move, git recognizes it as a rename/move operation. This preserves file history.

Clean diffs:

  • Phase 1 diff shows: file moved from A to B (no content changes)
  • Phase 2 diff shows: only the actual content modifications

Easy review: The user can verify moves are correct before any content changes happen. This makes it clear what moved versus what actually changed.

When to Use This

Use this pattern whenever:

  • Moving files between directories
  • Reorganizing documentation
  • Refactoring code structure
  • Consolidating scattered files
  • Any scenario where files need to move AND have content updated

Example Usage

User says: "Move all the guides from backend/docs/ to project/guides/backend/"

Your response:

  1. Use mv backend/docs/guides project/guides/backend
  2. Verify the move succeeded
  3. Tell user to stage the moves
  4. WAIT for user confirmation
  5. Only then make content changes to the moved files

Key Principles

  • Use mv commands only - Never copy and write
  • Stop after moves - Wait for staging
  • Make content changes separately - Only after user confirms staging
  • One phase at a time - Never combine moves with content changes

使用示例

查看来源仓库中的使用示例与配置说明。

查看来源 ↗

来源历史

收录时间
2026-03-11
索引更新时间
2026-03-11
Branch
main

收录与同步日期属于本站记录。源码修改历史请查看来源仓库。

GitHub ↗

chat Comments (0)

chat_bubble_outline

No comments yet. Be the first to share your thoughts!