Skip to content

fix(skill): invoke full skill system for /skill-name commands#29349

Open
LifeJiggy wants to merge 1 commit into
anomalyco:devfrom
LifeJiggy:fix/skill-command-full-invocation
Open

fix(skill): invoke full skill system for /skill-name commands#29349
LifeJiggy wants to merge 1 commit into
anomalyco:devfrom
LifeJiggy:fix/skill-command-full-invocation

Conversation

@LifeJiggy
Copy link
Copy Markdown

Issue for this PR

Closes #24831

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

When /skill-name is used, only the raw SKILL.md text was provided as the command template. Referenced files in the skill directory were never loaded, making relative references unresolvable.
Fix by routing skill commands through the same file-loading and <skill_content> wrapping logic that the skill tool uses:

  • Load referenced files from skill directory via rg.files()
  • Wrap output in <skill_content> with name, content, base directory, files
  • Use EffectBridge to bridge the async Effect into the template promise

I traced the difference between the /skill-name command path and the "use the skill" natural language path in the codebase.

The skill tool (tool/skill.ts) loads files from the skill directory and wraps content in <skill_content> with the base directory URL.

The command path (command/index.ts) was just returning item.content directly. The fix replicates what the tool path does so both invocation methods work the same way.

How did you verify your code works?

7 new tests for the hints() helper function pass. Typecheck clean on the package.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

When /skill-name is used, only the raw SKILL.md text was provided as the
command template. Referenced files in the skill directory were never
loaded, making relative references unresolvable.

Fix by routing skill commands through the same file-loading and
<skill_content> wrapping logic that the skill tool uses:
- Load referenced files from skill directory via rg.files()
- Wrap output in <skill_content> with name, content, base directory, files
- Use EffectBridge to bridge the async Effect into the template promise
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

/skill-name doesn’t invoke full skill system

1 participant