Skip to content

docs(skills): in a workspace, the skills postinstall goes in the root package.json, not a workspace package's - #484

Merged
wmadden-electric merged 5 commits into
mainfrom
docs/skills-sync-at-workspace-root
Dec 3, 2026
Merged

wmadden-electric merged 5 commits into
mainfrom
docs/skills-sync-at-workspace-root

Conversation

@wmadden-electric

@wmadden-electric wmadden-electric commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

In a monorepo, Composer's docs lead every user to a prisma warning on every install. This pull request tells them to put the prisma skills sync postinstall hook in the workspace root's package.json instead of a workspace package's.

What goes wrong today

The README, the getting-started guide and the skill's README all say to add "postinstall": "prisma skills sync || exit 0" to "your package.json". In a monorepo, a reader puts it in the workspace package that uses Composer. prisma/asks did exactly that, in deploy/package.json.

Since prisma 8.0.0-rc.38 (prisma/prisma-cli#425), the skill copies live at the workspace root, and a sync from any workspace package writes them there. Since rc.39, prisma prints SKILLS.MEMBER_LEFTOVER on every install that runs the hook in a workspace package. Several such hooks run at the same time, all writing the root's copies, and one can leave another's copy missing a file until the next version change.

The change

The getting-started guide and the skill's README gain this paragraph after the postinstall example:

In a monorepo (a pnpm, npm or Yarn workspace), put the hook in the package.json at the workspace root (the directory with pnpm-workspace.yaml, or the package.json that lists workspaces), not in a workspace package's: hooks in several packages run at the same time and can leave the skill copy at the root missing a file. The root's sync installs the skills of every workspace package. List prisma there as a dev dependency, at the version your packages use, so the root's hook can find the command. If prisma warns with SKILLS.MEMBER_LEFTOVER, a workspace package still has something an earlier prisma put there: move the hook to the root, and delete the other files the warning names, such as old skill copies.

The README gains one sentence pointing to the getting-started guide. A single-package app is unaffected: its own package.json is the root.

The dev dependency matters with pnpm, which puts only the root's own dependencies on the root hook's path. Without it, || exit 0 turns "command not found" into a silent no-op.

The prisma CLI does not change; the session that maintains it agreed that Composer's docs are what is out of step. No other Composer page puts a skills section in a workspace package's prisma.config.ts, which the CLI also ignores now, so nothing else changes.

A drive code review (system design and code) found three wording problems, fixed here: "workspace" alone could mean a Prisma Cloud workspace, the reason came last, and the advice for the warning covered only the hook.

Docs only; no release needed.

Agent: herodotus-23

🤖 Generated with Claude Code

… package.json, not a member's

Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
… and shorten the README's note

Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
@wmadden-electric
wmadden-electric requested a review from a team as a code owner December 3, 2026 02:30
@prisma-gizmo

prisma-gizmo Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

Caution

Gizmo failed to process the last GitHub event for this pull request: This suspended workflow run was already resumed by another caller. Workflow "guardrail-lifecycle" run "38f05bb7-8949-4cd3-9021-0494811ad25d" moved from "suspended" to "running" before this resume could claim it. Only one resume() call may continue a given suspension; re-read the run state before resuming again.

Open findings: 🟡 1 minor

Change walkthrough

This is a docs-only change that tells users of Composer to put the prisma skills sync postinstall hook in the workspace root's package.json rather than a workspace package's, in monorepos. Since prisma 8.0.0-rc.38 the CLI writes skill copies at the workspace root, so a hook inside a member package both races with other members' hooks and triggers the SKILLS.MEMBER_LEFTOVER warning on every install.

Getting-started guide and skill README (docs/guides/getting-started.md:80, skills/README.md:40). The pre-existing monorepo paragraph is reworded as one sentence chain: it now says "monorepo (a pnpm, npm or Yarn workspace)" to rule out the Prisma Cloud meaning of "workspace", states the concurrency hazard immediately after the instruction instead of at the end, and expands the SKILLS.MEMBER_LEFTOVER remedy to cover both the misplaced hook and the leftover files the warning names. The same paragraph is duplicated verbatim in the two files and kept in step, matching how they read before this PR.

Root README (README.md:38). The "In a workspace" phrasing becomes "In a monorepo, the hook goes in the workspace root's package.json", and the paragraph is joined to one line per the repo's markdown convention. The link to the getting-started guide's #1-project-setup anchor resolves against the head tree.

Deferred record (.drive/deferred.md:379). A new deferred entry notes that the auth module README's Composer 0.34.0 upgrade note still says to run prisma skills sync "from the app's root" and then node .agents/skills/prisma-8/..., which breaks under rc.38+ in a monorepo because the copy lands at the workspace root. I verified the claim against packages/1-prisma-cloud/2-shared-modules/auth/README.md:251 — it matches — so deferring the wording fix there with a recorded origin follows the repo's practice of recording known gaps in the project's deferred.md rather than expanding this docs PR's scope.

No behavior changes; the CLI, scripts, and examples are untouched.

@coderabbitai

coderabbitai Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: a0114f67-4e87-4dbe-8db8-f41bdc3dabdb
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@prisma-gizmo prisma-gizmo Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New findings: none · trace

@prisma-gizmo prisma-gizmo Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No Gizmo finding is open and the head commit has been reviewed. Approving.

…ftover the warning names

Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>

@prisma-gizmo prisma-gizmo Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New findings: 🟡 1 minor · trace

Comment thread .drive/deferred.md Resolved
Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
@wmadden-electric
wmadden-electric merged commit 6b8ee36 into main Dec 3, 2026
17 checks passed
@wmadden-electric
wmadden-electric deleted the docs/skills-sync-at-workspace-root branch December 3, 2026 03:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants