Skip to content
Skillpedia
Websites & UI (frontend)7.8k Β· #13065

panel-component-aggregator

What it does

This skill guides the AI agent to build a summary panel that does not fetch its own data. It is for developers who want a panel that combines data already loaded by other panels.

When to use it

  • βœ“When a summary panel should combine data that other panels already fetched.
  • βœ“When data arrives at different times and the summary should update each time.
  • βœ“When you want to avoid extra network calls from a panel that only shows totals or summaries.

Skill link

https://github.com/HKUDS/AgentPilot/blob/main/openspace/legacy/v1/showcase/skills/panel-component-aggregator/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/HKUDS/AgentPilot/blob/main/openspace/legacy/v1/showcase/skills/panel-component-aggregator/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute β†’

Example of what to ask your AI

β€œBuild a summary panel that totals the numbers pushed in from my stock and sales panels, and only shows once it has enough data.”

5 new skills a week. 1 minute to read.

How it works

The agent creates an aggregator base class that stores pushed partial data and tracks which fields have arrived. It waits until the required fields exist before its first render, then re-renders each time new data is pushed.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Aggregator Panel Component Pattern

Create aggregator dashboard panel components using vanilla TypeScript (no framework, no JSX). An aggregator panel does not fetch data itself. Instead, it receives partial data pushes from sibling panels (or a coordinator) via updateData(partial), defers its first render until enough data has arrived, and re-renders incrementally on each subsequent push.

This skill is self-contained. It covers the base Panel class, the AggregatorPanel generic base class, and a concrete example (SummaryPanel).


When to Use This Pattern

Use case Fetching Panel Aggregator Panel
Panel owns its own API endpoint yes no
Panel summarises data from multiple sources no yes
Data arrives asynchronously from siblings no yes
Re-renders on each push without extra network calls no yes

Architecture Overview

Panel (base class)
└── AggregatorPanel<TData> (generic aggregator base)
    β”œβ”€β”€ partialData: Partial<TData>         β€” accumulated pushed fields
    β”œβ”€β”€ receivedKeys: Set<keyof TData>      β€” tracks which keys have arrived
    β”œβ”€β”€ requiredKeys: (keyof TData)[]       β€” keys needed before first render
    β”œβ”€β”€ lastUpdated: Map<keyof TData, number> β€” staleness timestamps
    └── SummaryPanel (concrete example)

Data flow:

StockPanel ──pushes──► coordinator.push('stocks', quotes)
EmailPanel ──pushes──► coordinator.push('emails', messages)
                               β”‚
                    AggregatorPanel.updateData({ stocks, emails })
                               β”‚
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚  enough data yet?   β”‚
                    β”‚  no  β†’ showPending  β”‚
                    β”‚  yes β†’ render()     β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Base Panel Class

Create src/components/Panel.ts:

export interface PanelOptions {
  id: string;
  title: string;
  showCount?: boolean;
  className?: string;
}

export class Panel {
  protected element: HTMLElement;
  protected content: HTMLElement;
  protected header: HTMLElement;
  protected countEl: HTMLElement | null = null;
  protected panelId: string;
  private _fetching = false;

  constructor(options: PanelOptions) {
    this.panelId = options.id;
    this.element = document.createElement('div');
    this.element.className = `panel ${options.className || ''}`.trim();
    this.element.dataset.panel = options.id;

    // Header
    this.header = document.createElement('div');
    this.header.className = 'panel-header';

    const headerLeft = document.createElement('div');
    headerLeft.className = 'panel-header-left';

    const title = document.createElement('span');
    title.className = 'panel-title';
    title.textContent = options.title;
    headerLeft.appendChild(title);
    this.header.appendChild(headerLeft);

    if (options.showCount) {
      this.countEl = document.createElement('span');
      this.countEl.className = 'panel-count';
      this.countEl.textContent = '0';
      this.header.appendChild(this.countEl);
    }

    this.content = document.createElement('div');
    this.content.className = 'panel-content';
    this.content.id = `${options.id}Content`;

    this.element.appendChild(this.header);
    this.element.appendChild(this.content);
  }

  public getElement(): HTMLElement { return this.element; }

  public showLoading(message = 'Loading...'): void {
    this.content.innerHTML = `
      <div class="panel-loading">
        <div class="panel-loading-spinner"></div>
        <div class="panel-loading-text">${message}</div>
      </div>`;
  }

  /** Show a "waiting for data" placeholder β€” softer than showLoading */
  public showPending(message = 'Waiting for data\u2026'): void {
    this.content.innerHTML = `
      <div class="panel-pending">
        <div class="panel-pending-text">${message}</div>
      </div>`;
  }

  public showError(message = 'Failed to load', onRetry?: () => void): void {
    this.content.innerHTML = `
      <div class="panel-error-state">
        <div class="panel-error-msg">${message}</div>
        ${onRetry ? '<button class="panel-retry-btn" data-panel-retry>Retry</button>' : ''}
      </div>`;
    if (onRetry) {
      this.content.querySelector('[data-panel-retry]')
        ?.addEventListener('click', onRetry);
    }
  }

  public setContent(html: string): void { this.content.innerHTML = html; }

  public setCount(count: number): void {
    if (this.c
FAQ

Does the summary panel make its own API calls?

No, the skill says aggregator panels receive pushed data from sibling panels or a coordinator.

When does it first show?

It waits until all required data fields have arrived, then renders for the first time.

How does it track freshness?

The skill keeps timestamps for each field, so stale values can be recognized.

Details

Original description by the author

Dashboard panel component pattern for aggregator/summary panels that accept pushed partial data updates via updateData(), defer rendering until first data arrives, and incrementally re-render metrics without re-fetching β€” ideal for panels that synthesize data already fetched by other panels.

repo: HKUDS/AgentPilot

Popularity

GitHub stars
7.8k
Ranking position
#13065
License
MIT
Updated
11/1/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills