Skip to content
Skills Library
Programming · Learning & explanation

write-typescript

/write-typescript

TypeScript coding conventions for this codebase. Use when writing or modifying TypeScript or TSX files, when TypeScript type errors appear, or when asked about strict mode, type imports, naming conventions, return types, the no-any rule, async functions, floating promises, exhaustive switches, readonly properties, non-null assertions, control-flow style, test typing patterns, Node fs Dirent mock typing, formatting with oxfmt, import group order, enforced alphabetical ordering, the three-parameter limit, or JSDoc on public APIs.

Repository
codebase ↗
Licence
MIT
Last repository change
26.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
7
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 26.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

TypeScript coding conventions for this codebase. Use when writing or modifying TypeScript or TSX files, when TypeScript type errors appear, or when asked about strict mode, type imports, naming conventions, return types, the no-any rule, async functions, floating promises, exhaustive switches, readonly properties, non-null assertions, control-flow style, test typing patterns, Node fs Dirent mock typing, formatting with oxfmt, import group order, enforced alphabetical ordering, the three-parameter limit, or JSDoc on public APIs.

Original author description

TypeScript coding conventions for this codebase. Use when writing or modifying TypeScript or TSX files, when TypeScript type errors appear, or when asked about strict mode, type imports, naming conventions, return types, the no-any rule, async functions, floating promises, exhaustive switches, readonly properties, non-null assertions, control-flow style, test typing patterns, Node fs Dirent mock typing, formatting with oxfmt, import group order, enforced alphabetical ordering, the three-parameter limit, or JSDoc on public APIs.

How it works

  1. When to Use This Skill
  2. References
  3. Related Skills
  4. Verification
  5. Notes
Original SKILL.md headings · 53 lines, 309 words
SKILL.md preview
---
name: write-typescript
description: TypeScript coding conventions for this codebase. Use when writing or modifying TypeScript or TSX files, when TypeScript type errors appear, or when asked about strict mode, type imports, naming conventions, return types, the no-any rule, async functions, floating promises, exhaustive switches, readonly properties, non-null assertions, control-flow style, test typing patterns, Node fs Dirent mock typing, formatting with oxfmt, import group order, enforced alphabetical ordering, the three-parameter limit, or JSDoc on public APIs.
license: MIT
---

# Write TypeScript

All TypeScript projects in this codebase use strict settings. This skill is the entry point and links to focused reference files so guidance stays organized and maintainable.

## When to Use This Skill

Use this skill when:

- Writing or refactoring `.ts` or `.tsx` files
- Fixing TypeScript compile or lint errors
- Reviewing strict-mode type-safety issues
- Standardizing naming, import style, or control-flow patterns
- Writing strict typed tests (including `fs.readdirSync` Dirent mocks)

## References

- [Strict typing](./references/strict-typing.md)
: strict flags, explicit return types, `any` avoidance, `unknown`, promises, exhaustive switches.
- [Naming and imports](./references/naming-and-imports.md)
: identifier naming, abbreviation rules, file naming, type imports, NodeNext `.js` extensions.
- [Class and control flow](./references/class-and-control-flow.md)
: readonly properties, braces, early returns, object shorthand, template literals.
- [Error handling and tests](./references/errors-and-tests.md)
: catch typing, guard-first test narrowing, Node Dirent mock typing pattern.
- [Formatting and ordering](./references/formatting-and-ordering.md)
: `oxfmt` settings, import groups, enforced alphabetical order, the 3-parameter
limit, JSDoc on public APIs.
- [Size limits](./references/size-limits.md)
: file length, function length, block nesting depth, parameter limits, complexity, comment block sizes.

## Related Skills

- [Handle error](../handle-errors/SKILL.md)
- [Write comment](../write-comments/SKILL.md)
- [Validate code](../validate-code/SKILL.md)

## Verification

After TypeScript changes:

```bash
pnpm exec nx run <project>:lint-code --configuration=write
pnpm exec nx run <project>:lint-code --configuration=check
```

## Notes

- Keep this `SKILL.md` concise and discovery-focused.
- Add detailed examples and larger workflows to files under `references/`.
- > ✅ **Best practice:** In NestJS class files such as `*.service.ts`, `*.command.ts`, `*.resolver.ts`, `*.loader.ts`, and `*.module.ts`, keep only imports and the class at top level. Move helper types and interfaces to `*.types.ts`, constants to `*.constants.ts`, and shared initialization logic into class members or dedicated modules.
- > ⚠️ **Warning:** Do not use top-level alias exports or type re-exports from NestJS class files. Import supporting symbols from their source `*.types.ts` or `*.constants.ts` file instead of re-exporting them through the class file.
Files in this package (7)
  • SKILL.md 3 KB
  • references/class-and-control-flow.md 1 KB
  • references/errors-and-tests.md 2 KB
  • references/formatting-and-ordering.md 3 KB
  • references/naming-and-imports.md 2 KB
  • references/size-limits.md 3 KB
  • references/strict-typing.md 3 KB

Versions

The database has no other skills named write-typescript.

Database snapshot: 13.11.2026 · package version 97912615c986 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100typescript-strict
    Strict TypeScript conventions covering strict mode config, no-any rules, utility types, discriminated unions, branded types, and error handling patterns. Use when writing TypeScript, tightening types, or migrating code to strict mode.
  • 90typescript-conventions
    Use when a ticket adds or changes TypeScript/JavaScript code and it must follow the repo's TS conventions — strict mode typing, typescript-eslint type-aware rules, async correctness (no floating promises, bounded fan-out), boundary validation instead of casts, module/import…
  • 90google-ts-styleguide
    Google TypeScript Style Guide reference for writing, reviewing, and refactoring TypeScript code. Use this skill whenever you are writing TypeScript code, reviewing TypeScript code, refactoring TypeScript, configuring ESLint or linter rules for TypeScript, or when the user asks…
  • 90typescript-style
    TypeScript and JavaScript language conventions - types on public APIs, interface vs type, unions over enum, unknown over any, JSDoc, immutable updates, Zod-inferred types, naming, logging. Use when writing or reviewing .ts, .tsx, .js, .jsx or .mjs code. Structure and size: lean-code.
  • 90typescript-guide
    Use when editing or reviewing TypeScript in Node.js ESM projects. Triggers on `.ts` files, ESM `package.json`, and prompts about async functions, type inference, strict mode, ESM imports, env handling, template literals, even when the user doesn't say 'TypeScript'.
  • 100developing-with-typescript
    TypeScript 5.x development with type system, generics, utility types, and strict mode patterns. Use when writing TypeScript code or adding types to JavaScript projects.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.