6.9 KiB
MYwrite
Use this skill for the user's Zotero + Obsidian literature workflow. It covers Zotero child-note generation, deterministic audits, Obsidian literature-note maintenance, Dataview dashboards, and safe packaging/backups.
Core scripts:
py "$env:USERPROFILE\.codex\skills\MYwrite\scripts\init_private_config.py"
py "$env:USERPROFILE\.codex\skills\MYwrite\scripts\generate_zotero_ai_note.py" --vault "C:\Users\qyh15\Documents\Obsidian Vault" --item-key SXAIQUJT --skip-existing
py "$env:USERPROFILE\.codex\skills\MYwrite\scripts\audit_zotero_ai_notes.py" --vault "C:\Users\qyh15\Documents\Obsidian Vault" --keys-only
Requirements
- Zotero Desktop must be open and Local API enabled at
http://127.0.0.1:23119. - The vault default is
C:\Users\qyh15\Documents\Obsidian Vault. - The vault must contain
00 Templaterwith:01 ...mdresearch-article template02 ...mdreview-article template03 ...mdAI prompt
ZOTERO_API_KEYmust be available for Zotero Web API writes.- LLM settings come from
AWESOMEGPT_API_KEY,AWESOMEGPT_BASE_URL,AWESOMEGPT_MODEL, the private local config, or AwesomeGPT preferences in the default Zotero profile.
Never store API keys in SKILL.md, references, committed files, zip files, terminal output, or chat. If keys appear in chat or logs, tell the user to rotate them.
Private Config
Use a local-only config for Zotero and DeepSeek/AwesomeGPT keys. The committed template is config/config.template.json; the real file is config/config.local.json, which is ignored by Git.
Initialize or update it with hidden prompts:
py "$env:USERPROFILE\.codex\skills\MYwrite\scripts\init_private_config.py"
Do not print the config contents. When checking setup, report only whether each key is present. Environment variables override the private config; the private config overrides AwesomeGPT preferences for fields that are present.
Zotero Note Workflows
Single item
py "$env:USERPROFILE\.codex\skills\MYwrite\scripts\generate_zotero_ai_note.py" --vault "C:\Users\qyh15\Documents\Obsidian Vault" --item-key SXAIQUJT --skip-existing
Deep full-detail item
Use this when the user asks for 满血版本, 详细版, 深度精读, or says the batch note is not as detailed as manually generated AwesomeGPT notes. Do not use --skip-existing when the user wants to regenerate a fuller note; create a new Zotero child note unless the user explicitly asks to delete old notes.
py "$env:USERPROFILE\.codex\skills\MYwrite\scripts\generate_zotero_ai_note.py" --vault "C:\Users\qyh15\Documents\Obsidian Vault" --item-key SXAIQUJT --mode deep --fulltext-chars 80000 --max-tokens 12000
Multiple items
py "$env:USERPROFILE\.codex\skills\MYwrite\scripts\generate_zotero_ai_note.py" --vault "C:\Users\qyh15\Documents\Obsidian Vault" --item-keys "SXAIQUJT X7GJZ627 ZCZXGRAM" --limit 0 --skip-existing --fulltext-chars 4000
Whole library
Use only after the user explicitly approves library-wide writes.
py "$env:USERPROFILE\.codex\skills\MYwrite\scripts\generate_zotero_ai_note.py" --vault "C:\Users\qyh15\Documents\Obsidian Vault" --all --limit 0 --skip-existing --fulltext-chars 4000
For long runs, prefer 20-30 item batches. If a run times out, rerun with --skip-existing; the script resumes by checking child notes for the source Zotero item link.
Missing generated notes
Do this deterministically; do not ask DeepSeek or another LLM to compare library state.
py "$env:USERPROFILE\.codex\skills\MYwrite\scripts\audit_zotero_ai_notes.py" --vault "C:\Users\qyh15\Documents\Obsidian Vault" --rebuild
py "$env:USERPROFILE\.codex\skills\MYwrite\scripts\audit_zotero_ai_notes.py" --vault "C:\Users\qyh15\Documents\Obsidian Vault" --keys-only
The cache lives at <vault>\00 Templater\.zotero-ai-notes-index.json. Use --refresh or --rebuild when notes were edited outside this workflow.
Obsidian Workflows
Read references/obsidian-integration.md before changing template handling, adding vault-facing files, or generating Markdown meant to round-trip through Obsidian.
Read references/obsidian-literature-maintenance.md before cleaning empty notes, creating Dataview dashboards, adding CSS snippets, or changing the 01 文献阅读 organization.
Default vault organization:
00 Templater: source templates, prompts, and the hidden Zotero audit cache.01 文献阅读/00 AI总结笔记: Obsidian-exported/generated literature notes.01 文献阅读/01 Dataview文献看板: Dataview dashboards for journal, year, actuator, review, DOI, and material/keyword views..obsidian/snippets/literature-dataview.css: optional CSS snippet for compact Dataview tables.
Operating Rules
- For live Zotero writes, state that Zotero child notes will be created.
- Use
--dry-runfor first-time validation or template changes. - Use
--fulltext-chars 4000for cheap, lightweight notes; use--mode deep --fulltext-chars 80000 --max-tokens 12000when the user asks for a full-detail note. - Do not add visible machine markers to note bodies. Use the Zotero item link for duplicate detection.
- Do not delete Zotero duplicate notes unless the user explicitly requests cleanup.
- For Obsidian cleanup, delete only files that are empty after removing frontmatter, separators, whitespace, and empty HTML placeholders.
- Keep Dataview dashboards readable: avoid
GROUP BYtables that put longrows.file.linklists inside one cell; prefer count summaries plus separate one-row-per-paper detail tables. - Reserve DeepSeek for generating or improving note content, not deterministic library comparison or file cleanup.
- If PowerShell/cmd output has Unicode issues, set
PYTHONIOENCODING=utf-8or rely on script UTF-8 reconfiguration. - If PDF full text is unavailable, allow fallback to metadata, abstract, BibTeX, and optional local PDF extraction if a Python PDF library exists.
Upgrade Points
Read references/upgrade-plan.md before changing behavior, adding cleanup, adding collection targeting, improving note quality, or adding Gitea/GitHub backup steps.
Read references/upstream-obsidian-skills.md before pulling in more ideas from kepano/obsidian-skills.