Problem
resolveClosure (packages/agents/src/lib/dependency-resolver.ts) follows only dependencies: and members: edges. A subagent's top-level skills: field — the runtime injection list telling the harness which skills to load into the subagent's context — is invisible to it. A skill named only in skills: is injected at runtime but never pulled into the set of files sync deploys, so a selectively-synced subagent can reference a skill that was never materialized.
Context
The @library collection masks the gap: it resolves to every skill, so sync --global deploys them all. The gap bites a project that selectively deploys a subagent via repo sync without that skill otherwise in its closure. All 10 shipped subagents that declare skills: omit a matching dependencies: edge, so the "declare it in two places" workaround is reliably missed. Surfaced while reviewing #880, where the authoring-guidance rulebook documents that workaround.
Proposed solution
Union a subagent's top-level skills: into its skill edges in resolveClosure — not retrofit a dependencies: edge onto each subagent, which the 10/10 omission rate shows authors won't maintain. The resolver's existing visit bookkeeping carries dedup and cycle-safety, so a skill named in both skills: and dependencies: resolves once. An injected skill absent from the library fails sync closed, the same as any other missing edge.
Acceptance criteria
Must have
Should have
Problem
resolveClosure(packages/agents/src/lib/dependency-resolver.ts) follows onlydependencies:andmembers:edges. A subagent's top-levelskills:field — the runtime injection list telling the harness which skills to load into the subagent's context — is invisible to it. A skill named only inskills:is injected at runtime but never pulled into the set of filessyncdeploys, so a selectively-synced subagent can reference a skill that was never materialized.Context
The
@librarycollection masks the gap: it resolves to every skill, sosync --globaldeploys them all. The gap bites a project that selectively deploys a subagent via reposyncwithout that skill otherwise in its closure. All 10 shipped subagents that declareskills:omit a matchingdependencies:edge, so the "declare it in two places" workaround is reliably missed. Surfaced while reviewing #880, where theauthoring-guidancerulebook documents that workaround.Proposed solution
Union a subagent's top-level
skills:into its skill edges inresolveClosure— not retrofit adependencies:edge onto each subagent, which the 10/10 omission rate shows authors won't maintain. The resolver's existing visit bookkeeping carries dedup and cycle-safety, so a skill named in bothskills:anddependencies:resolves once. An injected skill absent from the library failssyncclosed, the same as any other missing edge.Acceptance criteria
Must have
resolveClosureunions a subagent's top-levelskills:field into its skill edges, so injected skills enter the deployment closure without a separatedependencies:declaration.syncmaterializes its injected skills even when they are not otherwise in the closure.Should have
authoring-guidancerulebook no longer presents an injectedskills:entry as needing a paireddependencies:edge — both the "Declaring dependencies" section opener and the subagent frontmatter bullet are corrected.