Frontend Module Standardsのロゴ

Frontend Module Standards

組織人気
siteboon
frontend-module-standards

Enforce this repository's React and TypeScript frontend module architecture standards. Use whenever creating, modifying, refactoring, or reviewing frontend code under `src/`, including feature modules, components, hooks, contexts, shared UI, API access, state, utilities, and frontend tests. Do not apply these rules to backend code under `server/` or non-frontend scaffolding.

概要

公開者siteboon
リポジトリclaudecodeui
スキル名frontend-module-standards
スター
14.3K
フォーク
2.1K
同梱ファイル
1
ライセンスAGPL-3.0
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 1個の同梱ファイル

    モデルが作業中に読み取れるスクリプト、テンプレート、参考資料です。ファイルは読み取り専用で、実行されることはありません。

  • オープンソース

    siteboonがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキルFrontend Module StandardsをTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/siteboon/claudecodeui/tree/main/.agents/skills/frontend-module-standards
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/siteboon/claudecodeui.git /tmp/claudecodeui
mkdir -p .claude/skills
cp -r /tmp/claudecodeui/.agents/skills/frontend-module-standards .claude/skills/frontend-module-standards
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでFrontend Module Standardsを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあると、モデルが自動的にFrontend Module Standardsを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Frontend Module Standardsは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、未使用のスキルにはコストがかかりません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

Frontend Module Standards

Apply these rules only to frontend code under src/. Preserve the requested task scope: make touched and newly generated frontend code compliant without performing an unrelated repository-wide migration.

Inspect before editing

  1. Identify the owning feature module and its existing barrel, components, hooks, contexts, utilities, state, API usage, and tests.
  2. Search for existing shared types, utilities, constants, UI components, hooks, and contexts before adding a new definition.
  3. Search for every consumer before moving a definition or changing a module's public exports.
  4. Distinguish application-source imports from package imports before applying the @ alias rules.

Use source-root imports

  • Treat @ as the alias for src.
  • Use @/... imports whenever the import target is frontend application code inside src, including imports within the same feature module.
  • Do not use relative paths such as ../, ../../, or ./ for application-source imports.
  • Continue using bare package specifiers for external dependencies, such as react or react-router-dom.
  • Use import type for every type-only import.

Organize feature modules

  • Place every frontend feature in src/modules/<feature>/.
  • Use .ts for non-JSX files and .tsx for files containing JSX. Do not add JavaScript feature-module files.
  • Give every feature module an index.ts barrel that exposes only its required public API.
  • Import another feature module only through that module's index.ts. Never deep-import another module's components, hooks, contexts, modals, utilities, or other implementation details.
  • Keep module-private implementation details out of the barrel.
  • Do not create view/ directories inside feature modules.
  • Keep module-owned UI components within the owning module, either at its root or in clearly named component-specific directories.

A feature module may contain only the directories it needs:

