skills/post-implementation-review-loop/SKILL.md
Iteratively review already-implemented code using the required phase_checkpoint_compact Pi extension tool at every continuing phase boundary; automatically apply straightforward Bucket I fixes, validate, and continue until no accepted Bucket I actions remain or the iteration limit is reached while Bucket II items receive recommended next actions.
npx skillsauth add sjunepark/custom-skills post-implementation-review-loopInstall 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.
Use this skill manually. Do not invoke it unless the user explicitly asks for a looped or iterative post-implementation review, or asks to fix straightforward findings from a post-implementation review automatically.
This is an implementation-and-review loop, not a one-pass advisory review. Review the completed code, verify findings, apply straightforward fixes, validate changed code, and call phase_checkpoint_compact at every continuing phase boundary so Pi performs a real compacted handoff before the next phase.
This skill requires the Pi extension tool phase_checkpoint_compact.
If phase_checkpoint_compact is unavailable:
post-implementation-review-loop skill requires the phase-checkpoint-compact Pi extension./compact, soft checkpoints, summaries, or ordinary conversation handoffs.phase_checkpoint_compact at every continuing phase boundary returned by scripts/loop-decision, including no-edit review and planning phases; use skipped validation for phases that made no code changes.phase_checkpoint_compact, do not continue substantial work; wait for the extension's next-phase prompt.review(post-review): before review commit instead of asking for a WIP baseline.review(post-review): after review commit for the loop's own changes.scripts/final-report can render every Bucket I finding, Bucket II finding, rejected finding, fix applied, and validation result across all iterations.Focus on issues that become visible only after the implementation touched real interfaces, control flow, state, tests, docs, or module boundaries.
Look for:
Do not manufacture findings. If the code is structurally sound, say so.
phase_checkpoint_compact remains the only required extension for this skill. Subagents are a tunnel-vision control, not a hard dependency. If the subagent tool is unavailable, run the loop yourself.
Use the lightest review shape that will materially improve confidence. Do not fan out reviewers by default, and do not treat every non-trivial change as requiring parallel subagents. Escalate only when the added independence is likely to catch issues the parent review would miss:
Fresh context does not mean context-free. Give each reviewer a bounded review packet: objective, scope or diff target, relevant constraints, validation commands, and any user-approved direction. Do not include the implementer's rationale, rejected alternatives, or persuasive framing unless it is needed to understand a hard constraint.
If subagent is unavailable, do not describe the same-conversation pass as independent. Run a deliberate second pass yourself and treat it as weaker evidence.
If an external review command or model is noisy, prefer running it through one review-only subagent filter so the parent receives only accepted actionable findings, rejected findings with one-line reasons, and exact files/tests to rerun.
Reviewer rules:
context: "fresh", not forked context, unless the user explicitly asks otherwise.Parent synthesis rules:
post-review; accepted fixes are verified in impl-review, implemented in impl, then compacted before the next post-review.Use scripts/loop-decision as the authoritative transition gate before stopping, asking the user whether to proceed, calling phase_checkpoint_compact, or entering the next phase. The script does not review or fix code; it converts the current phase state into one allowed transition.
Resolve the script path against this skill directory. From this repository root, run it with a JSON phase snapshot, for example:
skills/post-implementation-review-loop/scripts/loop-decision --pretty <<'JSON'
{"phase":"post-review","iteration":1,"limit":5,"bucketICandidates":2,"bucketII":0}
JSON
The output's requiredAction, nextPhase, checkpointRequired, and report fields are binding. If requiredAction is render_final_report, update the cumulative ledger, run scripts/final-report, and use its stdout as the final answer. Do not hand-write, summarize, or replace the rendered report. If requiredAction is call_phase_checkpoint_compact, do not produce a final answer or ask permission; call phase_checkpoint_compact and let the extension inject the next-phase prompt.
Goal-extension lesson: durable loops need persisted active state plus a continuation prompt, not only prose instructions. This skill does not use create_goal automatically, but it follows the same control pattern by checkpointing every continuing phase and preserving the next phase's first concrete action in the handoff.
Minimum snapshot fields:
phase, iteration, and limit.post-review, include bucketICandidates and bucketII counts or lists.impl-review, include acceptedBucketI and bucketII counts or lists.impl, include appliedBucketI count or list.reviewOnly, scopeBlocked, validationBlocked, checkpointUnavailable. Use reviewOnly only for a whole-run user request not to implement fixes; do not set it merely because the current phase is a no-edit review or planning phase.Transition table encoded by the gate:
| Phase | Condition | Next phase |
| --- | --- | --- |
| any | review-only, scope blocked, validation blocked, or checkpoint unavailable | final report via scripts/final-report |
| post-review | no Bucket I candidates | final report via scripts/final-report |
| post-review | iteration limit reached | final report via scripts/final-report |
| post-review | Bucket I candidates exist | impl-review via phase_checkpoint_compact |
| impl-review | no accepted/actionable Bucket I | final report via scripts/final-report |
| impl-review | iteration limit reached | final report via scripts/final-report |
| impl-review | accepted/actionable Bucket I exists | impl via phase_checkpoint_compact |
| impl | no Bucket I fixes were applied | final report via scripts/final-report |
| impl | Bucket I fixes were applied | post-review via phase_checkpoint_compact |
Treat user wording like "do not edit code in this phase" as phase-local unless the user explicitly says the whole run is review-only or asks to wait for approval before implementation. Producing Bucket I/Bucket II findings is not a stop condition by itself. Do not write "if you want me to proceed" during an active loop.
Forbidden pattern: after a gate returns requiredAction: "call_phase_checkpoint_compact", do not end the assistant turn with prose like "Gate result: continue to impl-review" or "I did not edit code in this phase." That is a premature stop. The next action must be phase_checkpoint_compact with the gate's nextPhase.
Active phase rhythm:
post-review -> compact -> impl-review -> compact -> impl/fix -> compact -> post-review -> ...
Each compacted handoff carries the active loop state, like goal continuation does. post-review discovers candidates, impl-review verifies and accepts actionable Bucket I work, and impl applies and validates fixes before the next post-review.
If the user already provided an accepted implementation plan, the loop may start at impl. Otherwise, start at post-review for an already-completed change.
Before the first active phase, establish a before-review baseline so pre-loop implementation work and review-loop fixes are identifiable without leaving generic WIP commits in history.
Run git status --short and identify the user-requested review scope.
If unrelated dirty files exist and the scoped files cannot be separated safely, stop and ask the user which files belong in the loop scope before staging anything.
If the working tree is clean, record the current HEAD as the before-review baseline. Set baseline.mode to existing-head.
If HEAD is already a before-review commit from this loop and there are additional uncommitted scoped implementation changes, stage only those scoped files and run git commit --amend --no-edit before reviewing. A commit counts as a before-review loop commit when its subject is review(post-review): before review or its body contains Post-review-loop before-review. Record the new HEAD and set baseline.mode to amended-before-review.
If HEAD is a legacy wip(post-review-loop): baseline before review commit, treat it as a loop-owned before-review baseline. If scoped implementation changes are dirty, stage only those files and amend now while renaming the commit to review(post-review): before review and keeping the Post-review-loop before-review marker.
If there are uncommitted scoped implementation changes and HEAD is not already a loop-owned before-review commit, stage only those scoped files and create this commit automatically before reviewing:
review(post-review): before review
Include this marker in the commit body:
Post-review-loop before-review
Captures the implementation state before automated post-review fixes.
Loop fixes should appear in a later after-review commit.
Record the new HEAD and set baseline.mode to created-before-review.
Do not amend normal user commits unless the user explicitly asks for amend/fold-in mode. Prefer before/after review commits over rewriting feature commits.
During the loop, leave loop-generated fixes uncommitted until a stop condition is reached so each phase can inspect git diff HEAD.
Before rendering the final report, if the loop applied fixes, validation for those fixes did not fail, no scope/context blocker remains, and HEAD is not already a loop-owned after-review commit, stage only the files changed by the loop and create this commit automatically:
review(post-review): after review
Include this marker in the commit body:
Post-review-loop after-review
Applies validated automated post-review fixes on top of the before-review baseline.
Record the new HEAD in afterReviewCommit.ref, set afterReviewCommit.mode to created-after-review, and list only the loop-changed files.
If HEAD is already a loop-owned after-review commit and the current run adds more validated loop fixes, stage only loop-changed files and run git commit --amend --no-edit instead of creating another after-review commit. Record the new HEAD and set afterReviewCommit.mode to amended-after-review.
If no loop fixes were applied, set afterReviewCommit.mode to not-needed. If validation failed, set it to skipped-validation-failed and leave fixes uncommitted for inspection. If scope/context blocked the loop, set it to skipped-scope-blocked.
Treat invoking this loop skill as approval to create or amend only loop-owned before-review and after-review commits. It is not approval to amend normal user commits, push, install globally, or commit unrelated files.
post-review phase completes against the current implementation state.post-review as iteration 1.impl, the first post-review after that implementation is iteration 1.Maintain a concise ledger across iterations and compacted handoffs. Update it after each visible phase report and after each fix/validation checkpoint so scripts/final-report has the full loop history.
Track:
HEAD, baseline mode, and scoped files included.Keep the ledger concise. Preserve facts and outcomes, not long reasoning traces.
Before rendering the final report, convert the ledger to the post-implementation-review-loop-final-report-v1 JSON shape expected by scripts/final-report:
{
"reportFormat": "post-implementation-review-loop-final-report-v1",
"baseline": {
"ref": "<commit-or-HEAD>",
"mode": "existing-head",
"createdCommit": false,
"scopedFiles": ["<repo-relative-path>"]
},
"afterReviewCommit": {
"ref": "<commit-or-none>",
"mode": "not-needed",
"files": ["<repo-relative-path>"]
},
"scope": "<review scope>",
"iterations": { "completed": 1, "limit": 5 },
"phasesRun": [
{
"phase": "post-review",
"iteration": 1,
"gateDecision": "stop",
"summary": "<one-line outcome>"
}
],
"filesChanged": ["<repo-relative-path>"],
"validation": [
{
"command": "<command or skipped-validation note>",
"result": "passed",
"phase": "impl",
"notes": "<concise notes>"
}
],
"finalCleanCondition": "<no accepted/actionable Bucket I findings remain, or stop reason>",
"finalDiffInspection": "<confirmation that the final diff was inspected and validation was run or intentionally skipped>",
"bucketI": [
{
"title": "<finding title>",
"revealed": "<what the implementation revealed>",
"status": "applied",
"fix": "<root-cause fix/refactor, or why none>",
"files": ["<repo-relative-path>"],
"bandageReason": "<why a smaller patch would have been a bandage, or Not applicable>",
"validation": ["<validation evidence>"]
}
],
"bucketII": [
{
"title": "<finding title>",
"revealed": "<what the implementation revealed>",
"weakness": "<design or quality weakness>",
"options": ["<option>"],
"recommendedAction": "Discuss before changing",
"tradeoffs": "<tradeoffs, risks, or uncertainty>",
"status": "left for user decision"
}
],
"codeChanges": [
{
"title": "<fix/refactor title>",
"files": ["<repo-relative-path>"],
"issueAddressed": "<behavior/design issue addressed>",
"scopeReason": "<why this was the right scope>",
"validation": ["<validation evidence>"],
"inspect": "git diff HEAD"
}
],
"rejectedOrKeptAsIs": [
{ "title": "<finding>", "reason": "<why no change is recommended>" }
],
"finalGate": {
"decision": "stop",
"nextPhase": "final report",
"checkpointRequired": false,
"requiredAction": "render_final_report",
"reportRequired": true,
"reportFormat": "post-implementation-review-loop-final-report-v1",
"reason": "<gate reason>"
},
"verdict": "Loop clean: no accepted/actionable Bucket I findings remain"
}
Required report enum values:
baseline.mode: existing-head, created-before-review, amended-before-review, or legacy-wip-baseline.afterReviewCommit.mode: not-needed, created-after-review, amended-after-review, skipped-validation-failed, skipped-scope-blocked, or left-uncommitted.validation[].result: passed, failed, or skipped.bucketI[].status: accepted, applied, rejected, or remaining.bucketII[].status: left for user decision, deferred, kept as-is for now, or implemented after explicit approval.verdict: one of the exact Verdict lines in the Output section.Use empty lists for empty sections. Do not omit required keys. If a field truly does not apply, use a short explicit value such as Not applicable instead of deleting the field.
post-review
scripts/loop-decision with phase: "post-review", the current iteration and limit, bucketICandidates, bucketII, and any active stop flags.checkpointRequired: true and nextPhase: "impl-review", call phase_checkpoint_compact with phaseCompleted: "post-review" and nextPhase: "impl-review"; otherwise render the final report and do not checkpoint into a no-op phase.impl-review
impl so validation and checkpoint payloads match the phase that changed files.scripts/loop-decision with phase: "impl-review", the current iteration and limit, acceptedBucketI, bucketII, and any active stop flags.checkpointRequired: true and nextPhase: "impl", call phase_checkpoint_compact with phaseCompleted: "impl-review" and nextPhase: "impl"; otherwise render the final report and include any unimplemented Bucket I items in the ledger.impl
scripts/loop-decision with phase: "impl", the current iteration and limit, appliedBucketI, and any active stop flags.checkpointRequired: true and nextPhase: "post-review", call phase_checkpoint_compact with phaseCompleted: "impl" and nextPhase: "post-review" so the next review can confirm whether Bucket I is clean or the iteration limit has been reached; otherwise render the final report.phase_checkpoint_compact UsageCall phase_checkpoint_compact after every gate output with requiredAction: "call_phase_checkpoint_compact". No-edit review and planning checkpoints are intentional: they persist loop state and inject the next-phase prompt, matching the continuation-control lesson from goal mode.
Populate the tool fields as follows:
phaseCompleted: the completed phase: post-review, impl-review, or impl.nextPhase: the gate output's nextPhase: impl-review, impl, or post-review.goal: the user's review/fix objective.scope: the reviewed diff, files, commit range, or user-provided scope.changedFiles: repo-relative paths touched or relevant to the loop.validation: commands run and whether each passed, failed, or was skipped. Each result value must be exactly passed, failed, or skipped; never use values like not run, pending, unknown, or n/a. For no-edit review or planning phases, include one skipped item such as Review/planning phase; no code changes to validate when no command applies.bucketIApplied: Bucket I fixes already applied; use an empty list before implementation has applied fixes.bucketIRemaining: Bucket I candidates or accepted/actionable Bucket I items still to implement or verify.bucketII: discussion items, each with options when useful and a recommended action.rejectedOrKeptAsIs: meaningful findings rejected after verification and why.handoffSummary: concise next-phase handoff; include only what the next phase needs.Handoff summaries must preserve:
HEAD, baseline mode, after-review commit status, and changed filespassed, failed, or skippeddecision, nextPhase, checkpointRequired, requiredAction, and reasonDo not preserve long reasoning traces, stale alternatives, raw tool output dumps, or rejected findings that no longer matter.
Put a finding here only when all are true:
For loop execution, Bucket I means: verify it, implement it, validate it, then review again.
Avoid Bucket I for tiny helper extractions, one-off naming polish, isolated dedupe, or logging niceties unless they reflect a broader boundary or ownership issue.
Put a finding here when any are true:
For loop execution, Bucket II means: do not auto-implement. Explain the tradeoff and recommend how to act.
When recommending an option, prefer the path that improves the codebase's design, ownership, boundaries, and long-term maintainability. Recommend a temporary/local fix only when the broader refactor cost is disproportionate, the evidence is not strong enough, the change would introduce meaningful new risk, or the decision depends on product/domain constraints.
Recommended actions:
Discuss before changing: user/domain decision needed.Defer: real concern, but not worth changing until the next related feature or until stronger evidence justifies the refactor.Keep as-is for now: current shape is acceptable; watch for repetition.Prototype separately: validate a broader refactor before committing when the design improvement is promising but risk or uncertainty is meaningful.Implement next if approved: best design-improving path is clear enough, but requires explicit approval because cost/risk/scope is meaningful.State the reason for the recommendation, not just the available options. If recommending a temporary fix, explicitly say why the stronger design improvement is not worth doing now.
phase_checkpoint_compact, every validation item must use one of exactly three result strings: passed, failed, or skipped.validation and continue only if the next phase can still reason safely.Stop when any of these are true:
post-review phase finds no Bucket I candidates.impl-review phase finds no accepted/actionable Bucket I items.phase_checkpoint_compact tool is unavailable.Do not run extra review cycles just to get nicer wording after a clean pass.
During active phases, preserve a phase report at each gate decision. For call_phase_checkpoint_compact gates, the report belongs in the phase_checkpoint_compact handoff and may also be shown by the checkpoint UI; do not replace the checkpoint with an ordinary final answer. For render_final_report gates, render the deterministic final report with scripts/final-report and use that stdout as the final answer.
Use this active phase report structure:
<current>/<limit><impl-review via checkpoint>, <impl via checkpoint>, <post-review via checkpoint>, or <final report>List Bucket I findings, accepted actions, or applied fixes. If empty, say No Bucket I items.
List discussion items with Recommended action: .... If empty, say No Bucket II items.
List meaningful rejected findings. If empty, say None.
List commands and results. Use only passed, failed, or skipped as status words.
Every phase report with a continuing gate is followed by phase_checkpoint_compact, using the same facts in the tool payload. No-edit review and planning reports checkpoint to the next phase instead of continuing in-context.
When the loop stops, render the final report. Do not stop with only a checkpoint handoff or terse verdict.
When scripts/loop-decision returns requiredAction: "render_final_report":
review(post-review): after review commit when validated loop fixes exist, or record the skip mode when no after-review commit should be made.post-implementation-review-loop-final-report-v1 JSON shape described in the Cumulative loop ledger section.scripts/final-report with that JSON on stdin or through --input.The rendered report always has these sections:
# Post-Implementation Review Loop Report## Summary## Phases Run## Validation## Bucket I — Findings and Fixes## Bucket II — Findings and Recommendations## Code Changes Applied## Rejected / Kept As-Is## Final VerdictThe report must end with one of these exact verdicts:
Loop clean: no accepted/actionable Bucket I findings remainLoop stopped: Bucket II decision neededLoop stopped: iteration limit reachedLoop stopped: validation failure remainsLoop stopped: scope or context neededLoop stopped: phase_checkpoint_compact unavailabledevelopment
Use when the user wants to design, redesign, shape, critique, audit, polish, clarify, distill, harden, optimize, adapt, animate, colorize, extract, or improve a frontend interface. Covers websites, landing pages, dashboards, product UI, app shells, components, forms, settings, onboarding, empty states, UX review, visual hierarchy, information architecture, accessibility, performance, responsive behavior, theming, typography, spacing, layout, color, motion, micro-interactions, UX copy, error states, edge cases, i18n, design systems, tokens, live browser iteration, and ambitious visual effects. Not for backend-only or non-UI tasks.
development
Manually integrate Git branch work without blind mechanical merges. Use when merging, transplanting, or refactoring branch work; resolving conflicts; preserving source-branch intent in a clean current-branch structure; or auditing that source additions, removals, tests, and docs landed intentionally.
testing
Prepare, audit, set up, and guide Release Please releases. Use when releasing, preparing or reviewing a release PR, adding Release Please, classifying SemVer impact or breaking changes, writing Release Please-compatible Conventional Commit guidance, or documenting release criteria. Release work requires existing Release Please config; setup requires an explicit setup request.
development
Teach how code, a subsystem, architecture area, feature flow, module, API/data boundary, or relevant technical concept works for reviewers and maintainers. Use when the user asks to understand code or concepts; focus on design, responsibilities, contracts, data flow, invariants, tradeoffs, and maintenance implications, not syntax or line-by-line execution. Use `change-explainer` for diffs, commits, or patches.