Skip to content

Conversation

@TabishB
Copy link
Contributor

@TabishB TabishB commented Nov 16, 2025

Align the add-scaffold-command proposal/spec/tasks with the latest decisions: command copies the template bundle, errors when the change directory exists, and defers spec deltas while documentation and tests cover the new workflow.

Summary by CodeRabbit

  • New Features

    • Added openspec scaffold command to create a change workspace with default templates (proposal, tasks, design) and an empty specs/ directory for later deltas.
    • Rejects existing change directories to avoid accidental overwrites.
  • Documentation

    • Updated CLI guidance to include scaffold workflow, template bundle contents, and a brief reminder to add spec deltas later.
  • Tests

    • Expanded coverage for name validation, template copying, existing-directory detection, and strict validation of freshly scaffolded workspaces.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 16, 2025

Walkthrough

The scaffold command behavior is specified: it validates change IDs, copies a default template bundle (proposal, tasks, design) into openspec/changes/<id>/ only if the directory does not exist, creates an empty specs/ subdirectory for later deltas, and fails when the target directory already exists.

Changes

Cohort / File(s) Summary
Scaffold spec + proposal + tasks
openspec/changes/add-scaffold-command/proposal.md, openspec/changes/add-scaffold-command/specs/cli-scaffold/spec.md, openspec/changes/add-scaffold-command/tasks.md
Proposal updated with concrete scaffold behavior (ID validation, template bundle copy, collision detection). Spec adjusted to create a specs/ subdirectory and to remove automated delta skeletons, replacing them with a reminder to add deltas. Tasks updated to implement copying the template bundle, erroring on existing directories, update AGENTS.md quick reference, and broaden tests to check name validation, template copying, collision handling, and that a fresh scaffold passes openspec validate --strict without deltas.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CLI as openspec scaffold
    participant FS as FileSystem
    participant Validator

    User->>CLI: run scaffold <change-id>
    CLI->>Validator: validate change-id
    Validator-->>CLI: valid / invalid
    alt invalid
        CLI-->>User: exit with error (invalid id)
    else valid
        CLI->>FS: check if openspec/changes/<id>/ exists
        FS-->>CLI: exists / not exists
        alt exists
            CLI-->>User: exit with error (directory exists)
        else not exists
            CLI->>FS: copy template bundle -> openspec/changes/<id>/
            CLI->>FS: create openspec/changes/<id>/specs/
            CLI->>Validator: run openspec validate --strict on new change
            Validator-->>CLI: pass / fail
            CLI-->>User: success / validation error
        end
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Areas to inspect closely:
    • spec.md for correct directory layout and delta guidance
    • tasks.md for test requirements and AGENTS.md updates
    • proposal.md for exact validation and collision semantics

Poem

🐇 I hopped and copied, neat and quick,
A bundle placed with one small flick.
I won't overwrite what came before,
A specs/ hole left to explore,
Tiny rabbit, scaffolding trick. 🥕✨

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Clarify scaffold proposal' is vague and does not clearly summarize the main changes, which involve updating the scaffold command behavior and documentation. Consider a more specific title like 'Update scaffold command to copy template bundle and defer delta creation' to better reflect the actual changes.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch scaffold-proposal-review

📜 Recent 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 2c667fb and ce3085c.

📒 Files selected for processing (2)
  • openspec/changes/add-scaffold-command/proposal.md (1 hunks)
  • openspec/changes/add-scaffold-command/specs/cli-scaffold/spec.md (2 hunks)
🧰 Additional context used
🪛 LanguageTool
openspec/changes/add-scaffold-command/specs/cli-scaffold/spec.md

