Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
182 changes: 180 additions & 2 deletions .claude/commands/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,105 @@ This directory contains pre-configured commands that provide automated workflows
/similarity-analysis path=src threshold=0.9
```

#### `code-complexity-check.md`

**Purpose**: Analyze code complexity and identify refactoring candidates
**Features**:

- Cyclomatic complexity analysis
- Function length and nesting depth detection
- Complexity thresholds (low/medium/high/critical)
- Refactoring recommendations
- CI integration with strict mode

**Usage**:

```
/code-complexity-check
/code-complexity-check --threshold 15
/code-complexity-check --strict
```

### Quality & Testing

#### `pre-pr-checklist.md`

**Purpose**: Automate comprehensive checks before creating a pull request
**Features**:

- Sequential quality checks (lint, format, test, etc.)
- PR size estimation and labeling
- Linked issues verification
- Branch status validation
- Merge conflict detection

**Usage**:

```
/pre-pr-checklist
/pre-pr-checklist --skip-tests
/pre-pr-checklist --verbose
```

#### `test-coverage-trend.md`

**Purpose**: Track and visualize test coverage trends over time
**Features**:

- Historical coverage tracking
- Trend analysis with ASCII graphs
- Threshold alerts (70% coverage)
- Per-file coverage breakdown
- CSV export for external analysis

**Usage**:

```
/test-coverage-trend
/test-coverage-trend --days 30
/test-coverage-trend --graph
```

### Security

#### `dependency-health-check.md`

**Purpose**: Comprehensive dependency health analysis
**Features**:

- npm package updates detection
- Security vulnerability scanning (`npm audit`)
- Deprecated package identification
- License compliance checking
- Health score calculation

**Usage**:

```
/dependency-health-check
/dependency-health-check --strict
/dependency-health-check --json
```

#### `security-credential-scan.md`

**Purpose**: Scan repository for hardcoded credentials and secrets
**Features**:

- API key, token, and password detection
- Private key and certificate scanning
- .env file validation
- False positive reduction
- Auto-fix capabilities

**Usage**:

```
/security-credential-scan
/security-credential-scan --fix
/security-credential-scan --strict
```

### Development Environment

#### `setup-husky.md`
Expand All @@ -47,15 +146,94 @@ This directory contains pre-configured commands that provide automated workflows
- Code quality gate enforcement
- Development workflow integration

#### `container-health.md`

**Purpose**: Verify DevContainer environment health and configuration
**Features**:

- Tool availability verification
- Version checking (Node.js, npm, Claude Code)
- Configuration validation
- System resource monitoring
- Auto-fix capabilities

**Usage**:

```
/container-health
/container-health --fix
/container-health --verbose
```

#### `setup-new-repo.md`

**Purpose**: Bootstrap a new repository with this configuration
**Features**:

- DevContainer setup
- Git configuration (commitlint, Husky)
- GitHub Actions workflows
- Development tools (ESLint, Prettier, Jest)
- Documentation templates

**Usage**:

```
/setup-new-repo /path/to/new/repo
/setup-new-repo --minimal
/setup-new-repo --no-devcontainer
```

### Repository Management

#### `branch-cleanup.md`

**Purpose**: Clean up merged and stale branches
**Features**:

- Merged branch detection and deletion
- Stale branch identification (30+ days)
- Protected branch exclusion
- Interactive confirmation
- Remote branch cleanup support

**Usage**:

```
/branch-cleanup
/branch-cleanup --dry-run
/branch-cleanup --remote
```

#### `changelog-generator.md`

**Purpose**: Generate CHANGELOG from Conventional Commits history
**Features**:

- Automatic commit grouping by type
- GitHub commit and PR links
- Breaking changes highlighting
- Version detection
- Keep a Changelog format

**Usage**:

```
/changelog-generator
/changelog-generator --since v1.0.0
/changelog-generator --contributors
```

#### `setup-team-protection.md`

**Purpose**: Configures GitHub repository protection for team development
**Purpose**: Setup GitHub repository protection rules for team development
**Features**:

- Branch protection rules (no direct push, required reviews)
- Branch protection (no direct push, required reviews)
- Required status checks (CI passing)
- Repository settings (squash merge, auto-delete branches)
- Security features (Dependabot, vulnerability alerts)
- Configurable reviewer count and enforcement

**Usage**:

Expand Down
153 changes: 153 additions & 0 deletions .claude/commands/changelog-generator.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
# Changelog Generator Command

Generate CHANGELOG.md from Conventional Commits history.

## Usage

```bash
/changelog-generator
/changelog-generator --since v1.0.0
/changelog-generator --output CHANGELOG.md
```

## What It Does

This command generates a structured CHANGELOG from git commit history:

### Commit Grouping

Automatically groups commits by type:

- **Features** (feat): New features and enhancements
- **Bug Fixes** (fix): Bug fixes and patches
- **Performance** (perf): Performance improvements
- **Breaking Changes**: BREAKING CHANGE notes
- **Documentation** (docs): Documentation updates
- **Other**: ci, chore, refactor, test, style, build

### Version Detection

- **Automatic Versioning**: Detects latest tag
- **Custom Range**: Specify start tag with `--since`
- **Unreleased Changes**: Shows commits since last tag

### Changelog Format

- **Grouped by Type**: Organized sections
- **Commit Links**: GitHub commit URLs
- **PR References**: Links to pull requests
- **Breaking Changes**: Highlighted separately
- **Contributors**: Optional contributor list

## Example Output

```markdown
# Changelog

