Skip to content

feat: add multi-repo workspace support (sub_repos)#873

Open
skoduri-epic wants to merge 1 commit intogsd-build:mainfrom
skoduri-epic:feat/multi-repo-workspace
Open

feat: add multi-repo workspace support (sub_repos)#873
skoduri-epic wants to merge 1 commit intogsd-build:mainfrom
skoduri-epic:feat/multi-repo-workspace

Conversation

@skoduri-epic
Copy link

Thank You & Purpose

First off — thank you for building GSD! It's been an incredible tool for structuring AI-driven development workflows, and I've been using it extensively.

I'm proposing this feature because I work with multi-repo workspaces — projects where the backend, frontend, and shared libraries each live in their own git repositories. GSD's planning and execution flow is perfect for coordinating work across these repos, but the commit routing assumes a single git root. This PR adds optional sub_repos support so GSD can handle these workspaces natively.

What This Does

Adds support for workspaces with multiple independent git repositories (e.g., separate backend/, frontend/, shared/ repos). When configured, GSD routes commits to the correct sub-repo based on file path prefixes.

How It Works

  1. Auto-detection: During /gsd:new-project, directories with their own .git folder are detected and offered for selection as sub-repos
  2. File grouping: Code files are grouped by their sub-repo prefix (e.g., backend/src/api/users.tsbackend/ repo)
  3. Independent commits: Each sub-repo gets its own atomic commit via commit-to-subrepo. File paths are made relative to the sub-repo root before staging
  4. Planning stays local: .planning/ is not committed — it acts as cross-repo coordination

Configuration

In .planning/config.json:

{
  "planning": {
    "commit_docs": false,
    "sub_repos": ["backend", "frontend", "shared"]
  }
}

When sub_repos is empty (the default), everything works exactly as before — zero impact on existing single-repo workflows.

Changes (8 files)

File Change
bin/lib/core.cjs Add sub_repos to config loading defaults and return
bin/lib/commands.cjs Add cmdCommitToSubrepo — groups files by prefix, strips prefixes, commits independently
bin/gsd-tools.cjs Add commit-to-subrepo CLI command
templates/config.json Include sub_repos: [] in default template
workflows/new-project.md Auto-detect .git dirs during init, prompt for sub-repo selection
workflows/execute-plan.md Route task commits through commit-to-subrepo when configured
agents/gsd-executor.md Update commit protocol for multi-repo workspaces
references/git-integration.md Document sub_repos config and behavior

Test Plan

  • All existing tests pass (pre-existing upstream failures only — config-get, frontmatter-cli)
  • Default behavior unchanged when sub_repos is empty
  • Changes are concentrated and non-invasive — no existing code paths modified for single-repo workflows

🤖 Generated with Claude Code

Add support for workspaces with multiple independent git repositories
(e.g., separate backend/, frontend/, shared/ repos). GSD can now route
commits to the correct sub-repo based on file path prefixes.

Changes:
- core.cjs: Add sub_repos to config loading defaults and return
- commands.cjs: Add cmdCommitToSubrepo - groups files by sub-repo
  prefix, strips prefixes, stages and commits to each repo independently
- gsd-tools.cjs: Add commit-to-subrepo CLI command
- templates/config.json: Include sub_repos in default config template
- new-project.md: Auto-detect .git directories during project init,
  prompt user to select sub-repos, configure commit_docs accordingly
- execute-plan.md: Route task commits through commit-to-subrepo when
  sub_repos is configured
- gsd-executor.md: Update commit protocol to use commit-to-subrepo
  for multi-repo workspaces
- git-integration.md: Document sub_repos configuration and behavior

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings March 2, 2026 23:25
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds optional multi-repo workspace support by introducing planning.sub_repos and a new commit routing command that commits changes into the correct nested git repository based on path prefixes.

Changes:

  • Add planning.sub_repos to config defaults/template and load it via loadConfig().
  • Introduce gsd-tools.cjs commit-to-subrepo / cmdCommitToSubrepo() to group files by sub-repo prefix and commit per repo.
  • Update execution/new-project workflows and documentation to describe sub-repo detection and the new commit flow.

Reviewed changes

Copilot reviewed 5 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
get-shit-done/workflows/new-project.md Documents sub-repo detection and config updates during project init.
get-shit-done/workflows/execute-plan.md Documents routing task commits via commit-to-subrepo when sub_repos is configured.
get-shit-done/templates/config.json Adds planning.sub_repos: [] to the default config template.
get-shit-done/references/git-integration.md Documents sub_repos behavior and the commit-to-subrepo command.
get-shit-done/bin/lib/core.cjs Adds sub_repos default and loads planning.sub_repos into the flattened config.
get-shit-done/bin/lib/commands.cjs Implements cmdCommitToSubrepo() and exports it.
get-shit-done/bin/gsd-tools.cjs Adds the commit-to-subrepo CLI command routing to cmdCommitToSubrepo().
agents/gsd-executor.md Updates executor commit protocol to use commit-to-subrepo in sub-repo mode.
Comments suppressed due to low confidence (4)

get-shit-done/workflows/execute-plan.md:22

  • This workflow says sub_repos is extracted from the init execute-phase JSON, but bin/lib/init.cjs currently does not include sub_repos in that payload. Either update the init output to include config.sub_repos, or change the workflow to read planning.sub_repos directly from .planning/config.json (e.g. via gsd-tools config-get) before deciding which commit flow to use.
Extract from init JSON: `executor_model`, `commit_docs`, `sub_repos`, `phase_dir`, `phase_number`, `plans`, `summaries`, `incomplete_plans`, `state_path`, `config_path`.

get-shit-done/workflows/execute-plan.md:258

  • The commit protocol here depends on sub_repos coming from init context, but init execute-phase does not currently return sub_repos. Without that, the executor cannot reliably choose between commit vs commit-to-subrepo. Align by either adding sub_repos to the init JSON or documenting how the executor should fetch it from config.
<sub_repos_commit_flow>
**Sub-repos mode:** If `sub_repos` is configured (non-empty array from init context), use `commit-to-subrepo` instead of standard git commit. This routes files to their correct sub-repo based on path prefix.

agents/gsd-executor.md:44

  • This agent doc says sub_repos is extracted from init execute-phase JSON, but bin/lib/init.cjs doesn't currently include sub_repos in that init result. Update the init payload or adjust the instructions to read planning.sub_repos from config so the agent can correctly select the commit flow.
Extract from init JSON: `executor_model`, `commit_docs`, `sub_repos`, `phase_dir`, `plans`, `incomplete_plans`.

get-shit-done/workflows/new-project.md:522

  • In this section you set planning.commit_docs and planning.sub_repos, but earlier in the same workflow the config example uses top-level commit_docs (not nested under planning). Because loadConfig() prioritizes top-level keys over nested ones, a config that already has top-level commit_docs: true will ignore planning.commit_docs: false, and planning docs may still be committed unexpectedly. To avoid that, keep the config shape consistent (prefer the nested planning.* structure used in templates/config.json) or ensure you update/clear the top-level keys as well.
**If user selects one or more directories:**
- Set `planning.sub_repos` in config.json to the selected directory names array (e.g., `["backend", "frontend"]`)
- Auto-set `planning.commit_docs` to `false` (planning docs stay local in multi-repo workspaces)
- Add `.planning/` to `.gitignore` if not already present

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants