agents/skills/typescript-style/SKILL.md
Apply TypeScript style rules that prefer checked literal typing with satisfies and as const satisfies over unsafe assertions. Use when writing or reviewing TypeScript or TSX code, test fixtures, typed object literals, mocks, config objects, or table-driven cases.
npx skillsauth add ryoppippi/dotfiles typescript-styleInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
satisfies Over asAvoid as type assertions and especially as any. Use satisfies when checking object literals, mocks, config objects, fixture data, and expected rows.
Bad:
const config = { port: 3000, host: 'localhost' } as ServerConfig;
const ctx = { fetchDirent: vi.fn(), addReadHistory: vi.fn() } as any;
Good:
const config = { port: 3000, host: 'localhost' } satisfies ServerConfig;
const ctx = { fetchDirent: vi.fn(), addReadHistory: vi.fn() } satisfies MockContext;
as const satisfiesUse as const satisfies for static literal data when preserving exact literal values or readonly tuples helps TypeScript catch mistakes.
Good:
const ROUTES = {
home: '/',
about: '/about',
} as const satisfies Record<string, string>;
Good for table-driven cases:
const reportCases = [
{ type: 'daily', period: '2026-05-16' },
{ type: 'monthly', period: '2026-05' },
] as const satisfies readonly ReportCase[];
asUse as only when satisfies cannot express the operation, such as narrowing data returned from an external untyped boundary or adapting to an API that requires a nominal type. Keep it local and avoid as any.
@ts-expect-errorUse @ts-expect-error instead of @ts-ignore, and include a short explanation. @ts-expect-error fails when the underlying type error disappears, so stale suppressions are caught.
Bad:
// @ts-ignore
import privateApi from 'some-package/private-api';
Good:
// @ts-expect-error Private runtime API has no public type declaration.
import privateApi from 'some-package/private-api';
development
Prevents and handles GitHub API rate limits during Nix commands. Use when running nix flake, nix run, nix build, nix shell, or comma against GitHub-backed inputs.
tools
Resolves missing CLI tools. Use when a command is unavailable, a shell reports command not found, or a tool must be run without installing it globally.
development
Guides t-wada Red-Green-Refactor TDD. Use when implementing features, fixing bugs, or refactoring logic with strict test-first development.
documentation
Guides agent-skill creation and updates following Anthropic's SKILL.md best practices. Use when adding or editing skills under `agents/skills/`, writing SKILL.md frontmatter, references, or skill routing.