perfection-loop
Skill0 starsChanged 27 days agoMITView on GitHub
A relentless verify-and-fix loop that proves work is actually finished instead of just delivered. Use this skill after making ANY change to a frontend or UI (web page, app screen, component, CSS, layout, animation, responsive behavior) and BEFORE telling the user it is done. Also use it whenever the user reports a visual or UI bug, attaches a screenshot of something wrong, or says things like 'make sure it's perfect', 'verify it', 'double check', 'polish', 'production ready', 'no issues', or 'why is it still broken'. Captures the real running result, sends independent adversarial judge sub-agents to inspect it, logs every defect, fixes them, and repeats until a fresh full review finds zero defects. Use it even when the change looks small, because small changes are where regressions hide. Also applies to any non-UI task where 'done' must be proven with evidence (tests, command output, API responses) rather than asserted. 无情的验证-修复循环,证明工作真正完成而非仅交付。任何前端/UI变更后、告诉用户完成前必须使用。触发词:完美验证, 视觉回归, UI修复, 像素级校验, 生产就绪, 零缺陷, 验证修复循环, 确保完美, 再检查一遍.
In this repository33 other files it gives its agents.
- ad-creativeSkill
- adsSkill
- ai-writing-detectorSkill
- boxim-release-assistantSkill
- business-toolboxSkill
- codebase-analyzerSkill
- code-quality-reviewSkill
- code-to-prdSkill
- context-modeSkill
- conversational-ai-dev-workflowSkill
- copywritingSkill
- croSkill
- design-taste-frontendSkill
- diagram-designSkill
- douyin-to-feishu-archiverSkill
- github-tech-optimizerSkill
- git-safety-guardSkill
- gsap-scroll-landingSkill
- image-to-codeSkill
- inverse-thinking-content-creatorSkill
- ios-ui-ux-devSkill
- mobile-app-ui-designSkill
- project-finishing-workflowSkill
- rea-reverse-engineeringSkill
- reverse-engineering-suiteSkill
- site-launch-checklistSkill
- skill-forgeSkill
- skill-installerSkill
- socialSkill
- uniapp-multi-platform-auditSkill
- uniapp-release-notesSkill
- video-content-extractionSkill
- wechat-article-htmlSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
19 rules. About 0 are common, 15 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈15
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 18
Evidence or it did not happen: Every defect cites a screenshot and a location.
- Distinctive: line 20
Perfect means zero open defects, not zero effort: Keep going until the ledger is empty.
- Very specific: line 36
Keep working files in .perfection/ at the project root (add it to .gitignore if the project has one, and mention it to the user once).
- Very specific: line 40
Before touching anything, write .perfection/contract.md.
- Distinctive: line 49
If the user attached a screenshot of a problem, describe precisely what is wrong in it and make "that specific thing is gone, in that same …
- Very specific: line 57
Follow references/capture.md.
- Distinctive: line 59
Run the real app (dev server or built output) and drive a real browser.
- Very specific: line 61
Run the automated checks (scripts/capture.py does console errors, failed requests, horizontal overflow, broken images, small tap targets, …
- Distinctive: line 63
If you truly cannot run a browser, say so explicitly, do the strongest verification you can (build, typecheck, tests, DOM inspection), and …
- Distinctive: line 88
When unsure, go Full. Under-reviewing is the failure mode.
- Distinctive: line 115
After fixing, look at the result yourself first, then return to Step 3 with a full recapture.
- Distinctive: line 120
Stop only when all are true:
- Distinctive: line 125
Every acceptance criterion in the contract is ticked with a pointer to the screenshot that proves it.
- Distinctive: line 128
If a round finds even one defect, you are not done.
- Distinctive: line 134
Per-defect stall: if the same defect survives 3 fix attempts, stop patching.
- Distinctive: line 135
Whole-loop stall: if two consecutive rounds do not reduce the open-defect count, or you are at round 8, stop looping.
- Distinctive: line 136
Oscillation: if a fix for judge X breaks judge Y's criterion, that is a real tension.
- Distinctive: line 145
Keep it short and honest. The user does not want a victory lap, they want to know what is true.
- Distinctive: line 155
Never write "perfect" or "no issues" unless the exit criteria are literally met.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Perfection Loop
Your job here is not to deliver. It is to finish.
The failure this skill exists to prevent: you write code, you believe it is correct, you never look at what it actually produced, and you announce "done". Even when you do look, you are the worst possible judge of your own work, because you know what you meant and your eyes fill it in. A fresh reviewer with a screenshot and a hostile mindset finds problems in seconds that the author swore were not there.
So the rule is simple: nothing is done until independent judges have looked at the real running result and found nothing wrong. "Good enough" is not a state this skill recognizes. Production means no known defects.
Principles (and why they exist)
- Never trust code you have not seen run. Reading a diff tells you what you wrote. Only the rendered result tells you what the user gets.
- The author is a biased judge. Judges are separate, start with fresh context, and never see your reasoning or your claim that it is fine. Anchoring on the author's confidence is how defects survive.
- Evidence or it did not happen. Every defect cites a screenshot and a location. Every "pass" cites what was inspected. A judge that cannot point at pixels does not get to report.
- Any change invalidates every earlier pass. A fix in one place breaks another. After every change, recapture everything and review again. The final clean review must be on the final code.
- Perfect means zero open defects, not zero effort. Keep going until the ledger is empty. But if you are stuck, stop and say so. Never claim perfection you have not proven.
- Fix defects against intent; do not redesign. The user's brief and existing design decisions win over your taste. Judges find what is broken, not what they would have done differently.
The loop at a glance
0. CONTRACT write down what "perfect" means for this task
1. REPRODUCE (bug fixes) see the user's problem with your own eyes first
2. BUILD / FIX make the change
3. CAPTURE screenshot the real running result across the full matrix + automated checks
4. JUDGE parallel independent judges review the evidence
5. TRIAGE verify each finding is real, log it in the ledger
6. FIX root-cause fixes, then go back to 3 (full recapture, never partial)
7. EXIT only when the exit criteria below are all true, then report honestlyKeep working files in .perfection/ at the project root (add it to .gitignore if the project has one, and mention it to the user once). Contents: contract.md, ledger.md, round-N/ folders of screenshots and judge reports.
Step 0: Contract
Before touching anything, write .perfection/contract.md. Judges are only as good as the standard they are held to, and "make it good" is not checkable. Include:
- Goal: one sentence.
- Acceptance criteria: concrete, checkable statements. Derive them from the request, from any screenshot the user sent, and from the existing design system in the codebase. "The Save button is fully visible and not clipped at 375px width" is checkable. "Looks nice" is not.
- Do-not-change list: what is out of scope and must stay identical.
- Verification matrix: viewports, states, themes, and flows that matter here (see
references/capture.mdfor defaults). - Design mode: pick one (from Impeccable). Persuade (landing pages, marketing: earn attention), Operate (app UI, dashboards, tools: scanability and consistency outrank expression), Read (docs, articles: comprehension first), Experience (portfolios, showcases: the artifact leads). Judges weigh things differently per mode.
- Locked decisions: choices already made and accepted (the user approved the palette, the layout is intentional). Judges may not reopen these. This is what stops the loop from oscillating.
If the user attached a screenshot of a problem, describe precisely what is wrong in it and make "that specific thing is gone, in that same view" acceptance criterion #1. The user's own reports are never disputable.
Step 1: Reproduce (for bug fixes)
Capture the broken view yourself before fixing anything, at the same viewport and state as the user's screenshot if you can infer it. If you cannot reproduce it, say so and ask for the viewport, browser, or steps. Do not "fix" a problem you have not seen; you will fix the wrong thing and declare victory.
Step 3: Capture
Follow references/capture.md. The essentials:
- Run the real app (dev server or built output) and drive a real browser. Not the code, not your mental model.
- Capture the full matrix from the contract: multiple viewports, relevant states (hover, focus, open menus, empty, loading, error, long content), light and dark if supported, reduced motion.
- Run the automated checks (
scripts/capture.pydoes console errors, failed requests, horizontal overflow, broken images, small tap targets, missing alt/lang/title). - Look at the screenshots yourself with the image viewer. Before judging, write two or three plain sentences per key screenshot describing what is literally visible. This forces real looking instead of assumed looking.
- If you truly cannot run a browser, say so explicitly, do the strongest verification you can (build, typecheck, tests, DOM inspection), and tell the user visual verification did not happen. Never imply it did.
Step 4: Judge
Dispatch the judge panel in parallel as separate sub-agents. The full prompts live in references/judges.md; read that file now and use them verbatim, filling in the placeholders.
Each judge receives only: the contract, the paths to evidence (screenshots, automated report, relevant source files where its rubric says so), its rubric, and the output schema. Each judge must not receive: your reasoning, your opinion of the work, what you intended, or other judges' findings. Anchoring on any of these makes them agreeable, and agreeable judges are useless.
The panel:
| Judge | Owns |
| A. Requirements | Contract compliance, the user's original complaint, scope creep, silently dropped requirements |
| B. Layout | Spacing, alignment, overflow, clipping, responsiveness, imagery |
| C. Design craft | Hierarchy, typography, color, consistency, distinctiveness |
| D. Interaction & UX | States, feedback, flows, forms, dead ends |
| E. Accessibility | Contrast, focus, keyboard, semantics, touch targets |
| F. Motion | Animation purpose, easing, duration, performance, reduced motion |
| G. Copy | Microcopy, labels, errors, empty states, invented content |
| H. Technical | Console, network, build, lint, layout shift, automated report |
| I. Regression | Before/after comparison. Round 2 onward. |
Scale the panel to the change, but never to your confidence:
- Light (a CSS tweak, one bug fix): A, B, H, I, plus any judge whose area the change touches.
- Full (new component, new page, redesign, anything with interaction or motion): the whole panel.
- When unsure, go Full. Under-reviewing is the failure mode; over-reviewing only costs tokens.
No sub-agents available? Run each judge as its own sequential pass. Between passes, discard your build intent: re-open the screenshots fresh, read only that judge's rubric, and write its report to .perfection/round-N/judge-X.md before starting the next. This is weaker than true independence because you still carry the bias, so compensate by being harsher and by making the evidence rule strict.
Step 5: Triage
- Verify each finding is real. Open the cited screenshot region and look. Judges hallucinate sometimes. A finding you cannot see is a false positive: mark it
disputedwith what you saw instead. Only evidence can dispute a finding, never "I think it is fine". - Merge duplicates across judges into one ledger entry.
- Log everything in
.perfection/ledger.md:
| ID | Sev | Status | Round found | Where (screenshot @ viewport/state) | Observed | Fix attempts |Statuses: open, fixed (fixed and awaiting re-review), verified (a later clean review confirmed it), disputed (with evidence, re-checked by next round), waived (P3 only, with a written reason).
Severity:
- P0 Broken. Crash, blocked flow, unreadable, content missing, the reported bug still present.
- P1 Clearly wrong. Visible layout break, overlap, clipping, contrast failure, broken state, console error.
- P2 Noticeably off. Inconsistent spacing, weak hierarchy, awkward wrap, missing state, jarring motion.
- P3 Fine detail. 1-2px misalignment, minor copy tweak, subtle polish.
Step 6: Fix
- Find the root cause, not the symptom. If a button is clipped, ask why, then check whether the same cause clips other things.
- Make the smallest change that fixes it. Do not touch what is not broken.
- Respect locked decisions and the do-not-change list.
- After fixing, look at the result yourself first, then return to Step 3 with a full recapture. Never re-check only the thing you fixed.
- Watch for CSS traps: selector specificity cancelling out padding or margin between sections,
transition: all, fixed pixel widths, z-index wars, missingmin-width: 0on flex children,100vhon mobile.
Exit criteria
Stop only when all are true:
- The last full recapture happened on the final code, with no edits since.
- The most recent judge round returned zero defects, and every zero-finding report lists what it inspected.
- The ledger has no
openorfixedentries. EveryP3isverifiedorwaivedwith a reason. - Every acceptance criterion in the contract is ticked with a pointer to the screenshot that proves it.
- The automated checks are clean.
If a round finds even one defect, you are not done. Fix, recapture, rejudge.
Being stubborn without thrashing
Loops fail two ways: quitting early, and spinning forever. Guard against both.
- Per-defect stall: if the same defect survives 3 fix attempts, stop patching. Re-read the relevant code end to end, question your diagnosis, and try a structurally different approach (simplify, remove the competing rule, rebuild the component). Log what you learned.
- Whole-loop stall: if two consecutive rounds do not reduce the open-defect count, or you are at round 8, stop looping. Something is wrong with the approach or the judges are oscillating.
- Oscillation: if a fix for judge X breaks judge Y's criterion, that is a real tension. Do not keep trading. Pick the option that satisfies the contract, record it as a locked decision, and tell the user about the trade-off.
- When stopped: report honestly what remains, what you tried, and your best recommendation. An honest "3 issues remain, here is why" beats a false "perfect".
Non-visual work
The same loop applies anywhere "done" can be faked. Swap the evidence: run the tests, execute the CLI, call the endpoint, read the logs, diff the output against the expectation. Judges then read real output instead of screenshots. Rule 1 still holds: never report success on something you did not execute.
Final report
Keep it short and honest. The user does not want a victory lap, they want to know what is true.
Verified: <what, across which viewports/states/themes>
Rounds: <n> Defects found: <n> Fixed: <n> Waived: <n> (reasons)
Evidence: .perfection/round-<last>/ (screenshots), .perfection/ledger.md
Not verified: <e.g. real iOS Safari, screen reader, slow network, real device>
Open issues: <none, or list with what was tried>Never write "perfect" or "no issues" unless the exit criteria are literally met. Always list what you did not or could not verify.
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.

