← ClaudeAtlas

contentrain-generatelisted

Generate the typed @contentrain/query SDK client from models. Use when running contentrain generate, setting up SDK, configuring bundler aliases, or integrating #contentrain imports.
Contentrain/ai · ★ 4 · AI & Automation · score 73
Install: claude install-skill Contentrain/ai
# Skill: Generate SDK Client > Generate the typed Contentrain query client from model definitions using the Prisma-pattern codegen. --- ## When to Use The user wants to generate or regenerate the SDK client, or says something like "generate client", "regenerate types", "set up contentrain imports", "run contentrain generate", "update SDK types". --- ## Steps ### 1. Check Project State Call `contentrain_status` to verify: - `.contentrain/` directory exists with `config.json`. - At least one model exists in `.contentrain/models/`. - Content files exist for the configured locales. If the project is not initialized, stop and suggest running `/contentrain-init` first. If no models exist, suggest `/contentrain-content` to create content first. ### 2. Verify Prerequisites Check that the required packages are available: - `@contentrain/query` must be installed in the project's `package.json` (as a dependency). - The `contentrain` CLI must be available (via `npx contentrain` or globally installed). If `@contentrain/query` is not installed, install it using the project's package manager: ```bash # Use whichever package manager the project uses pnpm add @contentrain/query # or: npm install @contentrain/query # or: yarn add @contentrain/query ``` ### 3. Run the Generator Execute the generation command: ```bash npx contentrain generate ``` > **Two ways to invoke the generator:** > - `contentrain generate` — via the `contentrain` CLI (recommended; requires the `contentra