lamina typescript.instructions.md

Guidelines for writing modern TypeScript, a programming language that adds type checking to JavaScript, using features supported by versions 5.0 through 5.8.

In plain words
What is it for?
Use them when designing or reviewing TypeScript code involving decorators, type narrowing, ESM and Node integration, bundlers, or newer JavaScript APIs.
Why use it?
They help developers choose current language, module, decorator, and standard-library patterns instead of older or less precise approaches.

Instructions file for GitHub Copilot

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 instructions/aryaniyaps/lamina/typescript
Clone the repo
git clone --depth 1 https://github.com/aryaniyaps/lamina

Made for: GitHub Copilot.

Per session 1,868 This file is loaded in full into every session.
When invoked 1,868 The same file — it is already loaded in full.
Security scan A 0 findings. 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 $0.01868 $0.01868
Opus 5 $0.00934 $0.00934
Sonnet 5 $0.00374 $0.00374
Haiku 4.5 $0.00187 $0.00187

Measured 2d ago against content hash e923c5c23458, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

lamina typescript.instructions.md 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 2d 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.

evals/fixtures/_base/plane/.github/instructions/typescript.instructions.md · 130 lines

How it starts

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

TypeScript Coding Guidelines & Modern Features (v5.0 - v5.8)

When writing TypeScript code, prioritize using modern features and best practices introduced in recent versions (up to 5.8).

Global Themes Across 5.x

  1. Standard decorators are here; legacy decorators are legacy. New TC39-compliant decorators landed in 5.0 and were extended in 5.2 (metadata). Old experimentalDecorators-style behavior is still supported but should be treated as legacy.

  2. Type system is more precise and less noisy. Major work went into narrowing, control flow analysis, error messages, and new helpers like NoInfer, inferred predicates, and better undefined/never/uninitialized checks.

  3. Module / runtime interop has been modernized. Options like --moduleResolution bundler, --module nodenext/node18, --rewriteRelativeImportExtensions, --erasableSyntaxOnly, and --verbatimModuleSyntax are about playing nicely with ESM, Node 18+/22+, direct TypeScript execution, and bundlers.

  4. The standard library keeps tracking modern JS. Support for new ES features (iterator helpers, Object.groupBy/Map.groupBy, new Set/ES2024 APIs) shows up as type declarations and sometimes extra checks (regex syntax checking, etc.).

When generating or refactoring code, prefer these newer idioms, and avoid patterns that conflict with updated checks.

Modern Features to Utilize

Type System & Inference

  • const Type Parameters (5.0): Use const type parameters for more precise literal inference.
    declare function names<const T extends string[]>(...names: T): void;
    
  • @satisfies Operator (5.0): Use satisfies to validate types without widening them.
  • Inferred Type Predicates (5.5): Allow TypeScript to infer type predicates for functions that filter arrays or check types, reducing the need for explicit is return types.
  • NoInfer Utility (5.4): Use NoInfer<T> to block inference for specific type arguments when you want them to be determined by other arguments.
  • Narrowing:
    • Switch(true) (5.3): Utilize narrowing in switch(true) blocks.
    • Boolean Comparisons (5.3): Rely on narrowing from direct boolean comparisons.
    • Closures (5.4): Trust preserved narrowing in closures when variables aren't modified after the check.
    • Constant Indexed Access (5.5): Use constant indices to narrow object/array properties.

Read the full file on GitHub · 130 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. 2d ago First seen · 130 lines · 1,868 tokens per session scan A e923c5c23458

Subscribe to this mod's changes

lamina typescript.instructions.md is an instructions file published in the GitHub repository aryaniyaps/lamina (114 stars, last pushed 16d ago), licensed Apache-2.0. It adds 1,868 tokens to every session, about $0.0093 per session on Opus 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.