跨源检索全球临床试验注册库并归一化聚合。可自动化直连:ClinicalTrials.gov v2、PubChem(公开 REST API,零保密数据或信息输入)。中国 CDE 因 WAF 拦截自动化浏览器,改为外部工作流自动化检索(第三方端点,仅公开查询词出域,需 Bearer token,已实测无 token 返回 401);ChiCTR 经统一端点(source=chictr,第三方,共享 Bearer)检索,用户粘贴页面仅作本地解析兜底;EU CTIS 仅支持按号 retrieve(无搜索);ISRCTN 公开 API 已失效,但可经统一端点(source=isrctn)取。聚合分期/状态/申办方/时间线/竞品格局,产出 JSON / Markdown(可选 PNG;可选经 download_docs.py 拉取 EU-CTR 文档 PDF 到本地 --out-dir)。CDE 亦支持可选商业 API key(--cde-api-key,仅发往官方 CDE API)。零保密数据或信息输入,B 档(普通数据输入 + 对外检索),可快速推广技能。 / Cross-source search of global clinical-trial registries, normalized and aggregated. Auto-direct sources: ClinicalTrials.gov v2, PubChem (public REST, ordinary input + public retrieval). China CDE blocks automated browsers via WAF → external workflow for automatable retrieval (third-party endpoint, public query terms only egress, Bearer token REQUIRED — verified: HTTP 401 without it); ChiCTR retrieved via unified endpoint (source=chictr, third-party, shared Bearer), with user-pasted page as a local-parse fallbac
设计与多媒体
ct-safety
试用基于 FDA FAERS(经 openFDA 公开 REST API)做药物-事件 disproportionality 信号检测,计算 PRR / ROR / IC / EBGM 及 95% 置信区间与信号判定;一次性流水线默认产出两份核心交付物——① 可渲染的 HTML 报告(可视化结论)② XLSX 数据簿(含全部原始 FAERS 计数、2×2 表、四种方法及 FDA 标签/CN-PV/评分明细,供逐条查阅与审计);同时保留 JSON / Markdown 作兼容备份。可选 --with-cn-pv 增加中国官方药物警戒通报(cdr-adr.org.cn)定性检索作信号佐证。所有数据均为公开不良事件报告,不输入任何保密数据或信息,B 档(普通数据输入 + 对外检索),可快速推广技能。 / Signal detection on FDA FAERS (via openFDA public REST API): computes PRR / ROR / IC / EBGM with 95% CIs and signal flags from the drug-event 2x2 table. The one-shot pipeline emits TWO core deliverables by default — ① a renderable HTML report (visual conclusion) and ② an XLSX workbook holding ALL raw FAERS counts, the 2x2 table, the four methods, and FDA-label / CN-PV / score details for line-by-line audit; JSON / Markdown are kept as compatibility backups. Optional --with-cn-pv adds qualitative China official PV bulletin search (cdr-adr.org.cn) as signal corroboration. All data are public adverse-event reports; zero confidential data or in
它能做什么
基于 FDA FAERS(经 openFDA 公开 REST API)做药物-事件 disproportionality 信号检测,计算 PRR / ROR / IC / EBGM 及 95% 置信区间与信号判定;一次性流水线默认产出两份核心交付物——① 可渲染的 HTML 报告(可视化结论)② XLSX 数据簿(含全部原始 FAERS 计数、2×2 表、四种方法及 FDA 标签/CN-PV/评分明细,供逐条查阅与审计);同时保留 JSON / Markdown 作兼容备份。可选 --with-cn-pv 增加中国官方药物警戒通报(cdr-adr.org.cn)定性检索作信号佐证。所有数据均为公开不良事件报告,不输入任何保密数据或信息,B 档(普通数据输入 + 对外检索),可快速推广技能。 / Signal detection on FDA FAERS (via openFDA public REST API): computes PRR / ROR / IC / EBGM with 95% CIs and signal flags from the drug-event 2x2 table. The one-shot pipeline emits TWO core deliverables by default — ① a renderable HTML report (visual conclusion) and ② an XLSX workbook holding ALL raw FAERS counts, the 2x2 table, the four methods, and FDA-label / CN-PV / score details for line-by-line audit; JSON / Markdown are kept as compatibility backups. Optional --with-cn-pv adds qualitative China official PV bulletin search (cdr-adr.org.cn) as signal corroboration. All data are public adverse-event reports; zero confidential data or information input — B-tier quickly-adoptable.
技能文档
Language
Pick the README that matches your language for human-readable, language-specific guides:
- English guide → README.md
- 中文指南 → README_zh-CN.md
This skill responds in the user's current input language and auto-detects / switches accordingly. The runtime scripts embed a locale check so all user-facing prompts switch to Chinese on a zh-* locale and to English otherwise. Code comments and documentation are English-only.
The SKILL.md body, references/*.md, and AGENTS.md are English-only and agent-facing; runtime command prompts switch to Chinese / English by locale. For end-to-end walkthroughs and troubleshooting in your language, open the README above.
Clinical Trial Safety Signal
Safe by default: overview-first. Step 1 (overview) runs automatically; Step 2 (detailed retrieval) runs ONLY after the user explicitly confirms.
Disclaimer & Intended Use
- Audience. This skill is intended for pharmacovigilance / clinical-trial methodologists and drug-safety professionals. It is a methodologic signal-screening aid, not end-user health software.
- Not a clinical or regulatory decision tool. All outputs are statistical disproportionality signals computed from spontaneous adverse-event reports (FDA FAERS), which are subject to reporting bias, under-reporting, and confounding. A signal does NOT establish causation and MUST NOT be used to start, stop, or change any medication, or to make clinical or regulatory decisions. Always corroborate with RCTs, product labels, and qualified clinical/regulatory judgment (ICH E2 family).
- Data flow (transparent). Reads ONLY public sources — FDA FAERS / openFDA and, optionally, the public columns of cdr-adr.org.cn. Writes outputs SOLELY to the user-specified
--out-dir(default: current working directory). No system-path or hidden logging; any operational log (e.g.safety_err.log) is written ONLY under--out-dir(e.g.out_live/), never outside it, and FAERS raw responses are not persisted unless the user explicitly saves them. Zero confidential data input; no user data is transmitted externally. - Dev artifacts excluded from the runtime package. The
tests/directory (regression harness) is shipped only in the source repo, not in the installed runtime package.
Purpose
Run pharmacovigilance disproportionality analysis on FDA FAERS public adverse-event data to surface potential drug–event safety signals (PRR / ROR / IC / EBGM), supporting clinical-trial safety surveillance and label / signal screening. Optional China official PV bulletins (cdr-adr.org.cn) provide qualitative corroboration only.
Data Sources
| Source | Access | Status |
|---|---|---|
FDA FAERS (drug/event.json) | Official public REST API, direct-connect, no key needed (low-frequency) | Required (B-tier, quantitative) |
FDA Label (drug/label.json) | Same openFDA, no key; adverse_reactions / warnings | Optional --with-fda-label (3rd source) |
| cdr-adr.org.cn | Public columns scraped (no WAF, no key) | Optional --with-cn-pv (qualitative only) |
Key mechanism: openFDA works keyless (anonymous 240 req/min, 1,000 req/day per IP); an optional free key only raises quota. The key, when used, is stored locally only (env var / local .env) and sent only over HTTPS to the official openFDA endpoint — never to any third party. NMPA main site is WAF-blocked (HTTP 412) and intentionally excluded. All data are public adverse-event reports; zero confidential input.
See references/fetch_pipeline.md for endpoint details, indexable/non-indexable fields, and count endpoint pitfalls.
Methods
Four disproportionality measures on the drug–event 2×2 table, plus multiple-testing and corroboration layers:
- PRR — signal if PRR ≥ 2 and χ² ≥ 4.
- ROR — signal if lower 95% CI > 1.
- IC (UMC/VigiBase Information Component) — signal if lower 95% CI > 0.
- EBGM (FDA MGPS Bayesian shrinkage) — signal if EB05 ≥ 2.
- BH-FDR Benjamini-Hochberg q-value across top-N events (R13) and benchmarks (R5).
- PT→SOC MedDRA organ-class grouping (curated, "Unmapped" fallback).
- Continuity Haldane-Anscombe (+0.5/cell;
a==0and negative cells → conservative null). - aROR multi-drug adjusted ROR (
--compare-drugs). - Temporal anomaly CUSUM / rolling-Z / changepoint (
--trend). - Safety Signal Score (0–100) + T1–T4 tier (
--with-fda-label). - Naranjo 因果归因(定性补充,non-causal) (
--with-causality) — 经典 7 准则打分(Definite/Probable/Possible/Doubtful)作为因果归因定性旁证;独立于 disproportionality,不与其混算、不喂入 PRR/ROR/IC/EBGM。
Full formulas, thresholds, EBGM/MGPS math, FDR, aROR, trend, and the score/tier weighting are in references/methods.md.
Features
| Capability | Source | Scenario |
|---|---|---|
| Drug adverse-event profile | FAERS | Safety baseline: a drug's top reported reactions |
| Drug–event signal detection | FAERS | Is a drug–event pair over-reported (PRR/ROR/IC/EBGM) |
| Multi-method cross-judgement | — | ROR CI>1 / PRR≥2 & χ²≥4 / IC CI>0 / EB05≥2 |
| Structured output (HTML + XLSX = core deliverables / JSON / MD backup, optional PNG) | — | Export — HTML (visual) + XLSX (all raw data) |
| China official PV bulletins | cdr-adr.org.cn | Qualitative corroboration only — NOT for disproportionality |
| Chained invocation | — | → ct-protocol (safety plan), → ct-registry (trial design) |
| Multi-event FDR control | — | BH q-value over top-N / benchmarks |
| PT→SOC grouping | — | Readable signal grouping |
| Continuity + control validation | — | Sparse 2×2 guard; --validate-controls self-check |
Temporal anomaly (--trend) | — | Quarterly CUSUM / rolling-Z / changepoint |
Multi-drug aROR (--compare-drugs) | — | Focal vs pooled-reference adjusted ROR |
Score 0–100 + T1–T4 (--with-fda-label) | FAERS×Label×CN-PV | Triangulated evidence tier |
Naranjo 因果归因(--with-causality) | FAERS 时间/去激发/再用药 + 可选 label | 定性因果归因旁证(non-causal,独立于统计信号) |
信号验证工作流(--verify-signal) | FAERS 季度报告序列 | 时序 CUSUM/Poisson 趋势 + 剂量-反应/去卷积(确证补充;剂量-反应/去卷积需 --case-level 个案数据) |
MedDRA 编码辅助(--code-verbatim) | verbatim AE 术语 | verbatim→PT 模糊匹配(内置字典;LLM 模式 opt-in,不自动开启) |
信号优先级排序与风险分级(--prioritize) | 检测到的信号 | 多维评分(严重度×新颖性×频率×趋势×多源)→ CRITICAL/HIGH/MEDIUM/LOW |
Label-gap & 时间趋势优先级层(随 --prioritize) | --with-fda-label + --trend | 未预期风险(label-gap)+异常趋势自动抬升优先级(K 项) |
PSUR/PBRER 自动报告(--psur) | 检测到的信号 | 生成 CIOMS/ICH E2C(R2) 格式 PSUR Markdown(psur.md) |
| Non-ASCII drug-name auto-translate | — | --drug 阿司匹林 → aspirin; disable --no-resolve-drug-name |
Requirements
- Python 3.10+ (Anaconda
C:\Tools\anaconda3\python.exerecommended). - Required:
requests. Optional:matplotlib(PNG charts). - Network: read-only FAERS public API.
- Optional: openFDA API key (raises quota only; never required).
⚠️ Safety
- Network: retrieval (present /
--out-xlsx) runs lightweight openFDAcountfacet queries (seconds, no case download); case-level download requires explicit--run(throttled by HARD_CAP=10000). - Reads FAERS public reports ONLY — zero confidential data or information input (B-tier).
- China PV bulletins are qualitative narrative — NO per-drug-event counts; must NOT feed disproportionality; only corroborate a FAERS signal.
- Signal detection is for screening, not causal conclusion; regulatory submission (DSUR / PBRER / label change) must be assessed per GCP / ICH E2 separately.
Workflow
Two-step, overview-first (default since v0.1.18: present summary in context, Excel on demand):
- Step 1 — Overview (automatic):
fetch_reports.py --drug Xsends 8countfacets, prints the full-matched summary to context in seconds, cachesfaers_summary_cache.json. No confirmation needed. - Step 2 — Detail (only after explicit confirm):
--out-xlsxbuilds a 3-sheet + 8-chart summary Excel from cache;--rundownloads individual case reports (HARD_CAP 10000) for age/country stats. Signal detection goes throughct_safety.py/disproportionality.py.
scripts/overview.py is deprecated (merged into Step 1). Full workflow, caching, --parallel, XLSX layout, and MedDRA PT caveats: references/fetch_pipeline.md.
One-shot signal report (ct_safety.py) — two core deliverables
Running ct_safety.py --drug X --event Y (with --run) writes, into --out-dir:
faers_report.html— the visual report (open in browser preview). Core deliverable ①.faers_report.xlsx— the data workbook with ALL raw information: FAERS counts, the 2×2 table, the four disproportionality measures, and — when enabled — FDA Label / CN-PV / Score sheets. Core deliverable ②; use it to audit every number.faers_report.md/*.json— compatibility backups only.
The run ends by printing an explicit "核心交付物 / Core Deliverables" block naming both files.
API Key (openFDA) — optional, self-configured
The skill runs without a key. A free key only raises quota (240 req/min, 120,000 req/day per key). The key is never required. Provide it via your own configuration only (do NOT paste keys into chat or any file that ships with the skill):
- CLI:
--api-key YOUR_KEY - Env var:
export OPENFDA_API_KEY=YOUR_KEY(auto-read; recommended) - Skill-root
.env:OPENFDA_API_KEY=YOUR_KEY(git-ignored, never shipped). The value may be plaintext or anobf:-prefixed XOR+base64 blob —resolve_api_keyauto-detects and decodes (ct-base §5 recommended for private keys).
Bilingual apply steps + quota table + packaging red line: references/openfda_api_key.md. Skill-root .gitignore / .clawhubignore exclude .env / *.key / credentials.json, so a user's key can never be bundled into a published skill.
Errors
Brief; full table in references/errors.md.
- 429 / rate-limited — exceed openFDA quota (anonymous 240/min, 1,000/day; key 120k/day, by request count). Fix:
--api-keyor lower frequency. --drugwithout--event— auto-degrades to top-N adverse-event report; add--eventfor signal.- Persistent 404 on 3-word PT (e.g.
RENAL FAILURE ACUTE) — not indexed; swap to standard PT (ACUTE KIDNEY INJURY).total()auto-downgrades 404→.exact. - CN-PV 412/WAF — expected; only cdr-adr.org.cn scraped.
--max > 10000— clamped to HARD_CAP 10000 (API-return-order first N, selection bias).
Comparative Study Design Mode
For "compare X vs Y" / "within-class head-to-head" / "active-comparator" requests, switch to the comparative track (single-drug default otherwise):
| Step | Reference |
|---|---|
| 1. Data prep (normalize → PS-role filter → de-dup → quality gate) | references/faers-data-prep.md |
| 2. Study style + 4 workloads (Lite/Standard/Advanced/Publication+); dependency rules | references/faers-comparative-design.md |
| 3. Metrics, comparator logic, characterization, robustness | references/faers-method-library.md |
| 4. Evidence-tier labeling + claim boundaries | references/evidence-hierarchy.md |
Hard rules: never run disproportionality on unprepared raw counts; present all four configurations then recommend one; label every result [Tier 1] signal / [Tier 2] comparative / [Tier 3] robustness; Tier-4 claims (incidence, causality, benefit–risk, prescribing) forbidden without external data; flag weak comparator indication overlap. Adapted from faers-multi-drug-soc-planner / active-comparator-single-soc-faers-safety-comparison (AIPOCH, MIT).
Pipeline
ct-safety→ct-protocol: signals feed the safety monitoring plan.ct-safety→ct-registry: control-trial safety-design benchmarking (CDE trials).- CN-PV is an in-skill qualitative add-on, not a chain target.
Atomic-task unit index: references/units.md. Changelog: references/changelog.md.
Regression Tests
Stdlib-only suite (no pytest): python tests/run_tests.py (offline) / --live (real openFDA). tests/_mocks.py stubs network; tests/diagnose_rounds.py runs 10×10 adversarial cases (CRASH/ANOMALY/OK). Details in references/errors.md.
Bug Reporting (ct-base §20.3, adapter: adapters/bug_report.py)
- Trigger (strong signal, max 1 proposal/session): unexpected non-zero exit / engine or compute error / user explicitly questions the result — and the same operation was retried ≥1. Weak signal (just repeated tuning) never triggers.
- Two-stage confirmation (2026-08-21): ① propose-with-preview — show the bilingual
confirm_prompttogether with the full report (render_report_text, state "sanitized, no input data", invite a problem description; if the user adds one, re-render and re-show before consent) → ② on explicit consent,send_to_endpoint(auto action=report, endpointhttps://ct-bugreport.coze.site/run, token = embedded §5 public credential). If the user declines, never re-propose this session. - Sanitization is hard: the report carries only the 11-key whitelist (skill / version / error_type / error_code / engine_status / description / locale / query_origin / session_hash / attempts / test) — never raw data or subject records.
descriptionis the single free-text field for debugging, user-reviewed: write the symptom / reproduction / expected vs actual / algorithm or function used / error message; values and study design are OK. Hard boundary: no identifiable person/institution/subject info. The user reviews it in stage ① before consent; empty description omits the key. If the session had no cloud call,save_local_report()writes a local md + author email (data never leaves the machine). - Client-only: this adapter sends
reportonly. Governance actions (get/update/download/delete — pull pending, mark done, download all, clean up) are reserved for thect-updateskill (author side); never call them from here.
Invoke: python adapters/bug_report.py --error-type --description "" [--send] (add --send only after the user confirms).
相关技能
Product recall & FDA safety data for AI agents — track FDA drug recalls, medical device recalls, 510(k) clearances, and drug labels by company or keyword. Us...
面向临床研发全生命周期的 ct 系列「总入口」,云端辅助的临床试验总顾问。方法学/设计/合规/QC/语气类问题在内部走 A–J 工作流并转发远程 Coze 引擎精校;统计计算转交 ct-samplesize;原始数据/竞品情报类需求路由到 ct-registry / ct-safety / ct-literature 并在代码内缝合三源产出。本技能会在本机运行兄弟技能、保留语言偏好/上下文缓存/长期记忆等本地状态,并支持可选的脱敏错误报告。 / The ct-series TOTAL ENTRY POINT across the full clinical-development lifecycle — a cloud-assisted clinical-trial advisor. Methodology / design / compliance / QC / tone questions run in-house through workflows A–J and are forwarded to the remote Coze engine for refinement; sample-size computation is handed to ct-samplesize; raw-data and competitive-intel needs route to the three sibling data skills (ct-registry / ct-safety / ct-literature) and are stitched in code. The skill runs sibling skills locally, keeps local state (language preference / context cache / long-term memory), and supports an optional de-identified bug report.
药企药物研发辅助临床试验数据统计。参考 Statistical Analysis skill 的 descriptive statistics 与 group comparison 部分,构建试验分析支持能力。
基础检查辅助解读。输入血常规/生化/尿常规/心电图等检查报告文本,识别异常指标,给出临床意义和随访建议(JSON + 自然语言摘要)。
跨多区域整合监管、临床、专利与生物医学数据,按来源分级输出可溯源结论。