Phase 3: add trackReadPaths gate — skip read-path detection when disabled.

Honor skillReinject.trackReadPaths before matching read tool paths to skills.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-17 10:24:49 +07:00
parent 9cd60a2534
commit cc5ffc47bf
+12
View File
@@ -60,3 +60,15 @@ export function matchReadPathToSkill(
}
return null;
}
/** Read-path detection only when trackReadPaths is enabled (SPEC §6.2, §3). */
export function matchReadPathToSkillWhenEnabled(
path: string,
skills: readonly SkillPathMeta[],
trackReadPaths: boolean,
): SkillPathMeta | null {
if (!trackReadPaths) {
return null;
}
return matchReadPathToSkill(path, skills);
}