experiment-detail-comparator

Compare experimental method details between two Zotero PDF papers, identify protocol differences (ratios, dosages, timing, conditions), search supporting literature to explain why they differ, and generate an HTML report. Use when you need a parameter-level comparison of two methods and evidence-backed reasons for discrepancies.

53 stars

Best use case

experiment-detail-comparator is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Compare experimental method details between two Zotero PDF papers, identify protocol differences (ratios, dosages, timing, conditions), search supporting literature to explain why they differ, and generate an HTML report. Use when you need a parameter-level comparison of two methods and evidence-backed reasons for discrepancies.

Teams using experiment-detail-comparator should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/experiment-detail-comparator/SKILL.md --create-dirs "https://raw.githubusercontent.com/aipoch/medical-research-skills/main/scientific-skills/Other/experiment-detail-comparator/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/experiment-detail-comparator/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How experiment-detail-comparator Compares

Feature / Agentexperiment-detail-comparatorStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Compare experimental method details between two Zotero PDF papers, identify protocol differences (ratios, dosages, timing, conditions), search supporting literature to explain why they differ, and generate an HTML report. Use when you need a parameter-level comparison of two methods and evidence-backed reasons for discrepancies.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

> **Source**: [https://github.com/aipoch/medical-research-skills](https://github.com/aipoch/medical-research-skills)

## Validation Shortcut

Run this minimal command first to verify the supported execution path:

```bash
python scripts/compare_methods.py --help
```

# Experiment Detail Comparator

## When to Use

Use this skill when you need to:

1. Compare two papers that apply the *same or highly similar* experimental method (e.g., CRISPR editing, ELISA, Western blot, synthesis protocol).
2. Identify parameter-level differences in protocols (concentration, ratio, dosage, temperature, duration, incubation, buffer composition, instrument settings).
3. Explain *why* protocols differ by searching additional references and extracting evidence-backed rationales.
4. Produce a structured, shareable **HTML comparison report** for collaborators, lab records, or reproducibility audits.
5. Standardize method extraction into machine-readable JSON for downstream analysis (QA, meta-analysis, protocol harmonization).

## Key Features

- **Zotero-first retrieval**: locate items by title/author/DOI, then resolve PDF attachments.
- **PDF → Markdown conversion** via the `mistral-pdf-to-markdown` workflow for robust text extraction.
- **Comprehensive method extraction** including:
  - reagents, concentrations, ratios, volumes
  - temperatures, durations, timing
  - organisms/cell lines, sample handling, ethics/consent (when present)
  - equipment models and settings
  - experimental design (controls, replicates, randomization/blinding when stated)
  - stepwise procedure structure
- **Optional table extraction** from PDFs to capture dense parameter tables.
- **Protocol comparison engine** producing a structured diff and a human-readable comparison table.
- **Literature-backed explanations**: query PubMed/Europe PMC/Semantic Scholar for each major difference.
- **Evidence grading** (High/Medium/Low) for each explanation.
- **HTML report generation** with citations, highlighted differences, and graded rationale sections.

## Dependencies

### Runtime (Python)

- Python `>=3.10`

### Core libraries / modules

- `json` (stdlib)
- `subprocess` (stdlib)
- `pathlib` (stdlib)
- `re` (stdlib)

### Optional but recommended

- `pdfplumber >=0.10.0` (PDF table extraction)
- `PyPDF2 >=3.0.0` (PDF text extraction / parsing support)
- `requests >=2.31.0` (download PDFs from URLs)

Install optional dependencies:

```bash
pip install "pdfplumber>=0.10.0" "PyPDF2>=3.0.0" "requests>=2.31.0"
```

### External tools / services

- Zotero MCP tools: `mcp__zotero__*`
- `mistral-pdf-to-markdown` skill (requires `MISTRAL_API_KEY`)
- Literature search tools (as available in your environment):
  - PubMed
  - Europe PMC
  - Semantic Scholar
- Optional: **EDirect** for PubMed CLI workflows  
  https://www.ncbi.nlm.nih.gov/books/NBK179288/

### Environment variables (recommended)

Set in `Notes/.env`:

- `ZOTERO_API_KEY` (required for Zotero web library access; optional for local-only)
- `ZOTERO_LIBRARY_TYPE` (`user` or `group`)
- `ZOTERO_LIBRARY_ID` (your Zotero library ID)
- `MISTRAL_API_KEY` (required for best PDF→Markdown conversion)

## Example Usage

### End-to-end run (recommended)

Compare two papers by Zotero search terms:

```bash
python run_comparison.py \
  "CRISPR-Cas9 knockout in HeLa cells" \
  "Efficient genome editing in HEK293 cells" \
  ./output
```

Compare two papers by Zotero attachment keys:

```bash
python run_comparison.py \
  ABCDEFGHIJKLMNOPQRSTUVWXYZ123456 \
  ZYXWVUTSRQPONMLKJIHGFEDCBA654321 \
  ./output
```

Compare two local PDFs:

```bash
python run_comparison.py \
  ./paper1.pdf \
  ./paper2.pdf \
  ./output
```

Expected outputs (in `./output`):

- `comparison_report.html`
- `method_details.json`
- `explanations.json`

### Manual workflow (script-by-script)

1) **Find items in Zotero and resolve PDF attachments**

