All skills
jwynia avatar

/frontend-design

@99a8797
by J Wyniajwynia/agent-skills160 stars
20

Create distinctive, production-grade frontend interfaces with high design quality. Provides analysis tools for auditing existing designs and generation tools for creating color palettes, typography systems, design tokens, and component templates. Supports React, Vue, Svelte, and vanilla HTML/CSS. Use when building web components, pages, or applications. Keywords: design, UI, frontend, CSS, components, palette, typography, tokens, accessibility.

Use this Skill: https://skilld.dev/gh/jwynia/agent-skills/frontend-design

This session only. Nothing lands on disk.

referencesframework-templates.md

≈1.9k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Framework Templates Reference

This document provides framework-specific patterns and best practices for generating components with the frontend-design skill.

React

File Structure

components/
├── Button/
│   ├── Button.tsx        # Component
│   ├── Button.css        # Styles (if using CSS)
│   ├── Button.module.css # Styles (if using CSS Modules)
│   ├── Button.test.tsx   # Tests
│   └── index.ts          # Re-export

Component Pattern

import React from 'react';

export interface ButtonProps {
  children: React.ReactNode;
  variant?: 'primary' | 'secondary' | 'ghost';
  size?: 'sm' | 'md' | 'lg';
  disabled?: boolean;
  onClick?: () => void;
}

export function Button({
  children,
  variant = 'primary',
  size = 'md',
  disabled = false,
  onClick,
}: ButtonProps) {
  return (
    <button
      className={`btn btn--${variant} btn--${size}`}
      disabled={disabled}
      onClick={onClick}
    >
      {children}
    </button>
  );
}

export default Button;

Styling Options

CSS Modules:

import styles from './Button.module.css';

<button className={styles.button} />

Tailwind:

<button className="px-4 py-2 bg-blue-500 text-white rounded-lg" />

Styled Components:

import styled from 'styled-components';

const StyledButton = styled.button`
  padding: 0.5rem 1rem;
  background: var(--color-primary);
`;

Emotion:

import { css } from '@emotion/react';

const buttonStyle = css`
  padding: 0.5rem 1rem;
  background: var(--color-primary);
`;

Vue 3

File Structure

components/
├── Button.vue           # Single File Component
└── __tests__/
    └── Button.spec.ts   # Tests

Component Pattern (Composition API)

<template>
  <button
    :class="[
      'btn',
      `btn--${variant}`,
      `btn--${size}`,
      { 'btn--disabled': disabled }
    ]"
    :disabled="disabled"
    @click="emit('click')"
  >
    <slot />
  </button>
</template>

<script setup lang="ts">
interface Props {
  variant?: 'primary' | 'secondary' | 'ghost';
  size?: 'sm' | 'md' | 'lg';
  disabled?: boolean;
}

const props = withDefaults(defineProps<Props>(), {
  variant: 'primary',
  size: 'md',
  disabled: false,
});

const emit = defineEmits<{
  click: [];
}>();
</script>

<style scoped>
.btn {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn--primary {
  background: var(--color-primary);
  color: white;
}

.btn--disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
</style>

Styling Options

Scoped CSS (default):

<style scoped>
.button { /* styles */ }
</style>

CSS Modules:

<style module>
.button { /* styles */ }
</style>

<template>
  <button :class="$style.button" />
</template>

Tailwind:

<template>
  <button class="px-4 py-2 bg-blue-500 text-white rounded-lg" />
</template>

Svelte

File Structure

components/
├── Button.svelte        # Component
└── Button.test.ts       # Tests

Component Pattern

<script lang="ts">
  export let variant: 'primary' | 'secondary' | 'ghost' = 'primary';
  export let size: 'sm' | 'md' | 'lg' = 'md';
  export let disabled = false;
</script>

<button
  class="btn btn--{variant} btn--{size}"
  class:btn--disabled={disabled}
  {disabled}
  on:click
>
  <slot />
</button>

<style>
  .btn {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
  }

  .btn--primary {
    background: var(--color-primary);
    color: white;
  }

  .btn--disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }
</style>

Styling Options

Component Styles (default):

<style>
  /* Scoped by default */
  .button { /* styles */ }
</style>

Global Styles:

<style global>
  .button { /* global styles */ }
</style>

Tailwind:

<button class="px-4 py-2 bg-blue-500 text-white rounded-lg" />

HTML (Vanilla)

File Structure

components/
├── button.html          # Component HTML
├── button.css           # Component CSS
└── button.js            # Optional JavaScript

Component Pattern

<!-- button.html -->
<button class="btn btn--primary btn--md">
  Button Text
