mirror of
https://github.com/anthropics/claude-plugins-official.git
synced 2026-02-05 09:33:07 +00:00
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.
35 lines
979 B
YAML
35 lines
979 B
YAML
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
|