Skip to content

Commit ce8d644

Browse files
fix(cursor): discover built-in skills in the composer (pingdotgg#24595)
Co-authored-by: Claude Opus 5.5 <[email protected]>
1 parent 7769d70 commit ce8d644

2 files changed

Lines changed: 19 additions & 3 deletions

File tree

‎packages/provider-cursor/src/server/skills.test.ts‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const runNode = <A, E>(
1919
) => effect.pipe(Effect.scoped, Effect.provide(NodeServices.layer), Effect.runPromise);
2020

2121
describe("Cursor skills", () => {
22-
it("discovers recursive project skills with project precedence", async () =>
22+
it("discovers project, user, then built-in skills by precedence", async () =>
2323
await runNode(
2424
Effect.gen(function* () {
2525
const fileSystem = yield* FileSystem.FileSystem;
@@ -66,6 +66,10 @@ describe("Cursor skills", () => {
6666
"oversized",
6767
"x".repeat(1_000_001),
6868
);
69+
const builtinRoot = path.join(userHome, ".cursor", "skills-cursor");
70+
yield* writeSkill(builtinRoot, "loop", "---\ndescription: builtin loop\n---\n");
71+
yield* writeSkill(builtinRoot, "review", "---\ndescription: builtin review\n---\n");
72+
yield* writeSkill(builtinRoot, "ide-only", "---\nmetadata:\n surfaces:\n - ide\n---\n");
6973
yield* fileSystem.makeDirectory(path.join(userHome, ".codex"), { recursive: true });
7074
yield* fileSystem.writeFileString(
7175
path.join(userHome, ".codex", "skills"),
@@ -81,6 +85,13 @@ describe("Cursor skills", () => {
8185
enabled: true,
8286
userInvocable: false,
8387
},
88+
{
89+
name: "loop",
90+
description: "builtin loop",
91+
path: path.join(builtinRoot, "loop", "SKILL.md"),
92+
scope: "system",
93+
enabled: true,
94+
},
8495
{
8596
name: "oversized",
8697
path: path.join(workspace, ".cursor", "skills", "oversized", "SKILL.md"),

‎packages/provider-cursor/src/server/skills.ts‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ function parseSkillFrontmatter(contents: string): CursorSkillFrontmatter | undef
125125

126126
const discoverSkillsInRoot = Effect.fn("discoverCursorSkillsInRoot")(function* (input: {
127127
readonly directory: string;
128-
readonly scope: "user" | "project";
128+
readonly scope: "user" | "project" | "system";
129129
readonly budget: CursorSkillScanBudget;
130130
/** Real paths of the roots already walked in this scan. */
131131
readonly scannedRoots: Set<string>;
@@ -232,7 +232,12 @@ const inspectCursorSkills = Effect.fn("inspectCursorSkills")(function* (
232232
{ directory: path.join(base, ".codex", "skills"), scope },
233233
{ directory: path.join(base, ".claude", "skills"), scope },
234234
];
235-
const roots = [...(cwd ? rootsBelow(cwd, "project") : []), ...rootsBelow(userHome, "user")];
235+
const roots = [
236+
...(cwd ? rootsBelow(cwd, "project") : []),
237+
...rootsBelow(userHome, "user"),
238+
// Cursor syncs its built-in skills here; same-named user and project skills win.
239+
{ directory: path.join(userHome, ".cursor", "skills-cursor"), scope: "system" as const },
240+
];
236241

237242
const skillsByName = new Map<string, ServerProviderSkill>();
238243
const budget: CursorSkillScanBudget = {

0 commit comments

Comments
 (0)