agentleFS
tuanductrantuanductran/hr-skills/.agents/skills/typescript/SKILL.md

typescript

Skill58 starsChanged 2 months agoMITView on GitHub

Repository guidance for writing, reviewing, and maintaining TypeScript code within the hr-skills monorepo. Covers project conventions, compiler settings, module structure, and development workflows.

69 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use rust, msw and 10 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 10 projects that use this

  • thongdn-itSkill

    msw

    MSW (Mock Service Worker) best practices for API mocking in tests (formerly test-msw). This skill should be used when setting up MSW, writing request handlers, or mocking HTTP APIs. This skill does NOT cover general testing patterns (use test-vitest or test-tdd skills) or test methodology.

    Also in 3 projects that use this

  • SupabaseSkill

    react-hook-form

    Correct React Hook Form usage anywhere in the monorepo — data flow, subscriptions,

    Also in 3 projects that use this

  • thongdn-itSkill

    tailwind

    Tailwind CSS v4 performance optimization and best practices guidelines (formerly tailwindcss-v4-style). This skill should be used when writing, reviewing, or refactoring Tailwind CSS v4 code to ensure optimal build performance, minimal CSS output, and correct usage of v4 features. Triggers on tasks involving Tailwind configuration, @theme directive, utility classes, responsive design, dark mode, container queries, or CSS generation optimization.

    Also in 6 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 11 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

  • +1 more from thongdn-it

The file

Show its rules and text

We split this skill into the rules it gives an agent

29 rules. 0 are common, 27 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 54 edited versions we read keep these.

  • 27

    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:

    Prefer strict type safety.

    line 31
  2. Distinctive:

    Prefer explicit public APIs.

    line 32
  3. Distinctive:

    Keep modules focused on a single responsibility.

    line 33
  4. Distinctive:

    Use ECMAScript modules exclusively.

    line 34
  5. Distinctive:

    Prefer native language features over unnecessary abstractions.

    line 35
  6. Distinctive:

    Avoid runtime dependencies when the type system is sufficient.

    line 36
  7. Distinctive:

    Prefer small, focused modules.

    line 71
  8. Distinctive:

    Keep helper functions private unless reused.

    line 75
  9. Distinctive:

    Prefer expressive types over assertions.

    line 81
  10. Distinctive:

    Keep imports grouped and organized.

    line 102
  11. Distinctive:

    Import only what is required.

    line 103
  12. Distinctive:

    Use relative imports within a package.

    line 104
  13. Very specific:

    Use workspace:* dependencies for internal packages.

    line 105
  14. Distinctive:

    Run TypeScript type checking.

    line 109
  15. Distinctive:

    Run all repository tests.

    line 115
  16. Distinctive:

    Prefer tool defaults over explicit configuration.

    line 147
  17. Distinctive:

    Add package-specific configuration only when the defaults are insufficient.

    line 149
  18. Distinctive:

    Keep build and compiler configuration easy to understand and maintain.

    line 150
  19. Distinctive:

    Run repository type checking.

    line 168
  20. Distinctive:

    Prefer inference when it improves readability.

    line 185
  21. Distinctive:

    Add explicit types to exported APIs.

    line 186
  22. Distinctive:

    Keep implementations simpler than their type definitions.

    line 187
  23. Very specific:

    Use unknown instead of any whenever possible.

    line 188
  24. Distinctive:

    Keep package-specific TypeScript configuration minimal and rely on shared defaults whenever possible.

    line 190
  25. Distinctive:

    Keep public APIs stable.

    line 203
  26. Distinctive:

    Prefer composition over inheritance.

    line 204
  27. Distinctive:

    Write reusable utility types only when they improve clarity.

    line 205
  28. Distinctive:

    Use strict compiler settings consistently.

    line 206
  29. Distinctive:

    Keep TypeScript code easy to understand before optimizing for brevity.

    line 208

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

This skill describes how TypeScript is used throughout the hr-skills monorepo. It covers repository conventions, compiler configuration, module organization, type safety, and development workflows.

The repository uses modern TypeScript with strict compiler settings, ECMAScript modules, and Bun as the runtime.

