Skip to main content
skill CX Codex

typescript-docs — Claude Code skill for TypeScript docs

Creates TypeScript documentation with JSDoc, TypeDoc, and ADRs. Use it when documenting APIs, architecture choices, or framework-specific code.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add giuseppe-trisciuoglio/developer-kit --skill typescript-docs -a claude-code
Open on GitHub

What typescript-docs does

This skill drafts JSDoc for functions, classes, interfaces, and generic types. It covers @param, @returns, @throws, @example, @remarks, @see, and @deprecated, with documentation patterns for React, NestJS, Express, Angular, and Vue.

For API reference output, it configures TypeDoc with an entry point such as src/index.ts and an output folder of docs/api. The sample configuration sets excludePrivate to true, so private members stay out of generated reference pages. That is a good boundary for public API docs, but internal code may need separate documentation.

The skill also provides an ADR structure covering status, context, decision, and consequences. It includes ESLint rules for documentation checks and a GitHub Actions workflow that generates and validates docs. Angular projects can use npx compodoc -p tsconfig.json, while JSDoc validation runs with eslint --ext .ts src/.

What it helps with

  • document public TypeScript APIs with JSDoc
  • generate an API reference with TypeDoc
  • record an architecture decision in an ADR
  • validate parameter and return descriptions with ESLint
  • add documentation generation to GitHub Actions

Example prompts for the agent

  • Add JSDoc to the public classes and functions in src/.
  • Configure TypeDoc from src/index.ts and write the API reference to docs/api.
  • Create an ADR for enabling TypeScript strict mode.

How to install typescript-docs

1Skills CLI (Vercel)

npx skills add giuseppe-trisciuoglio/developer-kit --skill typescript-docs -a claude-code

2Manually: put the files in place

~/.claude/skills/typescript-docs/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/typescript-docs/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about typescript-docs

How do I install typescript-docs in Claude Code?

Run npx skills add giuseppe-trisciuoglio/developer-kit --skill typescript-docs -a claude-code. The skill is placed at ~/.claude/skills/typescript-docs/SKILL.md.

What does typescript-docs do?

It helps create TypeScript documentation with inline JSDoc, TypeDoc API references, and ADRs for design decisions. It also includes patterns for NestJS, Express, React, Angular, and Vue.

How can I validate JSDoc comments?

The skill includes ESLint rules that require descriptions, parameter details, and return details; its example treats @example as a warning. Run eslint --ext .ts src/ and address the reported comments.

Source text

SKILL.md · MIT
---
name: typescript-docs
description: Generates comprehensive TypeScript documentation using JSDoc, TypeDoc, and multi-layered documentation patterns for different audiences. Use when creating API documentation, architectural decision records (ADRs), code examples, and framework-specific patterns for NestJS, Express, React, Angular, and Vue.
allowed-tools: Read, Write, Edit, Bash, Grep, Glob
---

# TypeScript Documentation

Generate production-ready TypeScript documentation with layered architecture for multiple audiences. Supports API docs with TypeDoc, ADRs, and framework-specific patterns.

## Overview

Use JSDoc annotations for inline documentation, TypeDoc for API reference generation, and ADRs for tracking design choices.

**Key capabilities:**
- TypeDoc configuration and API documentation generation
- JSDoc patterns for all TypeScript constructs
- ADR creation and maintenance
- Framework-specific patterns (NestJS, React, Express, Angular, Vue)
- ESLint validation rules for documentation quality
- GitHub Actions pipeline setup

## When to Use

Use this skill when creating API documentation, architectural decision records, code examples, or framework-specific patterns for NestJS, Express, React, Angular, or Vue.

## Quick Reference

| Tool | Purpose | Command |
|------|---------|---------|
| TypeDoc | API documentation generation | `npx typedoc` |
| Compodoc | Angular documentation | `npx compodoc -p tsconfig.json` |
| ESLint JSDoc | Documentation validation | `eslint --ext .ts src/` |

### JSDoc Tags

