docs/plans/agent-native/001-init-skill-install.md
prisma initMake prisma init install the Prisma skills from prisma/skills
into the freshly scaffolded project, so agents working in that project immediately have
current, version-appropriate Prisma knowledge. Modeled on prisma-next's init skill
distribution, adapted to the stable CLI's constraints.
packages/1-framework/3-tooling/cli/src/commands/init/skill-install.ts in
prisma/prisma-next:
Shells out to the upstream skills CLI, once per skill source, fully non-interactive:
pnpm dlx skills@latest add prisma/prisma-next/skills#v<cliVersion> \
--agent cursor claude-code codex windsurf --skill '*' -y
The runner adapts to the detected package manager (npx / pnpm dlx / yarn dlx / bunx /
deno run -A npm:).
Usage skills are pinned to the CLI's own version (#v<cliVersion>); upgrade skills track main.
Installs for all four agent runtimes unconditionally; no agent detection, no prompts.
--no-skill opts out; a failed install is fatal (error code 5013).
Results land in .claude/skills/<name>/SKILL.md and .agents/skills/<name>/SKILL.md, with a
skills-lock.json at the project root.
prisma.config.ts, .env, .gitignore),
run the skill install and append the written paths to the GeneratedFiles summary.--no-skills. Follows the prisma-next precedent and the goal of
zero-configuration agent readiness. (Alternative considered: install only when an agent
environment is detected — see Open questions.)cursor claude-code codex windsurf),
defined as a constant so it can grow.skills CLI version (deviation from prisma-next's skills@latest): execute
skills@<exact-vetted-version> to keep the supply chain reviewable. Bump via Renovate.--non-interactive is combined with an environment where npx would
prompt to download, or when offline (detect by the runner's failure, same non-fatal path).prisma/skills targets a specific ORM minor (currently 7.6.x per SKILL.md metadata). Install
prisma/skills#v<matching-tag> when a tag matching the CLI's minor exists, falling back to the
default branch. This requires release automation on prisma/skills (tag per supported ORM minor);
file that ask on the skills repo as part of this task.
packages/cli/src/init/skill-install.ts (new) — the runner: package-manager detection,
pinned skills version constant, agent-runtime list, command assembly, non-fatal error
handling. Written to be reused by task 002.packages/cli/src/Init.ts — add --no-skills to the arg spec and help text; invoke the
runner after scaffolding; thread results into the summary output.packages/cli/src/init/generated-files.ts — summary lines for installed skill paths.packages/cli/src/__tests__/ — unit tests for the runner (command assembly per package
manager, opt-out, failure path); init integration test asserting --no-skills and the
default path (with the runner mocked).skill-install.ts (command shape only; the
code is not directly portable) into packages/cli/src/init/skill-install.ts.Init.ts behind --no-skills, after scaffolding, before the success message.prisma init in a clean directory produces .claude/skills/prisma-*/SKILL.md and
.agents/skills/prisma-*/SKILL.md (when the network allows) and lists them in the summary.prisma init --no-skills writes nothing agent-related and prints no skill output.skills invocation leaves init successful, with a manual-install hint..claude/ and .agents/
into every new project, including ones never touched by an agent. If that proves contentious,
the fallback design is: install by default only when an agent environment is detectable
(markers from packages/migrate/src/utils/ai-safety.ts, or presence of .claude/, .cursor/,
AGENTS.md in the target directory), otherwise print a one-line hint. Decide during review.--prompt / --vibe (the AI init path) force-enable the install even if the general
default becomes detection-gated? (Recommend: yes — that path is agent-driven by definition.).gitignore-excluded paths or commit them (recommend: commit;
skills are project documentation, and skills-lock.json records provenance).