Skip to content
frontend-core logo

Frontend Core Skill

frontend-core

Build React components, pages, forms, and state management with TypeScript and TanStack Query. Use for frontend development, component creation, routing, and data fetching.

SKILL.md

Full skill instructions

Frontend Core Skill

When to Use

  • Creating React components or pages
  • Implementing forms with validation
  • Setting up data fetching or state management
  • Working with routing (/​c, /​o, /​t)
  • Working with files under frontend/

CRITICAL: Irreversible Action Confirmation (MANDATORY)

Redeem Flow

Customer screen shows "사용 처리" button → Trigger 2-step modal:

Modal Content:

  • Title: "되돌릴 수 없는 작업입니다"
  • Body: "매장 직원이 확인 후 눌러주세요"
  • Buttons: [취소] (easy to hit) / [확인]

TTL Enforcement:

  • If modal not confirmed within 30-60s → auto-expire
  • Show "요청이 만료되었습니다" → retry CTA

Why This Matters:

  • Prevents accidental customer-only redemption
  • Forces store-side confirmation
  • Abuse mitigation (no auto-click scripts)

Stack

Default (popular) stack:

  • React + TypeScript + Vite
  • Tailwind CSS
  • React Router
  • TanStack Query
  • Axios
  • React Hook Form + Zod

Libraries Policy

  • Use the existing stack first
  • Adding a new library requires:
    • clear benefit
    • small footprint
    • at least one example usage

Architecture

User Types & Viewports

  • Customer Wallet: mobile-first
  • Owner Backoffice: desktop-first
  • Store Terminal: always-on approval screen

Component Composition Pattern

Page (route-level)
  └─ Container (data fetch + state)
       └─ View (presentational)

File Organization

  • src/​components/ - Common UI elements
  • src/​features/<feature>/​components/ - Feature-specific UI

Code Style

Base: Airbnb JavaScript Style Guide, with these overrides:

  • Indentation: 4 spaces
  • Max line length: 120 characters
  • Semicolons: false

Naming Conventions

TypeConventionExample
Components/​FilesPascalCaseUserProfile.tsx
Variables/​Functions/​HookscamelCaseconst isOpen = useState()
ConstantsSCREAMING_SNAKE_CASEconst MAX_RETRY_COUNT = 3

No Abbreviations:

// bad
const idx = 0

// good
const index = 0

Boolean Naming:

  • Use prefixes: is, has, can, should
  • Event handlers: handle* for functions, on* for props
// good
const handleOpen = () => {}
<Button onClick={handleOpen} />

Component Internal Order

  1. State declarations (useState)
  2. Memoization (useMemo, useCallback)
  3. Side effects (useEffect)
  4. Event handlers
  5. JSX Rendering

TypeScript Rules

  • Never use any (use unknown if uncertain)
  • interface for objects (Props, API responses)
  • type for unions/​aliases
  • Use as const instead of enums:
const ROLES = {
  ADMIN: "ADMIN",
  USER: "USER",
} as const

type Role = (typeof ROLES)[keyof typeof ROLES]

Prettier Config

{
  "semi": false,
  "singleQuote": true,
  "tabWidth": 4,
  "trailingComma": "es5",
  "printWidth": 120,
  "plugins": ["prettier-plugin-tailwindcss"]
}

State Branching (REQUIRED)

Every page MUST handle:

  • Loading state
  • Empty state
  • Error state (with retry CTA)

Error Handling

  • Show user-friendly message
  • Provide a recovery action (retry / back)

State & Data Fetching

TanStack Query Patterns

  • useQuery for reads
  • useMutation for writes
  • Invalidate queries on mutation success

Polling (MVP REQUIRED)

Issuance approval status and terminal lists must support polling:

  • Default interval: 2-3 seconds
  • Stop when: status is final OR TTL expires

Routing & Navigation

Use React Router.

Route Grouping

  • /​c/​* - customer
  • /​o/​* - owner/​backoffice
  • /​t/​* - store terminal

Navigation Rules

  • Keep route params explicit (e.g., storeId, stampCardId)
  • Avoid deep nesting unless it improves clarity

Forms & Validation

  • Use react-hook-form for forms
  • Use zod schemas for validation

UX Requirements

  • Display field errors near the field
  • Disable submit while loading
  • Prevent double submits

Import Rules

Use Absolute Paths

Use @/ prefix for major directories (components/, hooks/, etc.)

Import Sorting Order

  1. React core libraries
  2. Third-party libraries
  3. Global/​Common components
  4. Domain-specific components
  5. Hooks, Utils, Types
  6. Assets (images, css)

Control Flow & Depth

  • Braces Required: Do not omit {} even for single-line if
  • Depth Limit: Maintain depth of 1 or less (max 2)
  • Actively use early returns

Linting & Formatting

Tools:

  • ESLint: Code quality, accessibility (a11y), import sorting
  • Prettier: Code formatting and Tailwind class sorting
  • Husky & lint-staged: Automated verification before git commit

PR Checklist

  • Loading/​Empty/​Error states exist
  • Keyboard navigation works
  • Mobile-first layout checked
  • No unnecessary re-renders / infinite loops
  • API errors are handled

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View