panel-visual-badges
하는 일
이 스킬은 대시보드 패널에 상태 배지, 작은 썸네일, 색으로 구분된 라벨 같은 시각적 요소를 더합니다. 재시도와 저장된 설정이 있는 패널 패턴 위에 만들어집니다. 한눈에 살펴볼 수 있는 데이터 대시보드를 만드는 사람을 위한 스킬입니다.
사용하는 경우
- ✓대시보드 항목이 출처나 상태를 색 배지로 보여 주기를 원할 때.
- ✓대시보드 목록의 항목 옆에 작은 썸네일을 두고 싶을 때.
- ✓상태나 출처 같은 데이터에 따라 색이 바뀌기를 원할 때.
스킬 링크
https://github.com/HKUDS/AgentPilot/blob/main/openspace/legacy/v1/showcase/skills/panel-visual-badges/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“제 대시보드의 뉴스 패널에 색이 있는 상태 배지와 작은 썸네일을 추가해 주실 수 있나요?”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
색과 출처 설정은 한곳에 모여 있습니다. 패널은 그 데이터를 읽고 각 항목에 배지나 이미지를 추가합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Robust UI Panel Components
Build visually rich, robust TypeScript UI components using a panel architecture pattern. This skill combines enhanced panel features (retry logic, state persistence) with a systematic workflow for adding visual enhancements (badges, thumbnails, dynamic styling).
Architecture Overview
Core Panel Features
- Retry Logic: Automatically retries failed data fetches with exponential backoff.
- State Persistence: Saves panel state (expanded/collapsed, size) to localStorage.
- Detailed Error Handling: Provides granular error messages and recovery options.
- Visual Enhancements: Systematic approach for adding badges, thumbnails, and dynamic styling.
Panel (base class)
├── element: HTMLElement (outer container, .panel)
│ ├── header: HTMLElement (.panel-header)
│ │ ├── headerLeft (.panel-header-left)
│ │ │ ├── title (.panel-title)
│ │ │ └── newBadge (.panel-new-badge) [optional]
│ │ ├── statusBadge (.panel-data-badge) [optional]
│ │ └── countEl (.panel-count) [optional]
│ ├── content: HTMLElement (.panel-content)
│ └── resizeHandle (.panel-resize-handle)
Implementation Workflow
1. Define Constants and Configuration
// Panel configuration
const PANEL_DEFAULTS = {
maxRetries: 3,
initialRetryDelay: 1000, // 1s
};
// Visual configuration
const SOURCE_COLORS: { [key: string]: string } = {
'Category A': '#FF6B6B',
'Category B': '#4ECDC4',
'default': '#95A5A6'
};
const THUMBNAIL_SIZE = 48; // pixels
2. Base Panel Class with Enhanced Features
export class Panel {
protected element: HTMLElement;
protected content: HTMLElement;
protected panelId: string;
private retryAttempts = 0;
private retryDelay = PANEL_DEFAULTS.initialRetryDelay;
constructor(options: PanelOptions) {
// ... existing constructor code ...
this.loadState();
}
protected async fetchWithRetry(url: string):<any> {
while (this.retryAttempts < PANEL_DEFAULTS.maxRetries) {
try {
const response = await fetch(url);
if (!response.ok) throw new Error(`HTTP ${response.status}`);
return await response.json();
} catch (error) {
this.retryAttempts++;
if (this.retryAttempts >= PANEL_DEFAULTS.maxRetries) {
throw new Error(`Failed after ${PANEL_DEFAULTS.maxRetries} attempts: ${error.message}`);
}
await new Promise(resolve => setTimeout(resolve, this.retryDelay));
this.retryDelay *= 2;
}
}
}
public saveState(): void {
localStorage.setItem(`panelState_${this.panelId}`, JSON.stringify({
isExpanded: !this.element.classList.contains('collapsed'),
width: this.element.style.width,
height: this.element.style.height
}));
}
public loadState(): void {
const savedState = localStorage.getItem(`panelState_${this.panelId}`);
if (savedState) {
const { isExpanded, width, height } = JSON.parse(savedState);
if (!isExpanded) this.element.classList.add('collapsed');
if (width) this.element.style.width = width;
if (height) this.element.style.height = height;
}
}
// Visual enhancement helpers
protected getColorForSource(source: string): string {
return SOURCE_COLORS[source] || SOURCE_COLORS['default'];
}
protected getThumbnailUrl(imageUrl?: string): string {
return imageUrl || `https://via.placeholder.com/${THUMBNAIL_SIZE}`;
}
}
3. Creating Enhanced Components
export class NewsPanel extends Panel {
private refreshTimer: ReturnType<typeof setInterval> | null = null;
constructor() {
super({ id: 'news', title: 'News Feed', showCount: true });
this.fetchData();
this.refreshTimer = setInterval(() => this.fetchData(), 60_000);
}
private async fetchData(): Promise<void> {
try {
const newsItems = await this.fetchWithRetry('/api/news');
this.render(newsItems);
this.setCount(newsItems.length);
this.saveState();
} catch (err) {
this.showError(`Failed to load news: ${err.message}`, () => {
this.retryAttempts = 0;
this.retryDelay = PANEL_DEFAULTS.initialRetryDelay;
this.fetchData();
});
}
}
private render(items: NewsItem[]): void {
const html = items.map(item => `
<div class="news-item">
<img src="${this.getThumbnailUrl(item.imageUrl)}" class="news-thumbnail">
<div class="news-content">
<h3>${item.tit
자주 묻는 질문
배지 색은 어디서 설정하나요?
색은 하나의 설정 객체에 나열되어 있어, 그곳에서 바꿀 수 있습니다.
재시도와 설정 패턴이 필요한가요?
배지는 단독으로도 작동하지만, 스킬은 재시도와 저장된 설정이 있는 패널 패턴 위에 만들도록 쓰여 있습니다.
나만의 배지 유형을 추가할 수 있나요?
네. 설정에 새 항목을 추가한 다음, 패널에서 그것을 사용하면 됩니다.
상세 정보
작성자의 원본 설명
Create visually rich, robust TypeScript UI components with panel architecture, combining enhanced features like retry logic, state persistence, and dynamic styling with a systematic workflow for visual enhancements.
repo: HKUDS/AgentPilot
인기도
- GitHub 스타
- 7.8k
- 순위
- #13075
- 라이선스
- MIT
- 업데이트
- 2026. 11. 1.
댓글
- …
이 저장소의 다른 스킬
agentpilot
7.8k작업을 준비하고 AgentPilot 루프를 실행해 변경을 제안, 테스트, 점수화하면서 프로젝트를 단계적으로 개선하도록 돕습니다.
openspace
7.8k에이전트 스킬을 저장하고 가져오는 도구인 OpenSpace를 설정하고, MCP를 통해 AI 앱에 연결하도록 돕습니다.
rsi-arena
7.8kAIME나 Terminal-Bench 같은 표준 AI 벤치마크 테스트를 설정하고 실행해 서로 다른 개선 방법을 비교하도록 돕습니다.
experiment-guide
7.8k프로그램을 개선하는 방법을 조사하면서 작은 실험을 계획하고, 결과를 읽고, 발견 사항을 기록하도록 돕습니다.
비슷한 스킬
canvas
394k에이전트가 연결된 Mac 패널에 호스팅된 시각적 위젯을 띄우고, 패널을 숨기거나 다른 페이지로 옮기도록 돕습니다.
control-ui
394k에이전트가 세션, 대시보드, 연결된 Gateway를 포함해 OpenClaw Control UI를 정리하고 문제를 해결하도록 돕습니다.
diagram-maker
394k에이전트가 프로세스, 시스템 구조, 화이트보드 스케치를 위해 SVG, HTML, 편집 가능한 Excalidraw 파일로 명확한 다이어그램을 만들도록 돕습니다.