Add single-line visual headers to 66 command files across 10 plugins: - clarity-assist (2 commands): 💬 - claude-config-maintainer (5 commands): ⚙️ - cmdb-assistant (11 commands): 🖥️ - code-sentinel (3 commands): 🔒 - contract-validator (5 commands): ✅ - data-platform (10 commands): 📊 - doc-guardian (5 commands): 📝 - git-flow (8 commands): 🔀 - pr-review (7 commands): 🔍 - viz-platform (10 commands): 🎨 Each command now displays a consistent header at execution start: ┌────────────────────────────────────────────────────────────────┐ │ [icon] PLUGIN-NAME · Command Description │ └────────────────────────────────────────────────────────────────┘ Addresses #275 (other plugin commands visual output) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
4.1 KiB
4.1 KiB
/commit - Smart Commit
Visual Output
When executing this command, display the plugin header:
┌──────────────────────────────────────────────────────────────────┐
│ 🔀 GIT-FLOW · Smart Commit │
└──────────────────────────────────────────────────────────────────┘
Then proceed with the commit workflow.
Purpose
Create a git commit with an auto-generated conventional commit message based on staged changes.
Behavior
Step 1: Check for Protected Branch
Before any commit operation, check if the current branch is protected:
- Get current branch:
git branch --show-current - Check against
GIT_PROTECTED_BRANCHES(default:main,master,development,staging,production)
If on a protected branch, warn the user:
⚠️ You are on a protected branch: development
Protected branches typically have push restrictions that will prevent
direct commits from being pushed to the remote.
Options:
1. Create a feature branch and continue (Recommended)
2. Continue on this branch anyway (may fail on push)
3. Cancel
If option 1 (create feature branch):
- Prompt for branch type (feat/fix/chore/docs/refactor)
- Prompt for brief description
- Create branch using
/branch-startnaming conventions - Continue with commit on the new branch
If option 2 (continue anyway):
- Proceed with commit (user accepts risk of push rejection)
- Display reminder: "Remember: push may be rejected by remote protection rules"
Step 2: Analyze Changes
- Run
git statusto see staged and unstaged changes - Run
git diff --stagedto examine staged changes - If nothing staged, prompt user to stage changes
Step 3: Generate Commit Message
Analyze the changes and generate a conventional commit message:
<type>(<scope>): <description>
[optional body]
[optional footer]
Types:
feat: New featurefix: Bug fixdocs: Documentation onlystyle: Formatting, missing semicolons, etc.refactor: Code change that neither fixes a bug nor adds a featureperf: Performance improvementtest: Adding/updating testschore: Maintenance tasksbuild: Build system or external dependenciesci: CI configuration
Scope: Determined from changed files (e.g., auth, api, ui)
Step 4: 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 5: Execute Commit
If confirmed, run:
git commit -m "$(cat <<'EOF'
<message>
Co-Authored-By: Claude <noreply@anthropic.com>
EOF
)"
Environment Variables
| Variable | Default | Description |
|---|---|---|
GIT_PROTECTED_BRANCHES |
main,master,development,staging,production |
Branches that trigger protection warning |
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(-)