- name
- medication-manager
- description
- >
Medication Manager
Family medication management with file-based storage. No database required — works anywhere.
Overview
| Feature | How |
|---|---|
| Medication catalog | Markdown files in data/medications/ |
| Member profiles | Markdown files in data/members/ |
| Batch tracking | Embedded in medication files |
| Expiry alerts | scripts/check_expiry.py or manual scan |
| Reminders | Your platform's cron/reminder system (configurable) |
| Notifications | OpenClaw cron, webhooks, email, local OS — you choose |
| Media archive | data/media/ with date-based folders |
Quick Start
Step 1: Set Up Family Member Profiles
This is always the first step. Before recording any medications, create profiles for each family member.
See references/member-profile.md for the complete template, role-specific fields, and data collection guide.
Setup flow (follow this every time):
- Ask about family members: "家里有几位成员?分别是谁?(大人/小孩/老人)"
- For each member, collect minimum info:
- 姓名 — who is this person? - 角色 — 成人 / 儿童 / 老人 - 出生日期 — for age calculation (儿童: calculate exact months) - 体重 (kg) — ⚠️ 儿童必填,用药剂量按体重计算 - 过敏史 — ⚠️ 最重要的安全问题 — "有没有什么药物过敏?"
- For children, additionally ask:
- 疫苗接种情况 - 近期是否生病/用药
- For adults/elderly, additionally ask:
- 慢性病(高血压、糖尿病等) - 长期服用的药物
- Create
data/members/{name}.mdfor each member - Confirm the profiles with the user before proceeding
Minimal profile (user can fill in details later):
# {姓名}
| Field | Value |
|-------|-------|
| Name | {姓名} |
| Role | 成人 / 儿童 / 老人 |
| Birth Date | YYYY-MM-DD |
| Weight | {kg} |
| Allergies | {list or "无已知过敏"} |Step 2: Configure Notifications
Before setting reminders, configure how the user wants to be notified.
This skill does not hardcode any notification channel. The user chooses their own method.
Option A: OpenClaw Built-in Cron (Recommended for OpenClaw users)
If running on OpenClaw, the cron system supports all configured channels automatically.
# Example: daily 8am reminder via current channel
openclaw cron add \
--name "med-{member}-{drug}" \
--schedule "0 8 * * *" \
--agent-id your-agent \
--message "⏰ 用药提醒\
\
💊 {药品名}\
剂量:{剂量}\
\
请按时服药!"Supported channels (via --target):
| Channel | Target Format | Example |
|---|---|---|
| Feishu | feishu:{open_id} | feishu:ou_xxxxx |
| Telegram | telegram:{chat_id} | telegram:-1001234567 |
| QQ Bot | qqbot:c2c:{openid} | qqbot:c2c:xxxxx |
| Discord | discord:{channel_id} | discord:123456789 |
| Signal | signal:{phone} | signal:+86138xxxx |
Tip: Omit --target to send to the current conversation (auto-detected).Option B: Webhook (DingTalk, WeChat Work, Slack, etc.)
If the user has a webhook URL, send a POST request with the reminder message. See references/notifications.md for full templates.
See references/notifications.md for:
- All notification options with full examples
- Notification content templates
- Agent implementation guide
- Troubleshooting
What the agent should do:
- Detect the user's current channel from conversation context
- Ask: "你希望通过什么方式接收用药提醒?" and offer options
- If OpenClaw → use cron with auto-detected target
- If webhook → ask for the webhook URL
- Store the notification config in the member profile
- Always test — send one test notification to confirm it works
Step 3: Set Up Data Directory
Create the storage structure:
data/
├── medications/ # One .md per medication
├── members/ # One .md per family member (created in Step 1)
├── prescriptions/ # Prescription records (optional)
├── logs/ # Medication intake logs (YYYY-MM-DD.md)
├── config/ # Optional: notification config
│ └── notifications.yaml
└── media/ # Photos of prescriptions/boxes
└── YYYY-MM-DD/Step 4: Add Medications
When a user describes or sends a photo of a medication:
- Analyze with vision model (if photo)
- Extract: generic name, brand name, spec, manufacturer, batch no, expiry, dosage
- Confirm details with user
- Create a markdown file:
data/medications/{generic_name}.md - Set up reminders if requested (using configured notification method)
Medication File Template
# {Generic Name} ({Brand Name})
## Basic Info
| Field | Value |
|-------|-------|
| Generic Name | {name} |
| Brand Name | {name} |
| Specification | {spec} |
| Manufacturer | {manufacturer} |
| Approval No | {批准文号} |
| Drug Type | 处方药 / OTC / 外用药 |
| Category | 抗生素 / 感冒药 / 退烧药 / etc. |
| Indications | {适应症} |
| Contraindications | {禁忌} |
| Storage | {储存条件} |
## Batches
| Batch No | Mfg Date | Expiry | Qty | Unit | Location | Status |
|----------|----------|--------|-----|------|----------|--------|
| {batch} | {date} | {date} | {n} | 盒/支/瓶 | {location} | active |
## Usage Notes
- Adult dose: {dosage}
- Child dose: {dosage by weight}
- Food: before/after meals
- Special notes: {warnings}
## History
| Date | Member | Action | Notes |
|------|--------|--------|-------|
| YYYY-MM-DD | {name} | added/prescribed | {source} |Notification Settings
Core Workflows
Photo Entry (prescription / medicine box)
User sends image → Analyze with vision model → Extract medication info
→ Confirm with user → Create/update medication .md file → Set reminders if requestedSteps:
- Use your platform's image analysis tool to read the photo
- Extract: generic name, brand name, spec, manufacturer, batch no, expiry, dosage
- Confirm details with user (especially for prescriptions)
- Save photo to
data/media/YYYY-MM-DD/ - Create or update the medication markdown file
- Ask if reminders are needed → use configured notification method
Text Entry
User describes medication → Parse → Confirm → Create .md fileUse structured extraction from user's text description. Always confirm before creating.
Set Reminder
Get member + medication + schedule → Check notification config
→ Create platform-specific reminder → Record in member file → Test it- Read member file for notification settings
- If no notification config exists → ask the user to configure first (see Step 2)
- Query medication file for drug info
- Determine reminder schedule based on dosage instructions
- Create reminder using the configured method:
- OpenClaw cron: openclaw cron add --name "..." --schedule "..." --message "..." - Webhook: POST JSON to the webhook URL
- Test — send one notification immediately to confirm delivery
- Record the reminder details in the member's notification settings
- Confirm with the user: "提醒已设置,{时间}会收到通知"
Expiry Check
python3 /path/to/medication-manager/scripts/check_expiry.py /path/to/data/medications/Or manually scan medication files for expiry dates. Alert levels:
| Level | Threshold | Action |
|---|---|---|
| 🔴 Expired | Past date | Notify immediately, mark as expired |
| ⚠️ 7 days | Within 7 days | Daily reminder to use or dispose |
| 🟡 30 days | Within 30 days | Weekly reminder |
| 🔶 90 days | Within 90 days | Monthly review |
Query Inventory
Scan all files in data/medications/ for:
- Active batches with quantity > 0
- Sort by expiry date (soonest first)
- Filter by category if requested
Log Medication Intake
When a family member takes a medication:
- Append entry to
data/logs/YYYY-MM-DD.md:
| Time | Member | Medication | Dose | Status | Notes |
|------|--------|-----------|------|--------|-------|
| 08:15 | 张三 | 氨氯地平 | 5mg | ✅ taken | 饭后 |- Update batch quantity in the medication file (decrement)
- Flag if dose was missed or skipped
Reference Data
| Reference | Path | Purpose |
|---|---|---|
| Member profiles | references/member-profile.md | Template & collection guide |
| Notifications | references/notifications.md | All notification options & templates |
| Storage layout | references/storage-layout.md | File organization & naming |
| Drug interactions | references/drug-interactions.md | Check when multiple drugs prescribed |
| Pediatric dosage | references/pediatric-dosage.md | Calculate child doses by weight |
| Setup guide | references/setup.md | Installation & first use |
Important Rules
- Always confirm medication details before saving
- Configure notifications first — reminders are useless if they can't reach the user
- Test notifications — always send a test notification after setup
- Children dosing: always verify weight and age, ask about allergies
- Expiry alerts: proactively notify when drugs expire or near expiry
- Antibiotics: flag prescription antibiotics, remind about completing full course
- Drug interactions: check reference when multiple drugs prescribed together
- Special drugs: flag controlled substances (精二药品, etc.)
- Privacy: do not share personal health information
Platform Adapters
This skill is platform-agnostic. The notification layer adapts to whatever the user has:
| Platform | Method | Setup |
|---|---|---|
| OpenClaw (any channel) | Built-in cron | Auto-detected, no config needed |
| Feishu | message tool or cron | Set --target "feishu:{open_id}" |
| Telegram | Bot API or cron | Set --target "telegram:{chat_id}" |
| QQ Bot | qqbot_remind / qqbot_cron | Set target via cron |
| Webhook | POST JSON | Provide webhook URL |
Full details: references/notifications.md
Data Migration
If you have existing medication data (e.g., from a spreadsheet or another system):
- Convert each medication to the markdown template above
- Place files in
data/medications/ - Run the expiry check script to validate dates