You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add user-configurable citation styles to RWA. Users pick a default style during setup (stored in .rwa-user-config.yaml), override per-project (in project-config.yaml), and each project gets a self-contained copy of its .csl file. Ship ~10 common styles in a csl/ directory; allow downloading additional styles from the Zotero Styles Repository on demand.
- Verify the resolved `.csl` file exists in the project directory. If it does not, use `bib_copy_csl_to_project` to copy it from the shared `csl/` library.
87
92
- Add an editable RWA disclosure in the Methods section when AI-assisted workflow details are relevant
88
93
- Add an acknowledgments / AI-disclosure section with ICMJE-compliant language
89
94
- When Research Workflow Assistant (RWA) is cited in Methods or Acknowledgments, use [@vanzyl2026rwa] and add the matching BibTeX entry from `templates/rwa-citation.bib` to `references.bib`
Copy file name to clipboardExpand all lines: .github/agents/project-manager.agent.md
+6-4Lines changed: 6 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,7 @@ description: >
6
6
meeting notes, and timeline management.
7
7
tools:
8
8
- project-tracker
9
+
- bibliography-manager
9
10
---
10
11
11
12
# Project Manager Agent
@@ -163,10 +164,11 @@ At natural project checkpoints, proactively ask:
163
164
1. Ask the researcher about their project (title, timeline, type, and who should be listed as authors on project outputs)
164
165
2. If `.rwa-user-config.yaml` contains `default_author`, offer to use it as the starting author profile for the project and let the researcher edit or override any field
165
166
3. Collect any additional project authors and store them in `project-config.yaml` under `research_assistant.authors`
166
-
4. Initialize tracking via `project-tracker`, preserving structured author metadata when the tool supports it
167
-
5. Suggest a phase structure based on the project type
168
-
6. Help define initial milestones and tasks
169
-
7. Offer to generate the first brief ("starting point" baseline)
167
+
4.**Citation style**: Read `default_citation_style` from `.rwa-user-config.yaml`. Ask: "Your default citation style is {style}. Should I use it for this project, or would you prefer a different style?" If the user picks a different style, check if it exists in `csl/` — if not, use `bib_download_csl_style` to fetch it. Then use `bib_copy_csl_to_project` to copy the chosen `.csl` file into the new project directory. Set `output_defaults.csl` in the project's `project-config.yaml` to match.
168
+
5. Initialize tracking via `project-tracker`, preserving structured author metadata when the tool supports it
169
+
6. Suggest a phase structure based on the project type
170
+
7. Help define initial milestones and tasks
171
+
8. Offer to generate the first brief ("starting point" baseline)
Copy file name to clipboardExpand all lines: .github/agents/research-planner.agent.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,7 @@ description: >
6
6
tools:
7
7
- prisma-tracker
8
8
- project-tracker
9
+
- bibliography-manager
9
10
---
10
11
11
12
# Research Planner Agent
@@ -42,6 +43,7 @@ Guide the researcher through creating a study protocol, adapting to the study ty
42
43
- Risk of bias assessment (which tool for which study types)
43
44
- Synthesis plan (narrative, meta-analysis, or both)
44
45
- Use the `templates/systematic-review/protocol.qmd` template
46
+
- When creating any `.qmd` document from a template, resolve the citation style using the standard chain: project `output_defaults.csl` → user `default_citation_style` → `apa.csl` fallback. Ensure the resolved `.csl` file exists in the project directory.
45
47
46
48
**Observational Study Protocol:**
47
49
- Study design (cohort, case-control, cross-sectional)
Copy file name to clipboardExpand all lines: .github/agents/setup.agent.md
+49-3Lines changed: 49 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,7 @@ tools:
14
14
- zotero-local
15
15
- project-tracker
16
16
- prisma-tracker
17
+
- bibliography-manager
17
18
---
18
19
19
20
# RWA Setup Agent
@@ -265,7 +266,43 @@ default_author:
265
266
266
267
If `default_author` already exists, show which fields are already set and ask before overwriting them.
267
268
268
-
**Transition**: "Your default author profile is saved. Would you like to create your first project?"
269
+
**Transition**: "Your default author profile is saved. Let's choose your preferred citation style."
270
+
271
+
## Stage 7.5 — Default Citation Style
272
+
273
+
Ask the user to choose their preferred citation / referencing style. This becomes the default for all new projects (overridable per project).
274
+
275
+
1. **List bundled styles**: Use the `bib_list_csl_styles` tool from the bibliography-manager MCP server to show the available styles. Present them in a clear table:
276
+
277
+
| ID | Style | Type |
278
+
|----|-------|------|
279
+
| `apa` | APA 7th edition | Author-date |
280
+
| `vancouver` | Vancouver / NLM (numbered) | Numbered |
281
+
| `vancouver-superscript` | Vancouver (superscript) | Superscript numbered |
282
+
| `american-medical-association` | AMA 11th edition | Superscript numbered |
2. **Ask**: "Which citation style do you prefer? Enter the style ID from the list above, or type a custom style ID from the [Zotero Style Repository](https://www.zotero.org/styles) (over 10 000 styles available). Press Enter to accept the default (APA)."
292
+
293
+
3. **If the user enters a bundled style ID**: Confirm the selection.
294
+
4. **If the user enters a custom style ID** not in the bundled list: Use the `bib_download_csl_style` tool to download it from the Zotero Style Repository. If the download fails (style not found), inform the user and ask them to try again or browse https://www.zotero.org/styles.
295
+
5. **Default**: If the user presses Enter or says "default", use `apa`.
296
+
297
+
Save the selection to `.rwa-user-config.yaml` under `default_citation_style`:
298
+
299
+
```yaml
300
+
default_citation_style: vancouver-superscript
301
+
```
302
+
303
+
If `default_citation_style` already exists, show the current value and ask if the user wants to change it.
304
+
305
+
**Transition**: "Your default citation style is saved. Would you like to create your first project?"
269
306
270
307
## Stage 8 — First Project Setup (Optional)
271
308
@@ -316,7 +353,12 @@ Use the `project-tracker` server to:
316
353
317
354
4. Create `ai-contributions-log.md` in the project directory with the standard template header.
318
355
319
-
5. Create `project-config.yaml` in the project directory with:
356
+
5. **Copy the citation style file** into the project directory. Ask the user:
357
+
- "Should I use your default citation style ({default_citation_style from .rwa-user-config.yaml}) for this project, or would you like a different style?"
358
+
- Use `bib_copy_csl_to_project` to copy the chosen `.csl` file from the shared `csl/` library into the project directory.
359
+
- If the user picks a style not yet in the library, use `bib_download_csl_style` first, then copy it.
360
+
361
+
6. Create `project-config.yaml` in the project directory with:
320
362
```yaml
321
363
research_assistant:
322
364
tracking_location: self
@@ -338,10 +380,11 @@ Use the `project-tracker` server to:
338
380
url: {organization URL if provided}
339
381
output_defaults:
340
382
bibliography: references.bib
341
-
csl: apa.csl
383
+
csl: {chosen style}.csl
342
384
include_rwa_methods_disclosure: true
343
385
include_rwa_acknowledgments: true
344
386
```
387
+
Note: `output_defaults.csl`must match the CSL filename that was copied into the project directory in step 5.
345
388
346
389
**Transition**: "Your project is set up! Here is a summary of everything we configured."
347
390
@@ -376,6 +419,9 @@ Print a clear summary:
376
419
- Affiliation: {organization or "not configured"}
377
420
- ORCID: {configured/skipped}
378
421
422
+
### Default Citation Style
423
+
- Style: {style title} ({style ID}) / not configured (defaults to APA)
424
+
379
425
### First Project
380
426
- {Project title} (created at {path}) / No project created yet
2. When creating the protocol `.qmd` file, resolve the citation style using the standard chain: project `output_defaults.csl` → user `default_citation_style` → `apa.csl` fallback. Ensure the resolved `.csl` file exists in the project directory (copy it from `csl/` if needed using `bib_copy_csl_to_project`).
Copy file name to clipboardExpand all lines: .github/copilot-instructions.md
+16Lines changed: 16 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -224,6 +224,22 @@ Agents should:
224
224
- Recommend [Quarto CLI](https://quarto.org/docs/get-started/) installation when rendering is needed
225
225
- See `docs/posit-quarto-guide.md` for the full Posit/Quarto ecosystem guide
226
226
227
+
### Citation Style Defaults
228
+
229
+
Citation formatting uses **CSL (Citation Style Language)** files processed by Pandoc citeproc. The repository ships a shared style library in `csl/` with common styles pre-bundled. Additional styles can be downloaded on demand from the [Zotero Style Repository](https://www.zotero.org/styles) (10,000+ styles) via the `bib_download_csl_style` tool.
230
+
231
+
**Resolution chain** (agents must follow this priority order):
232
+
1.**Project config** — `output_defaults.csl` in `project-config.yaml`
233
+
2.**User config** — `default_citation_style` in `.rwa-user-config.yaml`
234
+
3.**Fallback** — `apa` (APA 7th edition)
235
+
236
+
**Rules for all agents:**
237
+
- Each project directory gets its own copy of the `.csl` file (for portability). Use `bib_copy_csl_to_project` to copy from the shared library.
238
+
- When instantiating a Quarto template, resolve the CSL style via the chain above and substitute the `csl:` field in the YAML front matter.
239
+
- Never hardcode a path back to the repo-root `csl/` directory in project documents — always use a local copy.
240
+
- If the resolved style is not in the shared library, download it first with `bib_download_csl_style`.
241
+
- See `csl/README.md` for the full list of bundled styles and instructions for adding more.
242
+
227
243
### Diagram and Table Defaults
228
244
229
245
**Diagrams:** The default diagram tool is **Mermaid**, which is natively supported by Quarto via ` ```{mermaid} ` code blocks (no extensions or installs required). Use Mermaid for:
This directory contains [Citation Style Language (CSL)](https://citationstyles.org/) files used by Quarto/Pandoc to format in-text citations and bibliographies.
4
+
5
+
## Bundled Styles
6
+
7
+
| File | Style | Type | Common In |
8
+
|------|-------|------|-----------|
9
+
|`apa.csl`| APA Style 7th edition | Author-date | Psychology, education, social sciences |
In your Quarto (`.qmd`) document YAML front matter:
24
+
25
+
```yaml
26
+
bibliography: references.bib
27
+
csl: vancouver-superscript.csl
28
+
```
29
+
30
+
The CSL file should be in the same directory as your `.qmd` file (RWA copies the appropriate file into each project directory during project creation).
31
+
32
+
## Adding More Styles
33
+
34
+
Over 10,000 styles are available from the [Zotero Style Repository](https://www.zotero.org/styles). To add a new style:
35
+
36
+
1. **Via RWA**: Ask any agent to download a citation style — it will use the `download_csl_style` tool to fetch and save it automatically.
37
+
2. **Manually**: Download the `.csl` file from [zotero.org/styles](https://www.zotero.org/styles) and place it in this directory.
38
+
39
+
## Configuration
40
+
41
+
- **User default**: Set `default_citation_style` in `.rwa-user-config.yaml` (configured during `@setup`).
42
+
- **Per-project override**: Set `output_defaults.csl` in your project's `project-config.yaml`.
All CSL styles in this directory are sourced from the [Citation Style Language](https://github.com/citation-style-language/styles) project and are licensed under the [Creative Commons Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)](https://creativecommons.org/licenses/by-sa/3.0/) license.
0 commit comments