[style] ~28-~28: Consider using the synonym “brief” (= concise, using a few words, not lasting long) to strengthen your wording.
Context: ...keep or delete them - AND include a short reminder inside specs/README.md (or s...

(QUICK_BRIEF)

🔇 Additional comments (1)
openspec/changes/add-scaffold-command/proposal.md (1)

5-7: LGTM!

The updates clearly specify the scaffold behavior: directory creation conditionality, template bundle copying, and expanded test coverage including the error case for existing directories. These changes accurately align with the PR objectives.


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: 1

🧹 Nitpick comments (1)
openspec/changes/add-scaffold-command/specs/cli-scaffold/spec.md (1)

12-12: Clarify the phrasing of "directories" when describing the change workspace structure.

Line 12 states "proposal, tasks, optional design, and specs/ directories" which is grammatically awkward and unclear. It reads as if there are multiple directories at the root level, when the intent is to describe file types plus one specs/ directory.

Recommend: "The scaffold command SHALL create the standard change workspace with proposal, tasks, and optional design files, plus a specs/ directory, all laid out according to OpenSpec conventions."

📜 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 17d7e59 and 2c667fb.

📒 Files selected for processing (3)
  • openspec/changes/add-scaffold-command/proposal.md (1 hunks)
  • openspec/changes/add-scaffold-command/specs/cli-scaffold/spec.md (2 hunks)
  • openspec/changes/add-scaffold-command/tasks.md (1 hunks)
🧰 Additional context used
🪛 LanguageTool
openspec/changes/add-scaffold-command/specs/cli-scaffold/spec.md

[style] ~28-~28: Consider using the synonym “brief” (= concise, using a few words, not lasting long) to strengthen your wording.
Context: ...keep or delete them - AND include a short reminder inside specs/README.md (or s...

(QUICK_BRIEF)

🔇 Additional comments (3)
openspec/changes/add-scaffold-command/proposal.md (1)

5-7: LGTM conditional on resolving the specs/ directory inconsistency.

The proposal clearly describes the scaffold command behavior, documentation updates, and test coverage. However, the proposal should align with the resolution of the specs/README.md inconsistency flagged in tasks.md (line 3 vs. spec.md line 18). Once that is clarified, this proposal accurately summarizes the feature.

Verify that proposal.md aligns with the final decision on whether specs/README.md is included in the template bundle.

openspec/changes/add-scaffold-command/specs/cli-scaffold/spec.md (1)

30-36: Directory collision handling requirement is clear and well‑specified.

The error handling scenario (lines 30–36) is concrete, testable, and correctly specifies that no files should be modified when the target directory exists. This protects against accidental overwrites.

openspec/changes/add-scaffold-command/tasks.md (1)

3-4: The claimed inconsistency does not exist in the codebase.

Both tasks.md and spec.md are consistent: tasks.md line 1.2 lists specs/README.md as part of the copied template bundle, and spec.md confirms this by requiring "a short reminder inside specs/README.md" in the template. The word "empty" in spec.md refers to the absence of capability-specific deltas (which users add later), not the absence of files. The template bundle includes specs/README.md with guidance text, and the specs/ directory starts with no user deltas—both interpretations align correctly.

Likely an incorrect or invalid review comment.

Comment on lines +17 to +18
- **AND** copy the default template bundle (proposal, tasks, design placeholders) into that directory in a single operation
- **AND** create an empty `openspec/changes/add-user-notifications/specs/` directory ready for capability-specific deltas that will be authored later
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

Resolve inconsistency: Does the template bundle include specs/README.md or is specs/ created empty?

  • Line 18 states: "create an empty openspec/changes/add-user-notifications/specs/ directory ready for capability-specific deltas"
  • Line 28 states: "include a short reminder inside specs/README.md (or similar) instructing authors to add deltas"

These two statements conflict. If specs/ is truly empty (line 18), where does specs/README.md come from (line 28)?

Options to resolve:

  1. If the template includes specs/README.md: Update line 18 to remove "empty" and clarify that the directory is created with a README file.
  2. If specs/ is truly empty: Move the specs/README.md guidance to a separate manual step (after scaffolding), or update the requirement scope.

Also, per static analysis hint: Consider updating "short reminder" (line 28) to "brief reminder" for stronger wording.

Also applies to: 28-28

🤖 Prompt for AI Agents
In openspec/changes/add-scaffold-command/specs/cli-scaffold/spec.md around lines
17–18 there is a conflict: the scaffold is described as creating an "empty"
specs/ directory but later (line 28) references a specs/README.md; resolve by
choosing one of two fixes — Option A: if the template bundle should include a
README, change line 18 to remove "empty" and state the specs/ directory is
created with a brief README (also change "short reminder" on line 28 to "brief
reminder"); Option B: if the specs/ directory is truly empty, remove or relocate
the specs/README.md guidance from line 28 to a separate post-scaffold/manual
step and update line 28 wording to "brief reminder" if that guidance remains
elsewhere.

@jax-max
Copy link
Contributor

jax-max commented Nov 17, 2025

LGTM

@TabishB TabishB merged commit c54079a into main Nov 19, 2025
7 checks passed
Balancor pushed a commit to Balancor/OpenSpec that referenced this pull request Nov 29, 2025
* clarify scaffold proposal

* Update scaffold command proposal to support idempotent execution
fenghaitao pushed a commit to fenghaitao/OpenSpec that referenced this pull request Dec 10, 2025
* clarify scaffold proposal

* Update scaffold command proposal to support idempotent execution
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.

3 participants