From claude-resources
Commits changes with logical grouping, conventional messages, .gitignore handling, and file selection. Use when user requests 'commit', changes need committing, or grouped commits wanted. Supports push flags.
npx claudepluginhub takazudo/claude-resources[push] [--no-push] [--push-auto]This skill uses the workspace's default tool permissions.
Make commits for all necessary changes in the working directory.
Guides Next.js Cache Components and Partial Prerendering (PPR): 'use cache' directives, cacheLife(), cacheTag(), revalidateTag() for caching, invalidation, static/dynamic optimization. Auto-activates on cacheComponents: true.
Guides building MCP servers enabling LLMs to interact with external services via tools. Covers best practices, TypeScript/Node (MCP SDK), Python (FastMCP).
Share bugs, ideas, or general feedback.
Make commits for all necessary changes in the working directory.
Check $ARGUMENTS for these flags (case-insensitive, hyphens optional):
/push-forbid to disable automatic pushing for the rest of the session./push-auto to enable automatic pushing for the rest of the session.Offload the commit workflow to a Haiku subagent so the expensive main Opus context only sees a summary — not the full git diff, file-selection reasoning, or commit-message drafting.
Before anything else, run these two checks via Bash:
git status --porcelain
git rev-list --count @{upstream}..HEAD 2>/dev/null || echo "unknown"
Based on the results:
push argument present → No subagent needed. Run git pull --rebase && git push directly. Report and stop. Done.push argument present → New branch with no remote tracking. Run git push -u origin $(git branch --show-current). Report and stop. Done.push argument → Report "Nothing to commit. N commit(s) ahead of remote — use /commits push to push." and stop. Done.Spawn a Haiku subagent using the Agent tool with model: "haiku". Give it the full Instructions section below as its prompt, plus the current repo path and whether push is requested. The subagent runs in its own isolated context — the main Opus context only sees the final report, not the intermediate git diff/status output.
If the subagent reports success: stop here. Done.
If the subagent fails (partial commits, rebase conflict, or any error): run git status and git log --oneline to assess current state, then continue with Attempt 2 for the remainder.
Only if Attempt 1 failed, execute the Instructions below directly in the current session. Handles commit and (if push argument present) push.
If git pull --rebase fails due to a conflict:
If running as a child agent in a team:
git rebase --abortIf running standalone (no team):
git rebase --abort to restore the pre-rebase stategit fetch && git log --oneline HEAD..origin/$(git branch --show-current) to see incoming commitsgit pull --rebase again to see the actual conflictsgit rebase --continue, then git pushgit rebase --abort, then resolve carefully with full awareness of what was implemented before retrying pushgit status to see all modified, staged, and untracked filesgit diff --stat to understand the scope of changesCheck for unwanted files and update .gitignore
Before proceeding, scan the output for files that should never be committed:
Files/directories to exclude:
node_modules/ - Package dependencies
Build outputs: dist/, build/, .next/, out/, *.bundle.js
Log files: *.log, npm-debug.log*, yarn-error.log
Temporary files: *.tmp, *.temp, .cache/, *.swp, *~
OS files: .DS_Store, Thumbs.db, Desktop.ini
IDE files: .idea/, .vscode/, *.sublime-* (unless intentional)
Environment files: .env, .env.local, .env*.local
Test coverage: coverage/, .nyc_output/
Package manager: pnpm-lock.yaml, package-lock.json, yarn.lock (context-dependent)
Secrets/credentials: *.pem, *.key, credentials.json, secrets.*
If unwanted files are found:
Check if .gitignore exists in the project root
If it exists, check if the unwanted patterns are already listed
If patterns are missing, add them to .gitignore
If .gitignore doesn't exist and project has package.json or other project markers, create one with common patterns
After updating .gitignore, the ignored files will no longer appear in git status
If any unwanted files are already staged:
Unstage them with git reset HEAD <file>
If they were previously committed, inform the user they may need to remove them from history
Temporary image/screenshot files (NEVER add to .gitignore):
Image files (*.png, *.jpg, *.gif, *.webp, screenshot SVGs) in the repo root or non-content directories are typically temporary — generated by headless browsers or shared during conversation. Do NOT add glob patterns like *.png to .gitignore. Instead:
If the files appear no longer needed (old screenshots, leftover from previous work): delete them with rm
If the files appear still useful (referenced in the current conversation): move them to the log directory: LOGDIR=$(node $HOME/.claude/scripts/get-logdir.js) && mkdir -p "$LOGDIR" && mv <file> "$LOGDIR/"
Never add image glob patterns to .gitignore — it confuses users about what the pattern is for and may accidentally exclude intentional image assets
Optional: get a Copilot-drafted message first (fail-silent)
Before writing the commit message yourself, try:
$HOME/.claude/skills/gco/scripts/gcom-msg.sh
This works in both Attempt 1 (Haiku subagent) and Attempt 2 (direct execution).
git commit -m.Write clear, concise commit messages
Use conventional commit style when appropriate (feat:, fix:, docs:, refactor:, etc.)
Add Co-Authored-By: Claude <noreply@anthropic.com> if Claude contributed significantly
Use HEREDOC format for commit messages:
git commit -m "$(cat <<'EOF'
Commit message here
Co-Authored-By: Claude <noreply@anthropic.com>
EOF
)"
push argument is present)git rev-list --count @{upstream}..HEAD 2>/dev/null || echo "unknown""unknown" (no upstream / new branch): run git push -u origin $(git branch --show-current), skip to Verifygit pull --rebase then git pushgit pull --rebase fails with a conflict, follow the Conflict Handling section abovegit status after committing to confirm working tree is cleangit log --oneline -n <number of commits> to show what was committedgit add . blindly - be selective about what to stagegit commit --amend without explicit user permission - Always create new commits by default. Amending commits can be confusing and may cause issues if the original commit was already shared. If you need to fix a previous commit, ask the user first.