coding-convention

Enforces TypeScript, React, and Zustand coding conventions for the order-ui codebase.

Updated Aug 19, 2026
One-click install
npx skills add https://github.com/homeslands/trend-ui --skill coding-convention-homeslands
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: coding-convention
Source: https://github.com/homeslands/trend-ui/tree/main/app/order-ui/.claude/skills/coding-convention
Command: npx skills add https://github.com/homeslands/trend-ui --skill coding-convention-homeslands

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Teams working on the order-ui React application risk inconsistent code style, naming, and architecture patterns across components, hooks, stores, and API services. This Skill ensures every piece of generated code follows the project's established conventions automatically. ## Core Features & Use Cases - Naming & Structure Rules: Enforces kebab-case file names, PascalCase exports, I-prefixed interfaces, and .store/.type/.schema file suffixes. - Framework Patterns: Provides canonical patterns for React components (FC<Props>), Zustand stores with persist middleware, react-hook-form with Zod resolvers, and React Query mutations. - Import & i18n Standards: Defines ESLint-enforced import ordering and requires react-i18next translation keys instead of hardcoded strings. - Use Case: When asked to create a new printer management feature, the Skill guides generation of printer-card.tsx, use-printer.ts, printer.store.ts, and printer.schema.ts files that all match the existing codebase style. ## Quick Start Write a new Zustand store and hook for managing orders following the project coding conventions.

Frequently Asked Questions about coding-convention

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I name React component files and exports in a TypeScript project?

Use kebab-case for file names and PascalCase for exports, such as `order-card.tsx` exporting `export const OrderCard`. Hooks use camelCase exports like `usePrinter`, and Zustand stores use the `.store.ts` suffix with a `use` prefix.

How to create a Zustand store with persist middleware in React?

Create the store with `create<IStore>()(persist((set) => ({...}), { name: 'unique-name' }))`. Define the state interface in a separate types file, and subscribe to specific slices via selectors rather than spreading the entire store.

Should I use React.FC or FC<Props> for TypeScript components?

Use `FC<Props>` imported from react or an explicit `(props: Props) => JSX.Element` signature. The `React.FC` namespace pattern is deprecated. Always define a separate props interface rather than inline object types.

How do I handle errors in React Query mutations?

Let the global MutationCache handler process errors automatically by omitting `onError` unless `meta.ignoreGlobalError` is set. In manual try/catch blocks, return immediately after the catch to stop execution since the global toast already fires.

Why should UI strings use react-i18next translation keys?

Hardcoded strings prevent localization and create inconsistency across languages. Use `useTranslation` with namespaced keys like `t('chefArea:addPrinter')`, with translation files stored in `public/locales/[lang]/[namespace].json`.