askill
frontend

frontendSafety 90Repository

Frontend development guidance for stayfront functional framework, stayintro design system, SDUI engine, Declarative Shadow DOM, signals reactivity, and token-based styling.

0 stars
1.2k downloads
Updated 1/23/2026

Package Files

Loading files...
SKILL.md

Frontend Skill (staystack-ts)

What is it?

This skill provides guidance for building frontend applications using the staystack-ts functional framework ecosystem:

  • stayfront: Signals-based reactive framework with Declarative Shadow DOM (DSD)
  • stayintro: Design system with tokens, primitives, and styled components
  • SDUI Engine: Server-Driven UI rendering from JSON schemas

Why use it?

  • Ensures consistent functional patterns: pure functions, no classes, no this
  • Enforces token-based styling (no hardcoded values)
  • Maintains WCAG AA+ accessibility standards
  • Keeps code aligned with stayfront/stayintro APIs
  • Enables SSR with instant hydration via DSD

How to use it?

  1. Use defineElement to create custom elements with functional components
  2. Use signals (createSignal, createComputed) for reactive state
  3. Use stayintro tokens for all visual values (colors, spacing, typography)
  4. Use SDUI engine (createSchemaRenderer) for dynamic UI from schemas
  5. Validate with npm run lint, npm run build before committing

Core Standards

Functional Components

import { html, defineElement, useState } from "@staytunedllp/stayfront";

const counter = defineElement({ tagName: "my-counter" }, () => {
  const [count, setCount] = useState(0);
  return html`
    <button onclick="${() => setCount((c) => c + 1)}">Count: ${count()}</button>
  `;
});

counter.register();

Design System Integration

import { createIntroRegistry } from "@staytunedllp/stayintro";
import { createSchemaRenderer } from "@staytunedllp/stayfront/sdui";

const registry = createIntroRegistry();
const renderer = createSchemaRenderer(registry);

Token-Based Styling

/* ✅ CORRECT: Use stayintro tokens */
.component {
  padding: var(--intro-spacing-4);
  color: var(--intro-color-gray-900);
  border-radius: var(--intro-radius-md);
}

/* ❌ INCORRECT: Hardcoded values */
.component {
  padding: 16px;
  color: #111827;
  border-radius: 6px;
}

Key APIs

stayfront

APIPurpose
defineElement(opts, fn)Create custom element
htmlTagged template for HTML
useState(initial)State hook
useEffect(fn)Effect hook
createSignal(initial)Create reactive signal
createRouter()URLPattern-based routing
useRouter(), useParam()Router hooks
createSchemaRenderer(registry)SDUI renderer

stayfront/data

APIPurpose
createDataClient(config)Data fetching client
createMultiLayerCache(opts)Memory + IndexedDB cache
useQuery(url)Data fetching hook
useMutation(url)Mutation hook

stayfront/pwa

APIPurpose
generateServiceWorker(config)Generate SW code
registerServiceWorker(url, opts)Register SW
createLocalStore(name, store)IndexedDB storage
hydrateElement(el)Hydrate DSD element

stayintro

APIPurpose
createIntroRegistry(theme)Styled SDUI blocks
Box, Stack, GridLayout primitives
Button, Input, CardUI components
createTheme(overrides)Custom themes
colors, spacing, typographyDesign tokens

Mandatory Requirements

  • No classes: Use defineElement with pure functions
  • No direct DOM: Use html template, never innerHTML
  • No hardcoded values: Use --intro-* CSS variables
  • Accessibility: ARIA labels, keyboard navigation, 4.5:1 contrast
  • Container queries: Use @container not @media for components

Supporting Docs

Install

Download ZIP
Requires askill CLI v1.0+

AI Quality Score

92/100Analyzed 2/12/2026

A high-quality, comprehensive technical guide for the staystack-ts ecosystem, featuring clear functional patterns, dense API references, and strict coding standards.

90
95
70
95
92

Metadata

Licenseunknown
Version-
Updated1/23/2026
PublisherZ1-Test

Tags

apici-cdlintingsecurity