date-calculator
Calculate medical date windows including gestational age, estimated delivery dates, and follow-up visit scheduling. Produces structured JSON output for clinical research and trial coordination workflows.
Best use case
date-calculator is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Calculate medical date windows including gestational age, estimated delivery dates, and follow-up visit scheduling. Produces structured JSON output for clinical research and trial coordination workflows.
Teams using date-calculator should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/date-calculator/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How date-calculator Compares
| Feature / Agent | date-calculator | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Calculate medical date windows including gestational age, estimated delivery dates, and follow-up visit scheduling. Produces structured JSON output for clinical research and trial coordination workflows.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
> **Source**: [https://github.com/aipoch/medical-research-skills](https://github.com/aipoch/medical-research-skills)
# Date Calculator
Calculate medical date windows for clinical research: gestational age from LMP, estimated delivery dates, and follow-up visit scheduling with configurable window sizes.
## Quick Check
```bash
python -m py_compile scripts/main.py
python scripts/main.py --help
```
## When to Use
- Computing gestational age and estimated delivery date from last menstrual period
- Scheduling follow-up visit windows for clinical trials
- Generating date ranges for protocol-defined visit windows
## Workflow
1. Confirm the user objective, required inputs, and non-negotiable constraints before doing detailed work.
2. Validate that the request matches the documented scope and stop early if the task would require unsupported assumptions.
3. Use the packaged script path or the documented reasoning path with only the inputs that are actually available.
4. Return a structured result that separates assumptions, deliverables, risks, and unresolved items.
5. If execution fails or inputs are incomplete, switch to the fallback path and state exactly what blocked full completion.
**Note on group parameter:** If `--group` is not provided, log-rank test and Cox regression are skipped. Single-arm KM only. An informational note will be included in the output.
**Fallback template:** If `scripts/main.py` fails or a required parameter is absent, report: (a) which parameter is missing, (b) what partial calculation is still valid, (c) the manual formula for the requested calculation type.
## Parameters
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `--type`, `-t` | string | Yes | Calculation type: `gestational` or `followup` |
| `--date`, `-d` | string | Yes | Reference date in `YYYY-MM-DD` format |
| `--weeks` | int | No | Follow-up interval in weeks (default: 4; must be ≥ 1) |
| `--window-days` | int | No | Visit window size in days (default: 7) |
| `--timezone` | string | No | Timezone for calculation (default: UTC) |
| `--output`, `-o` | string | No | Output JSON file path (default: stdout) |
## Usage
```text
# Gestational age from LMP
python scripts/main.py --type gestational --date 2024-01-15
# 4-week follow-up window
python scripts/main.py --type followup --date 2024-03-01
# Custom 6-week follow-up with ±5-day window
python scripts/main.py --type followup --date 2024-03-01 --weeks 6 --window-days 5
```
## Output Format
**Gestational:**
```json
{
"lmp_date": "2024-01-15",
"gestational_age": "12 weeks 3 days",
"gestational_age_days": 87,
"estimated_delivery_date": "2024-10-21",
"calculation_date": "2024-04-12",
"warning": "LMP date is in the future; gestational age calculated from today may be negative or unexpected"
}
```
**Follow-up:**
```json
{
"start_date": "2024-03-01",
"followup_weeks": 4,
"window_start": "2024-03-29",
"window_end": "2024-04-05",
"window_range": "2024-03-29 to 2024-04-05"
}
```
## Output Requirements
Every response must make these explicit:
- Objective and deliverable
- Inputs used and assumptions introduced
- Workflow or decision path taken
- Core result: calculated dates and windows
- Constraints, risks, caveats (e.g., timezone assumptions, calendar edge cases)
- Unresolved items and next-step checks
## Input Validation
This skill accepts: medical date calculation requests specifying a calculation type (`gestational` or `followup`) and a reference date in `YYYY-MM-DD` format.
If the request does not involve medical date window calculation — for example, asking to schedule general appointments, perform time-zone conversions unrelated to clinical dates, or calculate non-medical intervals — do not proceed. Instead respond:
> "`date-calculator` is designed to calculate medical date windows for clinical research. Your request appears to be outside this scope. Please provide a calculation type and reference date, or use a more appropriate tool for your task."
**Validation rules:**
- Date must be in `YYYY-MM-DD` format; invalid formats are rejected with exit code 1.
- If LMP date is in the future, a `warning` field is included in the output.
- `--weeks` must be ≥ 1; zero or negative values are rejected with a clear error message.
- `--timezone` defaults to UTC; use pytz timezone names (e.g., `America/New_York`).
## Error Handling
- If required inputs are missing, state exactly which fields are missing and request only the minimum additional information.
- If the task goes outside the documented scope, stop instead of guessing or silently widening the assignment.
- If `scripts/main.py` fails, report the failure point, summarize what still can be completed safely, and provide a manual fallback.
- Do not fabricate files, citations, data, search results, or execution outcomes.
## Response Template
1. Objective
2. Inputs Received
3. Assumptions
4. Workflow
5. Deliverable
6. Risks and Limits
7. Next ChecksRelated Skills
ebm-calculator
Evidence-Based Medicine diagnostic test calculator. Computes sensitivity, specificity, PPV, NPV, likelihood ratios, NNT, and pre/post-test probability from 2x2 contingency table inputs.
cold-chain-risk-calculator
Calculate temperature excursion risks for cold chain transport. Assesses route risk, packaging suitability, and monitoring requirements for biological samples and pharmaceuticals requiring controlled-temperature shipping.
buffer-calculator
Calculate precise buffer recipes with accurate mass and volume measurements for molecular biology and biochemistry. Supports PBS, RIPA, and TAE with concentration scaling, stock solution preparation, pH adjustment guidance, and step-by-step protocols.
bmi-bsa-calculator
Calculate Body Mass Index (BMI) and Body Surface Area (BSA) for clinical assessment, obesity screening, and chemotherapy dosing. Supports multiple BSA formulas (DuBois, Mosteller, Haycock), WHO weight classification, pediatric calculations, and metric/imperial input.
sample-size-power-calculator
Advanced sample size and power calculations for complex study designs including survival analysis, clustered designs, and multiple comparisons.
skill-auditor
A comprehensive auditor for any agent skill — including Manus, OpenClaw/ClawHub, Claude, LobeHub, or custom SKILL.md-based skills. Use this skill whenever a user wants to evaluate, audit, review, score, or quality-check an agent skill before publishing, updating, or deploying. Covers two hard veto gates (structural redlines + research integrity redlines), static quality scoring across 25 criteria (ISO 25010 + OpenSSF + Agent), dynamic test input generation, multi-mode execution testing, multi-layer output evaluation with five specialized category rubrics (Evidence Insight / Protocol Design / Data Analysis / Academic Writing / Other), a Research Veto that applies to all four research categories, human eval viewer generation, actionable P0/P1/P2 optimization recommendations, and automatic skill improvement that outputs a polished, production-ready SKILL.md. Also use whenever a user says "audit my skill", "evaluate my skill", "improve my skill", or wants a corrected version after evaluation.
two-sample-mr-research-planner
Generates complete two-sample Mendelian randomization (MR) research designs from a user-provided research direction. Use when users want to design, plan, or build a study using two-sample MR to test causal relationships. Triggers:"design a two-sample MR study", "build a publishable MR paper", "test whether this biomarker causally affects this disease", "generate Lite/Standard/Advanced MR plans", "screen multiple exposures with MR", "bidirectional MR design", "causal inference using GWAS summary statistics", or "I want to study X and Y using MR". Always outputs four workload configurations (Lite / Standard / Advanced / Publication+) with a recommended primary plan, step-by-step workflow, figure plan, validation strategy, minimal executable version, and publication upgrade path.
research-proposal-generator
Generates a comprehensive research proposal design based on input literature, including hypothesis, mechanism verification, and budget. Use when the user wants to design a research project from a paper.
research-grants
Write competitive research proposals for NSF, NIH, DOE, DARPA, and Taiwan's NSTC when you need agency-compliant narratives, budgets, and review-criteria alignment for a specific solicitation/FOA/BAA.
protocol-standardization
Standardize fragmented experimental steps into reproducible protocol documents when you need method organization, lab SOP drafting, or cross-operator reproducibility; missing parameters must be explicitly marked as "To be supplemented/Not provided".
prospero-registration-helper
Assists researchers in generating PROSPERO registration content for meta-analyses from a title and optional protocol. Use when the user wants to draft a PROSPERO registration form.
non-tumor-ml-research-planner
Generates complete non-tumor biomedical machine learning research designs from a user-provided research direction. Always use this skill when users want to plan bioinformatics + ML papers for non-cancer diseases (metabolic, cardiovascular, kidney, inflammatory, autoimmune, infectious, neurological, endocrine, wound healing, chronic multifactor), design diagnostic biomarker studies, combine GEO datasets with feature selection and ML modeling, or generate Lite/Standard/Advanced/Publication+ workload plans. Trigger for:"non-tumor ML study", "bioinformatics paper outside oncology", "key genes and diagnostic model for a disease", "pyroptosis/ferroptosis/senescence/autophagy + disease", "GEO datasets + machine learning", "RF + LASSO diagnostic model", "DEG + feature selection + validation", "immune infiltration + biomarker", "non-cancer biomarker paper". Trigger even for casual phrasings like "I want to study X using machine learning", "help me design a non-tumor bioinformatics paper", or "how do I build a diagnostic model for disease Y".