Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计异常

data-to-ui数据到用户界面

Agent Skill

用于辅助数据整理、表格处理、CSV/Excel 分析、指标计算和图表准备。它适合让 Agent 清洗字段、汇总数据、发现异常、生成统计口径或把分析结果转成可读说明。使用时需要确认数据来源、字段含义和时间范围,避免把样本数据当全量事实;涉及敏感数据、导出文件或批量写回时,应先确认权限和脱敏边界。

总安装

824

周安装

33

GitHub Stars

74

下载量

267
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:data-to-ui(数据到用户界面)
来源仓库:https://github.com/dralgorhythm/claude-agentic-framework
仓库路径:skills/data-to-ui
安装命令:
npx skills add https://github.com/dralgorhythm/claude-agentic-framework --skill data-to-ui
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/dralgorhythm/claude-agentic-framework --skill data-to-ui

简介

将 JSON 数据转换为类型安全的 React 组件,建立语义色彩系统。

  • 适用于 IoT 设备状态、维修工单等结构化数据的 UI 自动生成。
  • 输出包含 TypeScript 类型推导、派生类型与格式化工具链的完整 pipeline。
  • 强调组件复用性与视觉一致性,避免孤立片段生成问题。
  • 安装依赖 GitHub 技能库,适用于数据驱动型前端项目开发。

SKILL.md

Data to UI

Overview

Patterns for transforming static data into type-safe React components. This skill covers JSON → TypeScript → React pipelines with emphasis on semantic color systems, derived types, and formatting utilities.

Workflows

1. JSON Schema → TypeScript Types

  • Read JSON schema/data structure
  • Create base TypeScript interfaces matching JSON shape
  • Export union types for enums (e.g., type Severity = 'safety_hazard' | 'repair_needed')
  • Use optional properties (?) for nullable/missing fields
  • Add JSDoc comments for complex types

2. Derived Types for UI

  • Create composed types extending base types with extends
  • Use Pick<T, K> and Omit<T, K> for component props
  • Build intersection types with & for joined data (e.g., FindingWithAsset)
  • Create aggregate interfaces for statistics/summaries

3. Color Mapping Systems

  • Define Record<EnumType, ColorValue> for semantic colors
  • Provide multiple color formats: badge, bg, text, border, dot
  • Use Tailwind utility classes (e.g., 'bg-red-500 text-red-600')
  • Export accessor functions (e.g., getSeverityColors())
  • Document color choices with comments

4. Icon Mapping

  • Create Record<EnumType, string> mapping to lucide-react icon names
  • Use PascalCase icon names (e.g., 'AlertTriangle', 'Thermometer')
  • Export accessor function (e.g., getSeverityIcon())

5. Formatting Utilities

  • Currency: Use Intl.NumberFormat with USD, no decimals
  • Dates: Use toLocaleDateString with short month format
  • Calculations: Create helpers for years, percentages, lifespans
  • Labels: Create human-readable label maps

6. Aggregation & Grouping

  • Implement groupBy patterns using reduce or forEach
  • Sort with custom comparators using severity/priority order
  • Calculate summary statistics (min, max, avg, count)
  • Return strongly-typed aggregates

Reference Implementation

Color Mapping System

// Single source of truth for semantic colors
export interface SeverityColors {
  badge: string;  // 'text-red-600 bg-red-100'
  bg: string;     // 'bg-red-500'
  text: string;   // 'text-red-600'
  border: string; // 'border-red-500'
  dot: string;    // 'bg-red-500'
}

const SEVERITY_COLOR_MAP: Record<Severity, SeverityColors> = {
  safety_hazard: {
    badge: 'text-red-600 bg-red-100',
    bg: 'bg-red-500',
    text: 'text-red-600',
    dot: 'bg-red-500',
    border: 'border-red-500',
  },
  // ... other severities
};

export function getSeverityColors(severity: Severity): SeverityColors {
  return SEVERITY_COLOR_MAP[severity];
}

Icon Mapping

