G

Guide Commit Navigator

A agent template for git workflows. Streamlines development with pre-configured patterns and best practices.

AgentClipticsgitv1.0.0MIT
0 views0 copies

Commit Navigator Guide

Your agent for writing clear, consistent git commits — covering commit message conventions, atomic commits, interactive staging, and commit best practices for team collaboration.

When to Use This Agent

Choose Commit Navigator Guide when:

  • Writing descriptive, well-structured commit messages
  • Creating atomic commits that each represent a single logical change
  • Using conventional commit format for automated changelog generation
  • Reviewing commit history for quality and consistency
  • Training teams on git commit best practices

Consider alternatives when:

  • You need git branching strategy — use a Git Flow Manager agent
  • You need PR creation and review — use a code reviewer agent
  • You need CI/CD pipeline setup — use a DevOps agent

Quick Start

# .claude/agents/commit-navigator.yml name: Commit Navigator Guide model: claude-sonnet tools: - Read - Write - Edit - Bash - Glob - Grep description: Git commit guide for writing clear messages, creating atomic commits, and following conventional commit standards

Example invocation:

claude "Review my staged changes and suggest well-structured commit messages following conventional commit format — split into logical atomic commits if the changes cover multiple concerns"

Core Concepts

Conventional Commit Format

<type>(<scope>): <subject>

<body>

<footer>

Types:
  feat:     New feature
  fix:      Bug fix
  docs:     Documentation only
  style:    Formatting (no logic change)
  refactor: Code change (no feature/fix)
  perf:     Performance improvement
  test:     Adding/modifying tests
  chore:    Build, tooling, dependencies

Examples:
  feat(auth): add SSO login with SAML2 support
  fix(cart): prevent duplicate items on rapid add
  refactor(api): extract validation into middleware

Atomic Commit Principles

PrincipleDescriptionExample
Single purposeOne logical change per commitSeparate refactor from feature
Self-containedCommit works independentlyDon't break the build mid-commit
ReviewableEasy to review in isolationKeep diffs focused and readable
RevertableCan be reverted without side effectsNo unrelated changes bundled

Configuration

ParameterDescriptionDefault
conventionCommit format (conventional, angular, custom)conventional
scope_requiredRequire scope in commitsfalse
max_subject_lengthMaximum subject line length72
body_requiredRequire commit bodyfalse
breaking_change_formatBreaking change notationfooter

Best Practices

  1. Write the subject line as an imperative command. "Add search endpoint" not "Added search endpoint" or "Adding search endpoint." The subject line completes the sentence "If applied, this commit will [subject]."

  2. Keep the subject line under 72 characters. Git log, GitHub, and most tools truncate long subject lines. If you can't summarize the change in 72 characters, the commit may be doing too much.

  3. Use the body to explain why, not what. The diff shows what changed. The body should explain why the change was necessary, what alternatives were considered, and any context that helps reviewers understand the decision.

  4. Create atomic commits, each building on the last. Each commit should leave the codebase in a working state. Avoid WIP commits on shared branches — use interactive rebase to clean up history before pushing.

  5. Reference issue numbers in commit messages. "fix(auth): resolve SSO timeout (#1234)" links the commit to the issue tracker. This creates a traceable chain from issue to commit to deployment.

Common Issues

Commits are too large and mix multiple concerns. A single commit with refactoring, a new feature, and a bug fix is hard to review and impossible to revert cleanly. Use git add -p to stage hunks selectively and create separate commits for each concern.

Commit messages are vague and unhelpful. "Fix bug," "Update code," and "WIP" don't help future readers. Every commit message should answer: what changed and why? If you can't write a clear message, the commit may be doing too much.

Teams don't follow commit conventions consistently. Enforce conventions with commitlint and husky pre-commit hooks. Automated enforcement is more reliable than code review — humans miss inconsistencies, tools don't.

Community

Reviews

Write a review

No reviews yet. Be the first to review this template!

Similar Templates