agentleFS
ksed8ksed8/cc-loopkit/.claude/skills/data/SKILL.md

data

Skill1 starsChanged 4 months agoMITView on GitHub

Working with SQL and data analysis — writing correct, safe, performant Postgres queries and analyzing data with pandas, numpy, and matplotlib. Use when writing or optimizing SQL, exploring a dataset, wrangling dataframes, computing statistics, or producing analysis. For chart aesthetics/design, also load the `dataviz` skill.

16 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use content, frontend and 4 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • Rayan55050Skill

    content

    Создание контента: посты, статьи, тексты

    Also in 3 projects that use this

  • imehrSkill

    frontend

    Use when building UI components, pages, or features - guides Claude through the approved frontend stack (Next.js 15, React 19, Shadcn, Tailwind) with design-first workflow for complex UIs, enforcing patterns and quality standards

    Also in 4 projects that use this

  • ryu111Skill

    browser

    agent-browser CLI 瀏覽器自動化指南。E2E 測試、UI 調試、設計驗證。適用於需要實際操作瀏覽器的場景。

    Also in 3 projects that use this

  • alxyrginSkill

    writing

    Создание контента для личного бренда — статьи, посты, туториалы. Use when user asks to "напиши статью", "создай пост", "подготовь контент", "write article", "create content", or when task requires content creation for blogging, LinkedIn, Medium, or other publishing platforms.

    Also in 3 projects that use this

  • NVIDIASkill

    github

    Interact with GitHub using the gh CLI restricted to REST API only (no GraphQL). Use when the user wants to work with GitHub issues, pull requests, repos, releases, or Actions — especially in sandboxed environments where the GraphQL endpoint may be blocked. Trigger keywords - github, gh, pull request, PR, github issue, github actions, workflow, release, gh api.

    Also in 3 projects that use this

  • NVIDIASkill

    research

    Before designing a feature, research how comparable libraries solve the problem, check best practices, known pitfalls, and upstream changes. Use when starting a new feature, investigating an unfamiliar area, or the user asks to research something.

    Also in 5 projects that use this

The file

We split this skill into the rules it gives an agent

9 rules. 0 are common, 2 are distinctive, and 7 are very specific to this project.

  • 0

    Common

    Most of the 12 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 7

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Read timezones explicitly: store/compare in UTC (timestamptz), convert at the edges.

    line 21
  2. Very specific:

    Treat db/migrations/* as append-only once merged — never edit a merged migration.

    line 28
  3. Very specific:

    Read the plan: EXPLAIN (ANALYZE, BUFFERS).

    line 32
  4. Distinctive:

    Prefer set-based SQL over row-by-row loops in app code.

    line 35
  5. Distinctive:

    Use CTEs for readability, but know they can be optimization fences for very large data — measure.

    line 36
  6. Very specific:

    Before analyzing: df.shape, df.dtypes, df.head(), df.isna().sum(), df.describe().

    line 42
  7. Very specific:

    Look at nulls, duplicates, and outliers explicitly — decide to drop, fill, or keep, and say which.

    line 43
  8. Very specific:

    Prefer nanmean/nansum when NaNs are expected, and be explicit about the axis.

    line 56
  9. Very specific:

    Load dataviz for color, scale, and accessibility choices: before finalizing.

    line 62

“Common” is measured: kept by at least 6 in 10 of the 12 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Data: SQL + Analysis

Correctness first, then clarity, then speed. A fast query that returns the wrong number is worse than no query. Verify what the data actually is before you trust what it seems to say.

For the visual design of any chart (color, layout, accessibility), load the dataviz skill before writing plotting code. This skill covers the query and analysis mechanics.

SQL (Postgres)

Correctness

  • Know your grain (one row = one what?). Joins that fan out silently inflate SUM/COUNT — check row counts before and after a join.
  • NULL is not a value: = NULL is never true, NOT IN (… NULL …) returns nothing, and aggregates skip NULLs. Use IS [NOT] NULL, COALESCE, and think about what NULL means for each column.
  • WHERE filters rows; HAVING filters groups. Filtering an aggregate in WHERE is a bug.
  • Integer division truncates (1/2 = 0) — cast to numeric for ratios.
  • Anything not in an aggregate must be in GROUP BY. Beware SELECT * with GROUP BY.
  • Read timezones explicitly: store/compare in UTC (timestamptz), convert at the edges.

Safety

  • Always parameterize — bind values, never string-concatenate user input into SQL (injection + type bugs). Allowlist dynamic identifiers (table/column/sort) since they can't be bound.
  • Route user-data access through lib/auth/; don't hand-write raw queries that dodge the app's authorization (project rule).
  • Preview destructive statements: run the SELECT form of a DELETE/UPDATE's WHERE first and check the count. Wrap risky writes in a transaction you can roll back. Never run an unbounded UPDATE/DELETE.
  • Treat db/migrations/* as append-only once merged — never edit a merged migration; write a new one (project rule + harness guard).

Performance

  • Read the plan: EXPLAIN (ANALYZE, BUFFERS). A Seq Scan on a large table in a hot path wants an index; a Nested Loop over many rows may want a different join.
  • Index the columns you filter and join on; a composite index's column order matters (leftmost-prefix). Indexes speed reads and slow writes — add deliberately.
  • SELECT only the columns you need. Paginate with keyset (WHERE id > :last) over OFFSET for deep pages.
  • Prefer set-based SQL over row-by-row loops in app code; let the database do the join/aggregate.
  • Use CTEs for readability, but know they can be optimization fences for very large data — measure.

Python analysis (pandas / numpy / matplotlib)

Load and sanity-check first

  • Before analyzing: df.shape, df.dtypes, df.head(), df.isna().sum(), df.describe(). Confirm the grain and that types are what you expect (dates parsed as datetimes, numerics not strings).
  • Look at nulls, duplicates, and outliers explicitly — decide to drop, fill, or keep, and say which. Silent dropna changes your denominator.

pandas

  • Vectorize; avoid iterrows/apply for anything you can express as a column operation (orders of magnitude faster and clearer).
  • Set/verify the join keys' types before merge; check how and the resulting row count (a many-to-many merge explodes rows). Use validate= to assert the relationship.
  • Beware chained-assignment (df[mask]['col'] = …) — use .loc[mask, 'col'] = ….
  • groupby(...).agg(...) with named aggregations for clarity. Watch how NaNs and empty groups are handled.
  • Reproducibility: fix a seed for any sampling; don't rely on row order unless you sorted.

numpy

  • Mind dtypes and integer overflow; use float64 when accumulating. Understand broadcasting before reshaping.
  • Prefer nanmean/nansum when NaNs are expected, and be explicit about the axis.

matplotlib

  • Label axes and units, title the plot, and never mislead: don't truncate the y-axis to exaggerate, match chart type to the data (distribution → histogram/box; trend → line; comparison → bar; relationship → scatter).
  • One idea per chart. Show sample size when a summary could hide it.
  • Load dataviz for color, scale, and accessibility choices before finalizing.

Reporting results

  • State the population, filters, and time window behind every number ("active users, last 30 days, excluding internal accounts").
  • Distinguish correlation from cause; report the denominator and sample size, not just the headline metric.
  • Make it reproducible: the query or notebook that produced the number should be runnable and reviewable, not a screenshot.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.