creating-a-package

Scaffold new workspace packages in the c15t monorepo with rslib, vitest, and turbo configuration.

1.9k|209|Updated Jan 13, 2025
One-click install
npx skills add https://github.com/c15t/c15t --skill creating-a-package
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: creating-a-package
Source: https://github.com/c15t/c15t/tree/main/.agents/skills/creating-a-package
Command: npx skills add https://github.com/c15t/c15t --skill creating-a-package

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Adding a new package to the c15t monorepo requires correctly wiring many interlocking pieces—package.json exports maps, rslib builds, TypeScript configs, vitest, turbo tasks, and changesets—and getting any of them wrong breaks builds or publishing. This Skill provides a step-by-step checklist that mirrors existing packages so new packages conform to the repository's conventions.

Core Features & Use Cases

  • Package Scaffolding Checklist: Covers directory naming, package.json shape (exports map, scripts, workspace deps), rslib.config.ts, tsconfig.json, and vitest.config.ts setup.
  • Build & Release Wiring: Guides turbo.json task configuration, changeset linked-group decisions, knip checks, and prepack artifact verification for published packages.
  • Docs & README Generation: Explains generated READMEs via readme.json and bundled docs (AGENTS.md, docs/) for user-facing SDK packages.
  • Use Case: When adding a new utility like @c15t/analytics under packages/, follow the checklist to copy the logger template, configure builds, and verify with turbo and a dry-run pack.

Quick Start

Ask the AI to scaffold a new package named @c15t/<name> in the c15t monorepo following the creating-a-package checklist.

Frequently Asked Questions about creating-a-package

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a new package to the c15t monorepo?

Create a directory under packages/<name> and copy the shape of an existing package like packages/logger. Configure package.json with the @c15t scope, exports map, and standard scripts, then add rslib, tsconfig, and vitest configs before verifying with turbo.

How do I configure package.json exports for a TypeScript library?

Point the exports map at build output: types to ./dist-types/index.d.ts, import to ./dist/index.js, and require to ./dist/index.cjs. Also set main, module, and types fields and include dist and dist-types in the files array.

Should a new package join the linked changeset group?

Core SDK packages that must version together join the linked group in .changeset/config.json. Independent utilities like logger, schema, or ui version separately instead.

How do I verify a new monorepo package builds correctly?

Run bun install, then bun turbo run build check-types lint test filtered to the new package. Finish with bun pm pack --dry-run in the package directory to confirm publishable artifacts.

When does a c15t package need a generated README?

User-facing published packages get a generated README: create a readme.json like packages/react/readme.json and run bun run generate:readmes. Internal utility packages may skip it, and README.md should not be hand-written.