Skip to main content
rule CX Codex

frameworks — Claude Code rule: what it does, how to install

frameworks directs Claude Code to generate production UI code for React with Tailwind v4, Next.js 15, and SwiftUI 6 without placeholders.

MIT ★ 3,216 updated 2026-10-20

Install into Claude Code · Plugin marketplace All methods and platforms ↓
/plugin marketplace add plugin87/ux-ui-agent-skills
/plugin install ux-ui-agent-skills@ux-ui-agent-skills
Open on GitHub

What frameworks does

This rule defines exact code patterns across specific frontend stacks. For React, it enforces TypeScript, forwardRef, cva, and utility helpers alongside Tailwind v4 @theme properties. Next.js 15 workflows keep Server Components by default, pushing "use client" directives down to leaf nodes while relying on Server Actions for data mutations. For Apple platforms, SwiftUI 6 setups receive extensions for tokens, button styles, and Dynamic Type sizing via @ScaledMetric.

The instruction enforces zero truncation. Emitting placeholders such as // ... rest unchanged is explicitly banned: the agent must return complete files. If your project uses a stack outside the primary trio, the rule mandates creating an on-demand adapter following frameworks/adapter-protocol.md.

Hardcoded values are prohibited. Every component must reference design tokens and account for responsive breakpoints, dark mode, and accessibility modifiers.

What it helps with

  • Build accessible React components using cva and Tailwind v4 theme variables
  • Structure Next.js 15 App Router pages with Server Actions and leaf client components
  • Implement SwiftUI 6 views with Dynamic Type support and design token extensions
  • Prevent truncated files and placeholder comments in generated code

Example prompts for the agent

  • Build a modal dialog component in React and Tailwind using cva and forwardRef
  • Create a user settings route in Next.js 15 with Server Actions
  • Implement a SwiftUI 6 profile screen with tokens and @ScaledMetric

How to install frameworks

1Plugin marketplace

/plugin marketplace add plugin87/ux-ui-agent-skills
/plugin install ux-ui-agent-skills@ux-ui-agent-skills

2Manually: put the files in place

.claude/rules/frameworks.md

The paths frontmatter field limits the files

Step by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use

Questions about frameworks

How to install frameworks in Claude Code?

Run /plugin marketplace add plugin87/ux-ui-agent-skills in Claude Code, followed by /plugin install ux-ui-agent-skills@ux-ui-agent-skills. You can also place the rule file directly into .claude/rules/frameworks.md.

What does the frameworks rule do?

It forces Claude Code to follow strict guidelines when writing React, Next.js 15, and SwiftUI 6 code. It ensures that components use design tokens, include accessibility attributes, and arrive fully written without omissions.

How does it handle unsupported frameworks?

When generating code for another stack, the agent must consult frameworks/adapter-protocol.md and produce an adapter on demand rather than improvising unstandardized code.

Source text

frameworks.md · MIT
# Rule: Framework output

Loaded when generating code for a specific stack.

Split out of `CLAUDE.md` so it loads only when the work calls for it. The
headings below are unchanged, so any pointer to them still resolves.

---

## Framework Output Formats

### React + Tailwind (primary web framework)
- TypeScript + `forwardRef` + `cva` (class-variance-authority) + `cn()` utility
- Tokens mapped to Tailwind v4 `@theme` CSS custom properties
- Component pattern: `components/ui/[name].tsx`
- Reference: `frameworks/react-tailwind.md`

### Next.js 15 (full-stack web)
- App Router with route groups, layouts, loading/error boundaries
- Server Components by default; `"use client"` pushed to leaf components
- `next/font` for font loading, `next/image` for images
- Server Actions for mutations
- Reference: `frameworks/nextjs.md`

### SwiftUI 6 (Apple platforms)
- Tokens → Asset Catalogs + `Color.DS` / `Font.DS` / `Spacing` extensions
- `ButtonStyle`, `ViewModifier` for component styling
- `@ScaledMetric` for Dynamic Type, `@Environment(\.accessibilityReduceMotion)` for motion
- `#if os()` for platform adaptation
- Reference: `frameworks/swiftui.md`

### Output Rules
When generating code for any framework:
1. **Use design tokens**: Never hardcode colors, sizes, or spacing. Always reference token values.
2. **Include accessibility**: Every interactive element gets ARIA attributes or a11y modifiers.
3. **Handle all states**: Default, hover, focus, disabled, loading, error.
4. **Support dark mode**: Use semantic color tokens that auto-switch.
5. **Responsive**: Mobile-first, breakpoint-aware.
6. **Copy-paste ready**: Code should work with minimal adaptation.
7. **Any framework**: Use `frameworks/adapter-protocol.md` for targets without a dedicated file; generate an adapter on demand.
8. **Output completeness**: A partial output is a broken output. Deliver full files, never placeholders (`// ... rest unchanged`). If asked for N components/screens, deliver all N. Split at clean boundaries only when length forces it, and continue to completion. (See `workflows/redesign-audit.md`.)

© Thientan Soparat · MIT · plugin87/ux-ui-agent-skills

Similar IDE rules

All IDE rules for Frontend and UI →

From the same set35

The whole set →
figma-integration The figma-integration Claude Code skill connects a project’s tokens and components with Figma, syncing in either direction and checking for design-code drift. It activates for token sync, design extraction, or component parity checks. CX Codex +1 554installs governance governance — a skill for Claude Code and Codex that enforces design system evolution rules, SemVer token versioning, and component deprecation workflows. CX Codex +1 549installs accessibility Checks interactive elements against core accessibility requirements. Use it during UI audits or when completing a component. CX Codex +1 ★ 3,216repo stars observe observe — a skill for Claude Code that checks local hook events to see if the agent followed UX/UI kit rules in recent sessions. Runs manually on user request. CX Codex +1 ★ 3,216repo stars ship ship — a skill for Claude Code runs pre-release checks and drafts a release checklist. It starts before a release tag, checking the project before preparing version and changelog details. CX Codex +1 ★ 3,216repo stars gate Skill for Claude Code runs a UI quality gate before marking tasks complete. You trigger the command manually, preventing the model from calling it autonomously. CX Codex +1 ★ 3,216repo stars review-and-research review-and-research standardizes UI audits, usability checks, and design handoff requirements. Activates when Claude Code inspects screens or prepares components for developers. CX Codex +1 ★ 3,216repo stars brand-and-operations brand-and-operations is a Claude Code rule for brand consistency, motion, and UI copy. It loads when an agent sets an aesthetic direction, writes interface text, or works on system operations. CX Codex +1 ★ 3,216repo stars

More in the catalog

Project sponsors

Companies that keep this analytics open