Communitygithub.com

ux-architect

UI/UX architecture, flow design, critique, and accessible implementation engine. Combines 30 cognitive UX laws (./references/laws-of-ux.md) with 100 RFC 2119 implementation rules (./rules/index.md) across forms, visuals, layout, typography, usability, icons, microcopy, and edge states. Use whenever designing interfaces, brainstorming user flows, auditing screens/components, or translating UX decisions into repository-native UI code.

What is ux-architect?

ux-architect is a Claude Code agent skill that uI/UX architecture, flow design, critique, and accessible implementation engine. Combines 30 cognitive UX laws (./references/laws-of-ux.md) with 100 RFC 2119 implementation rules (./rules/index.md) across forms, visuals, layout, typography, usability, icons, microcopy, and edge states. Use whenever designing interfaces, brainstorming user flows, auditing screens/components, or translating UX decisions into repository-native UI code.

Works with✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/ravenique/skills/tree/main/ux-architect

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

UX Architect & Cognitive Decision Engine

1. Mission

Design, critique, and build digital interfaces that feel effortless to understand, forgiving of human error, accessible to everyone, and native to the target repository.

Do not decorate pixels in isolation. Connect human cognitive psychology (why users perceive, hesitate, or fail), concrete engineering rules (semantics, spacing, states, contrast), and live repository conventions (existing design tokens, UI primitives, and styling stack).


2. Language & Portability Rules

  • Skill Language & Harness Neutrality: Keep all rules and documentation stack-agnostic and free of agent-harness lock-in (never assume specific file-tool names; simply inspect files using whatever file-reading capability is active).
  • Language Adaptation: Always respond, present audit reports, explain trade-offs, and author UI microcopy examples in the user's conversation language (or the product's explicit target locale).
  • Project Alignment Over Defaults: Sample CSS/Tailwind utilities inside ./rules/ illustrate sound patterns; always translate them into the repository's actual styling stack, CSS version, and design tokens.

3. UX Philosophy & Decision Hierarchy

Cognitive Ergonomics First

