shift: Skill for Claude Code

.agents/skills/typescript/SKILL.md

typescript is a skill for Claude Code, Codex from shift-editor/shift. It costs 108 tokens per session (2,676 once invoked), scanned A, original, Apache-2.0.

A set of project-specific rules for writing and reviewing TypeScript, a programming language that adds types to JavaScript. The rules cover domain types, collections, lookups, chained operations, and data received through interfaces such as IPC and MCP.

In plain words
What is it for?
Use them when adding or changing TypeScript code in Shift's packages and desktop app, especially around optional values, collections, lookups, casts, and incoming data.
Why use it?
They reduce repeated fallback code and unclear data assumptions by putting expected behavior into the types and their owners.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

This is shift-editor/shift's own configuration. It tells Claude Code and Codex how to work on shift itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything shift configures →

Reuse

Borrowing it

Nothing to install: this file belongs to shift-editor/shift. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/shift-editor/shift/main/.agents/skills/typescript/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/shift-editor/shift

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for typescript

README.md
[![agentmods](https://agentmods.dev/badge/skills/shift-editor/shift/typescript/github.svg)](https://agentmods.dev/skills/shift-editor/shift/typescript)
Your own site
<a href="https://agentmods.dev/skills/shift-editor/shift/typescript"><img src="https://agentmods.dev/badge/skills/shift-editor/shift/typescript/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.

agentmods 80×15 button for typescript

Your own site · 80×15
<a href="https://agentmods.dev/skills/shift-editor/shift/typescript"><img src="https://agentmods.dev/badge/skills/shift-editor/shift/typescript.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 108 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,676 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00108 $0.02676
Opus 5.5 $0.00043 $0.01070
Sonnet 5.5 $0.00022 $0.00535
Haiku 4.5 $0.00011 $0.00268

Measured today against content hash 2d53d5a1f43a, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

typescript 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 today.

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.

.agents/skills/typescript/SKILL.md · 98 lines

How it starts

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

/typescript — How TypeScript is written in Shift

TypeScript makes { points?: … }, ?. and ?? [] free to write, so a vague type never pays for itself; every caller does. An audit found 350 ?? null / ?? [] fallbacks, about 70 hand-written "take the first item" sequences and 95 calls that filtered the scene again for what they wanted. Each was a caller making up for a type or owner that did not answer its question. The rules below put the answer on the type, once.

The rule

When callers repeat the same fallback, filter or chain, the type they are reading is missing a method or is shaped wrong. Fix the type, then call it by name.

Collections

  • A collection field is never optional. An empty collection means "none". PositionTargets carries points and anchors always, so readers write targets.points, not targets.points ?? [], and ask targets.hasAnchors. Keep an optional collection only where absence differs from empty (an option that falls back to a default, a wire field mirroring Rust's Option<Vec<_>>), and say why in the disable comment. Enforced by shift/no-optional-collection-field.
  • Lookups return T | null, never undefined. Hold id-keyed collections in EntityMap from @shift/types: get returns null, require throws a named EntityNotFoundError when absence is a bug for that caller, and where(predicate) filters in insertion order. Expose indexes as ReadonlyEntityMap. Enforced by shift/no-map-get-to-null; no-mutable-collection-field treats EntityMap fields like Map fields.
  • Ask first: does Rust already compute this, or could another consumer need the same answer? Rust means shift-font and its libraries (fontc, fea-rs, fontdrasil, harfrust, line breaking); the other consumers are the CLI, export, the window's engine, the utility process, the SDK and agents. If yes, it has one implementation, in Rust, and every consumer calls it: expose it from shift-font through the engine and make the TypeScript method a one-line call (Kerning.between → engine.kerningRun; shaping → harfrust through the shaping module; feature compiling → fea-rs; interpolation → fontdrasil). Never write it in TypeScript "for now": two copies drift. If no (a lookup by id or name, a count, stored order, reactivity, UI state), the TypeScript model owns it, beside its siblings: before writing font.sources.find(({ name }) => name === n) outside the owner, look for the query there (Font.entryForName, recordForId, source(id), layerIdFor), and if none exists add it (Font.sourceNamed(name) next to source(id)) and point every caller at it. Unsure → Rust. scan:ts --kind model-rule lists model methods that compute without the engine; --kind repeated-filter lists predicates repeated across files.
  • Prove "at least one" in the type. When a list is never empty, type it readonly [T, ...T[]] and read list[0] without a fallback.
  • Use the built-ins before spreading. Query an iterator directly (map.values().filter(…).toArray(); .some/.every/.find need no array), copy-sort with toSorted, merge sets with union/intersection/difference, group with Map.groupBy. Enforced by shift/prefer-iterator-helpers.
  • A combined collection used in several places is a type. ThemeCatalog builds the shipped-then-user theme list once; KerningGroups.atPosition sorts once per change. Spread to build a value once, not at every read.
  • Pass a maybe-value straight through. Write x: v === undefined ? undefined : f(v); never spread conditionally to leave a key out, and don't add a helper function to build it. Where a stored shape must tell a missing key from an undefined one, keep the spread with a disable comment giving the reason. Enforced by shift/no-conditional-spread.

Read the full file on GitHub · 98 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. today Changed · +6 lines 2d53d5a1f43a
  2. 5d ago First seen · 92 lines · 108 tokens per session scan A 2679afcb801f

Subscribe to this mod's changes

typescript is a skill published in the GitHub repository shift-editor/shift (379 stars, last pushed today), licensed Apache-2.0. It adds 108 tokens to every session and 2,676 once invoked, about $0.0004 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-10-25.

Related

Other skills, from other repositories

ax-rust-signature

Use when writing Rust code with axllm for string signatures, field descriptors, JSON schema output, validation, and typed tool argument shapes.

ax-llm/ax · 36 tokens

dd-code-generation

Use pup CLI for immediate Datadog operations or generate code for integration into applications.

DataDog/pup · 16 tokens

ax-rust-llm

Use when writing Rust code with axllm for using the generated Ax package, factory functions, package docs, examples, and API reference.

ax-llm/ax · 37 tokens

solana-toolkit-guide

Guide to the Solana Wallet Toolkit — vanity address generation with multi-threaded search, official Solana Labs libraries, Rust and TypeScript implementations. Includes wallet generation, custom address prefixes, and OG names on the blockchain.

nirholas/three.ws · 50 tokens

solana

Use when working on Solana software, including one or more of: Solana client code using TypeScript, Rust libraries that use Solana crates, Anchor programs, Quasar programs, LiteSVM tests, including Rust program files, TypeScript tests, and Anchor.toml or Quasar.toml configuration. Designed to create minimal, reusable…

quicknode/solana-finance-claude-plugin · 76 tokens

docstring-generator

Generate and update language-idiomatic doc comments for TypeScript (TSDoc/JSDoc) and Rust (Rustdoc). Use when asked to "add docs", "document this file", "generate docstrings", "add JSDoc", "add Rustdoc", "write TSDoc", or when working with TypeScript or Rust source files that need documentation comments. Supports…

espennilsen/pi · 118 tokens