# Custom Skills Template

Place skill definitions in `.claude/skills/` to create reusable workflows invoked with slash commands. Each skill is a directory containing a `SKILL.md` file.

---

## Example: .claude/skills/fix-issue/SKILL.md

```markdown
---
name: fix-issue
description: Reads a GitHub issue, creates a branch, implements the fix, and opens a PR.
user-invocable: true
---

Follow these steps to fix a GitHub issue:

1. Read the issue details using `gh issue view $ARGUMENTS`
2. Create a feature branch from main: `git checkout -b fix/issue-$ARGUMENTS`
3. Understand the issue requirements and acceptance criteria
4. Implement the fix following the project's coding conventions
5. Write or update tests to cover the change
6. Run the test suite to verify all tests pass
7. Run the linter to verify code quality
8. Commit the changes with a descriptive message referencing the issue
9. Push the branch and create a pull request using `gh pr create`

The PR description should:
- Reference the issue with "Closes #$ARGUMENTS"
- Summarize the changes
- Include a test plan
```

---

## Example: .claude/skills/review-pr/SKILL.md

```markdown
---
name: review-pr
description: Reviews a pull request for code quality, security, and correctness.
user-invocable: true
---

Review the specified pull request:

1. Fetch the PR details: `gh pr view $ARGUMENTS`
2. Read the diff: `gh pr diff $ARGUMENTS`
3. Check the PR description for context and intent
4. Review every changed file for:
   - Correctness and completeness
   - Security vulnerabilities
   - Test coverage
   - Adherence to project conventions
   - Performance implications
5. Summarize your findings with:
   - Issues that must be fixed before merging
   - Suggestions for improvement
   - Positive observations (what was done well)
6. Post the review as a PR comment: `gh pr comment $ARGUMENTS --body "..."`
```

---

## Example: .claude/skills/release-notes/SKILL.md

```markdown
---
name: release-notes
description: Generates release notes from commits since the last tag.
user-invocable: true
---

Generate release notes:

1. Find the latest tag: `git describe --tags --abbrev=0`
2. List all commits since the last tag: `git log <tag>..HEAD --oneline`
3. Categorize commits into:
   - Features (feat:, feature:, add:)
   - Bug Fixes (fix:, bugfix:)
   - Breaking Changes (breaking:, BREAKING CHANGE in body)
   - Other (refactor:, docs:, chore:, ci:)
4. Write release notes in this format:

## [version] - [date]

### Features
- [description from commit]

### Bug Fixes
- [description from commit]

### Breaking Changes
- [description and migration steps]

5. Output the release notes for the user to review
```

---

## Example: .claude/skills/scaffold/SKILL.md

```markdown
---
name: scaffold
description: Creates a new feature module with standard boilerplate files.
user-invocable: true
---

Create a new feature module for the given feature name ($ARGUMENTS):

1. Create the feature directory structure following the project's conventions
2. Generate boilerplate files:
   - Main feature file
   - Types / interfaces file
   - Test file with basic test structure
   - Index / barrel export file
3. Register the feature in any relevant routers, registries, or configuration
4. Add placeholder implementations with TODO comments for business logic
5. Run the linter and type checker to verify the scaffolded code compiles
6. List all created files for the user to review
```

---

## Usage

Skills are invoked with slash commands in Claude Code:

```
/fix-issue 123
/review-pr 456
/release-notes
/scaffold user-preferences
```

## Notes

- Skills live in `.claude/skills/<skill-name>/SKILL.md`
- Set `user-invocable: true` to make the skill available as a slash command
- `$ARGUMENTS` is replaced with whatever the user types after the command name
- Skills are committed to version control and shared with the team
- Keep each skill focused on a single workflow
- Skills can reference CLAUDE.md instructions and project rules
