Back/Engineering/Claude
IntermediateEngineering

Automate High-Quality Pull Request Descriptions with a Custom AI Skill

Create a PR skill that explains intent from the coding session, then use a hook to route every agent generated pull request through the same team standard.

Automate High-Quality Pull Request Descriptions with a Custom AI Skill

Brian shows why code summaries make weak PR descriptions, then explains Intercom’s Create PR skill, blocking hook, session context, and measured quality improvement.

Before you start

What you need

  • A coding agent with skills and hooks
  • Your pull request template and quality rubric
  • Access to the current coding session and GitHub CLI

What you’ll make

A pull request whose description explains the problem, intent, approach, validation, and relevant context.

Tools used

Step by step

The workflow

Follow the sequence once, then adapt the prompts, checks, and handoffs to your own setup.

4 steps

Step01

Build a Custom 'Create PR' Skill

Write a Create PR skill around the description your team wants to review. Give it the PR template and tell it to use the whole session for the original request, decisions, tradeoffs, and tests.

Example prompt
Write a pull request description from this coding session. Explain the user or business problem, the intended behavior, the chosen approach, important tradeoffs, validation performed, and any known limitations. Follow this template: [paste template]. Do not merely translate the diff into prose. If the intent is missing, ask one focused question.
Step02

Create a Hook to Intercept PR Creation

Add a hook that detects direct attempts to run gh pr create. Return a clear block message that tells the agent to invoke the Create PR skill with the current session context.

Step03

Enforce the Quality Standard

Make the skill the default path for agent created PRs. Keep the hook narrow so it enforces description quality without interfering with unrelated Git or GitHub commands.

Step04

Execute the Workflow

Run a small real change through the flow. Check that the resulting PR explains why the change exists, follows the template, includes validation, and links any relevant issue before rolling it out broadly.

Example prompt
Add a lobster emoji Rails redirect to chatprd.ai, run the relevant checks, and create a pull request using the Create PR skill.

What good looks like

  • The description explains why the change exists, not only what files changed.
  • The output follows the team template.
  • Direct PR creation is redirected to the skill.
  • A reviewer can understand the change without reading the full coding session.

Build your next product with ChatPRD

Turn an idea into a PRD, user stories, and a plan.

Try ChatPRD free

After the steps

Runbook notes

How to recover when the loop fails and where human judgment helps.

Recover

If it goes sideways

The description only translates the diff into prose
Require the skill to use the original request, decisions, tradeoffs, and validation from the session before summarizing code.
The session lacks enough intent
Have the skill ask one focused question or retrieve the linked issue rather than inventing the rationale.
The agent calls GitHub CLI directly
Block the direct command with a hook and return an instruction to invoke the Create PR skill instead.

Start shipping
better products.

Join 100,000+ product managers who use ChatPRD to write better docs, align teams faster, and build products users love.

Free to start
No credit card
SOC 2 certified
Enterprise ready