本文へ移動
cccskills
無料GitHub で公開

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.

インストール方法を見る

含まれるファイル(1)

  • SKILL.md3.9 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Frontend Conventions Skill

Trigger

Use this skill when:

  • Adding or modifying React/TypeScript frontend code
  • Creating new pages, features, entities, or shared components
  • Changing API client calls or data fetching patterns

Rules

Feature-Sliced Design

Place code at the lowest appropriate layer:

LayerPathPurpose
Pagesweb/src/pages/Route-level page components
Featuresweb/src/features/Business features (search, upload, review, etc.)
Entitiesweb/src/entities/Domain entity display logic (skill, user, namespace)
Sharedweb/src/shared/Reusable UI components, hooks, utilities

Current features:

  • admin — Admin panel (user management, labels, search)
  • auth — Login, OAuth flows, device auth
  • governance — Skill governance actions (hide, yank, archive)
  • namespace — Namespace management (members, settings)
  • notification — User notifications and inbox
  • promotion — Skill promotion between scopes
  • publish — Skill upload/publish UI
  • report — Skill reporting
  • review — Review workflow UI
  • search — Skill search and filtering
  • security-audit — Security audit viewer
  • skill — Skill detail, listing, cards
  • social — Stars, ratings, subscriptions
  • token — API token management

Data Fetching

  • Always use TanStack Query (@tanstack/react-query) for server state.
  • Never use useEffect for data fetching.
  • Use openapi-fetch client with generated types from web/src/api/generated/schema.d.ts.
  • Never use any types.

State Management

  • TanStack Query for server state (API data, caching, invalidation, optimistic updates)
  • Zustand for local/UI state (theme, sidebar, modals, form state)

Component Composition

  • Radix UI primitives: @radix-ui/react-dropdown-menu, @radix-ui/react-select
  • class-variance-authority (cva) for component variants
  • clsx + tailwind-merge for class merging
  • cn() utility: web/src/shared/lib/utils.ts
  • shadcn/ui is NOT used as a library

API Type Generation

When backend OpenAPI contracts change:

make generate-api

This runs openapi-typescript http://localhost:8080/v3/api-docs -o src/api/generated/schema.d.ts.

Commit the updated web/src/api/generated/schema.d.ts with the PR.

To verify the generated file is not stale:

./scripts/check-openapi-generated.sh

Styling

  • Tailwind CSS for all styling
  • cn() utility for conditional class merging
  • Follow existing component patterns in web/src/shared/components/

Internationalization

  • i18next + react-i18next for translations
  • All user-facing text must be translatable
  • Translation keys in web/src/i18n/

Build & Development

make dev-web                # Start Vite dev server (HMR enabled)
make build-frontend         # Production build
make typecheck-web          # TypeScript type check (tsc --noEmit)
make lint-web               # ESLint check
make test-frontend          # Vitest unit tests
make test-e2e-frontend      # Playwright E2E tests
make test-e2e-smoke-frontend # Playwright smoke tests

Vite HMR is enabled by default — save a file and the browser updates instantly.

Frontend Dependencies

Key dependencies (from web/package.json):

  • react 19, react-dom 19
  • @tanstack/react-query 5
  • @tanstack/react-router 1
  • @radix-ui/react-dropdown-menu, @radix-ui/react-select
  • class-variance-authority, clsx, tailwind-merge
  • openapi-fetch 0.13
  • i18next, react-i18next
  • zustand 5
  • react-markdown, rehype-highlight, rehype-sanitize
  • lucide-react (icons)
  • sonner (toasts)

Build tools: Vite 6, TypeScript 5.7, Vitest 3.2, Playwright 1.58

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Evaluate factual claims in AI-generated text and teach a lightweight verification habit. Use when a learner wants to fact-check an AI answer, identify uncertainty, choose appropriate independent sources, or practise critical AI literacy.

日本語の概要は準備中です。原文の説明を表示しています。

iflytek/skillhub5,1722026年10月10日 更新

API design conventions, namespace coordinate system, RBAC roles, ClawHub compatibility layer, OpenAPI contract sync rules, and CSRF/session handling.

日本語の概要は準備中です。原文の説明を表示しています。

iflytek/skillhub5,1722026年10月10日 更新

Rules for the SkillHub backend Maven multi-module clean architecture. Ensures agents place new code in the correct module and respect dependency direction.

日本語の概要は準備中です。原文の説明を表示しています。

iflytek/skillhub5,1722026年10月10日 更新

Code style, logging, and testing conventions for SkillHub backend (Java) and frontend (TypeScript). Use when writing or reviewing code.

日本語の概要は準備中です。原文の説明を表示しています。

iflytek/skillhub5,1722026年10月10日 更新

Parse and understand an HTTP(S) URL or an authorized local document, audio, or video source through Cue Omni Reader when the Agent has the official Omni MCP tools.

日本語の概要は準備中です。原文の説明を表示しています。

iflytek/skillhub5,1722026年10月10日 更新

Generate concise daily standups, reflection prompts, and weekly retrospectives for individuals or teams. Use for planning a day, surfacing blockers, reviewing user-provided entries, or drafting a check-in without assuming prior history.

日本語の概要は準備中です。原文の説明を表示しています。

iflytek/skillhub5,1722026年10月10日 更新

iflytek のスキルをすべて見る

このスキルの問題を報告する