monorepo-extractor

Extract a single project from a monorepo while preserving complete git history.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/levonk/dotfiles --skill monorepo-extractor
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: monorepo-extractor
Source: https://github.com/levonk/dotfiles/tree/main/home/current/.chezmoitemplates/config/ai/skills/software-dev/monorepo-extractor
Command: npx skills add https://github.com/levonk/dotfiles --skill monorepo-extractor

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires git, jq, git-filter-repo, curl, and includes scripts (resource) components.

What problem does it solve?

This Skill enables teams to carve out individual projects from a shared monorepo without losing committed history or disrupting ongoing work.

Core Features & Use Cases

  • Deterministic extraction: Preserve complete git history when moving a subproject to its own repository.
  • Safety and validation: Enforces clean state checks, remote availability, and branch validation to prevent unsafe splits.
  • Team coordination: Provides guidance for team communication and migration references during repository restructuring.

Quick Start

  • Basic strict extraction: ./scripts/extract-project-strict.sh /path/to/monorepo project-name /path/to/new-repo
  • Specify branch explicitly: ./scripts/extract-project-strict.sh --branch main /path/to/monorepo project-name /path/to/new-repo
  • Development/flexible extraction: ./scripts/extract-project-flexible.sh --force /path/to/monorepo project-name /path/to/new-repo

Frequently Asked Questions about monorepo-extractor

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

FAQPage Schema
How do I extract a single project from a monorepo while preserving git history?

Extracting a project from a monorepo while preserving git history requires using git-filter-repo to filter commits by the target path. This process validates remotes and branches before extraction to ensure a clean, production-ready repository split.

What is the best way to split a monorepo without losing commit history?

The best way to split a monorepo without losing commit history is using git-filter-repo for deterministic path-based extraction. This approach enforces clean state checks and remote availability validation to prevent unsafe splits during repository migration.

Do I need git-filter-repo to split a subproject into its own repository?

Yes, git-filter-repo is a required core dependency for splitting a subproject into its own repository. You also need git, jq, and curl installed to execute the extraction scripts and validate repository state before migration.

Can I rewrite committer and author information when extracting a subproject from a monorepo?

Yes, you can optionally rewrite committer and author information when extracting a subproject from a monorepo. The extraction scripts support optional identity rewriting alongside path-based history filtering using git-filter-repo.

How does branch validation work during repository migration from a monorepo?

Branch validation during monorepo repository migration checks for a clean working state and confirms remote availability before extracting a target path. This prevents unsafe splits by verifying the specified branch exists prior to running git-filter-repo.

What are the limitations of using a flexible extraction script for monorepo migration?

Flexible extraction scripts for monorepo migration bypass strict clean state checks using a force flag, risking the extraction of uncommitted changes. Strict extraction is recommended for production-ready splits to ensure complete history validation and safe team coordination.