科研 Skill
研究复制包架构设计
reproducibility-architect
把研究整理成可重跑的复制包,涵盖专案结构、环境锁定、资料可用性声明与AI使用揭露。投稿要求交复制包时使用。
SKILL.md
可重現性與複製包架構師(Reproducibility Architect)
Step 1|可重現的專案結構(地基)
固定骨架,讓 replicator 一眼看懂:
project/
├── README.md # replicator 指南(見 Step 5)
├── run_all.R / run_all.py # master script:一鍵從 raw 跑到 output
├── renv.lock / requirements.txt # 環境鎖定
├── data/
│ ├── raw/ # 原始資料,唯讀,絕不被程式改寫
│ └── derived/ # 程式產生的中間檔(可由 raw 重建,不進版本庫)
├── code/
│ ├── 01_clean.R
│ ├── 02_integrate.R # 多源整合(接 multi-source-data-integrator)
│ ├── 03_analysis.R
│ └── 04_tables_figures.R
└── output/
├── tables/ # 每個檔對應論文某表
└── figures/ # 每個檔對應論文某圖
鐵律:raw 唯讀(所有清理輸出到 derived);輸出檔名對應論文表號圖號 (reviewer 追得到「表 4 是哪支程式產的」);master script 按序呼叫,中途不需手動介入。
Step 2|計算環境捕捉(別人跑得出來的關鍵)
- R:
renv::init()→renv::snapshot()產renv.lock(鎖定套件版本); replicatorrenv::restore()還原。 - Python:
pip freeze > requirements.txt或 condaenvironment.yml; 進階用 Docker 鎖 OS 層(頂刊複製包漸增)。 - 亂數種子:所有 bootstrap/模擬/隨機分派設固定 seed,寫在 master script 開頭。
- 版本聲明:R/Python 版本、作業系統、關鍵套件版本寫進 README—— 計量套件(如 did、fixest)更新可能改變結果,版本是可重現的一部分。
- 路徑:一律相對路徑(用 here::here / Path);絕不硬編本機絕對路徑 (別人的電腦沒有你家目錄的絕對路徑)。
Step 2b|可重現報告層:Quarto(把「程式→表圖→文字」縫成一份可重跑的原始檔)
複製包能重跑出表圖只是一半;頂刊資料編輯越來越常問「稿件裡的數字是從哪個輸出貼過來的」。 Quarto(.qmd)讓程式、圖表與正文住在同一份原始檔,render 時重算——論文裡的每個數字都有 可回溯的程式碼塊,直接消滅手動搬數字的貼錯風險。
- 何時用:投稿要交複製包且稿件含大量表圖;或審稿要求「換一個設定重跑全部結果」。 不用:純理論稿、或期刊只收 Word 且你已有穩定的表格直出流程(r-spss 的 modelsummary→docx)。
- 最小結構:
paper.qmd(正文+程式碼塊)+_quarto.yml(輸出格式、execute: freeze: auto凍結已算結果避免每次全跑)+references.bib。表格用gt/modelsummary、圖用ggplot2, 全部在程式碼塊內產生,不貼外部圖片。 - 輸出 Word 給期刊:
format: docx搭reference-doc: template.docx——模板裡先把正文樣式設好 中文標楷體、英數 Times New Roman(本家族字型紀律),render 出來的 docx 才會合規; 交付前仍照 D 檔第 5 節跑字型掃描,不因為是 Quarto 產的就免驗。 - 從 R Markdown/bookdown/xaringan 遷移:
quarto convert old.Rmd起手,YAML 與 chunk 選項語法 有差(#| echo: false取代{r, echo=FALSE}),遷移邏輯與官方 R 套件慣例以 posit-dev/skills 為權威來源(見ATTRIBUTION.md),本技能不重製其內容。 - 與 Step 1/2 的關係:
.qmd是 master script 的「敘事層」,環境仍由 renv 鎖;quarto render應能在乾淨環境從raw/一路跑到成品,否則它只是漂亮的筆記本、不是複製包。
Step 3|授權/受限資料的可重現困境(你的實際處境)
核心資料受授權(TEJ 等付費庫)不能散布時,可重現≠公開資料。滿足實質要求的階梯:
- 程式碼全公開 + 資料存取指引:公開所有程式碼,附「如何取得 TEJ 資料+ 本研究用的確切表/欄位/期間」的清單,讓有授權者能重建。這是最低標,多數頂刊接受。
- 合成/模擬資料:提供結構相同(欄位、型別、關聯)但數值為合成的假資料, 讓程式碼能跑通(驗證程式正確性,即使數字非真)。
- 可公開的中間結果:若授權允許,公開去識別的迴歸輸入(如已聚合、不可還原 原始的分析檔)。
- 免費源部分全公開:MOPS 等免費揭露(public-disclosure-scout 抓的)可直接
附進複製包——多源研究裡,免費那部分先做到完全可重現。
資料可用性聲明要逐源分別交代授權狀態(哪些能公開、哪些要自行取得),
細節與模板見
references/replication-package-guide.md。
Step 4|三份聲明(2026 投稿標配)
- 資料可用性聲明(Data Availability Statement):每個資料源的來源、授權、 取得方式;受限資料寫明「因授權不可公開,取得管道為…」。接 multi-source-data-integrator 的來源譜系表直接生成。
- 程式碼可用性聲明:公開庫連結(如 GitHub/OSF/Zenodo 附 DOI)。
- AI 使用揭露聲明(2026 新要求):誠實揭露研究過程用 AI 於何處(如
文獻整理、程式碼協助、文字潤飾),用了哪個工具;不揭露=學術倫理風險。
模板見
references/replication-package-guide.md。
Step 5|Replicator README(讓陌生人跑得動)
必含:計算環境與版本、預估執行時間與硬體需求、資料取得步驟(受限資料特別標注)、
一鍵指令(Rscript run_all.R)、輸出對應表(哪個輸出檔=論文哪張表/圖)、
已知問題與聯絡方式。在乾淨環境(或請同事)實跑一次才算完成——
「在我電腦能跑」不等於可重現。
Step 6|封存與 DOI
投稿/接受時把複製包存到可長期保存、可引用的平台(OSF、Zenodo、Harvard Dataverse), 取得 DOI 寫進論文。GitHub 不算長期封存(會變動),頂刊要 DOI 快照。
紅線
- raw 唯讀、相對路徑、固定 seed、鎖版本——四項缺一,複製包就不可重現。
- 受限資料不硬塞進公開庫(違授權);改用程式碼公開+存取指引+合成資料。
- AI 使用據實揭露,不隱瞞也不誇大。
- 「在我電腦能跑」不是可重現;沒在乾淨環境重跑過不宣稱完成。
- 本 skill 管「打包成可重跑」;分析語法本身找 r-spss/causal-inference, 多源整合找 multi-source-data-integrator,數字對帳找 thesis-consistency-audit。
Limitations
- Examples lean on Taiwan's TEJ database and Taiwan/Greater-China business-school conventions for licensed, non-redistributable data; the general replication-package structure (raw/read-only data, locked environment, master script, data-availability statement) applies more broadly, but field-specific advice may not.
- Written around R Markdown/Quarto and renv/conda; projects in other languages or environment managers will need to adapt the concrete commands.
示例提示词
投稿要交复制包,帮我设计可重现的项目结构和环境锁定方案。
所属插件
安装该插件会一并获得同领域的 54 个 Skill / MCP。
同插件的其他科研 Skill
- 智能体资源节约守则Applies token- and context-saving habits for tool choice, PDF handling, persistent memory, and privacy checks. Use at the start of sessions with many files or PDFs, or multi-session work.
- 英文论文双语精读器把英文论文转成中英对照精读档并生成离线双语阅读器,标注要点并输出读书笔记。精读单篇英文论文、要中英对照阅读时使用。
- 研究方法比较论证Compares quantitative, qualitative, and mixed research methods against what each can and cannot answer to build a methods table. Use when justifying a method choice in a thesis.
- 复杂系统分析方法Analyzes complex systems with power-law fitting, Hurst exponent, fractal dimension, agent-based modeling, and entropy measures. Use for nonlinear or complex-system data.
- 研究环境容器化部署Builds Docker and Singularity containers for reproducible computation and HPC deployment of research environments. Use when packaging an analysis pipeline for reuse or HPC.
- DVC数据版本管理Sets up DVC for dataset and pipeline versioning, remote storage, and experiment comparison in reproducible ML research workflows. Use when tracking large datasets or ML experiment runs.
- 期刊级统计图表绘制Creates publication-quality multi-panel figures with matplotlib, seaborn, or ggplot2 using colorblind-safe palettes and journal export settings. Use when preparing figures for a paper.
- 综述模块拆解规划Breaks a refined literature-review question into 3-5 non-overlapping modules to build a reading map, outline, or search plan. Use when structuring a literature review.
- 学位论文答辩教练模拟学位口试委员提问并提供承认回应证据三段式答辩框架与模拟问答。准备论文口试或研讨会问答环节时使用。
- 实验设计与样本量规划Designs rigorous experiments covering sample-size calculation, randomization strategy, pre-registration, and A/B test duration estimation. Use when planning an experiment or A/B test.
- 管理实验设计架构为管理与商学情境实验规划组间组内设计、对抗平衡与操弄检核,并产出设计书与情境材料模板。做商学实验设计时使用。
- 科研经费申请撰写Structures research grant proposals including NSF/NIH Specific Aims, budget justification, ERC narrative sections, and biosketch formatting. Use when drafting a funding application.
- 人类可读文档撰写规范Guides writing human-facing docs like README, PLAN, survey notes, and reviewer-response drafts with a clear two-tier structure. Use for text a human collaborator will read.
- 知识图谱与SPARQL检索Builds knowledge graphs and runs SPARQL queries over RDF and Wikidata for entity linking in research and library data. Use when modeling research entities as a linked graph.
- LaTeX论文写作与排版Writes, compiles, and submits LaTeX papers covering IMRaD structure, key packages, bibliography management, and arXiv preparation. Use when authoring or debugging a LaTeX manuscript.
- 文献比较矩阵构建器把一批PDF整理成含撤稿查核与APA7书目的文献资料库,并生成横向比较矩阵表。整理综述前要比较文献时使用。
- 跨库学术文献检索Searches OpenAlex, Semantic Scholar, and arXiv for academic literature with deduplication, citation snowballing, and BibTeX export. Use when collecting papers for a review or topic.
- 文献调研语料库维护Finds, verifies, and maintains a literature corpus from arXiv, OpenAlex, Crossref, and related databases with BibTeX entries and per-paper notes. Use when sourcing references for a paper.
- 文献综述研究缺口定位Converts a literature-review synthesis into a concrete, defensible research gap and future-research direction. Use when writing a conclusion or thesis contribution section.
- 文献矛盾结论梳理Analyzes conflicting findings across papers and explains disagreement by sample, method, or context differences for a stronger synthesis. Use when review sources disagree.
- 效应量汇总元分析Pools effect sizes across studies with fixed and random-effects models, heterogeneity tests, forest and funnel plots, and subgroup analysis. Use to synthesize quantitative study results.
- 缺失数据处理Diagnoses missing-data mechanisms such as MCAR, MAR, or MNAR and applies multiple imputation or deletion with sensitivity analysis. Use when a dataset has missing values.
- 混合方法研究设计Designs mixed-methods studies integrating qualitative coding, triangulation, content analysis, and QCA with inter-rater reliability checks. Use when combining qual and quant data.
- 科研机器学习流程Applies machine learning to research questions with scikit-learn pipelines, AutoML, SHAP explainability, and nested cross-validation. Use when building a predictive model for a study.
常见问题
研究复制包架构设计能做什么?
把研究整理成可重跑的复制包,涵盖专案结构、环境锁定、资料可用性声明与AI使用揭露。投稿要求交复制包时使用。
如何安装研究复制包架构设计?
在科搭 Codar 左侧点击「插件」,在「组件」页签搜索「研究复制包架构设计」并安装;在 Claude Code 或 Codex 中可以发送本页的安装提示词,或下载 Skill 包后解压到 ~/.claude/skills 或 ~/.codex/skills。
研究复制包架构设计需要哪些权限?
该科研 Skill没有声明额外权限;执行具体操作时仍由 Agent 按自身规则请求确认。
研究复制包架构设计经过官方审核吗?
是。SpeedSkills 收录的每个版本都会记录内容摘要与权限声明,当前版本已通过安全审核。