agentleFS
jscraikjscraik/Agent-Skills/Skills/agent-ops/typescript/SKILL.md

typescript

Skill9 starsChanged 2 months agoApache-2.0View on GitHub

Use when authoring or reviewing TypeScript code that requires strict type safety, explicit module contracts, and predictable runtime boundaries.

33 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use python, react and 2 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.
  • 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 9 projects that use this

  • VercelSkill

    react

    React renderer for json-render that turns JSON specs into React components. Use when working with @json-render/react, building React UIs from JSON, creating component catalogs, or rendering AI-generated specs.

    Also in 6 projects that use this

  • 0xSeroSkill

    security

    Also in 4 projects that use this

  • BlockSkill

    debugging

    Debugging guidelines and best practices

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 27 edited versions we read keep these.

  • 11

    Distinctive

    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:

    Use for TypeScript code authoring or review.

    line 21
  2. Distinctive:

    Use when strict typing and API contracts need hardening.

    line 22
  3. Very specific:

    Avoid any; model unknown values with guards and narrow types.

    line 38
  4. Distinctive:

    Prefer explicit return types on exported functions.

    line 39
  5. Distinctive:

    Use discriminated unions for stateful workflows.

    line 40
  6. Distinctive:

    Prefer named exports over default exports in shared modules.

    line 46
  7. Distinctive:

    Keep runtime validation close to IO boundaries.

    line 47
  8. Distinctive:

    Avoid barrel files when they obscure ownership.

    line 48
  9. Distinctive:

    If domain types are unclear, pause and request schema clarification.

    line 62
  10. Distinctive:

    Keep guidance deterministic so repeated runs produce consistent decisions.

    line 81
  11. Distinctive:

    Run the relevant local checks for touched files and workflow contracts.

    line 91
  12. Distinctive:

    Read when: the task needs advanced edge cases, migration-safe patterns, or runtime-specific nuance beyond the core checklist.

    line 104

“Common” is measured: kept by at least 6 in 10 of the 27 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

Table of Contents

  • When to use
  • Required inputs
  • Deliverables
  • Type Safety
  • Module Boundaries
  • Examples
  • Failure mode
  • Gotchas

When to use

  • Use for TypeScript code authoring or review.
  • Use when strict typing and API contracts need hardening.

Required inputs

  • Target files or module scope.
  • Runtime constraints (Node/browser/edge).
  • Existing type errors or contract requirements.

Deliverables

  • Type-safe implementation changes.
  • Explicitly typed exported surfaces.
  • Notes for any unavoidable tradeoffs.

Type Safety

  • Avoid any; model unknown values with guards and narrow types.
  • Prefer explicit return types on exported functions.
  • Use discriminated unions for stateful workflows.
  • Redact secrets, tokens, credentials, and sensitive data by default.

Module Boundaries

  • Prefer named exports over default exports in shared modules.
  • Keep runtime validation close to IO boundaries.
  • Avoid barrel files when they obscure ownership.

Examples

export function parsePort(value: string): number {
  const parsed = Number.parseInt(value, 10)
  if (Number.isNaN(parsed)) throw new Error(`Invalid port: ${value}`)
  return parsed
}

Failure mode

  • If domain types are unclear, pause and request schema clarification.

Gotchas

  • Casting with as unknown as hides real typing defects.

See Also

SkillWhen to use
[[javascript-pro]]Base JavaScript patterns when runtime compatibility and async flow need attention
[[biome-linting]]Enforce TypeScript lint and format rules with Biome

Topic map: [[agent-ops]]

Philosophy

  • Optimize for clear, verifiable outcomes with the minimum necessary changes.
  • Keep guidance deterministic so repeated runs produce consistent decisions.

Procedure

  1. Confirm scope, constraints, and required inputs before edits.
  2. Apply focused changes tied directly to the requested outcome.
  3. Re-run the highest-signal validations and capture concrete evidence.

Validation

  • Run the relevant local checks for touched files and workflow contracts.
  • Fail fast: stop at the first blocking validation failure and report exact evidence.
  • Re-run checks after fixes and record residual risk if any remains.

Anti-patterns

  • Skipping validation after making changes.
  • Applying broad refactors to solve narrow issues.
  • Assuming behavior without evidence from current checks.

References and assets

  • Open deep guidance: Infrastructure/references/deep-guidance.md
  • Read when: the task needs advanced edge cases, migration-safe patterns, or runtime-specific nuance beyond the core checklist.

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.