Agent skill

Frontend Typescript Rules

by shinpr in shinpr/ai-coding-project-boilerplate

React/TypeScriptの型安全性、コンポーネント設計、状態管理ルールを適用。Reactコンポーネント実装時に使用。

MITAuto-check passedFrontend & Design

Install Frontend Typescript Rules

skills CLI
$ npx skills add shinpr/ai-coding-project-boilerplate --skill frontend-typescript-rules -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install shinpr/ai-coding-project-boilerplate frontend-typescript-rules --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/shinpr/ai-coding-project-boilerplate.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills-ja/frontend-typescript-rules .claude/skills/frontend-typescript-rules && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
frontend-typescript-rules
GitHub stars
232
Token cost
~1.1k tokens
SKILL.md length
201 words
Files
1
Skills in repo
42
Repo updated
First seen
Licence
MIT

At a glance

React/TypeScriptの型安全性、コンポーネント設計、状態管理ルールを適用。Reactコンポーネント実装時に使用。

  • Frontend & Design work in your project
  • SKILL.md covers 前提条件の検出, アンチパターンとしきい値, 境界での型安全性 and コンポーネントと状態の設計, plus 2 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Frontend Typescript Rules is an agent skill from shinpr/ai-coding-project-boilerplate. React/TypeScriptの型安全性、コンポーネント設計、状態管理ルールを適用。Reactコンポーネント実装時に使用。

Its SKILL.md is about 1.1k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Frontend & Design. It works with TypeScript and React. The repository describes itself as: Agentic coding TypeScript boilerplate for Claude Code: sub-agent workflows with built-in quality checks and context engineering. The licence is MIT.

When your agent uses it

  • Frontend & Design work in your project

Example prompts

  • “/frontend-typescript-rules”

What it can do on your machine

Read from SKILL.md and the folder at commit 56913a2. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Frontend Typescript Rules loads about 1.1k tokens when it runs. Until then it costs about 22 tokens; SKILL.md has 201 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~22
When it runs · the whole SKILL.md, loaded when a task matches
~1.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from shinpr/ai-coding-project-boilerplate at commit 56913a2, republished under its MIT licence (© shinpr). 201 words, ~1,082 tokens.