All notable changes to this project will be documented in this file.

## [Unreleased]

### Features

- Add dependency health check command ([#238](https://github.com/user/repo/pull/238))
- Add pre-PR checklist automation ([a1b2c3d](https://github.com/user/repo/commit/a1b2c3d))
- Branch cleanup utility ([4e5f6g7](https://github.com/user/repo/commit/4e5f6g7))

### Bug Fixes

- Fix coverage reporting in CI ([8h9i0j1](https://github.com/user/repo/commit/8h9i0j1))
- Resolve shellcheck warnings ([2k3l4m5](https://github.com/user/repo/commit/2k3l4m5))

### Documentation

- Update README with new commands ([#239](https://github.com/user/repo/pull/239))

## [1.0.0] - 2025-12-30

### Features

- Initial release with comprehensive CI/CD
- DevContainer configuration
- Claude Code integration

### BREAKING CHANGES

- Minimum Node.js version is now 22+
```

## Options

```bash
# Generate since specific tag
/changelog-generator --since v1.0.0

# Generate for all history
/changelog-generator --all

# Custom output file
/changelog-generator --output HISTORY.md

# Include all commit types
/changelog-generator --include-all

# Add contributors section
/changelog-generator --contributors

# Preview without writing
/changelog-generator --dry-run
```

## Conventional Commit Types

| Type | Section | Included by Default |
| -------- | ---------------- | ------------------- |
| feat | Features | ✅ |
| fix | Bug Fixes | ✅ |
| perf | Performance | ✅ |
| docs | Documentation | ✅ |
| BREAKING | BREAKING CHANGES | ✅ |
| refactor | Refactoring | ❌ |
| test | Tests | ❌ |
| ci | CI/CD | ❌ |
| chore | Chores | ❌ |
| style | Style | ❌ |
| build | Build | ❌ |

## CI Integration

```yaml
# .github/workflows/release.yml
- name: Generate Changelog
run: |
bash script/changelog-generator.sh --since ${{ github.event.release.tag_name }}
git add CHANGELOG.md
git commit -m "docs: update changelog for ${{ github.event.release.tag_name }}"
```

## Format

The generated changelog follows [Keep a Changelog](https://keepachangelog.com/) format:

- **Readable**: Human-friendly format
- **Parseable**: Machine-readable structure
- **Consistent**: Follows Conventional Commits
- **Linkable**: GitHub URLs for commits and PRs

## Benefits

- 📝 **Automated**: No manual changelog maintenance
- ✅ **Accurate**: Based on actual commits
- 🔗 **Linked**: Direct links to commits and PRs
- 📊 **Organized**: Grouped by semantic meaning
- ⚡ **Fast**: Quick generation from git log

## Implementation

This command is implemented in `script/changelog-generator.sh`.

## Requirements

- Git repository with conventional commits
- GitHub repository (for PR links)
- Git tags for version markers
Loading
Loading