frontend-patterns

A set of React, TypeScript, terminal, event-listener, state-management, and inter-process communication patterns for a ClaudeTerminal frontend. It explains how to clean up terminal resources, handle events, and avoid outdated callback data.

In plain words
What is it for?
Use it when building or reviewing ClaudeTerminal frontend components, terminal windows, event listeners, Zustand state selectors, backend calls, loading states, or Tailwind styling.
Why use it?
It gives developers consistent rules for preventing resource leaks, unnecessary interface updates, broken event cleanup, and errors when the frontend talks to the Rust backend.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/talayash/agentrium/frontend-patterns
Any agent
npx skills add talayash/agentrium --skill frontend-patterns
Clone the repo
git clone --depth 1 https://github.com/talayash/agentrium

Made for: Claude Code, Codex.

Per session 16 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 247 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00016 $0.00247
Opus 5 $0.00008 $0.00123
Sonnet 5 $0.00003 $0.00049
Haiku 4.5 $0.00002 $0.00025

Measured 2d ago against content hash b1e6029a6e85, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 2d 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 · 32 lines

What it actually says

Frontend Patterns for ClaudeTerminal

xterm.js Lifecycle

  • Create terminal instance in useEffect, dispose on unmount
  • Dispose all addons (fit, search, weblinks) before terminal
  • Never hold references to disposed terminals

Event Listeners

  • listen() returns unlisten function - call it in useEffect cleanup
  • Register listeners in App.tsx for global events (terminal-output, terminal-finished)

Zustand

  • terminalStore - NOT persisted (terminals are ephemeral)
  • appStore - persisted to localStorage (UI state)
  • Use selectors to avoid unnecessary re-renders
  • Avoid stale closures - use getState() in callbacks

IPC

  • Always wrap invoke() in try/catch
  • Handle both success and error cases
  • Show loading states for slow operations

Styling

  • Dark glassmorphic theme: bg-gray-800/80, border-gray-700/50, backdrop-blur
  • Use Tailwind classes - no hardcoded colors
  • Framer Motion for animations
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. 2d ago First seen · 32 lines · 16 tokens per session scan A b1e6029a6e85

Subscribe to this mod's changes

frontend-patterns is a skill published in the GitHub repository talayash/agentrium (39 stars, last pushed 2d ago), licensed MIT. It adds 16 tokens to every session and 247 once invoked, about $0.0001 per session on Opus 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-08-30.

Related

Other skills, from other repositories

web-artifacts-builder

Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use for complex artifacts requiring state management, routing, or shadcn/ui components - not for simple single-file HTML/JSX artifacts.

ThinkInAIXYZ/deepchat · 64 tokens

frontend-conventions

Coding conventions, architecture patterns, and testing rules for the SkillHub React frontend. Ensures agents follow Feature-Sliced Design and use the generated OpenAPI types.

iflytek/skillhub · 36 tokens

frontend-dev-guidelines

Frontend development guidelines for React/TypeScript applications. Modern patterns including Suspense, lazy loading, useSuspenseQuery, file organization with features directory, MUI v7 styling, TanStack Router, performance optimization, and TypeScript best practices. Use when creating components, pages, features…

diet103/claude-code-infrastructure-showcase · 76 tokens

fast-typescript-check

Keep www-sacred's TypeScript fast to type-check and fast to run. Use when touching the ASCII/canvas animation components (the only real per-frame code here), tightening type-check wall-clock, or auditing a change for runtime or compiler regressions. Scoped to this repo — a React 19 / Next.js 16 component library plus…

internet-development/www-sacred · 84 tokens

moai-ref-react-patterns

React/Next.js component design patterns, state management strategies, and project structure reference for frontend development. Agent-extending skill that amplifies frontend domain work (spawned via Agent(general-purpose) with frontend instructions) with production-grade React patterns. NOT for: backend API design…

modu-ai/moai-adk · 72 tokens

vercel-react-best-practices

React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance…

CherryHQ/cherry-studio · 67 tokens