agentleFS
gaotiexinqugaotiexinqu/OneResearchClaw/.cursor/skills/document-grounding/SKILL.md

document-grounding

Skill444 starsChanged 7 months agoMITView on GitHub

Convert a raw document into a structured grounding note for downstream research and summarization.

The file

Show its rules and text

We split this skill into the rules it gives an agent

31 rules. About 0 are common, 24 are distinctive, and 7 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈24

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 7

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill when:

    line 17
  2. Distinctive:

    Do not use this skill when:

    line 24
  3. Very specific:

    Run the extraction script through the existing run.sh entrypoint.

    line 103
  4. Very specific:

    If extracted.md contains AssetRef blocks, inspect the referenced files in assets/...

    line 108
  5. Very specific:

    Write grounded.md as a real structured grounding note.

    line 109
  6. Distinctive:

    Do not stop after merely confirming that the extraction bundle exists.

    line 110
  7. Very specific:

    If an AssetRef appears relevant, the agent must inspect the referenced asset before final grounding.

    line 139
  8. Distinctive:

    Do not write a chronological recap of the document.

    line 185
  9. Distinctive:

    Do not invent facts, conclusions, owners, deadlines, or commitments.

    line 186
  10. Distinctive:

    Do not turn suggestions, hypotheses, or future work into established conclusions.

    line 187
  11. Distinctive:

    Do not add external knowledge, acronym expansions, years, benchmark details, or metadata not explicitly stated or strongly evidenced in the …

    line 188
  12. Distinctive:

    Remove low-signal boilerplate when it does not affect meaning.

    line 189
  13. Distinctive:

    Keep the output concise and structured.

    line 191
  14. Distinctive:

    Treat non-textual evidence as first-class evidence when relevant.

    line 192
  15. Distinctive:

    Only include something here if it is explicitly stated or strongly supported by the document.

    line 198
  16. Distinctive:

    If it is merely hinted, proposed, or speculative, do not present it as a confirmed finding.

    line 199
  17. Distinctive:

    Only include constraints, limitations, or risks that are explicitly stated or strongly evidenced.

    line 203
  18. Distinctive:

    Do not infer hidden constraints from weak hints.

    line 204
  19. Distinctive:

    Only mention tables, figures, formulas, diagrams, or code blocks that materially affect interpretation.

    line 208
  20. Very specific:

    Do not list every asset mechanically.

    line 209
  21. Very specific:

    If an asset was referenced in extracted.md through an AssetRef block and it appears relevant, inspect it before deciding whether to include …

    line 210
  22. Distinctive:

    Only include follow-up actions or directions that are explicitly discussed or strongly implied by the document.

    line 214
  23. Distinctive:

    Do not invent action owners, deadlines, or commitments.

    line 215
  24. Distinctive:

    Use specific noun phrases that are useful for later search.

    line 219
  25. Distinctive:

    Avoid generic terms such as:

    line 220
  26. Distinctive:

    If the document is repetitive, summarize repeated points once.

    line 231
  27. Distinctive:

    If the document is incomplete, paraphrase only when meaning is clear.

    line 232
  28. Distinctive:

    If sections conflict, keep the conflict under unresolved issues.

    line 233
  29. Very specific:

    If the main topic is genuinely unclear, write: Unclear — multiple loosely related topics appear in the document.

    line 234
  30. Distinctive:

    If non-textual assets are present but unclear, mention them cautiously rather than over-claiming their meaning.

    line 236
  31. Distinctive:

    When running the extraction script, ensure the Docling model path is set:

    line 254

≈ “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

Document Grounding

Convert a raw document into a structured grounding note.

This skill is for document grounding, not a narrative recap. It should produce a stable intermediate note that is easy to read and easy for downstream skills to use.

When to Use

Use this skill when:

  • the input is a single document file
  • the document may be a PDF, DOCX, Markdown, or TXT file
  • you need structured document notes before downstream research or summary work
  • the document may contain non-textual evidence such as tables, figures, diagrams, formulas, or code blocks

Do not use this skill when:

  • the task is to write a polished final report
  • the task is to perform external literature search
  • the task is to render output into PDF/DOCX
  • the input is a meeting transcript and you want meeting-specific grounding

Input

A single document file.

Supported first-stage formats:

  • .pdf
  • .docx
  • .md
  • .txt

The document may contain:

  • plain text
  • section headings
  • tables
  • figures / diagrams
  • formulas
  • code blocks
  • captions
  • layout / reading-order challenges

Output Bundle

For each input document, create one bundle directory:

data/grounded_notes/<type>-<doc_id>_<timestamp>/

where <type> is the file extension (e.g. pdf, docx, md, txt), <doc_id> is the sanitized filename without extension, and <timestamp> is the Beijing-time execution timestamp (format: YYYYMMDDHHMMSS).

For example:

data/grounded_notes/pdf-paper_name_20260410153022/
data/grounded_notes/docx-notes_001_20260410153100/
data/grounded_notes/md-project_readme_20260410153215/

Inside that bundle, the expected outputs are:

<bundle_dir>/
├─ ground_id.txt       # Ground ID for this unit (reused by all downstream stages)
├─ extracted.md
├─ extracted_meta.json
├─ asset_index.json
├─ grounded.md
└─ assets/
   ├─ tables/
   ├─ figures/
   └─ formulas/

