Skip to content

notque/vexjoy-agent / skills/frontend/frontend

frontend

Unverified

Frontend: UI design, distinctive visual styles, HTML artifacts, Three.js 3D, TypeScript/React/Next.js apps, e-commerce, portfolios, React Native, web performance.

FileKindSize
SKILL.mdskill md22.5 KB
SPEC.mdmarkdown4.3 KB
agents/html-builder.mdmarkdown5.9 KB
assets/base-template.htmlother495 B
references/design-refs/accessibility-review.mdmarkdown13.0 KB
references/design-refs/design-critique.mdmarkdown10.4 KB
references/design-refs/design-handoff.mdmarkdown9.9 KB
references/design-refs/design-systems.mdmarkdown9.3 KB
references/design-refs/llm-design-failure-modes.mdmarkdown9.1 KB
references/design-refs/ux-copy.mdmarkdown9.5 KB
references/distinctive-frontend-design-refs/animation-patterns.mdmarkdown10.5 KB
references/distinctive-frontend-design-refs/background-techniques.mdmarkdown10.5 KB
references/distinctive-frontend-design-refs/balatro-shader-breakdown.mdmarkdown14.9 KB
references/distinctive-frontend-design-refs/card-shader-patterns.mdmarkdown10.9 KB
references/distinctive-frontend-design-refs/color-inspirations.jsonconfig9.4 KB
references/distinctive-frontend-design-refs/css-audit-patterns.mdmarkdown4.7 KB
references/distinctive-frontend-design-refs/font-catalog.jsonconfig9.7 KB
references/distinctive-frontend-design-refs/game-ui-polish.mdmarkdown6.3 KB
references/distinctive-frontend-design-refs/honest-placeholders.mdmarkdown3.2 KB
references/distinctive-frontend-design-refs/implementation-examples.mdmarkdown7.7 KB
references/distinctive-frontend-design-refs/macrostructure-catalog.mdmarkdown9.3 KB
references/distinctive-frontend-design-refs/oklch-color-harmony.mdmarkdown7.3 KB
references/distinctive-frontend-design-refs/performance-budgets.mdmarkdown10.6 KB
references/distinctive-frontend-design-refs/phase-details.mdmarkdown4.8 KB
references/distinctive-frontend-design-refs/pptx-conversion.mdmarkdown9.7 KB
references/distinctive-frontend-design-refs/roll-text.mdmarkdown7.2 KB
references/distinctive-frontend-design-refs/shader-integration-react.mdmarkdown16.7 KB
references/distinctive-frontend-design-refs/slide-controller.mdmarkdown9.4 KB
references/distinctive-frontend-design-refs/text-animation-patterns.mdmarkdown4.3 KB
references/html-artifact-refs/design-system.mdmarkdown10.2 KB
references/html-artifact-refs/diagram-layering.mdmarkdown3.9 KB
references/html-artifact-refs/infographic-layouts.mdmarkdown4.9 KB
references/html-artifact-refs/pdf-export.mdmarkdown6.0 KB
references/html-artifact-refs/pptx-export.mdmarkdown10.2 KB
references/html-artifact-refs/shape-diagram-illustration.mdmarkdown4.3 KB
references/nextjs-ecommerce.mdmarkdown3.4 KB
references/nextjs-ecommerce/admin-dashboard.mdmarkdown9.8 KB
references/nextjs-ecommerce/error-catalog.mdmarkdown7.9 KB
references/nextjs-ecommerce/expertise.mdmarkdown5.1 KB
references/nextjs-ecommerce/patterns-and-errors.mdmarkdown4.6 KB
references/nextjs-ecommerce/preferred-patterns.mdmarkdown8.0 KB
references/nextjs-ecommerce/shopping-cart-patterns.mdmarkdown7.7 KB
references/nextjs-ecommerce/stripe-integration.mdmarkdown9.5 KB
references/performance-optimization.mdmarkdown9.9 KB
references/performance-optimization/browser-dom-optimizations.mdmarkdown6.0 KB
references/performance-optimization/bundle-optimization.mdmarkdown7.9 KB
references/performance-optimization/core-web-vitals.mdmarkdown9.6 KB
references/performance-optimization/js-algorithm-optimizations.mdmarkdown9.6 KB
references/performance-optimization/metrics-and-monitoring.mdmarkdown8.8 KB
references/performance-optimization/nextjs-optimization.mdmarkdown10.6 KB
references/performance-optimization/performance-testing.mdmarkdown9.6 KB
references/performance-optimization/preferred-patterns.mdmarkdown7.4 KB
references/performance-optimization/react-async-patterns.mdmarkdown7.0 KB
references/performance-optimization/react-bundle-optimization.mdmarkdown6.3 KB
references/performance-optimization/react-rendering-performance.mdmarkdown12.0 KB
references/react-native.mdmarkdown4.4 KB
references/react-native/animation-patterns.mdmarkdown3.9 KB
references/react-native/error-handling.mdmarkdown7.7 KB
references/react-native/list-performance.mdmarkdown5.4 KB
references/react-native/monorepo-config.mdmarkdown2.3 KB
references/react-native/navigation-patterns.mdmarkdown2.0 KB
references/react-native/rendering-patterns.mdmarkdown3.2 KB
references/react-native/state-management.mdmarkdown3.3 KB
references/react-native/testing.mdmarkdown6.2 KB
references/react-native/ui-patterns.mdmarkdown5.0 KB
references/react-portfolio.mdmarkdown7.7 KB
references/react-portfolio/gallery-patterns.mdmarkdown2.5 KB
references/react-portfolio/image-optimization.mdmarkdown3.4 KB
references/react-portfolio/lightbox-patterns.mdmarkdown6.1 KB
references/react-portfolio/nextjs-app-router.mdmarkdown4.9 KB
references/react-portfolio/performance.mdmarkdown3.9 KB
references/react-portfolio/portfolio-seo.mdmarkdown4.8 KB
references/react-portfolio/responsive-design.mdmarkdown3.3 KB
references/threejs-builder-refs/advanced-animation.mdmarkdown12.1 KB
references/threejs-builder-refs/advanced-topics.mdmarkdown11.0 KB
references/threejs-builder-refs/build-recipes.mdmarkdown7.4 KB
references/threejs-builder-refs/game-architecture.mdmarkdown10.4 KB
references/threejs-builder-refs/game-patterns.mdmarkdown12.5 KB
references/threejs-builder-refs/gltf-loading.mdmarkdown8.6 KB
references/threejs-builder-refs/performance-patterns.mdmarkdown11.8 KB
references/threejs-builder-refs/react-three-fiber.mdmarkdown17.8 KB
references/threejs-builder-refs/shader-patterns.mdmarkdown15.0 KB
references/threejs-builder-refs/visual-polish.mdmarkdown16.3 KB
references/threejs-builder-refs/webgpu.mdmarkdown20.4 KB
references/typescript-frontend.mdmarkdown5.3 KB
references/typescript-frontend/engineering-rules.mdmarkdown7.8 KB
references/typescript-frontend/nextjs-security.mdmarkdown2.6 KB
references/typescript-frontend/react-view-transitions.mdmarkdown5.4 KB
references/ui-design.mdmarkdown10.2 KB
references/ui-design/ai-slop-detection.mdmarkdown8.5 KB
references/ui-design/design-conventions.mdmarkdown2.8 KB
references/ui-design/motion-and-interaction.mdmarkdown5.6 KB
scripts-distinctive-frontend-design/css_slop_rules.pyscript15.3 KB
scripts-distinctive-frontend-design/tests/test_css_slop_rules.pyscript6.9 KB
scripts-distinctive-frontend-design/tests/test_validate_design_advisory.pyscript3.3 KB
scripts-distinctive-frontend-design/tests/test_validate_design_macro.pyscript4.3 KB
scripts-distinctive-frontend-design/validate_design.pyscript22.2 KB
scripts-html-artifact/assemble-template.pyscript7.5 KB
scripts-html-artifact/css_slop_rules.pyscript15.4 KB
scripts-html-artifact/detect-shape.pyscript7.0 KB
scripts-html-artifact/fill-template.pyscript5.5 KB
scripts-html-artifact/pptx-bridge/__init__.pyscript490 B
scripts-html-artifact/pptx-bridge/_pptx_engine.pyscript26.4 KB
scripts-html-artifact/pptx-bridge/extract_slides.pyscript13.5 KB
scripts-html-artifact/pptx-bridge/render_pptx.pyscript6.9 KB
scripts-html-artifact/pptx-bridge/run-unified.pyscript11.6 KB
scripts-html-artifact/render-github-issues.pyscript7.5 KB
scripts-html-artifact/tests/test_assemble_template.pyscript29.5 KB
scripts-html-artifact/tests/test_css_slop_emission.pyscript7.9 KB
scripts-html-artifact/tests/test_detect_shape.pyscript5.3 KB
scripts-html-artifact/tests/test_fill_template.pyscript5.2 KB
scripts-html-artifact/tests/test_to_pdf.pyscript13.3 KB
scripts-html-artifact/tests/test_validate_artifact.pyscript13.6 KB
scripts-html-artifact/to-pdf.pyscript12.5 KB
scripts-html-artifact/validate-artifact.pyscript11.0 KB
templates/base-reset.cssother1.2 KB
templates/components/collapsible.cssother1.1 KB
templates/components/collapsible.jsscript516 B
templates/components/copy-button.cssother534 B
templates/components/copy-button.jsscript334 B
templates/components/drag-drop.cssother612 B
templates/components/drag-drop.jsscript1.1 KB
templates/components/filter.cssother1.1 KB
templates/components/filter.jsscript987 B
templates/components/keyboard-nav.cssother249 B
templates/components/keyboard-nav.jsscript900 B
templates/components/scrollytelling.cssother1.5 KB
templates/components/scrollytelling.jsscript2.0 KB
templates/components/slider.cssother848 B
templates/components/tabs.cssother770 B
templates/components/tabs.jsscript508 B
templates/components/theme-toggle.cssother1.2 KB
templates/components/theme-toggle.jsscript178 B
templates/fonts/ArchivoBlack-OFL.txtmarkdown4.4 KB
templates/fonts/archivo-black.cssother13.7 KB
templates/print/code-review-print.cssother1.9 KB
templates/print/data-viz-print.cssother1.5 KB
templates/print/deck-print.cssother1.5 KB
templates/print/default-print.cssother1.6 KB
templates/print/diagram-print.cssother1.6 KB
templates/print/editor-print.cssother2.1 KB
templates/print/prototype-print.cssother1.4 KB
templates/print/report-print.cssother1.8 KB
templates/print/spec-print.cssother1.4 KB
templates/saved/README.mdmarkdown1.8 KB
templates/saved/business-review.htmlother17.1 KB
templates/saved/business-review.slots.jsonconfig1.5 KB
templates/saved/github-issues.htmlother34.0 KB
templates/saved/project-kickoff.htmlother17.3 KB
templates/saved/project-kickoff.slots.jsonconfig1.7 KB
templates/saved/system-design.htmlother16.9 KB
templates/saved/system-design.slots.jsonconfig1.6 KB
templates/shapes/code-review.cssother2.7 KB
templates/shapes/data-viz.cssother2.3 KB
templates/shapes/deck.cssother1.9 KB
templates/shapes/diagram.cssother2.7 KB
templates/shapes/editor.cssother2.8 KB
templates/shapes/prototype.cssother2.7 KB
templates/shapes/report.cssother2.9 KB
templates/shapes/spec.cssother3.0 KB
templates/themes/birchline.cssother2.4 KB
templates/themes/dark-focus.cssother2.6 KB
templates/themes/interactive-warm.cssother4.5 KB
templates/themes/minimal-document.cssother2.6 KB

