Communitygithub.com

Varnan-Tech/opendirectory

データ可視化チャート(棒、折れ線、面、円、ドーナツ、散布、レーダー、ツリーマップ)をApache ECharts v6を使用してPNGとして生成します。1080×1080pxのデフォルトサイズ、5種類のスタイルプリセット、ハイライト注釈機能を備えています。

opendirectory とは?

このスキルは、ユーザーのデータ可視化リクエストに応じて、Apache ECharts v6 を用いた高品質なチャート画像(PNG)を生成するAIエージェント機能です。PlaywrightによるヘッドレスChromiumを介して2倍のRetina品質でレンダリングします。対応するチャートタイプは棒、折れ線、面、円、ドーナツ、散布、レーダー、ツリーマップの8種類で、5つのスタイルプリセット(clean-slate, midnight-editorial, matt-gray, electric-burst, brutalist)から選択できます。データはJSON配列またはCSVで提供し、タイトル、サブタイトル、軸ラベル、データソース、特定のデータポイントのハイライトなど、豊富なカスタマイズオプションをサポートします。内部では、チャートタイプの自動正規化(area→line、doughnut→pie)、ECharts特有のバグ回避(finishedイベントの事前登録)、スタイルプリセットの適用、設計品質の自己チェックなど、堅牢で信頼性の高いチャート生成プロセスが実装されています。

対応✓Claude Code~Codex CLI~Cursor✓Gemini CLI
npx skills add https://github.com/Varnan-Tech/opendirectory/tree/main/skills/graphic-chart

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

graphic-chart

データ可視化チャートをPNGとして生成します。Apache ECharts v6 を使用してHTMLをレンダリングし、Playwright経由でヘッドレスChromiumでキャプチャ→2倍Retina品質のスクリーンショットを出力します。

CDN: https://cdn.jsdelivr.net/npm/[email protected]/dist/echarts.min.js


重要なルール(毎回の生成前に必読)

  1. area タイプ → type: 'line' + areaStyle: {} — EChartsに type: 'area' はありません。
  2. doughnut → type: 'pie' + radius: ['40%', '70%'] — EChartsに type: 'doughnut' はありません。
  3. 準備完了シグナル: chart.on('finished', fn) を chart.setOption() の前に登録する — EChartsのバグ #14101/#17500 により、リスナーをsetOptionの後に登録すると、発火しなくなります。常に finished と rendered イベントの両方をsetOptionの前に登録してください。
  4. xAxis.type: 'category' は明示的に指定する必要があります — EChartsはデータから自動推測しません。これを忘れると空白のチャートが生成されます。
  5. カテゴリラベルは xAxis.data に配置します。data.labels 配列ではありません。EChartsの構造はフラットです: { xAxis, yAxis, series, grid, title, legend } — data や options の下にネストしません。
  6. データラベルは完全にビルトインです — 任意の系列で label: { show: true } を使用します。プラグインは不要です。
  7. 特定の棒/ポイントのハイライトは、アイテムごとの itemStyle で行います — data 配列に { value: N, itemStyle: { color: '#...' } } を直接配置します。Chart.js スタイルの backgroundColor 配列は使用しないでください。
  8. EChartsの初期化には <div> コンテナを使用し、<canvas> は使用しません — echarts.init(document.getElementById('chart'))。コンテナdivには明示的な寸法が必要です。
  9. オプション内で animation: false — アニメーションを無効にして即時レンダリングを行います。それでも準備完了シグナルのために、finished + rendered イベントをsetOptionの前に登録してください。
  10. HTMLをチャット内にダンプしないでください。 ファイルに保存し、サマリーのみ表示します。
  11. タイトルは洞察を示し、主題を示しません。 「月間売上」ではなく「12ヶ月で売上が3倍に成長」。
  12. 円/ドーナツチャート: body の padding: 64px 80px と .chart-container { max-height: 860px } を使用します — タイトルがない場合の端から端までの塗りつぶしを防ぎます。

ステップ 1: 情報受け取り

必須: chart_type、data

オプションパラメータとデフォルト値:

