citation-helper
Skill2 starsChanged 8 months agoMITView on GitHub
**Zotero Citation Helper**: Searches a Zotero library (CSL-JSON) to find references by author, title, keyword, or year. Returns citation keys [@citekey], formats APA 7 entries, generates reference lists, and suggests citations for claims.
- Installs packages
In this repository8 other files it gives its agents.
- academic-editorSkill
- academic-essaySkill
- citation-checkerSkill
- citation-fixerSkill
- project-reportSkill
- proposal-graderSkill
- research-proposalSkill
- systematic-reviewSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
23 rules. About 0 are common, 19 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈19
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 16
Use when the user asks you to:
- Distinctive: line 22
Look up what's in their Zotero library
- Distinctive: line 23
Search for sources to cite in an essay or paper
- Very specific: line 29
If this file does not exist, instruct the user to set up Zotero auto-export.
- Very specific: line 45
Read and parse the Zotero CSL-JSON library configured in the plugin's .local.md file (default: references/salsu-library.json) (array of …
- Distinctive: line 46
Search across these fields (case-insensitive):
- Distinctive: line 71
Search the library for the specified reference (by author + year, title, or selection from search results)
- Very specific: line 123
Use et al. only in in-text citations, never in reference list (list all authors up to 20)
- Distinctive: line 135
Read the specified markdown document (or accept pasted text)
- Very specific: line 143
Look up each key in the Zotero CSL-JSON library configured in the plugin's .local.md file (default: references/salsu-library.json)
- Distinctive: line 164
Search the library (Operation 1) using those terms
- Distinctive: line 178
Every source cited must meet one of these conditions:
- Distinctive: line 191
Check if the source URL is openly accessible
- Distinctive: line 192
Check the user's NotebookLM resources
- Distinctive: line 193
IF FULLTEXT FOUND: Read it. Verify the claim matches what the source actually says.
- Distinctive: line 194
IF FULLTEXT NOT FOUND: Ask the user to provide it:
- Distinctive: line 201
When suggesting citations, clearly distinguish:
- Distinctive: line 216
When writing text that needs citations:
- Distinctive: line 219
Verify fulltext access: before inserting any citation (see Human-in-the-Loop above)
- Distinctive: line 221
After the document is complete, run Operation 4 to generate the reference list
- Distinctive: line 233
When the fixer needs to correct metadata (wrong DOI, author names, etc.):
- Distinctive: line 234
Look up the correct data from the CSL-JSON file (Zotero imports metadata from authoritative databases)
- Distinctive: line 239
If the user wants to render a markdown document with resolved citations to DOCX or PDF:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Zotero Citation Helper
Overview
This skill connects your Zotero reference library to Claude Code. It reads the auto-exported CSL-JSON bibliography file and provides five operations: search, cite, format, generate reference lists, and suggest citations. No runtime dependencies — it reads a JSON file that Zotero keeps updated automatically via Better BibTeX.
When to Use This Skill
Use when the user asks you to:
- Find or search references on a topic, by author, or by year
- Get a citation key for a known article or author
- Format a reference entry in APA 7
- Generate a reference list from
[@citekey]citations in a document - Suggest citations for a claim or topic sentence
- Look up what's in their Zotero library
- Search for sources to cite in an essay or paper
Input Requirements
Primary data source: The Zotero CSL-JSON library configured in the plugin's .local.md file (default: references/salsu-library.json).
If this file does not exist, instruct the user to set up Zotero auto-export. Refer them to references/zotero-setup.md in this skill's references directory and provide a brief summary:
Your Zotero library isn't connected yet. You need to:
- Install Zotero 7 and the Better BibTeX plugin
- Create a SALSU collection in Zotero
- Right-click the collection → Export → Better CSL JSON → check "Keep updated" → save to your configured CSL-JSON path
See
references/zotero-setup.mdfor the full setup guide.
Operations
Operation 1: Search Library
Triggers: "find references about X", "search library for X", "who wrote about X", "what do I have on X"
Process:
- Read and parse the Zotero CSL-JSON library configured in the plugin's
.local.mdfile (default:references/salsu-library.json) (array of CSL-JSON objects) - Search across these fields (case-insensitive):
author— match againstfamilyandgivenname fieldstitle— article/book titleabstract— if availablecontainer-title— journal or book nameissued— year (fromdate-parts[0][0])note— Zotero noteskeyword— Zotero tags
- Multiple search terms are treated as AND (all must match across any fields)
- Return results sorted by relevance (title/author matches ranked higher than abstract matches)
Output format per result:
[@citekey] — Author, A. A., & Author, B. B. (Year). Title of article. *Journal Name*, *Volume*(Issue), Pages.
Abstract: First 150 characters of abstract...
Tags: tag1, tag2Show up to 10 results. If more exist, tell the user the total count and suggest narrowing the search.
Operation 2: Get Citation Key
Triggers: "cite Moore and Westley", "citekey for X", "citation key for X", "how do I cite X"
Process:
- Search the library for the specified reference (by author + year, title, or selection from search results)
- Return the Better BibTeX citation key from the
idfield of the CSL-JSON item
Output formats:
| Context | Format | Example |
| Single parenthetical | [@citekey] | [@moore.westley2011] |
| Multiple sources | [@key1; @key2] | [@moore.westley2011; @avelino.etal2019] |
| Narrative | @citekey | @moore.westley2011 |
| With page number | [@citekey, p. 15] | [@moore.westley2011, p. 15] |
| Suppress author | [-@citekey] | [-@moore.westley2011] |
Explain the Pandoc citation syntax briefly when returning keys, so the user knows how to use them.
Operation 3: Format APA 7 Reference Entry
Triggers: "format reference for X", "APA reference for X", "how should I reference X"
Process:
- Find the item in the CSL-JSON library
- Determine the item type (
article-journal,book,chapter,report,webpage,thesis) - Apply APA 7 formatting rules from
../../references/apa7-guide.md
Formatting rules by type:
Journal article:
Author, A. A., Author, B. B., & Author, C. C. (Year). Title of article in sentence case. *Journal Name*, *Volume*(Issue), Pages. https://doi.org/xxxxxBook:
Author, A. A. (Year). *Title of book in sentence case* (Xth ed.). Publisher.Book chapter:
Author, A. A. (Year). Title of chapter. In B. B. Editor (Ed.), *Title of book* (pp. xx–xx). Publisher.Report:
Organisation. (Year). *Title of report* (Report No. xxx). Publisher. https://urlWebpage:
Author, A. A. (Year, Month Day). *Title of page*. Site Name. https://urlKey formatting details:
- Author names:
Surname, A. A.with&before last author - Use
et al.only in in-text citations, never in reference list (list all authors up to 20) - Sentence case for article/chapter titles (capitalise only first word, first word after colon, and proper nouns)
- Title case for journal names
- Italicise journal names, volume numbers, book/report titles
- DOI as
https://doi.org/hyperlink - No "Retrieved from" before URLs
Operation 4: Generate Reference List from Document
Triggers: "generate reference list", "make references for my paper", "reference list from citations", "what references does my document need"
Process:
- Read the specified markdown document (or accept pasted text)
- Extract all Pandoc citation keys using regex:
[@citekey]— standard parenthetical[@key1; @key2; @key3]— multiple sources@citekey— narrative (word boundary: preceded by space or start of line)[-@citekey]— author-suppressed[@citekey, p. XX]— with locator
- Deduplicate the extracted keys
- Look up each key in the Zotero CSL-JSON library configured in the plugin's
.local.mdfile (default:references/salsu-library.json) - Format each as an APA 7 reference entry (Operation 3)
- Sort alphabetically by first author surname
- Output the complete reference list
Handle errors:
- Keys not found in library → list separately with a warning:
⚠ Citation keys not found in Zotero library: - [@unknown.key2024] — not in library. Add this item to your Zotero collection. - Duplicate keys → deduplicate silently
- Malformed keys → flag with the location in the document
Operation 5: Suggest Citations
Triggers: "suggest citation for X", "what can I cite for X", "find me a source on X", "I need a reference for X"
Process:
- Parse the user's claim, topic sentence, or concept
- Extract key terms (remove stop words, identify domain terms)
- Search the library (Operation 1) using those terms
- Return 1-5 relevant matches with:
- Citation key in Pandoc format
- Full APA 7 reference
- Brief explanation of why this source is relevant (based on title/abstract match)
If no matches found:
No matching sources found in your Zotero library for "[search terms]". Consider searching for sources on this topic and adding them to your Zotero collection.
Human-in-the-Loop: Source Verification Protocol
CRITICAL RULE: Never cite a source you have not read or verified.
Every source cited must meet one of these conditions:
- The fulltext has been read by Claude Code (PDF, HTML, or pasted text)
- The user confirms they have read it and provides key claims to cite
- The source is from the user's own prior work (e.g., Espina, 2026)
Sources found only by metadata (title, abstract, DOI) are candidates, not citable sources, until verified.
When Writing: The Verification Loop
- SEARCH: Find candidate sources in Zotero library
- CHECK FULLTEXT: For each candidate, check local directories first:
- The local PDFs directory configured in
.local.mdfor course materials and assigned readings - Any additional research directories the user has specified
- Check if the source URL is openly accessible
- Check the user's NotebookLM resources
- The local PDFs directory configured in
- IF FULLTEXT FOUND: Read it. Verify the claim matches what the source actually says. Cite with confidence.
- IF FULLTEXT NOT FOUND: Ask the user to provide it:
- "I want to cite [Author (Year)] for [specific claim], but I don't have access to the fulltext. Could you download the PDF and save it to Downloads/Academic Research/, paste the relevant section, or confirm the claim from your reading?"
- IF BEHIND PAYWALL: Tell the user explicitly with the DOI link and suggest accessing through MAU library at https://libguides.mau.se/leadership_sustainability
- NEVER fabricate claims, page numbers, or quotes from sources not read.
Verified vs. Candidate Sources
When suggesting citations, clearly distinguish:
- VERIFIED (fulltext read): Show citation key, formatted reference, specific claim with page number
- CANDIDATE (metadata only): Show citation key and reference, mark with a warning, ask the user to provide fulltext before citing
Handling Missing Sources During Writing
- Pause writing at the point where the unverified citation is needed
- List what is missing with DOIs and the specific claim each source is needed for
- Continue writing sections that do not depend on the missing sources
- Resume once the user provides the fulltexts
Integration with Other Skills
With academic-essay / research-proposal / systematic-review
When writing text that needs citations:
- The writing skill drafts content
- For claims needing sources, invoke citation-helper to search the library
- Verify fulltext access before inserting any citation (see Human-in-the-Loop above)
- Insert the returned
[@citekey]at the appropriate location - After the document is complete, run Operation 4 to generate the reference list
- Final verification pass: confirm every cited source has been read or user-confirmed
With citation-checker
The checker can cross-reference cited sources against the Zotero library:
- References in the paper that exist in Zotero → higher confidence they're real
- References NOT in Zotero → flag for verification (may still be valid, just not in the library)
- Flag any citation where fulltext was never accessed during the writing session
With citation-fixer
When the fixer needs to correct metadata (wrong DOI, author names, etc.):
- Look up the correct data from the CSL-JSON file (Zotero imports metadata from authoritative databases)
- The Zotero library serves as a ground-truth source for reference metadata
Pandoc Rendering (Optional)
If the user wants to render a markdown document with resolved citations to DOCX or PDF:
# Paths are configured in the plugin's .local.md file.
# Defaults: BIBLIOGRAPHY=references/salsu-library.json, CSL_FILE=references/apa.csl
pandoc paper.md \
--citeproc \
--bibliography=$BIBLIOGRAPHY \
--csl=$CSL_FILE \
-o paper.docxThis replaces all [@citekey] with formatted APA 7 citations and appends a reference list automatically. Requires Pandoc to be installed (brew install pandoc).
CSL-JSON Parsing Reference
The CSL-JSON file is an array of objects. Key fields to parse:
| Field | Type | Description |
id | string | Better BibTeX citation key |
type | string | article-journal, book, chapter, report, webpage, thesis |
title | string | Full title |
author | array | [{family: "Surname", given: "First M."}] |
issued | object | {date-parts: [[2023]]} or {date-parts: [[2023, 6, 15]]} |
container-title | string | Journal name or parent book title |
volume | string | Journal volume |
issue | string | Journal issue |
page | string | Page range, e.g. "123-145" |
DOI | string | DOI without https://doi.org/ prefix |
URL | string | Full URL |
abstract | string | Abstract text |
publisher | string | Publisher name |
edition | string | Edition |
editor | array | [{family, given}] for edited books |
keyword | string | Comma-separated Zotero tags |
See references/csl-json-schema.md for the complete field reference.
Reference Files
references/zotero-setup.md— How to install and configure Zotero + Better BibTeX for this workflowreferences/csl-json-schema.md— Complete CSL-JSON field reference for parsing the bibliography file- Shared:
../../references/apa7-guide.md— APA 7 formatting rules
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