scripts-distinctive-frontend-design/tests/test_css_slop_rules.py

View on GitHub
"""Golden-fixture tests for css_slop_rules.scan_css.

Each rule has one positive fixture (rule fires) and one negative (rule silent).
The contrast canary covers both the hex and the oklch color paths.
"""

from __future__ import annotations

import sys
import time
from importlib import import_module
from pathlib import Path

sys.path.insert(0, str(Path(__file__).parent.parent))
slop = import_module("css_slop_rules")
scan_css = slop.scan_css


def ids(css: str) -> set[str]:
    """Return the set of rule_ids fired for a CSS string."""
    return {f.rule_id for f in scan_css(css)}


# --- transition-all ---


def test_transition_all_fires() -> None:
    css = ".btn { transition: all 0.2s ease; }"
    assert "transition-all" in ids(css)


def test_transition_all_silent_on_named_property() -> None:
    css = ".btn { transition: opacity 0.2s ease, transform 0.2s ease; }"
    assert "transition-all" not in ids(css)


# --- universal-hover-scale ---


def test_universal_hover_scale_fires() -> None:
    css = ".card:hover { transform: scale(1.05); }"
    assert "universal-hover-scale" in ids(css)


def test_universal_hover_scale_silent_when_hover_does_more() -> None:
    css = ".card:hover { transform: scale(1.05); box-shadow: 0 4px 12px #0003; }"
    assert "universal-hover-scale" not in ids(css)


