Skip to content

pattern-consistency

Finds behavior that differs across the product and picks the rule.

When your agent loads it

Audit whether an interface behaves consistently — how destructive actions confirm, how modals close, how loading, empty, and error states look, when validation fires, how success is confirmed, what terms and labels are used, how dates and numbers are formatted, and where primary actions sit. Inventories each behavior across the product, identifies variants, chooses a canonical pattern with rationale, and produces a migration plan. Use when a product has grown across teams or AI-generated features, when similar features feel different, before extracting a design system, or when users report that the same action works differently in different places. Triggers on "inconsistent", "consistency audit", "every modal behaves differently", "standardize", "UX debt". Not for visual token consistency alone (spacing, colors).

Group
Product scale
Produces
Canonical rules + migration
Length
165 lines
npx skills add aviralj02/interface-skills --skill pattern-consistency

Installs only this skill. Add -g to install globally.

View source

PurposeLink to this section

Users learn an interface once and expect that knowledge to transfer. When deleting a comment asks for confirmation, deleting a file shows an undo toast, and deleting a project does neither, users cannot build a model of the product. This skill finds behavioral inconsistencies, decides which variant should win, and plans the convergence.

Visual consistency (spacing, color, radius) matters, but this skill is about behavior and language: what happens, when, and what it is called.

When to UseLink to this section

  • A codebase built by multiple people, teams, or agents over time
  • Before a design system or component library effort (feeds design-system-evolution)
  • After a round of rapid feature work
  • Users or reviewers notice "it works differently over there"

Core PrinciplesLink to this section

  1. Consistency is about expectations, not sameness. Different situations may deserve different patterns; the same situation should not.
  2. Inventory before opinions. Collect every variant with its location before choosing a winner.
  3. Canonical choices need a rule, not a preference. "Use undo for recoverable deletes, confirmation for irreversible" is a rule. "Use the one in settings" is not.
  4. Intentional exceptions are documented. An exception with a reason is a pattern; one without is drift.
  5. Converge incrementally, prioritized by user impact.

WorkflowLink to this section

1. Choose the audit categoriesLink to this section

Behavioral categories to inventory:

CategoryWhat to compare
Destructive actionsconfirm vs undo vs nothing; button labels; placement
Dialogs & overlaysclose on Escape, on outside click, close button presence, unsaved-change guard, focus return
Loadingfirst-load treatment (skeleton/spinner/none), refetch treatment, button pending state
Empty statespresence, structure, action
Errorsinline vs toast vs page; retry presence; wording
Form validationwhen it fires (on blur / on change / on submit); error placement; required-field marking
Success feedbacktoast vs inline vs redirect vs nothing
Saving modelexplicit Save button vs autosave; unsaved change indicators
Action placementprimary action location (top-right, bottom, sticky footer); order of Cancel/Confirm
Navigationwhere detail views open (page/drawer/modal); back behavior; what's in the URL
Tables & listssorting, selection, bulk actions, pagination vs infinite scroll, row click behavior
Terminologynames for the same object or verb (delete/remove, workspace/organization)
Formattingdates (relative/absolute, format), numbers, currency, time zones, name display
Permissionshidden vs disabled vs explained
Keyboardshortcuts, Enter-to-submit, Escape behavior

Pick the categories relevant to the product; don't audit everything at once.

2. Inventory variantsLink to this section

For each category, find every instance. In code, search for signals:

