You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: openspec/changes/add-scaffold-command/proposal.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,9 +2,9 @@
2
2
Manual setup for new changes leads to formatting mistakes in spec deltas and slows agents who must recreate the same file skeletons for every proposal. A built-in scaffold command will generate compliant templates so assistants can focus on the change content instead of structure.
3
3
4
4
## What Changes
5
-
- Add an `openspec scaffold <change-id>` CLI command that creates a change directory with validated `proposal.md`, `tasks.md`, and spec delta templates.
6
-
- Update CLI documentation and quick-reference guidance so agents discover the scaffold workflow before drafting files manually.
7
-
- Add automated coverage (unit/integ tests) to ensure the command respects existing naming rulesand generated Markdown passes validation.
5
+
- Add an `openspec scaffold <change-id>` CLI command that validates IDs, copies the default proposal/tasks/design template bundle into a new change directory, and errors out if the target already exists (authors add spec deltas later).
6
+
- Update CLI documentation and quick-reference guidance so agents discover the scaffold workflow before drafting files manually, including reminders on when to create spec deltas.
7
+
- Add automated coverage (unit/integ tests) to ensure the command respects naming rules, copies templates correctly, fails for existing directories, and produces output that passes `openspec validate --strict` untouched.
Copy file name to clipboardExpand all lines: openspec/changes/add-scaffold-command/specs/cli-scaffold/spec.md
+10-18Lines changed: 10 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,13 +9,13 @@ The CLI SHALL expose an `openspec scaffold <change-id>` command that validates t
9
9
-**AND** exit with code 0 after successful scaffolding
10
10
11
11
### Requirement: Change Directory Structure
12
-
The scaffold command SHALL create the standard change workspace with proposal, tasks, optional design, and delta directories laid out according to OpenSpec conventions.
12
+
The scaffold command SHALL create the standard change workspace with proposal, tasks, optional design, and `specs/` directories laid out according to OpenSpec conventions.
13
13
14
14
#### Scenario: Generating change workspace
15
15
-**WHEN** scaffolding a new change with id `add-user-notifications`
-**AND**generate `proposal.md`, `tasks.md`, and `design.md` (commented placeholder content) in that directory when missing
18
-
-**AND** create `openspec/changes/add-user-notifications/specs/` ready for capability-specific deltas
17
+
-**AND**copy the default template bundle (proposal, tasks, design placeholders) into that directory in a single operation
18
+
-**AND** create an empty `openspec/changes/add-user-notifications/specs/`directory ready for capability-specific deltas that will be authored later
19
19
20
20
### Requirement: Template Content Guidance
21
21
The scaffold command SHALL populate generated Markdown files with OpenSpec-compliant templates so authors can copy, edit, and pass validation without reformatting.
@@ -25,20 +25,12 @@ The scaffold command SHALL populate generated Markdown files with OpenSpec-compl
25
25
-**THEN** include the `## Why`, `## What Changes`, and `## Impact` headings with placeholder guidance text
26
26
-**AND** ensure `tasks.md` starts with `## 1. Implementation` and numbered checklist items using `- [ ]` syntax
27
27
-**AND** annotate optional sections (like `design.md`) with inline TODO comments so users understand when to keep or delete them
28
+
-**AND** include a short reminder inside `specs/README.md` (or similar) instructing authors to add deltas once they know the affected capability
28
29
29
-
### Requirement: Delta Spec Creation
30
-
The scaffold command SHALL create at least one capability delta file with correctly formatted requirement and scenario placeholders that guide authors to enter the actual behavior.
30
+
### Requirement: Directory Collision Handling
31
+
The scaffold command SHALL prevent accidental overwrites by refusing to run when a change directory already exists.
31
32
32
-
#### Scenario: Creating spec delta skeleton
33
-
-**WHEN** scaffolding a change and the capability `cli-scaffold` is provided interactively or via flags
-**AND** include `## ADDED Requirements` with at least one `### Requirement:` block and matching `#### Scenario:` entries that remind the author to replace placeholder text
36
-
-**AND** ensure the generated delta passes `openspec validate add-user-notifications --strict` until the author edits it
37
-
38
-
### Requirement: Idempotent Execution
39
-
The scaffold command SHALL be safe to rerun, preserving user edits while filling in any missing managed sections.
40
-
41
-
#### Scenario: Rerunning scaffold on existing change
42
-
-**WHEN** the command is executed again for an existing change directory containing user-edited files
43
-
-**THEN** leave existing content untouched except for managed placeholder regions or missing files that need creation
44
-
-**AND** update the filesystem summary to highlight which files were skipped, created, or refreshed
33
+
#### Scenario: Existing change-id
34
+
-**WHEN** the command is executed for a `change-id` whose directory already exists
35
+
-**THEN** emit an error stating the change has already been scaffolded
-[ ] 1.1 Register an `openspec scaffold` command in the CLI entrypoint with `change-id` argument validation.
3
-
-[ ] 1.2 Implement generator logic that creates the change directory structure plus default `proposal.md`, `tasks.md`, and delta spec skeletons without overwriting existing populated files.
3
+
-[ ] 1.2 Implement generator logic that copies the default change template bundle (`proposal.md`, `tasks.md`, optional `design.md`, `specs/README.md`) into `openspec/changes/<id>/`, creating the directory tree in a single pass.
4
+
-[ ] 1.3 Detect when `openspec/changes/<id>/` already exists and exit with a clear error instead of overwriting user files.
4
5
5
6
## 2. Templates and documentation
6
-
-[ ] 2.1 Surface copy/paste templates and scaffold usage in the top-level quick reference for `openspec/AGENTS.md`.
7
-
-[ ] 2.2 Refresh other CLI docs (`docs/`, README) to mention the scaffold workflowand link to instructions.
7
+
-[ ] 2.1 Update `openspec/AGENTS.md` quick reference so agents see `openspec scaffold` before drafting files manually.
8
+
-[ ] 2.2 Refresh CLI docs/README/help text to mention the scaffold workflow, template bundle contents, and when to add spec deltas manually.
8
9
9
10
## 3. Test coverage
10
-
-[ ] 3.1 Add unit tests covering name validation, file generation, and idempotent reruns.
0 commit comments