SKILL.md

  1---
  2name: critique
  3description: "Evaluate design from a UX perspective, assessing visual hierarchy, information architecture, emotional resonance, cognitive load, and overall quality with quantitative scoring, persona-based testing, automated anti-pattern detection, and actionable feedback. Use when the user asks to review, critique, evaluate, or give feedback on a design or component."
  4argument-hint: "[area (feature, page, component...)]"
  5user-invocable: true
  6allowed-tools:
  7  - Bash(npx impeccable *)
  8---
  9
 10## STEPS
 11
 12### Step 1: Preparation
 13
 14Invoke {{command_prefix}}impeccable, which contains design principles, anti-patterns, and the **Context Gathering Protocol**. Follow the protocol before proceeding. If no design context exists yet, you MUST run {{command_prefix}}impeccable teach first. Additionally gather: what the interface is trying to accomplish.
 15
 16### Step 2: Gather Assessments
 17
 18Launch two independent assessments. **Neither must see the other's output** to avoid bias.
 19
 20You SHOULD delegate each assessment to a separate sub-agent for independence. Use your environment's agent spawning mechanism (e.g., Claude Code's `Agent` tool, or Codex's subagent spawning). Sub-agents should return their findings as structured text. Do NOT output findings to the user yet.
 21
 22If sub-agents are not available in the current environment, complete each assessment sequentially, writing findings to internal notes before proceeding.
 23
 24**Tab isolation**: When browser automation is available, each assessment MUST create its own new tab. Never reuse an existing tab, even if one is already open at the correct URL. This prevents the two assessments from interfering with each other's page state.
 25
 26#### Assessment A: LLM Design Review
 27
 28Read the relevant source files (HTML, CSS, JS/TS) and, if browser automation is available, visually inspect the live page. **Create a new tab** for this; do not reuse existing tabs. After navigation, label the tab by setting the document title:
 29```javascript
 30document.title = '[LLM] ' + document.title;
 31```
 32Think like a design director. Evaluate:
 33
 34**AI Slop Detection (CRITICAL)**: Does this look like every other AI-generated interface? Review against ALL **DON'T** guidelines in the impeccable skill. Check for AI color palette, gradient text, dark glows, glassmorphism, hero metric layouts, identical card grids, generic fonts, and all other tells. **The test**: If someone said "AI made this," would you believe them immediately?
 35
 36**Holistic Design Review**: visual hierarchy (eye flow, primary action clarity), information architecture (structure, grouping, cognitive load), emotional resonance (does it match brand and audience?), discoverability (are interactive elements obvious?), composition (balance, whitespace, rhythm), typography (hierarchy, readability, font choices), color (purposeful use, cohesion, accessibility), states & edge cases (empty, loading, error, success), microcopy (clarity, tone, helpfulness).
 37
 38**Cognitive Load** (consult [cognitive-load](reference/cognitive-load.md)):
 39- Run the 8-item cognitive load checklist. Report failure count: 0-1 = low (good), 2-3 = moderate, 4+ = critical.
 40- Count visible options at each decision point. If >4, flag it.
 41- Check for progressive disclosure: is complexity revealed only when needed?
 42
 43**Emotional Journey**:
 44- What emotion does this interface evoke? Is that intentional?
 45- **Peak-end rule**: Is the most intense moment positive? Does the experience end well?
 46- **Emotional valleys**: Check for anxiety spikes at high-stakes moments (payment, delete, commit). Are there design interventions (progress indicators, reassurance copy, undo options)?
 47
 48**Nielsen's Heuristics** (consult [heuristics-scoring](reference/heuristics-scoring.md)):
 49Score each of the 10 heuristics 0-4. This scoring will be presented in the report.
 50
 51Return structured findings covering: AI slop verdict, heuristic scores, cognitive load assessment, what's working (2-3 items), priority issues (3-5 with what/why/fix), minor observations, and provocative questions.
 52
 53#### Assessment B: Automated Detection
 54
 55Run the bundled deterministic detector, which flags 25 specific patterns (AI slop tells + general design quality).
 56
 57**CLI scan**:
 58```bash
 59npx impeccable --json [--fast] [target]
 60```
 61
 62- Pass HTML/JSX/TSX/Vue/Svelte files or directories as `[target]` (anything with markup). Do not pass CSS-only files.
 63- For URLs, skip the CLI scan (it requires Puppeteer). Use browser visualization instead.
 64- For large directories (200+ scannable files), use `--fast` (regex-only, skips jsdom)
 65- For 500+ files, narrow scope or ask the user
 66- Exit code 0 = clean, 2 = findings
 67
 68**Browser visualization** (when browser automation tools are available AND the target is a viewable page):
 69
 70The overlay is a **visual aid for the user**. It highlights issues directly in their browser. Do NOT scroll through the page to screenshot overlays. Instead, read the console output to get the results programmatically.
 71
 721. **Start the live detection server**:
 73   ```bash
 74   npx impeccable live &
 75   ```
 76   Note the port printed to stdout (auto-assigned). Use `--port=PORT` to fix it.
 772. **Create a new tab** and navigate to the page (use dev server URL for local files, or direct URL). Do not reuse existing tabs.
 783. **Label the tab** via `javascript_tool` so the user can distinguish it:
 79   ```javascript
 80   document.title = '[Human] ' + document.title;
 81   ```
 824. **Scroll to top** to ensure the page is scrolled to the very top before injection
 835. **Inject** via `javascript_tool` (replace PORT with the port from step 1):
 84   ```javascript
 85   const s = document.createElement('script'); s.src = 'http://localhost:PORT/detect.js'; document.head.appendChild(s);
 86   ```
 876. Wait 2-3 seconds for the detector to render overlays
 887. **Read results from console** using `read_console_messages` with pattern `impeccable`. The detector logs all findings with the `[impeccable]` prefix. Do NOT scroll through the page to take screenshots of the overlays.
 898. **Cleanup**: Stop the live server when done:
 90   ```bash
 91   npx impeccable live stop
 92   ```
 93
 94For multi-view targets, inject on 3-5 representative pages. If injection fails, continue with CLI results only.
 95
 96Return: CLI findings (JSON), browser console findings (if applicable), and any false positives noted.
 97
 98### Step 3: Generate Combined Critique Report
 99
