Style journal rewrite

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

Style journal rewrite is an AI agent skill from the GitHub repository aipoch/medical-research-skills. Rewrite drafts according to target writing style or target journal format. Triggers when user says "rewrite in XX style", "match this tone", "format for XX journal", "rewrite following this format". Input can be .docx / .md / .txt or conversation text.

How to use this skill

Skill file

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

Style and Journal Format Adaptation Skill

Trigger Conditions

Triggers

Does Not Trigger

Requirements

Process

0. Define Boundaries

Determine three things:

Then branch into the corresponding path below.

1. Extract Target Profile

Read extraction guides from references/:

Do not fabricate rules not found in the user's materials.


Path A: Pure Style Adaptation (any input format)

Read references/rewriting-criteria.md directly, rewrite according to profile. Change only expression style, not formatting.

Output matches input format. DOCX: change text only, not styles; MD/TXT: output same format; conversation text: output directly.

After completion, skip to Section 5 QC.


Path B: DOCX + Format Adaptation

Input is .docx, requires journal format changes (may also include style changes).

B1. Structure Layer

B2. Citation Layer

B3. Field Code Detection

Scan w:instrText in DOCX XML:

B4. Visual Formatting

python-docx adjusts font, size, line spacing, paragraph spacing, indentation, alignment per paragraph. Use para.runs to set font.name / font.size, use para.paragraph_format for spacing.

/!\ Do NOT use para._element.clear() to clear paragraphs containing field codes — this destroys Zotero/EndNote field codes. B4 only modifies w:rPr and w:pPr.


Path C: MD + Format Adaptation

Input is .md, requires journal format changes (may also include style changes).

C1. Check PMID Markers

MD must contain [PMID:xxxxxxxx] markers to use this path.

C2. Style and Structure Adjustment

AI directly modifies MD text:

/!\ Critical constraint: When moving or rewriting sentences with citations, [PMID:xxxxxxxx] markers must follow the text — do not lose, change numbers, or modify spaces.

C3. Hand Off to Citation Formatting Skill

Load the corresponding skill based on user's tool:

Both skills do: parse [PMID:xxxxx] → fetch PubMed metadata → download target journal CSL style → output DOCX (in-text citations and bibliography formatted per journal style).

This step replaces all work done by convert_ref_format.py in Path B, with more professional results — citation formatting is driven by Zotero/EndNote engines, avoiding inconsistencies from manual Unicode superscript assembly.

C4. Visual Formatting

python-docx applies journal-required font, size, line spacing, margins, and figure/table caption positioning on the DOCX produced by C3.

Same as B4: only modify w:rPr and w:pPr, do not affect Zotero/EndNote field codes.

C5. Output

Final DOCX = C2 (structure+style) → C3 (citation formatting) → C4 (visual formatting)


4. Output and Delivery


5. Quality Check

Verify each item:

Error Handling

Input Validation

This skill accepts requests that match the documented purpose of style-journal-rewrite 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:

style-journal-rewrite only handles its documented workflow. Please provide the missing required inputs or switch to a more suitable skill.

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.