```python
result1 = mcp__zotero__zotero_search_items(query="paper 1 title or author", limit=5)
item_key1 = result1[0]["key"]

result2 = mcp__zotero__zotero_search_items(query="paper 2 title or author", limit=5)
item_key2 = result2[0]["key"]

children1 = mcp__zotero__zotero_get_item_children(item_key=item_key1)
attachment_key1 = [c for c in children1 if c.get("type") == "application/pdf"][0]["key"]

children2 = mcp__zotero__zotero_get_item_children(item_key=item_key2)
attachment_key2 = [c for c in children2 if c.get("type") == "application/pdf"][0]["key"]
```

2) **Retrieve PDFs (local cache first, download if needed)**

```bash
python scripts/get_zotero_pdf.py "$ATTACHMENT_KEY1"
python scripts/get_zotero_pdf.py "$ATTACHMENT_KEY2"
```

3) **Convert PDFs to Markdown**

```bash
python scripts/convert_pdf_to_markdown.py "PATH_TO_PDF1" "temp/paper1.md"
python scripts/convert_pdf_to_markdown.py "PATH_TO_PDF2" "temp/paper2.md"
```

4) **Extract comprehensive method details to JSON**

```bash
python scripts/extract_method_section.py temp/paper1.md temp/paper1_method.json
python scripts/extract_method_section.py temp/paper2.md temp/paper2_method.json
```

5) **Compare extracted methods**

```bash
python scripts/compare_methods.py temp/paper1_method.json temp/paper2_method.json output/comparison.json
```

6) **Search literature for explanations (per major difference)**

```bash
python scripts/search_explanations.py output/comparison.json output/explanations.json
```

7) **Generate HTML report**

```bash
python scripts/generate_html_report.py \
  temp/paper1_method.json \
  temp/paper2_method.json \
  output/comparison.json \
  output/explanations.json \
  output/comparison_report.html
```

## Implementation Details

### 1) Method extraction schema (what is captured)

The extraction step aims to produce a structured JSON object per paper with:

- **Basic parameters**
  - method name (if inferable)
  - reagents and materials
  - concentrations, ratios, dosages, volumes
  - temperatures, durations, timing
  - organisms/cell lines
  - equipment list

- **Experimental design**
  - control vs experimental groups
  - replicates (technical/biological; e.g., *n=3*)
  - sample size statements
  - randomization/blinding (only if explicitly stated)
  - block design cues (if present)

