Przejdź do treści
Biblioteka skilli
Programowanie · Budowanie i kod

init-monorepo

/init-monorepo

Tworzy gotowe do pracy monorepo pnpm z Turborepo, wspólnymi pakietami, TypeScriptem i standardowymi skryptami.

Repozytorium
PandaStack ↗
Licencja
MIT
Ostatnia zmiana repozytorium
12.11.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
1
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
1
Przestarzałość

Brak sygnałów. Repozytorium zmienione 12.11.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Tworzy gotowe do pracy monorepo pnpm z Turborepo, wspólnymi pakietami, TypeScriptem i standardowymi skryptami.

Wyzwalacze z opisu

init monoreposet up monoreposcaffold monorepocreate monorepopnpm workspacenew monorepo
Oryginalny opis (EN)

Scaffold a production-ready pnpm monorepo with Turborepo, shared packages, TypeScript, and standard scripts. Use when the user says "init monorepo", "set up monorepo", "scaffold monorepo", "create monorepo", "pnpm workspace", "new monorepo", or when starting a new multi-package project.

Jak działa

  1. Protocol
  2. Rules
Sekcje z nagłówków SKILL.md, w oryginale · 228 linii, 672 słów
Podgląd SKILL.md
---
name: init-monorepo
description: Scaffold a production-ready pnpm monorepo with Turborepo, shared packages, TypeScript, and standard scripts. Use when the user says "init monorepo", "set up monorepo", "scaffold monorepo", "create monorepo", "pnpm workspace", "new monorepo", or when starting a new multi-package project.
version: 0.1.0
---

# Init Monorepo — pnpm + Turbo + TypeScript

You are scaffolding a production-ready monorepo. This follows the exact patterns used across 12+ projects in this developer's codebase.

## Protocol

### Phase 1: Gather Requirements

Before scaffolding, determine:

1. **Project name** — Used for package scoping (e.g., `@stroom/shared`)
2. **Apps needed** — What applications? Common combos:
   - `server` (Express/Fastify backend)
   - `web` (Vue/React frontend)
   - `cli` (CLI tool)
   - `extension` (browser extension)
3. **Shared packages** — Usually at minimum a `shared` package for types/schemas/utils
4. **Database** — Supabase (Prisma), MongoDB (Mongoose), or none
5. **Node version** — Default to 20 LTS

If the user doesn't specify, ask. Don't guess the app structure.

### Phase 2: Scaffold Structure

Create the following files:

#### `pnpm-workspace.yaml`
```yaml
packages:
  - 'packages/*'
  - 'apps/*'
```

#### `turbo.json`
```json
{
  "$schema": "https://turbo.build/schema.json",
  "tasks": {
    "build": {
      "dependsOn": ["^build"],
      "outputs": ["dist/**"]
    },
    "dev": {
      "cache": false,
      "persistent": true
    },
    "test": {
      "dependsOn": ["^build"]
    },
    "lint": {},
    "format": {}
  }
}
```

#### Root `package.json`
```json
{
  "name": "{project-name}",
  "private": true,
  "scripts": {
    "dev": "turbo dev",
    "build": "turbo build",
    "build:shared": "pnpm -F @{scope}/shared build",
    "test": "turbo test",
    "lint": "turbo lint",
    "format": "prettier --write \"**/*.{ts,tsx,vue,json,md}\"",
    "clean": "turbo clean && rm -rf node_modules"
  },
  "devDependencies": {
    "turbo": "^2",
    "prettier": "^3",
    "typescript": "^5"
  },
  "engines": {
    "node": ">=20.0.0"
  },
  "packageManager": "pnpm@9.15.0"
}
```

#### `packages/shared/package.json`
```json
{
  "name": "@{scope}/shared",
  "version": "0.0.1",
  "type": "module",
  "main": "dist/index.js",
  "types": "dist/index.d.ts",
  "exports": {
    ".": {
      "types": "./dist/index.d.ts",
      "import": "./dist/index.js"
    }
  },
  "scripts": {
    "build": "tsc",
    "dev": "tsc --watch",
    "clean": "rm -rf dist"
  },
  "devDependencies": {
    "typescript": "^5"
  }
}
```

#### `packages/shared/tsconfig.json`
```json
{
  "compilerOptions": {
    "target": "ES2022",
    "module": "ESNext",
    "moduleResolution": "bundler",
    "declaration": true,
    "declarationMap": true,
    "sourceMap": true,
    "outDir": "dist",
    "rootDir": "src",
    "strict": true,
    "esModuleInterop": true,
    "skipLibCheck": true,
    "forceConsistentCasingInFileNames": true
  },
  "include": ["src"],
  "exclude": ["dist", "node_modules"]
}
```

