| name | repo-add |
| description | Add repositories to a Mega Repo by cloning into `sources/` with an optional target path. Use when the user asks for `/repo-add`, asks to add/clone/import a repo into this Mega Repo, or needs to bootstrap local cross-repo context quickly. |
Repo Add
Overview
Clone a repository URL or local git path into sources/ with one command.
Use scripts/add.sh to keep the workflow predictable and low-friction.
Quick Start
scripts/add.sh <repo-url-or-path> [target-name]
Examples:
scripts/add.sh https://github.com/org/service-a.git
scripts/add.sh git@github.com:org/service-a.git org/service-a
scripts/add.sh ../local-repo sandbox/local-repo
Workflow
- Get the repository URL/path and optional destination name from the user.
- Run
scripts/add.sh <repo-url-or-path> [target-name].
- Report the cloned path under
sources/.
Behavior
- Detect Mega Repo root by finding parent directories that contain both
sources/ and worktrees/.
- Clone into
sources/<target-name>.
- Support nested relative target names like
org/repo.
- Reject absolute paths and
.. in target names.
- Derive target name from repo URL/path when omitted (
service-a.git -> service-a).
- Fail fast if destination already exists.