ts-sdk-author
하는 일
스킬은 다른 개발자가 npm에서 설치하는 TypeScript 라이브러리를 만드는 과정을 안내합니다. 기존 코드베이스에서 SDK를 만드는 팀을 위한 스킬입니다.
사용하는 경우
- ✓앱의 핵심 라이브러리를 별도의 TypeScript 패키지로 떼어내고 싶을 때.
- ✓TypeScript 라이브러리의 공개 API를 설계해야 할 때.
- ✓베타나 카나리 버전을 포함해 npm 패키지를 배포할 준비를 하는 경우.
스킬 링크
https://github.com/mindfold-ai/Trellis/blob/main/.agents/skills/ts-sdk-author/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“우리 내부 API 클라이언트를 npm에 배포할 수 있는 TypeScript SDK 패키지로 바꿔 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 작업 공간 구조를 정하고, 공개 인터페이스와 모듈 경계를 설계하며, 빌드 도구를 고르고, 환경별 패키지 exports를 설정합니다. 배포 전에는 검증 도구로 패키지를 점검합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
TypeScript SDK Author
End-to-end workflow for shipping a TypeScript SDK as a standalone npm package from inside a pnpm monorepo: workspace layout, public API design, build configuration, distribution shape, monorepo pipeline, verification, and the full release lifecycle including beta / rc / canary channels.
The seven references hold the depth. This file is the unified workflow plus a quick-reference for the patterns you reach for daily.
When to Use This Skill
- Extracting a core library (e.g.
packages/core,packages/sdk) out of an existing CLI or app inside a pnpm workspace - Designing the public API surface of a TypeScript library that strangers will consume — branded types, generic clients, plugin extension points
- Choosing a build tool — tsdown vs tsup vs tsc-only vs unbuild
- Authoring the
package.jsonexportsfield with dual ESM+CJS, isomorphic runtime conditions, and subpath plugin entries - Configuring Turborepo so the SDK rebuilds only when its inputs change and
downstream apps consume the SDK's build output (or raw
srcvia a custom condition) - Wiring
publint --strictandattw --packintoprepublishOnlyor CI - Managing pre-release channels —
canaryper commit,nextfor the upcoming major,beta/rcfor stabilization,latestfor stable — and the transitions between them (beta.N→rc.0→1.0.0→1.1.0-beta.0) - Setting up changesets with GitHub Actions
changesets/action@v1plus npm provenance
Execution Workflow
A single TS SDK build flows through these seven phases. Skip any phase and something will break later — the dependencies between phases are real.
Phase 1 — Workspace & Package Skeleton
Lay down the monorepo and create the empty SDK package.
Core moves:
- Adopt
apps/+packages/+ optionaltools/at the workspace root - Place the SDK in
packages/<sdk-name>/(orpackages/core/) - Give it a scoped name (
@<org>/<sdk-name>) - Wire workspace-internal deps with the
workspace:*protocol - Decide BEFORE anything else: this package will eventually be published, so design the boundary and naming with that in mind
my-repo/
├── pnpm-workspace.yaml
├── package.json # root: only devDeps + workspace scripts
├── apps/
│ └── example-app/ # consumer of the SDK
└── packages/
├── sdk/ # ← the SDK
└── shared-tsconfig/ # internal-only, never published
# pnpm-workspace.yaml
packages:
- "apps/*"
- "packages/*"
Read next: references/workspace-and-layout.md — §2 layout, §3 SDK naming
patterns, §4 internal package creation, §5 package.json skeleton, §7 multi
-repo → monorepo migration.
Phase 2 — Public API Surface
Before writing any code, decide what the SDK's public face looks like.
Two parallel concerns:
A. Module boundaries. The src/ tree splits cleanly into api/ (what
gets re-exported and is part of the contract) and internal/ (do not import
from outside the package). The package.json exports field is your
cheapest enforcement mechanism — anything not listed there cannot be
imported by consumers.
packages/sdk/src/
├── index.ts # barrel — re-exports from api/
├── api/
│ ├── client.ts
│ └── types.ts
└── internal/
├── transport.ts # NOT exported
└── state.ts # NOT exported
B. Type design. SDK types are consumed by strangers, must not leak internals, must be evolvable. Use:
- Branded types for opaque IDs:
type UserId = Brand<string, "UserId"> - Generic clients with sensible defaults so adding type params later is
non-breaking:
createClient<Schema = DefaultSchema>(...) - Discriminated unions for result types:
Result<T, E>with{ ok: true; value: T } | { ok: false; error: E } - Builder pattern for type-safe configuration when option combinations matter
- Interfaces (not type aliases) when users may need to extend the type via declaration merging
Read next:
references/module-boundaries-and-plugins.md— §2src/boundary, §3 runtime layering, §4 provider/adapter, §5 plugin extension, §6 boundary enforcement, §7 patterns vs anti-patternsreferences/type-design-for-public-api.md— §1 branded types, §2 generic surfaces, §3 conditional/mapped types, §4 type guards, §5 builder, §6 utility types ship/internal, §7 tsconfig for libraries, §8 API evolution
Phase 3 — Build Configuration
You need (a) a tsconfig.json tuned for library outp
자주 묻는 질문
어떤 빌드 도구를 비교하나요?
tsdown, tsup, 일반 TypeScript 컴파일러 설정, unbuild를 비교합니다.
배포 전 버전도 다루나요?
네. 카나리, 베타, 릴리스 후보 채널과 그 사이를 옮기는 방법을 다룹니다.
모노레포가 필요한가요?
이 스킬은 pnpm 모노레포 설정을 위해 작성되었습니다.
상세 정보
작성자의 원본 설명
Design, build, verify, and publish production-grade TypeScript SDKs as npm packages inside a pnpm monorepo. Covers workspace layout, public API and module boundaries, plugin extension points, branded types and library-tuned tsconfig, tsdown bundling (vs tsup/tsc-only/unbuild), package.json exports with dual ESM+CJS and isomorphic conditions (browser/workers/RN/deno), Turborepo pipelines, publint and @arethetypeswrong/cli verification, changesets pre-release mode, npm dist-tags (latest/next/beta/rc/canary), and the alpha→beta→rc→stable release lifecycle. Triggers on: build a TS SDK, extract cor
repo: mindfold-ai/Trellis
인기도
- GitHub 스타
- 15k
- 순위
- #11036
- 라이선스
- AGPL-3.0
- 업데이트
- 2026. 9. 29.
댓글
- …
이 저장소의 다른 스킬
first-principles-thinking
15k계획이나 설계를 기본 사실로 나누고 거기서부터 추론해 검증하도록 에이전트를 돕습니다. 습관이나 관례에 기대지 않습니다.
python-design
15k명확한 모듈, 단순한 인터페이스, 숨은 복잡성이 적은 Python 명령줄 스크립트를 작성하고 검토하도록 에이전트를 돕습니다.
trellis-before-dev
15k글을 쓰기 전에 프로젝트의 코딩 지침과 작업 메모를 읽어, 팀의 관례를 따르도록 에이전트를 돕습니다.
trellis-brainstorm
15k한 번에 하나씩 유용한 질문을 던지고 코드를 확인하며 좁은 범위에 합의해, 새 기능이나 불명확한 작업을 분명하게 하도록 에이전트를 돕습니다.
비슷한 스킬
api-connector-builder
280k에이전트가 기존 패턴을 따라 새로운 API 연결을 만들도록 합니다. 새로운 방식을 도입하지 않고 연동을 하나 더 추가할 때 씁니다.
api-design
280k에이전트가 모범 사례에 따라 REST API를 설계하도록 돕습니다. API가 통신하는 방식, 오류를 보여 주는 방식, 데이터를 정리하는 방식을 정하는 데 유용합니다.
backend-patterns
280k에이전트가 서버 쪽 아키텍처 패턴과 데이터베이스 최적화를 다루도록 돕습니다. 서버에서 실행되는 코드를 만들거나 검토할 때 유용합니다.