create-prisma 0.11.7 → 0.12.0-pr.98.331.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -60,6 +60,7 @@ older cached version. Prisma Compute does not support Deno deployments yet.
60
60
  - `--package-manager npm|pnpm|yarn|bun|deno`
61
61
  - `--deploy` / `--no-deploy`
62
62
  - `--workspace <id-or-name>`
63
+ - `--skills <agents>|none`: agents to install skill files for, comma-separated from `claude`, `cursor`, `agents`, `devin` (default: all). `--skills none` writes no `.claude/`, `.cursor/`, `.agents/`, or `.devin/` directories, no `postinstall` hook, and no `skills:sync` script, and records `skills: { agents: [] }` in `prisma.config.ts`. Interactive runs ask instead.
63
64
  - `--yes`
64
65
  - `--force`: overwrite generated starter and Prisma files in a non-empty directory. This replaces existing Prisma config, contract, and database-client files; back up edits first. A non-empty standard `migrations` path is protected: use a new directory for a fresh starter, or continue working in the existing project with the Prisma CLI. Custom migration paths are not detected.
65
66
  - `--verbose`
package/dist/cli.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { a as ApplicationLayer } from "./json-output-Cow6mEVn.mjs";
2
+ import { a as ApplicationLayer } from "./json-output-DBA3pj0a.mjs";
3
3
  import { runCreatePrismaCli } from "./index.mjs";
4
4
  import { Effect } from "effect";
5
5
  import { NodeRuntime } from "@effect/platform-node-shared";
package/dist/index.d.mts CHANGED
@@ -41,6 +41,7 @@ declare class CommandRunner extends CommandRunner_base {
41
41
  declare const DatabaseProviderSchema: Schema.Literals<readonly ["postgres", "mongo"]>;
42
42
  declare const PackageManagerSchema: Schema.Literals<readonly ["npm", "pnpm", "yarn", "bun", "deno"]>;
43
43
  declare const AuthoringStyleSchema: Schema.Literals<readonly ["psl", "typescript"]>;
44
+ declare const AgentSkillTargetSchema: Schema.Literals<readonly ["claude", "cursor", "agents", "devin"]>;
44
45
  declare const CreateTemplateSchema: Schema.Literals<readonly ["minimal", "hono", "elysia", "nest", "next", "svelte", "astro", "nuxt", "tanstack-start"]>;
45
46
  declare const CreateCommandInputSchema: Schema.Struct<{
46
47
  readonly name: Schema.optionalKey<Schema.Trim>;
@@ -51,6 +52,7 @@ declare const CreateCommandInputSchema: Schema.Struct<{
51
52
  readonly packageManager: Schema.optionalKey<Schema.Literals<readonly ["npm", "pnpm", "yarn", "bun", "deno"]>>;
52
53
  readonly deploy: Schema.optionalKey<Schema.Boolean>;
53
54
  readonly workspace: Schema.optionalKey<Schema.decodeTo<Schema.NonEmptyString, Schema.Trim, never, never>>;
55
+ readonly skills: Schema.optionalKey<Schema.decodeTo<Schema.NonEmptyString, Schema.Trim, never, never>>;
54
56
  readonly yes: Schema.optionalKey<Schema.Boolean>;
55
57
  readonly verbose: Schema.optionalKey<Schema.Boolean>;
56
58
  readonly json: Schema.optionalKey<Schema.Boolean>;
@@ -60,7 +62,7 @@ type CreateCommandInput = typeof CreateCommandInputSchema.Type;
60
62
  //#region src/create-outcome.d.ts
61
63
  declare const CreateFailureStageSchema: Schema.Literals<readonly ["validate_input", "collect_context", "scaffold_template", "initialize_prisma", "configure_project", "install_dependencies", "initialize_agent_skills", "emit_contract", "plan_migration", "initialize_git", "authenticate", "select_workspace", "check_project_name", "build", "composer_deploy", "unknown"]>;
62
64
  type CreateFailureStage = typeof CreateFailureStageSchema.Type;
63
- declare const CreateCancellationStageSchema: Schema.Literals<readonly ["project_name", "template", "database_provider", "authoring_style", "package_manager", "deployment_intent", "select_workspace"]>;
65
+ declare const CreateCancellationStageSchema: Schema.Literals<readonly ["project_name", "template", "database_provider", "authoring_style", "package_manager", "agent_skills", "deployment_intent", "select_workspace"]>;
64
66
  type CreateCancellationStage = typeof CreateCancellationStageSchema.Type;
65
67
  //#endregion
66
68
  //#region src/result.d.ts
@@ -116,7 +118,7 @@ declare const CreateCommandFailureResultSchema: Schema.Struct<{
116
118
  readonly schemaVersion: Schema.Literal<1>;
117
119
  readonly ok: Schema.Literal<false>;
118
120
  readonly error: Schema.Struct<{
119
- readonly stage: Schema.Union<readonly [Schema.Literals<readonly ["validate_input", "collect_context", "scaffold_template", "initialize_prisma", "configure_project", "install_dependencies", "initialize_agent_skills", "emit_contract", "plan_migration", "initialize_git", "authenticate", "select_workspace", "check_project_name", "build", "composer_deploy", "unknown"]>, Schema.Literals<readonly ["project_name", "template", "database_provider", "authoring_style", "package_manager", "deployment_intent", "select_workspace"]>, Schema.Literal<"parse_arguments">]>;
121
+ readonly stage: Schema.Union<readonly [Schema.Literals<readonly ["validate_input", "collect_context", "scaffold_template", "initialize_prisma", "configure_project", "install_dependencies", "initialize_agent_skills", "emit_contract", "plan_migration", "initialize_git", "authenticate", "select_workspace", "check_project_name", "build", "composer_deploy", "unknown"]>, Schema.Literals<readonly ["project_name", "template", "database_provider", "authoring_style", "package_manager", "agent_skills", "deployment_intent", "select_workspace"]>, Schema.Literal<"parse_arguments">]>;
120
122
  readonly message: Schema.String;
121
123
  }>;
122
124
  readonly project: Schema.optionalKey<Schema.Struct<{
@@ -163,7 +165,7 @@ declare const CreateCommandResultSchema: Schema.Union<readonly [Schema.Struct<{
163
165
  readonly schemaVersion: Schema.Literal<1>;
164
166
  readonly ok: Schema.Literal<false>;
165
167
  readonly error: Schema.Struct<{
166
- readonly stage: Schema.Union<readonly [Schema.Literals<readonly ["validate_input", "collect_context", "scaffold_template", "initialize_prisma", "configure_project", "install_dependencies", "initialize_agent_skills", "emit_contract", "plan_migration", "initialize_git", "authenticate", "select_workspace", "check_project_name", "build", "composer_deploy", "unknown"]>, Schema.Literals<readonly ["project_name", "template", "database_provider", "authoring_style", "package_manager", "deployment_intent", "select_workspace"]>, Schema.Literal<"parse_arguments">]>;
168
+ readonly stage: Schema.Union<readonly [Schema.Literals<readonly ["validate_input", "collect_context", "scaffold_template", "initialize_prisma", "configure_project", "install_dependencies", "initialize_agent_skills", "emit_contract", "plan_migration", "initialize_git", "authenticate", "select_workspace", "check_project_name", "build", "composer_deploy", "unknown"]>, Schema.Literals<readonly ["project_name", "template", "database_provider", "authoring_style", "package_manager", "agent_skills", "deployment_intent", "select_workspace"]>, Schema.Literal<"parse_arguments">]>;
167
169
  readonly message: Schema.String;
168
170
  }>;
169
171
  readonly project: Schema.optionalKey<Schema.Struct<{
@@ -187,6 +189,7 @@ declare const createPrismaCommand: Command.Command<"create-prisma", {
187
189
  readonly packageManager: "npm" | "pnpm" | "yarn" | "bun" | "deno" | undefined;
188
190
  readonly deploy: boolean | undefined;
189
191
  readonly workspace: string | undefined;
192
+ readonly skills: string | undefined;
190
193
  readonly force: boolean | undefined;
191
194
  readonly yes: boolean | undefined;
192
195
  readonly verbose: boolean | undefined;
@@ -201,6 +204,7 @@ declare function createCreatePrismaCli(): Command.Command<"create-prisma", {
201
204
  readonly packageManager: "npm" | "pnpm" | "yarn" | "bun" | "deno" | undefined;
202
205
  readonly deploy: boolean | undefined;
203
206
  readonly workspace: string | undefined;
207
+ readonly skills: string | undefined;
204
208
  readonly force: boolean | undefined;
205
209
  readonly yes: boolean | undefined;
206
210
  readonly verbose: boolean | undefined;
@@ -209,4 +213,4 @@ declare function createCreatePrismaCli(): Command.Command<"create-prisma", {
209
213
  declare function runCreatePrismaCli(argv?: readonly string[]): Effect.Effect<void, never, Command.Environment | CommandRunner>;
210
214
  declare function create(input?: CreateCommandInput): Promise<void>;
211
215
  //#endregion
212
- export { AuthoringStyleSchema, CREATE_PRISMA_RESULT_SCHEMA_VERSION, type CreateCommandFailureResult, type CreateCommandFailureStage, type CreateCommandInput, CreateCommandInputSchema, type CreateCommandResult, CreateCommandResultSchema, type CreateCommandSuccessResult, type CreateNextStep, type CreateProjectResult, CreateTemplateSchema, DatabaseProviderSchema, PackageManagerSchema, create, createCreatePrismaCli, createPrismaCommand, runCreatePrismaCli };
216
+ export { AgentSkillTargetSchema, AuthoringStyleSchema, CREATE_PRISMA_RESULT_SCHEMA_VERSION, type CreateCommandFailureResult, type CreateCommandFailureStage, type CreateCommandInput, CreateCommandInputSchema, type CreateCommandResult, CreateCommandResultSchema, type CreateCommandSuccessResult, type CreateNextStep, type CreateProjectResult, CreateTemplateSchema, DatabaseProviderSchema, PackageManagerSchema, create, createCreatePrismaCli, createPrismaCommand, runCreatePrismaCli };
package/dist/index.mjs CHANGED
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
- import { _ as databaseProviderInputs, c as CreateCommandResultSchema, d as CreateCommandInputSchema, f as CreateTemplateSchema, g as createTemplates, h as authoringStyles, i as getErrorMessage, l as createCommandFailureResult, m as PackageManagerSchema, n as writeJsonResult, o as applicationRuntime, p as DatabaseProviderSchema, r as runCreateCommandEffect, s as CREATE_PRISMA_RESULT_SCHEMA_VERSION, t as isJsonOutputRequested, u as AuthoringStyleSchema, v as normalizeDatabaseProvider, y as packageManagers } from "./json-output-Cow6mEVn.mjs";
2
+ import { _ as authoringStyles, b as normalizeDatabaseProvider, c as CreateCommandResultSchema, d as AuthoringStyleSchema, f as CreateCommandInputSchema, g as agentSkillTargets, h as PackageManagerSchema, i as getErrorMessage, l as createCommandFailureResult, m as DatabaseProviderSchema, n as writeJsonResult, o as applicationRuntime, p as CreateTemplateSchema, r as runCreateCommandEffect, s as CREATE_PRISMA_RESULT_SCHEMA_VERSION, t as isJsonOutputRequested, u as AgentSkillTargetSchema, v as createTemplates, x as packageManagers, y as databaseProviderInputs } from "./json-output-DBA3pj0a.mjs";
3
3
  import { Console, Effect, Option } from "effect";
4
4
  import { Argument, CliError, Command, Flag } from "effect/unstable/cli";
5
5
 
6
6
  //#region src/index.ts
7
- const CLI_VERSION = "0.11.7";
7
+ const CLI_VERSION = "0.12.0-pr.98.331.1";
8
8
  const optionalArgument = (name, description) => Argument.string(name).pipe(Argument.withDescription(description), Argument.optional, Argument.map(Option.getOrUndefined));
9
9
  const optionalBoolean = (name, description) => Flag.boolean(name).pipe(Flag.withDescription(description), Flag.optional, Flag.map(Option.getOrUndefined));
10
10
  const optionalString = (name, description) => Flag.string(name).pipe(Flag.withDescription(description), Flag.optional, Flag.map(Option.getOrUndefined));
@@ -17,6 +17,7 @@ const createPrismaCommand = Command.make("create-prisma", {
17
17
  packageManager: Flag.choice("package-manager", packageManagers).pipe(Flag.withDescription("Package manager used for dependency installation"), Flag.optional, Flag.map(Option.getOrUndefined)),
18
18
  deploy: optionalBoolean("deploy", "Deploy the generated app to Prisma immediately"),
19
19
  workspace: optionalString("workspace", "Prisma workspace id or name to deploy into"),
20
+ skills: optionalString("skills", `Agents to install skills for, comma-separated (${agentSkillTargets.join(", ")}); 'none' installs no agent skill files`),
20
21
  force: optionalBoolean("force", "Overwrite generated starter and Prisma files; refuses a non-empty migrations path"),
21
22
  yes: optionalBoolean("yes", "Skip prompts and accept default choices"),
22
23
  verbose: optionalBoolean("verbose", "Show verbose command output during setup"),
@@ -30,6 +31,7 @@ const createPrismaCommand = Command.make("create-prisma", {
30
31
  ...options.packageManager ? { packageManager: options.packageManager } : {},
31
32
  ...options.deploy !== void 0 ? { deploy: options.deploy } : {},
32
33
  ...options.workspace ? { workspace: options.workspace } : {},
34
+ ...options.skills ? { skills: options.skills } : {},
33
35
  ...options.force !== void 0 ? { force: options.force } : {},
34
36
  ...options.yes !== void 0 ? { yes: options.yes } : {},
35
37
  ...options.verbose !== void 0 ? { verbose: options.verbose } : {},
@@ -38,13 +40,20 @@ const createPrismaCommand = Command.make("create-prisma", {
38
40
  const result = yield* runCreateCommandEffect(input);
39
41
  if (input.json) yield* writeJsonResult(result);
40
42
  if (!result.ok) yield* Effect.sync(() => void (process.exitCode = 1));
41
- })).pipe(Command.withDescription("Create a new project with Prisma setup"), Command.withExamples([{
42
- command: "create-prisma my-app",
43
- description: "Create a project interactively"
44
- }, {
45
- command: "create-prisma my-app --yes --json",
46
- description: "Create and deploy with machine-readable output"
47
- }]));
43
+ })).pipe(Command.withDescription("Create a new project with Prisma setup"), Command.withExamples([
44
+ {
45
+ command: "create-prisma my-app",
46
+ description: "Create a project interactively"
47
+ },
48
+ {
49
+ command: "create-prisma my-app --yes --json",
50
+ description: "Create and deploy with machine-readable output"
51
+ },
52
+ {
53
+ command: "create-prisma my-app --yes --skills none",
54
+ description: "Create without agent skill files or the skills-sync postinstall hook"
55
+ }
56
+ ]));
48
57
  const silentConsole = Object.assign(Object.create(console), {
49
58
  log() {},
50
59
  error() {}
@@ -71,4 +80,4 @@ function create(input = {}) {
71
80
  }
72
81
 
73
82
  //#endregion
74
- export { AuthoringStyleSchema, CREATE_PRISMA_RESULT_SCHEMA_VERSION, CreateCommandInputSchema, CreateCommandResultSchema, CreateTemplateSchema, DatabaseProviderSchema, PackageManagerSchema, create, createCreatePrismaCli, createPrismaCommand, runCreatePrismaCli };
83
+ export { AgentSkillTargetSchema, AuthoringStyleSchema, CREATE_PRISMA_RESULT_SCHEMA_VERSION, CreateCommandInputSchema, CreateCommandResultSchema, CreateTemplateSchema, DatabaseProviderSchema, PackageManagerSchema, create, createCreatePrismaCli, createPrismaCommand, runCreatePrismaCli };
@@ -66,6 +66,7 @@ const CreateCancellationStageSchema = Schema.Literals([
66
66
  "database_provider",
67
67
  "authoring_style",
68
68
  "package_manager",
69
+ "agent_skills",
69
70
  "deployment_intent",
70
71
  "select_workspace"
71
72
  ]);
@@ -115,6 +116,13 @@ const packageManagers = [
115
116
  "deno"
116
117
  ];
117
118
  const authoringStyles = ["psl", "typescript"];
119
+ const agentSkillTargets = [
120
+ "claude",
121
+ "cursor",
122
+ "agents",
123
+ "devin"
124
+ ];
125
+ const SKILLS_NONE = "none";
118
126
  const createTemplates = [
119
127
  "minimal",
120
128
  "hono",
@@ -130,6 +138,7 @@ const DatabaseProviderInputSchema = Schema.Literals(databaseProviderInputs);
130
138
  const DatabaseProviderSchema = Schema.Literals(databaseProviders);
131
139
  const PackageManagerSchema = Schema.Literals(packageManagers);
132
140
  const AuthoringStyleSchema = Schema.Literals(authoringStyles);
141
+ const AgentSkillTargetSchema = Schema.Literals(agentSkillTargets);
133
142
  const CreateTemplateSchema = Schema.Literals(createTemplates);
134
143
  const OptionalBoolean = Schema.optionalKey(Schema.Boolean);
135
144
  const OptionalTrimmedString = Schema.optionalKey(Schema.Trim);
@@ -144,7 +153,8 @@ const PrismaSetupOptionsSchema = Schema.Struct({
144
153
  authoring: Schema.optionalKey(AuthoringStyleSchema),
145
154
  packageManager: Schema.optionalKey(PackageManagerSchema),
146
155
  deploy: OptionalBoolean,
147
- workspace: OptionalNonEmptyTrimmedString
156
+ workspace: OptionalNonEmptyTrimmedString,
157
+ skills: OptionalNonEmptyTrimmedString
148
158
  });
149
159
  const PrismaSetupCommandInputSchema = Schema.Struct({
150
160
  ...CommonCommandOptionsSchema.fields,
@@ -167,6 +177,37 @@ function normalizeDatabaseProvider(value) {
167
177
  default: return value;
168
178
  }
169
179
  }
180
+ function isAgentSkillTarget(name) {
181
+ return agentSkillTargets.includes(name);
182
+ }
183
+ /** Parses `--skills`: a comma-separated list of agent names, or `none`. */
184
+ function parseAgentSkillSelection(value) {
185
+ const names = value.split(",").map((name) => name.trim()).filter((name) => name.length > 0);
186
+ const known = agentSkillTargets.join(", ");
187
+ if (names.includes(SKILLS_NONE)) return names.length === 1 ? {
188
+ ok: true,
189
+ agents: []
190
+ } : {
191
+ ok: false,
192
+ message: `--skills ${SKILLS_NONE} cannot be combined with agent names.`
193
+ };
194
+ const agents = [];
195
+ for (const name of names) {
196
+ if (!isAgentSkillTarget(name)) return {
197
+ ok: false,
198
+ message: `--skills names '${name}', which is not a known agent. Use a comma-separated list of ${known}, or ${SKILLS_NONE}.`
199
+ };
200
+ if (!agents.includes(name)) agents.push(name);
201
+ }
202
+ if (agents.length === 0) return {
203
+ ok: false,
204
+ message: `--skills was given no agent names. Use a comma-separated list of ${known}, or ${SKILLS_NONE}.`
205
+ };
206
+ return {
207
+ ok: true,
208
+ agents
209
+ };
210
+ }
170
211
 
171
212
  //#endregion
172
213
  //#region src/result.ts
@@ -310,20 +351,14 @@ const applicationRuntime = ManagedRuntime.make(ApplicationLayer);
310
351
 
311
352
  //#endregion
312
353
  //#region src/telemetry/client.ts
313
- const TELEMETRY_API_KEY = "phc_cmc85avbWyuJ2JyKdGPdv7dxXli8xLdWDBPbvIXWJfs";
354
+ const TELEMETRY_API_KEY = "";
314
355
  const TELEMETRY_HOST = "https://us.i.posthog.com";
315
356
  const TELEMETRY_CONFIG_FILE = "telemetry.json";
316
357
  const TELEMETRY_TIMEOUT_MS = 2e3;
317
358
  const AnonymousId = Schema.String.check(Schema.isUUID(4));
318
359
  const decodeAnonymousId = Schema.decodeUnknownExit(AnonymousId);
319
- const isTruthyEnvValue = (value) => [
320
- "1",
321
- "true",
322
- "yes",
323
- "on"
324
- ].includes(String(value ?? "").trim().toLowerCase());
325
360
  function shouldDisableTelemetry() {
326
- return isTruthyEnvValue(process.env.CI) || isTruthyEnvValue(process.env.GITHUB_ACTIONS) || process.env.CREATE_PRISMA_DISABLE_TELEMETRY !== void 0 || process.env.CREATE_PRISMA_TELEMETRY_DISABLED !== void 0 || process.env.DO_NOT_TRACK !== void 0;
361
+ return true;
327
362
  }
328
363
  function getTelemetryConfigDir() {
329
364
  if (process.platform === "darwin") return path.join(os.homedir(), "Library", "Application Support", "create-prisma");
@@ -346,7 +381,7 @@ const getAnonymousIdEffect = Effect.fn("Telemetry.getAnonymousId")(function* ()
346
381
  return anonymousId;
347
382
  });
348
383
  const getCommonProperties = () => ({
349
- "cli-version": "0.11.7",
384
+ "cli-version": "0.12.0-pr.98.331.1",
350
385
  "node-version": process.version,
351
386
  platform: process.platform,
352
387
  arch: process.arch
@@ -415,6 +450,7 @@ function getBaseCreateProperties(input, context) {
415
450
  "database-provider": context?.prismaSetupContext.databaseProvider ?? input.provider ?? null,
416
451
  "authoring-style": context?.prismaSetupContext.authoring ?? input.authoring ?? null,
417
452
  "package-manager": context?.prismaSetupContext.packageManager ?? input.packageManager ?? null,
453
+ "agent-skills": context ? [...context.prismaSetupContext.skillAgents] : input.skills ?? null,
418
454
  "should-deploy": context?.prismaSetupContext.shouldDeploy ?? input.deploy ?? null,
419
455
  "target-directory-state": context ? getTargetDirectoryState(context) : null
420
456
  };
@@ -730,6 +766,7 @@ function createTemplateContext(options) {
730
766
  provider: options.provider,
731
767
  authoring: options.authoring,
732
768
  packageManager: options.packageManager,
769
+ skillAgents: options.skillAgents ?? agentSkillTargets,
733
770
  tsdownEntry: tsdownEntries[options.template] ?? null
734
771
  };
735
772
  }
@@ -765,10 +802,10 @@ const scaffoldCreateTemplateEffect = Effect.fn("Templates.scaffold")(function* (
765
802
  const dependencyVersionMap = {
766
803
  "@astrojs/node": "^10.0.2",
767
804
  "@elysiajs/node": "^1.4.5",
768
- "@prisma/composer": "0.17.0",
769
- "@prisma/composer-prisma-cloud": "0.17.0",
770
- "@prisma/orm-mongo": "8.0.0-rc.8",
771
- "@prisma/orm-postgres": "8.0.0-rc.8",
805
+ "@prisma/composer": "0.19.0",
806
+ "@prisma/composer-prisma-cloud": "0.19.0",
807
+ "@prisma/orm-mongo": "8.0.0-rc.10",
808
+ "@prisma/orm-postgres": "8.0.0-rc.10",
772
809
  "@sveltejs/adapter-node": "^5.3.2",
773
810
  "@types/node": "^25.6.2",
774
811
  alchemy: "2.0.0-beta.74",
@@ -843,7 +880,7 @@ const runSetupCommand = Effect.fn("runSetupCommand")(function* (options) {
843
880
 
844
881
  //#endregion
845
882
  //#region src/tasks/install.ts
846
- function getPrismaScriptMap(packageManager) {
883
+ function getPrismaScriptMap(packageManager, skillsSync) {
847
884
  if (packageManager === "deno") {
848
885
  const prismaCommand = (needsDatabase, ...args) => [
849
886
  "deno run -A",
@@ -872,7 +909,7 @@ function getPrismaScriptMap(packageManager) {
872
909
  migrate: prismaCommand("db", "migrate"),
873
910
  "migration:status": prismaCommand("migration", "status"),
874
911
  "migration:show": prismaCommand("migration", "show"),
875
- "skills:sync": `${prismaCommand("skills", "sync")} || exit 0`
912
+ ...skillsSync ? { "skills:sync": `${prismaCommand("skills", "sync")} || exit 0` } : {}
876
913
  };
877
914
  }
878
915
  function getComposerScriptMap(packageManager) {
@@ -933,7 +970,7 @@ const addPackageDependencyEffect = Effect.fn("Dependencies.add")(function* (opts
933
970
  packageJson.scripts = sortRecord(packageJson.scripts);
934
971
  yield* writePackageJson(packageJsonPath, packageJson);
935
972
  });
936
- const writePrismaDependenciesEffect = Effect.fn("Dependencies.writePrisma")(function* (provider, packageManager, _authoring, projectDir = process.cwd()) {
973
+ const writePrismaDependenciesEffect = Effect.fn("Dependencies.writePrisma")(function* (provider, packageManager, _authoring, projectDir = process.cwd(), options = {}) {
937
974
  const dependencies = [getDbPackages(provider)];
938
975
  if (provider === "postgres" && packageManager !== "deno") dependencies.push("temporal-polyfill");
939
976
  if (provider === "mongo") dependencies.push("arktype", "mongodb");
@@ -941,7 +978,7 @@ const writePrismaDependenciesEffect = Effect.fn("Dependencies.writePrisma")(func
941
978
  yield* addPackageDependencyEffect({
942
979
  dependencies,
943
980
  devDependencies: ["@types/node", "prisma"],
944
- scripts: getPrismaScriptMap(packageManager),
981
+ scripts: getPrismaScriptMap(packageManager, options.skillsSync ?? true),
945
982
  projectDir
946
983
  });
947
984
  });
@@ -1479,11 +1516,18 @@ const runPrismaInit = Effect.fn("PrismaSetup.init")(function* (context, projectD
1479
1516
  getContractPath(context.authoring),
1480
1517
  "--skip-install"
1481
1518
  ]);
1482
- if (context.packageManager === "deno") yield* (yield* FileSystem.FileSystem).remove(path.join(projectDir, "prisma-next.md"), { force: true });
1519
+ if (context.packageManager === "deno") {
1520
+ const fs = yield* FileSystem.FileSystem;
1521
+ for (const primer of ["prisma-8.md", "prisma-next.md"]) yield* fs.remove(path.join(projectDir, primer), { force: true });
1522
+ }
1483
1523
  });
1484
1524
  const initializeAgentSkills = Effect.fn("PrismaSetup.initializeSkills")(function* (context, projectDir) {
1485
- if (context.packageManager === "deno") return;
1486
- yield* runPrismaCli(context, projectDir, ["init", "--yes"]);
1525
+ if (context.skillAgents.length === 0) return;
1526
+ yield* runPrismaCli(context, projectDir, [
1527
+ "init",
1528
+ "--yes",
1529
+ `--skills=${context.skillAgents.join(",")}`
1530
+ ]);
1487
1531
  });
1488
1532
 
1489
1533
  //#endregion
@@ -1580,6 +1624,29 @@ const promptForPackageManager = Effect.fn("Prompts.packageManager")(function* (d
1580
1624
  }
1581
1625
  return yield* decodePromptValue(PackageManagerSchema, value);
1582
1626
  });
1627
+ const promptForAgentSkills = Effect.fn("Prompts.agentSkills")(function* (output) {
1628
+ const value = yield* Effect.tryPromise(() => confirm({
1629
+ message: "Install agent skills for coding assistants (Claude Code, Cursor, Codex, Devin)?",
1630
+ initialValue: true,
1631
+ output
1632
+ }));
1633
+ if (isCancel(value)) {
1634
+ yield* Effect.sync(() => cancel("Operation cancelled.", { output }));
1635
+ return yield* new CreateCancellationError({ stage: "agent_skills" });
1636
+ }
1637
+ return value ? agentSkillTargets : [];
1638
+ });
1639
+ const resolveRequestedAgentSkills = Effect.fn("PrismaSetup.resolveSkills")(function* (value, output) {
1640
+ const selection = parseAgentSkillSelection(value);
1641
+ if (selection.ok) return selection.agents;
1642
+ yield* Effect.sync(() => cancel(selection.message, { output }));
1643
+ return yield* new CreateFailure({
1644
+ stage: "collect_context",
1645
+ reason: "invalid_input",
1646
+ message: selection.message,
1647
+ errorReported: true
1648
+ });
1649
+ });
1583
1650
  const promptForDeployment = Effect.fn("Prompts.deployment")(function* (output) {
1584
1651
  const value = yield* Effect.tryPromise(() => confirm({
1585
1652
  message: "Deploy to Prisma now?",
@@ -1595,6 +1662,7 @@ const promptForDeployment = Effect.fn("Prompts.deployment")(function* (output) {
1595
1662
  const collectPrismaSetupContextEffect = Effect.fn("PrismaSetup.collectContext")(function* (input, options = {}) {
1596
1663
  const projectDir = path.resolve(options.projectDir ?? process.cwd());
1597
1664
  const { json, output, useDefaults } = resolveExecutionSettings(input);
1665
+ const requestedSkillAgents = input.skills === void 0 ? void 0 : yield* resolveRequestedAgentSkills(input.skills, output);
1598
1666
  const databaseProvider = input.provider ?? (useDefaults ? DEFAULT_DATABASE_PROVIDER : yield* promptForDatabaseProvider(output));
1599
1667
  const authoring = input.authoring ?? (useDefaults ? DEFAULT_AUTHORING : yield* promptForAuthoringStyle(output));
1600
1668
  const detectedPackageManager = yield* detectPackageManagerEffect(projectDir);
@@ -1614,6 +1682,7 @@ const collectPrismaSetupContextEffect = Effect.fn("PrismaSetup.collectContext")(
1614
1682
  reason: "unsupported_configuration",
1615
1683
  message: "Prisma Compute does not support Deno deployments yet. Use --no-deploy."
1616
1684
  });
1685
+ const skillAgents = packageManager === "deno" ? [] : requestedSkillAgents ?? (useDefaults ? agentSkillTargets : yield* promptForAgentSkills(output));
1617
1686
  const shouldDeploy = packageManager === "deno" ? false : input.deploy ?? (json ? true : useDefaults ? false : yield* promptForDeployment(output));
1618
1687
  return {
1619
1688
  projectDir,
@@ -1623,6 +1692,7 @@ const collectPrismaSetupContextEffect = Effect.fn("PrismaSetup.collectContext")(
1623
1692
  databaseProvider,
1624
1693
  authoring,
1625
1694
  packageManager,
1695
+ skillAgents,
1626
1696
  shouldDeploy,
1627
1697
  shouldPromptForWorkspace: !useDefaults,
1628
1698
  ...input.workspace ? { workspace: input.workspace } : {}
@@ -1708,9 +1778,10 @@ const executePrismaSetupContextEffect = Effect.fn("PrismaSetup.execute")(functio
1708
1778
  template,
1709
1779
  provider: context.databaseProvider,
1710
1780
  authoring: context.authoring,
1711
- packageManager: context.packageManager
1781
+ packageManager: context.packageManager,
1782
+ skillAgents: context.skillAgents
1712
1783
  }), "configure_project", "project_configuration_failed");
1713
- yield* atCreateStage(writePrismaDependenciesEffect(context.databaseProvider, context.packageManager, context.authoring, projectDir), "configure_project", "project_configuration_failed");
1784
+ yield* atCreateStage(writePrismaDependenciesEffect(context.databaseProvider, context.packageManager, context.authoring, projectDir, { skillsSync: context.skillAgents.length > 0 }), "configure_project", "project_configuration_failed");
1714
1785
  yield* Effect.sync(() => progress?.message(`Installing dependencies with ${getInstallCommand(context.packageManager)}...`));
1715
1786
  yield* atCreateStage(installProjectDependenciesEffect(context.packageManager, projectDir, {
1716
1787
  verbose: context.verbose,
@@ -1725,7 +1796,8 @@ const executePrismaSetupContextEffect = Effect.fn("PrismaSetup.execute")(functio
1725
1796
  template,
1726
1797
  provider: context.databaseProvider,
1727
1798
  authoring: context.authoring,
1728
- packageManager: context.packageManager
1799
+ packageManager: context.packageManager,
1800
+ skillAgents: context.skillAgents
1729
1801
  });
1730
1802
  yield* ensureComposerTypeScriptOptions(projectDir);
1731
1803
  if (context.databaseProvider === "mongo") yield* ensureMongoEnvironment(projectDir);
@@ -1734,8 +1806,10 @@ const executePrismaSetupContextEffect = Effect.fn("PrismaSetup.execute")(functio
1734
1806
  yield* ensureGitignoreEntry(projectDir, "/.prisma-composer");
1735
1807
  }
1736
1808
  }), "configure_project", "project_configuration_failed");
1737
- yield* Effect.sync(() => progress?.message("Installing Prisma agent skills..."));
1738
- yield* atCreateStage(initializeAgentSkills(context, projectDir), "initialize_agent_skills", "agent_skills_init_failed");
1809
+ if (context.skillAgents.length > 0) {
1810
+ yield* Effect.sync(() => progress?.message("Installing Prisma agent skills..."));
1811
+ yield* atCreateStage(initializeAgentSkills(context, projectDir), "initialize_agent_skills", "agent_skills_init_failed");
1812
+ }
1739
1813
  yield* Effect.sync(() => progress?.message("Generating Prisma 8 contract artifacts..."));
1740
1814
  yield* atCreateStage(runPrismaCli(context, projectDir, ["contract", "emit"]), "emit_contract", "contract_emit_failed");
1741
1815
  if (context.databaseProvider === "postgres") {
@@ -2028,7 +2102,8 @@ const executeCreateContext = Effect.fn("Create.execute")(function* (context) {
2028
2102
  template: context.template,
2029
2103
  provider: context.prismaSetupContext.databaseProvider,
2030
2104
  authoring: context.prismaSetupContext.authoring,
2031
- packageManager: context.prismaSetupContext.packageManager
2105
+ packageManager: context.prismaSetupContext.packageManager,
2106
+ skillAgents: context.prismaSetupContext.skillAgents
2032
2107
  }).pipe(Effect.andThen(writeCreateTemplateDependenciesEffect({
2033
2108
  template: context.template,
2034
2109
  packageManager: context.prismaSetupContext.packageManager,
@@ -2156,4 +2231,4 @@ function isJsonOutputRequested(argv) {
2156
2231
  const writeJsonResult = Effect.fn("JsonOutput.write")((result) => Effect.sync(() => process.stdout.write(`${JSON.stringify(result)}\n`)));
2157
2232
 
2158
2233
  //#endregion
2159
- export { databaseProviderInputs as _, ApplicationLayer as a, CreateCommandResultSchema as c, CreateCommandInputSchema as d, CreateTemplateSchema as f, createTemplates as g, authoringStyles as h, getErrorMessage as i, createCommandFailureResult as l, PackageManagerSchema as m, writeJsonResult as n, applicationRuntime as o, DatabaseProviderSchema as p, runCreateCommandEffect as r, CREATE_PRISMA_RESULT_SCHEMA_VERSION as s, isJsonOutputRequested as t, AuthoringStyleSchema as u, normalizeDatabaseProvider as v, packageManagers as y };
2234
+ export { authoringStyles as _, ApplicationLayer as a, normalizeDatabaseProvider as b, CreateCommandResultSchema as c, AuthoringStyleSchema as d, CreateCommandInputSchema as f, agentSkillTargets as g, PackageManagerSchema as h, getErrorMessage as i, createCommandFailureResult as l, DatabaseProviderSchema as m, writeJsonResult as n, applicationRuntime as o, CreateTemplateSchema as p, runCreateCommandEffect as r, CREATE_PRISMA_RESULT_SCHEMA_VERSION as s, isJsonOutputRequested as t, AgentSkillTargetSchema as u, createTemplates as v, packageManagers as x, databaseProviderInputs as y };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-prisma",
3
- "version": "0.11.7",
3
+ "version": "0.12.0-pr.98.331.1",
4
4
  "private": false,
5
5
  "description": "Create Prisma 8 projects with first-party templates and great DX.",
6
6
  "homepage": "https://github.com/prisma/create-prisma",
@@ -20,7 +20,7 @@ import { defineConfig as ormConfig } from "@prisma/orm-{{#if (eq provider "postg
20
20
 
21
21
  export default definePrismaConfig({
22
22
  skills: {
23
- agents: ["claude", "cursor", "agents", "devin"],
23
+ agents: [{{#each skillAgents}}"{{this}}"{{#unless @last}}, {{/unless}}{{/each}}],
24
24
  },
25
25
  orm: ormConfig({
26
26
  contract: "./src/prisma/contract{{#if (eq authoring "typescript")}}.ts{{else}}.prisma{{/if}}",
@@ -11,7 +11,7 @@
11
11
  "dev": "nuxt dev",
12
12
  "generate": "nuxt generate",
13
13
  "preview": "nuxt preview",
14
- "postinstall": "nuxt prepare && {{runScriptCommand packageManager "skills:sync"}}",
14
+ "postinstall": "nuxt prepare{{#if skillAgents.length}} && {{runScriptCommand packageManager "skills:sync"}}{{/if}}",
15
15
  "typecheck": "nuxt typecheck"
16
16
  },
17
17
  "dependencies": {