一键导入
micro-commit
Use when you have uncommitted changes spanning multiple contexts and need to split them into logical, independently meaningful commits — especially before a PR or code review
菜单
Use when you have uncommitted changes spanning multiple contexts and need to split them into logical, independently meaningful commits — especially before a PR or code review
Use this skill for ANY Git or GitHub operation — committing, staging, branching, merging, rebasing, cherry-picking, tagging, pushing, pulling, stashing, resetting, resolving conflicts, managing remotes, creating or reviewing pull requests, handling GitHub issues and releases, and running GitHub CLI (gh) commands. Invoke this skill whenever the user mentions git, commits, branches, PRs, push/pull, conflicts, GitHub, or any version control task — even if they phrase it casually like "save my changes", "submit my code", "make a PR", or "undo my last commit". Do not attempt Git operations without invoking this skill first.
Execute task planning based on the specified file and manage questions[/todo-task-planning file_path --pr --branch branch_name]
Execute tasks from TODO file - Generic task runner [/todo-task-run xxx]
Use this skill for project management: planning, progress tracking, task coordination, timeline/milestone management, risk assessment, resource allocation, and execution guidance. Examples: <example>User organizing complex development: "Starting feature with frontend, backend, infrastructure changes. Need project plan." → Creates plan with task breakdown, timeline, coordination strategy.</example> <example>User facing delays: "Project behind schedule, unsure how to prioritize tasks." → Analyzes situation, provides recovery plan with prioritized actions.</example>
Core development principles and standards for consistent, high-quality code. Automatically applies DRY, KISS, YAGNI, SOLID, TDD, and micro-commit methodologies.
TODO.md file output template examples for todo-task-planning command. Provides structured checklist format with task classification, status indicators, and research rationale.
| name | micro-commit |
| description | Use when you have uncommitted changes spanning multiple contexts and need to split them into logical, independently meaningful commits — especially before a PR or code review |
| user-invocable | true |
Splits uncommitted changes into small, logical commits — one per feature, fix, or layer. Each commit should be independently meaningful and reviewable.
Not needed when: all changes belong to a single logical unit — just commit normally.
IMPORTANT: ALL git operations (status checks, staging, committing) MUST be delegated to a Haiku sub-agent via the Agent tool. Do NOT execute any git commands directly in the main session.
Execute the following steps:
Use the Agent tool with model: "haiku" and pass the following prompt verbatim:
You are a Git Operations Specialist. Your job is to collect the current repository state, group changes into logical units, and execute micro-commits.
## Step A: Collect Repository State
Run the following commands using the Bash tool:
```bash
git status --short
git diff HEAD
git ls-files --others --exclude-standard
```
For each untracked file listed by `git ls-files`, read its contents using the Read tool.
## Step B: Group Changes
Group changes into logical commits using these criteria (in order of preference):
- By feature: files that implement the same feature
- By layer: API / model / frontend / config / test / docs
- By purpose: new feature, bug fix, refactoring, configuration
## Step C: Execute Micro-Commits
For each logical group:
1. Stage files explicitly — use `git add <file>` for tracked changes, `git add <untracked-file>` for new files
2. Commit with a clear message using this exact HEREDOC format:
```
git commit -m "$(cat <<'EOF'
<type>(<scope>): <description>
EOF
)"
```
3. Run `git status --short` after each commit to verify it succeeded before proceeding
Commit type prefixes: feat, fix, refactor, docs, style, test, chore
- One logical change per commit
- Process groups sequentially
- If a commit fails (e.g., pre-commit hook error), report the error and stop — do not force-skip hooks
After all commits, run `git status` to confirm the working tree is clean.
## Required Return Format
Return a summary report with:
- List of commits created: git hash + message + files included
- Any errors encountered and which files were skipped
- Final repository status (branch name, commits ahead of remote, working tree state)
Relay the sub-agent's summary report to the user. If the sub-agent reported errors, surface them clearly so the user can take action.
| Mistake | Fix |
|---|---|
HEREDOC EOF is indented | EOF must be at column 0; use <<-'EOF' only if stripping tabs intentionally |
Staging all files at once (git add .) | Stage files per logical group to keep commits focused |
Skipping git status between commits | Always verify each commit succeeded before proceeding |
Force-skipping hooks (--no-verify) | Fix the hook error instead — don't bypass it |