kramme-cc-workflow/skills/kramme:pr:finalize/SKILL.md
(experimental) Final PR readiness orchestration. Coordinates verify:run, pr:code-review, pr:product-review, pr:ux-review, qa, and pr:generate-description. Produces a ready/not-ready/ready-with-caveats verdict. Not for creating PRs, fixing CI, or merging code.
npx skillsauth add abildtoft/kramme-cc-workflow kramme:pr:finalizeInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
4 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Coordinate all pre-merge quality checks and produce a single readiness verdict. This skill runs verification, code review, product review, UX review, QA, and description generation in sequence, aggregating results into an actionable assessment.
Arguments: "$ARGUMENTS"
--auto → set AUTO_MODE=true.--fix → set FIX_MODE=true.--skip <skill,...> → parse comma-separated list of skill short names to skip. Valid values: verify, code-review, product-review, ux-review, qa, generate-description. Store as SKIP_LIST.--app-url <url> → store as APP_URL (enables QA testing against a running app).--base <branch> → store as BASE_BRANCH_OVERRIDE.--auto means:
diff-aware--fix means:
gated_auto code-backed critical or important findings exist, automatically run kramme:pr:resolve-review to address themgated_auto code-backed critical/important findingsgit rev-parse --is-inside-work-tree 2> /dev/null
If not a git repo → abort with error.
CURRENT_BRANCH=$(git branch --show-current)
If $CURRENT_BRANCH is main or master:
Error: Cannot finalize from the main/master branch.
Switch to a feature branch first:
git checkout <feature-branch>
Then run /kramme:pr:finalize again.
Action: Stop.
Read references/base-branch-resolution.md and follow it to compute BASE_BRANCH.
CHANGE_COUNT=$({
git diff --name-only "$MERGE_BASE"...HEAD
git diff --name-only --cached
git diff --name-only
git ls-files --others --exclude-standard
} | sed '/^$/d' | sort -u | wc -l)
If $CHANGE_COUNT is 0:
No changes detected compared to {BASE_REF}.
Nothing to finalize. Make changes first, then run /kramme:pr:finalize again.
Action: Stop.
Reuse the MERGE_BASE computed in Step 2.3. Build a unified change scope (committed + staged + unstaged + untracked):
{
git diff --name-only "$MERGE_BASE"...HEAD # committed PR diff
git diff --name-only --cached # staged local changes
git diff --name-only # unstaged local changes
git ls-files --others --exclude-standard # untracked local files
} | sed '/^$/d' | sort -u
Store as CHANGED_FILES and count as FILE_COUNT.
Read references/ui-relevance-heuristics.md and apply its extension and directory patterns to each entry in CHANGED_FILES.
Set HAS_UI_CHANGES=true if ANY changed file matches. Otherwise HAS_UI_CHANGES=false.
Display the plan before running:
PR Finalize Plan
Branch: {CURRENT_BRANCH} -> {BASE_BRANCH}
Changed files: {FILE_COUNT}
UI changes detected: {yes/no}
Steps to run:
1. verify:run [always]
2. pr:code-review [always]
3. pr:product-review [always]
4. pr:ux-review [if UI changes detected]
5. qa [if UI changes + app URL provided]
6. pr:resolve-review [if --fix and critical/important findings]
7. re-verify [if --fix applied fixes]
8. pr:generate-description [if no blockers]
Auto-fix: {yes/no}
Skipped: {any --skip items, or "none"}
If AUTO_MODE=true, skip this prompt and execute the plan as displayed.
Otherwise use AskUserQuestion to confirm:
header: "PR Finalize Plan"
question: "Proceed with this plan?"
options:
- label: "Run all"
description: "Execute all applicable steps as shown"
- label: "Skip QA"
description: "Run everything except QA testing"
- label: "Customize"
description: "Let me choose which steps to run"
- label: "Abort"
description: "Cancel without running anything"
multiSelect: false
If "Abort": Stop immediately.
If "Skip QA": Add qa to SKIP_LIST.
If "Customize": Use AskUserQuestion with multiSelect to let user pick steps:
header: "Select steps"
question: "Which steps should run?"
options:
- label: "verify:run"
- label: "pr:code-review"
- label: "pr:product-review"
- label: "pr:ux-review"
- label: "qa"
- label: "pr:generate-description"
multiSelect: true
Skip if verify is in SKIP_LIST.
Invoke via Skill tool:
skill: "kramme:verify:run"
Capture the result. Record pass/fail status.
If verification fails: Record as blocker. CONTINUE with remaining steps — do not abort.
See Error Handling for skill-error treatment.
Skip if code-review is in SKIP_LIST.
Delete any stale overview file so a failed run cannot be misread:
rm -f REVIEW_OVERVIEW.md
Note: deleting the overview also discards the producer's previously-addressed-findings memory, so findings dismissed in earlier runs may re-appear on finalize re-runs — stale-file avoidance wins this tradeoff.
Invoke via Skill tool (never pass --inline — this skill requires the file output):
skill: "kramme:pr:code-review", args: "--base {BASE_BRANCH}"
After completion, if REVIEW_OVERVIEW.md does not exist in the project root, treat as COULD NOT RUN: overview file not produced. Otherwise parse it:
Location field:
Location: field from the structured finding schemaLocation: is missing, fall back to inline [location] text only for legacy reportsAction class: gated_auto with path/to/file:line = code-backed finding, eligible for /kramme:pr:resolve-reviewAction class: manual = manual follow-up, even when the finding has a file locationAction class: advisory on a critical/important finding = invalid review schema; treat as manual follow-up and record a COULD NOT AUTO-FIX: invalid action class caveatreview-scope (or any broader non-file scope label) = process-level blocker, manual follow-upCOULD NOT AUTO-FIX: missing Locationgated_auto code-backed vs manual/process-level critical/important code-review findingsgated_auto finding as ELIGIBLE_REVIEW_FIXES with Finding ID as source id, severity, location, finding text, action class, owner, confidence, and evidenceFinding ID, do not invent one from position or prose. Treat it as manual follow-up and record COULD NOT AUTO-FIX: missing Finding ID.See Error Handling for skill-error treatment.
Skip if product-review is in SKIP_LIST.
rm -f PRODUCT_REVIEW_OVERVIEW.md
Same tradeoff as Step 6: this discards the previously-addressed-findings memory, so previously dismissed findings may re-appear on re-runs.
Invoke via Skill tool (do not pass --inline):
skill: "kramme:pr:product-review", args: "--base {BASE_BRANCH}"
After completion, if PRODUCT_REVIEW_OVERVIEW.md does not exist, treat as COULD NOT RUN: overview file not produced. Otherwise parse it:
See Error Handling for skill-error treatment.
Skip if ANY of:
ux-review is in SKIP_LISTHAS_UI_CHANGES is falserm -f UX_REVIEW_OVERVIEW.md
Same tradeoff as Step 6: this discards the previously-addressed-findings memory, so previously dismissed findings may re-appear on re-runs.
Invoke via Skill tool (do not pass --inline). When product review also ran (Step 7 was not skipped), pass --categories ux,visual,a11y so the kramme:product-reviewer agent — which ux-review otherwise always launches — does not review the same diff twice and get its findings double-counted in Step 10:
skill: "kramme:pr:ux-review", args: "--base {BASE_BRANCH} --categories ux,visual,a11y"
If product review was skipped (product-review in SKIP_LIST or COULD NOT RUN), invoke without --categories so ux-review keeps its full default coverage:
skill: "kramme:pr:ux-review", args: "--base {BASE_BRANCH}"
After completion, if UX_REVIEW_OVERVIEW.md does not exist, treat as COULD NOT RUN: overview file not produced. Otherwise parse it:
See Error Handling for skill-error treatment.
Skip if ANY of:
qa is in SKIP_LISTHAS_UI_CHANGES is falseAPP_URL was not providedIf AUTO_MODE=true, skip this prompt and run diff-aware QA:
skill: "kramme:qa", args: "{APP_URL} diff-aware --base {BASE_BRANCH}"
Otherwise confirm with user:
header: "QA Testing"
question: "Run QA testing against {APP_URL}? A browser MCP enables live checks; otherwise QA falls back to code-only analysis."
options:
- label: "Run QA quick"
description: "Quick smoke test of changed UI areas"
- label: "Run QA diff-aware"
description: "Thorough test focused on changed files and their impact"
- label: "Skip QA"
description: "Skip QA testing for now"
multiSelect: false
If "Skip QA": Record as skipped. Continue.
If "Run QA quick":
skill: "kramme:qa", args: "{APP_URL} quick"
If "Run QA diff-aware":
skill: "kramme:qa", args: "{APP_URL} diff-aware --base {BASE_BRANCH}"
Parse QA results for blockers, major issues, and minor issues.
See Error Handling for skill-error treatment.
Aggregate all results into a verdict. Explicitly skipped steps (--skip or conditional skip) are not caveats; failures and COULD NOT RUN are.
Before choosing the verdict, read references/residual-work.md and run the residual-work gate.
READY:
COULD NOT RUNfixed_now or not_relevantREADY WITH CAVEATS:
blocked_by_missing_information or unclassifieddeferred_with_owner or accepted_riskNOT READY:
blocked_by_missing_informationSkip if FIX_MODE is not true, OR the verdict is READY.
If FIX_MODE=true and one or more eligible gated_auto code-backed critical or important code-review findings exist:
Build a caller-scoped findings payload from ELIGIBLE_REVIEW_FIXES. Include only findings whose action class is gated_auto and whose location is path/to/file:line. Do not include manual, advisory, review-scope, PR description, or legacy entries without an explicit auto-resolvable marker.
Run kramme:pr:resolve-review in implement-only mode with that payload:
skill: "kramme:pr:resolve-review", args: "--implement-only --severity critical,important {ELIGIBLE_REVIEW_FIXES_PAYLOAD}"
Do not use --source local for this handoff. Local-source mode re-reads the entire REVIEW_OVERVIEW.md and would allow manual or advisory critical/important findings into the auto-fix path.
After resolve-review completes, read .context/resolve-review/implement-only-summary.json if present and use it to classify each eligible finding as fixed, deferred, or blocked.
Re-run verification:
skill: "kramme:verify:run"
Re-assess the verdict using the same logic as Step 10, incorporating the updated state.
Update the verdict, findings counts, and residual-work dispositions to reflect what was fixed.
If no eligible gated_auto code-backed critical/important code-review findings remain and the remaining blocker is process-level only, do not run resolve-review; keep the verdict and tell the user the follow-up is manual.
If resolve-review fails or introduces new issues, keep the original verdict and note the failure.
Render the verdict inline (no artifact file) using the template and per-verdict next-steps guidance in references/verdict-template.md. Substitute counts and status from Steps 5–10.
Skip if generate-description is in SKIP_LIST.
If verdict is READY or READY WITH CAVEATS and AUTO_MODE=true, run:
skill: "kramme:pr:generate-description", args: "--auto --base {BASE_BRANCH}"
Otherwise ask:
header: "PR Description"
question: "Generate or update PR description now?"
options:
- label: "Generate and update"
description: "Generate description and update the existing PR (if one exists)"
- label: "Generate for review"
description: "Generate description for review before applying"
- label: "Skip"
description: "Skip description generation"
multiSelect: false
If "Skip": Done.
If "Generate and update":
Run the sub-skill's direct-update path so it handles backup creation and --body-file application:
skill: "kramme:pr:generate-description", args: "--auto --base {BASE_BRANCH}"
If no PR exists or the generated body has a blocking missing requirement, the sub-skill will fall back to copy-paste output instead of publishing.
If "Generate for review":
skill: "kramme:pr:generate-description", args: "--base {BASE_BRANCH}"
If skill errors out: Report error but do not fail the overall assessment.
pr:finalize does NOT:
/kramme:pr:create)/kramme:pr:fix-ci)--fix, no commits, rebases, or file modifications occur. With --fix, resolve-review may create commits (with a rollback checkpoint)Side effects to be aware of:
--auto is set and a PR exists). Use --skip generate-description to opt out.COULD NOT RUN: {error message}, continue with remaining steps, and include the entry as a caveat in the final verdict.REVIEW_OVERVIEW.md, PRODUCT_REVIEW_OVERVIEW.md, UX_REVIEW_OVERVIEW.md) is not present, treat as COULD NOT RUN: overview file not produced rather than zero findings.--base <branch> (Step 2.3)./kramme:pr:finalize # all applicable steps
/kramme:pr:finalize --app-url http://localhost:3000 # with QA testing
/kramme:pr:finalize --skip qa,ux-review # skip specific steps
/kramme:pr:finalize --app-url http://localhost:4200 --base develop # custom base + app URL
/kramme:pr:finalize --fix # auto-fix critical/important findings
/kramme:pr:finalize --auto --fix # full automation + auto-fix
/kramme:pr:finalize --skip verify,qa # skip verification and QA
development
Runs kramme:pr:code-review as a closeout review loop for local or PR branch changes before commit, ship, or final response. Use when the user asks for autoreview, second-model review, or a final code-review pass after non-trivial edits. Not for UX, visual, accessibility, or product review.
development
Guides topic-level understanding verification for a PR, branch, feature, document, spec, design decision, bug fix, or other concrete subject. Use when the user asks to confirm, quiz, drill, teach-and-check, or verify that they understand a topic. Maintains a topic-specific checklist artifact and requires demonstrated understanding before marking the topic complete. Not for ordinary explanations without verification, end-of-session summaries, or code/test correctness checks.
testing
Design a CI/CD pipeline with quality gates, a <10-minute budget, feature-flag lifecycle, and an exit checklist. Use when adding a new CI pipeline, changing gate configuration, or planning a rollout for a new service. Complementary to kramme:pr:fix-ci (which fixes failures in an existing pipeline). Covers gate ordering, secrets storage, branch protection, rollback mechanism, and staged-rollout guardrails — not a rollout-execution runbook.
tools
--- name: kramme:visual:demo-reel description: Capture local demo evidence for observable product behavior: screenshots, before/after image sets, browser reels, terminal recordings, and short GIF/video proof. Use when shipping UI changes, CLI features, or any change where PR reviewers would benefit from visual or behavioral evidence. argument-hint: "[what to capture] [--url <url>|auto] [--tier static|before-after|browser-reel|terminal-recording]" disable-model-invocation: true user-invocable: tr