Introduction¶
In clinical trial protocols, sample size and statistical power often require iterative calculations based on statistical hypotheses: changes in different endpoints, group ratios, dropout rates, \(\alpha\), or \(\beta\) lead to different results. The common practice involves installing R locally and configuring packages like pwr or TrialSize, or writing formulas into Excel. While this is fine for statistical colleagues, for those who need to modify protocols and write documentation alongside Agents in an IDE, maintaining a local R environment and package versions incurs significant costs.
Below, we introduce the Clinical Trial Sample Size Expert on SkillHub (Coordinate: @user_ff7413f5/ct-samplesize): describe trial designs in natural language within the Agent, and the Skill performs calculations via cloud-based R, returning complete R code and publication-grade SVG plots without requiring local R installation.
What is this¶
The Clinical Trial Sample Size Expert (English name: Clinical Trial Sample Size & Power) is an Agent Skill designed for clinical trial practitioners, maintained by community publisher user_ff7413f5 (listed as author Zhang Wentong on the SkillHub page). The current version is v5.13.28, categorized as professional, and sourced from the community.
It solves the core problem of performing sample size estimation and statistical power calculations within a conversational workflow, without relying on a local R runtime. The official description states: it provides a cloud R calculation service, covering 65 types of tests, and outputs SVG publication-grade graphics; interaction is natural language driven, and it returns complete R code by default; the output language follows the operating system language by default (Chinese or English), but can also be forced to switch via prompts.
The Skill carries the requires_api_key=true tag; an API key must be configured before use according to the Skill instructions (specific fields are subject to the installed SKILL.md).
Core Features¶
The following capabilities are derived from the official SkillHub page and crawled metadata; the list of tests or interface details not appearing in the materials will not be expanded upon.
- Cloud R Computation: No local R installation is required; calculations are executed in a cloud R service.
- Test Type Coverage: The official documentation states coverage of 65 sample size/power related test scenarios (the specific list is subject to the documentation within the Skill).
- Graphical Output: Supports SVG format, designed for publication-level display such as reports or paper illustrations.
- Natural Language Interaction: Describe problems using trial design elements (e.g., number of groups, effect size, significance level, power, proportions, or mean differences), and the Agent calls the Skill to perform calculations.
- Auditable R Code: Returns complete R code by default, facilitating review by statisticians or reproduction in personal R environments.
- Chinese/English Output: Outputs in Chinese or English based on the system language by default; switching to the other language requires explicit request in the prompt.
Installation and Activation¶
Method 1: SkillHub CLI (Recommended)¶
First, confirm if skillhub is installed:
command -v skillhub && skillhub --version
If not installed, follow the SkillHub official installation documentation to perform a full installation (including CLI and default Skills):
curl -fsSL https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/install.sh | bash
To install only the CLI:
curl -fsSL https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/install.sh | bash -s -- --cli-only
When installing this Skill, you must use --dir to point to the current Agent’s skills directory; otherwise, it defaults to ./skills/ which may not be recognized. Common paths for Cursor are:
skillhub install user_ff7413f5/ct-samplesize --dir ~/.cursor/skills/
The coordinate is usually written as user_ff7413f5/ct-samplesize in the CLI (corresponding to @user_ff7413f5/ct-samplesize on the page). After installation, restart or refresh the skill list as required by the Agent, and configure the API Key required by the Skill (requires_api_key=true).
Method 2: Let AI follow official installation instructions¶
The installation prompt provided on the SkillHub skill page is: According to SkillHub Installation and Priority Source Configuration, install @user_ff7413f5/ct-samplesize. You can send this sentence to the Agent in your current IDE, allowing it to read skillhub.md and complete the installation and directory selection.
Skills directories for other clients¶
Paths listed in the official installation documentation include: Claude Code ~/.claude/skills/, Codex ~/.codex/skills/, or .agents/skills/ under the project, etc. The principle is the same: skillhub install ... --dir <corresponding directory>. The difference between Cursor, Codex, and Claude Code lies only in the skills directory path; the installation command itself is consistent.
Typical Usage¶
Official materials do not provide a fixed “copy-and-use” one-line dialogue template, but the Skill’s positioning is clear: Describe the trial and statistical hypotheses in natural language, and the Skill calls cloud R to return numerical results, SVG plots, and R code. You can use it in the Agent according to the following logic (the description must match your actual protocol; this is merely a reproducible interaction structure, not a fictional case result).
- Specify Endpoints and Tests: For example, two-group rate comparison, survival analysis, non-inferiority/equivalence, crossover design, etc., and provide \(\alpha\), \(\beta\) (or power \(1-\beta\)), and whether it is one-sided or two-sided (if applicable).
- Provide Design Parameters: Expected proportions or means and standard deviations for each group, inter-group allocation ratio, expected dropout or analyzable sample proportion, etc. (Try to fill in all available quantities from your current protocol).
- Declare Output Requirements: Specify if sample size per group or total sample size, power curves, or publication-ready SVG are needed; if archiving is required, explicitly request complete R code.
- Language: Defaults to following the system; if English protocol expression is needed, specify “Please output conclusions and code comments in English” in the prompt.
Once installed and API Key configured, simply send the structured description above in a session where the Skill is enabled; the names and parameter names of the specific 65 supported tests are subject to the instructions within the Skill.
Scenarios and Notes¶
Who it is for
- Clinical operations, medical writing, project managers, and others who need to quickly calculate sample sizes in environments like Cursor but do not want to maintain local R.
- Biostatisticians who want the Agent to draft calculations and then verify them using the returned R code in a formal environment.
Limitations and Notes
- Network and Key: Cloud R and
requires_api_key=trueimply that valid API configuration is needed; calculations may fail without a key or in network-restricted environments. - Regulatory and Compliance: For registration filings or final protocol confirmation, methods signed by qualified statisticians and results from independent statistical software should still be the standard; Skill output is suitable for exploration and documentation drafting and does not replace the toolchain prescribed by SOPs.
- Version: This article is based on SkillHub page v5.13.28; test types or parameters after upgrade are subject to the new version’s SKILL instructions.
- Metadata: SkillHub shows the Skill rating as 100000 and 2046 downloads (page statistics, subject to change over time).
Conclusion¶
The Clinical Trial Sample Size Expert connects sample size and power calculations for 65 types of tests into Agent conversations, using Cloud R to eliminate the need for local environments, and providing R code and SVG plots by default. It is suitable for quick trial-and-error calculations and communication during the protocol iteration phase. Official skill page and API entry:
- SkillHub: https://www.skillhub.cn/skills/user_ff7413f5/ct-samplesize
- API: https://api.skillhub.cn/user_ff7413f5/ct-samplesize
Installation coordinate: @user_ff7413f5/ct-samplesize. Combined with the SkillHub Installation Documentation and skillhub install ... --dir, it can be installed into the skills directory of clients like Cursor.