agentCLAWHUBUnverified

Clinical Trial Sample Size & Power / 临床试验样本量与检验效能专家

Sample size and power calculation tool for clinical trial practitioners. No local R install needed — a cloud R compute service covers all 49 test types and returns publication-grade SVG figures. Natural-language driven; full reproducible R code is returned by default; default output in Chinese or English per OS language setting (prompt can force-switch). / 为临床试验从业者提供的样本量与检验效能计算工具。本地无需安装 R,直接提供云端 R 计算服务(覆盖 49 种检验,并提供 SVG 出版级别图形)。自然语言驱动,默认回传完整 R 代码;默认按操作系统语言设定输出中文或英文(提示词可强制切换)。

OpenClaw

Rank

62

Safety

84

Downloads

2.1k

Updated

Oct 9, 2026

Version

5.8.0

Source

CLAWHUB

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 2.1K downloads reported by the source. Last updated 10/9/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Public facts

Every fact links back to the source it came from.

Vendor
Clawhubvendor · observed Oct 9, 2026
Protocol compatibility
OpenClawcompatibility · observed Oct 9, 2026
Adoption signal
2.1K downloadsadoption · observed Oct 9, 2026
Latest release
5.8.0release · observed Oct 9, 2026
Handshake status
UNKNOWNsecurity

Install and run

Setup complexity: low.

clawhub skill install s176fv8983h1rte6dmxwp9wt4n89j8p5:ct-samplesize
  1. Install using `clawhub skill install s176fv8983h1rte6dmxwp9wt4n89j8p5:ct-samplesize` in an isolated environment before connecting it to live workloads.
  2. No published capability contract is available yet, so validate auth and request/response behavior manually.
  3. Review the upstream CLAWHUB listing at https://clawhub.ai/medstatstar/ct-samplesize before using production credentials.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-medstatstar-ct-samplesize/snapshot"

Documentation

CLAWHUB

160,000 characters of source documentation, loaded on request.

Extracted files

5 files captured from the source.

SKILL.md

---
slug: ct-samplesize
displayName: Clinical Trial Sample Size / 临床试验样本量专家
name: ct-samplesize
cn_name: 临床试验样本量专家
version: 5.8.0
invocable: true
required_commands: [python]
summary: 为临床试验从业者提供的样本量与检验效能计算工具。本地无需安装 R,直接提供云端 R 计算服务(覆盖 49 种检验,并提供 SVG 出版级别图形)。自然语言驱动,默认回传完整 R 代码;默认按操作系统语言设定输出中文或英文(提示词可强制切换)。
license: MIT
description: "Sample size and power calculation tool for clinical trial practitioners. No local R install needed — a cloud R compute service covers all 49 test types and returns publication-grade SVG figures. Natural-language driven; full reproducible R code is returned by default; default output in Chinese or English per OS language setting (prompt can force-switch). / 为临床试验从业者提供的样本量与检验效能计算工具。本地无需安装 R,直接提供云端 R 计算服务(覆盖 49 种检验,并提供 SVG 出版级别图形)。自然语言驱动,默认回传完整 R 代码;默认按操作系统语言设定输出中文或英文(提示词可强制切换)。"
triggers:
  - "clinical trial sample size"
  - "样本量计算"
  - "clinical trial power"
  - "检验效能计算"
  - "临床试验 设计"
  - "non-inferiority sample size"
  - "equivalence sample size"
  - "survival analysis sample size"
  - "adaptive design"
  - "group sequential design"
  - "Bayesian clinical trial"
metadata: { openclaw: { emoji: "📊" }, authors: ["medstatstar", "phoe-zip"], license: "MIT", tags: [clinical-trial, sample-size, power, coze, adaptive-design, bayesian, win-ratio], homepage: "https://github.com/medstatstar/ct-samplesize" }
permissions:
  scope: "user-space-only"
  network: "required"
  network_note: "v5 requires the remote coze compute endpoint (CTSS_COZE_ENDPOINT, or CTSS_COZE_MOCK=1 for a local demo) — the published skill has no local compute fallback. Only trial-design parameters leave the machine (no patient data); every request also carries a hostname hash `query_origin` (sha256, for server attribution/rate-limit) and the OS-language-derived `locale`, and the skill version `skill_version` (read from the local SKILL.md, for per-version attribution of cloud usage). Outbound authorization gate: the public endpoint is pre-whitelisted in config/config.json auto_approve_endpoints (never prompts, but the assistant states what is sent on first use); user-custom endpoints trigger a one-time AUTH-BLOCK user confirmation before any data leaves the machine. Payloads are sanitized (PII stripped) before sending."
  filesystem: "writes figures to CTSS_OUTPUT_DIR (default ./outputs) and optional curve PNGs; otherwise read-only"
  data: "no patient/external data leaves the boundary — only trial-design parameters plus the hostname hash (query_origin), the skill version (skill_version) and locale metadata are sent to the coze service"

---

# Clinical Trial Sample Size

## Published Application

| Item | Value |
|---|---|
| Share link | `https://ct-samplesize.app.workbuddy.host/` |
| appId | `wbapp_9K1dei1PydVQ66YmawCD3C` |
| domainPrefix | `ct-samplesize` |
| Deploy metadata | `adapters/workbench/app.config.json` |
| Deployed as | Static site (`python -m http.server $PORT --bind 0.0.0.0`) |
| Payload | `WorkBuddy/20

README.md

# Clinical Trial Sample Size (ct-samplesize)

- **English guide** → [README.md](https://github.com/medstatstar/ct-samplesize/blob/main/README.md) · **中文指南** → [README_zh-CN.md](https://github.com/medstatstar/ct-samplesize/blob/main/README_zh-CN.md)

<div align="center">
  <img src="assets/icon.svg" alt="ct-samplesize logo" width="240" height="240">
</div>

> **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.

> **Easy-to-use Clinical Sample Size & Power Calculator for Clinical Researchers**
>
> You don't need to code or memorize commands — just describe your trial design in **plain language inside a chat**, and the skill performs **49** professional sample-size & power calculations for you. The default authoritative engine is a **remote coze R compute service** (rpact, TrialSize, PowerTOST and 20+ other packages running server-side, so your machine needs **no local R**; the published skill has **no local compute fallback**). Results come in Chinese or English per your OS setting (force-switchable via prompt). By default the skill shows a **SAFE PREVIEW** of the exact request it would send to coze — nothing leaves your machine until you confirm; full R code can be returned on request.

---

## Who This Is For

The `ct-*` clinical-trial skill family covers the whole clinical-trial lifecycle. ct-samplesize targets three groups who need **defensible sample-size / power numbers across 49 designs**:

- **Clinical-trial practitioners at pharmaceutical companies** — sponsors, CROs, and medical / statistical / regulatory roles: quick, auditable n / power for protocols, SAPs, feasibility.
- **Clinicians and nurses who design or run trials**: estimate sample size when drafting protocols or feasibility assessments.
- **Medical students who want to learn clinical-trial methodology**: exploring design families (group-sequential, adaptive, Bayesian, non-inferiority…).

This tool only takes aggregate design parameters — never patient-level data.

---

## 1. How to Use It in a Chat (the Core)

ct-samplesize is a **conversational skill**: you simply tell the assistant your trial design in natural language — no commands, no parameter names to remember. As a WorkBuddy skill it **auto-loads with no extra installation**.

Below are 6 real conversational examples ordered by common entry point — from "not sure which test" to specific designs. Each gives **"You say"** (a copy-ready natural-language input), a sketch of **"The assistant replies"**, plus how to get the actual number.

### Example 1 · Not sure which test (most common opening)
**You say:**
> I want a sample-size calculation but I'm not sure which test to use — help me choose the right one

**Assistant replies (sketch):**
> Sure — let's pin down your trial design first. I'll ask 1–3 focused questions per round, eac

_meta.json

{
  "ownerId": "kn7amqq1jv28skb63wavr6shah89jsm5",
  "slug": "ct-samplesize",
  "version": "5.8.0",
  "publishedAt": 1791547853622
}

references/adaptive_simulator.md

# Adaptive-Trial Monte-Carlo Simulator

Module: `--test adaptive_simulate` in the main CLI. **In the published skill, the
authoritative engine is an inlined pure base-R function library** `ADAPTIVE_SIM_R`,
maintained in `adapters/coze/ct_r_lib/local_r_backend.py` (no extra R packages), running **server-side
on coze**. The CLI shows the coze request envelope in SAFE PREVIEW and computes via
coze (no local R/shell). **Dev / offline:** the equivalent local-R path writes the
inlined engine to a temp `.R` file, `source()`s it and calls `run_adaptive_sim()`
(SAFE PREVIEW, `--yes` to run). A legacy pure-Python module
`adapters/coze/ct_r_lib/legacy/adaptive_simulator.py` is retained for offline dev/testing.
Ported from the ClawHub skill `adaptive-trial-simulator` (aipoch-ai) and
re-implemented to fit ct-samplesize.

> **No standalone `.R` file is shipped in the published skill.** The R engine lives
> inline in `adapters/coze/ct_r_lib/local_r_backend.py` as `ADAPTIVE_SIM_R` (excluded from the publish
> package; synced to coze). To drive the engine from R yourself, run the CLI with
> `--show-code` (or `-y`) and copy the printed R code into R.

## Run the R engine via CLI

This is the normal path (no manual `source()` needed):

```bash
# default = SAFE PREVIEW (shows the generated R code that sources the inlined engine)
python scripts/samplesize_power.py --test adaptive_simulate --sim_design group_sequential   --effect_size 0.3 --sim_n 200 --interim_looks 3 --spending_function obrien_fleming   --alpha 0.025 --n_simulations 20000 --sim_seed 42

