Complete Examples
Example 1: PR Description Generator
Generate standardized Pull Request descriptions automatically.
markdown
---
name: pr-description
description: |
Generate a structured PR description from git diff and commits.
Triggers on "generate PR description", "write PR summary".
metadata:
type: workflow
version: "1.0.0"
triggers:
- "generate PR description"
- "write PR summary"
- "create pull request description"
allowed-tools:
- Bash
- Read
---
# PR Description Generator
## When to Use
- Creating a pull request and need a structured description
- User mentions "PR description", "pull request summary"
## When NOT to Use
- Creating the PR itself (use gh CLI)
- Commit message generation (that's a separate task)
## Workflow
1. Run `git log` to get commits on this branch vs. base
2. Run `git diff` to get the full changeset
3. Analyze: categorize changes (feature, fix, refactor, etc.)
4. Generate PR description in the format below
## Output FormatSummary
- 1-3 bullet points summarizing the key changes
Changes
- Feature: ...
- Fix: ...
- Refactor: ...
Test Plan
- [ ] Manual test: ...
- [ ] Unit test: ...
Screenshots
(if UI changes)
## Notes
- Keep the title under 70 characters
- Focus on WHY, not just WHAT
- If the diff is very large, suggest splitting the PRExample 2: API Endpoint Generator
Generate RESTful API endpoints from database models.
markdown
---
name: api-generator
description: |
Generate RESTful API endpoints from database models.
Triggers on "generate API", "create endpoints for".
metadata:
type: tool
version: "1.0.0"
triggers:
- "generate API"
- "create endpoints"
- "scaffold API routes"
allowed-tools:
- Read
- Write
- Edit
- Bash
---
# API Generator
## When to Use
- User has a database model and wants CRUD endpoints
- User says "generate API for [model]"
## When NOT to Use
- GraphQL APIs (different patterns)
- Streaming or WebSocket endpoints
## Workflow
1. Read the model file to understand fields and types
2. Ask user: which CRUD operations are needed?
3. Ask user: what validation rules apply?
4. Generate route file, validation schemas, service layer, and basic tests
## Conventions
- Routes: thin, only request/response handling
- Services: all business logic
- Use async/await, no callbacks
- Validate all inputs
## Notes
- Generate only what's requested — don't over-engineer
- Use the project's existing patterns and librariesExample 3: Weekly Report Generator
Generate team weekly reports from Git activity.
markdown
---
name: weekly-report
description: |
Generate a weekly report from git activity.
Triggers on "weekly report", "team update", "write weekly summary".
metadata:
type: workflow
version: "1.0.0"
triggers:
- "weekly report"
- "team update"
allowed-tools:
- Bash
---
# Weekly Report Generator
## When to Use
- End of week team status update
- User mentions "weekly report" or "team update"
## Workflow
1. Run `git log --since="last Monday"` to get commits
2. Categorize into: Features, Fixes, Refactors, Chores
3. Ask user for non-code accomplishments
4. Generate report
## Output FormatWeekly Report — [Date Range]
Accomplishments
- ...
Next Week
- ...
Blockers
- ...
Next Steps
- When to Use Which — Choose the right Skill
- Common Mistakes — Avoid common pitfalls