| Tag | Use Case |
|-----|----------|
| `@param` | Document parameters |
| `@returns` | Document return values |
| `@throws` | Document error conditions |
| `@example` | Provide code examples |
| `@remarks` | Add implementation notes |
| `@see` | Cross-reference related items |
| `@deprecated` | Mark deprecated APIs |

## Instructions

### 1. Configure TypeDoc

```bash
npm install --save-dev typedoc typedoc-plugin-markdown
```

```json
{
  "entryPoints": ["src/index.ts"],
  "out": "docs/api",
  "theme": "markdown",
  "excludePrivate": true,
  "readme": "README.md"
}
```

### 2. Add JSDoc Comments

```typescript
/**
 * Service for managing user authentication
 *
 * @remarks
 * Handles JWT-based authentication with bcrypt password hashing.
 *
 * @example
 * ```typescript
 * const authService = new AuthService(config);
 * const token = await authService.login(email, password);
 * ```
 *
 * @security
 * - Passwords hashed with bcrypt (cost factor 12)
 * - JWT tokens signed with RS256
 */
@Injectable()
export class AuthService {
  /**
   * Authenticates a user and returns access tokens
   * @param credentials - User login credentials
   * @returns Authentication result with tokens
   * @throws {InvalidCredentialsError} If credentials are invalid
   */
  async login(credentials: LoginCredentials): Promise<AuthResult> {
    // Implementation
  }
}
```

### 3. Create an ADR

```markdown
# ADR-001: TypeScript Strict Mode Configuration

## Status
Accepted

## Context
What is the issue motivating this decision?

## Decision
What change are we proposing?

## Consequences
What becomes easier or more difficult?
```

### 4. Set Up CI/CD Pipeline

```yaml
name: Documentation
on:
  push:
    branches: [main]
    paths: ['src/**', 'docs/**']

jobs:
  generate-docs:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: '20'
          cache: 'npm'
      - run: npm ci
      - run: npm run docs:generate
      - run: npm run docs:validate
```

### 5. Validate Documentation

```json
{
  "rules": {
    "jsdoc/require-description": "error",
    "jsdoc/require-param-description": "error",
    "jsdoc/require-returns-description": "error",
    "jsdoc/require-example": "warn"
  }
}
```

**If validation fails:** review ESLint errors, fix JSDoc comments (add missing descriptions, add `@param`/`@returns`/`@throws` where absent), re-run `eslint --ext .ts src/` until all errors pass before committing.

## Examples

### Documenting a React Hook

```typescript
/**
 * Custom hook for fetching paginated data
 *
 * @remarks
 * This hook manages loading states, error handling, and automatic
 * refetching when the page or filter changes.
 *
 * @example
 * ```tsx
 * function UserList() {
 *   const { data, isLoading, error } = usePaginatedData('/api/users', {
 *     page: currentPage,
 *     limit: 10
 *   });
 *
 *   if (isLoading) return <Spinner />;
 *   if (error) return <ErrorMessage error={error} />;
 *   return <UserTable users={data.items} />;
 * }
 * ```
 *
 * @param endpoint - API endpoint to fetch from
 * @param options - Pagination and filter options
 * @returns Paginated response with items and metadata
 */
export function usePaginatedData<T>(
  endpoint: string,
  options: PaginationOptions
): UsePaginatedDataResult<T> {
  // Implementation
}
```

### Documenting a Utility Function

```typescript
/**
 * Validates email addresses using RFC 5322 specification
 *
 * @param email - Email address to validate
 * @returns True if email format is valid
 *
 * @example
 * ```typescript
 * isValidEmail('[email protected]'); // true
 * isValidEmail('invalid-email');      // false
 * ```
 *
 * @performance
 * O(n) where n is the email string length
 *
 * @see {@link https://tools.ietf.org/html/rfc5322} RFC 5322 Specification
 */
export function isValidEmail(email: string): boolean {
  const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
  return emailRegex.test(email);
}
```

### NestJS Controller Documentation

