frontend-patterns

frontend-patterns is a skill for Claude Code, Codex from JSK9999/ai-nexus. It costs 24 tokens per session (3,560 once invoked), scanned A, a copy of frontend-patterns, Apache-2.0.

A collection of patterns and recommendations for building web interfaces with React and Next.js, managing application state, improving speed, and organising user-interface components.

In plain words
What is it for?
Use it when designing React components, composing reusable interface parts, managing state, or improving the performance of a React or Next.js application.
Why use it?
It gives developers established ways to structure frontend code and avoid common design and performance problems.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when designing React components, composing reusable interface parts, managing state, or improving the performance of a React or Next.js application.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/jsk9999/ai-nexus/frontend-patterns
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add JSK9999/ai-nexus --skill frontend-patterns
Clone the repo
git clone --depth 1 https://github.com/JSK9999/ai-nexus

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for frontend-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/jsk9999/ai-nexus/frontend-patterns.svg)](https://agentmods.dev/skills/jsk9999/ai-nexus/frontend-patterns)
Your own site
<a href="https://agentmods.dev/skills/jsk9999/ai-nexus/frontend-patterns"><img src="https://agentmods.dev/badge/skills/jsk9999/ai-nexus/frontend-patterns.svg" alt="Measured on agentmods" height="20"></a>
Per session 24 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,560 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin 94% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00024 $0.03560
Opus 5 $0.00012 $0.01780
Sonnet 5 $0.00005 $0.00712
Haiku 4.5 $0.00002 $0.00356

Measured 8d ago against content hash 193bfa617559, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

frontend-patterns scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

fetch(url)
Origin

This is a copy

94% identical to frontend-patterns — 3 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

config/skills/frontend-patterns/SKILL.md · 632 lines

How it starts

The opening of the file, as written. The whole thing — 632 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Frontend Development Patterns

Modern frontend patterns for React, Next.js, and performant user interfaces.

Component Patterns

Composition Over Inheritance

// ✅ GOOD: Component composition
interface CardProps {
  children: React.ReactNode
  variant?: 'default' | 'outlined'
}

export function Card({ children, variant = 'default' }: CardProps) {
  return <div className={`card card-${variant}`}>{children}</div>
}

export function CardHeader({ children }: { children: React.ReactNode }) {
  return <div className="card-header">{children}</div>
}

export function CardBody({ children }: { children: React.ReactNode }) {
  return <div className="card-body">{children}</div>
}

// Usage
<Card>
  <CardHeader>Title</CardHeader>
  <CardBody>Content</CardBody>
</Card>

Compound Components

interface TabsContextValue {
  activeTab: string
  setActiveTab: (tab: string) => void
}

const TabsContext = createContext<TabsContextValue | undefined>(undefined)

export function Tabs({ children, defaultTab }: {
  children: React.ReactNode
  defaultTab: string
}) {
  const [activeTab, setActiveTab] = useState(defaultTab)

  return (
    <TabsContext.Provider value={{ activeTab, setActiveTab }}>
      {children}
    </TabsContext.Provider>
  )
}

export function TabList({ children }: { children: React.ReactNode }) {
  return <div className="tab-list">{children}</div>
}

export function Tab({ id, children }: { id: string, children: React.ReactNode }) {
  const context = useContext(TabsContext)
  if (!context) throw new Error('Tab must be used within Tabs')

  return (
    <button
      className={context.activeTab === id ? 'active' : ''}
      onClick={() => context.setActiveTab(id)}
    >
      {children}
    </button>
  )
}

// Usage
<Tabs defaultTab="overview">
  <TabList>
    <Tab id="overview">Overview</Tab>
    <Tab id="details">Details</Tab>
  </TabList>
</Tabs>

Render Props Pattern

interface DataLoaderProps<T> {
  url: string
  children: (data: T | null, loading: boolean, error: Error | null) => React.ReactNode
}

export function DataLoader<T>({ url, children }: DataLoaderProps<T>) {
  const [data, setData] = useState<T | null>(null)
  const [loading, setLoading] = useState(true)
  const [error, setError] = useState<Error | null>(null)

  useEffect(() => {
    fetch(url)
      .then(res => res.json())
      .then(setData)
      .catch(setError)
      .finally(() => setLoading(false))
  }, [url])

  return <>{children(data, loading, error)}</>
}

// Usage
<DataLoader<Market[]> url="/api/markets">
  {(markets, loading, error) => {
    if (loading) return <Spinner />
    if (error) return <Error error={error} />
    return <MarketList markets={markets!} />
  }}
</DataLoader>

Read the full file on GitHub · 632 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 632 lines · 24 tokens per session scan A 193bfa617559

Subscribe to this mod's changes

frontend-patterns is a skill published in the GitHub repository JSK9999/ai-nexus (19 stars, last pushed 5mo ago), licensed Apache-2.0. It adds 24 tokens to every session and 3,560 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). It is 94% identical to frontend-patterns, differing in 3 lines, and is treated as a copy.

Related

Other skills, from other repositories

open-slide-best-practices

Best practices for authoring presentations with open-slide, the React slide framework with a fixed 1920×1080 canvas, with full Hebrew and RTL support. Covers the slides/[id]/index.tsx file contract, type scale, DesignSystem tokens, themes/ system, @slide-comment inspector markers, current.json deictic resolution…

squadcodercom/squadcoder · 179 tokens

remotion-best-practices

Best practices for Remotion video creation in React with Hebrew RTL support. Use when dealing with Remotion code, creating programmatic videos, building Hebrew video content with RTL captions and text animations, or generating social media videos with Hebrew fonts. Covers animations, compositions, sequencing…

squadcodercom/squadcoder · 104 tokens

ckm:ui-styling

Create beautiful, accessible user interfaces with shadcn/ui components (built on Radix UI + Tailwind), Tailwind CSS utility-first styling, and canvas-based visual designs. Use when building user interfaces, implementing design systems, creating responsive layouts, adding accessible components (dialogs, dropdowns…

squadcodercom/squadcoder · 93 tokens

skillshare-ui-website-style

Skillshare frontend design system for the React dashboard (ui/) and Docusaurus website (website/). Use this skill whenever you: build or modify a dashboard page or component in ui/src/, style or layout website pages or custom CSS in website/, create new React components for the dashboard, add pages to the dashboard…

runkids/skillshare · 147 tokens

antd

Use when the user's task involves Ant Design (antd) — writing antd components, debugging antd issues, querying antd APIs/props/tokens/demos, migrating between antd versions, or analyzing antd usage in a project. Triggers on antd-related code, imports from 'antd', or explicit antd questions.

ant-design/ant-design-cli · 69 tokens

igniteui-wc-choose-components

Identify and select the right Ignite UI Web Components for your app UI, then navigate to official docs, usage examples, and API references.

IgniteUI/igniteui-cli · 34 tokens