Back to list
yusuke-suzuki

analytics-design

by yusuke-suzuki

1🍴 1📅 Jan 24, 2026

SKILL.md


name: analytics-design description: Design data analysis from purpose clarification to visualization. Use when analyzing data, exploring BigQuery schemas, building queries, or creating Looker Studio reports.

Analytics Design

Workflow

Use references/analytics-design-template.md to document every analysis.

  1. Clarify Purpose: What do you want to know? Why is this analysis needed? Who will use it? One-time or ongoing monitoring?

  2. Discover Data: Explore available datasets and understand schema.

    • Ask user for project/dataset context and business background
    • bq ls, bq show --schema for BigQuery tables
    • db/schema.rb for Rails projects
    • API docs or sample data for external services
    • Understand table relationships (ER diagrams help)
  3. Build Query: Write SQL based on discovered schema.

    • Use CTEs for readability
    • Execute using BigQuery CLI (see BigQuery Query Execution below)
    • Interpret results and document findings
  4. Create Dashboard (if ongoing monitoring needed):

    • Use references/looker-studio-template.md to design
    • Define decisions: What actions will users take based on this dashboard?
    • Check existing resources: Similar dashboards or queries already exist?
    • Align time granularity with usage frequency (daily/weekly/monthly)
    • Design data sources, pages, and charts

BigQuery Query Execution

Prerequisites

Check gcloud configuration before running queries:

gcloud config get-value project
  • If authentication error: prompt user to run gcloud auth login, then resume
  • If project unset: prompt user to run gcloud config set project <PROJECT_ID>

Execution Process

  1. Dry run: Validate syntax and estimate cost

    bq query --use_legacy_sql=false --dry_run "SELECT * FROM \`project.dataset.table\`"
    

    Cost: ~$5/TB. <1GB is light, 2GB+ needs optimization.

  2. Execute: Run and confirm results

    bq query --use_legacy_sql=false --format=csv "SELECT * FROM \`project.dataset.table\`"
    

Always use fully-qualified table names: project.dataset.table

Query Design Tips

  • Specify exact date ranges
  • Filter partitioned tables by partition key
  • Avoid correlated subqueries (use JOINs/CTEs)
  • Filter early with CTEs before joining large tables

Looker Studio Best Practices

Data Source Design

  • One data source per analytical purpose
  • Pre-aggregate in SQL for performance
  • Include bucket fields for distribution analysis
  • Include sort-order fields for proper chart ordering
  • Descriptive data source names

Report Structure

  • Separate pages by time granularity (daily/monthly)
  • Group related metrics per page
  • Consistent filter scopes within pages

Chart Type Selection

PurposeChart Type
KPI current valueScorecard
Time series trendTime series chart
Category breakdown over timeStacked area / Stacked bar
Category comparisonBar chart
CompositionPie chart
Detailed dataTable
Distribution (percentile)Time series (multiple metrics)

Score

Total Score

50/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

Reviews

💬

Reviews coming soon