Commit code with optional checking

VerifiedSafe

Analyzes current changes, optionally runs checks (lint, build, test) before committing. Creates a new feature branch if on main, stages relevant files, and writes a conventional commit message. Useful when you want to ensure code quality before committing or need to quickly commit changes to a new branch.

Sby Skills Guide Bot
DevelopmentBeginner
1606/2/2026
Claude Code
#git#commit#conventional-commit#development

Recommended for

Our review

Optionally checks code (lint, build, tests) then commits it with a conventional commit message, creating a feature branch if needed.

Strengths

  • Ensures code quality before each commit through automated checks
  • Uses conventional commit format (`type(scope): description`)
  • Automatically creates a feature branch if currently on main
  • Avoids committing sensitive files (secrets, .env)

Limitations

  • Relies on the project's configured check tools (lint, build, test)
  • Does not handle merge conflicts or rebases
  • Basic secret detection (by file name only)
When to use it

When you want to commit clean, well-formatted code following a standardized conventional commit style.

When not to use it

If you need to commit quickly without checks (use the `force` option) or if your changes include sensitive files that the skill cannot filter.

Security analysis

Safe
Quality score95/100

The skill runs only standard local git commands (status, diff, log, branch, add, commit) without any destructive actions, network calls, or secret exfiltration. It even advises against committing secret files.

No concerns found

Examples

Commit with checks
Commit my changes with checks.
Force commit without checks
Commit my changes with force.

name: commit description: Optionally checks, then commits code to the current or a new feature branch.

When asked to commit code, follow these steps:

Arguments

  • check (default): Run checks first to lint, build, and test the code. Stop if any checks fail.
  • force: Skip the check step and commit directly.

Steps

  1. Run these bash commands in parallel to understand the current state:

    • git status to see all untracked files
    • git diff HEAD to see both staged and unstaged changes
    • git log --oneline -10 to see recent commit messages for style consistency
  2. If you are on the main branch, create a new feature branch using git branch and switch to it.

  3. Analyze all changes and draft a commit message:

    • Summarize the nature of the changes (new feature, enhancement, bug fix, refactoring, test, docs, etc.)
    • Use the conventional commit format: type(scope): description
    • Keep the first line under 72 characters
    • Do not commit files that likely contain secrets (.env, credentials.json, etc.)
  4. Stage and commit the changes:

    • Add relevant files using git add
    • Use a plain string for the commit message (do not use HEREDOCs).
  5. Report the results including:

    • The commit hash
    • The commit message
Related skills