/endnote-for-word:endnote-for-wordfrom endnote-for-word
Creates and manages real EndNote Cite While You Write citations and bibliographies in Microsoft Word DOCX files. Handles RIS import/export, IEEE citations, DOI links, and output-style switching via EndNote 21 COM automation.
Ships in endnote-for-word. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Create real EndNote citations and a real bibliography in DOCX by driving EndNote 21 Cite While You Write through Word COM. Treat the source DOCX and the EndNote library as user data: write a new output file unless the user explicitly authorizes in-place replacement. Library reads stay read-only; an explicitly requested RIS import is the only library-writing operation and must go through EndNote's own Direct Export route.
ADDIN EN.CITE fields carrying a traveling library payload, and the bibliography must be an ADDIN EN.REFLIST field. Nothing else counts as a citation.(Author, 2023) or a typed reference list is a failed deliverable, not a fallback.sdb.eni or any other library database file directly. import_reference_file may add records only by opening the exact target library in EndNote and handing the RIS file to EndNote Direct Export. Every rec_number must still come from a fresh search_endnote_library call and pass precheck_endnote_manifest; never guess one from a PDF, DOI, sequence, or memory.10.1109/5.771073, and precheck_endnote_manifest must successfully resolve it through https://doi.org/ before citation. The only exception is a target marked "no_doi": true for a record that has no DOI at all, such as a web page, patent, extension article or conference paper without one: precheck then confirms that the record's DOI field is empty and that its URL and notes hold no DOI, and validation skips only that target's visible DOI link, and only while the record in the document's traveling library carries no DOI. Never set no_doi to get past a DOI that exists but fails a check.doi: https://doi.org/<DOI>. Reject missing DOI links and duplicated resolver prefixes such as https://doi.org/https://doi.org/....list_endnote_styles first. An unknown style name makes EndNote open a modal dialog and hangs the run, and no DisplayAlerts setting suppresses it.{see \Author, 2023 #1} and {\Author, 2023 #1} open modal dialogs, so Assert-Manifest rejects a prefix key outright.-Overwrite is supplied.{A, 2023 #1; B, 2020 #2} is one field, not two. Count citations as count(codes starting with "ADDIN EN.CITE") - count(codes starting with "ADDIN EN.CITE.DATA"), because a large traveling library payload is moved into a nested ADDIN EN.CITE.DATA field.ENFormatBibliography, ENAuthorYearFormat, and ENUnformatCitations are allowed. Every *Dlg macro opens a modal dialog and must never be invoked. ENRemoveFieldCodes also raises a modal confirmation dialog and never returns under automation, so converting to plain text stays a manual ribbon operation. ENToggleInstantFormatting toggles blindly with no read-back and is not used.Visible = false; an EndNote process started by the bridge uses a hidden window. Never surface either application during Agent editing.Application.AddIns.Add on the CWYW template. EndNote Cwyw.dotm auto-loads as a global template as soon as a document is open, and adding it again double-loads it.COMAddIns("EndNote.WordAddin.Connect").Object returns null on this platform. Application.Run('<macro>') is the only working entry point.pwsh.exe 7 or later, run the bridge directly.powershell.exe) is supported and allowed. Prefer pwsh.exe when it is present, but do not refuse to run in 5.1.pwsh.exe first and fall back to powershell.exe.pwsh cannot automate Windows Office COM.pwsh.exe nor powershell.exe is available, stop and ask the user to install PowerShell using https://learn.microsoft.com/powershell/scripting/install/installing-powershell-on-windows. Never silently downgrade the workflow to typed citations.mathtype-for-word merely to complete EndNote work.endnote-for-word-manifest.json, endnote-for-word-references.ris, or endnote-for-word-validation.json.-endnote when this skill runs alone. Use -mathtype-endnote, for example <source-stem>-mathtype-endnote.docx, only when mathtype-for-word is available and the task requires both skills.mathtype-for-word is available before planning a joint workflow. If it is unavailable, complete only the EndNote scope, keep the standalone suffix, report the unperformed MathType scope, and never claim combined completion.mathtype-for-word is available and required, plan one shared final DOCX. Do not create separate EndNote and MathType document trees or keep one document per skill. Preserve the original source, let the first skill publish the shared working copy, let the second skill continue on that same copy with explicit overwrite authorization, then validate the final shared document with both skills..docx.probe_endnote_word. Pass library_path when the library is already known so the three library_* checks are filled in. Stop on a failed prerequisite and report the exact failed check. Exit code 2 means the environment is not ready, not that the document is wrong.list_endnote_styles and resolve the requested output style to an installed .ens name before anything else touches Word. If the user named a style that does not resolve, present the nearest matches and ask; do not substitute a style silently.display, decides whether cited pages or a suffix are needed, and assigns one stable id and one unique marker per citation. Never start writing a manifest during the first pass.search_endnote_library to find candidate records and get_endnote_reference to confirm the exact record. If a needed record is absent and RIS is available, call import_reference_file on the exact target library, then search again. If the user names no library and the DOCX carries no EndNote citations, omit library_path and pass the DOCX as document_path: the target becomes <document stem>.enl beside the DOCX, and the returned library_path is the library for every later step and the manifest. If the target library does not exist, first ensure EndNote is fully closed; the tool then creates a new .enl + .Data pair from empty_library_template_path or, when that is omitted, from the template registered with configure_endnote_defaults. When neither exists, ask the user to create an empty library once in EndNote (File > New), close EndNote, and register it. Copy only the fresh search result's rec_number, first_author_surname, year, and bare DOI into the target. A record whose search result has an empty DOI is cited only with "no_doi": true on its target and no doi key; when the item has a DOI that the record lacks, add the DOI to the record instead.precheck_endnote_manifest. It verifies every target against the library and verifies each DOI online through doi.org before Word is opened; for a no_doi target it confirms that the record has no DOI. Fix every reported problem and re-run it; the pre-check reports all mismatches at once.render_endnote_word_document. Every shared formatting entry point refuses to call CWYW if any {{CITE:...}} remains, because braces are EndNote temporary-citation delimiters and an unmatched marker can open Select Matching Reference. Every document marker must therefore be in the manifest; for a subset test, use a scratch copy with every unselected marker removed. Do not edit the same DOCX in Word while the render runs. Render, update, and set-style return a job_id at once: call get_endnote_job_status with that id and wait_seconds (up to 120) until the state is succeeded, failed, or cancelled, and continue other work meanwhile. Jobs from every document and every agent session run one at a time; each opens its manifest library beside the libraries the user has open and closes it afterwards. Tell the user about any dialog under attention. When dialogs_cancelled names Select Matching Reference, another open library has overlapping record numbers and the job pressed Cancel on that chooser; ask the user to close the other libraries in EndNote, then render again. Call cancel_endnote_job for a job the user no longer wants.validate_endnote_word_document with the same manifest. A render is incomplete until validation returns ok: true. An output file that exists but fails validation is a diagnostic artifact, not a deliverable.endnote_preexisting), the validation result, and any limitation that applies.Use the bundled local MCP server when available:
probe_endnote_word: read-only prerequisite check for Word COM, the EndNote executable, the CWYW add-in registration, the CWYW template load state, macro callability, the styles directory, and the optional library.list_endnote_styles: read-only enumeration of installed and personal .ens output styles, with an optional case-insensitive filter.search_endnote_library: read-only search over the library across author, title, journal, DOI, keywords, and abstract.get_endnote_reference: read-only fetch of one record by rec-number.precheck_endnote_manifest: read-only library verification plus online doi.org verification for every bare DOI.configure_endnote_defaults: persist the packaged default profile, and register empty_library_template_path after verifying it holds zero stored references. A registered template survives later calls. Invoke only when the user asks to configure defaults or register a template, or during an explicitly requested installation. It does not touch EndNote's own preferences.render_endnote_word_document: marker-driven insertion of temporary citations followed by CWYW formatting. Runs as a background job unless background is false.validate_endnote_word_document: read-only structural validation against the gates below.update_endnote_word_fields: re-run CWYW formatting after the document text changed. Runs as a background job unless background is false.set_endnote_citation_style: switch the output style of an already formatted document. Runs as a background job unless background is false.get_endnote_job_status: a job's state, its tool result once finished, the EndNote notices it dismissed under notices_dismissed (news notices with Cancel, listed marketing notices such as Holiday Sale: ... with Cancel, never Ignore This), and any other dialog that stayed open, under attention. Without job_id it lists the session's jobs.cancel_endnote_job: stop a queued or running job; no output file is written.unformat_endnote_word_document: revert formatted citations to temporary citation text, into a new file only.export_reference_import_file: write a UTF-8 RIS file from structured reference metadata.import_reference_file: open the exact target library and import a RIS file through EndNote Direct Export once EndNote shows that library in front, its process holds the library's database open and no other open library has the same file name (import_target_confirmed_by: open_handle), or, only when Restart Manager cannot answer, EndNote's most recent library names it (recent_library). It reports before/after live-reference counts. With document_path instead of library_path, the target is <document stem>.enl beside the DOCX; a DOCX that already carries EndNote fields is refused rather than given a new library. When the target is absent and EndNote is fully closed, it first clones the supplied or registered empty library template, whose total stored-reference count, including trash, is verified as zero.If MCP is unavailable, invoke the same bridge directly from the plugin root. Resolve every variable from the user's attached or repository files and never reuse a sample path literally.
# PowerShell 7 preferred. Replace pwsh.exe with powershell.exe on Windows PowerShell 5.1.
pwsh.exe -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Bypass -File scripts\endnote-word.ps1 -Action probe -LibraryPath $library
pwsh.exe -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Bypass -File scripts\endnote-word.ps1 -Action list-styles -Style $styleFilter
pwsh.exe -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Bypass -File scripts\endnote-word.ps1 -Action render -InputPath $inputDocx -OutputPath $outputDocx -ManifestPath $manifestJson
pwsh.exe -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Bypass -File scripts\endnote-word.ps1 -Action validate -InputPath $outputDocx -ManifestPath $manifestJson
pwsh.exe -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Bypass -File scripts\endnote-word.ps1 -Action import-ris -LibraryPath $library -RisPath $ris
# The offline library reader is stdlib-only Python and needs no Word and no EndNote.
python scripts\endnote_library.py search --library $library --author "Thomsen" --year 2023 --limit 20
python scripts\endnote_library.py precheck --library $library --manifest $manifestJson
thomsen2023 or merged_welfare. An id matches ^[A-Za-z][A-Za-z0-9_-]*$ and is globally unique.{{CITE:thomsen2023}}. Each marker must occur exactly once in the document. Never reuse a marker.citations[] entry with several targets[] is a merged citation and renders as one field. Do not emit two adjacent citations when the user wants one merged parenthesis.rec_number greater than zero, a non-empty author surname, an integer year, and either a bare doi or "no_doi": true, never both. The DOI field must not contain doi: or a resolver URL. no_doi is per target and accepted only for a record that holds no DOI in its DOI field, URL or notes; DOI targets and no_doi targets mix freely in one manifest and render in the same pass.display to author-year only when the citation itself is a grammatical subject or named actor. Replace the complete existing plain-text author phrase and any legacy typed citation number with the marker. For example, change Li et al. [1] 以聚丙烯... to {{CITE:li2024}} 以聚丙烯...; IEEE then lets EndNote render Li et al. [n] 以聚丙烯.... Never leave Li et al. or [1] beside the marker, and never write Smith {{CITE:smith}}, because EndNote would duplicate the author or retain a fake number.author-year punctuation as output-style-owned and valid. IEEE may render Hernandez, et al. [1] with a comma before et al. even when the source prose used Hernandez et al.. Do not flag this as suspicious, pause for confirmation, propose display: default, or restore a plain-text author merely to remove the comma. Change it only when the user explicitly requests a different installed output style or asks to revise the style itself.display to default when the reference supports a claim, normally at the clause or sentence boundary, for example The method is stable {{CITE:smith}}, which IEEE renders as The method is stable [1].display: default. author-year requires exactly one target. When the prose is ambiguous, rewrite the sentence so the grammatical role is explicit before choosing.pages supplies EndNote cited pages and must match ^[0-9]+(\s*-\s*[0-9]+)?$. It renders as @45-46 inside the temporary citation.suffix supplies free text after the citation, such as , p. 99.pages and suffix bind to the last target only in EndNote semantics, so the manifest may only carry them when targets has exactly one entry. Assert-Manifest enforces that.prefix is rejected in v1. Read temporary-citations.md for the reason and the supported alternatives.library.path must point at an existing .enl file that has a sibling <name>.Data directory. The stub .enl alone is not a library.bibliography.expected to true whenever a reference list is wanted, which is almost always. It turns on validation gate 4.IEEE unless the user explicitly requests another installed style.doi: https://doi.org/DOI; the DOI field itself stays bare. Never add a resolver prefix to an already prefixed DOI value.EN.Layout holding an <ENLayout> XML fragment. The bridge reads it, replaces the <Style> element, and re-runs ENFormatBibliography. No dialog is involved..ens files first. list_endnote_styles is the authority, not the user's spelling and not a remembered style list.display: default yields [1]; display: author-year invokes EndNote's ENAuthorYearFormat and yields a form such as Thomsen et al. [1].et al. punctuation exactly as EndNote returns them for the active style; validation checks the author surname and native field structure, not whether punctuation matches the former plain text.set_endnote_citation_style on an already formatted document rather than re-rendering from the source. Re-rendering repeats the marker work for no gain.EN.Libraries records which library and which record ids were used. Do not edit it by hand; it is the provenance evidence used by validation gate 8.word/settings.xml as w:docVar entries, so the style and the record ids are also readable offline without Word.{{CITE:id}} markers at the intended ranges before rendering.update_endnote_word_fields, then validate again.ADDIN EN.CITE, ADDIN EN.CITE.DATA, or ADDIN EN.REFLIST fields. The traveling library inside them is what lets EndNote update the document on another machine.unformat_endnote_word_document is the correct way to get back to editable {Author, Year #RecNum} text. It writes a new file and never edits in place.Treat any of these as a failed deliverable. validate returns ok: false and exit code 3 when any gate fails.
{{CITE: marker text anywhere in the document.\{[^{}]*#\d+[^{}]*\} over the document text. Leftover braces mean CWYW did not format that citation.bibliography.expected is true, anything other than exactly one ADDIN EN.REFLIST field whose result text is non-empty after trimming.doi: https://doi.org/<DOI> text (targets with "no_doi": true are exempt while their traveling-library record carries no DOI), any duplicated DOI resolver prefix, or a leftover doi: label followed by nothing, by punctuation or by a link other than https://doi.org/10..rec_number that does not appear as <rec-number>N</rec-number> in some EN.CITE traveling library XML together with that target's author surname. When the payload moved into a nested ADDIN EN.CITE.DATA field, it is in no field code: match against the decoded field data (w:fldData).author-year citation whose native field result does not visibly contain its author surname.Error!, Reference source not found, {Citation}, or {Bibliography} placeholder strings in the document text.EN.Layout document variable, or a style in it that does not match the manifest style case-insensitively.EN.Libraries document variable, or one whose <record-ids> does not contain every manifest rec_number.HYPERLINK fields inside the bibliography are DOI links, not citations. Never count them as citations and never treat their presence or absence as a failure.
Application.Run. DisplayAlerts = 0 does not suppress add-in dialogs. The MCP watchdog enumerates WINWORD.EXE and EndNote.exe PIDs before and after the call and kills only the ones the call created. A pre-existing EndNote process is never killed..ens file. Both are prevented by steps 3 and 7 of the workflow, so a hang means a step was skipped.precheck_endnote_manifest, then retry only the smallest failing citation once before escalating.endnote_preexisting: true and does not force it to switch libraries. If the citations formatted against the wrong library, ask the user to open the intended library and re-run rather than closing their EndNote for them.export_reference_import_file when RIS must be generated, call import_reference_file on the exact library, then search again. A zero imported_count returns ok: false; search by DOI before retrying because the records may already exist, otherwise repair the RIS and retry once. Read library-import.md.powershell_notice, tell the user its message. Under Windows PowerShell 5.1 without pwsh.exe, read-only calls announce a PowerShell 7 install (pending) and the first call other than probe, list-styles or validate starts it with winget; see installation-matrix.md.ADDIN EN.CITE, nested ADDIN EN.CITE.DATA, ADDIN EN.REFLIST, and the counting rule: field-codes-and-traveling-library.mdApplication.Run entry point, and the dead COMAddIns route: cwyw-entrypoints.mdEN.Layout and EN.Libraries document variables, and style switching: styles-and-formatting.mdLICENSE.txt (opens in a new tab)agents/openai.yaml (opens in a new tab)references/cwyw-entrypoints.md (opens in a new tab)references/field-codes-and-traveling-library.md (opens in a new tab)references/installation-matrix.md (opens in a new tab)references/library-import.md (opens in a new tab)references/styles-and-formatting.md (opens in a new tab)references/temporary-citations.md (opens in a new tab)references/troubleshooting.md (opens in a new tab)references/workflow-and-schema.md (opens in a new tab)scripts/invoke-bridge.ps1 (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
endnote, citations, bibliography, word-automation, reference-management
Other plugins' skills for the same job
npx claudepluginhub felimet/endnote-for-word --plugin endnote-for-word