Skip to content

Check_frontend_design

FieldValue
TypeSkill Resource
Source~/.copilot/skills/frontend/scripts/check_frontend_design.py
DescriptionNot specified

Source Content

#!/usr/bin/env python3
"""Check delivered frontend-design UI code against this skill's house rules:
no banned generic font, and at least one deliberate motion/interaction detail
documented.
Usage: check_frontend_design.py <file-or-dir>
"""
import re
import sys
from pathlib import Path
BANNED_FONTS = ["Inter", "Roboto", "Arial", "Helvetica Neue"]
def main() -> int:
if len(sys.argv) != 2:
print("Usage: check_frontend_design.py <file-or-dir>", file=sys.stderr)
return 2
target = Path(sys.argv[1])
files = [target] if target.is_file() else list(target.rglob("*.tsx")) + list(target.rglob("*.css"))
fail = 0
banned_hits = []
for f in files:
text = f.read_text(encoding="utf-8", errors="ignore")
for font in BANNED_FONTS:
if font.lower() in text.lower():
banned_hits.append((f, font))
if banned_hits:
print(f"❌ banned generic font(s) found: {[(str(f), font) for f, font in banned_hits]}")
fail = 1
else:
print("✅ no banned generic fonts (Inter/Roboto/Arial/Helvetica Neue) found")
has_motion = any(
re.search(r"transition|animate|@keyframes|framer-motion|motion\.", f.read_text(encoding="utf-8", errors="ignore"))
for f in files
)
if has_motion:
print("✅ at least one motion/interaction detail found (transition/animation/framer-motion)")
else:
print("⚠️ no motion/interaction detail found — confirm a static design was intentional")
return fail
if __name__ == "__main__":
raise SystemExit(main())