パラメータデフォルト説明
chart_type—bar / line / area / pie / doughnut / scatter / radar / treemap
data—JSON配列またはCSV — 必須
title—洞察を示す、10語以内
subtitle—1文のコンテキスト行
styleclean-slateclean-slate / midnight-editorial / matt-gray / electric-burst / brutalist
dimensions1080x1080WxH ピクセル(出力PNGは deviceScaleFactor により2倍)
x_label—X軸ラベルテキスト
y_label—Y軸ラベルテキスト
source—フッターに表示するデータソース
highlight—ハイライトするデータラベル(例: "Q4"、"12月"、インデックス3)

chart_type または data が欠けている場合、正確に次のように尋ねます:

"チャートを作成するには、以下が必要です:

  1. チャートタイプ — bar / line / area / pie / doughnut / scatter / radar / treemap
  2. データ — JSON配列またはCSVで提供(例: ラベル ['Q1','Q2','Q3','Q4','Q5'] とともに [12, 18, 22, 25, 31])

オプション: タイトル、スタイル(デフォルト: clean-slate)、寸法(デフォルト: 1080×1080)、特定のデータポイントのハイライト"

両方とも存在する場合 → ステップ2に進みます。


ステップ 2: 内部アーキテクチャ(ユーザーには非表示)

1. チャートタイプの正規化:

  • area → line + 系列に areaStyle: {}
  • doughnut → pie + 系列に radius: ['40%', '70%']
  • horizontal bar → bar + xAxis/yAxis を入れ替え(カテゴリ軸をyに)
  • その他: そのまま使用

2. references/chart-library.md を読む — このチャートタイプの完全な設定仕様を読み込みます。

3. references/style-presets.md を読む — 選択したスタイルのCSSトークンとデータパレットを読み込みます。

4. デザインの方向性を決定:

決定導出元
トーンプロフェッショナル / エディトリアル / 大胆 / 技術的 — データのオーディエンスに合わせる
データストーリーこのチャートが証明する単一の洞察(タイトルになる)
ハイライト戦略どのデータポイントに視覚的強調が必要で、その理由は?
背景明るい(clean-slate、matt-gray)または暗い(midnight-editorial、electric-burst、brutalist)

5. データの解析:

  • 単純配列 [12, 18, 22] → series.data、ラベルは別途提供
  • オブジェクト配列 [{x: '1月', y: 12}] → xキーから xAxis.data、y値から series.data
  • CSV: ヘッダー行を xAxis.data、値の行を series.data として解析
  • 複数系列: それぞれが type、name、data を持つ複数の series エントリ
  • 散布図: series.data: [[x1,y1], [x2,y2], ...] 形式

6. 寸法の解析: "1080x1080" → W=1080、H=1080。Body = WxH。出力PNG = 2W × 2H。


ステップ 3: HTML生成

生成前にすべてを読む:

  • このチャートタイプの完全なECharts設定仕様については references/chart-library.md
  • 選択したスタイルのCSSトークン+パレットについては references/style-presets.md

必要なHTML構造:

<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
[スタイルプリセットからのフォントCDNリンク]
<style>
:root {
  [スタイルプリセットからのすべてのCSSトークン]
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  width: [W]px; height: [H]px;
  overflow: hidden;
  background: var(--bg);
  font-family: var(--font-body);
}
body {
  display: flex;
  flex-direction: column;
  padding: 40px 48px 32px;   /* 円/ドーナツ: 64px 80px を使用 */
}

/* EChartsコンテナは明示的なサイズが必要 */
.chart-container {
  flex: 1;
  min-height: 0;
  /* 円/ドーナツのみ: max-height: 860px; */
}

.chart-header { margin-bottom: 24px; }
.chart-title {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2.5vw, 1.6rem);
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.chart-subtitle {
  font-family: var(--font-body);
  font-size: clamp(0.75rem, 1.2vw, 0.9rem);
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.5;
}
.chart-footer {
  margin-top: 14px;
  font-family: var(--font-body);
  font-size: 10px;
  color: var(--text-muted);
  opacity: 0.65;
}
</style>
</head>
<body>

[タイトルまたはサブタイトルがある場合: <div class="chart-header"><div class="chart-title">...</div>...</div>]

<div id="chart" class="chart-container"></div>

[ソースがある場合: <div class="chart-footer">出典: [source]</div>]

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/echarts.min.js"></script>

