Skill git-commit
Mengotomatiskan proses staging perubahan dan pembuatan commit menggunakan format pesan conventional commit.
- Bintang GitHub
- 45
- File
- 1
- Commit terakhir
- 31 Mei 2026
- Lisensi
- MIT
- Tool yang diizinkan
- 2
Apa fungsi skill git-commit?
git-commit adalah agent skill. Mengotomatiskan proses staging perubahan dan pembuatan commit menggunakan format pesan conventional commit.
Ringkasan dibuat dari SKILL.md skill ini.
Tentang skill git-commit
Skill ini memungkinkan developer untuk mengotomatiskan proses staging dan committing perubahan kode menggunakan format conventional commit. Saat agent menerima instruksi untuk menyimpan perubahan atau melakukan commit pekerjaan, agent akan menggunakan Bash untuk memeriksa status repository dan melakukan staging pada semua file, termasuk file yang belum ditracked. Selanjutnya, agent akan menganalisis staged diff untuk menentukan tipe yang sesuai, seperti feat, fix, atau refactor, lalu menyusun pesan terstruktur yang mengikuti aturan spesifik seperti penggunaan imperative mood dan menjaga deskripsi tetap di bawah 72 karakter.
Agent sebaiknya memuat skill ini setiap kali pengguna ingin menyelesaikan sebuah tugas dalam git repository. Proses ini mengandalkan eksekusi perintah git status, git add, dan git diff untuk memahami konteks pekerjaan. Jika pre-commit hook mencegah pembuatan commit, skill ini akan melaporkan kegagalan spesifik tersebut agar Anda dapat menangani masalahnya. Skill ini menghasilkan commit formal dengan hash pendek dan pesan yang terstandarisasi, memastikan riwayat proyek tetap bersih dan konsisten.
Apa yang bisa dilakukan agent dengannya
- 1Commit semua pekerjaan saat iniMinta agent untuk menyimpan semua progres saat ini dan staged changes Anda ke dalam git commit baru.
- 2Generate pesan commit standarBiarkan agent menganalisis diff untuk menulis pesan yang mengikuti spesifikasi conventional commit.
- 3Menangani error pre-commit hookGunakan agent untuk mengidentifikasi penyebab kegagalan commit akibat local repository hooks.
Ditulis dari SKILL.md milik skill tersebut. Setiap use case diverifikasi dengan kutipan darinya.
Cara install skill git-commit
Setiap perintah menyalin folder skill ke direktori skills client. Restart client atau mulai sesi baru untuk memuatnya.Install skill git-commit di Plugin
/plugin marketplace add sequenzia/agent-alchemy /plugin install agent-alchemy-git-tools@agent-alchemy
Install skill git-commit di Claude Code
~/.claude/skills/git-commit/SKILL.md
$ npx degit sequenzia/agent-alchemy/claude/git-tools/skills/git-commit ~/.claude/skills/git-commitInstall skill git-commit di Claude Code (project)
.claude/skills/git-commit/SKILL.md
$ npx degit sequenzia/agent-alchemy/claude/git-tools/skills/git-commit .claude/skills/git-commitInstall skill git-commit di Codex
~/.agents/skills/git-commit/SKILL.md
$ npx degit sequenzia/agent-alchemy/claude/git-tools/skills/git-commit ~/.agents/skills/git-commitInstall skill git-commit di Gemini CLI
~/.gemini/skills/git-commit/SKILL.md
$ npx degit sequenzia/agent-alchemy/claude/git-tools/skills/git-commit ~/.gemini/skills/git-commitInstall skill git-commit di Claude.ai
npx degit sequenzia/agent-alchemy/claude/git-tools/skills/git-commit git-commit && zip -r git-commit.zip git-commit # claude.ai → Customize → Skills → + → Create skill → Upload a skill → git-commit.zip
SKILL.md
Lihat di GitHubGit Commit
Create a commit with a conventional commit message based on staged changes. Automatically stages all changes and analyzes the diff to generate an appropriate commit message.
Workflow
Execute these steps in order.
Step 1: Check Repository State
Check for changes to commit:
git status --porcelain
- If output is empty, report: "Nothing to commit. Working directory is clean." and stop.
- If changes exist, continue to Step 2.
Step 2: Stage All Changes
Stage all changes including untracked files:
git add .
Report: "Staged all changes."
Step 3: Analyze Changes
View the staged diff to understand what changed:
git diff --cached --stat
git diff --cached
Analyze the diff to determine:
- The type of change (feat, fix, docs, refactor, etc.)
- The scope (optional, based on affected files/modules)
- A concise description of what changed
Step 4: Construct Commit Message
Build a conventional commit message following this format:
<type>(<optional-scope>): <description>
[optional body]
Types:
feat- New featurefix- Bug fixdocs- Documentation onlystyle- Formatting, no code changerefactor- Code restructuring without behavior changetest- Adding or updating testschore- Maintenance tasksbuild- Build system or dependenciesci- CI configurationperf- Performance improvement
Rules:
- Use imperative mood ("add" not "added")
- Use lowercase
- No trailing period
- Keep description under 72 characters
- Add a body only for complex changes or breaking changes
- Do NOT add co-author, attribution, or "Generated with" lines
Step 5: Create Commit
Create the commit using a heredoc for proper formatting:
git commit -m "$(cat <<'EOF'
<commit message here>
EOF
)"
Step 6: Handle Result
On success:
- Report the commit hash: "Committed: {short_hash} - {message}"
On pre-commit hook failure:
- Report: "Pre-commit hook failed. The commit was NOT created."
- Explain what the hook reported
- Instruct: "Fix the issues above and run the commit command again. Do NOT use --amend as that would modify the previous commit."
Error Recovery
If the commit fails:
- Hook failure: Fix the reported issues, then stage and commit again (do NOT amend)
- Unstage changes:
git reset HEADto unstage without losing changes
Notes
- This command stages ALL changes including untracked files
- Pre-commit hooks run automatically; their failures mean no commit was created
- Always create a NEW commit after hook failure, never amend the previous commit
Berkas dalam skill ini
1Pertanyaan seputar skill git-commit
Bagaimana cara install skill git-commit di Claude Code?
Jalankan npx degit sequenzia/agent-alchemy/claude/git-tools/skills/git-commit ~/.claude/skills/git-commit. Claude Code memuat skill dari ~/.claude/skills (semua proyek) atau .claude/skills (satu proyek) dan menggunakan skill saat deskripsinya cocok dengan tugas.
Client mana saja yang bisa menggunakan skill git-commit?
Client apa pun yang membaca format Agent Skills: Claude Code, Codex, Gemini CLI, dan claude.ai (unggah sebagai ZIP). Script dalam skill hanya berjalan di client yang mengizinkan eksekusi kode.
Format apa yang digunakan untuk pesan commit?
Mengikuti format conventional commit, yang mencakup tipe, scope opsional, dan deskripsi.