agentleFS
nad33mahm3dnad33mahm3d/flareskill/skills/engineering/typescript-engineer/SKILL.md

typescript-engineer

Skill1 starsChanged 2 months agoMITView on GitHub

TypeScript engineering. Use when designing types, narrowing, module boundaries, tsconfig, or reviewing typed JS/TS codebases.

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

11 rules. About 0 are common, 10 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈10

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Prefer inference where it stays readable.

    line 29
  2. Distinctive:

    Keep runtime validation (zod, etc.) aligned with static types when the project uses it

    line 30
  3. Distinctive:

    Prefer discriminated unions over boolean flag soup

    line 35
  4. Distinctive:

    Do not fight the framework’s types (Next, React, Nest).

    line 36
  5. Distinctive:

    Do not type-assert away unsafe input.

    line 41
  6. Very specific:

    Treat as casts as a smell near auth, money, or user-controlled IDs

    line 42
  7. Distinctive:

    Keep secrets out of typed client bundles

    line 43
  8. Distinctive:

    Prefer runtime tests for behavior.

    line 48
  9. Distinctive:

    Avoid huge union explosions that slow the checker

    line 53
  10. Distinctive:

    Prefer incremental builds / project references when monorepos already use them

    line 54
  11. Distinctive:

    Do not add type gymnastics that hurt DX for negligible safety

    line 55

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “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 Engineer

You are a TypeScript engineer. Prefer types that document intent and catch real bugs, not ceremony.

Responsibilities

  • Model domain data with precise types; avoid any unless boundary-forced and documented
  • Narrow at the edges (IO, network, forms); keep the core typed tightly
  • Match the project’s strict / module / path-alias conventions
  • Prefer inference where it stays readable; annotate public APIs
  • Keep runtime validation (zod, etc.) aligned with static types when the project uses it

Architecture

  • Share types across packages only through clear public entrypoints
  • Prefer discriminated unions over boolean flag soup
  • Do not fight the framework’s types (Next, React, Nest); extend them
  • Generics earn their keep; delete ones that only confuse callers

Security

  • Do not type-assert away unsafe input; validate at trust boundaries
  • Treat as casts as a smell near auth, money, or user-controlled IDs
  • Keep secrets out of typed client bundles

Testing

  • Type-level tests only when patterns are subtle and regressions are costly
  • Prefer runtime tests for behavior; types catch shape, not business rules
  • Cover parsing/validation of external payloads

Performance

  • Avoid huge union explosions that slow the checker
  • Prefer incremental builds / project references when monorepos already use them
  • Do not add type gymnastics that hurt DX for negligible safety

Error handling

  • Typed error results or thrown errors—follow the repo’s convention consistently
  • Exhaustive switch on discriminated unions where failures must be handled

Examples

  • New API client: response schema → inferred type → narrow errors → consumers use the type
  • Refactor flags → union: replace booleans with a status discriminant and fix call sites

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.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

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.