projects/agent-native/spec.md
An AI agent operating Prisma succeeds by default — it works from current, version-matched knowledge instead of stale training data, cannot destroy user data without a relayed human decision, and is never silently betrayed by the API's sharp edges. This keeps agent-driven projects (an ever-growing share of new Prisma adoption) choosing Prisma and staying, rather than churning after avoidable first-hour failures.
Today an agent scaffolding a Prisma 7 app puts the database URL in the schema, expects .env
auto-loading, writes queries against a stale generated client, passes connection_limit in a
URL the driver adapter ignores, and — worst — runs
deleteMany({ where: { id: maybeUndefined } }), which silently deletes every row.
After this project, the same session looks like:
prisma init leaves .claude/skills/prisma-*/ and .agents/skills/prisma-*/ in the
project — the prisma/skills catalog, installed for the
four major agent runtimes; existing projects get one polite, TTY-gated, 30-second offer on
prisma generate (never in CI, containers, or hooks).migrate reset invoked by an agent halts at the AI safety checkpoint and relays a consent
request to the human — including when reached through prisma mcp.typedSql — the recommended escape hatch for several pitfalls — is discoverable instead of
hidden.Drafted task-level detail: docs/plans/agent-native/ (000 index + tasks 001–010, commit
f462cb0a8).
skills CLI
(agentskills.io), exactly as prisma-next does.prisma mcp functionality; only the safety-checkpoint interplay audit is in scope.OR: [], vacuous every) — breaking;
documented with engine citations instead.llms.txt, agent-readable error pages) — different repo; listed as future
ideas in the draft index.typedSql — this project only makes it visible (hidden → active).npx skills add prisma/skills. Six of the ten tasks land there. Needs release tagging per
supported ORM minor (ask filed as part of task 001).init skill distribution
(skill-install.ts) defines the command shape this project adapts (with deviations:
non-fatal failure, pinned skills version).typedSql classification lives in psl/psl-core/src/common/preview_features.rs,
shipped here via a @prisma/prisma-schema-wasm bump.@prisma/cli, platform/Compute CLI) — not modified; the
disambiguation reference (task 010) documents the boundary.packages/cli/src/utils/nps/survey.ts — TTY/CI/container gating, 30 s timeout,
config-dir persistence), prisma init (packages/cli/src/Init.ts), prisma generate
(packages/cli/src/Generate.ts), prisma mcp (packages/cli/src/mcp/MCP.ts), the AI
safety checkpoint (packages/migrate/src/utils/ai-safety.ts,
PR #29684 in review), and the PostHog
capture path (packages/cli/src/utils/nps/capture.ts).init or generate.npx-style invocation of the skills CLI uses an
exact vetted version, at every intermediate state, from the first slice that shells out.init and generate fully functional with the new
behavior either complete or dark — no half-wired prompts or dangling flags in a release.npx skills add prisma/skills)
at every intermediate state; content tasks must not gate on distribution tasks.Team-DoD floor: drive/calibration/dod.md does not exist in this repo yet (drive context was
bootstrapped with this project); the standard implicit floor applies — CI green, review
approved, no known regressions. Project-specific conditions:
prisma init on a clean directory produces skill files for all four agent runtimes;
prisma init --no-skills produces none; a simulated install failure leaves init
successful with a manual-install hint. Verified by CLI tests and one manual run.prisma mcp
migrate-reset tool with consent instructions intact.typedSql among valid options
(autocomplete + error message), via the bumped schema Wasm.plan.md: long-lived docs migrated to docs/, references stripped,
projects/agent-native/ deleted.--no-skills (prisma-next precedent, operator's stated
intent); revisit only on review pushback about writing .claude//.agents/ into
agent-free projects..claude-plugin/ marketplace manifest
inside prisma/skills, keeping one repo in sync with ORM releases.docs/plans/agent-native/
stays the detailed task reference during execution; project-level truth lives in
projects/agent-native/; close-out migrates what proves long-lived../plan.md; design notes: ./design-notes.mddocs/plans/agent-native/000-agent-native-index.md + tasks 001–010query-compiler/core/src/query_graph_builder/extractors/filters/mod.rs;
connector-test-kit filters.rs (empty_and/empty_or/empty_not), extended_relation_filters.rs, self_relation.rs