/mithunyc-skills:design-lawsfrom mithunyc-skills
Product design upgrade for a UI: first finds steps, fields, and screens to delete or automate, then scores design quality 0-100 on workflow compression, hierarchy, cognitive ease, and momentum, and reports a separate pass/fail release gate (WCAG 2.2 AA, six states, dark patterns). Returns exact copy, token, and code fixes. Use for /design-laws, a scored design or UX audit, a usability teardown, UX laws applied to a screen, or grilling a design before build. Works on screenshots, wireframes, mockups, PRDs, user flows, and frontend code. Not for logos, brand identity, illustration, or motion alone.
Ships in mithunyc-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Turn a design artifact into a simpler product and an honest verdict. Delete before you polish. Every claim points at something in the artifact. Every fix is something a developer can paste.
Read the mode from $ARGUMENTS. If your tool does not substitute $ARGUMENTS, read it from the user's message after stripping a leading /design-laws or design-laws.
| First word | Mode |
|---|---|
audit, none, or anything else | Audit (default) |
grill | Grill |
fix | Fix |
Drop the first word only when it is audit, grill, or fix; everything else is the target. If there is no target in the message or conversation, ask for one in one line and stop. Never audit an imagined UI.
<skill-dir> is the folder that holds this file. Read a reference only when the step below needs it.
references/laws-and-archetypes.md: archetype profiles, the laws, precedence ladder, conflict matrix, slop ban list, dark patterns. Read before Step 2 and before writing any fix.references/scoring-and-gate.md: the 20 design checks, score formula, penalties, ceilings, the Release Gate, the six states, the worked example. Read before producing any score or gate status.scripts/contrast.mjs: node <skill-dir>/scripts/contrast.mjs [--tw 3|4] <fg> <bg>. Accepts hex, rgb(), hsl(), oklch(), and Tailwind tokens (slate-400, text-gray-700, bg-white). Never estimate a ratio when the colors are known. For Tailwind classes, first check the project's Tailwind config and CSS for overrides of that color and measure the override if one exists; otherwise read the Tailwind version from package.json, and if it is unknown run without --tw and report both versions.Audit and Fix run Steps 0 to 7. Grill runs Steps 0 to 3 as its own preparation (Step 0 supplies its first questions), then section 6.
Answer in at most 4 bullets:
Structural 10x Change removes steps, fields, or screens, or changes the flow or information architecture. Tactical In-Place Fix keeps the flow and fixes it in place within the current backend. Label every structural item Ships now (source: <quoted from the artifact, repository, or user>) or Needs: <capability> (Assumed).Rules: a deletion with no quoted source is Needs ... (Assumed), never Ships now. Generic autocomplete or "AI prefill" with no named data source is a Tactical fix, not a structural one. If nothing can be deleted or automated, name the three strongest candidates and the evidence that keeps each; a one-line "nothing to delete" is not an answer.
One compact block:
DESIGN.md. Use it; never invent a palette or scale when one exists.Scan path: <1st> -> <2nd> -> <3rd> for the first viewport at the widest and narrowest width shown, judged by optical weight (size, contrast, color, isolation, position) and marked Inferred. Say when the eye lands on decoration or a secondary control before the primary task's first action. It feeds Step 0 and the fix ranking; check marks still follow their own clauses.Not rendered and name what was missing.A screenshot cannot show CSS pixels, accessible names, focus behavior, or exact hex values. Never mark those Measured from an image.
Pick one primary archetype (at most one secondary) and give the evidence in one line: A marketing or landing, B high-density B2B or ops, C mobile, field, or offline-first, D multi-step conversion. The profile in laws-and-archetypes.md changes how checks are read. If unclear, state the narrowest assumption and continue.
One sentence: who, what they finish, and what counts as finished. Judge every finding against it. If the artifact does not show it, write Assumed: and continue (Audit, Fix) or make it the first question (Grill).
[F<n>] <element> | <law, check ID, or gate ID> | <Observed | Measured | Inferred | Unverified>
Consequence: <what the user fails to do, or what the business loses>
Fix: <exact copy string, token or px value, grid rule, or code diff>
Tradeoff: <what the fix costs, and why it is still worth it>
Tier: <Structural | Gate blocker | Friction | Polish>
Citations: code gets component, file:line when line numbers exist, and the exact class or prop; images get the region plus visible text in quotes; prose gets the quoted sentence. Never invent line numbers, token values, names, or behavior. Inferred states its reasoning in one clause. Unverified is a test to run, never a pass and never a penalty. A finding with no element, consequence, or concrete fix is deleted.
When two laws pull opposite ways, use the conflict matrix; if the pair is missing, use the precedence ladder and write Conflict: <X> vs <Y> -> <winner>, because <archetype or task reason>.
Follow scoring-and-gate.md exactly and show the arithmetic. Never adjust a number by feel; if the result looks wrong, re-check the marks.
Before sending, check your draft against the ban list in laws-and-archetypes.md. Rewrite any banned critique phrase that has no measurable spec after it, any fix that proposes a banned visual tell, any praise with no cited element, and any "consider", "could", or "might" that should be an instruction. Delete working notes, self-corrections, and thinking-aloud phrases ("Hmm", "Wait,", "Actually,") from the output.
No preamble. This order, nothing else:
# Design Laws Audit: <artifact>
**Design Score <n>/100 (<band>[, Provisional (low evidence)])** | Coverage <evaluated>/<applicable> applicable (<n> N/A), <percent>% | Release Gate: <PASS | BLOCKED (<blockers>) | INCOMPLETE (<what is unverified>)>
Archetype <A-D> | Primary task: <one sentence>
Keep: <one cited element a redesign must not break; omit if none>
Biggest bottleneck: <one cited element and its consequence>
## 10x Structural Rethink
<Step 0 bullets: Structural 10x Change, then Tactical In-Place Fix>
## Scorecard and Release Gate
| Dimension | Pass | Fail | Unverified | N/A | Failed checks |
(4 rows, D1 to D4)
Math: raw round(100 x <p> / <p+f>) = <r>; penalties <list>; ceilings <list>; final <n>.
Gate: list only Fail and Unverified items with evidence; passing items in one line.
## Top 5 highest-leverage fixes
<findings in Step 4 format, ranked Structural or Gate blocker, then Friction, then Polish; a `Ships now` deletion ranks first>
## Implementation specs
- Copy: `"<before>"` -> `"<after>"`
- Tokens and layout: exact values, contrast pairs with measured ratios
- Code: a diff for the top fix in the project's framework when source exists; otherwise a framework-neutral spec that names its missing dependencies
## Conflicts resolved
<only conflicts that changed a fix or its rank; omit the section if none>
## Next verification checks
- [ ] <exact steps to test each Unverified item>
- [ ] Blocking product question: <the one answer that most changes the design>
package.json, Tailwind or CSS config, one existing component. Match framework, naming, and tokens: reuse the project's semantic tokens and components, and use a raw hex or arbitrary value (text-[13px], bg-[#1e293b]) only when no token fits, named in the output as a proposed token. With no code, deliver a wireframe spec (regions, grid, type scale, copy, states) and say why.Ships now structural change exists, implement it first; otherwise start with the highest-ranked Tactical In-Place Fix. A Needs ... (Assumed) change is delivered as a spec, with code only after the user confirms the capability exists.aria-describedby for help and errors, aria-live="polite" for async status; exact copy for every label, button, empty state, error, and confirmation. Stay inside the files the fix needs.
<form> with a submit button, so Enter in a single-line field submits (a textarea or an open option list keeps Enter; a multi-step form validates and advances on intermediate steps and submits on the final step). Escape closes the innermost dialog, drawer, popover, or menu and returns focus to the control that opened it, or to the next logical control if it is gone. For reversible draft edits, keep the draft or offer undo; ask before discarding input only when it cannot be recovered.Enter and Escape where they apply, and report what you saw. Never claim a state works without triggering it.Before <n> -> After <n> (plus the new gate status) only when Before scored the actual unedited revision with the same primary task, applicability, and evidence level; otherwise render and score the unedited version first, or print After <n> alone and say there is no comparable baseline. If not rendered, print Not re-scored (not rendered), the checks the fix should flip, and the gate items still open.Goal: decide the design before anyone draws it, grounded in what the repository already says.
DESIGN.md, CONTEXT.md, CONTEXT-MAP.md, docs/adr/, design tokens, Tailwind or CSS config, and the target components. Never ask a question the repository already answers; state the answer you found and its file instead.Delete or automate this step as an option whenever it is viable. Give one recommendation tied to the archetype and the primary task. Use your tool's question interface if it has one.DESIGN.md for decisions, CONTEXT.md for terms). A yes covers only those two files: append each decision under a ## Design Decisions heading or each term under a ## Glossary heading, creating the heading or file only if missing, and never rewrite or delete existing text. A no means write nothing. An ADR in docs/adr/ needs its own question, asked only when a decision is hard to reverse, surprising without context, and the result of a real tradeoff.Decisions
D1 <topic>: <decision> (law or gate that drove it)
Open: <remaining topics>
/design-laws fix.What SKILL.md sets; muted values are Claude Code's defaults
30 skills in this plugin
/api-designerDesign or review API contracts, schemas, errors, pagination, idempotency, and compatibility. Use for API specification work rather than general server implementation./asd-ste100Write or clarify English technical instructions, tool descriptions, error messages, prompts, agent handoffs, and explanations with ASD-STE100-inspired rules. Use for disambiguate, STE100, Simplified Technical English, controlled-language rewrite, or dense technical text whose misreading has a cost. Preserve meaning and authority. Do not apply automatically to creative writing, marketing, verbatim quotations, or executable code./auth-integration-engineerDesign, implement, or diagnose authentication, identity-provider integration, sessions, tenant authorization, SSO, MFA, and account recovery.Other plugins' skills for the same job
npx claudepluginhub mithunyc/skills --plugin mithunyc-skills