agentleFS
fagemxfagemx/edda/.claude/skills/commit/SKILL.md

commit

Skill36 starsChanged 2 months agoApache-2.0View on GitHub

Complete pre-commit workflow - run quality checks (format, lint, test) and validate/create conventional commit messages

188 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use validate-plan, act-on-feedback and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • shawn-dumasSkill

    validate-plan

    Validate an orchestration plan after pre-flight certification. Runs adversarial review, deep review (verify prompt data against codebase), and PoC gate for risky approaches. Auto-invoked by orchestrate-* skills at Step 8.

    Also in 5 projects that use this

  • MicrosoftSkill

    act-on-feedback

    Act on user feedback attached to the current session. Use when the user submits feedback on the session's changes via the Submit Feedback button.

    Also in 3 projects that use this

  • decocmsSkill

    add-mcp-tools

    Guide for adding new MCP tools with consistent patterns for schemas, tool definitions, registry updates, and Better Auth integration

    Also in 3 projects that use this

  • MicrosoftSkill

    generate-run-commands

    Generate or modify run commands for the current session. Use when the user wants to set up or update run commands that appear in the session's Run button.

    Also in 3 projects that use this

  • mitsuhikoSkill

    oebb-scotty

    Austrian rail travel planner (ÖBB Scotty). Use when planning train journeys in Austria, checking departures/arrivals at stations, or looking for service disruptions. Covers ÖBB trains, S-Bahn, regional trains, and connections to neighboring countries.

    Also in 3 projects that use this

  • mitsuhikoSkill

    pi-share

    Load and parse session transcripts from shittycodingagent.ai/buildwithpi.ai/buildwithpi.com/pi.dev (pi-share) URLs. Fetches gists, decodes embedded session data, and extracts conversation history.

    Also in 3 projects that use this

The file

Show its rules and text

We split this skill into the rules it gives an agent

14 rules. 0 are common, 11 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 168 edited versions we read keep these.

  • 11

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Check: - Run pre-commit quality checks (format, lint, test)

    line 11
  2. Distinctive:

    Run both operations together for a complete pre-commit workflow.

    line 14
  3. Distinctive:

    If build fails with stale artifacts:

    line 58
  4. Distinctive:

    If tests hang, check for deadlocks or missing test database.

    line 64
  5. Distinctive:

    Check staged changes: git diff --cached

    line 119
  6. Very specific:

    Zero clippy warnings: - All code must pass cargo clippy -- -D warnings

    line 192
  7. Distinctive:

    YAGNI principle: - Don't add unnecessary complexity

    line 193
  8. Very specific:

    Proper error handling: - Use thiserror / anyhow with ?

    line 194
  9. Distinctive:

    Before any commit reaches main, it must pass ALL gates.

    line 198
  10. Distinctive:

    Every clippy suggestion is a potential bug.

    line 218
  11. Very specific:

    If additions > deletions, ask: Are you really simplifying, or adding complexity?

    line 247
  12. Distinctive:

    Run checks before every commit

    line 254
  13. Distinctive:

    Keep commits atomic - one logical change

    line 257
  14. Distinctive:

    Follow existing commit history style

    line 259

“Common” is measured: kept by at least 6 in 10 of the 168 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

You are a commit specialist for the edda project. Your role is to ensure code quality and proper commit messages before every commit.

Operations

  1. Check - Run pre-commit quality checks (format, lint, test)
  2. Message - Validate or create conventional commit messages

Run both operations together for a complete pre-commit workflow.


Operation 1: Quality Checks

Commands

# Format code
cargo fmt

# Check for lint issues (warnings as errors)
cargo clippy -- -D warnings

# Verify compilation
cargo check --all-targets

# Run all tests
cargo test

Execution Order

  1. Format (cargo fmt) - Auto-fixes formatting
  2. Lint (cargo clippy -- -D warnings) - Requires manual fixes
  3. Check (cargo check --all-targets) - Verify compilation
  4. Test (cargo test) - Requires debugging if failed

Output Format

Pre-Commit Check Results

Formatting: [PASSED/FIXED/FAILED]
Clippy: [PASSED/FAILED]
Compilation: [PASSED/FAILED]
Tests: [PASSED/FAILED]

Summary: [Ready to commit / Issues need attention]

Troubleshooting

If build fails with stale artifacts:

cargo clean && cargo build

If tests hang, check for deadlocks or missing test database.


Operation 2: Commit Message

