cli-continues typescript.instructions.md

Review rules for TypeScript code, a programming language that adds type checks to JavaScript. They cover safe data handling, object definitions, branching by data type, asynchronous file work, and streaming large JSONL files.

In plain words
What is it for?
Use them when reviewing or writing TypeScript parsers, file operations, JSON or JSONL processing, async code, and code with several related data shapes.
Why use it?
They reduce runtime errors, unsafe assumptions about external data, blocked application code, and excessive memory use.

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/yigitkonur/cli-continues/typescript
Clone the repo
git clone --depth 1 https://github.com/yigitkonur/cli-continues

Made for: GitHub Copilot.

Per session 438 This file is loaded in full into every session.
When invoked 438 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.00438 $0.00438
Opus 5 $0.00219 $0.00219
Sonnet 5 $0.00088 $0.00088
Haiku 4.5 $0.00044 $0.00044

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

Security

Grade A, and why

cli-continues 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.

.github/instructions/typescript.instructions.md · 47 lines

What it actually says

TypeScript Review Guidelines

Type Safety

  • Avoid any — use unknown for external data (JSON.parse results, JSONL lines), then narrow with type guards
  • Define interfaces for all object shapes that cross module boundaries — not inline object literals
  • Use as const for literal arrays like TOOL_NAMES to get narrower inferred types
// Avoid
const parsed = JSON.parse(line) as any;
return parsed.type;

// Prefer
const parsed = JSON.parse(line) as unknown;
if (typeof parsed !== 'object' || parsed === null || !('type' in parsed)) return;
// Narrowed — safe to access (parsed as Record<string, unknown>)

Discriminated Unions

  • Use switch (d.category) for narrowing StructuredToolSample — not instanceof checks
  • New tool sample types must be added to the StructuredToolSample union in src/types/index.ts
  • The category field is the discriminant — never use string-equality checks outside of switch

Async Patterns

  • All file I/O must be async: use fs.promises.* not fs.readFileSync / fs.writeFileSync
  • JSONL files must be streamed with readline.createInterface — never loaded into memory wholesale
  • Avoid blocking the event loop in parsers — they run in parallel via Promise.allSettled

Import Rules

  • Local imports must end in .js: import { foo } from './bar.js' — required for Node.js ESM module resolution
  • Never import from dist/ in source files
  • Prefer named exports over default exports for better refactoring support

Defensive Patterns

  • Use optional chaining (?.) and nullish coalescing (??) for optional fields from parsed session data
  • Sessions returned from parsers must be sorted by updatedAt descending (newest first)
  • Use process.exitCode = N over process.exit(N) to allow SIGTERM/SIGINT handlers to run
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 · 47 lines · 438 tokens per session scan A a95729049367

Subscribe to this mod's changes

cli-continues typescript.instructions.md is an instructions file published in the GitHub repository yigitkonur/cli-continues (1,479 stars, last pushed 3mo ago), licensed MIT. It adds 438 tokens to every session, about $0.0022 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.