- **Materials detail**
  - chemicals (supplier/manufacturer, catalog/batch when present)
  - kits and manufacturers
  - media/buffers and compositions (when listed)
  - solvents

- **Equipment detail**
  - instrument model/manufacturer
  - instrument settings (e.g., centrifuge speed, wavelength, incubation conditions)

- **Sample information**
  - source and handling (fresh/frozen/fixed/dried)
  - storage conditions
  - ethics approval / consent statements (when present)

- **Key steps**
  - step sequence (numbered when possible)
  - step type tags (preparation / reaction / purification / detection)

### 2) Optional enhancements

#### A) Extract tables directly from PDF

Use when parameters are primarily in tables (common in materials lists, primer tables, buffer recipes):

```bash
python scripts/extract_pdf_tables.py paper.pdf output/tables.json
```

Output includes detected table types (e.g., materials/parameters/results) and normalized JSON rows.

#### B) Download and parse full PDFs (URL or local)

Use when you need full-text parsing, DOI detection, or multi-language handling:

```bash
python scripts/download_full_pdf.py https://example.com/paper.pdf ./downloads
# or
python scripts/download_full_pdf.py ./local/paper.pdf ./parsed
```

Features:
- automatic language detection (e.g., English/CJK/Russian)
- DOI extraction
- JSON metadata + plain text output

### 3) Comparison logic (protocol diff)

`compare_methods(...)` identifies differences across normalized fields and produces:

- a **parameter comparison table** (Paper 1 vs Paper 2)
- a list of **significant differences** (heuristics typically prioritize:
  - large numeric deltas (e.g., 2× concentration, 10°C shift)
  - categorical changes (different reagent, cell line, instrument)
  - timing/sequence changes that affect outcomes)

Example comparison table structure:

| Parameter | Paper 1 | Paper 2 | Difference |
|---|---|---|---|
| Reagent concentration | 10 mM | 20 mM | 2× higher in Paper 2 |
| Temperature | 37°C | 25°C | 12°C lower in Paper 2 |
| Duration | 2 h | 4 h | 2× longer in Paper 2 |

### 4) Literature search and explanation synthesis

For each significant difference, the skill builds targeted queries such as:

- `{method_name} {parameter} optimization`
- `{parameter} effect on yield`
- `{reagent} concentration protocol comparison`

Supported sources (depending on your toolchain availability):

- PubMed
- Europe PMC (including full-text term extraction when available)
- Semantic Scholar (including PDF snippet retrieval when available)

The output is an explanation object per parameter with:
- summary rationale
- citations
- extracted supporting snippets (when available)

### 5) Evidence grading rubric

Each explanation is graded:

- **High**: direct mechanistic or comparative experimental evidence supporting the parameter choice.
- **Medium**: empirical optimization/functional evidence without strong mechanistic validation.
- **Low**: review-level mention, indirect rationale, or anecdotal protocol statements.

### 6) HTML report generation

The report includes:

- paper metadata blocks
- a comparison table with highlighted differences
- per-parameter explanation sections with evidence grade styling
- references list

Primary output file:

- `comparison_report.html` (shareable, human-readable)

Supporting outputs:

- `method_details.json` (structured extraction for both papers)
- `explanations.json` (search results + graded rationales)

## When Not to Use

- Do not use this skill when the required source data, identifiers, files, or credentials are missing.
- Do not use this skill when the user asks for fabricated results, unsupported claims, or out-of-scope conclusions.
- Do not use this skill when a simpler direct answer is more appropriate than the documented workflow.

## Required Inputs

- A clearly specified task goal aligned with the documented scope.
- All required files, identifiers, parameters, or environment variables before execution.
- Any domain constraints, formatting requirements, and expected output destination if applicable.

## Recommended Workflow

1. Validate the request against the skill boundary and confirm all required inputs are present.
2. Select the documented execution path and prefer the simplest supported command or procedure.
3. Produce the expected output using the documented file format, schema, or narrative structure.
4. Run a final validation pass for completeness, consistency, and safety before returning the result.

