| name | template-scaffolding |
| description | Template loading, variable filling, and scaffolding for all GSD artifacts. Manages 22+ templates covering every document type in the GSD system, from PROJECT.md to milestone archives. |
phase: 72
status: planned
created: 2026-03-02
template: phase-prompt
variant: standard
Phase 72: OAuth2 Authentication
...
### 7. Template Discovery
List available templates:
Available templates:
project - Project definition (PROJECT.md)
requirements - Requirements specification (REQUIREMENTS.md)
roadmap - Development roadmap (ROADMAP.md)
state - Project state (STATE.md)
context - Phase context (CONTEXT.md)
summary - Phase summary (SUMMARY.md) [3 variants]
phase-prompt - Phase plan (PLAN.md)
...
### 8. Template Variant Selection
Automatic variant selection based on context:
```javascript
function selectSummaryVariant(context) {
if (context.isQuickTask) return 'summary-minimal';
if (context.taskCount <= 3) return 'summary-minimal';
if (context.taskCount <= 8) return 'summary-standard';
return 'summary-complex';
}
Tool Use Instructions
Loading and Filling a Template
- Use
Glob to locate the template file in templates/
- Use
Read to load the template content
- Replace all
{{VARIABLE}} placeholders with provided values
- Process conditional blocks (
{{#if}}...{{/if}}, {{#unless}}...{{/unless}})
- Add frontmatter if specified
- Use
Write to save the filled template to the target path
Batch Generation
- Accept list of template-to-target mappings
- Load each template, fill variables with shared + per-file data
- Write all files, collecting results