Define your own requirement schema with a custom reqmd init preset.
What’s in this folder#
04-custom-templates/
preset/ # the custom preset directory
schema.yaml.tmpl # Go template for schema.yaml
example.md.tmpl # Go template for the example .md fileThis preset defines a custom requirements template with:
priority(required) — low, medium, high, criticalverification-method(required) — test, review, analysis, inspection, demonstrationowner(optional) — responsible team
Scaffold from the custom preset#
reqmd init my-safety/ --preset 04-custom-templates/preset/ --id-prefix SCThis produces:
my-safety/
schema.yaml # rendered from schema.yaml.tmpl
requirements.md # rendered from example.md.tmplValidate the scaffolded output#
reqmd check my-safety/Expected: two requirements (SC-001, SC-002) pass validation.
Template variables#
Both .tmpl files use Go text/template syntax with:
| Variable | Source | Example |
|---|---|---|
{{ .ID }} | --id flag or dir basename | my-safety |
{{ .Title }} | --title flag or <dir> Requirements | my-safety Requirements |
{{ .Level }} | --level flag (default requirements) | requirements |
{{ .IDPrefix }} | --id-prefix flag | SC |
Create your own preset#
- Create a directory with
schema.yaml.tmpl+example.md.tmpl(or plainschema.yaml+ any.mdfile — no template syntax needed) - Use
{{ .ID }},{{ .Title }},{{ .Level }},{{ .IDPrefix }}variables - Scaffold with
reqmd init <dir> --preset <your-preset-dir>/
What’s next#
You can scaffold custom document types. Now load verification results — go to Step 5 for CTRF automated results or Step 6 for manual review results.