スキル一覧に戻る
Soborbo

astro-components

by Soborbo

1🍴 0📅 2026年1月19日
GitHubで見るManusで実行

SKILL.md


name: astro-components description: UI component library for Astro lead generation sites. Buttons, forms, cards, badges. Requires design-tokens skill.

Astro Components Skill

Purpose

Provides reusable UI components. Does NOT handle sections, layouts, or business logic.

Scope

✅ Use For❌ NOT For
Marketing sitesWeb apps
Lead gen pagesDashboards
Service websitesE-commerce carts

Core Rules

  1. All styling via design-tokens — No hardcoded colors/spacing
  2. Token missing = build error — Never fallback to arbitrary values
  3. Mobile-first — Base styles for mobile, md: for larger
  4. 44px minimum touch targets — All interactive elements
  5. Zero external dependencies — Pure Astro + Tailwind only

Semantic HTML Rules

ElementUseNever
<button>Actions, toggles<div onclick>
<a>Navigation<span onclick>
<input>Form dataContenteditable div

Rule: If it does something → <button>. If it goes somewhere → <a>.

Component Variants

Fixed variants only. Claude cannot invent new variants.

ComponentAllowed Variants
Buttonprimary, secondary, outline, ghost
Carddefault, elevated, outlined
Badgedefault, success, warning, error, info
Alertinfo, success, warning, error

New variant needed? → Update this skill first, then use.

Props Pattern (All Components)

interface Props {
  variant?: 'primary' | 'secondary';  // Explicit union, no string
  size?: 'sm' | 'md' | 'lg';          // Fixed sizes only
  class?: string;                      // Allow extension
  // ... component-specific
}

const { variant = 'primary', size = 'md' } = Astro.props;

JavaScript Rules

AllowedForbidden
client:visible islandsInline onclick
Astro actions<script> in component
Separate .ts filesAny DOM manipulation

Exception: None. If JS needed, use island architecture.

Icon Handling

// If icon name not found → render nothing + console.warn
const path = icons[name];
if (!path) {
  console.warn(`Icon "${name}" not found`);
  return null;
}

No silent failures. Missing icon = visible warning in dev.

Form Components

RuleRequirement
LabelAlways visible, linked via for
PlaceholderHint only, never replaces label
ErrorBelow input, role="alert"
RequiredVisual indicator (*) + required attr

Component Boundaries

Components must NOT:

  • Fetch data
  • Format/transform data
  • Access global state
  • Import other components (except Icon)
  • Contain business logic

Rule: Component receives props → renders UI. Nothing else.

File Structure

src/components/ui/
├── Button.astro
├── Input.astro
├── Card.astro
├── Badge.astro
├── Alert.astro
├── Icon.astro
└── index.ts

Forbidden

  • ❌ External UI libraries
  • ❌ Hardcoded colors/spacing
  • ❌ Touch targets under 44px
  • ❌ Missing focus states
  • ❌ Inline JavaScript
  • ❌ Inventing new variants
  • ❌ Silent failures

References

Definition of Done

  • Uses design-tokens only
  • All interactive: focus states + 44px touch
  • TypeScript Props interface
  • No inline JavaScript
  • Tested on mobile 375px

スコア

総合スコア

50/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です