Skip to content

Conversation

@TabishB
Copy link
Contributor

@TabishB TabishB commented Dec 28, 2025

Summary

  • Adds change proposal for Slice 4 of the artifact workflow POC
  • New top-level CLI commands for artifact workflow operations
  • Commands are experimental and implemented in isolation for easy removal

New Commands

Command Description
openspec status --change <id> Show artifact completion state
openspec next --change <id> Show artifacts ready to create
openspec instructions <artifact> --change <id> Get enriched template
openspec templates --change <id> Show resolved template paths
openspec new change <name> Create new change directory

Key Design Decisions

  • Top-level verbs for fluid UX (no subcommand grouping)
  • Explicit --change required - CLI is deterministic, agents infer from context
  • Experimental isolation - all commands in single file for easy removal
  • Integrates existing modules - uses instruction-loader, artifact-graph, change-utils from Slices 1-3

Files

  • proposal.md - Why and what changes
  • design.md - CLI design decisions
  • specs/cli-workflow/spec.md - 8 requirements, 27 scenarios
  • tasks.md - 22 implementation tasks

Test plan

  • openspec validate add-artifact-workflow-cli --strict passes

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Experimental artifact workflow CLI: status, next, instructions, templates, and new change commands (JSON and --no-color support)
  • Improvements

    • Recursive spec discovery (specs/**/*.md)
    • View now shows Draft, Active, and Completed sections with updated summary and ordering
  • Bug Fixes

    • Empty changes (no tasks) are treated as Draft instead of Completed
  • Documentation

    • Detailed spec, proposal, design, tasks, and help text for the artifact workflow
  • Tests

    • Comprehensive CLI and view tests covering new commands and draft handling

✏️ Tip: You can customize this high-level summary in your review settings.

Add CLI commands for artifact workflow operations:
- `openspec status --change <id>` - Show artifact completion state
- `openspec next --change <id>` - Show ready artifacts
- `openspec instructions <artifact> --change <id>` - Get enriched template
- `openspec templates --change <id>` - Show template paths
- `openspec new change <name>` - Create new change

Commands are top-level for fluid UX and implemented in isolation
for easy removal (experimental feature).
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 28, 2025

📝 Walkthrough

Walkthrough

Adds an experimental artifact-workflow CLI (status, next, instructions, templates, new change) via a new module registered in the CLI entry point, updates specs artifact globbing to recursive matching, and introduces view changes to surface Draft/Active/Completed change states.

Changes

Cohort / File(s) Summary
CLI integration
src/cli/index.ts, src/commands/artifact-workflow.ts
New experimental artifact-workflow command set. Exports and registers registerArtifactWorkflowCommands(program: Command) and wires commands (status, next, instructions, templates, new change) with JSON/--no-color options, spinner UX, validation, and consistent error handling.
View state & UI
src/core/view.ts, test/core/view.test.ts
Adds Draft category to change state model; updates getChangesData / displaySummary signatures and ordering; console output adjusted; tests ensure changes with no tasks appear in Draft, not Completed.
Schemas
schemas/spec-driven/schema.yaml
Change specs artifact generates pattern from specs/*.md to recursive specs/**/*.md.
Tests
test/commands/artifact-workflow.test.ts, test/core/artifact-graph/instruction-loader.test.ts
Adds comprehensive CLI tests for artifact-workflow commands (status/next/instructions/templates/new/help) and updates artifact-loader tests to expect recursive specs globbing.
Docs & design artifacts
openspec/changes/archive/..., openspec/specs/cli-artifact-workflow/spec.md
Adds proposal, design, specs, tasks, and archived change notes covering the artifact-workflow feature and unified change-state model.
Manifest
package.json
(Touched in diff summary) project manifest present in diff set.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    participant User as CLI User
    participant CLI as CLI Entrypoint
    participant Cmd as ArtifactCmds
    participant Ctx as ChangeContext
    participant Graph as ArtifactGraph
    participant Loader as InstructionLoader
    participant Out as Formatter

    Note over CLI,Cmd: status / next / instructions flow
    User->>CLI: openspec status --change foo
    CLI->>Cmd: dispatch status
    Cmd->>Ctx: validateChangeExists(change)
    Ctx-->>Cmd: change directory OK
    Cmd->>Ctx: loadChangeContext(change)
    Ctx->>Graph: build ArtifactGraph (resolve schema)
    Graph-->>Ctx: artifacts & metadata
    Cmd->>Loader: formatChangeStatus(graph)
    Loader-->>Cmd: formatted status (JSON/text)
    Cmd->>Out: apply --no-color / --json
    Out-->>User: render status output

    Note over CLI,Cmd: new change flow
    User->>CLI: openspec new change my-change --description "..."
    CLI->>Cmd: dispatch new change
    Cmd->>Cmd: validateChangeName(name)
    Cmd->>Ctx: createChange(name, description)
    Ctx-->>Cmd: directory + README created
    Cmd->>Out: print success
    Out-->>User: creation confirmation
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Poem

🐰 A hop, a CLI, a tiny feat,
I wire commands and tidy the sheet,
Status, templates, next in line,
Drafts now different, outputs shine,
New changes sprout — the workflow's sweet! 🥕

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 53.33% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: introducing artifact workflow CLI commands as part of Slice 4. It is specific, concise, and clearly conveys the primary objective.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch add-artifact-workflow-cli

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
openspec/changes/add-artifact-workflow-cli/proposal.md (1)

1-9: Fix redundant acronym in Why section.

Line 3 uses "CLI interface," but CLI already stands for Command Line Interface. Simplify to just "CLI."

🔎 Proposed fix
-The ArtifactGraph (Slice 1) and InstructionLoader (Slice 3) provide programmatic APIs for artifact-based workflow management. Users currently have no CLI interface to:
+The ArtifactGraph (Slice 1) and InstructionLoader (Slice 3) provide programmatic APIs for artifact-based workflow management. Users currently have no way to use the CLI to:

Or even simpler:

-The ArtifactGraph (Slice 1) and InstructionLoader (Slice 3) provide programmatic APIs for artifact-based workflow management. Users currently have no CLI interface to:
+The ArtifactGraph (Slice 1) and InstructionLoader (Slice 3) provide programmatic APIs for artifact-based workflow management. Users currently cannot:
openspec/changes/add-artifact-workflow-cli/design.md (1)

27-27: Add language identifiers to fenced code blocks.

Markdown linting standards require language identifiers for fenced code blocks. Lines 27 and 46 both have bare ``` without language specifiers (should be ```bash in both cases).

🔎 Proposed fixes

Line 27 (command structure example):

-```
+```bash
 openspec status --change <id>
 openspec next --change <id>
 openspec instructions <artifact> --change <id>
 openspec templates --change <id>
 openspec new change <name>
-```
+```

Line 46 (file location example):

-```
+```text
 src/commands/artifact-workflow.ts
-```
+```

Also applies to: 46-46

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 11e1955 and 39645d9.

📒 Files selected for processing (4)
  • openspec/changes/add-artifact-workflow-cli/design.md
  • openspec/changes/add-artifact-workflow-cli/proposal.md
  • openspec/changes/add-artifact-workflow-cli/specs/cli-workflow/spec.md
  • openspec/changes/add-artifact-workflow-cli/tasks.md
🧰 Additional context used
📓 Path-based instructions (4)
openspec/changes/**/*.md

📄 CodeRabbit inference engine (openspec/AGENTS.md)

Scaffold proposal using proposal.md, tasks.md, optional design.md, and delta specs under openspec/changes/<id>/

Files:

  • openspec/changes/add-artifact-workflow-cli/tasks.md
  • openspec/changes/add-artifact-workflow-cli/proposal.md
  • openspec/changes/add-artifact-workflow-cli/design.md
  • openspec/changes/add-artifact-workflow-cli/specs/cli-workflow/spec.md
openspec/changes/*/tasks.md

📄 CodeRabbit inference engine (openspec/AGENTS.md)

Ensure tasks.md contains implementation checklist with numbered sections and checkbox items

Files:

  • openspec/changes/add-artifact-workflow-cli/tasks.md
openspec/changes/*/proposal.md

📄 CodeRabbit inference engine (openspec/AGENTS.md)

Ensure proposal.md includes sections: Why (1-2 sentences), What Changes (bullet list with breaking change markers), and Impact (affected specs and code)

Files:

  • openspec/changes/add-artifact-workflow-cli/proposal.md
openspec/changes/**/specs/**/spec.md

📄 CodeRabbit inference engine (openspec/AGENTS.md)

openspec/changes/**/specs/**/spec.md: Use ## ADDED|MODIFIED|REMOVED|RENAMED Requirements headers in spec delta files
Include at least one #### Scenario: per requirement in spec delta files
Use #### Scenario: Name format (4 hashtags) for scenario headers, not bullets or bold text
Use ## ADDED Requirements for new orthogonal capabilities that can stand alone; use ## MODIFIED Requirements for behavior changes of existing requirements
When using MODIFIED Requirements, paste the full requirement block including header and all scenarios

Files:

  • openspec/changes/add-artifact-workflow-cli/specs/cli-workflow/spec.md
🧠 Learnings (9)
📓 Common learnings
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Applies to openspec/changes/**/*.md : Scaffold proposal using `proposal.md`, `tasks.md`, optional `design.md`, and delta specs under `openspec/changes/<id>/`
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
📚 Learning: 2025-11-25T01:08:19.004Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Applies to openspec/changes/*/tasks.md : Ensure `tasks.md` contains implementation checklist with numbered sections and checkbox items

Applied to files:

  • openspec/changes/add-artifact-workflow-cli/tasks.md
📚 Learning: 2025-11-25T01:08:19.004Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Applies to openspec/changes/**/*.md : Scaffold proposal using `proposal.md`, `tasks.md`, optional `design.md`, and delta specs under `openspec/changes/<id>/`

Applied to files:

  • openspec/changes/add-artifact-workflow-cli/tasks.md
  • openspec/changes/add-artifact-workflow-cli/proposal.md
  • openspec/changes/add-artifact-workflow-cli/design.md
  • openspec/changes/add-artifact-workflow-cli/specs/cli-workflow/spec.md
📚 Learning: 2025-11-25T01:08:19.004Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Applies to openspec/changes/*/proposal.md : Ensure `proposal.md` includes sections: Why (1-2 sentences), What Changes (bullet list with breaking change markers), and Impact (affected specs and code)

Applied to files:

  • openspec/changes/add-artifact-workflow-cli/tasks.md
  • openspec/changes/add-artifact-workflow-cli/proposal.md
  • openspec/changes/add-artifact-workflow-cli/design.md
  • openspec/changes/add-artifact-workflow-cli/specs/cli-workflow/spec.md
📚 Learning: 2025-11-25T01:08:02.839Z
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

Applied to files:

  • openspec/changes/add-artifact-workflow-cli/tasks.md
  • openspec/changes/add-artifact-workflow-cli/proposal.md
  • openspec/changes/add-artifact-workflow-cli/design.md
  • openspec/changes/add-artifact-workflow-cli/specs/cli-workflow/spec.md
📚 Learning: 2025-11-25T01:08:19.004Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Create `design.md` only when needed: cross-cutting changes, new external dependencies, significant data model changes, security/performance complexity, or pre-coding ambiguity

Applied to files:

  • openspec/changes/add-artifact-workflow-cli/design.md
📚 Learning: 2025-11-25T01:08:19.004Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Applies to openspec/changes/**/specs/**/spec.md : Use `## ADDED Requirements` for new orthogonal capabilities that can stand alone; use `## MODIFIED Requirements` for behavior changes of existing requirements

Applied to files:

  • openspec/changes/add-artifact-workflow-cli/design.md
  • openspec/changes/add-artifact-workflow-cli/specs/cli-workflow/spec.md
📚 Learning: 2025-11-25T01:08:19.004Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Applies to openspec/changes/**/specs/**/spec.md : Use `## ADDED|MODIFIED|REMOVED|RENAMED Requirements` headers in spec delta files

Applied to files:

  • openspec/changes/add-artifact-workflow-cli/design.md
  • openspec/changes/add-artifact-workflow-cli/specs/cli-workflow/spec.md
📚 Learning: 2025-11-25T01:08:19.004Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Use `openspec archive <change-id> --skip-specs --yes` for tooling-only changes

Applied to files:

  • openspec/changes/add-artifact-workflow-cli/design.md
🪛 LanguageTool
openspec/changes/add-artifact-workflow-cli/proposal.md

[style] ~3-~3: This phrase is redundant (‘I’ stands for ‘interface’). Use simply “CLI”.
Context: ...low management. Users currently have no CLI interface to: - See artifact completion status fo...

(ACRONYM_TAUTOLOGY)

🪛 markdownlint-cli2 (0.18.1)
openspec/changes/add-artifact-workflow-cli/design.md

27-27: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


46-46: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🔇 Additional comments (4)
openspec/changes/add-artifact-workflow-cli/specs/cli-workflow/spec.md (1)

1-149: Specification structure is well-formed and compliant.

The spec follows all guidelines: ## ADDED Requirements header, 8 well-scoped requirements with actionable descriptions, and 27 total scenarios all using the correct #### Scenario: Name format (4 hashtags). Each scenario includes WHEN/THEN patterns with clear acceptance criteria. Coverage includes command semantics, JSON output, error handling, UI considerations, and experimental isolation—providing a solid foundation for implementation.

openspec/changes/add-artifact-workflow-cli/proposal.md (1)

11-32: Proposal structure is well-formed and complete.

The What Changes section clearly lists the five new commands with "NEW" markers, explains integration points with existing modules (instruction-loader, artifact-graph, change-utils), and highlights the experimental isolation strategy. The Impact section properly documents affected specs and code locations. All required sections follow the proposal.md template.

openspec/changes/add-artifact-workflow-cli/tasks.md (1)

1-48: Tasks checklist is well-structured and comprehensive.

All seven sections (Core Implementation, CLI Registration, Output Formatting, Error Handling, Options, Testing, Documentation) use proper numbered hierarchy (1.1, 1.2, etc.) with checkbox items. Coverage spans command implementation, registration, output modes (text, JSON, colors, spinners), error cases, flags, and testing—aligning well with both the proposal and specification. 28 tasks provide a solid roadmap without being over-granular.

openspec/changes/add-artifact-workflow-cli/design.md (1)

1-111: Design decisions are well-documented and justified.

The document provides clear rationale for each major decision: top-level verb commands for UX fluidity, single-file isolation for easy removal, explicit --change for deterministic behavior, and structured subcommands for extensibility. The Goals/Non-Goals clarify scope, and the Risks table explicitly addresses trade-offs. Integration notes reference concrete module sources (artifact-graph, item-discovery.ts). This design document is justified per guidelines for cross-cutting decisions and experimental isolation strategy.

@vibe-kanban-cloud
Copy link

Review Complete

Your review story is ready!

View Story

Comment !reviewfast on this PR to re-generate the story.

Templates are schema-level, not change-level. The command now uses
--schema instead of --change for consistency with how templates
are actually resolved.
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
openspec/changes/add-artifact-workflow-cli/proposal.md (1)

11-24: Mark changes as non-breaking.

The "What Changes" section lists five NEW commands with no modifications to existing commands or specs. Consider explicitly indicating that these are non-breaking changes to align with proposal guidelines for breaking change markers:

 ## What Changes

-- **NEW**: `openspec status --change <id>` shows artifact completion state
-- **NEW**: `openspec next --change <id>` shows artifacts ready to create
-- **NEW**: `openspec instructions <artifact> --change <id>` outputs enriched template
-- **NEW**: `openspec templates [--schema <name>]` shows resolved template paths
-- **NEW**: `openspec new change <name>` creates a new change directory
+- **NEW** (non-breaking): `openspec status --change <id>` shows artifact completion state
+- **NEW** (non-breaking): `openspec next --change <id>` shows artifacts ready to create
+- **NEW** (non-breaking): `openspec instructions <artifact> --change <id>` outputs enriched template
+- **NEW** (non-breaking): `openspec templates [--schema <name>]` shows resolved template paths
+- **NEW** (non-breaking): `openspec new change <name>` creates a new change directory
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 39645d9 and 44ca42f.

📒 Files selected for processing (3)
  • openspec/changes/add-artifact-workflow-cli/design.md
  • openspec/changes/add-artifact-workflow-cli/proposal.md
  • openspec/changes/add-artifact-workflow-cli/specs/cli-workflow/spec.md
🧰 Additional context used
📓 Path-based instructions (3)
openspec/changes/**/*.md

📄 CodeRabbit inference engine (openspec/AGENTS.md)

Scaffold proposal using proposal.md, tasks.md, optional design.md, and delta specs under openspec/changes/<id>/

Files:

  • openspec/changes/add-artifact-workflow-cli/design.md
  • openspec/changes/add-artifact-workflow-cli/specs/cli-workflow/spec.md
  • openspec/changes/add-artifact-workflow-cli/proposal.md
openspec/changes/**/specs/**/spec.md

📄 CodeRabbit inference engine (openspec/AGENTS.md)

openspec/changes/**/specs/**/spec.md: Use ## ADDED|MODIFIED|REMOVED|RENAMED Requirements headers in spec delta files
Include at least one #### Scenario: per requirement in spec delta files
Use #### Scenario: Name format (4 hashtags) for scenario headers, not bullets or bold text
Use ## ADDED Requirements for new orthogonal capabilities that can stand alone; use ## MODIFIED Requirements for behavior changes of existing requirements
When using MODIFIED Requirements, paste the full requirement block including header and all scenarios

Files:

  • openspec/changes/add-artifact-workflow-cli/specs/cli-workflow/spec.md
openspec/changes/*/proposal.md

📄 CodeRabbit inference engine (openspec/AGENTS.md)

Ensure proposal.md includes sections: Why (1-2 sentences), What Changes (bullet list with breaking change markers), and Impact (affected specs and code)

Files:

  • openspec/changes/add-artifact-workflow-cli/proposal.md
🧠 Learnings (8)
📓 Common learnings
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Applies to openspec/changes/**/*.md : Scaffold proposal using `proposal.md`, `tasks.md`, optional `design.md`, and delta specs under `openspec/changes/<id>/`
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: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Applies to openspec/changes/*/tasks.md : Ensure `tasks.md` contains implementation checklist with numbered sections and checkbox items
📚 Learning: 2025-11-25T01:08:19.004Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Create `design.md` only when needed: cross-cutting changes, new external dependencies, significant data model changes, security/performance complexity, or pre-coding ambiguity

Applied to files:

  • openspec/changes/add-artifact-workflow-cli/design.md
📚 Learning: 2025-11-25T01:08:19.004Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Applies to openspec/changes/**/*.md : Scaffold proposal using `proposal.md`, `tasks.md`, optional `design.md`, and delta specs under `openspec/changes/<id>/`

Applied to files:

  • openspec/changes/add-artifact-workflow-cli/design.md
  • openspec/changes/add-artifact-workflow-cli/specs/cli-workflow/spec.md
  • openspec/changes/add-artifact-workflow-cli/proposal.md
📚 Learning: 2025-11-25T01:08:02.839Z
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

Applied to files:

  • openspec/changes/add-artifact-workflow-cli/design.md
  • openspec/changes/add-artifact-workflow-cli/specs/cli-workflow/spec.md
  • openspec/changes/add-artifact-workflow-cli/proposal.md
📚 Learning: 2025-11-25T01:08:19.004Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Applies to openspec/changes/*/proposal.md : Ensure `proposal.md` includes sections: Why (1-2 sentences), What Changes (bullet list with breaking change markers), and Impact (affected specs and code)

Applied to files:

  • openspec/changes/add-artifact-workflow-cli/specs/cli-workflow/spec.md
  • openspec/changes/add-artifact-workflow-cli/proposal.md
📚 Learning: 2025-11-25T01:08:19.004Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Applies to openspec/changes/**/specs/**/spec.md : Use `## ADDED Requirements` for new orthogonal capabilities that can stand alone; use `## MODIFIED Requirements` for behavior changes of existing requirements

Applied to files:

  • openspec/changes/add-artifact-workflow-cli/specs/cli-workflow/spec.md
📚 Learning: 2025-11-25T01:08:19.004Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Applies to openspec/changes/**/specs/**/spec.md : Use `## ADDED|MODIFIED|REMOVED|RENAMED Requirements` headers in spec delta files

Applied to files:

  • openspec/changes/add-artifact-workflow-cli/specs/cli-workflow/spec.md
📚 Learning: 2025-11-25T01:08:19.004Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Use `openspec archive <change-id> --skip-specs --yes` for tooling-only changes

Applied to files:

  • openspec/changes/add-artifact-workflow-cli/proposal.md
🪛 LanguageTool
openspec/changes/add-artifact-workflow-cli/proposal.md

[style] ~3-~3: This phrase is redundant (‘I’ stands for ‘interface’). Use simply “CLI”.
Context: ...low management. Users currently have no CLI interface to: - See artifact completion status fo...

(ACRONYM_TAUTOLOGY)

🔇 Additional comments (5)
openspec/changes/add-artifact-workflow-cli/design.md (2)

27-32: Clarify --schema flag scope across commands.

The command examples show --schema only for the templates command, but the spec.md file (Requirement: Schema Selection, line 122) requires openspec status --change <id> --schema tdd. Verify whether:

  1. --schema should apply to all workflow commands (status, next, instructions) or just templates, and
  2. Update command examples to reflect the actual design.

106-111: Verify referenced module functions.

The implementation notes reference specific functions like getActiveChangeIds() from item-discovery.ts, loadChangeContext() and formatChangeStatus() from instruction-loader, etc. Confirm these functions exist and are accessible from src/commands/artifact-workflow.ts before implementation begins.

openspec/changes/add-artifact-workflow-cli/specs/cli-workflow/spec.md (3)

79-93: Verify templates command signature matches design.

The "Templates Command" requirement (lines 76-93) specifies behavior for openspec templates [--schema <name>] (line 84), which aligns with design.md line 31. However, ensure the optional [--schema <name>] syntax is consistent with how other optional flags are handled in error messages and help text (e.g., whether omitting --schema should use a default or error).


132-142: Confirm color and spinner output implementation details.

The "Output Formatting" requirement (lines 132-142) specifies:

  • Color output using green (done), yellow (ready), red (blocked) — lines 134
  • Spinner display during loading — line 142

Ensure these visual implementations:

  1. Are compatible with the existing CLI framework (ora spinners, colors library, etc.)
  2. Handle both TTY and non-TTY environments correctly
  3. Respect --no-color flag and NO_COLOR environment variable globally

98-112: Verify "Create with description" scenario and UX flow.

The "New Change Command" requirement includes a scenario (lines 110-112) for openspec new change add-feature --description "Add new feature" that creates a change directory with description in README.md. Confirm:

  1. The --description flag is intentional (not mentioned in proposal.md or design.md).
  2. The implementation creates/updates README.md with the description.
  3. The change directory structure and initialization are consistent with existing change scaffolding.

Comment on lines +1 to +9
## Why

The ArtifactGraph (Slice 1) and InstructionLoader (Slice 3) provide programmatic APIs for artifact-based workflow management. Users currently have no CLI interface to:
- See artifact completion status for a change
- Discover what artifacts are ready to create
- Get enriched instructions for creating artifacts
- Create new changes with proper validation

This proposal adds CLI commands that expose the artifact workflow functionality to users and agents.
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Fix redundant "CLI interface" phrase.

Line 3 uses the redundant phrase "no CLI interface to:" which should be simplified to "no CLI to:" since CLI already means "command-line interface."

🔎 Proposed fix
-The ArtifactGraph (Slice 1) and InstructionLoader (Slice 3) provide programmatic APIs for artifact-based workflow management. Users currently have no CLI interface to:
+The ArtifactGraph (Slice 1) and InstructionLoader (Slice 3) provide programmatic APIs for artifact-based workflow management. Users currently have no CLI to:
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
## Why
The ArtifactGraph (Slice 1) and InstructionLoader (Slice 3) provide programmatic APIs for artifact-based workflow management. Users currently have no CLI interface to:
- See artifact completion status for a change
- Discover what artifacts are ready to create
- Get enriched instructions for creating artifacts
- Create new changes with proper validation
This proposal adds CLI commands that expose the artifact workflow functionality to users and agents.
## Why
The ArtifactGraph (Slice 1) and InstructionLoader (Slice 3) provide programmatic APIs for artifact-based workflow management. Users currently have no CLI to:
- See artifact completion status for a change
- Discover what artifacts are ready to create
- Get enriched instructions for creating artifacts
- Create new changes with proper validation
This proposal adds CLI commands that expose the artifact workflow functionality to users and agents.
🧰 Tools
🪛 LanguageTool

[style] ~3-~3: This phrase is redundant (‘I’ stands for ‘interface’). Use simply “CLI”.
Context: ...low management. Users currently have no CLI interface to: - See artifact completion status fo...

(ACRONYM_TAUTOLOGY)

🤖 Prompt for AI Agents
In openspec/changes/add-artifact-workflow-cli/proposal.md around lines 1 to 9,
the phrase "no CLI interface to:" is redundant; replace it with "no CLI to:" (or
"no CLI for:") so the sentence reads "Users currently have no CLI to:" and
update the bullet list punctuation if needed to keep grammatical consistency.

Comment on lines +114 to +127
### Requirement: Schema Selection
The system SHALL support custom schema selection for workflow commands.

#### Scenario: Default schema
- **WHEN** user runs workflow commands without `--schema`
- **THEN** the system uses the "spec-driven" schema

#### Scenario: Custom schema
- **WHEN** user runs `openspec status --change <id> --schema tdd`
- **THEN** the system uses the specified schema for artifact graph

#### Scenario: Unknown schema
- **WHEN** user specifies an unknown schema
- **THEN** the system displays an error listing available schemas
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

find openspec/changes/add-artifact-workflow-cli -type f -name "*.md" | head -20

Repository: Fission-AI/OpenSpec

Length of output: 292


🏁 Script executed:

cat -n openspec/changes/add-artifact-workflow-cli/design.md | head -50

Repository: Fission-AI/OpenSpec

Length of output: 1914


🏁 Script executed:

cat -n openspec/changes/add-artifact-workflow-cli/proposal.md | head -50

Repository: Fission-AI/OpenSpec

Length of output: 1973


🏁 Script executed:

cat -n openspec/changes/add-artifact-workflow-cli/design.md | tail -50

Repository: Fission-AI/OpenSpec

Length of output: 2011


🏁 Script executed:

cat -n openspec/changes/add-artifact-workflow-cli/proposal.md

Repository: Fission-AI/OpenSpec

Length of output: 1973


🏁 Script executed:

wc -l openspec/changes/add-artifact-workflow-cli/specs/cli-workflow/spec.md

Repository: Fission-AI/OpenSpec

Length of output: 136


🏁 Script executed:

cat -n openspec/changes/add-artifact-workflow-cli/specs/cli-workflow/spec.md | head -130

Repository: Fission-AI/OpenSpec

Length of output: 6419


Schema Selection requirement introduces scope not defined in design/proposal documents.

The "Schema Selection" requirement (lines 114-127) specifies --schema support for workflow commands, but design.md only shows --schema for the templates command (line 31). Key inconsistencies:

  1. Scope mismatch: spec.md line 122 shows openspec status --change <id> --schema tdd, but design.md (line 28) specifies openspec status --change <id> without --schema.
  2. Undocumented default: spec.md line 119 defines "spec-driven" as the default schema, but this is not documented in design.md or proposal.md.

The spec introduces new behavior not previously approved. Clarify whether --schema should apply to all workflow commands or only templates, and document the default schema name in design.md.

More specific capability name that clarifies which workflow the CLI
commands are for.
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (2)
openspec/changes/add-artifact-workflow-cli/proposal.md (1)

