openspec/initiatives/context-store-and-initiatives/work-items/07-add-agent-first-initiative-discovery/plan.md
Implementation complete; verification in progress.
Start from ../../direction.md.
This item exists because the expected workflow is agent-first:
Using initiative billing-launch, explore the API work and create a proposal.
Before repo-local linking, local resolution, or workspace opening can work, the agent needs a small command that answers:
Add agent-first initiative discovery without turning show into a reader,
progress dashboard, repo resolver, or workspace launcher.
initiative show <id> is a locator/discovery command.--store <id> filters to one registered store.--store-path <path> remains the explicit local-path escape hatch.--store and --store-path modes only consider the selected store.The first JSON contract should be a resolver/read-pointer projection, not a
full serialization of initiative.yaml.
Suggested success shape:
{
"context_store": {
"id": "platform",
"root": "/path/to/platform-context"
},
"initiative": {
"version": 1,
"id": "billing-launch",
"title": "Billing Launch",
"summary": "Coordinate billing launch work.",
"created": "2026-05-21",
"root": "/path/to/platform-context/initiatives/billing-launch",
"store_path": "initiatives/billing-launch",
"metadata_path": "/path/to/platform-context/initiatives/billing-launch/initiative.yaml"
},
"status": []
}
Locked field decisions:
initiative.version.initiative.created.initiative.id, title, summary, root, store_path, and
metadata_path.context_store.id and root.context_store.source from initiative show v1. It is selector
provenance, not context-store identity. Existing create/list output can remain
unchanged for now.resolution field from v1.initiative.status from the v1 projection.initiative.owners from the v1 projection.initiative.metadata from the v1 projection.files list from the v1 projection.matches.status[0].details.matches.status as command diagnostics only, not initiative work
progress.Success output should stay locator-focused:
OpenSpec initiative: Billing Launch
ID: billing-launch
Summary: Coordinate billing launch work.
Context store: platform
Location: /path/to/platform-context/initiatives/billing-launch
Files:
Metadata: /path/to/platform-context/initiatives/billing-launch/initiative.yaml
Error output should stay plain:
openspec initiative list.openspec initiative show <id> --store <store>.openspec context-store doctor.initiative show should not list initiative folder contents in v1.
Only initiative.yaml is required to identify and validate the initiative. All
other files are schema/config dependent and may differ across teams. Once the
command has resolved initiative.root, agents can use normal filesystem tools
to inspect the folder. Later schema-aware views can expose important files
without hardcoding today's default template filenames.
Add static shell completion metadata for:
initiative show <id> --store <id> --store-path <path> --json
Do not add dynamic completions for registered store ids or initiative ids in this slice.
Add a focused readInitiative operation for exact lookup.
Behavior:
null when the initiative folder or initiative.yaml is absent.initiative.yaml exists but is invalid.initiative.yaml id does not match the folder id.For default all-store lookup, any unreadable registered store makes lookup incomplete.
If one or more readable stores contain the initiative and one or more other
stores cannot be read, the primary error should still be
initiative_lookup_incomplete, not success or ambiguity. Include any readable
partial matches under the diagnostic details.
Explicit --store and --store-path modes are scoped to the selected store and
do not check unrelated registered stores.
Invalid exact initiative folders are broken shared state, not "not found".
If initiatives/<id>/initiative.yaml exists but is invalid or has a mismatched
id, initiative show should fail with an invalid-initiative diagnostic. In
default all-store lookup, unreadable stores still take precedence as
initiative_lookup_incomplete because the full candidate set is unknowable.
openspec show integration.