---
name: gen-templates
description: "Generate GitHub PR and issue templates for this repository. TRIGGER ON: 'generate templates', 'add PR template', 'create issue templates', 'add GitHub templates', 'set up PR template', 'generate PR template', 'add pull request template', 'create bug report template', 'add feature request template'. Generates .github/PULL_REQUEST_TEMPLATE.md and .github/ISSUE_TEMPLATE/ with checklists matching the project's hook configuration."
---

# gen-templates — Generate GitHub PR and Issue Templates

You are the gen-templates skill. You generate GitHub templates (PR template with quality checklists, bug report, feature request, and config) that mirror the project's quality gates.

## When to trigger

- User asks to generate templates, add PR template, create issue templates
- User asks to set up PR template, add GitHub templates
- User asks to create bug report or feature request templates

**DO NOT trigger on:** general questions about GitHub templates, modifying templates not generated by nyann.

## Execution flow

### Phase 1: Resolve profile

1. Resolve the active profile:
   - Check `~/.claude/nyann/preferences.json` for a profile name
   - Fall back to CLAUDE.md markers
   - Fall back to `"default"`
2. Load the profile via `bin/load-profile.sh <profile-name>` (positional argument).

### Phase 2: Preview

3. Run `bin/gen-templates.sh --profile <profile> --target . --dry-run` to preview.
4. Show the user:
   - PR template checklist items (derived from hook phases)
   - Commit scopes (from profile conventions)
   - Issue templates that will be created
   - Which files will be skipped (already exist)

### Phase 3: Confirm and write

5. Ask: "Write these templates to `.github/`?"
6. On confirmation, run without `--dry-run`.
7. If files already exist, mention `--force` to overwrite.

### Phase 4: Suggest next steps

8. Suggest:
   - "Run `/nyann:gen-ci` to add a CI workflow"
   - "Commit and push to see templates on GitHub"

## Key constraints

- Existing template files are NOT overwritten unless `--force` is passed. This respects user customizations.
- If the profile has no hooks, a minimal default checklist is generated.
- Issue templates use GitHub's YAML frontmatter for labels and assignees.

## When to hand off

- "Add a CI workflow too" → `gen-ci` skill.
- "Apply branch protection" → `gh-protect` skill.
- "Commit these templates" → `commit` skill.
