fix(orchestrator): allow reading global skill SKILL.md paths

This commit is contained in:
Hannes Rudolph 2025-12-30 16:10:55 -07:00
parent 249013522b
commit 0e9286e5c2
2 changed files with 14 additions and 2 deletions

View file

@ -192,7 +192,12 @@ export const DEFAULT_MODES: readonly ModeConfig[] = [
[
"read",
{
fileRegex: "^\\.roo\\/skills(-[a-zA-Z0-9-]+)?\\/[^\\/]+\\/SKILL\\.md$",
// Allow both workspace-relative and absolute skill paths (cross-platform).
// Examples:
// - .roo/skills/example-skill/SKILL.md
// - /Users/alice/.roo/skills/example-skill/SKILL.md
// - C:\\Users\\alice\\.roo\\skills\\example-skill\\SKILL.md
fileRegex: "(^|.*[\\\\/])\\.roo[\\\\/]skills(-[a-zA-Z0-9-]+)?[\\\\/][^\\\\/]+[\\\\/]SKILL\\.md$",
description: "Skill definition files only",
},
],

View file

@ -473,7 +473,8 @@ describe("FileRestrictionError", () => {
[
"read",
{
fileRegex: "^\\.roo\\/skills(-[a-zA-Z0-9-]+)?\\/[^\\/]+\\/SKILL\\.md$",
fileRegex:
"(^|.*[\\\\/])\\.roo[\\\\/]skills(-[a-zA-Z0-9-]+)?[\\\\/][^\\\\/]+[\\\\/]SKILL\\.md$",
description: "Skill definition files only",
},
],
@ -485,6 +486,12 @@ describe("FileRestrictionError", () => {
}),
).toBe(true)
expect(
isToolAllowedForMode("read_file", "orchestrator", [], undefined, {
files: [{ path: "/Users/test/.roo/skills/example-skill/SKILL.md" }],
}),
).toBe(true)
expect(() =>
isToolAllowedForMode("read_file", "orchestrator", [], undefined, {
files: [{ path: "src/index.ts" }],