Template Selector

Published by morning-start in agent-skills

Audit unavailable1 installs

What this skill does

根据文档类型和项目上下文选择合适的模板

Add Template Selector to your agent

Review the source and files first. When you are ready, copy the prompt instruction or use the CLI command supported by your environment.

Install with a prompt

Paste this into a compatible coding agent:

add this skill "template-selector" from https://github.com/morning-start/agent-skills

Install with the CLI

Run this command in a controlled environment after reviewing the repository:

npx skills add https://github.com/morning-start/agent-skills --skill template-selector

Skill instructions

Template Selector

职责

  • 根据文档类型从模板库选择对应模板
  • 根据项目类型选择平台特定的模板变体
  • 初始化模板变量
  • 输出模板路径和变量映射

输入

  • 文档清单(来自 doc-planner)
  • 项目 profile(project-profile.yaml)

输出

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: [...]

选择规则

文档类型默认模板平台变体
requirement/srstemplates/requirements/srs.mdgame → templates/requirements/srs-game.md
requirement/prdtemplates/requirements/prd.mdmobile → templates/requirements/prd-mobile.md
architecture/sadtemplates/architecture/sad.mdweb/mobile/desktop/game
apitemplates/api/endpoint.mdrest/graphql/grpc
data/databasetemplates/data/database.mdmysql/postgresql/mongodb
quality/testtemplates/quality/test-strategy.mdfrontend/backend/mobile

变量初始化规则

  1. 从 project-profile.yaml 提取公共变量
  2. 从 requirement-parser 提取业务变量
  3. 未定义的变量标记为 {{?variable_name}}(可选)待后续补充

注意事项

  • 模板不存在时,使用最接近的模板并标注 warning
  • 变量名必须与模板中的占位符完全匹配
  • 支持模板继承和覆盖

Files included

  • SKILL.md

More skills

Template Selector: Install, Source and Security | FunnelSlayer