git-split

Split large files into focused modules while preserving git history.

1|1|Updated Jun 11, 2024
One-click install
npx skills add https://github.com/ag-grid/ag-shared --skill git-split
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-split
Source: https://github.com/ag-grid/ag-shared/tree/main/prompts/skills/git-split
Command: npx skills add https://github.com/ag-grid/ag-shared --skill git-split

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Split large files into smaller modules while preserving git history (blame, log) to maintain complete traceability during refactors.

Core Features & Use Cases

  • Split large files into focused modules while preserving their history, enabling easier maintenance and code review.
  • Preserve blame and log history across file splits to ensure accountability.
  • Use on monolithic codebases where breaking changes must be introduced without losing historical context.

Quick Start

Split the target large file into focused modules while preserving its complete git history.

Frequently Asked Questions about git-split

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I split a large file into smaller modules while preserving git history?

You can split large files into focused modules while preserving git history by using a branch-based workflow that keeps blame and log intact. This technique enables safe extraction of functionality from monolithic codebases without losing historical context.

What is the best way to refactor a monolithic codebase without losing git blame?

The best way to refactor a monolithic codebase without losing git blame is to split large files into focused modules using a history-preservation workflow. This approach maintains accountability by keeping the complete git log and blame data intact across file splits.

Do I need a clean working tree to split files and preserve git history?

Yes, you need a clean working tree and must be on a feature branch to split files and preserve git history. This branch-based history-preservation workflow also requires the Git CLI to be installed to execute the modularization process safely.

Can I extract functionality from a large file into separate modules without breaking branch merges?

Yes, you can extract functionality from a large file into separate modules without breaking branch merges. The history-preservation workflow operates on a feature branch and ensures that historical context remains intact across branches and subsequent merges.

Why does refactoring a monolithic codebase into modules usually lose git traceability?

Refactoring a monolithic codebase into modules usually loses git traceability because standard file moves break the connection to previous commits. Using a history-preservation workflow solves this by keeping the git blame and log data intact during the file split.

When should I use a branch-based workflow for codebase modularization?

You should use a branch-based workflow for codebase modularization when you need to introduce breaking changes by splitting large files into focused modules. It allows you to safely extract functionality while preserving complete git history for accountability.