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 monkilabs/opencastle --skill typescript-best-practicesgit clone --depth 1 https://github.com/monkilabs/opencastleWrote 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/monkilabs/opencastle/typescript-best-practices)<a href="https://agentmods.dev/skills/monkilabs/opencastle/typescript-best-practices"><img src="https://agentmods.dev/badge/skills/monkilabs/opencastle/typescript-best-practices/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/monkilabs/opencastle/typescript-best-practices"><img src="https://agentmods.dev/badge/skills/monkilabs/opencastle/typescript-best-practices.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
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.00054 | $0.01377 |
| Opus 5.5 | $0.00022 | $0.00551 |
| Sonnet 5.5 | $0.00011 | $0.00275 |
| Haiku 4.5 | $0.00005 | $0.00138 |
Grade A, and why
typescript-best-practices 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 23d 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 — 95 lines — stays where its author put it; the contents beside it link to each section on GitHub.
TypeScript Best Practices
Make the illegal state unrepresentable, then let the compiler enforce it.
| Rule | Summary |
|---|---|
| Discriminated unions | Model variants with a kind literal discriminant so impossible states cannot be represented. No optional-field bags. |
| Branded types | Brand primitives with & { readonly __brand: 'X' } so they cannot be mixed up. Validate once at creation. |
| Constructive modeling | Build the shape so the illegal value cannot be constructed. [T, ...T[]] for non-empty, [T, T][] for even length, start plus duration for a range. Not a runtime guard. |
| Simplest total type | Keep T[] while every operation on it stays total. Strengthen to NonEmpty<T> only where the loose type forces !, a cast, or a "should never happen" throw. |
unknown over any |
External data is unknown. any disables type checking everywhere it touches. |
No as casts |
Every as is a runtime crash waiting. Cast only after validation. |
| Narrowing hierarchy | Discriminant switch > in operator > typeof/instanceof > user-defined type guard > as. |
| Type guards | Must verify the claim. A lying guard is worse than as, because the bug hides behind a name that says it is safe. Name them isX or hasX. |
| Exhaustiveness | Inline const _exhaustive: never = x in default arms so the compiler errors when a variant is added. |
satisfies over as |
Validates the value without widening literal types. |
| Boundary validation | Parse where data crosses in, into a named domain type. Record<string, unknown> stops at that parse. Trust types inside; do not re-validate deep in call chains. |
| Schema-derived types | Reach for Pick/Omit/Parameters/ReturnType/Awaited/typeof before declaring a new interface. |
| Object args | Pass objects, not positional args, so argument order is self-documenting. Skip on hot paths: per-frame render, tokenizers, parsers. |
| Real tests | Do not mock what you can run. Prefer real test primitives and verify UI in a running build. Mock only what you cannot run locally. |
| Structured telemetry | Structured logger diagnostics with enough context to debug from an id. No console.log in shipped code. |
External data is anything from RPC payloads, JSON.parse, postMessage, IPC, file contents, environment variables, or database results.
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.
- 23d ago Changed · -9 tokens per session 3b09b6c5c1c0
- 1mo ago First seen · 95 lines · 63 tokens per session scan A 753fc87d6749
typescript-best-practices is a skill published in the GitHub repository monkilabs/opencastle (80 stars, last pushed 7d ago), licensed MIT. It adds 54 tokens to every session and 1,377 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-09-03.
Other skills, from other repositories
python-patterns
Python development principles and decision-making. Framework selection, async patterns, type hints, and project structure.
rust-pro
Master Rust 1.75+ with modern async patterns, advanced type system features, and production-ready systems programming. Expert in Tokio, Axum, and zero-cost abstractions.
tauri-pro
Master Tauri v1/v2 desktop development with Rust commands, IPC bridge, security capabilities, window state, and event bus.
angular-shared-libraries
Structuring reusable Angular code across an app or Nx/Angular-CLI workspace — shared reactive-forms building blocks (form-group factories, centralized validators) and a generic typed paged/sortable/filterable DataTableComponent, extracted into proper workspace libraries with clean public APIs instead of duplicated per…
angular-coding-standards
General Angular coding-standards enforcement — naming conventions, standalone-first architecture (v17+), service extraction for business logic, strict TypeScript compiler options, barrel-file risk, and signal-based input()/output() adoption (v17.1+). Version-gated checks read .claude/pilot/stack-profile.json…
nodejs-devtools
TypeScript, ESLint, Prettier. Use when the project needs this capability or the user / team manifest asks for it. Use for specialized nodejs-devtools work when listed in TEAM.yaml or explicitly requested.