| name | rf-cite-generate |
| description | Generate properly formatted citations from a DOI, URL, paper title, or manual details. Supports APA 7th, IEEE, Chicago, Vancouver, and Harvard. Adds to a running reference list artifact. Trigger phrases: "generate a citation for this", "cite this paper", "add this to my references", "format this reference", "/rf-cite-generate". |
Citation Generation
Generate properly formatted references from whatever information the user provides — DOI, URL, paper title, or manual metadata.
Before You Begin
Load _rf/research-context.md to get the project's default citation style.
Check _rf-output/citations/references.md — if it exists, you will append to it, not overwrite it.
Step 1 — Source Input
Ask the user: "What would you like to cite?"
They can provide:
- DOI — e.g.,
10.1145/1234567.1234568 — most reliable, extract full metadata from it
- URL — web page, preprint, report, blog post
- Paper title — search for it to find the DOI and full metadata
- Manual details — authors, title, year, journal/venue, volume, issue, pages
- Multiple sources at once — a list of DOIs, titles, or URLs
Step 2 — Metadata Extraction
For each source, extract or prompt for:
| Field | Required | Notes |
|---|
| Authors | Yes | Last, F. M. format for each |
| Year | Yes | Publication year |
| Title | Yes | Full title, sentence case for APA, title case for Chicago |
| Source type | Yes | journal / conference / book / chapter / thesis / website / report / preprint |
| Journal/venue name | If journal/conference | Full name, not abbreviation (unless IEEE) |
| Volume | If journal | |
| Issue | If journal | |
| Pages | If journal/conference | |
| Publisher | If book | |
| DOI | If available | Always include when available |
| URL | If web source | |
| Access date | If web source | Today's date |
| Edition | If book | |
For preprints (ArXiv, SSRN, etc.): note "[Preprint]" and the repository name.
For theses: note degree type and institution.
For websites: note the organization and access date.
Step 3 — Format the Citation
Format the citation in the project's citation style. Apply these rules precisely:
APA 7th
Author, A. A., & Author, B. B. (Year). Title of article. Journal Name, Volume(Issue), pages. https://doi.org/xxxxx
- Sentence case for article/chapter titles
- Title case for journal/book names
- Up to 20 authors before using ellipsis
- DOI as URL format
IEEE
[N] A. Author, B. Author, and C. Author, "Title of article," Journal Name Abbrev., vol. X, no. Y, pp. ZZ–ZZ, Month Year, doi: xxxxx.
- Number citations in order of appearance
- Abbreviate journal names per IEEE standard
- Use "et al." after 6+ authors
Chicago (Author-Date)
Author, First. Year. "Article Title." Journal Name Volume (Issue): pages. https://doi.org/xxxxx.
Vancouver
N. Author A, Author B. Article title. Journal Name. Year;Volume(Issue):pages. DOI.
- Number citations sequentially
- Abbreviate journal names
Harvard
Author, A. and Author, B. (Year) 'Article title', Journal Name, Volume(Issue), pp. pages. doi:xxxxx.
Step 4 — In-Text Citation
Also generate the in-text citation format for the same citation:
- APA:
(Author, Year) or Author (Year)
- IEEE:
[N]
- Chicago:
(Author Year, page)
- Vancouver:
[N]
- Harvard:
(Author, Year)
Step 5 — Append to Reference List
Add the citation to _rf-output/citations/references.md in alphabetical order (for author-date styles) or numbered sequence (for numbered styles).
Also maintain a raw metadata record for each source so citations can be re-formatted to a different style later.
Output Format
_rf-output/citations/references.md:
# Reference List
**Citation style:** [APA / IEEE / etc.]
**Last updated:** [date]
**Count:** [N]
---
## Formatted References
[1] or [Author, Year] — [full formatted citation]
...
---
## Raw Metadata (for reformatting)
### [Title]
- authors: [list]
- year: [year]
- title: [title]
- source_type: [journal/etc.]
- journal: [name]
- volume: [v]
- issue: [i]
- pages: [pp]
- doi: [doi]
- url: [url]
After generating, say: "Added to your reference list. Total references: [N]. Run /rf-cite-check to validate citations in your document draft."