--- name: result-figure-consistencycheck description: Checks consistency between paper result descriptions and figure legends (text-only) when the input is a PDF-to-Markdown full text containing page breaks (e.g., `## Page XX`) and legend text; outputs a Markdown consistency report and a UTF-8 CSV issue list. license: MIT author: AIPOCH --- > **Source**: [https://github.com/aipoch/medical-research-skills](https://github.com/aipoch/medical-research-skills) ## When to Use - You converted a paper PDF to Markdown and need to verify that **Results text** matches **figure legends** (without inspecting the images). - You want to detect **missing figure references** in the Results section (e.g., a legend describes an analysis not mentioned in text). - You need to find **numerical/label mismatches** (e.g., group names, time points, units, n-values) between Results paragraphs and legends. - You are preparing a revision and want an **actionable discrepancy list** down to the **panel/sub-figure** level. - You need standardized outputs (Markdown report + CSV) for editorial or QA workflows. ## Key Features - Compares **Results descriptions** vs **figure legend text** using the PDF-to-Markdown source (including `## Page XX` markers). - Produces: - A **Markdown consistency report** (UTF-8). - A **CSV issue list** (UTF-8) with structured fields for tracking and revision. - Enforces a **template-based report format** using `assets/consistency_template.md`. - Uses a **rule/checklist reference** from `references/guide.md`. - Text-only validation: **does not read figure images** and **does not infer visual content**. ## Dependencies - None (no external runtime dependencies specified). - Input prerequisite (if starting from PDF): a PDF-to-Markdown conversion step (e.g., `pdf-extract`) must be completed before running this check. ## Example Usage ### Input Place the converted full text Markdown in your working location (example: `inputs/paper_fulltext.md`). The file should include page headers like: ```md ## Page 12 ... Results text ... Figure 3. ... (A) ... (B) ... ``` ### Run (conceptual workflow) 1. Read the full Markdown input (PDF conversion output). 2. Identify: - Result paragraphs describing findings. - Figure legend blocks (including panel labels such as A/B/C). 3. Compare legend statements against Results statements and record discrepancies. 4. Write outputs to `outputs/`: - `outputs/consistency_report.md` (UTF-8) - `outputs/consistency_issues.csv` (UTF-8) ### Output files **`outputs/consistency_issues.csv`** (UTF-8) columns: ```csv Figure Number,Location/Reference,Issue Description,Suggested Revision,Priority ``` Notes: - `Location/Reference` must contain only `Page XX`. - Issues should be granular to the **panel/sub-figure** level when applicable. **`outputs/consistency_report.md`** (UTF-8) must follow: - Template: `assets/consistency_template.md` - If no issues are found, write **"None found"** in the relevant sections. ## Implementation Details - **Scope of comparison** - Only compare **main text Results descriptions** and **figure legend text** present in the Markdown input. - Do **not** inspect images or infer information not explicitly stated in text. - **Rules and checklist** - Follow the specific checking rules and required output points defined in: - `references/guide.md` - **Report formatting** - The Markdown report must be generated by filling: - `assets/consistency_template.md` - Ensure all outputs are saved under: - `outputs/` (within the skill directory) - **Granularity and actionability** - Record discrepancies at the most specific level possible (e.g., Figure 2B vs Figure 2 overall). - Provide a concrete **Suggested Revision** whenever feasible (e.g., align terminology, correct numbers/units, add missing reference). - **Language** - Default output language is **Chinese**. - If the user explicitly specifies another language, output in that language. ## When Not to Use - Do not proceed when required input files, identifiers, parameters, or context are missing — ask the user to provide them first. - Do not assume capabilities beyond this skill's declared scope when the user requests external operations or inferences. - Do not proceed without user confirmation when overwriting existing results, executing high-cost batch operations, or expanding task scope. ## Required Inputs | Field | Required | Format/Source | Example | If Missing | |---|---|---|---|---| | User task description | Yes | Text | Research question, writing goal, analysis objective | Stop and ask user to provide | | Primary input material | Depends on task | Text, file path, ID, table, or literature | PMID, PDF, CSV, DOCX, keywords, etc. | Specify which material type is missing | | Output preference | No | Text | Language, format, target journal, template | Use skill default format | ## Output Contract - Primary output: Structured result or target file aligned with this skill's objective. - Optional output: Intermediate check notes, issue list, supplementary suggestions, or generated file paths. - Format requirement: Unless the user specifies otherwise, prefer stable, reviewable Markdown or JSON; if the skill's bundled script requires a fixed format, use that format. - If partially complete: Must explicitly mark as PARTIAL and state which steps are completed and which remain. ## Failure Handling - Missing critical input: Explicitly state which fields, files, or identifiers are missing and pause. - Script, template, or resource execution failure: Report the failing step, likely cause, and recovery suggestions — do not silently degrade. - Partial completion only: Return the verified portion first, then list remaining blockers and suggested next steps. ## User Checkpoints - Before executing batch processing, overwriting files, long-running searches, or multi-stage generation, confirm scope and output format with the user. - Before proceeding when a key judgment is ambiguous, evidence is insufficient, or the workflow is entering the next stage, confirm with the user. ## Input Validation This skill accepts requests that match the documented purpose of `result-figure-consistencycheck` and include enough context to complete the workflow safely. Do not continue the workflow when the request is out of scope, missing a critical input, or would require unsupported assumptions. Instead respond: > `result-figure-consistencycheck` only handles its documented workflow. Please provide the missing required inputs or switch to a more suitable skill. ## Quick Validation - Check that key scripts, templates, or reference file paths this skill depends on exist. - Check that the final output contains the core fields, sections, or files specified for this task. - Check that results clearly mark assumptions, limitations, and incomplete items.