Data Analyst logo

Data Analyst

Community
minicoohei
data-analyst

BigQuery/Snowflake接続、EDA、可視化、Marimoノートブック作成を行うサブエージェント。 データ分析関連の4つのルール(data_analysis, visualization, notebook, marimo_variable_naming)を統合。 「データ分析して」「BigQueryに接続」「EDAを実行」「Marimoで分析」等のリクエストで発動。

Overview

Publisherminicoohei
Repositoryai-agent-camp
Skill namedata-analyst
Stars
346
Forks
13
Bundled files
3
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 3 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by minicoohei on GitHub. Read the source before you install it.

Installation

Install the Data Analyst AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/minicoohei/ai-agent-camp/tree/main/.claude/skills/data-analyst
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/minicoohei/ai-agent-camp.git /tmp/ai-agent-camp
mkdir -p .claude/skills
cp -r /tmp/ai-agent-camp/.claude/skills/data-analyst .claude/skills/data-analyst
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Data Analyst in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Data Analyst on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Data Analyst is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Data Analyst サブエージェント

BigQuery/Snowflake接続、EDA、可視化、Marimoノートブック作成を専用コンテキストで実行するサブエージェント。

Draft: Marimo変数の補助Lintスクリプトは未収録。変数名の重複は手動で確認する。

目的

データ分析処理をメインエージェントのコンテキストから分離し:

  • 4つの関連ルールをサブエージェント内に統合(約1500-3000トークン削減)
  • 分析結果のサマリーのみを返却
  • GCP認証フローの統合

統合ルール

このサブエージェントは以下の4つのルールの内容を内包しています:

  1. data_analysis.mdc - データ分析の基本原則
  2. visualization.mdc - 可視化の品質基準
  3. notebook.mdc - Marimo Notebook利用ルール
  4. marimo_variable_naming.mdc - Marimo変数命名ルール

Part 1: データ分析の基本原則

分析プロセス

  1. 目的の明確化: 分析開始前に目的・ゴール・仮説を記述
  2. データ品質の確保: 完全性・正確性・一貫性を確認、欠損・異常値・重複の処理方針を説明
  3. バイアスと因果: 主観的バイアスを排除、相関と因果を混同しない
  4. 分析対象の理解: カラム意味・単位・収集元・更新頻度を把握

ファイル整理

data/
├── raw/           # 元データ(上書き禁止)
├── intermediate/  # 中間処理データ
├── feature/       # 特徴量データ
└── output/        # 最終出力

命名規則: {source}__{target}__{granularity}__{date}.parquet 例: bq__sales__daily__2025-03-01.parquet

EDA(探索的データ分析)

  • YData Profiling (ydata-profiling) やAutoViz (autoviz) を活用
  • Marimoでインタラクティブに探索
  • 1つのグラフに情報を詰め込みすぎない

Part 2: 可視化の品質基準

必須ルール

ルール説明
意味のあるラベルindex番号使用禁止、ユーザー名/日付/カテゴリ名を使用
適切なグラフタイプ棒グラフ(比較)、折れ線(時系列)、ヒートマップ(2次元)
日本語ラベル専門知識なしで理解できるように
数値ラベル表示棒の上に「1,791件」等を表示
タイトル/軸ラベル/凡例必須
高解像度300 DPI以上

グラフタイプ選択

データ推奨グラフ
カテゴリ比較棒グラフ
時系列折れ線グラフ
2次元データヒートマップ
内訳積み上げグラフ
長いラベル横棒グラフ

matplotlib設定

python
import matplotlib
matplotlib.use('Agg')  # GUIなしで動作
import matplotlib.pyplot as plt

# 日本語フォント設定
plt.rcParams['font.family'] = 'Hiragino Sans'

Part 3: Marimo Notebook ルール

基本ルール

  1. Marimoを使用: Jupyter Notebookは使用しない
  2. 分析目的を明記: 最初のセルに記載
  3. 仮想環境の使用: uv を使用
  4. エラー対応: 原因と再発防止策をNotebookに追記

進捗表示(tqdm)

python
from tqdm import tqdm

# 時間のかかる処理には必ず進捗表示
for item in tqdm(items, desc="処理中", unit="item"):
    process(item)
    time.sleep(0.5)

BigQuery重複除去(必須)

sql
WITH deduplicated AS (
    SELECT
        *,
        ROW_NUMBER() OVER (PARTITION BY post.xPostId ORDER BY _PARTITIONTIME DESC) as row_num
    FROM `project.dataset.table`
    WHERE _PARTITIONTIME IS NOT NULL
)
SELECT * FROM deduplicated WHERE row_num = 1

Part 4: Marimo変数命名ルール

🚨 重要な制約

Marimoでは変数の再定義が禁止。異なるセル間で同じ変数名を使用するとエラー。

命名パターン

セル固有の接尾辞

