agentleFS
abdullahkhawerabdullahkhawer/devops-skills/skills/commit-code/SKILL.md

commit-code

Skill8 starsChanged 6 months agoApache-2.0View on GitHub

Analyze code changes to prepare conventional commit message and commit to a new branch.

  • Reads credentials
  • Commits and pushes

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈8

    Distinctive · estimate

    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:

    Run this skill when asked to commit code changes, create a commit message, or push changes to a new branch.

    line 8
  2. Distinctive:

    Ask the user the following question:

    line 12
  3. Distinctive:

    If the user has already provided the answer upfront, skip the question and use the provided value.

    line 20
  4. Distinctive:

    If the command fails, try again only one more time.

    line 38
  5. Very specific:

    Before proceeding, list the staged files and check for potentially sensitive files (e.g.

    line 56
  6. Distinctive:

    If any staged file matches a sensitive pattern, pause and ask the user to confirm whether it should be included in the commit.

    line 62
  7. Distinctive:

    Must be descriptive and mention all relevant changes.

    line 79
  8. Very specific:

    NEVER include a scope — do NOT use <TYPE>(scope): ...

    line 81
  9. Distinctive:

    NEVER commit to main or master directly — always create a new branch.

    line 112
  10. Very specific:

    If pre-commit run -a fails, try again only one more time.

    line 113
  11. Distinctive:

    If the working directory has no staged or unstaged changes, report this and stop.

    line 115

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “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

Commit Code Skill

Run this skill when asked to commit code changes, create a commit message, or push changes to a new branch.

Step 1 — Collect input

Ask the user the following question:

Kindly let me know:

1. Branch Name: What should I name the new branch? (name of the branch)

If the user has already provided the answer upfront, skip the question and use the provided value.


Step 2 — Create a new branch

git checkout -b <BRANCH_NAME>

Step 3 — Run pre-commit checks (if .pre-commit-config.yaml exists)

pre-commit run -a

If the command fails, try again only one more time. If it fails again, report the output to the user and stop. Do not continue until the user resolves any failures.


Step 4 — Run Terraform formatting (if Terraform files exist)

terraform fmt -recursive

Step 5 — Stage all changes, analyze them and commit

git add .

Before proceeding, list the staged files and check for potentially sensitive files (e.g. .env, *.pem, *.key, *credentials*, *secret*, *token*, *password*):

git diff --cached --name-only

If any staged file matches a sensitive pattern, pause and ask the user to confirm whether it should be included in the commit. Do not proceed until confirmed.

And then analyze the code changes in each staged file with the following command:

git diff --cached -- <FILE_PATH>

Then based on all the code changes, determine the appropriate conventional commit type, compose a single one-liner commit message, and commit the changes with the following command:

git commit -m "<TYPE>: <COMMIT_MESSAGE>"

Commit message rules

  • Single line only — no multi-line messages.
  • Must be descriptive and mention all relevant changes.
  • First letter of <COMMIT_MESSAGE> must be capitalized.
  • NEVER include a scope — do NOT use <TYPE>(scope): ... format, even if a Jira ticket or branch name is provided.
  • Examples: fix: Fix memory leak in runner cleanup, feat: Add retry logic for failed jobs, feat!: Drop support for Node 16
  • Reference: https://www.conventionalcommits.org/en/v1.0.0/

Conventional commit types

TypeWhen to use
featA new feature
fixA bug fix
docsDocumentation only changes
styleFormatting changes that do not affect code meaning
refactorCode change that neither fixes a bug nor adds a feature
perfCode change that improves performance
testAdding or correcting tests
choreBuild process or auxiliary tool changes
ciChanges to CI configuration files and scripts
buildChanges that affect the build system or external dependencies

Step 6 — Push the new branch

git push origin $(git rev-parse --abbrev-ref HEAD) --set-upstream

Rules

  • NEVER commit to main or master directly — always create a new branch.
  • If pre-commit run -a fails, try again only one more time. If it fails again, stop and report the errors before proceeding.
  • The commit message must be a single line — never use \n or multi-line -m flags.
  • If the working directory has no staged or unstaged changes, report this and stop.

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.