Skip to main content

paper-agent

Full academic manuscript skill for quantitative-science papers, with journal profiles for Hydrogeology Journal, Journal of Hydrology Regional Studies, Journal of Hydrology, Water Resources Research, HESS, Groundwater, Engineering Geology, IEEE TIM, JMBE, and Physiological Measurement, plus a field-agnostic generic profile for any other journal. Six modes: Draft, Review, Revise, Proofread, Audit, and Format. Use whenever the user wants to draft, write, review, revise, polish, proofread, or audit a journal manuscript, or respond to reviewer comments, including when they upload a .docx for feedback or edits. Also use for submission formatting: "is this ready to submit", formatting for a named journal, line numbers, the highlights file, or a desk-return from an editorial office. Reads workspace data and existing .docx manuscripts, resolves citations via Semantic Scholar with OpenAlex DOI verification where available, and outputs publication-ready prose or structured feedback.

Informations de source

Dépôt
Rekin226/paper-agent
Dernière activité de la source
3 octobre 2026 à 07:59
Langue détectée de SKILL.md
anglais
Étoiles
8
Forks
2

Options d'installation

Le prompt qui vérifie d'abord la source est sélectionné par défaut. Vous pouvez passer à une commande directe ou télécharger une copie locale.

Vérifiez les fichiers source

Lisez SKILL.md et les fichiers associés affichés par SkillsMP avant de décider de l'installer.

Affichage de SKILL.md

SKILL.md
Instructions source · Aperçu en lecture seule
name
paper-agent
description
Full academic manuscript skill for quantitative-science papers, with journal profiles for Hydrogeology Journal, Journal of Hydrology Regional Studies, Journal of Hydrology, Water Resources Research, HESS, Groundwater, Engineering Geology, IEEE TIM, JMBE, and Physiological Measurement, plus a field-agnostic generic profile for any other journal. Six modes: Draft, Review, Revise, Proofread, Audit, and Format. Use whenever the user wants to draft, write, review, revise, polish, proofread, or audit a journal manuscript, or respond to reviewer comments, including when they upload a .docx for feedback or edits. Also use for submission formatting: "is this ready to submit", formatting for a named journal, line numbers, the highlights file, or a desk-return from an editorial office. Reads workspace data and existing .docx manuscripts, resolves citations via Semantic Scholar with OpenAlex DOI verification where available, and outputs publication-ready prose or structured feedback.
allowed-tools
Read, Write, Edit, Glob, Grep, Bash, Skill, mcp__semantic-scholar__search_papers, mcp__semantic-scholar__get_paper, mcp__semantic-scholar__search_papers_match, mcp__openalex__search_works, mcp__openalex__batch_resolve_references, mcp__openalex__check_venue_quality, mcp__openalex__get_work
# Paper Agent: Academic Manuscript Generator and Reviewer Generate, review, revise, proofread, audit, or format hydrology and water-resources manuscripts at journal-submission quality. Read project data or existing .docx manuscripts directly, resolve every citation inline via Semantic Scholar, and produce outputs calibrated to the user's chosen mode. Never produce outlines, summaries, or bullet-point drafts in Draft mode. Every Draft-mode output is complete academic writing ready for direct manuscript development. --- ## MODES This skill supports six distinct modes. The user selects one at startup (Block 0 of the interview). Each mode has its own reference file with specific workflow, output format, and boundaries. | Mode | Input | Output | Reference file | |---|---|---|---| | **Draft** | Project data (CSVs, source code, metadata) | Complete manuscript sections, .docx export | Body of this SKILL.md | | **Review** | Existing .docx manuscript | Reviewer-style feedback report in chat (no file edits) | `references/mode-review.md` | | **Revise** | Existing .docx + optional reviewer comments | Section-by-section revision suggestions in chat (BEFORE / AFTER / RATIONALE blocks). Never edits the .docx file directly; the user applies changes themselves. | `references/mode-revise.md` | | **Proofread** | Existing .docx manuscript | Revised .docx with language-level fixes only. No scientific changes, no restructuring, no new citations. | `references/mode-proofread.md` | | **Audit** | Existing .docx manuscript | Consistency and coherence report in chat with severity-tagged findings (Critical / Major / Minor). No edits, no revision proposals: it identifies issues for the user to fix via Revise mode. | `references/mode-audit.md` | | **Format** | Existing .docx + journal target | Submission-ready .docx (line numbers, page numbers, spacing, columns) plus the separate files the submission system requires, and a two-layer compliance report. No text changes. | `references/mode-format.md` | **Mode determines what is allowed.** Once a mode is selected, re-read the relevant reference file to understand the specific protocol. Do not mix mode behaviours (e.g. Proofread must not restructure sections; Revise must not silently edit the .docx file; Review must not rewrite paragraphs; Format must not change a single word of text). --- ## ENVIRONMENT DETECTION: run once, before anything else This skill runs in two environments with different toolchains. Detect which one you are in at the start of the session and record the answer; every `.docx` and citation step below branches on it. ```bash # 0. Resolve this skill's own directory. It varies by install method (plugin, # ~/.claude/skills/paper-agent, or a symlinked clone), so never hard-code it. SKILL_DIR=$(dirname "$(find ~/.claude -name SKILL.md -path '*paper-agent*' 2>/dev/null | head -1)") echo "SKILL_DIR=$SKILL_DIR" # A. Is a docx skill present? (Claude Desktop / claude.ai) ls /mnt/skills/public/docx/SKILL.md 2>/dev/null && echo "DOCX_SKILL=yes" || echo "DOCX_SKILL=no" # B. Is the bundled venv present? (Claude Code, local filesystem) ls "$SKILL_DIR/.venv/bin/python" 2>/dev/null && echo "LOCAL_VENV=yes" || echo "LOCAL_VENV=no" ``` `$SKILL_DIR` is used throughout this file for the bundled `scripts/` and `.venv`. If the `find` above returns nothing, ask the user where the skill is installed rather than guessing a path. Also check your own tool list for `mcp__openalex__*`. That is not detectable from the shell. | Environment | Signal | `.docx` handling | Citation handling | |---|---|---|---| | **Claude Code** (CLI, Claude Code desktop app, IDE) | `LOCAL_VENV=yes` | bundled `scripts/` + venv | Semantic Scholar + OpenAlex | | **Claude Desktop / claude.ai** | `DOCX_SKILL=yes` | delegate to the `docx` skill | Semantic Scholar only, unless OpenAlex tools are present | Neither path is a fallback for the other; they are different environments with different tools available. If **both** signals are present, prefer the bundled scripts: they compute the citation-integrity and cross-reference checks this skill needs in one pass, which the generic docx skill does not. If **neither** is present, say so and stop. Do not improvise a .docx parser. **State the detected environment to the user in the startup report**, so it is obvious which capabilities are active. When OpenAlex is unavailable, say so explicitly at that point: DOI verification will be degraded for the whole session, and the user should know before drafting, not at export. --- ## SUPPORTED JOURNALS Block 1 of the startup interview selects one. Load that file and keep it loaded for the whole session: it governs section structure, citation format, abstract rules, and the pre-submission checklist, and it overrides `references/manuscript-docx-style.md` wherever the two conflict. | Journal | Publisher | Citation style | Profile | |---|---|---|---| | Hydrogeology Journal (HJ) | Springer / IAH | author-year | `references/journal-hydrogeology.md` | | Journal of Hydrology: Regional Studies (JHRS) | Elsevier | author-year | `references/journal-jhrs.md` | | Journal of Hydrology (J. Hydrol.) | Elsevier | author-year | `references/journal-jhydrol.md` | | Water Resources Research (WRR) | AGU / Wiley | author-year | `references/journal-wrr.md` | | Hydrology and Earth System Sciences (HESS) | EGU / Copernicus | author-year | `references/journal-hess.md` | | Groundwater | NGWA / Wiley | author-year | `references/journal-groundwater.md` | | Engineering Geology (EG) | Elsevier | author-year | `references/journal-engineering-geology.md` | | IEEE Trans. Instrumentation and Measurement (TIM) | IEEE | **numeric bracketed** | `references/journal-tim.md` | | J. Medical and Biological Engineering (JMBE) | Springer | author-year | `references/journal-jmbe.md` | | Physiological Measurement (PM) | IOP / IPEM | author-year (IOP Harvard) | `references/journal-physiological-measurement.md` | | *Any other quantitative-science journal* | | per author guidelines | `references/journal-generic.md` | For any journal not listed, load `references/journal-generic.md` and ask the user to paste the author guidelines; those guidelines override the generic baseline. Flag every point where you are extrapolating rather than following a stated rule. Never invent a journal rule. --- ## ANTI-FABRICATION DIRECTIVE: read `references/anti-fabrication.md` before any work. This is the most important rule in the skill. If the agent does not know something with confidence, it asks the user, flags the gap, searches Semantic Scholar, or declines to make the claim. It never fills in a plausible-sounding answer. Applies to citations, numbers, study area facts, methodological details, physical interpretations, author metadata, and manuscript content read from existing files. The rules file enumerates the specific failure modes and the four acceptable responses. ## ANTI-SUMMARY DIRECTIVE: read `references/anti-summary-rules.md` before writing any section. This is one of the two most common failure modes. The rules file is short and mandatory. ## SUBMISSION-FORMAT DIRECTIVE: read `references/submission-format.md` before claiming any manuscript is ready to submit, and before every .docx export. **Silence in a journal's guide for authors is not evidence that nothing is required.** Guides describe the article; editorial offices separately enforce a presentation layer (continuous line numbers, page numbers, double spacing, single column) that is frequently stated nowhere on the guide page, and return manuscripts unreviewed when it is missing. Verified 2026-09-11: a manuscript was desk-returned by Engineering Geology for missing line and page numbers, neither of which appears anywhere in that journal's guide. Two consequences, both binding in every mode: 1. **Never say "the format meets the journal requirements."** That sentence merges article style with submission presentation. Report them as two separate layers and name which one you actually checked, per the template in the rules file. 2. **A style-checklist pass is not a readiness verdict.** Readiness requires `scripts/validate_docx.py` run on the exact file that will be uploaded, plus an explicit statement that upload state of the separate files (highlights, graphical abstract, supplementary data) cannot be verified from here and must be confirmed by the user. ## ANTI-AI-STYLE DIRECTIVE: read `references/anti-ai-style.md` before writing any prose. Manuscripts written by AI tend to give themselves away through stylistic tells: em-dashes, hedge words, throat-clearing transitions, three-item lists for everything, and long sentences padded with caveats. Reviewers notice. The rules file lists what to avoid and what good academic prose actually looks like. It applies to Draft mode, Revise mode (every AFTER block), and Proofread mode (which uses it as a compliance checklist). --- ## STARTUP SEQUENCE Run once per session, before any writing or review. Follow `references/startup-interview.md` verbatim: it contains the exact questions, mode-specific branches, and fast-path rules. **Block 0: Mode selection (always first).** Ask which mode the user wants: Draft, Review, Revise, Proofread, Audit, or Format. Load the corresponding reference file immediately. **Block 1: Journal target** (all modes). Load the matching profile from the journal table above, **and load `references/submission-format.md` alongside it**. The journal style matters for Review (is the manuscript HJ-compliant?), Revise (do the edits match journal style?), and Proofread (what terminology rules to enforce?), not just Draft. The submission-format baseline matters for all of them, because no journal profile can be assumed to state it. **Remaining blocks branch by mode.** Read `references/startup-interview.md` for the full protocol. **Draft-mode fast path:** If the workspace contains a recognised project-signature file declared by any `references/preset-<project>.md` (see `references/preset-example.md` for the template and detection convention), auto-load that preset and skip straight to journal selection + metadata. Still confirm with the user before writing. After the interview, report data loaded, mode selected, journal selected, and wait for explicit confirmation before acting. --- ## READING EXISTING MANUSCRIPTS (Review, Revise, Proofread modes) When the mode is Review, Revise, or Proofread, the user provides a path to an existing `.docx` manuscript. Before any analysis: 1. **Extract the manuscript**, per the environment detected above. **Claude Code (`LOCAL_VENV=yes`)**: run the bundled extractor. Absolute paths, so it works from any working directory: ```bash "$SKILL_DIR/.venv/bin/python" \ "$SKILL_DIR/scripts/extract_docx.py" <manuscript.docx> --sections ``` If the venv is missing, bootstrap it once: ```bash cd "$SKILL_DIR" && python3 -m venv .venv && .venv/bin/pip install python-docx lxml ``` **Claude Desktop / claude.ai (`DOCX_SKILL=yes`)**: the bundled `scripts/extract_docx.py` still runs if `python-docx` is importable, which it normally is in that container: ```bash python3 scripts/extract_docx.py <manuscript.docx> --sections ``` If that fails, delegate to the `docx` skill at `/mnt/skills/public/docx/SKILL.md`, read its reading section, and compute the integrity checks in step 2 by hand. That is slower and easier to get wrong, so try the script first. Either way: do not write ad-hoc .docx parsers. `pandoc in.docx -t markdown` is the last-resort fallback. 2. **What the extractor returns.** `--sections` adds the full text of every section; `--json` gives the machine-readable structure. In one pass it computes: - Full text and word count by section - All in-text citations, both `(Author, Year)` and `Author (Year)` forms - Reference list entries, split even when an export collapses them into one paragraph - Figure and table captions with their numbers, and the embedded table objects - Equation count and numbering - **Cross-reference integrity:** figures and tables that are captioned but never cited, and cited but never captioned - **Citation integrity:** orphan citations with no matching reference entry, and reference entries never cited Steps 3 and 4 are therefore already done by the tool. Read its `Integrity:` line rather than re-deriving it by hand. 3. **Sanity-check the extraction before trusting it.** If the report shows `Reference entries: 0` or a section list that is obviously wrong, the manuscript's heading styles did not survive whatever produced the .docx. Say so, and fall back to `pandoc <file>.docx -t markdown` before drawing any conclusion. A citation-integrity result computed against an empty reference list is not a clean bill of health, and the extractor prints an explicit warning in that case. 4. **Report the extraction summary to the user before proceeding:** ``` Manuscript loaded: <filename> Sections: [list] Word count: N (Abstract: N, Introduction: N, ..., References: N entries) Figures: N | Tables: N | Equations: N Citations in text: N | Reference entries: N Integrity: [OK / N orphan citations, M unused references, K figure/table gaps] ``` **Do not proceed with mode-specific work until this extraction report is presented and the user confirms.** If the manuscript is a .doc (legacy Word), convert to .docx first using the method in the docx skill. --- ## DRAFT MODE: workflow below The sections from here down (Citation workflow, Pause protocol, Section content guidance, QC, Export) apply to **Draft mode only**. For Review, Revise, or Proofread, read the corresponding mode reference file instead: - Review → `references/mode-review.md` - Revise → `references/mode-revise.md` - Proofread → `references/mode-proofread.md` - Audit → `references/mode-audit.md` - Format → `references/mode-format.md` The **Figure necessity assessment** (further down) applies to all modes: Review checks whether existing figures earn their place, Revise can recommend cutting them, Draft gates new ones. ## CITATION WORKFLOW Execute before drafting each section except the Abstract (most journals, including HJ, forbid citations in abstracts). **Two backends, different jobs.** Semantic Scholar finds the right paper; OpenAlex supplies the metadata needed to cite it. Use both, in that order. > **Known limitation of the Semantic Scholar MCP server.** Its `search_papers` and `get_paper` return only `title`, `authors`, `year`, and `venue`. They silently drop `externalIds`, `citationCount`, and `openAccessPdf` even when those fields are explicitly requested, and `venue` is often an empty string. Verified 2026-08-25 on both endpoints, including a lookup by DOI. **Do not rely on Semantic Scholar for a DOI, a citation count, or venue quality.** If a future server version returns those fields, this note can be dropped, but check before trusting them. 1. **Identify citation needs.** List the claims in the upcoming section that require literature support. 2. **Discovery: search Semantic Scholar.** One focused query per topic. Call `mcp__semantic-scholar__search_papers` with `limit` 5. Never batch unrelated topics into one query. Semantic Scholar has the better topical relevance on narrow domain queries, which is why it leads. Expect only title, authors, year, and possibly venue back. 3. **Shortlist by relevance.** From the Semantic Scholar results, pick the 1–3 candidates that actually support the specific claim. Judge on topical fit alone at this stage; you do not yet have the metadata to judge anything else. If nothing is topically relevant, insert `[CITATION NEEDED: <topic>]` inline and skip to the next claim. Never insert a loosely-related paper to fill a slot. 4. **Resolution: look the candidates up in OpenAlex.** Call `mcp__openalex__search_works` with the candidate title (set `exact_phrase: true` for a distinctive title). This returns what Semantic Scholar cannot: `doi`, `cited_by_count`, `fwci`, `source` with `source_issn_l`, and open-access status. If OpenAlex cannot find the paper, the citation is **unresolved**. Insert `[CITATION NEEDED: <topic>, found in Semantic Scholar as "<title>" but not resolvable in OpenAlex, DOI unverified]` and tell the user. Do not write a reference entry from the Semantic Scholar result alone, and never reconstruct a DOI from a pattern. **If `mcp__openalex__*` tools are not available at all** (Claude Desktop / claude.ai, unless you have added an OpenAlex connector), this step cannot run. Then: - Cite from the Semantic Scholar result: authors, title, year, and venue where present. - **Omit the DOI.** Do not substitute one from memory. An omitted DOI is a formatting gap the user can fill in minutes; a wrong one is a fabricated citation. - Mark every such entry `[DOI UNVERIFIED]` in the running reference list, and list them all in the post-section summary. - Say once, at the start of the session, that DOI verification is unavailable in this environment and the reference list will need a manual DOI pass before submission. This is a real capability difference, not a stylistic one. Do not paper over it. 5. **Select the best match.** Now rank the shortlist by: (a) topical relevance to the specific claim, (b) year, preferring 2010–present unless a seminal older work is clearly needed, (c) venue quality, (d) community acceptance. For (c), use `source` and `source_issn_l` from the OpenAlex result. When the venue is unfamiliar or its standing matters to the argument, call `mcp__openalex__check_venue_quality` with the venue name or ISSN: it returns h-index, `two_year_mean_citedness`, and DOAJ indexing status. A venue with no meaningful h-index and no indexing is a reason not to cite. For (d), prefer **`fwci`** (field-weighted citation impact) over raw `cited_by_count`. FWCI normalizes for field and publication age, so it does not penalize a strong 2023 paper against a mediocre 2005 one. Raw counts are still useful as a sanity check. 6. **Format in the journal's style.** Use the in-text and reference formats defined in the loaded journal reference file (see the journal table above). Note that TIM uses numeric bracketed citations, not author-year, so the whole insertion pattern changes when that profile is loaded. Include the DOI from the OpenAlex `doi` field. Strip the `https://doi.org/` prefix if the journal profile wants a bare DOI. 7. **Insert inline + append to running reference list.** Place the formatted in-text citation at the exact sentence location. Append the full reference entry to a `## REFERENCE LIST` block that grows across the session, alphabetically sorted and deduplicated by DOI or title. 8. **Post-section citation summary.** After each section output, report: ``` Citations resolved this section: N (N with verified DOI) Unresolved [CITATION NEEDED] items: <list or "none"> Running reference list total: N entries ``` **Never fabricate citations, DOIs, or author names.** Every DOI in the reference list must have come back from an OpenAlex lookup in this session. A DOI you have not seen returned by a tool call does not go in the manuscript, no matter how confident the pattern looks. If neither backend produces the paper, the placeholder stays. **Rate limits.** Semantic Scholar is 1 request/second (authenticated free tier); OpenAlex is 10/second. Neither is a practical constraint at one query per claim, but do not fan out parallel Semantic Scholar calls. --- ## SECTION-BY-SECTION PAUSE PROTOCOL After completing each section, stop and present: > **[Section Name]** is drafted. Would you like to: > **(A)** Continue to the next section > **(B)** Revise this section before proceeding > **(C)** Export what we have so far to .docx Do not proceed to the next section until the user confirms. This is non-negotiable, it protects the user from long runs of drift. ## RECOMMENDED WRITING ORDER If the user picks "all sections" or does not specify a starting point, recommend this writing order, not the IMRAD reading order: 1. **Materials and Methods** first. Methods is the most factual and least style-dependent section. Drafting it first surfaces gaps in cached data and equations early, before they propagate. 2. **Results** second. Now that Methods is fixed, every Results claim has a defined source. 3. **Discussion** third. Discussion benchmarks Results against the literature; both must exist first. 4. **Introduction** fourth. The Introduction's gap statement must align with what the paper actually delivers in Results and Discussion. Writing it last prevents the common failure of an Introduction that promises more than the Results show.
Voir sur GitHub
Ce SKILL.md est tres volumineux, SkillsMP affiche donc ici seulement la premiere section. Voir sur GitHub