feat: add a prompt and --skills flag so new projects can skip agent skill files - #96
Merged
Merged
Conversation
Every new project got skill files for Claude Code, Cursor, Codex-style
`.agents`, and Devin, a `postinstall` hook that re-syncs them on every
install, and a `skills:sync` script, with no way to decline.
Interactive runs now ask "Install agent skills for coding assistants?"
(default yes) after the package manager prompt. Non-interactive runs
take `--skills <agents>|none`, matching `prisma init --skills`.
With no agents chosen, `prisma.config.ts` records
`skills: { agents: [] }`, `prisma init` is not run (so no `postinstall`
hook and no skill directories), the `skills:sync` script is omitted, and
the Nuxt template's postinstall is `nuxt prepare` alone. With a list of
agents, the config names them and `prisma init --skills=<list>` installs
only those. `prisma-next.md` stays: it is the human quick reference
`prisma orm init` writes, not an agent file.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: Comment |
PR preview published
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
At a glance
produces a project with no agent directories and no install-time sync:
Interactive runs get one new question, after the package-manager prompt:
Answering no gives the same result as
--skills none. Answering yes, or passing nothing, gives exactly what create-prisma generated before this PR.The decision
Users can say no to agent skill files when a project is scaffolded, and saying no means the project has none of the machinery: no skill directories, no
postinstallhook, noskills:syncscript, and a config that records the choice so later tooling respects it. The default stays yes.Why now
Every project scaffolded by
create-prismagets skill files for four coding agents, apostinstallhook that re-copies them on every install, and askills:syncscript. There was no prompt and no flag to decline. One user counted over 200 files and left; five people raised it in one week. The workaround being shared in the community (skills sync --disable, or aPRISMA_DISABLE_AGENTvariable) is wrong: the first only silences a notice, the second does not exist.How the scaffold produces those files, and where this PR intervenes
create-prismabuilds a project in four steps that touch skills:prisma.config.tsfrom a template. The template hard-codedskills: { agents: ["claude", "cursor", "agents", "devin"] }.skills:sync. The Nuxt template additionally hard-codes apostinstallthat calls that script.prisma orm init, which writes the ORM files andprisma-next.md.prisma init --yes. That command adds thepostinstallhook, leaves the existing config alone, and copies the skill files into the four directories.This PR threads one value, the chosen agents list, through all four:
--skills, or from the new prompt, or defaults to all four agents under--yes/--json. Deno projects, which never got skills, always get an empty list.agents: []for "none" andagents: ["claude", "cursor"]for a subset.skills:syncwhen the list is empty, and the Nuxt postinstall collapses tonuxt prepare.prisma-next.mdis the "open this to get started" documentorm initwrites, so it stays regardless of the answer.postinstallhook and the directories, because nothing else creates them. With a subset, it becomesprisma init --yes --skills=claude,cursorso only those directories are written.--skillsaccepts a comma-separated subset ofclaude,cursor,agents,devin, ornone. A typo,nonemixed with names, or an empty list fails before anything is written, with a message naming the valid values. The README and--helplist the flag.Changing your mind later
A project scaffolded with skills can drop them by setting
agents: []inprisma.config.tsand runningprisma skills sync. Until now that sync wrote nothing and left the old copies on disk, so the opt-out looked broken. The companion PR prisma/prisma-cli#254 makes sync remove the copies for agents the config no longer names. A project scaffolded without skills can add them withnpx prisma init, which reports the config snippet to add, thenprisma skills sync.Tests
--skills noneyields no agents and never invokesprisma init;--skills cursor, claude,cursorkeeps order and drops duplicates; three invalid values fail before any command runs; the scripts writer omitsskills:syncon opt-out; templates renderagents: []andagents: ["claude", "cursor"]and the matching Nuxt postinstall; the default path passes--skills=claude,cursor,agents,devintoprisma init.create-prisma no-skills-app ... --yes --skills none --jsonyields none of the four directories, nopostinstall, noskills:sync,agents: []in the config, and keepsprisma-next.md. The existing Next.js e2e confirms the default path still writes skill files through the real CLI.bun run test:unit(65 pass),bun run typecheck,bun run lint,bun run format:check, and both e2e cases pass locally.Docs follow-up (written separately)
create-prismareference and both quickstarts: list the new prompt in the interactive sequence (name, template, database, authoring style, package manager, agent skills, deploy), document--skills <agents>|noneand what "none" leaves out, and how to add skills later (npx prisma init, editagents,prisma skills sync).cli/init: note thatcreate-prisma --skillsforwards toprisma init --skills.cli/orm-init: remove the--skip-skillsrow (see below).cli/skillsandcli/configuration:agents: []is the opt-out;prisma skills syncmakes disk match the list in both directions;skills sync --disableonly silences the staleness notice;PRISMA_DISABLE_AGENTdoes not exist.Alternatives considered
prisma orm inithonour--skillsas well. Not possible any more: since Init stops touching agent skills; the family-level prisma init owns skills setup orm#30097, bundled in the@prisma/orm-toolchainthatprisma-cliships,orm initdoes not install skills at all and its--skip-skillsflag is gone. The existing-project opt-out is alreadyprisma init --skills=none.prisma initand then delete what it wrote. Skipping the call is simpler and avoids thepostinstallhook ever being added.prisma-next.mdas an agent file and delete it on opt-out. It is written for humans andorm init's final line tells the user to open it, so it stays.prisma skills removecommand for the after-the-fact case. Makingskills syncconverge on the config covers it without a new command; see feat(cli): make skills sync remove copies for agents no longer in the config prisma-cli#254.🤖 Generated with Claude Code