From 6eaa6d64ac1eac64b3c474e8bd6a9d19298c246b Mon Sep 17 00:00:00 2001 From: Mark Henderson Date: Sat, 21 Feb 2026 17:27:34 -0800 Subject: [PATCH] feat: add Code OS project-info prompt template to scaffold MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds .prompts/project-info.prompttemplate to the Turborepo scaffold so every new user project gets a customized context file loaded by the Code OS agent — including build commands, workspace structure, and shared package import paths with the project's actual slug injected. Co-authored-by: Cursor --- .../.prompts/project-info.prompttemplate | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 lib/scaffold/turborepo/.prompts/project-info.prompttemplate diff --git a/lib/scaffold/turborepo/.prompts/project-info.prompttemplate b/lib/scaffold/turborepo/.prompts/project-info.prompttemplate new file mode 100644 index 0000000..3db8edd --- /dev/null +++ b/lib/scaffold/turborepo/.prompts/project-info.prompttemplate @@ -0,0 +1,67 @@ +## Project: {{project-name}} + +This is a **Turborepo monorepo** project named `{{project-slug}}`, built with Next.js and pnpm workspaces. + +### Workspace Structure + +``` +apps/ + product/ ← main user-facing Next.js application + website/ ← marketing / landing site (Next.js) + admin/ ← internal admin panel (Next.js) + storybook/ ← component browser for packages/ui + +packages/ + ui/ ← shared React components (@{{project-slug}}/ui) + tokens/ ← design tokens — CSS variables + TypeScript (@{{project-slug}}/tokens) + types/ ← shared TypeScript interfaces and types (@{{project-slug}}/types) + config/ ← shared tsconfig and eslint config (@{{project-slug}}/config) +``` + +### Build Commands (always run from repo root) + +| Task | Command | +|------|---------| +| Install dependencies | `pnpm install` | +| Build one app | `pnpm turbo run build --filter=product` | +| Build all apps | `pnpm turbo run build` | +| Dev one app | `pnpm turbo run dev --filter=product` | +| Dev all | `pnpm turbo run dev` | +| Lint | `pnpm turbo run lint` | +| Type-check | `pnpm turbo run type-check` | +| Add dep to app | `pnpm add --filter=product` | +| Add dep to package | `pnpm add --filter=@{{project-slug}}/ui` | + +### Shared Package Imports + +Always import workspace packages by their scoped name: + +```typescript +import { Button } from '@{{project-slug}}/ui'; +import type { User } from '@{{project-slug}}/types'; +import '@{{project-slug}}/tokens/css'; // CSS variables +``` + +Reference in `package.json` dependencies: +```json +{ "@{{project-slug}}/ui": "workspace:*" } +``` + +### Key Rules + +- **Never** use `npm install` — always `pnpm install` from the repo root +- **Never** run `next build` or `next dev` directly inside an app directory — use `turbo run` from root +- **Always** add dependencies with `--filter` to target the correct workspace +- Turbo caches build outputs in `.turbo/` — run `pnpm turbo run clean` to clear cache +- The `packages/config` package exports shared `tsconfig.base.json` and eslint config + +### Apps Overview + +- **product**: The primary user-facing Next.js app. Port `3000` in dev. +- **website**: Marketing site. Port `3001` in dev. +- **admin**: Admin panel. Port `3002` in dev. +- **storybook**: Visual component browser for `packages/ui`. Port `6006` in dev. + +### Next.js App Router + +All apps use the Next.js App Router (`app/` directory). Page files are `page.tsx`, layouts are `layout.tsx`.