openspec/initiatives/context-store-and-initiatives/work-items/05-ship-initiative-mvp/plan.md
Create/list operation and CLI adapter slices complete. Full read/show, update, and delete policy is deferred to later agent-first discovery and lifecycle work.
Start from ../../direction.md.
The relevant model is:
Context stores sync truth.
Collections shape truth.
Initiatives coordinate work.
Workspaces open local views.
Changes implement repo-owned slices.
Give coordinated work a durable, shared, agent-consumable home inside an
initiatives/ collection.
Default initiative shape:
initiatives/<id>/
initiative.yaml
requirements.md
design.md
decisions.md
questions.md
tasks.md
Direction also leaves room for later contracts/ content:
initiatives/<id>/
contracts/
src/core/context-store/.initiatives collection from Item 4.src/core/collections/initiatives/.src/core/index.ts only after a real API exists.initiative.yaml, not hidden .initiative.yaml, for the runtime
context-store initiative model. Existing roadmap folders may still carry
legacy .initiative.yaml progress metadata until that tracker is migrated or
retired.links.yaml in the initiative MVP. Repo-change wiring belongs
to workspace/local coordination work later.readInitiative API until the shape of "full initiative" is clearer.initiative.yaml. Missing initiative.yaml means "not an initiative";
invalid initiative.yaml means broken shared state and should fail loudly.initiative.yamlRecommended shape:
version: 1
id: launch-billing-flow
title: Launch Billing Flow
summary: >
Coordinate the billing launch across product, API, and client surfaces.
status: exploring
created: "2026-05-21"
owners: []
metadata: {}
Required:
versionidtitlesummarystatuscreatedDefaulted or optional:
ownersmetadataInitial statuses:
exploringactivecompletearchivedCreate these files up front:
requirements.md: product intent, accepted requirements, out of scope.design.md: context, approach, affected areas, dependencies, risks.decisions.md: accepted decisions with date/title/decision/why/implications.questions.md: open and resolved questions.tasks.md: coordination tasks only, not repo implementation tasks.Defer contracts/, README.md, milestones, dependency graphs, external issue
links, workspace path mappings, status dashboards, links.yaml, and Markdown
content validation.
src/core/collections/initiatives/schema.ts.src/core/collections/initiatives/templates.ts.src/core/collections/initiatives/index.ts.test/core/collections/initiatives/.initiative.yaml
parse/serialize helpers, and default template builders.src/core/collections/initiatives/schema.ts.src/core/collections/initiatives/templates.ts.src/core/collections/initiatives/index.ts.test/core/collections/initiatives/.src/core/collections/index.ts now that a
mounted operation API exists.links.yaml out of the initiative MVP file contract.src/core/collections/initiatives/operations.ts.src/core/collections/index.ts now that a mounted
operation API exists.createInitiative should create exactly the MVP file shape:
initiative.yaml, requirements.md, design.md, decisions.md,
questions.md, and tasks.md.createInitiative should generate created through an injectable date
provider, fail if the initiative folder already exists, and clean up a
partially created folder on write failure.listInitiatives should inspect immediate child directories under the
mounted initiatives collection, ignore folders without initiative.yaml,
parse and validate folders with initiative.yaml, require
initiative.yaml.id to match the folder name, and return initiative states
sorted by id.src/core/collections/initiatives/operations.ts.createInitiative for creating the MVP folder shape through a mounted
initiatives collection.listInitiatives using the valid-initiative.yaml detection rule.src/core/collections/index.ts.test/core/collections/initiatives/operations.test.ts.Before adding openspec initiative create/list, add a context-store
registration/resolution facade so CLI code can resolve a named store and mount
the initiatives collection without exposing raw registry or metadata YAML.
Add the first initiative CLI surface as a thin adapter over the mounted collection operations:
openspec initiative create <id> --store <store-id> --title <title> --summary <summary>
openspec initiative create <id> --store-path <path> --title <title> --summary <summary>
openspec initiative list --store <store-id>
openspec initiative list --store-path <path>
Use initiative create/list as a deliberate noun namespace, similar to
workspace and schema, even though newer OpenSpec conventions generally
prefer verb-first top-level commands. The stricter alternative would spread
initiative behavior across new initiative and global list flags, which is a
larger surface for this slice because initiative commands must resolve a
context store.
Keep store selection explicit in the first CLI slice. Require either
--store <id> or --store-path <path>, reject both together, and do not add
current-directory discovery, single-store auto-selection, an interactive picker,
a global default store, or workspace selected-store state yet.
Because shell completions are manually registered, adding the runtime command
also requires adding initiative create/list/ls to COMMAND_REGISTRY. Keep
completion support static for now: command names and flags only, with no dynamic
store-id or initiative-id completion.
src/commands/initiative.ts.openspec initiative create and openspec initiative list from
the top-level CLI.openspec initiative ls as an alias for list.--store <id> or
--store-path <path>.--store and --store-path selectors.status diagnostics
array.initiative create/list/ls.test/commands/initiative.test.ts.