fix: avoid duplicate group prefix in scoped --llms output#159
Open
Ryan-Ouyang wants to merge 1 commit into
Open
fix: avoid duplicate group prefix in scoped --llms output#159Ryan-Ouyang wants to merge 1 commit into
--llms output#159Ryan-Ouyang wants to merge 1 commit into
Conversation
When `--llms`/`--llms-full` is scoped to a command group, the prefix was applied twice — once via `scopedName` and again via `collectSkillCommands`, producing signatures like `cli auth auth login` instead of `cli auth login`. Pass an empty prefix to `collectSkillCommands` in the scoped markdown paths so command names stay relative to the already-prefixed `scopedName`, matching the unscoped and JSON/YAML manifest behavior. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Problem
When
--llms/--llms-full(markdown) is scoped to a command group, the group prefix is applied twice — producing command signatures like:instead of the correct
cli auth login. This affects every group, whether built as a sub-Clior generated from an OpenAPI spec, and shows up in both--llmsand--llms-full.Root cause
In the scoped
--llmsmarkdown branches, the prefix is double-counted: it's folded intoscopedNameand passed intocollectSkillCommands, which bakes it into eachcmd.name(path = [...prefix, name]).Skill.index/Skill.generatethen render${scopedName} ${cmd.name}.The unscoped call sites (and the JSON/YAML manifest path, which doesn't prepend
scopedName) already pass[], which is why rootcli --llmsand--format jsonwere correct.Fix
Pass
[]tocollectSkillCommandsin the two scoped markdown branches so command names stay relative to the already-prefixedscopedName.Tests
Cli.test.tsscopes to subtree— it previously asserted the buggytest auth auth loginoutput (which is why this slipped through). It now assertstest auth loginplus negative assertions against the duplicated form.e2e.test.tsinline snapshots that had captured the doubled output.🤖 Generated with Claude Code