dewey
Use when "query Dewey Data", "deweydata.io", "SafeGraph places/patterns/spend", "Advan foot traffic", "POI / points of interest", "mobility data", "dataplor", "Veraset", "PassBy", "crypto/Bitcoin ATM locations", or any pull from the Dewey Data academic marketplace (UVA/NYU Platform Subscription) via the deweypy/deweydatapy client, DuckDB, or the Dewey MCP server.
What this skill does
## Contents
- [What Dewey Is](#what-dewey-is)
- [Credential Enforcement](#credential-enforcement)
- [Download Enforcement](#download-enforcement)
- [Access Method Decision Table](#access-method-decision-table)
- [Authentication](#authentication)
- [Quick Reference: Featured Datasets](#quick-reference-featured-datasets)
- [SafeGraph Global Places Quick Reference](#safegraph-global-places-quick-reference)
- [Additional Resources](#additional-resources)
## What Dewey Is
[Dewey Data](https://www.deweydata.io) is an academic **data marketplace** — one institutional Platform Subscription unlocks a catalog of ~300 datasets from ~40 providers (foot traffic, POI, mobility, consumer transactions, real estate, labor). **UVA Library** and **NYU** both hold the institutional subscription; SafeGraph and most providers are free under it.
Dewey is **not** a SQL warehouse like WRDS. Data is delivered as **partitioned Parquet/CSV.gz files** downloaded via an API key. You discover datasets, read metadata, sample, filter (by date partition + columns), then download. Think "S3 of presigned Parquet links," not "PostgreSQL."
| | WRDS | Dewey |
|---|---|---|
| Data | Finance/accounting | POI, foot traffic, mobility, consumer, real estate |
| Access | PostgreSQL / SAS on the grid | File download (Parquet/CSV.gz) via API key |
| Query engine | server-side SQL | **DuckDB over the files** (local or remote presigned URLs) |
| Licensing | per-vendor, negotiated | one platform subscription unlocks the catalog |
| AI access | none | **MCP server** (`api.deweydata.io/mcp`) |
## Credential Enforcement
### IRON LAW: NEVER GUESS, INVENT, OR HARDCODE THE API KEY
<EXTREMELY-IMPORTANT>
The Dewey API key belongs to the **user's** account (`app.deweydata.io` → Connections → Add Connection → API Key). It is shown **once**. You do not have it and cannot derive it.
- **ALWAYS** ask the user for the key before any real data pull. No exceptions.
- **NEVER** write a placeholder like `apikey = "your_api_key"` and run it — it will 401 and waste a round trip. Read from `DEWEY_API_KEY` env var or a gitignored file (`~/.config/dewey/apikey`).
- **NEVER** commit the key, echo it back, or paste it into a script that gets committed.
**Guessing or hardcoding the key is NOT HELPFUL — every call 401s, and a committed key is a security incident the user must rotate.**
</EXTREMELY-IMPORTANT>
Each **product** (dataset) has its own **product path / project ID** (`prj_…`), obtained from the dataset page: **Get Data → (Skip filtering) → Connect to API / Bulk API → API URL**. One API key, many product paths. If you don't have the product path, discover it via the [MCP server](references/mcp.md) (`search_datasets`) rather than guessing.
## Download Enforcement
### IRON LAW: NO BULK DOWNLOAD WITHOUT METADATA + SAMPLE + FILTER FIRST
Before downloading ANY Dewey dataset, you MUST:
1. **IDENTIFY** the product path and what partitions/columns you actually need
2. **META** — call `get_meta` (deweydatapy) / `get_download_info` (MCP) to learn partition columns, date range, file count, total size
3. **SAMPLE** — pull 100 rows (`read_sample` / MCP `sample_dataset`) and INSPECT the schema before committing to a full pull
4. **FILTER** — restrict by date partition (`partition_key_after/before`) AND columns; for selective pulls use **DuckDB `COPY TO`** over the presigned URLs, never download the whole catalog
5. **DOWNLOAD** the filtered subset, then verify row counts / NULLs / date range on disk
This is not negotiable. Skipping the sample-and-filter step is NOT HELPFUL — Dewey datasets are routinely **hundreds of GB to multiple TB**; an unfiltered pull burns hours of bandwidth and disk for data you'll immediately throw away.
### Rationalization Table — STOP If You Think:
| Excuse | Reality | Do Instead |
|--------|---------|------------|
| "I'll just download everything and filter in pandas" | SafeGraph Patterns is multi-TB; you'll fill the disk | DuckDB `COPY TO` with WHERE on remote parquet — pull only the rows/cols you need |
| "I don't need to check the schema first" | Column names differ by provider/release (`naics_code` vs `NAICS_CODE`, `opened_on` may not exist) | `read_sample(nrows=100)` BEFORE the full pull |
| "No date filter needed, I want all of it" | Most datasets are date-partitioned; "all" = every weekly file ever | Set `partition_key_after/before` to your study window |
| "The download started, so it's correct" | A started download ≠ the right columns | Inspect a sample on disk before claiming success |
| "Presigned links are fine for a long job" | Links expire in **24h** (`download_files0`) | Use `download_files1` (page-by-page, refreshes links) for large multi-day pulls |
| "I'll hardcode the product path I think it is" | Wrong `prj_` → 404 or someone else's data | Get it from Connect to API, or MCP `search_datasets` |
### Red Flags — STOP Immediately If You're About To:
- **Call `download_files*` without first calling `get_meta` + `read_sample`** → STOP. Meta + sample first.
- **Download a dataset with no `start_date`/`end_date` / partition filter** → STOP. Scope the date range.
- **Load a whole remote dataset into a DataFrame** → STOP. Use DuckDB `COPY TO … (FORMAT PARQUET, PARTITION_BY …)` to persist a filtered subset to disk.
- **Run a pull with `apikey="your_api_key"` or any guessed key** → STOP. Ask the user; read from env/file.
- **Write the API key into a script you'll commit** → STOP. Env var or gitignored file only.
## Access Method Decision Table
| Need | Method | Reference |
|------|--------|-----------|
| Discover/search datasets, check schema, sample — from inside Claude | **MCP server** (`api.deweydata.io/mcp`) | `references/mcp.md` |
| Scripted Python bulk download | **deweypy** (recommended) or **deweydatapy** (legacy, product_path API) | `references/deweypy-client.md` |
| Selective pull — specific columns/rows from huge datasets | **DuckDB** over presigned URLs (`read_parquet($urls)` + `COPY TO`) | `references/duckdb.md` |
| R workflow | **deweyr** (`download_dewey()`) | `references/deweypy-client.md` |
| One-off, dataset < 2.0 GB | UI CSV download (platform → project) | `references/access-options.md` |
| Analyze data already on disk | DuckDB / pandas / polars over `*.parquet` or `*.csv.gz` | `references/access-options.md` |
## Authentication
Get the key once from `app.deweydata.io` → **Connections → Add Connection → API Key**. Store it out of source control:
```bash
mkdir -p ~/.config/dewey && echo 'YOUR_KEY' > ~/.config/dewey/apikey && chmod 600 ~/.config/dewey/apikey
# or: export DEWEY_API_KEY=... (add to .envrc, which should be gitignored)
```
```python
import os, pathlib
apikey = os.environ.get("DEWEY_API_KEY") or pathlib.Path("~/.config/dewey/apikey").expanduser().read_text().strip()
```
Institutional login (to browse the catalog / create the key) is via **UVA NetBadge** (use your UVA email) or NYU SSO. The Platform Subscription is what makes SafeGraph etc. free — see `references/datasets.md`.
## Quick Reference: Featured Datasets
| Provider | Dataset(s) | What it is |
|----------|------------|------------|
| **SafeGraph** | Global Places (POI), Geometry, Spend, **Patterns** | POI master, building footprints, card spend, foot-traffic visit patterns |
| **Advan Research** | Monthly/Weekly Patterns, Home Panel | Foot traffic aggregated to place & census-block |
| **dataplor** | POI | Global POI, strong emerging-markets coverage |
| **Veraset** | Movement | Device-level mobility (institutional license only) |
| **PassBy** | Foot Traffic | Per-POI foot-traffic analytics |
| Consumer Edge / PDI | Spend / transactions | Card & product-level purchasing |
| LinkUp | Job postings | Labor-market activity |
| ATTOM / Dwellsy / RentHub | Real estate | Property records, rentals |
**Full catalog (all ~250 datasets):** `references/catalog.md` — every dataset grouped by category with time coverage, row count, size, and download access (machine-readable: `references/caRelated in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.