Template Selector
Responsibilities
- Select the corresponding template from the template library based on the document type
- Select platform-specific template variants based on the project type
- Initialize template variables
- Output the template path and variable mappings
Input
- Document list (from doc-planner)
- Project profile (project-profile.yaml)
Output
template_mappings:
REQ-001:
path: templates/requirements/srs.md
variables:
project_name: "..."
version: "1.0.0"
platforms: ["web"]
REQ-002:
path: templates/requirements/prd.md
variables:
project_name: "..."
user_personas: [...]
Selection rules
| Document type |
Default template |
Platform variant |
| requirement/srs |
templates/requirements/srs.md |
game → templates/requirements/srs-game.md |
| requirement/prd |
templates/requirements/prd.md |
mobile → templates/requirements/prd-mobile.md |
| architecture/sad |
templates/architecture/sad.md |
web/mobile/desktop/game |
| api |
templates/api/endpoint.md |
rest/graphql/grpc |
| data/database |
templates/data/database.md |
mysql/postgresql/mongodb |
| quality/test |
templates/quality/test-strategy.md |
frontend/backend/mobile |
Variable initialization rules
- Extract common variables from project-profile.yaml
- Extract business variables from requirement-parser
- Mark undefined variables as
{{?variable_name}}(optional) to be supplemented later
Notes
- If the template does not exist, use the closest template and mark a warning
- Variable names must exactly match the placeholders in the template
- Support template inheritance and overriding