# add -y / --yes to execute and compute power / type I error
python scripts/samplesize_power.py --test adaptive_simulate --sim_design group_sequential   --effect_size 0.3 --sim_n 200 --interim_looks 3 --spending_function obrien_fleming   --alpha 0.025 --n_simulations 20000 --sim_seed 42 -y
```

## Drive the engine directly from R

There is no standalone `.R` file to `source()`. To run the engine from R,
replicate what the CLI does: run `python scripts/samplesize_power.py --test
adaptive_simulate ... --show-code`, copy the printed R code (it contains the full
`ADAPTIVE_SIM_R` definition plus the `run_adaptive_sim(...)` call) into R, and run
it. The pasted code is self-contained — base R only, no extra packages.

## When to use

Use this **simulation** engine when you want to *validate* an adaptive or
group-sequential design by Monte-Carlo (empirical power, empirical type I error,
expected sample size, early-stop probabilities) rather than solve a closed-form
sample size. For **analytic** group-sequential / adaptive sample size (rpact /
gsDesign), use `--test group_sequential` or `--test adaptive` instead — they are
complementary.

> **coze is the primary compute path** in the published skill: the CLI shows the
> coze request envelope (SAFE PREVIEW) and computes via coze (server-side R, base R
> only, no extra packages). The optional local-R dev backend (`adapters/coze/ct

references/backend_optimization_2026-09-11.md

# 后端优化建议(基于 2026-09-11 后端日志分析)

> 来源:`CTDB_searchlog (3).xlsx`(26 条有效请求 / 199 行,11 分钟窗口,单会话,
> skill_version 5.7.26,全部 `proportion_two`,status 全 ok)。
> 本文档为**服务端(coze 部署侧)**改进项,客户端 v5.7.27 已落地守卫(见 CHANGELOG);
> 服务端改动需按既有节奏人工打包上传 Coze,客户端无依赖、可先发布。

## 日志核心发现(服务端视角)

| # | 发现 | 量化 | 影响 |
|:--|:---|:---|:---|
| 1 | 「单点+曲线」成对串行 | 13 单点 : 13 曲线(1:1) | ~50% 请求、~40s 计算可省(客户端 v5.7.27 已强化约束 + 守卫) |
| 2 | 参数包过肥 | 135 参数/条(2.8KB),仅 6 个被消费 | 飞书日志全参数扫描假象;缓存签名噪声化 |
| 3 | 同网格曲线重复计算 | `0.6:0.05:0.95` 8 点网格重复 5 次(38% 曲线请求) | TTL 缓存因参数微调脱靶 |
| 4 | 日志空白行 | 173/199 行(87%)六字段全空 | 日志分析被脏数据污染 |

## 服务端改进项

### A. 同网格近似参数模糊缓存(命中 38% 曲线请求)

现状:`state.py` / samplesize 节点对 `(test, params, mode, locale)` 全量归一化后做 10 分钟 TTL
幂等缓存,`params` 中任一键变化(哪怕仅 `dropout_rate` 0→0.1)即脱靶。

建议(按侵入性从低到高,三选一):

1. **签名前先「归一化裁剪」**:缓存签名计算前,把 `params` 按该 test 的 contract 白名单
   (`required` ∪ 通用键 ∪ curve_*)裁剪——客户端 v5.7.27 守卫已在出站侧做了同样的裁剪,
   两端对齐后,即使老版本客户端发来过肥信封,服务端签名也只含有效键。改动点:
   签名计算函数处加一层 per-test 白名单过滤(白名单可内嵌或复用 `_contract_index.json` 的镜像)。
2. **网格级缓存**:对 `curve_*_seq` 请求,签名只取 `(test, mode, 网格串, 网格消费参数集)`
   (如 proportion_two 的曲线仅消费 p1/p2/alpha/side/ratio),其余键不进签名;命中后直接
   复用 R 结果。适合网格重复率高的场景(本日志 38%)。
3. **批量多场景接口**:扩展 batch 协议支持「同网格 + 多组参数」一次提交(batch 内逐项
   独立缓存签名),配合客户端 `build_batch` 已有能力,把 5 次同网格请求压成 1 次。

推荐 ①(改动最小、与客户端守卫天然对齐),②③ 视上线后日志再评估。

### B. 飞书日志空白行修复(87% 脏数据)

现象:199 行中 173 行 `ID/inittime/query_origin/skillname/querystr/resultstr` 六字段全空
(连 ID 都没有),非正常预分配形态。

排查方向:

