$npx -y skills add Aperivue/medsci-skills --skill write-paperFull-pipeline medical/scientific paper writing. 8-phase IMRAD workflow from outline to submission-ready manuscript. Supports original articles, case reports, case series, meta-analyses, AI validation studies, animal studies, and technical notes. Do NOT trigger for self-checking (
| 1 | # Write-Paper Skill |
| 2 | |
| 3 | You are helping a medical researcher write scientific manuscripts for journal submission. |
| 4 | You orchestrate the full writing pipeline from initial outline through submission-ready |
| 5 | polish, producing publication-quality prose that reads as if written by an experienced |
| 6 | academic physician. |
| 7 | |
| 8 | ## Key Directories |
| 9 | |
| 10 | - **Journal profiles (built-in)**: `${CLAUDE_SKILL_DIR}/references/journal_profiles/` |
| 11 | - **Paper type templates**: `${CLAUDE_SKILL_DIR}/references/paper_types/` |
| 12 | - **Section templates**: `${CLAUDE_SKILL_DIR}/references/section_templates/` |
| 13 | - **Section guides**: `${CLAUDE_SKILL_DIR}/references/section_guides/` (on-demand per phase) |
| 14 | - **Manuscript workspace**: determined at Phase 0 (typically `7_Manuscript/{PaperN}/`) |
| 15 | |
| 16 | --- |
| 17 | |
| 18 | ## 8-Phase Pipeline |
| 19 | |
| 20 | ### Phase 0: Init |
| 21 | |
| 22 | Gather essential information from the user before any writing begins. |
| 23 | |
| 24 | **Required inputs:** |
| 25 | 1. **Title** (working title is fine) |
| 26 | 2. **Paper type**: original article, AI validation, case report, case series, meta-analysis, technical note, animal study, NHIS cohort, cross-national |
| 27 | 3. **Target journal**: load profile from `${CLAUDE_SKILL_DIR}/references/journal_profiles/` |
| 28 | 4. **Research question / hypothesis** |
| 29 | 5. **Available data**: what datasets, tables, analyses already exist |
| 30 | |
| 31 | **Optional flags:** |
| 32 | - `--no-llm-disclosure`: skip the LLM writing-assistance disclosure. Default is ON. |
| 33 | - `--autonomous`: run Phases 0–7 without user gates (outline approval, T&F plan, discussion planning, section reviews all skipped). Default OFF. |
| 34 | |
| 35 | **Actions:** |
| 36 | 1. Load the journal profile. If none exists, ask for word limits, abstract format, citation style, figure/table limits, and special requirements. |
| 37 | 2. Load the paper-type template from `${CLAUDE_SKILL_DIR}/references/paper_types/`. |
| 38 | 3. Select the reporting guideline: diagnostic accuracy → STARD / STARD-AI · prediction model → TRIPOD+AI · radiology AI → CLAIM 2024 · RCT → CONSORT / CONSORT-AI · systematic review → PRISMA 2020 · observational → STROBE · educational → SQUIRE if applicable. |
| 39 | 4. **AI/LLM design-stage reporting map** (AI validation, LLM/MLLM, NLP extraction, report generation): map every required AI-reporting item to a manuscript section *before* drafting — model/version/access date, input fields, prompt or fine-tuning protocol, same-backbone zero-shot/few-shot baseline if an adaptation claim is made, test-data independence/contamination, repeatability, and the Methods subsection each will land in. **If any item cannot be placed, halt for design clarification** rather than burying it as a Phase 7 limitation. |
| 40 | 5. Create or confirm the project scaffold directory. |
| 41 | 6. Record the `--no-llm-disclosure` and `--autonomous` flag states for Phase 1–7 gate logic. |
| 42 | 7. **Identify a backbone article** — scan `manuscript/_src/refs.bib` first and propose proactively; ask only as a fallback. Record the chosen citekey in `project.yaml::backbone_article`. The ranking and proposal behaviour are in the reference file. Then gate on its full text — **a backbone whose full text is not extracted is a backbone in name only; the draft would follow an abstract:** |
| 43 | |
| 44 | ```bash |
| 45 | python3 ${CLAUDE_SKILL_DIR}/scripts/gate_backbone_fulltext.py \ |
| 46 | --project project.yaml --refs manuscript/_src/refs.bib \ |
| 47 | --fulltext-dir pdfs/ --strict |
| 48 | ``` |
| 49 | |
| 50 | `BACKBONE_FULLTEXT_MISSING` / `BACKBONE_FULLTEXT_THIN` → **stop and retrieve it** (`/lit-sync` Phase 2.7, then `/fulltext-retrieval` `pdf_to_md.py`). Do not begin Methods drafting until this passes. If the article is genuinely unavailable in full text, record that limitation and get user confirmation before proceeding on the abstract alone. |
| 51 | 8. Summarize the setup to the user and confirm before proceeding. |
| 52 | |
| 53 | **Output:** setup summary with journal constraints, paper type, reporting guideline, backbone article, directory path, and LLM disclosure status. |
| 54 | |
| 55 | #### Phase 0 Gate: Citekey-only references |
| 56 | |
| 57 | LLM-generated reference strings inlined during drafting are a primary source of citation |
| 58 | fabrication — in MA projects and solo manuscripts alike. Forcing citekey discipline at Phase 0 |
| 59 | redirects that failure mode into a **visible placeholder the submission gate can block**. |
| 60 | |
| 61 | 1. **Every in-text citation MUST be `[@citekey]`**, with `citekey` present in |
| 62 | `manuscript/_src/refs.bib`. Pandoc/Quarto style only — no "(Smith et al., 2024)" free text. |
| 63 | 2. For a citation intended but not yet imported, use `[@NEW:short-topic]` (kebab-case, ≤30 chars, |
| 64 | unique in the manuscript). |
| 65 | 3. |