fix(skill/command): add user_message param to skill tool, fix command priority order
- BUG-20: Add optional user_message parameter to skill tool for command arguments - BUG-19: Reorder command discovery: user > project > opencode-project > opencode-global > builtin - Update AGENTS.md to reflect slashcommand removal and skill tool changes
This commit is contained in:
@@ -224,6 +224,10 @@ export function createSkillTool(options: SkillLoadOptions = {}): ToolDefinition
|
||||
},
|
||||
args: {
|
||||
name: tool.schema.string().describe("The skill or command name (e.g., 'code-review' or 'publish'). Use without leading slash for commands."),
|
||||
user_message: tool.schema
|
||||
.string()
|
||||
.optional()
|
||||
.describe("Optional arguments or context for command invocation. Example: name='publish', user_message='patch'"),
|
||||
},
|
||||
async execute(args: SkillArgs, ctx?: { agent?: string }) {
|
||||
const skills = await getSkills()
|
||||
@@ -273,7 +277,7 @@ export function createSkillTool(options: SkillLoadOptions = {}): ToolDefinition
|
||||
const matchedCommand = commands.find(c => c.name.toLowerCase() === requestedName.toLowerCase())
|
||||
|
||||
if (matchedCommand) {
|
||||
return await formatLoadedCommand(matchedCommand)
|
||||
return await formatLoadedCommand(matchedCommand, args.user_message)
|
||||
}
|
||||
|
||||
// No match found — provide helpful error with partial matches
|
||||
|
||||
@@ -5,6 +5,7 @@ import type { CommandInfo } from "../slashcommand/types"
|
||||
|
||||
export interface SkillArgs {
|
||||
name: string
|
||||
user_message?: string
|
||||
}
|
||||
|
||||
export interface SkillInfo {
|
||||
|
||||
Reference in New Issue
Block a user