commits

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.

6 stars

Best use case

commits is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

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.

Teams using commits should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/commits/SKILL.md --create-dirs "https://raw.githubusercontent.com/Takazudo/claude-resources/main/skills/commits/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/commits/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How commits Compares

Feature / AgentcommitsStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

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.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Commits Command

Make commits for all necessary changes in the working directory.

## Argument Handling

Check `$ARGUMENTS` for these flags (case-insensitive, hyphens optional):

- **"push"**: Also push to the remote after committing.
- **"--nopush" or "--no-push"**: Before committing, invoke `/push-forbid` to disable automatic pushing for the rest of the session.
- **"--pushok" or "--push-ok" or "--pushauto" or "--push-auto"**: Before committing, invoke `/push-auto` to enable automatic pushing for the rest of the session.

## Execution Strategy (Token Cost Optimization)

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.

### Step 0: Pre-check (skip subagent when nothing to do)

Before anything else, run these two checks via Bash:

```bash
git status --porcelain
git rev-list --count @{upstream}..HEAD 2>/dev/null || echo "unknown"
```

Based on the results:

- **Nothing to commit + nothing to push** → Report "Nothing to commit or push." and **stop immediately**. Done.
- **Nothing to commit + commits ahead + `push` argument present** → No subagent needed. Run `git pull --rebase && git push` directly. Report and **stop**. Done.
- **Nothing to commit + "unknown" (no upstream) + `push` argument present** → New branch with no remote tracking. Run `git push -u origin $(git branch --show-current)`. Report and **stop**. Done.
- **Nothing to commit + commits ahead + NO `push` argument** → Report "Nothing to commit. N commit(s) ahead of remote — use `/commits push` to push." and **stop**. Done.
- **Something to commit** → Continue to Attempt 1 below.

### Attempt 1: Haiku subagent

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.

### Attempt 2: Direct execution (last resort)

Only if Attempt 1 failed, execute the Instructions below directly in the current session. Handles commit and (if `push` argument present) push.

---

## Conflict Handling (rebase conflict during push)

If `git pull --rebase` fails due to a conflict:

**If running as a child agent in a team:**

1. Do NOT attempt conflict resolution — you lack the full picture
2. Abort with `git rebase --abort`
3. Report to the manager immediately with: branch name, that a rebase conflict occurred, and any conflict details from the output
4. The manager will judge complexity and either resolve it directly or spawn an Opus subagent with full implementation context

**If running standalone (no team):**

1. Run `git rebase --abort` to restore the pre-rebase state
2. Run `git fetch && git log --oneline HEAD..origin/$(git branch --show-current)` to see incoming commits
3. Run `git pull --rebase` again to see the actual conflicts
4. Assess complexity:
- **Simple** (whitespace, non-overlapping, trivial): resolve directly, `git rebase --continue`, then `git push`
- **Complex** (overlapping logic, multiple files, unclear intent): abort with `git rebase --abort`, then resolve carefully with full awareness of what was implemented before retrying push

---

## Instructions

1. **Check current status**

- Run `git status` to see all modified, staged, and untracked files
- Run `git diff --stat` to understand the scope of changes

2. **Check 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:**

1. Check if `.gitignore` exists in the project root
2. If it exists, check if the unwanted patterns are already listed
3. If patterns are missing, add them to `.gitignore`
4. If `.gitignore` doesn't exist and project has `package.json` or other project markers, create one with common patterns
5. 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

3. **Filter and select files to commit**

- Review remaining files after .gitignore filtering
- Only stage files that contain intentional, meaningful changes
- Skip auto-generated files (timestamps, caches, lock files unless relevant)
- If unsure about a file, ask the user

4. **Analyze and group changes**

- If changes are small and related: make a single commit
- If changes span multiple unrelated concerns: separate into logical commits
- Examples of good separation:
  - Documentation changes vs code changes
  - Feature additions vs bug fixes
  - Refactoring vs new functionality
  - Config changes vs source changes

5. **Create commits**

- 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:

  ```bash
  git commit -m "$(cat <<'EOF'
  Commit message here

  Co-Authored-By: Claude <noreply@anthropic.com>
  EOF
  )"
  ```

6. **Push (only if `push` argument is present)**

- Check commits ahead: `git rev-list --count @{upstream}..HEAD 2>/dev/null || echo "unknown"`
- If 0 commits ahead: nothing to push, skip to Verify
- If `"unknown"` (no upstream / new branch): run `git push -u origin $(git branch --show-current)`, skip to Verify
- Otherwise: run `git pull --rebase` then `git push`
- If `git pull --rebase` fails with a conflict, follow the Conflict Handling section above

7. **Verify**

- Run `git status` after committing to confirm working tree is clean
- Run `git log --oneline -n <number of commits>` to show what was committed

## Important Notes

