agentleFS
lyh843lyh843/AgentSkills/skills/grounded-file-qa/SKILL.md

grounded-file-qa

Skill1 starsChanged 5 months agoMITView on GitHub

Read one or more local files, especially PDFs, and answer follow-up questions grounded in those sources. Use when the user wants Codex to ingest files first, keep track of evidence across later questions, compare multiple documents, extract key points or terminology, cite file or page anchors, or build a compact working note from a document set.

We split this skill into the rules it gives an agent

25 rules. About 0 are common, 17 are distinctive, and 8 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈17

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 8

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill for source-grounded reading workflows.

    line 9
  2. Distinctive:

    Start reading immediately unless the goal changes the reading strategy in a material way.

    line 14
  3. Distinctive:

    Treat the provided files as the primary source of truth unless the user explicitly asks for outside knowledge.

    line 15
  4. Very specific:

    Prefer a scratch folder such as /tmp/grounded-file-qa/<topic>/.

    line 18
  5. Very specific:

    Run scripts/ingest_documents.sh <scratch-dir> <file1> ...

    line 19
  6. Very specific:

    Read manifest.tsv first to see which files were extracted cleanly and which need fallback handling.

    line 20
  7. Very specific:

    Read source_map.md for a fast human-readable overview and page_manifest.tsv when page-level anchors matter.

    line 21
  8. Distinctive:

    If the user only gave one short text file, skip the scratch folder and read it directly.

    line 22
  9. Very specific:

    Prefer a markdown note in the scratch dir such as evidence.md.

    line 31
  10. Distinctive:

    Use references/evidence-sheet-template.md when the task has multiple files or many follow-up questions.

    line 32
  11. Distinctive:

    Keep only high-signal items: per-file summary, glossary, timeline, formulas, unresolved ambiguities, and page anchors.

    line 33
  12. Distinctive:

    Update the sheet instead of re-reading everything from zero when the conversation continues.

    line 34
  13. Very specific:

    If the user wants study or interview prep, also maintain question_bank.md with likely follow-up questions.

    line 35
  14. Distinctive:

    Add page anchors for PDFs and section headings or line spans for text files when practical.

    line 39
  15. Distinctive:

    If a question cannot be answered from the files, say that before adding outside knowledge.

    line 41
  16. Very specific:

    Prefer pdftotext -layout through the ingest script for readable extraction.

    line 44
  17. Very specific:

    Prefer pdfinfo page counts plus the generated pages/ directory when page-level lookup will matter later.

    line 45
  18. Distinctive:

    If extraction is noisy but usable, answer cautiously and cite short anchors.

    line 46
  19. Distinctive:

    If the PDF is image-only or badly scanned, say OCR is needed and do not pretend the text is reliable.

    line 47
  20. Distinctive:

    Use the same source bundle to optionally provide:

    line 57
  21. Distinctive:

    Do not claim to have read a file you have not opened or extracted.

    line 67
  22. Distinctive:

    Do not turn weak OCR or garbled extraction into confident prose.

    line 68
  23. Distinctive:

    Prefer "the file suggests" over certainty when evidence is partial.

    line 69
  24. Distinctive:

    Keep quotes short and only when they materially help.

    line 70
  25. Distinctive:

    If later answers depend on a cached note, refresh the original source before making a high-stakes claim.

    line 71

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

Grounded File QA

Overview

Use this skill for source-grounded reading workflows. The job is not just "summarize this once", but "read these files now and keep answering later questions from them."

Workflow

  1. Identify the source bundle.
    • Collect the exact local file paths the user provided.
    • Start reading immediately unless the goal changes the reading strategy in a material way.
    • Treat the provided files as the primary source of truth unless the user explicitly asks for outside knowledge.
  2. Build a scratch bundle when the task is larger than one quick answer.
    • Prefer a scratch folder such as /tmp/grounded-file-qa/<topic>/.
    • Run scripts/ingest_documents.sh <scratch-dir> <file1> ... to extract PDF text and normalize text-like files.
    • Read manifest.tsv first to see which files were extracted cleanly and which need fallback handling.
    • Read source_map.md for a fast human-readable overview and page_manifest.tsv when page-level anchors matter.
    • If the user only gave one short text file, skip the scratch folder and read it directly.
  3. Read in passes.
    • First pass: map each file's purpose, structure, and likely relevant sections.
    • Second pass: extract the evidence needed for the current question.
    • For PDFs, prefer the page shards under pages/<id>/pNNN.txt so answers can cite filename p.N.
    • For multiple files, record agreements, conflicts, and gaps instead of merging everything blindly.
  4. Maintain a compact evidence sheet for later turns.
    • Prefer a markdown note in the scratch dir such as evidence.md.
    • Use references/evidence-sheet-template.md when the task has multiple files or many follow-up questions.
    • Keep only high-signal items: per-file summary, glossary, timeline, formulas, unresolved ambiguities, and page anchors.
    • Update the sheet instead of re-reading everything from zero when the conversation continues.
    • If the user wants study or interview prep, also maintain question_bank.md with likely follow-up questions.
  5. Answer with grounded claims.
    • Cite the source file for non-obvious claims.
    • Add page anchors for PDFs and section headings or line spans for text files when practical.
    • Separate direct evidence from your inference.
    • If a question cannot be answered from the files, say that before adding outside knowledge.

PDF Handling

  • Prefer pdftotext -layout through the ingest script for readable extraction.
  • Prefer pdfinfo page counts plus the generated pages/ directory when page-level lookup will matter later.
  • If extraction is noisy but usable, answer cautiously and cite short anchors.
  • If the PDF is image-only or badly scanned, say OCR is needed and do not pretend the text is reliable.
  • Ignore headers, footers, page numbers, watermarks, and repeated slide chrome unless they matter.

Multi-file Patterns

  • For comparison requests, build a table with columns such as source, claim, evidence, and confidence.
  • For study or report files, keep a glossary of terms, symbols, acronyms, and formulas.
  • For policy or requirement sets, track conflicts and the latest controlling source if dates or versions are present.
  • For code plus PDF/context mixes, treat executable behavior and source files as first-party evidence and use the PDF as explanatory context.

Extra Capabilities

Use the same source bundle to optionally provide:

  • a 5-10 line executive summary
  • a glossary or concept map
  • a question bank for revision or interview prep
  • a comparison matrix across files
  • a list of contradictions or open questions
  • a reusable brief file for later turns
  • a per-page lookup path for later precise quoting or citation

Reliability Rules

  • Do not claim to have read a file you have not opened or extracted.
  • Do not turn weak OCR or garbled extraction into confident prose.
  • Prefer "the file suggests" over certainty when evidence is partial.
  • Keep quotes short and only when they materially help.
  • If later answers depend on a cached note, refresh the original source before making a high-stakes claim.

Fast Prompt Patterns

  • Use $grounded-file-qa to read these PDFs first, then answer my later questions from them.
  • Use $grounded-file-qa to compare these two papers and keep a running evidence note.
  • Use $grounded-file-qa to ingest this folder of PDFs and build a glossary plus summary for follow-up Q&A.
  • Use $grounded-file-qa to read the provided files and answer only from those sources unless I ask otherwise.

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.