Phase 14: build reinject blocks from tracked paths — loose skill disk fallback

buildReinjectBlocks uses tracked filePath/baseDir when resourceLoader has no entry and requireRegistered is false, completing defer-path B-002 injection.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-17 17:34:43 +07:00
parent e63041bfc5
commit ebc169c91f
2 changed files with 29 additions and 7 deletions
+13 -6
View File
@@ -179,11 +179,18 @@ export function buildReinjectBlocks(
continue;
}
const registered = registeredByName.get(name);
const filePath = registered?.filePath ?? tracked.filePath;
const baseDir = registered?.baseDir ?? tracked.baseDir;
if (!registered) {
notifySkippedSkill(ctx, name, "no longer registered");
continue;
}
if (!existsSync(registered.filePath)) {
if (settings.requireRegistered) {
notifySkippedSkill(ctx, name, "no longer registered");
continue;
}
if (!existsSync(tracked.filePath)) {
notifySkippedSkill(ctx, name, "SKILL.md not found on disk");
continue;
}
} else if (!existsSync(filePath)) {
notifySkippedSkill(ctx, name, "SKILL.md not found on disk");
continue;
}
@@ -192,8 +199,8 @@ export function buildReinjectBlocks(
expandSkill(
{
name: tracked.name,
filePath: registered.filePath,
baseDir: registered.baseDir,
filePath,
baseDir,
},
settings.suffix,
),