rc-typescript

rc-typescript is a skill for Claude Code, Codex from rodolfochicone/rc-project. It costs 32 tokens per session (1,490 once invoked), scanned A, original, MIT.

A TypeScript design guide built around making invalid program states impossible to represent in code. It recommends precise types, such as named state variants, instead of loose combinations of flags and escape hatches.

In plain words
What is it for?
Use it when writing or reviewing TypeScript types and data models. It helps design states, errors, APIs, and other structures so callers must handle only valid possibilities.
Why use it?
TypeScript can accept code that compiles but still permits contradictory or incomplete states. These practices move more mistakes into compile-time checks instead of leaving them for production.

Skill for Claude CodeCodex

Part of the rc plugin — 32 skills, 2 commands, 4 agents, 5 hooks shipped together

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/rodolfochicone/rc-project/rc-typescript
Any agent
npx skills add rodolfochicone/rc-project --skill rc-typescript
Clone the repo
git clone --depth 1 https://github.com/rodolfochicone/rc-project

Made for: Claude Code, Codex.

Or install rc, the plugin that ships this one along with the rest of its 32 skills, 2 commands, 4 agents, 5 hooks.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/rodolfochicone/rc-project/rc-typescript.svg)](https://agentmods.dev/skills/rodolfochicone/rc-project/rc-typescript)
Your own site
<a href="https://agentmods.dev/skills/rodolfochicone/rc-project/rc-typescript"><img src="https://agentmods.dev/badge/skills/rodolfochicone/rc-project/rc-typescript.svg" alt="Measured on agentmods" 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,490 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.00032 $0.01490
Opus 5 $0.00016 $0.00745
Sonnet 5 $0.00006 $0.00298
Haiku 4.5 $0.00003 $0.00149

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

Security

Grade A, and why

rc-typescript 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 5d 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.

Makes network callslowCapability

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

const res = await fetch(url);
skills/promoted/rc-typescript/SKILL.md · 149 lines

How it starts

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

TypeScript

Not a language tutorial — the model already writes TypeScript. This is the type design the model does not apply by default: left alone it produces loose, structurally-typed code that compiles and still permits the bug. For framework and library API behaviour, which moves faster than any skill can track, use the Context7 MCP; for the conventions of a specific repo, its AGENTS.md.

The whole discipline is one idea: make the illegal state unrepresentable, so the wrong code fails to compile instead of failing in production.

Model the state, don't flag it

Booleans multiply into states that cannot occur. Three flags describe eight states when the domain has three.

// permits { loading: true, error: Error, data: User } — meaningless, and reachable
type State = { loading: boolean; error?: Error; data?: User };

// exactly the states that exist
type State =
  | { status: 'idle' }
  | { status: 'loading' }
  | { status: 'failed'; error: Error }
  | { status: 'loaded'; data: User };

The discriminated union pays off at every use site: after if (s.status === 'loaded') the compiler knows s.data exists, so the optional-chaining and the non-null assertions disappear on their own.

The tell that you need one: two optional fields where exactly one is ever set, or a comment explaining which combination is valid.

Exhaustiveness

A switch over a union must be exhaustive, and the compiler must be the thing that enforces it — so adding a variant breaks the build at every site that needs updating, instead of silently falling through.

function label(s: State): string {
  switch (s.status) {
    case 'idle':    return 'Ready';
    case 'loading': return 'Loading…';
    case 'failed':  return s.error.message;
    case 'loaded':  return s.data.name;
    default: {
      const unreachable: never = s;   // a new variant fails to compile here
      throw new Error(`unhandled: ${JSON.stringify(unreachable)}`);
    }
  }
}

A default that returns a fallback value instead of the never check is how a new variant ships unhandled.

Read the full file on GitHub · 149 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. 5d ago First seen · 149 lines · 32 tokens per session scan A b92e0f92c349

Subscribe to this mod's changes

rc-typescript is a skill published in the GitHub repository rodolfochicone/rc-project (19 stars, last pushed 1mo ago), licensed MIT. It adds 32 tokens to every session and 1,490 once invoked, about $0.0002 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.