feat: add multi-repo workspace support (sub_repos)#873
Open
skoduri-epic wants to merge 1 commit intogsd-build:mainfrom
Open
feat: add multi-repo workspace support (sub_repos)#873skoduri-epic wants to merge 1 commit intogsd-build:mainfrom
skoduri-epic wants to merge 1 commit intogsd-build:mainfrom
Conversation
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>
There was a problem hiding this comment.
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_reposto config defaults/template and load it vialoadConfig(). - 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_reposis extracted from theinit execute-phaseJSON, butbin/lib/init.cjscurrently does not includesub_reposin that payload. Either update the init output to includeconfig.sub_repos, or change the workflow to readplanning.sub_reposdirectly from.planning/config.json(e.g. viagsd-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_reposcoming from init context, butinit execute-phasedoes not currently returnsub_repos. Without that, the executor cannot reliably choose betweencommitvscommit-to-subrepo. Align by either addingsub_reposto 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_reposis extracted frominit execute-phaseJSON, butbin/lib/init.cjsdoesn't currently includesub_reposin that init result. Update the init payload or adjust the instructions to readplanning.sub_reposfrom 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_docsandplanning.sub_repos, but earlier in the same workflow the config example uses top-levelcommit_docs(not nested underplanning). BecauseloadConfig()prioritizes top-level keys over nested ones, a config that already has top-levelcommit_docs: truewill ignoreplanning.commit_docs: false, and planning docs may still be committed unexpectedly. To avoid that, keep the config shape consistent (prefer the nestedplanning.*structure used intemplates/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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_repossupport 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
/gsd:new-project, directories with their own.gitfolder are detected and offered for selection as sub-reposbackend/src/api/users.ts→backend/repo)commit-to-subrepo. File paths are made relative to the sub-repo root before staging.planning/is not committed — it acts as cross-repo coordinationConfiguration
In
.planning/config.json:{ "planning": { "commit_docs": false, "sub_repos": ["backend", "frontend", "shared"] } }When
sub_reposis empty (the default), everything works exactly as before — zero impact on existing single-repo workflows.Changes (8 files)
bin/lib/core.cjssub_reposto config loading defaults and returnbin/lib/commands.cjscmdCommitToSubrepo— groups files by prefix, strips prefixes, commits independentlybin/gsd-tools.cjscommit-to-subrepoCLI commandtemplates/config.jsonsub_repos: []in default templateworkflows/new-project.md.gitdirs during init, prompt for sub-repo selectionworkflows/execute-plan.mdcommit-to-subrepowhen configuredagents/gsd-executor.mdreferences/git-integration.mdTest Plan
config-get,frontmatter-cli)sub_reposis empty🤖 Generated with Claude Code