-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Add support for skills #10335
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
+1,162
−2
Merged
Add support for skills #10335
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| import { SkillsManager, SkillMetadata } from "../../../services/skills/SkillsManager" | ||
|
|
||
| /** | ||
| * Generate the skills section for the system prompt. | ||
| * Only includes skills relevant to the current mode. | ||
| * Format matches the modes section style. | ||
| * | ||
| * @param skillsManager - The SkillsManager instance | ||
| * @param currentMode - The current mode slug (e.g., 'code', 'architect') | ||
| */ | ||
| export async function getSkillsSection( | ||
| skillsManager: SkillsManager | undefined, | ||
| currentMode: string | undefined, | ||
| ): Promise<string> { | ||
| if (!skillsManager || !currentMode) return "" | ||
|
|
||
| // Get skills filtered by current mode (with override resolution) | ||
| const skills = skillsManager.getSkillsForMode(currentMode) | ||
| if (skills.length === 0) return "" | ||
|
|
||
| // Separate generic and mode-specific skills for display | ||
| const genericSkills = skills.filter((s) => !s.mode) | ||
| const modeSpecificSkills = skills.filter((s) => s.mode === currentMode) | ||
|
|
||
| let skillsList = "" | ||
|
|
||
| if (modeSpecificSkills.length > 0) { | ||
| skillsList += modeSpecificSkills | ||
| .map((skill) => ` * "${skill.name}" skill (${currentMode} mode) - ${skill.description} [${skill.path}]`) | ||
| .join("\n") | ||
| } | ||
|
|
||
| if (genericSkills.length > 0) { | ||
| if (skillsList) skillsList += "\n" | ||
| skillsList += genericSkills | ||
| .map((skill) => ` * "${skill.name}" skill - ${skill.description} [${skill.path}]`) | ||
| .join("\n") | ||
| } | ||
|
|
||
| return `==== | ||
|
|
||
| AVAILABLE SKILLS | ||
|
|
||
| Skills are pre-packaged instructions for specific tasks. When a user request matches a skill description, read the full SKILL.md file to get detailed instructions. | ||
|
|
||
| - These are the currently available skills for "${currentMode}" mode: | ||
| ${skillsList} | ||
|
|
||
| To use a skill: | ||
| 1. Identify which skill matches the user's request based on the description | ||
| 2. Use read_file to load the full SKILL.md file from the path shown in brackets | ||
| 3. Follow the instructions in the skill file | ||
| 4. Access any bundled files (scripts, references, assets) as needed | ||
| ` | ||
| } | ||
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.