Repository navigation
fix: load leading-slash skill paths and group skills in the slash menu #14201
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
Merged
Merged
Changes from all commits
Commits
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| --- | ||
| "@kilocode/cli": patch | ||
| "kilo-code": patch | ||
| --- | ||
|
|
||
| Load skills from `skills.paths` entries written with a leading slash, such as `/.github/skills`, by falling back to the project root when no such directory exists at the filesystem root. Show skills in the VS Code slash menu under their own Skills group and list a skill that shares a name with a command as `/name:skill`. |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| import path from "path" | ||
| import { Effect } from "effect" | ||
|
|
||
| // `skills.paths` entries like "/.github/skills" are almost always meant as "relative to the | ||
| // project root", but `path.isAbsolute` reads them as the filesystem root (or the current drive | ||
| // root on Windows), so discovery silently finds nothing. Keep the upstream absolute-first | ||
| // semantics, and only when that directory does not exist, fall back to the project-relative | ||
| // reading. Drive-qualified ("C:\...") and UNC ("\\server\...") paths never fall back. | ||
| export function rooted(value: string): boolean { | ||
| return /^[\\/](?![\\/])/.test(value) | ||
| } | ||
|
|
||
| export const resolve = Effect.fn("KilocodeSkillPaths.resolve")(function* ( | ||
| expanded: string, | ||
| directory: string, | ||
| isDir: (dir: string) => Effect.Effect<boolean>, | ||
| ) { | ||
| const dir = path.isAbsolute(expanded) ? expanded : path.join(directory, expanded) | ||
| if (!rooted(expanded)) return dir | ||
| if (yield* isDir(dir)) return dir | ||
| const alt = path.join(directory, expanded) | ||
| if (!(yield* isDir(alt))) return dir | ||
| yield* Effect.logInfo("skill path resolved relative to the project", { path: expanded, dir: alt }) | ||
| return alt | ||
| }) |
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.