## Output Contract

- Return a structured deliverable that is directly usable without reformatting.
- If a file is produced, prefer a deterministic output name such as `experiment_detail_comparator_result.md` unless the skill documentation defines a better convention.
- Include a short validation summary describing what was checked, what assumptions were made, and any remaining limitations.

## Validation and Safety Rules

- Validate required inputs before execution and stop early when mandatory fields or files are missing.
- Do not fabricate measurements, references, findings, or conclusions that are not supported by the provided source material.
- Emit a clear warning when credentials, privacy constraints, safety boundaries, or unsupported requests affect the result.
- Keep the output safe, reproducible, and within the documented scope at all times.

## Failure Handling

- If validation fails, explain the exact missing field, file, or parameter and show the minimum fix required.
- If an external dependency or script fails, surface the command path, likely cause, and the next recovery step.
- If partial output is returned, label it clearly and identify which checks could not be completed.

## Quick Validation

Run this minimal verification path before full execution when possible:

```bash
python scripts/compare_methods.py --help
```

Expected output format:

```text
Result file: experiment_detail_comparator_result.md
Validation summary: PASS/FAIL with brief notes
Assumptions: explicit list if any
```

## Deterministic Output Rules

- Use the same section order for every supported request of this skill.
- Keep output field names stable and do not rename documented keys across examples.
- If a value is unavailable, emit an explicit placeholder instead of omitting the field.

## Completion Checklist

- Confirm all required inputs were present and valid.
- Confirm the supported execution path completed without unresolved errors.
- Confirm the final deliverable matches the documented format exactly.
- Confirm assumptions, limitations, and warnings are surfaced explicitly.

Related Skills

pdf-extract-experimental-materials

53
from aipoch/medical-research-skills

Extract experimental materials and instrument information from PDFs (or PDF-derived text/Markdown) into three CSV tables; use when a paper/report contains sections like Materials and Methods, Key Resources Table, Reagents, Antibodies, Consumables, Software, Equipment, Instruments, or Reagent Preparation.

literature-experiment-extract

53
from aipoch/medical-research-skills

Extract experimental models, experimental methods, and biomarker information from paper Markdown (typically produced by PDF-to-Markdown tools) when a user provides paper Markdown and needs a structured, evidence-backed summary (1 Markdown + 3 CSVs).

experimental-data-analysis

53
from aipoch/medical-research-skills

Statistical analysis and reporting for experimental datasets; use when you need to interpret experimental results, test significance (t-tests/ANOVA), or generate reproducible reports.

active-comparator-single-soc-faers-safety-comparison

53
from aipoch/medical-research-skills

Generates complete FAERS pharmacovigilance study designs for multi-drug or class-level safety comparison inside one predefined SOC or AE family using active comparators, disproportionality analysis, subgroup characterization, and reviewer-facing evidence control.

skill-auditor

53
from aipoch/medical-research-skills

A comprehensive auditor for any agent skill — including Manus, OpenClaw/ClawHub, Claude, LobeHub, or custom SKILL.md-based skills. Use this skill whenever a user wants to evaluate, audit, review, score, or quality-check an agent skill before publishing, updating, or deploying. Covers two hard veto gates (structural redlines + research integrity redlines), static quality scoring across 25 criteria (ISO 25010 + OpenSSF + Agent), dynamic test input generation, multi-mode execution testing, multi-layer output evaluation with five specialized category rubrics (Evidence Insight / Protocol Design / Data Analysis / Academic Writing / Other), a Research Veto that applies to all four research categories, human eval viewer generation, actionable P0/P1/P2 optimization recommendations, and automatic skill improvement that outputs a polished, production-ready SKILL.md. Also use whenever a user says "audit my skill", "evaluate my skill", "improve my skill", or wants a corrected version after evaluation.

two-sample-mr-research-planner

