sync-specs skill overwrites an existing ADDED requirement, contradicting the CLI's no-op/conflict rule from #1376
维护者通常 1 天内回复
@vaibhavdabas16 已经在做这个了。
开始于 2026年11月22日。
评估
- 难度
- 1/5
- 预计耗时
- 1 小时以内
- 新手友好度
- 86/100
- Issue 类型
- 文档
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- typescript
调研方向
阅读 src/core/specs-apply.ts 中第 583-592 行附近,了解 #1376 的 no-op/冲突规则,然后编辑 getSyncSpecsSkillTemplate(约第 114 行)和 getOpsxSyncCommandTemplate(约第 395 行)中的 ADDED Requirements 列表项(位于 src/core/templates/workflows/sync-specs.ts),使其与之一致。完成的标准是:两个模板都写明 add-if-missing、skip-if-identical 和 report-conflict-without-overwriting,并且现有的模板测试仍然通过。
由索引模型根据 Issue 内容生成。
描述
The sync-specs skill tells the agent to overwrite an ADDED requirement that already exists in the main spec. The CLI stopped doing that in #1376. If an earlier change is synced again after a later change has edited the same requirement, an agent following the skill silently reverts the later edit, where openspec archive would stop with a conflict.
Where (main at 0c737dc, v2.1.1):
src/core/templates/workflows/sync-specs.ts, line 114 in getSyncSpecsSkillTemplate and line 395 in getOpsxSyncCommandTemplate:
**ADDED Requirements:**
- If requirement doesn't exist in main spec → add it
- If requirement already exists → update it to match (treat as implicit MODIFIED)
Compare src/core/specs-apply.ts, lines 583 to 592, which implements the fix for #1332. When an ADDED requirement already exists, identical content is skipped as a no-op and differing content throws ADDED failed ... already exists.
Sequence
- Change A adds requirement R, and is synced to
openspec/specs/while A stays active. This is the early-sync pattern from #1332, and the skill allows syncing an active change. - Change B modifies R, for example by adding a scenario, and is synced or archived.
- A is synced again, either by running sync on it a second time or by choosing "Sync anyway" when archiving it.
In step 3 R already exists and no longer matches A's ADDED block. The CLI treats that as a genuine conflict and aborts. The skill tells the agent to "update it to match", which replaces R with A's original version and drops B's scenario without any warning.
I haven't reproduced the agent overwrite in a live session. This came out of an automated review of the skill files openspec init generated in my repo (1.6.0, where the same lines exist). I confirmed the text is unchanged on current main and read the CLI path in source.
Suggested fix
Make the skill match the CLI:
**ADDED Requirements:**
- If requirement doesn't exist in main spec → add it
- If it already exists with identical content → leave it unchanged (already synced; re-syncing is a no-op)
- If it already exists with different content → do not overwrite; report the conflict and ask the user
to reconcile it (a later change may have edited it, or the delta should use MODIFIED)
Happy to turn this into a PR against both templates.
- 主要语言
- TypeScript
- 星标
- 76k
- 派生
- 5.2k
- 平均合并
- 1 天 5 小时
- 30 天内合并 PR
- 58
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Fission-AI/OpenSpec 的其他 Issue
-
enhancement needs-triage
难度 2/5 1-3 小时 新手友好度 74/100
Fission-AI/OpenSpec#2337 ·
维护者通常 1 天内回复
-
bug needs-triage
难度 2/5 1-3 小时 新手友好度 78/100
Fission-AI/OpenSpec#2311 ·
维护者通常 1 天内回复
-
难度 1/5 1-3 小时 新手友好度 76/100
Fission-AI/OpenSpec#2208 · 2 条评论 ·
维护者通常 1 天内回复
-
Document the RFC 2119 keyword rule (attribution lost in docs rebuild) and its clarification update RFC 8174可能已有人在做 @sofiaali1521-cloud 于 5 天前认领。 未关闭documentation needs-triage
难度 1/5 1-3 小时 新手友好度 88/100
Fission-AI/OpenSpec#2200 · 5 条评论 ·
维护者通常 1 天内回复
-
archive and sync skills merge every `specs/**/*.md` as a delta spec, including files `validate` rejects可能已有人在做 @clay-good 于 33 天前认领。 未关闭bug needs-triage
难度 2/5 1-3 小时 新手友好度 78/100
Fission-AI/OpenSpec#2173 ·
维护者通常 1 天内回复
查看 Fission-AI/OpenSpec 的全部 Issue
相似的 Issue
-
area: integrations documentation priority: P2 size: XS
难度 2/5 1-3 小时 新手友好度 78/100
eddiejaoude/StackDash#798 ·
维护者通常 1 天内回复
-
bot:ai-assisted component:midnight-js status:untriaged
难度 2/5 1-3 小时 新手友好度 72/100
midnightntwrk/midnight-js#1790 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
area:vscode bug has repro platform:macos platform:vscode regression
难度 2/5 1-3 小时 新手友好度 70/100
anthropics/claude-code#113502 ·
-
check:passed streams:add
难度 1/5 1 小时以内 新手友好度 77/100
维护者通常 1 天内回复