{"id":"b0f385bc-4a14-47d4-98ed-bdd3a5dc5762","entityType":"agent","slug":"clawhub-medstatstar-meta-analysis","name":"Meta Analysis / 医学Meta分析","canonicalUrl":"https://www.xpersona.co/agent/clawhub-medstatstar-meta-analysis","canonicalPath":"/agent/clawhub-medstatstar-meta-analysis","generatedAt":"2026-10-10T07:39:48.666Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"editorial-content","verified":true,"confidence":"high","updatedAt":"2026-10-09T20:31:28.629Z","emptyReason":null},"description":"Comprehensive R-based meta-analysis skill covering RevMan + Stata equivalents + esc + RVE + Bayesian NMA + survival meta + TSA + single-group meta + diagnostic meta + systematic review workflow; produces forest plots, funnel plots, heterogeneity (I²), publication bias, subgroup analysis, meta-regression, network meta, for a total of 23 analysis figures. All analyses ship reproducible R code. Can also provide meta topic-direction judgment + literature retrieval and organization + screening + data-extraction functionality. / 基于 R 的全方位 Meta 分析技能，覆盖 RevMan + Stata 等价 + esc + RVE + 贝叶斯 NMA + 生存 Meta + TSA + 单组率 Meta + 诊断 Meta + 系统评价流程；输出森林图、漏斗图、异质性(I²)、发表偏倚、亚组分析、元回归、网络 Meta等共 23 种分析图形。所有分析提供可复现 R 代码。还可提供Meta选题方向判断 + 文献检索整理 + 筛选 + 数据提取功能。 Skill: Meta Analysis / 医学Meta分析 Owner: medstatstar Summary: Comprehensive R-based meta-analysis skill covering RevMan + Stata equivalents + esc + RVE + Bayesian NMA + survival meta + TSA + single-group meta + diagnostic meta + systematic review workflow; produces forest plots, funnel plots, heterogeneity (I²), publication bias, subgroup analysis, meta-regression, network meta, for a total of 23 analysis figures. All","descriptionLabel":"Technical summary","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 2K downloads reported by the source. Last updated 10/9/2026.","installCommand":"clawhub skill install s176fv8983h1rte6dmxwp9wt4n89j8p5:meta-analysis","sourceUrl":"https://clawhub.ai/medstatstar/meta-analysis","homepage":"https://clawhub.ai/medstatstar/skills/meta-analysis","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/medstatstar/meta-analysis","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/medstatstar/skills/meta-analysis","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":66,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"Comprehensive R-based meta-analysis skill covering RevMan + Stata equivalents + esc + RVE + Bayesian NMA + survival meta + TSA + single-group meta + diagnostic "},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-09T20:31:28.629Z","emptyReason":null},"protocols":[{"protocol":"OPENCLEW","label":"OpenClaw","status":"self-declared","notes":"Declared in the public agent profile."}],"capabilities":[],"verifiedCount":0,"selfDeclaredCount":1,"capabilityMatrix":{"rows":[{"key":"OPENCLEW","type":"protocol","support":"unknown","confidenceSource":"profile","notes":"Listed on profile"}],"flattenedTokens":"protocol:OPENCLEW|unknown|profile"}},"adoption":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-09T20:31:28.629Z","emptyReason":null},"stars":null,"forks":null,"downloads":2023,"packageName":null,"latestVersion":"2.20.1","tractionLabel":"2K downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-09T20:31:28.442Z","emptyReason":null},"lastUpdatedAt":"2026-10-09T20:31:28.629Z","lastCrawledAt":"2026-10-09T20:31:28.442Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-10T20:31:28.442Z","lastVerifiedAt":null,"highlights":[{"version":"2.20.1","createdAt":"2026-10-09T12:22:07.882Z","changelog":"v2.20.1: fix workbench quick-channel 504; unify skillname persistence; enhance i18n dictionary and localization; sync bilingual READMEs.","fileCount":188,"zipByteSize":1330646},{"version":"2.20.0","createdAt":"2026-09-27T04:56:32.766Z","changelog":"End-to-end meta-analysis pipeline: topic assessment, literature retrieval & screening, data extraction, 23 statistical analyses, RoB 2.0/AMSTAR-2/GRADE quality appraisal, structured manuscript drafting, and journal submission advice","fileCount":188,"zipByteSize":1309469},{"version":"2.2.30","createdAt":"2026-08-29T02:45:39.225Z","changelog":"coze return payload restructure: full JSON externalized as single S3 file (aligned with ct-base §20.8); inline trimmed copy (<4000); local _fetch_full_json prefers _coze_full; integrated test 27/27 PASS","fileCount":79,"zipByteSize":360405},{"version":"2.2.27","createdAt":"2026-08-28T14:33:35.404Z","changelog":"coze 并发限流(相邻≥1s, 写入 ct-base §20.10); 修复 classify 全角括号致亚组失效; 质量评估卡两列对齐; 契约漂移合并单入口 _assess_contract 且提示收敛到 HTML 横幅唯一出口; 端点回退提示同样收敛 HTML 横幅; SKILL.md 正文中文按 ct-base 全英文规范翻译","fileCount":78,"zipByteSize":349722},{"version":"2.2.16","createdAt":"2026-08-27T08:56:32.752Z","changelog":"统一版本号至 2.2.16；loo/cumulative 原始连续列桥接修复在 coze 云端端到端生效","fileCount":79,"zipByteSize":334761},{"version":"2.1.9","createdAt":"2026-08-26T14:22:20.247Z","changelog":"图形支持增加到23种","fileCount":72,"zipByteSize":317959},{"version":"2.1.5","createdAt":"2026-08-26T06:04:27.508Z","changelog":"Release v2.1.5: unify version across SKILL.md/README/CHANGELOG/metadata.openclaw; exclude meta_analysis/ from distribution; compress SKILL.md to <=200 lines; redesign logo (funnel + forest plot + summary diamond)","fileCount":72,"zipByteSize":298372},{"version":"2.1.1","createdAt":"2026-08-25T09:19:29.957Z","changelog":"Cross-turn continuity protocol (S5.1) inlined in English with ct-base dead refs removed; Language section standardized to ct-base skeleton; merge_spec promoted to shared script and injected; doc cleanup finalized; version unified 2.1.1 across GitHub/SkillHub/ClawHub","fileCount":72,"zipByteSize":290715}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s176fv8983h1rte6dmxwp9wt4n89j8p5:meta-analysis","setupComplexity":"low","setupSteps":["Setup complexity is classified as HIGH. You must provision dedicated cloud infrastructure or an isolated VM. Do not run this directly on your local workstation.","Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data."],"contract":{"contractStatus":"missing","authModes":[],"requires":[],"forbidden":[],"supportsMcp":false,"supportsA2a":false,"supportsStreaming":false,"inputSchemaRef":null,"outputSchemaRef":null,"dataRegion":null,"contractUpdatedAt":null,"sourceUpdatedAt":null,"freshnessSeconds":null},"invocationGuide":{"preferredApi":{"snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-medstatstar-meta-analysis/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-medstatstar-meta-analysis/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-medstatstar-meta-analysis/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-medstatstar-meta-analysis/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-medstatstar-meta-analysis/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-medstatstar-meta-analysis/trust\""],"jsonRequestTemplate":{"query":"summarize this repo","constraints":{"maxLatencyMs":2000,"protocolPreference":["OPENCLEW"]}},"jsonResponseTemplate":{"ok":true,"result":{"summary":"...","confidence":0.9},"meta":{"source":"CLAWHUB","generatedAt":"2026-10-10T07:39:48.663Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-medstatstar-meta-analysis/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-medstatstar-meta-analysis/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-medstatstar-meta-analysis/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-medstatstar-meta-analysis/trust"}},"reliability":{"evidence":{"source":"runtime-metrics","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No trust, reliability, or runtime telemetry is available."},"trust":{"status":"unavailable","handshakeStatus":"UNKNOWN","verificationFreshnessHours":null,"reputationScore":null,"p95LatencyMs":null,"successRate30d":null,"fallbackRate":null,"attempts30d":null,"trustUpdatedAt":null,"trustConfidence":"unknown","sourceUpdatedAt":null,"freshnessSeconds":null},"decisionGuardrails":{"doNotUseIf":["Contract metadata is missing or unavailable for deterministic execution."],"safeUseWhen":[],"riskFlags":["missing_or_unavailable_contract","trust_data_unavailable","schema_references_missing"],"operationalConfidence":"low"},"executionMetrics":{"observedLatencyMsP50":null,"observedLatencyMsP95":null,"estimatedCostUsd":null,"uptime30d":null,"rateLimitRpm":null,"rateLimitBurst":null,"lastVerifiedAt":null,"verificationSource":null},"runtimeMetrics":{"successRate":null,"avgLatencyMs":null,"avgCostUsd":null,"hallucinationRate":null,"retryRate":null,"disputeRate":null,"p50Latency":null,"p95Latency":null,"lastUpdated":null}},"benchmarks":{"evidence":{"source":"no-benchmark-data","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No benchmark suites or observed failure patterns are available."},"suites":[],"failurePatterns":[]},"artifacts":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"high","updatedAt":"2026-10-09T20:31:28.629Z","emptyReason":null},"readme":"Skill: Meta Analysis / 医学Meta分析\n\nOwner: medstatstar\n\nSummary: Comprehensive R-based meta-analysis skill covering RevMan + Stata equivalents + esc + RVE + Bayesian NMA + survival meta + TSA + single-group meta + diagnostic meta + systematic review workflow; produces forest plots, funnel plots, heterogeneity (I²), publication bias, subgroup analysis, meta-regression, network meta, for a total of 23 analysis figures. All analyses ship reproducible R code. Can also provide meta topic-direction judgment + literature retrieval and organization + screening + data-extraction functionality. / 基于 R 的全方位 Meta 分析技能，覆盖 RevMan + Stata 等价 + esc + RVE + 贝叶斯 NMA + 生存 Meta + TSA + 单组率 Meta + 诊断 Meta + 系统评价流程；输出森林图、漏斗图、异质性(I²)、发表偏倚、亚组分析、元回归、网络 Meta等共 23 种分析图形。所有分析提供可复现 R 代码。还可提供Meta选题方向判断 + 文献检索整理 + 筛选 + 数据提取功能。\n\nTags: latest:2.20.1\n\nVersion history:\n\nv2.20.1 | 2026-10-09T12:22:07.882Z | user\n\nv2.20.1: fix workbench quick-channel 504; unify skillname persistence; enhance i18n dictionary and localization; sync bilingual READMEs.\n\nv2.20.0 | 2026-09-27T04:56:32.766Z | user\n\nEnd-to-end meta-analysis pipeline: topic assessment, literature retrieval & screening, data extraction, 23 statistical analyses, RoB 2.0/AMSTAR-2/GRADE quality appraisal, structured manuscript drafting, and journal submission advice\n\nv2.2.30 | 2026-08-29T02:45:39.225Z | user\n\ncoze return payload restructure: full JSON externalized as single S3 file (aligned with ct-base §20.8); inline trimmed copy (<4000); local _fetch_full_json prefers _coze_full; integrated test 27/27 PASS\n\nv2.2.27 | 2026-08-28T14:33:35.404Z | user\n\ncoze 并发限流(相邻≥1s, 写入 ct-base §20.10); 修复 classify 全角括号致亚组失效; 质量评估卡两列对齐; 契约漂移合并单入口 _assess_contract 且提示收敛到 HTML 横幅唯一出口; 端点回退提示同样收敛 HTML 横幅; SKILL.md 正文中文按 ct-base 全英文规范翻译\n\nv2.2.16 | 2026-08-27T08:56:32.752Z | user\n\n统一版本号至 2.2.16；loo/cumulative 原始连续列桥接修复在 coze 云端端到端生效\n\nv2.1.9 | 2026-08-26T14:22:20.247Z | user\n\n图形支持增加到23种\n\nv2.1.5 | 2026-08-26T06:04:27.508Z | user\n\nRelease v2.1.5: unify version across SKILL.md/README/CHANGELOG/metadata.openclaw; exclude meta_analysis/ from distribution; compress SKILL.md to <=200 lines; redesign logo (funnel + forest plot + summary diamond)\n\nv2.1.1 | 2026-08-25T09:19:29.957Z | user\n\nCross-turn continuity protocol (S5.1) inlined in English with ct-base dead refs removed; Language section standardized to ct-base skeleton; merge_spec promoted to shared script and injected; doc cleanup finalized; version unified 2.1.1 across GitHub/SkillHub/ClawHub\n\nv2.0.5 | 2026-08-24T11:42:03.565Z | user\n\nRelease 2.0.5: pre-release compliance fixes — SKILL.md restructured (9-section, English-only body), auto-execute mode (removed safe-preview), local engine internalized (not advertised), cleaned i18n legacy install.* keys, removed ct-base annotations from public docs, fixed SkillSpector disclosure mismatches, version 2.0.0 -> 2.0.5\n\nv2.0.0 | 2026-08-24T02:19:37.137Z | user\n\nv2.0.0 — coze-only cloud mode (ct-meta.coze.site/run): 46 Mode-B cases covering all 24 task types; add bug-report endpoint (ct-bugreport.coze.site/run); align metadata version\n\nv1.8.4 | 2026-08-02T12:11:47.185Z | user\n\nv1.8.4（平台版本 bump；技能版本保持 1.8.3）：将两个 README（英文+中文）的版本标识从 v1.8.0 对齐到 v1.8.3，与技能实际版本一致。无 R 引擎或行为变更。\n\nv1.8.3 | 2026-08-02T11:51:16.341Z | user\n\nv1.8.3：修正 AGENTS.md §4 安全红线中 'summary stats vs IPD' 信任边界矛盾的真实源头——澄清所有数据（含 IPD 个体患者数据）均本地处理你提供的文件、从不上传/外发；IPD 完全支持且同样本地处理。版本 1.8.1→1.8.3。\n\nv1.8.2 | 2026-08-02T11:39:40.223Z | user\n\n修正 ClawHub 页面显示标题（--name Meta Analysis），此前误显示为首次发布时的临时目录名 Meta Analysis Strip V180。无代码变更，版本号 bump 1.8.1→1.8.2 仅用于平台元数据更新。\n\nv1.8.1 | 2026-08-02T11:37:28.241Z | user\n\nv1.8.1（bump；ClawHub 不允许同版本覆盖）：用干净目录名 meta-analysis 重发修正 ClawHub 页面标题（原为 Meta Analysis Strip V180）；带上 v1.8.0 GitHub 文档对齐——英文 README 残留中文翻译、删除 Confidentiality Notice（消除 IPD 信任边界矛盾，符合非 ct 系列不加保密声明）、补 PDF 批量下载警告/触发词高摩擦说明/语言切换说明、SKILL.md Memory 读取限定。\n\nv1.8.0 | 2026-08-02T07:39:01.177Z | user\n\n优化用户菜单(UI)与 README：SKILL.md Triage 显式列出「③ 拿不准？→ 详细解释差异」路由菜单项；README Complex 弹出菜单 / Vague grill-me 示例更人性化。10 轮 bug 修复（Q1/D/E/F/G/H/I/J/K）落地 R 引擎。版本 1.8.0。\n\nv1.7.0 | 2026-07-19T09:23:02.635Z | user\n\nfeat: full bilingual EN/ZH auto-switching + SKILL.md bilingual normalization\n\nv1.6.0 | 2026-07-17T09:40:57.171Z | user\n\nv1.6: 新增重依赖封装(TSA/剂量反应/生存Meta/贝叶斯NMA); 修正虚构API(meta::tes剔除改用run_tsa, dosresmeta type参数修复); 文档标题全量双语化(英/中); SKILL.md精简重构(内容外移references/advanced_api.md+svg_editing.md); triggers精简24->15\n\nv1.5.2 | 2026-07-14T07:35:40.369Z | user\n\n修正 Local only 事实表述、收窄触发词、补充安装/下载/写文件警告；统一为模板化无 .R 版本\n\nv1.5.1 | 2026-07-13T09:15:25.025Z | user\n\n补齐 correlation/single_proportion/single_mean 三类数据入口 + 累积Meta(cumul) + 修复5个确凿bug(HK崩溃/亚组检验/协变量丢失/bubble方法/svglite漏装)\n\nv1.5.0 | 2026-07-13T07:41:48.428Z | user\n\n版本1.5.0：充实README、SVG编辑工具说明、5个代码质量修复、安全审计通过\n\nv1.0.2 | 2026-07-13T07:39:23.044Z | auto\n\n**Major expansion: Advanced meta-analysis modules and interactive workflow**\n\n- Added support for Bayesian network meta-analysis (Stan/JAGS), survival meta-analysis, trial sequential analysis (TSA), single-group rate/meta-mean, and diagnostic accuracy meta-analysis.\n- Introduced a new interactive menu system for guided workflows and clearer module selection.\n- Added comprehensive R code references/workflows for advanced topics (e.g., one-stage dose–response, multilevel/multivariate meta, PRISMA/review screening, robust variance estimation).\n- Expanded output to include results summaries and editable SVG/PNG plot exports, with detailed guidance for figure editing and manuscript preparation.\n- Updated and reorganized documentation for easier navigation; added in-depth reference guides for all new methods and workflows.\n\nv1.0.1 | 2026-07-12T10:28:14.169Z | auto\n\n- Updated README.md and README_ZH.md documentation.\n- No changes were made to the skill's code or functionality in this release.\n- Enhanced clarity and detail for users in reference and usage sections.\n\nv1.0.0 | 2026-07-12T10:22:20.832Z | auto\n\n- Initial release of the meta-analysis skill for R-based, comprehensive meta-analysis.\n- Supports all RevMan 5.x features as well as Stata metareg/mvmeta equivalents, effect size conversions, and advanced cluster-robust variance estimation.\n- Enables random/fixed-effect, multilevel/multivariate, network, and Bayesian meta-analyses, plus power analysis.\n- All steps output fully reproducible R code and publication-ready tables/plots; designed for both clinical and research professionals.\n- Input via templates, CSV/Excel, or effect-size formats, with validation checks built in.\n- Covers extensive triggers in both English and Chinese, and ensures local-only, secure processing.\n\nArchive index:\n\nArchive v2.20.1: 188 files, 1330646 bytes\n\nFiles: adapters/__init__.py (242b), adapters/block_a.py (179567b), adapters/block_b.py (58420b), adapters/block_c.py (87318b), adapters/bug_report.py (19805b), adapters/build_gap_probe.py (7316b), adapters/config.json (161b), adapters/coze_client.py (82472b), adapters/coze_contract_validate.py (36804b), adapters/coze_error_analyze.py (16044b), adapters/coze_integration_test.py (11749b), adapters/coze_token.py (8576b), adapters/ctsearch_client.py (27989b), adapters/deploy_retest.py (18729b), adapters/evidence_upload.py (40482b), adapters/features.py (3280b), adapters/fullflow.py (81802b), adapters/interpretation.py (26653b), adapters/literature_probe.py (32343b), adapters/llm_client.py (4248b), adapters/llm_loader.py (4535b), adapters/pdf_extractor.py (86632b), adapters/pdf_fetch.py (43272b), adapters/prospero_probe.py (5675b), adapters/publish_guard.py (2410b), adapters/pytest.ini (102b), adapters/quality_advice.py (21246b), adapters/README.md (6068b), adapters/ref_verify.py (17995b), adapters/registry_probe.py (5627b), adapters/render_case_report.py (3123b), adapters/rendering.py (75404b), adapters/req_test.json (754b), adapters/run_analysis.py (21475b), adapters/run_case_human.py (14679b), adapters/run_real_meta.py (2801b), adapters/seam_test.py (8545b), adapters/session_store.py (15099b), adapters/tool_mapping_meta.json (1548b), adapters/topic_assess.py (16820b), adapters/topic_translate.py (18215b), adapters/writing_advisor.py (39337b), AGENTS.md (16499b), assets/icon.svg (3533b), cases/case_catalog.json (54564b), cases/case_catalog.py (45990b), cases/case_prompt.md (3709b), cases/case_prompts_index.md (4632b), cases/case_studies_real.json (1286b), cases/case_studies.json (1438b), cases/extraction_templates/TPL-01_binary_2x2.xlsx (8225b), cases/extraction_templates/TPL-02_continuous_twoarm.xlsx (8253b), cases/extraction_templates/TPL-03_precalculated_effect.xlsx (8128b), cases/extraction_templates/TPL-04_rate_ratio_IRR.xlsx (7943b), cases/extraction_templates/TPL-05_correlation.xlsx (7775b), cases/extraction_templates/TPL-06_single_proportion.xlsx (7803b), cases/extraction_templates/TPL-07_single_mean.xlsx (7777b), cases/extraction_templates/TPL-08_survival_HR.xlsx (7948b), cases/extraction_templates/TPL-09_network_meta.xlsx (8132b), cases/extraction_templates/TPL-10_diagnostic_DTA.xlsx (7903b), cases/extraction_templates/TPL-11_multiarm_rct.xlsx (8057b), cases/meta_report_pairwise_meta_zh_1788232879.html (48698b), cases/meta_report_pairwise_meta_zh_1788234130.html (43421b), cases/prompts/C01.md (2738b), cases/prompts/C02.md (2377b), cases/prompts/C03.md (2196b), cases/prompts/C04.md (2443b), cases/prompts/C05.md (2368b), cases/prompts/C06.md (2327b), cases/prompts/C07.md (2266b), cases/prompts/C08.md (2063b), cases/prompts/C09.md (2099b), cases/prompts/C10.md (2087b), cases/prompts/C11.md (2210b), cases/prompts/C12.md (2498b), cases/prompts/C13.md (2305b), cases/prompts/C14.md (2392b), cases/README.md (4811b), cases/VERIFICATION_REPORT.md (6928b), CHANGELOG.md (467899b)\n\nFile v2.20.1:SKILL.md\n\n---\nname: meta-analysis\ncn_name: 医学Meta分析\nslug: meta-analysis\ndisplayName: Meta Analysis / 医学Meta分析\nversion: 2.20.1\nlicense: MIT\nsummary: 基于 R 的全方位 Meta 分析技能，覆盖 RevMan + Stata 等价 + esc + RVE + 贝叶斯 NMA + 生存 Meta + TSA + 单组率 Meta + 诊断 Meta + 系统评价流程；输出森林图、漏斗图、异质性(I²)、发表偏倚、亚组分析、元回归、网络 Meta等共 23 种分析图形。所有分析提供可复现 R 代码。还可提供Meta选题方向判断 + 文献检索整理 + 筛选 + 数据提取功能。\ndescription: \"Comprehensive R-based meta-analysis skill covering RevMan + Stata equivalents + esc + RVE + Bayesian NMA + survival meta + TSA + single-group meta + diagnostic meta + systematic review workflow; produces forest plots, funnel plots, heterogeneity (I²), publication bias, subgroup analysis, meta-regression, network meta, for a total of 23 analysis figures. All analyses ship reproducible R code. Can also provide meta topic-direction judgment + literature retrieval and organization + screening + data-extraction functionality. / 基于 R 的全方位 Meta 分析技能，覆盖 RevMan + Stata 等价 + esc + RVE + 贝叶斯 NMA + 生存 Meta + TSA + 单组率 Meta + 诊断 Meta + 系统评价流程；输出森林图、漏斗图、异质性(I²)、发表偏倚、亚组分析、元回归、网络 Meta等共 23 种分析图形。所有分析提供可复现 R 代码。还可提供Meta选题方向判断 + 文献检索整理 + 筛选 + 数据提取功能。\"\n\nrequired_commands: [python]\ninvocable: true\n\ntriggers:\n  - \"meta分析\"\n  - \"meta-analysis\"\n  - \"系统评价\"\n  - \"森林图\"\n  - \"漏斗图\"\n  - \"异质性\"\n  - \"发表偏倚\"\n  - \"元回归\"\n  - \"network meta\"\n  - \"贝叶斯meta\"\n  - \"效应量转换\"\n  - \"TSA\"\n  - \"诊断meta\"\n  - \"full meta pipeline\"\n  - \"上下文菜单\"\n  - \"对话菜单\"\n  - \"全流程菜单\"\n  - \"flow menu\"\n  - \"论文撰写\"\n  - \"写稿\"\n  - \"初稿\"\n  - \"投稿建议\"\n  - \"发表建议\"\n  - \"writing advisor\"\n  - \"manuscript\"\npermissions:\n  scope: \"user-space-only\"\n  network: required\n  network_note: \"All numerical computation runs on the coze cloud R engine; analysis params/summary stats are POSTed to coze. No local-R fallback (paid-only feature); IPD only if the user explicitly opts in.\"\n  filesystem: \"writes only to the current working directory (meta_analysis/ and output/ report artifacts: generated .R scripts, .svg/.png figures, .csv tables); otherwise read-only\"\nmetadata:\n  {\n    \"openclaw\": { \"emoji\": \"📊\", \"icon\": \"assets/icon.svg\" },\n    \"authors\": [\"medstatstar\", \"phoe-zip\"],\n    \"homepage\": \"https://github.com/medstatstar/meta-analysis\",\n    \"workbench_url\": \"https://meta.app.workbuddy.host/\",\n    \"workbench_url_alias\": \"https://meta.app.workbuddy.link/\",\n    \"workbench_domain_prefix\": \"meta\",\n    \"workbench_domain_note\": \"Registered exception to the ct-base iron rule (2026-09-16): simplified prefix 'meta' instead of the skill name. Whitelisted, do not extend.\",\n    \"workbench_app_id\": \"wbapp_hNZl928SI6wByvJt2COtcC\",\n    \"workbench_owner_workspace\": \"2026-09-17-09-54-01\",\n    \"workbench_sandbox\": \"a3c70e48be8f45019845b76383334bfc\",\n    \"tags\": [\"meta-analysis\", \"systematic-review\", \"clinical-trials\", \"R\", \"biostatistics\", \"evidence-based-medicine\", \"forest-plot\", \"network-meta-analysis\", \"bayesian\", \"metafor\", \"meta\", \"netmeta\", \"gemtc\", \"revman\", \"robumeta\", \"clubSandwich\", \"esc\", \"dosresmeta\", \"mada\", \"metagear\", \"forestploter\"],\n  }\n---\n\n# Meta-Analysis\n\n> R-based comprehensive meta-analysis. Every module ships reproducible R code.\n\n## Language\n\n- **English guide** → [README.md](https://github.com/medstatstar/meta-analysis/blob/main/README.md) · **中文指南** → [README_zh-CN.md](https://github.com/medstatstar/meta-analysis/blob/main/README_zh-CN.md)\n- Bilingual auto-switch: the answer language follows the user's question language (English question → English answer, Chinese question → Chinese answer).\n\n## 0. Execution discipline (speed-first)\n\n> 🚀 **Top-level red line — higher priority than any \"thinking/polishing\" impulse. Violation = wasting the user's time.** Full boundaries/exceptions/anti-patterns in `references/speed-discipline.md`.\n\n### Two-track gating (code-driven routing, no LLM decision)\nThe first message goes through `python scripts/classify.py` for **deterministic triage** (zero LLM decision):\n- **Compute track (compute)**: clear Simple / Complex → describe and immediately run `run_meta.py --query --data`; three steps to completion, fully bound by this discipline.\n- **Topic track (topic)**: vague / topic selection / feasibility → **first run `scripts/topic_gate.py`** to route on ct-literature install status (installed → call ct-literature directly; not installed → AskUserQuestion install-vs-simple, simple = ct-search remote `adapters/ctsearch_client.py search`), then `generate_topic_report.py`; code-grounded, zero free-form improvisation.\n- Both tracks forbid reading source via Read/Grep/Bash to \"confirm how to tune / which task to use\" — that is `classify.py`'s job.\n\n### Agent operation card (copy verbatim, no variations)\n```bash\n# Compute track one-shot: report lands in --out-dir (user workspace); in-conversation data uses --data-json to skip file writes.\n# If data comes from a file, pass --data <csv|json absolute path> (csv auto-converts to JSON before sending to coze).\npython scripts/run_meta.py --query \"<user original request>\" --data-json '<[{\"study\":\"S1\",...}]>' --out-dir \"<user workspace>/meta_analysis\"\n```\nRead `META_HTML_REPORT=<path>` from stdout and pass directly to `present_files`; across turns, carve a subset into a new csv/json and re-issue the same command (always include `--out-dir`). Do NOT use this card for the topic track. Fallback `META_STATUS=build_failed` → re-run with `--colmap` per the hint.\n\n### Six iron rules\n1. **Execute, don't think**: when running the skill, only perform the workflow; no reasoning/trade-off/review/self-explanation; if a field is missing, ask only about that field.\n2. **Zero number rewriting**: cite `stats`/`pooled`/`heterogeneity`/`bias` verbatim; no rounding/conversion/re-formatting.\n3. **HTML report is the sole presentation surface**: `out['html_report']` is the final deliverable; no further processing; inline `show_widget` is deprecated, figures only appear in the HTML.\n4. **Coze is the sole source of truth for computation**: all numerical analysis/computation runs on the coze R engine; the local side keeps only orchestration + send/receive and retains no compute engine. If coze is unreachable/unauthorized, raise a structured error per §6 — never fall back to local. (Consequence: without coze authorization the skill cannot compute — this is intended, as it supports paid-only features.)\n5. **Call-count invariant**: compute track ≤1 call before fire (only `build_request`), ≤1 call after fire (only `present_files`); topic track ≤2; no retry loops. Cross-turn `--data-json` refill is input construction and does not count.\n6. **No duplicate fire**: once `run_meta.py` is in-flight (the Bash call has been issued), **wait for the result** — do NOT re-issue the same or equivalent command. If `META_STATUS=error`, follow the structured guidance; do NOT silently retry. If `META_HTML_REPORT=...`, pass to `present_files` — done. One command, one wait, one result.\n\n### Already automated / anti-patterns\nSubgroup columns auto-pass-through, column-name aliases auto-matched, artifact completeness guaranteed by `run_analysis` — the agent must not read source to verify, must not hand-assemble subgroup into request.json, must not declare \"missing Q_between\" each round.\n\n**❌ Impatient duplicate fire (2026-09-17 field incident):** re-issuing `run_meta.py` before the previous call returns wastes coze compute and burns rate limits. Full anti-pattern list → `references/speed-discipline.md`.\n\n## 1. Triage — First step: classify the user's intent\n\n> **Routing is already done in code (§0 two-track gating)**: track / task judgment is delegated to `build_request.py` (which calls `classify.py`); the LLM no longer makes routing decisions and does not hand-write request.json. The table below is for understanding only — the LLM calls `run_analysis` directly from the generated `request.json` and `present_files(html)`.\n\n| Classification | Condition | Action |\n|---|---|---|\n| **Simple** | Single, specific intent (e.g., \"pool OR from these 5 studies\") | Reply directly, no menu |\n| **Complex** | Multi-decision / multi-parameter (e.g., \"network meta with 3 interventions, subgroup, check inconsistency\") | Present level-1 routing menu incl. \"③ Can't decide? → explain the differences\"; full menu → `references/interactive_menu.md` |\n| **Vague** | Unclear what user wants (e.g., \"I need meta-analysis help\") | Grill-me branch questions, 1–3 per round; \"no topic / feasibility\" → **Topic Selection** (§2.2) |\n\nIf unsure between Simple and Complex → give short reply + optional expansion hint.\n\n## 2. Conversation guide\n\n### 2.1 Interactive menu\nVague → Level 1 menu (7 categories). Select → Level 2 with data-format hints. Sufficient info → skip menu, run directly. Full menu tree + data formats → `references/interactive_menu.md`.\n> **Other formats?** Install `@skill:statdata-transfer` for 50+ format conversion.\n\n### 2.2 Topic Selection (upstream gate, self-contained)\nTrigger: no topic / feasibility check / \"rejected as duplicate\" / pre-PROSPERO audit → `references/topic-selection.md`. Two paths:\n- **Quick** (≤30 min): 1-page decision card — 4-dim scores (clinical/feasibility/data/novelty, 0–5, any ≤2 = veto) + screen verdict.\n- **Full** (5 stages + gates): PICO (`pico-guide.md`) → scoring + cross-checks R1–R6 → dedup (`dedup-search.md`) → PRISMA 2020/AMSTAR-2 (`compliance-precheck.md`) → 11-section report via `python scripts/generate_topic_report.py input.json output.md|html` (templates → `topic-report-template.md` / `prospero-mapping.md`).\n- **Dedup source is gate-driven (see Topic Gating in `topic-selection.md`)**: first run `scripts/topic_gate.py`; if **ct-literature** is installed, call it directly for full 6-source retrieval (`.merged.json` as Stage-4 evidence); if not installed, AskUserQuestion → simple-analysis branch calls the **ct-search remote** (`adapters/ctsearch_client.py search --source europepmc`, no install needed); in-skill `adapters/literature_probe.py` (direct Europe PMC) is only the offline ultimate fallback. All paths return real `hit_count` + titles; novelty ranking grounded in actual literature.\n  - ⛔ **Topic-track red line**: candidate ranking **must** be based on the probe's real hit counts + 4-dim score card; the LLM only paraphrases, strictly no free-form \"which direction is good\". Quick is ranked by the probe card; Full is reported by `generate_topic_report.py`, the LLM does not rewrite.\n\n### 2.3 Upstream orchestration (retrieval → screening → extraction → analysis)\n\n> **Repositioning (2026-08-30):** meta-analysis evolved from \"pooling effect sizes only\" into a \"full-chain Meta orchestrator\".\n> The upstream three stages reuse existing modules and `ct-literature`; the only new capability is the **data-extraction assistant** (LLM draft + human-verification gate).\n\nFull-chain orchestration, command list, seam pitfalls (incl. `included_records` ≠ `included`), and guard semantics → `references/upstream_orchestration.md`.\nWriting-advisor (④′), evidence-upload (④″), and detailed A-stage contract / type-confirmation model → `references/chat_orchestration.md`.\n\n- ⛔ **Automatic PDF value extraction is SUSPENDED (2026-09-27, user-decided)**: `features.a4_extraction=False` gates off A4 auto 2×2 extraction; three backend bypasses (`/api/upload_pdf`, `/api/upload_pdf_auto`, fastpath `data_mode=\"pdf\"`) return 409. Do NOT offer \"auto-extract numbers from PDFs\" as an available capability in chat. Unfreeze = set `a4_extraction: True` in `adapters/features.py`.\n\n> ⚠️ **The human-verification gate is a red line:** any CSV from `extract_assist.py` not `stamp --confirm`ed is blocked by `run_meta.py` (`META_STATUS=unverified_extraction`).\n\n### 2.4 Systematic-review full-flow mode (@skill entry)\n\n> **Trigger:** \"systematic review full flow\" / \"from retrieval to meta-analysis\" / \"systematic review workflow\" → end-to-end orchestration, not a direct jump to compute track.\n> The agent executes the full playbook → `references/systematic_review_fullflow.md`. CCM (Conversation Context Menu) is **DISABLED** for agent use (2026-09-27) — two execution surfaces remain: ① the **published web app** and  **plain conversation** (agent narrates + asks open questions in prose). Do NOT render `flow_menu.py` menus in chat.\n> Archived CCM details (menu design, A1/A2 sub-menus, pre-flight checks, contract gaps) → `references/chat_orchestration.md`.\n### 2.5 Workbench — published app & local launch\n\n> **Trigger:** \"工作台\" / \"workbench\" / \"meta 全流程\" etc.\n> Published app metadata, share link, appId, publish toolchain, local-launch commands → `references/workbench.md`.\n\n## 3. Initialization & execution backend\n\n**Execution model**: coze-only, absolute. Startup: probe `coze_client.health()`, create `meta_analysis/` + `output/`, read R config from `~/.workbuddy/MEMORY.md`. Details → `references/ADVANCED.md`.\n\n## 4. Core functions & API\n\nModule → R-package/function matrix → `references/advanced_api.md` · `references/ADVANCED.md`.\n**Rule (mandatory)**: any analysis MUST call existing functions — never rewrite inline. Unified entry `adapters/run_analysis.py` (default: coze).\n\n## 5. Output specification\n\n**Artifacts**: `analysis_complete.R` + forest/funnel (`.svg`, inlined in HTML) + `results_summary.md` + `last_run.json`. Per-round dataset CSV is an *input* the agent carves; `run_analysis.py` does NOT auto-write `data_backup.csv`.\n\n**Rendering**: `figures[].svg` embedded into single-file HTML report → `present_files`. Inline `show_widget` cancelled. SVG keeps natural width. Quality Gate: R-side `run_quality_gate()` → red (k<3 / I²>75% / missing bias check) **blocks** presentation.\n\n**Cross-turn continuity (mandatory)**: stateless runtime → echo `## 当前分析设定 / Current analysis settings` after every analysis; follow-up changes only changed fields; dataset supplied per round (no `data_backup.csv`). Full spec + merge_spec + endpoint capability boundaries → `references/cross_turn.md`.\n\n## 6. Security & scope\n\n**Execution model**: numeric computation via coze. **Data-exfiltration decision belongs to the user**.\n\n**Outbound disclosure**: analysis data (no PII) POSTed to coze, sanitized by `sanitize_payload()`. Default endpoint pre-approved; custom `COZE_META_ENDPOINT` asks AUTH-BLOCK on first call. First outbound notice each session (once, bilingual). Attribution never empty (`query_origin` hostname SHA-256 + `request_id` UUID). Coze failure needs consent before diagnose+retry.\n\n**Other boundaries**: PDF download ONLY on explicit user instruction (`adapters/pdf_fetch.py`). Data-extraction guard (red line): `extract_assist.py` CSV blocked until `stamp --confirm`.\n\nFull security details → `references/ADVANCED.md` · `references/pdf-download-portals.md` · `references/bug_report_endpoint.md`.\n\n## 7. User-uploaded files\n\n1. **Structured data (`.csv`/`.xlsx`/`.xls`)** → Type 4 template (`references/data_templates.md`).\n2. **Document/template (`.docx`/`.pptx`/`.pdf`/`.doc`)** → convert to md first: `.docx`/`.pptx` via `scripts/office_to_md.py`; `.pdf` via `pdf` skill.\n\n**🔔 Pre-conversion notice**: `⚠️ All uploaded documents will be converted to md. PPT conversion can lose images/layout/animations/charts.`\n\nFull upload spec → `references/data_templates.md`.\n\n## 8. Bug Reporting\n\nAgent behavior only; implementation → `adapters/bug_report.py`, protocol → `references/bug_report_endpoint.md`. Trigger ≤1 proposal/session. Two-stage confirmation (propose-with-preview → consent → send). 11-key whitelist, never raw data.\n\n## 8.5 Deploy Retest Gate (mandatory before publish / deploy)\n\n**Freeze check FIRST**: before any publish attempt to GitHub → SkillHub → ClawHub, run `python adapters/publish_guard.py` — exit code 2 means a dev-period publish freeze is active (`adapters/DEV_POLICY.json`) and publishing is blocked; do NOT proceed and do NOT bypass it. This check is part of the gate, not optional advice.\n\n**Mandatory before publishing / deploying** to GitHub → SkillHub → ClawHub: run `python tests/deploy_retest.py` (`--live` to actually hit the network; publish allowed only on all-green). This gate strictly verifies that the coze response is **genuinely valid** (HTTP 200 ≠ success; it rejects `status=ok` empty shells / `NaN` / no-figure (svg/url) false greens — coze externalizes SVG to S3 `url`, so a present+reachable `url` counts as a valid figure), writes `tests/deploy_retest_report.json`, and exits non-zero on any failure to block publishing. Use `--mock` for local logic self-check (no network) and `--offline` for envelope-contract validation. Full rules and red lines → `outputs/deploy_retest_gate.md`.\n## 9. Meta information\n\n**Traceability**: all factual claims cite a `ref-*.md` section or official guideline; unverifiable → mark `⚠️ official verify`.\n**References**: full index → `references/references.md`. Key: `interactive_menu.md`, `ADVANCED.md`/`ADVANCED_zh-CN.md`, `advanced_api.md`, `topic-selection.md`, `data_templates.md`, `svg_editing.md`. Units → `references/units.md`.\n**Project Files**: `README.md` | `README_zh-CN.md` | `CHANGELOG.md` | `AGENTS.md` | `LICENSE` (MIT © 2025 medstatstar) | `requirements.txt` | `assets/icon.svg`.\n**Changelog**: → `CHANGELOG.md`.\n\nFile v2.20.1:adapters/README.md\n\n# adapters/ — 计算出口层（ct-base §16.9 架构预留）\n\n> 本目录是 **meta-analysis 技能** 的分析计算出口层。**发布形态为 coze-only**（2026-08-19 决策）：\n> 所有数值计算经 coze 元分析工作流，本地 LLM 仅做需求标准化/数据整理/结果呈现，**最终用户无需安装 R**。\n> 回退逻辑已于 2026-08-26 取消：coze 不可达 / 未授权时直接返回结构化错误，**不再兜底本地引擎**。\n\n## 路由策略（coze 唯一路径，无回退）\n\n```\n                 ┌─────────────────────────────────────────────┐\n   分析请求 ──────▶│ adapters/run_analysis.py  (统一入口)         │\n (task/data/…)    │   唯一对外路径 = coze                         │\n                 └───────────────┬─────────────────────────────┘\n                                 │\n                   coze_client.run_meta ── 成功 ──▶ _source=\"coze\"\n                                 │ 失败（网络/HTTP/空响应/未授权）\n                                 ▼\n                          返回结构化错误（不再回退本地）\n```\n\n- **发布形态**：唯一路径 = `coze`。coze 失败时直接返回 `{status:\"error\", ...}`，由上层决定如何提示用户。\n- **`_source` 字段**：仅 `\"coze\"`（成功）或缺失（结构化错误，不标 local_fallback）。\n- **开发者/复现**：本地无独立计算引擎。所有数值计算由 coze 端 R 引擎完成；`_dev/` 仅作开发调试占位（历史本地 R 引擎 `local_engine.py` 已于 2026-09-01 按架构终态原则删除）。\n\n## 文件\n\n```\nadapters/\n├── run_analysis.py        # 统一前端：唯一对外路径 = coze\n├── literature_probe.py    # ★ 选题去重自包含探针：Europe PMC REST（Cochrane+PubMed 层真实 hit_count），零依赖、不依赖其他技能\n├── coze_client.py         # Coze /run 客户端（唯一路径）：信封打包 / 响应解析\n├── coze_cases/            # 3 个冒烟案例（快速自测）\n├── coze/          # ★ coze 项目本地镜像（与 coze 远端双向同步的唯一源，2026-08-19 统一放置）\n│   ├── coze_contract.md   #   接口契约（§16.7 红线：不随技能发布，已 ignore）\n│   ├── src/r_engine/*.R   #   R 引擎（run_task.R 等，coze 端运行本体）\n│   ├── scripts/           #   部署脚本（http_run.sh / setup.sh 等）\n│   └── docker/ assets/    #   镜像/依赖清单\n├── _dev/                  # ★ 开发调试用，已 ignore（不随发布包分发）；历史本地 R 引擎已删除\n└── README.md              # 本文件\n```\n\n## coze 项目镜像：双向同步约定（2026-08-19 统一）\n\n> **`adapters/coze/` 是 coze 远端代码在本地唯一的同步源。** 所有 coze 端代码变更都从这里进出：\n> 本地改代码 → 打包部署 coze；coze 平台导出 → 覆盖回此目录。**不再使用工作区 `coze_meta_project/` 作为主镜像**（保留为历史快照）。\n\n- **本地 → coze**：改 `adapters/coze/` 内文件 → `tar -czf coze_final_YYYYMMDD.tar.gz .`（在镜像目录内）→ 上传 coze 平台 → vefaas 重部署 → 线上 96 例复测。\n- **coze → 本地**：coze 平台导出 project → 解包覆盖 `adapters/coze/` → `diff -r` 与镜像内 `src/r_engine/` 比对确认。\n- **发布排除**：`adapters/coze/` 已加入 `.gitignore` / `.clawhubignore`，**不随技能发布**（coze_contract.md 属 §16.7 红线）。\n- **一致性基准**：`adapters/coze/src/r_engine/` 为唯一本地引擎（技能根 `r_engine/` 已删），与 coze 远端同步。\n\n## 配置（环境变量）\n\n| 变量 | 说明 | 默认 |\n|------|------|------|\n| `COZE_META_ENDPOINT` | coze 工作流 `/run` 地址（2026-08-26 改造，主工作流回切 ct-meta） | `https://ct-meta.coze.site/run` |\n| `COZE_META_TOKEN` | 可选 Bearer 鉴权令牌 | 空（不带 Authorization） |\n| `COZE_META_TIMEOUT` | 请求超时（秒） | `600` |\n\n## 用法\n\n```python\nimport sys; sys.path.insert(0, \"adapters\")\nfrom run_analysis import run_analysis\n\n# 唯一路径：coze 云端 R 计算\nout = run_analysis(\n    task=\"pairwise_meta\",\n    data={\"rows\": [{\"study\": \"A\", \"event_exp\": 12, \"n_exp\": 100,\n                    \"event_ctrl\": 20, \"n_ctrl\": 100}]},\n    params={\"sm\": \"OR\", \"model\": \"REML\"},\n    figure={\"plots\": [\"forest\"]},\n)\n# 成功：out[\"_source\"] == \"coze\"\n# 失败：out[\"status\"] == \"error\"（coze 不可达/未授权），无 _source 回退\n```\n\nCLI 等价：`python adapters/run_analysis.py request.json`\n\n> **🚫 调用方约束（2026-08-30）**：请**始终经 `run_analysis` / `scripts/run_meta.py` 调用**——它们自动注入有效 `query_origin`（主机名 SHA-256，`[debug:]sha256:<64hex>`）。**不要**用 curl / Postman 直接 POST `/run`；如确需裸调，请求体**必须带合法 `query_origin`**（`coze_client._assert_query_origin` 已在客户端出站层硬拦截空归因，但裸 POST 不经该守卫）。空归因会绕过按 `query_origin` 计的限流，且飞书日志无法溯源。\n\n## 红线\n\n- **数值判断红线**：R 计算的数值结论（合并效应、I²、排序等）由 coze 端 R 产出，\n  本层仅解析结构（status/stats/figures[].svg/warnings/notes），绝不读取或改写数值。\n- **接口契约**：见 coze 项目的 `coze_contract.md`（不随技能发布，遵循 ct-base §16.7）。\n  镜像内 `src/r_engine/` 是 coze 远端引擎的字节级镜像，靠该契约保持同步。\n- **发布红线**：coze 接口契约 / system prompt / ops 文档一律不随技能发布（ct-base §16.7）。\n- **回退红线（2026-08-26 起）**：运行路径不再调用任何本地计算引擎；\n  历史本地 R 引擎 `adapters/_dev/local_engine.py` 已于 2026-09-01 删除，无本地回退。\n\nFile v2.20.1:cases/README.md\n\n# meta-analysis 案例库总览\r\n\r\n> 由 `cases/case_catalog.py` 生成。案例库 = 技能最便宜的回归基准：每次改 block_a/b/c、pdf_extractor、run_stage 都跑一遍全套案例比对信封/数值是否漂移。\r\n>\r\n> 📋 离线验证结果见 **[VERIFICATION_REPORT.md](./VERIFICATION_REPORT.md)**（14 案例全链路 A4 抽取 + 11 模板 1:1 映射 + 本地可算/需 coze 状态）。\r\n\r\n## 案例清单（14 个）\r\n\r\n| 案例 | 标题 | 类别 | 设计 | 效应量 | 模板 |\r\n|---|---|---|---|---|---|\r\n| C01 | SGLT2 抑制剂 vs 安慰剂对 T2DM 患者 MACE 的影响（二分类 OR） | 数值指标 | 干预性 RCT，二分类结局，pairwise | OR | TPL-01 |\r\n| C02 | 卡介苗（BCG）疫苗对结核病发病的保护效力（二分类 RR） | 数值指标 | 干预性 RCT，二分类结局，pairwise（RR） | RR | TPL-01 |\r\n| C03 | 某干预对术后 30 天死亡率的影响（二分类 RD） | 数值指标 | 干预性 RCT，二分类结局，pairwise（RD） | RD | TPL-01 |\r\n| C04 | 降压药对收缩压（SBP）降低的均数差（连续型 MD） | 数值指标 | 干预性 RCT，连续型结局，pairwise（MD） | MD | TPL-02 |\r\n| C05 | 心理干预对抑郁量表评分的影响（连续型 SMD） | 数值指标 | 干预性 RCT，连续型结局异量纲，pairwise（SMD） | SMD | TPL-02 |\r\n| C06 | 肿瘤免疫治疗对总生存期（OS）的 HR 合并（已有效应量 logHR） | 数值指标 | 干预性 RCT，时间-事件结局，已有效应量 pairwise（logHR） | logHR | TPL-03 |\r\n| C07 | 中心静脉导管相关血流感染（CLABSI）率比（IRR，人时数据） | 数值指标 | 前后对照/队列，率比，pairwise（IRR） | IRR | TPL-04 |\r\n| C08 | 教育年限与健康评分的相关性合并（ZCOR） | 数值指标 | 观察性，相关系数，pairwise（ZCOR） | ZCOR | TPL-05 |\r\n| C09 | 不同地区成人吸烟率合并（单组率 PLOGIT） | 数值指标 | 流行病学调查，单组率，pairwise（PLOGIT） | PLOGIT | TPL-06 |\r\n| C10 | 慢性疼痛患者基线疼痛评分合并（单组均值 MN） | 数值指标 | 观察性/基线，单组均值，pairwise（MN） | MN | TPL-07 |\r\n| C11 | 心衰治疗对心血管死亡风险的 HR（生存分析，O-E/V 法） | 数值指标 | 干预性 RCT，时间-事件结局，pairwise（logHR via O-E/V） | logHR | TPL-08 |\r\n| C12 | 三类降压药对 SBP 降低的网状 Meta（NMA，≥3 干预） | 复杂设计 | 干预性 RCT，多臂，网状 Meta（直接+间接比较） | OR | TPL-09 |\r\n| C13 | 新冠抗原检测准确性的诊断 Meta（DTA，TP/FP/TN/FN） | 复杂设计 | 诊断准确性研究，2×2 四格表，pairwise（DOR/Sens/Spec） | DOR | TPL-10 |\r\n| C14 | 三臂肿瘤 RCT（2 活性药 + 安慰剂）独立对比 Meta（多臂拆分） | 复杂设计 | 干预性多臂 RCT，按对比拆分，pairwise（OR） | OR | TPL-11 |\r\n\r\n## 模板清单（11 个）↔ 对应案例\r\n\r\n| 模板 | 情境 | 效应量 | PDF表型 | 自动识别 | 演示案例 |\r\n|---|---|---|---|---|---|\r\n| TPL-01 | 二分类 2×2 四格表 | OR/RR/RD | T_DICHOT | ✅ 已自动识别 | C01, C02, C03 |\r\n| TPL-02 | 连续型两臂（均值±SD） | MD/SMD | T_CONTINUOUS / T_CONT_TWOARM | ⚠️ 部分自动 | C04, C05 |\r\n| TPL-03 | 已有效应量（对数尺度） | lnOR/SMD/logHR/ROM/ZCOR | T_EFFECT_TABLE / T_MD_CI | ⚠️ 部分自动 | C06 |\r\n| TPL-04 | 率比（人时数据 IRR） | IRR | （暂无自动，需人工映射） | ✋ 需人工映射 | C07 |\r\n| TPL-05 | 相关系数 | ZCOR | （暂无自动，需人工映射） | ✋ 需人工映射 | C08 |\r\n| TPL-06 | 单组率 | PLOGIT/PRAW | （暂无自动，需人工映射） | ✋ 需人工映射 | C09 |\r\n| TPL-07 | 单组均值 | MN | （暂无自动，需人工映射） | ✋ 需人工映射 | C10 |\r\n| TPL-08 | 生存分析 HR | logHR | （暂无自动，需人工映射） | ✋ 需人工映射 | C11 |\r\n| TPL-09 | 网状 Meta（多臂） | OR/RR/MD | （暂无自动，需人工映射） | ✋ 需人工映射 | C12 |\r\n| TPL-10 | 诊断试验准确性（DTA） | DOR/Sens/Spec | （暂无自动，需人工映射） | ✋ 需人工映射 | C13 |\r\n| TPL-11 | 多臂 RCT（独立对比） | OR/RR/RD/MD | （暂无自动，需人工映射） | ✋ 需人工映射 | C14 |\r\n\r\n## 1:1 对应关系说明\r\n\r\n- 每个**数据形状/研究情境**有且仅有一个 Excel 提取模板（`TPL-xx`）。\r\n- 每个模板的「数据录入」sheet 列定义与 `references/data_templates.md` 完全一致，并追加 `PDF来源(页/表)` 与 `备注` 两列用于溯源。\r\n- `pdf_extractor` 当前 P1 仅自动识别 T_DICHOT / T_CONTINUOUS 系列；其余形状标注「需人工映射」，模板即人工映射的落地载体。\r\n- 运行：`python adapters/run_case_human.py --case <案例ID>`（默认 C01）。\n\nFile v2.20.1:README.md\n\n# meta-analysis\n\n- **English guide** → [README.md](https://github.com/medstatstar/meta-analysis/blob/main/README.md) · **中文指南** → [README_zh-CN.md](https://github.com/medstatstar/meta-analysis/blob/main/README_zh-CN.md)\n\n<div align=\"center\">\n  <img src=\"assets/icon.svg\" width=\"240\" height=\"240\" alt=\"meta-analysis logo\"/>\n</div>\n\n> **Works without installation:** If you'd rather not install and just want to quickly use this skill's basic features, you can also visit the ct-series unified web portal **https://ct.medstatstar.com** directly.\n\n> **Easy-to-use R-based Meta-Analysis for Clinical Researchers**\n>\n> You don't need to code or memorize commands — just describe your meta-analysis needs in **plain language inside a chat**, and the skill **automatically runs** the full analysis (pooling, figures, report) for you. Powered by R and 14 core + 2 optional professional R packages (metafor, meta, netmeta, bayesmeta, dosresmeta, mada, etc.), it returns results in Chinese or English depending on your OS language setting (you can force-switch via a prompt at any time). Once you describe a request, the skill **auto-executes** and returns results + figures; ask for the full reproducible R code at any time.\n\n---\n\n## Who This Is For\n\nmeta-analysis is part of the CT-series skill family, built for three groups:\n\n- **Clinical-trial practitioners at pharmaceutical companies** — sponsors, CROs, and medical / statistical / regulatory roles who need to pool and compare study evidence;\n- **Clinicians and nurses who design, conduct, or participate in clinical research** and need meta-analysis / systematic-review support;\n- **Medical students who want to learn evidence-based medicine and meta-analysis methodology in a structured way**.\n\n---\n\n## 1. How to Use It in a Chat (the Core)\n\nmeta-analysis is a **conversational skill**: you simply tell the assistant what you want in natural language — no commands, no parameter names to remember. As a WorkBuddy skill it **auto-loads with no extra installation**.\n\nBelow are 7 real conversational examples — **one per category** in the Scenario Index (§2): ① systematic-review workflow, ② pairwise meta, ③ heterogeneity & bias, ④ advanced models, ⑤ effect-size conversion, ⑥ visualization, ⑦ study quality. Each shows **\"You say\"** and a sketch of **\"The assistant replies\"**, plus how to get the actual number.\n\n### Example 1 · ① Systematic review workflow: topic selection\n**You say:**\n> I'm interested in SGLT2 inhibitors for renoprotection and cardiovascular benefit in chronic kidney disease (CKD), but I haven't decided which specific meta-analysis direction to pursue. Can you help me shortlist candidate directions?\n\n**Assistant replies (sketch):**\n> Sure — I'll use a **topic-selection approach** to lock down the direction. First I run the **in-skill dedup probe (Cochrane + PubMed real hit counts)**, then shortlist — otherwise a saturated direction can be wrongly pushed as top pick.\n>\n> **First, rule out the saturated directions**: the generic \"SGLT2i on cardiorenal outcomes in CKD\" is Cochrane 23 / PubMed 2785 — highly saturated. **Counter-intuitively**, the seemingly niche **non-diabetic CKD (Cochrane 20 / PubMed 2402)** and **dialysis / advanced CKD (Cochrane 22 / PubMed 1067)** are also heavily covered (DAPA-CKD / EMPA-KIDNEY spawned many reviews) — also not recommended.\n>\n> Re-shortlisting 3 candidates by **evidence gap + novelty** (I'll produce 1–3 directions; I won't decide for you):\n>\n> **Candidate ① Renoprotection in IgA nephropathy (top pick)**\n> - Cochrane 4 / PubMed 224 (≈1/10 of the broad direction) → **real gap**\n> - Most common primary GN; SGLT2i already a guideline adjunct; many RCTs, data available\n>\n> **Candidate ② Net benefit / benefit–risk framework**\n> - Cochrane 5 / PubMed 442 → gap\n> - Pools renal + cardiac benefit with safety events (DKA / infection / volume depletion) in one framework — strong methodological differentiation\n>\n> **Candidate ③ Specific glomerular diseases (FSGS / membranous / ADPKD / lupus)**\n> - FSGS Cochrane 0, ADPKD 2, membranous 1, lupus 3 → **very deep gap**\n> - ⚠️ but sparse RCTs → power risk; better as a **scoping review** than a hard efficacy MA\n>\n> **Suggestion**: Start with ① (real gap, high clinical need); ② as the methodological-differentiation alternative; ③ conditional. Next step: a **full topic assessment** (PICO + dedup search + PRISMA/AMSTAR-2 pre-check), and **run ct-literature first for a full dedup confirmation** (the probe is a quick signal; FSGS=0 may include index-phrasing variance, don't rely on it alone).\n\n**📌 Note:** When you have a direction but are unsure which specific meta to run, the assistant uses the topic-selection framework to produce **1–3 candidate directions + a 4-dim score + meta type**, instead of deciding for you or giving a single answer. This is the **topic-selection gate** before analysis — no R computation is invoked. Candidates are stratified by **evidence gap / novelty**, each backed by the **in-skill dedup probe (Cochrane + PubMed real hit counts)** — so a saturated generic direction (including the \"intuitively niche\" non-diabetic CKD or dialysis) is no longer mis-pushed as the top pick.\n\n### Example 2 · ② Pairwise meta: two-group binary (most common)\n**You say:**\n> Combine the OR across these 5 binary studies:\n> Study A: experimental 30/100, control 20/100\n> Study B: experimental 45/120, control 30/100\n> ...\n\n**Assistant replies (sketch):**\n> ✅ 5 studies, random-effects (DL), OR = 1.52 (95%CI: 1.18–1.96), I² = 34%\n> (Ask for the full reproducible R code at any time.)\n\n**📌 Auto-execution:** Once you describe the request, the assistant **auto-executes** and returns the real result; ask for the reproducible code by saying **\"give me the full R code\"**.\n\n### Example 3 · ③ Heterogeneity & bias: I² + subgroup\n**You say:**\n> I did a continuous meta with 8 studies, SMD pooled, but I² is high — I want to subgroup by region\n\n**Assistant replies (sketch):**\n> ✅ 8 studies, SMD = 0.42 (95%CI: 0.15–0.69), I² = 78%\n> Subgroup by region:\n> - Asia (k=4): SMD = 0.55, I² = 45%\n> - Euro-US (k=4): SMD = 0.28, I² = 62%\n> - Between-group Q = 4.12, p = 0.04\n\n### Example 4 · ④ Advanced models: network meta with multiple decisions\n**You say:**\n> I want to do a network meta with 4 interventions, but I haven't decided whether to use frequentist or Bayesian, and I'm not sure if I should include dose-response\n\n**Assistant replies (sketch):**\n> 4 interventions clear. Two key choices to clarify:\n>\n> **① Which analysis framework?**\n> - (a) Frequentist — `netmeta`, inverse-variance based, good for consistent networks\n> - (b) Bayesian — `gemtc` (JAGS) or `multinma` (Stan) **local only** (a known coze limitation: the container has no root to install JAGS; on the cloud use (a) netmeta); `bayesmeta` supports Bayesian pairwise comparisons locally\n>\n> **② Include dose-response?**\n> - (a) No — pure pairwise comparison network\n> - (b) Yes — needs dose-effect parameters, Bayesian framework preferred\n>\n> **③ Can't decide?** → say \"explain the differences between these choices in detail\", and I'll clarify the clinical/statistical meaning before you choose\n\n**📌 Note:** When you've **named the test type but are stuck on \"which option / design family\"**, the assistant **pops a routing menu** to confirm step by step — instead of deciding for you or dumping the full menu. The menu also offers an \"explain the differences\" option — when you're unsure, it explains before you decide.\n\n### Example 5 · ⑤ Effect size conversion\n**You say:**\n> Convert Cohen's d = 0.8 to logOR\n\n**Assistant replies (sketch):**\n> ✅ d = 0.8 → logOR ≈ 1.45 (SE ≈ 0.38), based on logOR = d × π/√3\n\n### Example 6 · ⑥ Visualization\n**You say:**\n> Draw a forest plot, lancet theme\n\n**Assistant replies (sketch):**\n> ✅ Forest plot generated (lancet theme, with summary diamond and I² label). [SVG output]\n\n### Example 7 · ⑦ Study quality\n**You say:**\n> Assess risk of bias with RoB 2.0\n\n**Assistant replies (sketch):**\n> ✅ RoB 2.0 assessment complete. Please provide the risk-of-bias judgment (Low / Some concerns / High) for each study — I'll generate the traffic-light plot and stacked summary bar. [SVG output]\n\n---\n\n## 2. What You Can Do — Scenario Index\n\nCategories are grouped by **workflow stage first, then analysis purpose** (7 below). The systematic-review workflow comes first as the upstream gate, followed by six analysis-purpose categories. Each row gives the typical **clinical scenario** and a line you can **copy verbatim** under \"Try saying\". The same test may be reached from multiple entry points.\n\n> The underlying R packages (metafor / meta / netmeta …) are listed in Section 6 \"Advanced Reference\"; ordinary users don't need to care.\n\n### ① Systematic Review Workflow\n| Scenario | Try saying in chat |\n|:---|:---|\n| Topic feasibility check | \"Judge my topic: efficacy of ×××\" (real literature hit counts + 4-dim score verdict) |\n| Full topic report | \"Produce the full topic-assessment report\" (PICO → scoring → dedup → compliance pre-check → 11-section report) |\n| Literature retrieval | \"Run a systematic search on this topic\" (multi-source + dedup + Excel/HTML, delegated to ct-literature) |\n| Title/abstract screening | \"Screen the search results\" (machine pre-screen + per-record human verdict, PRISMA counts bridged) |\n| PRISMA flow | \"Help me generate a PRISMA flow diagram\" |\n| PRISMA checklist | \"Generate the PRISMA 2020 checklist (27 items)\" |\n| Data-extraction assistant | \"Give me an extraction sheet to fill from the papers\" (blank sheet → LLM draft → **line-by-line human verification** → stamp to release) |\n| Quality gate | \"Run the quality gate\" (k count / I² / missing bias check — red cards block presentation) |\n| Overclaim check | \"Check whether the conclusions overclaim\" (abstract claims vs pooled evidence) |\n| Manuscript drafting | \"Draft a submission manuscript from my analysis\" (methods/results auto-filled from real data; background/discussion expanded by LLM; journal-fit advice) |\n| Author-supplied evidence | \"I have my own reference list — use it\" (xlsx/csv/RIS/BibTeX/PDF bundle as the draft's evidence base) |\n| Reference verification | \"Verify every citation in the draft\" (DOI/title reverse lookup — no hallucinated references) |\n| Pre-submission QA | \"Run pre-submission evidence QA\" (numbers reconciled against statistics, red-line gate) |\n| PDF batch download | \"Batch download full texts from a DOI list (needs confirmation)\" |\n| Graph digitize | \"Extract data from a scatter plot\" |\n| Missing value imputation | \"Impute missing standard deviations\" |\n\n### ② Pairwise Meta-Analysis\n| Scenario | Try saying in chat |\n|:---|:---|\n| Binary (OR/RR/RD) | \"Combine the OR across these 5 binary studies\" |\n| Continuous (SMD/MD) | \"Pool the SMD of these 6 continuous studies\" |\n| Pre-calculated (yi+CI) | \"I have effect sizes and CIs for 5 studies — draw the forest plot directly\" |\n| Survival (HR) | \"Pool the HR across these 8 studies\" |\n| Correlation (r→Zr) | \"Convert these 4 correlations via Fisher z then pool\" |\n| Single-group rate/mean | \"Pool the incidence rates across these studies\" |\n| Generic inverse-variance | \"I have yi and vi — run the meta directly\" |\n\n### ③ Heterogeneity & Bias\n| Scenario | Try saying in chat |\n|:---|:---|\n| Heterogeneity assessment | \"I ran a meta, I² is very high — help me assess heterogeneity\" |\n| Subgroup analysis | \"Run subgroup analysis by region\" |\n| Meta-regression | \"Run meta-regression on publication year and sample size\" |\n| Egger test | \"Check publication bias, run Egger's test\" |\n| Begg test | \"Begg rank-correlation test\" |\n| Trim-and-fill | \"Correct publication bias with trim-and-fill\" |\n| Selection model | \"Assess publication bias with a selection model\" |\n| Sensitivity analysis | \"Run leave-one-out sensitivity analysis\" |\n| Cumulative meta | \"Run cumulative meta by publication year\" |\n| GOSH plot | \"Plot a GOSH graph to see heterogeneity patterns\" |\n| Baujat diagnosis | \"Make a Baujat plot to see which study contributes most heterogeneity\" |\n| Drapery plot | \"Plot a Drapery graph to assess α robustness\" |\n\n### ④ Advanced Models\n| Scenario | Try saying in chat |\n|:---|:---|\n| Frequentist NMA | \"Run network meta with 4 interventions, use netmeta\" |\n| Bayesian NMA (Stan) | \"Run Bayesian network meta, Stan backend\" |\n| Bayesian NMA (JAGS) | \"Run Bayesian network meta, JAGS backend\" |\n| Multilevel meta | \"Run 3-level meta with multiple effects within studies\" |\n| Multivariate meta | \"Pool a meta with multiple correlated outcomes\" |\n| IPD meta | \"I have individual patient data — run IPD meta\" |\n| Dose-response | \"Run dose-response meta, dosresmeta\" |\n| Survival meta | \"Pool survival HR via metafor (survmeta removed)\" |\n| Trial sequential analysis | \"Run TSA — see how many more studies are needed\" |\n| Bootstrap meta | \"Use Bootstrap for nonparametric DL estimation\" |\n| Component NMA (CNMA) | \"Run component network meta — decompose combination treatments (A+B, additive model) and test the additivity assumption\" |\n| NMA ranking | \"Rank the NMA interventions: SUCRA and P-scores\" |\n| Diagnostic accuracy meta | \"Run diagnostic-accuracy meta — I have tp/fp/fn/tn\" |\n| Incidence-rate meta | \"Run incidence-rate (person-time) meta\" |\n| Power analysis | \"What power does this meta have / how large a sample do I need\" |\n\n### ⑤ Effect Size & Conversion\n| Scenario | Try saying in chat |\n|:---|:---|\n| Mean/SD→d | \"Convert mean and SD to Cohen's d\" |\n| t/F→d | \"Convert a t value to d\" |\n| r→Fisher z | \"Convert a correlation to Fisher z\" |\n| d↔logOR | \"Convert d to logOR\" |\n| OR↔logOR | \"Convert OR to logOR\" |\n| Batch convert | \"Batch convert SMD to logOR\" |\n| NNT | \"Calculate NNT\" |\n\n### ⑥ Visualization\n| Scenario | Try saying in chat |\n|:---|:---|\n| Forest plot | \"Draw a forest plot, lancet theme\" |\n| Funnel plot | \"Draw a funnel plot with contour enhancement\" |\n| Bubble plot | \"Draw a meta-regression bubble plot\" |\n| GOSH plot | \"Plot a GOSH graph\" |\n| Network plot | \"Draw the network meta graph\" |\n| League table | \"Draw the NMA league table\" |\n| RoB traffic-light | \"Draw a risk-of-bias traffic-light plot\" |\n| Power curve | \"Draw a power curve\" |\n| Drapery plot | \"Plot a Drapery graph\" |\n| Inconsistency heatmap | \"Plot an NMA inconsistency heatmap\" |\n\n### ⑦ Study Quality\n| Scenario | Try saying in chat |\n|:---|:---|\n| RoB 2.0 | \"Assess risk of bias with RoB 2.0\" |\n| RoB 1.0 | \"Assess with Cochrane RoB 1.0\" |\n| ROBINS-I | \"Non-randomized study — use ROBINS-I\" |\n| RoB summary plot | \"Draw the stacked risk-of-bias summary bar plot\" |\n| GRADE | \"Do a GRADE evidence-quality assessment\" |\n| CINeMA (network evidence) | \"Assess the NMA with the CINeMA six domains\" |\n| PRISMA checklist | \"PRISMA checklist\" |\n\n---\n\n---\n\n## 2.1 Supported Figures (23)\n\nThe skill renders **23 analysis figures** on the cloud coze R engine. Pass the plot type via the `plots` field. `prisma_flow` / `prisma` and `rob` / `rob2` resolve to the same figure.\n\n| # | Plot type | 中文名 | English name | Analysis area | Purpose |\n|:---:|:---|:---|:---|:---|:---|\n| 1 | `forest` | 森林图 | Forest plot | Pairwise / NMA | Pooled effect-size summary |\n| 2 | `funnel` | 漏斗图 | Funnel plot | Pairwise | Publication-bias visual |\n| 3 | `prisma_flow` | PRISMA 流程图 | PRISMA flow diagram | Systematic review | Four-stage screening flow |\n| 4 | `rob` / `rob2` | 偏倚风险图 | RoB traffic-light / summary | Study quality | Cochrane RoB 1.0 / 2.0 |\n| 5 | `cumulative` | 累积 Meta 图 | Cumulative meta plot | Pairwise | Accumulated by study order |\n| 6 | `baujat` | Baujat 图 | Baujat plot | Heterogeneity | Heterogeneity contributor |\n| 7 | `labbe` | L'Abbe 图 | L'Abbe plot | Pairwise (binary) | Effect-consistency check |\n| 8 | `radial` | Radial 图 | Radial / Galbraith plot | Heterogeneity | Radial heterogeneity view |\n| 9 | `sucra` | SUCRA 排名图 | SUCRA ranking plot | NMA | Intervention rank probability |\n| 10 | `egger` | Egger 回归散点图 | Egger's regression plot | Bias | Quantitative bias test |\n| 11 | `contribution` | NMA 贡献图 | NMA contribution plot | NMA | Design / comparison contribution |\n| 12 | `loo` | 留一法影响图 | Leave-one-out plot | Sensitivity | Sensitivity analysis |\n| 13 | `gosh` | GOSH 图 | GOSH plot | Heterogeneity | Heterogeneity pattern clusters |\n| 14 | `bubble` | 气泡图 | Bubble plot | Meta-regression | Covariate–effect relationship |\n| 15 | `netgraph` | 网络关系图 | Network graph | NMA | Evidence-network structure |\n| 16 | `dose_resp` | 剂量反应图 | Dose-response plot | Dose-response | Dose–effect relationship |\n| 17 | `drapery` | Drapery 图 | Drapery plot | Sensitivity | α robustness |\n| 18 | `sroc` | SROC 曲线 | SROC curve | Diagnostic MA | Diagnostic accuracy |\n| 19 | `tsa` | 试验序贯分析图 | Trial sequential analysis | TSA | Evidence sufficiency / required N |\n| 20 | `power` | 功效曲线 | Power curve | Power | Statistical power |\n| 21 | `influence` | 影响诊断图 | Influence diagnostic plot | Sensitivity | Single-study omission impact |\n| 22 | `nodesplit` | 节点拆分图 | Node-splitting plot | NMA | Local inconsistency |\n| 23 | `trimfill` | 剪补法漏斗图 | Trim-and-fill funnel plot | Bias | Bias-corrected funnel |\n\n> Note: `netleague` (NMA league table) is a **tabular** output, not a figure, so it is excluded from the count of 23.\n\n## 3. First-Time FAQ\n\n**Q: I only gave effect size and study count, no other parameters — will it still compute?**\nA: Yes. Most analyses need only 3 items — effect size (or rate / HR) + α + power. Omitted parts (two-sided α=0.05, 1:1 randomization, follow-up) are filled with sensible defaults; if something truly required is missing, the assistant will ask.\n\n**Q: Is the n in the result per group or total?**\nA: By default it's **per group**; paired / crossover designs report per-sequence, and survival often reports total events needed. The output always labels this clearly.\n\n**Q: Does the analysis run as soon as I describe a request?**\nA: Yes. Once you describe the request, the assistant **auto-executes** and returns the real numbers + figures — no extra trigger word needed. Computation runs on the cloud coze R engine (data disclosure in Section 5).\n\n**Q: I want the reproducible R code for submission or audit — how do I ask?**\nA: Say **\"give me the full R code\"**. Every analysis returns reproducible R code (with R and package versions), which you can copy, modify, and re-run yourself.\n\n**Q: On a Chinese system, is the output in Chinese?**\nA: Yes. By default the output language follows your OS language setting — Chinese on a Chinese-OS, English otherwise. This default requires no extra permission and only affects display language; you can force-switch anytime via a prompt (e.g. \"用中文回复\" / \"switch to English\").\n\n**Q: My data is in SPSS/Excel/Stata format — what do I do?**\nA: Say **\"help me convert my SPSS/Excel data to CSV\"** — the assistant will recommend installing `@skill:statdata-transfer` for 50+ format conversions.\n\n**Q: What if my data must stay confidential?**\nA: Run the whole analysis with **simulated / placeholder data**, then ask the skill for the **full reproducible R code** and run it yourself locally with your real data. The skill itself only sends your **analysis parameters / summary statistics** (event counts, sample sizes, effect sizes) to the cloud coze R engine — it **never touches your raw datasets or individual-patient records** (unless you explicitly choose to run an IPD analysis through the cloud, in which case sending IPD to the cloud is your decision).\n\n**Q: What if I found an error in the result — how do I report it?**\nA: This skill follows the standard bug-report workflow. If you suspect the result is wrong (or the engine errored), just say **\"report a bug\" / \"上报问题\" / \"提交错误报告\"**. The skill also **proactively asks** whether to report when it detects a likely defect (e.g. the engine errors or retries still fail) — at most **once per session**, and you can always decline. Either way, the assistant will:\n1. **Propose a sanitized report** (11-field whitelist: skill / skill_version / test / error_type / error_code / engine_status / description / locale / query_origin / session_hash / attempts — **no raw input values or personal data**, except the `description` field where you decide what to disclose, e.g. the algorithm/function used and the error message);\n2. **Show the full report text for your review** — you can add a problem description or correct anything before confirming;\n3. **Send after your explicit confirmation** — to the unified endpoint `https://ct-bugreport.coze.site/run` (if this session called coze) or, if purely local, **save the sanitized report locally and show you the author contact** so you can email it yourself if you choose (the skill itself does not send it; data never leaves your machine unless you email it);\n4. **Receive an acknowledgment** — including whether a previously submitted report from your source has already been fixed (with the fix note) or is still pending.\n\nYou stay in full control: the report is shown to you **before** anything is sent, and nothing is transmitted without your explicit \"send\" confirmation.\n\n---\n\n## 4. Execution Model\n\n- **Auto-execution:** Once you describe a request, the skill **auto-executes** the analysis and returns real numbers + figures — no extra trigger word or confirmation needed. Computation runs on the cloud coze R engine by default.\n- **Default compute path:** The skill sends the analysis request to the cloud coze R engine (`https://ct-meta.coze.site/run`) (data disclosure in Section 5).\n- **Reproducible code:** Every analysis returns reproducible R code (with R + package versions); say **\"give me the full R code\"** to obtain it for submission or audit.\n- **Outbound authorization:** The default endpoint is pre-approved and runs automatically; a custom endpoint (`COZE_META_ENDPOINT`) asks for confirmation on first use (see Section 5).\n- **Output is for reference only** — validate before journal submission or regulatory use.\n\n---\n\n## 5. Data & Privacy\n\nThe skill sends data externally in **two** situations: ① when you describe an analysis request, the skill **auto-sends** the analysis request to execute; ② when you confirm sending an error report. **Neither sends personal identifiers.**\n\n**5.1 Analysis request (cloud computation)**\n- **What is sent:** your **analysis data** — **summary statistics** such as study event counts / sample sizes / effect sizes. No personal identifiers; payloads are sanitized before sending.\n- **When:** the skill **auto-sends** after you describe a request; **before the first outbound call each session**, the skill gives you a one-time spoken disclosure of what is sent and to which endpoint (then executes automatically, without per-call confirmation).\n- **Endpoint:** default `https://ct-meta.coze.site/run` (pre-approved in `adapters/config.json` `auto_approve_endpoints`). A custom endpoint (`COZE_META_ENDPOINT`) asks for confirmation on first use (AUTH-BLOCK), and is persisted to the whitelist after you approve.\n- **If declined:** the skill returns a clear \"cloud analysis not used\" message.\n\n**5.2 Metadata sent with the request**\nEach request also carries two metadata fields (**in both the analysis request and the error report**):\n- `query_origin`: a SHA-256 hash of your machine hostname, used only for server-side attribution / rate-limiting — **not** your plaintext hostname;\n- `locale`: your OS language, for bilingual output.\n\nNeither is used to identify you personally.\n\n**5.3 Error report**\n- **What is sent:** **only** the 11-key whitelist envelope (skill / skill_version / test / error_type / error_code / engine_status / description / locale / query_origin / session_hash / attempts) — **no analysis data and no personal identifiers**. `description` is the only free-text field, and you review it before consent (hard boundary: no identifiable person/institution/subject info).\n- **Endpoint:** unified bug-report endpoint `https://ct-bugreport.coze.site/run`.\n- **If declined:** nothing is sent; if there is no cloud call this session, the report is saved locally instead (`save_local_report`, data never leaves the machine).\n\n> **In one sentence:** your **analysis summary data** is **auto-sent** to the cloud after you describe a request (with a one-time disclosure before the first outbound call each session); **error reports** go to the unified endpoint only after your confirmation; the two metadata fields (`query_origin` hash + `locale`) are for anonymous attribution. Raw data and individual records never leave your machine.\n\n---\n\n## 6. Advanced Reference (moved to a separate file)\n\nCLI examples, bidirectional solving, curve mode, core formulas, system requirements, common errors, full file structure, and references for developers have been moved to **[references/ADVANCED.md](references/ADVANCED.md)**. Ordinary users don't need it; see Sections 1-5 for daily use.\n\n---\n\n**Version**: v2.20.1 | **License**: MIT | **Authors**: medstatstar, phoe-zip\n\nFor feature requests, bug reports, or other feedback, please contact the author directly at medstatstar@gmail.com (Wintone Zhang / 张文彤).\n\n---\n\n## Confidentiality Notice\n\n> The CT series consists of 20+ specialized domain skills, organized into **two tiers — A, B** — by \"whether the input contains confidential information\" (network / egress / publish are independent orthogonal attributes; see ct-base §11), providing full coverage of the entire new-drug clinical trial (Clinical Trial) lifecycle.\n>\n> - **Tier A (non-confidential input)**: run fully locally using only ordinary data; Tier A may need external public retrieval but involves no confidential information. These skills are published openly on GitHub.\n> - **Tier B (confidential input)**: accept strictly confidential clinical-trial data / protocols / CRFs from pharma sponsors (e.g., ct-analysis, ct-sdtm, ct-protocol, ct-eligibility); Tier B is processed locally and never leaves the boundary (egress=none), or additionally requires policy approval (egress=approval-req, e.g. ct-eligibility). Tier B packages contain zero confidential data but are NOT publicly published (stays fully local) — confidential input never ships with the package or leaves the machine. For custom / on-prem deployment, contact the author.\n>\n> 📧 Contact: medstatstar@gmail.com (Wintone Zhang / 张文彤)\n\nFile v2.20.1:references/design/ccm/README.md\n\n# CCM — Conversation Context Menu / 对话上下文菜单（设计归档）\r\n\r\n> **状态：设计完成 · 已实现（2026-09-10）。** 本目录只放设计文档；\r\n> **可运行代码在 `scripts/flow_menu.py`，规范版在 `references/conversation_flow_menu.md`，\r\n> 回归在 `tests/test_flow_menu.py`（153 PASS / 0 FAIL）。** 以规范版为准，本目录仅存设计过程。\r\n> **背景：** 工作台（`adapters/workbench/`）已有完整的 12 节点渲染契约（`form_schema.py`）与 HITL 状态机（`adapters/fullflow.py`），但**对话侧没有菜单**——每轮展示什么、闸位有哪些选项，全靠 LLM 即兴，同一节点两次渲染可能不一致。\r\n> CCM 的目标是给同一套 schema 加一层「对话投影」，**不新建第二套流程定义**。\r\n\r\n---\r\n\r\n## 归档清单\r\n\r\n| 文件 | 状态 | 内容 |\r\n|---|---|---|\r\n| **`10_A_stage_menu_spec_v1.0.md`** | 🗄 已被收编 | A 阶段四节点菜单规格 —— **内容已收编进规范版 `references/conversation_flow_menu.md`，以那份为准**；此处仅存设计过程 |\r\n| `03_v0.4_A2fix_A3_contract.md` | ✅ 已实施 | A2 解释器路径修复记录（含端到端回归证据）+ A3 纯文件交接契约 + A4 按清单直下 |\r\n| `02_v0.3_A2A3_handoff.md` | ✅ 已实施 | A2/A3 向 ct-literature 移交的可行性评估、简化后菜单、风险 |\r\n| `01_framework_v0.2_draft.md` | 📐 框架草案 | 三层菜单（L0 导航条 / L1 节点菜单 / L2 字段菜单）+ **操作四策略分流**（原生迁移 · 降级简化 · 文件交接 · **跳过转出**）+ 四问判定 + `defer` 语义 |\r\n| `00_framework_v0.1_superseded.md` | 🗄 存档 | 最初框架，已被 v0.2 取代（保留备查） |\r\n\r\n> ⚠️ 阅读顺序：先 `01`（拿框架与分流规则），再 **`references/conversation_flow_menu.md`**（拿现行规范与落地细节）。`02`/`03` 是已实施的改动记录，`00`/`10` 可跳过。\r\n>\r\n> **实测遗留（2026-09-10）**：规范版 **§7.1 会话版本漂移** + **§8 的 D18 / D19**\r\n> （A4 下载配额与菜单未暴露 `fetch_log`）来自真实会话验收，**尚未修复**，交接前先读那两节。\r\n\r\n---\r\n\r\n## 框架要点（来自 `01`，尚未实现）\r\n\r\n**三层菜单**\r\n- **L0 上下文导航条** —— 12 节点压一行，每轮必贴（解决「每轮无位置感」）\r\n- **L1 节点菜单** —— 节点头 + 数据摘要 + 该节点专属选项\r\n- **L2 字段菜单** —— 只列该节点 `EDITABLE_KEYS`；全局指令 `/flow` `/node` `/rewind` `/explain` `/raw` `/workbench` `/export`\r\n\r\n**操作四策略**（对话侧不是工作台的能力等价物）\r\n\r\n| 策略 | 判据 | 例 |\r\n|---|---|---|\r\n| 原生迁移 | 读 + 单决策 | 9 个节点的主体面板 |\r\n| 降级简化 | 可自动化掉人工步骤 | 上传按 DOI/标题自动匹配，只问未匹配项 |\r\n| 文件交接 | >10 条逐条编辑，表格更合适 | A3 裁决表（⬇ 导出 / ⬆ 传回） |\r\n| **跳过转出** | 需视觉/空间信息、多选拖拽指派 | PDF 页码预览、文件↔条目映射 |\r\n\r\n**四问判定**（命中任一即转出，不进对话）\r\n1. 需要视觉/空间信息（PDF 页面、图片、并排）？\r\n2. 涉及 >10 条记录逐条编辑？\r\n3. 需要多选/拖拽/指派（文件↔条目映射）？\r\n4. 只是读 + 单决策？→ 优先进\r\n\r\n**`defer` ≠ `skip`（关键概念）**\r\n\r\n| | `skip` | `defer` |\r\n|---|---|---|\r\n| 含义 | 本会话不再停靠该节点，按默认值放行 | 人工动作**未完成**，流程**不得前进** |\r\n| 适用 | 仅软停 | 任意节点，尤其 🔴 |\r\n| 审计 | 写 `human_decisions` | **不写**，改写 `pending_actions`（双端共享待办） |\r\n| 效果 | 下游继续跑 | 闸位保持，`approve` 被拒 |\r\n\r\n> **混淆这两者 = 让红线的人工核验被静默绕过。** 因此 `pending_actions` 非空时须在**脚本层**直接拒绝放行，不靠提示词约束。\r\n\r\n**选项穷举原则** —— GUI 的选项是「可见的」，对话里用户不知道有哪些选项，所以**选项必须由我方穷举编号**（禁止「你要继续吗？」这类开放式问法）；≤3 个用卡片，≥4 用编号文本菜单；🔴 节点选项集中**禁止出现「跳过」**（由 `_REDLINE_GATES` 派生过滤）。\r\n\r\n---\r\n\r\n## 实现时的硬约束\r\n\r\n1. **状态真源只有一个**：复用工作台 `fullflow_session_ff-*.json`，CCM 不另起一套。收益是**对话 ↔ 工作台可中途无缝互切**。\r\n2. **菜单由代码产出、LLM 只转述** —— 避免同节点两次渲染不一致。\r\n3. **`/rewind` 候选集须服务端派生** —— `workbench.html:737` 的候选枚举是纯 JS（块序 + 块内次序 + `curIdx=-1`），对话侧**不可重写这套逻辑**（第二份真源必然漂移），应从 `/api/session` 的 `progress`/`next_human_action` 派生。\r\n4. **🔴 选项由 `cc._REDLINE_GATES` 派生** —— 不硬编码第二份清单。\r\n5. **不干扰纯算数请求** —— 「合并这 5 项 OR」/ NMA / 敏感性分析等**完全不出现 CCM**，保住「描述即执行」卖点。\r\n6. **回显块前缀分离** —— CCM 用 `## 当前流程设定 / Current pipeline settings:`，与计算轨道的 `## 当前分析设定:` 互不覆盖。\r\n\r\n---\r\n\r\n## 待落地清单\r\n\r\n> ⚠️ **以下清单已于 2026-09-10 落地**（`scripts/flow_menu.py` + `tests/test_flow_menu.py`）。\r\n> 保留原文仅作设计意图对照；实现细节与偏差以 `references/conversation_flow_menu.md` 为准。\r\n\r\n| 项 | 说明 |\r\n|---|---|\r\n| `scripts/flow_menu.py` | 确定性 render / status / decide / rewind |\r\n| `form_schema.py` `menu_for()` | 12 节点 → 对话投影 |\r\n| `references/conversation_flow_menu.md` | 规范（当前内容即本目录 `10_A_stage_menu_spec_v1.0.md`） |\r\n| `adapters/fullflow.py` | 加 `pending_actions` + `pending` 闸态（**核心状态机改动，须同步 `contracts/fullflow/v0.1.0/SPEC.md`**） |\r\n| `tests/` | 冒烟：12 节点 × zh/en 无缺键；🔴 节点菜单不含 skip；软停节点含 skip |\r\n| `references/interactive_menu.md` / `references/speed-discipline.md` / `SKILL.md` | 小改 |\r\n\r\n**实现时的实际偏差（3 处，均已在规范版记录）**\r\n1. 未新增 `form_schema.menu_for()`——投影实现在 `flow_menu.py` 内（避免 form_schema 反向依赖 fullflow）；\r\n   仅向 form_schema **增量**加了 `TITLE_EN` + `title_for()` 以支持 en 标题。\r\n2. `pending_actions` 闸态**仍未加**（D8）——A4 非 OA 未补传的拦截暂未闭合，属未决项。\r\n3. `A1/A2/A3` 的 `by_source 缺库` 判据改为**保守版**：不拿「可调度源全集」当期望（必然误报），\r\n   改为 `status≠ok` / 空结果 / 仅 1 库 硬判 + `--expected-sources` 显式比对。\r\n\r\n**归属**：先在 meta 内验证，稳定后可回写 ct-base 作第三原型 Type-Flow（D6，二期）。\n\nFile v2.20.1:_meta.json\n\n{\n  \"ownerId\": \"kn7amqq1jv28skb63wavr6shah89jsm5\",\n  \"slug\": \"meta-analysis\",\n  \"version\": \"2.20.1\",\n  \"publishedAt\": 1791548527882\n}\n\nFile v2.20.1:references/advanced_analysis.md\n\n# Advanced Analysis Methods / 高级分析方法\n\n## 目录 / Table of Contents\n\n1. [多水平元分析 (Multilevel Meta-Analysis)](#1-多水平元分析)\n2. [多元元分析 (Multivariate Meta-Analysis)](#2-多元元分析)\n3. [IPD 元分析 (Individual Patient Data)](#3-ipd-元分析)\n4. [贝叶斯网状 Meta 分析](#4-贝叶斯网状-meta-分析)\n5. [元分析中的因果推断](#5-元分析中的因果推断)\n6. [剂量反应 Meta 分析](#6-剂量反应-meta-分析)\n7. [罕见事件 Meta 分析](#7-罕见事件-meta-分析)\n8. [预测区间与 prognostic](#8-预测区间)\n\n---\n\n## 1. Multilevel Meta-Analysis / 多水平元分析\n\n**适用于**：同一研究报告多个结局、多组比较、或研究间存在聚类结构。\n\n### 1.1 Three-Level Model / 三水平模型\n\n```r\nlibrary(metafor)\n\n# Level 1: 抽样方差\n# Level 2: 研究内（多结局/多组）\n# Level 3: 研究间\n\nmlma_result <- rma.mv(\n  yi = yi,\n  V = vi,\n  random = list(~ 1 | study_id, ~ 1 | outcome_id),\n  data = mlma_data,\n  method = \"REML\"\n)\n\n# 输出方差成分\nprint(mlma_result)\n\n# 跨层异方差\nmlma_het <- rma.mv(\n  yi = yi,\n  V = diag(tau2_within) + diag(tau2_between),\n  random = list(~ 1 | study_id, ~ 1 | outcome_id),\n  data = mlma_data,\n  method = \"REML\",\n  control = list(optimizer = \"optim\")\n)\n```\n\n### 1.2 Multi-Arm Study Handling / 多臂研究处理\n\n```r\n# 多臂研究（Bolding et al. 处理方法）\n# 需要构建方差-协方差矩阵\n\nlibrary(metafor)\n\n# 构建 covariances 矩阵 for multi-arm studies\n# CS 结构（复合对称）\nV_matrix <- lapply(unique(mlma_data$study_id), function(s) {\n  sub <- mlma_data[mlma_data$study_id == s, ]\n  k <- nrow(sub)\n  vi <- sub$vi\n  tau2 <- mlma_result$sigma2[1]\n  \n  V <- matrix(tau2, nrow = k, ncol = k)\n  diag(V) <- vi\n  V\n})\n\n# 运行多水平模型\nlibrary(clubSandwich)\nmlma_result <- rma.mv(\n  yi = yi,\n  V = V_matrix,\n  random = ~ 1 | study_id/outcome_id,\n  data = mlma_data,\n  method = \"REML\"\n)\n```\n\n---\n\n## 2. Multivariate Meta-Analysis / 多元元分析\n\n**适用于**：同时分析多个相关结局（如血压的收缩压和舒张压）。\n\n```r\nlibrary(metafor)\n\n# 准备数据：需要多个结局 per study\n# study_id, outcome_type, yi, vi\n\nmvma_result <- rma.mv(\n  yi = yi,\n  V = vi_matrix,\n  random = ~ outcome_type | study_id,\n  struct = \"UN\",  # 非结构化协方差\n  data = mvma_data,\n  method = \"REML\"\n)\n\n# 提取研究间方差成分\nsigma <- mvma_result$sigma2\ncat(\"Between-study variance for outcome 1:\", sigma[1], \"\\n\")\ncat(\"Between-study variance for outcome 2:\", sigma[2], \"\\n\")\ncat(\"Between-study covariance:\", mvma_result$rho * prod(sqrt(sigma)), \"\\n\")\n\n# 模型比较\nmvma_CS <- rma.mv(yi, vi_matrix, random = ~ outcome_type | study_id,\n  struct = \"CS\", data = mvma_data)\nmvma_UN <- rma.mv(yi, vi_matrix, random = ~ outcome_type | study_id,\n  struct = \"UN\", data = mvma_data)\n\nanova(mvma_CS, mvma_UN)  # 检验结构选择\n```\n\n---\n\n## 3. IPD Meta-Analysis / IPD 元分析\n\n**适用于**：获得原始个体参与者数据（最理想情况）。\n\n```r\nlibrary(ipdmeta)\n\n# IPD 格式: study_id, patient_id, treatment, outcome, covariates\n# 两步法\n\n# Step 1: 每项研究拟合 IPD 模型\nipd_within <- lapply(unique(ipd$study_id), function(s) {\n  sub <- ipd[ipd$study_id == s, ]\n  glm(outcome ~ treatment + age + sex, data = sub, family = binomial)\n})\n\n# Step 2: 汇总各研究效应\neffect_estimates <- sapply(ipd_within, function(m) coef(m)[\"treatment\"])\nstandard_errors <- sapply(ipd_within, function(m) summary(m)$coefficients[\"treatment\", \"Std. Error\"])\n\n# 合并\ntwo_step_result <- metagen(\n  TE = effect_estimates,\n  seTE = standard_errors,\n  sm = \"OR\"\n)\n\n# 一步法（混合效应模型）\none_step_result <- glm(\n  outcome ~ treatment + age + sex + factor(study_id) + treatment:study_id,\n  data = ipd,\n  family = binomial\n)\n```\n\n---\n\n## 4. Bayesian Network Meta-Analysis / 贝叶斯网状 Meta 分析\n\n**适用于**：≥3 种干预需要排序，考虑先验信息。\n\n```r\nlibrary(gemtc)\nlibrary(rjags)\n\n# 准备数据\n# study, treatment, responders, sampleSize（二分类）\n# 或 study, treatment, mean, sd, sampleSize（连续型）\n\n# 创建 network 对象\nnetwork <- mtc.network(\n  data.ab = gemtc_data,\n  description = \"Network meta-analysis\",\n  treatments = treatments_list\n)\n\n# 构建一致性模型\nmodel <- mtc.model(\n  network,\n  type = \"consistency\",\n  linearModel = \"random\",\n  n.chain = 4,\n  likelihood = \"binom\",\n  link = \"logit\"\n)\n\n# 运行 MCMC\nresults <- mtc.run(model, n.adapt = 5000, n.iter = 20000, thin = 10)\n\n# 一致性检验: 节点拆分\nsplit <- mtc.nodesplit(network, linearModel = \"random\")\n\n# 结果\nresults  # 联赛表\nforest(results)\n\n# SUCRA（Surface Under Cumulative Ranking）\nrank_probs <- rank.probability(results)\nsucra <- cumrank(rank_probs)\n\n# 收敛诊断\ngelman.diag(results)\nplot(results)  # 后验密度图\n```\n\n### 4.1 Advanced Bayesian NMA / 贝叶斯 NMA 进阶\n\n```r\n# 加入协变量调整\nnetwork$studies$duration <- c(8, 12, 24, 16)  # 研究持续时间\n\n# 回归调整\nmodel_adjusted <- mtc.model(\n  network,\n  type = \"regression\",\n  regressor = list(\n    coefficient = \"shared\",\n    coefficient = \"off\",\n    \"duration\"\n  ),\n  linearModel = \"random\"\n)\n```\n\n---\n\n## 5. Causal Inference in Meta-Analysis / 元分析中的因果推断\n\n**适用于**：目标 trial emulation（在观察性研究 meta 中模拟 RCT）。\n\n```r\nlibrary(metafor)\nlibrary(WeightIt)\n\n# 计算逆方差权重\nipd_data$propensity <- glm(treatment ~ cov1 + cov2 + cov3,\n  data = ipd_data, family = binomial)$fitted\n\nipd_data$iptw <- ifelse(ipd_data$treatment == 1,\n  1 / ipd_data$propensity,\n  1 / (1 - ipd_data$propensity))\n\n# 加权元分析\nweighted_rma <- rma(\n  yi = yi,\n  vi = vi,\n  weights = iptw,\n  data = ipd_data,\n  method = \"REML\"\n)\n```\n\n---\n\n## 6. Dose-Response Meta-Analysis (dosresmeta run_dose_resp) / 剂量反应 Meta 分析（dosresmeta 封装 run_dose_resp）\n\n**适用于**：评估暴露剂量与疾病风险的（线性/曲线）关系。\n\n> ✅ **优先调用封装** `run_dose_resp()`（在 `advanced_functions.R`）。它已固化两处关键区分与\n> 易错点，避免手写 dosresmeta 时踩坑：\n> 1. **模型形状**（线性/二次曲线）由 `shape` 控制并写入 formula —— **不要**用 `type` 或\n>    虚构的 `degree` 参数来控制形状（dosresmeta 无 `degree`）。\n> 2. dosresmeta 的 `type` 参数**专指二分类的“研究设计”**（`cc`=病例对照 / `ci`=累积发病 /\n>    `ir`=发病率），经 `study_design` 传入（列名或统一字符串）。\n> 3. 协方差近似 `covariance` 合法值：`gl / h / md / smd / user / indep`（**无 \"ho\"**）。\n>    缺省：二分类 `gl`，连续型 `smd`。\n\n```r\nsource(\"src/r_engine/advanced_functions.R\")\n\n# ---- 二分类结局（logRR/logOR + cases + n + 研究设计 type）----\ndata(alcohol_cvd)   # cols: id/author/type/dose/cases/n/logrr/se\ndr_lin <- run_dose_resp(\n  yi = \"logrr\", dose = \"dose\", id = \"id\", data = alcohol_cvd,\n  outcome = \"binary\", shape = \"linear\",\n  se = \"se\", cases = \"cases\", n = \"n\",\n  study_design = \"type\"        # 列名，值为 cc/ci\n)                              # -> gl 协方差近似\n\ndr_quad <- run_dose_resp(       # 二次曲线：logrr ~ dose + I(dose^2)\n  yi = \"logrr\", dose = \"dose\", id = \"id\", data = alcohol_cvd,\n  outcome = \"binary\", shape = \"quadratic\",\n  se = \"se\", cases = \"cases\", n = \"n\", study_design = \"type\"\n)\n\n# ---- 连续型结局（均数 + sd + n）----\ndata(ari)                       # cols: id/author/dose/y/sd/n\ndr_cont <- run_dose_resp(\n  yi = \"y\", dose = \"dose\", id = \"id\", data = ari,\n  outcome = \"continuous\", shape = \"linear\",\n  sd = \"sd\", n = \"n\"           # -> smd 协方差近似\n)\n\n# 返回 list(fit, plot)；plot 为剂量-反应曲线(含 95%CI 带)，参照点取最小剂量\nsummary(dr_lin$fit)\nif (!is.null(dr_lin$plot)) print(dr_lin$plot)\n```\n\n---\n\n## 7. 罕见事件 Meta-Analysis / 罕见事件Meta分析\n\n**适用**：多项研究零事件时传统方法偏倚。\n\n```r\n# 7.1 Peto 法（仅 OR，一阶近似）\npeto_or <- metabin(\n  event.e = event_exp,\n  n.e = n_exp,\n  event.c = event_ctrl,\n  n.c = n_ctrl,\n  studlab = study,\n  data = meta_data,\n  sm = \"OR\",\n  method = \"Peto\"\n)\n\n# 7.2 Mantel-Haenszel + 连续性校正\nmh_or_corrected <- update(\n  peto_or,\n  method = \"MH\",\n  incr = 0.5  # Haldane 校正\n)\n\n# 7.3 贝叶斯方法（推荐用于零事件）\nlibrary(bayesmeta)\n\nbayes_zero <- bayesmeta(\n  y = yi,\n  sigma = sqrt(vi),\n  labels = study,\n  mu.prior = c(mean = 0, sd = 2),  # 保守先验\n  tau.prior = function(t) dhalfnormal(t, scale = 1)\n)\n```\n\n---\n\n## 8. Prediction Interval / 预测区间\n\n```r\n# 预测区间 — 衡量新研究可能落入的范围\nlibrary(metafor)\n\nresult <- rma(yi, vi, data = effect_data, method = \"REML\")\n\npred_lower <- result$beta[1] - qt(0.975, df = k - 2) *\n  sqrt(result$tau2 + result$se^2)\n\npred_upper <- result$beta[1] + qt(0.975, df = k - 2) *\n  sqrt(result$tau2 + result$se^2)\n\ncat(sprintf(\"95%% CI: [%.3f, %.3f]\\n\", result$ci.lb, result$ci.ub))\ncat(sprintf(\"95%% PI: [%.3f, %.3f]\\n\", pred_lower, pred_upper))\n\n# 可视化: 森林图加预测区间\nforest(result,\n  addpred = TRUE,\n  header = TRUE,\n  xlab = \"Log Odds Ratio\",\n  slab = study_names,\n  alim = c(-3, 3),\n  steps = 5,\n  psize = 1,\n  efac = 1,\n  col = \"#0072B2\"\n)\n```\n\n---\n\n## 9. Model Diagnostics in Meta-Analysis / 元分析中的模型诊断\n\n```r\n# 影响分析\ninfluence_result <- influence(result)\nprint(influence_result)\nplot(influence_result)\n\n# 标准化 residuals\nrstandard(result)\n\n# Cook's distance\ncooks.distance(result)\n\n# DFFITS 准则\ndffits(result)\n\n# 影响力森林图（仅保留 influential studies 高亮）\nforest(result,\n  subset = !cooks.d > 4/length(yi),\n  col = c(\"#E69F00\", \"#0072B2\")[as.numeric(cooks.d > 4/length(yi)) + 1]\n)\n```\n\n---\n\n## 10. Sample Size Planning & Power Analysis / 样本量规划与功效分析\n\n> **优先调用封装** / Prefer the wrapper: `source(\"src/r_engine/advanced_functions.R\")` →\n> `run_power_curve()`。该函数**自实现无外部依赖**（Valentine/Borenstein 功效公式，\n> 含固定效应与随机效应 I² 校正双曲线），返回 `$data` / `$plot` / `$k_needed` / `$v_study`，\n> 比 `metapower` / `dmetar` 更稳健（避免包缺失/API 变动）。\n\n```r\nsource(\"src/r_engine/advanced_functions.R\")\n\n# 功效曲线: 固定研究间样本量，研究数 k 从 2 到 30 时功效如何变化\npc <- run_power_curve(\n  effect       = 0.3,     # 预期效应量 (d)\n  n1 = 50, n2 = 50,       # 每研究两组样本量\n  k_range      = 2:30,    # 研究数扫描范围\n  i2           = 0.5,     # 异质性 (0–1)\n  measure      = \"d\",\n  sig_level    = 0.05,\n  target_power = 0.80\n)\n\npc$k_needed          # 达到 80% 功效所需的最少研究数（随机效应，含 I²）\nprint(pc$plot)       # ggplot 功效曲线（固定 vs 随机双线 + 目标功效参考线）\nggsave(\"power_curve.png\", pc$plot, width = 8, height = 5, dpi = 300)\n```\n\n### 备选：metapower::mpower()（如需其可视化）\n\n```r\nlibrary(metapower)   # 若缺失，请手动安装 metapower 包\n\n# 注意真实 API 参数名（非 power_d，此函数不存在）\nmp <- mpower(\n  effect_size = 0.3,   # 预期效应量\n  study_size  = 100,   # 每研究总样本量 (n1+n2)\n  k           = 15,    # 研究数量\n  i2          = 0.5,   # 异质性\n  es_type     = \"d\"    # d | or | r\n)\nprint(mp)            # mp$power 观测功效; plot_mpower(mp) 出图\n```\n\nFile v2.20.1:references/advanced_api.md\n\n# API Reference / 接口参考\r\n\r\n> 本文件集中收录技能的复用接口（强制调用规则 + 函数清单 + 示例）。运行任何分析都必须 `source()` 对应脚本并调用下列函数，禁止从零编写完整分析脚本。\r\n\r\n## Reusable API / 复用接口（强制）\r\n\r\n> **规则：任何分析必须调用已有函数，禁止从零编写完整分析脚本。**\r\n> When running any analysis, ALWAYS `source()` the skill scripts and call the functions below — never rewrite the full pipeline inline.\r\n\r\n### 基础 API / Core API\r\n\r\n```r\r\n# 统一入口：效应量计算 + 模型拟合，返回 ma_result 对象\r\nsource(\"src/r_engine/meta_analysis_core.R\")\r\nres <- ma_analyze(data, type = \"rate\",            # binary|continuous|rate|precomp|survival\r\n                                               # |correlation|single_proportion|single_mean\r\n                  measure = \"IRR\",                # 自动选 OR/SMD/IRR/ZCOR/PLOGIT(PLO)/MN 等\r\n                  method = \"REML\", test = \"knha\")\r\n\r\n# 一行出图 + 摘要（森林图/漏斗图 SVG+PNG + results.md）\r\nma_save(res, outdir = \"output\", prefix = \"meta\")\r\n```\r\n\r\nFunctions: `ma_analyze()`(分发) · `calculate_effect_size()` · `run_meta_analysis()` · `analyze_heterogeneity()` · `analyze_publication_bias()` · `run_subgroup_analysis()` · `run_meta_regression()` · `run_sensitivity_analysis()` · `create_forest_plot()` · `create_funnel_plot()` · `generate_results_summary()` · `ma_save()`.\r\nColumn names are case-insensitive; override mapping via `cols = list(a=\"A\", b=\"B\", c=\"C\", d=\"D\")`.\r\n\r\n**Forest 5 themes**: `create_forest_plot(res, style = \"revman\")` — `style ∈ {revman, classic, modern, lancet, nejm}`（配色/菱形形状随主题切换）。\r\n\r\n### 高级诊断与可视化封装 / Advanced Diagnostics\r\n\r\n```r\r\n# 高级诊断/可视化封装：GOSH / Baujat / Drapery / Power / Bayesian pairwise / 诊断Meta / RoB\r\nsource(\"src/r_engine/advanced_functions.R\")\r\n\r\ng  <- run_gosh(res$model); plot_gosh(g)          # GOSH 敏感性(子集拟合密度散点)\r\nplot_baujat(res$model, top_n = 5)                # Baujat 异质性-影响力图(top_n 高亮标签)\r\nplot_drapery(es_data, labels, type = \"zvalue\")   # Drapery 置信曲线(meta::drapery)\r\npw <- run_power_curve(effect = 0.3, k_range = 2:30, i2 = 0.5)   # 功效曲线(自实现,无依赖) -> $k_needed\r\nbp <- run_bayes_pairwise(es_data, labels, tau_prior = \"halfnormal\")  # bayesmeta 两组贝叶斯\r\ndx <- run_diagnostic_meta(data, cols = list(TP=\"TP\",FP=\"FP\",FN=\"FN\",TN=\"TN\")); plot_sroc(dx)  # mada::reitsma 双变量 SROC\r\nplot_rob_traffic(rob_data, tool = \"ROB2\"); plot_rob_summary(rob_data)  # robvis 红绿灯/汇总图\r\n```\r\n\r\nAdvanced functions: `run_gosh()` · `plot_gosh()` · `plot_baujat()` · `plot_drapery()` · `run_power_curve()` · `run_bayes_pairwise()` · `run_diagnostic_meta()` · `plot_sroc()` · `plot_rob_traffic()` · `plot_rob_summary()`.\r\n缺依赖时自动给出友好安装提示（bayesmeta / mada / robvis / ggrepel）。\r\n\r\n## 重依赖封装函数 / Heavy-Dependency Wrappers\r\n\r\n```r\r\n# TSA 试验序贯分析：自实现，无需外部包（连续型 d / 二分类 or）\r\nts <- run_tsa(es_data, labels, effect_type = \"continuous\", d = 0.3)   # -> $RIS $cum_Z $crossed $plot\r\n\r\n# 剂量-反应：dosresmeta。shape 控制模型形状(线/曲)；binary 的 study_design 指研究设计(cc/ci/ir)\r\ndr1 <- run_dose_resp(yi=\"y\", dose=\"dose\", id=\"id\", data=ari,\r\n                     outcome=\"continuous\", shape=\"linear\", sd=\"sd\", n=\"n\")          # 连续型(smd)\r\ndr2 <- run_dose_resp(yi=\"logrr\", dose=\"dose\", id=\"id\", data=alcohol_cvd,\r\n                     outcome=\"binary\", shape=\"quadratic\",\r\n                     se=\"se\", cases=\"cases\", n=\"n\", study_design=\"type\")            # 二分类(gl)\r\n\r\n# 生存 Meta（run_surv_meta 现已本地用 metafor 逆方差合并 logHR）；贝叶斯 NMA 用 gemtc(JAGS)，multinma 为可选后端\r\nsm <- run_surv_meta(yi=\"loghr\", vi=\"v\", studlab=\"study\", data=hr_df, method=\"REML\")\r\nbn <- run_bayes_nma_multinma(prep, priors)     # multinma (Stan, 可选后端)\r\nbg <- run_bayes_nma_gemtc(data.ab, treatments, studies)   # gemtc (JAGS)\r\n```\r\n\r\nBatch-2 functions: `run_tsa()` · `run_dose_resp()` · `run_surv_meta()` · `run_bayes_nma_multinma()` · `run_bayes_nma_gemtc()`.\r\n⚠️ `run_tsa()`/`run_dose_resp()` 沙盒内已实跑验证；`run_surv_meta()` 现已本地实跑（metafor）；`run_bayes_nma_gemtc()` 需本机装 JAGS、`run_bayes_nma_multinma()` 需本机装 Stan 工具链，封装做友好提示，请在**本机**运行。\r\n📌 无 `meta::tes()`（`meta` 包不存在该函数，历史文档有误）；TSA 一律用自实现的 `run_tsa()`。\n\nFile v2.20.1:references/ADVANCED_zh-CN.md\n\n# 进阶参考 / Advanced Reference\r\n\r\n> 本文件面向**开发者与高级用户**。普通用户只需阅读[对话使用指南](interactive_menu.md)即可。\r\n>\r\n> This file is for **developers and advanced users**. Ordinary users only need the [How to Use in a Chat](interactive_menu.md) section.\r\n\r\n---\r\n\r\n## 1. CLI 调用示例 / CLI Invocation Examples\r\n\r\n### 通过 Python helper（技能侧）\r\n```bash\r\ncd meta-analysis\r\n# 探测 coze 端点可达性（不发起分析请求）\r\npython adapters/coze_client.py --health\r\n\r\n# 运行分析（委派给 coze R 引擎）\r\npython adapters/run_analysis.py ...\r\n\r\n# 走生产路径冒烟一次完整请求（自动带归因 + 去重）\r\npython scripts/run_meta.py <request.json>\r\n```\r\n\r\n> **coze 项目 R 引擎维护命令**（包安装、分发器运行、模块帮助等）**不在此发布**——它们位于\r\n> `adapters/coze/DEV.md`（已被 git/clawhub 忽略，不进入发布包），仅供 coze 项目维护者使用。\r\n\r\n### 直接调用 R（仅作参考——计算在 coze 端进行）\r\n```r\r\nlibrary(metafor)\r\n# 二分类 Meta\r\nres <- metabin(event.e, n.e, event.c, n.c, sm=\"OR\", method=\"DL\", data=my_data)\r\nforest(res)\r\nfunnel(res)\r\n```\r\n\r\n---\r\n\r\n## 2. 双向求解模式 / Bidirectional Solving\r\n\r\n当用户只有部分信息时，技能可双向求解：\r\n\r\n| 已知 | 求解 |\r\n|---|---|\r\n| n, power, α, 效应量 → | 验证 power |\r\n| power, α, 效应量, n → | 验证 n |\r\n| 观测 I², k, n → | 评估异质性水平 |\r\n\r\n---\r\n\r\n## 3. 曲线模式 / Curve 模式\r\n\r\n- **功效曲线**：效应量 → 不同 α 下的 power\r\n- **异质性曲线**：I² vs. 剔除每个研究（leave-one-out）\r\n- **NMA 排序曲线**：各治疗排序概率分布\r\n\r\n---\r\n\r\n## 4. 核心公式推导 / Core Formulas\r\n\r\n### 4.1 随机效应模型 (DL)\r\n```\r\nθ̂_DL = Σ(w_i · θ_i) / Σ(w_i)\r\nw_i = 1 / (v_i + τ̂²)\r\nτ̂² = (Q - (k-1)) / (Σw_i - Σw_i²/Σw_i)\r\n```\r\n\r\n### 4.2 效应量转换\r\n```\r\nCohen's d → logOR: logOR = d × π / √3\r\nd → Hedges' g: g = J × d, J = 1 - 3/(4df - 1)\r\nr → Fisher's z: z = 0.5 · ln((1+r)/(1-r))\r\nOR → logOR: logOR = ln(OR), SE = (ln(upper) - ln(lower)) / (2 × 1.96)\r\n```\r\n\r\n### 4.3 异质性\r\n```\r\nI² = 100% × (Q - df) / Q\r\nH² = Q / df\r\nτ² = (Q - (k-1)) / (Σw_i - Σw_i²/Σw_i)  [DL 估计量]\r\n```\r\n\r\n### 4.4 贝叶斯 NMA (Stan)\r\n```\r\ny_i ~ Normal(θ_i, σ_i²)\r\nθ_i = μ + τ · η_i\r\nη_i ~ Normal(0, 1)\r\n```\r\n\r\n---\r\n\r\n## 5. 系统与环境要求 / System & Environment Requirements\r\n\r\n### R 包（必需）\r\n| 包 | 版本 | 用途 |\r\n|---|---|---|\r\n| metafor | ≥3.0 | 核心 Meta 分析 (rma, escalc, forest, funnel) |\r\n| meta | ≥5.0 | Metabin, metacont, metaprop 等 |\r\n| netmeta | ≥2.0 | 频率学派 NMA |\r\n| bayesmeta | ≥3.0 | 贝叶斯两组 Meta |\r\n| multinma | ≥0.8 | 贝叶斯 NMA (Stan，可选后端) |\r\n| gemtc | ≥2.0 | 贝叶斯 NMA (JAGS) |\r\n| esc | ≥0.5 | 效应量转换 |\r\n| clubSandwich | ≥0.5 | CR2 稳健标准误 |\r\n| robumeta | ≥2.0 | RVE 处理依赖效应 |\r\n| dosresmeta | ≥2.0 | 剂量反应 Meta |\r\n| ~~survmeta~~ | — | 已下架，改用 metafor 逆方差合并 logHR |\r\n| mada | ≥1.0 | 诊断 Meta |\r\n| metagear | ≥0.7 | PRISMA 2020 流程图 (plot_PRISMA；仅 prisma_flow 任务用) |\r\n| ggplot2 | ≥3.0 | 可视化 |\r\n| gridExtra | ≥2.0 | 多面板图 |\r\n| forestploter | ≥1.1 | 出版级森林图（替代 ggforestplot） |\r\n| svglite | ≥2.0 | 可编辑 SVG 导出 |\r\n\r\n### Python（仅 helper）\r\n- Python 3.10+，**无需第三方包**（仅 stdlib）\r\n- 推荐 Anaconda：`C:\\Tools\\anaconda3\\python.exe`\r\n\r\n### 操作系统\r\n- Windows 10/11（主要），macOS，Linux\r\n- 大型 NMA 模型（Stan/JAGS）建议 8GB+ RAM\r\n\r\n---\r\n\r\n## 6. 常见错误排查 / Common Errors & Troubleshooting\r\n\r\n| 错误 | 原因 | 修复 |\r\n|---|---|---|\r\n| `R package not found` | 缺少 R 包 | `install.packages(\"pkg\")` |\r\n| `Stan model compilation failed` | 缺少 C++ 工具链 | 安装 Rtools (Windows) 或 Xcode (macOS) |\r\n| `MCMC did not converge` | 迭代次数不足或链混合差 | 增加 `iter`，检查 `Rhat > 1.01` |\r\n| `Fisher scoring algorithm did not converge` | 稀疏数据或极端效应量；REMLE 无法收敛 | **数据问题，非引擎 bug**。尝试改用 `method=\"ML\"` 或 `method=\"EB\"`、剔除离群研究、用亚组降低异质性，或 k<5 时直接用固定效应模型 |\r\n| 客户端输入校验类错误（`invalid 'pos'`、`NULL cov`、列长不匹配、`mean=NULL`） | 输入校验缺失：subset 位置越界、协变量为空、列长不等、缺少必填 `mean` | 检查输入：pos ≤ 研究数；协变量列必须在数据中；公式涉及列等长；必填参数补齐 |\r\n| `I² = 0%` 但可见异质性 | 检测异质性功效低 | 用 Q 检验 p 值，考虑随机效应 |\r\n| `Funnel plot asymmetry` | 真实发表偏倚或异质性 | 用 Egger 检验，考虑选择模型 |\r\n| `netmeta inconsistency` | 违反可传递性假设 | 检查 node-split，考虑 meta-regression |\r\n| `svglite output is raster` | 未安装 Cairo | 安装 Cairo R 包 |\r\n| `UnicodeDecodeError` | 非 UTF-8 字符 | 用 `cp1252` 或 `utf-8 + errors='replace'` |\r\n\r\n---\r\n\r\n## 7. 完整文件结构 / Full File Structure\r\n\r\n```\r\nmeta-analysis/\r\n├── SKILL.md                       # 技能主定义（英文正文，ct-base 对齐）\r\n├── AGENTS.md                      # 自改进约定（英文）\r\n├── CHANGELOG.md                   # 版本/整改记录\r\n├── README.md                      # 英文使用指南（顶部切换 README_zh-CN.md）\r\n├── README_zh-CN.md                # 中文使用指南（顶部切换 README.md）\r\n├── LICENSE                        # MIT\r\n├── requirements.txt               # R 包清单\r\n├── assets/\r\n│   ├── icon.svg                   # 技能 Logo\r\n│   └── icon.png                   # 位图版\r\n├── scripts/\r\n│   ├── i18n.py                    # 中英切换 helper（来自 ct-base）\r\n│   ├── r_libs.py                  # R 调用 + 校验 + 脱敏（来自 ct-base）\r\n│   ├── r_templates.py             # R 代码模板生成器\r\n│   ├── r_meta_analysis_core.py    # 核心引擎模板\r\n│   ├── r_effect_size_conversions.py\r\n│   ├── r_network_meta_analysis.py\r\n│   ├── r_stata_equivalents.py\r\n│   ├── r_advanced_functions.py\r\n│   ├── r_setup_packages.py\r\n│   ├── check_integrity.sh         # 完整性自检\r\n│   └── *.R                        # 生成的 R 脚本（via check_integrity.sh）\r\n├── references/\r\n│   ├── interactive_menu.md        # 对话使用指南\r\n│   ├── ADVANCED.md                # 英文进阶参考\r\n│   ├── ADVANCED_zh-CN.md          # 中文进阶参考\r\n│   ├── language_policy.md         # 双语策略（来自 ct-base）\r\n│   ├── report_template.md         # 报告骨架（来自 ct-base）\r\n│   ├── units.md                   # 原子任务单元索引\r\n│   ├── data_templates.md          # 分类型 CSV 模板\r\n│   ├── revman_complete.md         # RevMan → R 1:1 代码映射\r\n│   ├── stata_to_r_mapping.md      # Stata metareg/mvmeta → R 等价\r\n│   ├── advanced_analysis.md       # 多元/多水平/IPD/剂量反应\r\n│   ├── single_group_meta.md       # metaprop/metamean/metainc/metacor\r\n│   ├── survival_meta.md           # metafor + KM 伪个体数据\r\n│   ├── tsa_diagnostics.md         # TSA + Baujat + Drapery + 选择模型\r\n│   ├── diagnosis_meta.md          # mada 双变量 + SROC\r\n│   ├── bayesian_nma.md            # gemtc (主) / multinma (可选) 工作流\r\n│   ├── esc_robust_meta.md         # esc 转换 + RVE\r\n│   ├── review_workflow.md         # PRISMA 流程图 (metagear::plot_PRISMA) + agent 行为层筛选 + 数据提取\r\n│   ├── r_packages.md              # 包清单\r\n│   ├── citations.md               # 方法学引用\r\n│   ├── references.md              # 引用列表\r\n│   ├── advanced_api.md            # 复用接口\r\n│   ├── svg_editing.md             # SVG 编辑工具与期刊格式转换\r\n│   └── purpose_zh.md              # 中文 Purpose 文本镜像\r\n```\r\n\r\n---\r\n\r\n## 8. 方法论参考文献 / Methodological References\r\n\r\n### 核心文献\r\n- Harrer M, Cuijpers P, Furukawa TA, Ebert DD. (2021). *Doing Meta-Analysis with R: A Hands-On Guide*. CRC Press.\r\n- Viechtbauer W. (2010). Conducting meta-analyses in R with the metafor package. *J Stat Softw*, 36(3), 1–48.\r\n- Balduzzi S, Rücker G, Schwarzer G. (2019). How to perform a meta-analysis with R: a practical tutorial. *Evid Based Ment Health*, 22(4), 153–160.\r\n- Rücker G, et al. (2016). netmeta: Network Meta-Analysis using Frequentist Methods. *BMC Med Res Methodol*, 16, 1–8.\r\n- Salanti G. (2012). Network meta-analysis in mental health. *Evid Based Ment Health*, 15(1), 16–20.\r\n\r\n### R 包引用\r\n- metafor: `citation(\"metafor\")`\r\n- meta: `citation(\"meta\")`\r\n- netmeta: `citation(\"netmeta\")`\r\n- gemtc: `citation(\"gemtc\")`\r\n- multinma: `citation(\"multinma\")`\r\n- bayesmeta: `citation(\"bayesmeta\")`\r\n- esc: `citation(\"esc\")`\r\n- clubSandwich: `citation(\"clubSandwich\")`\r\n- robumeta: `citation(\"robumeta\")`\r\n- dosresmeta: `citation(\"dosresmeta\")`\r\n- survmeta: `citation(\"survmeta\")`\r\n- mada: `citation(\"mada\")`\r\n- metagear: `citation(\"metagear\")`\r\n\r\n---\r\n\r\n## 9. 示例实测记录 / Example Test Records（§16.6 实测闸门留痕）\r\n\r\n> 测试日期 2026-08-20，依据 ct-base §16.6 逐示例实测：**7/7 通过**。计算类示例 2/3/4/7 经 coze 端点（`https://ct-meta.coze.site/run`）真实返回 `stats` + `figures` + `repro`；行为类示例 1/5/6 与 SKILL.md Triage（§5.2）及 `references/topic-selection.md` / `references/interactive_menu.md` 一致。完整报告见 `meta_readme_test/README_EXAMPLES_TEST_REPORT.md`。\r\n\r\n| 示例 | 类型 | 实测状态 |\r\n|---|---|---|\r\n| 1 选择候选方向 / 5 网络 Meta 路由菜单 / 6 Vague grill-me | 行为类（选题/路由） | ✅ 通过 |\r\n| 2 二分类 OR 配对 / 3 效应量转换 / 4 SMD+亚组 / 7 PRISMA 流程图 | 计算类（coze） | ✅ 通过 |\r\n\r\n**变更留痕（2026-08-24）：**\r\n- **示例 1 文案更新**：原示例按\"Meta 类型\"切分候选、且把泛化配对 Meta 列为首选（新颖性 3）；经一手文献核查，该泛化方向 2024 年已被 ≥5–6 篇大型 Meta 覆盖，原\"首选推荐\"事实站不住。已重写为**按证据空白 / 新颖性分层**，并引入真实去重核查依据：首选改为\"非糖尿病 CKD 专属 Meta\"，候选含\"RAS 停药机制桥接\"\"晚期 CKD\"。行为类判定逻辑（不替用户拍板、不调用 R）不变，7/7 通过结论仍然有效。\r\n- **选题行为固化**：将\"按证据空白分层 + 去重核查\"从 README 范例提升为技能**固定规则**。`references/topic-selection.md` 新增 **R7 规则**（候选方向排序须基于真实去重核查，不得把已饱和泛化方向列为首选）并在 Traps 第 14 条同步；`references/interactive_menu.md` 示例 6 已与 README 示例 1 同步重写（按证据空白排 3 候选）。\r\n- **README 结构重排**：将「对话中使用（7 个示例）」前置到第 1 节，使**使用便利性优先**；把原先散落在最前、互相交叉的三个出站披露块（分析数据 / 元数据 / 错误报告）收敛为 README 第 5 节「数据与隐私说明」，表格化、去重 `query_origin`+`locale` 的重复描述，并加一句总结。内容与强制披露语义（ct-base §5 / §20.3）零丢失。\r\n- **实测记录迁移**：原位于 README 的「示例实测记录（§16.6 实测闸门留痕）」属开发/QA 视角，对普通使用者无意义，已从 README 移除并迁移至此（第 9 节）。\r\n\r\n---\r\n\r\n**版本**: v1.7 | **许可**: MIT | **作者**: medstatstar, phoe-zip\n\nFile v2.20.1:references/ADVANCED.md\n\n# Advanced Reference / 进阶参考\r\n\r\n> This file is for **developers and advanced users**. Ordinary users only need the [How to Use in a Chat](interactive_menu.md) section.\r\n>\r\n> 本文件面向**开发者与普通用户**。普通用户只需阅读[对话使用指南](interactive_menu.md)即可。\r\n\r\n---\r\n\r\n## 1. CLI Invocation Examples / CLI 调用示例\r\n\r\n### Self-test & invocation (skill side)\r\n```bash\r\n# Probe coze endpoint reachability (sends no analysis request)\r\npython adapters/coze_client.py --health\r\n\r\n# Run an analysis (delegates to the coze R engine)\r\npython adapters/run_analysis.py ...\r\n\r\n# Smoke-test a full request through the production path (attribution + dedup applied)\r\npython scripts/run_meta.py <request.json>\r\n```\r\n\r\n> **Coze-project R-engine maintenance commands** (package setup, dispatcher run, module help,\r\n> etc.) are **not published here** — they live in `adapters/coze/DEV.md`\r\n> (git/clawhub-ignored, excluded from the published package). They are for coze-project\r\n> maintainers only.\r\n\r\n### Direct R invocation (reference only — computation runs on coze)\r\n```r\r\nlibrary(metafor)\r\n# Binary meta\r\nres <- metabin(event.e, n.e, event.c, n.c, sm=\"OR\", method=\"DL\", data=my_data)\r\nforest(res)\r\nfunnel(res)\r\n```\r\n\r\n---\r\n\r\n## 2. Bidirectional Solving / 双向求解模式\r\n\r\nWhen users only have partial information, the skill can solve bidirectionally:\r\n\r\n| Given | Solve for |\r\n|---|---|\r\n| n, power, α, effect size → | verify power |\r\n| power, α, effect size, n → | verify n |\r\n| Observed I², k, n → | evaluate heterogeneity level |\r\n\r\n---\r\n\r\n## 3. Curve Mode /  Curve 模式\r\n\r\n- **Power curve**: effect size → power at varying α\r\n- **Heterogeneity curve**: I² vs. exclusion of each study (leave-one-out)\r\n- **NMA rank curve**: distribution of each treatment's rank probability\r\n\r\n---\r\n\r\n## 4. Core Formulas / 核心公式推导\r\n\r\n### 4.1 Random-effects model (DL)\r\n```\r\nθ̂_DL = Σ(w_i · θ_i) / Σ(w_i)\r\nw_i = 1 / (v_i + τ̂²)\r\nτ̂² = (Q - (k-1)) / (Σw_i - Σw_i²/Σw_i)\r\n```\r\n\r\n### 4.2 Effect size conversions\r\n```\r\nCohen's d → logOR: logOR = d × π / √3\r\nd → Hedges' g: g = J × d, J = 1 - 3/(4df - 1)\r\nr → Fisher's z: z = 0.5 · ln((1+r)/(1-r))\r\nOR → logOR: logOR = ln(OR), SE = (ln(upper) - ln(lower)) / (2 × 1.96)\r\n```\r\n\r\n### 4.3 Heterogeneity\r\n```\r\nI² = 100% × (Q - df) / Q\r\nH² = Q / df\r\nτ² = (Q - (k-1)) / (Σw_i - Σw_i²/Σw_i)  [DL estimator]\r\n```\r\n\r\n### 4.4 Bayesian NMA (Stan)\r\n```\r\ny_i ~ Normal(θ_i, σ_i²)\r\nθ_i = μ + τ · η_i\r\nη_i ~ Normal(0, 1)\r\n```\r\n\r\n---\r\n\r\n## 5. System & Environment Requirements / 系统与环境要求\r\n\r\n### R packages (mandatory)\r\n| Package | Version | Purpose |\r\n|---|---|---|\r\n| metafor | ≥3.0 | Core meta-analysis (rma, escalc, forest, funnel) |\r\n| meta | ≥5.0 | Metabin, metacont, metaprop, etc. |\r\n| netmeta | ≥2.0 | Frequentist NMA |\r\n| bayesmeta | ≥3.0 | Bayesian pairwise meta |\r\n| multinma | ≥0.8 | Bayesian NMA (Stan, 可选后端) |\r\n| gemtc | ≥2.0 | Bayesian NMA (JAGS) |\r\n| esc | ≥0.5 | Effect size conversions |\r\n| clubSandwich | ≥0.5 | CR2 robust SE |\r\n| robumeta | ≥2.0 | RVE for dependent effects |\r\n| dosresmeta | ≥2.0 | Dose-response meta |\r\n| ~~survmeta~~ | — | 已下架，改用 metafor 逆方差合并 logHR |\r\n| mada | ≥1.0 | Diagnostic meta |\r\n| metagear | ≥0.7 | PRISMA 2020 flow diagram (plot_PRISMA; only prisma_flow task uses it) |\r\n| ggplot2 | ≥3.0 | Visualization |\r\n| gridExtra | ≥2.0 | Multi-panel plots |\r\n| forestploter | ≥1.1 | Publication-ready forest plots (替代 ggforestplot) |\r\n| svglite | ≥2.0 | Editable SVG export |\r\n\r\n### Python (helper only)\r\n- Python 3.10+ with **no third-party packages** (stdlib only)\r\n- Anaconda recommended: `C:\\Tools\\anaconda3\\python.exe`\r\n\r\n### Operating System\r\n- Windows 10/11 (primary), macOS, Linux\r\n- 8GB+ RAM recommended for large NMA models (Stan/JAGS)\r\n\r\n---\r\n\r\n## 6. Common Errors & Troubleshooting / 常见错误排查\r\n\r\n| Error | Cause | Fix |\r\n|---|---|---|\r\n| `R package not found` | Missing R package | `install.packages(\"pkg\")` |\r\n| `Stan model compilation failed` | C++ toolchain missing | Install Rtools (Windows) or Xcode (macOS) |\r\n| `MCMC did not converge` | Too few iterations or poor chain mixing | Increase `iter`, check `Rhat > 1.01` |\r\n| `Fisher scoring algorithm did not converge` | Sparse data or extreme effect sizes; REML cannot find a stable τ² estimate | **Data issue, not an engine bug.** Try `method=\"ML\"` or `method=\"EB\"`, check for outliers, reduce heterogeneity via subgroups, or use fixed-effect model when k<5 |\r\n| Client-side input validation errors (`invalid 'pos'`, `NULL cov`, column length mismatch, `mean=NULL`) | Missing input validation — subset position out of bounds, NULL covariates, mismatched column lengths, or missing required `mean` parameter | Check input schema: pos ≤ study count; covariates must exist in data; columns used in formula must have equal length; provide required `mean` |\r\n| `I² = 0%` but visible heterogeneity | Low power to detect heterogeneity | Use Q-test p-value, consider random-effects regardless |\r\n| `Funnel plot asymmetry` | True publication bias or heterogeneity | Use Egger test, consider selection models |\r\n| `netmeta inconsistency` | Violated transitivity assumption | Check node-split, consider meta-regression |\r\n| `svglite output is raster` | Cairo not installed | Install Cairo R package |\r\n| `UnicodeDecodeError` in R output | Non-UTF-8 characters | Use `cp1252` or `utf-8 + errors='replace'` |\r\n\r\n---\r\n\r\n## 7. Full File Structure / 完整文件结构\r\n\r\n```\r\nmeta-analysis/\r\n├── SKILL.md                       # Main skill definition (English body, ct-base aligned)\r\n├── AGENTS.md                      # Self-improvement + agent rules (English)\r\n├── CHANGELOG.md                   # Version / fix log\r\n├── README.md                      # English user guide (top switch to README_zh-CN.md)\r\n├── README_zh-CN.md                # Chinese user guide (top switch to README.md)\r\n├── LICENSE                        # MIT\r\n├── requirements.txt               # R package list\r\n├── assets/\r\n│   ├── icon.svg                   # Skill logo\r\n│   └── icon.png                   # Bitmap version\r\n├── scripts/\r\n│   ├── i18n.py                    # ct-base shared: bilingual helper\r\n│   └── generate_topic_report.py  # Topic-selection report generator (pure Python)\r\n├── adapters/\r\n│   ├── coze_client.py             # Coze workflow outbound client (envelope + parse)\r\n│   └── README.md                  # Adapter docs\r\n├── references/\r\n│   ├── (R engine lives in the coze project: src/r_engine/ — see coze_contract.md)\r\n│   ├── interactive_menu.md        # How to use in a chat (user-friendly guide)\r\n│   ├── ADVANCED.md                # This file (developer reference)\r\n│   ├── ADVANCED_zh-CN.md          # Chinese developer reference\r\n│   ├── language_policy.md         # Bilingual policy (from ct-base)\r\n│   ├── report_template.md         # Report skeleton (from ct-base)\r\n│   ├── units.md                   # Atomic task unit index\r\n│   ├── data_templates.md          # Per-type CSV templates + validation\r\n│   ├── revman_complete.md         # RevMan → R 1:1 code mapping\r\n│   ├── stata_to_r_mapping.md      # Stata metareg/mvmeta → R equivalents\r\n│   ├── advanced_analysis.md       # Multilevel/IPD/Bayesian/Dose-Resp/Power\r\n│   ├── single_group_meta.md       # metaprop/metamean/metainc/metacor\r\n│   ├── survival_meta.md           # metafor + KM pseudo-IPD\r\n│   ├── tsa_diagnostics.md         # TSA + Baujat + Drapery + selection\r\n│   ├── diagnosis_meta.md          # mada bivariate + SROC\r\n│   ├── bayesian_nma.md            # gemtc (主) / multinma (可选) workflows\r\n│   ├── esc_robust_meta.md         # esc conversions + RVE\r\n│   ├── review_workflow.md         # PRISMA flow (metagear::plot_PRISMA) + agent-layer screening + data extraction\r\n│   ├── r_packages.md              # Package inventory\r\n│   ├── citations.md               # Methodological references\r\n│   ├── references.md              # Reference list\r\n│   ├── advanced_api.md            # Reusable API reference\r\n│   ├── svg_editing.md             # SVG editing tools & journal format conversion\r\n│   └── purpose_zh.md              # Chinese Purpose text mirror\r\n```\r\n\r\n---\r\n\r\n## 8. References / 方法论参考文献\r\n\r\n### Core texts\r\n- Harrer M, Cuijpers P, Furukawa TA, Ebert DD. (2021). *Doing Meta-Analysis with R: A Hands-On Guide*. CRC Press.\r\n- Viechtbauer W. (2010). Conducting meta-analyses in R with the metafor package. *J Stat Softw*, 36(3), 1–48.\r\n- Balduzzi S, Rücker G, Schwarzer G. (2019). How to perform a meta-analysis with R: a practical tutorial. *Evid Based Ment Health*, 22(4), 153–160.\r\n- Rücker G, et al. (2016). netmeta: Network Meta-Analysis using Frequentist Methods. *BMC Med Res Methodol*, 16, 1–8.\r\n- Salanti G. (2012). Network meta-analysis in mental health. *Evid Based Ment Health*, 15(1), 16–20.\r\n\r\n### R package citations\r\n- metafor: `citation(\"metafor\")`\r\n- meta: `citation(\"meta\")`\r\n- netmeta: `citation(\"netmeta\")`\r\n- gemtc: `citation(\"gemtc\")`\r\n- multinma: `citation(\"multinma\")`\r\n- bayesmeta: `citation(\"bayesmeta\")`\r\n- esc: `citation(\"esc\")`\r\n- clubSandwich: `citation(\"clubSandwich\")`\r\n- robumeta: `citation(\"robumeta\")`\r\n- dosresmeta: `citation(\"dosresmeta\")`\r\n- survmeta: `citation(\"survmeta\")`\r\n- mada: `citation(\"mada\")`\r\n- metagear: `citation(\"metagear\")`\r\n\r\n---\r\n\r\n## 9. Example Test Records / 示例实测记录（§16.6 实测闸门留痕）\r\n\r\n> Tested 2026-08-20 per ct-base §16.6, one example at a time: **7/7 passed**. Computation examples 2/3/4/7 returned real `stats` + `figures` + `repro` from the coze endpoint (`https://ct-meta.coze.site/run`); behavioral examples 1/5/6 were verified against SKILL.md Triage (§5.2) and `references/topic-selection.md` / `references/interactive_menu.md`. Full report: `meta_readme_test/README_EXAMPLES_TEST_REPORT.md`.\r\n\r\n| Example | Type | Status |\r\n|---|---|---|\r\n| 1 Candidate-direction selection / 5 Network-meta routing menu / 6 Vague grill-me | Behavior (topic / routing) | ✅ Passed |\r\n| 2 Binary OR pairwise / 3 Effect-size conversion / 4 SMD+subgroup / 7 PRISMA flow | Computation (coze) | ✅ Passed |\r\n\r\n**Change log (2026-08-24):**\r\n- **Example 1 copy update**: the original example split candidates by \"meta type\" and listed the generic pairwise meta as the top pick (novelty 3); after primary-literature verification, that generic direction was already covered by ≥5–6 large meta-analyses in 2024, so the old \"top-pick\" recommendation no longer held. It was rewritten to stratify by **evidence gap / novelty**, backed by a real dedup check: top pick is now \"dedicated non-diabetic CKD meta\", candidates include \"RAS-persistence mechanistic bridge\" and \"advanced CKD\". The behavioral logic (no deciding for the user, no R invocation) is unchanged; the 7/7 verdict still holds.\r\n- **Topic-selection behavior hardening**: the \"stratify by evidence gap + dedup check\" approach was promoted from a README example into a **fixed skill rule**. `references/topic-selection.md` now has a **Rule R7** (candidate directions must be ranked by a real dedup check; a saturated generic direction must not be listed as the top pick) plus Trap #14; `references/interactive_menu.md` Example 6 was rewritten to match README Example 1 (3 candidates by evidence gap).\r\n- **README restructure**: \"How to Use It in a Chat (7 examples)\" was moved to README Section 1 so **usability comes first**. The three previously scattered, overlapping outbound-disclosure blocks (analysis data / metadata / error report) were consolidated into README Section 5 \"Data & Privacy\", tabularized, with the repeated `query_origin` + `locale` description deduplicated and a one-sentence summary added. Content and the mandatory-disclosure semantics (ct-base §5 / §20.3) are fully preserved.\r\n- **Test-records relocation**: the \"Example Test Records (§16.6 gate)\" section, which was previously in the README, is developer/QA-facing and has no value for ordinary users. It has been removed from the README and moved here (Section 9).\r\n\r\n---\r\n\r\n**Version**: v2.1.1 | **License**: MIT | **Authors**: medstatstar, phoe-zip\n\nFile v2.20.1:references/baujat-plot.md\n\n# Baujat Plot — Heterogeneity Source Diagnostics\n\n> 中文摘要：Baujat 图用于定位异质性来源与影响点——横轴为对总 Q 的贡献、纵轴为对合并效应的影响，右上角研究需重点核查。含 R 实现、论文级排版、解读规则，并纠正上游脚本坐标轴标签互换的错误。\n>\n> **Adapted from**: `meta-baujat-plot` — AIPOCH, MIT License\n> **Source**: https://github.com/aipoch/medical-research-skills\n> **Migrated**: 2026-08-04 (into meta-analysis)\n\nSee also: `tsa_diagnostics.md` §baujat() (existing short entry — this file is the extended plotting/reporting companion), `radial-plot.md`, `forest-binary.md`.\n\n---\n\n## 1. Purpose / When to Use\n\nA Baujat plot (Baujat 2002) separates two distinct questions that I² cannot answer:\n\n- **Which studies create the heterogeneity?** (contribution to Cochran's Q)\n- **Which studies move the pooled answer?** (influence on the overall estimate)\n\nUse it whenever `I² > 50%`, or before any leave-one-out sensitivity analysis, to decide *which* studies deserve scrutiny. It is a diagnostic for the analyst — include it in the supplement, not usually the main paper.\n\n| Situation | Use |\n|---|---|\n| I² > 50% and you must explain why | Yes |\n| Choosing candidates for sensitivity analysis | Yes |\n| k < 3 | No — undefined/uninformative |\n| k > 30 | Yes, but suppress most labels or the plot is unreadable |\n\n## 2. Input Data Requirements\n\nAny `meta` object (`metabin`, `metacont`, `metagen`). Upstream accepts the same three CSV shapes as the funnel template (`Binary` / `Continuity` / `Survival`); see `funnel-plot.md` §2 for the column contracts.\n\nHard requirement: **k ≥ 3**. With k = 3 each point is dominated by the other two, so treat results as indicative only.\n\n## 3. R Implementation Essentials\n\n```r\nlibrary(meta)\n\nbj <- baujat(m, yscale = 1, pos = 4, xmin = 1, ymin = 1)   # base-graphics version\n# Programmatic access (no plot):\nbj <- baujat(m, plot = FALSE)\n# bj$x = contribution to overall heterogeneity (Q)\n# bj$y = influence on the overall result\n```\n\nggplot2 version for a publication-grade figure:\n\n```r\nd <- data.frame(study = m$studlab, x = bj$x, y = bj$y)\nd$flag <- d$x > 2 * mean(d$x) | d$y > 2 * mean(d$y)\n\nggplot(d, aes(x, y)) +\n  geom_vline(xintercept = mean(d$x), linetype = \"dashed\", colour = \"grey50\") +\n  geom_hline(yintercept = mean(d$y), linetype = \"dashed\", colour = \"grey50\") +\n  geom_point(aes(colour = flag), size = 3) +\n  ggrepel::geom_text_repel(aes(label = study), size = 2.8, max.overlaps = 15) +\n  scale_colour_manual(values = c(`FALSE` = \"#2166ac\", `TRUE` = \"#b2182b\"),\n                      labels = c(\"Typical\", \"Potential outlier\"), name = NULL) +\n  labs(x = \"Contribution to overall heterogeneity (Q)\",\n       y = \"Influence on overall result\") +\n  theme_bw(base_size = 11) + theme(legend.position = \"bottom\")\n```\n\n> ⚠️ **Axis-label correction.** The upstream `baujat_plot.R` labels `bj$x` as \"Contribution to overall result\" and `bj$y` as \"Contribution to heterogeneity (Q)\" — these are **swapped**. Additionally, its manual fallback branch computes `x = (ΔTE)²` (influence) and `y = ΔQ` (heterogeneity), i.e. the opposite assignment to the primary `baujat()` branch. Use the orientation above (x = Q contribution, y = influence), which matches `meta`/`metafor` and `tsa_diagnostics.md`.\n\nUse `ggrepel` for labels; fall back to `geom_text` only when unavailable, and reduce to top-10 labels if crowded.\n\n## 4. Publication-Grade Output Specification\n\n| Parameter | Requirement |\n|---|---|\n| Format | SVG master → PDF/EPS/TIFF |\n| DPI | ≥ 300 (upstream default of 150 is **below journal minimum**) |\n| Size | 10 × 8 in draft; 120–170 mm wide at final size |\n| Font | 9–11 pt axes, 7–8 pt point labels |\n| Colour | Two-colour categorical (`#2166ac` typical / `#b2182b` flagged); greyscale-safe via shape as backup |\n| Guides | Dashed mean lines on both axes to define quadrants |\n| Labels | Study labels required — an unlabelled Baujat plot is useless |\n\nAlso export the underlying table (`study, x, y, rank`) as CSV so reviewers can verify the flagged studies.\n\n## 5. Interpretation Rules — Read by Quadrant\n\n| Quadrant | Meaning | Action |\n|---|---|---|\n| **Upper-right** (high Q contribution + high influence) | Drives heterogeneity **and** the pooled answer | Highest priority: verify data extraction, check RoB, run leave-one-out |\n| Lower-right (high Q, low influence) | An outlier in effect, but too imprecise to move the pooled estimate | Explain it, but excluding it will not change conclusions |\n| Upper-left (low Q, high influence) | Consistent with the rest but very heavily weighted (large trial) | Result depends on one trial — report a leave-one-out sensitivity analysis |\n| Lower-left | Unremarkable | No action |\n\nReporting template: *\"Baujat analysis identified Study X and Study Y in the upper-right quadrant, contributing the largest share of Q. Leave-one-out exclusion of these studies changed the pooled OR from a.aa to b.bb and reduced I² from p% to q%.\"*\n\nAlways follow a Baujat finding with an actual leave-one-out or subgroup analysis — the plot only generates hypotheses.\n\n## 6. Common Misreadings — Warn the User\n\n- **\"Outlier\" is not a licence to delete.** Excluding a study because it disagrees is data dredging. Exclude only for a pre-specified, documented methodological reason, and always report both analyses.\n- **The `y > 2 × mean(y)` outlier rule used upstream is an ad-hoc heuristic**, not a validated cut-off. Report it as a screening device, and describe the rule explicitly if you use it.\n- **Axis orientation is not standardised across packages/papers.** Always read the axis labels; never assume. (See the correction in §3.)\n- **A high-influence study is not a biased study.** Large, well-conducted trials are supposed to be influential.\n- **Baujat says nothing about the direction of bias**, only about contribution magnitude.\n- **Do not use Baujat as evidence of publication bias** — that is what `funnel-plot.md` is for.\n- **With small k, every point looks extreme.** Do not report quadrant findings when k < 5.\n- **Removing the top-right study usually lowers I²** — that is arithmetic, not a discovery, and must not be presented as resolving heterogeneity.\n- Baujat is a supplementary figure. Leading a results section with it signals that the primary synthesis was unstable.\n\nFile v2.20.1:references/bayesian_nma.md\n\n# Bayesian NMA (Network Meta-Analysis) / 贝叶斯网状Meta分析\n\n> two major backends: **gemtc (JAGS, 主后端)** and **multinma (Stan, 可选后端)**. Both handle consistency/inconsistency modeling.\n\n> ⚠️ **环境限制**：gemtc 需 JAGS（系统程序，需本机预装）、multinma 需 Stan（cmdstanr/rstan 工具链），\n> **均需外部编译**。封装 `run_bayes_nma_gemtc()` / `run_bayes_nma_multinma()` 在对应后端未安装时给出\n> **友好提示**（multinma 缺失时引导改用 gemtc / netmeta），请在**本机**装好 JAGS/Stan 后运行。\n>\n> ✅ **优先调用封装**（在 `advanced_functions.R`），参数默认值已按官方文档固化：\n> ```r\n> source(\"src/r_engine/advanced_functions.R\")\n> bn <- run_bayes_nma_multinma(prep, priors, response = \"events\", distribution = \"binomial\")\n> bg <- run_bayes_nma_gemtc(data.ab, treatments, studies, type = \"consistency\",\n>                           link = \"logit\", likelihood = \"binomial\", linearModel = \"random\")\n> ```\n\n---\n\n## multinma — Stan Backend (可选后端) / Stan后端（可选）\n\n```r\nlibrary(multinma)\n\n# Prepare data\nprep <- treatment_class(treatment ~ study, data = nma_data)\n\n# Prior specification\npriors <- prior_normal(0, 2, parameter = \"d\") +  # treatment effect\n          prior_halfnormal(0.5, parameter = \"sd\")   # heterogeneity\n\n# Model fit\nfit <- nma(\n  prep,\n  response = \"events\",\n  n = \"n\",\n  study = \"study\",\n  treatment = \"treatment\",\n  distribution = \"binomial\",\n  priors = priors,          # 仅此一处，勿再传 prior=（重复会报错）\n  chains = 4,\n  iter = 4000,\n  seed = 123\n)\n\n# Diagnostics\nplot(fit)  # traceplots\nsummary(fit)\n```\n\n### Survival NMA (non-PH) / 生存数据NMA（非比例风险）\n\n```r\nfit_surv <- nma(\n  prep,\n  response = \"time\",\n  n = \"n\",\n  study = \"study\",\n  treatment = \"treatment\",\n  survival = \"weibull\",   # weibull | gamma | lognormal | loglogistic | gengamma |pexp\n  prior = priors,\n  chains = 4,\n  iter = 6000\n)\n\n# Plot survival curves\nplot(fit_surv, outcome = \"survival\")\n```\n\n### ML-NMR Population Adjustment / 人群校正\n\n> ⚠️ multinma **无** `nlme_nma()` 函数（历史文档误写）。ML-NMR 人群校正仍用 `nma()`，\n> 通过 `regression = ~ 协变量交互` 指定，并需先用 `add_integration()` 对总体协变量做数值积分。\n\n```r\n# 1) 对聚合数据的效应修饰协变量做积分点（IPD 研究可跳过）\nprep <- add_integration(prep, covariate = distr(qnorm, mean = age_mean, sd = age_sd))\n\n# 2) 用 nma() + regression 拟合 ML-NMR（非 nlme_nma）\nfit_mlnmr <- nma(\n  prep,\n  regression = ~ (treatment):covariate,   # 处理-协变量交互（效应修饰）\n  response = \"events\", n = \"n\",\n  study = \"study\", treatment = \"treatment\",\n  distribution = \"binomial\",\n  priors = priors,\n  chains = 4, iter = 4000\n)\n```\n\n---\n\n## gemtc — JAGS Backend / JAGS后端\n\n```r\nlibrary(gemtc)\n\n# Build network\nnet <- mtc.network(\n  data.ab = nma_data,   # arm-level data\n  treatments = treatment_levels,\n  studies = study_levels\n)\n\n# Define model\nmodel <- mtc.model(\n  network = net,\n  type = \"consistency\",    # consistency | inconsistency | regression\n  link = \"logit\",          # logit | cloglog | identity | tdistribution\n  likelihood = \"binomial\", # binomial | normal | poisson | clnegativebin | survival\n  linearModel = \"random\",  # random | fixed\n  om.scale = 2.5,\n  dic = TRUE\n)\n\n# MCMC run\nresults <- mtc.run(\n  model,\n  n.adapt = 5000,\n  n.iter = 50000,\n  thin = 10\n)\n\n# Diagnostics\nplot(results)\n Gelman.diag(results)\n summary(results)\n\n# Node-split for consistency\nns <- nodesplit(net, model, results)\nsummary(ns)\nplot(ns)\n```\n\n---\n\n## Network Comparison / 网络结果\n\n### League Table (Both Packages) / 联赛表（两包通用）\n```r\n# multinma\nleague <- league_table(fit)\nprint(league, digits = 2)\n\n# gemtc\nleague <- relative.effect(results, t1 = \"placebo\")\n```\n\n### SUCRA / P-scores / 排序\n```r\n# multinma\nrank(fit, \"SUCRA\")\n# P-scores: rank(fit, \"P-score\")\n\n# gemtc\nrank.probability(results, preferredDirection = -1)\n```\n\n---\n\n## Diagnostics / 诊断\n\n| Check | multinma | gemtc |\n|-------|----------|-------|\n| Convergence | R-hat, n_eff, traceplots | Gelman.digraph, traceplots |\n| Inconsistency | `devdev()` node-splitting | `nodesplit()` |\n| Model fit | LOOIC, WAIC | DIC |\n| Funnel | `ggplot(study-specific)` | `comparison-adjusted funnel` |\n\n---\n\n## Data Formats / 数据格式\n\n| Type | Required | Example |\n|------|----------|---------|\n| Binary arm-level | study, treatment, n, events | study A, DrugX, 100, 25 |\n| Continuous arm-level | study, treatment, n, mean, sd | study A, DrugX, 50, 12.3, 2.1 |\n| Survival arm-level | study, treatment, n, time, status | study A, DrugX, 80, 12.5, 1 |\n| Contrast-level (change) | study, treatment, mean_diff, se, n | study A, DrugX vs PBO, 2.1, 0.5, 50 |\n\n---\n\n## References / 引用\n\n- What works best depends on research question: multinma offers population adjustment; gemtc is the classic frequentist-Bayesian bridge\n- multinma:抗老,\n\n\n\n继续创建其他引用文件。\n</longcat_think>\n\nArchive v2.20.0: 188 files, 1309469 bytes\n\nFiles: adapters/__init__.py (242b), adapters/block_a.py (179567b), adapters/block_b.py (58420b), adapters/block_c.py (87318b), adapters/bug_report.py (19805b), adapters/build_gap_probe.py (7316b), adapters/config.json (161b), adapters/coze_client.py (81496b), adapters/coze_contract_validate.py (36804b), adapters/coze_error_analyze.py (16044b), adapters/coze_integration_test.py (11749b), adapters/coze_token.py (8576b), adapters/ctsearch_client.py (27989b), adapters/deploy_retest.py (18729b), adapters/evidence_upload.py (40482b), adapters/features.py (3280b), adapters/fullflow.py (78356b), adapters/interpretation.py (26653b), adapters/literature_probe.py (32343b), adapters/llm_client.py (4248b), adapters/llm_loader.py (4535b), adapters/pdf_extractor.py (86632b), adapters/pdf_fetch.py (43272b), adapters/prospero_probe.py (5675b), adapters/publish_guard.py (2410b), adapters/pytest.ini (102b), adapters/quality_advice.py (21246b), adapters/README.md (6068b), adapters/ref_verify.py (17995b), adapters/registry_probe.py (5627b), adapters/render_case_report.py (3123b), adapters/rendering.py (75404b), adapters/req_test.json (754b), adapters/run_analysis.py (21475b), adapters/run_case_human.py (14679b), adapters/run_real_meta.py (2801b), adapters/seam_test.py (8545b), adapters/session_store.py (15099b), adapters/tool_mapping_meta.json (1548b), adapters/topic_assess.py (16820b), adapters/topic_translate.py (18215b), adapters/writing_advisor.py (39337b), AGENTS.md (16498b), assets/icon.svg (3533b), cases/case_catalog.json (54564b), cases/case_catalog.py (45990b), cases/case_prompt.md (3709b), cases/case_prompts_index.md (4632b), cases/case_studies_real.json (1286b), cases/case_studies.json (1438b), cases/extraction_templates/TPL-01_binary_2x2.xlsx (8225b), cases/extraction_templates/TPL-02_continuous_twoarm.xlsx (8253b), cases/extraction_templates/TPL-03_precalculated_effect.xlsx (8128b), cases/extraction_templates/TPL-04_rate_ratio_IRR.xlsx (7943b), cases/extraction_templates/TPL-05_correlation.xlsx (7775b), cases/extraction_templates/TPL-06_single_proportion.xlsx (7803b), cases/extraction_templates/TPL-07_single_mean.xlsx (7777b), cases/extraction_templates/TPL-08_survival_HR.xlsx (7948b), cases/extraction_templates/TPL-09_network_meta.xlsx (8132b), cases/extraction_templates/TPL-10_diagnostic_DTA.xlsx (7903b), cases/extraction_templates/TPL-11_multiarm_rct.xlsx (8057b), cases/meta_report_pairwise_meta_zh_1788232879.html (48698b), cases/meta_report_pairwise_meta_zh_1788234130.html (43421b), cases/prompts/C01.md (2738b), cases/prompts/C02.md (2377b), cases/prompts/C03.md (2196b), cases/prompts/C04.md (2443b), cases/prompts/C05.md (2368b), cases/prompts/C06.md (2327b), cases/prompts/C07.md (2266b), cases/prompts/C08.md (2063b), cases/prompts/C09.md (2099b), cases/prompts/C10.md (2087b), cases/prompts/C11.md (2210b), cases/prompts/C12.md (2498b), cases/prompts/C13.md (2305b), cases/prompts/C14.md (2392b), cases/README.md (4811b), cases/VERIFICATION_REPORT.md (6928b), CHANGELOG.md (464635b)\n\nFile v2.20.0:SKILL.md\n\n---\nname: meta-analysis\ncn_name: 医学Meta分析\nslug: meta-analysis\ndisplayName: Meta Analysis / 医学Meta分析\nversion: 2.20.0\nlicense: MIT\nsummary: 基于 R 的全方位 Meta 分析技能，覆盖 RevMan + Stata 等价 + esc + RVE + 贝叶斯 NMA + 生存 Meta + TSA + 单组率 Meta + 诊断 Meta + 系统评价流程；输出森林图、漏斗图、异质性(I²)、发表偏倚、亚组分析、元回归、网络 Meta等共 23 种分析图形。所有分析提供可复现 R 代码。还可提供Meta选题方向判断 + 文献检索整理 + 筛选 + 数据提取功能。\ndescription: \"Comprehensive R-based meta-analysis skill covering RevMan + Stata equivalents + esc + RVE + Bayesian NMA + survival meta + TSA + single-group meta + diagnostic meta + systematic review workflow; produces forest plots, funnel plots, heterogeneity (I²), publication bias, subgroup analysis, meta-regression, network meta, for a total of 23 analysis figures. All analyses ship reproducible R code. Can also provide meta topic-direction judgment + literature retrieval and organization + screening + data-extraction functionality. / 基于 R 的全方位 Meta 分析技能，覆盖 RevMan + Stata 等价 + esc + RVE + 贝叶斯 NMA + 生存 Meta + TSA + 单组率 Meta + 诊断 Meta + 系统评价流程；输出森林图、漏斗图、异质性(I²)、发表偏倚、亚组分析、元回归、网络 Meta等共 23 种分析图形。所有分析提供可复现 R 代码。还可提供Meta选题方向判断 + 文献检索整理 + 筛选 + 数据提取功能。\"\n\nrequired_commands: [python]\ninvocable: true\n\ntriggers:\n  - \"meta分析\"\n  - \"meta-analysis\"\n  - \"系统评价\"\n  - \"森林图\"\n  - \"漏斗图\"\n  - \"异质性\"\n  - \"发表偏倚\"\n  - \"元回归\"\n  - \"network meta\"\n  - \"贝叶斯meta\"\n  - \"效应量转换\"\n  - \"TSA\"\n  - \"诊断meta\"\n  - \"full meta pipeline\"\n  - \"上下文菜单\"\n  - \"对话菜单\"\n  - \"全流程菜单\"\n  - \"flow menu\"\n  - \"论文撰写\"\n  - \"写稿\"\n  - \"初稿\"\n  - \"投稿建议\"\n  - \"发表建议\"\n  - \"writing advisor\"\n  - \"manuscript\"\npermissions:\n  scope: \"user-space-only\"\n  network: required\n  network_note: \"All numerical computation runs on the coze cloud R engine; analysis params/summary stats are POSTed to coze. No local-R fallback (paid-only feature); IPD only if the user explicitly opts in.\"\n  filesystem: \"writes only to the current working directory (meta_analysis/ and output/ report artifacts: generated .R scripts, .svg/.png figures, .csv tables); otherwise read-only\"\nmetadata:\n  {\n    \"openclaw\": { \"emoji\": \"📊\", \"icon\": \"assets/icon.svg\" },\n    \"authors\": [\"medstatstar\", \"phoe-zip\"],\n    \"homepage\": \"https://github.com/medstatstar/meta-analysis\",\n    \"workbench_url\": \"https://meta.app.workbuddy.host/\",\n    \"workbench_url_alias\": \"https://meta.app.workbuddy.link/\",\n    \"workbench_domain_prefix\": \"meta\",\n    \"workbench_domain_note\": \"Registered exception to the ct-base iron rule (2026-09-16): simplified prefix 'meta' instead of the skill name. Whitelisted, do not extend.\",\n    \"workbench_app_id\": \"wbapp_hNZl928SI6wByvJt2COtcC\",\n    \"workbench_owner_workspace\": \"2026-09-17-09-54-01\",\n    \"workbench_sandbox\": \"a3c70e48be8f45019845b76383334bfc\",\n    \"tags\": [\"meta-analysis\", \"systematic-review\", \"clinical-trials\", \"R\", \"biostatistics\", \"evidence-based-medicine\", \"forest-plot\", \"network-meta-analysis\", \"bayesian\", \"metafor\", \"meta\", \"netmeta\", \"gemtc\", \"revman\", \"robumeta\", \"clubSandwich\", \"esc\", \"dosresmeta\", \"mada\", \"metagear\", \"forestploter\"],\n  }\n---\n\n# Meta-Analysis\n\n> R-based comprehensive meta-analysis. Every module ships reproducible R code.\n\n## Language\n\n- **English guide** → [README.md](https://github.com/medstatstar/meta-analysis/blob/main/README.md) · **中文指南** → [README_zh-CN.md](https://github.com/medstatstar/meta-analysis/blob/main/README_zh-CN.md)\n- Bilingual auto-switch: the answer language follows the user's question language (English question → English answer, Chinese question → Chinese answer).\n\n## 0. Execution discipline (speed-first)\n\n> 🚀 **Top-level red line — higher priority than any \"thinking/polishing\" impulse. Violation = wasting the user's time.** Full boundaries/exceptions/anti-patterns in `references/speed-discipline.md`.\n\n### Two-track gating (code-driven routing, no LLM decision)\nThe first message goes through `python scripts/classify.py` for **deterministic triage** (zero LLM decision):\n- **Compute track (compute)**: clear Simple / Complex → describe and immediately run `run_meta.py --query --data`; three steps to completion, fully bound by this discipline.\n- **Topic track (topic)**: vague / topic selection / feasibility → **first run `scripts/topic_gate.py`** to route on ct-literature install status (installed → call ct-literature directly; not installed → AskUserQuestion install-vs-simple, simple = ct-search remote `adapters/ctsearch_client.py search`), then `generate_topic_report.py`; code-grounded, zero free-form improvisation.\n- Both tracks forbid reading source via Read/Grep/Bash to \"confirm how to tune / which task to use\" — that is `classify.py`'s job.\n\n### Agent operation card (copy verbatim, no variations)\n```bash\n# Compute track one-shot: report lands in --out-dir (user workspace); in-conversation data uses --data-json to skip file writes.\n# If data comes from a file, pass --data <csv|json absolute path> (csv auto-converts to JSON before sending to coze).\npython scripts/run_meta.py --query \"<user original request>\" --data-json '<[{\"study\":\"S1\",...}]>' --out-dir \"<user workspace>/meta_analysis\"\n```\nRead `META_HTML_REPORT=<path>` from stdout and pass directly to `present_files`; across turns, carve a subset into a new csv/json and re-issue the same command (always include `--out-dir`). Do NOT use this card for the topic track. Fallback `META_STATUS=build_failed` → re-run with `--colmap` per the hint.\n\n### Six iron rules\n1. **Execute, don't think**: when running the skill, only perform the workflow; no reasoning/trade-off/review/self-explanation; if a field is missing, ask only about that field.\n2. **Zero number rewriting**: cite `stats`/`pooled`/`heterogeneity`/`bias` verbatim; no rounding/conversion/re-formatting.\n3. **HTML report is the sole presentation surface**: `out['html_report']` is the final deliverable; no further processing; inline `show_widget` is deprecated, figures only appear in the HTML.\n4. **Coze is the sole source of truth for computation**: all numerical analysis/computation runs on the coze R engine; the local side keeps only orchestration + send/receive and retains no compute engine. If coze is unreachable/unauthorized, raise a structured error per §6 — never fall back to local. (Consequence: without coze authorization the skill cannot compute — this is intended, as it supports paid-only features.)\n5. **Call-count invariant**: compute track ≤1 call before fire (only `build_request`), ≤1 call after fire (only `present_files`); topic track ≤2; no retry loops. Cross-turn `--data-json` refill is input construction and does not count.\n6. **No duplicate fire**: once `run_meta.py` is in-flight (the Bash call has been issued), **wait for the result** — do NOT re-issue the same or equivalent command. If `META_STATUS=error`, follow the structured guidance; do NOT silently retry. If `META_HTML_REPORT=...`, pass to `present_files` — done. One command, one wait, one result.\n\n### Already automated / anti-patterns\nSubgroup columns auto-pass-through, column-name aliases auto-matched, artifact completeness guaranteed by `run_analysis` — the agent must not read source to verify, must not hand-assemble subgroup into request.json, must not declare \"missing Q_between\" each round.\n\n**❌ Impatient duplicate fire (2026-09-17 field incident):** re-issuing `run_meta.py` before the previous call returns wastes coze compute and burns rate limits. Full anti-pattern list → `references/speed-discipline.md`.\n\n## 1. Triage — First step: classify the user's intent\n\n> **Routing is already done in code (§0 two-track gating)**: track / task judgment is delegated to `build_request.py` (which calls `classify.py`); the LLM no longer makes routing decisions and does not hand-write request.json. The table below is for understanding only — the LLM calls `run_analysis` directly from the generated `request.json` and `present_files(html)`.\n\n| Classification | Condition | Action |\n|---|---|---|\n| **Simple** | Single, specific intent (e.g., \"pool OR from these 5 studies\") | Reply directly, no menu |\n| **Complex** | Multi-decision / multi-parameter (e.g., \"network meta with 3 interventions, subgroup, check inconsistency\") | Present level-1 routing menu incl. \"③ Can't decide? → explain the differences\"; full menu → `references/interactive_menu.md` |\n| **Vague** | Unclear what user wants (e.g., \"I need meta-analysis help\") | Grill-me branch questions, 1–3 per round; \"no topic / feasibility\" → **Topic Selection** (§2.2) |\n\nIf unsure between Simple and Complex → give short reply + optional expansion hint.\n\n## 2. Conversation guide\n\n### 2.1 Interactive menu\nVague → Level 1 menu (7 categories). Select → Level 2 with data-format hints. Sufficient info → skip menu, run directly. Full menu tree + data formats → `references/interactive_menu.md`.\n> **Other formats?** Install `@skill:statdata-transfer` for 50+ format conversion.\n\n### 2.2 Topic Selection (upstream gate, self-contained)\nTrigger: no topic / feasibility check / \"rejected as duplicate\" / pre-PROSPERO audit → `references/topic-selection.md`. Two paths:\n- **Quick** (≤30 min): 1-page decision card — 4-dim scores (clinical/feasibility/data/novelty, 0–5, any ≤2 = veto) + screen verdict.\n- **Full** (5 stages + gates): PICO (`pico-guide.md`) → scoring + cross-checks R1–R6 → dedup (`dedup-search.md`) → PRISMA 2020/AMSTAR-2 (`compliance-precheck.md`) → 11-section report via `python scripts/generate_topic_report.py input.json output.md|html` (templates → `topic-report-template.md` / `prospero-mapping.md`).\n- **Dedup source is gate-driven (see Topic Gating in `topic-selection.md`)**: first run `scripts/topic_gate.py`; if **ct-literature** is installed, call it directly for full 6-source retrieval (`.merged.json` as Stage-4 evidence); if not installed, AskUserQuestion → simple-analysis branch calls the **ct-search remote** (`adapters/ctsearch_client.py search --source europepmc`, no install needed); in-skill `adapters/literature_probe.py` (direct Europe PMC) is only the offline ultimate fallback. All paths return real `hit_count` + titles; novelty ranking grounded in actual literature.\n  - ⛔ **Topic-track red line**: candidate ranking **must** be based on the probe's real hit counts + 4-dim score card; the LLM only paraphrases, strictly no free-form \"which direction is good\". Quick is ranked by the probe card; Full is reported by `generate_topic_report.py`, the LLM does not rewrite.\n\n### 2.3 Upstream orchestration (retrieval → screening → extraction → analysis)\n\n> **Repositioning (2026-08-30):** meta-analysis evolved from \"pooling effect sizes only\" into a \"full-chain Meta orchestrator\".\n> The upstream three stages reuse existing modules and `ct-literature`; the only new capability is the **data-extraction assistant** (LLM draft + human-verification gate).\n\nFull-chain orchestration, command list, seam pitfalls (incl. `included_records` ≠ `included`), and guard semantics → `references/upstream_orchestration.md`.\nWriting-advisor (④′), evidence-upload (④″), and detailed A-stage contract / type-confirmation model → `references/chat_orchestration.md`.\n\n- ⛔ **Automatic PDF value extraction is SUSPENDED (2026-09-27, user-decided)**: `features.a4_extraction=False` gates off A4 auto 2×2 extraction; three backend bypasses (`/api/upload_pdf`, `/api/upload_pdf_auto`, fastpath `data_mode=\"pdf\"`) return 409. Do NOT offer \"auto-extract numbers from PDFs\" as an available capability in chat. Unfreeze = set `a4_extraction: True` in `adapters/features.py`.\n\n> ⚠️ **The human-verification gate is a red line:** any CSV from `extract_assist.py` not `stamp --confirm`ed is blocked by `run_meta.py` (`META_STATUS=unverified_extraction`).\n\n### 2.4 Systematic-review full-flow mode (@skill entry)\n\n> **Trigger:** \"systematic review full flow\" / \"from retrieval to meta-analysis\" / \"systematic review workflow\" → end-to-end orchestration, not a direct jump to compute track.\n> The agent executes the full playbook → `references/systematic_review_fullflow.md`. CCM (Conversation Context Menu) is **DISABLED** for agent use (2026-09-27) — two execution surfaces remain: ① the **published web app** and  **plain conversation** (agent narrates + asks open questions in prose). Do NOT render `flow_menu.py` menus in chat.\n> Archived CCM details (menu design, A1/A2 sub-menus, pre-flight checks, contract gaps) → `references/chat_orchestration.md`.\n\n### 2.5 Workbench — published app & local launch\n\n> **Trigger:** \"工作台\" / \"workbench\" / \"meta 全流程\" etc.\n> Published app metadata, share link, appId, publish toolchain, local-launch commands → `references/workbench.md`.\n\n## 3. Initialization & execution backend\n\n**Execution model**: coze-only, absolute. Startup: probe `coze_client.health()`, create `meta_analysis/` + `output/`, read R config from `~/.workbuddy/MEMORY.md`. Details → `references/ADVANCED.md`.\n\n## 4. Core functions & API\n\nModule → R-package/function matrix → `references/advanced_api.md` · `references/ADVANCED.md`.\n**Rule (mandatory)**: any analysis MUST call existing functions — never rewrite inline. Unified entry `adapters/run_analysis.py` (default: coze).\n\n## 5. Output specification\n\n**Artifacts**: `analysis_complete.R` + forest/funnel (`.svg`, inlined in HTML) + `results_summary.md` + `last_run.json`. Per-round dataset CSV is an *input* the agent carves; `run_analysis.py` does NOT auto-write `data_backup.csv`.\n\n**Rendering**: `figures[].svg` embedded into single-file HTML report → `present_files`. Inline `show_widget` cancelled. SVG keeps natural width. Quality Gate: R-side `run_quality_gate()` → red (k<3 / I²>75% / missing bias check) **blocks** presentation.\n\n**Cross-turn continuity (mandatory)**: stateless runtime → echo `## 当前分析设定 / Current analysis settings` after every analysis; follow-up changes only changed fields; dataset supplied per round (no `data_backup.csv`). Full spec + merge_spec + endpoint capability boundaries → `references/cross_turn.md`.\n\n## 6. Security & scope\n\n**Execution model**: numeric computation via coze. **Data-exfiltration decision belongs to the user**.\n\n**Outbound disclosure**: analysis data (no PII) POSTed to coze, sanitized by `sanitize_payload()`. Default endpoint pre-approved; custom `COZE_META_ENDPOINT` asks AUTH-BLOCK on first call. First outbound notice each session (once, bilingual). Attribution never empty (`query_origin` hostname SHA-256 + `request_id` UUID). Coze failure needs consent before diagnose+retry.\n\n**Other boundaries**: PDF download ONLY on explicit user instruction (`adapters/pdf_fetch.py`). Data-extraction guard (red line): `extract_assist.py` CSV blocked until `stamp --confirm`.\n\nFull security details → `references/ADVANCED.md` · `references/pdf-download-portals.md` · `references/bug_report_endpoint.md`.\n\n## 7. User-uploaded files\n\n1. **Structured data (`.csv`/`.xlsx`/`.xls`)** → Type 4 template (`references/data_templates.md`).\n2. **Document/template (`.docx`/`.pptx`/`.pdf`/`.doc`)** → convert to md first: `.docx`/`.pptx` via `scripts/office_to_md.py`; `.pdf` via `pdf` skill.\n\n**🔔 Pre-conversion notice**: `⚠️ All uploaded documents will be converted to md. PPT conversion can lose images/layout/animations/charts.`\n\nFull upload spec → `references/data_templates.md`.\n\n## 8. Bug Reporting\n\nAgent behavior only; implementation → `adapters/bug_report.py`, protocol → `references/bug_report_endpoint.md`. Trigger ≤1 proposal/session. Two-stage confirmation (propose-with-preview → consent → send). 11-key whitelist, never raw data.\n\n## 8.5 Deploy Retest Gate (mandatory before publish / deploy)\n\n**Freeze check FIRST**: before any publish attempt to GitHub → SkillHub → ClawHub, run `python adapters/publish_guard.py` — exit code 2 means a dev-period publish freeze is active (`adapters/DEV_POLICY.json`) and publishing is blocked; do NOT proceed and do NOT bypass it. This check is part of the gate, not optional advice.\n\n**Mandatory before publishing / deploying** to GitHub → SkillHub → ClawHub: run `python tests/deploy_retest.py` (`--live` to actually hit the network; publish allowed only on all-green). This gate strictly verifies that the coze response is **genuinely valid** (HTTP 200 ≠ success; it rejects `status=ok` empty shells / `NaN` / no-figure (svg/url) false greens — coze externalizes SVG to S3 `url`, so a present+reachable `url` counts as a valid figure), writes `tests/deploy_retest_report.json`, and exits non-zero on any failure to block publishing. Use `--mock` for local logic self-check (no network) and `--offline` for envelope-contract validation. Full rules and red lines → `outputs/deploy_retest_gate.md`.\n\n## 9. Meta information\n\n**Traceability**: all factual claims cite a `ref-*.md` section or official guideline; unverifiable → mark `⚠️ official verify`.\n**References**: full index → `references/references.md`. Key: `interactive_menu.md`, `ADVANCED.md`/`ADVANCED_zh-CN.md`, `advanced_api.md`, `topic-selection.md`, `data_templates.md`, `svg_editing.md`. Units → `references/units.md`.\n**Project Files**: `README.md` | `README_zh-CN.md` | `CHANGELOG.md` | `AGENTS.md` | `LICENSE` (MIT © 2025 medstatstar) | `requirements.txt` | `assets/icon.svg`.\n**Changelog**: → `CHANGELOG.md`.\n\nFile v2.20.0:adapters/README.md\n\n# adapters/ — 计算出口层（ct-base §16.9 架构预留）\n\n> 本目录是 **meta-analysis 技能** 的分析计算出口层。**发布形态为 coze-only**（2026-08-19 决策）：\n> 所有数值计算经 coze 元分析工作流，本地 LLM 仅做需求标准化/数据整理/结果呈现，**最终用户无需安装 R**。\n> 回退逻辑已于 2026-08-26 取消：coze 不可达 / 未授权时直接返回结构化错误，**不再兜底本地引擎**。\n\n## 路由策略（coze 唯一路径，无回退）\n\n```\n                 ┌─────────────────────────────────────────────┐\n   分析请求 ──────▶│ adapters/run_analysis.py  (统一入口)         │\n (task/data/…)    │   唯一对外路径 = coze                         │\n                 └───────────────┬─────────────────────────────┘\n                                 │\n                   coze_client.run_meta ── 成功 ──▶ _source=\"coze\"\n                                 │ 失败（网络/HTTP/空响应/未授权）\n                                 ▼\n                          返回结构化错误（不再回退本地）\n```\n\n- **发布形态**：唯一路径 = `coze`。coze 失败时直接返回 `{status:\"error\", ...}`，由上层决定如何提示用户。\n- **`_source` 字段**：仅 `\"coze\"`（成功）或缺失（结构化错误，不标 local_fallback）。\n- **开发者/复现**：本地无独立计算引擎。所有数值计算由 coze 端 R 引擎完成；`_dev/` 仅作开发调试占位（历史本地 R 引擎 `local_engine.py` 已于 2026-09-01 按架构终态原则删除）。\n\n## 文件\n\n```\nadapters/\n├── run_analysis.py        # 统一前端：唯一对外路径 = coze\n├── literature_probe.py    # ★ 选题去重自包含探针：Europe PMC REST（Cochrane+PubMed 层真实 hit_count），零依赖、不依赖其他技能\n├── coze_client.py         # Coze /run 客户端（唯一路径）：信封打包 / 响应解析\n├── coze_cases/            # 3 个冒烟案例（快速自测）\n├── coze/          # ★ coze 项目本地镜像（与 coze 远端双向同步的唯一源，2026-08-19 统一放置）\n│   ├── coze_contract.md   #   接口契约（§16.7 红线：不随技能发布，已 ignore）\n│   ├── src/r_engine/*.R   #   R 引擎（run_task.R 等，coze 端运行本体）\n│   ├── scripts/           #   部署脚本（http_run.sh / setup.sh 等）\n│   └── docker/ assets/    #   镜像/依赖清单\n├── _dev/                  # ★ 开发调试用，已 ignore（不随发布包分发）；历史本地 R 引擎已删除\n└── README.md              # 本文件\n```\n\n## coze 项目镜像：双向同步约定（2026-08-19 统一）\n\n> **`adapters/coze/` 是 coze 远端代码在本地唯一的同步源。** 所有 coze 端代码变更都从这里进出：\n> 本地改代码 → 打包部署 coze；coze 平台导出 → 覆盖回此目录。**不再使用工作区 `coze_meta_project/` 作为主镜像**（保留为历史快照）。\n\n- **本地 → coze**：改 `adapters/coze/` 内文件 → `tar -czf coze_final_YYYYMMDD.tar.gz .`（在镜像目录内）→ 上传 coze 平台 → vefaas 重部署 → 线上 96 例复测。\n- **coze → 本地**：coze 平台导出 project → 解包覆盖 `adapters/coze/` → `diff -r` 与镜像内 `src/r_engine/` 比对确认。\n- **发布排除**：`adapters/coze/` 已加入 `.gitignore` / `.clawhubignore`，**不随技能发布**（coze_contract.md 属 §16.7 红线）。\n- **一致性基准**：`adapters/coze/src/r_engine/` 为唯一本地引擎（技能根 `r_engine/` 已删），与 coze 远端同步。\n\n## 配置（环境变量）\n\n| 变量 | 说明 | 默认 |\n|------|------|------|\n| `COZE_META_ENDPOINT` | coze 工作流 `/run` 地址（2026-08-26 改造，主工作流回切 ct-meta） | `https://ct-meta.coze.site/run` |\n| `COZE_META_TOKEN` | 可选 Bearer 鉴权令牌 | 空（不带 Authorization） |\n| `COZE_META_TIMEOUT` | 请求超时（秒） | `600` |\n\n## 用法\n\n```python\nimport sys; sys.path.insert(0, \"adapters\")\nfrom run_analysis import run_analysis\n\n# 唯一路径：coze 云端 R 计算\nout = run_analysis(\n    task=\"pairwise_meta\",\n    data={\"rows\": [{\"study\": \"A\", \"event_exp\": 12, \"n_exp\": 100,\n                    \"event_ctrl\": 20, \"n_ctrl\": 100}]},\n    params={\"sm\": \"OR\", \"model\": \"REML\"},\n    figure={\"plots\": [\"forest\"]},\n)\n# 成功：out[\"_source\"] == \"coze\"\n# 失败：out[\"status\"] == \"error\"（coze 不可达/未授权），无 _source 回退\n```\n\nCLI 等价：`python adapters/run_analysis.py request.json`\n\n> **🚫 调用方约束（2026-08-30）**：请**始终经 `run_analysis` / `scripts/run_meta.py` 调用**——它们自动注入有效 `query_origin`（主机名 SHA-256，`[debug:]sha256:<64hex>`）。**不要**用 curl / Postman 直接 POST `/run`；如确需裸调，请求体**必须带合法 `query_origin`**（`coze_client._assert_query_origin` 已在客户端出站层硬拦截空归因，但裸 POST 不经该守卫）。空归因会绕过按 `query_origin` 计的限流，且飞书日志无法溯源。\n\n## 红线\n\n- **数值判断红线**：R 计算的数值结论（合并效应、I²、排序等）由 coze 端 R 产出，\n  本层仅解析结构（status/stats/figures[].svg/warnings/notes），绝不读取或改写数值。\n- **接口契约**：见 coze 项目的 `coze_contract.md`（不随技能发布，遵循 ct-base §16.7）。\n  镜像内 `src/r_engine/` 是 coze 远端引擎的字节级镜像，靠该契约保持同步。\n- **发布红线**：coze 接口契约 / system prompt / ops 文档一律不随技能发布（ct-base §16.7）。\n- **回退红线（2026-08-26 起）**：运行路径不再调用任何本地计算引擎；\n  历史本地 R 引擎 `adapters/_dev/local_engine.py` 已于 2026-09-01 删除，无本地回退。\n\nFile v2.20.0:cases/README.md\n\n# meta-analysis 案例库总览\r\n\r\n> 由 `cases/case_catalog.py` 生成。案例库 = 技能最便宜的回归基准：每次改 block_a/b/c、pdf_extractor、run_stage 都跑一遍全套案例比对信封/数值是否漂移。\r\n>\r\n> 📋 离线验证结果见 **[VERIFICATION_REPORT.md](./VERIFICATION_REPORT.md)**（14 案例全链路 A4 抽取 + 11 模板 1:1 映射 + 本地可算/需 coze 状态）。\r\n\r\n## 案例清单（14 个）\r\n\r\n| 案例 | 标题 | 类别 | 设计 | 效应量 | 模板 |\r\n|---|---|---|---|---|---|\r\n| C01 | SGLT2 抑制剂 vs 安慰剂对 T2DM 患者 MACE 的影响（二分类 OR） | 数值指标 | 干预性 RCT，二分类结局，pairwise | OR | TPL-01 |\r\n| C02 | 卡介苗（BCG）疫苗对结核病发病的保护效力（二分类 RR） | 数值指标 | 干预性 RCT，二分类结局，pairwise（RR） | RR | TPL-01 |\r\n| C03 | 某干预对术后 30 天死亡率的影响（二分类 RD） | 数值指标 | 干预性 RCT，二分类结局，pairwise（RD） | RD | TPL-01 |\r\n| C04 | 降压药对收缩压（SBP）降低的均数差（连续型 MD） | 数值指标 | 干预性 RCT，连续型结局，pairwise（MD） | MD | TPL-02 |\r\n| C05 | 心理干预对抑郁量表评分的影响（连续型 SMD） | 数值指标 | 干预性 RCT，连续型结局异量纲，pairwise（SMD） | SMD | TPL-02 |\r\n| C06 | 肿瘤免疫治疗对总生存期（OS）的 HR 合并（已有效应量 logHR） | 数值指标 | 干预性 RCT，时间-事件结局，已有效应量 pairwise（logHR） | logHR | TPL-03 |\r\n| C07 | 中心静脉导管相关血流感染（CLABSI）率比（IRR，人时数据） | 数值指标 | 前后对照/队列，率比，pairwise（IRR） | IRR | TPL-04 |\r\n| C08 | 教育年限与健康评分的相关性合并（ZCOR） | 数值指标 | 观察性，相关系数，pairwise（ZCOR） | ZCOR | TPL-05 |\r\n| C09 | 不同地区成人吸烟率合并（单组率 PLOGIT） | 数值指标 | 流行病学调查，单组率，pairwise（PLOGIT） | PLOGIT | TPL-06 |\r\n| C10 | 慢性疼痛患者基线疼痛评分合并（单组均值 MN） | 数值指标 | 观察性/基线，单组均值，pairwise（MN） | MN | TPL-07 |\r\n| C11 | 心衰治疗对心血管死亡风险的 HR（生存分析，O-E/V 法） | 数值指标 | 干预性 RCT，时间-事件结局，pairwise（logHR via O-E/V） | logHR | TPL-08 |\r\n| C12 | 三类降压药对 SBP 降低的网状 Meta（NMA，≥3 干预） | 复杂设计 | 干预性 RCT，多臂，网状 Meta（直接+间接比较） | OR | TPL-09 |\r\n| C13 | 新冠抗原检测准确性的诊断 Meta（DTA，TP/FP/TN/FN） | 复杂设计 | 诊断准确性研究，2×2 四格表，pairwise（DOR/Sens/Spec） | DOR | TPL-10 |\r\n| C14 | 三臂肿瘤 RCT（2 活性药 + 安慰剂）独立对比 Meta（多臂拆分） | 复杂设计 | 干预性多臂 RCT，按对比拆分，pairwise（OR） | OR | TPL-11 |\r\n\r\n## 模板清单（11 个）↔ 对应案例\r\n\r\n| 模板 | 情境 | 效应量 | PDF表型 | 自动识别 | 演示案例 |\r\n|---|---|---|---|---|---|\r\n| TPL-01 | 二分类 2×2 四格表 | OR/RR/RD | T_DICHOT | ✅ 已自动识别 | C01, C02, C03 |\r\n| TPL-02 | 连续型两臂（均值±SD） | MD/SMD | T_CONTINUOUS / T_CONT_TWOARM | ⚠️ 部分自动 | C04, C05 |\r\n| TPL-03 | 已有效应量（对数尺度） | lnOR/SMD/logHR/ROM/ZCOR | T_EFFECT_TABLE / T_MD_CI | ⚠️ 部分自动 | C06 |\r\n| TPL-04 | 率比（人时数据 IRR） | IRR | （暂无自动，需人工映射） | ✋ 需人工映射 | C07 |\r\n| TPL-05 | 相关系数 | ZCOR | （暂无自动，需人工映射） | ✋ 需人工映射 | C08 |\r\n| TPL-06 | 单组率 | PLOGIT/PRAW | （暂无自动，需人工映射） | ✋ 需人工映射 | C09 |\r\n| TPL-07 | 单组均值 | MN | （暂无自动，需人工映射） | ✋ 需人工映射 | C10 |\r\n| TPL-08 | 生存分析 HR | logHR | （暂无自动，需人工映射） | ✋ 需人工映射 | C11 |\r\n| TPL-09 | 网状 Meta（多臂） | OR/RR/MD | （暂无自动，需人工映射） | ✋ 需人工映射 | C12 |\r\n| TPL-10 | 诊断试验准确性（DTA） | DOR/Sens/Spec | （暂无自动，需人工映射） | ✋ 需人工映射 | C13 |\r\n| TPL-11 | 多臂 RCT（独立对比） | OR/RR/RD/MD | （暂无自动，需人工映射） | ✋ 需人工映射 | C14 |\r\n\r\n## 1:1 对应关系说明\r\n\r\n- 每个**数据形状/研究情境**有且仅有一个 Excel 提取模板（`TPL-xx`）。\r\n- 每个模板的「数据录入」sheet 列定义与 `references/data_templates.md` 完全一致，并追加 `PDF来源(页/表)` 与 `备注` 两列用于溯源。\r\n- `pdf_extractor` 当前 P1 仅自动识别 T_DICHOT / T_CONTINUOUS 系列；其余形状标注「需人工映射」，模板即人工映射的落地载体。\r\n- 运行：`python adapters/run_case_human.py --case <案例ID>`（默认 C01）。\n\nFile v2.20.0:README.md\n\n# meta-analysis\r\n\r\n- **English guide** → [README.md](https://github.com/medstatstar/meta-analysis/blob/main/README.md) · **中文指南** → [README_zh-CN.md](https://github.com/medstatstar/meta-analysis/blob/main/README_zh-CN.md)\r\n\r\n<div align=\"center\">\r\n  <img src=\"assets/icon.svg\" width=\"240\" height=\"240\" alt=\"meta-analysis logo\"/>\r\n</div>\r\n\r\n> **No install needed for the basics:** if you don't want to install this skill and just want to try its core features quickly, use the web app directly at **https://meta.medstatstar.com**.\r\n\r\n> **Easy-to-use R-based Meta-Analysis for Clinical Researchers**\r\n>\r\n> You don't need to code or memorize commands — just describe your meta-analysis needs in **plain language inside a chat**, and the skill **automatically runs** the full analysis (pooling, figures, report) for you. Powered by R and 14 core + 2 optional professional R packages (metafor, meta, netmeta, bayesmeta, dosresmeta, mada, etc.), it returns results in Chinese or English depending on your OS language setting (you can force-switch via a prompt at any time). Once you describe a request, the skill **auto-executes** and returns results + figures; ask for the full reproducible R code at any time.\r\n\r\n---\r\n\r\n## Who This Is For\r\n\r\nmeta-analysis is part of the CT-series skill family, built for three groups:\r\n\r\n- **Clinical-trial practitioners at pharmaceutical companies** — sponsors, CROs, and medical / statistical / regulatory roles who need to pool and compare study evidence;\r\n- **Clinicians and nurses who design, conduct, or participate in clinical research** and need meta-analysis / systematic-review support;\r\n- **Medical students who want to learn evidence-based medicine and meta-analysis methodology in a structured way**.\r\n\r\n---\r\n\r\n## 1. How to Use It in a Chat (the Core)\r\n\r\nmeta-analysis is a **conversational skill**: you simply tell the assistant what you want in natural language — no commands, no parameter names to remember. As a WorkBuddy skill it **auto-loads with no extra installation**.\r\n\r\nBelow are 7 real conversational examples — **one per category** in the Scenario Index (§2): ① systematic-review workflow, ② pairwise meta, ③ heterogeneity & bias, ④ advanced models, ⑤ effect-size conversion, ⑥ visualization, ⑦ study quality. Each shows **\"You say\"** and a sketch of **\"The assistant replies\"**, plus how to get the actual number.\r\n\r\n### Example 1 · ① Systematic review workflow: topic selection\r\n**You say:**\r\n> I'm interested in SGLT2 inhibitors for renoprotection and cardiovascular benefit in chronic kidney disease (CKD), but I haven't decided which specific meta-analysis direction to pursue. Can you help me shortlist candidate directions?\r\n\r\n**Assistant replies (sketch):**\r\n> Sure — I'll use a **topic-selection approach** to lock down the direction. First I run the **in-skill dedup probe (Cochrane + PubMed real hit counts)**, then shortlist — otherwise a saturated direction can be wrongly pushed as top pick.\r\n>\r\n> **First, rule out the saturated directions**: the generic \"SGLT2i on cardiorenal outcomes in CKD\" is Cochrane 23 / PubMed 2785 — highly saturated. **Counter-intuitively**, the seemingly niche **non-diabetic CKD (Cochrane 20 / PubMed 2402)** and **dialysis / advanced CKD (Cochrane 22 / PubMed 1067)** are also heavily covered (DAPA-CKD / EMPA-KIDNEY spawned many reviews) — also not recommended.\r\n>\r\n> Re-shortlisting 3 candidates by **evidence gap + novelty** (I'll produce 1–3 directions; I won't decide for you):\r\n>\r\n> **Candidate ① Renoprotection in IgA nephropathy (top pick)**\r\n> - Cochrane 4 / PubMed 224 (≈1/10 of the broad direction) → **real gap**\r\n> - Most common primary GN; SGLT2i already a guideline adjunct; many RCTs, data available\r\n>\r\n> **Candidate ② Net benefit / benefit–risk framework**\r\n> - Cochrane 5 / PubMed 442 → gap\r\n> - Pools renal + cardiac benefit with safety events (DKA / infection / volume depletion) in one framework — strong methodological differentiation\r\n>\r\n> **Candidate ③ Specific glomerular diseases (FSGS / membranous / ADPKD / lupus)**\r\n> - FSGS Cochrane 0, ADPKD 2, membranous 1, lupus 3 → **very deep gap**\r\n> - ⚠️ but sparse RCTs → power risk; better as a **scoping review** than a hard efficacy MA\r\n>\r\n> **Suggestion**: Start with ① (real gap, high clinical need); ② as the methodological-differentiation alternative; ③ conditional. Next step: a **full topic assessment** (PICO + dedup search + PRISMA/AMSTAR-2 pre-check), and **run ct-literature first for a full dedup confirmation** (the probe is a quick signal; FSGS=0 may include index-phrasing variance, don't rely on it alone).\r\n\r\n**📌 Note:** When you have a direction but are unsure which specific meta to run, the assistant uses the topic-selection framework to produce **1–3 candidate directions + a 4-dim score + meta type**, instead of deciding for you or giving a single answer. This is the **topic-selection gate** before analysis — no R computation is invoked. Candidates are stratified by **evidence gap / novelty**, each backed by the **in-skill dedup probe (Cochrane + PubMed real hit counts)** — so a saturated generic direction (including the \"intuitively niche\" non-diabetic CKD or dialysis) is no longer mis-pushed as the top pick.\r\n\r\n### Example 2 · ② Pairwise meta: two-group binary (most common)\r\n**You say:**\r\n> Combine the OR across these 5 binary studies:\r\n> Study A: experimental 30/100, control 20/100\r\n> Study B: experimental 45/120, control 30/100\r\n> ...\r\n\r\n**Assistant replies (sketch):**\r\n> ✅ 5 studies, random-effects (DL), OR = 1.52 (95%CI: 1.18–1.96), I² = 34%\r\n> (Ask for the full reproducible R code at any time.)\r\n\r\n**📌 Auto-execution:** Once you describe the request, the assistant **auto-executes** and returns the real result; ask for the reproducible code by saying **\"give me the full R code\"**.\r\n\r\n### Example 3 · ③ Heterogeneity & bias: I² + subgroup\r\n**You say:**\r\n> I did a continuous meta with 8 studies, SMD pooled, but I² is high — I want to subgroup by region\r\n\r\n**Assistant replies (sketch):**\r\n> ✅ 8 studies, SMD = 0.42 (95%CI: 0.15–0.69), I² = 78%\r\n> Subgroup by region:\r\n> - Asia (k=4): SMD = 0.55, I² = 45%\r\n> - Euro-US (k=4): SMD = 0.28, I² = 62%\r\n> - Between-group Q = 4.12, p = 0.04\r\n\r\n### Example 4 · ④ Advanced models: network meta with multiple decisions\r\n**You say:**\r\n> I want to do a network meta with 4 interventions, but I haven't decided whether to use frequentist or Bayesian, and I'm not sure if I should include dose-response\r\n\r\n**Assistant replies (sketch):**\r\n> 4 interventions clear. Two key choices to clarify:\r\n>\r\n> **① Which analysis framework?**\r\n> - (a) Frequentist — `netmeta`, inverse-variance based, good for consistent networks\r\n> - (b) Bayesian — `gemtc` (JAGS) or `multinma` (Stan) **local only** (a known coze limitation: the container has no root to install JAGS; on the cloud use (a) netmeta); `bayesmeta` supports Bayesian pairwise comparisons locally\r\n>\r\n> **② Include dose-response?**\r\n> - (a) No — pure pairwise comparison network\r\n> - (b) Yes — needs dose-effect parameters, Bayesian framework preferred\r\n>\r\n> **③ Can't decide?** → say \"explain the differences between these choices in detail\", and I'll clarify the clinical/statistical meaning before you choose\r\n\r\n**📌 Note:** When you've **named the test type but are stuck on \"which option / design family\"**, the assistant **pops a routing menu** to confirm step by step — instead of deciding for you or dumping the full menu. The menu also offers an \"explain the differences\" option — when you're unsure, it explains before you decide.\r\n\r\n### Example 5 · ⑤ Effect size conversion\r\n**You say:**\r\n> Convert Cohen's d = 0.8 to logOR\r\n\r\n**Assistant replies (sketch):**\r\n> ✅ d = 0.8 → logOR ≈ 1.45 (SE ≈ 0.38), based on logOR = d × π/√3\r\n\r\n### Example 6 · ⑥ Visualization\r\n**You say:**\r\n> Draw a forest plot, lancet theme\r\n\r\n**Assistant replies (sketch):**\r\n> ✅ Forest plot generated (lancet theme, with summary diamond and I² label). [SVG output]\r\n\r\n### Example 7 · ⑦ Study quality\r\n**You say:**\r\n> Assess risk of bias with RoB 2.0\r\n\r\n**Assistant replies (sketch):**\r\n> ✅ RoB 2.0 assessment complete. Please provide the risk-of-bias judgment (Low / Some concerns / High) for each study — I'll generate the traffic-light plot and stacked summary bar. [SVG output]\r\n\r\n---\r\n\r\n## 2. What You Can Do — Scenario Index\r\n\r\nCategories are grouped by **workflow stage first, then analysis purpose** (7 below). The systematic-review workflow comes first as the upstream gate, followed by six analysis-purpose categories. Each row gives the typical **clinical scenario** and a line you can **copy verbatim** under \"Try saying\". The same test may be reached from multiple entry points.\r\n\r\n> The underlying R packages (metafor / meta / netmeta …) are listed in Section 6 \"Advanced Reference\"; ordinary users don't need to care.\r\n\r\n### ① Systematic Review Workflow\r\n| Scenario | Try saying in chat |\r\n|:---|:---|\r\n| Topic feasibility check | \"Judge my topic: efficacy of ×××\" (real literature hit counts + 4-dim score verdict) |\r\n| Full topic report | \"Produce the full topic-assessment report\" (PICO → scoring → dedup → compliance pre-check → 11-section report) |\r\n| Literature retrieval | \"Run a systematic search on this topic\" (multi-source + dedup + Excel/HTML, delegated to ct-literature) |\r\n| Title/abstract screening | \"Screen the search results\" (machine pre-screen + per-record human verdict, PRISMA counts bridged) |\r\n| PRISMA flow | \"Help me generate a PRISMA flow diagram\" |\r\n| PRISMA checklist | \"Generate the PRISMA 2020 checklist (27 items)\" |\r\n| Data-extraction assistant | \"Give me an extraction sheet to fill from the papers\" (blank sheet → LLM draft → **line-by-line human verification** → stamp to release) |\r\n| Quality gate | \"Run the quality gate\" (k count / I² / missing bias check — red cards block presentation) |\r\n| Overclaim check | \"Check whether the conclusions overclaim\" (abstract claims vs pooled evidence) |\r\n| Manuscript drafting | \"Draft a submission manuscript from my analysis\" (methods/results auto-filled from real data; background/discussion expanded by LLM; journal-fit advice) |\r\n| Author-supplied evidence | \"I have my own reference list — use it\" (xlsx/csv/RIS/BibTeX/PDF bundle as the draft's evidence base) |\r\n| Reference verification | \"Verify every citation in the draft\" (DOI/title reverse lookup — no hallucinated references) |\r\n| Pre-submission QA | \"Run pre-submission evidence QA\" (numbers reconciled against statistics, red-line gate) |\r\n| PDF batch download | \"Batch download full texts from a DOI list (needs confirmation)\" |\r\n| Graph digitize | \"Extract data from a scatter plot\" |\r\n| Missing value imputation | \"Impute missing standard deviations\" |\r\n| Full-flow web workbench | \"Open the meta workbench\" (guided browser-based full pipeline with clickable human gates) |\r\n\r\n### ② Pairwise Meta-Analysis\r\n| Scenario | Try saying in chat |\r\n|:---|:---|\r\n| Binary (OR/RR/RD) | \"Combine the OR across these 5 binary studies\" |\r\n| Continuous (SMD/MD) | \"Pool the SMD of these 6 continuous studies\" |\r\n| Pre-calculated (yi+CI) | \"I have effect sizes and CIs for 5 studies — draw the forest plot directly\" |\r\n| Survival (HR) | \"Pool the HR across these 8 studies\" |\r\n| Correlation (r→Zr) | \"Convert these 4 correlations via Fisher z then pool\" |\r\n| Single-group rate/mean | \"Pool the incidence rates across these studies\" |\r\n| Generic inverse-variance | \"I have yi and vi — run the meta directly\" |\r\n\r\n### ③ Heterogeneity & Bias\r\n| Scenario | Try saying in chat |\r\n|:---|:---|\r\n| Heterogeneity assessment | \"I ran a meta, I² is very high — help me assess heterogeneity\" |\r\n| Subgroup analysis | \"Run subgroup analysis by region\" |\r\n| Meta-regression | \"Run meta-regression on publication year and sample size\" |\r\n| Egger test | \"Check publication bias, run Egger's test\" |\r\n| Begg test | \"Begg rank-correlation test\" |\r\n| Trim-and-fill | \"Correct publication bias with trim-and-fill\" |\r\n| Selection model | \"Assess publication bias with a selection model\" |\r\n| Sensitivity analysis | \"Run leave-one-out sensitivity analysis\" |\r\n| Cumulative meta | \"Run cumulative meta by publication year\" |\r\n| GOSH plot | \"Plot a GOSH graph to see heterogeneity patterns\" |\r\n| Baujat diagnosis | \"Make a Baujat plot to see which study contributes most heterogeneity\" |\r\n| Drapery plot | \"Plot a Drapery graph to assess α robustness\" |\r\n\r\n### ④ Advanced Models\r\n| Scenario | Try saying in chat |\r\n|:---|:---|\r\n| Frequentist NMA | \"Run network meta with 4 interventions, use netmeta\" |\r\n| Bayesian NMA (Stan) | \"Run Bayesian network meta, Stan backend\" |\r\n| Bayesian NMA (JAGS) | \"Run Bayesian network meta, JAGS backend\" |\r\n| Multilevel meta | \"Run 3-level meta with multiple effects within studies\" |\r\n| Multivariate meta | \"Pool a meta with multiple correlated outcomes\" |\r\n| IPD meta | \"I have individual patient data — run IPD meta\" |\r\n| Dose-response | \"Run dose-response meta, dosresmeta\" |\r\n| Survival meta | \"Pool survival HR via metafor (survmeta removed)\" |\r\n| Trial sequential analysis | \"Run TSA — see how many more studies are needed\" |\r\n| Bootstrap meta | \"Use Bootstrap for nonparametric DL estimation\" |\r\n| Component NMA (CNMA) | \"Run component network meta — decompose combination treatments (A+B, additive model) and test the additivity assumption\" |\r\n| NMA ranking | \"Rank the NMA interventions: SUCRA and P-scores\" |\r\n| Diagnostic accuracy meta | \"Run diagnostic-accuracy meta — I have tp/fp/fn/tn\" |\r\n| Incidence-rate meta | \"Run incidence-rate (person-time) meta\" |\r\n| Power analysis | \"What power does this meta have / how large a sample do I need\" |\r\n\r\n### ⑤ Effect Size & Conversion\r\n| Scenario | Try saying in chat |\r\n|:---|:---|\r\n| Mean/SD→d | \"Convert mean and SD to Cohen's d\" |\r\n| t/F→d | \"Convert a t value to d\" |\r\n| r→Fisher z | \"Convert a correlation to Fisher z\" |\r\n| d↔logOR | \"Convert d to logOR\" |\r\n| OR↔logOR | \"Convert OR to logOR\" |\r\n| Batch convert | \"Batch convert SMD to logOR\" |\r\n| NNT | \"Calculate NNT\" |\r\n\r\n### ⑥ Visualization\r\n| Scenario | Try saying in chat |\r\n|:---|:---|\r\n| Forest plot | \"Draw a forest plot, lancet theme\" |\r\n| Funnel plot | \"Draw a funnel plot with contour enhancement\" |\r\n| Bubble plot | \"Draw a meta-regression bubble plot\" |\r\n| GOSH plot | \"Plot a GOSH graph\" |\r\n| Network plot | \"Draw the network meta graph\" |\r\n| League table | \"Draw the NMA league table\" |\r\n| RoB traffic-light | \"Draw a risk-of-bias traffic-light plot\" |\r\n| Power curve | \"Draw a power curve\" |\r\n| Drapery plot | \"Plot a Drapery graph\" |\r\n| Inconsistency heatmap | \"Plot an NMA inconsistency heatmap\" |\r\n\r\n### ⑦ Study Quality\r\n| Scenario | Try saying in chat |\r\n|:---|:---|\r\n| RoB 2.0 | \"Assess risk of bias with RoB 2.0\" |\r\n| RoB 1.0 | \"Assess with Cochrane RoB 1.0\" |\r\n| ROBINS-I | \"Non-randomized study — use ROBINS-I\" |\r\n| RoB summary plot | \"Draw the stacked risk-of-bias summary bar plot\" |\r\n| GRADE | \"Do a GRADE evidence-quality assessment\" |\r\n| CINeMA (network evidence) | \"Assess the NMA with the CINeMA six domains\" |\r\n| PRISMA checklist | \"PRISMA checklist\" |\r\n\r\n---\r\n\r\n---\r\n\r\n## 2.1 Supported Figures (23)\r\n\r\nThe skill renders **23 analysis figures** on the cloud coze R engine. Pass the plot type via the `plots` field. `prisma_flow` / `prisma` and `rob` / `rob2` resolve to the same figure.\r\n\r\n| # | Plot type | 中文名 | English name | Analysis area | Purpose |\r\n|:---:|:---|:---|:---|:---|:---|\r\n| 1 | `forest` | 森林图 | Forest plot | Pairwise / NMA | Pooled effect-size summary |\r\n| 2 | `funnel` | 漏斗图 | Funnel plot | Pairwise | Publication-bias visual |\r\n| 3 | `prisma_flow` | PRISMA 流程图 | PRISMA flow diagram | Systematic review | Four-stage screening flow |\r\n| 4 | `rob` / `rob2` | 偏倚风险图 | RoB traffic-light / summary | Study quality | Cochrane RoB 1.0 / 2.0 |\r\n| 5 | `cumulative` | 累积 Meta 图 | Cumulative meta plot | Pairwise | Accumulated by study order |\r\n| 6 | `baujat` | Baujat 图 | Baujat plot | Heterogeneity | Heterogeneity contributor |\r\n| 7 | `labbe` | L'Abbe 图 | L'Abbe plot | Pairwise (binary) | Effect-consistency check |\r\n| 8 | `radial` | Radial 图 | Radial / Galbraith plot | Heterogeneity | Radial heterogeneity view |\r\n| 9 | `sucra` | SUCRA 排名图 | SUCRA ranking plot | NMA | Intervention rank probability |\r\n| 10 | `egger` | Egger 回归散点图 | Egger's regression plot | Bias | Quantitative bias test |\r\n| 11 | `contribution` | NMA 贡献图 | NMA contribution plot | NMA | Design / comparison contribution |\r\n| 12 | `loo` | 留一法影响图 | Leave-one-out plot | Sensitivity | Sensitivity analysis |\r\n| 13 | `gosh` | GOSH 图 | GOSH plot | Heterogeneity | Heterogeneity pattern clusters |\r\n| 14 | `bubble` | 气泡图 | Bubble plot | Meta-regression | Covariate–effect relationship |\r\n| 15 | `netgraph` | 网络关系图 | Network graph | NMA | Evidence-network structure |\r\n| 16 | `dose_resp` | 剂量反应图 | Dose-response plot | Dose-response | Dose–effect relationship |\r\n| 17 | `drapery` | Drapery 图 | Drapery plot | Sensitivity | α robustness |\r\n| 18 | `sroc` | SROC 曲线 | SROC curve | Diagnostic MA | Diagnostic accuracy |\r\n| 19 | `tsa` | 试验序贯分析图 | Trial sequential analysis | TSA | Evidence sufficiency / required N |\r\n| 20 | `power` | 功效曲线 | Power curve | Power | Statistical power |\r\n| 21 | `influence` | 影响诊断图 | Influence diagnostic plot | Sensitivity | Single-study omission impact |\r\n| 22 | `nodesplit` | 节点拆分图 | Node-splitting plot | NMA | Local inconsistency |\r\n| 23 | `trimfill` | 剪补法漏斗图 | Trim-and-fill funnel plot | Bias | Bias-corrected funnel |\r\n\r\n> Note: `netleague` (NMA league table) is a **tabular** output, not a figure, so it is excluded from the count of 23.\r\n\r\n## 3. First-Time FAQ\r\n\r\n**Q: I only gave effect size and study count, no other parameters — will it still compute?**\r\nA: Yes. Most analyses need only 3 items — effect size (or rate / HR) + α + power. Omitted parts (two-sided α=0.05, 1:1 randomization, follow-up) are filled with sensible defaults; if something truly required is missing, the assistant will ask.\r\n\r\n**Q: Is the n in the result per group or total?**\r\nA: By default it's **per group**; paired / crossover designs report per-sequence, and survival often reports total eve\n\nArchive v2.2.30: 79 files, 360405 bytes\n\nFiles: adapters/__init__.py (242b), adapters/bug_report.py (19798b), adapters/config.json (161b), adapters/coze_client.py (40888b), adapters/coze_integration_test.py (11749b), adapters/coze_token.py (8576b), adapters/literature_probe.py (15015b), adapters/pdf_fetch.py (5624b), adapters/README.md (5650b), adapters/rendering.py (48443b), adapters/req_test.json (718b), adapters/run_analysis.py (9560b), AGENTS.md (12159b), assets/icon.svg (3533b), CHANGELOG.md (139980b), LICENSE (1064b), meta_request.json (1423b), README_zh-CN.md (22921b), README.md (25451b), references/advanced_analysis.md (11464b), references/advanced_api.md (4630b), references/ADVANCED_zh-CN.md (11326b), references/ADVANCED.md (11750b), references/baujat-plot.md (6407b), references/bayesian_nma.md (5064b), references/bug_report_endpoint.md (8202b), references/citations.md (4080b), references/compliance-precheck.md (4359b), references/data_templates.md (7268b), references/dedup-search.md (7846b), references/diagnosis_meta.md (2918b), references/drug_name_map.json (22340b), references/esc_robust_meta.md (7120b), references/forest-binary.md (6361b), references/forest-continuous.md (6703b), references/funnel-plot.md (6290b), references/inline_rendering.md (10612b), references/interactive_menu.md (17895b), references/language_policy.md (5490b), references/migration-notes-aipoch.md (7914b), references/pico-guide.md (3849b), references/prospero-mapping.md (3275b), references/purpose_zh.md (715b), references/r_packages.md (7970b), references/radial-plot.md (6685b), references/references.md (3181b), references/report_template.md (4130b), references/review_workflow.md (3458b), references/revman_complete.md (9148b), references/rob2-plot.md (7595b), references/single_group_meta.md (3247b), references/speed-discipline.md (10901b), references/stata_to_r_mapping.md (4490b), references/survival_meta.md (2388b), references/svg_editing.md (1010b), references/term_map.json (8934b), references/topic-report-template.md (3693b), references/topic-selection.md (10131b), references/tsa_diagnostics.md (3590b), references/units.md (4465b), requirements.txt (1175b), scripts/build_request.py (27797b), scripts/classify.py (7766b), scripts/drug_name_resolver.py (5018b), scripts/excel_style.py (23740b), scripts/generate_topic_report.py (14335b), scripts/i18n.py (6465b), scripts/keyword_breadth.py (9543b), scripts/merge_spec.py (3652b), scripts/meta_request_debug.json (1423b), scripts/meta_request_fixed.json (1620b), scripts/office_to_md.py (7354b), scripts/quality_gate.py (5305b), scripts/run_meta.py (4509b), scripts/source_guard.py (5779b), scripts/topic_report.example.json (5783b), skill-card.md (3426b), SKILL.md (18904b), _meta.json (133b)\n\nArchive v2.2.27: 78 files, 349722 bytes\n\nFiles: adapters/__init__.py (242b), adapters/bug_report.py (19798b), adapters/config.json (161b), adapters/coze_client.py (31303b), adapters/coze_integration_test.py (8488b), adapters/coze_token.py (8576b), adapters/literature_probe.py (15015b), adapters/pdf_fetch.py (5624b), adapters/README.md (5650b), adapters/rendering.py (48443b), adapters/req_test.json (718b), adapters/run_analysis.py (9171b), AGENTS.md (12159b), assets/icon.svg (3533b), CHANGELOG.md (126279b), meta_request.json (1423b), README_zh-CN.md (22921b), README.md (25451b), references/advanced_analysis.md (11464b), references/advanced_api.md (4630b), references/ADVANCED_zh-CN.md (11178b), references/ADVANCED.md (11592b), references/baujat-plot.md (6407b), references/bayesian_nma.md (5064b), references/bug_report_endpoint.md (8202b), references/citations.md (4080b), references/compliance-precheck.md (4359b), references/data_templates.md (7268b), references/dedup-search.md (7846b), references/diagnosis_meta.md (2918b), references/drug_name_map.json (22340b), references/esc_robust_meta.md (7120b), references/forest-binary.md (6361b), references/forest-continuous.md (6703b), references/funnel-plot.md (6290b), references/inline_rendering.md (10612b), references/interactive_menu.md (17895b), references/language_policy.md (5490b), references/migration-notes-aipoch.md (7914b), references/pico-guide.md (3849b), references/prospero-mapping.md (3275b), references/purpose_zh.md (715b), references/r_packages.md (7970b), references/radial-plot.md (6685b), references/references.md (3181b), references/report_template.md (4130b), references/review_workflow.md (3458b), references/revman_complete.md (9148b), references/rob2-plot.md (7595b), references/single_group_meta.md (3247b), references/speed-discipline.md (10901b), references/stata_to_r_mapping.md (4490b), references/survival_meta.md (2388b), references/svg_editing.md (1010b), references/term_map.json (8934b), references/topic-report-template.md (3693b), references/topic-selection.md (10131b), references/tsa_diagnostics.md (3590b), references/units.md (4465b), requirements.txt (1175b), scripts/build_request.py (27797b), scripts/classify.py (7766b), scripts/drug_name_resolver.py (5018b), scripts/excel_style.py (23740b), scripts/generate_topic_report.py (14335b), scripts/i18n.py (6465b), scripts/keyword_breadth.py (9543b), scripts/merge_spec.py (3652b), scripts/meta_request_debug.json (1423b), scripts/meta_request_fixed.json (1620b), scripts/office_to_md.py (7354b), scripts/quality_gate.py (5305b), scripts/run_meta.py (4509b), scripts/source_guard.py (5779b), scripts/topic_report.example.json (5783b), skill-card.md (2631b), SKILL.md (17831b), _meta.json (133b)\n\nArchive v2.2.16: 79 files, 334761 bytes\n\nFiles: adapters/__init__.py (242b), adapters/bug_report.py (19798b), adapters/config.json (161b), adapters/coze_client.py (19080b), adapters/coze_integration_test.py (8488b), adapters/coze_token.py (8576b), adapters/literature_probe.py (15015b), adapters/pdf_fetch.py (5624b), adapters/README.md (5650b), adapters/rendering.py (42731b), adapters/req_test.json (718b), adapters/run_analysis.py (9171b), AGENTS.md (10871b), assets/icon.svg (3533b), CHANGELOG.md (105796b), LICENSE (1064b), meta_request.json (1423b), README_zh-CN.md (22921b), README.md (25451b), references/advanced_analysis.md (11464b), references/advanced_api.md (4630b), references/ADVANCED_zh-CN.md (11178b), references/ADVANCED.md (11592b), references/baujat-plot.md (6407b), references/bayesian_nma.md (5064b), references/bug_report_endpoint.md (8202b), references/citations.md (4080b), references/compliance-precheck.md (4359b), references/data_templates.md (7268b), references/dedup-search.md (7846b), references/diagnosis_meta.md (2918b), references/drug_name_map.json (22340b), references/esc_robust_meta.md (7120b), references/forest-binary.md (6361b)...","readmeExcerpt":"Skill: Meta Analysis / 医学Meta分析 Owner: medstatstar Summary: Comprehensive R-based meta-analysis skill covering RevMan + Stata equivalents + esc + RVE + Bayesian NMA + survival meta + TSA + single-group meta + diagnostic meta + systematic review workflow; produces forest plots, funnel plots, heterogeneity (I²), publication bias, subgroup analysis, meta-regression, network meta, for a total of 23 analysis figures. All ","codeSnippets":[],"executableExamples":[{"language":"bash","snippet":"# Compute track one-shot: report lands in --out-dir (user workspace); in-conversation data uses --data-json to skip file writes.\n# If data comes from a file, pass --data <csv|json absolute path> (csv auto-converts to JSON before sending to coze).\npython scripts/run_meta.py --query \"<user original request>\" --data-json '<[{\"study\":\"S1\",...}]>' --out-dir \"<user workspace>/meta_analysis\""},{"language":"text","snippet":"┌─────────────────────────────────────────────┐\n   分析请求 ──────▶│ adapters/run_analysis.py  (统一入口)         │\n (task/data/…)    │   唯一对外路径 = coze                         │\n                 └───────────────┬─────────────────────────────┘\n                                 │\n                   coze_client.run_meta ── 成功 ──▶ _source=\"coze\"\n                                 │ 失败（网络/HTTP/空响应/未授权）\n                                 ▼\n                          返回结构化错误（不再回退本地）"},{"language":"text","snippet":"adapters/\n├── run_analysis.py        # 统一前端：唯一对外路径 = coze\n├── literature_probe.py    # ★ 选题去重自包含探针：Europe PMC REST（Cochrane+PubMed 层真实 hit_count），零依赖、不依赖其他技能\n├── coze_client.py         # Coze /run 客户端（唯一路径）：信封打包 / 响应解析\n├── coze_cases/            # 3 个冒烟案例（快速自测）\n├── coze/          # ★ coze 项目本地镜像（与 coze 远端双向同步的唯一源，2026-08-19 统一放置）\n│   ├── coze_contract.md   #   接口契约（§16.7 红线：不随技能发布，已 ignore）\n│   ├── src/r_engine/*.R   #   R 引擎（run_task.R 等，coze 端运行本体）\n│   ├── scripts/           #   部署脚本（http_run.sh / setup.sh 等）\n│   └── docker/ assets/    #   镜像/依赖清单\n├── _dev/                  # ★ 开发调试用，已 ignore（不随发布包分发）；历史本地 R 引擎已删除\n└── README.md              # 本文件"},{"language":"python","snippet":"import sys; sys.path.insert(0, \"adapters\")\nfrom run_analysis import run_analysis\n\n# 唯一路径：coze 云端 R 计算\nout = run_analysis(\n    task=\"pairwise_meta\",\n    data={\"rows\": [{\"study\": \"A\", \"event_exp\": 12, \"n_exp\": 100,\n                    \"event_ctrl\": 20, \"n_ctrl\": 100}]},\n    params={\"sm\": \"OR\", \"model\": \"REML\"},\n    figure={\"plots\": [\"forest\"]},\n)\n# 成功：out[\"_source\"] == \"coze\"\n# 失败：out[\"status\"] == \"error\"（coze 不可达/未授权），无 _source 回退"},{"language":"r","snippet":"library(metafor)\n\n# Level 1: 抽样方差\n# Level 2: 研究内（多结局/多组）\n# Level 3: 研究间\n\nmlma_result <- rma.mv(\n  yi = yi,\n  V = vi,\n  random = list(~ 1 | study_id, ~ 1 | outcome_id),\n  data = mlma_data,\n  method = \"REML\"\n)\n\n# 输出方差成分\nprint(mlma_result)\n\n# 跨层异方差\nmlma_het <- rma.mv(\n  yi = yi,\n  V = diag(tau2_within) + diag(tau2_between),\n  random = list(~ 1 | study_id, ~ 1 | outcome_id),\n  data = mlma_data,\n  method = \"REML\",\n  control = list(optimizer = \"optim\")\n)"},{"language":"r","snippet":"# 多臂研究（Bolding et al. 处理方法）\n# 需要构建方差-协方差矩阵\n\nlibrary(metafor)\n\n# 构建 covariances 矩阵 for multi-arm studies\n# CS 结构（复合对称）\nV_matrix <- lapply(unique(mlma_data$study_id), function(s) {\n  sub <- mlma_data[mlma_data$study_id == s, ]\n  k <- nrow(sub)\n  vi <- sub$vi\n  tau2 <- mlma_result$sigma2[1]\n  \n  V <- matrix(tau2, nrow = k, ncol = k)\n  diag(V) <- vi\n  V\n})\n\n# 运行多水平模型\nlibrary(clubSandwich)\nmlma_result <- rma.mv(\n  yi = yi,\n  V = V_matrix,\n  random = ~ 1 | study_id/outcome_id,\n  data = mlma_data,\n  method = \"REML\"\n)"}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\nname: meta-analysis\ncn_name: 医学Meta分析\nslug: meta-analysis\ndisplayName: Meta Analysis / 医学Meta分析\nversion: 2.20.1\nlicense: MIT\nsummary: 基于 R 的全方位 Meta 分析技能，覆盖 RevMan + Stata 等价 + esc + RVE + 贝叶斯 NMA + 生存 Meta + TSA + 单组率 Meta + 诊断 Meta + 系统评价流程；输出森林图、漏斗图、异质性(I²)、发表偏倚、亚组分析、元回归、网络 Meta等共 23 种分析图形。所有分析提供可复现 R 代码。还可提供Meta选题方向判断 + 文献检索整理 + 筛选 + 数据提取功能。\ndescription: \"Comprehensive R-based meta-analysis skill covering RevMan + Stata equivalents + esc + RVE + Bayesian NMA + survival meta + TSA + single-group meta + diagnostic meta + systematic review workflow; produces forest plots, funnel plots, heterogeneity (I²), publication bias, subgroup analysis, meta-regression, network meta, for a total of 23 analysis figures. All analyses ship reproducible R code. Can also provide meta topic-direction judgment + literature retrieval and organization + screening + data-extraction functionality. / 基于 R 的全方位 Meta 分析技能，覆盖 RevMan + Stata 等价 + esc + RVE + 贝叶斯 NMA + 生存 Meta + TSA + 单组率 Meta + 诊断 Meta + 系统评价流程；输出森林图、漏斗图、异质性(I²)、发表偏倚、亚组分析、元回归、网络 Meta等共 23 种分析图形。所有分析提供可复现 R 代码。还可提供Meta选题方向判断 + 文献检索整理 + 筛选 + 数据提取功能。\"\n\nrequired_commands: [python]\ninvocable: true\n\ntriggers:\n  - \"meta分析\"\n  - \"meta-analysis\"\n  - \"系统评价\"\n  - \"森林图\"\n  - \"漏斗图\"\n  - \"异质性\"\n  - \"发表偏倚\"\n  - \"元回归\"\n  - \"network meta\"\n  - \"贝叶斯meta\"\n  - \"效应量转换\"\n  - \"TSA\"\n  - \"诊断meta\"\n  - \"full meta pipeline\"\n  - \"上下文菜单\"\n  - \"对话菜单\"\n  - \"全流程菜单\"\n  - \"flow menu\"\n  - \"论文撰写\"\n  - \"写稿\"\n  - \"初稿\"\n  - \"投稿建议\"\n  - \"发表建议\"\n  - \"writing advisor\"\n  - \"manuscript\"\npermissions:\n  scope: \"user-space-only\"\n  network: required\n  network_note: \"All numerical computation runs on the coze cloud R engine; analysis params/summary stats are POSTed to coze. No local-R fallback (paid-only feature); IPD only if the user explicitly opts in.\"\n  filesystem: \"writes only to the current working directory (meta_analysis/ and output/ report artifacts: generated .R scripts, .svg/.png figures, .csv tables); otherwise read-only\"\nmetadata:\n  {\n    \"openclaw\": { \"emoji\": \"📊\", \"icon\": \"assets/icon.svg\" },\n    \"authors\": [\"medstatstar\", \"phoe-zip\"],\n    \"homepage\": \"https://github.com/medstatstar/meta-analysis\",\n    \"workbench_url\": \"https://meta.app.workbuddy.host/\",\n    \"workbench_url_alias\": \"https://meta.app.workbuddy.link/\",\n    \"workbench_domain_prefix\": \"meta\",\n    \"workbench_domain_note\": \"Registered exception to the ct-base iron rule (2026-09-16): simplified prefix 'meta' instead of the skill name. Whitelisted, do not extend.\",\n    \"workbench_app_id\": \"wbapp_hNZl928SI6wByvJt2COtcC\",\n    \"workbench_owner_workspace\": \"2026-09-17-09-54-01\",\n    \"workbench_sandbox\": \"a3c70e48be8f45019845b76383334bfc\",\n    \"tags\": [\"meta-analysis\", \"systematic-review\", \"clinical-trials\", \"R\", \"biostatistics\", \"evidence-based-medicine\", \"forest-plot\", \"network-meta-analysis\", \"bayesian\", \"metafor\", \"meta\", \"netmeta\", \"gemtc\", \"revman\", \"robumeta\", \"clubSandwich\", \"esc\", \"dosresmeta\", \"mada\", \"metagear\", \"forestploter\"],\n  }\n---\n\n# Meta-Analysis\n\n> R-based comprehensive meta-analy"},{"path":"adapters/README.md","content":"# adapters/ — 计算出口层（ct-base §16.9 架构预留）\n\n> 本目录是 **meta-analysis 技能** 的分析计算出口层。**发布形态为 coze-only**（2026-08-19 决策）：\n> 所有数值计算经 coze 元分析工作流，本地 LLM 仅做需求标准化/数据整理/结果呈现，**最终用户无需安装 R**。\n> 回退逻辑已于 2026-08-26 取消：coze 不可达 / 未授权时直接返回结构化错误，**不再兜底本地引擎**。\n\n## 路由策略（coze 唯一路径，无回退）\n\n```\n                 ┌─────────────────────────────────────────────┐\n   分析请求 ──────▶│ adapters/run_analysis.py  (统一入口)         │\n (task/data/…)    │   唯一对外路径 = coze                         │\n                 └───────────────┬─────────────────────────────┘\n                                 │\n                   coze_client.run_meta ── 成功 ──▶ _source=\"coze\"\n                                 │ 失败（网络/HTTP/空响应/未授权）\n                                 ▼\n                          返回结构化错误（不再回退本地）\n```\n\n- **发布形态**：唯一路径 = `coze`。coze 失败时直接返回 `{status:\"error\", ...}`，由上层决定如何提示用户。\n- **`_source` 字段**：仅 `\"coze\"`（成功）或缺失（结构化错误，不标 local_fallback）。\n- **开发者/复现**：本地无独立计算引擎。所有数值计算由 coze 端 R 引擎完成；`_dev/` 仅作开发调试占位（历史本地 R 引擎 `local_engine.py` 已于 2026-09-01 按架构终态原则删除）。\n\n## 文件\n\n```\nadapters/\n├── run_analysis.py        # 统一前端：唯一对外路径 = coze\n├── literature_probe.py    # ★ 选题去重自包含探针：Europe PMC REST（Cochrane+PubMed 层真实 hit_count），零依赖、不依赖其他技能\n├── coze_client.py         # Coze /run 客户端（唯一路径）：信封打包 / 响应解析\n├── coze_cases/            # 3 个冒烟案例（快速自测）\n├── coze/          # ★ coze 项目本地镜像（与 coze 远端双向同步的唯一源，2026-08-19 统一放置）\n│   ├── coze_contract.md   #   接口契约（§16.7 红线：不随技能发布，已 ignore）\n│   ├── src/r_engine/*.R   #   R 引擎（run_task.R 等，coze 端运行本体）\n│   ├── scripts/           #   部署脚本（http_run.sh / setup.sh 等）\n│   └── docker/ assets/    #   镜像/依赖清单\n├── _dev/                  # ★ 开发调试用，已 ignore（不随发布包分发）；历史本地 R 引擎已删除\n└── README.md              # 本文件\n```\n\n## coze 项目镜像：双向同步约定（2026-08-19 统一）\n\n> **`adapters/coze/` 是 coze 远端代码在本地唯一的同步源。** 所有 coze 端代码变更都从这里进出：\n> 本地改代码 → 打包部署 coze；coze 平台导出 → 覆盖回此目录。**不再使用工作区 `coze_meta_project/` 作为主镜像**（保留为历史快照）。\n\n- **本地 → coze**：改 `adapters/coze/` 内文件 → `tar -czf coze_final_YYYYMMDD.tar.gz .`（在镜像目录内）→ 上传 coze 平台 → vefaas 重部署 → 线上 96 例复测。\n- **coze → 本地**：coze 平台导出 project → 解包覆盖 `adapters/coze/` → `diff -r` 与镜像内 `src/r_engine/` 比对确认。\n- **发布排除**：`adapters/coze/` 已加入 `.gitignore` / `.clawhubignore`，**不随技能发布**（coze_contract.md 属 §16.7 红线）。\n- **一致性基准**：`adapters/coze/src/r_engine/` 为唯一本地引擎（技能根 `r_engine/` 已删），与 coze 远端同步。\n\n## 配置（环境变量）\n\n| 变量 | 说明 | 默认 |\n|------|------|------|\n| `COZE_META_ENDPOINT` | coze 工作流 `/run` 地址（2026-08-26 改造，主工作流回切 ct-meta） | `https://ct-meta.coze.site/run` |\n| `COZE_META_TOKEN` | 可选 Bearer 鉴权令牌 | 空（不带 Authorization） |\n| `COZE_META_TIMEOUT` | 请求超时（秒） | `600` |\n\n## 用法\n\n```python\nimport sys; sys.path.insert(0, \"adapters\")\nfrom run_analysis import run_analysis\n\n# 唯一路径：coze 云端 R 计算\nout = run_analysis(\n    task=\"pairwise_meta\",\n    data={\"rows\": [{\"study\": \"A\", \"event_exp\": 12, \"n_exp\": 100,\n                    \"event_ctrl\": 20, \"n_ctrl\": 100}]},\n    params={\"sm\": \"OR\", \"model\": \"REML\"},\n    figure={\"plots\": [\"forest\"]},\n)\n# 成功：out[\"_source\"] == \"coze\"\n# 失败：out[\"status\"] == \"error\"（coze 不可达/未授权），无 _sou"},{"path":"cases/README.md","content":"# meta-analysis 案例库总览\r\n\r\n> 由 `cases/case_catalog.py` 生成。案例库 = 技能最便宜的回归基准：每次改 block_a/b/c、pdf_extractor、run_stage 都跑一遍全套案例比对信封/数值是否漂移。\r\n>\r\n> 📋 离线验证结果见 **[VERIFICATION_REPORT.md](./VERIFICATION_REPORT.md)**（14 案例全链路 A4 抽取 + 11 模板 1:1 映射 + 本地可算/需 coze 状态）。\r\n\r\n## 案例清单（14 个）\r\n\r\n| 案例 | 标题 | 类别 | 设计 | 效应量 | 模板 |\r\n|---|---|---|---|---|---|\r\n| C01 | SGLT2 抑制剂 vs 安慰剂对 T2DM 患者 MACE 的影响（二分类 OR） | 数值指标 | 干预性 RCT，二分类结局，pairwise | OR | TPL-01 |\r\n| C02 | 卡介苗（BCG）疫苗对结核病发病的保护效力（二分类 RR） | 数值指标 | 干预性 RCT，二分类结局，pairwise（RR） | RR | TPL-01 |\r\n| C03 | 某干预对术后 30 天死亡率的影响（二分类 RD） | 数值指标 | 干预性 RCT，二分类结局，pairwise（RD） | RD | TPL-01 |\r\n| C04 | 降压药对收缩压（SBP）降低的均数差（连续型 MD） | 数值指标 | 干预性 RCT，连续型结局，pairwise（MD） | MD | TPL-02 |\r\n| C05 | 心理干预对抑郁量表评分的影响（连续型 SMD） | 数值指标 | 干预性 RCT，连续型结局异量纲，pairwise（SMD） | SMD | TPL-02 |\r\n| C06 | 肿瘤免疫治疗对总生存期（OS）的 HR 合并（已有效应量 logHR） | 数值指标 | 干预性 RCT，时间-事件结局，已有效应量 pairwise（logHR） | logHR | TPL-03 |\r\n| C07 | 中心静脉导管相关血流感染（CLABSI）率比（IRR，人时数据） | 数值指标 | 前后对照/队列，率比，pairwise（IRR） | IRR | TPL-04 |\r\n| C08 | 教育年限与健康评分的相关性合并（ZCOR） | 数值指标 | 观察性，相关系数，pairwise（ZCOR） | ZCOR | TPL-05 |\r\n| C09 | 不同地区成人吸烟率合并（单组率 PLOGIT） | 数值指标 | 流行病学调查，单组率，pairwise（PLOGIT） | PLOGIT | TPL-06 |\r\n| C10 | 慢性疼痛患者基线疼痛评分合并（单组均值 MN） | 数值指标 | 观察性/基线，单组均值，pairwise（MN） | MN | TPL-07 |\r\n| C11 | 心衰治疗对心血管死亡风险的 HR（生存分析，O-E/V 法） | 数值指标 | 干预性 RCT，时间-事件结局，pairwise（logHR via O-E/V） | logHR | TPL-08 |\r\n| C12 | 三类降压药对 SBP 降低的网状 Meta（NMA，≥3 干预） | 复杂设计 | 干预性 RCT，多臂，网状 Meta（直接+间接比较） | OR | TPL-09 |\r\n| C13 | 新冠抗原检测准确性的诊断 Meta（DTA，TP/FP/TN/FN） | 复杂设计 | 诊断准确性研究，2×2 四格表，pairwise（DOR/Sens/Spec） | DOR | TPL-10 |\r\n| C14 | 三臂肿瘤 RCT（2 活性药 + 安慰剂）独立对比 Meta（多臂拆分） | 复杂设计 | 干预性多臂 RCT，按对比拆分，pairwise（OR） | OR | TPL-11 |\r\n\r\n## 模板清单（11 个）↔ 对应案例\r\n\r\n| 模板 | 情境 | 效应量 | PDF表型 | 自动识别 | 演示案例 |\r\n|---|---|---|---|---|---|\r\n| TPL-01 | 二分类 2×2 四格表 | OR/RR/RD | T_DICHOT | ✅ 已自动识别 | C01, C02, C03 |\r\n| TPL-02 | 连续型两臂（均值±SD） | MD/SMD | T_CONTINUOUS / T_CONT_TWOARM | ⚠️ 部分自动 | C04, C05 |\r\n| TPL-03 | 已有效应量（对数尺度） | lnOR/SMD/logHR/ROM/ZCOR | T_EFFECT_TABLE / T_MD_CI | ⚠️ 部分自动 | C06 |\r\n| TPL-04 | 率比（人时数据 IRR） | IRR | （暂无自动，需人工映射） | ✋ 需人工映射 | C07 |\r\n| TPL-05 | 相关系数 | ZCOR | （暂无自动，需人工映射） | ✋ 需人工映射 | C08 |\r\n| TPL-06 | 单组率 | PLOGIT/PRAW | （暂无自动，需人工映射） | ✋ 需人工映射 | C09 |\r\n| TPL-07 | 单组均值 | MN | （暂无自动，需人工映射） | ✋ 需人工映射 | C10 |\r\n| TPL-08 | 生存分析 HR | logHR | （暂无自动，需人工映射） | ✋ 需人工映射 | C11 |\r\n| TPL-09 | 网状 Meta（多臂） | OR/RR/MD | （暂无自动，需人工映射） | ✋ 需人工映射 | C12 |\r\n| TPL-10 | 诊断试验准确性（DTA） | DOR/Sens/Spec | （暂无自动，需人工映射） | ✋ 需人工映射 | C13 |\r\n| TPL-11 | 多臂 RCT（独立对比） | OR/RR/RD/MD | （暂无自动，需人工映射） | ✋ 需人工映射 | C14 |\r\n\r\n## 1:1 对应关系说明\r\n\r\n- 每个**数据形状/研究情境**有且仅有一个 Excel 提取模板（`TPL-xx`）。\r\n- 每个模板的「数据录入」sheet 列定义与 `references/data_templates.md` 完全一致，并追加 `PDF来源(页/表)` 与 `备注` 两列用于溯源。\r\n- `pdf_extractor` 当前 P1 仅自动识别 T_DICHOT / T_CONTINUOUS 系列；其余形状标注「需人工映射」，模板即人工映射的落地载体。\r\n- 运行：`python adapters/run_case_human.py --case <案例ID>`（默认 C01）。"},{"path":"README.md","content":"# meta-analysis\n\n- **English guide** → [README.md](https://github.com/medstatstar/meta-analysis/blob/main/README.md) · **中文指南** → [README_zh-CN.md](https://github.com/medstatstar/meta-analysis/blob/main/README_zh-CN.md)\n\n<div align=\"center\">\n  <img src=\"assets/icon.svg\" width=\"240\" height=\"240\" alt=\"meta-analysis logo\"/>\n</div>\n\n> **Works without installation:** If you'd rather not install and just want to quickly use this skill's basic features, you can also visit the ct-series unified web portal **https://ct.medstatstar.com** directly.\n\n> **Easy-to-use R-based Meta-Analysis for Clinical Researchers**\n>\n> You don't need to code or memorize commands — just describe your meta-analysis needs in **plain language inside a chat**, and the skill **automatically runs** the full analysis (pooling, figures, report) for you. Powered by R and 14 core + 2 optional professional R packages (metafor, meta, netmeta, bayesmeta, dosresmeta, mada, etc.), it returns results in Chinese or English depending on your OS language setting (you can force-switch via a prompt at any time). Once you describe a request, the skill **auto-executes** and returns results + figures; ask for the full reproducible R code at any time.\n\n---\n\n## Who This Is For\n\nmeta-analysis is part of the CT-series skill family, built for three groups:\n\n- **Clinical-trial practitioners at pharmaceutical companies** — sponsors, CROs, and medical / statistical / regulatory roles who need to pool and compare study evidence;\n- **Clinicians and nurses who design, conduct, or participate in clinical research** and need meta-analysis / systematic-review support;\n- **Medical students who want to learn evidence-based medicine and meta-analysis methodology in a structured way**.\n\n---\n\n## 1. How to Use It in a Chat (the Core)\n\nmeta-analysis is a **conversational skill**: you simply tell the assistant what you want in natural language — no commands, no parameter names to remember. As a WorkBuddy skill it **auto-loads with no extra installation**.\n\nBelow are 7 real conversational examples — **one per category** in the Scenario Index (§2): ① systematic-review workflow, ② pairwise meta, ③ heterogeneity & bias, ④ advanced models, ⑤ effect-size conversion, ⑥ visualization, ⑦ study quality. Each shows **\"You say\"** and a sketch of **\"The assistant replies\"**, plus how to get the actual number.\n\n### Example 1 · ① Systematic review workflow: topic selection\n**You say:**\n> I'm interested in SGLT2 inhibitors for renoprotection and cardiovascular benefit in chronic kidney disease (CKD), but I haven't decided which specific meta-analysis direction to pursue. Can you help me shortlist candidate directions?\n\n**Assistant replies (sketch):**\n> Sure — I'll use a **topic-selection approach** to lock down the direction. First I run the **in-skill dedup probe (Cochrane + PubMed real hit counts)**, then shortlist — otherwise a saturated direction can be wrongly pushed as top pick.\n>\n> **First, rule out the saturated directions**: the"},{"path":"references/design/ccm/README.md","content":"# CCM — Conversation Context Menu / 对话上下文菜单（设计归档）\r\n\r\n> **状态：设计完成 · 已实现（2026-09-10）。** 本目录只放设计文档；\r\n> **可运行代码在 `scripts/flow_menu.py`，规范版在 `references/conversation_flow_menu.md`，\r\n> 回归在 `tests/test_flow_menu.py`（153 PASS / 0 FAIL）。** 以规范版为准，本目录仅存设计过程。\r\n> **背景：** 工作台（`adapters/workbench/`）已有完整的 12 节点渲染契约（`form_schema.py`）与 HITL 状态机（`adapters/fullflow.py`），但**对话侧没有菜单**——每轮展示什么、闸位有哪些选项，全靠 LLM 即兴，同一节点两次渲染可能不一致。\r\n> CCM 的目标是给同一套 schema 加一层「对话投影」，**不新建第二套流程定义**。\r\n\r\n---\r\n\r\n## 归档清单\r\n\r\n| 文件 | 状态 | 内容 |\r\n|---|---|---|\r\n| **`10_A_stage_menu_spec_v1.0.md`** | 🗄 已被收编 | A 阶段四节点菜单规格 —— **内容已收编进规范版 `references/conversation_flow_menu.md`，以那份为准**；此处仅存设计过程 |\r\n| `03_v0.4_A2fix_A3_contract.md` | ✅ 已实施 | A2 解释器路径修复记录（含端到端回归证据）+ A3 纯文件交接契约 + A4 按清单直下 |\r\n| `02_v0.3_A2A3_handoff.md` | ✅ 已实施 | A2/A3 向 ct-literature 移交的可行性评估、简化后菜单、风险 |\r\n| `01_framework_v0.2_draft.md` | 📐 框架草案 | 三层菜单（L0 导航条 / L1 节点菜单 / L2 字段菜单）+ **操作四策略分流**（原生迁移 · 降级简化 · 文件交接 · **跳过转出**）+ 四问判定 + `defer` 语义 |\r\n| `00_framework_v0.1_superseded.md` | 🗄 存档 | 最初框架，已被 v0.2 取代（保留备查） |\r\n\r\n> ⚠️ 阅读顺序：先 `01`（拿框架与分流规则），再 **`references/conversation_flow_menu.md`**（拿现行规范与落地细节）。`02`/`03` 是已实施的改动记录，`00`/`10` 可跳过。\r\n>\r\n> **实测遗留（2026-09-10）**：规范版 **§7.1 会话版本漂移** + **§8 的 D18 / D19**\r\n> （A4 下载配额与菜单未暴露 `fetch_log`）来自真实会话验收，**尚未修复**，交接前先读那两节。\r\n\r\n---\r\n\r\n## 框架要点（来自 `01`，尚未实现）\r\n\r\n**三层菜单**\r\n- **L0 上下文导航条** —— 12 节点压一行，每轮必贴（解决「每轮无位置感」）\r\n- **L1 节点菜单** —— 节点头 + 数据摘要 + 该节点专属选项\r\n- **L2 字段菜单** —— 只列该节点 `EDITABLE_KEYS`；全局指令 `/flow` `/node` `/rewind` `/explain` `/raw` `/workbench` `/export`\r\n\r\n**操作四策略**（对话侧不是工作台的能力等价物）\r\n\r\n| 策略 | 判据 | 例 |\r\n|---|---|---|\r\n| 原生迁移 | 读 + 单决策 | 9 个节点的主体面板 |\r\n| 降级简化 | 可自动化掉人工步骤 | 上传按 DOI/标题自动匹配，只问未匹配项 |\r\n| 文件交接 | >10 条逐条编辑，表格更合适 | A3 裁决表（⬇ 导出 / ⬆ 传回） |\r\n| **跳过转出** | 需视觉/空间信息、多选拖拽指派 | PDF 页码预览、文件↔条目映射 |\r\n\r\n**四问判定**（命中任一即转出，不进对话）\r\n1. 需要视觉/空间信息（PDF 页面、图片、并排）？\r\n2. 涉及 >10 条记录逐条编辑？\r\n3. 需要多选/拖拽/指派（文件↔条目映射）？\r\n4. 只是读 + 单决策？→ 优先进\r\n\r\n**`defer` ≠ `skip`（关键概念）**\r\n\r\n| | `skip` | `defer` |\r\n|---|---|---|\r\n| 含义 | 本会话不再停靠该节点，按默认值放行 | 人工动作**未完成**，流程**不得前进** |\r\n| 适用 | 仅软停 | 任意节点，尤其 🔴 |\r\n| 审计 | 写 `human_decisions` | **不写**，改写 `pending_actions`（双端共享待办） |\r\n| 效果 | 下游继续跑 | 闸位保持，`approve` 被拒 |\r\n\r\n> **混淆这两者 = 让红线的人工核验被静默绕过。** 因此 `pending_actions` 非空时须在**脚本层**直接拒绝放行，不靠提示词约束。\r\n\r\n**选项穷举原则** —— GUI 的选项是「可见的」，对话里用户不知道有哪些选项，所以**选项必须由我方穷举编号**（禁止「你要继续吗？」这类开放式问法）；≤3 个用卡片，≥4 用编号文本菜单；🔴 节点选项集中**禁止出现「跳过」**（由 `_REDLINE_GATES` 派生过滤）。\r\n\r\n---\r\n\r\n## 实现时的硬约束\r\n\r\n1. **状态真源只有一个**：复用工作台 `fullflow_session_ff-*.json`，CCM 不另起一套。收益是**对话 ↔ 工作台可中途无缝互切**。\r\n2. **菜单由代码产出、LLM 只转述** —— 避免同节点两次渲染不一致。\r\n3. **`/rewind` 候选集须服务端派生** —— `workbench.html:737` 的候选枚举是纯 JS（块序 + 块内次序 + `curIdx=-1`），对话侧**不可重写这套逻辑**（第二份真源必然漂移），应从 `/api/session` 的 `progress`/`next_human_action` 派生。\r\n4. **🔴 选项由 `cc._REDLINE_GATES` 派生** —— 不硬编码第二份清单。\r\n5. **不干扰纯算数请求** —— 「合并这 5 项 OR」/ NMA / 敏感性分析等**完全不出现 CCM**，保住「描述即执行」卖点。\r\n6. **回显块前缀分离** —— CCM 用 `## 当前流程设定 / Current pipeline settings:`，与计算轨道的 `## 当前分析设定:` 互不覆盖。\r\n\r\n---\r\n\r\n## 待落地清单\r\n\r\n> ⚠️ **以下清单已于 2026-09-10 落地**（`scripts/flow_menu.py` + `tests/test_flow_"}],"languages":[],"docsSourceLabel":"CLAWHUB","editorialOverview":"Comprehensive R-based meta-analysis skill covering RevMan + Stata equivalents + esc + RVE + Bayesian NMA + survival meta + TSA + single-group meta + diagnostic meta + systematic review workflow; produces forest plots, funnel plots, heterogeneity (I²), publication bias, subgroup analysis, meta-regression, network meta, for a total of 23 analysis figures. All analyses ship reproducible R code. Can also provide meta topic-direction judgment + literature retrieval and organization + screening + data-extraction functionality. / 基于 R 的全方位 Meta 分析技能，覆盖 RevMan + Stata 等价 + esc + RVE + 贝叶斯 NMA + 生存 Meta + TSA + 单组率 Meta + 诊断 Meta + 系统评价流程；输出森林图、漏斗图、异质性(I²)、发表偏倚、亚组分析、元回归、网络 Meta等共 23 种分析图形。所有分析提供可复现 R 代码。还可提供Meta选题方向判断 + 文献检索整理 + 筛选 + 数据提取功能。 Skill: Meta Analysis / 医学Meta分析 Owner: medstatstar Summary: Comprehensive R-based meta-analysis skill covering RevMan + Stata equivalents + esc + RVE + Bayesian NMA + survival meta + TSA + single-group meta + diagnostic meta + systematic review workflow; produces forest plots, funnel plots, heterogeneity (I²), publication bias, subgroup analysis, meta-regression, network meta, for a total of 23 analysis figures. All","editorialQuality":{"score":100,"threshold":65,"status":"ready","wordCount":1906,"uniquenessScore":47,"reasons":[]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-09T20:31:28.629Z","emptyReason":"No screenshots, media assets, or demo links are available."},"primaryImageUrl":null,"mediaAssetCount":0,"assets":[],"demoUrl":null},"ownerResources":{"evidence":{"source":"unclaimed","verified":false,"confidence":"low","updatedAt":"2026-10-09T20:31:28.629Z","emptyReason":"This page has not been claimed by the agent owner."},"hasCustomPage":false,"customPageUpdatedAt":null,"customLinks":[],"structuredLinks":{"docsUrl":null,"demoUrl":null,"supportUrl":null,"pricingUrl":null,"statusUrl":null},"customPage":null},"relatedAgents":{"evidence":{"source":"protocol-neighbors","verified":false,"confidence":"medium","updatedAt":"2026-10-10T07:39:48.666Z","emptyReason":null},"items":[{"id":"8ebccd8e-3863-4187-8355-c3f14e1f9edf","entityType":"agent","canonicalPath":"/agent/iofficeai-aionui","slug":"iofficeai-aionui","name":"AionUi","description":"Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!","url":"https://github.com/iOfficeAI/AionUi","homepage":"https://www.aionui.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-10-09T19:11:12.944Z","createdAt":"2026-02-25T03:38:16.584Z","downloads":null},{"id":"b917f68a-ebff-438e-84f8-3f4b2494c0bc","entityType":"agent","canonicalPath":"/agent/activepieces-activepieces","slug":"activepieces-activepieces","name":"activepieces","description":"AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents","url":"https://github.com/activepieces/activepieces","homepage":"https://www.activepieces.com","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-15T02:22:12.426Z","createdAt":"2026-02-25T03:38:12.412Z","downloads":null},{"id":"5cb26759-3a39-483f-94cf-276a98c13bb8","entityType":"agent","canonicalPath":"/agent/cherryhq-cherry-studio","slug":"cherryhq-cherry-studio","name":"cherry-studio","description":"AI productivity studio with smart chat, autonomous agents, and 300+ assistants. Unified access to frontier LLMs","url":"https://github.com/CherryHQ/cherry-studio","homepage":"https://cherry-ai.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-11T14:38:40.986Z","createdAt":"2026-02-25T03:38:19.379Z","downloads":null},{"id":"6f6582d0-5d76-4f0f-b81d-86520247950b","entityType":"agent","canonicalPath":"/agent/copilotkit-copilotkit","slug":"copilotkit-copilotkit","name":"CopilotKit","description":"The Frontend for Agents & Generative UI. React + Angular","url":"https://github.com/CopilotKit/CopilotKit","homepage":"https://docs.copilotkit.ai","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-03-25T09:50:57.846Z","createdAt":"2026-02-25T03:39:14.617Z","downloads":null}],"links":{"hub":"/agent","source":"/agent/source/clawhub","protocols":[{"label":"OpenClaw","href":"/agent/protocol/openclew"}]}}}