agentleFS
d-oitd-oit/rust-2026-template/.agents/skills/atomic-commit/SKILL.md

atomic-commit

Skill15 starsChanged 5 months agoMITView on GitHub

Atomic git workflow - validates, commits, pushes, creates PR/MR, and verifies CI with zero-warnings policy. Orchestrates complete code submission as state machine with rollback on failure. Supports GitHub (gh) and GitLab (glab). Triggers: "commit changes", "push and create PR", "submit code", "atomic commit".

  • Commits and pushes

4 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

2 rules. 0 are common, 2 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 4 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    COMMIT - Atomic commit creation (conventional format)

    line 29
  2. Distinctive:

    VERIFY - Wait for CI checks

    line 33

“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Atomic Commit Skill

When to Use

Atomic workflow: validate → commit → push → PR/MR → verify. All changes committed as single unit with zero warnings policy.

For large features (3+ distinct concerns), consider the stacked-prs skill instead.

Overview

Orchestrates complete code submission as state machine with 7 phases:

  1. PRE_COMMIT - Validation (quality gate, secrets scan)
  2. COMMIT - Atomic commit creation (conventional format)
  3. PRE_PUSH - Remote sync check
  4. PUSH - Upload to origin
  5. PR_CREATE - Open pull request (GitHub) or merge request (GitLab)
  6. VERIFY - Wait for CI checks
  7. REPORT - Success summary

Zero warnings policy: Any warning fails the workflow and triggers rollback.

Platform Detection

Auto-detect from git remote:

REMOTE=$(git remote get-url origin)
if echo "$REMOTE" | grep -qi "github"; then
  PLATFORM="github"; CLI="gh"
elif echo "$REMOTE" | grep -qi "gitlab"; then
  PLATFORM="gitlab"; CLI="glab"
fi

CLI Command Mapping

ActionGitHub (gh)GitLab (glab)
Create PR/MRgh pr create --title "..."glab mr create --title "..."
Check CIgh pr checksglab ci status
Mergegh pr merge 123 --squashglab mr merge 123 --squash

Arguments

ArgumentDescriptionDefault
--message, -mCommit message (auto-detect if omitted)auto
--platform github|gitlabForce platformauto-detect
--dry-runValidate only, no commits/pushesfalse
--skip-ciSkip CI verificationfalse
--timeoutCI wait timeout in seconds1800
--base-branchTarget branch for PR/MRmain

State Machine

[Start] → PRE_COMMIT → COMMIT → PRE_PUSH → PUSH → PR_CREATE → VERIFY → REPORT → [Success]
              ↓           ↓         ↓         ↓          ↓         ↓
            [Fail]      Rollback  Rollback  Rollback   Rollback  Rollback

Quality Gates

PhaseCheckFailure Action
PRE_COMMIT./scripts/quality-gates.sh zero warningsAbort
PRE_COMMITNo secrets in diffAbort
COMMITValid conventional formatRollback
PRE_PUSHRemote accessibleRollback
PUSHSHA verificationRollback
PR_CREATEgh/glab CLI authenticatedRollback
VERIFYAll CI checks greenRollback

Rust-Specific Checks

Before committing, verify:

  • cargo fmt --check passes
  • cargo clippy --workspace --all-targets --all-features -- -D warnings passes
  • cargo nextest run --workspace passes
  • No unsafe blocks without // SAFETY: comments

Commit Format

type(scope): Brief description (50 chars max)

- Why (not what) - user perspective
- Reference issues: Fixes #123

Types: feat, fix, docs, style, refactor, perf, test, ci, chore

Rationalizations

RationalizationReality
"I'll skip the quality gate, it's just a small change"Small changes cause the majority of production incidents.
"Rollback is too complicated, I'll just fix forward"Fix-forward creates tangled history and makes it harder to isolate what broke.
"I don't need to verify CI, the changes are cosmetic"Cosmetic changes can still break builds, linters, or type checks.

Red Flags

  • Bypassing the quality gate for "trivial" changes
  • Committing without running validation checks
  • Disabling rollback on failure

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.