Templates
Every doc type has a matching template bundled in the @ciderpress/templates package. Use the CLI to scaffold them or import the SDK directly into your own tooling.
Scaffolding with the CLI
The fastest way to create a new doc is ciderpress draft:
This renders the template with your title (plus any variables) and writes it to the output directory. Variables you don't supply are left as raw {{ }} markers for you — or a coding agent — to fill in later, and draft prints a checklist of what remains.
Custom templates
Point Ciderpress at one or more directories of your own templates via the templates field in ciderpress.config.ts:
Each template is a plain .md or .mdx file with label and hint frontmatter. The filename is the type (adr.md becomes type adr):
.mdxtemplates scaffold to.mdxfiles, so JSX and components flow through the MDX pipeline.- A custom template whose filename matches a built-in overrides it — a
guide.mdreplaces the bundled Guide. - Frontmatter is always stripped from the scaffolded output.
Variables
A template body can contain {{ marker }} variables. Interior whitespace is ignored, so {{title}} and {{ title }} are equivalent.
Built-in variables are always substituted at draft time:
Declared variables are the fillable blanks a template names under vars. Only id is required; title and description drive the interactive prompt:
At draft time each declared variable is filled from a --var id=value argument, then — on an interactive terminal — prompted for. Anything left blank (or every declared variable when running non-interactively, e.g. from a coding agent) stays as a raw {{ id }} marker.
Undeclared markers pass through untouched as plain text — no error, no substitution. This lets you leave hand-authored blanks a template doesn't formally declare.
The no-leftover-markers lint
ciderpress check and ciderpress build fail when a published doc still contains a {{ }} marker, so a half-filled draft can't ship. Markers inside fenced or inline code are ignored, so docs that demonstrate the convention (like this one) don't trip it. A marker's key is limited to identifier and phrase characters, so JSX/MDX inline objects such as style={{ color: 'red' }} are never mistaken for markers.
Listing and validating
Template validation also runs as part of ciderpress check and ciderpress build, alongside the no-leftover-markers lint.
Using the SDK
You can import @ciderpress/templates directly to integrate with your own CLI or tooling:
render substitutes only the keys you pass and leaves the rest as raw markers. Use findMarkers to list what remains:
Available templates
These built-in templates use {{title}}; see Variables for the full substitution model.
Tutorial
Type: tutorial
Guide
Type: guide
Quickstart
Type: quickstart
Explanation
Type: explanation
Reference
Type: reference
Standard
Type: standard
Troubleshooting
Type: troubleshooting
Runbook
Type: runbook
References
- Types — rules for each doc type
- Recommended — where templates fit in the layout
- CLI Commands — full CLI reference