# --- gradient-text-headline ---


def test_gradient_text_headline_fires_webkit() -> None:
    css = "h1 { -webkit-background-clip: text; color: transparent; }"
    assert "gradient-text-headline" in ids(css)


def test_gradient_text_headline_fires_standard() -> None:
    css = "h2 { background-clip: text; }"
    assert "gradient-text-headline" in ids(css)


def test_gradient_text_headline_silent_on_body() -> None:
    css = ".badge { -webkit-background-clip: text; }"
    assert "gradient-text-headline" not in ids(css)


# --- focus-ring-fade ---


def test_focus_ring_fade_fires() -> None:
    css = ".input:focus { outline: 2px solid #09f; transition: outline 0.3s ease; }"
    assert "focus-ring-fade" in ids(css)


def test_focus_ring_fade_silent_when_instant() -> None:
    css = ".input:focus { outline: 2px solid #09f; }"
    assert "focus-ring-fade" not in ids(css)


# --- emoji-feature-icon ---


def test_emoji_feature_icon_fires() -> None:
    css = '.feature li::before { content: "\U0001f680"; }'
    assert "emoji-feature-icon" in ids(css)


def test_emoji_feature_icon_silent_on_text_content() -> None:
    css = '.tag::before { content: "New"; }'
    assert "emoji-feature-icon" not in ids(css)


