fix(auto-slash-command): substitute $ARGUMENTS placeholder in skill templates #765
+2
−1
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.
Summary
Problem
When a skill was invoked as
/my-skill(without arguments), the$ARGUMENTSplaceholder remained as literal text in the prompt. This caused the agent to see<user-request>$ARGUMENTS</user-request>instead of an empty user request, making it ignore the skill instructions entirely.Solution
In
formatCommandTemplate(), substitute$ARGUMENTSwith actual arguments (or empty string) before adding the content to the output. Uses function replacement to prevent$sequences in user args from being interpreted as special patterns.Test Plan
bun test src/hooks/auto-slash-command/)bun run typecheck)bun run build)Summary by cubic
Fixes $ARGUMENTS substitution in auto-slash-command skill templates to prevent the placeholder from appearing when a skill is invoked without arguments. We now replace $ARGUMENTS with the provided args or an empty string using function replacement, so the agent sees a clean prompt and follows the skill instructions.
Written for commit b7b8772. Summary will update on new commits.