cp

Read CLAUDE.md or AGENTS.md to run pre-commit checks and push safely.

2|Updated Mar 18, 2026
One-click install
npx skills add https://github.com/pmatos/skills --skill cp-pmatos
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cp
Source: https://github.com/pmatos/skills/tree/main/cp
Command: npx skills add https://github.com/pmatos/skills --skill cp-pmatos

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Automates safe commits and pushes by respecting a project's CLAUDE.md (or AGENTS.md) requirements, avoiding accidental pushes to protected branches and ensuring pre-commit checks are executed.

Core Features & Use Cases

  • Detects the repository root and locates the nearest CLAUDE.md/AGENTS.md to extract required checks (formatting, linting, type-checking, tests, builds) before committing.
  • Determines the appropriate branch behavior (switch or create) and prevents commits to main/master without explicit instruction.
  • Executes pre-commit steps in a logical order (format → lint → type-check → test → build), stages only relevant changes, and commits with a descriptive message, then pushes with upstream tracking.

Quick Start

Tell the assistant to commit and push changes in the current branch while honoring the repository's CLAUDE.md or AGENTS.md requirements.

Frequently Asked Questions about cp

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

FAQPage Schema
How do I automate git commits while enforcing pre-commit checks defined in my project?

You can automate git commits by reading the nearest CLAUDE.md or AGENTS.md file to extract required pre-commit checks like formatting, linting, type-checking, tests, and builds. The process executes these checks in a logical order before staging relevant changes and committing with a descriptive message.

What is the safest way to push git changes without accidentally committing to the main branch?

Safe pushing involves detecting the repository root and enforcing branch safety to prevent accidental commits to main or master unless explicitly instructed. The mechanism switches or creates an appropriate branch, commits changes, and pushes with upstream tracking enabled.

Can I run linting and type-checking before committing using rules from CLAUDE.md?

Yes, you can run linting, type-checking, formatting, tests, and builds before committing. The system locates the nearest CLAUDE.md or AGENTS.md file, extracts the specified requirements, and executes the ordered pre-commit checks prior to staging and committing changes.

How do I configure git push to automatically track upstream branches?

To push with upstream tracking, the system determines the appropriate branch behavior by switching or creating a branch, stages only relevant changes, commits with a descriptive message, and pushes while automatically setting upstream tracking for the remote branch.

What happens if my pre-commit tests fail during an automated git commit?

When pre-commit tests fail during an automated git commit, the ordered execution chain stops. The process runs formatting, linting, type-checking, testing, and building sequentially, ensuring that failures halt the commit before staging occurs.

Do I need an existing AGENTS.md or CLAUDE.md file to use automated safe commits?

You need an existing CLAUDE.md or AGENTS.md file to extract project-specific commit requirements like formatting, linting, type-checking, tests, and builds. The system searches for the nearest configuration file to apply these rules during the commit and push workflow.