jpskill.com
🛠️ 開発・MCP コミュニティ

when-managing-multiple-repos-use-github-multi-repo

Multi-repository coordination, synchronization, and architecture management with AI swarm orchestration. Coordinates repo-architect, code-analyzer, and coordinator agents across multiple repositories to maintain consistency, propagate changes, manage dependencies, and ensure architectural alignment. Handles monorepo-to-multi-repo migrations, cross-repo refactoring, and synchronized releases. Use when managing microservices, multi-package ecosystems, or coordinating changes across related repositories.

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o when-managing-multiple-repos-use-github-multi-repo.zip https://jpskill.com/download/18807.zip && unzip -o when-managing-multiple-repos-use-github-multi-repo.zip && rm when-managing-multiple-repos-use-github-multi-repo.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/18807.zip -OutFile "$d\when-managing-multiple-repos-use-github-multi-repo.zip"; Expand-Archive "$d\when-managing-multiple-repos-use-github-multi-repo.zip" -DestinationPath $d -Force; ri "$d\when-managing-multiple-repos-use-github-multi-repo.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して when-managing-multiple-repos-use-github-multi-repo.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → when-managing-multiple-repos-use-github-multi-repo フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-18
取得日時
2026-05-18
同梱ファイル
1

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

[スキル名] 複数のリポジトリを管理する際は GitHub Multi-Repo を使用する

GitHub Multi-Repository 管理スキル

概要

インテリジェントなエージェント連携により、複数の関連する GitHub リポジトリにわたる複雑な操作をオーケストレーションします。このスキルは、マイクロサービス、マルチパッケージエコシステム、分散システムアーキテクチャに対して、一貫したアーキテクチャの強制、同期された依存関係の更新、リポジトリ間のリファクタリング、および調整されたリリースを可能にします。

このスキルを使用するタイミング

マイクロサービスアーキテクチャを複数のリポジトリにまたがって管理する場合、フロントエンド/バックエンド/インフラストラクチャのリポジトリ間で変更を調整する場合、モノレポからマルチレポ構造に移行する場合、依存するリポジトリ全体に破壊的変更を伝播する場合、チーム間で一貫したコーディング標準を維持する場合、マルチパッケージシステムのリリースを同期する場合、または組織全体でアーキテクチャパターンを強制する場合に、このスキルをアクティブ化してください。

小規模な調整(2~5個のリポジトリ)から大規模なオーケストレーション(10個以上のリポジトリ)まで、一度限りの移行や継続的なメンテナンス、マルチレポエコシステムのガバナンス確立に利用できます。

エージェント連携アーキテクチャ

スウォームトポロジー

コーディネーターエージェントが専門のワーカーエージェントを管理する階層型トポロジーを初期化します。階層構造により、一貫性のための集中型意思決定が可能になり、専門的なタスクはエキスパートエージェントに委任されます。

# Initialize hierarchical swarm for multi-repo coordination
npx claude-flow@alpha swarm init --topology hierarchical --max-agents 8 --strategy adaptive

専門エージェントの役割

階層コーディネーター (hierarchical-coordinator): すべてのリポジトリのグローバルビューを維持し、アーキテクチャ上の決定を下し、リポジトリ間の操作を調整し、一貫性を確保するトップレベルのオーケストレーターです。マルチレポ戦略の単一の信頼できる情報源として機能します。

リポジトリアーキテクト (repo-architect): リポジトリ構造を分析し、アーキテクチャパターンを定義し、依存関係グラフを作成し、結合の問題を特定し、移行戦略を設計します。リポジトリ全体でアーキテクチャビジョンを維持します。

コードアナライザー (code-analyzer): コードベースをスキャンしてパターン、依存関係、不整合を検出します。リポジトリ間のコード重複を特定し、API契約を追跡し、アーキテクチャコンプライアンスを検証します。

CI/CDエンジニア (cicd-engineer): ビルドパイプライン、デプロイメントワークフロー、リリースオーケストレーションを管理します。リポジトリ間の継続的インテグレーションを調整し、バージョン管理戦略を処理します。

ワーカーエージェント (動的に生成): リファクタリング、テスト、ドキュメントの更新、依存関係のバンプなど、リポジトリ固有のタスクを実行します。ターゲットリポジトリの数に基づいてスケーリングされます。

マルチリポジトリワークフロー (SOP)

ワークフロー 1: リポジトリ間の変更伝播

破壊的変更、API更新、またはアーキテクチャパターンを複数のリポジトリに伝播します。

