openspec/initiatives/context-store-and-initiatives/work-items/12-context-store-first-run-and-cleanup-ux/plan.md
Implemented.
This work item covers the context-store setup and cleanup gaps that were not fully captured by later docs, schema, or handoff work.
Manual beta notes:
../11-manual-beta-reality-pass/notes.md, especially the findings around
no-argument setup, cleanup, target path safety, and shared-store Git guidance.Preserve the current boundary:
Context stores sync truth.
Collections shape truth.
Initiatives coordinate work.
Workspaces open local views.
Changes implement repo-owned slices.
The beta pass found that openspec context-store setup feels like a first-run
entrypoint, but no-argument setup currently does not guide the user through the
choices they need to make. The pass also found that recovering from a mistaken
store setup requires manual registry edits and file deletion.
These are local lifecycle problems, not shared coordination model problems. They should be solved before asking new users or teammates to trust context stores as normal local workflow.
context-store setup a friendly interactive setup path in a
terminal.Locked decisions from the product pass:
openspec context-store setup with no arguments should start a guided setup
when run in an interactive terminal. Agents, scripts, CI, and --json callers
should pass the equivalent explicit inputs instead of relying on prompts.Context store name, Where should this context store live?,
Initialize Git in this context store?, then a final
Create this context store? confirmation after showing the resolved summary.context-store unregister <id>
forgets the machine-local registry entry and leaves files alone, while
context-store remove <id> unregisters the store and deletes the local folder
only after showing the exact path and receiving confirmation.--json, or context-store doctor output.next_commands. Empty
status: [] can be preserved where existing JSON compatibility needs it, but
new behavior should not rely on blank status arrays for meaning.git init, but it must not stage, commit, push, create
remotes, create branches, or define team Git policy.Interactive setup should cover the minimum choices:
Store id
Target path, defaulting to the managed OpenSpec context-store location
Whether to initialize Git
Before writing files, output should show the resolved target path. If an explicit path is inside another Git repo or an existing non-empty directory, the command should either ask for confirmation with clear wording or fail with a fix message in non-interactive mode.
Cleanup should distinguish local registration from file deletion:
openspec context-store unregister team-context
openspec context-store remove team-context
The command names are explicit because the user intents are different:
If Git initialization fails, setup should explain that the user can install Git or rerun setup without Git. Successful Git initialization stays out of the happy-path human output.
JSON setup output should report:
JSON cleanup output should report:
openspec context-store setup in a terminal and be led
through the normal local setup path without knowing flags.