Agent skill

Typescript

by scalar in scalar/scalar

Write clear, predictable TypeScript and Vue TypeScript code with strong typing, maintainability, and consistent documentation conventions.

MITAuto-check passedBackend & APIs

Install Typescript

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

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

GitHub CLI
$ gh skill install scalar/scalar 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/scalar/scalar.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/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
16k
Token cost
~1.1k tokens
SKILL.md length
389 words
Files
1
Skills in repo
7
Repo updated
First seen
Licence
MIT

At a glance

Write clear, predictable TypeScript and Vue TypeScript code with strong typing, maintainability, and consistent documentation conventions.

  • Tasks that involve OpenAPI specifications
  • SKILL.md covers Principles, General Guidelines, Naming Conventions and Working with Vue + TypeScript, plus 2 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Typescript is an agent skill from scalar/scalar. Write clear, predictable TypeScript and Vue TypeScript code with strong typing, maintainability, and consistent documentation conventions.

Its SKILL.md is about 1.1k 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 Backend & APIs, covering OpenAPI specifications. It works with TypeScript, Vue.js and OpenAPI. The repository describes itself as: Scalar is an open-source API platform: 🌐 Modern REST API Client 📖 Beautiful API References ✨ 1st-Class OpenAPI/Swagger Support. The licence is MIT.

When your agent uses it

  • Tasks that involve OpenAPI specifications

Example prompts

  • “/typescript”

What it can do on your machine

Read from SKILL.md and the folder at commit 854b0f4. 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 1.1k tokens when it runs. Until then it costs about 37 tokens; SKILL.md has 389 words of instructions outside code blocks.

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

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 scalar/scalar at commit 854b0f4, republished under its MIT licence (© scalar). 389 words, ~1,109 tokens.

