Hypothesis Generation
spacering-net/codeg
Structured hypothesis formulation from observations. An agent skill from spacering-net/codeg.
A skill your agent uses when drafting a medical research manuscript or any IMRAD section.
$ npx skills add Aperivue/medsci-skills --skill write-paper -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install Aperivue/medsci-skills write-paper --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/Aperivue/medsci-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/write-paper .claude/skills/write-paper && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "write-paper" agent skill from https://github.com/Aperivue/medsci-skills/tree/main/skills/write-paper into .claude/skills/write-paper/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "write-paper", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/Aperivue/medsci-skills/tree/main/skills/write-paperType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add Aperivue/medsci-skills --skill write-paper -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install Aperivue/medsci-skills write-paper --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/Aperivue/medsci-skills.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/write-paper .agents/skills/write-paper && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "write-paper" agent skill from https://github.com/Aperivue/medsci-skills/tree/main/skills/write-paper into .agents/skills/write-paper/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "write-paper", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add Aperivue/medsci-skills --skill write-paper -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install Aperivue/medsci-skills write-paper --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/Aperivue/medsci-skills.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/write-paper .cursor/skills/write-paper && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "write-paper" agent skill from https://github.com/Aperivue/medsci-skills/tree/main/skills/write-paper into .cursor/skills/write-paper/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "write-paper", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/Aperivue/medsci-skills.git --path skills/write-paper--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add Aperivue/medsci-skills --skill write-paper -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install Aperivue/medsci-skills write-paper --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/Aperivue/medsci-skills.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/write-paper .gemini/skills/write-paper && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "write-paper" agent skill from https://github.com/Aperivue/medsci-skills/tree/main/skills/write-paper into .gemini/skills/write-paper/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "write-paper", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install Aperivue/medsci-skills write-paperInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add Aperivue/medsci-skills --skill write-paper -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/Aperivue/medsci-skills.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/write-paper .github/skills/write-paper && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "write-paper" agent skill from https://github.com/Aperivue/medsci-skills/tree/main/skills/write-paper into .github/skills/write-paper/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "write-paper", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add Aperivue/medsci-skills --skill write-paper -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install Aperivue/medsci-skills write-paper --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/Aperivue/medsci-skills.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/write-paper .opencode/skills/write-paper && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "write-paper" agent skill from https://github.com/Aperivue/medsci-skills/tree/main/skills/write-paper into .opencode/skills/write-paper/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "write-paper", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
write-paperA skill your agent uses when drafting a medical research manuscript or any IMRAD section.
Write Paper is an agent skill from Aperivue/medsci-skills. Use when drafting a medical research manuscript or any IMRAD section. Runs an 8-phase pipeline from outline to submission-ready draft for original articles, AI validation studies, case reports, meta-analyses, technical notes and more. Checking a draft is /self-review.
Its SKILL.md is about 9k tokens, which your agent loads only when the skill is triggered. The skill folder holds 126 other files, including scripts and reference files (for example `references/exemplar_abstract.md`, `references/exemplar_case_report.md` and `references/exemplar_case_report_radiology.md`).
It sits in Research & Science. The repository describes itself as: Agent Skills for medical research — literature search, reporting-guideline & citation checks, statistics, publication figures, submission. Works with Claude Code, Codex, Cursor &… The licence is MIT.
9 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 3b14ae2. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Ships 1 file in scripts/, which the agent can run.
Shell commands in SKILL.md call:
python3From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Write Paper loads about 9k tokens when it runs, and up to ~202k if it reads all its reference files. Until then it costs about 70 tokens; SKILL.md has 4,195 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.
The full file from Aperivue/medsci-skills at commit 3b14ae2, republished under its MIT licence (© Aperivue). 4,195 words, ~8,961 tokens.
.claude/skills/write-paper/SKILL.md (or your agent's skills folder). This skill also uses 123 other files; get the full folder from GitHub.Gather essential information from the user before any writing begins.
Required inputs:
${CLAUDE_SKILL_DIR}/references/journal_profiles/Optional flags:
--no-llm-disclosure: skip the LLM writing-assistance disclosure. Default is ON.--autonomous: run Phases 0–7 without user gates (outline approval, T&F plan, discussion planning, section reviews all skipped). Default OFF.Actions:
Load the journal profile. If none exists, ask for word limits, abstract format, citation style, figure/table limits, and special requirements.
Load the paper-type template from ${CLAUDE_SKILL_DIR}/references/paper_types/.
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.
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.
Create or confirm the project scaffold directory.
Record the --no-llm-disclosure and --autonomous flag states for Phase 1–7 gate logic.
Identify a backbone article — scan manuscript/_src/refs.bib first and propose proactively (ranking: Backbone ranking below); ask only as a fallback. Record the chosen citekey in project.yaml::backbone_article. 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:
python3 ${CLAUDE_SKILL_DIR}/scripts/gate_backbone_fulltext.py \
--project project.yaml --refs manuscript/_src/refs.bib \
--fulltext-dir pdfs/ --strictA file in --fulltext-dir counts as the backbone when it is named <citekey>.md or names the backbone DOI/citekey before its References heading; a paper that only cites the backbone in its reference list does not count. Known limit: another paper that names the DOI in its own body still resolves — name the file <citekey>.md or pass --fulltext to remove the doubt.
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.
Summarize the setup — journal constraints, paper type, reporting guideline, backbone article, directory path, LLM-disclosure status — and confirm before proceeding.
Citekey discipline turns citation fabrication into a visible placeholder the submission gate can block.
Every in-text citation MUST be [@citekey], with citekey present in
manuscript/_src/refs.bib. Pandoc/Quarto style only — no "(Smith et al., 2024)" free text.
For a citation intended but not yet imported, use [@NEW:short-topic] (kebab-case, ≤30 chars,
unique in the manuscript).
Never fabricate a citekey that "looks real" ([@Smith_2024_AI]) when the entry is not in
refs.bib. [@NEW:...] is the only allowed placeholder.
All [@NEW:...] placeholders must be resolved before Phase 7 (/search-lit → /lit-sync
imports verified entries; Better BibTeX refreshes refs.bib). Cite only references whose DOI or
PMID /search-lit has confirmed; mark any other as [UNVERIFIED - NEEDS MANUAL CHECK].
Pre-submission check — must return zero matches before /sync-submission may freeze a package:
grep -E '\[@NEW:[^]]+\]|\[N\]|\[N–N\]' manuscript/index.qmdBare [N] / [N–N] markers mean a manuscript drafted outside this pipeline (no refs.bib)
with method-load-bearing citations left unresolved. Block them exactly like [@NEW:...].
If refs.bib is absent, create it empty with the comment
% refs.bib managed by /lit-sync via Zotero Better BibTeX. Do not hand-edit., record
reference_manager.required_for: project_owner in SSOT.yaml, and proceed — early citations
will all be [@NEW:...] until the first /lit-sync run.
Read on demand — once the paper type is known (step 2), and only the row that matches:
| File | Read it when |
|---|---|
references/phase0_init_detail.md → Case Report Mode | paper type is case report — word/abstract/reference-limit overrides, the CARE 8-section outline, default figures |
references/phase0_init_detail.md → Case Series Mode | paper type is case series — the methods-light mini-cohort outline, all-cases summary table, counts-not-rates discipline |
references/phase0_init_detail.md → Backbone ranking | refs.bib exists and you are proposing a backbone |
Build the outline on the paper-type template's section structure. Start with a header — working title, target journal, paper type, total word limit (excluding abstract, references and legends) — then give every section a word budget and a paragraph- or subsection-level plan, with the budgets summing within the journal limits. End with the planned tables, figures and supplemental materials, one line each.
Gate: Present the outline to the user. Do NOT proceed until the user approves or requests changes.
Autonomous mode: skip this gate; log the outline to qc/_pipeline_log.md and proceed to Phase 2.
Design all tables and figures BEFORE writing prose, so the narrative serves the data.
/analyze-stats if statistical analysis is needed./make-figures with the full figure set the study type requires — do not ask the user to name each figure. Pass --study-type mapped from the Phase 0 paper type / reporting guideline: diagnostic accuracy → diagnostic-accuracy, prediction model → ai-validation, systematic review → meta-analysis, DTA systematic review → dta-meta-analysis, observational → observational-cohort, RCT → rct, case report → case-report./make-figures with a visual abstract request: title, Key Points 1 and 3, methodology summary, and the best study figure as the visual element.analysis/figures/ for every PNG and PDF. For each, insert {width=80%} at the appropriate place in Results and draft its legend from the figure type and analysis context.analysis/figures/_figure_manifest.md must exist with at least one figure entry — the Phase 7 DOCX build embeds figures from it, and a missing manifest silently drops every figure. If it is missing or empty: in autonomous mode, HALT with error code MANIFEST_MISSING, log to qc/_pipeline_log.md, and write a recovery note to manuscript/<id>/REPORT.md Tier-3 section ("rerun /make-figures or manually create _figure_manifest.md"); in interactive mode, report the error and ask the user how to proceed.Gate: Present T&F plan to user. Do NOT proceed until user approves.
Autonomous mode: skip this gate; log the T&F plan to qc/_pipeline_log.md and proceed to Phase 3.
Write Methods first — it is the most objective section and anchors the rest of the paper.
Before writing: Load ${CLAUDE_SKILL_DIR}/references/section_guides/methods.md and skim the matching study type in ${CLAUDE_SKILL_DIR}/references/exemplar_methods/ (diagnostic-accuracy/STARD, AI-validation/TRIPOD+AI·CLAIM, observational-cohort/STROBE, meta-analysis/PRISMA 2020, RCT/CONSORT 2010): what each paragraph must establish, plus the element that type most often omits. Every exemplar used in Phases 3–6 is synthetic, with placeholder specifics — model its structure; it is not prose to copy.
Writing order: (1) Study Design and Setting; (2) Participants / Dataset (inclusion/exclusion, recruitment period); (3) Procedures / Intervention / AI Model description; (4) Outcome Measures (primary and secondary endpoints); (5) Statistical Analysis (${CLAUDE_SKILL_DIR}/references/section_templates/methods_statistical.md); (6) Ethics statement; (7) AI/LLM disclosure (unless --no-llm-disclosure): when the target journal wants it in Methods, add the Methods paragraph from LLM Writing Disclosure.
AI/LLM extraction add-ons (when applicable):
Process: Run the critic-fixer loop (Critic Review Criteria), then present the final Methods to the user.
Write Results aligned to the approved tables and figures. Results = "What did we find?" — nothing more. Every sentence must be a factual statement backed by a number.
Before writing: Load ${CLAUDE_SKILL_DIR}/references/section_guides/results.md (mirror symmetry with Methods, flowchart, missing data, the anti-interpretation self-check) and skim the matching study type in ${CLAUDE_SKILL_DIR}/references/exemplar_results/ (the same five types, each in its Methods sibling's order).
Rules:
/design-study Phase 3), soften the claim to standalone performance rather than implying added value.Process: critic-fixer loop. Gate: Present final Results to user. Confirm before proceeding to Discussion.
Before writing: Load ${CLAUDE_SKILL_DIR}/references/section_guides/discussion.md and skim the matching study type in ${CLAUDE_SKILL_DIR}/references/exemplar_discussion/ (the same five types, each naming the element that type most often omits). For case reports, use ${CLAUDE_SKILL_DIR}/references/exemplar_case_report.md instead (literature-boundary wording, n=1 causal caution, bedside teaching points).
Ask the user the following questions. Wait for answers before drafting.
Q1. List the 3-5 key findings of this study in order of importance.
Q2. Name 3-5 key prior studies (anchor papers) you want to compare against in the
Discussion — titles or DOIs.
- Studies consistent with your results: ?
- Studies inconsistent with your results: ?
Q3. Are there methodological or population differences that could explain any disagreement?
Q4. State up to 3 limitations of this study.
(For each, include how it was mitigated and the direction in which it could affect the results.)
Q5. Are there clinical implications you want to emphasize?If the user provides partial answers, proceed with what is available and note gaps.
If the user says "skip", use /search-lit to identify anchor papers from the reference list and
proceed with best-effort defaults.
Gate: Do NOT start writing Discussion until user responds (or explicitly skips). Autonomous mode: skip the interactive planning and take the "skip" path.
Write an inverted funnel:
Rules:
/self-review §D (check_scope_coherence.py) flags CROSS_SECTIONAL_PROGNOSTIC / SURROGATE_CARE_DIRECTIVE; keep the conclusion verb inside the design's reach.After the first draft, ask the user: any missing anchor papers or comparisons, any change to the interpretation, and which clinical implications to emphasize or soften. Incorporate the feedback, then run the critic-fixer loop.
Write these LAST because they frame the paper and depend on knowing what was actually found.
Before writing: Load ${CLAUDE_SKILL_DIR}/references/section_guides/introduction.md and ${CLAUDE_SKILL_DIR}/references/section_guides/title_abstract.md, and skim the structure models ${CLAUDE_SKILL_DIR}/references/exemplar_introduction.md and ${CLAUDE_SKILL_DIR}/references/exemplar_abstract.md. For case reports, use ${CLAUDE_SKILL_DIR}/references/exemplar_case_report.md for the 150-word Introduction / Case Presentation / Conclusion abstract anatomy rather than the IMRAD abstract model.
Introduction (3-4 paragraphs): clinical context establishing importance (prevalence, burden, current practice) → the knowledge gap this study addresses → the study objective, stated precisely, with the hypothesis if applicable. For AI/LLM extraction studies, state the decision-impact path: what clinical or research workflow step changes if the model works, not only that the extracted label is interesting.
Abstract: self-contained; all numbers match the main text and tables; the final sentence is a clinical implication, not "further studies are needed."
Lead with the pre-specified primary estimand, not the largest effect — even when a critic or peer-sim pass suggests foregrounding the strongest number. Tightening effect-size language is fine; promoting a secondary, exploratory, or post-hoc estimate to the headline is estimand shopping. The Abstract's primary result must be the registered/protocol primary contrast — the same one Step 7.3b checks. If the primary is null or underpowered, report it as such (see /self-review category C, power-aware null) rather than substituting a more favourable secondary estimate.
Process: critic-fixer loop.
Final quality pass. Strict sequential execution — each step MUST complete before the next begins. Every HALT stops the pipeline; none is advisory.
7.1 — AI Pattern Scan. Remove AI writing patterns (see AI Pattern Avoidance below), editing
manuscript/manuscript.md in place. Then run the deterministic classical-style lint:
python3 "${CLAUDE_SKILL_DIR}/../self-review/scripts/check_classical_style.py" --manuscript manuscript/manuscript.md --strict.
For an MA / systematic review, or when a senior co-author review is expected, also work the
7-grep checklist in references/section_guides/step7_1_classical_qc.md. Pattern 19–21 body
rewrites (§, self-reference, AI-disclosure boilerplate) go to /humanize.
HALT — AI-disclosure meta-applicability. An AI/LLM-use disclosure must itself satisfy the items the manuscript critiques (FLAIR F1.6, TRIPOD-LLM, MI-CLEAR-LLM): version, access channel, date range, responsible party, zero
[version]/TODOplaceholders. A paper cannot fail a framework item it critiques. (Classical target: title page, not the body.)
7.2 — Reporting Guideline Check. Call /check-reporting. Auto-insert only MISSING items whose
fixable_by_ai is true; never invent items needing external facts (IRB / registration numbers).
Log every insertion to qc/_pipeline_log.md.
7.3 — Citation Verification. The placeholder gate first — HARD STOP on any hit of
grep -nE '\[@NEW:[^]]+\]' manuscript/index.qmd manuscript/manuscript.md, looping back to
/search-lit → /lit-sync. Then /verify-refs: parse qc/reference_audit.json and stop the
pipeline if submission_safe: false, surfacing every FABRICATED / MISMATCH and any
duplicate_findings[].
7.3a / 7.3b / 7.3c — Integrity audits. Run all three between 7.3 and 7.4; each can HALT and
route to 7.4a. 7.3a numerical claims (text ↔ Table ↔ extraction CSV + primary-source check; a
direction reversal or a p<0.05↔p≥0.05 crossing is a P0 blocker). 7.3b estimand provenance
(delegates to /self-review 2.5f; PRIMARY_REASSIGNED, EVALUE_ARITHMETIC, EVALUE_NON_PRIMARY
= P0). 7.3c reference adequacy (every named method cited — resolve via /search-lit →
/lit-sync → /verify-refs --strict, never fabricate). See phase7_integrity_audits.md.
7.4 — Self-Review + Fix Loop. Call /self-review --json --fix: it reviews, applies
fixable_by_ai edits, and re-reviews (≤2 iterations), stopping early on PASS. Log the score,
verdict, iteration count, and residual issues. Any surviving severity: "fatal" issue routes to
7.4a — do not proceed to 7.5.
7.4a — Audit Recovery Branch. When a finding is structural — the data, protocol, or analysis
script is wrong — polishing yields a clean manuscript on a broken foundation.
Inline text fixes are forbidden — recovery means re-extraction, re-analysis, or
re-registration. Halt 7.5–7.6, log the branch, invoke the routed skill, re-enter at 7.3.
Loop budget: one cycle. Routing: references/section_guides/step7_4a_audit_recovery.md.
7.5 — Generate Deliverables. manuscript/manuscript.md, manuscript/title_page.md,
qc/reporting_checklist.md, qc/self_review.md, qc/_pipeline_log.md. Do not hand-number
author affiliations — build and verify with scripts/build_title_page_affiliations.py --check title_page.md --strict (a Nature Portfolio / npj technical-check item).
7.6 — DOCX Build. Embed figures from analysis/figures/_figure_manifest.md, then render.
Prefer /manage-refs (pandoc + citeproc + journal CSL) for any submission with >5 references, and
never hand-type a References list.
7.6a — Cross-Reference QC. After the build, before the final gate:
python3 "${CLAUDE_SKILL_DIR}/../manage-refs/scripts/check_xref.py" \
--md manuscript/manuscript.md --docx manuscript/manuscript_final.docx \
--out qc/xref_audit.json --strictIt catches in-text citations resolving to the wrong rendered caption. Any
MISSING_DOCX/MISSING_BODY/MISMATCH → submission_safe: false, exit 1, HALT. The body
caption is the SSOT — fix the build pipeline, never the reverse.
7.7 — Final Gate. Autonomous: log completion; report word count, figure count, self-review score, reporting-compliance %, FATAL flags. Interactive: present summary, await confirmation.
| File | Read it when |
|---|---|
references/phase7_polish_detail.md | you reach the build steps (7.5–7.6a), a HALT fires, or the manuscript has an AI-disclosure paragraph |
references/phase7_integrity_audits.md | running 7.3a / 7.3b / 7.3c |
references/section_guides/step7_4a_audit_recovery.md | 7.4 left a fatal finding |
Only when the user explicitly asks for a cover letter (for example after /find-journal picks a
target) — never automatically. Read ${CLAUDE_SKILL_DIR}/references/phase8_cover_letter.md for
the inputs you must ask for, the letter structure, the reviewer-COI cross-check (mandatory for
meta-analyses), and the overclaiming guard.
Phases 3–6 each run writer → critic → fixer: draft the section, have the critic review it with line-level feedback, revise, and repeat for up to 3 rounds. After 3 rounds without a pass, present the best version to the user with the remaining issues listed, and ask for guidance.
The critic reviews six dimensions, with line-level feedback: Accuracy (every claim matches data/tables; effect directions correct), Completeness (all reporting-guideline elements and subsections present), Clarity (parseable on first read; no ambiguous referents), Conciseness (no filler or redundant hedging; within word budget), Reporting (this section's STARD/TRIPOD/CLAIM/etc. items addressed), Humanness (no AI Pattern Avoidance hits). The section passes when no dimension carries an issue a journal reviewer would raise; otherwise run a fixer round.
Section boundaries (pass/fail, Phases 4 and 5): in Results, no interpretation, no "why," no prior-literature references, no evaluative adjectives without numbers; in Discussion, no data absent from Results and no overclaiming beyond the evidence level. The critic MUST flag every violating sentence, and the section cannot pass until the fixer moves or rewrites it.
Report each round as ## Critic Report: {Section} -- Round {N} with the issues by priority as
[Dimension] location: issue -> suggested fix, and Verdict: PASS | REVISE.
[VERIFY] and ask the user.The manuscript must NOT contain these patterns commonly flagged as AI-generated:
Forbidden phrases: "In conclusion" (use "In summary" or rephrase) · "It is worth noting that" · "It is important to note that" · "Notably," · "Interestingly," · "Importantly," · "Furthermore," or "Moreover," at sentence start (use "In addition," or restructure) · "plays a crucial role" · "a comprehensive analysis" · "delve into" · "leverage" (use "use" or "apply") · "utilize" (use "use") · "in the realm of" · "underscores the importance of" · "sheds light on" · "paves the way for" · "a nuanced understanding" · "the landscape of" · "a paradigm shift" · "robust" (unless describing a statistical method).
Forbidden structural patterns: three-part list sentences ("X, Y, and Z" repeated across paragraphs); excessive hedging chains ("may potentially be associated with possible"); mirror-structure paragraphs (same template repeated with different content); grandstanding opening sentences ("In the rapidly evolving landscape of...").
Instead: vary sentence structure and length, prefer specific concrete language, and let data speak: "The AUC was 0.92" rather than "The model demonstrated remarkable performance."
If the user returns to a partially completed manuscript, check the workspace for existing drafts, identify the last completed phase, summarize progress, and ask the user where to resume.
When enabled (default), the skill generates transparency statements that follow the ICMJE
Recommendations and COPE. It is ON by default because the ICMJE and major journals require
disclosure of AI writing assistance and omitting it risks rejection or retraction;
--no-llm-disclosure turns it off for journals with no such policy or when LLM assistance was minimal.
Where the disclosure goes is a fact about the target journal, and journals disagree: some want
it in Methods, some in Acknowledgments, some only in the cover letter, title page or submission
form. Take the location from the loaded journal profile (Journal-Specific Overrides below)
and use only the templates for the places that journal asks for. With no target journal
recorded, fall back to ICMJE — Acknowledgments for writing assistance, Methods for use in data
collection, analysis or figures, and the cover letter for either — and treat the placement as
unconfirmed: the Phase 7.1 check (check_classical_style.py, INBODY_AI_DISCLOSURE) reports
it as a Minor item until a target is set, and as Major if the target does not accept a body
disclosure.
The statements about what the authors did (reviewed, verified, approved; what the tool was not
used for) are the authors' to make. Draft them inside a [TODO authors confirm: …] marker and
leave the marker for the authors to resolve — check_placeholders.py blocks submission while a
TODO, an unfilled token from these templates ([tool], [version], [developer],
[Claude/tool name], [Journal Name], [statistician/author], {version} …), or any
[VERIFY…] / [UNVERIFIED - NEEDS MANUAL CHECK] marker remains.
When the target journal wants it in Methods, place it at the end of the Methods section, after the ethics statement:
Template (adapt to specifics):
[AI-Assisted Writing Disclosure]
An artificial intelligence language model ([tool] [version], [developer]) was used to assist
with [tasks actually performed, e.g. structuring sections, refining prose, checking the
internal consistency of reported statistics]. [TODO authors confirm: All content was
critically reviewed, verified against source data, and approved by all authors. The tool was
not involved in study design, data collection, data analysis, or interpretation of results.]Customization rules:
[tool] [version], [developer] with the actual tool(s) used./analyze-stats), state this explicitly: "was also used to generate statistical
analysis code, which was reviewed and validated by [statistician/author]."Template:
The authors acknowledge the use of [Claude/tool name] ([Anthropic/developer]) for
writing assistance in preparing this manuscript. The authors retain full responsibility
for the content.Template:
In accordance with [Journal Name]'s policy on AI-assisted writing, we disclose that
[tool] [version] was used to assist with manuscript preparation, specifically
[list tasks: drafting, language editing, statistical code review]. [TODO authors confirm:
All authors have reviewed and take responsibility for the final content. The AI tool was
not listed as an author and did not contribute to study conception, design, or data
interpretation.]When a journal profile is loaded in Phase 0, check for the ## AI Writing Disclosure Policy
section in the profile. Its structured fields — Requirement level (Required / Recommended /
Not specified), Permitted scope (All tasks / Language editing only / Not permitted),
Disclosure location (Methods / Acknowledgments / Cover letter / Submission form),
AI-generated images (Allowed / Banned / Not specified), Policy URL — set the disclosure
language automatically. Key known policies:
If the loaded journal profile has no AI Writing Disclosure Policy section, fall back to the ICMJE placement under Disclosure Locations. ICMJE requires disclosure; it does not limit what AI may be used for, so take any limit on scope from the journal.
Severity levels: ENFORCED = pipeline halts on failure (cannot proceed to next phase). ADVISORY = warning logged, user may override. OPT-IN = runs only when explicitly invoked.
| Phase | Gate | Severity | Trigger | Action on fail |
|---|---|---|---|---|
| 0 | Backbone-article auto-proposal (Phase 0 "Identify a backbone article" action) | ADVISORY | refs.bib has methodologically similar candidate | Surface to user; user accepts/declines |
| 7.0 | Citekey resolution (delegate /manage-refs scripts/check_citation_keys.py) | ENFORCED | UNDEFINED keys present | Halt; resolve via /lit-sync then re-run |
| 7.0 | [@NEW:topic] drain (delegate /manage-refs; check_citation_keys.py reports them as UNDEFINED, exit 1) | ENFORCED at 7.6 entry | [@NEW:topic] markers remain | Resolve each before DOCX render |
| 7.1 | Classical-style QC (check_classical_style.py) | ENFORCED | a § section cross-reference OR an AI disclosure in the body of a journal that does not accept one there (per profile); more than 25 prose em-dashes is reported as Minor and does not halt | Auto-fix or HALT for senior MA reviewer prep |
| 7.2 | Reporting guideline compliance (/check-reporting) | ENFORCED at submission | <100% mandatory items present | Auto-fix MISSING; ADVISORY for partial |
| 7.3 | Reference audit (/verify-refs --strict) | ENFORCED | submission_safe: false (any FABRICATED or MISMATCH row, or a non-empty duplicate_findings[]), or any UNVERIFIED row (--strict exits 1 on those too) | Halt; fix in Zotero, re-render refs.bib via /lit-sync |
| 7.4 | Self-review fix loop (/self-review --json --fix) | ENFORCED | score below threshold after 2 iterations | Route to Step 7.4a Audit Recovery |
| 7.4a | Audit Recovery branch (route to /meta-analysis Phase 10 for MA manuscripts) | ENFORCED in --e2e | self-review surfaced structural data issue | HALT with RECOVERY_HALT_HUMAN_DECISION if recovery validation fails twice |
| 7.5 | Humanize density (/humanize) | ADVISORY | AI patterns > 2.0 / 1000 words | Sweep + flag remaining; user reviews |
| 7.5a | AIO checklist (/academic-aio --aio) — run after /humanize; also when preparing a preprint / GitHub README / CITATION.cff / HF card alongside submission. Never run it silently: academic-aio's Communication Rules prohibit that. | OPT-IN | user supplies --aio flag | PASS/PARTIAL/FAIL report; never auto-applies |
| 7.6 | DOCX build (delegate /manage-refs scripts/render_pandoc.sh) | ENFORCED | render exits non-zero | Halt; report stderr to user |
| 7.6a | Cross-reference QC (delegate /manage-refs scripts/check_xref.py --strict) | ENFORCED — submission gate | MISSING_DOCX / MISSING_BODY / MISMATCH > 0 (under --allow-separate-attachments: MISMATCH, or MISSING_BODY whose float is in the DOCX) | Halt; route fixes per references/phase7_polish_detail.md |
| 7.7 | Final submission gate | ENFORCED | any of 7.0–7.6a above failed | Refuse to mark submission_safe: true |
| 8+ | Cover letter generation | OPT-IN | user invokes --cover-letter | Renders against journal profile |
© Aperivue, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 123 other files (scripts, references) in skills/write-paper of Aperivue/medsci-skills.
Open the folder on GitHubat commit 3b14ae2
We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in Aperivue/medsci-skills, which our catalogue first saw on October 7, 2026.
Write Paper next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Write Paper this skillAperivue/medsci-skills | 329 | 1 repos | ~9k | Automated safety check: Pass | MIT | |
| Hypothesis Generationspacering-net/codeg | 3.8k | 15 repos | ~3.6k | Automated safety check: Notes | MIT | |
| GitHub Deep Researchbytedance/deer-flow | 83k | 5 repos | ~1.3k | Automated safety check: Pass | MIT | |
| Nature Paper CardYuan1z0825/nature-skills | 46k | 2 repos | ~2.1k | Automated safety check: Pass | Apache-2.0 | |
| Read arXiv Paperkarpathy/nanochat | 58k | 2 repos | ~494 | Automated safety check: Pass | MIT | |
| Content Research Writerweapp-tailwindcss/weapp-tailwindcss | 1.9k | 25 repos | ~3.5k | Automated safety check: Pass | MIT |
spacering-net/codeg
Structured hypothesis formulation from observations. An agent skill from spacering-net/codeg.
bytedance/deer-flow
Researches a GitHub repository over four rounds using the GitHub API and web search, then writes a structured markdown report with timeline, metrics and Mermaid diagrams.
Yuan1z0825/nature-skills
Builds a structured deep-reading card for one scientific paper, covering methods, how experiments support claims, limitations and research ideas, with a script to prepare the source.
karpathy/nanochat
Fetches the TeX source of an arXiv paper from its URL, reads it and writes a markdown summary tied to the nanochat project.
weapp-tailwindcss/weapp-tailwindcss
Assists in writing high-quality content by conducting research, adding citations, improving hooks, iterating on outlines, and providing real-time feedback on each section.
spacering-net/codeg
Structured manuscript/grant review with checklist-based evaluation.
Aperivue/medsci-skills
A skill your agent uses when validating or evaluating a trained medical-imaging model.
Aperivue/medsci-skills
A skill your agent uses when turning a folder of research PDFs into Obsidian notes, even if Obsidian is not named.
Aperivue/medsci-skills
A skill your agent uses when building or auditing a radiomics or tabular clinical-ML prediction model with a classical learner (LASSO, SVM, random forest, XGBoost and similar).
Aperivue/medsci-skills
A skill your agent uses when checking whether a manuscript's references are real.
Aperivue/medsci-skills
A skill your agent uses when a clinical CSV/Excel dataset needs profiling and cleaning before analysis (missing values, outliers, duplicates, type mismatches).
Aperivue/medsci-skills
A skill your agent uses when checking a radiology or medical AI study design before drafting or submission.
Categories
A skill your agent uses when drafting a medical research manuscript or any IMRAD section. Write Paper is an agent skill from Aperivue/medsci-skills. Use when drafting a medical research manuscript or any IMRAD section.
Write Paper fits situations like: drafting a medical research manuscript; any IMRAD section.
Run `npx skills add Aperivue/medsci-skills --skill write-paper -a claude-code`. Or copy the skill folder (skills/write-paper in Aperivue/medsci-skills) into .claude/skills/write-paper in your project. Claude Code loads it when a task matches its description.
Run `npx skills add Aperivue/medsci-skills --skill write-paper -a codex`. Or copy the skill folder (skills/write-paper in Aperivue/medsci-skills) into .agents/skills/write-paper in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Aperivue/medsci-skills --skill write-paper -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/write-paper, .gemini/skills/write-paper, .github/skills/write-paper and .opencode/skills/write-paper in your project.
Going by SKILL.md and its folder, Write Paper needs the command-line tools its instructions call (python3). Our summary lists: Python 3.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.
Write Paper is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 9k tokens (SKILL.md is roughly 36k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 194k tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Write Paper: Hypothesis Generation (spacering-net/codeg, 3.8k stars), GitHub Deep Research (bytedance/deer-flow, 83k stars), Nature Paper Card (Yuan1z0825/nature-skills, 46k stars) and Read arXiv Paper (karpathy/nanochat, 58k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
Aperivue (a GitHub organization) maintains it in Aperivue/medsci-skills, which has 329 GitHub stars. The repository holds 54 skills in this directory. The repository was last updated on October 5, 2026.
Source: Aperivue/medsci-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.