- Introduced `card_language` attribute in ProjectRecord and Workspace classes to handle multiple languages for project cards. - Updated project creation and renaming methods to accept and store the card language. - Enhanced ZoteroReader to read and return attachment metadata, including language-specific summaries and claims. - Modified LLM client to generate card content based on the specified language, supporting both English and Chinese. - Updated tests to cover new functionality, ensuring correct handling of multilingual card generation and retrieval. - Adjusted UI tests to verify the presence of language selection options and proper rendering of multilingual content.
54 lines
2.2 KiB
Markdown
54 lines
2.2 KiB
Markdown
---
|
||
name: zotero-cite
|
||
description: >
|
||
从指定的 Zotero KB 项目中检索知识卡片,为论文写作推荐最合适的引用文献。
|
||
只能访问用户明确指定的项目,严禁读取其他项目。
|
||
---
|
||
|
||
# Zotero Citation Skill
|
||
|
||
Use this skill when the user needs citations from a specific Zotero KB project while writing.
|
||
|
||
## Constraints
|
||
|
||
- **ONLY** read the project explicitly specified by the user.
|
||
- NEVER guess a project_id. If the user does not provide one, ask for it.
|
||
- NEVER read other projects' indexes unless the user explicitly asks.
|
||
|
||
## Workflow
|
||
|
||
1. **Get project_id** from the user if not provided.
|
||
2. **Read** `workspace/projects/{project_id}/project.json` to confirm the project exists and get its name.
|
||
3. **Read** `workspace/projects/{project_id}/project-index.json` to get all cards in the project.
|
||
4. **Build context** from the cards:
|
||
- title, summary, claims, citations, quotable_spans, attachments
|
||
- creator names and publication year (from `items` array)
|
||
5. **Analyze the user's writing context** (the sentence/paragraph/section they are working on).
|
||
6. **Recommend 1–5 most relevant citations** from the project's cards only.
|
||
7. **Format the response** in Chinese (matching the card language if it is zh).
|
||
|
||
## Output Format
|
||
|
||
For each recommended citation, provide:
|
||
|
||
```
|
||
### 推荐引用 {n}
|
||
- **文献标题**: {title}
|
||
- **作者**: {creators}
|
||
- **年份**: {year}
|
||
- **item_key**: {item_key}(用于插入引用标记)
|
||
- **相关性说明**: {why this card matches the writing context}
|
||
- **可用论点**: {1–2 key claims from the card}
|
||
- **可直接引用的原文**: {quotable_spans if any}
|
||
- **建议的修辞角色**: {supporting evidence / counterpoint / background / methodological reference / etc.}
|
||
- **引用建议**: {a concrete suggestion for how to weave this citation into the user's text}
|
||
```
|
||
|
||
If no relevant card is found, state clearly that the current project does not contain matching literature, and suggest either:
|
||
- broadening the writing topic, or
|
||
- importing more items into the project.
|
||
|
||
## Cardinal Rule
|
||
|
||
> The user has curated this project for a reason. Do NOT suggest citations from outside the project index, even if you know the literature personally.
|