feat: initial trend-radar skill suite v0.1.0 #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: validate-skills | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| validate: | |
| name: Validate Agent Skills frontmatter | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install skills-ref validator | |
| run: | | |
| pip install --upgrade pip | |
| # Reference validator from the Agent Skills standard repo. | |
| # See: https://github.com/agentskills/agentskills/tree/main/skills-ref | |
| pip install agentskills-ref || pip install git+https://github.com/agentskills/agentskills.git#subdirectory=skills-ref | |
| - name: Validate every skill | |
| run: | | |
| set -e | |
| failed=0 | |
| for dir in trend-monitor trend-deep-dive trend-alert viral-forge trend-report; do | |
| echo "::group::skills-ref validate ./$dir" | |
| if ! skills-ref validate "./$dir"; then | |
| echo "::error file=$dir/SKILL.md::skills-ref validation failed" | |
| failed=1 | |
| fi | |
| echo "::endgroup::" | |
| done | |
| exit $failed | |
| - name: Check relative references resolve | |
| run: | | |
| set -e | |
| missing=0 | |
| for skill_md in $(find . -name SKILL.md -not -path './.git/*'); do | |
| skill_dir=$(dirname "$skill_md") | |
| # Extract relative .md references (skip http(s) links and code fences). | |
| grep -oE '\(\.\.?/[^)[:space:]]+\.md\)|`\.\.?/[^`[:space:]]+\.md`' "$skill_md" \ | |
| | sed -E 's/[`()]//g' \ | |
| | while read -r ref; do | |
| abs="$(cd "$skill_dir" && cd "$(dirname "$ref")" 2>/dev/null && echo "$(pwd)/$(basename "$ref")")" || abs="" | |
| if [ -z "$abs" ] || [ ! -f "$abs" ]; then | |
| echo "::error file=$skill_md::broken reference $ref" | |
| missing=1 | |
| fi | |
| done | |
| done | |
| exit $missing | |
| - name: Check body length caps | |
| run: | | |
| set -e | |
| declare -A caps=( | |
| [trend-monitor]=300 | |
| [trend-deep-dive]=400 | |
| [trend-alert]=400 | |
| [viral-forge]=500 | |
| [trend-report]=350 | |
| ) | |
| over=0 | |
| for skill in "${!caps[@]}"; do | |
| cap=${caps[$skill]} | |
| file="./$skill/SKILL.md" | |
| # Body = lines after the second '---' frontmatter delimiter. | |
| body_lines=$(awk ' | |
| /^---$/ { fm++; next } | |
| fm >= 2 { print } | |
| ' "$file" | wc -l) | |
| echo "$skill: $body_lines / $cap" | |
| if [ "$body_lines" -gt "$cap" ]; then | |
| echo "::error file=$file::body has $body_lines lines, cap is $cap" | |
| over=1 | |
| fi | |
| done | |
| exit $over |