Agent skill

Typescript

by tahabasri in tahabasri/snippets

LobeHub TypeScript style and type-safety guide. An agent skill from tahabasri/snippets.

MITAuto-check passedDevelopment

Install Typescript

skills CLI
$ npx skills add tahabasri/snippets --skill typescript -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install tahabasri/snippets typescript --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/tahabasri/snippets.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/typescript .claude/skills/typescript && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
typescript
GitHub stars
170
Token cost
~968 tokens
SKILL.md length
437 words
Files
1
Skills in repo
1
Repo updated
First seen
Licence
MIT

At a glance

LobeHub TypeScript style and type-safety guide. An agent skill from tahabasri/snippets.

  • Editing TS/TSX/MTS
  • SKILL.md covers Types and Type Safety, Async Patterns, Imports and Code Structure, plus 4 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Choosing interface vs type

What it does

Typescript is an agent skill from tahabasri/snippets. LobeHub TypeScript style and type-safety guide. Use when editing TS/TSX/MTS, fixing types, choosing interface vs type, avoiding any/object, import type, async flow, or ts-expect-error.

Its SKILL.md is about 970 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Type safety and React components. It works with TypeScript and Visual Studio Code. The repository describes itself as: Supercharge your Snippets in VS Code — Manage your code snippets & AI prompts without quitting your editor. The licence is MIT.

When your agent uses it

  • Editing TS/TSX/MTS
  • Choosing interface vs type
  • Avoiding any/object
  • Ts-expect-error

Example prompts

  • “/typescript”

What it can do on your machine

Read from SKILL.md and the folder at commit 9d8640e. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Typescript loads about 968 tokens when it runs. Until then it costs about 49 tokens; SKILL.md has 437 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~49
When it runs · the whole SKILL.md, loaded when a task matches
~968

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from tahabasri/snippets at commit 9d8640e, republished under its MIT licence (© tahabasri). 437 words, ~968 tokens.

