Skip to content

[Extension]: Add Multi-Repo Branch Sync (multi-repo-sync) #3406

Description

@sebastienthibaud

Extension ID

multi-repo-sync

Extension Name

Multi-Repo Branch Sync

Version

1.0.0

Description

Creates the feature branch in affected sub-repositories and git submodules via plan/tasks hooks

Author

Fyloss

Repository URL

https://github.com/fyloss/spec-kit-multi-repo-sync

Download URL

https://github.com/fyloss/spec-kit-multi-repo-sync/releases/download/v1.0.0/spec-kit-multi-repo-sync.zip

License

MIT

Homepage (optional)

https://github.com/fyloss/spec-kit-multi-repo-sync

Documentation URL (optional)

https://github.com/fyloss/spec-kit-multi-repo-sync/blob/main/README.md

Changelog URL (optional)

https://github.com/fyloss/spec-kit-multi-repo-sync/blob/main/CHANGELOG.md

Required Spec Kit Version

=0.2.0

Required Tools (optional)

- git (>=2.31) - required

Number of Commands

3

Number of Hooks (optional)

2

Tags

git, branching, multi-repo, submodules, workflow

Key Features

  • Two-phase flow hooked into the native lifecycle: after_plan discovers sub-repositories and records the affected ones in an "Affected Repositories" table in plan.md; after_tasks creates the feature branch in exactly those repositories
  • No core command is overridden — hooks are namespaced and survive specify self upgrade
  • Three detection modes: auto, submodule (parsed from .gitmodules), and independent (nested .git scan honouring git check-ignore)
  • Idempotent branch creation with per-target failure isolation (dirty tree, unborn HEAD, uninitialized submodule, non-repo) — warnings never abort the native run
  • Uninitialized submodules are automatically initialized before branching
  • Hardened git wrapper for untrusted sub-repositories: neutralizes core.hooksPath, core.fsmonitor, and content-filter drivers before touching a cloned repo
  • Read-only /speckit.multi-repo-sync.status report and --dry-run support on sync
  • Cross-platform: equivalent Bash and PowerShell implementations (PowerShell 5.1+ supported)

Testing Checklist

  • Extension installs successfully via download URL
  • All commands execute without errors
  • Documentation is complete and accurate
  • No security vulnerabilities identified
  • Tested on at least one real project

Submission Requirements

  • Valid extension.yml manifest included
  • README.md with installation and usage instructions
  • LICENSE file included
  • GitHub release created with version tag
  • All command files exist and are properly formatted
  • Extension ID follows naming conventions (lowercase-with-hyphens)

Testing Details

Tested on:

  • macOS 26 (Tahoe) with Spec Kit v0.12.5 (local)
  • CI matrix: Bash suite on ubuntu-latest + macos-latest; PowerShell suite on ubuntu-latest + windows-latest

CI quality gates (run on every PR and push to main):
ShellCheck, PSScriptAnalyzer, extension.yml schema validation, and both automated test harnesses (tests/test-bash.sh, tests/test-powershell.ps1) covering detection modes, idempotency, dirty trees, uninitialized submodules, --targets filtering, branch-name validation, and path-safety guards.

Test scenarios:

  1. Installed the extension in a fresh project from the published release asset URL (specify extension add multi-repo-sync --from <download_url>) — all 18 files land in .specify/extensions/multi-repo-sync/ and the 3 commands are registered
  2. Ran analyze / sync / status against submodule-based and independent-repo layouts
  3. Verified idempotency (second sync reports exists) and single-repo projects report "nothing to do"

Example Usage

# Install extension
specify extension add multi-repo-sync --from https://github.com/fyloss/spec-kit-multi-repo-sync/releases/download/v1.0.0/spec-kit-multi-repo-sync.zip

# The two-phase flow then runs automatically:
#   /speckit.plan  -> after_plan hook records affected sub-repos in plan.md
#   /speckit.tasks -> after_tasks hook creates the feature branch in those repos

# Manual commands
/speckit.multi-repo-sync.status
/speckit.multi-repo-sync.sync --dry-run

Proposed Catalog Entry

{
  "multi-repo-sync": {
    "name": "Multi-Repo Branch Sync",
    "id": "multi-repo-sync",
    "description": "Creates the feature branch in affected sub-repositories and git submodules via plan/tasks hooks",
    "author": "Fyloss",
    "version": "1.0.0",
    "download_url": "https://github.com/fyloss/spec-kit-multi-repo-sync/releases/download/v1.0.0/spec-kit-multi-repo-sync.zip",
    "sha256": "12a5c7392145b4424b20715aaa3d8b6a8218c143dea596873e344146c1a76ba0",
    "repository": "https://github.com/fyloss/spec-kit-multi-repo-sync",
    "homepage": "https://github.com/fyloss/spec-kit-multi-repo-sync",
    "documentation": "https://github.com/fyloss/spec-kit-multi-repo-sync/blob/main/README.md",
    "changelog": "https://github.com/fyloss/spec-kit-multi-repo-sync/blob/main/CHANGELOG.md",
    "license": "MIT",
    "requires": {
      "speckit_version": ">=0.2.0",
      "tools": [
        { "name": "git", "version": ">=2.31", "required": true }
      ]
    },
    "provides": {
      "commands": 3,
      "hooks": 2
    },
    "tags": ["git", "branching", "multi-repo", "submodules", "workflow"],
    "verified": false,
    "downloads": 0,
    "stars": 0,
    "created_at": "2026-07-06T14:04:59Z",
    "updated_at": "2026-07-08T00:00:00Z"
  }
}

Additional Context

This extension is a hook-based, upgrade-safe alternative to the community preset spec-kit-preset-multi-repo-branching: it mirrors the preset's two-phase behaviour (discover in plan, branch in tasks) without overriding any core command, so specify self upgrade never touches it. A migration guide from the preset is included in the README.

The release asset is a filtered archive (dev-only files such as tests/ and CI config are excluded via .extensionignore). SHA-256 of the asset: 12a5c7392145b4424b20715aaa3d8b6a8218c143dea596873e344146c1a76ba0.

Security note: all git invocations inside sub-repositories go through a hardened wrapper that disables repo-local hooks, fsmonitor, and content-filter drivers, so a cloned malicious sub-repository cannot execute code during branch creation/switching (this is why git >= 2.31 is required).

Metadata

Metadata

Assignees

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions