本文へスキップ
Skillpedia
WebサイトとUI(フロントエンド)48k · #4665

frontend-dev-guidelines

できること

このガイドは、React を使ってWebサイトやWebアプリを作るプログラマー向けのものです。コードの整理方法、データの取得方法を定め、スムーズに動き、保守しやすい状態を保つための明確なルールを示します。

使う場面

  • ✓Webサイトの新しい部分(コンポーネントやページ)を作るとき。
  • ✓新しい機能を追加するとき。
  • ✓システムの情報を取得したり変更したりするとき。

スキルのリンク

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/frontend-dev-guidelines/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/frontend-dev-guidelines/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“新しいログイン機能のコードは、どのように整理すればよいですか?”

毎週5つの新しいスキル。1分で読めます。

仕組み

このガイドでは、データ取得に「Suspense優先」の方式を採用します。つまり、読み込み中にちらつく「読み込み中」表示を出すのではなく、画面全体が整った形で待つ仕組みです。また、コードを「機能(features)」ごとに整理することを求め、エラーを防ぐためにTypeScriptの使用を義務づけています。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

Frontend Development Guidelines

(React · TypeScript · Suspense-First · Production-Grade)

You are a senior frontend engineer operating under strict architectural and performance standards.

Your goal is to build scalable, predictable, and maintainable React applications using:

  • Suspense-first data fetching
  • Feature-based code organization
  • Strict TypeScript discipline
  • Performance-safe defaults

This skill defines how frontend code must be written, not merely how it can be written.


1. Frontend Feasibility & Complexity Index (FFCI)

Before implementing a component, page, or feature, assess feasibility.

FFCI Dimensions (1–5)

Dimension Question
Architectural Fit Does this align with feature-based structure and Suspense model?
Complexity Load How complex is state, data, and interaction logic?
Performance Risk Does it introduce rendering, bundle, or CLS risk?
Reusability Can this be reused without modification?
Maintenance Cost How hard will this be to reason about in 6 months?

Score Formula

FFCI = (Architectural Fit + Reusability + Performance) − (Complexity + Maintenance Cost)

Range: -5 → +15

Interpretation

FFCI Meaning Action
10–15 Excellent Proceed
6–9 Acceptable Proceed with care
3–5 Risky Simplify or split
≤ 2 Poor Redesign

2. Core Architectural Doctrine (Non-Negotiable)

1. Suspense Is the Default

  • useSuspenseQuery is the primary data-fetching hook
  • No isLoading conditionals
  • No early-return spinners

2. Lazy Load Anything Heavy

  • Routes
  • Feature entry components
  • Data grids, charts, editors
  • Large dialogs or modals

3. Feature-Based Organization

  • Domain logic lives in features/
  • Reusable primitives live in components/
  • Cross-feature coupling is forbidden

4. TypeScript Is Strict

  • No any
  • Explicit return types
  • import type always
  • Types are first-class design artifacts

When to Use

Use frontend-dev-guidelines when:

  • Creating components or pages
  • Adding new features
  • Fetching or mutating data
  • Setting up routing
  • Styling with MUI
  • Addressing performance issues
  • Reviewing or refactoring frontend code

3. Quick Start Checklists

New Component Checklist

  • React.FC<Props> with explicit props interface
  • Lazy loaded if non-trivial
  • Wrapped in <SuspenseLoader>
  • Uses useSuspenseQuery for data
  • No early returns
  • Handlers wrapped in useCallback
  • Styles inline if <100 lines
  • Default export at bottom
  • Uses useMuiSnackbar for feedback

New Feature Checklist

  • Create features/{feature-name}/
  • Subdirs: api/, components/, hooks/, helpers/, types/
  • API layer isolated in api/
  • Public exports via index.ts
  • Feature entry lazy loaded
  • Suspense boundary at feature level
  • Route defined under routes/

4. Import Aliases (Required)

Alias Path
@/ src/
~types src/types
~components src/components
~features src/features

Aliases must be used consistently. Relative imports beyond one level are discouraged.


5. Component Standards

Required Structure Order

  1. Types / Props
  2. Hooks
  3. Derived values (useMemo)
  4. Handlers (useCallback)
  5. Render
  6. Default export

Lazy Loading Pattern

const HeavyComponent = React.lazy(() => import('./HeavyComponent'));

Always wrapped in <SuspenseLoader>.


6. Data Fetching Doctrine

Primary Pattern

  • useSuspenseQuery
  • Cache-first
  • Typed responses

Forbidden Patterns

❌ isLoading ❌ manual spinners ❌ fetch logic inside components ❌ API calls without feature API layer

API Layer Rules

  • One API file per feature
  • No inline axios calls
  • No /api/ prefix in routes

7. Routing Standards (TanStack Router)

  • Folder-based routing only
  • Lazy load route components

…

よくある質問

「Suspense優先」とは何ですか?

点滅する「読み込み中」表示を出さずに、インターフェースがデータの読み込みを待つ方法です。画面全体が整理された形で待ちます。

なぜ「機能」ごとに整理するのですか?

Webサイトの各部分のロジックを分けて管理することで、コードを整理しやすくなります。特定の部分を、他の部分に影響を与えずに見つけて修正しやすくなります。

TypeScriptとは何ですか?

JavaScriptにチェック機能を加えるツールです。コードを実行する前にエラーを見つけやすくなり、開発をより安全で予測しやすいものにします。

詳細

作者による元の説明

You are a senior frontend engineer operating under strict architectural and performance standards. Use when creating components or pages, adding new features, or fetching or mutating data.

repo: sickn33/agentic-awesome-skills

人気

GitHubのスター
48k
ランキング
#4665
ライセンス
MIT
更新日
2026/10/15

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル