react-component-convention

react-component-convention is a skill for Claude Code from ncaq/konoka. It costs 32 tokens per session (1,227 once invoked), scanned A, original, Apache-2.0.

A set of conventions for organizing React component files. It defines the order of imports, styling definitions, properties, and component code, and generally keeps one component in each file.

In plain words
What is it for?
Use it when writing or reviewing React components, deciding when to split a component, naming new files, or checking whether a file follows the project layout.
Why use it?
Consistent file structure makes components easier to read and prevents large files from mixing unrelated responsibilities.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter.

Part of the web-tasuke plugin — 17 skills shipped together

Good fit Use it when writing or reviewing React components, deciding when to split a component, naming new files, or checking whether a file follows the project layout.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ncaq/konoka/react-component-convention
View source ↗ ncaq/konoka
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add ncaq/konoka --skill react-component-convention
Clone the repo
git clone --depth 1 https://github.com/ncaq/konoka

Made for: Claude Code.

Or install web-tasuke, the plugin that ships this one along with the rest of its 17 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for react-component-convention

README.md
[![agentmods](https://agentmods.dev/badge/skills/ncaq/konoka/react-component-convention/github.svg)](https://agentmods.dev/skills/ncaq/konoka/react-component-convention)
Your own site
<a href="https://agentmods.dev/skills/ncaq/konoka/react-component-convention"><img src="https://agentmods.dev/badge/skills/ncaq/konoka/react-component-convention/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for react-component-convention

Your own site · 80×15
<a href="https://agentmods.dev/skills/ncaq/konoka/react-component-convention"><img src="https://agentmods.dev/badge/skills/ncaq/konoka/react-component-convention.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 32 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,227 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00032 $0.01227
Opus 5 $0.00016 $0.00613
Sonnet 5 $0.00006 $0.00245
Haiku 4.5 $0.00003 $0.00123

Measured 4d ago against content hash d9041e884d69, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

react-component-convention scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/web-tasuke/skills/react-component-convention/SKILL.md · 81 lines

What it actually says

Reactコンポーネントの規約

ファイル内の構造順序を守る

すべてのコンポーネントファイルは、上から順に次の流れで構成します。

  1. デザイン定義 — sva/cva/cssなどのstyled-system呼び出し
  2. props定義 — type Props = ...interface Props { ... }
  3. Functional Component定義 — export const Foo: React.FC<Props> = ...export function Foo(props: Props): React.ReactElement { ... }

import群は当然この前に置きます。 純粋な振る舞いだけのコンポーネントならデザイン定義は省略可能ですが、 それ以外で順序の入れ替えは認めません。

理由: 「見た目」「インターフェース」「振る舞い」の責務分離をファイル内の縦方向で表現することで、 コンポーネントを読むときの認知の階段を一定に保つため。

1ファイル1コンポーネント

1つのファイルの中にexport/非exportを問わずコンポーネントを2つ以上書かないでください。

ファイル内で再利用される小さなコンポーネントが必要になった場合は、必ず別ファイルに切り出します。 切り出した先のファイル名はIDEのQuick Openで識別しやすい名前にし、 index.tsxindex.tsといった汎用名を新規作成しないでください。 既存のindex.tsxを大幅に書き換える場合も、 リファクタリングの一環として適切なファイル名にリネームします。

例外として、他のコンポーネントのrender propに渡すためのごく小さなコンポーネントは、 その場で定義することを許容します。 <DataGrid renderRow={...} />columns[i].renderreact-hook-formControllerrenderなどが該当します。 ただし次の条件をすべて満たすこと。

  • 呼び出し元のrender関数の引数型にそのまま当てはめられる、数行〜十数行程度の軽量なものに限る
  • ファイル内で1度しか使われない。使い回される可能性が出てきた時点で別ファイルに切り出す
  • どのrender propに渡すために定義しているのかを説明するコメントを直前に付ける

例:

// DataGridのrenderRowに渡すための行コンポーネント。このファイル内でしか使わない
const DeviceRow: React.FC<{ device: Device }> = ({ device }) => (
  <tr>
    <td>{device.id}</td>
    <td>{device.name}</td>
  </tr>
);

ファイル内で複数回使う場合、それなりの行数がある場合、 呼び出し側から渡される関数でなく通常のJSXの一部として使っている場合などは、 必ず別ファイルに切り出してください。

コンポーネントが肥大化してきたら分割する

「関数の始まりからJSXが登場するまでに30行程度かかっている」状態は、 コンポーネントが過剰な責務を持っている兆候です。 次のいずれかの方法で責務を逃します。

  • ロジックをカスタムフックに切り出す。state、副作用、メモ化、ハンドラの寄せ集めはほぼ必ずフック化できます
  • 表示の塊を子コンポーネントに切り出す
  • 算出値をモジュールスコープの純粋関数に切り出す

ただし、JSX自体が長くなることは必ずしも悪ではありません。 判定すべきは「行数」ではなく「認知負荷」です。 次のような状態は危険信号として扱ってください。

  • 同一の構造が縦に並んでいるが、わずかな差異があってループに落とせていない
  • 条件分岐ごとにJSXの枝が派生しており、どの枝が描画されるかを脳内でトラッキングする必要がある
  • 1つの要素のクラス名/propsを組み立てるために手前で何段ものローカル変数を準備している
  • 同じblock内でユーザー情報・支払い情報・通知設定のように複数のドメイン概念を扱っている

逆に、整然と並んだ単純な要素列が長いだけであれば、無理に分割する必要はありません。 「他人がこのコンポーネントを上から下まで一気に読めるか」を基準にしてください。

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 81 lines · 32 tokens per session scan A d9041e884d69

Subscribe to this mod's changes

react-component-convention is a skill published in the GitHub repository ncaq/konoka (3 stars, last pushed yesterday), licensed Apache-2.0. It adds 32 tokens to every session and 1,227 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-05.

Related

Other skills, from other repositories