summaryrefslogtreecommitdiff
path: root/.github/workflows
diff options
context:
space:
mode:
authorDickson Tsai <dickson@anthropic.com>2026-02-04 16:17:59 -0800
committerDickson Tsai <dickson@anthropic.com>2026-02-04 16:21:18 -0800
commit25617fd487ce043e751e78e22ac16e1f0145eb98 (patch)
tree2ea407f84fff62a06317769f3e16d4656000761b /.github/workflows
parent27d2b86d72da27c64585150857cee8472ad47abb (diff)
Add CI workflow to validate YAML frontmatter in PRsdickson/validate-frontmatter-ci
Adds a GitHub Actions workflow that validates frontmatter in agent, skill, and command .md files changed by a PR. Checks: - Agents: name and description are present and parseable - Skills: description is present (required for Skill tool discovery) - Commands: description is present and parseable The workflow only runs when PRs touch files in agents/, skills/, or commands/ directories, and only validates the changed files.
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/validate-frontmatter.yml34
1 files changed, 34 insertions, 0 deletions
diff --git a/.github/workflows/validate-frontmatter.yml b/.github/workflows/validate-frontmatter.yml
new file mode 100644
index 00000000..148364d4
--- /dev/null
+++ b/.github/workflows/validate-frontmatter.yml
@@ -0,0 +1,34 @@
+name: Validate Frontmatter
+
+on:
+ pull_request:
+ paths:
+ - '**/agents/*.md'
+ - '**/skills/*/SKILL.md'
+ - '**/commands/*.md'
+
+jobs:
+ validate:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+
+ - uses: oven-sh/setup-bun@v2
+
+ - name: Install dependencies
+ run: cd .github/scripts && bun install yaml
+
+ - name: Get changed frontmatter files
+ id: changed
+ run: |
+ FILES=$(gh pr diff ${{ github.event.pull_request.number }} --name-only | grep -E '(agents/.*\.md|skills/.*/SKILL\.md|commands/.*\.md)$' || true)
+ echo "files<<EOF" >> "$GITHUB_OUTPUT"
+ echo "$FILES" >> "$GITHUB_OUTPUT"
+ echo "EOF" >> "$GITHUB_OUTPUT"
+ env:
+ GH_TOKEN: ${{ github.token }}
+
+ - name: Validate frontmatter
+ if: steps.changed.outputs.files != ''
+ run: |
+ echo "${{ steps.changed.outputs.files }}" | xargs bun .github/scripts/validate-frontmatter.ts