</button>
/* button.css */
.btn {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.btn--primary {
  background: var(--color-primary, #2563eb);
  color: white;
}

.btn--primary:hover {
  background: var(--color-primary-dark, #1d4ed8);
}

.btn--secondary {
  background: var(--color-gray-100, #f3f4f6);
  color: var(--color-gray-900, #111827);
}

.btn--ghost {
  background: transparent;
  color: var(--color-gray-700, #374151);
}

.btn--sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
}

.btn--md {
  padding: 0.5rem 1rem;
  font-size: 1rem;
}

.btn--lg {
  padding: 0.75rem 1.5rem;
  font-size: 1.125rem;
}

.btn:disabled,
.btn--disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

Common Patterns

Variant Classes

All frameworks use a consistent variant pattern:

.component--variant
.component--size
.component--state

Examples:

  • .btn--primary, .btn--secondary, .btn--ghost
  • .btn--sm, .btn--md, .btn--lg
  • .btn--disabled, .btn--loading

Prop/Attribute Naming

Concept React Vue Svelte
Style variant variant variant variant
Size size size size
Disabled disabled disabled disabled
Click handler onClick @click on:click
Children children <slot /> <slot />

Accessibility

All generated components include:

  1. Proper semantics - Use native elements (<button>, <input>)
  2. Keyboard support - Focus styles, keyboard handlers
  3. ARIA attributes - When native semantics insufficient
  4. Focus management - Visible focus indicators

Dark Mode Support

When --dark-mode is enabled:

/* Light mode (default) */
.btn {
  background: white;
  color: #111827;
}

/* Dark mode */
.dark .btn,
[data-theme="dark"] .btn {
  background: #1f2937;
  color: white;
}

/* Or using media query */
@media (prefers-color-scheme: dark) {
  .btn {
    background: #1f2937;
    color: white;
  }
}

Animation Levels

Level Description Usage
none No animations Accessibility, performance
subtle Micro-interactions Most components
expressive Bold animations Hero sections, CTAs
/* Subtle */
.btn {
  transition: all 0.2s ease-out;
}

/* Expressive */
.btn {
  transition: all 0.3s ease-out;
}
.btn:hover {
  transform: scale(1.05);
}
.btn:active {
  transform: scale(0.95);
}

Best Practices

  1. Use semantic HTML - <button> for buttons, <a> for links
  2. Include TypeScript types - For React and Vue
  3. Support variants - Primary, secondary, ghost at minimum
  4. Include sizes - sm, md, lg
  5. Handle disabled state - Visual and functional
  6. Add focus styles - Visible focus indicators
  7. Respect motion preferences - prefers-reduced-motion
  8. Use CSS custom properties - For theming flexibility

Source: SKILL.md on GitHub

1 warning15d5 checks · Risk SAFE
  • Gen Agent Trust Hub15d

    The skill provides a set of design-focused Deno scripts for CSS analysis and frontend code generation. It follows secure practices by using scoped Deno permissions and versioned imports from trusted registries. No security issues were detected.

  • Socket15d

    No alerts

  • Snyk15d

    Risk: MEDIUM · 1 issue

  • Runlayer7mo

    3/14 files flagged

  • ZeroLeaks5mo

    1 finding · Score: 86/100

Signed by skilld at 99a8797. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 months ago.

Dormantupdated 8 months ago
compatibility
Requires Deno with --allow-read, --allow-write permissions
Other metadata
metadata
{
  "author": "agent-skills",
  "version": "1.0",
  "type": "generator",
  "mode": "generative",
  "domain": "development"
}
  • Frontend
  • React
  • Vue
  • design-systems
  • svelte
  • css
  • typography
  • color-palette
  • design-tokens
  • accessibility

README badge

README badge for jwynia/agent-skills/frontend-design

Generates and audits frontend design systems including color palettes, typography scales, design tokens, and component templates for React, Vue, Svelte, and HTML. Supports analysis of existing CSS for design patterns, token extraction, and accessibility compliance checks.

Generated from the current SKILL.md.

Does this skill work with TypeScript and Deno?
Yes. All scripts are written in TypeScript and require Deno runtime with --allow-read and --allow-write permissions to execute.
What frameworks and styling methods does component generation support?
Component generation supports React, Vue, Svelte, and vanilla HTML. Styling options include CSS, Tailwind, CSS modules, styled-components, and Emotion.
Can this skill extract design tokens from existing CSS files?
Yes. The extract-tokens script can parse existing CSS and output design tokens in multiple formats: CSS variables, SCSS, Tailwind, Style Dictionary, or Tokens Studio.
Does this handle accessibility checking?
Yes. The analyze-accessibility script checks color contrast ratios, focus indicators, touch target sizes, and motion preferences against WCAG AA or AAA standards.
What color palette output formats are available?
Generated palettes can be output as CSS variables, SCSS, Tailwind config, token format, or JSON.

Generated from the current SKILL.md. These answers refresh after source changes.