
data-and-visualization
Data analysis, charting, forecasting, and interactive visualization tools.
- version
- 1.0.0
- GitHub stars
- 404
Install
/plugin install data-and-visualization@oaustegard-claude-skillsRun it inside Claude Code after adding the marketplace with /plugin marketplace add oaustegard/claude-skills.
Contents
Discovered from sourceSkills 7
Overview
This skill creates interactive Vega-Lite visualizations from uploaded data. The workflow:
- Analyze data structure and context
- Select 5-10 meaningful chart types based on what the data represents
- Build chart specifications programmatically
- Generate React artifact with embedded visualizations
Critical Technical Constraint: Inline Data Island
Claude artifacts cannot use fetch() for computer:// URLs.
All data must be embedded as an inline JavaScript constant:
const DATA = [ /* embedded data array */ ];
// Later in chart specs:
spec.data = { values: DATA };
DO NOT:
- Use fetch() to load external files
- Reference external data URLs
- Create separate data files
This is the only pattern that works in Claude's artifact environment.
Primary Workflow: Data Upload → Chart Explorer
Execute this sequence when user uploads data without specifying chart type:
1. Analyze Data Structure
python /mnt/skills/user/charting-vega-lite/scripts/analyze_data.py /mnt/user-data/uploads/<filename>
Extract from output:
fields[](with types and statistics)suggested_charts[](suggested chart types with encodings)sample_data(first 10 rows for understanding context)
If script fails: Use manual pandas analysis
import pandas as pd
df = pd.read_csv('/mnt/user-data/uploads/<filename>')
# Classify: numeric→quantitative, datetime→temporal, <20 unique→nominal
2. Understand Data Context
Read sample data and column names to infer what the data represents:
- Biomedical data? → Biomarkers, patient outcomes, clinical relevance
- Financial data? → Trends, comparisons, performance metrics
- Sensor data? → Temporal patterns, anomalies, correlations
- E-commerce? → Sales trends, product comparisons, conversions
Ask: What questions would someone analyzing this data want answered?
Examples:
- Assay data: Which biomarkers strongest? Patterns across samples? Variability?
- Financial: What are trends? How volatile? Seasonal patterns?
- IoT: Temporal patterns? Anomalies? Sensor correlations?
3. Select Meaningful Charts (5-10 suggestions)
Filter analyze_data.py suggestions based on context and readability:
Apply readability filters:
- Pie chart with >7 categories → Skip (unreadable)
- Heatmap with >50 categories per axis → Aggregate first
- Multi-line with >10 series → Consider faceting
Prioritize charts that answer domain questions:
- Comparison needs → Bar, box plot, grouped bar
- Distribution analysis → Histogram, box plot
- Pattern recognition → Heatmap, scatter
- Temporal trends → Line, area
- Part-to-whole → Stacked bar (pie only if <7 categories)
Don't suggest charts just because data types match - choose charts that reveal insights.
4. Generate Chart Specs
Build specs programmatically using analyze_data.py encodings:
For each suggested chart type, construct spec using:
- Templates from
assets/templates/for basic types (bar, line, scatter, pie, heatmap, area) - Builder patterns from
references/spec-builder-patterns.mdfor variations (histogram, boxplot, grouped-bar, etc.) - Vega-Lite examples from
references/vega-lite-examples-inventory.mdfor uncommon types
Structure each chart as:
{"type": "Chart Name", "reason": "Why this chart", "spec": {/* vega-lite spec */}}
5. Create Artifact with Inline Data Island
Load data, read template, replace __DATA__ and __CHART_SPECS__ placeholders, write using bash heredoc.
6. Provide Link
[View chart explorer](computer:///mnt/user-data/outputs/ChartExplorer.jsx)
Created 7 contextually relevant charts for your data.
Secondary Workflow: Specific Chart Request
When user specifies chart type (e.g., "make a bar chart"):
1. Analyze Data
python /mnt/skills/user/charting-vega-lite/scripts/analyze_data.py /mnt/user-data/uploads/<filename>
2. Validate Chart Fits Data
Check requirements:
- Bar: needs 1 nominal + 1 quantitative
- Line: needs 1 temporal + 1 quantitative
- Scatter: needs 2 quantitative
- Heatmap: needs 2 nominal + 1 quantitative
- Pie: needs 1 nominal + 1 quantitative + <7 categories
If data doesn't fit:
- Explain: "Bar chart needs categorical data, but all columns are numeric"
- Suggest 2-3 alternatives
- Use Primary Workflow to create explorer with alternatives
3. Generate Spec
Use templates or programmatic builders based on chart type complexity.
4. Create Artifact
Same pattern as Primary Workflow step 5, but with single chart.
Error Prevention
Common failures:
-
Using fetch() in artifacts
- Solution: Always use inline data island pattern
- Never create external data files
-
Chart doesn't render
- Verify scripts load: Vega → Vega-Lite → Vega-Embed
- Check data is injected:
spec.data = {values: DATA} - Confirm field names match data columns
-
Generic/random chart suggestions
- Solution: Consider data context and meaning
- Filter suggestions for relevance and readability
- Prioritize charts that answer meaningful questions
Resources
Scripts:
scripts/analyze_data.py- analyze structure, suggest 8-12 chart types
Components:
assets/components/ChartExplorer.jsx- multi-chart explorer template
Templates:
assets/templates/*.json- 6 basic chart templates (bar, line, scatter, pie, heatmap, area)
References - Progressive Disclosure:
Read spec-builder-patterns.md when building charts programmatically (histogram, boxplot, grouped/stacked bars, multi-line, etc.)
Read vega-lite-examples-inventory.md when user requests uncommon chart type not in spec-builder-patterns
Read chart-types.md when validating specific chart requirements or user asks "what chart should I use for..."
Read advanced-charts.md for complete specs of specialized charts (sankey, waterfall, violin plots, complex layered compositions)
Read contextual-chart-selection.md for extended domain examples if unfamiliar with data domain (biomedical, financial, IoT, etc.)
Read online-resources.md to fetch Vega-Lite docs for advanced features (custom selections, transforms, conditional encoding)
Complete Workflow Example
User uploads assay data CSV (51 assays, 74 samples)
# 1. Analyze
python /mnt/skills/user/charting-vega-lite/scripts/analyze_data.py /mnt/user-data/uploads/assay_data.csv
# 2. Understand context: Multi-analyte immunoassay
# Questions: Which biomarkers strongest? Patterns across samples? Variability?
# 3. Build contextual charts (5-7 specs)
# Bar: Mean signal by assay
# Heatmap: Sample × Assay
# Box plot: Signal distribution by assay
# Histogram: Overall signal distribution
# etc.
# 4. Load data and template
df = pd.read_csv('/mnt/user-data/uploads/assay_data.csv')
data = df.to_dict(orient='records')
template = open('/mnt/skills/user/charting-vega-lite/assets/components/ChartExplorer.jsx').read()
# 5. Replace placeholders and write
artifact = template.replace('__DATA__', json.dumps(data)).replace('__CHART_SPECS__', json.dumps(charts))
# Use bash heredoc to avoid XML conflicts in tool parameters
# 6. Provide link
Created 7 charts for your assay data - bar charts show biomarker signals, heatmap reveals sample patterns, box plots display variability.
Critical Rules
- ALWAYS use inline data island pattern - No fetch(), no external files
- Consider data context - Choose meaningful charts based on what data represents, not just data types
- Filter by readability - Avoid charts with too many categories
- Use bash heredoc for file creation - Prevents XML conflicts when creating artifacts
- Provide links, not content - Output token efficiency
Charting: Python Static Visualizations
Select the optimal Python charting library and produce clean, publication-quality output.
Library Selection Framework
Choose the library based on what the visualization represents, not habit.
Seaborn — DEFAULT for statistical/analytical charts
Seaborn wraps matplotlib with better defaults, tighter pandas integration, and fewer lines of code. Reach for seaborn first when the data lives in a DataFrame and the goal is analytical.
Use for: distributions (histograms, KDEs, violin plots, ECDFs), categorical comparisons (box plots, swarm plots, strip plots, bar plots), correlation (heatmaps, pair plots, regression plots), grouped/faceted views (FacetGrid, catplot, relplot).
Why: Automatic axis labeling from column names, coherent color palettes, built-in aggregation with confidence intervals, and hue/col/row faceting with minimal code.
Practical rule: If the code would call plt.bar(), plt.hist(), plt.scatter(), or build a heatmap with plt.imshow() — use the seaborn equivalent instead. It will look better with less effort.
Matplotlib — fine-grained control and non-standard layouts
Drop to raw matplotlib only when seaborn doesn't support the chart type or when pixel-level layout control is required.
Use for: custom multi-panel figures mixing chart types, unusual annotations (arrows, shaded regions, custom legends), non-standard axes (polar, broken axes, insets), animations, image overlays, or any layout where the default seaborn API is insufficient.
Combine with seaborn: Seaborn plots return matplotlib Axes objects. Apply matplotlib customization on top of seaborn output rather than rebuilding from scratch.
Graphviz — graph/network structures
Graphviz operates in a fundamentally different domain: nodes and edges, not x/y data.
Use for: dependency trees, flowcharts, state machines, org charts, entity-relationship diagrams, DAGs, call graphs, any directed or undirected graph structure.
Python interface: Use the graphviz Python package (installed). Create graphviz.Digraph() or graphviz.Graph(), add nodes/edges, render to PNG/SVG/PDF.
import graphviz
g = graphviz.Digraph(format='png')
g.node('A', 'Start')
g.node('B', 'Process')
g.edge('A', 'B')
g.render('/home/claude/output', cleanup=True)
Layout engines: dot (hierarchical, default), neato (spring model), fdp (force-directed), circo (circular), twopi (radial). Set via g.engine = 'neato'.
Vega-Lite — interactive browser charts
When the user wants interactive, browser-rendered visualizations (tooltips, zoom, selection, filtering) or uploads data for exploratory charting, defer to the charting-vega-lite skill. That skill handles React artifact generation with inline data islands.
Decision shortcut: Static image file → this skill. Interactive artifact → charting-vega-lite.
Quick Reference: Chart Type → Library
| Need | Library | Function |
|---|---|---|
| Histogram / KDE | seaborn | sns.histplot(), sns.kdeplot() |
| Box / Violin / Swarm | seaborn | sns.boxplot(), sns.violinplot() |
| Bar (categorical) | seaborn | sns.barplot(), sns.countplot() |
| Correlation heatmap | seaborn | sns.heatmap() |
| Scatter + regression | seaborn | sns.scatterplot(), sns.regplot() |
| Pair plot (multi-var) | seaborn | sns.pairplot() |
| Faceted grid | seaborn | sns.FacetGrid, catplot, relplot |
| Time series line | seaborn | sns.lineplot() (handles CI bands) |
| Custom multi-panel | matplotlib | fig, axes = plt.subplots() |
| Polar / radar | matplotlib | projection='polar' |
| Annotated diagrams | matplotlib | ax.annotate(), arrows, patches |
| Dependency tree | graphviz | Digraph |
| Flowchart / FSM | graphviz | Digraph with shape attrs |
| ER diagram | graphviz | Graph with record shapes |
| Network graph | graphviz | Graph with layout engine |
Production Defaults
Apply these defaults to produce clean output without per-chart fiddling.
Seaborn Setup
import seaborn as sns
import matplotlib.pyplot as plt
sns.set_theme(style="whitegrid", palette="muted", font_scale=1.1)
Style options: whitegrid (default, good for most), white (cleaner for publications), darkgrid (data-dense plots), ticks (minimal).
Figure Sizing and DPI
fig, ax = plt.subplots(figsize=(10, 6))
# Or for seaborn figure-level functions:
g = sns.catplot(..., height=6, aspect=1.5)
# Save at publication quality
plt.savefig('/home/claude/chart.png', dpi=150, bbox_inches='tight', facecolor='white')
Use dpi=150 for screen/web output, dpi=300 for print. Always use bbox_inches='tight' to avoid clipped labels.
Color Guidance
- Categorical:
"muted","Set2","tab10"— distinct, accessible - Sequential:
"viridis","YlOrRd","Blues"— ordered magnitude - Diverging:
"RdBu","coolwarm"— centered on zero/midpoint - Avoid:
"jet","rainbow"— perceptually non-uniform, colorblind-hostile
Common Refinements
# Rotate x-labels if overlapping
plt.xticks(rotation=45, ha='right')
# Remove top/right spines for cleaner look
sns.despine()
# Thousands separator for large numbers
ax.yaxis.set_major_formatter(plt.FuncFormatter(lambda x, _: f'{x:,.0f}'))
Output Workflow
- Create chart in
/home/claude/ - Save as PNG (default) or SVG (if user needs vector)
- Copy to
/mnt/user-data/outputs/ - Present via
present_files
Always plt.close() after saving to free memory.
Exploring Data
0. Route by size FIRST
ls -la <filepath> # or: wc -l for row estimate
- < 200MB and < ~5M rows → ydata-profiling path (section A). Exact stats, interactive HTML.
- Larger → large-file path (section B). ydata-profiling loads everything into pandas and will crawl or OOM; the DuckDB/sketch path runs in fixed memory at any size.
- Task-specific ops (any size): duplicates, join feasibility, drift → section C.
A. Standard path (ydata-profiling)
1. Check if installed (instant)
bash /mnt/skills/user/exploring-data/scripts/check_install.sh
Returns: installed or not_installed
2. Install if needed (one-time, ~19s)
if [ "$(bash /mnt/skills/user/exploring-data/scripts/check_install.sh)" = "not_installed" ]; then
bash /mnt/skills/user/exploring-data/scripts/install_ydata.sh
fi
3. Run analysis (always generates JSON + HTML by default)
bash /mnt/skills/user/exploring-data/scripts/analyze.sh <filepath> [minimal|full] [html|json]
Defaults: minimal + html (also generates JSON)
Output:
eda_report.html- Interactive report for usereda_report.json- Machine-readable for Claude analysis
4. If Claude needs to analyze (user asks "what do you think?" etc.)
python /mnt/skills/user/exploring-data/scripts/summarize_insights.py /mnt/user-data/outputs/eda_report.json
Claude should read the stdout markdown summary, NOT the full JSON report.
5. Present findings visually (don't just hand over the ydata HTML)
The ydata report is exhaustive but dense; a link to it is a weak deliverable. Turn the JSON into a compact dashboard of the findings that matter:
python3 /mnt/skills/user/exploring-data/scripts/visualize_findings.py \
/mnt/user-data/outputs/eda_report.json
# → /mnt/user-data/outputs/eda_findings.html
Emits a single self-contained HTML file (Chart.js from cdnjs, dark-mode aware):
missingness by column (tiered good/bad), the most skewed or zero-inflated
numeric distributions as small-multiple histograms, and the largest categorical
breakdowns. --top N caps charts per category (default 6). Also reads
profile_large.py --json output, so the large-file path gets the same treatment.
Present BOTH files: eda_findings.html for the headline read, eda_report.html
for the full drill-down. In a chat surface that renders inline visuals, prefer
rendering the two or three findings that actually answer the user's question as
inline charts over linking a file — a link the user has to open is the weakest
form of "showing" data.
Modes
Minimal (default, 5-10s): overview, variable analysis, correlations, missing values, alerts Full (10-20s): minimal + scatter matrices, sample data, character analysis
Full-mode triggers: "comprehensive analysis", "detailed EDA", "full profiling", "deep analysis". Otherwise minimal.
Time series
If the data has a datetime index/column and the user cares about temporal behavior
(gaps, trends, seasonality, autocorrelation), pass tsmode=True to ProfileReport —
run the venv python directly instead of analyze.sh:
ProfileReport(df, tsmode=True, sortby="<datetime_col>", title=...)
This adds gap detection, stationarity and seasonality checks that the default report omits.
Small-file drift
Comparing two versions of a dataset that BOTH fit in memory: use ydata's native
compare — ProfileReport(df_a).compare(ProfileReport(df_b)).to_file(...).
For files too big to load, or comparing against a months-old file you no longer
have, use the sketch snapshot/drift ops in section C.
B. Large-file path (DuckDB, fixed memory)
1. Install deps (idempotent, ~10s first time)
bash /mnt/skills/user/exploring-data/scripts/install_large.sh
2. Profile
python3 /mnt/skills/user/exploring-data/scripts/profile_large.py <file> [--json out.json]
Streams the file through DuckDB: per-column null%, approximate distinct counts (HLL), min/max/mean, approximate quantiles (t-digest) for numerics, top-5 values for strings, plus quality flags (mostly-null, constant, id-like columns). Markdown lands on stdout — read it directly, no summarize step needed. Handles csv/tsv/parquet/json/ndjson. 1M rows profiles in seconds; memory is flat regardless of file size.
For ad-hoc follow-up queries on the same large file, use DuckDB SQL directly
(duckdb.connect().execute("SELECT ... FROM read_csv_auto('...')")) rather
than loading pandas.
C. Sketch ops (any file size, fixed memory)
All via scripts/sketch_ops.py (deps from install_large.sh). These answer
questions profilers don't:
Near-duplicate rows
python3 sketch_ops.py dups <file> [--threshold 0.9] [--cols a,b,c] [--unweighted]
Exact duplicates counted by hash; near-duplicates via MinHash LSH over row
tokens. --threshold is a weighted Jaccard cutoff: a token occurring c
times in a row counts c times, so new york new york and york new score 0.5
rather than 1.0. Pass --unweighted for set semantics, where repeats are
discarded. Use --cols to restrict to the columns that define identity.
Key overlap / join feasibility
python3 sketch_ops.py overlap <fileA> <fileB> --key <col> [--key-b <col>]
Theta sketches per key column → estimated intersection, Jaccard, and "% of A's keys in B" both ways — answers "will this join hold?" without loading either file.
Drift vs stored baseline
python3 sketch_ops.py snapshot <file> --out baseline.sketch.json # ~20KB
python3 sketch_ops.py drift <newfile> --baseline baseline.sketch.json
Snapshot serializes HLL (all columns) + KLL quantile sketches (numeric columns) to a small JSON. Drift reports schema changes, >10% shifts in distinct counts, and IQR-relative quantile movement. The snapshot is a few KB — store it (repo, memory) and diff next month's delivery against it without keeping the original file.
Note: snapshot/dups stream rows through Python (~1M rows in a few seconds); profile_large is pure DuckDB and faster. For a quick look at a big file, profile first, sketch ops only when the question calls for them.
Extracting Keywords
Extract keywords from text using YAKE (Yet Another Keyword Extractor), an unsupervised statistical keyword extraction algorithm.
Installation
First time only: Install YAKE with optimized dependencies to avoid unnecessary downloads.
cd /home/claude
uv venv yake-venv --system-site-packages
uv pip install yake --python yake-venv/bin/python --no-deps
uv pip install jellyfish segtok regex --python yake-venv/bin/python
This reuses system packages (numpy, networkx) instead of downloading them (~0.08s vs ~5s).
Stopwords Configuration
Built-in YAKE stopwords (34 languages): Use lan="<code>" parameter
- See Parameters section below for all 34 supported language codes
- English (
lan="en") is the default
Custom domain stopwords (bundled in assets/):
AI/ML: stopwords_ai.txt
- English stopwords + 783 AI/ML domain-specific terms (1357 total)
- Filters AI/ML methodology noise (model, training, network, algorithm, parameter)
- Filters ML boilerplate (dataset, baseline, benchmark, experiment, evaluation)
- Filters technical terms (transformer, embedding, attention, optimization, inference)
- Includes full lemmatization (train/trains/trained/training/trainer)
- Use for AI/ML papers, technical reports, machine learning literature
- Performance impact: +4-5% runtime vs English stopwords
Life Sciences: stopwords_ls.txt
- English stopwords + 719 life sciences domain-specific terms (1293 total)
- Filters research methodology noise (study, results, analysis, significant, observed)
- Filters academic boilerplate (paper, manuscript, publication, review, editing)
- Filters statistical terms (correlation, distribution, deviation, variance)
- Filters clinical terms (patient, treatment, diagnosis, symptom, therapy)
- Filters biology/medicine (cell, tissue, protein, gene, organism)
- Includes full lemmatization (analyze/analyzes/analyzed/analyzing/analysis)
- Use for biomedical papers, clinical studies, research articles, scientific literature
- Performance impact: +4-5% runtime vs English stopwords
Basic Usage
import yake
# Read text
with open('document.txt', 'r') as f:
text = f.read()
# Extract with English stopwords (default)
kw_extractor = yake.KeywordExtractor(
lan="en", # Language code
n=3, # Max n-gram size (1-3 word phrases)
dedupLim=0.9, # Deduplication threshold (0-1)
top=20 # Number of keywords to return
)
keywords = kw_extractor.extract_keywords(text)
# Display results (lower score = more important)
for kw, score in keywords:
print(f"{score:.4f} {kw}")
Domain-Specific Extraction
Using Life Sciences Stopwords
Option 1: Install custom stopwords file
# Copy life sciences stopwords to YAKE package
cp assets/stopwords_ls.txt /home/claude/yake-venv/lib/python3.12/site-packages/yake/core/StopwordsList/stopwords_ls.txt
# Use with lan="ls"
kw_extractor = yake.KeywordExtractor(lan="ls", n=3, top=20)
Option 2: Load custom stopwords directly
# Load stopwords from file
with open('assets/stopwords_ls.txt', 'r') as f:
custom_stops = set(line.strip().lower() for line in f)
# Pass to extractor
kw_extractor = yake.KeywordExtractor(
stopwords=custom_stops,
n=3,
top=20
)
Using AI/ML Stopwords
# Load AI/ML stopwords
with open('/mnt/skills/user/extracting-keywords/assets/stopwords_ai.txt', 'r') as f:
ai_stops = set(line.strip().lower() for line in f)
# Extract with AI stopwords
kw_extractor = yake.KeywordExtractor(
stopwords=ai_stops,
n=3,
top=20
)
keywords = kw_extractor.extract_keywords(text)
Deeper Extraction (n=2 + n=3 Combined)
For more comprehensive extraction, run both n=2 and n=3 and consolidate results. This captures both focused phrases and broader context with ~100% time overhead (still <2s for large documents).
import yake
# Load domain stopwords
with open('/mnt/skills/user/extracting-keywords/assets/stopwords_ai.txt', 'r') as f:
stops = set(line.strip().lower() for line in f)
# Extract with n=2 (captures focused phrases)
kw_n2 = yake.KeywordExtractor(stopwords=stops, n=2, dedupLim=0.9, top=50)
results_n2 = kw_n2.extract_keywords(text)
# Extract with n=3 (captures broader context)
kw_n3 = yake.KeywordExtractor(stopwords=stops, n=3, dedupLim=0.9, top=50)
results_n3 = kw_n3.extract_keywords(text)
# Consolidate: union with score averaging for overlaps
combined = {}
for kw, score in results_n2:
combined[kw] = score
for kw, score in results_n3:
if kw in combined:
combined[kw] = (combined[kw] + score) / 2
else:
combined[kw] = score
# Sort by score (lower = more important)
consolidated = sorted(combined.items(), key=lambda x: x[1])
# Display top 30
for kw, score in consolidated[:30]:
print(f"{score:.4f} {kw}")
Benefits:
- n=2 extracts cleaner domain-specific phrases ("disk move", "error rate")
- n=3 captures contextual combinations ("Move disk 1", "per-step error rate")
- Consolidation provides richer keyword set for topic modeling or search indexing
Performance:
- Combined approach: ~2x runtime of single extraction
- Typical timing: 0.4s (small doc) to 1.0s (large doc)
- Use when quality matters more than speed
Parameters
lan (str): Language code for built-in stopwords
"en"- English (default)"ai"- AI/ML (if stopwords_ai.txt installed in YAKE)"ls"- Life sciences (if stopwords_ls.txt installed in YAKE)
Built-in YAKE languages (34 total):
"ar"- Arabic"bg"- Bulgarian"br"- Breton"cz"- Czech"da"- Danish"de"- German"el"- Greek"es"- Spanish"et"- Estonian"fa"- Farsi/Persian"fi"- Finnish"fr"- French"hi"- Hindi"hr"- Croatian"hu"- Hungarian"hy"- Armenian"id"- Indonesian"it"- Italian"ja"- Japanese"lt"- Lithuanian"lv"- Latvian"nl"- Dutch"no"- Norwegian"pl"- Polish"pt"- Portuguese"ro"- Romanian"ru"- Russian"sk"- Slovak"sl"- Slovenian"sv"- Swedish"tr"- Turkish"uk"- Ukrainian"zh"- Chinese
n (int): Maximum n-gram size (default: 3)
1- Single words only2- Up to 2-word phrases3- Up to 3-word phrases (recommended)4-5- May produce suboptimal results with YAKE's algorithm
dedupLim (float): Deduplication threshold (default: 0.9)
- Range: 0.0 to 1.0
- Higher values = more aggressive deduplication
- Controls handling of similar terms (e.g., "cancer cell" vs "cancer cells")
top (int): Number of keywords to return (default: 20)
stopwords (set): Custom stopwords set (overrides lan parameter)
Workflow Patterns
Single Document Analysis
import yake
# Read document
with open('/mnt/user-data/uploads/article.txt', 'r') as f:
text = f.read()
# Extract keywords
kw_extractor = yake.KeywordExtractor(lan="en", n=3, top=30)
keywords = kw_extractor.extract_keywords(text)
# Format results
results = []
for kw, score in keywords:
results.append(f"{score:.4f} {kw}")
print("\n".join(results))
Comparing Stopwords Strategies
import yake
# Load life sciences stopwords
with open('assets/stopwords_ls.txt', 'r') as f:
ls_stops = set(line.strip().lower() for line in f)
# Extract with English stopwords
kw_en = yake.KeywordExtractor(lan="en", n=3, top=20)
keywords_en = kw_en.extract_keywords(text)
# Extract with life sciences stopwords
kw_ls = yake.KeywordExtractor(stopwords=ls_stops, n=3, top=20)
keywords_ls = kw_ls.extract_keywords(text)
# Compare results
print("English stopwords:")
for kw, score in keywords_en:
print(f" {score:.4f} {kw}")
print("\nLife sciences stopwords:")
for kw, score in keywords_ls:
print(f" {score:.4f} {kw}")
Batch Processing
import yake
import os
# Initialize extractor
kw_extractor = yake.KeywordExtractor(lan="en", n=3, top=15)
# Process multiple files
results = {}
for filename in os.listdir('/mnt/user-data/uploads'):
if filename.endswith('.txt'):
with open(f'/mnt/user-data/uploads/{filename}', 'r') as f:
text = f.read()
keywords = kw_extractor.extract_keywords(text)
results[filename] = keywords
# Output results
for filename, keywords in results.items():
print(f"\n{filename}:")
for kw, score in keywords[:10]: # Top 10
print(f" {score:.4f} {kw}")
Multilingual Extraction
import yake
# French document
with open('/mnt/user-data/uploads/article_fr.txt', 'r') as f:
french_text = f.read()
# Extract with French stopwords
kw_fr = yake.KeywordExtractor(lan="fr", n=3, top=20)
keywords_fr = kw_fr.extract_keywords(french_text)
print("Mots-clés (French):")
for kw, score in keywords_fr:
print(f" {score:.4f} {kw}")
# German document
with open('/mnt/user-data/uploads/artikel_de.txt', 'r') as f:
german_text = f.read()
# Extract with German stopwords
kw_de = yake.KeywordExtractor(lan="de", n=3, top=20)
keywords_de = kw_de.extract_keywords(german_text)
print("\nSchlüsselwörter (German):")
for kw, score in keywords_de:
print(f" {score:.4f} {kw}")
Output Formats
Plain Text
for kw, score in keywords:
print(f"{kw}: {score:.4f}")
CSV
import csv
with open('/mnt/user-data/outputs/keywords.csv', 'w', newline='') as f:
writer = csv.writer(f)
writer.writerow(['Keyword', 'Score'])
writer.writerows(keywords)
JSON
import json
output = [{"keyword": kw, "score": score} for kw, score in keywords]
with open('/mnt/user-data/outputs/keywords.json', 'w') as f:
json.dump(output, f, indent=2)
Notes
- Lower scores indicate more important keywords
- YAKE is unsupervised - no training data required
- Supports 34 languages - built-in stopwords for Arabic, Bulgarian, Chinese, Czech, Danish, Dutch, English, Estonian, Farsi, Finnish, French, German, Greek, Hindi, Croatian, Hungarian, Armenian, Indonesian, Italian, Japanese, Lithuanian, Latvian, Norwegian, Polish, Portuguese, Romanian, Russian, Slovak, Slovenian, Spanish, Swedish, Turkish, Ukrainian, and more
- Optimal n-gram size is 2 or 3 for most use cases
- For longer technical phrases (4+ words), consider post-processing or ontology matching
- Always specify full venv path:
/home/claude/yake-venv/bin/python
Troubleshooting
Import errors: Verify venv installation
/home/claude/yake-venv/bin/python -c "import yake; print(yake.__version__)"
Empty results: Check text length (YAKE needs sufficient content, typically 100+ words)
Poor quality keywords: Adjust parameters:
- Increase
dedupLimfor more aggressive deduplication - Try domain-specific stopwords
- Increase
topto see more candidates
Generic terms appearing: Add custom stopwords for your domain:
with open('assets/stopwords_ls.txt', 'r') as f:
stops = set(line.strip().lower() for line in f)
# Add domain-specific terms
stops.update(['term1', 'term2', 'term3'])
kw_extractor = yake.KeywordExtractor(stopwords=stops, n=3, top=20)
Reverso Time Series Forecasting
Produce zero-shot univariate time series forecasts using the Reverso foundation model family (arXiv:2602.17634), implemented in NumPy/Numba for CPU-only container execution.
Setup (run once per conversation)
uv pip install numba --system --break-system-packages
cp /mnt/skills/user/forecasting-reverso/scripts/reverso.py /home/claude/reverso.py
cp /mnt/skills/user/forecasting-reverso/scripts/load_checkpoint.py /home/claude/load_checkpoint.py
Obtaining Weights
Two paths depending on network access:
Path A: Direct download (HuggingFace allow-listed)
import urllib.request, os
os.makedirs("/tmp/reverso", exist_ok=True)
url = "https://huggingface.co/shinfxh/reverso/resolve/main/checkpoints/reverso_small/checkpoint.pth"
urllib.request.urlretrieve(url, "/tmp/reverso/checkpoint.pth")
Path B: User upload (HuggingFace not accessible)
If the download fails with a network error, tell the user:
I can't reach HuggingFace from this environment. Please download the checkpoint from https://huggingface.co/shinfxh/reverso/blob/main/checkpoints/reverso_small/checkpoint.pth and upload it here.
Then load from /mnt/user-data/uploads/checkpoint.pth.
Loading weights
from load_checkpoint import load_checkpoint
weights = load_checkpoint("/tmp/reverso/checkpoint.pth") # or upload path
Model Configuration
Reverso Small uses this config (matching the published args.json):
from reverso import ReversoConfig
config = ReversoConfig(d_model=64, module_list=["conv", "attn", "conv", "attn"])
Forecasting
from reverso import forecast, warmup_jit
warmup_jit() # ~2s one-time JIT compilation
result = forecast(
series=data, # 1-D array/list of floats
prediction_length=96, # how many future steps
weights=weights, # dict from load_checkpoint
config=config,
)
The function handles preprocessing (NaN interpolation, padding, min-max normalization) and autoregressive rollout internally.
Key parameters
flip_equivariant=True — averages forward pass on original and vertically-flipped input. Slightly improves single-step predictions but can dampen amplitude over multi-step rollout. Default is False.
Input Handling
Accept time series as Python list, NumPy array, CSV column, or inline values. Convert to 1-D float array before calling forecast().
For CSV/DataFrame input, ask the user which column to forecast if ambiguous.
The model's context window is 2048 steps. Series shorter than 2048 are left-padded with the first value. Series longer than 2048 use only the most recent 2048 observations. Provide at least a few hundred real data points for meaningful results — heavily padded context degrades forecast quality because the long convolution kernels process mostly constant input.
Visualization
import matplotlib.pyplot as plt
fig, ax = plt.subplots(figsize=(12, 4))
n = len(history)
ax.plot(range(n), history, label="Historical", color="#2563eb")
ax.plot(range(n, n + len(preds)), preds,
label="Forecast", color="#dc2626", linewidth=2)
ax.axvline(x=n, color="gray", linestyle="--", alpha=0.4)
ax.set_xlabel("Time step"); ax.set_ylabel("Value")
ax.legend(); fig.tight_layout()
fig.savefig("/mnt/user-data/outputs/forecast.png", dpi=150)
Performance
| Phase | Latency |
|---|---|
| numba install (uv) | ~1.6s |
| Weight loading (.pth) | <1s |
| JIT warmup | ~2s |
| Forward pass (L=2048) | ~80ms |
| 96-step forecast (2 chunks) | ~160ms |
| 192-step forecast (4 chunks) | ~320ms |
Container Environment Limits
Each forward pass takes ~65ms at L=2048. In the ephemeral container, reject batch forecasting requests that would exceed ~1500 forward passes (~100s wall time) to avoid timeouts.
Detect the container environment by checking for /mnt/user-data or /mnt/skills:
import os
IN_CONTAINER = os.path.exists("/mnt/user-data")
Estimate cost before running when processing multiple series:
n_forwards = n_series * n_windows * max(1, pred_length // 48)
est_seconds = n_forwards * 0.065
if IN_CONTAINER and est_seconds > 100:
# Reject or subsample
max_series = int(1500 / (n_windows * max(1, pred_length // 48)))
Practical limits at ~100s budget:
| Scenario | Series | Windows | Pred steps | Forwards | Time |
|---|---|---|---|---|---|
| Single series, 96-step | 1 | 1 | 2 chunks | 2 | 0.1s |
| Small dataset (sz_taxi) | 156 | 6 | 48 | 936 | 61s |
| Medium dataset, short horizon | 300 | 4 | 48 | 1200 | 78s |
| Large dataset (m4_yearly) | 22974 | 1 | 48 | 22974 | 25min ✗ |
When a request exceeds the budget, inform the user with the estimated time and suggest either subsampling or running locally. For benchmark evaluation of large datasets, recommend running outside the container.
Limitations
The model is strongest with periodic or quasi-periodic signals and full 2048-point context. Short series (under ~200 points) are heavily padded and produce degraded forecasts — this is a model limitation, not an implementation bug. Edge cases: binary-valued input (e.g. step functions normalizing to exactly 0/1) and series ending at the exact min-max boundary are out-of-distribution for the training data.
For architecture details, weight mapping, and debugging guidance, read references/architecture.md.
JSON Render UI
Overview
Transform natural language UI requests into working dashboards and applications. Claude acts as the translation layer (prompt → JSON), the skill provides the rendering runtime (JSON → UI).
Architecture:
User prompt → Claude (constrained by catalog) → UITree JSON → Preact renderer → UI
Output Format
Claude emits a UITree structure:
{
"root": "main",
"elements": {
"main": {
"key": "main",
"type": "Grid",
"props": { "columns": 2, "gap": "md" },
"children": ["metric1", "metric2"]
},
"metric1": {
"key": "metric1",
"type": "Metric",
"props": {
"label": "Revenue",
"valuePath": "/revenue",
"format": "currency"
}
},
"metric2": {
"key": "metric2",
"type": "Metric",
"props": {
"label": "Growth",
"valuePath": "/growth",
"format": "percent"
}
}
},
"data": {
"revenue": 125000,
"growth": 0.15
}
}
Component Catalog
Claude can ONLY use these components. This is the guardrail.
Layout Components
| Component | Props | Children | Description |
|---|---|---|---|
Card | title?, description?, padding?: sm|md|lg | Yes | Container with optional header |
Grid | columns?: 1-4, gap?: sm|md|lg | Yes | CSS grid layout |
Stack | direction?: horizontal|vertical, gap?: sm|md|lg, align?: start|center|end|stretch | Yes | Flexbox stack |
Data Display
| Component | Props | Children | Description |
|---|---|---|---|
Metric | label, valuePath, format?: number|currency|percent, trend?: up|down|neutral, trendValue? | No | Single KPI display |
Chart | type: bar|line|pie|area, dataPath, title?, height? | No | Data visualization |
Table | dataPath, columns: [{key, label, format?: text|currency|date|badge}] | No | Tabular data |
List | dataPath, emptyMessage? | Yes | Rendered list from array |
Interactive
| Component | Props | Children | Description |
|---|---|---|---|
Button | label, action, variant?: primary|secondary|danger|ghost, size?: sm|md|lg, disabled? | No | Clickable action |
Select | label?, bindPath, options: [{value, label}], placeholder? | No | Dropdown select |
DatePicker | label?, bindPath, placeholder? | No | Date input |
Typography
| Component | Props | Children | Description |
|---|---|---|---|
Heading | text, level?: h1|h2|h3|h4 | No | Section heading |
Text | content, variant?: body|caption|label, color?: default|muted|success|warning|danger | No | Text paragraph |
Status
| Component | Props | Children | Description |
|---|---|---|---|
Badge | text, variant?: default|success|warning|danger|info | No | Status indicator |
Alert | type: info|success|warning|error, title, message?, dismissible? | No | Notification banner |
Special
| Component | Props | Children | Description |
|---|---|---|---|
Divider | label? | No | Visual separator |
Empty | title, description?, action?, actionLabel? | No | Empty state |
Data Binding
Props ending in Path (e.g., valuePath, dataPath, bindPath) reference the data model using JSON Pointer syntax:
/revenue→data.revenue/users/0/name→data.users[0].name/filters/dateRange→data.filters.dateRange
Visibility Conditions
Any element can have a visible property:
{
"type": "Alert",
"props": { "type": "error", "title": "Error" },
"visible": { "path": "/hasError" }
}
Visibility expressions:
true/false— Static{ "path": "/some/path" }— Truthy check{ "and": [...] }— All conditions true{ "or": [...] }— Any condition true{ "not": {...} }— Negation{ "eq": [a, b] }— Equality
Generating Output
Step 1: Emit UITree JSON
Analyze the user's request and emit a UITree structure. Include sample data that matches the schema.
Step 2: Create Artifact
Create an HTML artifact that:
- Embeds the UITree JSON
- Renders the UI
Start from assets/template.html, which already carries the embedded renderer —
there is no separate renderer.js to inline.
Constraints
DO:
- Use only catalog components
- Provide realistic sample data
- Use semantic component choices (Metric for KPIs, Table for tabular data)
- Keep trees flat (no deep nesting beyond 3 levels)
DO NOT:
- Invent new component types
- Use arbitrary HTML/CSS
- Omit required props
- Create deeply nested structures
Example
User: "Create a sales dashboard with revenue, orders, and a chart showing monthly trends"
Claude outputs:
{
"root": "dashboard",
"elements": {
"dashboard": {
"key": "dashboard",
"type": "Stack",
"props": { "direction": "vertical", "gap": "lg" },
"children": ["header", "metrics", "chartCard"]
},
"header": {
"key": "header",
"type": "Heading",
"props": { "text": "Sales Dashboard", "level": "h1" }
},
"metrics": {
"key": "metrics",
"type": "Grid",
"props": { "columns": 3, "gap": "md" },
"children": ["revenue", "orders", "avgOrder"]
},
"revenue": {
"key": "revenue",
"type": "Card",
"props": { "padding": "md" },
"children": ["revenueMetric"]
},
"revenueMetric": {
"key": "revenueMetric",
"type": "Metric",
"props": {
"label": "Total Revenue",
"valuePath": "/revenue",
"format": "currency",
"trend": "up",
"trendValue": "12%"
}
},
"orders": {
"key": "orders",
"type": "Card",
"props": { "padding": "md" },
"children": ["ordersMetric"]
},
"ordersMetric": {
"key": "ordersMetric",
"type": "Metric",
"props": {
"label": "Orders",
"valuePath": "/orders",
"format": "number"
}
},
"avgOrder": {
"key": "avgOrder",
"type": "Card",
"props": { "padding": "md" },
"children": ["avgMetric"]
},
"avgMetric": {
"key": "avgMetric",
"type": "Metric",
"props": {
"label": "Avg Order Value",
"valuePath": "/avgOrderValue",
"format": "currency"
}
},
"chartCard": {
"key": "chartCard",
"type": "Card",
"props": { "title": "Monthly Trends", "padding": "md" },
"children": ["chart"]
},
"chart": {
"key": "chart",
"type": "Chart",
"props": {
"type": "line",
"dataPath": "/monthlyData",
"height": 300
}
}
},
"data": {
"revenue": 284500,
"orders": 1247,
"avgOrderValue": 228,
"monthlyData": [
{ "month": "Jan", "value": 18000 },
{ "month": "Feb", "value": 22000 },
{ "month": "Mar", "value": 28000 },
{ "month": "Apr", "value": 24000 },
{ "month": "May", "value": 32000 }
]
}
}
Then wrap in the artifact template from assets/template.html.
Files
assets/template.html— Complete artifact template with embedded rendererassets/catalog.json— Machine-readable component schemasreferences/uitree-format.md— Detailed UITree specification
Making Tiny Little Office links
Tiny Little Office (tinylittleoffice.com) keeps a whole document in its URL fragment, after the #, which browsers never send to a server. You write the document as TLO text (Markdown plus a few additions), percent-encode it into a link and hand the link over. Whoever opens it gets an editor on their own copy, and the address bar updates after each edit to hold the new version.
Procedure
- Pick the app from the table below. Read only that app's reference file. It holds the shapes the app reads and one or two worked examples.
- Write the TLO to a file in your scratchpad. Copy an example from the reference and change it rather than starting from nothing.
- Build the link with the script, which packs the text the way the site does and runs the offline lint:
It prints the URL on stdout, and findings and length warnings on stderr.python3 scripts/tlo.py link deck talk.tlo --title "My talk" --by "Muninn" - Fix every finding and rebuild.
python3 scripts/tlo.py read <url>gives back the text any link holds, packed or plain, so you can edit a link you were sent. It also reads links a chat client mangled (percent-encoded, a quote glued to the end);tlo.py repair <url>prints the clean link. - Deliver. If the link is under 2,000 characters, give it as a Markdown link with a plain description. If it is longer, put the bare URL alone in a fenced code block. Chat renderers and some apps break or truncate long links, and the code block keeps it whole for copying. Put the link on its own line: Webex, for one, pulls a following quote or bracket into the link. Say that the link is the document: an edit produces a new link, and anyone holding the link can read it.
The script makes the packed form the site itself shares: #/v1/<app>/<flag><payload>, the TLO deflated against TLO's frozen word dictionary, base64url with - for 62 and a + every 300 characters so messaging apps don't break it. The site itself writes ~ for 62 and reads - as well. This script writes - because chat clients such as Webex percent-encode ~ (sometimes twice, %257E) and the site does not decode that, so the link opens empty. --tilde reproduces the site's own output. It runs 35–50% shorter than the readable form. --title and --by go into the document's head. --plain gives the readable /<app>/#title=…&doc=… form instead, which the site also opens and packs on arrival.
Apps
| App | Reference | For |
|---|---|---|
write | references/write.md | Letters, memos, résumés, invoices, contracts, a table that adds up |
outline | references/outline.md | Nested ideas; the same tree can open as slides, a mind map or an org chart |
deck | references/deck.md | Slides, plus format: poster / zine / booklet / brochure / comic / badges |
sheet | references/sheet.md | Tables with formulas, bar/line/pie/sankey charts, named-cell models |
calc | references/calc.md | Sums with names, unit conversion, y = f(x) graphs |
draw | references/draw.md | Boxes and arrows on an 8px grid; pixel art |
diagram | references/diagram.md | kind: mind, org, family, lanes, timeline, venn, seating, net |
anim | references/anim.md | A drawing with keyframes |
cal | references/cal.md | Events, repeats, time zones; view: gantt for schedules |
trip | references/trip.md | Stops with lat/lon and notes on a map |
Load these only when needed. references/api.md covers file downloads (view=pdf|pptx|xlsx|…), encrypted short links, the JS API and npm CLI, password-sealed links and the official lint's full finding list. references/editors.md lists keyboard shortcuts for driving the editors in a browser.
Routing: numbers go in sheet, quick arithmetic in calc, prose in write, a tree of notes in outline, anything presented in deck. A diagram lays itself out, so prefer diagram over draw whenever one of its kinds fits. Tasks over weeks go in cal with view: gantt.
The URL
https://tinylittleoffice.com/<app>/#title=<title>&doc=<TLO, percent-encoded>
- Parameters go after
#, never after?. - Optional parameters:
by=(who made it, an unverified claim),view=(pdf,png,html,md,tlo, the app's own formats such aspptx,xlsxorics;embedfor an iframe;showto open a deck presenting). - A head line
app: sheetletshttps://tinylittleoffice.com/#doc=…work without the app in the path. - Length: QR codes hold 2,953 characters. Encrypted short links hold up to 12,272 (see api.md). Past 2,000, some chat apps cut the link.
TLO in one table
Write ordinary Markdown: headings, paragraphs, - and 1. lists nested by two spaces, - [ ] tasks, > quotes, pipe tables, **bold**, *italic*, `code`, [words](url), and footnotes as ^[note]. TLO adds the following:
| Write | Means |
|---|---|
--- / key: value / --- at the top | The head: title, by, theme, chart, kind, zone, format… |
{#id .class key=value} at line end | Attributes: {.title}, {.two}, {due=2027-03-01}, {color=green every=week} |
Price:money in a table header | Typed column: text number money percent date time check url rich long icon name option |
~ A -> B: label | A connection (->, <-, <->, --) |
```sheet … ``` | Another app's document embedded here (any of the ten ids) |
==hi==, ++under++, :rocket: | Highlight, underline, Lucide icon by name |
A --- between blocks starts the next slide, page or card. Any table is a live spreadsheet. Nothing is fetched from the web:  renders as a plain link.
Rules agents break
- Whitespace is content. Nesting is two spaces per level, and a dropped space flattens the tree. Never hard-wrap a paragraph, because each line break is kept.
- One thing per slide. A slide with a fence (chart, diagram, table) shows only that fence under its headline, and bullets on the same slide are dropped. Put the commentary in
>notes or on its own slide. A{.title}slide takes a line or two, not a list. - Commas split lists. In Venn and seating lists, "2,000 cases" becomes two things. Write 2000.
- Diagram things are short names. Two to four words each. Connection ends must match a listed name exactly (the text before
|). - Embed, don't link. Put another document inside as a fence rather than linking to a second TLO URL.
- A link is a copy. There is no shared live document. For a sign-up sheet or a form, tell people to send their edited link back. A short link is frozen once made.
Verifying
scripts/tlo.py lint is an offline subset of the official checks: fence-bullets, title-long, title-list, body-over, edge-end, edge-unused, net-colon, comma-number, label-long, doc-link and length. It is fast and needs no network. It does not measure rendered text or evaluate formulas. When Node is available and running third-party npm code is acceptable, npx tinylittleoffice lint <link> and measure run the real layout code and also catch formula-error, label-over and exact overflow (see api.md).
If a finding persists, the fix is in the TLO, not the URL. Re-read the app's reference rule for that shape.
Sponsors
Details
- Marketplace
- oaustegard/claude-skills
- Source
- plugins/data-and-visualization
- Category
- Data And Visualization
- License
- MIT
- Keywords
- charting, charting-vega-lite, exploring-data, extracting-keywords, forecasting-reverso, json-render-ui, making-tinyoffice-links
More from oaustegard/claude-skills
All 14- deciding-with-confidencev0.4.0
- declaudingv0.14.0
- delegating-with-contextv0.3.0
- development-toolsv1.2.1
- environment-and-configv2.0.0
- github-and-gitv2.0.1
- knowledge-and-memoryv1.3.0
- media-processingv2.3.0
- skill-developmentv2.6.0
- social-and-lifestylev1.0.0
- web-and-retrievalv1.0.4
- ai-and-reasoningv2.9.1
- code-intelligencev2.6.0