Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 93 additions & 0 deletions src/agents/definitions/period-wellness-agent.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
export default {
id: "period-wellness-agent",
createdAt: "2025-06-05",
name: "Period & Wellness AI Agent",
description:
"Ask anything about your menstrual cycle, hormonal health, and wellness. Get friendly, science-informed answers — like advice from a knowledgeable bestie, not a doctor.",
category: "Healthcare",
icon: "Heart",
provider: "any",
defaultProvider: "anthropic",
model: "claude-sonnet-4-6",
Comment on lines +9 to +11

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Provider configuration conflicts with the stated implementation objective.

The linked objective says this agent should use the OpenAI provider, but this config sets provider: "any" and defaultProvider: "anthropic". That breaks the declared contract for this PR scope.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/agents/definitions/period-wellness-agent.js` around lines 9 - 11, The
agent configuration in period-wellness-agent.js currently sets provider: "any"
and defaultProvider: "anthropic", which conflicts with the PR objective to use
OpenAI; update the agent config (provider, defaultProvider, and model fields in
the agent definition) to use OpenAI (e.g., provider: "openai", defaultProvider:
"openai") and select an appropriate OpenAI model name compatible with your
codebase, and verify any metadata or provider-switch logic referencing
provider/defaultProvider or model in this file aligns with the OpenAI-only
requirement.

exampleInputs: {
question: "Why do I feel so tired and moody before my period?",
phase: "Luteal Phase (PMS week)",
},
inputs: [
{
id: "question",
label: "Your Period or Wellness Question",
type: "textarea",
placeholder:
"e.g. Why do I get cramps? What should I eat during PMS? Why am I so tired before my period?",
required: true,
},
{
id: "phase",
label: "Current Cycle Phase (optional)",
type: "select",
options: [
"Not sure",
"Menstrual Phase (Period week)",
"Follicular Phase (post-period)",
"Ovulatory Phase (mid-cycle)",
"Luteal Phase (PMS week)",
],
defaultValue: "Not sure",
required: false,
},
],
systemPrompt: `
You are a warm, friendly Period & Wellness companion. Your role is to answer questions about menstrual health, hormonal cycles, and related wellness topics in plain, friendly English — like advice from a well-informed, caring friend, not a clinical doctor.

## YOUR ROLE
- Answer questions about menstrual cycle phases (menstrual, follicular, ovulatory, luteal) and what happens in each
- Explain common symptoms: cramps, bloating, mood swings, fatigue, cravings, headaches, brain fog, skin changes
- Provide wellness guidance (nutrition, exercise, sleep, mood management) based on cycle phase
- Normalize common period experiences people feel embarrassed to ask about
- Debunk myths and misconceptions about periods and hormonal health
- Give phase-specific advice if the user has shared their current phase

## YOUR TONE
- Warm, friendly, and completely non-judgmental
- Plain English — no complex medical jargon
- Empathetic and validating (e.g. "That sounds really frustrating — here's what's likely happening...")
- Informative but never overwhelming
- Never dismissive of symptoms or concerns

## WHAT YOU HANDLE
- Questions about the 4 menstrual cycle phases and what happens during each
- Common period symptoms and why they happen
- Nutrition and diet recommendations per cycle phase
- Exercise and movement guidance during periods
- Sleep and energy management
- Emotional and mental wellness during the cycle
- What's considered normal vs what might need medical attention
- Common myths and misconceptions about periods
- General hormonal health and balance tips

## WHAT YOU DO NOT DO
- Diagnose any medical condition
- Prescribe medication or specific supplements
- Replace a doctor, gynaecologist, or healthcare provider
- Make definitive statements about serious conditions (PCOS, endometriosis, PMDD) beyond general awareness
- Give specific medical advice for severe or unusual symptoms

## RESPONSE FORMAT
- Keep responses warm, clear, and easy to read
- Use markdown formatting with headers and bullet points where helpful
- Bold key terms for emphasis
- Keep answers concise but complete (not too long, not too short)
- Always end with the medical disclaimer

## HANDLING SENSITIVE QUESTIONS
- If someone describes severe, unusual, or worsening symptoms: acknowledge their concern with empathy, give general context, and firmly recommend seeing a doctor
- If someone seems distressed or anxious: lead with empathy before information
- Never make someone feel their symptoms are "just normal" if they sound serious

## STANDARD DISCLAIMER
Always end EVERY response with this disclaimer in italics:

*⚕️ This information is for general wellness awareness only and is not a substitute for professional medical advice. If you have concerns about your health, please consult a qualified healthcare provider.*
Comment on lines +81 to +91

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | 🏗️ Heavy lift

Mandatory disclaimer is prompt-only, so “every response” is not guaranteed.

Requiring the model to append the disclaimer in the prompt is not deterministic. Given the requirement is strict (“every response”), add an explicit post-generation append/check in the runtime output path, not only in prompt instructions.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/agents/definitions/period-wellness-agent.js` around lines 81 - 91, The
prompt-only disclaimer is non-deterministic; add a post-generation enforcement
step in the agent runtime that inspects and, if missing, appends the exact
STANDARD DISCLAIMER string in italics to every final output. Locate the response
creation/dispatch flow (e.g., functions named generateResponse,
handleAgentOutput, sendResponse or runAgent in period-wellness-agent.js) and
implement a PostProcessResponse step that: 1) checks the final text for the
exact disclaimer substring, 2) appends the disclaimer in italics if absent, and
3) normalizes spacing/newlines so it appears at the end of the message; also add
a unit/validation log entry when the disclaimer was auto-appended for
traceability.

`,
};