- Never use `git add .` blindly - be selective about what to stage
- If unsure whether a file should be committed, ask the user
- Prefer smaller, focused commits over large monolithic commits
- Always verify the commit was successful before moving on
- **Never use `git 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.
- **Proactively update .gitignore** - If you see files that should be ignored (node_modules, .env, logs, etc.), update .gitignore before committing. This prevents accidental commits of sensitive or unnecessary files in the future. Exception: never add image glob patterns (*.png, etc.) — delete or move those instead (see above).

Related Skills

commits-forbid

6
from Takazudo/claude-resources

Disable automatic committing. From now on, do NOT make commits unless the user explicitly asks. Used during try-and-error development. Use when: (1) User says 'commits forbid', 'no auto commit', 'don't commit automatically', (2) User wants to experiment without committing.

commits-auto

6
from Takazudo/claude-resources

Enable automatic committing mode. From now on, commit changes automatically without asking for permission. Use when: (1) User says 'commits auto', 'auto commit', 'commit automatically', (2) User wants hands-off development.

zudoesa-articlify

6
from Takazudo/claude-resources

Convert conversation context into an esa article via the zudoesa-writer subagent. ONLY invoke when the user explicitly asks — NEVER proactively propose. Triggers: 'write esa article', 'esa記事', 'esaに書いて', 'articlify for esa', or /zudoesa-articlify. Gathers context, creates a writing brief, delegates to the writer subagent.

zudoesa-apply-voice

6
from Takazudo/claude-resources

Apply Takazudo's esa writing voice and vocabulary rules to text. Use when: (1) User wants to write/rewrite text in Takazudo's esa style, (2) User says 'apply voice', 'esa voice', 'esa文体で', 'esa風に書いて', '文体を適用', (3) User provides text to transform to esa style. Reads writing-style.md and vocabulary-rule.md from takazudo-esa-writing repo and applies the rules.

zudocg-articlify

6
from Takazudo/claude-resources

Convert conversation context into a CodeGrid article via the zudocg-writer subagent. ONLY invoke when the user explicitly asks — NEVER proactively propose. Triggers: 'write codegrid article', 'CodeGrid記事', 'codegridに書いて', 'articlify for codegrid', or /zudocg-articlify. Gathers context, creates a writing brief, delegates to the writer subagent.

zudocg-apply-voice

6
from Takazudo/claude-resources

Apply Takazudo's CodeGrid writing voice and vocabulary rules to text. Use when: (1) User wants to write/rewrite text in Takazudo's CodeGrid style, (2) User says 'apply voice', 'codegrid voice', 'codegrid文体で', 'codegrid風に書いて', '文体を適用', (3) User provides text to transform to CodeGrid style. Reads writing-style.md and vocabulary-rule.md from takazudo-codegrid-writing repo and applies the rules.

zpaper-articlify

6
from Takazudo/claude-resources

Convert conversation context into a zpaper blog article via the zpaper-writer subagent. ONLY invoke when the user explicitly asks — NEVER proactively propose. Triggers: 'write zpaper article', 'zpaper記事', 'zpaperに書いて', 'articlify for zpaper', or /zpaper-articlify. Gathers context, creates a writing brief, delegates to the writer subagent.

zpaper-apply-voice

6
from Takazudo/claude-resources

Apply Takazudo's zpaper blog writing voice and vocabulary rules to text. Use when: (1) User wants to write/rewrite text in Takazudo's zpaper style, (2) User says 'apply voice', 'zpaper voice', 'zpaper文体で', 'zpaper風に書いて', 'ブログ文体を適用', (3) User provides text to transform to zpaper style. Reads writing-style.md and vocabulary-rule.md from the zpaper repo and applies the rules.

xlsx

6
from Takazudo/claude-resources

Spreadsheet creation, editing, and analysis. Use when working with .xlsx, .xlsm, .csv, .tsv files for: (1) Creating spreadsheets with formulas and formatting, (2) Reading or analyzing data, (3) Modifying existing spreadsheets while preserving formulas, (4) Data analysis and visualization, (5) Recalculating formulas.

x

6
from Takazudo/claude-resources

Facade for development workflows. Routes on two axes: plan-first vs implement-now (escalates to /big-plan -a when the request needs research / decomposition / has unclear scope — the appended -a makes the plan chain into implementation in-session), then single vs multi on the ready-to-build fast paths (/x-as-pr single-topic, /x-wt-teams multi-topic parallel). Use when: (1) User says '/x' followed by dev instructions, (2) User wants to start development without choosing the workflow skill, (3) User says 'dev', 'implement', or 'build' with a task. Default option: -v (verify-ui). Review-loop (-l) is opt-in — without -l the downstream skill runs a single /deep-review pass. Forwards -a (autonomy/auto-chain) and -m (merge at the end + cleanup + CI watch) through every route; auto-fix of raised findings (-f) and issue-raising (-ri) are downstream defaults, with -nf/--no-fix and -nori/--no-raise-issues as the forwarded opt-outs. -a and -m are orthogonal — full hands-off end-to-end is -a -m.

x-wt-teams

6
from Takazudo/claude-resources

Parallel multi-topic development using git worktrees, base branches, and Claude Code agent teams. Use when: (1) User wants to work on multiple related features in parallel, (2) User mentions 'worktree', 'base branch', 'parallel development', 'split into topics', or 'multi-topic'. FULLY AUTONOMOUS — creates worktrees, spawns teams, coordinates everything. Also supports Super-Epic child mode for [Epic] issues from /big-plan with '**Super-epic:** #N' markers (targets the super-epic base branch instead of main).

x-as-pr

6
from Takazudo/claude-resources

Start a development workflow as a draft PR. Creates a NEW branch from the current branch, empty start commit, draft PR targeting the current branch, then implements. ALWAYS creates a new branch by default — produces a nested PR-on-PR when the current branch already has one. Use when: (1) User says 'dev as pr', (2) User wants a PR-first workflow before coding, (3) User passes -s/--stay to reuse the current branch instead of nesting, (4) User passes a GitHub issue URL to implement, (5) User passes --make-issue/--issue to create an issue first. Logs progress via issue comments when an issue is linked.