agentleFS
kriscardkriscard/Skills/skills/dev/typescript/SKILL.md

typescript

Skill15 starsChanged 15 days agoMITView on GitHub

Language-wide TypeScript guidance for full-stack frameworks, backend services, libraries, scripts, and frontend code. Use when modeling domain states, narrowing values, designing useful generics, validating runtime boundaries, reviewing assertions or suppressions, matching compiler contracts, or improving TypeScript-specific code quality, TypeScript AST tooling, or selecting the collected TypeScript practices. Component/native wrapper props and browser-specific storage, URL, postMessage, and form behavior are outside its language-wide scope.

66 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use rust, drizzle and 5 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • MicrosoftSkill

    rust

    Use this guide when working on Rust changes in the FAST monorepo.

    Also in 9 projects that use this

  • leonaaardobSkill

    drizzle

    Complete Drizzle ORM documentation in markdown format. Use when working with Drizzle ORM - covers schema definition, queries, migrations, database connections (PostgreSQL, MySQL, SQLite), integrations (Neon, Supabase, PlanetScale, Cloudflare D1, Turso), column types, relations, transactions, and framework usage (Next.js, SvelteKit, Astro).

    Also in 3 projects that use this

  • mfang0126Skill

    development

    Full-stack development workflow skill. Guides the complete cycle from understanding requirements to shipping code via PR with Preview validation.

    Also in 3 projects that use this

  • rogue-dev-studioSkill

    python

    Python 3.13 with uv package manager via mise. Use when the project needs this capability or the user / team manifest asks for it. Use for specialized `python` work when listed in TEAM.yaml or explicitly requested.

    Also in 8 projects that use this

  • sarukasSkill

    markdown

    Convert any document format TO Markdown. Supports 14 formats (PDF, DOCX, XLSX, PPTX, HTML, CSV, EPUB, MSG, and more) via unified CLI. Use when Claude needs to read or extract text from non-Markdown files.

    Also in 4 projects that use this

  • testdino-hqSkill

    java

    Google's official Java style guide. Covers 2-space indentation, 100-char line limit, naming conventions, braces, imports, Javadoc, exception handling, lambdas, and streams. Enforces @Override annotations and specific imports.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

10 rules. 0 are common, 8 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 52 edited versions we read keep these.

  • 8

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use TypeScript to preserve evidence: model the states the program can really reach, retain relationships through inference and generics, …

    line 16
  2. Very specific:

    Read nearby code for public type, interface, and enum conventions before recommending a different form.

    line 30
  3. Distinctive:

    Treat installed declarations and runtime support as the compatibility boundary.

    line 33
  4. Distinctive:

    Complete when: every changed type describes a real program state and every untrusted value has a named trust boundary.

    line 44
  5. Distinctive:

    Prefer the simplest total model: strengthen a type when doing so removes a demonstrated partial operation, assertion, or impossible …

    line 49
  6. Very specific:

    Keep untrusted values unknown until control-flow narrowing, a complete guard, the project's existing schema convention, or a documented …

    line 56
  7. Distinctive:

    Treat assertions and suppressions as local claims about evidence, not conversions.

    line 63
  8. Distinctive:

    Run the repository's focused formatter, typecheck, tests, and build checks that exercise the changed contract.

    line 70
  9. Distinctive:

    Use the Current skill guidance sections as the existing default.

    line 77
  10. Distinctive:

    Read every reference whose trigger matches the task, not the entire collection.

    line 92

“Common” is measured: kept by at least 6 in 10 of the 52 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

TypeScript Engineering

Use TypeScript to preserve evidence: model the states the program can really reach, retain relationships through inference and generics, and establish runtime facts before trusted use. Match the requested work; a small typed edit does not require a language-wide audit.

Workflow

1. Read the environment

Scope discovery to the changed contract. Inspect the relevant manifest, lockfile, TypeScript version, runtime versions, tsconfig chain, framework-generated configuration, declarations, generated clients, schema libraries, and established typecheck/test/format scripts. Inspect runtime support for runtime features, schema APIs for decoding work, and generated contracts when they own the changed shape; skip unrelated or absent artifacts. Read nearby code for public type, interface, and enum conventions before recommending a different form.

Treat installed declarations and runtime support as the compatibility boundary. Do not enable flags, add dependencies, or start migrations automatically.

Complete when: version-sensitive advice and available checks match the actual project.

2. Frame the type contract

Name the public inputs and outputs, valid states, invariants, untrusted entry points, failure paths, and interoperability constraints. Distinguish static knowledge from facts that require runtime evidence.