Download SKILL.mdSave it as .claude/skills/typescript/SKILL.md (or your agent's skills folder).
name
typescript
description
Write clear, predictable TypeScript and Vue TypeScript code with strong typing, maintainability, and consistent documentation conventions.

Writing TypeScript

You write TypeScript code that is clear, predictable, and easy to maintain. The goal is to make the codebase safer, more understandable, and easier to refactor without over-engineering.

Principles

  • Type safety over flexibility.
  • Clarity over cleverness.
  • Type inference where it makes sense.

General Guidelines

  • Prefer type over interface.
  • Explicit return types for functions.
  • Avoid any. Use unknown when the type is unclear.
  • Prefer primitive types over complex ones unless necessary.
  • Use readonly when possible.
  • Avoid enums. Use string literal unions instead.
  • Always use const instead of let.
  • Use satisfies instead of as
  • Always use arrow functions when possible

Naming Conventions

  • Be descriptive.
  • Use suffixes appropriately.

Working with Vue + TypeScript

  • Explicitly type defineProps and defineEmits.
  • Explicit return types for composables.
  • Explicitly type Ref and ComputedRef.

Testing

  • Write all tests using vitest.
  • Ensure you cover all main cases as well as edge cases, try to break the code with the tests.
  • Create the test file alongside the file being tested, call it name.test.ts.

Great Comments for All Types

  • Use comments to explain why, not what. Most of the time, the code explains what is happening. Comments should clarify why a type or function exists, why you made specific decisions, or why a workaround is necessary.
  • Write friendly comments that sound human. Comments should be clear and helpful, not robotic or overly formal. Aim for a tone that's friendly and supportive, like you're helping a teammate understand the code later.
Show full SKILL.md (150 more words)Show less

Good:

ts
/**
 * We load the user here to make sure we have fresh data when the component mounts.
 * Without this, the user info could be stale.
 */

Bad:

ts
/**
 * Load user.
 */
  • Avoid contractions in comments. Use do not instead of don't, it is instead of it's, etc. This makes comments easier to read, especially for non-native speakers.

  • If you use contractions, make sure they have proper apostrophes. Sometimes contractions can make a comment more approachable. If you choose to use them, use proper punctuation.

  • Comment on types when their purpose isn't obvious. If a type models an external API, or has a non-obvious constraint, explain it.

  • Explain relationships between types when they're not clear.

Example:

ts
/**
 * Maps UserStatus to a badge color used in the UI.
 * Should stay in sync with the theme color palette.
 */
export type StatusColorMap = {
  active: 'green'
  inactive: 'gray'
}
  • Document the intent of utility types or generic types.

Example:

ts
/**
 * Represents a partial object where at least one property is required.
 * Useful when you want to enforce at least one field update in a PATCH request.
 */
export type AtLeastOne<T> = {
  [K in keyof T]: Partial<T> & Pick<T, K>
}[keyof T]
  • For complex function signatures or composables, describe the behavior and usage.

Example:

ts
/**
 * useUser composable for loading and managing user data.
 * Fetches the user from the API and exposes reactive state.
 *
 * Returns:
 * - user: Ref<User | null>
 * - isLoading: Ref<boolean>
 * - loadUser: Function to manually trigger user loading
 */
export function useUser() { ... }
  • If the type is temporary or will change later, leave a TODO comment.

Example:

ts
/**
 * TODO: Replace with dynamic permissions from backend when available.
 */
export type Permissions = 'read' | 'write' | 'admin'
  • Use JSDoc style consistently for types and functions that are exported or public. This improves editor support (tooltips, autocompletion) and helps other developers understand your code faster.

Example

ts
/**
 * A user in the system.
 * This type represents the internal data structure for application logic.
 * If you need to expose user data publicly, use `PublicUser`.
 */
export type User = {
  /** Unique identifier for the user (UUID). */
  id: string
  /** The user's full name. */
  name: string
  /** Email address. Must be validated before saving. */
  email: string
  /** ISO date string of when the user signed up. */
  createdAt: string
  /** Whether the user has verified their email. */
  isVerified: boolean
}

© scalar, 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 .agents/skills/typescript of scalar/scalar.

Open the folder on GitHubat commit 854b0f4

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 skillscalar/scalar16k—~1.1kAutomated safety check: PassMIT
OpenAPI to MCP Servermcp-use/mcp-use11k—~5.2kAutomated safety check: PassApache-2.0
Api2clialexknowshtml/api2cli455—~2.9kAutomated safety check: PassMIT
Projectsamchon/nestia2.2k—~3kAutomated safety check: PassMIT
API ContractChenyCHENYU/Robot_Admin1k—~1.9kAutomated safety check: PassMIT
Spiceflowremorses/spiceflow167—~1.9kAutomated safety check: PassMIT

Similar skills

  • OpenAPI to MCP Server

    mcp-use/mcp-use

    Turns an OpenAPI or Swagger spec into an MCP server with the mcp-use TypeScript SDK, mapping each operation to a tool, wiring auth, testing and deploying.

    11k GitHub stars~5.2k tokensUpdated today
    Backend & APIsAuto-check passed
  • Api2cli

    alexknowshtml/api2cli

    Generate a working CLI from any API, then wrap it in a Claude Code skill.

    455 GitHub stars~2.9k tokensUpdated 7 mo ago
    Backend & APIsAuto-check passed
  • Project

    samchon/nestia

    Defines the nestia product contract, workspace layout, package boundaries, the Go plugin composition model, and canonical commands.

    2.2k GitHub stars~3k tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • API Contract

    ChenyCHENYU/Robot_Admin

    A skill your agent uses when: generating TypeScript API layer (type definitions + request functions) from page-spec JSON or Swagger/OpenAPI docs.

    1k GitHub stars~1.9k tokensUpdated today
    Backend & APIsAuto-check passed
  • Spiceflow

    remorses/spiceflow

    Spiceflow is a super simple, fast, and type-safe API and React Server Components framework for TypeScript.

    167 GitHub stars~1.9k tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • Counterfact Repl

    counterfact/api-simulator

    Interact with Counterfact mock API server programmatically. An agent skill from counterfact/api-simulator.

    170 GitHub stars~3.2k tokensUpdated today
    Backend & APIsAuto-check passed

More from scalar/scalar

  • Scalar's design system — design tokens, theming (@scalar/themes), CSS variables, and the @scalar/components library.

    16k GitHub stars~2.7k tokensUpdated today
    Auto-check passed
  • Minimal starter runbook for cloud agents to install dependencies, run packages, execute tests, and troubleshoot the Scalar monorepo quickly.

    16k GitHub stars~1.4k tokensUpdated today
    Auto-check passed
  • Mock Server

    scalar/scalar

    Build, customize, and troubleshoot OpenAPI mock servers with @scalar/mock-server, including x-handler, x-seed, authentication, and Docker.

    16k GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Openapi Glossary

    scalar/scalar

    Use consistent OpenAPI terminology and definitions when writing documentation, educational material, and tooling guidance.

    16k GitHub stars~3.3k tokensUpdated today
    Auto-check passed
  • Scalar Docs

    scalar/scalar

    Skill for writing and updating scalar.config.json — Scalar Docs configuration reference for users and LLMs.

    16k GitHub stars~3.6k tokensUpdated today
    Auto-check passed
  • Vue Components

    scalar/scalar

    Build Vue 3 components with TypeScript and Tailwind using clean structure, composable logic, accessibility, and maintainable patterns.

    16k GitHub stars~886 tokensUpdated today
    Auto-check passed

Categories

Questions about Typescript

What does Typescript do?

Write clear, predictable TypeScript and Vue TypeScript code with strong typing, maintainability, and consistent documentation conventions. Typescript is an agent skill from scalar/scalar. Write clear, predictable TypeScript and Vue TypeScript code with strong typing, maintainability, and consistent documentation conventions.

When should I use Typescript?

Typescript fits situations like: tasks that involve OpenAPI specifications.

How do I install Typescript in Claude Code?

Run `npx skills add scalar/scalar --skill typescript -a claude-code`. Or copy the skill folder (.agents/skills/typescript in scalar/scalar) 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 scalar/scalar --skill typescript -a codex`. Or copy the skill folder (.agents/skills/typescript in scalar/scalar) 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 scalar/scalar --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 1.1k tokens (SKILL.md is roughly 4.4k 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: OpenAPI to MCP Server (mcp-use/mcp-use, 11k stars), Api2cli (alexknowshtml/api2cli, 455 stars), Project (samchon/nestia, 2.2k stars) and API Contract (ChenyCHENYU/Robot_Admin, 1k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Typescript?

scalar (a GitHub organization) maintains it in scalar/scalar, which has 16,241 GitHub stars. The repository holds 7 skills in this directory. The repository was last updated on October 8, 2026.

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