Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

How I Merged 6 Repos Into One Monorepo With Claude Code Without Breaking CI

Описание и применение

Пять репозиториев с сервисами объединены в монорепозиторий, сохраняя историю git, упрощая CI и устраняя дублирование кода. Использованы git filter-repo, GitHub Actions, Turborepo и Claude Code.

Задача

Six independent service repos caused duplicated code, version drift, and slow cross‑cutting changes, making maintenance hard and leading to a production incident.

Результат

Merged six repos into a single monorepo while preserving git history, reduced median CI time from 11 to 7 minutes, achieved a 70% Turborepo cache hit rate, and eliminated duplicated utilities.

Рабочий процесс

  • 1. Rewrite each repo’s history to a subdirectory with git filter‑repo and merge into monorepo using --allow-unrelated-histories.
  • 2. Verify merge integrity with blame survival, commit count, and tree diff checks.
  • 3. Consolidate CI: generate a unified workflow with path filtering driven by Turborepo’s dependency graph, ensuring only affected packages run.
  • 4. Deduplicate utilities: inventory all copies, identify equivalent ones, promote them to packages/shared-utils, rewrite imports, and leave divergent copies with explanatory comments.
  • 5. Set a hard cutover date, archive old repos, and enforce the new monorepo workflow.

Доказательства

The merge itself was the easy part. The real work was CI and the shared code — and an AI agent turned out to be great at one of those and dangerous at the other.

Источник

I had Claude Code write a script that did this for all six repos and then verify the result — and the verification is the part I'd tell you to steal.

Источник

The fix is path-filtered jobs driven by Turborepo's dependency graph.

Источник

  • Дата записи: 2026-09-10T08:18:54.820Z