refactor: extract skills from commands across 8 plugins
Refactored commands to extract reusable skills following the Commands → Skills separation pattern. Each command is now <50 lines and references skill files for detailed knowledge. Plugins refactored: - claude-config-maintainer: 5 commands → 7 skills - code-sentinel: 3 commands → 2 skills - contract-validator: 5 commands → 6 skills - data-platform: 10 commands → 6 skills - doc-guardian: 5 commands → 6 skills (replaced nested dir) - git-flow: 8 commands → 7 skills Skills contain: workflows, validation rules, conventions, reference data, tool documentation Commands now contain: YAML frontmatter, agent assignment, skills list, brief workflow steps, parameters Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -6,116 +6,49 @@ description: Generate changelog from conventional commits in Keep-a-Changelog fo
|
||||
|
||||
Generate a changelog entry from conventional commits.
|
||||
|
||||
## Skills to Load
|
||||
|
||||
- skills/changelog-format.md
|
||||
|
||||
## Visual Output
|
||||
|
||||
When executing this command, display the plugin header:
|
||||
|
||||
```
|
||||
┌──────────────────────────────────────────────────────────────────┐
|
||||
│ 📝 DOC-GUARDIAN · Changelog Generation │
|
||||
└──────────────────────────────────────────────────────────────────┘
|
||||
+------------------------------------------------------------------+
|
||||
| DOC-GUARDIAN - Changelog Generation |
|
||||
+------------------------------------------------------------------+
|
||||
```
|
||||
|
||||
Then proceed with the generation.
|
||||
|
||||
## Process
|
||||
|
||||
1. **Identify Commit Range**
|
||||
- Default: commits since last tag
|
||||
- Optional: specify range (e.g., `v1.0.0..HEAD`)
|
||||
- Detect if this is first release (no previous tags)
|
||||
Execute `skills/changelog-format.md` - detect range from tags
|
||||
|
||||
2. **Parse Conventional Commits**
|
||||
Extract from commit messages following the pattern:
|
||||
```
|
||||
<type>(<scope>): <description>
|
||||
|
||||
[optional body]
|
||||
|
||||
[optional footer(s)]
|
||||
```
|
||||
|
||||
**Recognized Types:**
|
||||
| Type | Changelog Section |
|
||||
|------|------------------|
|
||||
| `feat` | Added |
|
||||
| `fix` | Fixed |
|
||||
| `docs` | Documentation |
|
||||
| `perf` | Performance |
|
||||
| `refactor` | Changed |
|
||||
| `style` | Changed |
|
||||
| `test` | Testing |
|
||||
| `build` | Build |
|
||||
| `ci` | CI/CD |
|
||||
| `chore` | Maintenance |
|
||||
| `BREAKING CHANGE` | Breaking Changes |
|
||||
Use pattern from skill: `<type>(<scope>): <description>`
|
||||
|
||||
3. **Group by Type**
|
||||
Organize commits into Keep-a-Changelog sections:
|
||||
- Breaking Changes (if any `!` suffix or `BREAKING CHANGE` footer)
|
||||
- Added (feat)
|
||||
- Changed (refactor, style, perf)
|
||||
- Deprecated
|
||||
- Removed
|
||||
- Fixed (fix)
|
||||
- Security
|
||||
Map to Keep-a-Changelog sections per skill
|
||||
|
||||
4. **Format Entries**
|
||||
For each commit:
|
||||
- Extract scope (if present) as prefix
|
||||
- Extract scope as bold prefix
|
||||
- Use description as entry text
|
||||
- Link to commit hash if repository URL available
|
||||
- Include PR/issue references from footer
|
||||
- Link commit hashes if repo URL available
|
||||
|
||||
5. **Output Format**
|
||||
```markdown
|
||||
## [Unreleased]
|
||||
|
||||
### Breaking Changes
|
||||
- **scope**: Description of breaking change
|
||||
|
||||
### Added
|
||||
- **scope**: New feature description
|
||||
- Another feature without scope
|
||||
|
||||
### Changed
|
||||
- **scope**: Refactoring description
|
||||
|
||||
### Fixed
|
||||
- **scope**: Bug fix description
|
||||
|
||||
### Documentation
|
||||
- Updated README with new examples
|
||||
```
|
||||
5. **Output**
|
||||
Use format from `skills/changelog-format.md`
|
||||
|
||||
## Options
|
||||
|
||||
| Flag | Description | Default |
|
||||
|------|-------------|---------|
|
||||
| `--from <tag>` | Start from specific tag | Latest tag |
|
||||
| `--to <ref>` | End at specific ref | HEAD |
|
||||
| `--version <ver>` | Set version header | [Unreleased] |
|
||||
| `--include-merge` | Include merge commits | false |
|
||||
| `--group-by-scope` | Group by scope within sections | false |
|
||||
| `--from <tag>` | Start from tag | Latest tag |
|
||||
| `--to <ref>` | End at ref | HEAD |
|
||||
| `--version <ver>` | Version header | [Unreleased] |
|
||||
| `--include-merge` | Include merges | false |
|
||||
| `--group-by-scope` | Group by scope | false |
|
||||
|
||||
## Integration
|
||||
|
||||
The generated output is designed to be copied directly into CHANGELOG.md:
|
||||
Output designed for direct copy to CHANGELOG.md:
|
||||
- Follows [Keep a Changelog](https://keepachangelog.com) format
|
||||
- Compatible with semantic versioning
|
||||
- Excludes non-user-facing commits (chore, ci, test by default)
|
||||
|
||||
## Example Usage
|
||||
|
||||
```
|
||||
/changelog-gen
|
||||
/changelog-gen --from v1.0.0 --version 1.1.0
|
||||
/changelog-gen --include-merge --group-by-scope
|
||||
```
|
||||
|
||||
## Non-Conventional Commits
|
||||
|
||||
Commits not following conventional format are:
|
||||
- Listed under "Other" section
|
||||
- Flagged for manual categorization
|
||||
- Skipped if `--strict` flag is used
|
||||
|
||||
Reference in New Issue
Block a user