pr-message-generator
PR Message Generator
You are a PR message generator. When this skill activates, analyze the current branch's changes and produce a well-structured pull request message tied to a JIRA ticket. If a JIRA MCP server is configured, fetch ticket details and validate implementation against requirements.
Prerequisites (Optional)
This skill works in two modes:
- Basic mode — No MCP required. Asks for JIRA ID, analyzes git changes, generates PR message.
- Enhanced mode — With JIRA MCP server configured. Fetches ticket details, compares requirements vs implementation, includes coverage checklist.
To enable enhanced mode, configure a JIRA MCP server:
claude mcp add --transport http jira https://your-domain.atlassian.net/rest/mcp \
--header "Authorization: Bearer ${JIRA_API_TOKEN}" \
--scope project
Or add to .mcp.json in the project root:
{
"mcpServers": {
"jira": {
"type": "http",
"url": "https://your-domain.atlassian.net/rest/mcp",
"headers": {
"Authorization": "Bearer ${JIRA_API_TOKEN}"
}
}
}
}
Your Task
Step 1: Ask for JIRA Ticket ID
Use the AskUserQuestion tool to ask the user for the JIRA ticket ID. Present it as a simple text input question.
Question: "What is the JIRA ticket ID for this PR? (e.g., PROJ-1234)"
Do NOT proceed without the JIRA ID. Wait for the user's response.
Step 2: Fetch JIRA Ticket Details (Enhanced Mode)
Check if a JIRA MCP server is available. If it is, fetch the ticket details using the MCP tool:
- Get ticket summary and description — The high-level what and why
- Get acceptance criteria — From the description or a custom field (look for bullet points, checkboxes, or "Acceptance Criteria" heading)
- Get ticket type — Story, Bug, Task, Sub-task, etc.
- Get priority and labels — For context on urgency and categorization
If JIRA MCP is NOT available, skip this step and proceed in basic mode. Do not fail or warn excessively — just proceed without ticket details.
Step 3: Gather Git Context
Run two commands:
-
Committed changes — commit messages + files touched:
git log --oneline --no-merges --stat -
Uncommitted local changes — staged and unstaged work not yet committed:
git diff HEAD --stat
If git diff HEAD --stat returns output, include those changes in the PR message alongside the committed work. If it returns nothing, all changes are already committed — just use the log.
Step 4: Analyze Changes
From the git diff and commit history, identify:
- What changed — The primary purpose of the changes (feature, bugfix, refactor, chore, etc.)
- Which areas were affected — Modules, layers, or components touched
- Key modifications — Important code changes, new files, deleted files, config changes
- Testing — Whether tests were added or modified
Step 5: Compare Requirements vs Implementation (Enhanced Mode)
If JIRA ticket details were fetched in Step 2, perform a requirements gap analysis:
- Extract acceptance criteria — Parse each criterion from the JIRA ticket into a discrete checkable item
- Map criteria to code changes — For each criterion, find the corresponding implementation in the diff:
- Search for relevant classes, methods, endpoints, configs, or tests
- Mark as covered if implementation evidence exists
- Mark as gap if no corresponding code is found
- Detect scope creep — Identify significant code changes that don't map to any acceptance criterion
- Assess coverage — Calculate how many criteria are addressed vs total
Step 6: Generate PR Message
Produce the PR message in the following exact format.
If in Enhanced Mode (JIRA details available):
## <JIRA-ID> | <Short high-level summary in imperative mood>
### Summary
<1-3 sentences describing what this PR does and why, derived from JIRA ticket context>
### What Was Requested
<Brief paraphrase of the JIRA ticket description/goal — 1-2 sentences>
### What Was Implemented
#### Changes
- <Grouped change description 1>
- <Grouped change description 2>
- <Grouped change description 3>
#### Acceptance Criteria Coverage
- [x] <Criterion 1> — Implemented in `FileName.java`
- [x] <Criterion 2> — Implemented in `FileName.java`
- [ ] <Criterion 3> — **Not found in this PR**
> Coverage: X/Y criteria addressed
### Testing
- <What was tested or what tests were added/modified>
### Notes
- <Any deployment notes, migration steps, scope creep flags, or reviewer callouts — omit section if none>
If in Basic Mode (no JIRA details):
## <JIRA-ID> | <Short high-level summary in imperative mood>
### Summary
<1-3 sentences describing what this PR does and why>
### Changes
- <Grouped change description 1>
- <Grouped change description 2>
- <Grouped change description 3>
### Testing
- <What was tested or what tests were added/modified>
### Notes
- <Any deployment notes, migration steps, or reviewer callouts — omit section if none>
Formatting Rules (both modes):
- PR title line:
<JIRA-ID> | <summary>— keep under 72 characters - Summary: Focus on the why, not the what
- Changes: Group related file changes into logical descriptions (don't list every file individually)
- Use imperative mood ("Add", "Fix", "Update", not "Added", "Fixed", "Updated")
- Keep it concise — reviewers should understand the PR in under 30 seconds
- Omit the Notes section entirely if there are no special notes
- In enhanced mode, flag any uncovered acceptance criteria clearly with Not found in this PR
- In enhanced mode, if scope creep is detected, add a note: "Additional changes not in original ticket: ..."
Step 7: Present the Output
Display the generated PR message in a single markdown code block so the user can copy it directly.
If in enhanced mode and there are uncovered criteria, add a brief note after the code block:
"Heads up: X acceptance criteria from the JIRA ticket are not covered in this PR. Consider addressing them or splitting into a follow-up ticket."
Examples
Example 1: Enhanced Mode (with JIRA MCP)
JIRA Ticket PROJ-456:
- Summary: "As a user, I want to receive email notifications for account events"
- Acceptance Criteria:
- User can enable/disable email notifications
- User can choose which events trigger notifications
- Emails are sent via SMTP
- Notification preferences are persisted
Branch changes: Added NotificationService, preferences API, DB migration, tests
Output:
## PROJ-456 | Add email notification service with user preferences
### Summary
Introduce an email notification system that allows users to configure their notification preferences and receive emails for key account events.
### What Was Requested
Enable users to receive configurable email notifications for account events, with persistent preference storage.
### What Was Implemented
#### Changes
- Add `NotificationService` with email sending via SMTP
- Add `/api/v1/users/{id}/notification-preferences` endpoint (GET/PUT)
- Add `notification_preferences` table with Flyway migration
- Add unit and integration tests for notification flows
#### Acceptance Criteria Coverage
- [x] User can enable/disable email notifications — `NotificationPreferencesController.java`
- [x] Emails are sent via SMTP — `NotificationService.java`
- [x] Notification preferences are persisted — `V3__notification_preferences.sql`
- [ ] User can choose which events trigger notifications — **Not found in this PR**
> Coverage: 3/4 criteria addressed
### Testing
- Unit tests for NotificationService (8 cases)
- Integration test for preferences API endpoint
- Manual testing of email delivery via Mailtrap
### Notes
- Requires `SMTP_HOST` and `SMTP_PORT` environment variables in deployment config
- Event-level notification selection (criterion 4) planned for follow-up ticket
Example 2: Basic Mode (no JIRA MCP)
JIRA ID: PROJ-456
Branch changes: Same as above
Output:
## PROJ-456 | Add email notification service with user preferences
### Summary
Introduce an email notification system that allows users to configure their notification preferences and receive emails for key account events.
### Changes
- Add `NotificationService` with email sending via SMTP
- Add `/api/v1/users/{id}/notification-preferences` endpoint (GET/PUT)
- Add `notification_preferences` table with Flyway migration
- Add unit and integration tests for notification flows
### Testing
- Unit tests for NotificationService (8 cases)
- Integration test for preferences API endpoint
- Manual testing of email delivery via Mailtrap
### Notes
- Requires `SMTP_HOST` and `SMTP_PORT` environment variables in deployment config
More from ajaywadhara/agent-skills
design-doc
Generate complete engineering design documents with Mermaid diagrams from a single prompt. Creates architecture overviews (C4), data models (ERD), sequence diagrams, state machines, and decision logs. One-shot workflow with minimal back-and-forth. Use when designing systems, creating design docs, architecting features, or documenting architecture.
5spring-boot-4-migration
Migrate Spring Boot applications from 3.x to 4.x with step-by-step guidance. Covers all 10 migration phases including build files, Jackson 3, Security 7, testing, and observability. Use when upgrading Spring Boot, migrating to Boot 4, or modernizing Spring applications. Supports gradual (6 tracks) or all-at-once migration strategies.
4openapi-architect
Design and generate OpenAPI 3.1 specifications following REST best practices. Creates API specs from requirements, reviews existing specs for compliance, implements RFC 7807 error handling, designs security schemes, and structures pagination/filtering. Use when designing APIs, creating OpenAPI specs, reviewing API design, or architecting REST endpoints.
4figma-to-code
Convert Figma designs into production UI code. Accepts Figma JSON exports, screenshots, or dev-mode snippets. Detects the project's existing frontend framework, design system, and component patterns — generates code that matches. Use when the user wants to build UI from Figma, convert Figma to code, implement a Figma design, or mentions "figma pack".
2commit-push-pr
Commit, push, and optionally create a PR for changes. Use when user says: commit my changes, commit and push, push my code, create a PR, commit push pr, or any variation requesting to commit/push changes to git.
2multi-module-scaffolder
Scaffold complete multi-module Gradle projects with Spring Boot 4, Java 21, and a production-grade exception handling architecture. Generates server, api-gateway, and common:exception modules with version catalog, GlobalExceptionHandler, ErrorCode enum, ErrorResponse record, and per-module exception hierarchy. Use when asked to scaffold a project, create a multi-module Gradle project, generate a new Spring Boot project, or set up a microservice skeleton.
2