--- namespace: aiwg name: add-template platforms: [all] description: Scaffold a new document template inside an existing addon or framework --- # Add Template Scaffold a new document template inside an existing addon or framework. ## Triggers Alternate expressions and non-obvious activations (primary phrases are matched automatically from the skill description): - "I need a new template" → scaffold template in specified target - "add a document template" → prompt for name, category, and target - "create a template for X documents" → derive name from X, prompt for target - "template for use cases" → name=`use-case`, prompt for target and category ## Trigger Patterns Reference | Pattern | Example | Action | |---------|---------|--------| | Named add | "add template adr --to sdlc-complete" | Scaffold directly | | Category specified | "add template threat-model --to sdlc-complete --category security" | Place in category subdir | | Interactive | "add template --interactive --to sdlc-complete" | Guided design mode | | Target omitted | "add template risk-register" | Ask which addon or framework | ## Process ### 1. Parse Arguments Extract from `$ARGUMENTS`: - `` — kebab-case template name (required) - `--to ` — addon or framework directory name (required) - `--category ` — subdirectory within `templates/` (optional; e.g., `requirements`, `architecture`, `security`) - `--interactive` — enable guided design questions If either `` or `--to` is missing, ask before proceeding. ### 2. Validate Target Confirm the target exists: ```bash # Check addons ls agentic/code/addons//templates/ # Check frameworks ls agentic/code/frameworks//templates/ ``` ### 3. Determine Category If `--category` is not provided and the target has existing category subdirectories, list them and ask. Common categories in sdlc-complete: | Category | Contents | |----------|----------| | `requirements` | Use cases, user stories, NFRs | | `architecture` | SAD, ADRs, C4 diagrams | | `security` | Threat models, security gates | | `testing` | Test plans, test cases, test reports | | `deployment` | Deployment plans, runbooks | | `planning` | Phase plans, iteration plans, risk registers | | `analysis-design` | Domain models, sequence diagrams | If no category is appropriate, place directly in `templates/`. ### 4. Interactive Design (if --interactive) Ask before generating: 1. **Purpose**: What SDLC artifact does this template produce? 2. **Audience**: Who fills in this template? (developer, architect, project manager) 3. **Required sections**: What sections must every instance include? 4. **Optional sections**: What sections depend on the specific project? 5. **Variables**: What `{{placeholder}}` variables should be pre-populated by tooling? 6. **Examples**: Should the template include inline examples? ### 5. Run Scaffolding ```bash aiwg add-template --to [--category ] ``` ### 6. Customize the Generated Template Templates use Markdown with YAML frontmatter and `{{variable}}` placeholders: ```markdown --- template: version: 1.0.0 category: description: variables: - project_name - author - date --- #