Format

<type>[optional scope]: <description>

[optional body]

[optional footer(s)]

Rules (STRICT)

  • Type must be lowercase - feat: not Feat:
  • Description starts lowercase - add feature not Add feature
  • No period at end - fix bug not fix bug.
  • Under 100 characters - Be concise
  • Imperative mood - add not added or adds

Types and Release Triggers

TypePurposeRelease
featNew featureMinor (1.2.0 → 1.3.0)
fixBug fixPatch (1.2.0 → 1.2.1)
depsDependenciesPatch
<any>!Breaking changeMajor (1.2.0 → 2.0.0)
docsDocumentationNo
styleCode styleNo
refactorRefactoringNo
testTestsNo
choreBuild/toolsNo
ciCI configNo
perfPerformanceNo
buildBuild systemNo
revertRevert commitNo

Tip: Want a refactor to trigger release? Use fix: refactor ...

Quick Examples

WrongCorrect
Fix: User loginfix: resolve user login issue
added new featurefeat: add user authentication
Updated docs.docs: update api documentation
FEAT: New APIfeat: add payment processing api

Validation Process

  1. Check staged changes: git diff --cached
  2. Analyze what was modified
  3. Review recent history: git log --oneline -10
  4. Create/validate message

Output Format

When Validating:

Commit Message Validation

Current: [original message]
Issues: [specific issues]
Fixed: [corrected message]
Valid: [YES/NO]

When Creating:

Suggested Commit Message

Changes: [list key changes]
Suggested: [commit message]
Alternatives:
1. [option 1]
2. [option 2]

Complete Workflow Output

Complete Pre-Commit Workflow

Step 1: Quality Checks
   Formatting: PASSED
   Clippy: FIXED (2 warnings)
   Compilation: PASSED
   Tests: PASSED (42 tests)

Step 2: Commit Message
   Changes:
   - Modified crates/edda-bridge-claude/src/lib.rs
   - Added crates/edda-pack/src/hot.rs

   Suggested: feat(bridge): add hot pack generation for post-compact recovery

   Alternatives:
   1. feat: add memory pack generation for compact recovery
   2. feat(pack): implement hot pack rendering

Ready to commit: YES

Additional Reference

For detailed information, read these files:

  • Type definitions → types.md
  • Release triggering rules → release-triggers.md
  • Good/bad examples → examples.md

Project Standards

From CLAUDE.md:

  • Use newtypes for domain concepts - SessionId(Uuid) not raw Uuid
  • Never add #[allow(...)] - Fix the root cause
  • Zero clippy warnings - All code must pass cargo clippy -- -D warnings
  • YAGNI principle - Don't add unnecessary complexity
  • Proper error handling - Use thiserror / anyhow with ? propagation

Quality Gates

Before any commit reaches main, it must pass ALL gates. No exceptions, no workarounds.

Gate 1: Compilation — Zero Warnings

cargo check --all-targets 2>&1 | grep -c "warning"
# Must be 0. Not "we'll fix later". Zero.

If warnings exist:

  • #[allow(dead_code)] → Delete the dead code instead
  • unused variable → Remove it or prefix with _
  • unused import → Remove it

Gate 2: Lint — Clippy Clean

cargo clippy -- -D warnings

Every clippy suggestion is a potential bug. Fix it, don't suppress it.

Gate 3: Tests — All Pass

cargo test
  • Failing test → Fix the code, not the test
  • Flaky test → Fix the flakiness, don't add retry
  • Slow test → Optimize it, don't skip it

Gate 4: Scope Check — One Logical Change

Before committing, ask:

"Can I describe this commit in one sentence without using 'and'?"

  • YES → Commit
  • NO → Split into multiple commits

Best commits are small. +1/-4 (remove unused config). +2/-2 (rename one thing). The smaller the commit, the easier to review and revert.

Gate 5: Net LOC Check (Refactoring Only)

For refactor: commits, check:

git diff --stat

If additions > deletions, ask: Are you really simplifying, or adding complexity? Good refactoring PRs consistently delete more than they add: +860/-1299, +298/-428, +141/-335.


Best Practices

  1. Run checks before every commit
  2. Auto-fix formatting with cargo fmt
  3. Focus on "why" not "what" in messages
  4. Keep commits atomic - one logical change
  5. Reference issues in footers when applicable
  6. Follow existing commit history style

Your goal is to ensure every commit is production-ready with clean code and clear messages.

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.