feat: add Turborepo per-project monorepo scaffold and project API
- Add Turborepo scaffold templates (apps: product, website, admin, storybook; packages: ui, tokens, types, config) - Add ProjectRecord and AppRecord types to control plane - Add Gitea integration service (repo creation, scaffold push, webhooks) - Add Coolify integration service (project + per-app service provisioning with turbo --filter) - Add project routes: GET/POST /projects, GET /projects/:id/apps, POST /projects/:id/deploy - Update chat route to inject project/monorepo context into AI requests - Add deploy_app and scaffold_app tools to Gemini tool set - Update deploy executor with monorepo-aware /execute/deploy endpoint - Add TURBOREPO_MIGRATION_PLAN.md documenting rationale and scope Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -108,26 +108,71 @@ export const PRODUCT_OS_TOOLS = [
|
||||
},
|
||||
required: ["task"]
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "deploy_app",
|
||||
description: "Deploy a specific app from the project monorepo. Use when user wants to deploy or ship one of their apps (product, website, admin, storybook).",
|
||||
parameters: {
|
||||
type: "object",
|
||||
properties: {
|
||||
project_id: { type: "string", description: "The project ID" },
|
||||
app_name: {
|
||||
type: "string",
|
||||
enum: ["product", "website", "admin", "storybook"],
|
||||
description: "Which app to deploy"
|
||||
},
|
||||
env: {
|
||||
type: "string",
|
||||
enum: ["dev", "staging", "prod"],
|
||||
description: "Target environment"
|
||||
}
|
||||
},
|
||||
required: ["project_id", "app_name"]
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "scaffold_app",
|
||||
description: "Add a new app to the project monorepo. Use when user wants to add a new application beyond the defaults.",
|
||||
parameters: {
|
||||
type: "object",
|
||||
properties: {
|
||||
project_id: { type: "string", description: "The project ID" },
|
||||
app_name: { type: "string", description: "Name for the new app (e.g. 'mobile', 'api', 'dashboard')" },
|
||||
framework: {
|
||||
type: "string",
|
||||
enum: ["nextjs", "astro", "express", "fastify"],
|
||||
description: "Framework to scaffold"
|
||||
}
|
||||
},
|
||||
required: ["project_id", "app_name"]
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
// System prompt for Product OS assistant
|
||||
const SYSTEM_PROMPT = `You are Product OS, an AI assistant specialized in helping users launch and operate SaaS products on Google Cloud.
|
||||
const SYSTEM_PROMPT = `You are the AI for a software platform where every project is a Turborepo monorepo containing multiple apps: product, website, admin, and storybook. You have full visibility and control over the entire project.
|
||||
|
||||
Each project has:
|
||||
- apps/product — the core user-facing application
|
||||
- apps/website — the marketing and landing site
|
||||
- apps/admin — internal admin tooling
|
||||
- apps/storybook — component browser and design system
|
||||
- packages/ui — shared React component library
|
||||
- packages/tokens — shared design tokens (colors, spacing, typography)
|
||||
- packages/types — shared TypeScript types
|
||||
- packages/config — shared eslint and tsconfig
|
||||
|
||||
You can help with:
|
||||
- Deploying services to Cloud Run
|
||||
- Deploying any app using turbo run build --filter=<app>
|
||||
- Writing and modifying code across any app or package in the monorepo
|
||||
- Adding new apps or packages to the project
|
||||
- Analyzing product metrics and funnels
|
||||
- Generating marketing content
|
||||
- Writing and modifying code
|
||||
- Understanding what drives user behavior
|
||||
|
||||
When users ask you to do something, use the available tools to take action. Be concise and helpful.
|
||||
|
||||
If a user asks about code, analyze their request and either:
|
||||
1. Use generate_code tool for code changes
|
||||
2. Provide explanations directly
|
||||
|
||||
Always confirm before taking destructive actions like deploying to production.`;
|
||||
When a user says "deploy" without specifying an app, ask which one or default to "product".
|
||||
When a user asks to change something visual, consider whether it belongs in packages/ui or packages/tokens.
|
||||
When users ask you to do something, use the available tools to take action. Be concise and specific about which app or package you are working in.`;
|
||||
|
||||
/**
|
||||
* Chat with Gemini
|
||||
|
||||
Reference in New Issue
Block a user