Summary
Every agent-facing instruction in the codebase tells the agent to write specs at specs/<capability>/spec.md — a flat, one-level-deep layout. Human-facing documentation (docs/concepts.md, docs/existing-projects.md) describes organizing specs by domain (e.g., specs/auth/, specs/payments/), but that nested pattern is never surfaced in agent instructions.
The internal code already supports nested layouts (spec-discovery.ts, validator.ts, specs-apply.ts, change-parser.ts all handle specs/<area>/<capability>/spec.md), so the gap is purely in agent-facing guidance.
Affected files
schemas/spec-driven/schema.yaml:62-64 — The authoritative schema instruction tells agents specs/<capability>/spec.md (flat, no domain).
- All skill templates (
src/core/templates/workflows/propose.ts, explore.ts, sync-specs.ts, archive-change.ts) — Reference specs/<capability>/spec.md.
- All SKILL.md files (
skills/openspec-propose/SKILL.md, openspec-explore/, openspec-sync-specs/, openspec-archive-change/) — Same flat pattern.
openspec/specs/openspec-conventions/spec.md — Structure diagram shows [capability]/ without a [domain]/ level.
src/core/validation/validator.ts:165 and src/core/parsers/spec-structure.ts:47 — User-facing error messages use the flat path pattern.
Expected behavior
Agents should be instructed to organize specs by domain under specs/<domain>/<capability>/spec.md. The schema instruction and all skill templates should reflect this.
Root cause
The schema instruction has been specs/<capability>/spec.md since spec-driven was introduced, and every skill template and skill file copied that pattern. The human docs show domain organization but the agent instructions never caught up.
Suggested approach
- Update
schemas/spec-driven/schema.yaml instruction to tell agents to group specs by domain, look at existing domain directories, and create new ones as needed.
- Update the path patterns in all skill templates and SKILL.md files to use
specs/<domain>/<capability>/spec.md.
- Update the conventions spec structure diagram to include the domain level.
- Update user-facing error messages in the validator and parser.
- Add guidance about how agents should determine the appropriate domain for a capability (existing domains take precedence; create a new short kebab-case domain if none fits).
Note: I have a local branch with all these changes applied that I can share if it would help kickstart the PR.
Summary
Every agent-facing instruction in the codebase tells the agent to write specs at
specs/<capability>/spec.md— a flat, one-level-deep layout. Human-facing documentation (docs/concepts.md,docs/existing-projects.md) describes organizing specs by domain (e.g.,specs/auth/,specs/payments/), but that nested pattern is never surfaced in agent instructions.The internal code already supports nested layouts (
spec-discovery.ts,validator.ts,specs-apply.ts,change-parser.tsall handlespecs/<area>/<capability>/spec.md), so the gap is purely in agent-facing guidance.Affected files
schemas/spec-driven/schema.yaml:62-64— The authoritative schema instruction tells agentsspecs/<capability>/spec.md(flat, no domain).src/core/templates/workflows/propose.ts,explore.ts,sync-specs.ts,archive-change.ts) — Referencespecs/<capability>/spec.md.skills/openspec-propose/SKILL.md,openspec-explore/,openspec-sync-specs/,openspec-archive-change/) — Same flat pattern.openspec/specs/openspec-conventions/spec.md— Structure diagram shows[capability]/without a[domain]/level.src/core/validation/validator.ts:165andsrc/core/parsers/spec-structure.ts:47— User-facing error messages use the flat path pattern.Expected behavior
Agents should be instructed to organize specs by domain under
specs/<domain>/<capability>/spec.md. The schema instruction and all skill templates should reflect this.Root cause
The schema instruction has been
specs/<capability>/spec.mdsince spec-driven was introduced, and every skill template and skill file copied that pattern. The human docs show domain organization but the agent instructions never caught up.Suggested approach
schemas/spec-driven/schema.yamlinstruction to tell agents to group specs by domain, look at existing domain directories, and create new ones as needed.specs/<domain>/<capability>/spec.md.Note: I have a local branch with all these changes applied that I can share if it would help kickstart the PR.