feat(workspace): add multi-repository workspace support
Summary
Add workspace mode for managing specifications across multiple repositories (monorepos, separate frontend/backend repos, etc.).
Features
openspec init --workspace- Interactive workspace initialization with automatic repo discoveryopenspec validate --workspace- Validate workspace structure and cross-repo change conventionsworkspace.yamlschema with Zod validation for configuration- Cross-repo change validation (Impact section, implementation order requirements)
- AGENTS.md template updated with workspace guidance and capability-centric organization principles
New Files
src/core/workspace.ts- WorkspaceManager class with static methodssrc/core/schemas/workspace.schema.ts- Zod schemas for workspace.yamlsrc/core/validation/workspace-rules.ts- Cross-repo validation rules
Change Proposal
Includes full OpenSpec change proposal in openspec/changes/add-workspace-support/ with:
- proposal.md - Why and what
- design.md - Full architecture vision
- tasks.md - Implementation checklist
- specs/cli-workspace/spec.md - Capability specification with scenarios
Test plan
- [x]
openspec validate --workspacewithout workspace.yaml shows helpful error - [x]
openspec validate --workspacewith valid workspace.yaml passes - [x]
openspec validate --workspace --jsonoutputs structured JSON - [x] Build compiles successfully
- [ ] Manual testing of
openspec init --workspace(interactive flow)
Summary by CodeRabbit
Release Notes
-
New Features
- Added multi-repo workspace support with
openspec init --workspacefor orchestrating multiple repositories. - Introduced
openspec validate --workspacefor aggregating validation across all workspace repositories. - Added cross-repo change validation requiring Impact sections for changes affecting multiple repositories.
- New workspace.yaml configuration file for defining repository mappings and cross-repo conventions.
- Added multi-repo workspace support with
-
Documentation
- Updated AGENTS.md template with workspace-aware guidance for coordinating across multiple repositories.
✏️ Tip: You can customize this high-level summary in your review settings.
Walkthrough
Introduces multi-repo workspace support for OpenSpec with new initialization and validation workflows. Adds workspace configuration schema, YAML-based workspace definitions, workspace management utilities, cross-repo validation rules, and CLI enhancements to support --workspace flag for both init and validate commands.
Changes
| Cohort / File(s) | Summary |
|---|---|
Design & Planning Documentation openspec/changes/add-workspace-support/design.md, openspec/changes/add-workspace-support/proposal.md, openspec/changes/add-workspace-support/specs/cli-workspace/spec.md, openspec/changes/add-workspace-support/tasks.md |
Comprehensive design documents, specification, and task roadmap for workspace feature implementation, including architecture, CLI workflows, validation rules, and phased rollout plan. |
Workspace Core Infrastructure src/core/workspace.ts, src/core/schemas/workspace.schema.ts |
New WorkspaceManager class with methods for loading, discovering, and validating workspaces; Zod schemas defining workspace configuration structure (repos, conventions, cross-repo rules). |
Workspace Validation Rules src/core/validation/workspace-rules.ts |
Cross-repo validation utilities including Impact section parsing, per-change validation, and aggregated workspace validation with error/warning categorization. |
Schema & Type Exports src/core/schemas/index.ts |
Re-exports new workspace schemas and types for public consumption. |
CLI Command Enhancements src/cli/index.ts |
Adds --workspace flag to init and validate commands; threads workspace option through command constructors. |
Command Implementation src/commands/validate.ts |
Extends validate command with workspace validation workflow; routes --workspace flag to new runWorkspaceValidation method with JSON/human-readable output. |
Init Command Workspace Support src/core/init.ts |
Adds workspace initialization path with executeWorkspace method; implements repo discovery, interactive workspace setup, and workspace.yaml generation. |
Templates & Styles src/core/templates/agents-template.ts, src/core/styles/palette.ts |
Extends AGENTS.md template with workspace documentation and multi-repo workflow guidance; adds yellow color to palette. |
Dependencies package.json |
Adds yaml ^2.8.1 dependency for YAML parsing. |
Sequence Diagram(s)
sequenceDiagram
participant User
participant CLI as CLI<br/>(init --workspace)
participant InitCmd as InitCommand<br/>(workspace mode)
participant WkspMgr as WorkspaceManager
participant FSys as File System
User->>CLI: openspec init --workspace [path]
CLI->>InitCmd: new InitCommand({workspace: true})
CLI->>InitCmd: execute(targetPath)
InitCmd->>InitCmd: executeWorkspace(targetPath)
InitCmd->>WkspMgr: discoverRepos(targetPath)
WkspMgr->>FSys: scan directories for indicators
WkspMgr-->>InitCmd: repo paths[]
InitCmd->>User: prompt: workspace name
User-->>InitCmd: workspace name
InitCmd->>User: prompt: select repos (checkbox)
User-->>InitCmd: selected repos[]
InitCmd->>WkspMgr: generateWorkspaceYaml(name, repos)
WkspMgr-->>InitCmd: workspace.yaml content
InitCmd->>FSys: write workspace.yaml
InitCmd->>FSys: write/update AGENTS.md<br/>(with workspace context)
InitCmd-->>User: ✓ Workspace initialized
sequenceDiagram
participant User
participant CLI as CLI<br/>(validate --workspace)
participant ValidateCmd as ValidateCommand
participant WkspMgr as WorkspaceManager
participant WkspRules as workspace-rules
participant FSys as File System
User->>CLI: openspec validate --workspace [options]
CLI->>ValidateCmd: execute({workspace: true, ...})
ValidateCmd->>ValidateCmd: runWorkspaceValidation()
ValidateCmd->>WkspMgr: load(cwd)
WkspMgr->>FSys: read workspace.yaml
WkspMgr-->>ValidateCmd: Workspace
ValidateCmd->>WkspRules: validateWorkspaceChanges(workspace)
WkspRules->>FSys: scan openspec/changes
loop For each change directory
WkspRules->>FSys: read proposal.md
WkspRules->>WkspRules: parseImpactSection()
WkspRules->>WkspRules: validateCrossRepoChange()
WkspRules->>WkspRules: check conventions<br/>(Impact required, repo refs, order)
end
WkspRules-->>ValidateCmd: ValidationReport{errors, warnings, valid}
alt JSON output
ValidateCmd->>User: JSON report
else Human-readable
ValidateCmd->>User: formatted validation results
end
ValidateCmd->>User: exit code (0=valid, 1=invalid)
Estimated code review effort
🎯 4 (Complex) | ⏱️ ~60 minutes
- Duplicate method in validate.ts: The
runWorkspaceValidationmethod appears twice in the diff with identical implementations; this should be deduplicated before merge. - Workspace discovery and validation logic: Review the repo discovery heuristics (indicators like package.json, pyproject.toml, etc.) and validation rules for correctness and robustness.
- YAML parsing and error handling: Ensure WorkspaceManager handles malformed YAML, missing files, and invalid repo paths gracefully.
- CLI integration: Verify workspace options correctly thread through InitCommand and ValidateCommand constructors and that control flow prioritization is correct (workspace validation before standard validation).
- Cross-repo validation rules: Validate parseImpactSection regex/parsing logic and cross-repo change detection accuracy.
- Interactive prompts: Review repo discovery flow, checkbox interaction, and user-facing messaging in executeWorkspace.
Poem
🐰 A workspace now blooms, with repos in a row, Multi-repo magic, watch the changes flow! Validate across borders, init with a plan, Federated harmony—OpenSpec's grand span! ✨
Pre-merge checks and finishing touches
✅ Passed checks (3 passed)
| Check name | Status | Explanation |
|---|---|---|
| Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check | ✅ Passed | The title 'feat(workspace): add multi-repository workspace support' clearly summarizes the main change in this pull request, which is the introduction of multi-repository workspace support including new CLI commands, workspace schemas, and validation rules. |
| Docstring Coverage | ✅ Passed | No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. |
✨ Finishing touches
- [ ] 📝 Generate docstrings
🧪 Generate unit tests (beta)
- [ ] Create PR with unit tests
- [ ] Post copyable unit tests in a comment
[!TIP]
📝 Customizable high-level summaries are now available in beta!
You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.
- Provide your own instructions using the
high_level_summary_instructionssetting.- Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
- Use
high_level_summary_in_walkthroughto move the summary from the description to the walkthrough section.Example instruction:
"Divide the high-level summary into five sections:
- 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
- 📓 References — List relevant issues, discussions, documentation, or related PRs.
- 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
- 📊 Contributor Summary — Include a Markdown table showing contributions:
| Contributor | Lines Added | Lines Removed | Files Changed |- ✔️ Additional Notes — Add any extra reviewer context. Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."
Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands and usage tips.
Nice stuff @hcnimi, I was working on something similar too, this is top of mind for me. I'll check if this aligns with the design decisions I was working through. I'll take it for a spin and get back to you.
@hcnimi This might be useful to you in terms of how I see workspaces: https://github.com/Fission-AI/OpenSpec/pull/342 Would love your thoughts on there.
Hi Tabish,
I haven’t had a chance to go through it thoroughly, but I recall disagreeing with the focus on single-developer scenarios. I’d like to see support for collaboration in a workspace.
Thanks!
On Wed, Nov 26, 2025 at 11:09 PM Tabish Bidiwale @.***> wrote:
TabishB left a comment (Fission-AI/OpenSpec#330) https://github.com/Fission-AI/OpenSpec/pull/330#issuecomment-3584468220
@hcnimi https://github.com/hcnimi This might be useful to you in terms of how I see workspaces: #342 https://github.com/Fission-AI/OpenSpec/pull/342 Would love your thoughts on there.
— Reply to this email directly, view it on GitHub https://github.com/Fission-AI/OpenSpec/pull/330#issuecomment-3584468220, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHY45KHLHESF7TWJDAK5Q4D362PQZAVCNFSM6AAAAACM5LSM26VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTKOBUGQ3DQMRSGA . You are receiving this because you were mentioned.Message ID: @.***>
@hcnimi For sure, collaboration is a big part of why I think workspaces are important and it'll be a core part of what makes it work for teams.
Will this be merged soon ?
Will this be merged soon ?
"+ 1"
When this feature is merge ?