Getting it into your agent
It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.
git clone --depth 1 https://github.com/joaoguirunas/team-osnpx agentmods add skills/joaoguirunas/team-os/dev-typescript-patternsWrote 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/joaoguirunas/team-os/dev-typescript-patterns)<a href="https://agentmods.dev/skills/joaoguirunas/team-os/dev-typescript-patterns"><img src="https://agentmods.dev/badge/skills/joaoguirunas/team-os/dev-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/joaoguirunas/team-os/dev-typescript-patterns"><img src="https://agentmods.dev/badge/skills/joaoguirunas/team-os/dev-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.00037 | $0.01544 |
| Opus 5.5 | $0.00015 | $0.00618 |
| Sonnet 5.5 | $0.00007 | $0.00309 |
| Haiku 4.5 | $0.00004 | $0.00154 |
Grade A, and why
dev-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 27d 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 — 215 lines — stays where its author put it; the contents beside it link to each section on GitHub.
TypeScript Patterns — Software Complexo
Types vs Interfaces
// Interface: para objetos públicos e extensíveis (podem ser merged via declaration merging)
interface User {
id: string
email: string
name: string
}
// Type: para unions, intersections, mapped types, e aliases
type UserRole = 'admin' | 'member' | 'viewer'
type UserWithRole = User & { role: UserRole }
type PartialUser = Partial<User>
Regra geral: Interface para contratos de API e objetos de domínio. Type para unions, aliases e tipos compostos.
Discriminated Unions
// ✅ Modelar resultados com discriminated union
type Result<T, E = Error> =
| { success: true; data: T }
| { success: false; error: E }
// Uso
function parseUser(raw: unknown): Result<User> {
const parsed = userSchema.safeParse(raw)
if (!parsed.success) return { success: false, error: parsed.error }
return { success: true, data: parsed.data }
}
// Type narrowing automático
const result = parseUser(rawData)
if (result.success) {
console.log(result.data.email) // TypeScript sabe que data existe
} else {
console.log(result.error.message) // TypeScript sabe que error existe
}
Branded Types (IDs seguros)
// Evitar confundir UserId com OrderId
type UserId = string & { readonly _brand: 'UserId' }
type OrderId = string & { readonly _brand: 'OrderId' }
function createUserId(id: string): UserId {
return id as UserId
}
// Agora TypeScript recusa UserId onde OrderId é esperado
function getOrder(id: OrderId) { ... }
getOrder(userId) // ✅ Erro de compilação — catching bug em compile time
Generics com Constraints
// Generic para Repository pattern
interface Repository<T extends { id: string }> {
findById(id: string): Promise<T | null>
findAll(filters?: Partial<T>): Promise<T[]>
create(data: Omit<T, 'id' | 'createdAt'>): Promise<T>
update(id: string, data: Partial<Omit<T, 'id'>>): Promise<T>
delete(id: string): Promise<void>
}
// Generic utilitário
type PaginatedResult<T> = {
data: T[]
pagination: { page: number; perPage: number; total: number; hasNext: boolean }
}
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.
- 27d ago Changed 5413f6ec69c7
- 1mo ago First seen · 215 lines · 37 tokens per session scan A 685026878b44
dev-typescript-patterns is a skill published in the GitHub repository joaoguirunas/team-os (5 stars, last pushed 3d ago), licensed MIT. It adds 37 tokens to every session and 1,544 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-09-03.
Other skills, from other repositories
react-component-generator
Generate React components with TypeScript, proper props, hooks, and accessibility. Use when creating new React components, UI elements, or refactoring existing components.
kysely
Guidelines for developing with Kysely, a type-safe TypeScript SQL query builder with autocompletion support.
deno-typescript
Guidelines for developing with Deno and TypeScript using modern runtime features, security model, and native tooling.
drizzle-orm
Guidelines for developing with Drizzle ORM, a lightweight type-safe TypeScript ORM with SQL-like syntax.
express-typescript
Guidelines for building robust APIs with Express.js and TypeScript, covering middleware patterns, routing, and security best practices.
koa-typescript
Guidelines for building modern APIs with Koa.js and TypeScript, featuring the onion middleware model and async/await patterns.