```typescript
/**
 * REST API endpoints for user management
 *
 * @remarks
 * All endpoints require authentication via Bearer token.
 * Rate limiting: 100 requests per minute per user.
 *
 * @example
 * ```bash
 * curl -H "Authorization: Bearer <token>" https://api.example.com/users/123
 * ```
 *
 * @security
 * - All endpoints use HTTPS
 * - JWT tokens expire after 1 hour
 * - Sensitive data is redacted from logs
 */
@Controller('users')
export class UsersController {
  /**
   * Retrieves a user by ID
   * @param id - User UUID
   * @returns User profile (password excluded)
   */
  @Get(':id')
  async getUser(@Param('id') id: string): Promise<UserProfile> {
    // Implementation
  }
}
```

## Best Practices

1. **Document Public APIs**: All public methods, classes, and interfaces
2. **Use `@example`**: Provide runnable examples for complex functions
3. **Include `@throws`**: Document all possible errors
4. **Add `@see`**: Cross-reference related functions/types
5. **Use `@remarks`**: Add implementation details and notes
6. **Document Generics**: Explain generic constraints and usage
7. **Include Performance Notes**: Document time/space complexity
8. **Add Security Warnings**: Highlight security considerations
9. **Keep Updated**: Update docs when code changes
10. **Don't document obvious code**: Focus on why, not what

## Constraints and Warnings

- **Private Members**: Use `@private` or exclude from TypeDoc output
- **Complex Types**: Document generic constraints and type parameters
- **Breaking Changes**: Use `@deprecated` with migration guidance
- **Security Info**: Never include secrets or credentials in documentation
- **Link Validity**: Ensure `@see` references point to valid locations
- **Example Code**: All examples should be runnable and tested
- **Versioning**: Keep documentation in sync with code versions

## References

- **[references/jsdoc-patterns.md](references/jsdoc-patterns.md)** — JSDoc patterns for interfaces, functions, classes, generics, and unions
- **[references/framework-patterns.md](references/framework-patterns.md)** — Framework-specific patterns for NestJS, React, Express, and Angular
- **[references/adr-patterns.md](references/adr-patterns.md)** — ADR templates and examples
- **[references/pipeline-setup.md](references/pipeline-setup.md)** — CI/CD pipeline configuration for documentation
- **[references/validation.md](references/validation.md)** — ESLint rules and validation checklists
- **[references/typedoc-configuration.md](references/typedoc-configuration.md)** — Complete TypeDoc configuration options
- **[references/examples.md](references/examples.md)** — Additional code examples

© giuseppe-trisciuoglio · MIT · giuseppe-trisciuoglio/developer-kit

Similar skills

Everything for Writing and docs →

From the same set93

tailwind-design-system Creates and orchestrates a design system using Tailwind CSS v4.1+ and shadcn/ui. It defines oklch design tokens, themes via CSS variables, and wraps UI primitives. CX Codex +1 4,500installs spring-boot-test-patterns A skill that gives your agent ready patterns for Spring Boot tests: Mockito unit tests, @DataJpaTest and @WebMvcTest slices, Testcontainers integration. CX Codex +1 4,300installs react-code-review Reviews React components and hooks before merge: composition, hook dependencies, accessibility, TypeScript types. Findings come sorted by severity. CX Codex +1 4,300installs spring-boot-rest-api-standards Enforces REST API design standards for Spring Boot, covering URL structure, DTO validation, status codes, and global exception handling. CX Codex +1 4,200installs nestjs Gives your agent NestJS patterns: CRUD modules, JWT guards, Drizzle schemas and migrations. Handy when you are building an API on NestJS. CX Codex +1 4,200installs unit-test-boundary-conditions A skill that hands your agent ready patterns for Java unit tests at the edges: min and max values, nulls, empty collections, overflow and double precision. CX Codex +1 4,100installs turborepo-monorepo A skill that walks your agent through Turborepo: workspaces, turbo.json tasks, test pipelines and build caching. CX Codex +1 4,100installs spring-data-jpa Patterns and rules for Spring Data JPA persistence layers: repository setup, pagination, entity auditing, and transaction boundaries. CX Codex +1 4,100installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor