fix(opencode): preserve user request for skill slash commands - #40472
fix(opencode): preserve user request for skill slash commands#40472BrickerP wants to merge 1 commit into
Conversation
Skill slash commands were treated as command templates, so $ARGUMENTS/$N inside SKILL.md docs swallowed user args, or long skill bodies buried the request at the end. Wrap skill bodies without placeholder substitution and append a dedicated User request section. Closes anomalyco#40463
|
The following comment was made by an LLM, it may be inaccurate: Based on my search, I found some related PRs but no duplicates of PR #40472: Related PRs (not duplicates):
These are addressing related issues around skill commands but are distinct from PR #40472's specific fix about preserving user requests and preventing placeholder substitution within skill bodies. No duplicate PRs found. |
|
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
Issue for this PR
Closes #40463
Related / previously reported: #26185, #27686, #28241 (closed as dupes / stale)
Type of change
What does this PR do?
Skill slash commands (
/skill-name user request here) were registered as normal commands whosetemplateis the rawSKILL.mdbody.SessionPrompt.commandthen ran$ARGUMENTS/$Nsubstitution against that body.That caused two failure modes:
$ARGUMENTSor$1(common in examples) swallowed the real user args into those example spots.Fix: when
cmd.source === "skill", do not substitute placeholders inside the skill body. Wrap it as:Regular commands and MCP prompts keep the existing
$ARGUMENTS/$N/ append behavior.Also set skill command
hintsto["$ARGUMENTS"]so the slash UI can show that trailing input is supported.How did you verify your code works?
Result: 3 pass, 0 fail (includes new regression test that asserts
$ARGUMENTS/$1in skill docs stay literal and the user request appears under## User request).Screenshots / recordings
N/A — server-side prompt construction only.
Checklist