The <ground_id> (e.g. pdf-paper_name_20260410153022) is the single stable identifier for the entire pipeline — all downstream directories (lit_inputs, lit_results, report_inputs, review_outputs, reports, final_outputs) reuse this same <ground_id>.

Important separation of responsibilities

  • ground_document.py is responsible for building the extraction bundle:
    • extracted.md
    • extracted_meta.json
    • asset_index.json
    • assets/...
  • The agent is responsible for reading those outputs and then writing the final:
    • grounded.md

grounded.md must be a real grounding note. It must not remain a placeholder scaffold.

Required Agent Workflow

  1. Run the extraction script through the existing run.sh entrypoint.
  2. Read:
    • extracted.md
    • extracted_meta.json
    • asset_index.json
  3. If extracted.md contains AssetRef blocks, inspect the referenced files in assets/... before writing grounded.md.
  4. Write grounded.md as a real structured grounding note.
  5. Do not stop after merely confirming that the extraction bundle exists.

AssetRef Rule

extracted.md may contain blocks such as:

[AssetRef]
type: figure
id: figure_001
path: assets/figures/figure_001.png
instruction: Inspect this asset before writing grounded.md if it is relevant to the document's claims, comparisons, or conclusions.
[/AssetRef]

and

[AssetRef]
type: table
id: table_001
path_md: assets/tables/table_001.md
path_csv: assets/tables/table_001.csv
instruction: Inspect this table before writing grounded.md if it contains key evidence, comparisons, or numerical results.
[/AssetRef]

These are not decorative markers. They indicate that important evidence may exist outside the plain extracted text. If an AssetRef appears relevant, the agent must inspect the referenced asset before final grounding.

Output Format

Return markdown with exactly these sections.

# Document Grounding

## 1. Main Topic / Purpose
[2–4 sentence statement of the document’s main topic and purpose.]

## 2. Main Points
- [One bullet per major sub-topic, contribution, or argument]

## 3. Key Findings / Claims
- [Only items explicitly stated or strongly supported by the document]

## 4. Constraints / Risks
- [Only constraints, limitations, caveats, or risks explicitly stated or strongly supported by the document]

## 4a. Important Non-Textual Elements
- [Key tables, figures, diagrams, formulas, or code blocks that materially affect interpretation]
- [Mention how they affect the reading of the document if relevant]

## 5. Unresolved Issues
- [Preserve uncertainty, unanswered questions, incomplete evidence, or limitations that remain open]

## 6. Suggested Next Steps
- [Concrete follow-up directions grounded in the document]
- [Do not invent owners, deadlines, or commitments]

## 7. Search Keywords

### Problem Keywords
- ...

### Method / Solution Keywords
- ...

### Domain / Constraint Keywords
- ...

Instructions

  • Do not write a chronological recap of the document.
  • Do not invent facts, conclusions, owners, deadlines, or commitments.
  • Do not turn suggestions, hypotheses, or future work into established conclusions.
  • Do not add external knowledge, acronym expansions, years, benchmark details, or metadata not explicitly stated or strongly evidenced in the document.
  • Remove low-signal boilerplate when it does not affect meaning.
  • Group related content into high-level sub-topics instead of page-by-page bullets.
  • Keep the output concise and structured.
  • Treat non-textual evidence as first-class evidence when relevant.

Special Rules

Key Findings / Claims

Only include something here if it is explicitly stated or strongly supported by the document. If it is merely hinted, proposed, or speculative, do not present it as a confirmed finding.

Constraints / Risks

Only include constraints, limitations, or risks that are explicitly stated or strongly evidenced. Do not infer hidden constraints from weak hints.

Important Non-Textual Elements

Only mention tables, figures, formulas, diagrams, or code blocks that materially affect interpretation. Do not list every asset mechanically. If an asset was referenced in extracted.md through an AssetRef block and it appears relevant, inspect it before deciding whether to include it.

Suggested Next Steps

Only include follow-up actions or directions that are explicitly discussed or strongly implied by the document. Do not invent action owners, deadlines, or commitments.

Search Keywords

Use specific noun phrases that are useful for later search. Avoid generic terms such as:

  • project
  • document
  • update
  • issue
  • optimization
  • system

Handling Difficult Cases

  • If the document is repetitive, summarize repeated points once.
  • If the document is incomplete, paraphrase only when meaning is clear.
  • If sections conflict, keep the conflict under unresolved issues.
  • If the main topic is genuinely unclear, write: Unclear — multiple loosely related topics appear in the document.
  • For long documents, identify major section shifts first, then synthesize.
  • If non-textual assets are present but unclear, mention them cautiously rather than over-claiming their meaning.

Execution Rule

The task is not complete if grounded.md is missing, empty, or still contains placeholder scaffold text. The agent must overwrite or newly create grounded.md with a real grounding note based on:

  • extracted.md
  • extracted_meta.json
  • asset_index.json
  • any relevant files referenced from assets/...

Example Invocation

/document-grounding

Environment Variables

When running the extraction script, ensure the Docling model path is set:

export DOCLING_ARTIFACTS_PATH="${PROJECT_ROOT}/models/docling"

Supported model path locations (checked in order):

  • ${PROJECT_ROOT}/models/docling
  • ${PROJECT_ROOT}/models/docling-project/docling-models
  • /root/.cache/docling/models

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.