openspec/initiatives/context-store-and-initiatives/work-items/15-context-store-project-roots-and-schema-led-initiatives/plan.md
Proposed from the manual beta reality pass.
This work item replaces the current "initiative create writes a full hardcoded six-file packet" model with a project-like context-store root and an iterative, schema-led initiative artifact flow.
Start from ../../direction.md and preserve the current boundary:
Context stores sync truth.
Collections shape truth.
Initiatives coordinate work.
Workspaces open local views.
Changes implement repo-owned slices.
Manual beta evidence: agents can create the current MVP initiative shape, but
the generated requirements.md, design.md, decisions.md, questions.md,
and tasks.md invite premature, unreviewed planning content.
openspec initiative create currently creates a complete-looking planning
packet from hardcoded TypeScript constants and TBD templates. That made the
MVP tangible, but it is the wrong default for real initiative work.
Initiatives are high-level shared planning surfaces for PMs, designers, architects, and agents. They should capture intent, reviewed requirements, design direction, open questions, and decisions as those artifacts become real. They should not create empty or fake documents that look finished just because the folder exists.
The broader product shape is that a context store should feel like an OpenSpec
root in the same way a repo does after openspec init: it can have local
OpenSpec configuration and project-local schemas. The difference is lifecycle:
a context store is the shared context root, not an implementation repo.
Repo after openspec init:
repo/
openspec/
config.yaml
schemas/
changes/
specs/
Context store after setup:
context-store/
.openspec-store/
store.yaml
openspec/
config.yaml
schemas/
initiatives/
The openspec/ directory inside a context store exists for OpenSpec config and
schema resolution. It does not by itself make the context store an executable
implementation planning home.
openspec/schemas/.initiative create sparse and safe by default.New initiative creation should create a shell, not the whole plan:
initiatives/<id>/
initiative.yaml
brief.md
brief.md is a seed document, not a completion marker for reviewed
requirements or design. It should contain the title, summary, and a short
"current understanding" section with no TBD placeholders.
Reviewed planning artifacts are created later through the initiative schema.
Default built-in schema, conceptually:
name: product-initiative
version: 1
description: High-level initiative planning for PMs, designers, architects, and agents
usage: initiative
artifacts:
- id: requirements
generates: requirements.md
description: Product intent, goals, non-goals, requirements, and open questions
template: requirements.md
requires: []
- id: design
generates: design.md
description: Product, UX, and architecture direction with constraints and tradeoffs
template: design.md
requires:
- requirements
Do not include tasks.md in the default initiative schema. Implementation
tasks belong in repo-local changes. Coordination tasks, workstreams, decision
logs, and question logs can be separate later schemas or explicit artifacts once
the usage pattern is clearer.
Store setup should make the store project-like enough for schemas:
openspec context-store setup team-context --init-git
Expected created shape:
team-context/
.openspec-store/store.yaml
openspec/config.yaml
initiatives/
Preferred config direction:
initiative_schema: product-initiative
This avoids overloading the existing repo-local schema field, which currently
means "default change schema." If implementation chooses to reuse schema
instead, docs and JSON output must make the context-store scope explicit.
Then initiative creation stays small:
openspec initiative create agent-trace-hooks \
--store team-context \
--title "Agent Trace Hooks" \
--summary "Explore lightweight capture of agent trace events and hook outcomes."
Expected next action:
openspec initiative status team-context/agent-trace-hooks --json
openspec initiative instructions requirements team-context/agent-trace-hooks --json
The agent writes requirements.md only when the conversation has enough
reviewed content. design.md becomes ready after requirements exist.
Reuse the artifact graph primitives, but add an initiative-specific loader
instead of forcing initiatives through loadChangeContext.
Current reusable pieces:
src/core/artifact-graph/graph.tssrc/core/artifact-graph/state.tssrc/core/artifact-graph/outputs.tssrc/core/artifact-graph/resolver.tssrc/core/artifact-graph/instruction-loader.ts template loadingsrc/core/project-config.tsNew initiative-specific pieces:
projectRoot for config and schema lookupcontext-store/initiatives/<id>/status and instructions commands that mirror the repo-local
artifact workflow but return initiative-specific fieldsinitiative create path that writes initiative.yaml and brief.md
onlyDo not use the existing repo planning-home resolver unchanged. Once context
stores contain openspec/config.yaml, the current "nearest openspec/ folder
means repo planning home" heuristic can accidentally make a context store look
like an implementation repo. This work must either:
.openspec-store/store.yaml and
return or reject a context-store kind for implementation commands, oropenspec new change from a context-store root until Item
15 defines target-bound executable changes.Prefer a next-release-safe config path:
initiative_schema to project config, or an equivalent
collection-specific config field.schema as the default repo-local change schema.metadata if needed.schema field to initiative.yaml until
initiative metadata versioning is designed.Why: initiative.yaml is currently strict and versioned as version: 1.
Adding a top-level field would make older CLIs reject new initiatives. Existing
metadata can carry forward-compatible fields without breaking old readers.
Schema namespace needs one explicit decision:
usage: change | initiative discriminator to schema files and
filter commands accordingly, orThe simplest user-facing model is still openspec/schemas/, but commands must
avoid listing product-initiative as a valid repo-local change workflow.
initiative create --json should report the shell and next actions:
{
"context_store": {
"id": "team-context",
"root": "/path/to/store"
},
"initiative": {
"id": "agent-trace-hooks",
"root": "/path/to/store/initiatives/agent-trace-hooks",
"metadata_path": "/path/to/store/initiatives/agent-trace-hooks/initiative.yaml",
"schema": "product-initiative"
},
"created_files": [
"initiative.yaml",
"brief.md"
],
"next_commands": {
"status": "openspec initiative status team-context/agent-trace-hooks --json",
"requirements": "openspec initiative instructions requirements team-context/agent-trace-hooks --json"
},
"status": []
}
initiative status --json should include:
done, ready, blockedinitiative instructions --json should include:
This is compatible if implemented as a sparse, additive layer:
initiative.yaml.metadata or store config rather than new strict top-level fields.High-risk areas:
openspec/config.yaml.Likely tests to update or add:
test/core/collections/initiatives/schema.test.tstest/core/collections/initiatives/templates.test.tstest/core/collections/initiatives/operations.test.tstest/commands/initiative.test.tstest/commands/context-store.test.tstest/commands/artifact-workflow.test.tsopenspec/config.yamlLikely docs to update:
docs/workspaces-beta/agent-cli-playbook.mddocs/workspaces-beta/user-guide.mddocs/cli.mdusage or initiative_schema is addedopenspec/initiatives/context-store-and-initiatives/work-items/05-ship-initiative-mvp/
with a note that the MVP shape was superseded by this work iteminitiative create creates only the sparse initiative shell.openspec new change does not accidentally treat a context store as a normal
implementation repo just because the store has openspec/config.yaml.