<script>
window.__chartReady = false;

document.fonts.ready.then(() => {
  const container = document.getElementById('chart');
  const chart = echarts.init(container, null, { renderer: 'canvas' });

  // 重要: setOptionの前にイベントを登録 — EChartsバグ #14101/#17500
  // 'finished' は animation:false で setOption の後に登録すると発火しない可能性があります
  chart.on('finished', () => {
    window.__chartReady = true;
  });
  // 'rendered' による二重の安全策フォールバック
  chart.on('rendered', () => {
    clearTimeout(window.__renderDebounce);
    window.__renderDebounce = setTimeout(() => { window.__chartReady = true; }, 100);
  });

  const palette = [スタイルプリセットからのパレット];

  const option = {
    animation: false,                            // スクリーンショットのための即時レンダリング

    backgroundColor: 'transparent',             // body CSSが背景色を処理

    textStyle: {
      fontFamily: '[--font-body の値]',
      color: '[--text-muted の値]',
    },

    [title パラメータが提供された場合の title 設定],
    [チャートタイプに応じた legend 設定],
    [チャートタイプに応じた grid 設定],
    [チャートタイプに応じた xAxis 設定],
    [チャートタイプに応じた yAxis 設定],

    series: [{
      [chart-library.md からのこのタイプの完全な系列設定]
      [チャートタイプに応じて適用されるパレット色]
      [ハイライトがある場合: ハイライトされたデータポイントのアイテムごとの itemStyle]
    }]
  };

  chart.setOption(option);   // setOption は常にイベント登録の後
});
</script>
</body>
</html>

デザイン品質ルール:

  • タイトルフォント: fontWeight: 'bold'、fontSize: 20–24 — 細いタイトルは不可
  • グリッド線: 低不透明度(0.06–0.10)— データに従属
  • 棒: barMaxWidth: 60、itemStyle.borderRadius: [4,4,0,0] で角丸
  • 折れ線: smooth: true で自然な曲線、ポイントに symbolSize: 8
  • 円/ドーナツ: label.formatter: '{b}\n{d}%' でスライス上のビルトインラベル
  • ダークプリセット: grid rgba(255,255,255,0.07)、軸線/目盛り色 rgba(255,255,255,0.15)
  • ツールチップ: show: false — 静的PNG、ホバー操作なし
  • タイトルが提供されない場合: .chart-header をスキップし、EChartsオプションからtitleを省略

ステップ 4: 自己QA(ステップ5の前にすべての失敗を修正)

構造:

  • コンテナは <div> であり、<canvas> ではない
  • window.__chartReady = false が document.fonts.ready の前に宣言されている
  • chart.on('finished', ...) が chart.setOption() の前に登録されている
  • chart.on('rendered', ...) のデバウンスフォールバックが chart.setOption() の前に登録されている
  • オプションオブジェクトに animation: false がある
  • chart.setOption(option) がinitブロックの最後の呼び出しである

タイプ固有:

  • 面: type: 'line' + areaStyle: {} — type: 'area' ではない
  • ドーナツ: type: 'pie' + radius: ['40%', '70%'] — type: 'doughnut' ではない
  • 棒: xAxis.type: 'category' が明示的に設定されている
  • カテゴリデータが xAxis.data にある(data.labels ではない)
  • 円/ドーナツ: body padding: 64px 80px + .chart-container { max-height: 860px }
  • ハイライト: データ配列内のアイテムごとに { value: N, itemStyle: { color } }

デザイン:

  • すべてのパレット色が references/style-presets.md からのものである
  • タイトルが洞察を示している(単なる主題ではない)
  • tooltip: { show: false } または省略(静的PNGにホバーなし)
  • ダークプリセット: grid/軸の色に rgba(255,255,255,...) を使用
  • source パラメータが提供された場合、フッターに出典がある
  • データラベルが表示されている(系列にビルトインの label: { show: true })

ステップ 5: エクスポート

タイトルまたはチャートタイプ+データコンテキストからスラッグを決定(ケバブケース、30文字以内):

mkdir -p chart/[slug]

HTMLを保存: chart/[slug]/chart.html

クイックブラウザチェック:

open chart/[slug]/chart.html

エクスポートを実行([skill-root] をこのスキルのディレクトリへの実際のパスに置き換え):

