| name | research-harness-audit |
| description | RES: Read-only audit of raw data: variable inventory, missingness, IDs, units, merge keys, feasibility. Produces data_audit_report.md. Trigger: audit data, inspect data, data audit, check raw data. Do NOT load for: cleaning, analysis, review, release, setup. |
| description-en | RES: Read-only audit of raw data: variable inventory, missingness, IDs, units, merge keys, feasibility. Produces data_audit_report.md. Trigger: audit data, inspect data, data audit, check raw data. Do NOT load for: cleaning, analysis, review, release, setup. |
| kind | workflow |
| purpose | Perform a read-only audit of raw data files and produce a structured audit report |
| trigger | audit data, inspect data, data audit, check raw data, /research-harness-audit |
| shape | evaluate |
| role | evaluator |
| pair | research-harness-clean |
| owner | research-harness-core |
| since | 2026-05-29 |
| allowed-tools | ["Read","Write","Bash","Glob","Grep"] |
| argument-hint | [--file PATH] [--all] |
| user-invocable | true |
| effort | medium |
Research Harness Audit
Perform a read-only audit of raw data files. No data file is modified. The only output is a structured audit report and a log.
This skill runs after /research-harness-setup and before /research-harness-clean.
Quick Reference
| Input | Action |
|---|
/research-harness-audit | Audit all files listed in study_spec.md §3 |
/research-harness-audit --file data/raw/X.csv | Audit a specific file |
/research-harness-audit --all | Audit everything found under data/raw/ |
Pre-flight Checks
Before starting:
- Read
study_spec.md. If it does not exist, stop and tell the user to run /research-harness-setup first.
- Confirm the raw data path in
study_spec.md §3 exists. If it does not, report the missing path and stop.
- Write the audit log header to
logs/audit_YYYYMMDD.log.
Procedure
Step 1 — File inventory
For each file under data/raw/ (or the file specified by --file):
- Record: file name, file size, format (CSV, DTA, XLSX, parquet, etc.), encoding if detectable
- Record: row count (excluding header), column count
- Do not load entire files into memory if they are large — use shell commands (
wc -l, head, column-sniffing) where possible
Log each file to logs/audit_YYYYMMDD.log.
Step 2 — Variable inventory
For each file, record:
| Variable | Inferred type | Non-missing count | Missing count | Missing % | Min | Max | Sample values |
|---|
Use the actual variable names from the file headers. Do not rename or interpret variable names — record them as-is. If a variable name is ambiguous, note it in the audit report under §6 Open Issues; do not infer its meaning from the name alone.
Step 3 — ID consistency check
For each file:
- Identify candidate ID variables (variables whose name suggests an identifier: e.g., , , , , any variable ending in or )