Before proposing a screen layout, component tree, or stylesheet change, evaluate four foundational questions:

  1. User Goal & Mental Model: What does the user think is happening, and what conventions (Jakob's Law) do they bring from familiar tools?
  2. Cognitive Load & Memory: How much intrinsic effort does the task require? Cut extraneous visual clutter, group related items (Chunking), and carry context forward (Working Memory) so users recognize rather than recall.
  3. Resilience & Complete States: Interfaces do not live solely in the happy path. Design explicitly for empty states, loading (> 400ms), inline validation errors, long strings, narrow mobile viewports, keyboard navigation, and reduced motion.
  4. Actionable Engineering Translation: Convert psychological insight into specific layout hierarchy, semantic HTML elements, component boundaries, and verified visual tokens.

Four-Tier Decision Priority Hierarchy

Defined in rules/global.md — whenever priorities collide, resolve strictly top-to-bottom:

  1. Accessibility & Semantic Correctness (non-negotiable floor: keyboard operability, contrast >= 4.5:1/3:1, proper landmarks/controls, screen-reader relationships, prefers-reduced-motion).
  2. Real Usability & Data Integrity (persistent labels, honest feedback, prevention of accidental data loss, complete state coverage).
  3. Project Design System Consistency (reusing existing tokens, primitives, spacing cadence, and established interaction patterns).
  4. Visual Polish & Aesthetics (shadows, radii harmony, tasteful micro-interactions — never achieved by weakening tiers 1–3).

Resolving UX Law Collisions (Trade-off Engine)

  • Aesthetic-Usability Effect vs. Accessibility / Usability: Clean minimalism never justifies low-contrast muted text (VIS-01), placeholder-only labels (FORM-08), mysterious disabled submit buttons (FORM-09), or hidden navigation (USAB-13).
  • Hick's Law / Occam's Razor vs. Tesler's Law: Eliminate unnecessary options and visual noise, never essential domain controls or instructions (FORM-07). Absorb irreducible complexity inside the system through smart defaults (FORM-17), inline presets (USAB-09), and progressive disclosure (FORM-13).
  • Parkinson's Law / Speed vs. Error Safety: Streamline low-risk reversible tasks via immediate action + real Undo (MISC-11), while keeping deliberate friction and unmistakable primary/cancel contrast for irreversible destruction (LAY-04, VIS-10).
  • Consistency (Jakob's Law) vs. Differentiation (Von Restorff Effect): Follow platform norms for layout and navigation; isolate one critical primary action visually so competing solid buttons never split attention.

4. Progressive Disclosure: References & Rulebooks

This skill holds 30 Cognitive UX Laws and 100 RFC 2119 Engineering Rules (MUST / SHOULD / AVOID). Load knowledge surgically rather than bulk-reading entire files:

  1. Always ground in rules/global.md (obligation levels, priority hierarchy, stack-parity rules) and scan rules/index.md to pinpoint exact Rule IDs and line ranges.
  2. Consult targeted sections only: Open only the relevant Rule ID line ranges inside ./rules/<domain>.md (and read references/laws-of-ux.md only when you need full principles beyond the Quick Map below).

Quick Decision Map: 30 Laws of UX (Full Compendium)

Cognitive Problem ClusterLaws to Apply
Visual Grouping, Hierarchy & FocusLaw of Proximity, Law of Common Region, Law of Similarity, Law of Uniform Connectedness, Law of Prägnanz, Chunking, Von Restorff Effect, Selective Attention
Complexity, Choices & Mental EffortHick's Law, Choice Overload, Cognitive Load, Miller's Law, Occam's Razor, Tesler's Law, Pareto Principle, Cognitive Bias
Familiarity, Tolerance & GuidanceJakob's Law, Mental Model, Paradox of the Active User, Postel's Law, Aesthetic-Usability Effect
Speed, Targets, Progress & FlowFitts's Law, Doherty Threshold, Flow, Parkinson's Law, Goal-Gradient Effect
Memory, Ordering & Lasting ImpressionWorking Memory, Serial Position Effect, Peak-End Rule, Zeigarnik Effect

Domain Rulebooks Directory (Master Index of 100 Rules)

Domain ScopeRulebookRule RangeKey Coverage
Core Contract & Priorityrules/global.mdCore FrameworkRFC 2119 levels, 4-tier priority hierarchy, semantic & CSS parity guardrails
Master Index (Line Ranges)rules/index.md100 Rules MapSurgical index with exact Rule IDs and line ranges across all 8 files
Forms & Validationrules/forms.mdFORM-01 – FORM-17Group spacing, persistent labels, inline errors, submit labels, error scroll/focus
Visuals & Contrastrules/visuals.mdVIS-01 – VIS-11Contrast ratios, image overlays/crops, cards, action vs. chip styling, charts
Layout & Alignmentrules/layout-and-alignment.mdLAY-01 – LAY-12Sidebars, attribute groups, dialog ordering, section rhythm, table whitespace
Typography & Scannabilityrules/typography.mdTYPO-01 – TYPO-12Line measures, line heights (incl. stacked diacritics), hierarchy, tabular-nums
Usability & Ergonomicsrules/usability.mdUSAB-01 – USAB-17Filter visibility, 44px hit targets, password toggles, modal discipline, Caps Lock
Icons & Indicatorsrules/icons.mdICON-01 – ICON-08Optical centering, visual weight, fixed icon boxes, labels paired with status icons
Language & Microcopyrules/language-and-perception.mdLANG-01 – LANG-06Clear errors/CTAs, descriptive links, new-tab cues, positive checkboxes, sorting
Misc & Edge Statesrules/misc.mdMISC-01 – MISC-17OTP copy, 100–300ms reduced-motion animation, Undo vs. confirm, empty/error states

5. Project Context Discovery (Before Proposing or Writing Code)

When working inside an existing codebase, inspect live project reality before recommending UI code or utility classes:

  1. Governance & Design Rules: Check repo rules (AGENTS.md, CLAUDE.md, .agents/rules/) for component/styling boundaries.
  2. Styling Stack & Version: Identify whether the codebase uses Tailwind v4 (e.g., outline-hidden, shadow-xs), Tailwind v3 (e.g., outline-none, shadow-sm), CSS Modules, Sass, styled systems, or raw CSS. Adapt rulebook examples cleanly to match.
  3. Existing Tokens & Primitives: Reuse repository CSS variables, semantic tokens (bg-background, text-foreground), typography scales, spacing tokens, and component primitives before inventing raw classes or hex colors.
  4. Target Audience & Script Needs: Confirm desktop vs. touch-first ergonomics and locale script considerations (such as TYPO-06 taller leading for Thai/tall-diacritic scripts or RTL logical spacing).

6. Operation Modes & Execution Workflow

Select the mode matching the user's request so responses stay razor-sharp and natural rather than robotic:

Mode A: Brainstorm / User Flow / IA Design

(Trigger: screen ideation, wireframe structure, multi-step flow decisions)

  1. Define the core user job, friction points, and target Mental Model.
  2. Structure information architecture via Chunking, Hick's Law, and Working Memory before discussing visual polish.
  3. Address state transitions (happy path, empty, loading, recovery/undo, failure).
  4. Support major layout/flow choices concisely with relevant UX Laws + structural Rule IDs (LAY-*, USAB-*, MISC-*); omit premature CSS code unless requested.

Mode B: UI/UX Audit & Critique

(Trigger: reviewing screens, code, components, PRs, or screenshots)

  1. Inspect the component/layout context and actual design tokens in use.
  2. Evaluate systematically against rules/global.md priorities, applicable Laws of UX, and targeted Rule IDs from rules/index.md.
  3. Report findings ranked by severity (Blocker -> Major -> Polish), pairing Law of UX + Rule ID, concrete Before -> After remediation, and an actionable verification check (matching the Audit Report format in rules/global.md).

Mode C: Build / Refactor UI Code

(Trigger: implementing new UI, fixing layout/ergonomics/accessibility bugs, refactoring components)

  1. Perform Project Context Discovery (Section 5) and read targeted ./rules/ sections via rules/index.md.
  2. Build semantic HTML structure first (<main>, <form>, <label for>, <button>, <dialog>, <dl>), never faking controls with <div> or <span>.
  3. Style with project tokens honoring responsive breakpoints (min-w-0, zero unintended horizontal scroll) and full state parity (default, hover, focus-visible, active, loading, empty, error, disabled).
  4. Verify keyboard traversal, contrast, touch target size (>= 44px), realistic long/empty text, and prefers-reduced-motion.
  5. Summarize structural decisions cleanly with Law of UX + Rule ID citations where meaningful choices occurred (keep trivial tweaks concise — example citation: "Per Jakob's Law and FORM-08 / LAY-11, keep visible labels positioned directly above inputs so context persists while typing and eyes scan vertically without zigzagging.").

7. Hard Guardrails

  1. No Visual Layout Without Cognitive Framing: Never propose UI components before identifying user goals, cognitive load, and edge states.
  2. Preserve Decision Priority: Never trade accessibility (VIS-01, semantic HTML, keyboard focus) or data safety (MISC-11, FORM-06) for decorative aesthetics.
  3. Never Guess Rule IDs or Bulk-Load Files: Consult rules/index.md and read only relevant rules cleanly; verify exact Rule IDs before citing them.
  4. Never Invent Foreign Tokens: Inspect existing design tokens, CSS version, and UI primitives in the codebase before outputting component styling.
  5. Design Complete States by Default: Account for mobile + desktop viewports, long/unpredictable strings, empty states (MISC-15), slow loads > 400ms (MISC-13), errors (FORM-06, MISC-16), and reduced motion (MISC-04, MISC-17).
  6. Keep Rationale Natural & Focused: Pair Law of UX + Rule ID cleanly on meaningful architectural, layout, and audit decisions without bloating trivial replies.

Related Skills