feat(cli): Add argument-hint support for slash commands#3593
Merged
Conversation
- Parse argument-hint from SKILL.md and command markdown frontmatter - Propagate argumentHint through SkillCommandLoader, BundledSkillLoader, FileCommandLoader, and command-factory - Show argumentHint as inline ghost text when a slash command is fully typed but no arguments provided - Pass argumentHint as input hint in ACP session prompt descriptions - Keep argumentHint out of command suggestion labels in completion menus This allows skill/command authors to hint what arguments the command expects, improving discoverability and usability in the CLI. Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Contributor
Code Coverage Summary
CLI Package - Full Text ReportCore Package - Full Text ReportFor detailed HTML reports, please see the 'coverage-reports-22.x-ubuntu-latest' artifact from the main CI run. |
wenshao
approved these changes
Apr 26, 2026
wenshao
left a comment
Collaborator
There was a problem hiding this comment.
No issues found. LGTM! ✅ — gpt-5.5 via Qwen Code /review
wenshao
pushed a commit
that referenced
this pull request
Apr 28, 2026
Brings the branch up to date (36 commits behind). Two source-level conflicts in the skills area, both resolved by keeping additions from both sides — the new `argument-hint:` parsing from #3593 and this branch's `paths:` / `parsePathsField` work are independent features that touch the same parser entry points but do not interact: - packages/core/src/skills/skill-manager.test.ts: combined the two new branches in `mockParseYaml.mockImplementation` (one for `argument-hint:`, one for `paths:`) so both feature paths get exercised, and combined the two new `parseSkillContent` test blocks (argument-hint frontmatter + paths frontmatter variants). Other touched files (skill-manager.ts, skill-load.ts, skill-load.test.ts, types.ts) auto-merged cleanly: argumentHint extraction lives next to model/whenToUse, and the parsePathsField helper call is the last optional-field extraction before the SkillConfig is constructed. Validation after merge: - 210 skill-area tests pass (skill-manager + skill-activation + skill-load + tools/skill + coreToolScheduler). - typecheck clean. - lint clean.
xaelistic
pushed a commit
to xaelistic/qwen-code
that referenced
this pull request
Jun 7, 2026
Adds argument-hint support across the slash command pipeline. Skill and command authors specify an argument-hint field in markdown frontmatter, which renders as inline ghost text when the user has typed the command name but not yet provided arguments. Pipeline: - Skill parsing: SkillConfig.argumentHint parsed from SKILL.md frontmatter - Command loaders: propagated through SkillCommandLoader, BundledSkillLoader, FileCommandLoader, command-factory - UI: useCommandCompletion shows hint as ghost text with showCursorBeforeText layout; InputPrompt separates display text from Tab-accept text - ACP: passed as input.hint per spec - Bundled skills (batch, loop, qc-helper, review) get hints Hint is excluded from completion menu labels to keep the dropdown clean and disappears as soon as the user starts typing arguments.
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.
TLDR
Adds
argument-hintsupport across the slash command pipeline, from skill/command definition parsing to CLI UI ghost text display. Skill and command authors can now specify anargument-hintfield (e.g.,[issue-number]) in their markdown frontmatter, which is shown as inline ghost text when a user completes a slash command name but hasn't started typing arguments yet.Screenshots / Video Demo
Dive Deeper
Full-chain implementation
Core skill parsing (
packages/core/src/skills/): AddedargumentHinttoSkillConfigtype and parsing logic in bothskill-load.tsandskill-manager.ts. Parsed from theargument-hintYAML frontmatter field in SKILL.md files.CLI command loaders (
packages/cli/src/services/):SkillCommandLoaderandBundledSkillLoader: PropagateargumentHintfrom skills to slash command definitions.FileCommandLoader: Parseargument-hintfrom markdown command frontmatter and pass it through.command-factory: AddedargumentHinttoCommandDefinitioninterface andcreateSlashCommandFromDefinition.UI ghost text (
packages/cli/src/ui/):useCommandCompletion: When a slash command is fully typed (cursor at end of line) with no arguments, shows theargumentHintas inline ghost text with a cursor-before-text indicator (showCursorBeforeText: true). Once the user starts typing arguments, the hint disappears.InputPrompt: ExtendedmidInputGhostTextwithacceptTextandshowCursorBeforeTextfields. WhenshowCursorBeforeTextis true, renders a blank inverted cursor before the hint text instead of inverting the first character.ACP integration (
Session.ts): PassesargumentHintas aninputhint in prompt descriptions for external tool integrations.Completion menus (
useSlashCompletion):argumentHintis deliberately excluded from suggestion labels so it doesn't clutter the dropdown — it only appears as ghost text after command selection.Key design decisions
showCursorBeforeTextflag enables a "cursor + text" layout distinct from the existing "first-char-as-cursor" pattern used for autocomplete.Reviewer Test Plan
argument-hint: "[topic]"in the frontmatter/followed by the command name[topic]with a cursor before it[topic]in suggestion labelsinputfieldTesting Matrix
Linked issues / Bugs
No linked issues
🤖 Generated with Qwen Code