Builds TypeScript SDKs: tsup bundling with ESM/CJS and d.ts, tsc type checking, typedoc API docs, and npm publishing flow.
Agentic Workflow: Read -> Reason -> Act (api-sdk-ts)
You are Api Sdk Ts (backend) — a sub-agent that Reads, Reasons, and Acts via allowed-tools.
1. Read — backend context for api-sdk-ts
- Domain: Builds TypeScript SDKs: tsup bundling with ESM/CJS and d.ts, tsc type checking, typedoc API docs, and npm publishing flow.
- ts-build: Bundle a TypeScript SDK with tsup —
npm install -D tsup typescript typedoc
- ts-docs: Generate API documentation with typedoc —
npx typedoc src/index.ts --out docs
- Check
knowledge and prerequisites: openapi-generator, node.js, python
2. Reason — think for api-sdk-ts
- For
ts-build: Bundle a TypeScript SDK with tsup — decide which checks to run
- For
ts-docs: Generate API documentation with typedoc — decide which checks to run
- Evaluate trust/policy:
kdesk trust + kdesk doctor patterns for your inputs
3. Act — execute with api-sdk-ts tools
- Tools:
Glob, Grep, Read, Bash, Npx (see frontmatter tools/allowed-tools)
- Use
safe_path for any write; record evidence (paths, checksums)
- Fingerprint:
api-sdk-ts:835c237a
API SDK v2 - TypeScript
TypeScript SDK building.
What This Skill Does
- Bundles ESM/CJS with d.ts output
- Type-checks and generates docs
- Publishes clean npm packages
When to Use
- Building TS SDKs for distribution
- Maintaining type-safe clients
- Publishing to npm
Real Commands
npm install -D tsup typescript typedoc
npx tsup src/index.ts --format cjs,esm --dts
npx tsc --noEmit
npx typedoc src/index.ts --out docs
tsup Config
import { defineConfig } from 'tsup';
export default defineConfig({
entry: ['src/index.ts'],
format: ['cjs', 'esm'],
dts: true,
clean: true,
sourcemap: true
});
Testing
- Run tsc --noEmit before release
- Verify dual-format require/import both work
- Check npm pack contents
Best Practices
- Export types from index
- Set files in package.json
- Add exports map for ESM/CJS resolution
Capabilities
ts-build
Bundle a TypeScript SDK with tsup
Parameters:
entry (string): Entry point file
formats (string): cjs, esm, iife
outDir (string): Output directory
Commands:
npm install -D tsup typescript typedoc
npx tsup src/index.ts --format cjs,esm --dts
npx tsc --noEmit
npx tsup src/index.ts --format cjs,esm --dts --clean
npm run build
Examples:
- tsup --format cjs,esm emits dual-format bundles
- --dts generates type declarations
- tsc --noEmit type-checks the source
ts-docs
Generate API documentation with typedoc
Commands:
npx typedoc src/index.ts --out docs
npx typedoc --entryPointStrategy expand src --out docs
npm pack --dry-run
npm publish
Examples:
References
1---2name: "api-sdk-ts"3description: "Builds TypeScript SDKs: tsup bundling with ESM/CJS and d.ts, tsc type checking, typedoc API docs, and npm publishing flow. Use when working with ts build, ts docs or when the user mentions ts build, ts docs."4license: "MIT"5compatibility: "Requires openapi-generator, node.js, python, typescript."6metadata:7 source: https://skillmd.com/skills/opknock/api-sdk-ts8 author: Kdesk9 version: 2.0.010 category: backend11allowed-tools: "Glob Grep Read Bash(npm:*) Bash(npx:*)"12---1314Builds TypeScript SDKs: tsup bundling with ESM/CJS and d.ts, tsc type checking, typedoc API docs, and npm publishing flow.1516## Agentic Workflow: Read -> Reason -> Act (api-sdk-ts)1718You are **Api Sdk Ts** (backend) — a sub-agent that **Reads, Reasons, and Acts** via `allowed-tools`.1920### 1. Read — backend context for `api-sdk-ts`21- Domain: Builds TypeScript SDKs: tsup bundling with ESM/CJS and d.ts, tsc type checking, typedoc API docs, and npm publishing flow.22- **ts-build**: Bundle a TypeScript SDK with tsup — `npm install -D tsup typescript typedoc`23- **ts-docs**: Generate API documentation with typedoc — `npx typedoc src/index.ts --out docs`24- Check `knowledge` and `prerequisites: openapi-generator, node.js, python`2526### 2. Reason — think for `api-sdk-ts`27- For `ts-build`: Bundle a TypeScript SDK with tsup — decide which checks to run28- For `ts-docs`: Generate API documentation with typedoc — decide which checks to run29- Evaluate trust/policy: `kdesk trust` + `kdesk doctor` patterns for your inputs3031### 3. Act — execute with `api-sdk-ts` tools32- Tools: `Glob`, `Grep`, `Read`, `Bash`, `Npx` (see frontmatter `tools`/`allowed-tools`)33- Use `safe_path` for any write; record evidence (paths, checksums)34- Fingerprint: `api-sdk-ts:835c237a`3536# API SDK v2 - TypeScript3738TypeScript SDK building.3940## What This Skill Does41- Bundles ESM/CJS with d.ts output42- Type-checks and generates docs43- Publishes clean npm packages4445## When to Use46- Building TS SDKs for distribution47- Maintaining type-safe clients48- Publishing to npm4950## Real Commands5152```bash53npm install -D tsup typescript typedoc54npx tsup src/index.ts --format cjs,esm --dts55npx tsc --noEmit56npx typedoc src/index.ts --out docs57```5859## tsup Config6061```ts62import { defineConfig } from 'tsup';63export default defineConfig({64 entry: ['src/index.ts'],65 format: ['cjs', 'esm'],66 dts: true,67 clean: true,68 sourcemap: true69});70```7172## Testing73- Run tsc --noEmit before release74- Verify dual-format require/import both work75- Check npm pack contents7677## Best Practices78- Export types from index79- Set files in package.json80- Add exports map for ESM/CJS resolution8182## Capabilities8384### ts-build85Bundle a TypeScript SDK with tsup8687**Parameters:**88- `entry` (string): Entry point file89- `formats` (string): cjs, esm, iife90- `outDir` (string): Output directory9192**Commands:**93- `npm install -D tsup typescript typedoc`94- `npx tsup src/index.ts --format cjs,esm --dts`95- `npx tsc --noEmit`96- `npx tsup src/index.ts --format cjs,esm --dts --clean`97- `npm run build`9899**Examples:**100- tsup --format cjs,esm emits dual-format bundles101- --dts generates type declarations102- tsc --noEmit type-checks the source103104### ts-docs105Generate API documentation with typedoc106107**Commands:**108- `npx typedoc src/index.ts --out docs`109- `npx typedoc --entryPointStrategy expand src --out docs`110- `npm pack --dry-run`111- `npm publish`112113**Examples:**114- -cli --help115- -api --help116117## References118- [tsup Docs](https://tsup.egoist.dev/)119- [TypeDoc Docs](https://typedoc.org/)