xiaohongshu
xiaohongshu
data-to-ui
Data-to-UI pipeline patterns. Use when transforming JSON data into React components, creating TypeScript types from schemas, building derived types, or creating data utilities.
Full skill instructions
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.
type Severity = 'safety_hazard' | 'repair_needed')?) for nullable/missing fieldsextendsPick<T, K> and Omit<T, K> for component props& for joined data (e.g., FindingWithAsset)Record<EnumType, ColorValue> for semantic colors'bg-red-500 text-red-600')getSeverityColors())Record<EnumType, string> mapping to lucide-react icon names'AlertTriangle', 'Thermometer')getSeverityIcon())Intl.NumberFormat with USD, no decimalstoLocaleDateString with short month formatgroupBy patterns using reduce or forEach// 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];
}
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];
}
// 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[];
}
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));
}
// 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]
);
}
Record<EnumType, Value> instead of plain objectsIntl.NumberFormat and Intl.DateTimeFormat for localization'red' instead of 'safety_hazard')any types; prefer unknown and type guardsIntl.DateTimeFormat for consistencytsc --noEmit to validate typesinterface-design - Use color systems in React componentsrefactoring-code - Consolidate duplicate color/formatting logicxiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience