Commit - Safe Git Workflow

SkillDev tools

Safe commit and push workflow. Creates a commit following conventions and pushes. Husky handles verifications (TypeScript, Biome, tests).

Available today. Use it from your connected AI after setup.

Connect ahel once, and every AI you use reads what you have installed.

Then ask your AI: use the Commit - Safe Git Workflow skill

What this skill tells your AI

The instructions your AI receives, as published by dgouron/review-flow in .claude/skills/commit/SKILL.md and read by ahel’s review.

Persona

Read .claude/roles/senior-dev.md — adopt this profile and follow all its rules.

Activation

This skill activates:

  • On explicit request (/commit)
  • When the user asks to commit/push code

Husky Hooks (automatic)

The project uses Husky which automatically runs:

HookAction
pre-commitTypeScript check + Biome lint (modified files)
commit-msgcommitlint (message format)
pre-pushVitest tests (modified files since test)

Claude Code Hooks (automatic)

The project also has PreToolUse hooks that run BEFORE git commands:

HookAction
protect-main-branch.shBlocks commit on master
pre-commit-gate.shRuns tests before commit
verify-spec-updated.shChecks spec has ## Status: implemented
protect-main-push.shBlocks push to master and force push

Workflow

Step 0: Quality Gates (BLOCKING)

BEFORE any commit, run:

yarn verify

If it fails: display errors and STOP. Do not commit until quality gates pass.

Step 0b: Spec & Tracker Verification

If staged files include src/ code:

  1. Check docs/feature-tracker.md — any feature in implementing status should be updated to implemented
  2. Check corresponding spec — should have ## Status: implemented if feature is complete
  3. If missing, WARN the user (the hook will also catch this)

Step 1: Analyze Changes

git status --short

If nothing is staged, suggest:

git add <files>

Step 2: Create the Commit

Message Format (Conventional Commits)
<type>(<scope>): <description>

Allowed types:

TypeUsage
featNew feature
fixBug fix
docsDocumentation only
styleFormatting (no code change)
refactorRefactoring (no new feature or fix)
perfPerformance improvement
testAdding or fixing tests
buildBuild system changes
ciCI/CD changes
choreMaintenance, dependencies
revertRevert a previous commit

Rules:

  • Header max 72 characters
  • Description in lowercase, no trailing period
  • Scope optional in parentheses
Examples
feat(webhook): add GitHub signature validation
fix(review): resolve score calculation overflow
refactor(gateway): extract GitLab API client
test(usecase): add unit tests for track assignment

Step 3: Commit

git commit -m "<type>(<scope>): <description>"

Husky will automatically run:

  1. TypeScript check
  2. Biome lint
  3. commitlint

Step 4: Push (optional)

git push origin <current-branch>

Husky will automatically run tests before pushing.

Security Rules

  • NEVER use --force without explicit request
  • NEVER push to main or master directly
  • NEVER use --no-verify unless explicitly requested by the user
  • ALWAYS verify you are on a feature branch
  • NEVER mention Claude, Anthropic, or Co-Authored-By in commits

If Husky Fails

ErrorSolution
TypeScriptFix type errors
Biomeyarn lint:fix to auto-correct
commitlintReword the commit message
Tests (push)Fix failing tests

Output Template

COMMIT

Branch: <branch>
Staged files:
  - <file 1>
  - <file 2>

Message: <type>(<scope>): <description>

Verifications:
  - Husky: TypeScript / Biome / commitlint

Confirm commit? (yes/no)

Signals

GitHub stars
43
Forks
6
Last commit
Sep 2026
Advanced
Catalog kind
skill
Gateway key
commit-dgouron
Source
github.com/dgouron/review-flow