Complete when: every changed type describes a real program state and every untrusted value has a named trust boundary.

3. Preserve useful evidence

Prefer the simplest total model: strengthen a type when doing so removes a demonstrated partial operation, assertion, or impossible state—not by reflex. Preserve literal and relational information through inference, discriminants, and useful generics. Derive from schemas, generated contracts, and existing APIs before duplicating shapes.

4. Establish runtime facts

Keep untrusted values unknown until control-flow narrowing, a complete guard, the project's existing schema convention, or a documented validating SDK establishes the needed fact. Parse once at the boundary; trusted internal values normally continue as the validated type without repeated decoding.

5. Make local evidence claims

Treat assertions and suppressions as local claims about evidence, not conversions. First diagnose missing discriminants, widened inference, incomplete declarations, or an untested boundary. Use an assertion only when the invariant is real and TypeScript cannot express it directly; keep the explanation scoped to non-obvious cases.

6. Verify the contract

Run the repository's focused formatter, typecheck, tests, and build checks that exercise the changed contract. Do not broaden types or weaken validation merely to make checks green. State what was verified and what remains runtime-dependent.

Collected practices are not automatic policy

The references document 47 collected practices; documenting a practice does not activate it. Use the Current skill guidance sections as the existing default. Collected sections preserve policy alternatives, examples, exceptions, and conflicts for selection. The Decision column in references/practice-catalog.md is the single authority for persistent adoption status. Before applying a collected practice as policy, read its catalog entry and full section; pending or excluded entries do not introduce new review findings. A task-specific request can select a practice for that task without changing persistent status. Durable changes update the catalog decision and, only when needed, the affected conditions or conflicting guidance—not a second copy of the adoption status.

Automation notes in collected sections describe optional enforcement designs, not installed checker capabilities. Verify the target project's actual tooling before configuring options; collecting or selecting a practice does not authorize a tooling installation.

References

Read every reference whose trigger matches the task, not the entire collection. Each collected practice has one canonical section; the catalog is an index, not a substitute.

PriorityLoad whenReference
1 — CriticalDomain states, discriminated unions, exhaustiveness, constructive models, brands, schema/generated type derivation, inference, or genericsreferences/type-modeling.md
1 — CriticalExternal payloads, parsers, guards, schemas, validation failures, wire formats, persisted JSON, SDK results, files, IPC, environment data, database rows, or broad boundary contractsreferences/runtime-boundaries.md
1 — HighAssertions, chained casts, safety comments, narrowing, typeof, satisfies, reflection, suppressions, declaration gaps, interop, or compiler flagsreferences/assertions-and-interop.md
2 — ConditionalCollection pipelines, reducers, iterator helpers, object construction, argument design, symbol naming, spacing, or syntactic code-quality findingsreferences/code-quality.md
2 — ConditionalTypeScript module mocks, dependency-injection test seams, real dependency tests, disposal/leak checks, running-UI evidence, structured logging, or console diagnosticsreferences/testing-and-diagnostics.md
2 — ConditionalImplementing lint rules, TypeScript AST tooling, codemods, alias/type analysis, scope resolution, or program-analysis cachesreferences/static-analysis.md
1 — Policy checkBefore applying a collected practice as policy; selecting practices, changing adoption status, comparing policy alternatives, or auditing coverage of all 47 practicesreferences/practice-catalog.md

Ownership Boundary

  • typescript owns language-wide modeling, narrowing, generics, runtime type evidence, assertions, compiler contracts, and TypeScript-specific code quality.
  • Browser component props, native wrapper contracts, DOM events, browser storage, URL state, postMessage, and form feedback remain frontend concerns.
  • Framework behavior, testing architecture, formatting policy, and performance findings remain with their established owners unless the TypeScript contract itself is the issue. The testing/diagnostics reference preserves collected practices in full for selection; it does not override those owners or authorize app runs, telemetry changes, or new tools.

Completion Gate

Before finishing:

  • guidance matches the installed TypeScript, runtime, libraries, and repository conventions;
  • public models exclude known-invalid states without needless strengthening;
  • untrusted structured input gains runtime evidence before trusted use;
  • generics preserve a caller-visible relationship rather than hiding unknown;
  • assertions and suppressions are local, justified, and do not launder evidence;
  • checks use established scripts, and unverified runtime behavior is explicit;
  • collected policy decisions follow the catalog or explicit task selection, and conflicting policy alternatives are reported rather than silently combined.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

Reviews can't be read right now.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.