Commit

From microsoft/vscode · View interactive version

Commit is an AI agent skill from the GitHub repository microsoft/vscode. Commit staged or unstaged changes with an AI-generated commit message that matches the repository's existing commit style. Use when the user asks to 'commit', 'commit changes', 'create a commit', 'save my work', or 'check in code'.

How to use this skill

Skill file

<!-- Customize this skill and select save to override its behavior. Delete that copy to restore the built-in behavior. -->

Commit Changes

Help the user commit code changes with a well-crafted commit message derived from the diff, following the conventions already established in the repository.

Guidelines

Workflow

1. Discover the repository's commit convention

Run the following to sample recent commits and the user's own commits:

# Recent repo commits (for overall style)
git log --oneline -20

# User's recent commits (for personal style)
git log --oneline --author="$(git config user.name)" -10

Analyse the output to determine the commit message convention used in the repository (e.g. Conventional Commits, Gitmoji, ticket-prefixed, free-form). All generated messages must follow the detected convention.

2. Check repository status

git status --short

3. Generate the commit message

Obtain the full diff of what will be committed:

git diff --cached --stat
git diff --cached

Using the diff and the commit convention detected in step 1, draft a commit message with:

4. Commit

Construct the git commit command with the generated message.

Execute the commit:

git commit -m "<subject>" -m "<body>"

5. Confirm

After the commit:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.