clean-typescript-modules

Installation
SKILL.md

Clean TypeScript Modules

Modules should read as small, cohesive units. Keep related code close, expose one clear concept, and avoid abstractions that do not carry real responsibility.

M1: Keep Declarations Close To Use

Declare variables near the code that needs them. A value defined at the top of a function but used much later forces the reader to remember stale context.

// Bad - formatter is irrelevant until much later
function sendDigest(users: User[], now: Date) {
  const formatter = new Intl.DateTimeFormat("en-US");

  const activeUsers = users.filter((user) => user.active);
  const recipients = activeUsers.map((user) => user.email);
  const subject = `Digest for ${recipients.length} users`;
Installs
2
GitHub Stars
1
First Seen
Jun 4, 2026
clean-typescript-modules — gosukiwi/clean-code-skills