Stores: keep your planning in its own repo and work with it from anywhere
What this is
This PR replaces OpenSpec's old workspace/initiative model with one simple idea: a store — a standalone repo that holds your specs and changes, registered on your machine by name. Everything else here makes that idea practical: your code repos can point at a store, OpenSpec can tell you whether your setup is healthy, show you the working context it assembles for you, and reopen the folders you work on together in your editor or agent.
It is the complete simplify-context-and-workspace-model roadmap (Phases 1–7), built slice by slice with per-slice specs, plans, and reviews, and proven as a whole by a final acceptance capstone.
What you can do now
Start planning in five minutes. Two commands take you from install to a working, store-scoped change:
openspec store setup team-plans --path ~/openspec/team-plans
openspec new change my-first-change --store team-plans
Every step prints the exact next command, so neither you nor your agent needs insider knowledge. The whole lifecycle — status, instructions, archive — works the same way.
Share planning across a team. A store is an ordinary git repo: push it, and a teammate clones it and runs openspec store register to continue the same work from their machine.
Connect your code repos. One line in a code repo's openspec/config.yaml (store: team-plans) and every OpenSpec command works from inside that repo with no flags. Stores can also declare the upstream context they draw on (references:) and the repos the work is about (targets:), with openspec repo register mapping those names to local checkouts. Declarations are just declarations — nothing clones, syncs, or fences your edits.
Ask "is my setup healthy?" openspec doctor checks the whole picture — store identity, pointers, references, targets, repo map — and every finding comes with a pasteable fix.
Ask "what am I working with?" openspec context assembles your working set as a human listing, an agent brief, or a .code-workspace file for your editor.
Keep personal worksets. Name a group of folders you like open together (a store plus some repos) and reopen them with one command in VS Code, Cursor, Claude Code, or codex: openspec workset create → openspec workset open. Worksets are personal and local — your view of the work, never shared state.
Drive it all from an agent. Every command has --json behind a documented contract (docs/agent-contract.md: every shape and 100+ diagnostic codes).
What's gone
The workspace and initiative command groups — their state model, schema, accepted specs, and generated guidance — are deleted, not hidden. "Context store" became simply store everywhere (commands, output, docs, machine tokens). Despite everything added above, the branch is net −4,478 lines of src.
How it was proven
- Four persona journeys pass as e2e tests or live headless dogfoods — including a cold-start agent given only a vague prompt and
--helpoutput, which assembled the full setup and self-verified withdoctor/context/validate. - Usability audits: a 55-wrong-turn error catalog (every failure fixed), a vocabulary sweep across all user-facing surfaces, and a measured time-to-first-success of 2 commands / 2 concepts.
- Technical audits: one root-resolution code path (verified, no command-local forks), dependency-direction invariants hold, agent contract documented and checked against the emitting code.
- Whole-delta review gauntlet over
origin/main...HEAD: four independent mechanisms; all P1/P2 findings fixed and re-verified. - 1,717 tests across 97 files, green on macOS and Linux.
Full evidence lives in openspec/work/simplify-context-and-workspace-model/ — the roadmap with its decision changelog (including every Decided autonomously entry for review), per-slice specs and plans, capstone reports, and the release-readiness verdict.
🤖 Generated with Claude Code
📝 Walkthrough
Walkthrough
OpenSpec commands now resolve an explicit root context from --store, nearest repo state, or an implicit directory, and propagate that root through workflow commands and JSON output. Context-store setup, registration, and doctoring now inspect and preserve OpenSpec roots directly. Several workspace-era commands and docs were marked obsolete or removed, while new /work guidance and slice documents were added.
Changes
OpenSpec root and context-store foundation
| Layer / File(s) | Summary |
|---|---|
Root helpers and selection src/core/openspec-root.ts, src/core/root-selection.ts, src/core/index.ts, test/core/openspec-root.test.ts, test/core/root-selection.test.ts |
OpenSpec root inspection, creation, rollback, and command root selection are added with store, nearest, and implicit resolution paths. |
Context-store setup, register, and doctor src/core/context-store/*, test/commands/context-store.test.ts, test/core/context-store/registry.test.ts |
Context-store mutation and inspection flow now uses OpenSpec root health, richer registry status, optional identity creation, and separate root diagnostics. |
CLI command root-awareness and workflow changes
| Layer / File(s) | Summary |
|---|---|
CLI flags and command registry src/cli/index.ts, src/core/completions/*, docs/cli.md, test/core/completions/command-registry.test.ts, test/commands/store-root-selection.test.ts, test/commands/artifact-workflow.test.ts, test/commands/change-initiative-link.test.ts |
The top-level CLI and completion surfaces add --store, hide --store-path, remove set, and update new change flag handling and docs. |
Workflow commands and outputs src/commands/workflow/*, src/commands/show.ts, src/commands/spec.ts, src/commands/change.ts, src/commands/validate.ts, src/core/list.ts |
Workflow commands resolve roots, emit banners, include root metadata in JSON, and delegate show/spec/change/validate/list behavior through the selected root. |
Archive command and JSON failures src/core/archive.ts, src/core/specs-apply.ts, test/core/archive.test.ts, test/commands/store-root-selection.test.ts |
archive is refactored to resolve roots, support JSON/non-interactive flows, and emit structured blocked diagnostics and JSON results. |
Documentation and roadmap reframing
| Layer / File(s) | Summary |
|---|---|
CLI docs and historical roadmap updates openspec/changes/*, openspec/initiatives/context-store-and-initiatives/* |
CLI reference text, legacy workspace guidance, initiative history, and roadmap/task documents are rewritten to point at the new simplify-context-and-workspace-model direction. |
/work guidance and slice artifacts openspec/work/* |
The new /work documentation, goal/roadmap, slice specs, and HTML review pages describe the simplified model and its supporting artifacts. |
Sequence Diagram(s)
sequenceDiagram
participant CLI as CLI commands
participant Root as resolveRootForCommand
participant Store as context-store registry
participant OS as inspectOpenSpecRoot
participant Ops as context-store operations
CLI->>Root: resolve with store / nearest / implicit inputs
Root->>Store: read registry and identity metadata
Root->>OS: inspect candidate OpenSpec root
Root->>CLI: return ResolvedOpenSpecRoot / diagnostic payload
Ops->>OS: ensureOpenSpecRoot / inspectOpenSpecRoot
Ops->>Store: commit registration state
Ops->>Ops: rollbackCreatedPaths on failure
Estimated code review effort
🎯 5 (Critical) | ⏱️ ~90+ minutes
Possibly related PRs
- Fission-AI/OpenSpec#1025: This PR rewrites several workspace reimplementation roadmap and proposal documents that the current changes mark obsolete or pending deletion.
- Fission-AI/OpenSpec#1089: This PR is directly connected because the current diff removes
set changeand changesnew change/--areas/--initiativehandling in the same command surface. - Fission-AI/OpenSpec#1127: This PR is related because it previously introduced workflow and initiative-link surfaces that are now being removed or replaced by the root-selection model.
Suggested reviewers
- alfred-openspec
Poem
🐰 I hopped through roots and found the trail, Specs now know where truth sets sail. Work is motion, clear and bright, With banners, roots, and JSON light.
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Docstring Coverage | ⚠️ Warning | Docstring coverage is 14.46% which is insufficient. The required threshold is 80.00%. | Write docstrings for the functions missing them to satisfy the coverage threshold. |
✅ Passed checks (4 passed)
| Check name | Status | Explanation |
|---|---|---|
| Linked Issues check | ✅ Passed | Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check | ✅ Passed | Check skipped because no linked issues were found for this pull request. |
| Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check | ✅ Passed | The title accurately and concisely summarizes the main change: replacing workspaces and initiatives with context stores as the primary model. |
✏️ Tip: You can configure your own custom pre-merge checks in the settings.
✨ Finishing Touches
📝 Generate docstrings
- [ ] Create stacked PR
- [ ] Commit on current branch
🧪 Generate unit tests (beta)
- [ ] Create PR with unit tests
- [ ] Commit unit tests in branch
codex/store-root-parity
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.