pnpm workspace prompts help when a dependency behaves one way inside the repository and another way in a clean install. Local links, package exports and build outputs can hide mistakes until a package is published or CI starts from an empty checkout. The prompts below focus on explaining resolution, correcting dependency declarations and verifying the artifact a real consumer receives.
Capture the workspace and the failing command
Provide the pnpm version, workspace configuration, relevant manifests and the command that fails. State whether consumers import source files or built output. Include the package's export map and build script if resolution is involved. Avoid deleting the lockfile as an unexplained first step; that changes the evidence and can introduce unrelated dependency updates.
The pnpm workspace documentation explains workspace configuration and the workspace protocol. It also documents how workspace references are transformed for packaging. Use the documentation matching your installed release when applying a fix, especially if the repository deliberately pins its package manager version.
Explain why a dependency resolves where it does
Ask the agent to distinguish the package name, declared range, workspace membership and actual entry point. A TypeScript path alias can make an editor appear healthy while runtime resolution still fails. Include the environment where the error occurs so the explanation covers the right resolver rather than only the language server.
Diagnose {{resolution_error}} for {{consumer_package}} importing {{dependency}}.
Inspect workspace membership, manifests, lockfile entries, exports,
build output and TypeScript aliases. Use pnpm {{version}} conventions.
Explain the resolution path in local development and {{failing_environment}}.
Propose the smallest correction and verify it with the original command.
Do not delete the lockfile or upgrade dependencies without a reason.
Check declarations against actual use
A package may rely on a dependency that happens to exist elsewhere in the repository. Ask the agent to compare imports with manifest declarations, then decide whether a dependency is needed at runtime, during development or as a peer contract. The answer depends on how the package is consumed, not just where an import appears.
Audit dependency declarations for {{package_path}}.
Compare source imports, build scripts and generated code with package.json.
Classify missing or misplaced dependencies using {{consumer_model}}.
Explain peer dependencies and local workspace references that need review.
Make a focused proposal with a clean-install validation plan. Preserve
our intended supported consumer versions instead of widening them blindly.
Verify the package that will actually ship
A workspace test can bypass the published entry point. Ask for a packed artifact check with a small consumer outside the workspace's resolution shortcuts. Inspect included files, declarations and exports. If the package supports more than one module format, validate each promised path rather than assuming one successful import covers them all.
Check publish readiness for {{package_path}} without publishing it.
Read our release scripts, produce or inspect a local packed artifact and
list included files. Test its documented imports in {{consumer_environment}}.
Verify runtime entry points, type declarations and transformed dependency
ranges. Report files or workspace-only assumptions missing from the artifact.
Do not send a package to a registry as part of this review.
Preserve a reproducible package workflow
Record the commands that established the fix and whether they used a clean install or existing build output. Check that CI and local development use the same intended package manager release. A useful final explanation names the broken assumption and the consumer-visible result, rather than merely saying dependencies were synchronized.
Save the reviewed pnpm prompt in Kipt with variables for consumer, dependency and environment. Use the monorepo prompts when the problem concerns project boundaries or affected builds beyond package resolution.