fix: scope suit inject to named components; add --skill/--hook#74
Merged
Conversation
suit inject --accessory X over-emitted the ENTIRE wardrobe (108 skills + all hooks/agents) into the target home, not just X's declared components. Root cause: with no outfit effectiveCategories is null so nothing is dropped, and emitForTarget only filters skills by the drop-set — every non-skill component emitted unconditionally. Fix: thread an optional restrictTo keep-set (<type>:<name> keys) through composeBundle into emitForTarget. When present, a component is emitted ONLY if named in the keep-set; when absent, suit up/prepare behave exactly as before. inject computes the keep-set from the accessory's include block (--accessory/--bundle) or the single component (--skill/ --hook), validated against the catalog. - add --skill <name> / --hook <name> (inject one bare component); exactly one of --accessory/--bundle/--skill/--hook required (exit 2 otherwise) - unknown component name -> exit 1 with a clear message - lockfile provenance label qualifies bare components (skill:<name>) Verified: inject --accessory philosophy now emits 6 skills + 1 agent (was 108 skills), --skill ousterhout emits exactly ousterhout. 629 tests pass.
This was referenced May 25, 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.
Increment 3 of
suit inject(follows #66, #73). Fixes a real over-emission bug and adds the--skill/--hooksugar — they share one mechanism.The bug
suit inject --accessory philosophymaterialized the entire wardrobe — 108 skills + all hooks/agents — into the target home, not just philosophy's 6 declared skills + 1 agent. Root cause: inject composes with no outfit, soeffectiveCategoriesis null andcomputeSkillsDropdrops nothing;emitForTargetonly filters skills by the drop-set and emits every non-skill component unconditionally. Nothing scoped the output.The fix (+ feature)
Thread an optional
restrictTokeep-set (<type>:<name>keys) throughcomposeBundle→emitForTarget. When present, a component is emitted only if it's named in the keep-set; when absent,suit up/suit preparebehave exactly as before (verified — they pass nothing). All post-processing (dedupe, additive marker-wrap, redirects) is preserved, sooff-cleanup + idempotency keep working.suit injectcomputes the keep-set from:--accessory/--bundle X→ X'sincludeblock (skills/rules/hooks/agents/commands).--skill X/--hook X(new) → the single component.Exactly one of
--accessory/--bundle/--skill/--hookis required (exit 2); unknown component → exit 1 with a clear message; lockfile provenance label qualifies bare components (skill:<name>).Verification
npm run typecheck,npm run build,npm test→ 629 tests pass (+ bug-regression, --skill, --hook, exactly-one-kind ×2, not-found).inject --accessory philosophy→ 6 skills + architect-review agent (was 108 skills);golang-patterns/publish-to-npmabsent.--skill ousterhout→ exactly ousterhout (tigerstyle absent). Exit codes: no-kind 2, two-kind 2, not-found 1.Note
This corrects behavior shipped in #66 (increment 1). Reload still aggregates to
restart-requiredwhenever the target set includes codex/gemini/pi (unchanged).Next (deferred)
NATS
--targetdiscovery (#68), reload emit-side (#69), reload-verb research (#70), docs (#72).