Download SKILL.mdSave it as .claude/skills/frontend-typescript-rules/SKILL.md (or your agent's skills folder).
name
frontend-typescript-rules
description
React/TypeScriptの型安全性、コンポーネント設計、状態管理ルールを適用。Reactコンポーネント実装時に使用。

TypeScript 開発ルール(フロントエンド)

実装向けの frontend 固有 React/TypeScript ルール: しきい値、境界での型安全性、コンポーネント/状態の設計、エラーハンドリング、プロジェクト規約。

前提条件の検出

プロジェクト規約を適用する前に、TypeScript、bundler/framework、lint・format、path alias、React Compiler、代表的なコンポーネントの設定を確認する。設定またはリポジトリで確立済みのパターンに裏付けられた規約を確認済みとして扱い、限られた例から導いた結論には推測であることを明記する。競合するパターンによって公開される振る舞い、互換性、コンポーネント境界が変わる場合は作業を止め、必要な情報源または判断を具体的に示す。

アンチパターンとしきい値

設計変更を促すシグナル:

  • prop drilling が 3 階層以上 → Context または状態管理へ持ち上げる
  • コンポーネントが 300 行超 → 分割する
  • Props が 10 個超 → コンポーネントを分割(3〜7 個が適正範囲)
  • optional Props が 50% 超 → デフォルト値または Context を導入する
  • Props のネストが 2 階層超 → フラット化する

境界での型安全性

信頼できない型または取得できない型はunknownで受け、型ガードで絞り込む。asは、runtime/frameworkの不変条件によって対象の型が保証される場合にのみ使用し、その不変条件を近くのコメントに記録する。既存の生成コードまたはサードパーティの型宣言に含まれるanyは、ラップすべき境界入力であり、アプリケーションの契約へanyを広げる根拠にはならない。

アプリ内部では React の Props/State は型保証されており unknown は不要。外部境界では必ず unknown で受け、使用前に型ガードで絞り込む: API レスポンス、localStorage/sessionStorage、URL パラメータ、パースした JSON。制御コンポーネントのフォーム入力は React 合成イベントを通じて型安全に保たれる。

typescript
const raw: unknown = await (await fetch(url)).json()
if (!isUser(raw)) throw new ValidationError('invalid user')
const user = raw // User に絞り込み済み

コンポーネントと状態の設計

  • Function component のみ。 class component は Error Boundary に限り許可(hook の代替が存在しないため)
  • Props は名前付き型で明示し分割代入する: function UserCard({ user, onSelect }: UserCardProps)。propsを関数に直接型付けしてProps契約を明示する
  • Props 駆動: 1つの明確な親コンポーネントが所有する依存はPropsで渡す。互いに隣接しない複数の子孫が値を共有し、Propsの中継によって所有責務を持たない中間コンポーネントが増える場合は、Contextまたは確立済みのグローバルstateを使用する
  • Custom hook をロジック再利用と依存注入の単位とする(テスト容易性のため、依存オブジェクトは hook 経由で注入する)
  • 関数引数: 位置引数は 0〜2 個。3 個以上は単一の options オブジェクトで受ける
  • 状態の形: 状態は明示的に型付けする。複数フィールドかつ離散的な遷移を持つ状態は、複数の useState ではなく discriminated union の action 型を用いた useReducer にする
  • Server/Client 境界(RSC フレームワークのみ — 例: Next.js App Router): データ取得とレンダリングは既定でサーバーコンポーネントに置き、インタラクティブ性は必要最小のスコープで "use client" 境界の内側に隔離する。ブラウザ専用 API(window、localStorage、イベントハンドラ)はクライアントコンポーネント内に留める。サーバーコンポーネントで呼ぶとレンダリングが壊れるためである。クライアントのみの SPA(例: Vite)では N/A であり、サーバーコンポーネントランタイムが無いプロジェクトではスキップする

エラーハンドリング

  • すべてのエラーに1つの明示的な結果を与える: 型付きの想定内失敗へ変換する、担当するUI境界で処理する、診断情報を保持して伝播する、のいずれかとする。同じ失敗を重複して記録しないよう、ログ出力を担う層で記録する
  • Fail fast: 不正な状態では、無言のフォールバックを返さず throw する
  • 想定内の失敗は Result 型で値として表現する。throw は想定外/回復不能なケースに限る
  • 目的別のエラークラスは code を持つ基底 AppError を継承する(例: ValidationError, ApiError, NotFoundError)
  • 層の責務: API 層は transport エラーをドメインエラーへ変換する。hook は AppError を上位へ伝播する。Error Boundary はレンダリング時のエラーを捕捉しフォールバック UI を表示する
  • Effect の競合/クリーンアップ: useEffect 内のデータ取得は、順序が入れ替わった応答とアンマウント後の状態更新に対してガードする。具体的には、AbortController か mounted フラグで stale な結果を中断・無視するか、キャンセルと重複排除を行うサーバー状態ライブラリ(React Query/SWR)を使う。try-catch だけではこれをカバーできない
  • 現在の信頼境界で許可された診断フィールドだけをログに含める。認証情報、トークン、決済情報、その他の機微情報はログ出力前に除去する
typescript
type Result<T, E> = { ok: true; value: T } | { ok: false; error: E }

class AppError extends Error {
  constructor(message: string, readonly code: string, readonly statusCode = 500) {
    super(message); this.name = this.constructor.name
  }
}

Error Boundary — class component が必要となる唯一の箇所:

typescript
class ErrorBoundary extends React.Component<{ children: React.ReactNode; fallback: React.ReactNode }, { hasError: boolean }> {
  state = { hasError: false }
  static getDerivedStateFromError() { return { hasError: true } }
  render() { return this.state.hasError ? this.props.fallback : this.props.children }
}

プロジェクト規約

  • 環境変数: クライアント側の環境変数は、設定済みbundlerが公開するaccessor経由で読む。確認したbundlerに合わせる: Viteはimport.meta.env.VITE_*、Next.jsの公開変数はprocess.env.NEXT_PUBLIC_*、CRAはprocess.env.REACT_APP_*。フロントエンドのバンドルには公開設定だけを含め、シークレットはサーバー側の境界内に置く
  • バンドルとパフォーマンス: バンドルサイズは build スクリプトでプロジェクトの予算に対して監視する。React.lazy + Suspense でコード分割する。再レンダリングを最小化する状態構造にする。メモ化: React Compiler が有効なときはそれに任せる。手動の React.memo/useMemo/useCallback は、プロファイラの実測または参照同一性の必要性で裏付けられる場合に限る(実測されたボトルネック、またはサードパーティ API や effect 依存に対する安定した参照同一性)
  • 命名: コンポーネント/型は PascalCase、変数/関数は camelCase、hook は use 接頭辞、定数は SCREAMING_SNAKE_CASE
  • インポート: tsconfig、lint設定、代表的なファイルから確認したaliasとimport順序に従う。src/からの絶対pathは設定済みのaliasが対応している場合にのみ使用する
  • フォーマット: リポジトリで設定済みのformatterに従う。Biomeが存在する場合は、セミコロンとスタイルをそのプロジェクト設定に合わせる

© shinpr, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills-ja/frontend-typescript-rules of shinpr/ai-coding-project-boilerplate.

Open the folder on GitHubat commit 56913a2

Compare with similar skills

Frontend Typescript Rules next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Frontend Typescript Rules compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Frontend Typescript Rules this skillshinpr/ai-coding-project-boilerplate232—~1.1kAutomated safety check: PassMIT
Web Artifacts Builderanthropics/skills180k41 repos~769Automated safety check: PassApache-2.0
Ink Tui Wizardnovuhq/novu40k—~1.9kAutomated safety check: PassMIT
Frontend Module Standardssiteboon/claudecodeui14k—~2.6kAutomated safety check: PassAGPL-3.0
Dify Component Writing Guidelanggenius/dify158k—~626Automated safety check: PassCustom licence
React Frontend Development Guidelinesdiet103/claude-code-infrastructure-showcase10k2 repos~2.9kAutomated safety check: PassMIT

Similar skills

  • Web Artifacts Builder

    anthropics/skills

    Official

    Builds multi-component claude.ai HTML artifacts as a small React, TypeScript and Tailwind project, then bundles it into one shareable HTML file.

    180k GitHub starsUsed in 41 repos~769 tokens
    Frontend & DesignAuto-check passed
  • Ink Tui Wizard

    novuhq/novu

    Build terminal user interfaces (TUIs) using Ink (React for CLIs) and @inkjs/ui with a reactive, session-driven wizard pattern.

    40k GitHub stars~1.9k tokensUpdated today
    Frontend & DesignAuto-check passed
  • Frontend Module Standards

    siteboon/claudecodeui

    Enforces one repository's React and TypeScript module layout for code under src/: source-root imports, feature barrels, deliberate exports and no deep imports.

    14k GitHub stars~2.6k tokensUpdated today
    Frontend & DesignAuto-check passed
  • Use when implementing or refactoring React/TypeScript components and the task requires decisions about component ownership, feature boundaries, state, data…

    158k GitHub stars~626 tokensUpdated today
    Frontend & DesignAuto-check passed
  • React Frontend Development Guidelines

    diet103/claude-code-infrastructure-showcase

    Guidelines for React 18 and TypeScript apps covering Suspense data fetching, lazy loading, feature folders, MUI v7 styling, TanStack Router and performance.

    10k GitHub starsUsed in 2 repos~2.9k tokens
    Frontend & DesignAuto-check passed
  • Formik Form Patterns

    ChrisWiles/claude-code-showcase

    Shows how to build forms with Formik and Yup validation, including conditional rules, field helpers, GraphQL submission, edit forms and multi-step flows.

    6.1k GitHub starsUsed in 3 repos~2.1k tokens
    Frontend & DesignAuto-check passed

More from shinpr/ai-coding-project-boilerplate

All 42 skills in this repo
  • Integration E2E Testing

    shinpr/ai-coding-project-boilerplate

    Selects and designs the smallest integration/E2E test set that proves accepted behavior at an observable boundary.

    232 GitHub stars~2.8k tokensUpdated 4 days ago
    Auto-check passed
  • Skill Optimization

    shinpr/ai-coding-project-boilerplate

    Evaluates and optimizes skill file quality using 9 content patterns and 10 editing principles.

    232 GitHub stars~3.5k tokensUpdated 4 days ago
    Auto-check passed
  • Frontend Technical Spec

    shinpr/ai-coding-project-boilerplate

    Defines React environment, component architecture, state/data flow, build verification, and frontend non-functional criteria from repository evidence.

    232 GitHub stars~1.9k tokensUpdated 4 days ago
    Auto-check: notes
  • Frontend Typescript Rules

    shinpr/ai-coding-project-boilerplate

    Applies React/TypeScript type safety, component design, and state management rules.

    232 GitHub stars~1.7k tokensUpdated 4 days ago
    Auto-check passed
  • Implementation Approach

    shinpr/ai-coding-project-boilerplate

    Selects implementation strategy (vertical slice, horizontal, or hybrid) with risk assessment.

    232 GitHub stars~3.2k tokensUpdated 4 days ago
    Auto-check passed
  • Subagents Orchestration Guide

    shinpr/ai-coding-project-boilerplate

    Coordinates subagents through scale-based planning, approval, implementation, verification, and escalation flows.

    232 GitHub stars~8k tokensUpdated 4 days ago
    Auto-check passed

Works with

Questions about Frontend Typescript Rules

What does Frontend Typescript Rules do?

React/TypeScriptの型安全性、コンポーネント設計、状態管理ルールを適用。Reactコンポーネント実装時に使用。. Frontend Typescript Rules is an agent skill from shinpr/ai-coding-project-boilerplate.

When should I use Frontend Typescript Rules?

Frontend Typescript Rules fits situations like: frontend & Design work in your project.

How do I install Frontend Typescript Rules in Claude Code?

Run `npx skills add shinpr/ai-coding-project-boilerplate --skill frontend-typescript-rules -a claude-code`. Or copy the skill folder (.claude/skills-ja/frontend-typescript-rules in shinpr/ai-coding-project-boilerplate) into .claude/skills/frontend-typescript-rules in your project. Claude Code loads it when a task matches its description.

How do I install Frontend Typescript Rules in Codex?

Run `npx skills add shinpr/ai-coding-project-boilerplate --skill frontend-typescript-rules -a codex`. Or copy the skill folder (.claude/skills-ja/frontend-typescript-rules in shinpr/ai-coding-project-boilerplate) into .agents/skills/frontend-typescript-rules in your project. Codex loads it when a task matches its description.

Can I use Frontend Typescript Rules in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add shinpr/ai-coding-project-boilerplate --skill frontend-typescript-rules -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/frontend-typescript-rules, .gemini/skills/frontend-typescript-rules, .github/skills/frontend-typescript-rules and .opencode/skills/frontend-typescript-rules in your project.

What does Frontend Typescript Rules need to run?

SKILL.md names no scripts, command-line tools or credentials: Frontend Typescript Rules is instructions for the agent only.

Does Frontend Typescript Rules access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Frontend Typescript Rules safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Frontend Typescript Rules use?

Frontend Typescript Rules is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Frontend Typescript Rules use?

About 1.1k tokens (SKILL.md is roughly 4.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Frontend Typescript Rules?

Skills that share tags, products or a category with Frontend Typescript Rules: Web Artifacts Builder (anthropics/skills, 180k stars), Ink Tui Wizard (novuhq/novu, 40k stars), Frontend Module Standards (siteboon/claudecodeui, 14k stars) and Dify Component Writing Guide (langgenius/dify, 158k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Frontend Typescript Rules?

shinpr (a GitHub user) maintains it in shinpr/ai-coding-project-boilerplate, which has 232 GitHub stars. The repository holds 42 skills in this directory. The repository was last updated on October 4, 2026.

Source: shinpr/ai-coding-project-boilerplate on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.