CategorySearch signals
Destructivedelete, remove, destroy, confirm(, window.confirm, dialog components with "danger"/"destructive" variants
Dialogsdialog/modal component imports; onClickOutside, closeOnOverlayClick, onEscapeKeyDown props
LoadingisLoading, isPending, Spinner, Skeleton, Loader usages
Errorstoast.error, catch, error boundary components, ErrorMessage/Alert usages
Validationform library mode/reValidateMode settings, onBlur validation handlers
Terminologygrep the UI strings/i18n catalog for synonyms
FormattingtoLocaleDateString, format(, Intl., date library calls, hard-coded formats

If the app runs, walk the equivalent flows side by side and record what happens.

Record:

CategoryVariantWhere (route / file)Count
Deletewindow.confirm("Are you sure?")comments, tags2
Deletecustom dialog "Delete X?"projects, members2
Deleteundo toasttasks1
Deleteno safeguardfiles1

3. Classify each differenceLink to this section

  • Justified variation: different situation warrants a different pattern (irreversible project delete vs recoverable task delete). Document the rule.
  • Drift: same situation, different behavior. Needs convergence.
  • Defect: a variant that is harmful regardless of consistency (no safeguard on irreversible delete). Fix first.

4. Choose canonical patternsLink to this section

For each drift, pick the canonical pattern using, in order:

  1. The variant that best serves users in that situation (consult the relevant skill: destructive-actions, interface-states, async-interactions, ux-writing, focus-management)
  2. The variant closest to platform conventions
  3. The most common variant (cheaper migration)

Write the rule: situation → pattern, plus allowed exceptions.

5. Plan the migrationLink to this section

Prioritize by impact:

  • P0: defects (data loss risk, inaccessible behavior)
  • P1: drift in high-traffic flows or core actions
  • P2: drift in secondary areas
  • P3: terminology and formatting cleanups

For each item: what changes, where, and whether a shared component or utility should be created first so the fix sticks (hand off to design-system-evolution).

6. Prevent regressionLink to this section

  • Encode rules in shared components (a ConfirmDestructive or useUndoableDelete), lint rules (ban window.confirm), i18n glossary checks, or a PR checklist.
  • Document patterns where contributors and agents will read them (a PATTERNS.md, the design system docs, or agent instructions).

ChecklistLink to this section

  • Audit categories chosen and scoped
  • Every variant recorded with location and count
  • Differences classified as justified, drift, or defect
  • Canonical pattern chosen with a written situation → pattern rule
  • Exceptions documented with reasons
  • Migration prioritized by user impact
  • Regression prevention defined (component, lint, docs, checklist)

Common MistakesLink to this section

  • Standardizing on the most common variant even when it's the worst one.
  • Forcing sameness across different situations — confirming every delete because some deletes need confirmation.
  • Auditing visuals only while dialogs close three different ways.
  • Producing a report with no canonical decision, so nothing changes.
  • Fixing instances one by one without a shared component, so drift returns next sprint.
  • Ignoring terminology, which is the cheapest and most visible inconsistency to fix.

ExampleLink to this section

Category: dialog closing behavior

VariantWhereEscapeOutside clickUnsaved guardFocus return
ACreate projectclosescloses (loses input)nono
BEdit memberclosesignorednoyes
CBilling addressignoredclosesyesyes
DConfirm deleteclosesignoredn/ayes

Rule chosen:

  • Escape always closes; if there is unsaved input, show "Discard changes?" first.
  • Outside click closes only dialogs with no input (informational, confirmations); ignored for forms.
  • Focus returns to trigger in all cases.

Migration: A (P0 — data loss on outside click), C (P1 — Escape broken), B (P2 — add unsaved guard). Implement once in the shared Dialog wrapper via a hasUnsavedChanges prop; remove per-dialog overrides.

Implementation NotesLink to this section

  • The most durable fix is a shared primitive with the rule built in and escape hatches that require a reason.
  • Terminology: centralize in the i18n catalog and add a glossary check in CI for banned synonyms.
  • For AI-generated codebases, add the canonical rules to the agent's instructions file so new features follow them.

Output ExpectationsLink to this section

Produce:

  1. Scope — categories audited and what was examined (routes, files, flows).
  2. Variant inventory per category — Variant | Where | Count.
  3. Classification — justified / drift / defect for each difference.
  4. Canonical rules — situation → pattern, with exceptions.
  5. Migration plan — prioritized items with locations and the shared primitive to introduce.
  6. Regression prevention steps.