commit-and-push-changes
Skill13 starsChanged 7 months agoApache-2.0View on GitHub
Commit and push changes with exclusions and a generated commit message
- Commits and pushes
In this repository8 other files it gives its agents.
- ai-harness-setupSkill
- ai-native-assessmentSkill
- code-reviewSkill
- create-pull-request-with-reviewersSkill
- gh-pr-comment-resolutionSkill
- pr-follow-upSkill
- python-best-practicesSkill
- reflect-on-changesSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 4 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
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
- Distinctive: line 11
Commit all changes except specified files, with an auto-generated or user-provided commit message.
- Very specific: line 24
All files in .cursor/ folders
- Very specific: line 31
If apm install was run during this session and new deployed files appeared, include them in the commit.
- Distinctive: line 41
Do NOT use git add -A or git add .
- Distinctive: line 52
If no Jira key is found, ask the user for the story key.
- Distinctive: line 87
Step 6: After user confirms, create the commit and push:
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 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.
Files
Commit and Push Changes
Commit all changes except specified files, with an auto-generated or user-provided commit message.
Instructions
Step 1: Show the current state of changes:
git status --shortStep 2: Identify files to exclude from the commit.
Always exclude:
- All files in
.cursor/folders - Files modified by external processes (not by us)
APM and OpenSpec deployed content:
Repos using APM or OpenSpec will have deployed content under .github/ (e.g., .github/skills/, .github/prompts/, .github/instructions/, .github/agents/, .github/hooks/) and possibly .claude/. These files should be committed so that every contributor and Copilot on github.com gets agent context without running apm install. Only apm_modules/ should be gitignored.
If apm install was run during this session and new deployed files appeared, include them in the commit. If deployed files appear in git status but were not expected, run apm install to verify they are in sync with apm.yml before committing.
To detect unintended modifications, compare the changed files against the conversation history. If a file appears in git status but was not edited during this session, treat it as potentially unintended. For APM/OpenSpec-managed repos, keep .github/ and .claude/ changes that come from apm install and only exclude .github/ files that are still unexpected after re-running apm install. For non-APM repos, exclude unexpected .github/ files that are clearly out of scope for this task.
Step 3: Stage only the files we intentionally modified:
git add <file1> <file2> ...Do NOT use git add -A or git add . as this will stage unintended files.
Step 4: Generate the commit message.
- Extract the Jira key (try in order until one succeeds):
git branch --show-current | grep -oE '[A-Z]{2,}-[0-9]+'
git log --oneline -10 | grep -oE '[A-Z]{2,}-[0-9]+' | head -1If no Jira key is found, ask the user for the story key. If the user confirms no Jira key is needed, proceed without one.
- Generate the descriptive message based on the work done during this session (from conversation context), not from parsing git diff output.
- Compose the final message in this format:
# With Jira key:
<JIRA-KEY>: <descriptive message>
# Without Jira key (when user confirms none is needed):
<type>: <descriptive message>Where <type> is one of: feat, fix, refactor, docs, chore, test, ci.
Step 5: Present the commit details for confirmation:
📝 Commit Preview
Files to commit:
- file1.py
- file2.py
Excluded files (auto):
- .cursor/* (IDE configuration)
- package-lock.json (not modified by us)
Commit message:
EADL-1234: Add retry logic with exponential backoff
Proceed with commit? [Y/n]Step 6: After user confirms, create the commit and push:
git commit -m "<COMMIT_MESSAGE>"
git pushStep 7: Show the result:
git log -1 --onelineDoes 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
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.

