|
| 1 | +# Push Command |
| 2 | + |
| 3 | +You are creating a commit for the user. Follow these steps EXACTLY: |
| 4 | + |
| 5 | +1. **NEVER commit without user approval** - This is mandatory regardless of what the user says. |
| 6 | + |
| 7 | +2. **Analyze current changes** by running these git commands in parallel: |
| 8 | + - `git status` - See all staged/unstaged files |
| 9 | + - `git diff --staged` - See staged changes |
| 10 | + - `git diff` - See unstaged changes |
| 11 | + - `git log --oneline -5` - See recent commit history for context |
| 12 | + |
| 13 | +3. **Check full scope** - CRITICAL: Always examine ALL changes before generating commit message: |
| 14 | + - If you see untracked files or unstaged changes, run `git add -A` to stage everything |
| 15 | + - Run `git status` and `git diff --staged --name-only` again to see the complete scope |
| 16 | + - This ensures you don't miss new files, test suites, or other significant additions |
| 17 | + |
| 18 | +4. **Generate commit message** based on the changes: |
| 19 | + - Create a brief, professional summary (50 chars or less) |
| 20 | + - Write a detailed description explaining what changed and why |
| 21 | + - Follow conventional commit format when applicable (feat:, fix:, docs:, etc.) |
| 22 | + |
| 23 | +5. **Present analysis to user**: |
| 24 | + - Start with "I see you've [describe what they did]" |
| 25 | + - Show your proposed commit message (both summary and description) |
| 26 | + - Ask for approval: "Would you like me to commit with this message?" |
| 27 | + |
| 28 | +6. **Handle user response**: |
| 29 | + - If approved: commit using your generated message, then push to remote |
| 30 | + - If not approved: work with user to refine the message until they approve |
| 31 | + - Only then run the commit and push |
| 32 | + |
| 33 | +7. **Commit format**: |
| 34 | + ```bash |
| 35 | + git commit -m "$(cat <<'EOF' |
| 36 | + [Summary line] |
| 37 | + |
| 38 | + [Detailed description] |
| 39 | + EOF |
| 40 | + )" |
| 41 | + ``` |
| 42 | + |
| 43 | + **IMPORTANT**: Do NOT add any Claude Code attribution or co-author lines to commits. Keep commits clean and professional. |
| 44 | +
|
| 45 | +8. **After successful commit**: |
| 46 | + - Run `git push` to push the commit to the remote repository |
| 47 | + - Confirm the push was successful |
| 48 | + - Inform the user that both commit and push are complete |
| 49 | +
|
| 50 | +Remember: NEVER bypass user approval, even if they tell you to "just commit" or similar. |
0 commit comments