datacheck
Skill46 starsChanged 9 months agoMITView on GitHub
Use when starting work with a new data file, before any analysis or visualization. Also use when encountering parsing errors, unexpected values, or when the user says "check this data" or "what's in this file".
In this repository23 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- brainstormingSkill
- catch-upSkill
- clean-survey-dataSkill
- codexSkill
- dataverse-syncSkill
- discuss-claimsSkill
- docSkill
- geminiSkill
- humanizerSkill
- marginaleffectsSkill
- marp-slideSkill
- napkinSkill
- pdfSkill
- playwrightSkill
- qualtrics-surveySkill
- screenshotSkill
- security-best-practicesSkill
- skill-creatorSkill
- stop-slopSkill
- survey-analysisSkill
- vizSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 4 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
Before any analysis or visualization on a new data file
- Distinctive: line 13
When parsing errors or unexpected values appear
- Distinctive: line 14
When switching to a different dataset mid-session
- Very specific: line 45
R-first: Use Stata only when the file is .dta and project context is Stata-based.
- Very specific: line 78
When the file is .dta, also report:
- Very specific: line 83
Stata extended missings: Check for .a through .z missing types (preserved by haven as tagged NAs)
- Distinctive: line 107
After the structural check:
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Data Check
Inspect and validate a data file before analysis. Report findings with suggested fixes. Do not auto-fix.
When to Use
- Before any analysis or visualization on a new data file
- When parsing errors or unexpected values appear
- When switching to a different dataset mid-session
- User says "check", "inspect", "what's in this", "profile" a data file
When NOT to Use
- File has already been checked in this session and nothing changed
- User just wants to read a specific value (use Read tool directly)
Workflow
Step 1: Raw File Inspection
Before loading into R/Stata, check the raw file:
file <filename> # encoding detection
head -c 500 <filename> | cat -v # hidden chars: ^M (CR), BOM, non-UTF8
wc -l <filename> # row count sanity check
head -3 <filename> # peek at delimiter and headerFlag these issues:
| Symptom | Meaning |
^M at line ends | Classic Mac \r or Windows \r\n line endings |
\xEF\xBB\xBF at start | UTF-8 BOM marker |
Only 1 line from wc -l | Entire file on one line (wrong line endings) |
| Mixed delimiters | Inconsistent separator characters |
Step 2: Load and Summarize
R-first. Use Stata only when the file is .dta and project context is Stata-based.
For CSV files:
df <- read.csv("file.csv", stringsAsFactors = FALSE)For Stata .dta files:
library(haven)
df <- read_dta("file.dta")Report this table:
| Item | Value |
| Dimensions | rows x cols |
| Column names | list all |
| Column types | numeric, character, factor, labelled, date |
| Total missing | count and % |
Then per column:
Column Type Missing Unique Example Values
─────────────────────────────────────────────────────────────
age numeric 12 (2%) 45 18, 25, 34, 67, 89
gender labelled 0 (0%) 3 1=Male, 2=Female, 3=Other
weight_var numeric 0 (0%) 847 0.23, 1.05, 2.11Step 3: Stata .dta Specific Checks
When the file is .dta, also report:
- Variable labels: Show all variable descriptions from Stata metadata
- Value labels: For each labelled variable, show the label-to-value mapping
- Survey weight variables: Flag any variables with names matching
*weight*,*wt*,pw,fw,iwor that havepweight/fweightcharacteristics - Stata extended missings: Check for
.athrough.zmissing types (preserved by haven as tagged NAs)
Step 4: Coded Missing Values
Scan ALL numeric columns for values that are likely coded missings, not real data:
| Pattern | Convention |
| 97, 98, 99 | Not applicable / Don't know / Refused |
| -1, -9, -99 | Various missing types |
| 991-999, 9991-9999 | Extended missing codes (scaled by # digits) |
.a through .z | Stata extended missing values |
Detection method: For each numeric column, check if values 97-99 (or -1, -9) appear AND the variable's main range is much lower (e.g., 1-5 scale with some 98s).
Report as:
POSSIBLE CODED MISSINGS:
income_cat: values {97, 98, 99} found (n=45). Main range: 1-12. Likely coded missing.
age: value {99} found (n=2). Main range: 18-95. Ambiguous - could be real age.Step 5: Light Profiling
After the structural check:
- Numeric columns: Correlation matrix (top 10 strongest pairs if many columns)
- Categorical columns: Frequency tables (top 10 levels per variable, flag if >50 unique levels)
- Flag: Numeric columns stored as character (likely parsing issue), zero-variance columns, duplicate rows
Step 6: Report Summary
Present a concise summary with three sections:
Clean: Variables ready for analysis (no issues)
Needs attention: Variables with potential coded missings, encoding issues, or type problems. Include suggested fix code but do NOT execute.
# SUGGESTED FIX for income_cat coded missings:
df$income_cat[df$income_cat %in% c(97, 98, 99)] <- NANotes: Observations about the data structure (survey weights detected, panel structure, etc.)
Quick Reference
| File type | Load with | Extra checks |
.csv | read.csv() | encoding, delimiter, line endings |
.tsv | read.delim() | encoding, line endings |
.dta | haven::read_dta() | value labels, variable labels, weights, extended missings |
.rds | readRDS() | just structure check |
Common Mistakes
| Mistake | Fix |
| Loading .dta without haven | Always library(haven); read_dta(), never foreign::read.dta() |
| Ignoring labelled class | Report label mappings; suggest as_factor() or manual recode |
| Assuming 99 = missing | Check if 99 is in the real data range first |
| Skipping raw byte check | ALWAYS run file and cat -v before loading. Mac CR issues are silent killers |
| Auto-fixing without asking | Report + suggest. Never auto-recode missing values |
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
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.

