From 0e9286e5c2d9db78744259c43809466c9cde3c9c Mon Sep 17 00:00:00 2001 From: Hannes Rudolph Date: Tue, 30 Dec 2025 16:10:55 -0700 Subject: [PATCH] fix(orchestrator): allow reading global skill SKILL.md paths --- packages/types/src/mode.ts | 7 ++++++- src/shared/__tests__/modes.spec.ts | 9 ++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/packages/types/src/mode.ts b/packages/types/src/mode.ts index 748c89b5bc..adf9cbd540 100644 --- a/packages/types/src/mode.ts +++ b/packages/types/src/mode.ts @@ -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", }, ], diff --git a/src/shared/__tests__/modes.spec.ts b/src/shared/__tests__/modes.spec.ts index c32815b0e0..726e05ace1 100644 --- a/src/shared/__tests__/modes.spec.ts +++ b/src/shared/__tests__/modes.spec.ts @@ -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" }],