フェーズ 1: 影響分析

ステップ 1.1: 階層型連携の初期化

# Set up hierarchical swarm
mcp__claude-flow__swarm_init topology=hierarchical maxAgents=8 strategy=adaptive

# Spawn coordinator and specialists
mcp__claude-flow__agent_spawn type=coordinator name=hierarchical-coordinator
mcp__claude-flow__agent_spawn type=analyst name=repo-architect
mcp__claude-flow__agent_spawn type=analyst name=code-analyzer
mcp__claude-flow__agent_spawn type=coder name=cicd-engineer

ステップ 1.2: リポジトリの依存関係の分析

scripts/repo-graph.sh を使用して依存関係グラフを構築します。

# Generate dependency graph across all repositories
bash scripts/repo-graph.sh build-graph \
  --repos "repo1,repo2,repo3" \
  --output "references/dependency-graph.dot"

依存関係グラフを視覚化して影響範囲を特定します。

# Render graph visualization
dot -Tpng references/dependency-graph.dot -o dependency-graph.png

ステップ 1.3: 影響を受けるリポジトリの特定

コーディネーターを起動して影響を分析します。

Task("Hierarchical Coordinator", "
  Analyze the impact of <CHANGE_DESCRIPTION> across all repositories:

  1. Review dependency graph at references/dependency-graph.dot
  2. Identify direct dependents (repositories importing affected code)
  3. Identify transitive dependents (downstream consumers)
  4. Categorize changes by risk level (breaking/compatible/enhancement)
  5. Create propagation strategy with sequencing

  Store impact analysis in memory: multi-repo/impact-analysis
  Use scripts/repo-graph.sh for dependency traversal
  Run hooks: npx claude-flow@alpha hooks pre-task --description 'impact analysis'
", "hierarchical-coordinator")

フェーズ 2: 並行リポジトリ更新

影響を受けるすべてのリポジトリにわたって調整された更新を実行します。

ステップ 2.1: リポジトリごとにワーカーエージェントを生成

影響を受ける各リポジトリに対して、専用のワーカーエージェントを生成します。

Task("Worker: Repository 1", "
  Apply changes to repository <REPO_1>:

  1. Clone repository: bash scripts/multi-repo.sh clone <REPO_1>
  2. Create feature branch: change-propagation-<DATE>
  3. Apply code changes based on coordinator strategy
  4. Update tests to reflect new API contracts
  5. Validate build passes: npm test / cargo test
  6. Commit changes with standardized message
  7. Push branch and create draft PR

  Store results in memory: multi-repo/updates/<REPO_1>
  Run hooks for coordination
", "coder")

Task("Worker: Repository 2", "
  Apply changes to repository <REPO_2>:
  [Same steps as above, tailored to REPO_2]

  Store results in memory: multi-repo/updates/<REPO_2>
", "coder")

# Spawn additional workers for each repository
# All workers execute in parallel

ステップ 2.2: テスト実行の調整

すべてのワーカーが完了した後、リポジトリをまとめてテストします。

Task("CI/CD Engineer", "
  Validate changes across all repositories:

  1. Set up integration test environment
  2. Build all modified repositories in dependency order
  3. Run integration tests with new versions
  4. Check for breaking changes in API contracts
  5. Validate performance hasn
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

GitHub Multi-Repository Management Skill

Overview

Orchestrate complex operations across multiple related GitHub repositories with intelligent agent coordination. This skill enables consistent architecture enforcement, synchronized dependency updates, cross-repo refactoring, and coordinated releases for microservices, multi-package ecosystems, and distributed system architectures.

When to Use This Skill

Activate this skill when managing microservices architectures spanning multiple repositories, coordinating changes across frontend/backend/infrastructure repos, migrating from monorepo to multi-repo structure, propagating breaking changes across dependent repositories, maintaining consistent coding standards across teams, synchronizing releases for multi-package systems, or enforcing architectural patterns across an organization.

Use for both small-scale coordination (2-5 repos) and large-scale orchestration (10+ repositories), one-time migrations or ongoing maintenance, and establishing governance for multi-repo ecosystems.

Agent Coordination Architecture

Swarm Topology

Initialize a hierarchical topology with a coordinator agent managing specialized worker agents. Hierarchical structure enables centralized decision-making for consistency while delegating specialized tasks to expert agents.

# Initialize hierarchical swarm for multi-repo coordination
npx claude-flow@alpha swarm init --topology hierarchical --max-agents 8 --strategy adaptive

Specialized Agent Roles

Hierarchical Coordinator (hierarchical-coordinator): Top-level orchestrator that maintains global view of all repositories, makes architectural decisions, coordinates cross-repo operations, and ensures consistency. Acts as the single source of truth for multi-repo strategy.

Repository Architect (repo-architect): Analyzes repository structures, defines architectural patterns, creates dependency graphs, identifies coupling issues, and designs migration strategies. Maintains the architectural vision across repositories.

Code Analyzer (code-analyzer): Scans codebases for patterns, dependencies, and inconsistencies. Identifies code duplication across repos, tracks API contracts, and validates architectural compliance.

CI/CD Engineer (cicd-engineer): Manages build pipelines, deployment workflows, and release orchestration. Coordinates continuous integration across repositories and handles versioning strategies.

Worker Agents (spawned dynamically): Execute repository-specific tasks such as refactoring, testing, documentation updates, and dependency bumps. Scaled based on number of target repositories.

Multi-Repository Workflows (SOP)

Workflow 1: Cross-Repository Change Propagation

Propagate breaking changes, API updates, or architectural patterns across multiple repositories.

Phase 1: Impact Analysis

Step 1.1: Initialize Hierarchical Coordination

# Set up hierarchical swarm
mcp__claude-flow__swarm_init topology=hierarchical maxAgents=8 strategy=adaptive

# Spawn coordinator and specialists
mcp__claude-flow__agent_spawn type=coordinator name=hierarchical-coordinator
mcp__claude-flow__agent_spawn type=analyst name=repo-architect
mcp__claude-flow__agent_spawn type=analyst name=code-analyzer
mcp__claude-flow__agent_spawn type=coder name=cicd-engineer

Step 1.2: Analyze Repository Dependencies

Use scripts/repo-graph.sh to build dependency graph:

# Generate dependency graph across all repositories
bash scripts/repo-graph.sh build-graph \
  --repos "repo1,repo2,repo3" \
  --output "references/dependency-graph.dot"

Visualize the dependency graph to identify impact scope:

# Render graph visualization
dot -Tpng references/dependency-graph.dot -o dependency-graph.png

Step 1.3: Identify Affected Repositories

Launch coordinator to analyze impact:

Task("Hierarchical Coordinator", "
  Analyze the impact of <CHANGE_DESCRIPTION> across all repositories:

  1. Review dependency graph at references/dependency-graph.dot
  2. Identify direct dependents (repositories importing affected code)
  3. Identify transitive dependents (downstream consumers)
  4. Categorize changes by risk level (breaking/compatible/enhancement)
  5. Create propagation strategy with sequencing

  Store impact analysis in memory: multi-repo/impact-analysis
  Use scripts/repo-graph.sh for dependency traversal
  Run hooks: npx claude-flow@alpha hooks pre-task --description 'impact analysis'
", "hierarchical-coordinator")

Phase 2: Parallel Repository Updates

Execute coordinated updates across all affected repositories.

Step 2.1: Spawn Worker Agents per Repository

For each affected repository, spawn a dedicated worker agent:

Task("Worker: Repository 1", "
  Apply changes to repository <REPO_1>:

  1. Clone repository: bash scripts/multi-repo.sh clone <REPO_1>
  2. Create feature branch: change-propagation-<DATE>
  3. Apply code changes based on coordinator strategy
  4. Update tests to reflect new API contracts
  5. Validate build passes: npm test / cargo test
  6. Commit changes with standardized message
  7. Push branch and create draft PR

  Store results in memory: multi-repo/updates/<REPO_1>
  Run hooks for coordination
", "coder")

Task("Worker: Repository 2", "
  Apply changes to repository <REPO_2>:
  [Same steps as above, tailored to REPO_2]

  Store results in memory: multi-repo/updates/<REPO_2>
", "coder")

# Spawn additional workers for each repository
# All workers execute in parallel

Step 2.2: Coordinate Test Execution

After all workers complete, test repositories together:

Task("CI/CD Engineer", "
  Validate changes across all repositories:

  1. Set up integration test environment
  2. Build all modified repositories in dependency order
  3. Run integration tests with new versions
  4. Check for breaking changes in API contracts
  5. Validate performance hasn't degraded

  Use scripts/integration-test.sh for orchestration
  Store test results in memory: multi-repo/test-results
", "cicd-engineer")

Phase 3: Synchronized Release

Coordinate pull request creation and merging across repositories.

Step 3.1: Create Pull Requests

Generate PRs for all repositories simultaneously:

# Create PRs across all repos
bash scripts/multi-repo.sh create-prs \
  --repos "repo1,repo2,repo3" \
  --title "Propagate: <CHANGE_DESCRIPTION>" \
  --body-template "references/pr-template.md" \
  --labels "multi-repo-sync,automated"

Step 3.2: Coordinate Review and Merge

Track PR status and coordinate merging in dependency order:

Task("Hierarchical Coordinator", "
  Coordinate PR review and merge process:

  1. Monitor PR status using scripts/multi-repo.sh pr-status
  2. Ensure PRs are reviewed in dependency order
  3. Merge upstream dependencies first (libraries, shared code)
  4. Wait for CI to pass on each merge
  5. Merge downstream consumers after dependencies released
  6. Verify no build breaks in dependency chain

  Use scripts/multi-repo.sh merge-sequence for ordering
  Store merge sequence in memory: multi-repo/merge-plan
", "hierarchical-coordinator")

Step 3.3: Tag and Release

Create coordinated releases across repositories:

# Execute synchronized releases
bash scripts/multi-repo.sh synchronized-release \
  --repos "repo1,repo2,repo3" \
  --version-strategy "minor" \
  --release-notes-dir "references/release-notes"

Workflow 2: Monorepo to Multi-Repo Migration

Migrate a monolithic repository into multiple focused repositories while preserving history.

Phase 1: Architecture Planning

Step 1.1: Analyze Monorepo Structure

Task("Repository Architect", "
  Analyze monorepo structure and design migration strategy:

  1. Map directory structure and module boundaries
  2. Identify logical separation points (services, packages, layers)
  3. Analyze import/dependency patterns using scripts/analyze-deps.sh
  4. Detect circular dependencies that need refactoring
  5. Create proposed repository structure
  6. Design shared library strategy for common code

  Reference references/migration-best-practices.md
  Store architecture plan in memory: multi-repo/migration-plan
", "repo-architect")

Step 1.2: Generate Dependency Graph

Create comprehensive dependency visualization:

# Analyze monorepo dependencies
bash scripts/analyze-deps.sh \
  --monorepo-path <PATH> \
  --output references/monorepo-dependencies.json

# Generate split recommendations
bash scripts/repo-graph.sh recommend-split \
  --deps references/monorepo-dependencies.json \
  --output references/split-strategy.md

Phase 2: Repository Creation and History Preservation

Step 2.1: Create Target Repositories

# Create new repositories with proper structure
bash scripts/multi-repo.sh create-repos \
  --org <ORGANIZATION> \
  --repos-config references/new-repos.json \
  --template "references/repo-template"

Step 2.2: Extract Code with History

For each target repository, extract relevant code while preserving Git history:

# Extract subdirectory with full history
bash scripts/migration.sh extract-with-history \
  --source <MONOREPO_PATH> \
  --subdirectory <SUBDIR> \
  --target-repo <NEW_REPO> \
  --preserve-authors true

Step 2.3: Refactor Cross-Repository Dependencies

Task("Code Analyzer", "
  Refactor dependencies for multi-repo structure:

  1. Identify hard-coded paths that need updating
  2. Convert internal imports to package dependencies
  3. Extract shared code to common library repository
  4. Update build configurations for new structure
  5. Generate package.json / Cargo.toml with correct dependencies

  Use scripts/refactor-imports.sh for automated conversion
  Store refactoring changes in memory: multi-repo/refactoring
", "code-analyzer")

Phase 3: Validation and Cutover

Step 3.1: Parallel Build Validation

Ensure all new repositories build independently:

Task("CI/CD Engineer", "
  Validate all new repositories build and test successfully:

  1. Set up CI pipelines for each new repository
  2. Configure dependency resolution (npm registry, cargo)
  3. Run full test suites in each repository
  4. Validate integration between repositories
  5. Compare test results with monorepo baseline

  Use scripts/validate-migration.sh
  Store validation results in memory: multi-repo/validation
", "cicd-engineer")

Step 3.2: Gradual Migration Plan

Create phased cutover strategy:

# Generate migration timeline
bash scripts/migration.sh create-timeline \
  --repos references/new-repos.json \
  --risk-assessment references/risk-analysis.md \
  --output references/migration-timeline.md

Workflow 3: Architectural Pattern Enforcement

Ensure consistent architectural patterns across all repositories.

Phase 1: Pattern Definition

Step 1.1: Define Architectural Standards

Create comprehensive architecture documentation in references/architecture-standards.md covering:

  • Directory structure conventions
  • Module organization patterns
  • API design guidelines
  • Testing strategies
  • Documentation requirements
  • CI/CD pipeline standards

Step 1.2: Create Enforcement Rules

Define linting rules and validation checks in references/enforcement-rules.json:

  • Static analysis rules
  • Dependency policy (allowed/forbidden packages)
  • File naming conventions
  • Code complexity thresholds
  • Test coverage minimums

Phase 2: Compliance Scanning

Step 2.1: Scan All Repositories

Task("Code Analyzer", "
  Scan all repositories for architectural compliance:

  1. Clone all repositories: bash scripts/multi-repo.sh clone-all
  2. Run architectural linting: bash scripts/arch-lint.sh --config references/enforcement-rules.json
  3. Generate compliance report for each repository
  4. Identify violations by severity (critical/high/medium/low)
  5. Create prioritized remediation plan

  Store compliance reports in memory: multi-repo/compliance
", "code-analyzer")

Step 2.2: Automated Remediation

For common violations, generate automated fixes:

# Apply automated fixes where safe
bash scripts/auto-fix-violations.sh \
  --repos-dir <CLONED_REPOS> \
  --rules references/enforcement-rules.json \
  --create-prs true

Phase 3: Continuous Monitoring

Step 3.1: Set Up Compliance Tracking

# Create dashboard for ongoing monitoring
bash scripts/compliance-dashboard.sh setup \
  --repos references/repo-list.txt \
  --rules references/enforcement-rules.json \
  --output-dir compliance-dashboard

Step 3.2: Automated Alerts

Configure alerts for architectural violations:

# Set up GitHub Actions for compliance checks
bash scripts/setup-compliance-ci.sh \
  --repos references/repo-list.txt \
  --workflow-template references/compliance-workflow.yml

MCP Tool Integration

Repository Analysis

# Analyze each repository's structure and quality
mcp__flow-nexus__github_repo_analyze repo=<owner/repo1> analysis_type=code_quality
mcp__flow-nexus__github_repo_analyze repo=<owner/repo2> analysis_type=performance
mcp__flow-nexus__github_repo_analyze repo=<owner/repo3> analysis_type=security

Swarm Orchestration

# Monitor multi-repo operation progress
mcp__claude-flow__swarm_status verbose=true

# Track task completion across repositories
mcp__claude-flow__task_status detailed=true

# Get performance metrics
mcp__claude-flow__agent_metrics metric=performance

Best Practices

Hierarchical Coordination: Always use a single coordinator agent to maintain consistency and make global decisions. Worker agents handle repository-specific tasks but report to coordinator.

Dependency-Order Execution: Respect dependency graphs when applying changes. Update upstream dependencies before downstream consumers to avoid build breaks.

Atomic Operations: Group related changes across repositories into single coordinated operations. Use draft PRs and synchronized merges to maintain atomicity.

History Preservation: When migrating or refactoring, preserve Git history. Use git filter-branch or git subtree to maintain commit provenance.

Testing Integration: Always test repositories together after multi-repo changes. Individual repository tests may pass while integration fails.

Rollback Strategy: Maintain ability to rollback changes across all repositories. Use Git tags and release branches to enable coordinated rollback.

Communication: Keep stakeholders informed of multi-repo operations. Use consistent PR descriptions, labels, and commit messages across repositories.

Error Handling

Partial Failure Recovery: If some repositories update successfully while others fail, coordinate rollback or forward-fix strategy based on dependency relationships.

Merge Conflict Resolution: For cross-repo conflicts, use coordinator to determine resolution strategy. Prioritize maintaining API contracts and build stability.

Network Failures: Implement retry logic with exponential backoff for GitHub API calls. Cache repository metadata to reduce API dependencies.

Circular Dependency Detection: If circular dependencies detected during analysis, coordinator must create refactoring plan to break cycles before migration proceeds.

References

  • references/architecture-standards.md - Organizational architecture patterns
  • references/enforcement-rules.json - Automated compliance rules
  • references/migration-best-practices.md - Repository migration guidelines
  • references/pr-template.md - Standardized PR description template
  • references/repo-template/ - Template structure for new repositories
  • scripts/multi-repo.sh - Multi-repository operation utilities
  • scripts/repo-graph.sh - Dependency graph analysis
  • scripts/migration.sh - Monorepo migration tools
  • scripts/analyze-deps.sh - Dependency analysis
  • scripts/arch-lint.sh - Architectural linting
  • scripts/integration-test.sh - Cross-repo integration testing