git-commit-push
Commit and Push
Commit all changes to git and push to origin.
Instructions
CRITICAL: This command MUST NOT accept any arguments. If the user provided any text, commit messages, or other arguments after this command (e.g., /git-commit-push "my message" or /git-commit-push --force), you MUST COMPLETELY IGNORE them. Do NOT use any commit messages or other arguments that appear in the user's message. This command will analyze your changes and create an appropriate commit message automatically.
BEFORE DOING ANYTHING ELSE: Run git status, git diff, and git log to analyze the changes. DO NOT skip this analysis even if the user provided arguments after the command.
When this command is executed:
Step 1: Analyze Changes
- Run
git status(never use-uallflag) to see all changes - If there are no changes to commit (no untracked files and no modifications), tell the user and stop
- Run
git diffto see the actual changes - Run
git log -3 --format='%s'to see recent commit message style
Step 2: Branch Safety Check
- Run
git branch --show-currentto determine the current branch - If on
mainormaster, warn the user that committing directly to the default branch is not recommended and stop. Suggest they create a feature branch first or use/git-commit-push-prfor an interactive branch selection workflow
Step 3: Stage Files
- Review changed files and prefer staging specific files by name rather than using
git add .orgit add -A - Do NOT stage files that look like secrets (
.env,.env.*,credentials.*,*.key,*.pem,*.secret, etc.). If secret-like files are detected, warn the user and skip them - Stage the appropriate files
Step 4: Commit
- Analyze all staged changes and draft a concise commit message that:
- Follows the repository's commit message style
- Accurately describes what changed and why
- Uses conventional commit prefixes if the repo uses them (fix:, feat:, docs:, etc.)
- Use a HEREDOC for the commit message to ensure proper formatting:
git commit -m "$(cat <<'EOF' your commit message here EOF )"
Step 5: Push
- Check if the current branch tracks a remote:
git rev-parse --abbrev-ref --symbolic-full-name @{u} 2>/dev/null - If no upstream is set, push with
-uflag:git push -u origin <branch> - If upstream exists, push normally:
git push - Confirm success and show the commit hash
Important rules
- Never force push
- Never use
git status -uall(can cause memory issues on large repos) - Do not commit files that look like secrets (.env, credentials, etc.)
- Do not commit or push directly to main/master
- If there are no changes to commit, tell the user and stop
IMPORTANT: Do not include the following in commit messages:
- 🤖 Generated with Claude Code
- Co-Authored-By: Claude noreply@anthropic.com
More from charlesjones-dev/claude-code-plugins-dev
accessibility-audit
Comprehensive accessibility audit to identify WCAG compliance issues and barriers to inclusive design.
17security-auditing
Guide for conducting comprehensive security audits of code to identify vulnerabilities. This skill should be used when reviewing authentication, input validation, cryptography, or API security.
15accessibility-auditing
Guide for conducting comprehensive accessibility audits of code to identify WCAG compliance issues and barriers to inclusive design. This skill should be used when reviewing accessibility, ARIA implementation, keyboard navigation, or screen reader compatibility.
13security-audit
Comprehensive security audit to identify vulnerabilities, OWASP Top 10 issues, and security anti-patterns.
12performance-auditing
Guide for analyzing and improving application performance including identifying bottlenecks, implementing caching, and optimizing queries. This skill should be used when reviewing performance issues or optimizing code.
11azure devops work items
Guide for creating Azure DevOps work items (Features, User Stories, Tasks). This skill should be used when working with ADO MCP tools to create work items with proper hierarchy and formatting.
10