Meta manuscript generator

From aipoch/medical-research-skills · View interactive version

Meta manuscript generator is an AI agent skill from the GitHub repository aipoch/medical-research-skills. Generates a first draft of a clinical meta-analysis paper. Input the research report (including Methods and Results sections), language, and title to automatically generate a complete paper draft including Abstract, Introduction, Discussion, and other sections, with automatic ...

How to use this skill

Skill file

Source: https://github.com/aipoch/medical-research-skills

Meta-Analysis Manuscript Generator

Generates a first draft of a meta-analysis paper meeting SCI journal standards based on the user-provided research report, including reference support.

When to Use

Key Features

Dependencies

Example Usage

cd "20260316/scientific-skills/Academic Writing/meta-manuscript-generator"
python -m py_compile scripts/insert_references.py
python scripts/insert_references.py --help

Example run plan:

  1. Confirm the user input, output path, and any required config values.
  2. Edit the in-file CONFIG block or documented parameters if the script uses fixed settings.
  3. Run python scripts/insert_references.py with the validated inputs.
  4. Review the generated output and return the final artifact with any assumptions called out.

Implementation Details

See ## Workflow above for related details.

Input Requirements

The user needs to provide:

  1. Research Report: Contains complete Methods and Results sections
  1. Language: Chinese or English
  2. Title: Paper title

Input Format Example:

Methods and Results: (User's complete methods and results content...)
Language: (Chinese/English)
Title: (Paper title)

Workflow

Phase 1: Report Parsing

Extract and structure the following information from the research report:

Methods Section Keywords (for reference retrieval):

Study Population:
Exposure/Intervention:
Outcome Measures:
Research Direction:
Primary Research Methods:

Key Points of the Results Section(For discussion writing, extracted by module):

  1. Results Interpretation Module

Main findings and statistical data

Analysis of the relationship between exposure and outcomes

  1. Literature Comparison Module

Findings that need to be compared with previous studies

Contextual and background significance

  1. Clinical Implications Module

Results relevant to clinical significance

  1. Study Limitations Module

Methodological limitations

Stage 2: Reference Retrieval

Use scripts/search_references.py to retrieve PubMed references.

API Description:Use the official PubMed E-utilities API

Search Workflow:

  1. Keyword Extraction:Extract 3–5 keywords from the topic and rank them by importance.
  2. Search Query Generation:Generate English search queries for each keyword.
  3. PubMed esearch Call:Retrieve a list of PMIDs that meet the criteria.
  4. PubMed efetch Call:Retrieve article details (authors, title, journal, year, abstract).
  5. Number of Articles Returned:

Search Allocation:

Usage Example:

from scripts.search_references import search_references_for_theme

# Retrieve references for the Introduction
intro_refs = search_references_for_theme("immune checkpoint inhibitors non-small cell lung cancer efficacy meta-analysis")

# Retrieve references for the Discussion
discussion_refs = search_references_for_theme( "PD-1 inhibitors lung cancer survival mechanism")

Stage 3: Section Writing

Generate each section of the manuscript in the following order.

Detailed guidelines are available in references/writing-guide.md。

Citation Format During Writing:Use [PMID: xxxxxxxx] to mark references, which will be processed later

3.1 Abstract
3.2 Introduction
3.3 Discussion

Write in modular order with natural transitions between sections:

| Module | Content | Word Count |

| ------ | ------- | ---------- |

| Opening of Discussion | Summary of main findings and statistical significance | 150–200 |

| Results Interpretation | Mechanistic analysis and clinical relevance | ≥150 |

| Literature Comparison | Comparison with previous studies | ≥150 |

| Study Limitations | Methodological and clinical limitations | 100–150 |

| Closing of Discussion | Conclusions and future directions | 100–150 |

Each module should cite no more than 10 references.

Stage 4: Reference Insertion

Use scripts/insert_references.py to process references.

API Description:Use the PubMed efetch API to retrieve formatted citations

Processing Workflow:

  1. Article Segmentation:Split the manuscript into sections using markers such as ## Discussion
  1. PMID Extraction: Use regular expressions to identify [PMID: number] or 【PMID: number】
  1. PubMed efetch Call:Retrieve full citation details for each PMID.
  1. AMA Citation Generation:Format as:

Author(s). Title. Journal. Year;Volume(Issue):Pages.

  1. In-text Citation Replacement:Replace [PMID: xxx] with [[n]](link) format
  2. Renumbering Numeric Citations:Resolve conflicts with existing bracketed numeric citations.
  3. Reference List Generation:Number references sequentially based on citation order.

Usage Example:

from scripts.insert_references import insert_references

# Process the complete manuscript
final_article = insert_references(
    article=draft_with_pmid_markers,
    new_references=""  # Optional: additional references
)

Stage 5: Final Integration and Output

Integrate the generated content with the user-provided Methods and Results sections into a complete manuscript.

Integration Order:

  1. Title (user-provided)
  1. Abstract (generated)
  1. Introduction (generated)
  1. Materials and Methods (extracted from user input, unchanged)
  1. Results (extracted from user input, unchanged)
  1. Discussion (generated)
  1. Conclusion (generated)
  1. References (generated)

Final Output Format:


# [Article Title]

## Abstract
[Abstract content]

## Introduction
[Introduction content with hyperlinks]

## Materials and Methods
[User-provided Methods section, original text preserved]

## Results
[User-provided Results section, original text preserved]

## Discussion
[Discussion content, no subheadings, natural flow]

## Conclusion
[Conclusion]


## Input Validation

This skill accepts requests that match the documented purpose of `meta-manuscript-generator` 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:

> `meta-manuscript-generator` only handles its documented workflow. Please provide the missing required inputs or switch to a more suitable skill.

## References
[1] Author et al. Title. Journal. Year;Vol(Issue):Pages. [https://pubmed.ncbi.nlm.nih.gov/PMID/]
[2] ...

Note:The user-provided Methods and Results sections should be preserved in their original wording, with only minimal formatting adjustments made where necessary.

Writing Standards

  1. Language Style:Academic, objective, and precise
  2. Abbreviation Rules:Provide full term at first mention
  3. Citation Format:
  1. Data Presentation:Retain original statistical data, e.g.

HR = 1.25, 95% CI: 1.10–1.42, p < 0.001

  1. Avoid:Subjective judgments, overinterpretation, and redundant statements

Quality Checklist

Verify after generation:

Error Handling

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.