frontend-patterns

frontend-patterns is a skill for Claude Code from tranhieutt/software_development_department. It costs 63 tokens per session (1,406 once invoked), scanned A, original, MIT.

A set of general patterns for building React and Vue interfaces, including component composition, hooks, data fetching, memoization, and error boundaries. React and Vue are tools for creating interactive web screens.

In plain words
What is it for?
Use it for framework-agnostic React or Vue work in projects such as Vite, Create React App, or Storybook, including reusable components and server-data loading.
Why use it?
It helps avoid common interface bugs such as stale values, incorrect effect dependencies, unstable list keys, unnecessary rendering, and mishandled asynchronous work.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Good fit Use it for framework-agnostic React or Vue work in projects such as Vite, Create React App, or Storybook, including reusable components and server-data loading.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/tranhieutt/software_development_department/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 tranhieutt/software_development_department --skill frontend-patterns
Clone the repo
git clone --depth 1 https://github.com/tranhieutt/software_development_department

Made for: Claude Code.

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/tranhieutt/software_development_department/frontend-patterns/github.svg)](https://agentmods.dev/skills/tranhieutt/software_development_department/frontend-patterns)
Your own site
<a href="https://agentmods.dev/skills/tranhieutt/software_development_department/frontend-patterns"><img src="https://agentmods.dev/badge/skills/tranhieutt/software_development_department/frontend-patterns/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for frontend-patterns

Your own site · 80×15
<a href="https://agentmods.dev/skills/tranhieutt/software_development_department/frontend-patterns"><img src="https://agentmods.dev/badge/skills/tranhieutt/software_development_department/frontend-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 63 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,406 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found 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.00063 $0.01406
Opus 5.5 $0.00025 $0.00562
Sonnet 5.5 $0.00013 $0.00281
Haiku 4.5 $0.00006 $0.00141

Measured 1mo ago against content hash 1339e0c8fe41, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

frontend-patterns scanned grade A with 0 findings 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 1mo 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/frontend-patterns/SKILL.md · 155 lines

How it starts

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

Frontend Patterns

Critical rules (non-obvious)

  • Stale closure in useEffect: always list all dependencies; use useRef for values that shouldn't trigger re-run
  • useEffect with async: never make the callback async directly — create inner async fn and call it
  • Object/array as dependency: memoize with useMemo/useCallback or use primitive values; otherwise infinite loop
  • Key prop on lists: use stable IDs, never index when list can reorder or items get deleted
  • React.memo is not free: only wrap components with expensive renders and stable prop references

Component composition patterns

// Compound component with Context
const TabsContext = createContext<{ active: string; setActive: (v: string) => void } | null>(null);

function Tabs({ children, defaultValue }: { children: React.ReactNode; defaultValue: string }) {
  const [active, setActive] = useState(defaultValue);
  return <TabsContext.Provider value={{ active, setActive }}>{children}</TabsContext.Provider>;
}
Tabs.Trigger = function TabsTrigger({ value, children }: { value: string; children: React.ReactNode }) {
  const ctx = useContext(TabsContext)!;
  return <button onClick={() => ctx.setActive(value)} aria-selected={ctx.active === value}>{children}</button>;
};
Tabs.Content = function TabsContent({ value, children }: { value: string; children: React.ReactNode }) {
  const { active } = useContext(TabsContext)!;
  return active === value ? <>{children}</> : null;
};

State management decision

Scope Solution
Single component useState, useReducer
Subtree Context + useContext
Client global (UI) Zustand / Jotai
Server state (API) TanStack Query
Form state React Hook Form
URL state useSearchParams (Next.js)

Data fetching with TanStack Query

// Fetch
const { data, isLoading, error } = useQuery({
  queryKey: ["products", filters],   // filters in key → auto-refetch on change
  queryFn: () => api.getProducts(filters),
  staleTime: 5 * 60 * 1000,          // don't refetch for 5 min
});

// Mutate with optimistic update
const mutation = useMutation({
  mutationFn: api.updateProduct,
  onMutate: async (newProduct) => {
    await queryClient.cancelQueries({ queryKey: ["products"] });
    const prev = queryClient.getQueryData(["products"]);
    queryClient.setQueryData(["products"], (old) => old.map(p => p.id === newProduct.id ? newProduct : p));
    return { prev };
  },
  onError: (_, __, ctx) => queryClient.setQueryData(["products"], ctx?.prev),
  onSettled: () => queryClient.invalidateQueries({ queryKey: ["products"] }),
});

Read the full file on GitHub · 155 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. 1mo ago First seen · 155 lines · 63 tokens per session scan A 1339e0c8fe41

Subscribe to this mod's changes

frontend-patterns is a skill published in the GitHub repository tranhieutt/software_development_department (73 stars, last pushed 5mo ago), licensed MIT. It adds 63 tokens to every session and 1,406 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

playwright-frontend

For frontend engineers authoring UI — how to make components reliably locatable by tests and AI agents. Covers the official Playwright locator priority, semantic/accessible markup first, and how to add valid, unique, stable data-testid attributes (naming convention, uniqueness in lists, stability rules) for React…

testdino-hq/playwright-skill · 92 tokens

astro-integrations

Use when adding React, Vue, Svelte, Solid, Preact, or another UI framework to an Astro project via @astrojs/ integrations.

fusengine/agents · 34 tokens

chrome-extension-wxt

Build Chrome extensions with the WXT framework and TypeScript, React, Vue, or Svelte. Use when creating browser extensions or cross-browser add-ons. Triggers on "chrome extension", "browser extension", WXT, manifest v3, or wxt.config.ts.

tenequm/skills · 60 tokens

component-api-design

Design clean, composable React/Vue component APIs with accessibility built in. Use when designing or reviewing a component's props, composition, events or accessibility, or when a component API has grown hard to use.

SkillMedev/skills · 46 tokens

nextjs

Skill "nextjs" from DongDuong2001/pudo-code-system, covering next.js 15 (app router) pudo checklist, 1. plan (architecture & strategy), 2. understand (context & auditing), 3. develop (implementation) and 4. optimize (performance & review).

DongDuong2001/pudo-code-system · 0 tokens

btc-connect

A Bitcoin wallet connection guide for React, Vue, Next.js, and Nuxt 3 applications. It covers UniSat and OKX wallets, network changes, server-rendered setups, and a shared Hook interface.

Microck/ordinary-claude-skills · 71 tokens