セルの目的推奨接尾辞例
データ取得_fetch, _loaddf_fetch, result_load
前処理_prep, _cleandata_prep, values_clean
統計分析_stat, _calcmean_stat, corr_calc
可視化(静的)_static, _plotfig_static, ax_plot
可視化(動的)_dyn, _internet_dyn, chart_inter
モデル学習_train, _fitmodel_train, scaler_fit
評価_eval, _testscore_eval, pred_test

正しい例

python
# ✅ 良い例(セルごとに固有の接尾辞)
@app.cell
def _(data):
    fig_overview, axes_overview = plt.subplots(2, 2)
    for idx_ov, ax_ov in enumerate(axes_overview.flatten()):
        ax_ov.plot(data[idx_ov])
    return fig_overview, axes_overview

@app.cell
def _(data):
    fig_detail, axes_detail = plt.subplots(3, 3)
    return fig_detail, axes_detail

変数の重複確認

編集前後に各セルのトップレベル変数名を見直し、同じ名前を複数セルで再定義していないことを確認する。重複する場合は、セルの役割が分かる固有の接尾辞を付ける。


GCP認証

作業開始前の確認

bash
# 設定プロファイル一覧
gcloud config configurations list

# プロファイル切り替え
gcloud config configurations activate <profile_name>

# 認証
gcloud auth application-default login

利用可能なプロファイル

プロファイル名プロジェクトID用途
default-デフォルト環境
my-profilemy-gcp-project本番データ分析
my-devmy-dev-project開発分析

サブエージェント呼び出しパターン

メインエージェントは以下のパターンでこのサブエージェントを呼び出す:

python
Task(
    subagent_type="generalPurpose",
    model="fast",
    description="Data analysis",
    prompt="""
    このスキルを読んで実行してください: skills/data-analyst/SKILL.md
    
    タスク: {ユーザーの指示}
    データソース: {BigQuery / Snowflake / CSV等}
    分析目的: {EDA / 可視化 / レポート作成等}
    
    分析結果のサマリーを返却してください。
    """
)

返却フォーマット

yaml
status: success
analysis_type: EDA
data_source: BigQuery (my-dev-project)
summary:
  total_rows: 150000
  columns: 25
  date_range: "2025-01-01 ~ 2025-12-31"
  key_findings:
    - "日別投稿数は平均1,200件/日"
    - "ピーク時間帯は12:00-13:00"
    - "週末は平日比30%減少"
visualizations:
  - path: reports/daily_posts.png
    description: "日別投稿数推移"
  - path: reports/hourly_heatmap.png
    description: "時間帯別ヒートマップ"
notebook:
  path: notebooks/eda_analysis.py
  status: "作成完了"

依存関係

txt
marimo>=0.5.0
pandas>=2.0.0
plotly>=5.0.0
matplotlib>=3.7.0
google-cloud-bigquery>=3.0.0
ydata-profiling>=4.0.0
tqdm>=4.65.0

ユースケース

  1. BigQuery EDA: テーブル構造把握、基本統計、分布確認
  2. 時系列分析: トレンド、季節性、異常値検出
  3. コホート分析: ユーザーセグメント、リテンション
  4. 可視化レポート: ダッシュボード、プレゼン資料
  5. Marimoノートブック作成: インタラクティブ分析環境構築

Troubleshooting

エラー解決方法
GCP認証エラーgcloud auth application-default login を実行
BigQueryテーブルが見つからないgcloud config configurations list でプロファイルを確認し適切なものに切り替え
Marimo変数再定義エラー各セルのトップレベル変数を見直し、重複名に固有の接尾辞を付ける

Success Criteria

  • 分析結果のサマリー(YAML形式)が返却されている
  • 可視化グラフに日本語ラベル・タイトル・凡例が含まれている
  • 出力ファイルが data/output/ または reports/ に保存されている

Overview

BigQuery/Snowflake接続、EDA(探索的データ分析)、可視化、Marimoノートブック作成を専用コンテキストで実行するサブエージェントスキルです。データ分析・可視化・Notebook作成の4つのルールを統合し、分析結果のサマリーのみを返却します。

Usage

上記「サブエージェント呼び出しパターン」および「GCP認証」セクションを参照。基本的な実行例:

bash
# Marimo ノートブックで分析を開始
marimo edit notebooks/eda_analysis.py

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Data Analyst AI skill do?

BigQuery/Snowflake接続、EDA、可視化、Marimoノートブック作成を行うサブエージェント。 データ分析関連の4つのルール(data_analysis, visualization, notebook, marimo_variable_naming)を統合。 「データ分析して」「BigQueryに接続」「EDAを実行」「Marimoで分析」等のリクエストで発動。

Why use Data Analyst on TypingMind?

Because you install it once and use it with any model. Data Analyst is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Data Analyst in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/minicoohei/ai-agent-camp/tree/main/.claude/skills/data-analyst. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Data Analyst?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Data Analyst?

As many as you like. As long as a model supports skills, you can use Data Analyst with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Data Analyst AI skill free?

It is published on GitHub by minicoohei. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