3-3: Fix the redundant "CLI interface" phrase.

This is a repeat of a past review comment: the phrase "CLI interface" is tautological since CLI already stands for "command-line interface." Simplify to "no CLI to:".

🔎 Proposed fix
-The ArtifactGraph (Slice 1) and InstructionLoader (Slice 3) provide programmatic APIs for artifact-based workflow management. Users currently have no CLI interface to:
+The ArtifactGraph (Slice 1) and InstructionLoader (Slice 3) provide programmatic APIs for artifact-based workflow management. Users currently have no CLI to:
openspec/changes/add-artifact-workflow-cli/specs/cli-artifact-workflow/spec.md (1)

8-32: ** Schema Selection scope inconsistency remains unresolved from previous review.**

The Schema Selection requirement (lines 114–127) shows --schema applied to the status command (line 122), but the Status Command requirement (lines 8–32) does not include any --schema variant scenarios. This creates structural confusion about which commands support schema selection.

Additionally, the previous review flagged that design.md only documents --schema for the templates command, yet this spec proposes it for status and other "workflow commands" without design documentation.

Per coding guidelines, spec changes require design justification. Either:

  1. Add --schema scenarios to each affected command requirement (Status, Next, Instructions), or
  2. Clarify in the Schema Selection requirement that it applies only to templates, and move schema handling into the Templates Command requirement.

Please confirm the design.md currently documents which commands support --schema, or provide updated design documentation if the schema scope has changed since the previous review:

#!/bin/bash
# Verify design.md documents which commands support --schema
grep -n "\-\-schema" openspec/changes/add-artifact-workflow-cli/design.md

Also applies to: 114-127

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 44ca42f and ac8f6d2.

📒 Files selected for processing (2)
  • openspec/changes/add-artifact-workflow-cli/proposal.md
  • openspec/changes/add-artifact-workflow-cli/specs/cli-artifact-workflow/spec.md
🧰 Additional context used
📓 Path-based instructions (3)
openspec/changes/**/*.md

📄 CodeRabbit inference engine (openspec/AGENTS.md)

Scaffold proposal using proposal.md, tasks.md, optional design.md, and delta specs under openspec/changes/<id>/

Files:

  • openspec/changes/add-artifact-workflow-cli/specs/cli-artifact-workflow/spec.md
  • openspec/changes/add-artifact-workflow-cli/proposal.md
openspec/changes/**/specs/**/spec.md

📄 CodeRabbit inference engine (openspec/AGENTS.md)

openspec/changes/**/specs/**/spec.md: Use ## ADDED|MODIFIED|REMOVED|RENAMED Requirements headers in spec delta files
Include at least one #### Scenario: per requirement in spec delta files
Use #### Scenario: Name format (4 hashtags) for scenario headers, not bullets or bold text
Use ## ADDED Requirements for new orthogonal capabilities that can stand alone; use ## MODIFIED Requirements for behavior changes of existing requirements
When using MODIFIED Requirements, paste the full requirement block including header and all scenarios

Files:

  • openspec/changes/add-artifact-workflow-cli/specs/cli-artifact-workflow/spec.md
openspec/changes/*/proposal.md

📄 CodeRabbit inference engine (openspec/AGENTS.md)

Ensure proposal.md includes sections: Why (1-2 sentences), What Changes (bullet list with breaking change markers), and Impact (affected specs and code)

Files:

  • openspec/changes/add-artifact-workflow-cli/proposal.md
🧠 Learnings (13)
📓 Common learnings
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Applies to openspec/changes/**/*.md : Scaffold proposal using `proposal.md`, `tasks.md`, optional `design.md`, and delta specs under `openspec/changes/<id>/`
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
📚 Learning: 2025-11-25T01:08:19.004Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Applies to openspec/changes/**/specs/**/spec.md : Use `## ADDED|MODIFIED|REMOVED|RENAMED Requirements` headers in spec delta files

Applied to files:

  • openspec/changes/add-artifact-workflow-cli/specs/cli-artifact-workflow/spec.md
📚 Learning: 2025-11-25T01:08:19.004Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Applies to openspec/changes/**/*.md : Scaffold proposal using `proposal.md`, `tasks.md`, optional `design.md`, and delta specs under `openspec/changes/<id>/`

Applied to files:

  • openspec/changes/add-artifact-workflow-cli/specs/cli-artifact-workflow/spec.md
  • openspec/changes/add-artifact-workflow-cli/proposal.md
📚 Learning: 2025-11-25T01:08:19.004Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Applies to openspec/changes/**/specs/**/spec.md : Use `## ADDED Requirements` for new orthogonal capabilities that can stand alone; use `## MODIFIED Requirements` for behavior changes of existing requirements

Applied to files:

  • openspec/changes/add-artifact-workflow-cli/specs/cli-artifact-workflow/spec.md
📚 Learning: 2025-11-25T01:08:02.839Z
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

Applied to files:

  • openspec/changes/add-artifact-workflow-cli/specs/cli-artifact-workflow/spec.md
  • openspec/changes/add-artifact-workflow-cli/proposal.md
📚 Learning: 2025-11-25T01:08:19.004Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Use `openspec archive <change-id> --skip-specs --yes` for tooling-only changes

Applied to files:

  • openspec/changes/add-artifact-workflow-cli/specs/cli-artifact-workflow/spec.md
📚 Learning: 2025-11-25T01:08:19.004Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Create `design.md` only when needed: cross-cutting changes, new external dependencies, significant data model changes, security/performance complexity, or pre-coding ambiguity

Applied to files:

  • openspec/changes/add-artifact-workflow-cli/specs/cli-artifact-workflow/spec.md
📚 Learning: 2025-11-25T01:08:19.004Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Applies to openspec/changes/*/proposal.md : Ensure `proposal.md` includes sections: Why (1-2 sentences), What Changes (bullet list with breaking change markers), and Impact (affected specs and code)

Applied to files:

  • openspec/changes/add-artifact-workflow-cli/specs/cli-artifact-workflow/spec.md
  • openspec/changes/add-artifact-workflow-cli/proposal.md
📚 Learning: 2025-11-25T01:08:19.004Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Applies to openspec/changes/**/specs/**/spec.md : Include at least one `#### Scenario:` per requirement in spec delta files

Applied to files:

  • openspec/changes/add-artifact-workflow-cli/specs/cli-artifact-workflow/spec.md
📚 Learning: 2025-11-25T01:08:02.839Z
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

Applied to files:

  • openspec/changes/add-artifact-workflow-cli/specs/cli-artifact-workflow/spec.md
📚 Learning: 2025-11-25T01:08:19.004Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Applies to openspec/specs/**/spec.md : Use SHALL/MUST for normative requirements in spec files; avoid should/may unless intentionally non-normative

Applied to files:

  • openspec/changes/add-artifact-workflow-cli/specs/cli-artifact-workflow/spec.md
📚 Learning: 2025-11-25T01:08:19.004Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Applies to openspec/changes/**/specs/**/spec.md : When using MODIFIED Requirements, paste the full requirement block including header and all scenarios

Applied to files:

  • openspec/changes/add-artifact-workflow-cli/specs/cli-artifact-workflow/spec.md
📚 Learning: 2025-11-25T01:08:19.004Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Run `openspec validate [change-id] --strict` before requesting approval

Applied to files:

  • openspec/changes/add-artifact-workflow-cli/specs/cli-artifact-workflow/spec.md
🪛 LanguageTool
openspec/changes/add-artifact-workflow-cli/proposal.md

[style] ~3-~3: This phrase is redundant (‘I’ stands for ‘interface’). Use simply “CLI”.
Context: ...low management. Users currently have no CLI interface to: - See artifact completion status fo...

(ACRONYM_TAUTOLOGY)

🔇 Additional comments (1)
openspec/changes/add-artifact-workflow-cli/proposal.md (1)

1-32: Proposal structure meets all requirements.

The document follows the required scaffold structure with all three sections (Why, What Changes, Impact) clearly articulated. The "Why" section concisely explains the motivation, "What Changes" enumerates the five new commands with clear integration points and experimental isolation notes, and "Impact" precisely identifies affected specs and code files. The use of NEW markers is appropriate since no breaking changes are introduced.

Comment on lines +144 to +151
### Requirement: Experimental Isolation
The system SHALL implement artifact workflow commands in isolation for easy removal.

#### Scenario: Single file implementation
- **WHEN** artifact workflow feature is implemented
- **THEN** all commands are in `src/commands/artifact-workflow.ts`

#### Scenario: Help text marking
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

Experimental Isolation requirement is incomplete without help text content.

Line 152–153 state that help text "SHALL indicate the command is experimental," but the requirement does not specify the exact help text string or where it appears in the implementation. This leaves ambiguity for developers about compliance.

Add a clarifying scenario defining the exact help text format:

🔎 Proposed addition
 #### Scenario: Help text marking
 - **WHEN** user runs `--help` on any artifact workflow command
 - **THEN** help text indicates the command is experimental
+
+#### Scenario: Help text format
+- **WHEN** user runs `openspec status --help`
+- **THEN** help text includes prefix or footer marking: "(Experimental)" or similar clear indicator

Based on coding guidelines, each scenario should be concrete enough for implementation; this adds the needed specificity.