1. **写入侧**:`src/graphs/nodes/feishu_write_node.py` / `feishu_save_node.py`——检查是否存在
   异常分支「先建行、后填字段」,异常时行已建但字段未写(本日志窗口 status 全 ok,
   更可能是预分配/重试路径泄漏);
2. **导出侧**:若飞书多维表格模板预留下了大量空行,导出脚本未过滤 `query_origin == null`
   的行——最低成本修复是在导出端过滤空行,同时排查写入端是否确有泄漏路径;
3. **建议加写入侧断言**:写行前校验 `querystr` 非空,空则跳过并计数上报(避免静默膨胀)。

### C.(可选)skill_version 缺失兜底

客户端 `_skill_version()` 正则在 v5.7.26 及以前**全部损坏**(从未从 SKILL.md 读到过版本),
历史日志中的 `skill_version` 全部来自 fallback 常量,**升版归因可能静默漂移**。
服务端无需改动(客户端 v5.7.27 已修),但做日志归因分析时请注意 5.7.26 及以前的
版本号可信度有限。

## 部署顺序

1. 客户端 v5.7.27 先发(守卫 + 正则修复,全离线验证通过,无服务端依赖);
2. 服务端 A① / B 随下一次 coze 打包部署一并上线;
3. 上线后取一段新日志复测:请求参数键数(期望 ~10-20)、缓存命中率、空白行占比。
Github ReposUpdated 9h agoRank 70

AionUi

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!

MCPOPENCLAW
Github ReposUpdated 6mo agoRank 70

activepieces

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

OPENCLAW
Github ReposUpdated 6mo agoRank 70

cherry-studio

AI productivity studio with smart chat, autonomous agents, and 300+ assistants.

MCPOPENCLAW
Github ReposUpdated 7mo agoRank 70

CopilotKit

The Frontend for Agents & Generative UI. React + Angular

OPENCLAW

Machine-readable data

The same record, as JSON, for agents and crawlers.

{
  "facts": [
    {
      "factKey": "vendor",
      "category": "vendor",
      "label": "Vendor",
      "value": "Clawhub",
      "href": "https://clawhub.ai/medstatstar/skills/ct-samplesize",
      "sourceUrl": "https://clawhub.ai/medstatstar/skills/ct-samplesize",
      "sourceType": "profile",
      "confidence": "medium",
      "observedAt": "2026-10-09T18:17:45.160Z",
      "isPublic": true
    },
    {
      "factKey": "protocols",
      "category": "compatibility",
      "label": "Protocol compatibility",
      "value": "OpenClaw",
      "href": "https://www.xpersona.co/api/v1/agents/clawhub-medstatstar-ct-samplesize/contract",
      "sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-medstatstar-ct-samplesize/contract",
      "sourceType": "contract",
      "confidence": "medium",
      "observedAt": "2026-10-09T18:17:45.160Z",
      "isPublic": true
    },
    {
      "factKey": "traction",
      "category": "adoption",
      "label": "Adoption signal",
      "value": "2.1K downloads",
      "href": "https://clawhub.ai/medstatstar/ct-samplesize",
      "sourceUrl": "https://clawhub.ai/medstatstar/ct-samplesize",
      "sourceType": "profile",
      "confidence": "medium",
      "observedAt": "2026-10-09T18:17:45.160Z",
      "isPublic": true
    },
    {
      "factKey": "latest_release",
      "category": "release",
      "label": "Latest release",
      "value": "5.8.0",
      "href": "https://clawhub.ai/medstatstar/ct-samplesize",
      "sourceUrl": "https://clawhub.ai/medstatstar/ct-samplesize",
      "sourceType": "release",
      "confidence": "medium",
      "observedAt": "2026-10-09T12:10:53.622Z",
      "isPublic": true
    },
    {
      "factKey": "handshake_status",
      "category": "security",
      "label": "Handshake status",
      "value": "UNKNOWN",
      "href": "https://www.xpersona.co/api/v1/agents/clawhub-medstatstar-ct-samplesize/trust",
      "sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-medstatstar-ct-samplesize/trust",
      "sourceType": "trust",
      "confidence": "medium",
      "observedAt": null,
      "isPublic": true
    }
  ],
  "events": [
    {
      "eventType": "release",
      "title": "Release 5.8.0",
      "description": "No changes detected in this version. - Version bumped to 5.8.0 with no file/content updates. - Functionality, features, and documentation remain unchanged.",
      "href": "https://clawhub.ai/medstatstar/ct-samplesize",
      "sourceUrl": "https://clawhub.ai/medstatstar/ct-samplesize",
      "sourceType": "release",
      "confidence": "medium",
      "observedAt": "2026-10-09T12:10:53.622Z",
      "isPublic": true
    }
  ]
}

Record generated Oct 10, 2026.

Sponsored

Ads related to Clinical Trial Sample Size & Power / 临床试验样本量与检验效能专家 and adjacent AI workflows.