agentleFS
strikersamstrikersam/autonomous-ai-agency/.agents/skills/smart-commit/SKILL.md

smart-commit

Skill9 starsChanged 3 months agoMITView on GitHub

Quality gates + conventional commits. Run tests, lint, and typecheck before committing. Format the commit message as a conventional commit. Blocks on failure.

  • Reads credentials

12 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

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

  • 0

    Common

    Most of the 10 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Very specific:

    Use this skill every time you are ready to commit code.

    line 22
  2. Very specific:

    If the diff is empty and this is a code change (not chore/test/docs), update docs/changelog.md under ## [Unreleased] before continuing.

    line 35
  3. Distinctive:

    Block on failure: Do not commit with failing tests.

    line 44
  4. Distinctive:

    If any secrets are detected: stop immediately, do not commit.

    line 56

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

Skill: smart-commit

When to Use

Use this skill every time you are ready to commit code. It replaces ad-hoc git add && git commit with a structured quality gate sequence.


Instructions

Step 1 — Confirm changelog is updated

git diff docs/changelog.md

If the diff is empty and this is a code change (not chore/test/docs), update docs/changelog.md under ## [Unreleased] before continuing.

Step 2 — Run tests

pytest -x

Block on failure. Do not commit with failing tests. Fix the failure first.

Step 3 — Check for obvious issues

# Syntax check staged Python files
git diff --staged --name-only | grep '\.py$' | xargs python -m py_compile

# Confirm no secrets in staged files
git diff --staged | grep -iE '(SECRET_KEY\s*=\s*["\x27][^"\x27]{8}|password\s*=\s*["\x27][^"\x27]{4}|api_key\s*=\s*["\x27]sk-)'

If any secrets are detected: stop immediately, do not commit.

Step 4 — Stage your changes

git status                          # review what changed
git diff --staged                   # confirm what's staged
git add <specific files>            # stage by name, not -A

Step 5 — Write a conventional commit message

Format: <type>(<scope>): <short description>

TypeWhen to Use
featNew feature visible to users
fixBug fix
refactorCode change with no behaviour change
testAdding or updating tests
docsDocumentation only
choreTooling, config, dependencies
ciCI/CD changes
styleFormatting, whitespace (no logic change)
perfPerformance improvement
securitySecurity fix or hardening

Examples:

feat(router): add task classification for long-context requests
fix(auth): reject tokens with empty bearer string
refactor(agent): extract planner prompt into prompts.py
security(key_store): hash keys before comparison

Step 6 — Commit

git commit -m "$(cat <<'EOF'
feat(scope): description here

- Additional context if needed
- Reference issue if applicable

https://claude.ai/code/session_<id>
EOF
)"

Step 7 — Verify

git log --oneline -3    # confirm commit appeared
git status              # confirm working tree is clean

Acceptance Checks

  • docs/changelog.md updated (or commit is chore/test/docs/ci/style exempt)
  • pytest -x passed
  • No secrets in staged diff
  • Specific files staged (not git add -A)
  • Conventional commit message used
  • git log confirms commit

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.