Skip to content
Back to skills

1639 Spec 50c2c107

ASecurity

TBD - created by archiving change add-chat-visualization. Update Purpose after archive. The system SHALL emit an SSE event of type `visualization` when an agent tool returns structured chart data, containing the chart type, component name, title, and props sufficient to render the corresponding frontend chart component.

  • 9 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added May 31, 2026
datafrontend

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned May 31, 2026

npx -y skills add tools-only/X-Skills --skill 1639-spec_50c2c107 --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 1639 Spec 50c2c107?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for 1639 Spec 50c2c107
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tools-only-1639-spec-50c2c107/badge)](https://www.skillsdirectory.com/skills/tools-only-1639-spec-50c2c107)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
# chat-visualization Specification

## Purpose
TBD - created by archiving change add-chat-visualization. Update Purpose after archive.
## Requirements
### Requirement: SSE Visualization Event
The system SHALL emit an SSE event of type `visualization` when an agent tool returns structured chart data, containing the chart type, component name, title, and props sufficient to render the corresponding frontend chart component.

#### Scenario: MarketAgent returns K-line data
- **GIVEN** a user asks "分析一下贵州茅台的K线"
- **WHEN** MarketAgent's `get_kline` tool returns data
- **THEN** an SSE `visualization` event SHALL be emitted with type `kline` and props containing `data` (array of OHLCV objects)

#### Scenario: ReportAgent returns financial analysis
- **GIVEN** a user asks "分析贵州茅台的财报"
- **WHEN** ReportAgent's `get_comprehensive_financial_analysis` tool returns data
- **THEN** an SSE `visualization` event SHALL be emitted with type `financial_trend` and props containing revenue, profit, and ratio trend data

#### Scenario: BacktestAgent returns backtest results
- **GIVEN** a user asks "用MACD策略回测贵州茅台"
- **WHEN** BacktestAgent's `run_simple_backtest` tool returns data
- **THEN** an SSE `visualization` event SHALL be emitted with type `profit_curve` and props containing portfolio value time series

### Requirement: Dynamic Chart Component Rendering
The frontend MessageList SHALL render visualization events using the corresponding reusable chart component (KLineChart, TrendChart, ProfitChart, IndexCompareChart) based on the `type` field, displaying charts inline within the assistant message.

#### Scenario: K-line chart rendered in chat
- **WHEN** a `visualization` event with type `kline` is received
- **THEN** the system SHALL render the KLineChart component with the event's props data inline in the message

#### Scenario: No chart data
- **WHEN** a tool returns no `_visualization` field
- **THEN** no visualization event SHALL be emitted and the message SHALL render as text-only

### Requirement: Visualization Data Persistence
The system SHALL persist visualization data in the message metadata so that charts can be re-rendered when loading historical messages.

#### Scenario: Reload chat with charts
- **GIVEN** a message with visualization data was previously sent
- **WHEN** the user reloads the chat session
- **THEN** the charts SHALL be re-rendered from persisted metadata

Files in this skill

  • README.md836 B
  • skill.md2.4 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.