Skip to content

feat(roadmap): onboard sets up openspec in a repository #3770

Done

Description

@dan-petty

Update 2026-11-26 (infra move): devops repos onboard (ADR 0035) replaced devops roadmap onboard.

The generic openspec/config.yaml is in dan-petty/infra (templates/repository/), and the template pull request (row 9) adds it. Do not add a template under src/. What is left: the openspec row with its three states, and openspec/specs/. The page is docs/repos/onboard.md.


Problem

The stage job plans an item as an OpenSpec change in the managed repository: openspec/changes/<issue>-<slug>/. It reads the rules of openspec/config.yaml (check_proposal in src/devops_cli/roadmap/stage_change.py), and it runs openspec validate --strict on the change (validate_change in stage_validate.py). devops repos onboard has no row for OpenSpec. A repository without openspec/config.yaml is found out when a plan fails, one failure at a time.

The file of this repository cannot be copied. Its context says "devops-cli is pre-1.0 alpha software", and its rules name devops-cli documents. A copy gives a wrong project context to the planner of another repository.

Expected

devops repos onboard checks OpenSpec in the target repository and, with --confirm, sets it up through a pull request. The default branch can be protected, as in #3742, so the files never go straight to it.

Acceptance criteria

  • A new row openspec reads present, missing or invalid. It is present when openspec/config.yaml is on the default branch, names the schema spec-driven, and openspec/specs/ exists.
  • With --confirm, the command opens one pull request that adds the missing files. It never overwrites a file that exists. A second --confirm writes nothing.
  • The config.yaml comes from the template of dan-petty/infra, not from a template that devops-cli ships (project-neutral context with a marked line for a person to fill in, and the proposal, specs, design and tasks rules that the planner needs). It does not copy the file of devops-cli.
  • After the pull request merges, openspec validate --specs --strict passes in the repository. A test shows this on a scratch repository built with the git fake.
  • The row for the type/* label rule of feat(roadmap): onboard writes labels.yml and clear-status.yml from --from #3742 and this row use the same pull request, so one onboarding run opens one pull request.
  • docs/repos/onboard.md describes the row and the template.

Existing tool considered

The openspec CLI already creates the folder (openspec init). Check its non-interactive options first, and use it to create the folder and the skills where it can, before the command writes a file. The template of the rules is the part that no tool gives. The cost is about 300,000 tokens and 2 hours to build.

Related

#1359 (the command), #3742 (writes the other files, and the pull request rule), #3767 (devops pr create must work in a repository with and without OpenSpec).

Alternatives check of 2026-11-24: in-use.
The repository already uses this tool.
Tool: Fission-AI/OpenSpec (https://github.com/Fission-AI/OpenSpec), MIT, last activity 2026-11-23, maintained.
Reason: The search and repository facts found the OpenSpec CLI, which initializes the folder and validates specs; it does not supply the project-neutral config template or the onboard row and pull-request behavior.

Covers:

  • Creates the init layout and workflow skills
  • Writes config.yaml with the spec-driven schema
  • Adds specs and archive .gitkeep placeholders
  • Runs strict validation over specs and changes

Lacks:

  • Project-neutral context line and proposal, specs, design and tasks rules
  • Present, missing and invalid row detection
  • One pull request, no overwrite and second-confirm behavior
  • Shared pull request with the type/* label row

Proposed design

Problem statement

The devops repos onboard command has no openspec row. A managed repository without OpenSpec is found when a plan fails. This change adds the row, reads present, missing or invalid, and adds openspec/specs/.gitkeep through the onboarding pull request. The generic openspec/config.yaml stays in dan-petty/infra, and the template pull request row 9 adds it.

Acceptance criteria

Requirement: OpenSpec row reads present

devops repos onboard SHALL report the openspec row as present when openspec/config.yaml on the default branch names schema: spec-driven and a tracked regular file is under openspec/specs/.

Scenario: A complete OpenSpec setup

  • WHEN The default branch holds openspec/config.yaml with schema: spec-driven and a tracked regular file under openspec/specs/
  • THEN The openspec row reads present and the command writes nothing.

Requirement: OpenSpec row reads missing

The openspec row SHALL read missing when the default branch holds no openspec/config.yaml.

Scenario: A repository with no OpenSpec

  • WHEN The default branch holds no openspec/config.yaml
  • THEN The openspec row reads missing.

Requirement: OpenSpec row reads invalid

The openspec row SHALL read invalid and name the failed condition in its detail when openspec/config.yaml is present and fails one condition of present.

Scenario: A config file of another schema

  • WHEN openspec/config.yaml on the default branch names a schema other than spec-driven, does not parse as YAML, or no tracked regular file is under openspec/specs/
  • THEN The openspec row reads invalid and its detail names the failed condition.

Requirement: Init supplies the specs placeholder

The command SHALL run the pinned openspec init --tools <ids> through OpenSpecTool in a scratch checkout and SHALL copy only openspec/specs/.gitkeep from the generated layout.

Scenario: The scratch init

  • WHEN The command needs to add openspec/specs/.gitkeep for a target repository
  • THEN The recorded openspec init --tools <ids> run exits 0 in a scratch checkout, and the command copies openspec/specs/.gitkeep from that layout.

Requirement: One onboarding pull request

With --confirm, the command SHALL add the missing OpenSpec files through one onboarding pull request and SHALL write nothing to the default branch.

Scenario: Confirm on a missing OpenSpec row

  • WHEN The user runs devops repos onboard --confirm and the openspec row reads missing or invalid
  • THEN The command opens one onboarding pull request that holds the missing OpenSpec files, and the default branch is unchanged.

Requirement: Config comes from the baseline template

The openspec row SHALL leave openspec/config.yaml to the template pull request row 9 and SHALL add no openspec/config.yaml itself.

Scenario: Row 9 adds the config

  • WHEN The openspec row runs with --confirm and the target lacks openspec/config.yaml
  • THEN The row adds no openspec/config.yaml, and row 9 adds the baseline file.

Requirement: No overwrite of an existing file

The command SHALL NOT overwrite a file that exists on the default branch or on the head of the open onboarding pull request.

Scenario: A config file that already exists

  • WHEN openspec/config.yaml exists on the default branch and the openspec row reads invalid
  • THEN The onboarding pull request adds no openspec/config.yaml and the existing file is unchanged.

Requirement: Second confirm writes nothing

A second --confirm SHALL create no commit and no second pull request while the onboarding pull request is open.

Scenario: Second confirm

  • WHEN The user runs devops repos onboard --confirm again and the onboarding pull request is open
  • THEN The command creates no commit and opens no second pull request.

Requirement: One pull request for both rows

The type/* label row of #3742 and the openspec row SHALL add their files to one onboarding pull request.

Scenario: Both rows need files

Requirement: Strict validation after the merge

The repository SHALL pass openspec validate --specs --strict after the onboarding pull request merges.

Scenario: A scratch repository

  • WHEN The test merges the onboarding pull request in a scratch repository built with the git fake
  • THEN The pinned openspec validate --specs --strict run through OpenSpecTool with the suite's fake at the process edge exits 0.

Requirement: Onboard documentation

docs/repos/onboard.md SHALL describe the openspec row, the baseline openspec/config.yaml and openspec/specs/.gitkeep.

Scenario: The onboard document

  • WHEN A reader opens docs/repos/onboard.md after the merge
  • THEN The document names the three row states, the baseline openspec/config.yaml and openspec/specs/.gitkeep, and uv run devops ci docs exits 0.

Requirement: Pending a person after the merge

After the onboarding pull request merges, a person SHALL fill the marked context line of openspec/config.yaml in the target repository.

Scenario: The marked context line

  • WHEN The onboarding pull request merges in the target repository
  • THEN A person replaces the marked context line with the context of the project, and devops repos onboard reports the openspec row as present on its next run.

Existing Tool Considered

Fission-AI/OpenSpec is the open, maintained tool. The alternatives check in the issue body gives the verdict in-use and lists what the tool covers and lacks. This item adds the row that reads the two paths at the default branch and the specs placeholder to the one onboarding pull request. The template is in dan-petty/infra and row 9 adds it, so this item does not ship a template. The remaining work costs about 300,000 tokens and 2 hours.

Key questions

  • Which tool creates the OpenSpec layout?: Run the pinned openspec init --tools <ids> through OpenSpecTool in a scratch checkout. Copy only openspec/specs/.gitkeep from the generated layout, because row 9 adds openspec/config.yaml from the baseline. (best practice) [sources: src/devops_cli/openspec/tool.py:87, openspec/specs/.gitkeep, docs/adr/0010-openspec-is-the-spec-and-change-proposal-layer.md]
    • Chosen: Run openspec init in a scratch checkout. The CLI writes the layout and the placeholders, so devops-cli keeps only the row and the pull-request behavior.
    • Rejected: Write every OpenSpec file from devops-cli. It duplicates the CLI and the skills, which change with the CLI.
    • Rejected: Copy the openspec/config.yaml of devops-cli. Its context names devops-cli, so the planner of another repository reads a wrong project.
  • Where does the generic openspec/config.yaml come from?: The baseline Copier template of github.template_repository (default dan-petty/infra). The template pull request row 9 adds the missing template files. [sources: docs/repos/onboard.md, docs/adr/0035-the-onboard-command-owns-the-repository-settings.md]
  • How does the row read the OpenSpec state without a checkout?: Read openspec/config.yaml and the tree under openspec/specs/ at the default branch through GitHub GET requests. The row needs no checkout. (best practice) [sources: docs/repos/onboard.md]
    • Chosen: Read the two paths at the default branch through GitHub GET. The row stays a read of the live state, and the command needs no checkout.
    • Rejected: Clone the repository and run the CLI. It needs a checkout and a network on every onboard run.
    • Rejected: Run the CLI on a temporary copy of the two files. The copy is no valid OpenSpec root, so the CLI reports the setup as missing.
  • When does the row read invalid instead of missing?: missing when openspec/config.yaml is absent from the default branch. invalid when the file is present and its schema is not spec-driven, the YAML does not parse, or no tracked regular file is under openspec/specs/. (best practice) [sources: openspec/config.yaml:1, openspec/specs/.gitkeep]
    • Chosen: A bad file or no tracked specs file reads invalid. The config file exists, so the repository is half set up, and the pull request adds the placeholder.
    • Rejected: A missing specs path reads missing. It reports that OpenSpec is absent when it is partly present.
    • Rejected: The config file alone reads present. The planner needs the specs path, so the row would hide a broken setup.
  • How does the row share one pull request and avoid a second write?: Add only the missing paths to the open onboarding pull request. Read each candidate path at the default branch and at the head of that pull request. A path present at either revision counts as present. (best practice) [sources: docs/repos/onboard.md]
    • Chosen: Add to the open onboarding pull request and read its head. The files of the first run are on the branch until the merge, and a read at a revision needs no checkout.
    • Rejected: Open a second pull request for the OpenSpec files. The issue requires one onboarding pull request for both rows.
    • Rejected: Read the default branch only. A second run would add the same files again while the pull request is open.
  • Which agent tool ids does openspec init get?: The agent tool ids of the project profile of the target repository. When the profile names none, pass the ids of the agent tools that the repository has files for. (best practice) [sources: CONTEXT.md]
    • Chosen: Use the agent tool ids of the project profile. The profile holds the facts of the repository, and the command writes skills only for the tools that the repository uses.
    • Rejected: Pass all for every repository. It writes skills for tools that the repository does not use.
    • Rejected: Use a fixed list in the command. It is wrong for a repository that uses another agent tool.
  • How does the test prove openspec validate --specs --strict after the merge?: Build a scratch repository with the git fake, run the onboarding command with --confirm, merge the branch, and run the pinned validation through OpenSpecTool with the suite's fake at the process edge. (best practice) [sources: docs/adr/0007-tests-double-only-process-edges.md, src/devops_cli/openspec/tool.py:87]
    • Chosen: Replay the pinned CLI through the fake. ADR 0007 doubles only process edges, and the fake replays the real pinned answer.
    • Rejected: Run the real binary on the scratch repository. It needs a process edge that the suite does not allow.
    • Rejected: Assert the written files only. It does not prove that the CLI accepts the result.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

#3742

Activity

  1. added
    source/agent
    type/feature
    scope/roadmap
    status/new
    value/medium
    effort/medium
    on Nov 6, 2026
  2. dan-petty commented on Nov 6, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/feature. The feat prefix of the title gives the type.
    • Scope: scope/roadmap. The (roadmap) scope of the title gives the scope.
    • Priority: P2-Medium. The feature improves onboarding but does not block existing workflows.
    • Value: Medium. It prevents one-failure-at-a-time discovery of missing OpenSpec files in new repositories.
    • Effort: Medium. The body estimates about 300,000 tokens and 2 hours to build.
    • Related: fix(pr): pr create fits a repository without openspec #3767, which asks for a different change. Both items deal with OpenSpec in the devops-cli toolchain, but #3767 fixes pr create to work without OpenSpec while the candidate adds OpenSpec setup to roadmap onboard.
  3. added
    priority/p2-medium
    on Nov 6, 2026
  4. devops-cli-service commented on Nov 7, 2026

    @devops-cli-service
    Contributor

    Refine cannot set this item to Ready at 72744a9 while the items below stay open. The next refine round looks at the item again when they close, or when a person replies in a comment or edits the body.

    The next refine round also looks at the item again when a commit on the default branch changes one of these files: src/devops_cli/commands/roadmap.py, src/devops_cli/commands/pr.py.

  5. devops-cli-service commented on Nov 7, 2026

    @devops-cli-service
    Contributor

    Refine cannot set this item to Ready at 734e060 while the items below stay open. The next refine round looks at the item again when they close, or when a person replies in a comment or edits the body.

  6. devops-cli-service commented on Nov 8, 2026

    @devops-cli-service
    Contributor

    Alternatives check: in-use

    Reason: The OpenSpec CLI's openspec init is non-interactive with --tools <ids> and already creates the openspec/ layout, a config.yaml with schema: spec-driven, and the skills/commands, so it covers the folder and skills part of the need. It does not ship devops-cli's project-neutral context and rules template, cannot commit an empty openspec/specs/ directory (needs .gitkeep), and gives no onboard row or pull request, so it covers only part of the issue.

    The item already names this tool.

    Tool: Fission-AI/OpenSpec (https://github.com/Fission-AI/OpenSpec)

    • License: MIT
    • Last activity: 2026-11-07
    • Maintained: yes

    Covers:

    • openspec init --tools <ids> sets up openspec/ without prompts
    • Writes openspec/config.yaml with schema: spec-driven
    • Writes the workflow skills and commands into the agent tool folders
    • openspec update --force refreshes the installed files
    • openspec validate --specs --strict checks the result

    Lacks:

    • A project-neutral context with a marked line for a person to fill in
    • A rules template for proposal, specs, design and tasks
    • A committed openspec/specs/.gitkeep for an otherwise empty specs path
    • The openspec row reading present, missing or invalid
    • Opening the onboarding pull request and the no-overwrite/second-confirm behavior

    Tools considered:

    Searches run:

    • openspec CLI init non-interactive OPEN_SPEC_INTERACTIVE fission-ai, results: 5
    • @fission-ai/openspec npm package init config.yaml spec-driven, results: 5
    • openspec config.yaml rules proposal specs design tasks context customize, results: 5

    Sources:

    Checked on 2026-11-08. A person decides what this means for the item. The check changes no label and closes no issue.

  7. dan-petty commented on Nov 11, 2026

    @dan-petty
    OwnerAuthor

    Scope from the generalization plan (2026-11-11)

    The tracker #4627 changes this row as follows.

  8. devops-cli-service commented on Nov 11, 2026

    @devops-cli-service
    Contributor

    Refine cannot set this item to Ready at 5c71ad4 while the items below stay open. The next refine round looks at the item again when they close, or when a person replies in a comment or edits the body.

  9. 27 remaining items

  10. added
    status/planned
    and removed
    status/blocked
    on Nov 27, 2026
  11. devops-cli-service commented on Nov 27, 2026

    @devops-cli-service
    Contributor

    Cleared the stop at job by the rule continue: the runner Job devops-cli-implement-devops-cli-3770-ec96d7 ended without a result. The class ci_infra of the stop is one that a new attempt can fix. This is continuation 1 of 4 for this item. The item is Planned again. The Service takes it in the next round. The new Job takes the branch from origin, so it keeps the work that the run pushed there.

  12. added a commit that references this issue on Nov 27, 2026
  13. added
    owner/service
    status/in-progress
    status/in-review
    and removed
    status/planned
    status/in-progress
    on Nov 27, 2026
  14. devops-cli-service commented on Nov 27, 2026

    @devops-cli-service
    Contributor

    The draft pull request #7407 holds the final title and body. In mode on of roadmap.fix_checks.mode, the watch row marks it ready when its checks pass, and a fix-checks Job repairs a failed check whose name gives the class test, lint or types. In each other case the watch row stops the item: another failed check, a cancelled check, a conflict, a fix-checks Job that ended with no repair, or another mode.

    Spend: 188 model requests, 31048463 input tokens, 72503 output tokens.

  15. removed
    owner/service
    on Nov 27, 2026
  16. removed
    status/in-review
    on Nov 27, 2026
  17. devops-cli-service commented on Nov 27, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-27 18:39 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/mediumpriority/p2-mediumscope/roadmapsource/agenttype/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions