data-research

Move JavaScript aggregations into SQL queries against Postgres tables.

4|5|Updated Nov 5, 2025
One-click install
npx skills add https://github.com/cogni-dao/cogni --skill data-research-cogni-dao
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: data-research
Source: https://github.com/cogni-dao/cogni/tree/main/.claude/skills/data-research
Command: npx skills add https://github.com/cogni-dao/cogni --skill data-research-cogni-dao

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Build scalable research views that summarize large datasets without loading raw data into memory, ensuring dashboards stay fast and reliable.

Core Features & Use Cases

  • SQL-based aggregations for dashboard slices, wallet/market analytics, P/L curves, and histograms over millions of rows.
  • Enforces "read-from-DB only" for render paths, bounding results, and single-source truth for persisted data.
  • Provides recipes and patterns to migrate complex JS aggregations to SQL and validate parity.

Quick Start

Ask the agent to generate a new SQL aggregation that computes a bounded histogram of fill sizes for the target wallet.

Frequently Asked Questions about data-research

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build scalable SQL aggregations for dashboards over millions of rows?

Build scalable SQL aggregations by moving data summarization directly into SQL queries against Postgres tables, ensuring dashboards render fast without loading raw data into memory. This approach enforces DB-only reads and bounded results to maintain dashboard performance.

Why does my dashboard run out of memory when summarizing large datasets?

Dashboards run out of memory when loading raw data for client-side aggregation. Moving these aggregations into SQL against Postgres tables ensures the database handles summarization, bounding results and preventing memory exhaustion during render.

What is the best way to migrate complex JavaScript aggregations to SQL?

Migrate JavaScript aggregations to SQL by applying provided recipes that translate JS logic into Postgres queries. Validate the migration using parity tests to ensure the SQL output matches the original JS results before fully switching the render path.

Can I compute histogram analytics directly in Postgres for wallet data?

Yes, you can compute histogram analytics directly in Postgres. Ask the agent to generate a SQL aggregation that computes a bounded histogram of fill sizes for the target wallet, enforcing single-source truth and DB-only reads on the render path.

Does this approach enforce traceable explain plans for SQL queries?

Yes, the approach enforces traceable explain plans for SQL queries. It applies core principles ensuring query transparency and performance validation when summarizing large datasets for analytics and dashboard slices.

When should I not use SQL-based aggregations for analytics?

Avoid SQL-based aggregations if your dataset is small enough for in-memory processing or if your data store lacks advanced SQL support. This approach targets summarizing millions of rows in Postgres where memory constraints impact dashboard rendering.