skills/commits/SKILL.md
Commit necessary changes with appropriate separation. Use when: (1) User says 'commit', 'commits', or 'save changes', (2) Claude has made changes that need committing, (3) User wants commits with proper grouping and conventional messages. Handles .gitignore updates, file selection, logical grouping, clean commit messages.
npx skillsauth add takazudo/claude-resources commitsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
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
Write clear, concise commit messages
Use conventional commit style when appropriate (feat:, fix:, docs:, refactor:, etc.)
Add Co-Authored-By: Claude <[email protected]> if Claude contributed significantly
Use HEREDOC format for commit messages:
git commit -m "$(cat <<'EOF'
Commit message here
Co-Authored-By: Claude <[email protected]>
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.development
Link Claude Code skill names mentioned in a CodeGrid article (data/{series}/{n}.md) to the author's public claude-resources repo, pinned to the latest commit hash so links don't rot. Use when: (1) user says 'linkify cc resources', 'link the skills', 'link skill names', or invokes /dev-linkify-cc-resources; (2) editing a CodeGrid article that mentions `/commits`, `/pr-complete`, `/skill-creator` or other Claude Code skills and they should point to claude-resources. Only links skills that actually exist in the public repo; skips hypothetical examples and code blocks.
development
Second opinion from Claude Opus on a plan or approach. Use when: (1) Planning phase of /big-plan needs a higher-quality review than /codex-2nd / /gco-2nd, (2) User says 'opus 2nd' or 'opus opinion', (3) Wanting Anthropic's larger model to critique a plan. Spawns a general-purpose Agent with model: opus that reads the plan file and returns structured feedback. Anthropic quota — not free.
tools
AI-based testing via subagent + a per-task test-flow skill. Use when the user wants to verify something that mechanical assertions can't fully capture — image recognition, visual size/position comparison, animation smoothness, multi-step manual flows that need AI judgment. Triggers: 'AI-based test', 'AI test', 'visual verify', 'image recognition test', 'manual operation test', 'human-eye check', 'verify visually', 'compare screenshots', 'looks the same', 'looks correct'. The skill's job is to (1) author a focused test-flow skill that captures the exact procedure + verdict criteria, then (2) dispatch a verification subagent via the Agent tool that loads BOTH the test-flow skill AND a browser-driving skill (/verify-ui primary, /headless-browser fallback) so the subagent has clear context and consistent verdicts. NEVER uses `claude -p` — subagent dispatch goes through the Agent tool exclusively.
development
End-of-workflow audit of touched GitHub issues, PRs, and branches via a Sonnet subagent. Use when: (1) /big-plan, /x-as-pr, or /x-wt-teams finishes its main work and needs to verify every touched resource is in the right state (closed when done, kept when ongoing, deleted when dead), (2) User says 'cleanup resources', 'audit cleanup', or 'check what should be closed', (3) A long workflow ends and the manager wants a structured paper trail of what it closed/kept/deleted. Auto-execute by default — the Sonnet agent proposes, the manager (you) executes safe actions and prints a final report.