Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
be571e9
feat: add comprehensive development and security tools
keito4 Dec 31, 2025
de7ee81
docs: update README with new commands documentation
keito4 Dec 31, 2025
0398703
feat: merge main with DevContainer and team protection updates
keito4 Dec 31, 2025
0dcd3c3
fix: resolve shellcheck warnings in development tools
keito4 Dec 31, 2025
6a2463f
fix: correct shellcheck directive placement
keito4 Dec 31, 2025
06080d1
feat: Sync Claude settings from Elu-co-jp projects
keito4 Jan 1, 2026
a2432af
docs: Add security check step to sync-claude-settings command
keito4 Jan 1, 2026
845cb7e
feat: Merge latest main branch updates
keito4 Jan 1, 2026
a508325
feat: Add create-pr command for automated PR creation
keito4 Jan 1, 2026
a7d6244
feat: Add auto-refactor and PR creation to similarity-analysis
keito4 Jan 1, 2026
2198861
chore: trigger CI rerun with updated main branch
github-actions[bot] Jan 1, 2026
923160f
chore: trigger CI rerun with updated main branch
github-actions[bot] Jan 1, 2026
5c15b4f
chore: trigger CI rerun with updated main branch
github-actions[bot] Jan 1, 2026
0ea471c
chore: trigger CI rerun with updated main branch
github-actions[bot] Jan 1, 2026
940f4d7
chore: trigger CI rerun with updated main branch
github-actions[bot] Jan 1, 2026
1386c94
chore: trigger CI rerun with updated main branch
github-actions[bot] Jan 1, 2026
dc2b297
chore: trigger CI rerun with updated main branch
github-actions[bot] Jan 1, 2026
e387e7f
chore: trigger CI rerun with updated main branch
github-actions[bot] Jan 1, 2026
c04bc42
chore: trigger CI rerun with updated main branch
github-actions[bot] Jan 1, 2026
873c56b
chore: trigger CI rerun with updated main branch
github-actions[bot] Jan 1, 2026
f7e1661
chore: trigger CI rerun with updated main branch
github-actions[bot] Jan 1, 2026
0408262
chore: trigger CI rerun with updated main branch
github-actions[bot] Jan 2, 2026
fa3572d
chore: trigger CI rerun with updated main branch
github-actions[bot] Jan 2, 2026
0eb58f5
ci: bump docker/setup-qemu-action from 2 to 3 (#249)
dependabot[bot] Jan 1, 2026
dc8ef47
feat: Add pnpm:2 DevContainer feature recommendations (#260)
keito4 Jan 1, 2026
eec0164
ci: bump actions/setup-node from 4 to 6 (#250)
dependabot[bot] Jan 1, 2026
148ef5c
ci: bump actions/upload-artifact from 4 to 6 (#248)
dependabot[bot] Jan 1, 2026
95783a5
feat: add user-level Claude commands sync and automation scripts (#238)
keito4 Jan 1, 2026
52deab2
ci: bump codecov/codecov-action from 4 to 5 (#246)
dependabot[bot] Jan 1, 2026
a54b5fd
feat: Add Deno DevContainer feature (#263)
keito4 Jan 2, 2026
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
138 changes: 138 additions & 0 deletions .claude/commands/branch-cleanup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
# Branch Cleanup Command

Clean up merged and stale branches both locally and remotely.

## Usage

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

## What It Does

This command helps maintain a clean repository by identifying and removing:

### Local Branches

- **Merged Branches**: Branches already merged into main/master
- **Stale Branches**: Branches with no activity for 30+ days
- **Gone Remote Branches**: Local branches tracking deleted remote branches

### Remote Branches (with --remote)

- **Merged PR Branches**: Branches from merged pull requests
- **Stale Remote Branches**: No activity for 30+ days
- **Abandoned Branches**: No commits, PRs, or activity

### Protected Branches

Never deletes:

- main, master, develop
- Current branch
- Branches with unmerged changes
- Branches specified in protection list

## Example Output

```
🧹 Branch Cleanup
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

📍 Current branch: feat/add-commands
🔒 Protected: main, master, develop

📊 Analysis
• Total local branches: 15
• Merged branches: 8
• Stale branches (30+ days): 3
• Up-to-date branches: 4

🗑️ Branches to delete (11):

Merged (8):
✓ feat/227-commitlint (merged 2 days ago)
✓ feat/226-common-utils (merged 2 days ago)
✓ feat/225-docker-in-docker (merged 2 days ago)
... and 5 more

Stale (3):
⚠ experiment/new-feature (90 days old)
⚠ fix/old-bug (45 days old)
⚠ refactor/unused (60 days old)

Delete these branches? [y/N]: y

Deleting branches...
✓ Deleted feat/227-commitlint
✓ Deleted feat/226-common-utils
✓ Deleted feat/225-docker-in-docker
✓ Deleted 8 more branches

✨ Cleanup complete! Removed 11 branches.
```

## Options

```bash
# Preview without deleting (recommended first run)
/branch-cleanup --dry-run

# Include remote branches
/branch-cleanup --remote

# Auto-confirm deletion (for CI)
/branch-cleanup --yes

# Custom staleness threshold (default: 30 days)
/branch-cleanup --stale-days 60

# Only merged branches
/branch-cleanup --merged-only
```

## Safety Features

- **Dry Run**: Preview before deletion
- **Interactive Confirmation**: Requires user approval
- **Protection List**: Never deletes protected branches
- **Unmerged Detection**: Warns about unmerged changes
- **Current Branch**: Never deletes current branch

## CI Integration

```yaml
# .github/workflows/branch-cleanup.yml
- name: Cleanup Merged Branches
run: |
bash script/branch-cleanup.sh --merged-only --yes
```

## Staleness Criteria

| Age | Status | Action |
| ------ | ---------- | ------ |
| < 30d | Active | Keep |
| 30-60d | Stale | Warn |
| 60-90d | Very Stale | Delete |
| > 90d | Abandoned | Delete |

## Benefits

- 🧹 **Clean Repository**: Remove clutter
- ⚡ **Faster Operations**: Fewer branches to manage
- 👀 **Better Visibility**: Focus on active work
- 💾 **Disk Space**: Free up local storage
- 🔄 **Best Practice**: Regular maintenance habit

## Implementation

This command is implemented in `script/branch-cleanup.sh`.

## Requirements

- Git repository
- GitHub CLI (`gh`) for remote branch operations (optional)
- Proper permissions for remote deletions
Loading
Loading