Repository navigation
Description
Problem or Motivation
Every pull request starts with a change folder, and the plans of the last days broke the project form in the same few ways. openspec new change makes the folder (ADR 0010), but its files are the generic OpenSpec skeleton. The project rules are in openspec/config.yaml, AGENTS.md and CONTRIBUTING.md, and each author, human, agent or the stage job, has to remember them: the folder name <issue>-<slug>, a ## Feasibility section with real evidence, ## Existing Tool Considered with a cost in tokens and time, task groups with a kind and a failing test first, the .openspec.yaml key skip_specs, the ADDED or MODIFIED choice against the base spec, and the allowed Workflow follow-up bullets. In a review of 23 plan pull requests the same defects came back: placeholder text, a wrong folder name in the proposal (#3176, #3179), a spec delta where MODIFIED was needed (#3163, #3170, #3174, #3184), and a missing cost. The branch name has the same slug as the folder, and agents typed both by hand.
Proposed Solution & Architectural Design
- Add
devops openspec new <issue>(a new subcommand next to the existingdevops openspec archiveandcheck). From the issue it takes the number, the title, the type and the scope. It makesopenspec/changes/<issue>-<slug>/with the four files, written in the project form:.openspec.yamlwith the schema andskip_specsset from the paths the author names (--paths), or left for the author when none is given;proposal.mdwith## Why(cites#<issue>),## What Changes,## Capabilities,## Impact,## Feasibilityand## Existing Tool Considered, each with a one-line instruction in a comment and no placeholder word that a gate would accept;design.mdwith Decisions and Rejected alternatives;tasks.mdwith one group of each kind and the verification forms ofopenspec/config.yaml;specs/<capability>/spec.mdfor each capability named with--capability, with## ADDED Requirementsor## MODIFIED Requirementschosen by looking at the base spec: a name that exists getsMODIFIED, with the existing text copied in.
- The slug and the branch name come from one function that the
devops repos worktrees addcommand shares, so folder and branch agree. - It prints the next steps: the branch name, the checks to run, and the archive command.
- It never overwrites a folder. The output is the same for the same input (no date or random value), except the
createddate of.openspec.yaml, which the existing tool already writes. - The skeleton has text a human has to replace.
devops openspec check(and the stage content gate from feat(roadmap): refuse a plan with placeholder or cut text #3200) refuses a file that still holds the skeleton text, so an unfilled scaffold cannot merge. - A small skill (
.claude/skills,.agents/skills) calls this command, so an interactive agent uses it and does not write the files by hand. The command holds the rules; the skill only points to it.
Open questions for the refine step: whether to extend openspec new change through a project schema (OpenSpec 1.14 supports schemas) in place of a wrapper, which would keep one tool; and how the created date and the slug rule should be tested for determinism.
Target Subsystem
src/devops_cli/commands/openspec.py (or the file that holds devops openspec), src/devops_cli/openspec/, src/devops_cli/git/branch_form.py (the slug), tests/.
Existing Tool Considered
openspec new change makes the generic folder, and Copier or Cookiecutter can fill templates. None reads the base specs to choose MODIFIED, derives the slug the branch rule uses, or knows the gates of this project. A project OpenSpec schema may cover the file layout, and the refine step should compare it with a wrapper. Cost to build: about 100k tokens and 5 hours. To keep: one set of templates and their tests, changed when openspec/config.yaml changes. The cost of not building it is a review round for each plan with a form defect.
Related: #3200 (content gate), #3201 (plan-check), #3198 (pull request title and body), #1844 (closed: scaffold OpenSpec and gate its folders).
Alternatives check of 2026-11-05: partly.
Tool: Fission-AI/OpenSpec (https://github.com/Fission-AI/OpenSpec), MIT, last activity 2026-11-04, maintained.
Proposed design
Problem statement
Every pull request starts with an OpenSpec change folder, and each author writes it by hand. The same defects return in review: skeleton text, a wrong folder name, a wrong ADDED or MODIFIED choice and a missing cost. One command must write the folder in the project form. The gate must refuse an unfilled scaffold.
Acceptance criteria
Requirement: The command creates the change folder
devops openspec new SHALL create a change folder named for the issue and the slug, with .openspec.yaml, proposal.md, design.md and tasks.md.
Scenario: A new issue gets the four files
- WHEN The author runs
devops openspec new 3203 --title 'feat(openspec): scaffold the change folder'in a checkout with no folder for issue 3203. - THEN The command creates
openspec/changes/3203-scaffold-the-change-folder/with the four files and exits 0.
Requirement: The command reads the issue title
When --title is absent, devops openspec new ISSUE SHALL read the issue title from GitHub and use it for the slug and the branch.
Scenario: The title comes from the issue
- WHEN A fake GitHub client returns issue 3203 with the title
feat(openspec): scaffold the change folder, and the author runsdevops openspec new 3203with no--title. - THEN The command creates
openspec/changes/3203-scaffold-the-change-folder/and printsfeat/3203-scaffold-the-change-folder.
Requirement: The proposal holds the project sections
The scaffolded proposal.md SHALL hold ## Why, ## What Changes, ## Capabilities, ## Impact, ## Feasibility and ## Existing Tool Considered, and ## Why SHALL cite the issue number.
Scenario: The proposal cites the issue and holds the six sections
- WHEN The command creates the folder for issue 3203.
- THEN
proposal.mdholds the six headings in this order, and## Whyholds#3203.
Requirement: The design file holds decisions and rejected alternatives
The scaffolded design.md SHALL hold a ## Decisions section and a ## Rejected alternatives section.
Scenario: The design file holds both sections
- WHEN The command creates the folder for issue 3203.
- THEN
design.mdholds## Decisionsand## Rejected alternatives, each with one instruction line that ends with<!-- devops-openspec-new: replace -->.
Requirement: The tasks file holds a behavior group and a documents group
The scaffolded tasks.md SHALL hold a behavior group whose first task is a failing test with a uv run devops ci test command, and a documents group whose task names uv run devops ci docs.
Scenario: The tasks file holds both groups
- WHEN The command creates the folder for issue 3203.
- THEN
tasks.mdholds## 1. Behaviorwith the test task before the implementation task, and## 2. Documentswithuv run devops ci docs.
Requirement: The folder and the branch share one slug
The folder slug and the branch name MUST come from the same slug_from_title and branch_name functions.
Scenario: Folder and branch agree
- WHEN The command derives the slug from the title
feat(openspec): scaffold the change folderfor issue 3203. - THEN The folder is
3203-scaffold-the-change-folderand the printed branch isfeat/3203-scaffold-the-change-folder.
Requirement: The worktree command shares the slug function
devops repos worktrees add SHALL accept --title and derive the type and the slug with slug_from_title, and MUST refuse a --type or --slug that differs from the derived value.
Scenario: The worktree command plans the same branch
- WHEN The author runs
devops repos worktrees add 3203 --title 'feat(openspec): scaffold the change folder' --dry-run. - THEN The command plans the branch
feat/3203-scaffold-the-change-folderand no other branch.
Requirement: An existing folder stops the command
The command MUST NOT write into an existing change folder.
Scenario: An existing folder stops the command
- WHEN The folder
openspec/changes/3203-scaffold-the-change-folder/already exists. - THEN The command exits 1, names the folder and changes no file.
Requirement: Two runs write the same bytes
Two runs on the same issue MUST write the same bytes, except the created value of .openspec.yaml.
Scenario: Two runs write equal files
- WHEN The test runs the command twice on issue 3203 in two clean checkouts.
- THEN The four files are equal after the test masks the
createdline of.openspec.yaml.
Requirement: The gate refuses the scaffold marker
Each scaffolded line that the author must replace SHALL end with the marker <!-- devops-openspec-new: replace -->, and devops openspec check SHALL fail a change file that still holds the marker.
Scenario: An unfilled scaffold fails the check
- WHEN The test runs
uv run devops openspec checkon a change folder that still holds the marker. - THEN The command reports a finding that names the file and exits 1.
Requirement: The delta chooses ADDED or MODIFIED from the base spec
The command SHALL write ## MODIFIED Requirements with the existing text when the base spec holds the named requirement, and ## ADDED Requirements otherwise.
Scenario: An existing requirement gets MODIFIED
- WHEN
openspec/specs/roadmap-refine/spec.mdholds the requirementOnly the limit stops a refine round, and the author names--capability roadmap-refine:Only the limit stops a refine round. - THEN The delta holds
## MODIFIED Requirementsand copies the existing requirement text.
Requirement: A new capability gets a Purpose
A delta that creates a capability SHALL start with a ## Purpose section of at least 50 characters.
Scenario: A new capability gets Purpose and ADDED
- WHEN No
openspec/specs/openspec-scaffold/spec.mdexists for the named capabilityopenspec-scaffold. - THEN The delta starts with
## Purposeof at least 50 characters and holds## ADDED Requirements.
Requirement: skip_specs follows the named paths
The command SHALL write skip_specs: true only when every --paths value is non-observable and no --capability is named, skip_specs: false when a path is observable or a capability is named, and no key when both options are absent.
Scenario: Test and document paths set skip_specs
- WHEN The author runs the command with
--paths tests/test_openspec_new.py --paths docs/openspec.md. - THEN
.openspec.yamlholdsskip_specs: true.
Requirement: A dry run makes no request
devops openspec new --dry-run MUST make no external request and SHALL print the folder and the branch it would make.
Scenario: The dry run writes nothing
- WHEN The author runs
devops openspec new 3203 --title 'feat(openspec): scaffold the change folder' --dry-run. - THEN The command prints the folder and the branch, writes no file and makes no request.
Requirement: The command prints the next steps
The command SHALL print the branch name, the checks to run and the archive command.
Scenario: The output names the next steps
- WHEN The command creates the folder for issue 3203.
- THEN The output holds
feat/3203-scaffold-the-change-folder,uv run devops cianduv run devops openspec archive 3203-scaffold-the-change-folder.
Requirement: The skill points to the command
A skill in .claude/skills and .agents/skills SHALL tell an interactive agent to run devops openspec new and MUST NOT tell it to run openspec new change.
Scenario: Both skill files name the command
- WHEN A test reads
.claude/skills/devops-openspec-new/SKILL.mdand.agents/skills/devops-openspec-new/SKILL.md. - THEN Each file holds
devops openspec newand no line that tells the agent to runopenspec new change.
Requirement: The skill passes the OpenSpec gate
devops openspec check SHALL pass on a tree that holds the project skill.
Scenario: The gate passes with the skill
- WHEN The test runs
uv run devops openspec checkon the tree that holds both skill files. - THEN The check exits 0.
Existing Tool Considered
OpenSpec (Fission-AI/OpenSpec, MIT, maintained) covers the change folder, .openspec.yaml, project-local custom schemas and templates, instruction comments and validation. It lacks a folder slug from the issue title, a shared slug function with the branch rule, branch creation and output, a read of the issue from GitHub, the ADDED or MODIFIED choice from the base spec with copied text, skip_specs from paths, a marker gate, next-step output and a project skill. Use OpenSpec for the folder and build a thin wrapper for the missing parts. Written cost to build the whole scaffold instead: about 100k tokens to build, keep and fix it until it matches the tool, and 5 hours of elapsed time.
Key questions
- What command form does the scaffold use?: Add
devops openspec new ISSUEnext tocheckandarchive. It takes--title,--paths,--capability CAPABILITY:REQUIREMENTand--dry-run. (best practice) [sources: src/devops_cli/commands/openspec.py, CONTRIBUTING.md, docs/adr/0010-openspec-is-the-spec-and-change-proposal-layer.md]- Chosen: A new
devops openspec newsubcommand. It sits beside the existingcheckandarchivecommands and uses the same isolated tool. - Rejected: Extend
openspec new changewith a project schema. ADR 0010 rejects a forked schema because it is experimental and drifts with each release. - Rejected: A separate shell script. It would duplicate the command tree, the settings and the error handling of the CLI.
- Chosen: A new
- Should the change extend
openspec new changethrough a project schema in place of a wrapper?: No. Use a thin wrapper on the pinned tool. ADR 0010 rejects a forked schema because it is experimental and drifts. The wrapper runsopenspec new changefor.openspec.yamland writes the project files. (best practice) [sources: docs/adr/0010-openspec-is-the-spec-and-change-proposal-layer.md, openspec/config.yaml, src/devops_cli/commands/openspec.py]- Chosen: Wrapper on the pinned tool. It reuses
openspec new changeand keeps the project rules in code that a test can check. - Rejected: Project schema only. The schema writes no marker, no base-spec lookup and no next-step output.
- Rejected: Copier or Cookiecutter template. The template reads no base spec, derives no slug and knows no project gate.
- Chosen: Wrapper on the pinned tool. It reuses
- How does the command derive the slug and the branch name?: Add
slug_from_title(title)tosrc/devops_cli/git/branch_form.py. It removes the Conventional Commit prefix, lowercases, folds to ASCII, joins words with one hyphen and checksCONST_BRANCH_SLUG_PATTERN.branch_name(issue, type_, slug)makes the branch.devops repos worktrees addgains--titleand calls the same functions. (best practice) [sources: src/devops_cli/git/branch_form.py, src/devops_cli/git/worktree_add.py, CONTRIBUTING.md, CONTEXT.md]- Chosen: One slug function from the title. The folder and the branch get the same slug, and the author types the title one time.
- Rejected: A
--slugtyped by the author. The author types the slug twice, and the folder and the branch can disagree. - Rejected: A random or date suffix. The output would not be the same for the same input.
- How does the command choose ADDED or MODIFIED for a capability?: The author names each capability and requirement as
--capability CAPABILITY:REQUIREMENT. The command readsopenspec/specs/CAPABILITY/spec.md. A requirement that the spec holds gets## MODIFIED Requirementswith the existing text copied. Another requirement gets## ADDED Requirements. A capability with no spec gets a## Purposeof at least 50 characters and## ADDED Requirements. (best practice) [sources: openspec/config.yaml, docs/adr/0010-openspec-is-the-spec-and-change-proposal-layer.md, openspec/specs/roadmap-refine/spec.md]- Chosen: Read the base spec and choose. The config allows MODIFIED only for a requirement that exists in
openspec/specs/. - Rejected: Always write ADDED. A duplicate ADDED makes archive refuse the change and write no file.
- Rejected: Ask the author to choose. The author repeats a choice that the base spec settles, and the review defect returns.
- Chosen: Read the base spec and choose. The config allows MODIFIED only for a requirement that exists in
- How does the command keep the output deterministic with the
createddate?: The command creates.openspec.yamlwithopenspec new changethroughisolated_openspec(), so the pinned tool writescreated. It writes the other three files from module-level constants and no timestamp. The test runs the command twice and compares the bytes after it masks thecreatedline. (best practice) [sources: src/devops_cli/commands/openspec.py, docs/adr/0010-openspec-is-the-spec-and-change-proposal-layer.md]- Chosen: Let the pinned tool write
.openspec.yaml. The schema stays valid and the tool owns the only date. - Rejected: Write
.openspec.yamlby hand. A wrong key failsopenspec validate --strict, and the command takes over a format that the tool owns. - Rejected: Write no date. The tool writes
createdalready, and the issue keeps it.
- Chosen: Let the pinned tool write
- How does the gate refuse an unfilled scaffold?: One constant holds the marker
<!-- devops-openspec-new: replace -->. Every scaffolded line that needs author input ends with it.check_openspecfails a file underopenspec/changes/that still holds the marker. (best practice) [sources: src/devops_cli/openspec/gate.py, docs/adr/0010-openspec-is-the-spec-and-change-proposal-layer.md]- Chosen: One shared marker string. The scaffold and the gate read one constant, and a test can assert both.
- Rejected: A list of words to refuse. A real text can hold such a word, and a closed list cannot cover every skeleton line.
- Rejected: No gate. An unfilled scaffold would merge, and the review defect returns.
- How does
skip_specsfollow the--pathsvalues?: One module-level table holds the non-observable prefixes:tests/,docs/,openspec/and.github/workflows/. When every path starts with one of them and no capability is named, the command writesskip_specs: true. Otherwise it writesfalse. With no--pathsand no--capability, it writes noskip_specskey. (best practice) [sources: openspec/config.yaml, docs/adr/0010-openspec-is-the-spec-and-change-proposal-layer.md]- Chosen: A closed table of non-observable prefixes. The config names tests, CI workflows and documentation as non-observable, so the command can decide from the paths.
- Rejected: Always
false. A test or document change would carry a spec delta that it does not need. - Rejected: A
--skip-specsflag. The issue asks the command to set the key from the paths, and a flag repeats the decision.
- Does the command read the issue in a dry run?: No. The normal run reads the issue title with the paced GitHub client.
--dry-runmakes no request and requires--title, asdevops repos worktrees add --dry-runrequires the branch parts. (best practice) [sources: CONTRIBUTING.md, src/devops_cli/git/worktree_add.py]- Chosen: Read the issue in the normal run and take
--titlein a dry run. The normal run needs no extra input, and the dry run keeps the no-external-request rule. - Rejected: Always take
--title. The author types the title that GitHub holds, and the type and the scope can disagree with the issue. - Rejected: Read the issue in the dry run. A dry run would make a request and could fail offline.
- Chosen: Read the issue in the normal run and take
- Does the change carry a spec delta?: Yes. A new
devopscommand, its options and its messages are observable. The change sets noskip_specsand holds a spec delta. (best practice) [sources: openspec/config.yaml, docs/adr/0010-openspec-is-the-spec-and-change-proposal-layer.md]- Chosen: Carry a spec delta. The config names a
devopscommand, option or message as observable. - Rejected: Set
skip_specs: true. The change adds a command that a consumer observes.
- Chosen: Carry a spec delta. The config names a
- Does a project skill in
.claude/skillsand.agents/skillspassdevops openspec check?: Yes. The gate regenerates the OpenSpec skills and compares the generated files. It fails a generated glob that matches no file. It does not compare an extra skill. The test runsdevops openspec checkon the tree that holds the skill. (best practice) [sources: src/devops_cli/openspec/gate.py, docs/adr/0010-openspec-is-the-spec-and-change-proposal-layer.md]- Chosen: Add the skill to both skill directories. The gate compares the generated files only, and the issue asks for the skill there.
- Rejected: Add the skill to
AGENTS.mdonly. The interactive agent reads the skill directory, and the issue asks for a skill. - Rejected: Add no skill. An agent would write the folder by hand, and the review defect returns.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
devops-cli-service commentedon Nov 2, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
featprefix of the title gives the type.(openspec)scope of the title gives the scope.It reduces repeated review defects but does not block delivery or expose a security risk.It removes a recurring source of review rework across 23 plan pull requests.A new subcommand with templates, slug logic, spec-delta detection, and skill wiring; the body estimates about 5 hours.Both work on the openspec tooling, but the candidate creates the change folder in project form while #3201 validates an existing plan pull request against the same rules.devops-cli-service commentedon Nov 2, 2026
Status set to Ready at bc0434e (see proposed design in issue body).
devops-cli-service commentedon Nov 2, 2026
The stage job returned the item to New. The premise of the issue does not hold at the staging commit, so the job planned no change and opened no pull request.
Evidence:
placeholder
devops-cli-service commentedon Nov 5, 2026
Alternatives check: partly
Tool: Fission-AI/OpenSpec (https://github.com/Fission-AI/OpenSpec)
Covers:
openspec/changes//with.openspec.yaml,proposal.md,design.md,tasks.mdand aspecs//spec.mdper capability.openspec/schemas//schema.yamlplustemplates/proposal.md,spec.md,design.md,tasks.md) let the project own the file bodies and section order, selected fromopenspec/config.yaml, so project-only sections such as## Feasibilityand## Existing Tool Consideredcan be part of the scaffold instead of the generic skeleton..openspec.yamlcarries the schema and theskip_specskey, andopenspec validaterejects a zero-delta change that does not setskip_specs: true.openspec schema validateandopenspec validatecheck a schema and a change folder, so a malformed scaffold is caught by the tool.Lacks:
openspec new change); the tool does not derive the folder slug from the issue title, and shares no slug function with the project's branch rule.openspec/specs//spec.mdto choose## MODIFIED Requirementswith the copied existing text versus## ADDED Requirements; the author makes that choice.skip_specsfrom--paths(or any non-observable path list); the value is written by hand or fixed by the schema.Searches run:
Sources:
Checked on 2026-11-05. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 5, 2026
Status set to Ready at d254410 (see proposed design in issue body).
feat(openspec): scaffold the change folder of an issue to project form
feat(openspec): scaffold the change folder of an issue to project form
devops-cli-service commentedon Nov 8, 2026
Released in v0.95.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.95.0
devops-cli-service commentedon Nov 8, 2026
Live since 2026-11-08 22:36 UTC