diff --git a/eng/validate-collections.mjs b/eng/validate-collections.mjs index 914a23fa..77bb5806 100644 --- a/eng/validate-collections.mjs +++ b/eng/validate-collections.mjs @@ -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")) { - return `Item ${ - i + 1 - } kind is "hook" but path doesn't end with .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 must be hooks//README.md`; + } } // Validate agent-specific frontmatter