From d7d9ed200648ff60a14644ee2d15722f916ecf40 Mon Sep 17 00:00:00 2001 From: Kenshiro Nakagawa Date: Tue, 17 Feb 2026 17:12:34 -0800 Subject: [PATCH] fix(ci): skip frontmatter validation for files nested inside skill content The detectFileType function matched any .md file under an agents/ or commands/ directory, including those nested inside skill content (e.g. plugins/foo/skills/bar/agents/). These are reference docs, not plugin agent definitions. Only validate agents/ and commands/ at the plugin root level. --- .github/scripts/validate-frontmatter.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/scripts/validate-frontmatter.ts b/.github/scripts/validate-frontmatter.ts index c406985..2aafe8f 100644 --- a/.github/scripts/validate-frontmatter.ts +++ b/.github/scripts/validate-frontmatter.ts @@ -159,10 +159,14 @@ function validateCommand( // --- File type detection --- function detectFileType(filePath: string): FileType | null { - if (filePath.includes("/agents/")) return "agent"; + // Only match agents/ and commands/ at the plugin root level, not nested + // inside skill content (e.g. plugins/foo/skills/bar/agents/ is skill content, + // not an agent definition). + const inSkillContent = /\/skills\/[^/]+\//.test(filePath); + if (filePath.includes("/agents/") && !inSkillContent) return "agent"; if (filePath.includes("/skills/") && basename(filePath) === "SKILL.md") return "skill"; - if (filePath.includes("/commands/")) return "command"; + if (filePath.includes("/commands/") && !inSkillContent) return "command"; return null; }