-
Notifications
You must be signed in to change notification settings - Fork 1.7k
docs: fix openspec status examples in cli.md #761
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
fsilvaortiz
wants to merge
1
commit into
Fission-AI:main
Choose a base branch
from
fsilvaortiz:fix/cli-status-docs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+113
−15
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@fission-ai/openspec": patch | ||
| --- | ||
|
|
||
| docs: fix `openspec status` examples in cli.md to match actual CLI output (field names, indicators, and JSON structure). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| schema: spec-driven | ||
| created: 2026-02-25 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| ## Context | ||
|
|
||
| The `docs/cli.md` file contains example output for the `openspec status` command that doesn't match the actual CLI output. The discrepancies exist in both text and JSON format examples. The source of truth is the actual CLI implementation in `src/commands/workflow/status.ts` and `src/commands/workflow/shared.ts`. | ||
|
|
||
| ## Goals / Non-Goals | ||
|
|
||
| **Goals:** | ||
| - Replace the incorrect text and JSON examples with output that matches the actual CLI behavior | ||
| - Ensure examples are verifiable by running the actual commands | ||
|
|
||
| **Non-Goals:** | ||
| - Changing the CLI output format itself | ||
| - Updating any other documentation sections | ||
| - Adding new documentation sections | ||
|
|
||
| ## Decisions | ||
|
|
||
| ### 1. Derive examples from actual CLI output | ||
|
|
||
| **Decision:** Run `openspec status` against a real change and use the actual output (sanitized with a user-friendly change name) as the documentation examples. | ||
|
|
||
| **Rationale:** This eliminates guesswork and ensures accuracy. The examples should be copy-pasted from real output, not written from memory. | ||
|
|
||
| ### 2. Validate after editing | ||
|
|
||
| **Decision:** After updating the documentation, verify correctness by comparing every field name and format in the documented examples against the actual CLI output. | ||
|
|
||
| **Rationale:** The original bug was introduced because examples were written without validation. The fix must not repeat this mistake. | ||
|
|
||
| ## Risks / Trade-offs | ||
|
|
||
| - **[Examples go stale if CLI output changes]** → Low risk for a single fix. A systemic solution (generated docs) is out of scope. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| ## Why | ||
|
|
||
| The `docs/cli.md` documentation for the `openspec status` command shows example output (both text and JSON) that doesn't match the actual CLI output. Anyone reading the docs to understand or parse the output will encounter field names and formats that don't exist, making the documentation misleading for both users and integration developers. | ||
|
|
||
| ## What Changes | ||
|
|
||
| - Fix the text output example for `openspec status` to match actual format (`[x]`/`[ ]`/`[-]` indicators, `Progress:` line, `Change:`/`Schema:` headers) | ||
| - Fix the JSON output example to use correct field names (`changeName` not `change`, `schemaName` not `schema`, `status: "done"` not `status: "complete"`, `isComplete`, `applyRequires`, `outputPath`, `missingDeps`) | ||
| - Remove the non-existent `"next"` field and `"requires"` field from the JSON example | ||
|
|
||
| ## Capabilities | ||
|
|
||
| ### New Capabilities | ||
|
|
||
| _None._ | ||
|
|
||
| ### Modified Capabilities | ||
|
|
||
| _None._ This is a documentation-only fix with no behavioral changes. No spec-level requirements are affected. | ||
|
|
||
| ## Impact | ||
|
|
||
| - `docs/cli.md` — status command examples (text and JSON output sections) |
24 changes: 24 additions & 0 deletions
24
openspec/changes/fix-cli-status-docs/specs/docs-agent-instructions/spec.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| ## ADDED Requirements | ||
|
|
||
| ### Requirement: CLI status documentation accuracy | ||
|
|
||
| The `docs/cli.md` status command examples SHALL match the actual output produced by the CLI. | ||
|
|
||
| #### Scenario: Text output example matches actual format | ||
|
|
||
| - **WHEN** comparing the text output example in `docs/cli.md` to the output of `openspec status --change <name>` | ||
| - **THEN** the documented indicators SHALL be `[x]` for done, `[ ]` for ready, and `[-]` for blocked | ||
| - **AND** the documented headers SHALL include `Change:`, `Schema:`, and `Progress: N/M artifacts complete` | ||
| - **AND** blocked artifacts SHALL show `(blocked by: dep1, dep2)` notation | ||
|
|
||
| #### Scenario: JSON output example matches actual field names | ||
|
|
||
| - **WHEN** comparing the JSON output example in `docs/cli.md` to the output of `openspec status --change <name> --json` | ||
| - **THEN** the documented top-level fields SHALL be `changeName`, `schemaName`, `isComplete`, `applyRequires`, and `artifacts` | ||
| - **AND** each artifact object SHALL have fields `id`, `outputPath`, `status`, and optionally `missingDeps` | ||
| - **AND** the `status` field values SHALL be `done`, `ready`, or `blocked` | ||
|
|
||
| #### Scenario: Validation by running actual CLI | ||
|
|
||
| - **WHEN** the documentation update is complete | ||
| - **THEN** the implementer MUST run `openspec status` (both text and `--json` modes) against a real change and verify every field name, value format, and indicator symbol matches the documented examples |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| ## 1. Fix Documentation Examples | ||
|
|
||
| - [x] 1.1 Update the text output example in `docs/cli.md` (lines ~437-448) to match actual `openspec status` format: `[x]`/`[ ]`/`[-]` indicators, `Change:`/`Schema:`/`Progress:` headers, `(blocked by: ...)` notation | ||
| - [x] 1.2 Update the JSON output example in `docs/cli.md` (lines ~452-464) to use correct field names: `changeName`, `schemaName`, `isComplete`, `applyRequires`, `artifacts` with `id`/`outputPath`/`status`/`missingDeps` | ||
|
|
||
| ## 2. Validation | ||
|
|
||
| - [x] 2.1 Run `openspec status --change <name>` (text mode) and verify every line in the documented example matches the actual output format | ||
| - [x] 2.2 Run `openspec status --change <name> --json` and verify every field name and value format in the documented example matches the actual output | ||
|
|
||
| ## 3. Changeset | ||
|
|
||
| - [x] 3.1 Create a changeset file (`.changeset/fix-cli-status-docs.md`) with a patch bump describing the documentation fix |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Potential ordering inconsistency within the same doc for
spec-drivenflow.This example shows
proposal → design → specs → tasks, but Line 585 still saysproposal → specs → design → tasks. Please align both sections (or explicitly explain why they differ).Also applies to: 457-460
🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch on the ordering difference — this is intentional and both are correct for their respective contexts:
openspec schemascommand, which shows the schema's canonical definition order:proposal → specs → design → tasks. This reflects how the schema declares its artifacts.openspec statuscommand, which shows the topological sort order:proposal → design → specs → tasks. This reflects how the CLI actually outputs status.specsanddesignare parallel — both depend only onproposal— so neither ordering is "wrong"; they just come from different sources (schema definition vs. runtime topological sort).Since the goal of this PR is to make the status examples match the actual CLI output, the status section must use the topological sort order. Line 585 correctly reflects the schema definition order for a different command.
No change needed here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fsilvaortiz, thank you for the detailed clarification! That makes complete sense now. Topological sorting can produce multiple valid orderings for graphs with parallel dependencies, and sincespecsanddesignboth depend only onproposal, either order is valid depending on the context.I appreciate you explaining the distinction:
Since your PR is ensuring the docs match the actual CLI behavior, using the topological sort order in the status examples is absolutely correct. Apologies for the noise on this one!
✏️ Learnings added
🧠 Learnings used