diff options
| author | Kenshiro Nakagawa <kenshiro@anthropic.com> | 2026-02-17 17:12:34 -0800 |
|---|---|---|
| committer | Kenshiro Nakagawa <kenshiro@anthropic.com> | 2026-02-17 17:12:34 -0800 |
| commit | d7d9ed200648ff60a14644ee2d15722f916ecf40 (patch) | |
| tree | 2338bdef677965e97c97f387559b07c6d68bd64d /.github/scripts | |
| parent | 30975e61e36524bebc30c8e05d0b7e719db228d0 (diff) | |
fix(ci): skip frontmatter validation for files nested inside skill contentkenshiro/add-skill-creator-20260217
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.
Diffstat (limited to '.github/scripts')
| -rw-r--r-- | .github/scripts/validate-frontmatter.ts | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/.github/scripts/validate-frontmatter.ts b/.github/scripts/validate-frontmatter.ts index c4069857..2aafe8f1 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; } |
