workflows-finalize
Ship-readiness pass: review, fix, and validate working copy or PR changes. This skill should be used when asked to finalize, harden, do a final pass, or make code shippable. Runs as a forked subagent.
What this skill does
# Finalize Take ownership of the last serious pass before merge: understand what changed, identify what could still go wrong, simplify what can be safely simplified, fix everything with a clear right answer, validate the result, and surface only decisions that genuinely require product or architectural input. After this runs, the user should be able to click merge. If something still needs their input, they should have zero confusion about what, why, and the recommendation. ## Operating Stance Think like the person who would approve this to ship tonight. - Care most about correctness, regressions, user-visible behavior, failure modes, and maintainability - Read enough surrounding code to understand the change in context, not just the patch - Map the likely blast radius before declaring confidence: callers, dependents, shared utilities, adjacent integrations, affected user flows, tests, docs - Prefer focused investigation over exhaustive ceremony - Always look for simplification, but only apply when clearly safe and local - Delegate narrow, concrete questions to subagents; keep the critical path in the main thread - Optimize for shipping confidence, not maximum diff size ## Safety Rails ### Approval boundary Without explicit user approval, do not: deploy, merge, publish, release to production, send external communications, or trigger any action affecting live systems. Aggressive preparation is fine: fix code, run validations, create branches, commit task-related changes, open/update PRs through normal workflow. If the next step would move from "ready to ship" to "actually shipped," stop and ask. ### Preserve reversibility Before making non-trivial edits, create a clear rollback boundary: - On a non-default branch with coherent working copy: commit the current task state, then place finalize edits in new commits on top - On the default/base branch with coherent working copy: create a branch first, baseline commit, then finalize edits - Work already committed: keep finalize edits in their own commit If the tree is mixed with unrelated edits or the task boundary is unclear, do not force a commit. Instead: keep edits narrowly scoped and easy to inspect, or stop and ask before making changes that would be hard to disentangle. ## Execution Order ### 1. Determine scope Determine whether the user wants the working copy, the current PR, or both. If both exist and the user did not specify, prefer working copy first and mention PR-only concerns separately. Only ask when the distinction materially changes the work. If the working copy is dirty, distinguish finalize targets from unrelated in-progress edits. Do not rewrite, reformat, or "clean up" files just because they are dirty. If nothing to finalize, say so plainly. ### 2. Build the picture - Inspect repo status and the effective diff - Read changed files in full - Read active project instructions (AGENTS.md, CLAUDE.md, OPENCODE.md, referenced docs) - Identify work type: backend, frontend, infra, schema, integration, refactor, new feature, or mix - Look beyond changed files: callers, related tests, docs, routes, schemas, affected flows - Size the work: low, medium, or high risk - Map the blast radius before editing Read [investigation-patterns.md](references/investigation-patterns.md) for domain-specific investigation checklists based on the type of change identified. Do not stay trapped inside the diff. A finalize pass is about whether the change holds up in the codebase. Any area with credible impact that was not inspected is unverified, not implicitly safe. ### 3. Deslop and simplify Run `/deslop` then `/simplify` on the changed files. These are mechanical cleanup passes that should happen before investigation: - **Deslop** removes AI slop: unnecessary comments, defensive over-engineering, type hacks, style inconsistencies, over-abstraction - **Simplify** reviews for reuse, quality, and efficiency — then fixes Skip if reviewing a plan folder (no code to clean). If either pass makes changes, note them briefly before proceeding. If neither finds anything, proceed silently. ### 4. Create rollback boundary (if needed) If likely changes are non-trivial and the task state is coherent, create the appropriate branch and/or baseline commit before editing (see Safety Rails above). ### 5. Investigate and delegate Spawn parallel subagents for independent side investigations. Good delegated work: - Convention and command discovery - Dependency and impact tracing - Focused backend or frontend audits - Unresolved PR feedback evaluation - Targeted verification of suspicious areas Each subagent should return concrete findings with file references and recommended action. After subagents return, integrate findings before editing. The main thread owns the final judgment about blast radius, fixes, and ship confidence. ### 6. Fix Default is to fix, not propose. Read [investigation-patterns.md](references/investigation-patterns.md) for the fix rubric, review-feedback handling, and simplification guidelines. Fix directly when the correct action is clear and low-risk: real bugs, safe simplifications, broken imports, missing edge-case handling, type-safety holes, dead code, stale docs, unresolved review feedback with a clear path. Do not widen scope. Avoid speculative rewrites, style churn, and opportunistic architecture changes. "Could be cleaner" is not enough. "Would likely bite us soon" is enough. Raise the bar further when a simplification would remove multiple components, delete helper layers, or collapse public interfaces. Those are not "safe and local." Investigate more, checkpoint first, keep in a reversible commit. ### 7. Validate Run the appropriate checks for the scope: - Typecheck for localized code changes - Lint when changes span files or patterns - Targeted tests for the affected area - Build for broader structural changes - Real-flow verification in the best safe environment available when behavior changed If a check fails, treat it as part of finalize: understand, fix what belongs to this change, rerun. Prefer exercising real behavior over reading code or relying only on static checks. Do not poke production systems or trigger irreversible external side effects. When relevant, also check ship-readiness beyond code: rollout assumptions, migration safety, rollback path, observability, feature flags, config drift. Use judgment — do not force this onto trivial changes. ### 8. Final targeted pass (medium/high risk only) After fixes and validation, do one more targeted pass over the original blast radius to catch anything introduced by the fixes themselves. ### 9. PR flow (when appropriate) If finalizing working copy on the default/base branch, the work ends in high confidence, has no unresolved blockers, and the diff is a coherent task: proactively create a branch, commit, and open a PR through the project's normal workflow. Only when clearly safe. If the tree contains unrelated work, task boundary is unclear, or publishing would be premature, stop at the finalize handoff. ## Completion Done when one of: - Work is validated and comfortable to ship - Work is validated, comfortable to ship, and carried through branch-and-PR flow when safe - Short, explicit list of blockers/decisions that prevent high confidence If confidence is not high, say exactly why. ## Final Response Keep concise and decision-oriented: - Scope reviewed - Risk level and why - Surfaces checked vs. unverified - What was fixed or simplified, and why - Delegated investigations and what they established - Decisions still needed (if any) - Validation ran and results - Rollback boundary created (how) - Branch/PR created (link if so) - Follow-up improvements (only if clearly valuable and non-blocking) - **Ship confidence: high / medium / low** — one short reason Keep blockers separate from follow-up ideas. The user should scan the response and know both whether this is ready to merge and what woul
Related in Writing & Docs
jax-development
IncludedUse this skill when the user is writing, debugging, profiling, refactoring, reviewing, benchmarking, parallelising, exporting, or explaining JAX code, or when they mention JAX, jax.numpy, jit, grad, value_and_grad, vmap, scan, lax, random keys, pytrees, jax.Array, sharding, Mesh, PartitionSpec, NamedSharding, pmap, shard_map, Pallas, XLA, StableHLO, checkify, profiler, or the JAX repo. It helps turn NumPy or PyTorch-style code into pure functional JAX, fix tracer/control-flow/shape/PRNG bugs, remove recompiles and host-device syncs, choose transforms and sharding strategies, inspect jaxpr/lowering/IR, and benchmark compiled code correctly.
nature-article-writer
IncludedDrafts, rewrites, diagnostically critiques, and style-calibrates primary research manuscripts for Nature and Nature Portfolio journals. Use when the user wants a Nature-style title, summary paragraph or abstract, introduction, results, discussion, methods, figure legends, presubmission enquiry, cover letter, reviewer response, or when a scientific draft sounds generic, jargon-heavy, structurally weak, or AI-ish and needs precise, broad-reader-friendly prose without inventing data, analyses, or references. Best for primary research articles and letters rather than reviews or press releases unless explicitly adapting one.
deckrd
IncludedDocument-driven framework that derives requirements, specifications, implementation plans, and executable tasks from goals through structured AI dialogue. Use when user says "write requirements", "create spec", "plan implementation", "derive tasks", "structure this feature", "break down into tasks", or "document this module". Also use for reverse engineering existing code into docs (/deckrd rev). Do NOT use for direct code writing — use /deckrd-coder after tasks are generated. Do NOT use when the user only wants to run or fix existing code without planning.
clinical-decision-support
IncludedGenerate professional clinical decision support (CDS) documents for pharmaceutical and clinical research settings, including patient cohort analyses (biomarker-stratified with outcomes) and treatment recommendation reports (evidence-based guidelines with decision algorithms). Supports GRADE evidence grading, statistical analysis (hazard ratios, survival curves, waterfall plots), biomarker integration, and regulatory compliance. Outputs publication-ready LaTeX/PDF format optimized for drug development, clinical research, and evidence synthesis.
handling-sf-data
IncludedSalesforce data operations with 130-point scoring. Use this skill to create, update, delete, bulk import/export, generate test data, and clean up org records using sf CLI and anonymous Apex. TRIGGER when: user creates test data, performs bulk import/export, uses sf data CLI commands, needs data factory patterns for Apex tests, or needs to seed/clean records in a Salesforce org. DO NOT TRIGGER when: SOQL query writing only (use querying-soql), Apex test execution (use running-apex-tests), or metadata deployment (use deploying-metadata).
accelint-ac-to-playwright
IncludedConvert and validate acceptance criteria for Playwright test automation. Use when user asks to (1) review/evaluate/check if AC are ready for automation, (2) assess if AC can be converted as-is, (3) validate AC quality for Playwright, (4) turn AC into tests, (5) generate tests from acceptance criteria, (6) convert .md bullets or .feature Gherkin files to Playwright specs, (7) create test automation from requirements. Handles both bullet-style markdown and Gherkin syntax with JSON test plan generation and validation.