rename: repo slug -> tinted-ui-tokens-skills (consistent 'skills' suf… #4
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 Skill | |
| # Runs whenever the skill definition or its engine changes, plus on PRs and | |
| # manual dispatch. Cheap (Python stdlib only, ~15s). | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'SKILL.md' | |
| - 'INSTRUCTIONS.md' | |
| - 'scripts/**' | |
| - 'agents/**' | |
| - '.github/workflows/validate.yml' | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| jobs: | |
| validate: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Validate SKILL.md frontmatter | |
| # Equivalent to WorkBuddy's `package_skill.py` validation: | |
| # required fields, hyphen-case name, no angle brackets in description. | |
| run: python scripts/validate_skill.py . | |
| - name: Smoke test — generate tokens for cool / warm / balanced brands | |
| run: | | |
| set -e | |
| GEN="scripts/generate_tokens.py" | |
| for hex in "#2563EB" "#C4502A" "#16A34A"; do | |
| tag="${hex//\#/}" | |
| out="out-${tag}" | |
| python "$GEN" --brand "$hex" --name "CI $hex" --out "$out" | |
| test -s "${out}/tokens.css" || { echo "tokens.css missing/empty for $hex"; exit 1; } | |
| test -s "${out}/preview.html" || { echo "preview.html missing/empty for $hex"; exit 1; } | |
| echo "OK $hex -> tokens.css ($(wc -c < "${out}/tokens.css") bytes), preview.html ($(wc -c < "${out}/preview.html") bytes)" | |
| done | |
| - name: Sanity check — semantic colors are distinct and error is reddish | |
| # Guards against the HSL->RGB channel-mapping regression we hit earlier, | |
| # where a blue brand produced a blue "error" color. | |
| run: | | |
| python - <<'PY' | |
| import re | |
| from pathlib import Path | |
| css = Path("out-2563EB/tokens.css").read_text(encoding="utf-8") | |
| def grab(var): | |
| m = re.search(rf'--color-{var}:\s*(#[0-9a-fA-F]+)', css) | |
| assert m, f"--color-{var} not found in tokens.css" | |
| return m.group(1) | |
| err, warn, succ = grab("error"), grab("warning"), grab("success") | |
| assert len({err.lower(), warn.lower(), succ.lower()}) == 3, \ | |
| f"semantic colors collapsed: error={err} warning={warn} success={succ}" | |
| r, g, b = int(err[1:3], 16), int(err[3:5], 16), int(err[5:7], 16) | |
| assert r > g and r > b, \ | |
| f"error color {err} is not reddish (r={r} g={g} b={b}); HSL->RGB mapping may be broken" | |
| print(f"semantic OK: error={err} warning={warn} success={succ}") | |
| PY | |
| - name: Summary | |
| if: always() | |
| run: echo "Validation complete — frontmatter + generator smoke test + semantic sanity." |