Add experimental CLI commands for artifact-based workflow management:
- `openspec status --change <id>` - display artifact completion status
- `openspec next --change <id>` - show artifacts ready to create
- `openspec instructions <artifact> --change <id>` - output enriched template
- `openspec templates [--schema <name>]` - show resolved template paths
- `openspec new change <name>` - create new change directory

Features:
- JSON output support (--json flag) for all commands
- Color-coded status indicators (green/yellow/red)
- Progress spinners during loading
- --no-color and NO_COLOR env support
- --schema option for custom schema selection
- Comprehensive error handling with helpful messages

All commands are isolated in src/commands/artifact-workflow.ts for easy
removal if the feature doesn't work out. Help text marks them as experimental.
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/commands/artifact-workflow.ts (1)

349-351: Consider a top-level import for consistency.

The dynamic import of getUserSchemasDir is different from other imports in this file. Unless there's a code-splitting reason, a static import at the top would be more consistent.

🔎 Suggested change

Add to imports at top of file:

import { getUserSchemasDir } from '../core/artifact-graph/resolver.js';

Then simplify line 349-351:

-    const { getUserSchemasDir } = await import('../core/artifact-graph/resolver.js');
-    const userSchemasDir = getUserSchemasDir();
+    const userSchemasDir = getUserSchemasDir();
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ac8f6d2 and a91adbd.

📒 Files selected for processing (3)
  • openspec/changes/add-artifact-workflow-cli/tasks.md
  • src/cli/index.ts
  • src/commands/artifact-workflow.ts
✅ Files skipped from review due to trivial changes (1)
  • openspec/changes/add-artifact-workflow-cli/tasks.md
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Applies to openspec/changes/**/*.md : Scaffold proposal using `proposal.md`, `tasks.md`, optional `design.md`, and delta specs under `openspec/changes/<id>/`
🧬 Code graph analysis (2)
src/commands/artifact-workflow.ts (2)
src/utils/item-discovery.ts (1)
  • getActiveChangeIds (4-23)
src/core/artifact-graph/graph.ts (1)
  • isComplete (139-146)
src/cli/index.ts (1)
src/commands/artifact-workflow.ts (1)
  • registerArtifactWorkflowCommands (431-515)
🔇 Additional comments (8)
src/cli/index.ts (1)

17-17: LGTM!

The import and registration follow the established patterns in this file (registerSpecCommand, registerConfigCommand). Placement before program.parse() is correct, and the comment clearly indicates the experimental nature of these commands.

Also applies to: 320-322

src/commands/artifact-workflow.ts (7)

1-28: Well-documented experimental feature.

The header comment clearly explains the purpose and provides explicit removal instructions, which is excellent for experimental feature isolation.


35-69: LGTM!

The color helpers properly respect the NO_COLOR environment variable and provide a clean abstraction for status-based coloring.


74-115: Good UX for validation errors.

The validation helpers provide helpful, actionable error messages by listing available changes/schemas when the requested one isn't found.


189-228: LGTM!

The next command handles edge cases well (all complete, none ready), and the suggestion to run status when blocked is helpful for users.


240-287: LGTM!

The instructions command provides comprehensive artifact details and handles missing artifacts gracefully with helpful error messages listing valid artifact IDs.


431-515: LGTM!

The command registration follows a consistent pattern with proper error handling. All commands are clearly marked as experimental in their descriptions, and the new command group structure is clean.


408-414: No action needed—no README.md conflict exists.

The createChange function only validates the change name, checks if the directory exists, and creates the necessary directories. It does not create a README.md file. The code at lines 408-414 safely creates a README.md only when a description is provided, with no risk of overwriting existing content.

Likely an incorrect or invalid review comment.

Comment on lines +173 to +177
if (status.isComplete) {
console.log();
console.log(chalk.green('All artifacts complete!'));
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Inconsistent color handling with NO_COLOR support.

Line 175 uses chalk.green directly, bypassing the isColorDisabled() check established earlier in getStatusColor(). This will output ANSI codes even when NO_COLOR=1 is set.

The same pattern appears in printInstructionsText (lines 291, 305) and nextCommand (line 209).

🔎 Proposed fix

Consider creating a helper or consistently using the color pattern:

   if (status.isComplete) {
     console.log();
-    console.log(chalk.green('All artifacts complete!'));
+    const successColor = getStatusColor('done');
+    console.log(successColor('All artifacts complete!'));
   }

Apply similar fixes to:

  • Line 209 in nextCommand
  • Lines 291 and 305 in printInstructionsText
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if (status.isComplete) {
console.log();
console.log(chalk.green('All artifacts complete!'));
}
}
if (status.isComplete) {
console.log();
const successColor = getStatusColor('done');
console.log(successColor('All artifacts complete!'));
}
}
🤖 Prompt for AI Agents
In src/commands/artifact-workflow.ts around lines 173–177 (and also address
similar occurrences at line 209 and lines 291 & 305), direct calls to
chalk.green bypass the module's NO_COLOR-aware logic; replace these direct
chalk.color calls with the centralized color helper used elsewhere (e.g., call
the existing getStatusColor() or the same NO_COLOR-aware chalk instance) so
coloring respects isColorDisabled()/NO_COLOR, and update the three other
locations (nextCommand at 209 and printInstructionsText at 291 and 305) the same
way to keep color handling consistent.

The schema used specs/*.md but specs are stored as specs/<capability>/spec.md.
Updated to specs/**/*.md so openspec status/next correctly detect spec completion.
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
test/commands/artifact-workflow.test.ts (1)

54-57: Update comment to reflect recursive glob pattern.

The comment references specs/*.md, but the schema was just updated to specs/**/*.md to support nested directories. Consider updating this comment and potentially adding a test case that creates nested specs (e.g., specs/capability/spec.md) to verify the recursive glob behavior.

🔎 Proposed update
-    // specs artifact uses glob pattern "specs/*.md" - files directly in specs/ directory
+    // specs artifact uses glob pattern "specs/**/*.md" - supports nested directories
     const specsDir = path.join(changeDir, 'specs');
     await fs.mkdir(specsDir, { recursive: true });
     await fs.writeFile(path.join(specsDir, 'test-spec.md'), '## Purpose\nTest spec.');

Optionally, add a nested spec file to better test the recursive glob:

await fs.mkdir(path.join(specsDir, 'capability'), { recursive: true });
await fs.writeFile(
  path.join(specsDir, 'capability', 'nested-spec.md'),
  '## Purpose\nNested spec.'
);
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a91adbd and 17016d5.

📒 Files selected for processing (2)
  • schemas/spec-driven/schema.yaml
  • test/commands/artifact-workflow.test.ts
🧰 Additional context used
🧠 Learnings (7)
📓 Common learnings
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Applies to openspec/changes/**/*.md : Scaffold proposal using `proposal.md`, `tasks.md`, optional `design.md`, and delta specs under `openspec/changes/<id>/`
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
📚 Learning: 2025-11-25T01:08:19.004Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Applies to openspec/changes/**/*.md : Scaffold proposal using `proposal.md`, `tasks.md`, optional `design.md`, and delta specs under `openspec/changes/<id>/`

Applied to files:

  • schemas/spec-driven/schema.yaml
📚 Learning: 2025-11-25T01:08:19.004Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Applies to openspec/changes/**/specs/**/spec.md : Use `## ADDED|MODIFIED|REMOVED|RENAMED Requirements` headers in spec delta files

Applied to files:

  • schemas/spec-driven/schema.yaml
📚 Learning: 2025-11-25T01:08:19.004Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Applies to openspec/changes/**/specs/**/spec.md : Include at least one `#### Scenario:` per requirement in spec delta files

Applied to files:

  • schemas/spec-driven/schema.yaml
📚 Learning: 2025-11-25T01:08:19.004Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Applies to openspec/changes/*/proposal.md : Ensure `proposal.md` includes sections: Why (1-2 sentences), What Changes (bullet list with breaking change markers), and Impact (affected specs and code)

Applied to files:

  • schemas/spec-driven/schema.yaml
📚 Learning: 2025-11-25T01:08:02.839Z
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

Applied to files:

  • schemas/spec-driven/schema.yaml
📚 Learning: 2025-11-25T01:08:19.004Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Applies to openspec/changes/*/tasks.md : Ensure `tasks.md` contains implementation checklist with numbered sections and checkbox items

Applied to files:

  • schemas/spec-driven/schema.yaml
🧬 Code graph analysis (1)
test/commands/artifact-workflow.test.ts (2)
test/helpers/run-cli.ts (1)
  • runCLI (75-148)
scripts/postinstall.js (1)
  • stat (44-44)
🔇 Additional comments (7)
schemas/spec-driven/schema.yaml (1)

11-11: LGTM! Recursive glob enables nested spec organization.

The change from specs/*.md to specs/**/*.md correctly enables discovery of specs in nested capability directories, supporting the new artifact-workflow CLI commands.

test/commands/artifact-workflow.test.ts (6)

67-156: Excellent test coverage for status command.

The test suite comprehensively covers happy paths (minimal/partial/complete changes, JSON output), error cases (missing/unknown change, unknown schema), and the --schema option.


158-207: LGTM! Next command tests are well-structured.

Tests appropriately verify dependency-based artifact ordering, completion states, JSON output, and error handling.


209-270: Instructions command tests are comprehensive.

Tests cover artifact instructions display, dependency blocking, JSON output, and error cases (missing/unknown artifact). The blocked artifact warning test is particularly valuable.


272-307: Templates command tests cover all scenarios.

