cp
Skill2 starsChanged 4 months agoMITView on GitHub
This skill should be used when the user asks to "commit and push", "cp", "commit push", "ship it", "push my changes", or wants to commit and push while respecting the project's CLAUDE.md (or AGENTS.md) commit requirements. Also triggered by the /cp command.
- Commits and pushes
In this repository20 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- auto-merge-dependabotSkill
- best-ofSkill
- codestorySkill
- codex-2nd-opinionSkill
- extract-design-systemSkill
- investigateSkill
- is-skillSkill
- pm-autofix-prSkill
- pm-crSkill
- pm-deepenSkill
- pm-planSkill
- pm-riskSkill
- pm-simplifySkill
- pm-triageSkill
- rebase-prSkill
- review-offlineSkill
- upscaleSkill
- vibeSkill
- wigoSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
14 rules. About 0 are common, 10 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈10
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 9
Commit and push changes to the current branch, running only the pre-commit checks described in the project's CLAUDE.md (or AGENTS.md).
- Very specific: line 20
Test commands (e.g. npm test, pytest, cargo test)
- Distinctive: line 22
Commit message conventions (e.g.
- Very specific: line 30
If the branch already exists locally: git switch <branch-name>
- Very specific: line 31
If it needs to be created: git switch -c <branch-name>
- Distinctive: line 33
If the current branch is neither main/master nor detached HEAD, use it as-is without switching.
- Distinctive: line 39
If a formatter modifies files, stage the changes with git add on those files.
- Distinctive: line 40
If any check fails, report the failure to the user and stop.
- Distinctive: line 42
If no requirements were found in CLAUDE.md (or AGENTS.md), skip this step entirely.
- Distinctive: line 46
Run git status and git diff --stat to review what will be committed.
- Distinctive: line 48
Write a concise commit message that summarizes the why of the changes.
- Distinctive: line 56
Run git status after committing to verify success.
- Very specific: line 60
Check whether the branch already has an upstream configured by running git rev-parse --abbrev-ref <branch-name>@{upstream}.
- Distinctive: line 69
If the push fails due to a network error, retry up to 4 times with exponential backoff (2s, 4s, 8s, 16s).
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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 & Push
Commit and push changes to the current branch, running only the pre-commit checks described in the project's CLAUDE.md (or AGENTS.md). Does not invent extra steps — if the project specifies no requirements, skip straight to commit and push.
Workflow
Step 1: Read the project's CLAUDE.md
First determine the Git repository root by running git rev-parse --show-toplevel. Then look for a CLAUDE.md (or AGENTS.md) starting from the working directory and walking up through its ancestor directories, but stop once you reach that repo root and do not search beyond it. Use the nearest file found; if both CLAUDE.md and AGENTS.md exist in the same directory, prefer CLAUDE.md. Read the file and extract any commit-related requirements such as:
- Formatting commands (e.g.
prettier,black,gofmt) - Linting commands (e.g.
eslint,ruff,clippy) - Type-checking commands (e.g.
tsc --noEmit,mypy) - Test commands (e.g.
npm test,pytest,cargo test) - Build commands (e.g.
npm run build,cargo build) - Commit message conventions (e.g. conventional commits, prefix rules)
Only extract requirements that are explicitly stated. If CLAUDE.md says nothing about pre-commit checks, do not run any.
Step 2: Determine the branch
Run git branch --show-current to get the current branch name. If the result is empty (detached HEAD) or is main/master, ask the user which branch to push to before proceeding — this is a safety guard to avoid accidental commits directly to main/master. Once the target branch is determined, switch to it:
- If the branch already exists locally:
git switch <branch-name> - If it needs to be created:
git switch -c <branch-name>
If the current branch is neither main/master nor detached HEAD, use it as-is without switching.
Step 3: Run pre-commit checks
For each requirement found in Step 1, run the corresponding command via Bash. Execute them in a logical order: format → lint → type-check → test → build.
- If a formatter modifies files, stage the changes with
git addon those files. - If any check fails, report the failure to the user and stop. Do not commit broken code.
If no requirements were found in CLAUDE.md (or AGENTS.md), skip this step entirely.
Step 4: Stage and commit
- Run
git statusandgit diff --statto review what will be committed. - Stage the relevant changed files (prefer explicit file names over
git add -A). - Write a concise commit message that summarizes the why of the changes. Follow any commit message conventions found in CLAUDE.md. Use a HEREDOC to pass the message:
git commit -F - <<'EOF'
<commit message here>
EOF- Run
git statusafter committing to verify success.
Step 5: Push
Check whether the branch already has an upstream configured by running git rev-parse --abbrev-ref <branch-name>@{upstream}.
- Upstream exists: simply run
git push(no flags needed — git uses the existing tracking config). - No upstream: determine the remote via
git config --get branch.<branch-name>.remote, falling back toorigin, then run:
git push -u <remote> <branch-name>If the push fails due to a network error, retry up to 4 times with exponential backoff (2s, 4s, 8s, 16s). If it fails for other reasons (e.g. rejected), report the error and stop.
Step 6: Report
Tell the user:
- What checks were run (if any) and their results.
- The commit hash and message.
- The branch that was pushed to.
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
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.

