Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/fix-cli-status-docs.md
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).
29 changes: 14 additions & 15 deletions docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -437,29 +437,28 @@ openspec status --change add-dark-mode --json
```
Change: add-dark-mode
Schema: spec-driven
Progress: 2/4 artifacts complete

Artifacts:
✓ proposal proposal.md exists
✓ specs specs/ exists
◆ design ready (requires: specs)
○ tasks blocked (requires: design)

Next: Create design using /opsx:continue
[x] proposal
[ ] design
[x] specs
[-] tasks (blocked by: design)
Comment on lines +442 to +445
Copy link
Contributor

@coderabbitai coderabbitai bot Feb 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Potential ordering inconsistency within the same doc for spec-driven flow.
This example shows proposal → design → specs → tasks, but Line 585 still says proposal → specs → design → tasks. Please align both sections (or explicitly explain why they differ).

Also applies to: 457-460

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/cli.md` around lines 442 - 445, The doc has an ordering inconsistency
for the "spec-driven" flow: one section shows "proposal → design → specs →
tasks" while another shows "proposal → specs → design → tasks"; pick the correct
canonical order for the spec-driven flow (or add a short note explaining why the
two orders differ) and update all occurrences to match; search for the
"spec-driven" heading and the sequences "proposal → design → specs → tasks" and
"proposal → specs → design → tasks" (and the nearby mention affecting the
section noted as "Also applies to: 457-460") and make the text consistent or add
the explicit explanation.

Copy link
Author

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:

  • Line 585 documents the openspec schemas command, which shows the schema's canonical definition order: proposal → specs → design → tasks. This reflects how the schema declares its artifacts.
  • The status examples (lines ~437–463) document the openspec status command, which shows the topological sort order: proposal → design → specs → tasks. This reflects how the CLI actually outputs status.

specs and design are parallel — both depend only on proposal — 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.

Copy link
Contributor

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 since specs and design both depend only on proposal, either order is valid depending on the context.

I appreciate you explaining the distinction:

  • Schema definition order (Line 585) = how the schema artifact flow is declared
  • Topological sort order (status output) = how the CLI runtime actually outputs the artifacts

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
Learnt from: fsilvaortiz
Repo: Fission-AI/OpenSpec PR: 761
File: docs/cli.md:442-445
Timestamp: 2026-02-25T20:02:43.381Z
Learning: In the OpenSpec spec-driven schema, `specs` and `design` artifacts are parallel dependencies that both depend only on `proposal`. This means either can appear first in a topological sort, and both orderings are valid depending on the specific sort algorithm used.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.


🧠 Learnings used
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:02.839Z
Learning: Use `@/openspec/AGENTS.md` to learn how to create and apply change proposals, spec format and conventions, and project structure and guidelines

Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:02.839Z
Learning: Always open `@/openspec/AGENTS.md` when the request mentions planning or proposals (words like proposal, spec, change, plan), introduces new capabilities, breaking changes, architecture shifts, or performance/security work, or sounds ambiguous and needs the authoritative spec before coding

```

**Output (JSON):**

```json
{
"change": "add-dark-mode",
"schema": "spec-driven",
"changeName": "add-dark-mode",
"schemaName": "spec-driven",
"isComplete": false,
"applyRequires": ["tasks"],
"artifacts": [
{"id": "proposal", "status": "complete", "path": "proposal.md"},
{"id": "specs", "status": "complete", "path": "specs/"},
{"id": "design", "status": "ready", "requires": ["specs"]},
{"id": "tasks", "status": "blocked", "requires": ["design"]}
],
"next": "design"
{"id": "proposal", "outputPath": "proposal.md", "status": "done"},
{"id": "design", "outputPath": "design.md", "status": "ready"},
{"id": "specs", "outputPath": "specs/**/*.md", "status": "done"},
{"id": "tasks", "outputPath": "tasks.md", "status": "blocked", "missingDeps": ["design"]}
]
}
```

Expand Down
2 changes: 2 additions & 0 deletions openspec/changes/fix-cli-status-docs/.openspec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
schema: spec-driven
created: 2026-02-25
32 changes: 32 additions & 0 deletions openspec/changes/fix-cli-status-docs/design.md
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.
23 changes: 23 additions & 0 deletions openspec/changes/fix-cli-status-docs/proposal.md
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)
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
13 changes: 13 additions & 0 deletions openspec/changes/fix-cli-status-docs/tasks.md
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