mcpField
W
web-rules

web-rules

github.com/pproencaDesign & UI218161 installsUpdated 11w ago
Repository

About web-rules

A strict-rules reference for developers building interfaces with React 19, the Next.js 16 App Router, and Tailwind CSS 4. Its guidance spans six design categories and pairs directives with incorrect and correct examples.

Key features

  1. 01Rules across six interface categories
  2. 02Incorrect and correct code examples
  3. 03Guidance for forms and error states
  4. 04Keyboard and accessibility requirements
  5. 05Dark mode and spacing conventions

Use cases

  1. 01Building a route or component
  2. 02Reviewing design and accessibility regressions
  3. 03Designing forms, permission, or settings flows

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/pproenca/dot-skills --skill web-rules

After installing, type/web-rulesin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

metadata.json
assets/templates/
_template.md
references/
_sections.md
acc-color-contrast.md
acc-color-independent.md
acc-focus-management.md
acc-labels.md
acc-reduce-motion.md
acc-relative-units.md
acc-responsive-layout.md
acc-text-scaling.md
feed-empty-states.md
feed-error-states.md
feed-loading-states.md
feed-success-confirmation.md
feed-toasts.md
inter-drag-drop.md
inter-keyboard-navigation.md
inter-microinteractions.md
inter-pointer-patterns.md
inter-revalidation.md
inter-row-actions.md
inter-search.md
inter-touch-targets.md
nav-app-router.md
nav-page-actions.md
nav-primary.md
ux-data-entry.md
ux-destructive-confirmation.md
ux-modality.md

Details

From the project README

React 19 + Next.js 16 + Tailwind CSS Best Practices

Comprehensive strict-rules reference for web apps built on React 19, the Next.js 16 App Router, and Tailwind CSS 4. Contains 34 rules across 6 categories. Each rule is stated as an Always/Never directive with a quantified impact, an incorrect example, and a correct example.

Stack Contract

All guidance assumes:

  • React 19 with Server Components by default; Client Components only when interactivity is required ('use client' at the top)
  • Next.js 16 App Router with app/ directory, layout.tsx, page.tsx, loading.tsx, error.tsx, not-found.tsx, parallel routes, intercepting routes
  • Server Actions for mutations ('use server') — never useEffect for data fetching
  • Tailwind CSS 4 with the @theme directive, dark: variant, container queries, and the standard 4pt spacing scale
  • lucide-react as the canonical icon system
  • No CSS-in-JS (no styled-components, no emotion) — Tailwind utility classes only, with cn() from clsx + tailwind-merge for conditional classes
  • shadcn/ui primitives (Radix-based) preferred for dialogs, popovers, dropdowns, tooltips, toasts

When to Apply

Reference these rules when:

  • Building any user-facing route, layout, or component
  • Reviewing PRs for design / UX / accessibility regressions
  • Choosing between modality types (dialog vs popover vs full-page)
  • Implementing forms with Server Actions and useFormState / useOptimistic
  • Configuring loading and error boundaries
  • Designing onboarding, permissions, or settings flows
  • Ensuring dark mode, focus management, and keyboard navigation work end-to-end

Rule Categories by Priority

PriorityCategoryImpactPrefix
1NavigationCRITICALnav-
2Interaction DesignCRITICALinter-
3AccessibilityCRITICALacc-
4User FeedbackHIGHfeed-
5UX PatternsHIGHux-
6Visual DesignHIGHvis-

Quick Reference

1. Navigation (CRITICAL)
  • nav-primary - Use top nav (3-7 sections) or sidebar; never hamburger-only on desktop
  • nav-app-router - Use App Router layouts, parallel routes, and <Link> for all internal navigation
  • nav-page-actions - Place primary actions in the page header; never bury them in scroll
2. Interaction Design (CRITICAL)
3. Accessibility (CRITICAL)
4. User Feedback (HIGH)
5. UX Patterns (HIGH)
  • ux-onboarding - Onboarding never exceeds 3 screens; always skippable
  • ux-permissions - Request browser permissions in-context, not on page load
  • ux-modality - Choose dialog / popover / full-page by content weight; never stack modals
  • ux-destructive-confirmation - Destructive actions require a typed confirmation OR an undo window
  • ux-data-entry - Use Server Actions + progressive enhancement; never disable submit while typing
  • ux-undo - Prefer undo over confirmation for everyday actions
  • ux-settings - Settings are autosaved on change; never gated behind a Save button
6. Visual Design (HIGH)
  • vis-dark-mode - Use CSS custom properties + dark: variant; never hardcode text-black/bg-white
  • vis-icon-system - Use lucide-react with 1.5px stroke and size-4/size-5 standard sizes
  • vis-spacing - Use the Tailwind 4 pt scale and container queries; never use ad-hoc px margins

How to Use

Read individual reference files for detailed explanations and code examples:

Reference Files

FileDescription
references/_sections.mdCategory definitions and ordering
assets/templates/_template.mdTemplate for new rules

Comments

Markdown supported