# Commit and PR Writer

> Enforce atomic commits and reviewer-first PRs using git diff analysis and automated linting.

Commit and PR Writer is a free AI agent skill on Agensi by Bandonker Labs., in Code Quality & Review. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [Bandonker Labs.](https://www.agensi.io/creators/bandonkerlabs)
- Category: [Code Quality & Review](https://www.agensi.io/skills/code-quality-review)
- Uses: 3
- Version: 1.0
- Last updated: 2026-10-16
- Security: scan passed (2026-10-16); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/commit-and-pr-writer
- Tags: code-review, git, python, documentation, workflow-automation

## About this skill

Reviewers often read the commit message and PR body before the diff, yet these are typically written in a hurry from memory. This leads to vague descriptions like "fix stuff" and unrelated changes being crammed into single commits, making code reviews difficult and rollbacks impossible. This skill enforces a disciplined git workflow that prioritizes the reviewer's needs and ensures every change is documented with technical precision.

### What it does
- **Diff analysis** extracts file counts, insertions, deletions, and structural changes directly from git before writing begins.
- **Concern splitting** analyzes staged paths by area to suggest separate commits for unrelated changes, ensuring clean history.
- **Message drafting** generates imperative subjects under 72 characters and structured bodies covering the "why," impact, and verification.
- **Automated linting** validates messages for length, mood, vagueness, and mandatory verification commands to prevent low-quality logs.
- **PR assembly** builds reviewer-first pull request bodies including risk assessments, rollback plans, and grouped commit summaries.

### How it works
1. **Analyze:** Run `facts` to get a data-driven report of what actually changed in the staged files or commit range.
2. **Organize:** Use `split` to group changes by logical area and generate the specific `git add` commands needed for atomic commits.
3. **Draft:** Execute `draft` to produce a subject line and body scaffold based on the largest functional changes detected.
4. **Validate:** Pipe the written message through `lint` to check for vagueness, missing verification commands, or subject line errors.

### Frameworks & tools
The core logic is contained in a Python script using the standard library. It interacts directly with `git` CLI via subcommands like `facts`, `split`, `draft`, `pr`, and `lint`. It requires no external dependencies or network access.

### Why this beats prompting it yourself
Generic AI prompts often guess what changed based on filenames alone and produce "hallucinated" summaries of the logic. This skill uses a Python-backed analysis of the actual git diff to ground every claim in data, ensuring the "Verified" and "Risk" sections reflect real code impact rather than polite filler.

### Use cases
- Splitting a large, messy "work in progress" stash into a clean series of atomic commits.
- Generating a professional PR description for a complex branch with multiple contributors.
- Enforcing commit message standards across a team to ensure "fix stuff" never hits the main branch.
- Validating that every commit includes a repeatable verification command and output log.

### Known limitations
It requires a local git environment and Python 3. The `lint` command needs access to the repository to validate diff-related claims; without it, only basic subject and body formatting checks are performed.

## Requires

- Python
- Git

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Commit and PR Writer skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### How does this skill improve my existing git workflow?

This skill solves the 'fix stuff' problem by analyzing your actual git diffs to generate atomic commits and structured PRs, making code reviews faster and rollbacks easier. It acts as a bridge between your code changes and your documentation, ensuring every commit message is data-driven and technically precise.

### Does my code need to be sent to an external API for the diff analysis to work?

No, this skill is designed for maximum security and privacy; it runs entirely on your local machine using a Python-based analysis engine. It does not require an internet connection or send your proprietary source code to external servers to generate descriptions.

### What are the technical requirements for running this skill?

The skill requires a local Git environment and Python 3. It is designed to be compatible with any AI agent that supports local script execution and terminal interaction.

### What exactly is included in the purchase?

You receive the core Python-backed git utility, a suite of specialized commands (facts, split, draft, lint, pr), and clear documentation on integrating it with your AI agent's environment.

### Can this skill handle large, complex diffs that span multiple architectural layers?

While it can draft messages for any size change, its 'split' command is specifically designed to identify unrelated changes in large stashes and suggest how to break them into smaller, atomic commits.

### How does the automated linting prevent low-quality commit messages?

The 'lint' feature acts as an automated quality gate, scanning drafts for imperative mood, vagueness, and mandatory verification sections before you ever push to a remote repository.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
