Claude Skills
CollectionsCompareWorkflowsNominate
Sign inSign up
© 2026 Curated Agent Skills·Learn more about Agent Skills
Back to repository

creating-commits

verified

Use before EVERY git commit - no exceptions. Enforces pre-commit quality checks, atomic commits, and conventional commit format to prevent hook failures and maintain clean history

View on GitHub

Marketplace

claude-devcontainer

zookanalytics/claude-devcontainer

Plugin

git-workflow

Repository

zookanalytics/claude-devcontainer

packages/git-workflow/skills/creating-commits/SKILL.md

Last Verified

February 1, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/zookanalytics/claude-devcontainer/blob/main/packages/git-workflow/skills/creating-commits/SKILL.md -a claude-code --skill creating-commits

Installation paths:

Claude
.claude/skills/creating-commits/
Powered by add-skill CLI

Instructions

# Creating Commits

Use before ANY commit - never skip for "simple" changes.

## MANDATORY FIRST STEP

**STOP: Create TodoWrite checklist BEFORE running any commands.**

**Correct pattern:**

1. Load this skill ✓
2. TodoWrite with 6 checklist items (see below) → FIRST response
3. Execute steps, updating todos (step 1 runs two operations in parallel)

**Wrong pattern (will fail):**

1. Load skill
2. Run git commands without TodoWrite
3. Forget a step
4. Hook blocks commit ❌

## Workflow Checklist

**Create these TodoWrite items as your FIRST action, ALL steps are required:**

1. ☐ Run `pnpm pre-commit` (if available) AND Read `docs/commit_specification.md` (PARALLEL)
2. ☐ Run `git diff` and analyze staging (see below)
3. ☐ `git add <files>` (stage atomic unit of related files)
4. ☐ `git diff --staged` (preview commit)
5. ☐ Write `.claude/.commit-state.json` (signals workflow completion)
6. ☐ `git commit -m "type(scope): description"`

**Parallel optimization:** Step 1 runs `pnpm pre-commit` (if the script exists) and reads `docs/commit_specification.md` simultaneously since they have no dependencies.

### Steps 2-3: Staging Analysis

Before running `git add`, check current staging state:

**Never stage files containing secrets** (`.env`, `credentials.json`, `*.pem`, `*_key`, etc.) - warn user if these appear in diff.

**Some files already staged?** User pre-selected - verify staged files form atomic unit.

**No files staged?** After reviewing `git diff`, evaluate what constitutes an atomic unit:

- If all changes form one logical unit → stage all files and proceed
- If multiple logical changes detected → use AskUserQuestion to ask which atomic unit to commit first, then suggest splitting rest into separate commits

**Multiple logical changes?** See Atomic Commits section below for how to identify and split.

### Step 5: Write Commit State File

Write this file after steps 1-4 and before step 6:

```bash
cat > .claude/.commit-state.json <<'EOF'
{
  "workflow_completed

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
3582 chars