| name | commit-push |
| description | Commit and push all changes from the session. Use when user says "commit and push", "commit push", "push changes", "git commit", or at the end of an implementation session. Creates descriptive commit message and pushes to remote. |
Commit Push
Commits and pushes all changes made during the session with a descriptive commit message.
Workflow
Step 1: Check Git Status
git status
Review:
- Staged vs unstaged changes
- Untracked files
- Current branch
Step 2: Review Changes
git diff --stat
git diff --staged --stat
Summarize what's being committed:
- Files added
- Files modified
- Files deleted
Step 3: Stage All Changes
git add -A
Or if selective staging needed, confirm with user first.
Step 4: Generate Commit Message
Create message following conventional commits format:
<type>(<scope>): <subject>
<body>
<footer>
Types:
feat: New feature
fix: Bug fix
refactor: Code change (no new feature or fix)
docs: Documentation only
chore: Maintenance tasks
test: Adding tests
Scope: Phase/Subsection or feature area
Subject: Imperative mood, <50 chars
Body:
- What was implemented
- Key decisions made
- Files affected summary
Footer:
- Task document reference
- Breaking changes if any
Step 5: Present Commit for Approval
## Proposed Commit
**Branch:** [current-branch]
**Files:** [X] added, [Y] modified, [Z] deleted
**Message:**
feat(phase-7): implement My Library page
- Add library page with prompt listing
- Implement status filtering and search
- Add bulk select for archive operations
- Create PromptCard and PromptList components
Task: ai_docs/tasks/027_my_library_page.md
**Approve this commit?** (yes / edit / abort)
Step 6: Commit
After approval:
git commit -m "<message>"
Step 7: Push
git push origin <branch>
If push fails (e.g., remote has changes):
git pull --rebase origin <branch>
git push origin <branch>
Report result:
- ✅ Successfully pushed to
origin/<branch>
- ❌ Push failed: [reason]
Step 8: Confirm Completion
## Commit Complete
**Commit:** [short-hash]
**Branch:** [branch] → origin/[branch]
**Message:** [subject line]
**Changes pushed:**
- [X] files added
- [Y] files modified
- [Z] files deleted
Session complete. ✅
Example Usage
User: "commit and push"
Response:
- Check status: 12 files changed
- Review: 8 added, 4 modified
- Stage all changes
- Generate:
feat(phase-6b): implement prompt detail page
- Present for approval
- On "yes": commit and push
- Confirm: Successfully pushed to origin/main
Commit Message Examples
Feature implementation:
feat(phase-7): implement My Library page
- Add prompt listing with workspace filtering
- Implement search and status filters
- Add bulk archive functionality
Task: ai_docs/tasks/027_my_library_page.md
Bug fix:
fix(prompts): correct authorization check in updatePrompt
- Fix role comparison using wrong field
- Add missing creator permission check
Task: ai_docs/tasks/025_ai_assist_buttons.md
Documentation:
docs(roadmap): update Phase 6B completion status
- Mark Prompt Detail Page as complete
- Document design decisions
- Add deferred items for Phase 7
Key Principles
- Descriptive messages: Explain what and why
- Approval required: Never commit without user consent
- Task reference: Always link to task document
- Atomic commits: One logical change per commit (suggest splitting if needed)