cp

Commits staged and unstaged changes in Karma style and pushes to the tracked remote.

Updated Dec 25, 2021
One-click install
npx skills add https://github.com/kotahashihama/dotfiles --skill cp-kotahashihama
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cp
Source: https://github.com/kotahashihama/dotfiles/tree/main/home/.claude/skills/cp
Command: npx skills add https://github.com/kotahashihama/dotfiles --skill cp-kotahashihama

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Manually reviewing diffs, drafting consistent commit messages, staging files selectively, and pushing to a remote is repetitive and error-prone. This Skill automates the full commit-and-push cycle in one command while enforcing a consistent Karma-style message format and safety guardrails. ## Core Features & Use Cases - Automated commit and push: Inspects git status, diffs, and recent log history, drafts a Karma-style message (type(scope): subject with Japanese noun-ending subjects), stages files by explicit path, commits via HEREDOC, and pushes to the tracked remote. - Safety guardrails: Refuses empty commits, warns on secret-like files (.env, credentials, private keys), never uses git add -A, --amend, or force-push, and blocks direct pushes to main/master. - Pre-commit hook handling: When hooks fail, it diagnoses the cause, fixes, restages, and creates a new commit. When hooks are slow, it reads the hook contents, runs the equivalent checks itself, and only then uses --no-verify, reporting what was verified. - Use Case: After finishing a feature edit, invoke the skill and it reviews your working tree, writes a properly formatted commit message, commits only the intended files, pushes the branch, and lists each pushed commit by hash and subject. ## Quick Start Ask the assistant to commit and push the current changes, for example by saying "commit and push my changes" or invoking /cp.

Frequently Asked Questions about cp

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I commit and push git changes in one step?

Invoke this skill with a commit-and-push request and it inspects git status and diffs, drafts a Karma-style commit message, stages files by explicit path, commits, and pushes to the tracked remote. No confirmation prompts are required once invoked.

What commit message format does the Karma style use?

The first line follows the form type(scope): subject, with the type and scope in lowercase English and the subject as a Japanese noun-ending phrase without trailing punctuation, around 50 characters. An optional body explains the intent of the diff, followed by a generator trailer.

Can it push directly to the main or master branch?

No, direct pushes to main or master are prohibited. It also never uses --force or --force-with-lease; if a push is rejected, it reports the cause and asks the user how to proceed.

What happens when a pre-commit hook fails?

A failed hook means no commit was created, so it reads the error, fixes the cause, restages the files, and creates a new commit rather than amending. If retries do not resolve it, the error is summarized and reported to the user.

When is it acceptable to skip git hooks with --no-verify?

Only after reading the hook contents to see what it checks, running those same checks manually, and confirming they pass. The skipped hook and the substitute verification performed must be included in the completion report.

Does it stage all changes automatically with git add -A?

No, bulk staging with git add -A or git add . is forbidden. It stages files by explicitly naming each path, respecting any already-staged changes, and warns before committing files that look like secrets or credentials.