method-extract skill
Extracts structured methods, cohorts, endpoints, and statistical models from PubMed papers to provide grounding for Statistical Analysis Plans.
- GitHub stars
- 6
- Files
- 4
- Last commit
- Oct 31, 2026
- License
- MIT
- Allowed tools
- —
What does the method-extract skill do?
method-extract extracts structured methods, cohorts, endpoints, and statistical models from PubMed papers to provide grounding for Statistical Analysis Plans.
Summary generated from the skill's SKILL.md.
About the method-extract skill
Extracting specific methodological details from medical literature to justify Statistical Analysis Plans is the primary function of this skill. It is designed for researchers and statisticians who need to ground their analysis choices in existing evidence. The tool processes PubMed result CSV files to identify cohorts, endpoints, statistical models, and covariates used in prior studies.
An agent should load this skill after running method-pubmed to transform raw search results into a structured comparison table. It prioritizes full-text access through PubMed or Paperclip connectors to ensure high-quality data, only falling back to abstracts when full text is unavailable. The process produces a detailed CSV file containing sample sizes, analysis populations, and software used, alongside a markdown summary that highlights modal methods and effect-size ranges. This structured output provides the necessary context for downstream tasks like power calculations or model selection.
What an agent can do with it
- 1Justify statistical model choicesA developer can use this to find the most common statistical methods and adjustment sets used in previous studies for a specific outcome.
- 2Generate a methods comparison tableProvide a path to a PubMed CSV to create a structured table of cohorts, outcomes, and effect sizes.
Written from the skill's SKILL.md. Every use case is checked against a quote from it.
How to install the method-extract skill
Each command copies the skill folder into the client's skills directory. Restart the client or start a new session to load it.Install the method-extract skill in Plugin
/plugin marketplace add sajor2000/methodsmith /plugin install methodsmith@methodsmith
Install the method-extract skill in Claude Code
~/.claude/skills/method-extract/SKILL.md
$ npx degit sajor2000/methodsmith/plugins/methodsmith/skills/method-extract ~/.claude/skills/method-extractInstall the method-extract skill in Claude Code (project)
.claude/skills/method-extract/SKILL.md
$ npx degit sajor2000/methodsmith/plugins/methodsmith/skills/method-extract .claude/skills/method-extractInstall the method-extract skill in Codex
~/.agents/skills/method-extract/SKILL.md
$ npx degit sajor2000/methodsmith/plugins/methodsmith/skills/method-extract ~/.agents/skills/method-extractInstall the method-extract skill in Gemini CLI
~/.gemini/skills/method-extract/SKILL.md
$ npx degit sajor2000/methodsmith/plugins/methodsmith/skills/method-extract ~/.gemini/skills/method-extractInstall the method-extract skill in Claude.ai
npx degit sajor2000/methodsmith/plugins/methodsmith/skills/method-extract method-extract && zip -r method-extract.zip method-extract # claude.ai → Customize → Skills → + → Create skill → Upload a skill → method-extract.zip
SKILL.md
View on GitHubMethod Extraction from Prior Literature
Skill Value
- Problem it solves: Plans cite papers but often miss the methods details needed to justify analysis choices.
- Use when: The user has PubMed, Paperclip, or literature-search results and needs methods grounding.
- Output: Structured methods extraction table with cohort, outcome, model, covariate, and effect-size clues.
- Ask only if: Only when source set, extraction fields, or target SAP section is unclear.
- Do not do: Do not treat abstracts as full-text evidence when methods are unavailable.
- Interaction: Check repo/config/chat evidence first. Ask one decision-changing question at a time; use the current harness's blocking question UI when available, otherwise present numbered choices and wait.
Reads a PubMed result CSV and produces a structured methods-comparison table for the SAP.
When this skill activates
- After
method-pubmedhas producedanalysis/pubmed/<query>-<date>.csv - During
method-planSAP drafting when method choice needs justification - Before
method-powerwhen you need literature context for the target difference (published effects are typically inflated by publication bias and small-study effects;method-powershould justify the target difference as important and/or realistic per DELTA2, Cook et al., BMJ 2018, PMID 30560792)
Prerequisites
- A PubMed result CSV (from
method-pubmed) exists - For
--full-text-only, the rows must have non-emptypmcid(open PMC full text), or Paperclip must be able tolookupthe paper
Evidence access
When this run needs literature, read references/evidence-access.md first; never invent a citation, effect size, or guideline item.
- Look up here: the full text of each included paper (Methods, Results, statistical-analysis sections, and Table 1) for methods extraction; the CSV abstract is the source only when no lawful full text exists.
Core workflow
Step 0: Context inputs (scan chat first)
If no <path/to/pubmed-results.csv> was passed as the first argument, scan the most recent ~50 chat turns for __CE_PUBMED_RESULTS__ csv=<path> n=<int> .... If found, use that CSV path as the input.
Also scan for __CE_EVIDENCE_MAP__ path=<artifact> sources=pubmed[,paperclip] .... If present, read the evidence map before extraction and use it to prioritize papers, identify full-text-verified claims, and avoid re-asking literature questions already answered there. The PubMed CSV remains the required tabular input for this skill; the evidence map is context, not a replacement CSV.
Print: [pubmed] using results from <path> (n=<N>). If neither an explicit path nor the signal is present, ask the user to load the method-pubmed skill first or pass a CSV path explicitly.
Step 1: Load and prioritize
Read the input CSV. If --full-text-only, drop rows without pmcid and report how many were dropped. Sort by year (descending), then by design (RCT > prospective cohort > retrospective cohort > case-control > case series; a project ordering for reading priority, not an evidence grade). Cap at --max (default 25).
Step 2: Read the paper, not only the abstract
MCP egress (every mode): send PubMed, Paperclip, and other MCP or web tools only search terms, MeSH terms, PMIDs, DOIs, and titles, never data values, identifiers, row text, or data files; an endpoint approval does not cover third-party services.
Full text is the extraction source whenever it is lawfully available; the CSV abstract alone is the last resort. For each paper, in preference order:
- PubMed MCP full text. For rows with a
pmcid, callpubmed_fetch_fulltext(default server), orget_copyright_statusand thenget_full_text_article(other connectors), with the PMCID. Read the Methods, Results, and statistical-analysis sections and Table 1. Cite PubMed and include the DOI in the output row. - Paperclip MCP full text.
lookupthe paper bydoi,pmid, orpmc, thencatthe Methods/Results sections orgrep/scanfor the field cues in Step 3 (for exampleCox|logistic|mixed|propensity|primary outcome). The authenticatedpaperclipCLI is the fallback for the same reads. Paperclip may cover papers without a PMCID. - E-utilities fallback when neither MCP server is connected and the row has a
pmcid:efetch.fcgi?db=pmc&id=<pmcid>&rettype=xml&retmode=xml, then extract<sec sec-type="methods">,<sec sec-type="results">, and<sec sec-type="statistics">. - Abstract only when no lawful full text exists: use the abstract from the input CSV and say so.
Record what was read in an evidence_level column: full_text when any of paths 1-3 was read, abstract otherwise. Under --full-text-only, drop rows that end at abstract and report them.
Step 3: Extract structured fields per paper
For each paper, populate:
| Field | Source heuristic |
|---|---|
sample_size |
"we enrolled N", "Final analytic cohort comprised N", first table-1 N |
primary_outcome |
"primary outcome was X", "primary endpoint", first sentence after "Outcomes" subsection |
outcome_type |
continuous / binary / time-to-event / count / ordinal |
analysis_population |
ITT / per-protocol / mITT / complete-case / multiple-imputation |
statistical_method |
"Cox proportional hazards", "logistic regression", "linear mixed model", etc. |
adjustment_set |
covariates listed in the model |
software |
R + package name, SAS, Stata, Python+statsmodels/sklearn, etc. |
multiplicity_control |
Bonferroni / FDR / hierarchical / none |
effect_size_reported |
OR, HR, RR, mean diff, with 95% CI |
design |
RCT / prospective cohort / retrospective cohort / case-control / cross-sectional / simulation / methods guidance |
bias_flags |
stated or obvious: selection, confounding, small n, single site, outcome-reporting; none noted otherwise (not a formal risk-of-bias assessment) |
checklist_followed |
CONSORT / STROBE / TRIPOD / TRIPOD+AI / PRISMA / none stated |
evidence_level |
full_text or abstract, from Step 2 |
Be conservative: if the paper does not state a field, write not reported rather than infer. Fields such as adjustment_set, software, and multiplicity_control are rarely in an abstract; on an abstract row expect not reported rather than a guess.
Step 4: Write the comparison table
Save to analysis/pubmed/<query-slug>-methods.csv with one row per paper, keeping the input's pmid, year, first_author, doi, and pmcid columns (method-meta-analysis needs them). Also write analysis/pubmed/<query-slug>-methods-summary.md:
- Modal method (most common) per outcome type
- Method × year matrix (is the field shifting?)
- Software × method matrix (what to install)
- Effect-size range (min / median / max) for each commonly-reported metric, with a note that published estimates are likely inflated and should not be used unadjusted as the power target
- % of papers stating a checklist (low % is itself informative)
- % of rows at
full_textversusabstract, so the SAP states how much of the justification rests on abstracts
Step 5: Emit signal for downstream skills
__CE_METHOD_EXTRACT__ csv=<path> n=<count> modal_method=<name>
Completion check before emitting: every row has pmid or doi, design, and evidence_level; no field is filled by inference (not reported instead); the summary's full_text percentage matches the CSV.
The modal method is reported as context for method-model-choice, which selects the analytic method from the estimand, outcome, and data structure; method frequency is never the selection criterion. The comparison table (PMIDs, DOIs, per-row design and evidence_level) is the citation for that context.
What this skill does NOT do
- Does not download PDFs or use unauthorized mirrors (full text via open PMC or a connected Paperclip service only)
- Does not perform formal risk-of-bias or quality appraisal (it records design and obvious bias flags only)
- Does not pool effect sizes (use the
method-meta-analysisskill) - Does not match the study to a checklist (use the
method-checklistskill)
References
@./references/extraction-prompts.md
@./references/method-taxonomy.md
Files in this skill
4method-extract skill questions
How do I install the method-extract skill in Claude Code?
Run npx degit sajor2000/methodsmith/plugins/methodsmith/skills/method-extract ~/.claude/skills/method-extract. Claude Code loads skills from ~/.claude/skills (all projects) or .claude/skills (one project) and uses a skill when its description matches the task.
Which clients can use the method-extract skill?
Any client that reads the Agent Skills format: Claude Code, Codex, Gemini CLI and claude.ai (upload as a ZIP). Scripts in the skill run only where the client allows code execution.
Can the skill use abstracts for all extractions?
The skill prefers full-text evidence from PubMed or Paperclip; abstracts are used only as a last resort when no lawful full text is available.
Does this skill perform a formal risk-of-bias assessment?
No, it only records the study design and any obvious bias flags mentioned in the text, rather than performing a formal quality appraisal.