Supported tasks

  • Explain TypeScript conventions used by this repository
  • Review TypeScript code for correctness and maintainability
  • Improve type safety without changing runtime behavior
  • Recommend repository-consistent TypeScript patterns
  • Organize modules and exports
  • Review public APIs
  • Validate compiler configuration
  • Explain workspace TypeScript structure
  • Troubleshoot common TypeScript errors

Repository conventions

This repository follows several core principles.

  • Prefer strict type safety.
  • Prefer explicit public APIs.
  • Keep modules focused on a single responsibility.
  • Use ECMAScript modules exclusively.
  • Prefer native language features over unnecessary abstractions.
  • Avoid runtime dependencies when the type system is sufficient.

Compiler configuration

The repository enables modern TypeScript features including:

  • strict
  • moduleResolution: bundler
  • module: Preserve
  • target: ESNext
  • noEmit
  • isolatedModules
  • verbatimModuleSyntax
  • exactOptionalPropertyTypes
  • noUncheckedIndexedAccess
  • noImplicitReturns
  • noImplicitOverride
  • useUnknownInCatchVariables

These settings prioritize correctness, maintainability, and predictable builds.

Project structure

Workspace packages typically organize source code as:

src/
test/
tsconfig.json

Packages extend the shared repository TypeScript configuration while keeping package-specific configuration minimal.

Code organization

Prefer small, focused modules.

  • One responsibility per file.
  • Export only public APIs.
  • Keep helper functions private unless reused.
  • Avoid circular dependencies.
  • Group related types with their implementation.

Type design

Prefer expressive types over assertions.

Recommended patterns include:

  • discriminated unions
  • generic functions
  • utility types
  • readonly objects
  • literal types
  • as const where appropriate

Avoid:

  • unnecessary any
  • excessive type assertions
  • duplicated type definitions
  • overly complex conditional types

Imports and exports

  • Prefer named exports.
  • Keep imports grouped and organized.
  • Import only what is required.
  • Use relative imports within a package.
  • Use workspace:* dependencies for internal packages.

Common commands

Run TypeScript type checking.

bun run typecheck

Run all repository tests.

bun run test

Build every workspace package.

bun run build

Key prompts

Type safety

  • "Review this TypeScript code for type safety."
  • "Explain this compiler error."
  • "Reduce unnecessary type assertions."
  • "Improve the inferred types."

Repository conventions

  • "Rewrite this file following repository conventions."
  • "Review the module organization."
  • "Recommend a cleaner public API."
  • "Validate this package structure."

Configuration philosophy

Repository configuration should remain as simple as possible.

  • Prefer tool defaults over explicit configuration.
  • Extend shared repository configuration instead of duplicating settings.
  • Add package-specific configuration only when the defaults are insufficient.
  • Keep build and compiler configuration easy to understand and maintain.

Refactoring

  • "Simplify this TypeScript implementation."
  • "Extract reusable utilities."
  • "Remove duplicated types."
  • "Improve module boundaries."

Development

  • "Explain this tsconfig option."
  • "Generate a repository-compatible tsconfig."
  • "Recommend TypeScript best practices for this package."
  • "Review this pull request for TypeScript issues."

Examples

Run repository type checking.

bun run typecheck

Package tsconfig.json files extend the shared repository configuration and include only the package sources.

{
  "extends": "../../tsconfig.json",
  "include": ["src", "test"]
}

Tips

  • Prefer inference when it improves readability.
  • Add explicit types to exported APIs.
  • Keep implementations simpler than their type definitions.
  • Use unknown instead of any whenever possible.
  • Validate changes with bun run typecheck.
  • Keep package-specific TypeScript configuration minimal and rely on shared defaults whenever possible.

Common issues

  • Exporting implementation details unnecessarily.
  • Using any where stronger types are possible.
  • Duplicating types across packages.
  • Mixing runtime logic with type definitions.
  • Ignoring compiler diagnostics.
  • Creating modules with multiple unrelated responsibilities.

Best practices

  • Keep public APIs stable.
  • Prefer composition over inheritance.
  • Write reusable utility types only when they improve clarity.
  • Use strict compiler settings consistently.
  • Review exported types as carefully as runtime code.
  • Keep TypeScript code easy to understand before optimizing for brevity.

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.