← ClaudeAtlas

write-js-packagelisted

Write, review, and maintain any Agora service's JavaScript/TypeScript REST client package. Use whenever creating or editing files under pkg/js/ — the published client library (pkg/js/rest/), its integration tests (pkg/js/test/rest/), or the package and build config. Covers API methods, type definitions, exports, and test cases.
a-novel-kit/stack · ★ 1 · AI & Automation · score 67
Install: claude install-skill a-novel-kit/stack
# JS Package Writing Skill Every backend service publishes a TypeScript REST client from `pkg/js/`. It is the service's public JS surface: it mirrors the OpenAPI spec exactly and stays synchronized with the REST handlers. **Before editing any file**, read the file first. Every service is scaffolded from `service-template` and the layout is identical across all of them, so follow the patterns you find rather than inventing a local variant. Read the OpenAPI spec (`openapi.yaml`) for every endpoint you touch; the client contract must match it. --- ## Package Layout ``` pkg/js/ ├── rest/ # Published npm package (@a-novel/<service-slug>-rest) │ ├── src/ │ │ ├── index.ts # Re-exports everything — only file consumers import from │ │ ├── api.ts # <Service>Api class (HTTP plumbing + system endpoints) │ │ └── <domain>.ts # One file per resource domain (e.g., item.ts) │ ├── dist/ # Build artefacts — never edit manually │ ├── package.json │ ├── tsconfig.json # Base TypeScript config │ ├── tsconfig.build.json # Declaration-only build config │ └── vite.config.ts # ES module bundle config │ └── test/rest/ # Integration test suite (private, not published) ��── src/ │ ├── api.test.ts # Tests for <Service>Api system endpoints │ └── <domain>.test.ts # One test file per domain (mirrors library files) ├── package.jso