cp — Claude Code command for commits and installation
The cp command reviews the current branch, creates a commit, pushes it to origin, and runs remote checks before a pull request.
MIT ★ 907 updated 2025-11-12
.claude/commands/cp.mdWhat cp does
The command starts with /review, then stages selected changes with git add. It uses a Conventional Commit message and .github/commit-template.txt, whose required blocks are Context, Testing, and Reviewers. Leave generated files and secrets out of the staged changes, and do not add AI attribution to the commit.
Next, cp commits and pushes the current branch to origin. It starts ci-commit-branch-guard.yml and ci-quality-gate.yml with gh workflow run, then waits using gh run watch --workflow ci-quality-gate.yml. If commitlint rejects the message, revise it and retry the commit. Open the pull request after both workflows finish.
What it helps with
- Run a review before committing
- Format a commit message with the project template
- Push the current branch to origin
- Start remote checks before opening a pull request
Example prompts for the agent
- Run
/cpto prepare the current branch for a pull request. - Review the changes, commit using
.github/commit-template.txt, and start the remote checks.
How to install cp
Manually: put the files in place
.claude/commands/cp.mdCall it with /cp. For all projects use ~/.claude/commands/
Manually: put the files in place
~/.codex/prompts/cp.mdCall it with /prompts:cp. Codex marks this format deprecated in favour of skills
Manually: put the files in place
.github/prompts/cp.prompt.mdManually: put the files in place
.gemini/commands/cp.tomlGemini stores commands as TOML: the prompt text goes into the prompt field
Questions about cp
How do I install cp in Claude Code?
Save the command file as .claude/commands/cp.md in the project.
What does cp do?
It reviews changes, creates a commit, pushes the current branch to origin, and starts remote workflow checks.
What happens if commitlint rejects the commit message?
Edit the message and retry git commit.
Source text
cp.md · MIT
--- description: Stage, commit, and push the current branch following git governance rules. --- 1. Run `/review` to ensure lint/tests/security checks pass locally. 2. Review and stage changes with `git add` (avoid staging generated or secret files). 3. Craft a Conventional Commit message (types: feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert). - Use `.github/commit-template.txt` and include Context / Testing / Reviewers blocks. - Never add AI attribution strings to commits. 4. Commit with `git commit` using the prepared message. If commitlint fails, fix the message and retry. 5. Push to origin: `git push origin $(git branch --show-current)`. 6. Trigger remote checks for visibility: - `gh workflow run ci-commit-branch-guard.yml --ref $(git branch --show-current)` - `gh workflow run ci-quality-gate.yml --ref $(git branch --show-current)` 7. Wait for both workflows to finish (`gh run watch --workflow ci-quality-gate.yml`) before opening a pull request.
© alirezarezvani · MIT · alirezarezvani/claude-code-skill-factory