text
src/modules/<feature>/
|-- index.ts
|-- FeatureComponent.tsx
|-- hooks/
|-- context/
|-- modals/
|-- utils/
`-- tests/

Design exports deliberately

  • Export components and other public symbols at their declarations. This does not apply to re-exports from index.ts barrels.
  • Do not export speculative helpers, unused symbols, or module-private implementation details.
  • For every exported component, add a brief comment at its definition naming the consuming module or modules and explaining why they use it.
  • Update an exported component's consumer comment whenever its consumers change.
  • Use clear, specific names for functions, variables, components, and hooks.
  • Add a concise comment wherever intent, ordering, invariants, or edge cases would otherwise be unclear.

Example:

tsx
/** Used by the chat and plugins modules to display the active provider. */
export function ProviderBadge() {
  // ...
}

Use types, not interfaces

  • Do not introduce TypeScript interface declarations in frontend code. Use type aliases instead, including for component props, context values, state shapes, and API data.
  • When the requested work directly touches an existing interface, convert it to a type when doing so remains within scope.
  • Use export type when exporting a type.
  • Use import type when importing a type.
  • Use type-only barrel exports such as export type { Session }.

Place types by usage

  • Define a type directly in its sole owning component or implementation file when only that file uses it.
  • When two or more files use the same type, place it in src/shared/types.ts.
  • Do not create module-local types.ts files.
  • Do not duplicate a shared type to avoid importing it.
  • Add a brief comment to every type in src/shared/types.ts explaining what it represents and how it should be used.

Place utilities by usage

  • Define a utility directly in its sole owning component or implementation file when only that file uses it.
  • When two or more files use the same utility, place it in src/shared/utils.ts.
  • Do not create a module-level utils.ts file or duplicate a shared utility to avoid importing it.
  • Add a brief comment to every utility in src/shared/utils.ts explaining what it does and how it should be used.
  • A large module-private utility may be placed in src/modules/<feature>/utils/ when keeping it in its sole consumer would make that file impractical to maintain.
  • Give large module-private utility files descriptive names, such as mobileTerminalSelection.ts; do not name them utils.ts.
  • Keep a large utility module-private unless it acquires consumers in other modules. If it becomes shared across multiple modules, move it to src/shared/utils.ts.

Place constants by usage

  • Define a constant directly in its sole owning component or implementation file when only that file uses it.
  • When two or more files use the same constant, place it in src/shared/constants.ts.
  • Do not create module-local constants.ts files or duplicate shared constants.
  • Name true constants using UPPER_SNAKE_CASE.
  • Treat a value as a constant only when it is fixed independently of runtime evaluation.
  • A runtime-derived value such as platform detection is a variable or utility, even if it was previously given an uppercase name. Place it according to the utility rules.
  • Add a brief comment to every constant in src/shared/constants.ts explaining what it represents and how it should be used.

Organize shared definitions

Within src/shared/types.ts, src/shared/utils.ts, and src/shared/constants.ts:

  • Keep related definitions adjacent.
  • Introduce each related group with //----------------- DESCRIPTION OF GROUP ------------.
  • Separate unrelated groups with // ---------------------------.
  • Document each definition individually, even when it belongs to a documented group.
  • Avoid unrelated catch-all groups.

Place hooks by ownership

  • Put a hook used only by one feature module in src/modules/<feature>/hooks/.
  • Put a hook used by multiple feature modules in src/shared/hooks/.
  • Do not move a module-private hook into shared code merely because multiple components within the same module use it.
  • Search for an existing equivalent hook before adding a new one.

Place contexts by ownership

  • Put a context primarily owned by one feature in src/modules/<feature>/context/. For example, the auth module owns AuthContext.
  • Put a context without a clear feature owner in src/shared/context/. For example, ThemeContext affects the application broadly.
  • Ownership, not the number of consumers alone, determines context placement.

Place shared UI by usage

  • Keep a UI component inside its owning feature module when it is used only by that module.
  • Move a UI component to src/shared/ui/ only when two or more different feature modules use it.
  • Multiple consumers within the same feature module do not make a component globally shared.
  • Do not place shared UI under src/shared/view/ui/ or create view/ directories as an organizational layer.
  • Export only shared UI components that have real consumers.

Centralize frontend API access

  • Place frontend API endpoint definitions and shared request helpers in src/shared/api.ts.
  • Do not scatter endpoint paths or duplicate API request logic across feature components.
  • Feature modules may call the public API helpers but should not redefine their endpoint details.
  • Keep API transport concerns out of presentational UI components when practical.

Document state deliberately

Treat React state, reducer state, context state, and external-store state as frontend state for these rules.

  • Add a brief comment immediately above every newly introduced state declaration explaining why the state is essential and how it is used.
  • Describe its purpose rather than merely restating its variable name.
  • Do not introduce state that can be derived reliably from existing props or state.
  • If the task requires temporarily retaining state that appears redundant or questionable, mark it with // ! Possibly unnecessary - <brief reason>.
  • Do not add known-redundant state merely to annotate it.

Organize modals

  • When a feature module contains multiple modals, place them in src/modules/<feature>/modals/.
  • When a feature module contains only one modal, keep it directly in the module.
  • Keep a modal in src/shared/ui/ only when it is a genuinely reusable UI primitive used by multiple different modules.

Test within the owner

  • Put feature-module tests in src/modules/<feature>/tests/.
  • Put tests for shared frontend code in src/shared/tests/.
  • Add or update focused tests for changed hooks, utilities, API behavior, state transitions, and component behavior when applicable.
  • Do not place feature-specific tests in the shared test directory.

Verify the result

Before finishing:

  1. Confirm every application-source import uses @/... and external packages still use bare package specifiers.
  2. Confirm all cross-module imports go through the owning module's index.ts.
  3. Confirm module barrels contain only necessary, documented public exports.
  4. Confirm frontend code introduces no interfaces and uses export type and import type correctly.
  5. Confirm types, utilities, constants, hooks, contexts, UI components, modals, and tests follow their ownership and usage rules.
  6. Confirm shared types, utilities, and constants use the required comments and grouping separators.
  7. Confirm every newly introduced state declaration explains why it exists or is marked as possibly unnecessary.
  8. Run the narrow relevant frontend tests, followed by npm run test:client, npm run build:client, npm run typecheck, and npm run lint when the task scope and environment permit.

同梱ファイル

スキルが読み込まれている間、モデルは必要に応じてこれらを読み取ります。読み取り可能なファイルとして提供され、実行されることはありません。

よくある質問

AIスキル「Frontend Module Standards」では何ができますか?

Enforce this repository's React and TypeScript frontend module architecture standards. Use whenever creating, modifying, refactoring, or reviewing frontend code under `src/`, including feature modules, components, hooks, contexts, shared UI, API access, state, utilities, and frontend tests. Do not apply these rules to backend code under `server/` or non-frontend scaffolding.

TypingMindでFrontend Module Standardsを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Frontend Module Standardsはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにFrontend Module Standardsをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/siteboon/claudecodeui/tree/main/.agents/skills/frontend-module-standardsを貼り付けてください。TypingMindがSKILL.mdを読み込み、関連ファイルをまとめて、チャットごとに有効にできるスキルとしてインストールします。

Frontend Module Standardsを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストが合致したときにこのスキルを読み込めます。

Frontend Module Standardsは何個のAIモデルで使えますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもFrontend Module Standardsを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Frontend Module Standards」は無料ですか?

はい。siteboonがGitHubでAGPL-3.0ライセンスの下で公開しています。支払いが必要なのは、利用したトークンに対する、ご自身が契約するAIプロバイダーへの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