mirror of
https://github.com/tiennm99/try-claudekit.git
synced 2026-04-17 17:21:50 +00:00
Add agent definitions, slash commands, hooks, and settings for Claude Code project tooling.
3.1 KiB
3.1 KiB
description, allowed-tools, category, argument-hint
| description | allowed-tools | category | argument-hint |
|---|---|---|---|
| Smart branch creation and switching with conventional naming | Bash(git:*), Read | workflow | <branch-type/branch-name | branch-name> |
Git Checkout: Smart Branch Management
Create or switch to branches with intelligent naming conventions and setup.
Current Branch Status
!git branch --show-current 2>/dev/null || echo "(no branch)"
Available Branches
!git branch -a 2>/dev/null | head -20
Branch Creation Task
Based on the arguments provided: $ARGUMENTS
Parse the branch specification and create/switch to the appropriate branch.
Supported Branch Types
feature/- New features and enhancementsbugfix/- Bug fixes (non-critical)hotfix/- Urgent production fixesrelease/- Release preparation brancheschore/- Maintenance and cleanup tasksexperiment/- Experimental featuresdocs/- Documentation updatestest/- Test-related changesrefactor/- Code refactoring
Branch Naming Rules
- If argument contains
/, use as-is (e.g.,feature/user-auth) - If argument is single word, suggest adding a prefix
- Convert spaces to hyphens
- Lowercase all characters
- Remove special characters except hyphens and slashes
- Validate branch name is git-compatible
Workflow
-
Parse the branch argument:
- If empty, show current branch and available branches
- If contains
/, treat as type/name format - If single word without
/, ask for branch type or suggestfeature/
-
Validate branch name:
- Check if branch already exists locally
- Check if branch exists on remote
- Ensure name follows git conventions
- Warn if name is too long (>50 chars)
-
Create or switch branch:
- If branch exists locally:
git checkout <branch> - If branch exists only on remote:
git checkout -b <branch> origin/<branch> - If new branch:
git checkout -b <branch>
- If branch exists locally:
-
Set up branch configuration:
- For hotfix branches: Base off main/master
- For feature branches: Base off current branch or develop
- For release branches: Base off develop or main
-
Report status:
- Confirm branch switch/creation
- Show upstream tracking status
- Suggest next steps (e.g., "Ready to start working. Use /git:push to set upstream when ready to push.")
Examples
# Create feature branch
/git:checkout feature/user-authentication
# Create hotfix from main
/git:checkout hotfix/security-patch
# Switch to existing branch
/git:checkout develop
# Create branch without prefix (will prompt)
/git:checkout payment-integration
Special Handling
For hotfix branches:
- Automatically checkout from main/master first
- Set high priority indicator
- Suggest immediate push after fix
For feature branches:
- Check if develop branch exists, use as base
- Otherwise use current branch as base
For release branches:
- Validate version format if provided (e.g., release/v1.2.0)
- Set up from develop or main
Error Handling
- If branch name is invalid, suggest corrections
- If checkout fails, show git error and provide guidance
- If working directory is dirty, warn and suggest stashing or committing