typescript-react

typescript-react is a skill for Claude Code, Codex from mkosir/typescript-style-guide. It costs 50 tokens per session (1,409 once invoked), scanned A, original, MIT.

A set of conventions for writing and reviewing React code with TypeScript. React is a tool for building user interfaces, and TypeScript adds checks to JavaScript code.

In plain words
What is it for?
Designing React components, typing their inputs, handling data and state, and reviewing client-side or server-side code. It is especially relevant when values passed into a component may change over time.
Why use it?
It helps prevent bugs caused by unclear component responsibilities, incorrect prop types, or state that stops matching incoming data. It also makes design choices and tradeoffs easier to review.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Designing React components, typing their inputs, handling data and state, and reviewing client-side or server-side code. It is especially relevant when values passed into a component may change over time.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/mkosir/typescript-style-guide/typescript-react
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 mkosir/typescript-style-guide --skill typescript-react
Clone the repo
git clone --depth 1 https://github.com/mkosir/typescript-style-guide

Made for: Claude Code, Codex.

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 typescript-react

README.md
[![agentmods](https://agentmods.dev/badge/skills/mkosir/typescript-style-guide/typescript-react/github.svg)](https://agentmods.dev/skills/mkosir/typescript-style-guide/typescript-react)
Your own site
<a href="https://agentmods.dev/skills/mkosir/typescript-style-guide/typescript-react"><img src="https://agentmods.dev/badge/skills/mkosir/typescript-style-guide/typescript-react/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 typescript-react

Your own site · 80×15
<a href="https://agentmods.dev/skills/mkosir/typescript-style-guide/typescript-react"><img src="https://agentmods.dev/badge/skills/mkosir/typescript-style-guide/typescript-react.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 50 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,409 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. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Prompt Injection · line 28
    Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.
    Fix: Audit all comments and invisible characters. Remove any instructions that direct the agent to perform unauthorized actions. Use plain, reviewable content.
How audits are shown
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.00050 $0.01409
Opus 5.5 $0.00020 $0.00564
Sonnet 5.5 $0.00010 $0.00282
Haiku 4.5 $0.00005 $0.00141

Measured 1mo ago against content hash c90c3b65ffcf, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

typescript-react 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 1mo 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.

skills/typescript-react/SKILL.md · 174 lines

How it starts

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

React

Apply the TypeScript Style Guide's React conventions in the context of the current task.

Workflow

  1. Inspect the consuming repository's React, framework, and state-management conventions.
  2. Let explicit repository conventions take precedence over this opinionated guidance.
  3. Apply, review, or explain only the guidance relevant to the task.
  4. State important tradeoffs when component or state design depends on application context.

Boundaries

  • Keep TypeScript, React, and ESLint responsible for checks they can enforce automatically.
  • Do not redesign unrelated components or state merely because this skill is active.

Functions

For detailed function design guidance, use typescript-functions when it is available.

Appendix - React

Since React components and hooks are also functions, the respective function conventions apply.

Props To State

In general, avoid using props as initial state because the state will not update when the props change. This can lead to bugs that are hard to track, unintended side effects, and difficulty testing.
When there is truly a use case for using a prop as initial state, the prop must be prefixed with initial (e.g. initialProduct, initialSort etc.)

// ❌ Avoid using props to state
type FooProps = {
  productName: string;
  userId: string;
};

export const Foo = ({ productName, userId }: FooProps) => {
  const [productName, setProductName] = useState(productName);
  ...

// ✅ Use prop prefix `initial` when there is a rationale for it
type FooProps = {
  initialProductName: string;
  userId: string;
};

export const Foo = ({ initialProductName, userId }: FooProps) => {
  const [productName, setProductName] = useState(initialProductName);
  ...

Props Type

// ❌ Avoid using React.FC type
type FooProps = {
  name: string;
  score: number;
};

export const Foo: React.FC<FooProps> = ({ name, score }) => {

// ✅ Use props argument with type
type FooProps = {
  name: string;
  score: number;
};

export const Foo = ({ name, score }: FooProps) => {...

Read the full file on GitHub · 174 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. 1mo ago First seen · 174 lines · 50 tokens per session scan A c90c3b65ffcf

Subscribe to this mod's changes

typescript-react is a skill published in the GitHub repository mkosir/typescript-style-guide (784 stars, last pushed 1mo ago), licensed MIT. It adds 50 tokens to every session and 1,409 once invoked, about $0.0002 per session on Opus 5.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-08-30.

Related

Other skills, from other repositories

typescript-advanced-types

Master TypeScript's advanced type system including generics, conditional types, mapped types, template literals, and utility types for building type-safe applications. Use when implementing complex type logic, creating reusable type utilities, or ensuring compile-time type safety in TypeScript projects.

bartstc/vite-ts-react-template · 57 tokens

webiny-api-cms-custom-field-type

How to implement a custom CMS field type that integrates with the model builder's fluent API. Covers extending DataFieldBuilder, composing validator interfaces, creating a FieldTypeFactory, registering via DI, and module augmentation for TypeScript autocomplete on the fields() registry.

webiny/webiny-js · 60 tokens

no-bare-casts

Writing as in TypeScript or TSX production code, modifying a file that contains a bare as cast, silencing a type error with a cast, encountering as unknown as, or reviewing a cast site.

prisma/orm · 52 tokens

adapter-express

Mount tRPC as Express middleware with createExpressMiddleware() from @trpc/server/adapters/express. Access Express req/res in createContext via CreateExpressContextOptions. Mount at a path prefix like app.use('/trpc', ...). Avoid global express.json() conflicting with tRPC body parsing for FormData.

trpc/trpc · 67 tokens

trpc-router

Entry point for all tRPC skills. Decision tree routing by task: initTRPC.create(), t.router(), t.procedure, createTRPCClient, adapters, subscriptions, React Query, Next.js, links, middleware, validators, error handling, caching, FormData.

trpc/trpc · 59 tokens

merge-seed

Merge upstream React Starter Kit updates (the seed remote) into main, preserving this project's identity, scope, and behavior. Use when asked to sync, pull, or merge the seed / starter kit / upstream template.

kriasoft/react-starter-kit · 49 tokens