# --- two-line-cta ---


def test_two_line_cta_fires() -> None:
    html = '<button class="cta">Start your free<br>trial today</button>'
    assert "two-line-cta" in ids(html)


def test_two_line_cta_silent_on_single_line() -> None:
    html = '<button class="cta">Get started</button>'
    assert "two-line-cta" not in ids(html)


# --- contrast-canary (hex path) ---


def test_contrast_canary_fires_hex() -> None:
    # dark-gray text on a marginally different dark-gray surface (black-on-black slop)
    css = ".x { color: #1a1a1a; background-color: #1e1e1e; }"
    assert "contrast-canary" in ids(css)


def test_contrast_canary_silent_hex_high_contrast() -> None:
    css = ".x { color: #ffffff; background-color: #111111; }"
    assert "contrast-canary" not in ids(css)


# --- contrast-canary (oklch path) ---


def test_contrast_canary_fires_oklch() -> None:
    css = ".y { color: oklch(0.20 0.02 250); background-color: oklch(0.22 0.03 250); }"
    assert "contrast-canary" in ids(css)


def test_contrast_canary_silent_oklch_high_contrast() -> None:
    css = ".y { color: oklch(0.95 0.02 250); background-color: oklch(0.20 0.03 250); }"
    assert "contrast-canary" not in ids(css)