Tests validate template path display for default/custom schemas, JSON output structure, and error handling for unknown schemas.


309-354: New change command tests properly verify filesystem operations.

Tests correctly validate directory creation, README generation with --description flag, and error cases (invalid/duplicate/missing name).


356-386: Help text tests ensure experimental marking.

Tests systematically verify that all artifact-workflow commands display the [Experimental] tag in their help text, which aligns with the design decision to mark these commands for easy removal.

- Move change to archive/2025-12-28-add-artifact-workflow-cli
- Create cli-artifact-workflow spec
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

♻️ Duplicate comments (1)
openspec/changes/archive/2025-12-28-add-artifact-workflow-cli/proposal.md (1)

3-3: Fix redundant "CLI interface" phrase.

Line 3 uses the redundant phrase "no CLI interface to:" which should be simplified to "no CLI to:" since CLI already stands for "command-line interface."

🔎 Proposed fix
-The ArtifactGraph (Slice 1) and InstructionLoader (Slice 3) provide programmatic APIs for artifact-based workflow management. Users currently have no CLI interface to:
+The ArtifactGraph (Slice 1) and InstructionLoader (Slice 3) provide programmatic APIs for artifact-based workflow management. Users currently have no CLI to:
🧹 Nitpick comments (1)
openspec/changes/archive/2025-12-28-add-artifact-workflow-cli/proposal.md (1)

1-10: Condense the Why section to 1–2 sentences.

The Why section should open with a concise problem statement in 1–2 sentences, then optionally provide supporting context. Currently, lines 3–7 form a multi-bullet list explaining user needs, which makes the section longer and less punchy than the convention allows.

Consider restructuring to lead with a single summary sentence (e.g., "Users need CLI access to artifact workflow features") followed by the inline or collapsed list of capabilities, or consolidate the bullets into narrative form.

🔎 Suggested restructuring
 ## Why
 
-The ArtifactGraph (Slice 1) and InstructionLoader (Slice 3) provide programmatic APIs for artifact-based workflow management. Users currently have no CLI to:
-- See artifact completion status for a change
-- Discover what artifacts are ready to create
-- Get enriched instructions for creating artifacts
-- Create new changes with proper validation
+The ArtifactGraph (Slice 1) and InstructionLoader (Slice 3) provide programmatic APIs for artifact-based workflow management, but users lack CLI access to these capabilities: artifact status, discovery of ready artifacts, enriched instructions, and change creation.
 
-This proposal adds CLI commands that expose the artifact workflow functionality to users and agents.
+This proposal adds top-level CLI commands to bridge this gap.

Based on learnings, proposal scaffolds should follow the convention of 1–2 concise sentences in the Why section. Does your version match the project's style guide (e.g., in openspec/AGENTS.md)?

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f874720 and 9eb2241.

📒 Files selected for processing (5)
  • openspec/changes/archive/2025-12-28-add-artifact-workflow-cli/design.md
  • openspec/changes/archive/2025-12-28-add-artifact-workflow-cli/proposal.md
  • openspec/changes/archive/2025-12-28-add-artifact-workflow-cli/specs/cli-artifact-workflow/spec.md
  • openspec/changes/archive/2025-12-28-add-artifact-workflow-cli/tasks.md
  • openspec/specs/cli-artifact-workflow/spec.md
✅ Files skipped from review due to trivial changes (2)
  • openspec/specs/cli-artifact-workflow/spec.md
  • openspec/changes/archive/2025-12-28-add-artifact-workflow-cli/specs/cli-artifact-workflow/spec.md
🧰 Additional context used
📓 Path-based instructions (1)
openspec/changes/**/*.md

📄 CodeRabbit inference engine (openspec/AGENTS.md)

Scaffold proposal using proposal.md, tasks.md, optional design.md, and delta specs under openspec/changes/<id>/

Files:

  • openspec/changes/archive/2025-12-28-add-artifact-workflow-cli/design.md
  • openspec/changes/archive/2025-12-28-add-artifact-workflow-cli/proposal.md
  • openspec/changes/archive/2025-12-28-add-artifact-workflow-cli/tasks.md
🧠 Learnings (6)
📓 Common learnings
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Applies to openspec/changes/**/*.md : Scaffold proposal using `proposal.md`, `tasks.md`, optional `design.md`, and delta specs under `openspec/changes/<id>/`
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: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Use `openspec archive <change-id> --skip-specs --yes` for tooling-only changes
📚 Learning: 2025-11-25T01:08:19.004Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Use `openspec archive <change-id> --skip-specs --yes` for tooling-only changes

Applied to files:

  • openspec/changes/archive/2025-12-28-add-artifact-workflow-cli/design.md
  • openspec/changes/archive/2025-12-28-add-artifact-workflow-cli/proposal.md
📚 Learning: 2025-11-25T01:08:19.004Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Applies to openspec/changes/**/*.md : Scaffold proposal using `proposal.md`, `tasks.md`, optional `design.md`, and delta specs under `openspec/changes/<id>/`

Applied to files:

  • openspec/changes/archive/2025-12-28-add-artifact-workflow-cli/design.md
  • openspec/changes/archive/2025-12-28-add-artifact-workflow-cli/proposal.md
📚 Learning: 2025-11-25T01:08:02.839Z
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

Applied to files:

  • openspec/changes/archive/2025-12-28-add-artifact-workflow-cli/proposal.md
  • openspec/changes/archive/2025-12-28-add-artifact-workflow-cli/tasks.md
📚 Learning: 2025-11-25T01:08:19.004Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Applies to openspec/changes/*/proposal.md : Ensure `proposal.md` includes sections: Why (1-2 sentences), What Changes (bullet list with breaking change markers), and Impact (affected specs and code)

Applied to files:

  • openspec/changes/archive/2025-12-28-add-artifact-workflow-cli/proposal.md
📚 Learning: 2025-11-25T01:08:19.004Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Applies to openspec/changes/*/tasks.md : Ensure `tasks.md` contains implementation checklist with numbered sections and checkbox items

Applied to files:

  • openspec/changes/archive/2025-12-28-add-artifact-workflow-cli/tasks.md
🪛 LanguageTool
openspec/changes/archive/2025-12-28-add-artifact-workflow-cli/proposal.md

[style] ~3-~3: This phrase is redundant (‘I’ stands for ‘interface’). Use simply “CLI”.
Context: ...low management. Users currently have no CLI interface to: - See artifact completion status fo...

(ACRONYM_TAUTOLOGY)

🪛 markdownlint-cli2 (0.18.1)
openspec/changes/archive/2025-12-28-add-artifact-workflow-cli/design.md

27-27: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


46-46: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🔇 Additional comments (7)
openspec/changes/archive/2025-12-28-add-artifact-workflow-cli/proposal.md (2)

11-25: Approve structure and content of What Changes and implementation details.

The What Changes section properly lists all new commands with NEW markers, describes the integration points with existing modules, and clearly explains the experimental isolation strategy. The section aligns well with the PR objectives and architecture decisions.


26-33: Approve Impact section.

The Impact section correctly documents affected specs and code, notes the lack of breaking changes, and references the prior slices. Completeness looks good.

openspec/changes/archive/2025-12-28-add-artifact-workflow-cli/design.md (3)

27-33: Add language specification to fenced code block.

Line 27 opens a fenced code block but omits the language tag. This should be marked as bash to enable proper syntax highlighting.

-```
+```bash
 openspec status --change <id>
 openspec next --change <id>
 openspec instructions <artifact> --change <id>
 openspec templates [--schema <name>]
 openspec new change <name>
-```
+```bash

[suggest_minor_issue]


46-48: Add language specification to fenced code block.

Line 46 opens a fenced code block but omits the language tag. Since this is a file path reference, use a generic marker:

-```
+```plaintext
 src/commands/artifact-workflow.ts
-```
+```plaintext

[suggest_minor_issue]


1-112: Design document is well-structured and comprehensive.

The document effectively scaffolds the design decisions for the artifact workflow CLI feature, following the expected change proposal pattern. Clear rationale for top-level commands, experimental isolation strategy, deterministic CLI design, and error handling. The risks/trade-offs table clearly articulates what has been accepted. Implementation notes ground the design in concrete file locations and dependencies.

openspec/changes/archive/2025-12-28-add-artifact-workflow-cli/tasks.md (2)

1-47: Task list structure and coverage looks good.

The task list follows the required format with numbered sections and checkbox items, and comprehensively covers the artifact workflow CLI implementation across all key areas: core commands, CLI registration, output formatting, error handling, options, testing, and documentation. All implementation tasks (1–6) are marked complete.


48-48: Clarify the intent and status of the post-archive documentation task.

Task 7.2 ("Update AGENTS.md with new commands (post-archive)") is incomplete and explicitly deferred with a "(post-archive)" note. Since this change has already been archived, clarify whether this task should:

  • Be removed entirely (if documentation updates are not planned for archived changes);
  • Be marked as "intentionally deferred for future release cycle" with a tracking issue link; or
  • Be completed and marked done (if it should have been finished before archiving).

This ensures clarity on the final documentation state of the archived change.

- Update artifact workflow commands to work with scaffolded changes
- Add draft changes section to dashboard view
- Fix completed changes to require tasks.total > 0
- Archive unify-change-state-model change
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

♻️ Duplicate comments (1)
src/commands/artifact-workflow.ts (1)

192-196: Inconsistent NO_COLOR handling remains.

