Guide models to pass positional script arguments as a string array - #88
Merged
Merged
Conversation
The skills system prompt only showed the JSON-object form for script arguments, so models leaned toward it even for file-based scripts that document CLI-style positional arguments — a shape the args schema and the runner have accepted all along. The guidance now scopes the object form to named arguments (inline scripts included) and adds the string-array form for positional ones, matching the wording the Python implementation adopted. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the default skills system-prompt guidance so models correctly choose between the two supported run_skill_script argument shapes (JSON object for named args vs string array for CLI-style positional args), and adds a regression test to lock in the wording behavior.
Changes:
- Refined
SCRIPT_INSTRUCTIONSto explicitly scope the JSON-object form to named arguments (including inline scripts). - Added guidance/example for file-based scripts that document positional CLI arguments via
args: string[]. - Added a prompt test asserting both guidance lines are present in the default prompt.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/core/src/skills/provider.ts | Updates script-argument guidance in the default skills prompt. |
| packages/core/src/skills/provider.test.ts | Adds a regression test ensuring the prompt distinguishes the two args shapes. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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
The skills system prompt's script guidance only showed the JSON-object argument form:
The
run_skill_scripttool schema and the script runner have accepted a string array for CLI-style positional arguments all along (args: ["input.docx", "--output", "result.idx"]), but models read the prompt before the tool schema, so they leaned toward the object form even for file-based scripts that document positional arguments.Change
Prompt wording only — no API or runtime change. The guidance now matches what the Python implementation adopted in microsoft/agent-framework#7695:
A prompt test mirroring the upstream one asserts both shapes are distinguished in the default prompt.
Verification
pnpm checkpasses (exit code verified).🤖 Generated with Claude Code