3.7 KiB
3.7 KiB
Document Metadata Schema
All documents in the docs/ directory must include YAML frontmatter with the following structure.
Required Fields
title
- Type: String
- Description: Human-readable document title
- Example:
"OAuth2 Migration Specification"
category
- Type: String (enum)
- Description: Document category, must match the directory it's in
- Valid values:
ai_docs- Reference materials for Claude Codespecs- Feature and migration specificationsanalysis- Investigation outputsplans- Implementation planstemplates- Reusable templatesarchive- Historical documents (auto-set on archiving)
- Example:
specs
status
- Type: String (enum)
- Description: Current lifecycle status of the document
- Valid values:
draft- Document is being createdactive- Document is current and relevantcomplete- Work is done, kept for referencearchived- Document has been archived
- Example:
active - Lifecycle: draft → active → complete → archived
created
- Type: Date (YYYY-MM-DD)
- Description: Date the document was created
- Example:
2024-11-16
last_updated
- Type: Date (YYYY-MM-DD)
- Description: Date the document was last modified
- Example:
2024-11-16 - Note: Should be updated whenever significant changes are made
Optional Fields
tags
- Type: List of strings
- Description: Keywords for categorization and search
- Example:
[auth, oauth2, security, migration] - Best practice: Use consistent tags across related documents
archivable_after
- Type: Date (YYYY-MM-DD)
- Description: Explicit date after which the document can be auto-archived
- Example:
2025-02-16 - Note: Overrides category-based archiving rules when set
archived_date
- Type: Date (YYYY-MM-DD)
- Description: Date the document was archived (auto-set by archiving script)
- Example:
2024-12-01
archive_reason
- Type: String
- Description: Reason for archiving (auto-set by archiving script)
- Example:
"90 days old (threshold: 90)"
author
- Type: String
- Description: Document author or owner
- Example:
"Simon Lamb"
related_docs
- Type: List of strings (file paths)
- Description: Links to related documents
- Example:
["specs/auth-system/oauth2-spec.md", "plans/oauth2-rollout.md"]
Complete Example
---
title: OAuth2 Migration Specification
category: specs
status: active
created: 2024-11-16
last_updated: 2024-11-16
tags: [auth, oauth2, security, migration]
author: Simon Lamb
related_docs:
- analysis/auth-system-audit.md
- plans/oauth2-implementation-plan.md
---
Validation
Documents are validated using scripts/validate_doc_metadata.py. Run this before committing to ensure all metadata is correct.
Metadata Updates
When Creating a New Document
- Copy from
assets/doc_template.md - Fill in all required fields
- Set status to
draft - Set created and last_updated to current date
When Updating a Document
- Update
last_updatedto current date - Update
statusif lifecycle stage changes - Add relevant
tagsif needed
When Completing Work
- Set
statustocomplete - Update
last_updatedto current date - Optionally set
archivable_afterif auto-archiving should be deferred
Best Practices
- Consistent Tags: Use a common vocabulary of tags across documents
- Accurate Status: Keep status up to date as work progresses
- Related Docs: Link to related documents for context and discoverability
- Regular Updates: Update
last_updatedwhenever making significant changes - Descriptive Titles: Use clear, specific titles that describe the content