This is a duplicate of a previous review comment. Line 194 uses chalk.green directly, bypassing the isColorDisabled() check. The same issue exists at line 228 and lines 310, 324.

🧹 Nitpick comments (3)
src/commands/artifact-workflow.ts (1)

428-433: Unnecessary dynamic import of fs.

The fs module is already imported at line 16. Use fs.promises.writeFile instead of dynamically importing.

🔎 Proposed fix
     // If description provided, create README.md with description
     if (options.description) {
-      const { promises: fs } = await import('fs');
       const changeDir = path.join(projectRoot, 'openspec', 'changes', name);
       const readmePath = path.join(changeDir, 'README.md');
-      await fs.writeFile(readmePath, `# ${name}\n\n${options.description}\n`, 'utf-8');
+      await fs.promises.writeFile(readmePath, `# ${name}\n\n${options.description}\n`, 'utf-8');
     }
src/core/view.ts (1)

164-166: Consider stronger typing for changesData parameter.

The any[] types work but lose type safety. Consider using the actual return type from getChangesData.

🔎 Proposed improvement
   private displaySummary(
-    changesData: { draft: any[]; active: any[]; completed: any[] },
+    changesData: {
+      draft: Array<{ name: string }>;
+      active: Array<{ name: string; progress: { total: number; completed: number } }>;
+      completed: Array<{ name: string }>;
+    },
     specsData: any[]
   ): void {
openspec/changes/archive/2025-12-29-unify-change-state-model/design.md (1)

49-69: Add language specifiers to fenced code blocks.

Static analysis flagged missing language specifiers on lines 49 and 57. While these are output examples rather than code, adding a language tag (e.g., text or plaintext) improves consistency.

🔎 Proposed fix
 **Before:**
-```
+```text
 Completed Changes
 ─────────────────
   ✓ add-feature        (all tasks done - correct)
   ✓ test-workflow      (no tasks - WRONG)

After:
- +text
Draft Changes
─────────────────

</details>

</blockquote></details>

</blockquote></details>

<details>
<summary>📜 Review details</summary>

**Configuration used**: Path: .coderabbit.yaml

**Review profile**: CHILL

**Plan**: Pro

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between 9eb22410a901cc9ee856df493c4bc46b32a3efef and 4f47bd2f37d7ecb89e2d11dc7f120d099030100e.

</details>

<details>
<summary>📒 Files selected for processing (11)</summary>

* `openspec/changes/archive/2025-12-29-unify-change-state-model/design.md`
* `openspec/changes/archive/2025-12-29-unify-change-state-model/proposal.md`
* `openspec/changes/archive/2025-12-29-unify-change-state-model/specs/cli-artifact-workflow/spec.md`
* `openspec/changes/archive/2025-12-29-unify-change-state-model/specs/cli-view/spec.md`
* `openspec/changes/archive/2025-12-29-unify-change-state-model/tasks.md`
* `openspec/specs/cli-artifact-workflow/spec.md`
* `openspec/specs/cli-view/spec.md`
* `src/commands/artifact-workflow.ts`
* `src/core/view.ts`
* `test/commands/artifact-workflow.test.ts`
* `test/core/view.test.ts`

</details>

<details>
<summary>✅ Files skipped from review due to trivial changes (1)</summary>

* openspec/changes/archive/2025-12-29-unify-change-state-model/tasks.md

</details>

<details>
<summary>🚧 Files skipped from review as they are similar to previous changes (2)</summary>

* test/commands/artifact-workflow.test.ts
* openspec/specs/cli-artifact-workflow/spec.md

</details>

<details>
<summary>🧰 Additional context used</summary>

<details>
<summary>📓 Path-based instructions (3)</summary>

<details>
<summary>openspec/changes/**/*.md</summary>


**📄 CodeRabbit inference engine (openspec/AGENTS.md)**

> Scaffold proposal using `proposal.md`, `tasks.md`, optional `design.md`, and delta specs under `openspec/changes/<id>/`

Files:
- `openspec/changes/archive/2025-12-29-unify-change-state-model/specs/cli-view/spec.md`
- `openspec/changes/archive/2025-12-29-unify-change-state-model/proposal.md`
- `openspec/changes/archive/2025-12-29-unify-change-state-model/specs/cli-artifact-workflow/spec.md`
- `openspec/changes/archive/2025-12-29-unify-change-state-model/design.md`

</details>
<details>
<summary>openspec/changes/**/specs/**/spec.md</summary>


**📄 CodeRabbit inference engine (openspec/AGENTS.md)**

> `openspec/changes/**/specs/**/spec.md`: Use `## ADDED|MODIFIED|REMOVED|RENAMED Requirements` headers in spec delta files
> Include at least one `#### Scenario:` per requirement in spec delta files
> Use `#### Scenario: Name` format (4 hashtags) for scenario headers, not bullets or bold text
> Use `## ADDED Requirements` for new orthogonal capabilities that can stand alone; use `## MODIFIED Requirements` for behavior changes of existing requirements
> When using MODIFIED Requirements, paste the full requirement block including header and all scenarios

Files:
- `openspec/changes/archive/2025-12-29-unify-change-state-model/specs/cli-view/spec.md`
- `openspec/changes/archive/2025-12-29-unify-change-state-model/specs/cli-artifact-workflow/spec.md`

</details>
<details>
<summary>openspec/specs/**/spec.md</summary>


**📄 CodeRabbit inference engine (openspec/AGENTS.md)**

> Use SHALL/MUST for normative requirements in spec files; avoid should/may unless intentionally non-normative

Files:
- `openspec/specs/cli-view/spec.md`

</details>

</details><details>
<summary>🧠 Learnings (13)</summary>

<details>
<summary>📓 Common learnings</summary>

Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Applies to openspec/changes/**/*.md : Scaffold proposal using proposal.md, tasks.md, optional design.md, and delta specs under openspec/changes/<id>/


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


</details>
<details>
<summary>📚 Learning: 2025-11-25T01:08:19.004Z</summary>

Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Applies to openspec/changes/*/tasks.md : Ensure tasks.md contains implementation checklist with numbered sections and checkbox items


**Applied to files:**
- `test/core/view.test.ts`
- `openspec/changes/archive/2025-12-29-unify-change-state-model/specs/cli-view/spec.md`
- `openspec/changes/archive/2025-12-29-unify-change-state-model/proposal.md`
- `openspec/specs/cli-view/spec.md`

</details>
<details>
<summary>📚 Learning: 2025-11-25T01:08:19.004Z</summary>

Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Applies to openspec/changes//specs//spec.md : Use ## ADDED|MODIFIED|REMOVED|RENAMED Requirements headers in spec delta files


**Applied to files:**
- `openspec/changes/archive/2025-12-29-unify-change-state-model/specs/cli-view/spec.md`
- `openspec/changes/archive/2025-12-29-unify-change-state-model/proposal.md`
- `openspec/changes/archive/2025-12-29-unify-change-state-model/specs/cli-artifact-workflow/spec.md`
- `openspec/specs/cli-view/spec.md`

</details>
<details>
<summary>📚 Learning: 2025-11-25T01:08:19.004Z</summary>

Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Applies to openspec/changes/**/*.md : Scaffold proposal using proposal.md, tasks.md, optional design.md, and delta specs under openspec/changes/<id>/


**Applied to files:**
- `openspec/changes/archive/2025-12-29-unify-change-state-model/specs/cli-view/spec.md`
- `openspec/changes/archive/2025-12-29-unify-change-state-model/proposal.md`
- `openspec/changes/archive/2025-12-29-unify-change-state-model/specs/cli-artifact-workflow/spec.md`
- `openspec/changes/archive/2025-12-29-unify-change-state-model/design.md`
- `openspec/specs/cli-view/spec.md`
- `src/core/view.ts`

</details>
<details>
<summary>📚 Learning: 2025-11-25T01:08:19.004Z</summary>

Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Applies to openspec/changes//specs//spec.md : Include at least one #### Scenario: per requirement in spec delta files


**Applied to files:**
- `openspec/changes/archive/2025-12-29-unify-change-state-model/specs/cli-view/spec.md`
- `openspec/changes/archive/2025-12-29-unify-change-state-model/specs/cli-artifact-workflow/spec.md`
- `openspec/specs/cli-view/spec.md`

</details>
<details>
<summary>📚 Learning: 2025-11-25T01:08:19.004Z</summary>

Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Applies to openspec/changes/*/proposal.md : Ensure proposal.md includes sections: Why (1-2 sentences), What Changes (bullet list with breaking change markers), and Impact (affected specs and code)


**Applied to files:**
- `openspec/changes/archive/2025-12-29-unify-change-state-model/specs/cli-view/spec.md`
- `openspec/changes/archive/2025-12-29-unify-change-state-model/proposal.md`
- `openspec/changes/archive/2025-12-29-unify-change-state-model/specs/cli-artifact-workflow/spec.md`
- `openspec/specs/cli-view/spec.md`

</details>
<details>
<summary>📚 Learning: 2025-11-25T01:08:19.004Z</summary>

Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Applies to openspec/changes//specs//spec.md : Use ## ADDED Requirements for new orthogonal capabilities that can stand alone; use ## MODIFIED Requirements for behavior changes of existing requirements


**Applied to files:**
- `openspec/changes/archive/2025-12-29-unify-change-state-model/specs/cli-view/spec.md`
- `openspec/changes/archive/2025-12-29-unify-change-state-model/proposal.md`
- `openspec/changes/archive/2025-12-29-unify-change-state-model/specs/cli-artifact-workflow/spec.md`
- `openspec/specs/cli-view/spec.md`

</details>
<details>
<summary>📚 Learning: 2025-11-25T01:08:19.004Z</summary>

Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Create design.md only when needed: cross-cutting changes, new external dependencies, significant data model changes, security/performance complexity, or pre-coding ambiguity


**Applied to files:**
- `openspec/changes/archive/2025-12-29-unify-change-state-model/specs/cli-view/spec.md`
- `openspec/changes/archive/2025-12-29-unify-change-state-model/proposal.md`
- `openspec/changes/archive/2025-12-29-unify-change-state-model/design.md`

</details>
<details>
<summary>📚 Learning: 2025-11-25T01:08:19.004Z</summary>

Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Applies to openspec/changes//specs//spec.md : When using MODIFIED Requirements, paste the full requirement block including header and all scenarios


**Applied to files:**
- `openspec/changes/archive/2025-12-29-unify-change-state-model/specs/cli-view/spec.md`
- `openspec/changes/archive/2025-12-29-unify-change-state-model/specs/cli-artifact-workflow/spec.md`
- `openspec/specs/cli-view/spec.md`

</details>
<details>
<summary>📚 Learning: 2025-11-25T01:08:02.839Z</summary>

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


**Applied to files:**
- `openspec/changes/archive/2025-12-29-unify-change-state-model/specs/cli-view/spec.md`
- `openspec/changes/archive/2025-12-29-unify-change-state-model/proposal.md`
- `openspec/changes/archive/2025-12-29-unify-change-state-model/specs/cli-artifact-workflow/spec.md`

</details>
<details>
<summary>📚 Learning: 2025-11-25T01:08:02.839Z</summary>

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


**Applied to files:**
- `openspec/changes/archive/2025-12-29-unify-change-state-model/proposal.md`

</details>
<details>
<summary>📚 Learning: 2025-11-25T01:08:19.004Z</summary>

Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Use openspec archive <change-id> --skip-specs --yes for tooling-only changes


**Applied to files:**
- `openspec/changes/archive/2025-12-29-unify-change-state-model/specs/cli-artifact-workflow/spec.md`

</details>
<details>
<summary>📚 Learning: 2025-11-25T01:08:19.004Z</summary>

Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Applies to openspec/changes//specs//spec.md : Use #### Scenario: Name format (4 hashtags) for scenario headers, not bullets or bold text


**Applied to files:**
- `openspec/specs/cli-view/spec.md`

</details>

</details><details>
<summary>🧬 Code graph analysis (2)</summary>

<details>
<summary>src/commands/artifact-workflow.ts (1)</summary><blockquote>

<details>
<summary>src/core/artifact-graph/graph.ts (1)</summary>

* `isComplete` (139-146)

</details>

</blockquote></details>
<details>
<summary>src/core/view.ts (1)</summary><blockquote>

<details>
<summary>src/utils/task-progress.ts (1)</summary>

* `getTaskProgressForChange` (27-35)

</details>

</blockquote></details>

</details><details>
<summary>🪛 markdownlint-cli2 (0.18.1)</summary>

<details>
<summary>openspec/changes/archive/2025-12-29-unify-change-state-model/design.md</summary>

49-49: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

---

57-57: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

</details>

</details>

</details>

<details>
<summary>🔇 Additional comments (8)</summary><blockquote>

<details>
<summary>openspec/specs/cli-view/spec.md (1)</summary><blockquote>

`1-129`: **LGTM! Well-structured specification with proper conventions.**

The spec correctly uses `SHALL` for normative requirements and includes proper `#### Scenario:` headers. The Draft Changes addition integrates well with the existing structure, and the bug fix note on line 52 provides useful context.

</blockquote></details>
<details>
<summary>src/commands/artifact-workflow.ts (1)</summary><blockquote>

`1-28`: **Well-structured experimental CLI module.**

The file header clearly documents how to remove this experimental feature, and the command implementations follow consistent patterns with proper spinner UX and error handling.

</blockquote></details>
<details>
<summary>openspec/changes/archive/2025-12-29-unify-change-state-model/specs/cli-artifact-workflow/spec.md (1)</summary><blockquote>

`1-109`: **LGTM! Properly structured spec delta.**

The file correctly uses `## MODIFIED Requirements` for behavior changes, includes full requirement blocks with all scenarios, and uses the proper `#### Scenario:` format. The scaffolded change scenarios adequately cover the new functionality.

</blockquote></details>
<details>
<summary>src/core/view.ts (1)</summary><blockquote>

`102-111`: **Correct fix for the completed changes bug.**

The new categorization logic properly distinguishes between draft (`total === 0`), completed (`completed === total` with implicit `total > 0`), and active states. This correctly fixes the bug where empty changes were shown as completed.

</blockquote></details>
<details>
<summary>test/core/view.test.ts (1)</summary><blockquote>

`31-79`: **LGTM! Comprehensive test for the Draft/Completed categorization.**

The test covers all three scenarios (empty change, no-tasks change, completed change) and verifies both positive and negative assertions using the section markers. Good use of filtering by indicator characters to validate section placement.

</blockquote></details>
<details>
<summary>openspec/changes/archive/2025-12-29-unify-change-state-model/specs/cli-view/spec.md (1)</summary><blockquote>

`1-60`: **LGTM! Correctly structured spec delta with proper ADDED/MODIFIED separation.**

The file appropriately uses `## ADDED Requirements` for the new Draft Changes Display (an orthogonal standalone capability) and `## MODIFIED Requirements` for behavior changes to existing requirements. Full requirement blocks are included as required by the coding guidelines.

</blockquote></details>
<details>
<summary>openspec/changes/archive/2025-12-29-unify-change-state-model/proposal.md (1)</summary><blockquote>

`1-101`: **LGTM! Well-structured proposal with comprehensive analysis.**

The proposal clearly explains the problem (two bugs), provides root cause analysis, proposes minimal fixes, and documents breaking changes. The Related Commands Analysis table is particularly helpful for understanding the scope of impact.

</blockquote></details>
<details>
<summary>openspec/changes/archive/2025-12-29-unify-change-state-model/design.md (1)</summary><blockquote>

`1-151`: **LGTM! Clear design document with good rationale.**

The document appropriately explains why task-based and artifact-based systems should remain separate, provides concrete code examples for both fixes, and includes a testing strategy. The design is well-justified for a cross-cutting change affecting multiple commands.

</blockquote></details>

</blockquote></details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->

Add validation in validateChangeExists() to ensure --change parameter
is a valid kebab-case ID before constructing file paths. This prevents
path traversal attacks like --change "../foo" or --change "/etc/passwd".

- Reuses existing validateChangeName() from change-utils.ts
- Adds 3 tests for path traversal, absolute paths, and slashes
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
test/commands/artifact-workflow.test.ts (2)

32-33: Consider clarifying the comment.

The comment mentions "empty proposal" but the implementation actually creates a minimal (non-empty) proposal.md file. Consider updating to: "If no artifacts are specified, we create a minimal proposal to make it detectable."


407-410: Add output verification for consistency.

This error test only checks the exit code, while all other error tests in this file validate both the exit code and error message content. For consistency and thoroughness, consider adding output validation.

🔎 Suggested enhancement
 it('errors when name argument is missing', async () => {
   const result = await runCLI(['new', 'change'], { cwd: tempDir });
   expect(result.exitCode).toBe(1);
+  const output = getOutput(result);
+  expect(output).toContain('Missing required argument');
 });
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4f47bd2 and acdce5b.

📒 Files selected for processing (2)
  • src/commands/artifact-workflow.ts
  • test/commands/artifact-workflow.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/commands/artifact-workflow.ts
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Applies to openspec/changes/**/*.md : Scaffold proposal using `proposal.md`, `tasks.md`, optional `design.md`, and delta specs under `openspec/changes/<id>/`
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Run `openspec validate [change-id] --strict` before requesting approval
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
🧬 Code graph analysis (1)
test/commands/artifact-workflow.test.ts (2)
test/helpers/run-cli.ts (1)
  • runCLI (75-148)
scripts/postinstall.js (1)
  • stat (44-44)
🔇 Additional comments (6)
test/commands/artifact-workflow.test.ts (6)

1-21: LGTM: Clean test setup with proper resource management.

The imports are appropriate, and the beforeEach/afterEach properly handle temporary directory lifecycle with robust cleanup.


67-188: LGTM: Comprehensive status command test coverage.

The tests cover success cases, error handling, JSON output, schema options, and path traversal validation (aligning with the PR's security fix). All assertions are thorough and properly check both exit codes and output content.


190-250: LGTM: Well-structured next command tests.

The tests effectively validate the artifact dependency chain and progression, with proper coverage of JSON output and error cases.


252-327: LGTM: Thorough instructions command tests.

Tests properly validate instruction retrieval, dependency warnings, JSON structure, and error handling with helpful error messages.


329-364: LGTM: Complete templates command test coverage.

Tests validate template resolution for different schemas, JSON output structure, and error handling.


413-443: LGTM: Proper experimental feature documentation verification.

These tests ensure all new artifact-workflow commands are clearly marked as experimental in their help text, which is important for user expectations.

@TabishB TabishB merged commit fb7ff52 into main Dec 29, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants