fix(templates): show the main spec format in the sync-specs skill#1402
fix(templates): show the main spec format in the sync-specs skill#1402clay-good wants to merge 1 commit into
Conversation
📝 WalkthroughWalkthroughThe sync specification, authored skill, and generated sync templates now define a canonical merged main-spec format with one ChangesSync main-spec format
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
The sync-specs skill's only markdown example was the delta format, so agents (Junie in #1120) copied delta files into openspec/specs/ as-is, leaving ## MODIFIED Requirements headers that the spec parser rejects — openspec view reported 0 requirements. Add a Main Spec Format Reference, point step 4d at it, and add a guardrail against wholesale delta copies. Fixes #1120 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
ec154f2 to
c9d109e
Compare
alfred-openspec
left a comment
There was a problem hiding this comment.
The canonical main-spec reference closes the delta-header failure mode in both sync variants, and the checked-in skill remains generator-clean. Exact-head build, 37 focused tests, all 36 spec validations, and the full cross-platform matrix passed.
Status
Ready for review. Guidance-only change to the sync-specs skill/command templates — no CLI behavior, parser, or schema changes. Rebased onto current main (the golden-hash file had drifted with #1394's archive-template update).
What was wrong
The
openspec-sync-specsskill tells the agent to merge delta specs into main specs, but the only markdown example it shows is the delta format (## ADDED/MODIFIED Requirementsheaders). Weaker agents pattern-match that example and copy the delta file intoopenspec/specs/<capability>/spec.mdas-is. The main-spec parser anchors on a literal## Requirementssection (src/core/parsers/requirement-blocks.ts), so a main spec left with delta headers parses as 0 requirements inopenspec view— exactly what #1120 reported with Junie. Since #1394 the archive skill also routes its sync through this skill, so the gap affected every archive-with-sync too.How it was fixed
In both templates in
src/core/templates/workflows/sync-specs.ts(skill +/opsx:synccommand):# <capability> Specification→## Purpose→## Requirements, perbuildSpecSkeletoninsrc/core/specs-apply.ts), with an explicit rule that main specs never contain delta operation headers.openspec/specs/specs-sync-skill/spec.mdand regeneratedskills/openspec-sync-specs/SKILL.md+ the golden hashes.Proof it works
npx vitest runon the rebased branch: 2,027 passing; the only failures are the 17 known environment-onlyzsh-installerfailures on machines with a real Oh My Zsh install (ZshInstaller tests fail on machines with a real Oh My Zsh install (17/50 failures) #1321, fix open in test(completion): isolate ZshInstaller tests from a real Oh My Zsh install #1400); CI is unaffected.node dist/cli/index.js validate --specs: 36 passed, 0 failed (includes the modifiedspecs-sync-skill).npm run build+npm run generate:skillsclean after the rebase — zero drift between the committedskills/openspec-sync-specs/SKILL.mdand the generator output; no other skill changed.Notes
CORE_WORKFLOWS(src/core/profiles.ts) now includessync.archive-change.ts; fix: validate artifact content before marking workflow step done #1098 touches done-detection inartifact-graph.Fixes #1120
🤖 Generated with Claude Code
Summary by CodeRabbit
## Requirementssection).