(
{ skill, args },
context,
canUseTool,
parentMessage,
onProgress?,
)
| 578 | }, |
| 579 | |
| 580 | async call( |
| 581 | { skill, args }, |
| 582 | context, |
| 583 | canUseTool, |
| 584 | parentMessage, |
| 585 | onProgress?, |
| 586 | ): Promise<ToolResult<Output>> { |
| 587 | // At this point, validateInput has already confirmed: |
| 588 | // - Skill format is valid |
| 589 | // - Skill exists |
| 590 | // - Skill can be loaded |
| 591 | // - Skill doesn't have disableModelInvocation |
| 592 | // - Skill is a prompt-based skill |
| 593 | |
| 594 | // Skills are just names, with optional arguments |
| 595 | const trimmed = skill.trim() |
| 596 | |
| 597 | // Remove leading slash if present (for compatibility) |
| 598 | const commandName = trimmed.startsWith('/') ? trimmed.substring(1) : trimmed |
| 599 | |
| 600 | // Remote canonical skill execution (ant-only experimental). Intercepts |
| 601 | // `_canonical_<slug>` before local command lookup — loads SKILL.md from |
| 602 | // AKI/GCS (with local cache), injects content directly as a user message. |
| 603 | // Remote skills are declarative markdown so no slash-command expansion |
| 604 | // (no !command substitution, no $ARGUMENTS interpolation) is needed. |
| 605 | if ( |
| 606 | feature('EXPERIMENTAL_SKILL_SEARCH') && |
| 607 | process.env.USER_TYPE === 'ant' |
| 608 | ) { |
| 609 | const slug = remoteSkillModules!.stripCanonicalPrefix(commandName) |
| 610 | if (slug !== null) { |
| 611 | return executeRemoteSkill(slug, commandName, parentMessage, context) |
| 612 | } |
| 613 | } |
| 614 | |
| 615 | const commands = await getAllCommands(context) |
| 616 | const command = findCommand(commandName, commands) |
| 617 | |
| 618 | // Track skill usage for ranking |
| 619 | recordSkillUsage(commandName) |
| 620 | |
| 621 | // Check if skill should run as a forked sub-agent |
| 622 | if (command?.type === 'prompt' && command.context === 'fork') { |
| 623 | return executeForkedSkill( |
| 624 | command, |
| 625 | commandName, |
| 626 | args, |
| 627 | context, |
| 628 | canUseTool, |
| 629 | parentMessage, |
| 630 | onProgress, |
| 631 | ) |
| 632 | } |
| 633 | |
| 634 | // Process the skill with optional args |
| 635 | const { processPromptSlashCommand } = await import( |
| 636 | 'src/utils/processUserInput/processSlashCommand.js' |
| 637 | ) |
nothing calls this directly
no test coverage detected