agentleFS
karim-bhalwanikarim-bhalwani/agentic-harness/skills/data-narrative/SKILL.md

data-narrative

Skill0 starsChanged 4 months agoMITView on GitHub

Turns a raw dataset into a structured, evidence-grounded Markdown report where every claim traces back to the code or source that produced it. Orchestrates four specialist roles: Detective (external context), Analyst (exhaustive data profiling via data-science skill), Editor (narrative angle + report.md), and Inspector (provenance binding → inspector.json). USE FOR: any dataset-to-report workflow where auditability and claim traceability matter - analytical briefings, stakeholder reports, data-backed narratives. DO NOT USE FOR: SQL querying (use data-analyst), pipeline construction (use data-engineering), standalone EDA without a deliverable (use data-science), or architecture diagrams (use excalidraw-diagram).

The file

Show its rules and text

We split this skill into the rules it gives an agent

14 rules. About 0 are common, 4 are distinctive, and 10 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.

  • 10

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Do not generate statistics mentally: Every number in report.md must come from an Analyst script.

    line 34
  2. Very specific:

    Output directory is fixed: All artifacts go to narrative-output/ in the current working directory.

    line 35
  3. Distinctive:

    verification-before-completion applies at the end: Before declaring the pipeline complete, run the Inspector verification gate (Step 5 …

    line 37
  4. Distinctive:

    Before running any role, determine whether the input is a single file or a folder of files, then follow the matching path.

    line 61
  5. Very specific:

    Create narrative-output/ if it does not exist

    line 84
  6. Very specific:

    Read PROJECT_CONTEXT.md if present - use domain constraints

    line 85
  7. Very specific:

    Write narrative-output/preflight.json with the pre-flight record so every downstream role can read it

    line 86
  8. Very specific:

    If the dataset path is missing, unreadable, or relationship is "unrelated", stop and ask the user before proceeding.

    line 88
  9. Distinctive:

    Task: Run exhaustive profiling of the dataset and produce a findings manifest where every finding is paired with a Python script.

    line 110
  10. Very specific:

    Every finding in analyst.json has a code.script that points to an existing file

    line 116
  11. Very specific:

    Analyst → Editor handoff check: If the Analyst finds no findings of "significance": "high", surface this to the user before proceeding - …

    line 118
  12. Very specific:

    Every specific number in report.md appears verbatim in analyst.json or detective.json

    line 132
  13. Very specific:

    Verification gate: After the Inspector writes inspector.json, confirm the file exists and contains a non-empty claims[] array.

    line 150
  14. Distinctive:

    After all four roles complete, present this summary to the user:

    line 156

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

data-narrative Skill

Version: 9.0 | Updated: 01-July-2026 | Architect: Karim Bhalwani | Deps: data-science (Analyst), security-boundaries (Detective), verification-before-completion (Inspector gate)

Turns a raw dataset into a report.md where every claim is evidence-traced. Four sequential roles run as a fixed pipeline; each role reads what the previous one produced. The pipeline always runs in full - there are no skip-ahead paths.


Behavioral Directives

  • Pipeline is sequential and non-negotiable. Detective → Analyst → Editor → Inspector. No role may be skipped. No role may run before its predecessor has written its output file.
  • Do not generate statistics mentally. Every number in report.md must come from an Analyst script. If the Editor needs a number the Analyst did not compute, re-task the Analyst before writing the report.
  • Output directory is fixed. All artifacts go to narrative-output/ in the current working directory. Create it if it does not exist.
  • Load sub-role SKILL.md files before running each role. Each role has its own SKILL.md with detailed instructions. Read it before starting that role's work.
  • verification-before-completion applies at the end. Before declaring the pipeline complete, run the Inspector verification gate (Step 5 below). Do not claim done without fresh evidence.

Dependencies

Load these before starting:

~/.copilot/skills/data-narrative/detective/SKILL.md      - before running Detective
~/.copilot/skills/data-narrative/analyst/SKILL.md        - before running Analyst
~/.copilot/skills/data-narrative/editor/SKILL.md         - before running Editor
~/.copilot/skills/data-narrative/inspector/SKILL.md      - before running Inspector
~/.copilot/skills/data-science/SKILL.md                  - loaded by Analyst role
~/.copilot/skills/security-boundaries/SKILL.md           - loaded by Detective role
~/.copilot/skills/verification-before-completion/SKILL.md - loaded at Inspector gate

Pipeline

Pre-flight: Validate Input

Before running any role, determine whether the input is a single file or a folder of files, then follow the matching path.

Single file (e.g., data/sales.csv)

  1. Confirm the file exists and is readable
  2. Extract column names and 5 sample rows
  3. Record: { "mode": "single", "files": ["data/sales.csv"], "schema": { ... } }

Multiple files (e.g., data/ or explicit file list)

  1. List all .csv / .xlsx files in the folder (ignore hidden files and __pycache__)
  2. For each file, read column names and 5 sample rows
  3. Identify likely join keys: columns with the same name across files are join candidates - flag them
  4. Assess relationship type:
    • Same schema, different periods (e.g., jan.csv, feb.csv) → treat as a single concatenated dataset; Analyst should union before profiling
    • Different schemas, shared key (e.g., orders.csv + customers.csv) → treat as a relational dataset; Analyst should join on the shared key before profiling
    • Unrelated files → ask the user which file(s) to focus on before continuing
  5. Record: { "mode": "multi", "files": [...], "relationship": "union|join|unrelated", "join_key": "<col or null>" }

Pass the full pre-flight record to the Detective so it has context about the full dataset shape.

Both cases

  • Create narrative-output/ if it does not exist
  • Read PROJECT_CONTEXT.md if present - use domain constraints
  • Write narrative-output/preflight.json with the pre-flight record so every downstream role can read it

If the dataset path is missing, unreadable, or relationship is "unrelated", stop and ask the user before proceeding.


Role 1 - Detective

Load: ~/.copilot/skills/data-narrative/detective/SKILL.md

Task: Gather the external context that frames the dataset. Pass the Detective:

  • Dataset name and file path
  • Column names and 5 sample rows
  • Any topic hint the user provided

Done when: narrative-output/detective.json exists and contains at least 2 context items.


Role 2 - Analyst

Load: ~/.copilot/skills/data-narrative/analyst/SKILL.md + ~/.copilot/skills/data-science/SKILL.md

Task: Run exhaustive profiling of the dataset and produce a findings manifest where every finding is paired with a Python script.

Done when:

  • narrative-output/analyst.json exists with ≥ 3 findings
  • At least one Python script exists in narrative-output/analyst/
  • Every finding in analyst.json has a code.script that points to an existing file

Analyst → Editor handoff check: If the Analyst finds no findings of "significance": "high", surface this to the user before proceeding - the dataset may be too sparse to support a meaningful narrative.


Role 3 - Editor

Load: ~/.copilot/skills/data-narrative/editor/SKILL.md

Task: Select a single narrative angle and draft the report.

Done when:

  • narrative-output/editor.md exists (outline with chosen angle)
  • narrative-output/report.md exists (full draft, ≤ 800 words body, no Provenance section yet)
  • Every specific number in report.md appears verbatim in analyst.json or detective.json

Editor → Inspector handoff check: Cross-reference every statistic in report.md against analyst.json before handing off. If any number cannot be matched, re-task the Analyst to produce it before continuing.


Role 4 - Inspector

Load: ~/.copilot/skills/data-narrative/inspector/SKILL.md + ~/.copilot/skills/verification-before-completion/SKILL.md

Task: Bind every claim in report.md to its upstream evidence and write the provenance manifest.

Done when:

  • narrative-output/inspector.json exists and is schema-valid
  • ≥ 80% of quantitative claims in report.md must be bound to a Python script in narrative-output/analyst/ as their primary evidence source (evidence type: code). Claims sourced exclusively from detective.json may be tagged as evidence type reference and do not count toward the 80% threshold.
  • report.md has the Provenance footer appended by the Inspector

Verification gate: After the Inspector writes inspector.json, confirm the file exists and contains a non-empty claims[] array. Report the claim count and evidence type distribution to the user.


Completion Report

After all four roles complete, present this summary to the user:

data-narrative pipeline complete
================================
Dataset        : <path>
Report         : narrative-output/report.md
Provenance     : narrative-output/inspector.json
Angle          : <chosen angle in one sentence>
Claims bound   : <n> total | <code_count> code evidence | <ref_count> reference evidence
Analyst scripts: <count> scripts in narrative-output/analyst/

To verify all claims:
  python ~/.copilot/skills/data-narrative/inspector/scripts/verify_claims.py \
      --inspector narrative-output/inspector.json

Output File Reference

FileRoleDescription
narrative-output/detective.jsonDetectiveExternal context items with source URLs
narrative-output/analyst.jsonAnalystFindings manifest with code line references
narrative-output/analyst/*.pyAnalystPython scripts - one per finding group
narrative-output/analyst/plots/*.pngAnalystVisualisations (if produced)
narrative-output/editor.mdEditorEditorial outline: chosen angle + section plan
narrative-output/report.mdEditor + InspectorFinal narrative report with Provenance footer
narrative-output/inspector.jsonInspectorProvenance manifest (schema: inspector/references/output-schema.json)

Error Handling

SituationAction
Dataset not foundStop, ask user for correct path
Detective finds no context (0 items)Warn and continue - Editor will note "no external context available"
Analyst finds no high-significance findingsStop, present findings list to user, ask whether to proceed
Editor needs a number the Analyst did not computeRe-task Analyst before writing report.md
Analyst re-tasked more than 2 times for the same missing statisticStop, report the statistic that cannot be produced and the reason, and ask the user whether to omit that claim from the report or provide the value manually.
Inspector cannot bind a claim to evidenceFlag in inspector.json as unbound; do not fabricate evidence
Inspector coverage < 60%Report the gap to the user before declaring complete

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.