Quick Commit
Powerful command for create, well, formatted, commits. Includes structured workflows, validation checks, and reusable patterns for git workflow.
Quick Commit
Create well-structured conventional commits with automated staging, message formatting, and validation.
When to Use This Command
Run this command when you need to:
- Create a conventional commit with proper type, scope, subject, and body formatting
- Stage and commit related changes with automated message generation from diff analysis
- Validate commit messages against team conventions before finalizing the commit
Consider alternatives when:
- You need to amend or rewrite existing commit history (use interactive rebase instead)
- The commit involves complex merge conflict resolution that requires manual staging
Quick Start
Configuration
name: quick-commit type: command category: git-workflow
Example Invocation
claude command:run quick-commit --type feat --scope auth --message "Add OAuth2 login flow"
Example Output
Staged Changes Analysis:
Modified: src/auth/oauth.ts (+142, -12)
Modified: src/auth/middleware.ts (+28, -3)
Added: src/auth/providers/google.ts (+87)
Modified: tests/auth/oauth.test.ts (+45)
Commit Message:
feat(auth): Add OAuth2 login flow
Implement Google OAuth2 authentication provider with token
refresh and session management. Add middleware for protecting
routes that require authentication.
Validation:
[OK] Type: feat (valid)
[OK] Scope: auth (matches directory structure)
[OK] Subject: 38 chars (limit: 70)
[OK] Body: present and descriptive
[OK] No secrets detected in staged files
Commit created: a4f8e2c feat(auth): Add OAuth2 login flow
Core Concepts
Conventional Commit Overview
| Aspect | Details |
|---|---|
| Commit Types | feat, fix, ref, perf, docs, test, build, ci, chore, style |
| Scope | Optional module or area identifier matching project structure |
| Subject Line | Imperative mood, capitalized, no period, max 70 characters |
| Body | Explains what and why, not how; separated by blank line |
| Footer | Issue references (Fixes #123) and breaking change declarations |
Commit Creation Workflow
Changes Ready
|
v
+-------------------+
| Analyze Diff |---> Categorize changes by type
+-------------------+
|
v
+-------------------+
| Stage Files |---> Add related files only
+-------------------+
|
v
+-------------------+
| Format Message |---> type(scope): subject + body
+-------------------+
|
v
+-------------------+
| Validate Message |---> Length, format, conventions
+-------------------+
|
v
+-------------------+
| Security Scan |---> Check for secrets in diff
+-------------------+
|
v
+-------------------+
| Create Commit |---> git commit with formatted msg
+-------------------+
Configuration
| Parameter | Type | Default | Description |
|---|---|---|---|
| type | string | auto-detect | Commit type: feat, fix, ref, perf, docs, test, build, ci, chore |
| scope | string | auto-detect | Module scope inferred from changed file paths |
| message | string | required | Commit subject line describing the change |
| body | string | auto-generate | Commit body with additional context (generated from diff if omitted) |
| issue | string | none | Issue reference to include in footer (e.g., #123, PROJ-456) |
Best Practices
-
One Logical Change Per Commit - Each commit should represent a single, coherent change that can be independently reviewed and reverted. Mixing a feature addition with an unrelated refactor makes both harder to understand and review.
-
Write Imperative Subject Lines - Use "Add feature" not "Added feature" or "Adds feature". The imperative mood reads as a command that completes the sentence "If applied, this commit will [subject]."
-
Explain Why in the Body - The diff shows what changed. The commit body should explain why the change was necessary, what alternatives were considered, and any non-obvious implications of the change.
-
Reference Issues in the Footer - Link commits to issue trackers using Fixes #123 or Refs PROJ-456. This creates traceability from code changes back to requirements and bug reports.
-
Scan for Secrets Before Committing - Check staged files for API keys, passwords, tokens, and private keys. A secret committed even briefly to version control should be considered compromised and rotated.
Common Issues
-
Wrong Commit Type Selected - The auto-detected type does not match the intent of the change. Override the type explicitly when the diff analysis misclassifies a change (e.g., a bugfix detected as a refactor because no test files changed).
-
Subject Line Too Long - The commit subject exceeds 70 characters. Shorten the subject to a concise summary and move details into the commit body where there is no length restriction.
-
Staged Files Include Unrelated Changes - Multiple unrelated modifications were staged together. Use git add with specific file paths rather than git add -A to ensure only related changes are included in each commit.
Reviews
No reviews yet. Be the first to review this template!
Similar Templates
Git Commit Message Generator
Generates well-structured conventional commit messages by analyzing staged changes. Follows Conventional Commits spec with scope detection.
React Component Scaffolder
Scaffolds a complete React component with TypeScript types, Tailwind styles, Storybook stories, and unit tests. Follows project conventions automatically.
CI/CD Pipeline Generator
Generates GitHub Actions workflows for CI/CD including linting, testing, building, and deploying. Detects project stack automatically.