Motivation
Schema artifact definitions currently require template to be a filename resolved under schemas/<name>/templates/. For small schemas (a one-artifact "memo" workflow, quick project-local schemas), forcing a separate template file adds friction — the schema author has to maintain a second file for what is often a three-line skeleton.
Proposal
Let template accept either form, distinguished by shape:
artifacts:
- id: memo
template: memo.md # existing: filename under templates/
- id: memo
template: | # new: inline content, used verbatim
## Memo
<!-- What changed, why, which files affected -->
Detection: a single-line, path-shaped string with an extension is treated as a file reference; anything multi-line or not path-shaped is inline content. Fully backward-compatible — every existing schema keeps resolving as before, and a missing referenced file still raises TemplateLoadError.
Implementation
A ready implementation (+50 lines including tests, no behavior change for existing schemas) is on this branch:
https://github.com/stanleykao72/OpenSpec/tree/feat/inline-template-content
Happy to open a PR if there's interest.
Motivation
Schema artifact definitions currently require
templateto be a filename resolved underschemas/<name>/templates/. For small schemas (a one-artifact "memo" workflow, quick project-local schemas), forcing a separate template file adds friction — the schema author has to maintain a second file for what is often a three-line skeleton.Proposal
Let
templateaccept either form, distinguished by shape:Detection: a single-line, path-shaped string with an extension is treated as a file reference; anything multi-line or not path-shaped is inline content. Fully backward-compatible — every existing schema keeps resolving as before, and a missing referenced file still raises
TemplateLoadError.Implementation
A ready implementation (+50 lines including tests, no behavior change for existing schemas) is on this branch:
https://github.com/stanleykao72/OpenSpec/tree/feat/inline-template-content
Happy to open a PR if there's interest.