53
from aipoch/medical-research-skills

Generates complete two-sample Mendelian randomization (MR) research designs from a user-provided research direction. Use when users want to design, plan, or build a study using two-sample MR to test causal relationships. Triggers:"design a two-sample MR study", "build a publishable MR paper", "test whether this biomarker causally affects this disease", "generate Lite/Standard/Advanced MR plans", "screen multiple exposures with MR", "bidirectional MR design", "causal inference using GWAS summary statistics", or "I want to study X and Y using MR". Always outputs four workload configurations (Lite / Standard / Advanced / Publication+) with a recommended primary plan, step-by-step workflow, figure plan, validation strategy, minimal executable version, and publication upgrade path.

research-proposal-generator

53
from aipoch/medical-research-skills

Generates a comprehensive research proposal design based on input literature, including hypothesis, mechanism verification, and budget. Use when the user wants to design a research project from a paper.

research-grants

53
from aipoch/medical-research-skills

Write competitive research proposals for NSF, NIH, DOE, DARPA, and Taiwan's NSTC when you need agency-compliant narratives, budgets, and review-criteria alignment for a specific solicitation/FOA/BAA.

protocol-standardization

53
from aipoch/medical-research-skills

Standardize fragmented experimental steps into reproducible protocol documents when you need method organization, lab SOP drafting, or cross-operator reproducibility; missing parameters must be explicitly marked as "To be supplemented/Not provided".

prospero-registration-helper

53
from aipoch/medical-research-skills

Assists researchers in generating PROSPERO registration content for meta-analyses from a title and optional protocol. Use when the user wants to draft a PROSPERO registration form.

non-tumor-ml-research-planner

53
from aipoch/medical-research-skills

Generates complete non-tumor biomedical machine learning research designs from a user-provided research direction. Always use this skill when users want to plan bioinformatics + ML papers for non-cancer diseases (metabolic, cardiovascular, kidney, inflammatory, autoimmune, infectious, neurological, endocrine, wound healing, chronic multifactor), design diagnostic biomarker studies, combine GEO datasets with feature selection and ML modeling, or generate Lite/Standard/Advanced/Publication+ workload plans. Trigger for:"non-tumor ML study", "bioinformatics paper outside oncology", "key genes and diagnostic model for a disease", "pyroptosis/ferroptosis/senescence/autophagy + disease", "GEO datasets + machine learning", "RF + LASSO diagnostic model", "DEG + feature selection + validation", "immune infiltration + biomarker", "non-cancer biomarker paper". Trigger even for casual phrasings like "I want to study X using machine learning", "help me design a non-tumor bioinformatics paper", or "how do I build a diagnostic model for disease Y".

network-tox-docking-research-planner

53
from aipoch/medical-research-skills

Generates complete network toxicology + molecular docking research designs from a user-provided toxicant and disease/phenotype. Always use this skill when users want to investigate how an environmental toxicant, endocrine disruptor, heavy metal, food contaminant, pharmaceutical residue, or consumer product chemical may contribute to a disease through shared molecular targets, hub genes, pathways, and docking evidence. Trigger for:"network toxicology study", "toxicology mechanism paper", "target prediction + PPI + docking", "environmental pollutant and disease mechanism", "hub genes and docking for toxicant", "Lite/Standard/Advanced toxicology plan", "CTD + SwissTargetPrediction + GeneCards + STRING", "CB-Dock2 docking study", "triclosan/BPA/cadmium/PFAS + disease". Also triggers for Chinese phrasings:"网络毒理学研究设计"、"毒物机制论文"、"靶点预测+PPI+对接"、"环境污染物与疾病机制". Trigger even for casual phrasings like "I want to study how chemical X affects disease Y" or "help me design a toxicology paper". Always output four workload configurations (Lite / Standard / Advanced / Publication+) with a recommended primary plan, step-by-step workflow, figure plan, validation strategy, minimal executable version, and publication upgrade path.