Frontmatter
LeanSpec uses YAML frontmatter for structured metadata at the top of each spec.
What is Frontmatter?
Frontmatter is machine-readable metadata in YAML format:
---
status: in-progress
created: 2025-11-02
tags: [api, security]
priority: high
---
# Your Spec Title
[Spec content...]
Core Fields
status (required)
Current state of the spec.
Valid values:
planned- Not started yetin-progress- Currently being worked oncomplete- Work is finishedarchived- Work is archived
Example:
status: in-progress
created (required)
Date when spec was created (ISO 8601 format).
Format: YYYY-MM-DD
Example:
created: 2025-11-02
This is auto-filled when you use lean-spec create.
Optional Fields
tags
Array of tags for categorization and filtering.
Example:
tags: [api, security, mvp]
Usage:
lean-spec list --tag=api
priority
Importance level of the work.
Valid values:
lowmediumhighcritical
Example:
priority: high
Usage:
lean-spec list --priority=high
completed
Date when work was completed (auto-added).
Format: YYYY-MM-DD
Example:
completed: 2025-11-05
This is automatically added when you set status: complete.
Custom Fields
You can define custom fields in .lean-spec/config.json:
{
"frontmatter": {
"custom": {
"assignee": "string",
"reviewer": "string",
"epic": "string",
"sprint": "number",
"estimate": "string"
}
}
}
Supported types:
stringnumberbooleanarray
Usage:
lean-spec create feature --field assignee=alice --field sprint=42
lean-spec list --field epic=PROJ-123
See Custom Fields for details.
Visual Badges
LeanSpec auto-generates visual badges from frontmatter:
> **Status**: ⏳ In progress · **Priority**: High · **Created**: 2025-11-02 · **Tags**: api, security
Status icons:
- 📅 Planned
- ⏳ In progress
- ✅ Complete
- 📦 Archived
These badges are automatically updated when you use lean-spec update.
Full Example
---
status: in-progress
created: 2025-11-02
completed:
tags: [api, authentication, security]
priority: high
assignee: alice
reviewer: bob
epic: PROJ-123
sprint: 42
---
# User Authentication API
> **Status**: ⏳ In progress · **Priority**: High · **Created**: 2025-11-02
> **Tags**: api, authentication, security · **Assignee**: alice · **Reviewer**: bob
[Spec content...]
Editing Frontmatter
Via CLI
Recommended approach:
lean-spec update 001 --status=complete --priority=critical
This updates both frontmatter and visual badges.
Manual Editing
You can also edit frontmatter directly in the file:
- Open
README.mdin editor - Modify YAML between
---markers - Save file
Note: Manual edits don't auto-update visual badges. Run lean-spec update to sync.
Best Practices
Begin with just status and created. Add fields only when you need them.
Establish tag conventions for your team. Examples: api, ui, backend, security.
Keep status current. Use lean-spec list to see what's in progress.
Add custom fields sparingly. Each field is overhead to maintain.
Next: Learn about Custom Fields or explore Variables.