export function getSeverityIcon(severity: Severity): string {
  const icons: Record<Severity, string> = {
    safety_hazard: 'AlertTriangle',
    repair_needed: 'Wrench',
    maintenance_item: 'Settings',
    monitor: 'Eye',
    informational: 'Info'
  };
  return icons[severity];
}

Derived Types

// Base type
export interface Finding {
  id: string;
  assetId?: string | null;
  severity: Severity;
  title: string;
}

// Derived type with relationship
export interface FindingWithAsset extends Finding {
  asset?: Asset;
}

// Aggregate type
export interface PropertyWithDetails {
  property: Property;
  inspectionReport: InspectionReport;
  findings: Finding[];
  assets: Asset[];
}

Formatting Utilities

export function formatCurrency(value: number): string {
  return new Intl.NumberFormat('en-US', {
    style: 'currency',
    currency: 'USD',
    minimumFractionDigits: 0,
    maximumFractionDigits: 0
  }).format(value);
}

export function formatDate(dateString: string): string {
  return new Date(dateString).toLocaleDateString('en-US', {
    year: 'numeric',
    month: 'short',
    day: 'numeric'
  });
}

export function yearsSince(dateString: string): number {
  const date = new Date(dateString);
  const now = new Date();
  return Math.floor((now.getTime() - date.getTime()) / (365.25 * 24 * 60 * 60 * 1000));
}

Aggregation Patterns

// Group by enum value
export function groupFindingsBySeverity(findings: Finding[]): Record<Severity, Finding[]> {
  const grouped: Record<Severity, Finding[]> = {
    safety_hazard: [],
    repair_needed: [],
    maintenance_item: [],
    monitor: [],
    informational: []
  };

  findings.forEach(f => grouped[f.severity].push(f));
  return grouped;
}

// Sort by priority
export function sortFindingsBySeverity(findings: Finding[]): Finding[] {
  const severityOrder: Record<Severity, number> = {
    safety_hazard: 0,
    repair_needed: 1,
    maintenance_item: 2,
    monitor: 3,
    informational: 4
  };
  return [...findings].sort((a, b) =>
    severityOrder[a.severity] - severityOrder[b.severity]
  );
}

Best Practices

  • Single Source of Truth: All color/icon mappings in one place with accessor functions
  • Multi-Format Colors: Provide badge, bg, text, border, dot variants for flexibility
  • Type Safety: Use Record<EnumType, Value> instead of plain objects
  • Intl APIs: Use Intl.NumberFormat and Intl.DateTimeFormat for localization
  • Immutability: Use spread operator when sorting/filtering arrays
  • Documentation: Add JSDoc comments explaining color choices and data structures
  • Colocate Utilities: Keep types and utilities in same file for easy import

Anti-Patterns

  • DO NOT use generic color names without semantic meaning (e.g., 'red' instead of 'safety_hazard')
  • DO NOT inline color classes in components; always use mapping functions
  • DO NOT use any types; prefer unknown and type guards
  • DO NOT mutate input arrays in sort/filter functions; always create copies
  • DO NOT hardcode date formats; use Intl.DateTimeFormat for consistency
  • DO NOT create separate files for simple utilities; colocate with types
  • DO NOT forget to handle null/undefined in optional fields
  • DO NOT use snake_case or kebab-case for TypeScript file names; use camelCase

Feedback Loops

  1. Type Checking: Run tsc --noEmit to validate types
  2. Runtime Validation: Consider Zod for JSON schema validation at runtime
  3. Visual Testing: Build Storybook stories to verify color systems
  4. Data Consistency: Compare aggregated stats with source data counts
  5. Import Verification: Ensure all utilities are exported and importable

Related Skills

  • interface-design - Use color systems in React components
  • refactoring-code - Consolidate duplicate color/formatting logic

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

38.88%
按下载量换算104

Claude

28.47%
按下载量换算76

Cursor

19.25%
按下载量换算51

Gemini CLI

9.2%
按下载量换算25

安全审计

Gen Agent Trust Hub

未通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills