kramme-cc-workflow/skills/kramme:pr:generate-description/SKILL.md
Write a structured PR title and body from git diff, commit log, and Linear context. Outputs markdown for copy-paste or, when explicitly invoked with --auto, updates an existing PR.
npx skillsauth add abildtoft/kramme-cc-workflow kramme:pr:generate-descriptionInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Parse $ARGUMENTS for flags:
--auto: Preferred hands-off mode for explicit user invocation. Skip clarification prompts (Phase 2.5) and the save-to-file prompt (Phase 4). If a PR already exists for the current branch, update its title/body directly. If no PR exists yet, generate the title and description for copy-paste without pausing for user input.--no-update: Output-only automation mode for orchestrators that need generated title/body content but must not mutate an existing PR. Valid with --auto; it skips prompts but keeps DIRECT_UPDATE=false even if gh pr view finds a PR.--visual: Delegate demo evidence capture to kramme:visual:demo-reel and include the resulting Screenshots/Videos section when local or embeddable evidence is available. If capture cannot run, continue with the placeholder Screenshots/Videos section.--base <ref>: Use <ref> as the base branch for diff computation instead of auto-detecting.--linear-issue <ISSUE-ID>: Use a caller-validated Linear identifier as the authoritative issue context. Validate [A-Za-z0-9]+-[0-9]+, normalize it to uppercase, and do not replace it with a branch-name substring.If --auto is present, set AUTO_MODE=true and NON_INTERACTIVE=true, and remove the flag from remaining arguments. If --no-update is present, set OUTPUT_ONLY=true and remove the flag from remaining arguments. If --visual is present, set VISUAL_MODE=true and remove the flag from remaining arguments. If --base <ref> is present, set BASE_BRANCH_OVERRIDE=<ref> and remove the flag and value from remaining arguments. If --linear-issue <ISSUE-ID> is present, set LINEAR_ISSUE_OVERRIDE to the validated normalized value and remove the flag and value. Reject a missing or invalid value before Phase 1.
When another skill invokes this one as an orchestration step, it must pass --auto (and should pass --base <ref> when it already resolved the base branch). If the caller already validated a Linear issue, it should pass --linear-issue <ISSUE-ID> so this skill does not depend on lossy branch-name extraction. If the caller only needs generated title/body content and owns the eventual publish gate, it must also pass --no-update. In --auto mode, Phase 2.5 clarification prompts and the Phase 4 save-to-file prompt are skipped. Missing context is surfaced as MISSING REQUIREMENT: output instead of prompting mid-orchestration; blocking missing requirements disable direct PR updates and produce copy-paste output.
Use this skill when:
When NOT to use this skill:
High-quality PR descriptions are essential for:
This skill automates the process of gathering context from multiple sources (git history, Linear issues, code changes) and generating a structured, focused description following best practices for Pull Requests.
Read the guideline keyword glossary from references/guideline-keywords.md.
Read references/base-branch-resolution.md and follow it to confirm the current branch and compute BASE_BRANCH.
If AUTO_MODE=true and OUTPUT_ONLY is not true, check whether a PR exists for the current branch:
gh pr view --json number,url
If a PR exists, set DIRECT_UPDATE=true and capture the PR URL for Phase 4.
If no PR exists, continue in generated-output mode:
NON_INTERACTIVE=true if auto mode is enabledDIRECT_UPDATE=falseIf OUTPUT_ONLY=true, skip the PR existence check for direct-update purposes, leave DIRECT_UPDATE=false, and continue in generated-output mode. The caller is responsible for any later PR creation or update.
Read the context-gathering procedure from references/context-gathering.md and apply every step in that document before continuing. It covers:
origin/$BASE_BRANCH, file categorization, optional GitHub tool use.Skip this phase entirely if NON_INTERACTIVE=true. Proceed directly to Phase 3.
ALWAYS pause after gathering context and before generating the description:
Present initial analysis:
Ask clarification questions:
Example clarification prompt:
I've analyzed the changes and identified this as a [type] that [brief summary].
Key decisions I found:
- [Decision 1]
- [Decision 2]
Divergences from Linear issue (if any):
- [Divergence 1 and why]
- [Divergence 2 and why]
Before generating the description:
- Is there anything specific you'd like me to emphasize or explain in detail?
- Are there any concerns, limitations, or trade-offs reviewers should be aware of?
- Should I highlight any particular aspects of the implementation?
- Should I explain any divergences from the original Linear issue in more detail?
Wait for user response before proceeding to Phase 3
Skip this phase if VISUAL_MODE is not set. Proceed directly to Phase 3.
If VISUAL_MODE=true, read references/visual-capture.md and follow Phase 2.6 in that document. This prepares the target summary for kramme:visual:demo-reel; it does not duplicate browser capture or dev-server heuristics inside this PR-description skill.
Before drafting, evaluate whether any MISSING REQUIREMENT conditions hold (see the Output markers section below). Emit a MISSING REQUIREMENT: … line in the skill's conversation output whenever:
Surface the marker even when NON_INTERACTIVE=true; in that mode, report the gap in the run output so the caller can collect the missing context before publication.
If any blocking missing requirement is present, set DIRECT_UPDATE=false even when --auto found an existing PR. Generate copy-paste output that names the missing context, and leave publication to the caller or user after they provide it. Do not publish a PR body that invents migration rationale, rollback plans, or rollout context.
(Phase 1 already aborts hard when the base branch cannot be resolved, so there is no Phase 3 trigger for that case.)
ALWAYS generate a structured PR title and description after that check.
Generate a PR title using Conventional Commits format: <type>(<scope>): <description>
Types (based on Phase 2.4 analysis):
| feat | fix | refactor | docs | test | build/ci | chore | perf | style | revert |
Rules:
auth, platform-picker). Omit if changes span multiple areas.Examples: feat(auth): add OAuth2 support · fix: resolve null pointer in user lookup · refactor(api): extract validation utilities
If Phase 2 found a GitHub PR template, treat it as the body structure contract before applying default section templates.
assets/section-templates.md.ALWAYS include:
What changed (1-2 sentences, high-level, user/business-focused)
Why it changed (1-2 sentences, business context)
Link to Linear issue (if available):
Fixes, Closes, Resolves (marks issue as done when PR merges)Related to, Refs, References (links without auto-closing)Format options:
Fixes ABC-123
or
Closes https://linear.app/your-workspace/issue/ABC-123/title
or (for related but not closing):
Related to ABC-123
Fixes or Closes when the PR completes the work for the issueRelated to when the PR is partial work or tangentially relatedRead the section templates and worked examples from assets/section-templates.md. It covers Summary, Technical Details (implementation approach, scope changes, optional area notes, reviewer landmarks), Test Plan, and Breaking Changes — each with structural guidance and a complete example.
When drafting the Test Plan, apply the Test Plan section in assets/section-templates.md and the Test Plans rules in references/best-practices.md.
Before drafting the body, decide what the PR description adds beyond GitHub's review UI.
ALWAYS include context GitHub cannot infer from the diff browser:
NEVER include description content whose main value is already provided by GitHub:
git diff --stat summariesnode_modules, unavailable Postgres, missing services, or other reasons a command could not run on the agent machine; CI is the source of truth for build, lint, typecheck, formatting, and automated test statusIf a section would merely prove that files changed, omit it or replace it with one or two review-relevant notes that explain behavior, coupling, risk, or review order.
When the diff changes a versioned artifact surface or durable public contract, make the release story explicit in the PR body:
patch, minor, or major) and explain breaking-change rationale when applicable.If there is no versioned artifact or durable public contract change, say so briefly only when reviewers might otherwise infer a release impact.
Build the Change Summary block from assets/section-templates.md and enforce the Change Summary Block rules in references/best-practices.md.
If VISUAL_MODE is not set or browser/app detection failed (Phase 2.6):
Include a placeholder section for visual aids:
## Screenshots / Videos
<!-- Add screenshots or videos here to help reviewers visualize the changes -->
<!-- Consider including: -->
<!-- - Before/after UI comparisons -->
<!-- - New features in action -->
<!-- - Error states or edge cases -->
<!-- - Mobile/responsive views -->
NOTE: This is a placeholder section for the PR creator to populate with relevant visuals.
If VISUAL_MODE=true:
Read references/visual-capture.md and follow Phase 3.5 to delegate evidence capture to kramme:visual:demo-reel, prepare any returned local artifacts for manual attachment or embeddable assets, and build the Screenshots/Videos section. Do not implement a separate screenshot/GIF capture flow here.
ALWAYS format the output as clean Markdown:
[TODO] or [Fill this in]🤖 Generated with [Claude Code](https://claude.ai/code)Generated with Claude CodeCo-Authored-By: Claude or similarDIRECT_UPDATE=true: Update PR directlyRead references/direct-update.md and follow it. If the update fails, fall back to presenting the description for copy-paste using the default flow below.
ALWAYS present the final PR title and description in a clear, copy-paste-ready format:
Here is your generated PR:
**Title:** `<type>(<scope>): <description>`
---
[DESCRIPTION CONTENT HERE]
---
NOTE: The title is formatted with backticks for easy copying. The description follows the standard markdown format.
Skip this step if NON_INTERACTIVE=true.
After presenting the description, ask: "Would you like me to save this description to a markdown file?"
If yes, save to $REPO_ROOT/.kramme-cc-workflow/pr-description/PR_DESCRIPTION.md where REPO_ROOT=$(git rev-parse --show-toplevel). Add .kramme-cc-workflow/ to git's local exclude file first if it is not already listed (use the same idempotent check as step 1 of references/direct-update.md), so the saved file is not accidentally committed without mutating tracked files. Confirm the absolute file path after saving.
Run the consolidated checklist in references/verification-checklist.md. Phases 1–4 do not have their own checklist; that reference is the single source of truth.
Read the best practices guidelines from references/best-practices.md. Covers context gathering, writing style, technical details, and test plan rules.
Read the anti-pattern examples from references/anti-patterns.md. Includes title anti-patterns, vague-summary patterns (rejects titles like Fix bug, Fix build, Phase 1, Add convenience functions), and 6 paired WRONG/CORRECT examples covering vague summaries, missing context, missing tests, tone, hidden breaking changes, and AI attribution.
Read the complete PR examples from references/pr-examples.md. Includes 3 examples: frontend-only feature, full-stack with database migration, and frontend with visual capture (--visual).
Read the platform-specific notes from references/platform-notes.md. Covers magic words for issue linking, team abbreviations, and GitHub conventions.
--auto, an existing PR is found, --no-update is absent, and no blocking missing requirement is present, it may update that PR's title/body through gh pr edit. When saving output, it may write local files under .kramme-cc-workflow/pr-description/ and add .kramme-cc-workflow/ to git's local exclude file if missing.Use these uppercase markers when reasoning about the description generation. They do NOT appear in the final PR body — they go in the skill's conversation output so the user can track decisions.
UNVERIFIED: the migration is reversible — no down-migration present in the diff.NOTICED BUT NOT TOUCHING: a test-only rename in an adjacent file — not part of this PR's narrative.CONFUSION: commits say "add feature flag", but the diff toggles it on by default.MISSING REQUIREMENT: no Linear ID in branch name and no issue mentioned in commits — confirm the intended ticket or proceed without one.Read references/red-flags.md before finalizing. It covers common rationalizations that under-serve the reviewer.
Read references/red-flags.md before finalizing. Stop and regenerate when the draft uses vague summary nouns, mirrors a file list, hides migration risk, includes automated testing instructions in the Test Plan, references spec files, or includes AI-attribution badges.
Read references/verification-checklist.md and complete it before presenting copy-paste output, before gh pr edit, and before saving to file.
tools
Requires Linear MCP. Implements one Linear issue end to end, selects applicable code-review, convention, and PR-refactor gates, runs them to bounded convergence, verifies, and optionally opens the PR and iterates on CI and review feedback until green. Use when the user wants a single Linear issue taken from implementation through a clean Pull Request. Not for implementation-only work, SIW-tracked issues, stacked PRs, existing PR updates, or post-merge rollout.
development
Reviews PR and local changes for convention drift and overcaution against documented rules and mined peer-file practice. Use for new patterns, dependencies, abstractions, or defensive complexity that departs from established practice; every finding cites evidence. Supports --inline. Not for general code quality (use kramme:pr:code-review) or spec review (use kramme:siw:spec-audit --team).
testing
Charts huge or foggy initiatives into a local `.context` decision map and resolves one typed frontier ticket per session until the work is ready for SIW or another execution workflow. Use when the route to a destination cannot fit in one agent session or parallel workspaces need coordinated planning state. Not for clear specs, ordinary issue decomposition, implementation, or Linear-native tracking.
development
Investigates a question against primary sources and saves one cited Markdown artifact. Use for reading legwork: official docs/API facts, source-code or spec checks, standards, and first-party service behavior before planning or implementation. Not for making product or architecture decisions, implementing code, broad web search, secondary blog summaries, or uncited answers.