Repository navigation
feat(sync): add --recursive for workspace packages - #2446
Merged
Merged
Conversation
With --recursive, sync also reads each workspace package declared in
pnpm-workspace.yaml or package.json workspaces (array or { packages }),
honoring ! negations. Each workspace package's declared dependencies
are resolved from the package with Node's lookup, so pnpm's per-package
node_modules and npm or Yarn hoisting both work, and its own skills
field is read like a dependency's.
Workspace dependencies count as one level further from the project
than root dependencies: a root dependency wins over a workspace one
with the same skill name, and two workspaces with different copies of
a skill tie and install neither, with an --exclude hint.
Dependencies are now always resolved with the same lookup, so a
package hoisted above the project root is found too.
antfubot
force-pushed
the
feat/sync-recursive
branch
from
October 9, 2026 06:04
d2f45ad to
eb55c37
Compare
antfu
approved these changes
Oct 9, 2026
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.
Step 9 of #2323 (RFC: Install skills from npm packages). Builds on #2445.
What changes
skills experimental_sync --recursive(-r) also reads every workspace package of the project and syncs the skills of their dependencies into the project root's agent directories.Finding workspace packages
pnpm-workspace.yaml(packages:) and frompackage.json#workspaces, in both the array form and Yarn's{ "packages": [...] }form.!negations are honored.fs.promises.glob, which expands*and**at any depth and never descends intonode_modules. It is stable and prints no warning on Node 22.20, 24 and 26, so there is no new dependency and no hand-written expander. The helper in feat: sync skills shipped by npm packages #2348 only expanded one-leveldir/*patterns and ignored negations.Resolving their dependencies
Each workspace package's declared dependencies are resolved from that package with Node's lookup: walk up
node_modulesfrom its realpath, the same asnpm:entries since step 5. This finds pnpm's per-packagenode_modulesas well as npm and Yarn hoisting to the root. A workspace package's ownskillsfield is read like a dependency's: problems in it are warnings,viais the workspace package name, and only the project root's field is strict.The root's dependencies now go through the same lookup, which also finds a package hoisted above the project root, as Node does.
Which version wins
This answers the monorepo question raised in the RFC discussion. Workspace dependencies count as one level further from the project than root dependencies:
--exclude <pkg>#<skill>.Without
--recursive, nothing changes.Tests
tests/sync.test.tsadds a--recursivegroup:--recursivenode_modulesand a!negation--excludehintskillsfield withviaThe full suite passes (959).
This PR was created with the help of an agent.