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.
npx skills add chandrudp29/skillhub --skill typescript-patternsgit clone --depth 1 https://github.com/chandrudp29/skillhubWrote 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.
[](https://agentmods.dev/skills/chandrudp29/skillhub/typescript-patterns)<a href="https://agentmods.dev/skills/chandrudp29/skillhub/typescript-patterns"><img src="https://agentmods.dev/badge/skills/chandrudp29/skillhub/typescript-patterns/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.
<a href="https://agentmods.dev/skills/chandrudp29/skillhub/typescript-patterns"><img src="https://agentmods.dev/badge/skills/chandrudp29/skillhub/typescript-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00030 | $0.00763 |
| Opus 5.5 | $0.00012 | $0.00305 |
| Sonnet 5.5 | $0.00006 | $0.00153 |
| Haiku 4.5 | $0.00003 | $0.00076 |
Grade A, and why
typescript-patterns 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.
How it starts
The opening of the file, as written. The whole thing — 102 lines — stays where its author put it; the contents beside it link to each section on GitHub.
When to Use
Apply when writing, reviewing, or refactoring any TypeScript code. Works for Node.js backends, React frontends, and full-stack projects.
Core Rules
- Always use
strict: truein tsconfig — never disable it to fix an error - Prefer
typefor unions and intersections,interfacefor object shapes that extend - Use
unknownoveranyat boundaries; narrow with type guards before use - Never use
ascasts to silence errors — fix the type instead - Avoid
!non-null assertions unless you've verified the value exists
Type Design
// Discriminated unions over boolean flags
type Result<T> =
| { success: true; data: T }
| { success: false; error: string };
// Utility types — use them, don't reinvent
type UserPreview = Pick<User, 'id' | 'name' | 'email'>;
type PartialConfig = Partial<Config>;
type ReadonlyUser = Readonly<User>;
// Branded types for semantic safety
type UserId = string & { readonly __brand: 'UserId' };
type EmailAddress = string & { readonly __brand: 'EmailAddress' };
// Const assertions for literal inference
const ROLES = ['admin', 'editor', 'viewer'] as const;
type Role = typeof ROLES[number]; // 'admin' | 'editor' | 'viewer'
Generics
// Constrain generics — never leave them open if you can help it
function first<T>(arr: readonly T[]): T | undefined {
return arr[0];
}
// Conditional types for inference
type Awaited<T> = T extends Promise<infer U> ? U : T;
// Template literal types for string APIs
type EventName = `on${Capitalize<string>}`;
Runtime Safety
// Type guards at system boundaries
function isUser(value: unknown): value is User {
return (
typeof value === 'object' &&
value !== null &&
'id' in value &&
typeof (value as User).id === 'string'
);
}
// Zod for schema validation at API boundaries
import { z } from 'zod';
const UserSchema = z.object({ id: z.string(), email: z.string().email() });
type User = z.infer<typeof UserSchema>;
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.
- 1mo ago First seen · 102 lines · 30 tokens per session scan A 104b2e86698e
typescript-patterns is a skill published in the GitHub repository chandrudp29/skillhub (14 stars, last pushed 3mo ago), licensed MIT. It adds 30 tokens to every session and 763 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.
Other skills, from other repositories
typescript-expert
Expert-level TypeScript development with modern tooling, advanced types, and best practices. Use this skill for TypeScript projects requiring type-safe code, modern bundling, and comprehensive testing.
adding-a-command
Creates a new CLI command following the Commander.js pattern in src/commands/. Handles command registration in src/cli.ts, telemetry tracking via tracked() wrapper, and option parsing. Use when user says add command, new CLI command, create subcommand, or adds files to src/commands/. Do NOT use for modifying existing…
jest-expert
Expert in Jest unit testing framework, mocks, snapshots, coverage reports, watch mode, and custom matchers. Use when the user mentions testing, unit testing, JavaScript, QA, mocking, or snapshots, or when the task involves Jest Framework, Test Structure, Advanced Features, or Basic Unit Tests.
implement-parse-list
Implement the parseList string utility.
code-review-typescript
Deep TypeScript-specific code review covering type safety, ESM/CJS, async correctness, money precision, and domain modeling. Applied in addition to the generic code-review skill when TypeScript/JavaScript code is detected. Invoked when reviewing TS/JS PRs, TypeScript changes, or performing TypeScript-specific quality…
typescript-docs
Comprehensive TypeScript reference covering all language features, type system, generics, narrowing, classes, modules, utility types, TSConfig, and advanced patterns. Use whenever the user mentions TypeScript, types, interfaces, generics, type inference, TSConfig, type guards, decorators, or needs help with any…