hermes

Plan a monorepo migration

Plans moving several repositories into a monorepo, covering history preservation, build tooling, CI, code ownership and a staged rollout. Use before consolidating repositories.

context

A monorepo pays off when code that changes together lives together: atomic cross-project changes, one dependency version per library, shared tooling. It costs build and CI work: without affected-only builds and caching, every pull request runs everything and the team blames the monorepo. Migrations fail when history is squashed and blame is lost, when CI is ported job by job without change detection, when release processes that assumed one repo per artifact break silently, and when everything moves in one weekend. A good plan checks the decision, moves one repository at a time and keeps the old repositories read-only until the new path is proven.

task

Plan the migration of these repositories:

repos

Only if [TOOLING] is given: Tooling preference:

  1. Decision check. In a few bullets, say whether the repositories share enough change, dependencies and ownership to justify a monorepo, and name any repository that should stay out (different access needs, open source with an external community, very large binaries, a separate compliance boundary). If the input lacks what you need to judge, say so.
  2. Target layout. A directory tree (apps/, packages/ or services/, libs/, tools/), naming conventions, and how internal dependencies are referenced (workspace protocol, path dependencies) instead of published versions.
  3. Tooling. Recommend the build tool from the languages, size and preference, with the reason and what it must provide: a project graph, affected-only builds and tests, local and remote caching, and task pipelines. Show the root configuration skeleton.
  4. History. Preserve history by importing each repository into its subdirectory (for example with git filter-repo --to-subdirectory-filter and a merge with --allow-unrelated-histories), keep or prefix tags, and handle large files and secrets found in history before import. Say how git log --follow and blame will work afterwards.
  5. CI and releases. Path-based or graph-based change detection, required checks per project, cache strategy, and a CI time budget. For releases: per-project versioning and tags, changelog generation, and how each artifact's existing release pipeline is pointed at its subdirectory.
  6. Ownership. CODEOWNERS per directory, branch protection, and review rules for shared libraries.
  7. Rollout. Order the repositories (start with the one with the fewest dependents or the most cross-repo changes, say which and why), a pilot, a freeze window per repository, the cutover steps, redirects (archive the old repository with a pointer in its README, move open pull requests and issues), and rollback while the old repository is still intact.
  8. Name risks with mitigation, and the metrics that show success (CI time per pull request, cross-project change lead time).
constraints
  • Commands that rewrite history only ever run on fresh clones; say so next to them. Never on the original repositories.
  • Do not recommend a tool feature you are not sure exists; describe the capability and say "check the tool's documentation".
  • Do not invent repository sizes, team names or dependency versions.
  • Keep each rollout step reversible until the old repository is archived.
  • Separate what you verified from what you inferred. Mark inferences as such.
  • When you do not know, say "I don't know" once and state what would settle it.
output format

Decision check

Bullets, ending with go, go with exclusions, or reconsider.

Target layout

A tree in a fenced block, plus conventions.

Tooling

Recommendation, reasons, root config skeleton.

History

Numbered commands per repository, with the fresh-clone warning.

CI and releases

Bullets and a pipeline sketch.

Ownership

A CODEOWNERS sketch and rules.

Rollout

A table: phase, repositories, steps, exit criteria, rollback.

Risks

A table: risk, likelihood, mitigation.

Open questions

Numbered.

1 required value still a placeholder; the assistant will ask for it.

details

kind
Prompt: a task you run by name to get one finished thing back
domain
Software engineering
category
Migration
level
Expert
made for
Tech lead / staff engineer, DevOps / platform engineer, Software architect, Engineering manager
risk
read-only
version
v1.0.0 · incubating
reviewed
2026-10-03
works in
Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Antigravity, OpenCode, Windsurf, Zed, Continue, AGENTS.md, ChatGPT, claude.ai

Edit on GitHubReport a problem

use in

Hodios CLI
npx @hermes-hq/hodios install plan-monorepo-migration --target claude-code
Agent Skills
npx skills add hermes-hq/hodios-dist --skill plan-monorepo-migration -a claude-code
Add the Hodios marketplace (once)
claude plugin marketplace add hermes-hq/hodios-dist
Install the software-engineering plugin
claude plugin install hodios-software-engineering@hodios

The plugin brings every entry in this domain at once.

pairs well with

All of Migration
PersonaDevOps

DevOps engineer

Acts as a DevOps engineer who automates the second time, keeps pipelines fast and reproducible, and makes every change reversible. Use for CI/CD, infrastructure and release work.

devops-engineer
PromptDevOps

Speed up a CI pipeline

Analyses a slow CI configuration and its job timings, then proposes caching, parallelism and test splitting with the minutes each change saves. Use when builds are slowing the team down.

speed-up-ci-pipeline
PromptGit and version control

Choose a branching strategy

Recommends a branching and release strategy such as trunk-based, GitHub flow or release branches for a team's size, cadence and environments, with rules, protections and migration steps.

choose-branching-strategy
PromptMigration

Plan an incremental migration

Plans a framework, platform or system migration as small reversible phases using the strangler fig pattern, with data strategy, verification and rollback per phase. Use instead of a big-bang rewrite.

plan-incremental-migration
PromptMigration

Migrate JavaScript to TypeScript

Plans and carries out an incremental JavaScript-to-TypeScript migration with config, file order, typed boundaries and a strictness ratchet. Use to move a JS codebase without a freeze.

migrate-javascript-to-typescript
PromptMigration

Upgrade a major dependency

Upgrades a library or framework across major versions using the official migration notes, fixes what breaks, and proves the result with before-and-after checks. Use for any breaking upgrade.

upgrade-major-dependency