SuperAPI AI Directory

template-selector

Writing & research

View repository

Updated 10-16 01:19

About this skill

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

  1. Extract common variables from project-profile.yaml
  2. Extract business variables from requirement-parser
  3. 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