frontend-typescript-rules

frontend-typescript-rules is a skill for Claude Code from shinpr/ai-coding-project-boilerplate. It costs 29 tokens per session (1,435 once invoked), scanned A, original, MIT.

A set of React and TypeScript rules for safe types, component structure, state management, boundaries, and error handling. TypeScript adds checks to JavaScript code before it runs.

In plain words
What is it for?
Use it when implementing React components, choosing state-management patterns, typing untrusted data, handling errors, or deciding when to split a component.
Why use it?
It provides concrete limits and repository checks that help prevent oversized components, excessive prop passing, unsafe assertions, and unclear data ownership.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

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.

agentmods
npx agentmods add skills/shinpr/ai-coding-project-boilerplate/frontend-typescript-rules
Any agent
npx skills add shinpr/ai-coding-project-boilerplate --skill frontend-typescript-rules
Clone the repo
git clone --depth 1 https://github.com/shinpr/ai-coding-project-boilerplate

Made for: Claude Code.

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 frontend-typescript-rules

README.md
[![agentmods](https://agentmods.dev/badge/skills/shinpr/ai-coding-project-boilerplate/frontend-typescript-rules.svg)](https://agentmods.dev/skills/shinpr/ai-coding-project-boilerplate/frontend-typescript-rules)
Your own site
<a href="https://agentmods.dev/skills/shinpr/ai-coding-project-boilerplate/frontend-typescript-rules"><img src="https://agentmods.dev/badge/skills/shinpr/ai-coding-project-boilerplate/frontend-typescript-rules.svg" alt="Measured on agentmods" height="20"></a>
Per session 29 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,435 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
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.00029 $0.01435
Opus 5 $0.00015 $0.00718
Sonnet 5 $0.00006 $0.00287
Haiku 4.5 $0.00003 $0.00144

Measured yesterday against content hash 46fb2c08c2c3, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

frontend-typescript-rules scanned grade A with 1 finding 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 yesterday.

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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

const raw: unknown = await (await fetch(url)).json()
.claude/skills-en/frontend-typescript-rules/SKILL.md · 77 lines

How it starts

The opening of the file, as written. The whole thing — 77 lines — stays where its author put it; the contents beside it link to each section on GitHub.

TypeScript Development Rules (Frontend)

Frontend-specific React/TypeScript rules for implementation: thresholds, boundary type safety, component/state design, error handling, and project conventions.

Prerequisite Detection

Inspect TypeScript, bundler/framework, lint/format, path-alias, React compiler, and representative component configuration before applying a project convention. Treat a convention as observed when configuration or an established repository pattern supports it; label a conclusion from limited examples as inferred. When conflicting patterns affect public behavior, compatibility, or component boundaries, stop and name the required source or decision.

Anti-patterns and Thresholds

Signals that trigger a design change:

  • Prop drilling through 3+ levels → lift to Context or state management
  • Component over 300 lines → split
  • Props count over 10 → split the component (3-7 is the working range)
  • Optional props over 50% → introduce defaults or Context
  • Props nesting deeper than 2 levels → flatten
  • The same as assertion appearing 3+ times → revisit the type design

Type Safety at Boundaries

Receive untrusted or unavailable types as unknown and narrow them with a type guard. Use as only when a runtime/framework invariant proves the asserted type and record that invariant in a nearby comment. Existing generated or third-party declarations that contain any are boundary inputs to wrap, not justification for spreading any into application contracts.

Inside the app, React Props/State are type-guaranteed — no unknown needed. At every external boundary, receive as unknown and narrow with a type guard before use: API responses, localStorage/sessionStorage, URL parameters, parsed JSON. Controlled-component form input stays type-safe through React synthetic events.

const raw: unknown = await (await fetch(url)).json()
if (!isUser(raw)) throw new ValidationError('invalid user')
const user = raw // narrowed to User

Read the full file on GitHub · 77 lines

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. yesterday Changed 46fb2c08c2c3
  2. 6d ago First seen · 77 lines · 29 tokens per session scan A a772baaa70f4

Subscribe to this mod's changes

frontend-typescript-rules is a skill published in the GitHub repository shinpr/ai-coding-project-boilerplate (228 stars, last pushed yesterday), licensed MIT. It adds 29 tokens to every session and 1,435 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories