typescript-project

typescript-project is a skill for Claude Code, Codex from majiayu000/spellbook. It costs 42 tokens per session (3,139 once invoked), scanned A, original, MIT.

A guide to structuring modern TypeScript projects, including configuration, module layout, layers, validation, and testing choices. TypeScript is JavaScript with checks that catch many mistakes before the program runs.

In plain words
What is it for?
Use it when creating or reorganising a TypeScript project, choosing its architecture, setting up strict checks, or deciding how services and adapters should be separated.
Why use it?
It gives new projects a consistent structure and discourages unused code, unsafe types, and unnecessary compatibility layers.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: positional $N argument.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is import { UserService } from '../src/services/user.service';.

Good fit Use it when creating or reorganising a TypeScript project, choosing its architecture…

Compare 6 skills from other repositories ↓
Install

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.

Clone the repo
git clone --depth 1 https://github.com/majiayu000/spellbook
agentmods
npx agentmods add skills/majiayu000/spellbook/typescript-project

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-project

README.md
[![agentmods](https://agentmods.dev/badge/skills/majiayu000/spellbook/typescript-project.svg)](https://agentmods.dev/skills/majiayu000/spellbook/typescript-project)
Your own site
<a href="https://agentmods.dev/skills/majiayu000/spellbook/typescript-project"><img src="https://agentmods.dev/badge/skills/majiayu000/spellbook/typescript-project.svg" alt="Measured on agentmods" height="20"></a>
Per session 42 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,139 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.00042 $0.03139
Opus 5 $0.00021 $0.01570
Sonnet 5 $0.00008 $0.00628
Haiku 4.5 $0.00004 $0.00314

Measured 3d ago against content hash 1963b20a2c5f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

typescript-project 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 3d ago.

The scan reads SKILL.md. This mod also ships 10 executable files (templates/project/src/adapters/in-memory.repository.ts, templates/project/src/adapters/llm.adapter.ts, templates/project/src/index.ts, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

skills/typescript-project/SKILL.md · 490 lines

How it starts

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

TypeScript Project Architecture

Core Principles

  • Type safety first — Strict mode, no any, Zod for runtime validation
  • ESM native — ES Modules by default, Node 22+ / Bun
  • Layered architecture — Separate lib/services/adapters
  • 200-line limit — No file exceeds 200 lines (see elegant-architecture skill)
  • Test reality — Vitest/Bun test, minimal mocks
  • No backwards compatibility — Delete, don't deprecate. Change directly, no shims
  • LiteLLM for LLM APIs — Use LiteLLM proxy for all LLM integrations, unless specific SDK required

No Backwards Compatibility

Delete unused code. Change directly. No compatibility layers.

Why

  • Dead code is tech debt
  • Compatibility shims add complexity
  • Old patterns spread through copy-paste
  • "Temporary" workarounds become permanent

Anti-Patterns to Avoid

// ❌ BAD: Renaming but keeping old export
export { newName };
export { newName as oldName }; // "for backwards compatibility"

// ❌ BAD: Unused parameter with underscore
function process(_legacyParam: string, data: Data) { ... }

// ❌ BAD: Deprecated comments instead of deletion
/** @deprecated Use newMethod instead */
export function oldMethod() { ... }

// ❌ BAD: Re-exporting removed functionality
export { removed } from './legacy'; // Keep for existing consumers

// ❌ BAD: Feature flags for old behavior
if (config.useLegacyMode) { ... }

Correct Approach

// ✅ GOOD: Just delete and update all usages
// Old: export { fetchData as getData }
// New: export { fetchData }
// Then: Find & replace all getData → fetchData

// ✅ GOOD: Remove unused parameters entirely
function process(data: Data) { ... }

// ✅ GOOD: Delete deprecated code, update callers
// Don't mark as deprecated, just remove it

// ✅ GOOD: Breaking changes are fine in active development
// Semantic versioning handles this for libraries

When Changing Interfaces

// ❌ BAD: Adding optional fields "for compatibility"
interface User {
  id: string;
  name: string;
  firstName?: string; // New field, name kept for compatibility
  lastName?: string;
}

// ✅ GOOD: Clean break, update all usages
interface User {
  id: string;
  firstName: string;
  lastName: string;
}
// Then update ALL code that uses User.name

Read the full file on GitHub · 490 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. 3d ago First seen · 490 lines · 42 tokens per session scan A 1963b20a2c5f

Subscribe to this mod's changes

typescript-project is a skill published in the GitHub repository majiayu000/spellbook (272 stars, last pushed 2d ago), licensed MIT. It adds 42 tokens to every session and 3,139 once invoked, about $0.0002 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-09-03.

Related

Other skills, from other repositories

Cursor rules for Next

Cursor rules for Next.js App Router with TanStack Query v5, covering the HydrationBoundary pattern, Server Actions as mutations, and optimistic updates.

AmariahAK/atlarix-skills · 4 tokens

Cursor rules for Jest development with unit testing

Skill "Cursor rules for Jest development with unit testing" from AmariahAK/atlarix-skills, covering cursor rules for jest development with unit testing, when to use this skill, source, persona and auto-detect typescript usage.

AmariahAK/atlarix-skills · 8 tokens

Next

Next.js App Router combined with TanStack Query v5 — HydrationBoundary pattern, Server Actions as mutations, optimistic updates, and infinite scroll.

AmariahAK/atlarix-skills · 1 tokens

TypeScript Patterns

Use this skill when working in a strict TypeScript codebase and you want reliable patterns for modeling data, narrowing, generics, and configuration—without papering over errors with as casts.

AmariahAK/atlarix-skills · 3 tokens

Cursor rules for JavaScript development with Astro and Tailwind CSS integration

Skill "Cursor rules for JavaScript development with Astro and Tailwind CSS integration" from AmariahAK/atlarix-skills, covering when to use this skill and source.

AmariahAK/atlarix-skills · 13 tokens

Cursor rules for VSCode extension development with Electron and TypeScript integ

Skill "Cursor rules for VSCode extension development with Electron and TypeScript integ" from AmariahAK/atlarix-skills, covering when to use this skill and source.

AmariahAK/atlarix-skills · 13 tokens