OpenSpec icon indicating copy to clipboard operation
OpenSpec copied to clipboard

Proposal: Add workspace control plane proposal

Open rajashree-n opened this issue 7 months ago • 2 comments

Summary

This PR adds a draft OpenSpec proposal for first-class multi-repo workspace support using a dedicated control-plane pattern.

The new change introduces:

  • a checked-in openspec-workspace.yaml manifest as the source of truth for workspace topology
  • a new openspec workspace command surface with init, sync, and doctor
  • generated workspace router files like .agents.md derived from the manifest
  • a dedicated control-plane repo pattern that works across sibling repos without requiring a monorepo

Context

This draft is based on the multi-repo workspace pattern described in my comment on issue #725: https://github.com/Fission-AI/OpenSpec/issues/725#issuecomment-4228953380

Why

OpenSpec is currently project-root centric. That works well for single repos, but it leaves multi-repo teams without a standard way to keep agents grounded across a shared workspace.

This proposal targets a common setup like:

scm/
├── openspec-management/
├── service-auth/
└── service-payments/

The goal is to let teams manage shared specs, schemas, and repo routing from a single control plane while preserving repo-local ownership of existing AGENTS.md files.

What’s Included

  • proposal.md
  • design.md
  • tasks.md
  • spec delta for cli-workspace
  • spec delta for workspace-manifest

Key Design Choices

  • openspec init remains project-scoped
  • multi-repo support is introduced as a separate openspec workspace command group
  • .agents.md is treated as a generated artifact, not the primary contract
  • repo-local AGENTS.md files are referenced, not overwritten
  • sibling repo discovery is supported, but discovered entries must be reviewed before writing

Validation

  • openspec validate add-workspace-control-plane passed locally

Status

Draft proposal only. No runtime CLI implementation is included in this PR.

Summary by CodeRabbit

  • Documentation
    • Added design, proposal, spec, and task docs describing a new workspace control‑plane for multi-repo OpenSpec management.
    • Specified a checked‑in workspace manifest and validation rules, plus router generation and drift detection behaviors.
    • Documented a new CLI surface: openspec workspace with init, sync, and doctor commands and expected workflows.

rajashree-n avatar Apr 11 '26 22:04 rajashree-n

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 9db421b8-f273-4ea5-8043-fb6cb3c78b27

📥 Commits

Reviewing files that changed from the base of the PR and between caeebea7b8560ced5420e7f371cf5489792a54ed and c54a1f59f0192d02c3f81f557f4929699c955593.

📒 Files selected for processing (1)
  • openspec/changes/add-workspace-control-plane/tasks.md
✅ Files skipped from review due to trivial changes (1)
  • openspec/changes/add-workspace-control-plane/tasks.md

📝 Walkthrough

Walkthrough

Adds design, proposal, specs, and task documentation for a new first-class multi-repo "workspace" control-plane in OpenSpec, plus a small .openspec.yaml metadata file. No code or public API declarations were changed.

Changes

Cohort / File(s) Summary
Change Metadata
openspec/changes/add-workspace-control-plane/.openspec.yaml
New per-change metadata file with schema: spec-driven and created timestamp.
Design & Proposal
openspec/changes/add-workspace-control-plane/design.md, openspec/changes/add-workspace-control-plane/proposal.md
Adds design and proposal documents defining a checked-in openspec-workspace.yaml manifest, control-plane scaffolding expectations, generated-router ownership rules, and CLI surface (`workspace init
CLI & Manifest Specs
openspec/changes/add-workspace-control-plane/specs/cli-workspace/spec.md, openspec/changes/add-workspace-control-plane/specs/workspace-manifest/spec.md
Formalizes CLI requirements and manifest schema: discovery with user review, path normalization, validation rules (duplicate names/paths, missing control-plane), and router-generation behavior (.agents.md handling).
Tasks / Roadmap
openspec/changes/add-workspace-control-plane/tasks.md
Task checklist for implementing workspace commands, manifest read/write/validation, discovery, scaffold behavior, router generation, drift detection, diagnostics, and tests.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CLI as "openspec CLI"
    participant Manifest as "openspec-workspace.yaml"
    participant RepoFS as "Sibling Repos / Filesystem"
    participant Generator as "Router Generator"

    User->>CLI: run `openspec workspace init` (root)
    CLI->>RepoFS: discover candidate repos + instruction files
    RepoFS-->>CLI: list of candidates
    CLI->>User: present discovered entries for review
    User-->>CLI: confirm selections
    CLI->>Manifest: write `openspec-workspace.yaml` (normalized paths)
    CLI->>RepoFS: scaffold control-plane repo files if missing
    User->>CLI: run `openspec workspace sync`
    CLI->>Manifest: read manifest
    CLI->>Generator: generate routers (.agents.md) per manifest config
    Generator->>RepoFS: write generated router files (unless repo-local preserved)
    CLI->>User: report summary & drift info

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • Fission-AI/OpenSpec#443 — Overlaps on adding per-change .openspec.yaml metadata support and schema-aware handling for change files.

Suggested reviewers

  • TabishB

Poem

🐰 I hopped from repo to root with cheer,
A workspace map now drawn so clear,
Init, sync, doctor — tools in paw,
Manifests stitch the paths we saw,
Together we keep agents near. 🥕

🚥 Pre-merge checks | ✅ 3
✅ 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 'Proposal: Add workspace control plane proposal' accurately describes the main change: adding a comprehensive proposal for multi-repo workspace control-plane support with manifest, CLI commands, and specifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • [ ] Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot] avatar Apr 11 '26 22:04 coderabbitai[bot]

Thanks for the thoughtful review. I agree with the architectural mismatch you’re calling out.

This proposal was coming from the “standardized sibling workspace” direction I described in issue #725, but after comparing it against openspec/explorations/workspace-architecture.md, I agree it pushes too hard on a mandatory checked-in, path-based control plane as the primary model.

I’m aligned with treating this as an exploration signal rather than the proposal to merge as-is. The parts I still think are worth carrying forward are:

generated routing as a derived output rather than the source of truth explicit review-before-write discovery possibly a workspace sync / workspace doctor surface

But I agree those should be re-framed inside the thinner coordination-workspace model, with initiative-first planning, stable project identifiers, and optional/lazy workspace state.

Happy to close this out as a draft exploration and open a narrower follow-up proposal that extracts just the reusable pieces into the current workspace direction.

rajashree-n avatar Jun 06 '26 18:06 rajashree-n