data-analysis-workflow
Use this skill when the task is open-ended analysis of local files or mixed data sources in this repository, especially CSV, XLSX, PDF, DOCX, PPTX, JSON, text, HTML, XML, or folders of related evidenc
SKILL.md.codex/skills/data-analysis-workflow/SKILL.md
GitHubData Analysis Workflow
Use this skill for exploratory analysis, document review, dataset triage, metric investigation, or mixed-source fact finding inside this repo.
Default source rule: if the user does not name a path, start from workspace/input/.
Default Workflow
- Inventory the input files.
- Run
scripts/file_profile.pyon the likely inputs. - Split the work by source type:
- Tabular: CSV, TSV, XLSX, JSON, parquet-like exports
- Document: PDF, DOCX, PPTX, TXT, MD, HTML, XML
- Mixed folders: create a short source map first
- Create reproducible analysis:
- SQL in
workspace/sql/ - Notes in
workspace/notes/ - Charts and exports in
workspace/artifacts/
- SQL in
- End with findings, caveats, and suggested next drills.
Scripts
scripts/file_profile.pyUse first for profiling a file or folder. It prints a compact summary of structure, schema, sample content, and likely analysis directions.scripts/query_tabular.pyUse for SQL over one or more tabular files. It registers files as DuckDB tables and returns markdown, CSV, or JSON output.scripts/chart_from_query.pyUse when a chart should be produced from a repeatable SQL query rather than one-off notebook code.
Source-Type Guidance
- For CSV/XLSX/JSON tabular data, prefer SQL or pandas over manual reading.
- For PDFs and DOCX files, extract text first, then summarize sections and search for anchors before making claims.
- For PPTX files, treat slide titles and bullets as the first-pass structure.
- For unknown formats, inspect metadata and fall back to raw text or binary summary rather than guessing.
Reporting Standard
Every substantial analysis should leave behind at least one durable artifact:
- a note with the question, method, caveats, and findings
- a SQL file or Python snippet if the analysis is likely to be reused
- a chart or export when it materially helps interpretation
References
Read these only when needed:
references/workflow-recipes.mdfor concrete investigation patternsreferences/output-conventions.mdfor where to store results and how to name them