Command Palette

Search for a command to run...

UnylyUnyly
Back to skills

commit-changes

FreeNo executable scriptsNot checked

Commit changes as signed Conventional Commits after the pre-commit checks. Use when committing or writing a commit message.

torrustby torrust★ 539 GitHub stars

About this skill

Committing Changes

This skill guides you through the complete commit process for the Torrust Tracker project.

Quick Reference

# One-time setup: install the pre-commit Git hook
./contrib/dev-tools/git/install-git-hooks.sh

# Stage changes
git add <files>

# Commit with conventional format and GPG signature (MANDATORY)
# The pre-commit hook runs ./contrib/dev-tools/git/hooks/pre-commit.sh automatically
git commit -S -m "<type>[(<scope>)]: <description>"

Conventional Commit Format

We follow Conventional Commits specification.

Commit Message Structure

<type>[optional scope]: <description>

[optional body]

[optional footer(s)]

Scope should reflect the affected package or area (e.g., tracker-core, udp-protocol, ci, docs).

Commit Types

Type Description Example
feat New feature or enhancement feat(tracker-core): add peer expiry grace period
fix Bug fix fix(udp-protocol): resolve endianness in announce response
docs Documentation changes docs(agents): add root AGENTS.md
style Code style changes (formatting, etc.) style: apply rustfmt to all source files
refactor Code refactoring refactor(tracker-core): extract peer list to own module
test Adding or updating tests test(http-core): add announce response tests
chore Maintenance tasks chore: update dependencies
ci CI/CD related changes ci: add workflow for container publishing
perf Performance improvements perf(swarm-coordination-registry): switch to dashmap

GPG Commit Signing (MANDATORY)

All commits must be GPG signed. Use the -S flag:

git commit -S -m "your commit message"

Restricted Agent Sandboxes

Some agent sandboxes cannot write hook logs to /tmp and can invoke Git hooks with a PATH that does not resolve the Rust toolchain. Preserve GPG signing and explicitly restore Cargo's conventional installation directory while writing hook logs inside the workspace:

PATH="${CARGO_HOME:-$HOME/.cargo}/bin:$PATH" \
TORRUST_GIT_HOOKS_LOG_DIR=.tmp \
git commit -S -m "<type>(<scope>): <description>"

The repository hook also tries to restore Cargo. First validate with the same PATH and TORRUST_GIT_HOOKS_LOG_DIR variables by running the pre-commit script directly. If Git still launches the hook without usable Cargo in the restricted agent sandbox, rerun the signed git commit outside that sandbox; do not bypass the hook or signing. This workaround keeps hook logs in the git-ignored workspace .tmp/ directory and does not alter the checks or replace normal developer setup.

One Signed Commit per Step

Run each signed commit as its own step, and check its result (the exit status, and git log -1 --format=%G?) before staging or committing anything else. Never chain a commit with a later git add or git commit in one command using ; or newlines: if the signature fails, its changes stay staged and the next commit sweeps them in. In issue #2505 a commit failed with a GPG timeout, and the next commit, issued in the same command, swept the staged rename into an unrelated docs commit.

GPG Timeout Handling

If the GPG passphrase prompt times out (gpg: signing failed: Timeout), the agent must:

  1. Stop the failed attempt immediately. Do not use --no-gpg-sign or skip signing.
  2. Notify the user that the passphrase prompt timed out and offer these choices:
  • retry the same signed commit manually; or
  • have the agent retry the same git commit -S command while the user enters the passphrase directly in the terminal prompt.
  1. Wait for the user's choice. Do not retry automatically. If the user requests an agent-assisted retry, invoke only the same signed commit command and allow the user to provide the passphrase; never receive, request, or handle the passphrase in chat.

This rule is absolute. Never bypass GPG signing for any reason.

Pre-commit Verification (MANDATORY)

Git Hook

The repository ships a pre-commit Git hook that runs ./contrib/dev-tools/git/hooks/pre-commit.sh automatically on every git commit. Install it once after cloning:

./contrib/dev-tools/git/install-git-hooks.sh

Once installed, the hook fires on every commit and you do not need to run the script manually. To check whether it is installed before you run the script by hand, see the [`run-pre-commit

Full SKILL.md on GitHub

Install commit-changes in Claude Code & Claude Desktop

Sign up to install this skill

Create a free account to reveal the install command and save the skill to your library.

  • Reveal the one-line install command
  • Save skills to your synced library
  • Get notified when skills update
Sign up freeI already have an account

Allowed tools

Tools this skill is permitted to call.

No restriction — this skill can use any tool.

FAQ

What does the commit-changes skill do?

Commit changes as signed Conventional Commits after the pre-commit checks. Use when committing or writing a commit message.

How do I install the commit-changes skill?

Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.

Does the commit-changes skill run scripts?

No, this skill is instructions only (SKILL.md) with no executable scripts.

Related skills

Compare commit-changes with