#### `packages/shared/src/index.ts`
```typescript
// Re-export all shared modules
// export * from './schemas'
// export * from './constants'
// export * from './utils'
```

#### Root `tsconfig.json`
```json
{
  "compilerOptions": {
    "target": "ES2022",
    "module": "ESNext",
    "moduleResolution": "bundler",
    "strict": true,
    "esModuleInterop": true,
    "skipLibCheck": true,
    "forceConsistentCasingInFileNames": true,
    "declaration": true,
    "declarationMap": true,
    "sourceMap": true
  }
}
```

#### `.gitignore`
```
node_modules/
dist/
.turbo/
*.log
.env
.env.*
!.env.example
.DS_Store
coverage/
```

#### `.npmrc`
```
auto-install-peers=true
strict-peer-dependencies=false
```

### Phase 3: Scaffold Apps

For each requested app, create the appropriate package structure:

**Express backend (`apps/server/`)**:
- `package.json` with `@{scope}/shared` dependency, Express, TypeScript, Vitest
- `tsconfig.json` extending root
- `src/index.ts` — Express setup with health check
- `src/middleware/` — Auth, error handler stubs
- `src/routes/` — Route stubs

**Vue frontend (`apps/web/`)**:
- `package.json` with Vue 3, Vite, `@{scope}/shared` dependency
- `vite.config.ts`
- `src/App.vue`, `src/main.ts`, `src/router/index.ts`
- `src/composables/` — Empty directory for composables
- `src/pages/` — Home page stub

**CLI (`apps/cli/`)**:
- `package.json` with `bin` field pointing to entry
- `src/index.ts` — Commander/yargs setup with version command
- `src/commands/` — Command stubs

### Phase 4: Wire Dependencies

1. Add `@{scope}/shared` as a workspace dependency to each app:
   ```json
   "@{scope}/shared": "workspace:*"
   ```

2. Add convenience scripts to root `package.json`:
   ```json
   "dev:server": "pnpm -F @{scope}/server dev",
   "dev:web": "pnpm -F @{scope}/web dev",
   "test:server": "pnpm -F @{scope}/server test",
   "test:web": "pnpm -F @{scope}/web test"
   ```

### Phase 5: Initialize and Verify

1. Run `pnpm install`
2. Run `pnpm build:shared` — verify shared package compiles
3. Run `pnpm build` — verify full build chain works
4. Run `pnpm dev` — verify dev servers start

## Rules

- **pnpm only.** No npm or yarn. Use `workspace:*` protocol for local deps.
- **Turbo for orchestration.** Never manually order builds — let Turbo's `dependsOn: ["^build"]` handle it.
- **Shared package is mandatory.** Even if it starts empty, it prevents type duplication later.
- **TypeScript strict mode everywhere.** No `any` types, no loose config.
- **Build before dev.** The shared package must be built before apps can import from it. This is the #1 gotcha in monorepos — make it obvious in scripts and docs.
- **Match the user's stack.** If they use Vue, use Vue. If they use React, use React. Don't impose framework choices.

Wersje

W bazie nie ma innych skilli o nazwie init-monorepo.

Migawka bazy z 13.11.2026 · wersja paczki c14f4fea5708 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 2 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 95monorepo
    Konfiguruje monorepo w Nx, Turborepo lub pnpm workspaces, optymalizuje buildy i zarządza współdzielonym kodem.
  • 100monorepo-bootstrap
    Tworzy szkielet monorepo Turborepo na pnpm workspaces ze wspólnymi pakietami w trzech topologiach: web z mobile (Next.js i Expo), web z agentem albo sam web.
  • 95monorepo-management
    Prowadzi monorepo w Turborepo, Nx i pnpm workspaces, optymalizując buildy i wspólne zależności między pakietami.
  • 95pnpm-workspace
    Konfiguruje monorepo w pnpm: strukturę workspace, protokół workspace:*, kolejność budowania i filtrowanie poleceń między pakietami.
  • 100monorepo-manager
    Zarządza zależnościami, konfiguracją workspace i relacjami między pakietami w monorepo, synchronizuje wersje, rozwiązuje konflikty i analizuje graf zależności z npm, pnpm, Yarn, Turborepo lub Nx.
  • 100fec-monorepo-project-standard
    Pomaga tworzyć, przeglądać i restrukturyzować monorepozytoria frontendowe z pnpm workspace, Turborepo i Nx: granice zależności, orkiestracja zadań, nazewnictwo i publikowanie pakietów.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.