archive and sync skills merge every `specs/**/*.md` as a delta spec, including files `validate` rejects

オープン 初心者向け
#2,173 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

@clay-good がすでに取り組んでいます。

2026年10月29日 から。

  • #2174 @clay-good による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
78/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
typescript

調査の方向性

Read the archive-change.ts step 4 and sync-specs.ts step 3 instructions, then compare their use of artifactPaths.specs.existingOutputPaths with the <capability-path>/spec.md rule and discoverSpecFiles. Check the generated skill templates on main and run the archive and sync workflows with a stray specs/user-auth/notes.md file. Done when both workflows stop before writing main specs and explain how to move those requirements into spec.md; verify the valid spec.md path still syncs.

索引モデルが issue の本文から書いたものです。

説明

bug needs-triage
What you were trying to do

Archive a change with /opsx:archive, or sync it with /opsx:sync, when a delta was written to a second file beside a capability's spec.md, for example specs/user-auth/notes.md.

What happened

#1869 fixed the CLI side of this. instructions apply now warns ("specs/user-auth/notes.md is not a capability's spec.md, so openspec validate rejects it and archive never merges it"), and openspec archive validates and refuses the change.

The agent workflows still take their delta set from artifactPaths.specs.existingOutputPaths. That list resolves the schema glob specs/**/*.md, so it includes notes.md:

  • archive-change.ts step 4: "Use artifactPaths.specs.existingOutputPaths … as the only delta-spec source".
  • sync-specs.ts step 3: "Sync every path in existingOutputPaths".

Neither workflow runs openspec validate, and neither checks the <capability-path>/spec.md shape. The agent therefore merges notes.md's requirements into openspec/specs/user-auth/spec.md and moves the change to the archive, which is exactly what the CLI now refuses to do. The skills and the CLI disagree about which files are deltas.

Open PR #1796 delegates the final move to openspec archive --skip-specs. CLI validation would then refuse at the end, but only after the skill's inline sync has already written the stray requirements into the main specs. So that PR does not close this.

What you expected instead

The archive and sync skills treat only specs/<capability-path>/spec.md as delta specs, the same set discoverSpecFiles reads. For any other file under specs/, they stop before writing a main spec and tell the user to move its requirements into the capability's spec.md, as the apply warning says. Running openspec validate <name> before the sync would cover this and any future validate/skill drift.

Minimal steps to reproduce
openspec init --tools claude
openspec new change add-logout
# write proposal.md, design.md, tasks.md
mkdir -p openspec/changes/add-logout/specs/user-auth
# specs/user-auth/spec.md   -> "## ADDED Requirements / ### Requirement: Password Login" + scenario
# specs/user-auth/notes.md  -> "## ADDED Requirements / ### Requirement: Logout" + scenario
openspec status --change add-logout --json | jq '.artifactPaths.specs.existingOutputPaths'
# [".../specs/user-auth/notes.md", ".../specs/user-auth/spec.md"]
openspec validate add-logout   # exit 1

Then run /opsx:archive add-logout. Step 4 reads both paths as delta specs and offers "Sync now". The sync merges Logout into the main spec, and step 5 moves the change.

OpenSpec version

Reproduced on 1.14.3. The templates are unchanged on main @ 6d04a1b (1.15.0). Related: #1869 (CLI side, closed), #2163 (archive reads only artifactPaths.specs, open), #1796 (open PR).

Coding agent and model

Claude Code, Claude Opus. Found by reading the generated skills against status/validate output; the gap is in the instruction text.

Agent session trace

No response

OS and Node version

macOS, Node 24

主要言語
TypeScript
スター
73.6k
フォーク
5k
平均マージ
3日 22時間
マージ済み PR(30日)
62

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Fission-AI/OpenSpec のほかの issue

Fission-AI/OpenSpec の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。