bash [skill-root]/scripts/export-chart.sh \
  chart/[slug]/chart.html \
  chart/[slug]/chart.png \
  --width [W] \
  --height [H]

このスクリプトは初回実行時にPlaywrightをインストールし(約200MBのChromiumダウンロード)、その後 deviceScaleFactor: 2 でチャートをキャプチャします。


ステップ 6: 出力サマリー

## チャート: [title]
日付: [YYYY-MM-DD] | タイプ: [chart_type] | スタイル: [style]
寸法: [W×H]px → PNG: [2W×2H]px @2倍 Retina

ファイル
  ソース:   chart/[slug]/chart.html
  出力:   chart/[slug]/chart.png
  サイズ:     [X] KB

チェックリスト
- [ ] タイトルが洞察を明確に示している
- [ ] データラベルが表示サイズで読みやすい
- [ ] ハイライトが正しいデータポイントに表示されている
- [ ] フッターに出典表示がある

プロンプトのヒント(ユーザーがガイダンスを求めたときに表示)

"構造化データを提供してください — 散文による説明ではなく、JSONまたはCSVで。"

"チャートタイプを明示的に指定してください。'四半期を示すチャート'ではなく 'Q1~Q4を比較する棒グラフ'。"

"データストーリーを指定してください。'他のすべてを上回ったQ4をハイライト' と指定すると注釈のコンテキストが与えられます。"

✅ 良い例: "折れ線グラフを作成。タイトル: '12ヶ月でARRが1.2万ドルから9.5万ドルへ成長'。データ: [12, 18, 22, 25, 31, 38, 44, 52, 61, 68, 78, 95](2024年1月~12月)。12月をハイライト。出典: 内部CRM。スタイル: electric-burst。"

❌ 悪い例: "会社の成長についてのチャートを作って"

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

Varnan-Tech/opendirectory

Use when the user asks to generate a blog cover image, thumbnail, or article header. Automatically uses modern typography, brand logos, and Google Search grounding to create beautiful 16:9 images with Gemini 3.1 Flash Image Preview.

Varnan-Tech/opendirectory

World-class brand strategist and naming expert. Uses an interrogation-led discovery phase to extract your brand's DNA, then applies scientific naming frameworks (Phonosemantics) and automated multi-TLD domain checking.

Varnan-Tech/opendirectory

Use when the user asks to generate or update a project's CLAUDE or AGENTS context file from a codebase scan. Writes a focused file under 100 lines containing only the non-obvious build commands, conventions, and gotchas Claude Code needs.

Varnan-Tech/opendirectory

Use when the user wants to verify cold emails, enrich a lead list, or autonomously guess email addresses from a CSV using ValidEmail.co or the open-source Reacher engine.

Varnan-Tech/opendirectory

Competitive intelligence orchestrator tracking companies across 8+ platforms (GitHub, Twitter, Reddit, HN, PH, YC Jobs) with heat scores and AI briefings.

Varnan-Tech/opendirectory

Give it your product URL or description. It finds your top 5 competitors, runs three-track PR research across all of them (editorial, podcasts, communities), identifies which channels appear most frequently, looks up the journalist or host for each, and returns a tiered outreach list with story angles and ready-to-send cold pitch drafts tailored to your product. Use when asked to find PR opportunities, discover where competitors got featured, build a media outreach list, find which journalists cover my space, or get pitch templates for press coverage.

Varnan-Tech/opendirectory

Generate high-converting, deep-dive growth case studies in MDX format. Use this skill when asked to write a case study or blog post about a company's growth, tech stack, or product-led strategy. It handles the full pipeline (researching the company via Tavily, generating a 16:9 cover image, quality checking the draft, uploading assets to cloud storage, and pushing directly to the target repository).

Varnan-Tech/opendirectory

Scans your project for outdated npm, pip, Cargo, Go, or Ruby packages. Runs a CVE security audit. Fetches changelogs, summarizes breaking changes with Gemini, and opens one PR per risk group (patch, minor, major). Includes Diagnosis Mode for install conflicts. Use when asked to update dependencies, check for outdated packages, open dependency PRs, scan for package updates, audit for CVEs, or flag breaking changes in upgrades. Trigger when a user says "check for outdated packages", "update my dependencies", "open PRs for dependency updates", "scan for CVEs", or "which packages need upgrading".

Varnan-Tech/opendirectory

Generates and updates README.md and API reference docs by reading your codebase's functions, routes, types, schemas, and architecture. Uses graphify to build a knowledge graph first, then writes accurate docs from it. Use when asked to write docs, generate a README, document an API, update stale docs, create an API reference from code, add an architecture section, or document a project in any language. Trigger when a user says their docs are missing, outdated, or wants to document their codebase without writing it manually.

Varnan-Tech/opendirectory

Evaluates expired domain candidates against a target niche, scores them by topical relevance, historical activity level, and history cleanliness, then outputs a ranked shortlist with explainable reasoning and risk flags.

Varnan-Tech/opendirectory

Brutally honest developer-experience audit for a GitHub repo. Scores 10 DX dimensions (time-to-first-success, README clarity, visual proof, install, quick-start, docs, examples, community, trust, marketing), writes a shareable roast in the requested tone (brutal/honest/kind), produces a prioritized action plan ranked by impact × effort, and sketches an ideal README. Trigger when user says "roast my repo", "audit my README", "dx audit", "developer experience review", "score my GitHub project", "before launch checklist", or "make my repo shareable".

Varnan-Tech/opendirectory

Drafts and designs a complete HTML email newsletter from a topic or content brief. Outputs paste-ready HTML for Loops, Mailchimp, Beehiiv, Resend, or any standard email platform. Includes subject line options and plain-text fallback. Trigger when a user says "write a newsletter", "draft an email newsletter", "create an HTML email", "design an email for my subscribers", or "write a newsletter about [topic]".

Varnan-Tech/opendirectory

Takes a GitHub PR URL or the current branch and writes a plain-English explanation of what it does and why, then posts it as a PR comment. Use when asked to explain a PR, summarize a pull request, write a plain-English description of a PR, add a summary comment to a PR, or understand what a PR changes. Trigger when a user says "explain this PR", "summarize this pull request", "what does this PR do", "add a comment explaining the PR", or shares a GitHub PR URL and asks what it does.

Varnan-Tech/opendirectory

Audit how often LLMs recommend your brand vs competitors and generate a GEO action plan.

Varnan-Tech/opendirectory

Takes a competitor's public GitHub repo URL, fetches their open issues via the GitHub REST API, filters noise locally, clusters issues into 6 demand categories, computes a demand score per issue and per cluster, and outputs a ranked demand gap report with a GTM messaging brief. Use when asked to scan a competitor's GitHub issues, find what their users are begging for, turn GitHub complaints into product positioning, identify competitor feature gaps, or generate messaging from real user demand. Trigger when a user says "scan competitor issues", "what are users asking for on X repo", "find demand gaps in Y", "turn GitHub issues into messaging", or "what should I build based on competitor complaints".

Varnan-Tech/opendirectory

Find recurring confusion in your repo's GitHub Discussions, rank it by urgency, and draft the actual docs fixes and content angles — with verbatim community quotes and source links as evidence.

Varnan-Tech/opendirectory

SEO keyword research workflow for blog generation using Google Trends data. Use when writing blog posts, planning content calendars, or optimizing articles for search engines. Finds breakout keywords, builds content structure, and generates SEO-optimized blog outlines targeting tech and developer audiences.

Varnan-Tech/opendirectory

Generates a professionally designed case study PDF for B2B SaaS sales and marketing. Supports 7 page layouts, 9 style presets, 1-4 page output. Trigger when user says "create a case study", "write a customer story", "make a case study PDF", "design a success story", "turn this customer win into a PDF".

Varnan-Tech/opendirectory

Creates professionally designed B2B SaaS e-books in HTML + CSS, exported as print-ready PDF. 3–10 pages, 9 style presets, 11 page layout types. Trigger when user says "create an ebook", "design a lead magnet", "make a PDF guide", "build a gated content piece", "write a B2B ebook", "design a white paper", "create a nurture asset", or "make a PDF report".

Varnan-Tech/opendirectory

Fetches low-star App Store and Google Play reviews, clusters them into broken-promise patterns, and generates a ranked copy brief with positioning opportunities.

関連スキル