| name | dr-cook:citation-checker |
| description | Validate and correct citation formatting in academic manuscripts. Use when checking references, fixing citation style errors, validating in-text citation matching, auditing self-citation rates, or formatting to Vancouver, APA, or GB/T 7714-2015. Triggers on: check citations, fix references, validate reference list, citation errors, self-citation audit, Vancouver/APA/GB/T 7714, 检查参考文献, 格式化引用, 自引检查. Do NOT trigger on: literature review, paper download, manuscript writing, English polishing, or peer review comments.
|
citation-checker
1. Overview
Validates reference lists and in-text citations against Vancouver, APA 7th, and GB/T 7714-2015. Identifies formatting errors, orphaned citations, and self-citation rate violations. Operates standalone (user pastes text) or in pipeline mode (receives raw_text and references from upstream). Output: numbered issues list with severity tags and a corrected reference list. Bilingual input supported. Domains: tcm, bioinformatics, clinical, pharmacology.
2. Parameters
Required
| Parameter | Values | Description |
|---|
citation_style | vancouver | apa | gb-t-7714 | The target citation standard. If inherited from upstream context_output, skip asking. |
text | string | The manuscript body, reference list, or both. May be pasted directly or inherited from context_output.raw_text. |
Optional
| Parameter | Values | Description |
|---|
check_self_citation | bool (default: false) | Whether to audit the reference list for self-citations by the manuscript's authors. |
author_name | string | Full name or last name + initials of the submitting author. Required when check_self_citation = true. |
domain | tcm | bioinformatics | clinical | pharmacology | Research domain. Used for context only; does not alter citation rules. Inherit from upstream if available. |
Parameter collection rule
Collect one missing required parameter at a time. If citation_style and text are both available from upstream context_output, proceed without prompting. If check_self_citation = true but author_name is missing, ask for it before Step 6.
3. Workflow
Step 1 — Check for upstream context_output.
Inspect active context_output. Inherit parameters.citation_style → citation_style, parameters.domain → domain, raw_text → text, references → structured reference list. Record inherited fields for the output header. If no upstream context, proceed to Step 2.
Step 2 — Collect missing parameters.
- If
citation_style not inherited, ask: "Which citation style: Vancouver, APA 7th, or GB/T 7714-2015?"
- Resolve
text using the first available source: (1) context_output.raw_text if present; (2) text pasted directly in the user's message; (3) content the user references as "the file I shared" or a previously-displayed block — acknowledge and use it. If none apply, ask: "Please paste the reference list and/or manuscript text you'd like me to check."
- Collect one parameter at a time.
- If
check_self_citation = true, ask for author_name immediately after confirming.
- If the user has not mentioned self-citation checking, briefly offer it after confirming
citation_style and text are in hand: "Would you also like me to check the self-citation rate? If so, please provide your name as it appears in your publications."
Step 3 — Load citation format rules.
Load references/citation-formats.md. Extract the rule set for the selected citation_style (field-order, author format, DOI format, in-text regex patterns). Keep active through Steps 4 and 5.
Step 4 — Run format consistency check.
Parse the reference list from text (or references array if inherited). For each entry apply the rule set from Step 3: field order, author format and "et al" threshold, journal name (abbreviated vs. full), DOI format, punctuation, and GB/T 7714 document type identifier.
Severity: ERROR (missing required field, wrong field order, wrong type identifier); WARNING (wrong punctuation, DOI format mismatch, journal name not abbreviated when required); INFO (stylistic inconsistency not violating the standard).
Step 5 — Run in-text citation matching.
Extract all in-text markers using patterns from references/citation-formats.md. Style-specific rules apply:
- Vancouver and GB/T 7714: extract numeric markers using the bracket-number regex patterns from citation-formats.md.
- APA: build a surname-year lookup key for each reference (e.g., "Smith 2022"). Scan manuscript text for
(Author, Year) patterns. When "et al." appears, match on first-author surname only (applies when ≥3 authors). Flag references with no match in text (orphan). Flag in-text citations with no reference list entry (dangling).
Compare in both directions:
- Cited in-text but absent from list → ERROR: "In-text citation [X] has no corresponding reference list entry."
- In list but never cited in-text → WARNING: "Reference [X] is never cited in the text."
Step 6 — Self-citation audit (conditional).
Run only if check_self_citation = true. Load references/self-citation-norms.md. Match author_name (surname + initials, fuzzy, case-insensitive) against each reference's author fields. Calculate rate: self_citations / total_references × 100%. Apply thresholds from norms file (defaults: > 30% ALERT; > 20% WARNING; ≤ 20% INFO). List matched references by number.
Step 7 — Output.
Present output per Section 4. Write context_output per Section 5.
4. Output Format
Output consists of two mandatory sections, presented in this order.
Section A — Issues Found
## Issues Found
[N issue(s) detected]
1. [SEVERITY] Reference N: description of issue.
If no issues are found: state "No citation issues found." then proceed to Section B.
Section B — Corrected Reference List
Echo the full reference list with all corrections applied inline. Number each entry. If a correction was applied, append [corrected] in italics after the entry on the same line for traceability.
If check_self_citation was run, append a Self-Citation Summary block after Section B showing: total references, self-citation count, rate percentage, severity level, and list of self-cited reference numbers.
5. context_output
Reads from upstream
| Field | Source module | Usage |
|---|
parameters.citation_style | paper-writer, paper-reviewer | Skip asking user for style |
parameters.domain | any upstream module | Contextual information |
parameters.target_journal | paper-writer, cover-letter-writer | Informational; does not alter rules |
raw_text | paper-writer, paper-reviewer, rebuttal-writer | Used as text input |
references | literature-reviewer, literature-downloader | Used as structured reference list |
Writes to output
{
"module": "citation-checker",
"summary": "string — one sentence: references checked, error/warning counts, self-citation rate if applicable.",
"key_findings": [
"string — one entry per ERROR-severity issue found"
],
"references": [
{
"pmid": "string | null",
"doi": "string | null",
"title": "string",
"authors": "string",
"year": "integer"
}
],
"parameters": {
"citation_style": "vancouver | apa | gb-t-7714",
"domain": "tcm | bioinformatics | clinical | pharmacology | null",
"self_citation_rate": "float | null — percentage value, e.g. 25.0; null if check_self_citation was false"
},
"status": "success | partial | failed",
"error_message": "string | null — null on success; error description on failure"
}
key_findings: ERROR-severity issues only; WARNING and INFO are in output text only.
references: corrected reference list; replaces any upstream references array.
status: "success" — completed; "partial" — some references unparseable; "failed" — no valid reference list found.
Downstream readers
references (corrected) → cover-letter-writer, grant-writer. summary and key_findings → paper-reviewer (if looping back for re-check).
6. References
citation-formats.md — field-order rules, author format, DOI format, in-text regex patterns, and error checklists per style.
self-citation-norms.md — rate thresholds by article type and journal tier, identification algorithm, and mitigation strategies.