Update eng/validate-collections.mjs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Aaron Powell
2026-02-10 14:28:47 +11:00
committed by GitHub
parent 99a48a4020
commit 4ddc77bb36

View File

@@ -243,10 +243,14 @@ function validateCollectionItems(items) {
i + 1
} kind is "agent" but path doesn't end with .agent.md`;
}
if (item.kind === "hook" && !item.path.endsWith(".hook.md")) {
if (item.kind === "hook") {
const isValidHookPath =
item.path.startsWith("hooks/") && item.path.endsWith("/README.md");
if (!isValidHookPath) {
return `Item ${
i + 1
} kind is "hook" but path doesn't end with .hook.md`;
} kind is "hook" but path must be hooks/<hook>/README.md`;
}
}
// Validate agent-specific frontmatter