finalize
Skill2 starsChanged 4 months agoMITView on GitHub
Prepare the smallest viable PR. Assess its blast radius, preserve regression protection, and run simplify, unslop, test pruning, and adversarial code review.
22 other projects use a version of this.
Adopted by
Most recently taken up by
- PL-Coding-GmbH/Skillstheir own version, first seen Nov 8, 2026
- DnsQueen/orcinus-skillstheir own version, first seen Nov 8, 2026
- MagicJosh/rastheir own version, first seen Nov 2, 2026
- SDSLeon/lightcodetheir own version, first seen Nov 1, 2026
- griffinhilly/claude-code-synthesistheir own version, first seen Nov 1, 2026
- Porabuild/Poracodetheir own version, first seen Nov 1, 2026
Used with
Projects with it also use debug, verify and 2 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
AnthropicSkilldebug
Structured debugging session — reproduce, isolate, diagnose, and fix. Trigger with an error message or stack trace, "this works in staging but not prod", "something broke after the deploy", or when behavior diverges from expected and the cause isn't obvious.
Also in 3 projects that use this
Microsoft AzureSkillverify
End-to-end app testing pipeline for browser-based web apps on cloud browsers via Azure Playwright Workspaces: verify the live app, author tests for working flows, heal failing tests, then re-run with video and produce one consolidated report. Three phases (app verification, test authoring, test healing) plus a scoped final sanity run; each phase emits a sub-report. Use when asked to "verify my app", "make sure my app works and has good test coverage", "do a full QA pass", "add tests where I'm missing coverage", "fix failing tests and add new ones", "smoke test before deploy", "QA my deployment", or any combined verify-and-test ask. Requires Azure CLI (`az login`) and a Playwright Workspace resource ID — bootstraps configs on first invocation. Browser-based web apps with Playwright only — not for unit/API tests, native mobile/desktop, load/perf, or full accessibility audits.
Also in 3 projects that use this
SentrySkillcommit
Create commit messages following Sentry conventions. Use when committing code changes, writing commit messages, or formatting git history. Follows conventional commits with Sentry-specific issue references.
Also in 3 projects that use this
MicrosoftSkillhandoff
Compact the current conversation into a handoff document for another agent to pick up.
Also in 3 projects that use this
Other versions22 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 22
- morethanwords/tweb★ 2.7ksame name
- educlopez/ui-craft★ 441same name
- zifeo/lade★ 135same name
- Porabuild/Poracode★ 121same name
- SDSLeon/lightcode★ 121same name
- redis/docs★ 86same name
- skillberry-ai/cap-evolve★ 69same name
- griffinhilly/claude-code-synthesis★ 67same name
- PL-Coding-GmbH/Skills★ 18same name
- alexiolan/craft-skills★ 17same name
12 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository12 other files it gives its agents.
- adversarial-code-reviewSkill
- code-review-loopSkill
- effect-loggingSkill
- fly-optimizationSkill
- formattingSkill
- product-design-evolveSkill
- product-design-extendSkill
- product-design-propagateSkill
- simplifySkill
- style-docSkill
- test-value-auditSkill
- typescript-structureSkill
The file
We split this skill into the rules it gives an agent
12 rules. 0 are common, 7 are distinctive, and 5 are very specific to this project.
0
Common
Most of the 22 edited versions we read keep these.
7
Distinctive
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 28
Use optional tools when they help assess the blast radius:
- Very specific: line 31
Use dev-review-map for structural or high-risk changes when before-and-after dependency maps would help.
- Very specific: line 43
Run simplify for behavior-preserving cleanup.
- Very specific: line 44
Run unslop on text in the diff.
- Very specific: line 46
Run adversarial-code-review on the full candidate without editing it.
- Distinctive: line 48
Update the blast-radius map and validation plan after each edit.
- Very specific: line 66
Read the final diff and status again.
- Distinctive: line 68
Every final hunk belongs to the intended change or a recorded fix.
- Distinctive: line 70
All four passes meet their completion rules for the final candidate.
- Distinctive: line 71
Every finding and PR item in scope has a supported resolution or safe follow-up.
- Distinctive: line 72
If Linear MCP is configured, you have read the linked ticket and verified every requirement and acceptance criterion against the final …
- Distinctive: line 73
No action exceeded the user's authorization.
“Common” is measured: kept by at least 6 in 10 of the 22 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Finalize
Produce the smallest viable PR that meets the intended requirements. Assess what the change can affect and verify that tests detect regressions. Remove unnecessary complexity without removing required behavior or useful tests. Prefer clarity and safety over fewer lines.
Permissions
Inspect repository and read-only PR state, edit intended files, and run safe checks. Preserve unrelated user work. Branch changes, commits, pushes, PR or ticket updates, review replies, merges, deployments, and other external actions require explicit authorization in the current conversation. Invoking finalize does not authorize those actions.
1. Establish scope and blast radius
- Determine whether the scope is the working copy, a PR, or both. Read status, the full diff, changed files, repository instructions, relevant callers, and tests. For a PR, record the merge base and head SHA. Include local edits in the candidate diff.
- If the project has Linear MCP configured, require a linked ticket. Find it in the user's request, branch, commits, or PR. Read its description, acceptance criteria, and relevant comments through MCP. Ask if the ticket is missing or ambiguous. Block if you cannot read it. Define intended behavior and scope from the ticket, not from what the code happens to do.
- For each changed part, identify direct and indirect consumers, shared contracts, stored data, and operational effects. List possible failures and the checks that detect them. Mark each affected part as checked, not at risk with supporting evidence, or blocked.
- Assign the highest applicable risk tier. A small diff can be high risk. Missing evidence raises risk.
| Risk | Conditions | Required validation |
| Low | Local change without shared-contract or operational effects | Targeted checks and direct tests |
| Medium | Shared paths, indirect consumers, dependency or configuration changes, or difficult rollback | Affected-package checks and tests of actual workflows |
| High | Authentication, authorization, public APIs, persisted data, migrations, concurrency, infrastructure, or hard rollback | End-to-end integrations and applicable migration, rollback, rollout, observability, and containment checks |
Use optional tools when they help assess the blast radius:
- Use
calldifffor call-path changes. Runcalldiff --helpfor supported syntax. Compare the recorded base with the current candidate usingcalldiff diff. Usereachortreeto trace affected entrypoints and callers. Record refs, paths, entrypoints, and depth limits. Treat output as supporting evidence, not proof that every dependency or runtime path was found. Inspect omitted paths separately. - Use
dev-review-mapfor structural or high-risk changes when before-and-after dependency maps would help. Supply exact base and head commits, validate both maps, and save them only in Git notes. Push notes only with explicit authorization. Maps cover committed changes, so inspect local edits separately.
Neither tool replaces ticket checks, tests, or adversarial review. If an optional tool is unavailable or blocked, report the limitation and assess the blast radius directly.
Fix correctness and release issues within scope when repository evidence supports the fix. Record where each issue occurs, how you confirmed it, its severity, the action taken, and how you checked the result. Block when a product or contract decision needs clarification.
For bug fixes, apply principle-fix-root-causes. Reproduce the failure and confirm that the fix removes its cause rather than hiding the symptom.
2. Run the preparation sequence
Load these skills and run them in order on the current diff, including earlier edits. Keep the same scope and supply any linked ticket's requirements. Follow each skill's evidence and completion rules. Report BLOCKED if a required skill is missing or a pass is blocked. A pass needs no edits if its review finds none to make.
- Run
simplifyfor behavior-preserving cleanup. Applyprinciple-minimize-reader-loadto remove unnecessary layers and reduce hidden or mutable state. RequireSIMPLIFIED. - Run
unslopon text in the diff. Remove AI writing patterns and preserve meaning. Block if its instructions conflict with finalize's permissions or behavior-preservation requirements. - Run
test-value-auditin cleanup mode on changed tests and tests affected by changed behavior. Applyprinciple-test-behavior-not-implementation. Call the interface users call and assert the result or effect they observe. Rewrite weak assertions for important behavior. Read neighboring tests to check overlap. Delete tests only when they meet the audit's deletion rules, and name surviving tests that detect the same regressions. Keep production code unchanged. Preserve uncertain tests and unrelated suites. Size, mocking, test count, and coverage percentage alone do not determine value. - Run
adversarial-code-reviewon the full candidate without editing it. Require the rules the change must preserve, concrete failure cases, evidence for attacks the code prevents, and anApproveverdict. After the review, fix supported findings. Do not dismiss a correctness failure as style.
Update the blast-radius map and validation plan after each edit. Repeat affected passes in order. Reuse evidence only if it still applies. Adversarial approval must cover the final candidate.
Within these passes, apply principle-type-system-discipline when types change and principle-make-operations-idempotent when retries, crashes, or duplicate requests matter. When workers share mutable data, apply principle-separate-before-serializing-shared-state. Check whether they can own separate data before adding locks. Do not add another sequence of passes.
3. Check PR evidence and validate
For a PR, inspect required checks and every unresolved review thread at the current head SHA. Record an action or no-change reason for each item, with evidence. Recheck if the remote head changes. Replies and thread resolution require authorization.
For each material risk, choose a repository command or safe behavior check and state the expected result. Use commands from repository instructions, package scripts, and CI. Run these checks, all required repository checks, and git diff --check at the assigned risk tier.
Apply principle-prove-it-works. Run the affected workflow or inspect the actual output before claiming success. Compilation, cached results, and agent reports alone are not proof. For large changes, apply principle-build-the-lever with a small repeatable verification script and keep its output available to the reviewer.
For a linked ticket, show which code meets each requirement and acceptance criterion, and which check verifies it. Confirm that the final candidate fixes the reported problem without unexplained changes outside the ticket. Block on missing, conflicting, or unclear requirements.
Fix failures caused by the candidate and rerun affected checks. Record unrelated failures with evidence. Block if a required material check fails or cannot run, or if a material contract lacks regression protection.
Completion and report
Read the final diff and status again. Report TREE_MERGE_READY only when:
- Every final hunk belongs to the intended change or a recorded fix. Unrelated work is intact, generated files match their sources, and documentation matches behavior.
- The blast-radius map accounts for every affected part. All material risks have passed validation, and all required checks pass.
- All four passes meet their completion rules for the final candidate. Every deleted test has surviving regression coverage.
- Every finding and PR item in scope has a supported resolution or safe follow-up. No blocker remains.
- If Linear MCP is configured, you have read the linked ticket and verified every requirement and acceptance criterion against the final candidate.
- No action exceeded the user's authorization. State tree readiness separately from publication or merge status.
Otherwise report BLOCKED. Give evidence and the next action for each unmet condition.
Report the outcome, scope, risk, and results of each pass. Include test-pruning totals and surviving coverage, the adversarial verdict, commands and results, blockers, and publication state. Add ticket and optional tool results when applicable, including limitations. Separate safe follow-ups from blockers. Keep the report proportional to the change.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

