Agent skill

smith-typescript

TypeScript development standards for frontend and backend projects. Use when working with TypeScript, configuring path aliases, setting up test runners (Vitest/Jest), or organizing test files. Covers Vite alias configuration and type checking.

Stars 1
Forks 0

Install this agent skill to your Project

npx add-skill https://github.com/tianjianjiang/smith/tree/main/smith-typescript

SKILL.md

TypeScript Development Standards

  • Scope: TypeScript projects (frontend or backend)
  • Load if: Working with TypeScript
  • Prerequisites: @smith-principles/SKILL.md, @smith-standards/SKILL.md

CRITICAL: Path Aliases (Primacy Zone)

Configure path aliases in test config - Vite's ~ and @ aliases need explicit test runner setup.

Path Aliases in Test Config

Vite-based projects use ~ and @ as path aliases. Test runners need explicit configuration.

typescript
// vitest.config.ts or jest.config.ts
resolve: {
  alias: {
    '~': projectRoot,
    '@': projectRoot,
  },
}

Test File Organization

  • Place tests adjacent to source in __tests__/ directories
  • Use consistent extension (.spec.ts or .test.ts)

Type Checking

Framework CLIs may provide enhanced type checking. Match CI configuration for consistency.

Claude Code LSP (Experimental)

LSP plugins exist but are currently broken (race condition in initialization):

  • typescript-lsp@claude-plugins-official
  • pyright-lsp@claude-plugins-official

When fixed, LSP provides: goToDefinition, findReferences, hover, documentSymbol, getDiagnostics

Workaround: Use Serena MCP for language server features (find_symbol, find_referencing_symbols)

  • @smith-tests/SKILL.md - Testing standards
  • @smith-dev/SKILL.md - Development workflow
  • @smith-serena/SKILL.md - Serena MCP for language server features

ACTION (Recency Zone)

Before running tests:

  1. Configure path aliases in vitest/jest config
  2. Match CI type-checking configuration
  3. Place tests in __tests__/ adjacent to source

Expand your agent's capabilities with these related and highly-rated skills.

tianjianjiang/smith

smith-style

File naming, path standards, and conventional commits. Use when naming files, creating branches, writing commit messages, or setting up new projects. Covers underscore vs hyphen conventions, commit format, and branch naming patterns.

1 0
Explore
tianjianjiang/smith

smith-stacks

Stacked pull request workflows for large features. Use when creating stacked PRs, managing dependent PRs, or rebasing after parent merges. Covers stack creation, merge order, and squash merge handling.

1 0
Explore
tianjianjiang/smith

smith-python

Python development with uv, pytest, ruff, and type hints. Use when writing Python code, running tests, managing Python packages, or working with virtual environments. Covers import organization, type hints, pytest patterns, and environment variables.

1 0
Explore
tianjianjiang/smith

smith-principles

Fundamental coding principles (DRY, KISS, YAGNI, SOLID, HHH). Use when starting any development task, evaluating implementation approaches, or reviewing code quality. Always active as foundation for all development decisions.

1 0
Explore
tianjianjiang/smith

smith-nuxt

Nuxt 3 development patterns including auto-import stubbing for tests, environment variable conventions, and middleware testing. Use when working with Nuxt projects, testing Nuxt components/middleware, or configuring Nuxt environment variables.

1 0
Explore
tianjianjiang/smith

smith-plan

Plan tracking protocol (portable). Progress tracking with checkboxes, iteration workflow, completion/blocker signals. Use when executing multi-step plans, tracking task progress, or working from plan files. IMPORTANT - Always update the plan file after completing tasks.

1 0
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results