typescript-rules

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

A set of TypeScript rules for keeping data type-safe and handling errors at clear boundaries. It includes a no-`any` policy and requires checks that confirm the shape of external data.

In plain words
What is it for?
Use it when implementing or reviewing TypeScript, especially around APIs, forms, legacy systems, serialization, and error handling.
Why use it?
It reduces runtime failures caused by trusting unverified API responses, form input, or legacy integrations. It also keeps invalid data from spreading through the application.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

Good fit Use it when implementing or reviewing TypeScript, especially around APIs, forms, legacy systems, serialization, and error handling.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/shinpr/ai-coding-project-boilerplate/typescript-rules
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 shinpr/ai-coding-project-boilerplate --skill 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 typescript-rules

README.md
[![agentmods](https://agentmods.dev/badge/skills/shinpr/ai-coding-project-boilerplate/typescript-rules/github.svg)](https://agentmods.dev/skills/shinpr/ai-coding-project-boilerplate/typescript-rules)
Your own site
<a href="https://agentmods.dev/skills/shinpr/ai-coding-project-boilerplate/typescript-rules"><img src="https://agentmods.dev/badge/skills/shinpr/ai-coding-project-boilerplate/typescript-rules/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-rules

Your own site · 80×15
<a href="https://agentmods.dev/skills/shinpr/ai-coding-project-boilerplate/typescript-rules"><img src="https://agentmods.dev/badge/skills/shinpr/ai-coding-project-boilerplate/typescript-rules.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 31 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,252 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 pass 7 Sept 2026
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.00031 $0.01252
Opus 5.5 $0.00012 $0.00501
Sonnet 5.5 $0.00006 $0.00250
Haiku 4.5 $0.00003 $0.00125

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

Security

Grade A, and why

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

.claude/skills-en/typescript-rules/SKILL.md · 125 lines

How it starts

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

TypeScript Development Rules

Prerequisite Detection

Inspect tsconfig, runtime/framework configuration, lint/format configuration, path aliases, package scripts, and representative modules before applying project conventions. Treat a rule as project-specific only when configuration or an established pattern supports it. Label limited-pattern conclusions as inferred. When competing conventions change a public contract, runtime behavior, or error boundary, stop and name the source or user decision required.

Type Safety in Backend Implementation

Type Safety in Data Flow Input Layer (unknown) -> Type Guard -> Business Layer (Type Guaranteed) -> Output Layer (Serialization)

Backend-Specific Type Scenarios:

  • API Communication: Receive responses as unknown and validate them with type guards
  • Form Input: External input as unknown, type determined after validation
  • Legacy Integration: Receive the legacy boundary as unknown; isolate any evidence-backed assertion in the adapter that owns the boundary
  • Test Code: Define mock input/output types with the configured test harness; use Partial<T> for intentionally partial fixtures and typed vi.fn<[Args], Return>() only when Vitest is configured

Coding Conventions

Class Usage Criteria

  • Recommended: Implementation with Functions and Interfaces
    • Rationale: Improves testability and flexibility of function composition
  • Classes Allowed:
    • Framework requirements (NestJS Controller/Service, TypeORM Entity, etc.)
    • Custom error class definitions
    • When state and business logic are tightly coupled (e.g., ShoppingCart, Session, StateMachine)
  • Decision Criterion: If "Does this data have behavior?" is Yes, consider using a class
    // Functions and interfaces
    interface UserService { create(data: UserData): User }
    const userService: UserService = { create: (data) => {...} }
    

Function Design

  • 0-2 parameters maximum: Use object for 3+ parameters
    // Object parameter
    function createUser({ name, email, role }: CreateUserParams) {}
    

Read the full file on GitHub · 125 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 · 125 lines · 31 tokens per session scan A 14ed63860295

Subscribe to this mod's changes

typescript-rules is a skill published in the GitHub repository shinpr/ai-coding-project-boilerplate (234 stars, last pushed 5d ago), licensed MIT. It adds 31 tokens to every session and 1,252 once invoked, about $0.0001 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

V3 CLI Modernization

CLI modernization and hooks system enhancement for claude-flow v3. Implements interactive prompts, command decomposition, enhanced hooks integration, and intelligent workflow automation.

ruvnet/ruflo · 35 tokens

setup-ts-deep-modules

A TypeScript repository setup that keeps each package's internal code private behind root-level entry files. A package is a reusable unit of code, and an entry point is the file other code is meant to import.

vinvcn/mattpocock-skills-zh-CN · 49 tokens

CreateCLI

Generates production-ready TypeScript CLIs via a 3-tier template system (manual arg parsing, Commander.js, oclif), each shipping full implementation, docs, package.json, strict config, JSON output, and exit-code compliance. USE WHEN create CLI, build CLI, command-line tool, wrap API, add command, upgrade tier…

danielmiessler/LifeOS · 88 tokens

typescript-best-practices

TypeScript best practices. Use when reading or editing any .ts or .tsx file.

michael-denyer/pstack-claude · 24 tokens

frontend-ai-guide

Applies React/TypeScript-specific technical decision criteria, anti-pattern detection, debugging, and frontend quality gates. Use when reviewing components, hooks, browser behavior, or frontend implementation completeness.

shinpr/claude-code-workflows · 41 tokens

output-dev-code-style

Code style conventions for Output SDK workflow projects. Use when writing or reviewing any TypeScript/JavaScript code. Discovers the project's own linting rules first; falls back to Output SDK conventions when no linter is configured.

growthxai/output · 50 tokens