{"data":{"slug":"github-datopian-portaljs-skills-portaljs-check-data-quality-bb5327272bcf","title":"PortalJS \u2014 Check Data Quality","summary":"Audit CSV\/TSV files for data quality issues before publishing or diagnosing showcase errors.","url":"https:\/\/skillshunter.net\/skills\/github-datopian-portaljs-skills-portaljs-check-data-quality-bb5327272bcf","json_url":"https:\/\/skillshunter.net\/api\/public\/v1\/skills\/github-datopian-portaljs-skills-portaljs-check-data-quality-bb5327272bcf","markdown_url":"https:\/\/skillshunter.net\/skills\/github-datopian-portaljs-skills-portaljs-check-data-quality-bb5327272bcf.md","download_url":"https:\/\/skillshunter.net\/skills\/github-datopian-portaljs-skills-portaljs-check-data-quality-bb5327272bcf\/download","category":{"slug":"data-research","name":"Data & Research"},"editor_note":"Requires Python 3 on PATH. Input is a local path or HTTP\/HTTPS URL. Output is a structured JSON report with findings and recommendations.","instructions":"---\nname: portaljs-check-data-quality\ndescription: Audit a local or remote tabular file (CSV\/TSV) for common data quality issues \u2014 schema, nulls, types, duplicates. Read-only. Use when a dataset needs a quality check before publishing, or a showcase renders wrong (blank cells, garbled numbers, an unsortable date column) and the cause needs isolating.\nallowed-tools: Bash(curl:*), Bash(awk:*), Bash(sort:*), Bash(head:*), Bash(wc:*)\nversion: 1.0.0\nauthor: Datopian <hello@datopian.com>\nlicense: MIT\ncompatibility: Claude Code with PortalJS portals (Next.js 14, React 18, Node 18+). Runs from any project via the plugin, a personal ~\/.claude\/commands install, or a portaljs clone.\ntags:\n  - portaljs\n  - data-portal\n  - data-quality\n  - audit\n  - csv\n  - validation\n---\n\n# PortalJS \u2014 Check Data Quality\n\n## Overview\n\nRun a read-only quality audit of one CSV or TSV file, local or remote, and return a\nstructured JSON report. The audit profiles every column \u2014 null\/blank counts, inferred\nvalue types, numeric ranges, likely year\/date fields \u2014 and flags duplicate rows,\nduplicate values in identifier-like columns, ambiguous overlapping year columns (e.g.\n`calendar year` vs `fiscal year`), and mixed-type columns. It never edits the source\nfile, `datasets.json`, or any other project file; it only reads the target file (a\nremote URL is downloaded to a temp file that is deleted before the run ends) and\nprints a report. Use it before publishing a dataset with `portaljs-add-dataset`, or to\ndiagnose why a showcase renders wrong.\n\n## Prerequisites\n\n- `python3` on `PATH` \u2014 the audit logic runs as an embedded Python script; nothing is\n  installed.\n- One CSV or TSV file, given as a local path or an `http`\/`https` URL. Only one file\n  per run.\n\n## Instructions\n\nThe canonical, full step-by-step workflow is\n[`.claude\/commands\/portaljs-check-data-quality.md`](https:\/\/github.com\/datopian\/portaljs\/blob\/main\/.claude\/commands\/portaljs-check-data-quality.md) \u2014\nthe single source of truth. Read and follow it when executing. Summary:\n\n1. Gather input \u2014 the file path or URL to audit. If missing, ask for it; never dead-end.\n2. Resolve the source: if it's an `http`\/`https` URL, download it to a temp file first;\n   otherwise use the local path as given.\n3. Validate the extension is `.csv` or `.tsv`. If not, or the file is missing, or the\n   header row is empty, stop and surface the error JSON as-is \u2014 do not guess a fix.\n4. Profile every column: null\/blank counts, distinct values, sample values, inferred\n   per-value type (boolean\/integer\/float\/date\/string), numeric min\/max, and year\n   range for columns whose name looks year-like.\n5. Derive findings from the profiles \u2014 duplicate rows, missing-value ratios, invalid\n   year values, mixed types, suspect negative values, duplicate identifier values, and\n   ambiguous overlapping year columns \u2014 each tagged `critical`, `warning`, or `info`.\n6. Assemble the JSON report (`status`, file metadata, `findings`, `recommendations`,\n   `column_profiles`), print it, and clean up the temp file if one was created.\n7. Relay the report to the user as-is; do not modify the source file, `datasets.json`,\n   or any other project file based on the findings \u2014 that's a separate, explicit step.\n\n## Output\n\nA single JSON object printed to stdout:\n\n- `status` \u2014 `ok`, `warning`, or `critical`.\n- `file`, `file_name`, `source_type` (`local` or `url`), `row_count`, `column_count`.\n- `findings` \u2014 structured issues, most severe first.\n- `recommendations` \u2014 de-duplicated suggested next steps.\n- `column_profiles` \u2014 per-column summary (nulls, blanks, distinct count, sample\n  values, inferred types, numeric\/year ranges).\n\nNo files are created or modified. A remote URL's temp download is removed on exit,\nsuccess or failure alike.\n\n## Error Handling\n\n| Symptom | Cause | Fix |\n| --- | --- | --- |\n| `\"File ... is not available.\"` | Local path is wrong, or the URL download failed | Verify the path or URL is reachable and retry. |\n| `\"Only CSV and TSV files are supported right now.\"` | File extension isn't `.csv`\/`.tsv` | Convert the file, or point to its tabular source instead. |\n| `\"... does not contain tabular headers.\"` | File is empty or the header row is malformed | Open the file and confirm it has a valid, non-empty header line. |\n| Command hangs on a URL | Remote host is slow or blocks non-browser requests | Download the file manually and audit the local copy instead. |\n| `python3: command not found` | Python 3 isn't installed or not on `PATH` | Install Python 3, or run the audit where it's available. |\n| Report looks truncated in the terminal | Large report wrapped\/paginated by the shell | Redirect to a file (`> report.json`) and open it separately. |\n\n## Examples\n\n### Example 1 \u2014 Audit a local CSV before publishing\n\n```\n\/portaljs-check-data-quality .\/public\/data\/trash.csv\n```\n\n### Example 2 \u2014 Audit a remote CSV over HTTPS\n\n```\n\/portaljs-check-data-quality https:\/\/example.com\/trash.csv\n```\n\n### Example 3 \u2014 Audit a TSV and save the report for review\n\n```bash\nbash scripts\/check-data-quality.sh .\/data\/emissions.tsv > \/tmp\/emissions-quality.json\n```\n\n### Example 4 \u2014 Read a `critical` status report\n\n```json\n{\n  \"status\": \"critical\",\n  \"findings\": [\n    { \"severity\": \"critical\", \"check\": \"duplicate_rows\", \"message\": \"42 duplicate rows found.\" }\n  ],\n  \"recommendations\": [\"Review and deduplicate repeated rows if they are not intentional.\"]\n}\n```\nFix the flagged rows\/columns, then re-run the audit before publishing.\n\n## Resources\n\n- Full workflow: [`.claude\/commands\/portaljs-check-data-quality.md`](https:\/\/github.com\/datopian\/portaljs\/blob\/main\/.claude\/commands\/portaljs-check-data-quality.md)\n- Detailed check catalog and troubleshooting: [`references\/reference.md`](references\/reference.md)\n- Related skills: `portaljs-add-dataset`, `portaljs-define-schema`\n- Python `csv` module (parsing behavior this audit relies on): <https:\/\/docs.python.org\/3\/library\/csv.html>\n","use_cases":["Before publishing a dataset with portaljs-add-dataset","Diagnose why a showcase renders incorrectly","Validate data before loading into a database"],"limitations":["Only supports CSV and TSV files","Does not modify the source file","Cannot handle large files efficiently"],"compatibility":[],"setup_tip":null,"sample_input":null,"sample_output":null,"source_url":"https:\/\/github.com\/datopian\/portaljs\/blob\/fc7ccd651459549a962c8b7aa08f60f8849fd9a5\/skills\/portaljs-check-data-quality\/SKILL.md","source_commit":"fc7ccd651459549a962c8b7aa08f60f8849fd9a5","license":"MIT","version":"1.0.0","listing_approved_at":"2026-11-15","created_at":"2026-11-14T17:10:15.000000Z","updated_at":"2026-11-15T18:51:31.000000Z","seo_title":"Check Data Quality in CSV\/TSV Files","seo_description":"Audit CSV and TSV files for data quality issues before publishing. Identify nulls, duplicates, and type mismatches.","seo_keywords":["data quality audit","csv file validation","tsv data check","portaljs data quality","duplicate row detection"]}}