repo-management
Manage git repositories across teams using repo-manager.sh. Use when syncing repos, checking repo status, creating branches, or when user mentions 'repo sync', 'repo status', 'clone repos', 'setup rep
SKILL.md.claude/skills/repo-management/SKILL.md
GitHubRepository Management
Setup
Before starting: check .handoff/sessions/ for active sessions, read context status.yaml, run git status. Follow .rules/universal.md (Plan -> Approve -> Execute).
Wrapper for scripts/repo-manager.sh to manage git repositories across teams.
Commands
/repo setup {team|--all}- Clone all repos for a team/repo sync {team|--all}- Pull latest changes/repo status {team|--all}- Check repo status/repo verify {team|--all}- Verify repos are cloned/repo list {team|--all}- List repos for team/repo teams- List all teams/repo branch {team} {type/name}- Create branch across repos/repo merge {team}- Merge current to active branch/repo cleanup {team} [--dry-run] [--remote]- Delete merged branches
Branch Strategy
All teams use develop as active branch, main/master is production-only.
Full SOP: docs/system/sops/branch-strategy.md
The sync command automatically enforces this: repos on main/master get switched to develop.
The status command shows [WARN: should be on develop] for repos on the wrong branch.
Available Contexts
Contexts are defined in pos.yaml under the contexts: key. Run /repo teams to list all registered contexts with repositories.
Process
Execute Command
All commands execute the repo-manager.sh script:
scripts/repo-manager.sh {command} {args}
/repo setup {team}
Clones all repositories for a team from the platform registry.
./scripts/repo-manager.sh setup {team}
# Or for all teams:
./scripts/repo-manager.sh setup --all
What it does:
- Reads platform-registry.yaml for team repos
- Clones each repo to
{teams_dir}/{team}/repos/ - Checks out the active branch (if different from default)
- Reports success/failure for each repo
/repo sync {team}
Pulls latest changes for all team repos.
./scripts/repo-manager.sh sync {team}
What it does:
- For each repo in team
git fetch --all --prunegit pull(if on tracking branch)- Reports ahead/behind status
/repo status {team}
Shows git status for all team repos.
./scripts/repo-manager.sh status {team}
Output includes:
- Current branch
- Uncommitted changes count
- Ahead/behind remote count
- Last commit message
/repo branch {team} {type/name}
Creates a branch across ALL team repos.
./scripts/repo-manager.sh branch {team} feature/my-feature
Branch types:
feature/- New featuresfix/- Bug fixeschore/- Maintenancehotfix/- Urgent fixesrelease/- Release prep
/repo merge {team}
Merges current branch back to active branch.
./scripts/repo-manager.sh merge {team}
/repo cleanup {team}
Deletes merged branches.
# Preview deletions
./scripts/repo-manager.sh cleanup {team} --dry-run
# Delete local branches
./scripts/repo-manager.sh cleanup {team}
# Delete local AND remote branches
./scripts/repo-manager.sh cleanup {team} --remote
Registry Reference
Repos are defined in the platform registry file referenced by scripts/repo-manager.sh. Each context lists its repositories, default branch, and active branch.
contexts:
my-project:
default_branch: main # Production branch (protected)
active_branch: develop # Development branch (all work here)
repos:
- name: my-project-core
- name: my-project-api
Examples
# Clone all repos for a context
/repo setup my-project
# Sync all contexts
/repo sync --all
# Check repo status for a context
/repo status my-project
# Create feature branch across a context
/repo branch my-project feature/add-webhooks
# Clean up merged branches (preview)
/repo cleanup my-project --dry-run
Notes
- Registry file: referenced by
scripts/repo-manager.sh(configurable per installation) - Branch strategy:
docs/system/sops/branch-strategy.md - Script location:
scripts/repo-manager.sh - Repos are cloned to:
contexts/{context}/projects/ - Supports SSH and HTTPS cloning
- Supports both GitLab and GitHub
Self-Assessment (Internal)
Rate this skill execution 0-10. If < 8, write feedback to .handoff/feedback/{date}-{skill-name}.yaml with: skill, rating, friction, suggestion, context. Do not mention to user.