Skip to content

Adding a Product

Using the Generator

The fastest way to create a new product:

Terminal window
npx tsx scripts/gen-product.ts

This will prompt you for:

  1. Product name — lowercase, kebab-case (e.g., my-app)
  2. Platforms — which sub-packages to create (web, backend, mobile)

The script creates:

  • products/<name>/shared/ — always created
  • products/<name>/web/ — if web platform selected
  • products/<name>/backend/ — if backend platform selected
  • products/<name>/mobile/ — if mobile platform selected
  • CLAUDE.md files for each sub-package

Manual Setup

If you prefer to create a product manually:

1. Create the shared package

Terminal window
mkdir -p products/my-app/shared/src

Create products/my-app/shared/package.json:

{
"name": "@repo/my-app-shared",
"version": "0.0.0",
"private": true,
"type": "module",
"exports": {
".": {
"types": "./src/index.ts",
"default": "./src/index.ts"
}
},
"scripts": {
"build": "tsc --build",
"lint": "eslint .",
"typecheck": "tsc --noEmit",
"test": "vitest run"
},
"devDependencies": {
"@repo/eslint-config": "workspace:*",
"@repo/tsconfig": "workspace:*",
"eslint": "^9.16.0",
"typescript": "^5.7.0",
"vitest": "^2.1.0"
}
}

2. Add platform sub-packages

Follow the same pattern as the example product. Each sub-package needs:

  • package.json with appropriate dependencies
  • tsconfig.json extending the right base config
  • eslint.config.js importing from @repo/eslint-config
  • vitest.config.ts for tests

3. Run pnpm install

Terminal window
pnpm install

This will link your new packages into the workspace.