feat: v3.0.0 architecture overhaul
- Rename marketplace to lm-claude-plugins - Move MCP servers to root with symlinks - Add 6 PR tools to Gitea MCP (list_pull_requests, get_pull_request, get_pr_diff, get_pr_comments, create_pr_review, add_pr_comment) - Add clarity-assist plugin (prompt optimization with ND accommodations) - Add git-flow plugin (workflow automation) - Add pr-review plugin (multi-agent review with confidence scoring) - Centralize configuration docs - Update all documentation for v3.0.0 BREAKING CHANGE: MCP server paths changed, marketplace renamed Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
75
plugins/git-flow/.claude-plugin/plugin.json
Normal file
75
plugins/git-flow/.claude-plugin/plugin.json
Normal file
@@ -0,0 +1,75 @@
|
||||
{
|
||||
"name": "git-flow",
|
||||
"version": "1.0.0",
|
||||
"description": "Git workflow automation with intelligent commit messages and branch management",
|
||||
"author": {
|
||||
"name": "Leo Miranda",
|
||||
"email": "leobmiranda@gmail.com"
|
||||
},
|
||||
"homepage": "https://gitea.hotserv.cloud/personal-projects/support-claude-mktplace/src/branch/main/plugins/git-flow/README.md",
|
||||
"repository": "https://gitea.hotserv.cloud/personal-projects/support-claude-mktplace.git",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
"git",
|
||||
"workflow",
|
||||
"commit",
|
||||
"branch",
|
||||
"automation"
|
||||
],
|
||||
"commands": [
|
||||
{
|
||||
"name": "commit",
|
||||
"description": "Create a commit with auto-generated conventional message",
|
||||
"file": "commands/commit.md"
|
||||
},
|
||||
{
|
||||
"name": "commit-push",
|
||||
"description": "Commit and push to remote in one operation",
|
||||
"file": "commands/commit-push.md"
|
||||
},
|
||||
{
|
||||
"name": "commit-merge",
|
||||
"description": "Commit current changes and merge into target branch",
|
||||
"file": "commands/commit-merge.md"
|
||||
},
|
||||
{
|
||||
"name": "commit-sync",
|
||||
"description": "Commit, push, and sync with upstream",
|
||||
"file": "commands/commit-sync.md"
|
||||
},
|
||||
{
|
||||
"name": "branch-start",
|
||||
"description": "Start a new feature/fix/chore branch with naming convention",
|
||||
"file": "commands/branch-start.md"
|
||||
},
|
||||
{
|
||||
"name": "branch-cleanup",
|
||||
"description": "Clean up merged branches locally and optionally remotely",
|
||||
"file": "commands/branch-cleanup.md"
|
||||
},
|
||||
{
|
||||
"name": "git-status",
|
||||
"description": "Enhanced git status with recommendations",
|
||||
"file": "commands/git-status.md"
|
||||
},
|
||||
{
|
||||
"name": "git-config",
|
||||
"description": "Configure git-flow settings for this project",
|
||||
"file": "commands/git-config.md"
|
||||
}
|
||||
],
|
||||
"agents": [
|
||||
{
|
||||
"name": "git-assistant",
|
||||
"description": "Git workflow assistant for complex operations",
|
||||
"file": "agents/git-assistant.md"
|
||||
}
|
||||
],
|
||||
"skills": [
|
||||
{
|
||||
"name": "workflow-patterns",
|
||||
"description": "Git branching strategies and workflow patterns",
|
||||
"path": "skills/workflow-patterns"
|
||||
}
|
||||
]
|
||||
}
|
||||
128
plugins/git-flow/README.md
Normal file
128
plugins/git-flow/README.md
Normal file
@@ -0,0 +1,128 @@
|
||||
# git-flow
|
||||
|
||||
Git workflow automation with intelligent commit messages and branch management.
|
||||
|
||||
## Overview
|
||||
|
||||
git-flow streamlines common git operations with smart defaults, conventional commit messages, and workflow enforcement. It supports multiple branching strategies and adapts to your team's workflow.
|
||||
|
||||
## Commands
|
||||
|
||||
| Command | Description |
|
||||
|---------|-------------|
|
||||
| `/commit` | Create commit with auto-generated conventional message |
|
||||
| `/commit-push` | Commit and push in one operation |
|
||||
| `/commit-merge` | Commit and merge into target branch |
|
||||
| `/commit-sync` | Full sync: commit, push, and rebase on base branch |
|
||||
| `/branch-start` | Start new feature/fix/chore branch |
|
||||
| `/branch-cleanup` | Clean up merged branches |
|
||||
| `/git-status` | Enhanced status with recommendations |
|
||||
| `/git-config` | Configure git-flow settings |
|
||||
|
||||
## Workflow Styles
|
||||
|
||||
| Style | Description | Best For |
|
||||
|-------|-------------|----------|
|
||||
| `simple` | Direct commits to main | Solo projects |
|
||||
| `feature-branch` | Feature branches, merge when done | Small teams |
|
||||
| `pr-required` | All changes via pull request | Code review workflows |
|
||||
| `trunk-based` | Short-lived branches, frequent integration | CI/CD heavy |
|
||||
|
||||
## Installation
|
||||
|
||||
Add to your project's `.claude/settings.json`:
|
||||
|
||||
```json
|
||||
{
|
||||
"plugins": ["git-flow"]
|
||||
}
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
Set environment variables in `.env` or `~/.config/claude/git-flow.env`:
|
||||
|
||||
```bash
|
||||
GIT_WORKFLOW_STYLE=feature-branch
|
||||
GIT_DEFAULT_BASE=development
|
||||
GIT_AUTO_DELETE_MERGED=true
|
||||
GIT_AUTO_PUSH=false
|
||||
GIT_PROTECTED_BRANCHES=main,master,development,staging
|
||||
GIT_COMMIT_STYLE=conventional
|
||||
GIT_CO_AUTHOR=true
|
||||
```
|
||||
|
||||
Or use `/git-config` for interactive configuration.
|
||||
|
||||
## Features
|
||||
|
||||
### Smart Commit Messages
|
||||
|
||||
Analyzes staged changes to generate appropriate conventional commit messages:
|
||||
|
||||
```
|
||||
feat(auth): add password reset functionality
|
||||
|
||||
Implement forgot password flow with email verification.
|
||||
Includes rate limiting and token expiration.
|
||||
```
|
||||
|
||||
### Branch Naming
|
||||
|
||||
Enforces consistent branch naming:
|
||||
|
||||
```
|
||||
feat/add-user-authentication
|
||||
fix/login-timeout-error
|
||||
chore/update-dependencies
|
||||
```
|
||||
|
||||
### Safety Checks
|
||||
|
||||
- Warns before commits to protected branches
|
||||
- Confirms force push operations
|
||||
- Prevents accidental branch deletion
|
||||
|
||||
### Conflict Resolution
|
||||
|
||||
The git-assistant agent helps resolve merge conflicts with analysis and recommendations.
|
||||
|
||||
## Usage Examples
|
||||
|
||||
### Start a Feature
|
||||
|
||||
```
|
||||
/branch-start add user authentication
|
||||
|
||||
→ Created: feat/add-user-authentication
|
||||
Based on: development
|
||||
```
|
||||
|
||||
### Commit Changes
|
||||
|
||||
```
|
||||
/commit
|
||||
|
||||
→ Analyzing changes...
|
||||
→ Proposed: feat(auth): add login component
|
||||
→ Committed: abc1234
|
||||
```
|
||||
|
||||
### Full Sync
|
||||
|
||||
```
|
||||
/commit-sync
|
||||
|
||||
→ Committed: abc1234
|
||||
→ Pushed to origin
|
||||
→ Rebased on development
|
||||
→ Status: Clean, up-to-date
|
||||
```
|
||||
|
||||
## Integration
|
||||
|
||||
For CLAUDE.md integration instructions, see `claude-md-integration.md`.
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
139
plugins/git-flow/agents/git-assistant.md
Normal file
139
plugins/git-flow/agents/git-assistant.md
Normal file
@@ -0,0 +1,139 @@
|
||||
# Git Assistant Agent
|
||||
|
||||
## Role
|
||||
|
||||
You are a git workflow assistant that helps users navigate complex git operations, resolve conflicts, and maintain clean repository history.
|
||||
|
||||
## Capabilities
|
||||
|
||||
### 1. Conflict Resolution
|
||||
|
||||
Guide users through merge conflicts:
|
||||
|
||||
```
|
||||
Conflict detected in: src/auth/login.ts
|
||||
|
||||
Let me analyze the conflict:
|
||||
|
||||
<<<<<<< HEAD (your changes)
|
||||
function login(user: User) {
|
||||
return authenticate(user.email, user.password);
|
||||
}
|
||||
=======
|
||||
function login(credentials: Credentials) {
|
||||
return authenticate(credentials);
|
||||
}
|
||||
>>>>>>> development (incoming)
|
||||
|
||||
Analysis:
|
||||
- Your version: Uses User type, explicit parameters
|
||||
- Their version: Uses Credentials type, single object
|
||||
|
||||
Recommendation:
|
||||
The incoming change uses a cleaner pattern. However, you'll need
|
||||
to ensure User type is converted to Credentials.
|
||||
|
||||
Options:
|
||||
1. Accept theirs (update your code to use Credentials)
|
||||
2. Accept yours (they'll need to adapt)
|
||||
3. Combine both (create overloaded function)
|
||||
4. Need more context about Credentials type
|
||||
```
|
||||
|
||||
### 2. History Cleanup
|
||||
|
||||
Help with rebasing, squashing, and amending:
|
||||
|
||||
```
|
||||
Your branch has 15 commits, including:
|
||||
- 5 "WIP" commits
|
||||
- 3 "fix typo" commits
|
||||
- 2 "oops" commits
|
||||
|
||||
Before merging, would you like to clean up history?
|
||||
|
||||
Options:
|
||||
1. Squash all into single commit (cleanest)
|
||||
2. Interactive rebase (you pick what to squash)
|
||||
3. Keep as-is (preserve full history)
|
||||
```
|
||||
|
||||
### 3. Recovery Operations
|
||||
|
||||
Help users recover from mistakes:
|
||||
|
||||
```
|
||||
Accidentally deleted a branch? Let's recover it:
|
||||
|
||||
Recent deleted branches (from reflog):
|
||||
- feat/important-feature (deleted 5 mins ago)
|
||||
Last commit: abc1234 "Add important feature"
|
||||
|
||||
Recover this branch?
|
||||
```
|
||||
|
||||
### 4. Complex Merges
|
||||
|
||||
Handle cherry-picks, partial merges, octopus merges:
|
||||
|
||||
```
|
||||
You want to merge only specific commits from feat/mixed-changes.
|
||||
|
||||
Commits in that branch:
|
||||
1. abc1234 - Add user auth (✓ want this)
|
||||
2. def5678 - Fix unrelated bug (✗ skip)
|
||||
3. ghi9012 - Add password reset (✓ want this)
|
||||
|
||||
I'll cherry-pick commits 1 and 3. Proceed?
|
||||
```
|
||||
|
||||
## Communication Style
|
||||
|
||||
### Clear Explanations
|
||||
- Explain what each command does before running
|
||||
- Show the before/after state
|
||||
- Highlight risks
|
||||
|
||||
### Safe Defaults
|
||||
- Always prefer non-destructive operations
|
||||
- Confirm before force operations
|
||||
- Create backups before risky operations
|
||||
|
||||
### Educational
|
||||
- Explain why conflicts occur
|
||||
- Teach patterns to avoid issues
|
||||
- Suggest workflow improvements
|
||||
|
||||
## Safety Protocols
|
||||
|
||||
### Before Destructive Operations
|
||||
```
|
||||
⚠️ This operation will:
|
||||
- Rewrite history for 5 commits
|
||||
- Require force push to remote
|
||||
- Affect other team members
|
||||
|
||||
Creating backup branch: backup/feat-password-reset-20240120
|
||||
|
||||
Proceed? (yes/no)
|
||||
```
|
||||
|
||||
### Protected Branches
|
||||
```
|
||||
⛔ Cannot directly modify 'main' branch.
|
||||
|
||||
This branch is protected. You should:
|
||||
1. Create a feature branch
|
||||
2. Make your changes
|
||||
3. Create a pull request
|
||||
|
||||
Would you like me to create a branch for this change?
|
||||
```
|
||||
|
||||
## Output Style
|
||||
|
||||
Always show:
|
||||
- What will happen
|
||||
- Current state
|
||||
- Expected outcome
|
||||
- Recovery options if things go wrong
|
||||
55
plugins/git-flow/claude-md-integration.md
Normal file
55
plugins/git-flow/claude-md-integration.md
Normal file
@@ -0,0 +1,55 @@
|
||||
# git-flow - CLAUDE.md Integration
|
||||
|
||||
Add the following section to your project's CLAUDE.md file to enable git-flow.
|
||||
|
||||
---
|
||||
|
||||
## Git Workflow
|
||||
|
||||
This project uses the git-flow plugin for git operations.
|
||||
|
||||
### Workflow Style
|
||||
|
||||
**Style:** feature-branch
|
||||
**Base Branch:** development
|
||||
|
||||
### Branch Naming
|
||||
|
||||
Use the format: `<type>/<description>`
|
||||
|
||||
Types: feat, fix, chore, docs, refactor, test, perf
|
||||
|
||||
Examples:
|
||||
- `feat/add-user-auth`
|
||||
- `fix/login-timeout`
|
||||
- `chore/update-deps`
|
||||
|
||||
### Commit Messages
|
||||
|
||||
Use conventional commits:
|
||||
|
||||
```
|
||||
<type>(<scope>): <description>
|
||||
|
||||
[body]
|
||||
|
||||
[footer]
|
||||
```
|
||||
|
||||
### Commands
|
||||
|
||||
| Command | Use Case |
|
||||
|---------|----------|
|
||||
| `/commit` | Create commit with smart message |
|
||||
| `/commit-push` | Commit and push |
|
||||
| `/commit-merge` | Commit and merge to base |
|
||||
| `/branch-start` | Start new branch |
|
||||
| `/git-status` | Enhanced status |
|
||||
|
||||
### Protected Branches
|
||||
|
||||
Do not commit directly to: main, development, staging
|
||||
|
||||
---
|
||||
|
||||
Copy the section between the horizontal rules into your CLAUDE.md.
|
||||
94
plugins/git-flow/commands/branch-cleanup.md
Normal file
94
plugins/git-flow/commands/branch-cleanup.md
Normal file
@@ -0,0 +1,94 @@
|
||||
# /branch-cleanup - Clean Merged Branches
|
||||
|
||||
## Purpose
|
||||
|
||||
Remove branches that have been merged, both locally and optionally on remote.
|
||||
|
||||
## Behavior
|
||||
|
||||
### Step 1: Identify Merged Branches
|
||||
|
||||
```bash
|
||||
# Find merged local branches
|
||||
git branch --merged <base-branch>
|
||||
|
||||
# Find merged remote branches
|
||||
git branch -r --merged <base-branch>
|
||||
```
|
||||
|
||||
### Step 2: Present Findings
|
||||
|
||||
```
|
||||
Found 5 merged branches:
|
||||
|
||||
Local:
|
||||
- feat/login-page (merged 3 days ago)
|
||||
- fix/typo-header (merged 1 week ago)
|
||||
- chore/deps-update (merged 2 weeks ago)
|
||||
|
||||
Remote:
|
||||
- origin/feat/login-page
|
||||
- origin/fix/typo-header
|
||||
|
||||
Protected (won't delete):
|
||||
- main
|
||||
- development
|
||||
- staging
|
||||
|
||||
Delete these branches?
|
||||
1. Delete all (local + remote)
|
||||
2. Delete local only
|
||||
3. Let me pick which ones
|
||||
4. Cancel
|
||||
```
|
||||
|
||||
### Step 3: Execute Cleanup
|
||||
|
||||
```bash
|
||||
# Delete local
|
||||
git branch -d <branch-name>
|
||||
|
||||
# Delete remote
|
||||
git push origin --delete <branch-name>
|
||||
```
|
||||
|
||||
### Step 4: Report
|
||||
|
||||
```
|
||||
Cleanup complete:
|
||||
|
||||
Deleted local: 3 branches
|
||||
Deleted remote: 2 branches
|
||||
Skipped: 0 branches
|
||||
|
||||
Remaining local branches:
|
||||
- main
|
||||
- development
|
||||
- feat/current-work (not merged)
|
||||
```
|
||||
|
||||
## Environment Variables
|
||||
|
||||
| Variable | Default | Description |
|
||||
|----------|---------|-------------|
|
||||
| `GIT_DEFAULT_BASE` | `development` | Base branch for merge detection |
|
||||
| `GIT_PROTECTED_BRANCHES` | `main,master,development,staging,production` | Never delete these |
|
||||
| `GIT_AUTO_DELETE_REMOTE` | `false` | Auto-delete remote branches |
|
||||
|
||||
## Safety
|
||||
|
||||
- Never deletes protected branches
|
||||
- Warns about unmerged branches
|
||||
- Confirms before deleting remote branches
|
||||
- Uses `-d` (safe delete) not `-D` (force delete)
|
||||
|
||||
## Output
|
||||
|
||||
On success:
|
||||
```
|
||||
Cleaned up:
|
||||
Local: 3 branches deleted
|
||||
Remote: 2 branches deleted
|
||||
|
||||
Repository is tidy!
|
||||
```
|
||||
96
plugins/git-flow/commands/branch-start.md
Normal file
96
plugins/git-flow/commands/branch-start.md
Normal file
@@ -0,0 +1,96 @@
|
||||
# /branch-start - Start New Branch
|
||||
|
||||
## Purpose
|
||||
|
||||
Create a new feature/fix/chore branch with consistent naming conventions.
|
||||
|
||||
## Usage
|
||||
|
||||
```
|
||||
/branch-start [description]
|
||||
```
|
||||
|
||||
## Behavior
|
||||
|
||||
### Step 1: Determine Branch Type
|
||||
|
||||
```
|
||||
What type of change is this?
|
||||
1. feat - New feature
|
||||
2. fix - Bug fix
|
||||
3. chore - Maintenance task
|
||||
4. docs - Documentation
|
||||
5. refactor - Code refactoring
|
||||
```
|
||||
|
||||
### Step 2: Get Description
|
||||
|
||||
If not provided, ask:
|
||||
|
||||
```
|
||||
Brief description (2-4 words):
|
||||
> add user authentication
|
||||
```
|
||||
|
||||
### Step 3: Generate Branch Name
|
||||
|
||||
Convert to kebab-case:
|
||||
- `feat/add-user-authentication`
|
||||
- `fix/login-timeout-error`
|
||||
- `chore/update-dependencies`
|
||||
|
||||
### Step 4: Create Branch
|
||||
|
||||
```bash
|
||||
# Ensure base branch is up-to-date
|
||||
git checkout <base-branch>
|
||||
git pull origin <base-branch>
|
||||
|
||||
# Create and switch to new branch
|
||||
git checkout -b <new-branch>
|
||||
```
|
||||
|
||||
### Step 5: Confirm
|
||||
|
||||
```
|
||||
Created branch: feat/add-user-authentication
|
||||
Based on: development (abc1234)
|
||||
|
||||
Ready to start coding!
|
||||
```
|
||||
|
||||
## Environment Variables
|
||||
|
||||
| Variable | Default | Description |
|
||||
|----------|---------|-------------|
|
||||
| `GIT_DEFAULT_BASE` | `development` | Branch to create from |
|
||||
| `GIT_BRANCH_PREFIX` | `true` | Use type/ prefix |
|
||||
|
||||
## Naming Rules
|
||||
|
||||
- Lowercase only
|
||||
- Hyphens for spaces
|
||||
- No special characters
|
||||
- Max 50 characters
|
||||
|
||||
## Validation
|
||||
|
||||
```
|
||||
Branch name validation:
|
||||
✓ Lowercase
|
||||
✓ Valid prefix (feat/)
|
||||
✓ Descriptive (3+ words recommended)
|
||||
✗ Too long (52 chars, max 50)
|
||||
|
||||
Suggested: feat/add-user-auth
|
||||
Use this instead? (y/n)
|
||||
```
|
||||
|
||||
## Output
|
||||
|
||||
On success:
|
||||
```
|
||||
Branch: feat/add-user-authentication
|
||||
Base: development @ abc1234
|
||||
Status: Ready for development
|
||||
```
|
||||
83
plugins/git-flow/commands/commit-merge.md
Normal file
83
plugins/git-flow/commands/commit-merge.md
Normal file
@@ -0,0 +1,83 @@
|
||||
# /commit-merge - Commit and Merge
|
||||
|
||||
## Purpose
|
||||
|
||||
Commit current changes, then merge the current branch into a target branch.
|
||||
|
||||
## Behavior
|
||||
|
||||
### Step 1: Run /commit
|
||||
|
||||
Execute the standard commit workflow.
|
||||
|
||||
### Step 2: Identify Target Branch
|
||||
|
||||
Check environment or ask:
|
||||
|
||||
```
|
||||
Merge into which branch?
|
||||
1. development (Recommended - GIT_DEFAULT_BASE)
|
||||
2. main
|
||||
3. Other: ____
|
||||
```
|
||||
|
||||
### Step 3: Merge Strategy
|
||||
|
||||
```
|
||||
How should I merge?
|
||||
1. Merge commit (preserves history)
|
||||
2. Squash and merge (single commit)
|
||||
3. Rebase (linear history)
|
||||
```
|
||||
|
||||
### Step 4: Execute Merge
|
||||
|
||||
```bash
|
||||
# Switch to target
|
||||
git checkout <target>
|
||||
|
||||
# Pull latest
|
||||
git pull origin <target>
|
||||
|
||||
# Merge feature branch
|
||||
git merge <feature-branch> [--squash] [--no-ff]
|
||||
|
||||
# Push
|
||||
git push origin <target>
|
||||
```
|
||||
|
||||
### Step 5: Cleanup (Optional)
|
||||
|
||||
```
|
||||
Merge complete. Delete the feature branch?
|
||||
1. Yes, delete local and remote (Recommended)
|
||||
2. Delete local only
|
||||
3. Keep the branch
|
||||
```
|
||||
|
||||
## Environment Variables
|
||||
|
||||
| Variable | Default | Description |
|
||||
|----------|---------|-------------|
|
||||
| `GIT_DEFAULT_BASE` | `development` | Default branch to merge into |
|
||||
| `GIT_MERGE_STRATEGY` | `merge` | Default merge strategy |
|
||||
| `GIT_AUTO_DELETE_MERGED` | `true` | Auto-delete merged branches |
|
||||
|
||||
## Safety Checks
|
||||
|
||||
- Verify target branch exists
|
||||
- Check for uncommitted changes before switching
|
||||
- Ensure merge doesn't conflict (preview first)
|
||||
|
||||
## Output
|
||||
|
||||
On success:
|
||||
```
|
||||
Committed: abc1234
|
||||
feat(auth): add password reset functionality
|
||||
|
||||
Merged feat/password-reset → development
|
||||
Deleted branch: feat/password-reset
|
||||
|
||||
development is now at: def5678
|
||||
```
|
||||
57
plugins/git-flow/commands/commit-push.md
Normal file
57
plugins/git-flow/commands/commit-push.md
Normal file
@@ -0,0 +1,57 @@
|
||||
# /commit-push - Commit and Push
|
||||
|
||||
## Purpose
|
||||
|
||||
Create a commit and push to the remote repository in one operation.
|
||||
|
||||
## Behavior
|
||||
|
||||
### Step 1: Run /commit
|
||||
|
||||
Execute the standard commit workflow (see commit.md).
|
||||
|
||||
### Step 2: Push to Remote
|
||||
|
||||
After successful commit:
|
||||
|
||||
1. Check if branch has upstream tracking
|
||||
2. If no upstream, set it: `git push -u origin <branch>`
|
||||
3. If upstream exists: `git push`
|
||||
|
||||
### Step 3: Handle Conflicts
|
||||
|
||||
If push fails due to diverged history:
|
||||
|
||||
```
|
||||
Remote has changes not in your local branch.
|
||||
|
||||
Options:
|
||||
1. Pull and rebase, then push (Recommended)
|
||||
2. Pull and merge, then push
|
||||
3. Force push (⚠️ destructive)
|
||||
4. Cancel and review manually
|
||||
```
|
||||
|
||||
## Environment Variables
|
||||
|
||||
| Variable | Default | Description |
|
||||
|----------|---------|-------------|
|
||||
| `GIT_AUTO_PUSH` | `true` | Auto-push after commit |
|
||||
| `GIT_PUSH_STRATEGY` | `rebase` | How to handle diverged branches |
|
||||
|
||||
## Safety Checks
|
||||
|
||||
- **Protected branches**: Warn before pushing to main/master/production
|
||||
- **Force push**: Require explicit confirmation
|
||||
- **No tracking**: Ask before creating new remote branch
|
||||
|
||||
## Output
|
||||
|
||||
On success:
|
||||
```
|
||||
Committed: abc1234
|
||||
feat(auth): add password reset functionality
|
||||
|
||||
Pushed to: origin/feat/password-reset
|
||||
Remote URL: https://github.com/user/repo
|
||||
```
|
||||
79
plugins/git-flow/commands/commit-sync.md
Normal file
79
plugins/git-flow/commands/commit-sync.md
Normal file
@@ -0,0 +1,79 @@
|
||||
# /commit-sync - Commit, Push, and Sync
|
||||
|
||||
## Purpose
|
||||
|
||||
Full sync operation: commit local changes, push to remote, and sync with upstream/base branch.
|
||||
|
||||
## Behavior
|
||||
|
||||
### Step 1: Run /commit
|
||||
|
||||
Execute the standard commit workflow.
|
||||
|
||||
### Step 2: Push to Remote
|
||||
|
||||
Push committed changes to remote branch.
|
||||
|
||||
### Step 3: Sync with Base
|
||||
|
||||
Pull latest from base branch and rebase/merge:
|
||||
|
||||
```bash
|
||||
# Fetch all
|
||||
git fetch --all
|
||||
|
||||
# Rebase on base branch
|
||||
git rebase origin/<base-branch>
|
||||
|
||||
# Push again (if rebased)
|
||||
git push --force-with-lease
|
||||
```
|
||||
|
||||
### Step 4: Report Status
|
||||
|
||||
```
|
||||
Sync complete:
|
||||
|
||||
Local: feat/password-reset @ abc1234
|
||||
Remote: origin/feat/password-reset @ abc1234
|
||||
Base: development @ xyz7890 (synced)
|
||||
|
||||
Your branch is up-to-date with development.
|
||||
No conflicts detected.
|
||||
```
|
||||
|
||||
## Environment Variables
|
||||
|
||||
| Variable | Default | Description |
|
||||
|----------|---------|-------------|
|
||||
| `GIT_DEFAULT_BASE` | `development` | Branch to sync with |
|
||||
| `GIT_SYNC_STRATEGY` | `rebase` | How to incorporate upstream changes |
|
||||
|
||||
## Conflict Handling
|
||||
|
||||
If conflicts occur during rebase:
|
||||
|
||||
```
|
||||
Conflicts detected while syncing with development.
|
||||
|
||||
Conflicting files:
|
||||
- src/auth/login.ts
|
||||
- src/auth/types.ts
|
||||
|
||||
Options:
|
||||
1. Open conflict resolution (I'll guide you)
|
||||
2. Abort sync (keep local state)
|
||||
3. Accept all theirs (⚠️ loses your changes in conflicts)
|
||||
4. Accept all ours (⚠️ ignores upstream in conflicts)
|
||||
```
|
||||
|
||||
## Output
|
||||
|
||||
On success:
|
||||
```
|
||||
Committed: abc1234
|
||||
Pushed to: origin/feat/password-reset
|
||||
Synced with: development (xyz7890)
|
||||
|
||||
Status: Clean, up-to-date
|
||||
```
|
||||
117
plugins/git-flow/commands/commit.md
Normal file
117
plugins/git-flow/commands/commit.md
Normal file
@@ -0,0 +1,117 @@
|
||||
# /commit - Smart Commit
|
||||
|
||||
## Purpose
|
||||
|
||||
Create a git commit with an auto-generated conventional commit message based on staged changes.
|
||||
|
||||
## Behavior
|
||||
|
||||
### Step 1: Analyze Changes
|
||||
|
||||
1. Run `git status` to see staged and unstaged changes
|
||||
2. Run `git diff --staged` to examine staged changes
|
||||
3. If nothing staged, prompt user to stage changes
|
||||
|
||||
### Step 2: Generate Commit Message
|
||||
|
||||
Analyze the changes and generate a conventional commit message:
|
||||
|
||||
```
|
||||
<type>(<scope>): <description>
|
||||
|
||||
[optional body]
|
||||
|
||||
[optional footer]
|
||||
```
|
||||
|
||||
**Types:**
|
||||
- `feat`: New feature
|
||||
- `fix`: Bug fix
|
||||
- `docs`: Documentation only
|
||||
- `style`: Formatting, missing semicolons, etc.
|
||||
- `refactor`: Code change that neither fixes a bug nor adds a feature
|
||||
- `perf`: Performance improvement
|
||||
- `test`: Adding/updating tests
|
||||
- `chore`: Maintenance tasks
|
||||
- `build`: Build system or external dependencies
|
||||
- `ci`: CI configuration
|
||||
|
||||
**Scope:** Determined from changed files (e.g., `auth`, `api`, `ui`)
|
||||
|
||||
### Step 3: Confirm or Edit
|
||||
|
||||
Present the generated message:
|
||||
|
||||
```
|
||||
Proposed commit message:
|
||||
───────────────────────
|
||||
feat(auth): add password reset functionality
|
||||
|
||||
Implement forgot password flow with email verification.
|
||||
Includes rate limiting and token expiration.
|
||||
───────────────────────
|
||||
|
||||
Options:
|
||||
1. Use this message (Recommended)
|
||||
2. Edit the message
|
||||
3. Regenerate with different focus
|
||||
4. Cancel
|
||||
```
|
||||
|
||||
### Step 4: Execute Commit
|
||||
|
||||
If confirmed, run:
|
||||
|
||||
```bash
|
||||
git commit -m "$(cat <<'EOF'
|
||||
<message>
|
||||
|
||||
Co-Authored-By: Claude <noreply@anthropic.com>
|
||||
EOF
|
||||
)"
|
||||
```
|
||||
|
||||
## Environment Variables
|
||||
|
||||
| Variable | Default | Description |
|
||||
|----------|---------|-------------|
|
||||
| `GIT_COMMIT_STYLE` | `conventional` | Message style (conventional, simple, detailed) |
|
||||
| `GIT_SIGN_COMMITS` | `false` | Use GPG signing |
|
||||
| `GIT_CO_AUTHOR` | `true` | Include Claude co-author footer |
|
||||
|
||||
## Edge Cases
|
||||
|
||||
### No Changes Staged
|
||||
|
||||
```
|
||||
No changes staged for commit.
|
||||
|
||||
Would you like to:
|
||||
1. Stage all changes (`git add -A`)
|
||||
2. Stage specific files (I'll help you choose)
|
||||
3. Cancel
|
||||
```
|
||||
|
||||
### Untracked Files
|
||||
|
||||
```
|
||||
Found 3 untracked files:
|
||||
- src/new-feature.ts
|
||||
- tests/new-feature.test.ts
|
||||
- docs/new-feature.md
|
||||
|
||||
Include these in the commit?
|
||||
1. Yes, stage all (Recommended)
|
||||
2. Let me pick which ones
|
||||
3. No, commit only tracked files
|
||||
```
|
||||
|
||||
## Output
|
||||
|
||||
On success:
|
||||
```
|
||||
Committed: abc1234
|
||||
feat(auth): add password reset functionality
|
||||
|
||||
Files: 3 changed, 45 insertions(+), 12 deletions(-)
|
||||
```
|
||||
100
plugins/git-flow/commands/git-config.md
Normal file
100
plugins/git-flow/commands/git-config.md
Normal file
@@ -0,0 +1,100 @@
|
||||
# /git-config - Configure git-flow
|
||||
|
||||
## Purpose
|
||||
|
||||
Configure git-flow settings for the current project.
|
||||
|
||||
## Behavior
|
||||
|
||||
### Interactive Configuration
|
||||
|
||||
```
|
||||
git-flow Configuration
|
||||
═══════════════════════════════════════════
|
||||
|
||||
Current settings:
|
||||
GIT_WORKFLOW_STYLE: feature-branch
|
||||
GIT_DEFAULT_BASE: development
|
||||
GIT_AUTO_DELETE_MERGED: true
|
||||
GIT_AUTO_PUSH: false
|
||||
|
||||
What would you like to configure?
|
||||
1. Workflow style
|
||||
2. Default base branch
|
||||
3. Auto-delete merged branches
|
||||
4. Auto-push after commit
|
||||
5. Protected branches
|
||||
6. View all settings
|
||||
7. Reset to defaults
|
||||
```
|
||||
|
||||
### Setting: Workflow Style
|
||||
|
||||
```
|
||||
Choose your workflow style:
|
||||
|
||||
1. simple
|
||||
- Direct commits to development
|
||||
- No feature branches required
|
||||
- Good for solo projects
|
||||
|
||||
2. feature-branch (Recommended)
|
||||
- Feature branches from development
|
||||
- Merge when complete
|
||||
- Good for small teams
|
||||
|
||||
3. pr-required
|
||||
- Feature branches from development
|
||||
- Requires PR for merge
|
||||
- Good for code review workflows
|
||||
|
||||
4. trunk-based
|
||||
- Short-lived branches
|
||||
- Frequent integration
|
||||
- Good for CI/CD heavy workflows
|
||||
```
|
||||
|
||||
### Setting: Protected Branches
|
||||
|
||||
```
|
||||
Protected branches (comma-separated):
|
||||
Current: main, master, development, staging, production
|
||||
|
||||
These branches will:
|
||||
- Never be auto-deleted
|
||||
- Require confirmation before direct commits
|
||||
- Warn before force push
|
||||
```
|
||||
|
||||
## Environment Variables
|
||||
|
||||
| Variable | Default | Options |
|
||||
|----------|---------|---------|
|
||||
| `GIT_WORKFLOW_STYLE` | `feature-branch` | simple, feature-branch, pr-required, trunk-based |
|
||||
| `GIT_DEFAULT_BASE` | `development` | Any branch name |
|
||||
| `GIT_AUTO_DELETE_MERGED` | `true` | true, false |
|
||||
| `GIT_AUTO_PUSH` | `false` | true, false |
|
||||
| `GIT_PROTECTED_BRANCHES` | `main,master,development,staging,production` | Comma-separated |
|
||||
| `GIT_COMMIT_STYLE` | `conventional` | conventional, simple, detailed |
|
||||
| `GIT_CO_AUTHOR` | `true` | true, false |
|
||||
|
||||
## Storage
|
||||
|
||||
Settings are stored in:
|
||||
- Project: `.env` or `.claude/settings.json`
|
||||
- User: `~/.config/claude/git-flow.env`
|
||||
|
||||
Project settings override user settings.
|
||||
|
||||
## Output
|
||||
|
||||
After configuration:
|
||||
```
|
||||
Configuration saved!
|
||||
|
||||
GIT_WORKFLOW_STYLE=feature-branch
|
||||
GIT_DEFAULT_BASE=development
|
||||
GIT_AUTO_DELETE_MERGED=true
|
||||
|
||||
These settings will be used for all git-flow commands.
|
||||
```
|
||||
72
plugins/git-flow/commands/git-status.md
Normal file
72
plugins/git-flow/commands/git-status.md
Normal file
@@ -0,0 +1,72 @@
|
||||
# /git-status - Enhanced Status
|
||||
|
||||
## Purpose
|
||||
|
||||
Show comprehensive git status with recommendations and insights.
|
||||
|
||||
## Behavior
|
||||
|
||||
### Output Format
|
||||
|
||||
```
|
||||
═══════════════════════════════════════════
|
||||
Git Status: <repo-name>
|
||||
═══════════════════════════════════════════
|
||||
|
||||
Branch: feat/password-reset
|
||||
Base: development (3 commits ahead, 0 behind)
|
||||
Remote: origin/feat/password-reset (synced)
|
||||
|
||||
─── Changes ───────────────────────────────
|
||||
|
||||
Staged (ready to commit):
|
||||
✓ src/auth/reset.ts (modified)
|
||||
✓ src/auth/types.ts (modified)
|
||||
|
||||
Unstaged:
|
||||
• tests/auth.test.ts (modified)
|
||||
• src/utils/email.ts (new file, untracked)
|
||||
|
||||
─── Recommendations ───────────────────────
|
||||
|
||||
1. Stage test file: git add tests/auth.test.ts
|
||||
2. Consider adding new file: git add src/utils/email.ts
|
||||
3. Ready to commit with 2 staged files
|
||||
|
||||
─── Quick Actions ─────────────────────────
|
||||
|
||||
• /commit - Commit staged changes
|
||||
• /commit-push - Commit and push
|
||||
• /commit-sync - Full sync with development
|
||||
|
||||
═══════════════════════════════════════════
|
||||
```
|
||||
|
||||
## Analysis Provided
|
||||
|
||||
### Branch Health
|
||||
- Commits ahead/behind base branch
|
||||
- Sync status with remote
|
||||
- Age of branch
|
||||
|
||||
### Change Categories
|
||||
- Staged (ready to commit)
|
||||
- Modified (not staged)
|
||||
- Untracked (new files)
|
||||
- Deleted
|
||||
- Renamed
|
||||
|
||||
### Recommendations
|
||||
- What to stage
|
||||
- What to ignore
|
||||
- When to commit
|
||||
- When to sync
|
||||
|
||||
### Warnings
|
||||
- Large number of changes (consider splitting)
|
||||
- Old branch (consider rebasing)
|
||||
- Conflicts with upstream
|
||||
|
||||
## Output
|
||||
|
||||
Always produces the formatted status report with context-aware recommendations.
|
||||
@@ -0,0 +1,183 @@
|
||||
# Git Branching Strategies
|
||||
|
||||
## Supported Workflow Styles
|
||||
|
||||
### 1. Simple
|
||||
|
||||
```
|
||||
main ─────●─────●─────●─────●─────●
|
||||
↑ ↑ ↑ ↑ ↑
|
||||
commit commit commit commit commit
|
||||
```
|
||||
|
||||
**Best for:**
|
||||
- Solo projects
|
||||
- Small scripts/utilities
|
||||
- Documentation repos
|
||||
|
||||
**Rules:**
|
||||
- Direct commits to main/development
|
||||
- No feature branches required
|
||||
- Linear history
|
||||
|
||||
### 2. Feature Branch (Default)
|
||||
|
||||
```
|
||||
main ─────────────────●───────────●───────────
|
||||
↑ ↑
|
||||
development ────●────●────●────●────●────●────
|
||||
↑ ↑ ↑ ↑
|
||||
feat/a ─────●───●────┘ │ │
|
||||
│ │
|
||||
feat/b ──────────●────●───┘ │
|
||||
│
|
||||
fix/c ────────────────●────●───┘
|
||||
```
|
||||
|
||||
**Best for:**
|
||||
- Small teams (2-5 developers)
|
||||
- Projects without formal review process
|
||||
- Rapid development cycles
|
||||
|
||||
**Rules:**
|
||||
- Feature branches from development
|
||||
- Merge when complete
|
||||
- Delete branches after merge
|
||||
- development → main for releases
|
||||
|
||||
### 3. PR Required
|
||||
|
||||
```
|
||||
main ─────────────────────────────●───────────
|
||||
↑
|
||||
development ────●────●────●────●────●────●────
|
||||
↑ ↑ ↑ ↑
|
||||
PR PR PR PR
|
||||
↑ ↑ ↑ ↑
|
||||
feat/a ─────●───● │ │ │
|
||||
│ │ │
|
||||
feat/b ──────────●───● │ │
|
||||
│ │
|
||||
feat/c ───────────────●───● │
|
||||
│
|
||||
fix/d ────────────────────●────●
|
||||
```
|
||||
|
||||
**Best for:**
|
||||
- Teams with code review requirements
|
||||
- Open source projects
|
||||
- Projects with CI/CD gates
|
||||
|
||||
**Rules:**
|
||||
- All changes via pull request
|
||||
- At least one approval required
|
||||
- CI must pass before merge
|
||||
- Squash commits on merge
|
||||
|
||||
### 4. Trunk-Based
|
||||
|
||||
```
|
||||
main ────●────●────●────●────●────●────●────●
|
||||
↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
||||
│ │ │ │ │ │ │ │
|
||||
short branches (< 1 day)
|
||||
```
|
||||
|
||||
**Best for:**
|
||||
- CI/CD heavy workflows
|
||||
- Experienced teams
|
||||
- High deployment frequency
|
||||
|
||||
**Rules:**
|
||||
- Very short-lived branches (hours, not days)
|
||||
- Frequent integration to main
|
||||
- Feature flags for incomplete work
|
||||
- Continuous deployment
|
||||
|
||||
## Branch Naming Convention
|
||||
|
||||
```
|
||||
<type>/<description>
|
||||
```
|
||||
|
||||
### Types
|
||||
|
||||
| Type | Purpose | Example |
|
||||
|------|---------|---------|
|
||||
| `feat` | New feature | `feat/user-authentication` |
|
||||
| `fix` | Bug fix | `fix/login-timeout` |
|
||||
| `chore` | Maintenance | `chore/update-deps` |
|
||||
| `docs` | Documentation | `docs/api-reference` |
|
||||
| `refactor` | Code restructure | `refactor/auth-module` |
|
||||
| `test` | Test additions | `test/auth-coverage` |
|
||||
| `perf` | Performance | `perf/query-optimization` |
|
||||
|
||||
### Naming Rules
|
||||
|
||||
1. Lowercase only
|
||||
2. Hyphens for word separation
|
||||
3. No special characters
|
||||
4. Descriptive (2-4 words)
|
||||
5. Max 50 characters
|
||||
|
||||
### Examples
|
||||
|
||||
```
|
||||
✓ feat/add-password-reset
|
||||
✓ fix/null-pointer-login
|
||||
✓ chore/upgrade-typescript-5
|
||||
|
||||
✗ Feature/Add_Password_Reset (wrong case, underscores)
|
||||
✗ fix-bug (too vague)
|
||||
✗ my-branch (no type prefix)
|
||||
```
|
||||
|
||||
## Protected Branches
|
||||
|
||||
Default protected branches:
|
||||
- `main` / `master`
|
||||
- `development` / `develop`
|
||||
- `staging`
|
||||
- `production`
|
||||
|
||||
Protection rules:
|
||||
- No direct commits
|
||||
- No force push
|
||||
- Require PR for changes
|
||||
- No deletion
|
||||
|
||||
## Commit Message Convention
|
||||
|
||||
```
|
||||
<type>(<scope>): <description>
|
||||
|
||||
[optional body]
|
||||
|
||||
[optional footer]
|
||||
```
|
||||
|
||||
### Examples
|
||||
|
||||
```
|
||||
feat(auth): add password reset flow
|
||||
|
||||
Implement forgot password functionality with email verification.
|
||||
Includes rate limiting (5 attempts/hour) and 24h token expiration.
|
||||
|
||||
Closes #123
|
||||
```
|
||||
|
||||
```
|
||||
fix(ui): resolve button alignment on mobile
|
||||
|
||||
The submit button was misaligned on screens < 768px.
|
||||
Added responsive flex rules.
|
||||
```
|
||||
|
||||
```
|
||||
chore(deps): update dependencies
|
||||
|
||||
- typescript 5.3 → 5.4
|
||||
- react 18.2 → 18.3
|
||||
- node 18 → 20 (LTS)
|
||||
```
|
||||
Reference in New Issue
Block a user