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, hand only that bounded payload to kramme:pr:resolve-review in its gated implement-only pathgated_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.
Read references/execution-plan-prompts.md, display the populated plan, and apply its confirmation/customization flow. If AUTO_MODE=true, skip only this plan confirmation; still honor every downstream safety gate, missing-requirement stop, and sub-skill confirmation for destructive or high-impact operations.
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:
Read references/review-result-parsing.md and apply its code-review parsing rules, including ELIGIBLE_REVIEW_FIXES construction and blocker classification.
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:
Read references/review-result-parsing.md and apply its product-review overview parsing rules.
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 providedRead references/qa-and-description-prompts.md and follow its QA prompt/invocation flow. 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.
Read references/qa-and-description-prompts.md and follow its PR description prompt/invocation flow. If the skill errors out, report the error but do not fail the overall assessment.
Direct update path marker: skill: "kramme:pr:generate-description", args: "--auto --base {BASE_BRANCH}"; the sub-skill handles backup creation and --body-file application.
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
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.