Скилл переносится из ~/.claude/skills/aura-design в репозиторий обвязки: SKILL.md, справочники reference/ и набор kit/ (токены, base.css, компоненты React, оболочка AppShell, тест токенов, test-setup, примеры входа). install.sh ставит его в ~/.claude/skills/aura-design, --check его видит. tests/test-aura-design.sh проверяет структуру и инварианты набора. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
35 lines
2.3 KiB
Bash
35 lines
2.3 KiB
Bash
# Skill aura-design: frontmatter, справочники, набор kit и его инварианты (литералы цвета только в tokens.css,
|
||
# одинаковые имена --color-* в светлой и обоих тёмных блоках).
|
||
D="$ROOT/skills/aura-design"; S="$D/SKILL.md"
|
||
assert_file "SKILL.md существует" "$S"
|
||
assert_eq "skill: первая строка ---" "$(sed -n '1p' "$S" 2>/dev/null)" "---"
|
||
assert_grep "skill: name: aura-design" '^name: aura-design$' "$S"
|
||
assert_grep "skill: description начинается с Use when" '^description: Use when ' "$S"
|
||
for f in reference/foundations.md reference/components.md reference/layout-ux.md \
|
||
kit/styles/tokens.css kit/styles/base.css kit/styles/tokens.test.ts kit/test-setup.ts \
|
||
kit/main.example.tsx kit/index.example.html kit/shell/AppShell.tsx kit/shell/shell.css \
|
||
kit/ui/index.ts kit/ui/ui.css kit/ui/theme.ts kit/ui/Button.tsx kit/ui/Dialog.tsx kit/ui/Confirm.tsx; do
|
||
assert_file "aura-design: $f" "$D/$f"
|
||
done
|
||
assert_grep "skill: ссылается на kit" 'kit/' "$S"
|
||
out=$(python3 - "$D/kit" <<'PY' 2>&1
|
||
import pathlib, re, sys
|
||
kit = pathlib.Path(sys.argv[1]); tokens = kit / "styles" / "tokens.css"
|
||
strip = lambda s: re.sub(r"/\*.*?\*/", "", s, flags=re.S)
|
||
lit = re.compile(r"#[0-9a-fA-F]{3,8}\b|\b(?:rgb|rgba|hsl|hsla)\(|:\s*(?:white|black|red|green|blue|gray|grey|orange|yellow|purple)\b")
|
||
bad = [f"{f.relative_to(kit)}: {m.group(0)}" for f in kit.rglob("*.css") if f != tokens for m in lit.finditer(strip(f.read_text()))]
|
||
css = strip(tokens.read_text())
|
||
def block(head):
|
||
i = css.index("{", css.index(head)); d = 0
|
||
for j in range(i, len(css)):
|
||
d += {"{": 1, "}": -1}.get(css[j], 0)
|
||
if d == 0: return css[i + 1:j]
|
||
names = lambda b: sorted(re.findall(r"(--color-[\w-]+)\s*:", b))
|
||
light = names(block(":root {"))
|
||
same = names(block(':root:not([data-theme="light"])')) == light == names(block(':root[data-theme="dark"]'))
|
||
print("literals:", ";".join(bad) or "none"); print("parity:", "ok" if same and len(light) > 20 else "diff")
|
||
PY
|
||
)
|
||
assert_grep "kit: нет литералов цвета вне tokens.css" '^literals: none$' <(printf '%s\n' "$out")
|
||
assert_grep "kit: темы задают одни имена --color-*" '^parity: ok$' <(printf '%s\n' "$out")
|