This is a strict TypeScript style guide that enforces two main patterns: const objects with type extraction instead of string unions, and flat interfaces with no inline nesting. It's opinionated about banning `any` entirely in favor of `unknown` and generics. The const types pattern is clever because you get both runtime values and type safety from a single source, which genuinely makes refactoring easier. The flat interface rule might feel restrictive if you're used to inline objects, but it does force cleaner separation. Also includes a solid reference for utility types and type guards. Use this if you want strict conventions on a team or you're tired of inconsistent TypeScript across a codebase.

skills.sh installs
500
GitHub stars
665
last updated
Aug 21, 2026

Install

$ npx -y skills add gentleman-programming/gentleman-skills --skill typescript --agent claude-code

Installs into .claude/skills of the current project.

Files

Const Types Pattern (REQUIRED)

// ✅ ALWAYS: Create const object first, then extract type
const STATUS = {
  ACTIVE: "active",
  INACTIVE: "inactive",
  PENDING: "pending",
} as const;

type Status = (typeof STATUS)[keyof typeof STATUS];

// ❌ NEVER: Direct union types
type Status = "active" | "inactive" | "pending";

Why? Single source of truth, runtime values, autocomplete, easier refactoring.

Flat Interfaces (REQUIRED)

// ✅ ALWAYS: One level depth, nested objects → dedicated interface
interface UserAddress {
  street: string;
  city: string;
}

interface User {
  id: string;
  name: string;
  address: UserAddress;  // Reference, not inline
}

interface Admin extends User {
  permissions: string[];
}

// ❌ NEVER: Inline nested objects
interface User {
  address: { street: string; city: string };  // NO!
}

Never Use any

// ✅ Use unknown for truly unknown types
function parse(input: unknown): User {
  if (isUser(input)) return input;
  throw new Error("Invalid input");
}

// ✅ Use generics for flexible types
function first<T>(arr: T[]): T | undefined {
  return arr[0];
}

Sponsors

Details

Repository
github.com/gentleman-programming/gentleman-skills
Category
Documentation
First seen
Jun 3, 2026

More from gentleman-programming/gentleman-skills

All 13
1jwynia avatargentle-teachingjwynia/agent-skillsGuide AI-assisted learning that empowers learners while maintaining appropriate boundaries. Use when teaching, explaining concepts, or helping someone who is st498skills.sh installs
2davila7 avatarbackend-dev-guidelinesdavila7/claude-code-templatesComprehensive backend development guide for Node.js/Express/TypeScript microservices. Use when creating routes, controllers, services, repositories, middleware,492skills.sh installs
3yusufkaraaslan avatarskill-builderyusufkaraaslan/skill_seekersAutomatically detect source types and build AI skills using Skill Seekers. Use when the user wants to create skills from documentation, repos, PDFs, videos, or 490skills.sh installs
4glebis avatarpdf-generationglebis/claude-skillsProfessional PDF generation from markdown using Pandoc with Eisvogel template and EB Garamond fonts. Use when converting markdown to PDF, creating white papers,489skills.sh installs
5lobehub avatarvercel-react-best-practiceslobehub/lobehubReact and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js c489skills.sh installs
6manutej avatarrust-systems-programmingmanutej/luxor-claude-marketplaceComplete guide for Rust systems programming including ownership, borrowing, concurrency, async programming, unsafe code, and performance optimization488skills.sh installs