Skip to content
Back to skills

Commit Twiddle

ASecurity

Validates and corrects commit messages against project guidelines after a commit is created. Invoke automatically after every git commit to ensure messages conform to .omni-dev/commit-guidelines.md.

  • 3 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 13, 2026
ai-agentsbashgit

Security analysis

A100/100

Scanned October 13, 2026

npx -y skills add rust-works/omni-dev --skill commit-twiddle --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Commit Twiddle?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Commit Twiddle
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/rust-works-commit-twiddle/badge)](https://www.skillsdirectory.com/skills/rust-works-commit-twiddle)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: commit-twiddle
description: Validates and corrects commit messages against project guidelines after a commit is created. Invoke automatically after every git commit to ensure messages conform to .omni-dev/commit-guidelines.md.
argument-hint: [commit-hash|range]
allowed-tools: Bash(mkdir *), Read, Write, Edit, "omni-dev *"
---

# Commit Twiddle

Validate and correct commit messages to conform to `.omni-dev/commit-guidelines.md`.

If `$ARGUMENTS` is provided, use it as the commit hash or range. Otherwise default to `HEAD`.

## Step 1 — Analyse

```bash
omni-dev git commit message view $ARGUMENTS
```

The output is self-describing. Read the `explanation.fields` section to understand all
available fields, then extract the values needed for Step 2.

Key fields to look at:
- `commits[].original_message` — the current message
- `commits[].analysis.detected_type` and `detected_scope` — what omni-dev detected
- `commits[].analysis.diff_file` — read this file to understand what actually changed
- `ai.scratch` — base path for temporary files

## Step 2 — Craft corrected messages

For each commit, write a corrected message that conforms to the guidelines. Constraints:

- **Type and scope** must match the actual changes — read the diff if uncertain
- **Scope** must be one of the values defined in `.omni-dev/scopes.yaml`
- **Subject line** must be lowercase, imperative mood, no trailing period, ≤80 chars total
- **No `Co-Authored-By` footers** — do not add AI attribution lines
- **Body** required for changes >50 lines or architectural changes; wrap at 72 cols

Write the amendments file to `<ai.scratch>/amendments-<random-8-hex>.yaml`:

```yaml
amendments:
  - commit: "<exactly 40 lowercase hex chars>"   # full SHA, not abbreviated
    message: |
      <type>(<scope>): <subject>

      <optional body wrapped at 72 cols>

      <optional footers — no Co-Authored-By>
```

Create the directory if the write fails:

```bash
mkdir -p <ai.scratch>
```

## Step 3 — Apply

```bash
omni-dev git commit message amend <ai.scratch>/amendments-<random-8-hex>.yaml
```

## Constraints

- The target commit must be at the **branch tip with no merge commit above it**. If a
  merge commit is present the amend will fail — work on the branch before merging.
- Use the **exact 40-character SHA** from the `commits[].hash` field. An abbreviated
  hash silently skips the amendment or errors.
- If the message is already correct, do nothing and say so.

## Enforcement

`.github/workflows/commit-lint.yml` runs `omni-dev git commit message lint --strict` on every
push/PR to `main` (non-required check), so a message this skill leaves non-conforming will still
be caught in CI.

## Troubleshooting

If `omni-dev` is not installed: https://crates.io/crates/omni-dev (requires ≥ v0.3.0)

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.