Reference Style Sync
One-click synchronization and standardization of reference formats in literature management tools, intelligently fixing metadata errors.
When to Use
- - Use this skill when the task needs One-click synchronization and standardization of reference formats in literature management tools, intelligently fixing metadata errors.
- Use this skill for academic writing tasks that require explicit assumptions, bounded scope, and a reproducible output format.
- Use this skill when you need a documented fallback path for missing inputs, execution errors, or partial evidence.
Key Features
See ## Features above for related details.
- - Scope-focused workflow aligned to: One-click synchronization and standardization of reference formats in literature management tools, intelligently fixing metadata errors.
- Packaged executable path(s):
scripts/main.py. - Reference material available in
references/ for task-specific guidance. - Structured execution path designed to keep outputs consistent and reviewable.
Dependencies
See ## Prerequisites above for related details.
- -
Python: 3.10+. Repository baseline for current packaged skills. - INLINECODE6 :
unspecified. Declared in requirements.txt.
Example Usage
See ## Usage above for related details.
CODEBLOCK0
Example run plan:
- 1. Confirm the user input, output path, and any required config values.
- Edit the in-file
CONFIG block or documented parameters if the script uses fixed settings. - Run
python scripts/main.py with the validated inputs. - Review the generated output and return the final artifact with any assumptions called out.
Implementation Details
See ## Workflow above for related details.
- - Execution model: validate the request, choose the packaged workflow, and produce a bounded deliverable.
- Input controls: confirm the source files, scope limits, output format, and acceptance criteria before running any script.
- Primary implementation surface:
scripts/main.py. - Reference guidance:
references/ contains supporting rules, prompts, or checklists. - Parameters to clarify first: input path, output path, scope filters, thresholds, and any domain-specific constraints.
- Output discipline: keep results reproducible, identify assumptions explicitly, and avoid undocumented side effects.
Quick Check
Use this command to verify that the packaged script entry point can be parsed before deeper execution.
CODEBLOCK1
Audit-Ready Commands
Use these concrete commands for validation. They are intentionally self-contained and avoid placeholder paths.
CODEBLOCK2
Workflow
- 1. Confirm the user objective, required inputs, and non-negotiable constraints before doing detailed work.
- Validate that the request matches the documented scope and stop early if the task would require unsupported assumptions.
- Use the packaged script path or the documented reasoning path with only the inputs that are actually available.
- Return a structured result that separates assumptions, deliverables, risks, and unresolved items.
- If execution fails or inputs are incomplete, switch to the fallback path and state exactly what blocked full completion.
Overview
Reference Style Sync can:
- - Automatically detect and fix erroneous metadata scraped in Zotero/EndNote
- Unify literature formats to standard citation styles (APA, MLA, AMA, Vancouver, etc.)
- Batch process entire literature libraries
- Intelligently complete missing fields (DOI, page numbers, volume/issue, etc.)
- Detect duplicate entries and merge them
Supported Literature Management Tools
- - Zotero: Supports RDF, BibTeX, CSL JSON, RIS format export
- EndNote: Supports XML, RIS, BibTeX format export
- Universal Formats: BibTeX, RIS, CSV, JSON
Features
🔧 Metadata Repair
- - Author name format standardization
- Journal name abbreviation/full name unification
- DOI format validation and completion
- Page number format normalization
- Date format unification
🎨 Format Sync
- - Batch conversion to target citation format
- Field order standardization
- Punctuation unification
- Case normalization
🔍 Quality Check
- - Missing field detection
- Duplicate entry identification
- Invalid DOI/URL marking
- Journal name spell checking
Usage
Command Line Interface
CODEBLOCK3
Python API
CODEBLOCK4
Parameter Description
| Parameter | Type | Default | Description |
|---|
| INLINECODE15 | str | Required | Input file path (.bib, .ris, .json, .xml) |
| INLINECODE16 |
str | Required | Output file path |
|
--style | str | ama | Target format: apa, mla, ama, vancouver, chicago |
|
--fix-metadata | bool | False | Enable metadata repair |
|
--deduplicate | bool | False | Detect and merge duplicate entries |
|
--check-only | bool | False | Check only, no output |
|
--format | str | auto | Input format auto-detect or specify |
Repair Rules
Author Names
CODEBLOCK5
Journal Names
CODEBLOCK6
DOI
CODEBLOCK7
Page Numbers
CODEBLOCK8
Output Example
Before Repair (Zotero Export)
CODEBLOCK9
After Repair (AMA Format)
CODEBLOCK10
Technical Details
Difficulty: Medium
Dependencies: Python 3.8+, regex, titlecase
Data Processing: Supports 10000+ entries batch processing
Supported Citation Formats
- - AMA: American Medical Association (11th Edition)
- APA: American Psychological Association (7th Edition)
- MLA: Modern Language Association (9th Edition)
- Vancouver: ICMJE Recommended Format
- Chicago: Chicago Manual of Style (17th Edition)
- IEEE: Institute of Electrical and Electronics Engineers
Error Handling
- - If required inputs are missing, state exactly which fields are missing and request only the minimum additional information.
- If the task goes outside the documented scope, stop instead of guessing or silently widening the assignment.
- If
scripts/main.py fails, report the failure point, summarize what still can be completed safely, and provide a manual fallback. - Do not fabricate files, citations, data, search results, or execution outcomes.
Notes
- 1. It is recommended to backup the original library before processing
- Metadata repair is based on built-in rule library; complex cases may require manual review
- Journal abbreviations follow ISO 4 standard
- DOI validation uses regex patterns, does not actually resolve and verify
Risk Assessment
| Risk Indicator | Assessment | Level |
|---|
| Code Execution | Python/R scripts executed locally | Medium |
| Network Access |
No external API calls | Low |
| File System Access | Read input files, write output files | Medium |
| Instruction Tampering | Standard prompt guidelines | Low |
| Data Exposure | Output files saved to workspace | Low |
Security Checklist
- - [ ] No hardcoded credentials or API keys
- [ ] No unauthorized file system access (../)
- [ ] Output does not expose sensitive information
- [ ] Prompt injection protections in place
- [ ] Input file paths validated (no ../ traversal)
- [ ] Output directory restricted to workspace
- [ ] Script execution in sandboxed environment
- [ ] Error messages sanitized (no stack traces exposed)
- [ ] Dependencies audited
Prerequisites
CODEBLOCK11
Evaluation Criteria
Success Metrics
- - [ ] Successfully executes main functionality
- [ ] Output meets quality standards
- [ ] Handles edge cases gracefully
- [ ] Performance is acceptable
Test Cases
- 1. Basic Functionality: Standard input → Expected output
- Edge Case: Invalid input → Graceful error handling
- Performance: Large dataset → Acceptable processing time
Lifecycle Status
- - Current Stage: Draft
- Next Review Date: 2026-03-06
- Known Issues: None
- Planned Improvements:
- Performance optimization
- Additional feature support
Output Requirements
Every final response should make these items explicit when they are relevant:
- - Objective or requested deliverable
- Inputs used and assumptions introduced
- Workflow or decision path
- Core result, recommendation, or artifact
- Constraints, risks, caveats, or validation needs
- Unresolved items and next-step checks
Input Validation
This skill accepts requests that match the documented purpose of reference-style-sync and include enough context to complete the workflow safely.
Do not continue the workflow when the request is out of scope, missing a critical input, or would require unsupported assumptions. Instead respond:
INLINECODE24 only handles its documented workflow. Please provide the missing required inputs or switch to a more suitable skill.
References
Response Template
Use the following fixed structure for non-trivial requests:
- 1. Objective
- Inputs Received
- Assumptions
- Workflow
- Deliverable
- Risks and Limits
- Next Checks
If the request is simple, you may compress the structure, but still keep assumptions and limits explicit when they affect correctness.
参考文献格式同步
一键同步和标准化文献管理工具中的参考文献格式,智能修复元数据错误。
使用时机
- - 当任务需要一键同步和标准化文献管理工具中的参考文献格式,并智能修复元数据错误时使用此技能。
- 用于需要明确假设、限定范围以及可复现输出格式的学术写作任务。
- 当需要为缺失输入、执行错误或部分证据提供有记录的备用方案时使用此技能。
主要特性
详见上方## 特性部分的相关说明。
- - 聚焦范围的工作流程,对齐目标:一键同步和标准化文献管理工具中的参考文献格式,智能修复元数据错误。
- 打包的可执行路径:scripts/main.py。
- 参考资料位于references/目录,提供任务特定指导。
- 结构化执行路径,确保输出一致且可审查。
依赖项
详见上方## 先决条件部分的相关说明。
- - Python:3.10+。当前打包技能的仓库基线。
- dataclasses:未指定版本。在requirements.txt中声明。
使用示例
详见上方## 用法部分的相关说明。
bash
cd 20260318/scientific-skills/Academic Writing/reference-style-sync
python -m py_compile scripts/main.py
python scripts/main.py --help
示例运行计划:
- 1. 确认用户输入、输出路径以及任何必需的配置值。
- 如果脚本使用固定设置,编辑文件内的CONFIG块或文档化参数。
- 使用验证后的输入运行python scripts/main.py。
- 审查生成的输出,并返回最终产物,同时注明所有假设。
实现细节
详见上方## 工作流程部分的相关说明。
- - 执行模型:验证请求,选择打包的工作流程,并生成限定范围的可交付成果。
- 输入控制:在运行任何脚本之前,确认源文件、范围限制、输出格式和验收标准。
- 主要实现界面:scripts/main.py。
- 参考指导:references/目录包含支持性规则、提示或检查清单。
- 需优先明确的参数:输入路径、输出路径、范围过滤器、阈值以及任何领域特定的约束。
- 输出规范:保持结果可复现,明确标识假设,避免未记录的副作用。
快速检查
在深入执行之前,使用此命令验证打包脚本入口点是否可解析。
bash
python -m py_compile scripts/main.py
审计就绪命令
使用这些具体命令进行验证。它们特意保持自包含,避免使用占位符路径。
bash
python -m py_compile scripts/main.py
python scripts/main.py --help
python scripts/main.py -h
工作流程
- 1. 在进行详细工作之前,确认用户目标、必需输入和不可协商的约束条件。
- 验证请求是否与文档化范围匹配,如果任务需要不支持的假设,则提前停止。
- 仅使用实际可用的输入,使用打包脚本路径或文档化的推理路径。
- 返回结构化结果,区分假设、可交付成果、风险和未解决项。
- 如果执行失败或输入不完整,切换到备用方案,并准确说明阻止完整完成的原因。
概述
参考文献格式同步可以:
- - 自动检测并修复从Zotero/EndNote抓取的错误元数据
- 将文献格式统一为标准引文格式(APA、MLA、AMA、Vancouver等)
- 批量处理整个文献库
- 智能补全缺失字段(DOI、页码、卷/期等)
- 检测重复条目并合并
支持的文献管理工具
- - Zotero:支持RDF、BibTeX、CSL JSON、RIS格式导出
- EndNote:支持XML、RIS、BibTeX格式导出
- 通用格式:BibTeX、RIS、CSV、JSON
特性
🔧 元数据修复
- - 作者姓名格式标准化
- 期刊名称缩写/全称统一
- DOI格式验证与补全
- 页码格式规范化
- 日期格式统一
🎨 格式同步
- - 批量转换为目标引文格式
- 字段顺序标准化
- 标点符号统一
- 大小写规范化
🔍 质量检查
- - 缺失字段检测
- 重复条目识别
- 无效DOI/URL标记
- 期刊名称拼写检查
用法
命令行界面
text
处理单个文件
python scripts/main.py --input library.bib --output fixed.bib --style apa
修复元数据并转换为AMA格式
python scripts/main.py --input zotero.rdf --output fixed.ris --style ama --fix-metadata
批量处理并检测重复
python scripts/main.py --input library.json --output cleaned.json --deduplicate --style vancouver
仅进行质量检查
python scripts/main.py --input library.bib --check-only
Python API
python
from scripts.main import ReferenceSync
初始化
sync = ReferenceSync()
加载文献库
sync.load(library.bib)
修复元数据
sync.fix_metadata()
转换为目标格式
sync.convert
style(targetstyle=apa)
导出
sync.export(output.bib)
参数说明
| 参数 | 类型 | 默认值 | 说明 |
|---|
| --input | str | 必需 | 输入文件路径(.bib, .ris, .json, .xml) |
| --output |
str | 必需 | 输出文件路径 |
| --style | str | ama | 目标格式:apa, mla, ama, vancouver, chicago |
| --fix-metadata | bool | False | 启用元数据修复 |
| --deduplicate | bool | False | 检测并合并重复条目 |
| --check-only | bool | False | 仅检查,不输出 |
| --format | str | auto | 输入格式自动检测或指定 |
修复规则
作者姓名
python
修复前
Smith, John, Doe, Jane M.
Smith J., Doe J.M.
修复后(AMA格式)
Smith J, Doe JM.
期刊名称
python
修复前
journal of the american medical association
J. Am. Med. Assoc.
修复后
JAMA
DOI
python
修复前
www.doi.org/10.1234/example
doi:10.1234/example
10.1234/example
修复后
doi:10.1234/example
页码
python
修复前
123-127
123 -- 127
123–127
修复后
123-127
输出示例
修复前(Zotero导出)
@article{smith2020,
author = {Smith, John and Doe, Jane M.},
title = {A Study of Something},
journal = {journal of clinical medicine},
year = {2020},
volume = {15},
pages = {123-127},
doi = {10.1234/example}
}
修复后(AMA格式)
@article{smith2020,
author = {Smith J, Doe JM},
title = {A Study of Something},
journal = {J Clin Med},
year = {2020},
volume = {15},
pages = {123-127},
doi = {doi:10.1234/example}
}
技术细节
难度:中等
依赖项:Python 3.8+, regex, titlecase
数据处理:支持10000+条目的批量处理
支持的引文格式
- - AMA:美国医学会(第11版)
- APA:美国心理学会(第7版)
- MLA:现代语言协会(第9版)
- Vancouver:ICMJE推荐格式
- Chicago:芝加哥格式手册(第17版)
- IEEE:电气电子工程师学会
错误处理
- - 如果缺少必需输入,准确说明哪些字段缺失,并仅请求最少量的额外信息。
- 如果任务超出文档化范围,停止执行,而不是猜测或静默扩大任务范围。
- 如果scripts/main.py执行失败,报告失败点,总结仍可安全完成的内容,并提供手动备用方案。
- 不得伪造文件、引文、数据、搜索结果或执行结果。
注意事项
- 1. 建议在处理前备份原始文献库
- 元数据修复基于内置规则库;复杂情况可能需要人工审核
- 期刊缩写遵循ISO 4标准
- DOI验证使用正则表达式模式,不实际解析和验证
风险评估
| 风险指标 | 评估 | 等级 |
|---|
| 代码执行 | Python/R脚本在本地执行 | 中 |
| 网络访问 |
无外部API