100Synthesize both assessments into a single report. Do NOT simply concatenate. Weave the findings together, noting where the LLM review and detector agree, where the detector caught issues the LLM missed, and where detector findings are false positives.
101
102Structure your feedback as a design director would:
103
104#### Design Health Score
105> *Consult [heuristics-scoring](reference/heuristics-scoring.md)*
106
107Present the Nielsen's 10 heuristics scores as a table:
108
109| # | Heuristic | Score | Key Issue |
110|---|-----------|-------|-----------|
111| 1 | Visibility of System Status | ? | [specific finding or "n/a" if solid] |
112| 2 | Match System / Real World | ? | |
113| 3 | User Control and Freedom | ? | |
114| 4 | Consistency and Standards | ? | |
115| 5 | Error Prevention | ? | |
116| 6 | Recognition Rather Than Recall | ? | |
117| 7 | Flexibility and Efficiency | ? | |
118| 8 | Aesthetic and Minimalist Design | ? | |
119| 9 | Error Recovery | ? | |
120| 10 | Help and Documentation | ? | |
121| **Total** | | **??/40** | **[Rating band]** |
122
123Be honest with scores. A 4 means genuinely excellent. Most real interfaces score 20-32.
124
125#### Anti-Patterns Verdict
126
127**Start here.** Does this look AI-generated?
128
129**LLM assessment**: Your own evaluation of AI slop tells. Cover overall aesthetic feel, layout sameness, generic composition, missed opportunities for personality.
130
131**Deterministic scan**: Summarize what the automated detector found, with counts and file locations. Note any additional issues the detector caught that you missed, and flag any false positives.
132
133**Visual overlays** (if browser was used): Tell the user that overlays are now visible in the **[Human]** tab in their browser, highlighting the detected issues. Summarize what the console output reported.
134
135#### Overall Impression
136A brief gut reaction: what works, what doesn't, and the single biggest opportunity.
137
138#### What's Working
139Highlight 2-3 things done well. Be specific about why they work.
140
141#### Priority Issues
142The 3-5 most impactful design problems, ordered by importance.
143
144For each issue, tag with **P0-P3 severity** (consult [heuristics-scoring](reference/heuristics-scoring.md) for severity definitions):
145- **[P?] What**: Name the problem clearly
146- **Why it matters**: How this hurts users or undermines goals
147- **Fix**: What to do about it (be concrete)
148- **Suggested command**: Which command could address this (from: {{available_commands}})
149
150#### Persona Red Flags
151> *Consult [personas](reference/personas.md)*
152
153Auto-select 2-3 personas most relevant to this interface type (use the selection table in the reference). If `{{config_file}}` contains a `## Design Context` section from `impeccable teach`, also generate 1-2 project-specific personas from the audience/brand info.
154
155For each selected persona, walk through the primary user action and list specific red flags found:
156
157**Alex (Power User)**: No keyboard shortcuts detected. Form requires 8 clicks for primary action. Forced modal onboarding. High abandonment risk.
158
159**Jordan (First-Timer)**: Icon-only nav in sidebar. Technical jargon in error messages ("404 Not Found"). No visible help. Will abandon at step 2.
160
161Be specific. Name the exact elements and interactions that fail each persona. Don't write generic persona descriptions; write what broke for them.
162
163#### Minor Observations
164Quick notes on smaller issues worth addressing.
165
166#### Questions to Consider
167Provocative questions that might unlock better solutions:
168- "What if the primary action were more prominent?"
169- "Does this need to feel this complex?"
170- "What would a confident version of this look like?"
171
172**Remember**:
173- Be direct. Vague feedback wastes everyone's time.
174- Be specific. "The submit button," not "some elements."
175- Say what's wrong AND why it matters to users.
176- Give concrete suggestions, not just "consider exploring..."
177- Prioritize ruthlessly. If everything is important, nothing is.
178- Don't soften criticism. Developers need honest feedback to ship great design.
179
180### Step 4: Ask the User
181
182**After presenting findings**, use targeted questions based on what was actually found. {{ask_instruction}} These answers will shape the action plan.
183
184Ask questions along these lines (adapt to the specific findings; do NOT ask generic questions):
185
1861. **Priority direction**: Based on the issues found, ask which category matters most to the user right now. For example: "I found problems with visual hierarchy, color usage, and information overload. Which area should we tackle first?" Offer the top 2-3 issue categories as options.
187
1882. **Design intent**: If the critique found a tonal mismatch, ask whether it was intentional. For example: "The interface feels clinical and corporate. Is that the intended tone, or should it feel warmer/bolder/more playful?" Offer 2-3 tonal directions as options based on what would fix the issues found.
189
1903. **Scope**: Ask how much the user wants to take on. For example: "I found N issues. Want to address everything, or focus on the top 3?" Offer scope options like "Top 3 only", "All issues", "Critical issues only".
191
1924. **Constraints** (optional; only ask if relevant): If the findings touch many areas, ask if anything is off-limits. For example: "Should any sections stay as-is?" This prevents the plan from touching things the user considers done.
193
194**Rules for questions**:
195- Every question must reference specific findings from the report. Never ask generic "who is your audience?" questions.
196- Keep it to 2-4 questions maximum. Respect the user's time.
197- Offer concrete options, not open-ended prompts.
198- If findings are straightforward (e.g., only 1-2 clear issues), skip questions and go directly to Step 5.
199
200### Step 5: Recommended Actions
201
202**After receiving the user's answers**, present a prioritized action summary reflecting the user's priorities and scope from Step 4.
203
204#### Action Summary
205
206List recommended commands in priority order, based on the user's answers:
207
2081. **`{{command_prefix}}command-name`**: Brief description of what to fix (specific context from critique findings)
2092. **`{{command_prefix}}command-name`**: Brief description (specific context)
210...
211
212**Rules for recommendations**:
213- Only recommend commands from: {{available_commands}}
214- Order by the user's stated priorities first, then by impact
215- Each item's description should carry enough context that the command knows what to focus on
216- Map each Priority Issue to the appropriate command
217- Skip commands that would address zero issues
218- If the user chose a limited scope, only include items within that scope
219- If the user marked areas as off-limits, exclude commands that would touch those areas
220- End with `{{command_prefix}}polish` as the final step if any fixes were recommended
221
222After presenting the summary, tell the user:
223
224> You can ask me to run these one at a time, all at once, or in any order you prefer.
225>
226> Re-run `{{command_prefix}}critique` after fixes to see your score improve.