Download SKILL.mdSave it as .claude/skills/typescript/SKILL.md (or your agent's skills folder).
name
typescript
description
LobeHub TypeScript style and type-safety guide. Use when editing TS/TSX/MTS, fixing types, choosing interface vs type, avoiding any/object, import type, async flow, or ts-expect-error.
user-invocable
false

TypeScript Code Style Guide

Types and Type Safety

  • Avoid explicit type annotations when TypeScript can infer
  • Avoid implicitly any; explicitly type when necessary
  • Use accurate types: prefer Record<PropertyKey, unknown> over object or any
  • Prefer interface for object shapes (e.g., React props); use type for unions/intersections
  • Prefer as const satisfies XyzInterface over plain as const
  • Prefer @ts-expect-error over @ts-ignore over as any
  • Avoid meaningless null/undefined parameters; design strict function contracts
  • Prefer ES module augmentation (declare module '...') over namespace; do not introduce namespace-based extension patterns
  • When a type needs extensibility, expose a small mergeable interface at the source type and let each feature/plugin augment it locally instead of centralizing all extension fields in one registry file
  • For package-local extensibility patterns like PipelineContext.metadata, define the metadata fields next to the processor/provider/plugin that reads or writes them

Async Patterns

  • Prefer async/await over callbacks or .then() chains
  • Prefer async APIs over sync ones (avoid *Sync)
  • Use promise-based variants: import { readFile } from 'fs/promises'
  • Use Promise.all, Promise.race for concurrent operations where safe

Imports

  • This project uses simple-import-sort/imports and consistent-type-imports (fixStyle: 'separate-type-imports')

  • Separate type imports: always use import type { ... } for type-only imports, NOT import { type ... } inline syntax

  • When a file already has import type { ... } from a package and you need to add a value import, keep them as two separate statements:

    ts
    import type { ChatTopicBotContext } from '@lobechat/types';
    import { RequestTrigger } from '@lobechat/types';
  • Within each import statement, specifiers are sorted alphabetically by name

Show full SKILL.md (214 more words)Show less

Code Structure

  • Prefer object destructuring
  • Use consistent, descriptive naming; avoid obscure abbreviations
  • Replace magic numbers/strings with well-named constants
  • Defer formatting to tooling
  • Prefer named exports over export default — keeps refactor renames and IDE auto-import in sync, and avoids the default re-naming drift you get with import Foo from './foo'. Reserve export default for files where the framework requires it (Next.js page/route/layout, React.lazy targets, config files like vitest.config.ts)
  • Before adding local helpers for common guards/parsing/normalization (record checks, string extraction, empty-string handling, timing helpers, JSON-safe utilities, etc.), search packages/utils first. If the helper already exists or clearly belongs there, import it from @lobechat/utils (or the relevant @lobechat/utils/* subpath) instead of duplicating tiny helpers across feature files.

UI and Theming

  • Use @lobehub/ui, Ant Design components instead of raw HTML tags
  • Design for dark mode and mobile responsiveness
  • Use antd-style token system instead of hard-coded colors

Performance

  • Reuse existing utils in packages/utils or installed npm packages
  • Query only required columns from database

Time Consistency

  • Assign Date.now() to a constant once and reuse for consistency

Logging

  • Never log user private information (API keys, etc.)
  • Don't use import { log } from 'debug' directly (logs to console)
  • Use console.error in catch blocks instead of debug package
  • Always log the error in .catch() callbacks — silent .catch(() => fallback) swallows failures and makes debugging impossible

© tahabasri, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills/typescript of tahabasri/snippets.

Open the folder on GitHubat commit 9d8640e

Compare with similar skills

Typescript next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Typescript compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Typescript this skilltahabasri/snippets170—~968Automated safety check: PassMIT
Typescript Styletjx666/vscode-mcp106—~961Automated safety check: PassCustom licence
Typescript Expertremix-run/remix33k—~3.4kAutomated safety check: PassMIT
Types Enforce TStimmo001/system-bridge356—~689Automated safety check: PassApache-2.0
Typescript CoderLeoYeAI/openclaw-master-skills2.2k—~5.8kAutomated safety check: PassMIT
Frontend Typescript Rulesshinpr/ai-coding-project-boilerplate232—~1.7kAutomated safety check: PassMIT

Similar skills

  • Typescript Style

    tjx666/vscode-mcp

    TypeScript code style and repo conventions for VSCode MCP — inference vs explicit types, ESM import suffixes, zod schema contracts, async VSCode/Node APIs, JSON-safe IPC results, JSDoc for public…

    106 GitHub stars~961 tokensUpdated 2 mo ago
    DevelopmentAuto-check passed
  • Typescript Expert

    remix-run/remix

    Write, refactor, or review TypeScript code with strict, precise, maintainable types and without unnecessary any, type assertions, or type suppressions.

    33k GitHub stars~3.4k tokensUpdated today
    DevelopmentAuto-check passed
  • Types Enforce TS

    timmo001/system-bridge

    TypeScript type-safety guidance. An agent skill from timmo001/system-bridge.

    356 GitHub stars~689 tokensUpdated today
    DevelopmentAuto-check passed
  • Typescript Coder

    LeoYeAI/openclaw-master-skills

    Expert 10x engineer with extensive knowledge of TypeScript fundamentals, migration strategies, and best practices.

    2.2k GitHub stars~5.8k tokensUpdated 2 mo ago
    DevelopmentAuto-check passed
  • Frontend Typescript Rules

    shinpr/ai-coding-project-boilerplate

    Applies React/TypeScript type safety, component design, and state management rules.

    232 GitHub stars~1.7k tokensUpdated 4 days ago
    Frontend & DesignAuto-check passed
  • React Dev

    davila7/claude-code-templates

    This skill should be used when building React components with TypeScript, typing hooks, handling events, or when React TypeScript, React 19, Server Components are mentioned.

    32k GitHub starsUsed in 2 repos~2.6k tokens
    Frontend & DesignAuto-check passed

Categories

Questions about Typescript

What does Typescript do?

LobeHub TypeScript style and type-safety guide. An agent skill from tahabasri/snippets. Typescript is an agent skill from tahabasri/snippets. LobeHub TypeScript style and type-safety guide.

When should I use Typescript?

Typescript fits situations like: editing TS/TSX/MTS; choosing interface vs type; avoiding any/object; ts-expect-error.

How do I install Typescript in Claude Code?

Run `npx skills add tahabasri/snippets --skill typescript -a claude-code`. Or copy the skill folder (.claude/skills/typescript in tahabasri/snippets) into .claude/skills/typescript in your project. Claude Code loads it when a task matches its description.

How do I install Typescript in Codex?

Run `npx skills add tahabasri/snippets --skill typescript -a codex`. Or copy the skill folder (.claude/skills/typescript in tahabasri/snippets) into .agents/skills/typescript in your project. Codex loads it when a task matches its description.

Can I use Typescript in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add tahabasri/snippets --skill typescript -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/typescript, .gemini/skills/typescript, .github/skills/typescript and .opencode/skills/typescript in your project.

What does Typescript need to run?

SKILL.md names no scripts, command-line tools or credentials: Typescript is instructions for the agent only.

Does Typescript access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Typescript safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Typescript use?

Typescript is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Typescript use?

About 968 tokens (SKILL.md is roughly 3.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Typescript?

Skills that share tags, products or a category with Typescript: Typescript Style (tjx666/vscode-mcp, 106 stars), Typescript Expert (remix-run/remix, 33k stars), Types Enforce TS (timmo001/system-bridge, 356 stars) and Typescript Coder (LeoYeAI/openclaw-master-skills, 2.2k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Typescript?

tahabasri (a GitHub user) maintains it in tahabasri/snippets, which has 170 GitHub stars. The repository was last updated on July 11, 2026.

Source: tahabasri/snippets on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.