Repository Strategy
Purpose
Decide the repository shape for the project's applications — one app repo, a monorepo of several, or separate repos — from real coupling and team factors, so the layout serves development instead of fighting it. Complements the core ../../repository-architecture (on-disk layout) with the repo-boundary decision.
When to Use
- After applications are selected (
../../application-selection), before scaffolding structure.
- When restructuring how existing apps are split across repos.
- Not after the layout is decided and stable.
Inputs
- Selected applications (web, dashboard, mobile, backend, shared packages).
- Shared-code needs, team boundaries, release cadences, existing repos.
Discovery Questions
- How many applications, and how much code do they genuinely share (types, contracts, utilities)?
- Are they released together or independently (cadence coupling)?
- Who owns each — one team or several with separate workflows?
- Is there existing tooling/CI that favors one shape?
Responsibilities
- Evaluate the options against coupling, not fashion:
- Single repo (one app) — one application, no sharing: simplest, default when there's genuinely one thing.
- Monorepo (multiple apps + shared packages) — apps that share code (API contracts/types between backend and clients), release in coordination, or benefit from one CI/tooling surface; needs a workspace tool (
monorepo-selection).
- Multiple repos — apps with independent ownership, cadence, and little shared code, or hard access/security boundaries.
- Weigh trade-offs explicitly: monorepo eases sharing + atomic cross-app changes but needs tooling discipline (caching, affected-only CI); multi-repo isolates but duplicates config and complicates shared-contract changes.
- Record the decision and what would flip it; hand off to
monorepo-selection if monorepo, else to ../../repository-architecture for the single/multi layout.
Required Workflow
- Inventory apps, shared code, cadences, ownership.
- Match against single / monorepo / multi-repo.
- Record the decision + trade-offs + flip conditions (Gate 2 where it affects stack/tooling).
- Hand off to
monorepo-selection or ../../repository-architecture.
Decision Rules
- Shared code + coordinated release + shared tooling → monorepo; independent everything → separate repos; one app → one repo.
- Don't adopt a monorepo (and its tooling cost) for a single app "to be ready."
- Don't split tightly-coupled apps that share contracts into separate repos — cross-repo contract changes become painful.
- Team ownership boundaries are a legitimate reason to split even shared-code apps — record it.
Rules
- The decision is recorded and tied to the app inventory.
- Repository/tooling choices that affect the stack need approval (
../../stack-recommendation, Gate 2).
- No scaffolding here — decision only.
Anti-Patterns
- Monorepo-by-default for one application.
- Multi-repo for apps that share an evolving API contract.
- Choosing the shape before knowing the apps and their coupling.
- Copying another project's repo shape without checking fit.
Validation Checklist
Definition of Done
A recorded repository-shape decision — single, monorepo, or multi-repo — justified by coupling, cadence, and ownership, with trade-offs noted and the next skill selected.
Related Skills
monorepo-selection, ../../repository-architecture, ../../application-selection, ../../stack-recommendation, turborepo-foundation, pnpm-workspaces, npm-workspaces, ci-cd.
Related Knowledge
../../../knowledge/ (team boundaries, release cadences).
Related References
../../../references/devops/ (repo-shape notes, when populated).
Context Loading Guidance
- Requires: app inventory, shared-code + ownership + cadence summary.
- Does not require: tooling internals, app source.
- May load:
monorepo-selection (if monorepo), ../../repository-architecture.
- Stop when: the repo-shape decision is recorded.
Token Efficiency Guidance
The app × (shared code, cadence, owner) table drives the decision; keep it to the deciding factors.
1---2name: repository-strategy3description: Use to decide how a project's applications are organized into repositories — single repo, monorepo, or multiple repos — based on shared code, coupling, team boundaries, and release cadence. A decision, not a default; feeds monorepo-selection when a monorepo is chosen.4---56# Repository Strategy78## Purpose910Decide the **repository shape** for the project's applications — one app repo, a monorepo of several, or separate repos — from real coupling and team factors, so the layout serves development instead of fighting it. Complements the core `../../repository-architecture` (on-disk layout) with the repo-boundary decision.1112## When to Use1314- After applications are selected (`../../application-selection`), before scaffolding structure.15- When restructuring how existing apps are split across repos.16- **Not** after the layout is decided and stable.1718## Inputs1920- Selected applications (web, dashboard, mobile, backend, shared packages).21- Shared-code needs, team boundaries, release cadences, existing repos.2223## Discovery Questions2425- How many applications, and how much code do they genuinely **share** (types, contracts, utilities)?26- Are they **released together** or independently (cadence coupling)?27- Who owns each — one team or several with separate workflows?28- Is there existing tooling/CI that favors one shape?2930## Responsibilities3132- Evaluate the options against coupling, not fashion:33 - **Single repo (one app)** — one application, no sharing: simplest, default when there's genuinely one thing.34 - **Monorepo (multiple apps + shared packages)** — apps that **share code** (API contracts/types between backend and clients), release in coordination, or benefit from one CI/tooling surface; needs a workspace tool (`monorepo-selection`).35 - **Multiple repos** — apps with **independent ownership, cadence, and little shared code**, or hard access/security boundaries.36- Weigh trade-offs explicitly: monorepo eases sharing + atomic cross-app changes but needs tooling discipline (caching, affected-only CI); multi-repo isolates but duplicates config and complicates shared-contract changes.37- Record the decision and what would flip it; hand off to `monorepo-selection` if monorepo, else to `../../repository-architecture` for the single/multi layout.3839## Required Workflow40411. Inventory apps, shared code, cadences, ownership.422. Match against single / monorepo / multi-repo.433. Record the decision + trade-offs + flip conditions (Gate 2 where it affects stack/tooling).444. Hand off to `monorepo-selection` or `../../repository-architecture`.4546## Decision Rules4748- Shared code + coordinated release + shared tooling → monorepo; independent everything → separate repos; one app → one repo.49- Don't adopt a monorepo (and its tooling cost) for a single app "to be ready."50- Don't split tightly-coupled apps that share contracts into separate repos — cross-repo contract changes become painful.51- Team ownership boundaries are a legitimate reason to split even shared-code apps — record it.5253## Rules5455- The decision is recorded and tied to the app inventory.56- Repository/tooling choices that affect the stack need approval (`../../stack-recommendation`, Gate 2).57- No scaffolding here — decision only.5859## Anti-Patterns6061- Monorepo-by-default for one application.62- Multi-repo for apps that share an evolving API contract.63- Choosing the shape before knowing the apps and their coupling.64- Copying another project's repo shape without checking fit.6566## Validation Checklist6768- [ ] Apps, shared code, cadences, ownership inventoried.69- [ ] Option chosen against real coupling.70- [ ] Trade-offs + flip conditions recorded.71- [ ] Handed to `monorepo-selection` or `../../repository-architecture`.7273## Definition of Done7475A recorded repository-shape decision — single, monorepo, or multi-repo — justified by coupling, cadence, and ownership, with trade-offs noted and the next skill selected.7677## Related Skills7879`monorepo-selection`, `../../repository-architecture`, `../../application-selection`, `../../stack-recommendation`, `turborepo-foundation`, `pnpm-workspaces`, `npm-workspaces`, `ci-cd`.8081## Related Knowledge8283`../../../knowledge/` (team boundaries, release cadences).8485## Related References8687`../../../references/devops/` (repo-shape notes, when populated).8889## Context Loading Guidance9091- **Requires:** app inventory, shared-code + ownership + cadence summary.92- **Does not require:** tooling internals, app source.93- **May load:** `monorepo-selection` (if monorepo), `../../repository-architecture`.94- **Stop when:** the repo-shape decision is recorded.9596## Token Efficiency Guidance9798The app × (shared code, cadence, owner) table drives the decision; keep it to the deciding factors.