# --- contrast-canary severity split at 1.2:1 ---


def _canary(css: str) -> list:
    return [f for f in scan_css(css) if f.rule_id == "contrast-canary"]


def test_contrast_ratio_known_values() -> None:
    assert abs(slop.contrast_ratio("#000000", "#ffffff") - 21.0) < 0.01
    assert abs(slop.contrast_ratio("#777777", "#777777") - 1.0) < 1e-9
    assert slop.contrast_ratio("red", "#ffffff") is None


def test_contrast_canary_below_1_2_is_error_hex() -> None:
    # 1.04:1: effectively invisible text blocks the build.
    found = _canary(".x { color: #1a1a1a; background-color: #1e1e1e; }")
    assert [f.severity for f in found] == ["error"]
    assert "1.04:1" in found[0].message


def test_contrast_canary_below_1_2_is_error_oklch() -> None:
    found = _canary(".y { color: oklch(0.20 0.02 250); background-color: oklch(0.22 0.03 250); }")
    assert [f.severity for f in found] == ["error"]


def test_contrast_canary_low_ratio_error_even_when_chroma_differs() -> None:
    # Gray on equal-luminance red: chroma differs by 0.12, so the old delta test missed it, but 1.00:1 is invisible.
    found = _canary(".z { color: #767676; background-color: #b85a50; }")
    ratio = slop.contrast_ratio("#767676", "#b85a50")
    assert ratio is not None and ratio < 1.2
    assert [f.severity for f in found] == ["error"]


def test_contrast_canary_between_1_2_and_threshold_is_warning() -> None:
    # 1.21:1 and within delta-L 0.05: readable only with effort, so warn, do not block.
    css = ".w { color: oklch(0.30 0.02 250); background-color: oklch(0.35 0.02 250); }"
    assert 1.2 <= slop.contrast_ratio("oklch(0.30 0.02 250)", "oklch(0.35 0.02 250)") < 1.3
    assert [f.severity for f in _canary(css)] == ["warning"]


# --- Finding shape contract ---


def test_finding_has_required_fields() -> None:
    findings = scan_css(".btn { transition: all 0.2s; }")
    assert findings
    f = findings[0]
    assert f.rule_id
    assert f.severity == "warning"
    assert isinstance(f.message, str) and f.message
    assert isinstance(f.line, int) and f.line >= 1


def test_clean_css_silent() -> None:
    css = ".btn { transition: opacity 0.2s ease; color: #1a1a1a; background: #fafafa; }"
    assert scan_css(css) == []


# --- ReDoS regression: large single-line input must scan fast ---


def test_scan_css_fast_on_large_single_line() -> None:
    """A ~1MB single-line artifact must scan in well under a second.

    Guards the block-iterating scanners against the O(n^2) backtracking that
    hung scan_css on minified single-line input (the "[^{}]*" pre-brace run).
    """
    unit = '<div class="btn cta" style="color:#111;background:#222">text</div>'
    big = "<html><body>" + unit * 16000 + "</body></html>"
    assert len(big) >= 1_000_000
    start = time.perf_counter()
    scan_css(big)
    assert time.perf_counter() - start < 1.0


def test_scan_css_correct_after_large_block_fix() -> None:
    """Fix must not change findings on normal nested CSS (at-rule + blocks)."""
    css = (
        "h1 { -webkit-background-clip: text; } "
        ".card:hover { transform: scale(1.0); } "
        "@media (min-width: 600px) { .x { color: #1a1a1a; background-color: #1e1e1e; } }"
    )
    assert ids(css) == {"gradient-text-headline", "universal-hover-scale", "contrast-canary"}
brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).Stars: 322kUpdated Claude CodeCodexVerifiedInstall
brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).Stars: 198kUpdated Claude CodeCodexVerifiedInstall