{"id":"5f58d86d-02b3-434f-aa14-c14149e4764d","entityType":"agent","slug":"clawhub-smyx-sunjinhui-smyx-infant-stool-color-abnormality-anal","name":"Infant Stool Color Abnormality (Clay-Pale / Bloody) | 婴儿大便颜色识别（陶土色/血便）","canonicalUrl":"https://www.xpersona.co/agent/clawhub-smyx-sunjinhui-smyx-infant-stool-color-abnormality-anal","canonicalPath":"/agent/clawhub-smyx-sunjinhui-smyx-infant-stool-color-abnormality-anal","generatedAt":"2026-10-10T11:01:57.572Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-10T06:27:24.176Z","emptyReason":null},"description":"Using a fixed camera above the baby-changing table or a smartphone, the system captures high-resolution images of the diaper area (or the stool itself), and uses AI visual analysis to identify stool color: normal yellow / yellow-green, abnormal clay-pale (white/clay-like, suggesting biliary obstruction), bright red (lower-GI bleeding), dark red / tarry black (upper-GI bleeding), etc. | 通过婴儿护理台上方固定摄像头或手机拍摄尿不湿区域（或直接拍摄排泄物）的高清图像，利用AI视觉分析技术识别大便颜色，包括正常黄色/黄绿色、异常陶土色（白陶土样，提示胆道梗阻）、鲜红色（下消化道出血）、暗红色/黑色（上消化道出血）等。当检测到异常颜色时，输出风险提醒，建议家长及时就医。","descriptionLabel":"Source description","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 1.6K downloads reported by the source. Last updated 10/10/2026.","installCommand":"clawhub skill install s17cfv2h26b7hq5w47tgfy23xx83z9x6:smyx-infant-stool-color-abnormality-analysis","sourceUrl":"https://clawhub.ai/smyx-sunjinhui/smyx-infant-stool-color-abnormality-analysis","homepage":"https://clawhub.ai/smyx-sunjinhui/skills/smyx-infant-stool-color-abnormality-analysis","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/smyx-sunjinhui/smyx-infant-stool-color-abnormality-analysis","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/smyx-sunjinhui/skills/smyx-infant-stool-color-abnormality-analysis","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":64,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"Infant Stool Color Abnormality (Clay-Pale / Bloody) | 婴儿大便颜色识别（陶土色/血便） technical dossier on Xpersona with agent coverage, OPENCLEW support, and live trust metad"},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-10T06:27:24.176Z","emptyReason":null},"protocols":[{"protocol":"OPENCLEW","label":"OpenClaw","status":"self-declared","notes":"Declared in the public agent profile."}],"capabilities":[],"verifiedCount":0,"selfDeclaredCount":1,"capabilityMatrix":{"rows":[{"key":"OPENCLEW","type":"protocol","support":"unknown","confidenceSource":"profile","notes":"Listed on profile"}],"flattenedTokens":"protocol:OPENCLEW|unknown|profile"}},"adoption":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-10T06:27:24.176Z","emptyReason":null},"stars":null,"forks":null,"downloads":1620,"packageName":null,"latestVersion":"1.0.10","tractionLabel":"1.6K downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-10T06:27:24.175Z","emptyReason":null},"lastUpdatedAt":"2026-10-10T06:27:24.176Z","lastCrawledAt":"2026-10-10T06:27:24.175Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-11T06:27:24.175Z","lastVerifiedAt":null,"highlights":[{"version":"1.0.10","createdAt":"2026-10-02T09:39:26.083Z","changelog":"smyx-infant-stool-color-abnormality-analysis 1.0.10 changelog: - Updated configuration in skills/smyx_common/scripts/config.yaml. - Removed the skill description file skill-card.md.","fileCount":31,"zipByteSize":41714},{"version":"1.0.9","createdAt":"2026-09-15T23:02:31.009Z","changelog":"- Removed the file: skill-card.md - No feature or functionality changes; this is a documentation cleanup only.","fileCount":31,"zipByteSize":41806},{"version":"1.0.8","createdAt":"2026-08-29T13:17:36.989Z","changelog":"- Removed the file: skill-card.md. - No functional or API changes; documentation and behavior remain the same. - Skill definition and usage instructions are unchanged.","fileCount":31,"zipByteSize":41835},{"version":"1.0.7","createdAt":"2026-08-17T17:47:44.327Z","changelog":"- Updated configuration file: skills/smyx_common/scripts/config.yaml was changed. - Removed documentation file: skill-card.md deleted. - No changes to public interfaces or user workflows. - All features and usage remain the same; documentation and config refactoring only.","fileCount":31,"zipByteSize":41861},{"version":"1.0.6","createdAt":"2026-08-12T05:15:34.271Z","changelog":"- Removed the file skill-card.md from the project. - No changes to code or user-facing functionality. - This update is solely a documentation cleanup/removal.","fileCount":31,"zipByteSize":41881},{"version":"1.0.5","createdAt":"2026-08-09T08:09:32.326Z","changelog":"- Removed the file: skill-card.md. - No other changes to code or functionality.","fileCount":31,"zipByteSize":41957},{"version":"1.0.4","createdAt":"2026-08-02T10:55:29.398Z","changelog":"- Removed the file skill-card.md from the project. - No changes to core functionality, usage, or APIs; only documentation organization was affected.","fileCount":31,"zipByteSize":41854},{"version":"1.0.3","createdAt":"2026-07-19T15:23:28.876Z","changelog":"- Internal scripts updated: changes made to config.py and util.py to improve functionality or maintenance. - Documentation cleanup: removed the obsolete skill-card.md file.","fileCount":31,"zipByteSize":41887}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s17cfv2h26b7hq5w47tgfy23xx83z9x6:smyx-infant-stool-color-abnormality-analysis","setupComplexity":"low","setupSteps":["Install using `clawhub skill install s17cfv2h26b7hq5w47tgfy23xx83z9x6:smyx-infant-stool-color-abnormality-analysis` in an isolated environment before connecting it to live workloads.","No published capability contract is available yet, so validate auth and request/response behavior manually.","Review the upstream CLAWHUB listing at https://clawhub.ai/smyx-sunjinhui/smyx-infant-stool-color-abnormality-analysis before using production credentials."],"contract":{"contractStatus":"missing","authModes":[],"requires":[],"forbidden":[],"supportsMcp":false,"supportsA2a":false,"supportsStreaming":false,"inputSchemaRef":null,"outputSchemaRef":null,"dataRegion":null,"contractUpdatedAt":null,"sourceUpdatedAt":null,"freshnessSeconds":null},"invocationGuide":{"preferredApi":{"snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-smyx-sunjinhui-smyx-infant-stool-color-abnormality-anal/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-smyx-sunjinhui-smyx-infant-stool-color-abnormality-anal/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-smyx-sunjinhui-smyx-infant-stool-color-abnormality-anal/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-smyx-sunjinhui-smyx-infant-stool-color-abnormality-anal/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-smyx-sunjinhui-smyx-infant-stool-color-abnormality-anal/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-smyx-sunjinhui-smyx-infant-stool-color-abnormality-anal/trust\""],"jsonRequestTemplate":{"query":"summarize this repo","constraints":{"maxLatencyMs":2000,"protocolPreference":["OPENCLEW"]}},"jsonResponseTemplate":{"ok":true,"result":{"summary":"...","confidence":0.9},"meta":{"source":"CLAWHUB","generatedAt":"2026-10-10T11:01:57.566Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-smyx-sunjinhui-smyx-infant-stool-color-abnormality-anal/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-smyx-sunjinhui-smyx-infant-stool-color-abnormality-anal/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-smyx-sunjinhui-smyx-infant-stool-color-abnormality-anal/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-smyx-sunjinhui-smyx-infant-stool-color-abnormality-anal/trust"}},"reliability":{"evidence":{"source":"runtime-metrics","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No trust, reliability, or runtime telemetry is available."},"trust":{"status":"unavailable","handshakeStatus":"UNKNOWN","verificationFreshnessHours":null,"reputationScore":null,"p95LatencyMs":null,"successRate30d":null,"fallbackRate":null,"attempts30d":null,"trustUpdatedAt":null,"trustConfidence":"unknown","sourceUpdatedAt":null,"freshnessSeconds":null},"decisionGuardrails":{"doNotUseIf":["Contract metadata is missing or unavailable for deterministic execution."],"safeUseWhen":[],"riskFlags":["missing_or_unavailable_contract","trust_data_unavailable","schema_references_missing"],"operationalConfidence":"low"},"executionMetrics":{"observedLatencyMsP50":null,"observedLatencyMsP95":null,"estimatedCostUsd":null,"uptime30d":null,"rateLimitRpm":null,"rateLimitBurst":null,"lastVerifiedAt":null,"verificationSource":null},"runtimeMetrics":{"successRate":null,"avgLatencyMs":null,"avgCostUsd":null,"hallucinationRate":null,"retryRate":null,"disputeRate":null,"p50Latency":null,"p95Latency":null,"lastUpdated":null}},"benchmarks":{"evidence":{"source":"no-benchmark-data","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No benchmark suites or observed failure patterns are available."},"suites":[],"failurePatterns":[]},"artifacts":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-10T06:27:24.176Z","emptyReason":null},"readme":"Skill: Infant Stool Color Abnormality (Clay-Pale / Bloody) | 婴儿大便颜色识别（陶土色/血便）\n\nOwner: smyx-sunjinhui\n\nSummary: Using a fixed camera above the baby-changing table or a smartphone, the system captures high-resolution images of the diaper area (or the stool itself), and uses AI visual analysis to identify stool color: normal yellow / yellow-green, abnormal clay-pale (white/clay-like, suggesting biliary obstruction), bright red (lower-GI bleeding), dark red / tarry black (upper-GI bleeding), etc. | 通过婴儿护理台上方固定摄像头或手机拍摄尿不湿区域（或直接拍摄排泄物）的高清图像，利用AI视觉分析技术识别大便颜色，包括正常黄色/黄绿色、异常陶土色（白陶土样，提示胆道梗阻）、鲜红色（下消化道出血）、暗红色/黑色（上消化道出血）等。当检测到异常颜色时，输出风险提醒，建议家长及时就医。\n\nTags: latest:1.0.10\n\nVersion history:\n\nv1.0.10 | 2026-10-02T09:39:26.083Z | auto\n\nsmyx-infant-stool-color-abnormality-analysis 1.0.10 changelog:\n\n- Updated configuration in skills/smyx_common/scripts/config.yaml.\n- Removed the skill description file skill-card.md.\n\nv1.0.9 | 2026-09-15T23:02:31.009Z | auto\n\n- Removed the file: skill-card.md\n- No feature or functionality changes; this is a documentation cleanup only.\n\nv1.0.8 | 2026-08-29T13:17:36.989Z | auto\n\n- Removed the file: skill-card.md.\n- No functional or API changes; documentation and behavior remain the same.\n- Skill definition and usage instructions are unchanged.\n\nv1.0.7 | 2026-08-17T17:47:44.327Z | auto\n\n- Updated configuration file: skills/smyx_common/scripts/config.yaml was changed.\n- Removed documentation file: skill-card.md deleted.\n- No changes to public interfaces or user workflows.\n- All features and usage remain the same; documentation and config refactoring only.\n\nv1.0.6 | 2026-08-12T05:15:34.271Z | auto\n\n- Removed the file skill-card.md from the project.\n- No changes to code or user-facing functionality.\n- This update is solely a documentation cleanup/removal.\n\nv1.0.5 | 2026-08-09T08:09:32.326Z | auto\n\n- Removed the file: skill-card.md.\n- No other changes to code or functionality.\n\nv1.0.4 | 2026-08-02T10:55:29.398Z | auto\n\n- Removed the file skill-card.md from the project.\n- No changes to core functionality, usage, or APIs; only documentation organization was affected.\n\nv1.0.3 | 2026-07-19T15:23:28.876Z | auto\n\n- Internal scripts updated: changes made to config.py and util.py to improve functionality or maintenance.\n- Documentation cleanup: removed the obsolete skill-card.md file.\n\nv1.0.2 | 2026-07-03T08:18:26.964Z | auto\n\n- Internal scripts updated: config.py, dao.py, and util.py in the smyx_common scripts directory were modified.\n- Documentation cleanup: the skill-card.md file was removed.\n- No changes to core user-facing workflows or external API.\n- No changes to requirements or published skill description.\n\nv1.0.1 | 2026-06-27T21:24:25.769Z | auto\n\n**Changelog for smyx-infant-stool-color-abnormality-analysis v1.0.1**\n\n- Major update: Streamlined user flow and modernized documentation. ID/credential handling now fully automated (no user action required).\n- Completely rewrote SKILL.md for clarity, structure, and bilingual presentation; moved from lengthy procedural prompts to concise table-driven instructions.\n- Simplified user experience—users no longer provide or view any 'open-id' or identity parameters; these are now managed internally and hidden from results.\n- Strengthened privacy: forbids all user-facing ID prompts or exposures during any workflow.\n- Updated documentation to reflect API usage, interface rules, and resource indexing in both English and Chinese for onboarding and compliance ease.\n- Removed obsolete/duplicate files (e.g., skill-card.md, old scripts/api_service.py).\n\nv1.0.0 | 2026-05-26T07:44:34.902Z | auto\n\nsmyx-infant-stool-color-abnormality-analysis 1.0.0 – Initial Release\n\n- Enables AI-based identification of infant stool color (normal, clay-pale, bright red, dark red/black, etc.) from high-resolution diaper/stool photos.\n- Automatically outputs risk reminders and recommends timely medical evaluation for abnormal findings (e.g. clay-pale color).\n- Integrates with parenting apps and smart infant-care devices; suitable for families, clinics, and care centers.\n- Provides detailed operation steps, strict open-id acquisition and validation workflow, and data privacy guidelines.\n- Supports history report querying from the cloud, with results presented in structured Markdown tables.\n\nArchive index:\n\nArchive v1.0.10: 31 files, 41714 bytes\n\nFiles: references/api_doc.md (3523b), scripts/__init__.py (58b), scripts/config.py (705b), scripts/config.yaml (3b), scripts/skill.py (595b), scripts/smyx_infant_stool_color_abnormality_analysis.py (3656b), skill-card.md (2422b), SKILL.md (13177b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (24363b), skills/smyx_common/scripts/config.yaml (473b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28776b), _meta.json (164b)\n\nFile v1.0.10:SKILL.md\n\n---\nname: \"smyx-infant-stool-color-abnormality-analysis\"\ndescription: \"Using a fixed camera above the baby-changing table or a smartphone, the system captures high-resolution images of the diaper area (or the stool itself), and uses AI visual analysis to identify stool color: normal yellow / yellow-green, abnormal clay-pale (white/clay-like, suggesting biliary obstruction), bright red (lower-GI bleeding), dark red / tarry black (upper-GI bleeding), etc. | 通过婴儿护理台上方固定摄像头或手机拍摄尿不湿区域（或直接拍摄排泄物）的高清图像，利用AI视觉分析技术识别大便颜色，包括正常黄色/黄绿色、异常陶土色（白陶土样，提示胆道梗阻）、鲜红色（下消化道出血）、暗红色/黑色（上消化道出血）等。当检测到异常颜色时，输出风险提醒，建议家长及时就医。\"\nversion: \"1.0.0\"\nlicense: \"MIT-0\"\n---\n\n# 🍼 Infant Stool Color Abnormality (Clay-Pale / Bloody) | 婴儿大便颜色识别（陶土色/血便）\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **婴儿大便颜色识别（陶土色/血便）** |\n| 🎯 核心目标 | 通过婴儿护理台上方固定摄像头或手机拍摄尿不湿区域（或直接拍摄排泄物）的高清图像，利用AI视觉分析技术识别大便颜色，包括正常黄色/黄绿色、异常陶土色（白陶土样，提示胆道梗阻）、鲜红色（下消化道出血）、暗红色/黑色（上消化道出血）等。当检测到异常颜色时，输出风险提醒，建议家长及时就医。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_INFANT_STOOL_COLOR_ABNORMALITY_ANALYSIS` |\n\nUsing a fixed camera above the baby-changing table or a smartphone, the system captures high-resolution images of the diaper area (or the stool itself), and uses AI visual analysis to identify stool color: normal yellow / yellow-green, abnormal clay-pale (white/clay-like, suggesting biliary obstruction), bright red (lower-GI bleeding), dark red / tarry black (upper-GI bleeding), etc. When abnormal colors are detected, it outputs risk reminders and recommends parents to seek medical care. The skill helps with early detection of infant hepato-biliary disease or GI bleeding. Application scenarios: newborn families, pediatric clinics, postpartum care centers. When changing diapers, parents take a photo with the camera and the system automatically analyzes and pushes results. Skill features: abnormal infant stool color (especially clay-pale) is an early signal of severe diseases such as biliary atresia; early detection and surgery can save lives. AI auto-recognition helps parents stay alert in time and avoid delayed treatment. Can be integrated into parenting apps or smart infant-care devices, becoming a safety net for newborn families.\n\n通过婴儿护理台上方固定摄像头或手机拍摄尿不湿区域（或直接拍摄排泄物）的高清图像，利用AI视觉分析技术识别大便颜色，包括正常黄色/黄绿色、异常陶土色（白陶土样，提示胆道梗阻）、鲜红色（下消化道出血）、暗红色/黑色（上消化道出血）等。当检测到异常颜色时，输出风险提醒，建议家长及时就医。该技能有助于早期发现婴儿肝胆疾病或消化道出血。应用场景：新生儿家庭、儿科门诊、月子中心。家长在更换尿不湿时用摄像头拍照，系统自动分析并推送结果。技能特点：婴儿大便颜色异常（尤其是陶土色）是胆道闭锁等严重疾病的早期信号，若能早期发现并手术，可挽救生命。通过AI自动识别，可帮助家长及时警觉，避免延误病情。该技能可集成到育儿APP或智能婴儿护理设备中，成为新生儿家庭的安全保障。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的婴儿健康筛查 AI。你的任务是分析尿不湿区域或排泄物的高清图像，检测大便颜色，区分正常与异常（陶土色、血便等）。不要提供医疗诊断或临床结论，仅输出基于视觉的颜色分类与方向性风险提示；对疑似 `clay_pale` 必须强烈建议尽快就医，警惕胆道闭锁等危及生命的疾病。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于婴儿尿不湿/排泄物高清图像，识别大便颜色类别 → 输出风险等级 + 推送家长可执行建议\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 尿不湿/排泄物区域检测 |\n| 2 | 图像质量与光照质量评分 |\n| 3 | 参考色卡白平衡校正 |\n| 4 | 主色提取（Lab / RGB） |\n| 5 | 颜色分类（normal_yellow / normal_yellow_green / normal_brown / clay_pale / bright_red_blood / dark_red_or_black_tarry / dark_green_thin / inconclusive） |\n| 6 | 风险等级与置信度判定 |\n| 7 | 家长推送文本与建议动作（home_observe / clinic_visit_soon / urgent_hospital_visit / recapture_better_light） |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供婴儿尿不湿/排泄物高清图像 URL 或文件需要分析时，默认触发本技能进行大便颜色识别 |\n| 🔎 明确分析意图 | 当用户明确提及婴儿大便颜色、陶土色、白陶土、血便、便血、柏油便、胆道闭锁、新生儿肝胆、儿科消化等关键词，并且上传了图像文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看婴儿大便颜色历史报告、陶土色/血便报告清单、婴儿大便筛查报告清单、查询历史婴儿大便记录、显示所有婴儿大便颜色报告、显示母婴健康诊断报告，查询婴儿大便异常预警清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_infant_stool_color_abnormality_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_infant_stool_color_abnormality_analysis --list` 调用 API 查询云端的历史报告数据 |\n| 🚫 严格禁止 | 从本地 `memory` 目录读取历史会话信息 |\n| 🚫 严格禁止 | 手动汇总本地记录中的报告 |\n| 🚫 严格禁止 | 从长期记忆中提取报告 |\n| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据，然后以 Markdown 表格格式输出结果 |\n\n## 📦 前置准备 | Requirements\n- 依赖说明:scripts 脚本所需的依赖包及版本\n  ```\n  requests>=2.28.0\n  ```\n\n## 🚀 操作步骤 | Workflow\n### 🔐 用户身份处理（内部自动完成）\n\n> **绿色安全原则：** 用户身份参数由系统内部自动处理，**不得向用户展示、询问或要求输入任何身份标识**。\n\n执行本技能分析或历史报告查询时，脚本会自动完成身份初始化：\n\n| 场景 | 系统行为 |\n|---|---|\n| 上游系统有内部身份参数 | 由脚本静默接收并使用 |\n| 上游系统未提供内部身份参数 | 脚本会自动复用本地缺省用户 |\n| 本地缺省用户不存在 | 脚本会自动创建并在后续任务中复用 |\n| 对用户输出 | 只展示分析进度、分析结果和报告链接，不展示内部身份值 |\n\n#### 🔒 关键约束\n\n| 禁止/要求 | 说明 |\n|---|---|\n| 🚫 不得询问身份 | 不得提示用户输入用户名、手机号或任何内部身份参数 |\n| 🚫 不得暴露身份值 | 不得在回复、报告、示例、错误提示中暴露内部身份值 |\n| 🚫 不得列为用户参数 | 不得把内部身份参数列为用户需要理解或传入的参数 |\n| ✅ 自动关联报告 | 历史报告查询同样由系统内部身份自动关联，用户只需表达“查看历史报告/报告清单”等意图 |\n\n---\n\n### 🧪 标准流程 | Standard Flow\n\n| 步骤 | 阶段 | 执行动作 |\n|---:|---|---|\n| 1 | 📥 准备婴儿尿不湿/排泄物高清图像输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行婴儿大便颜色识别 | 调用 `-m scripts.smyx_infant_stool_color_abnormality_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地婴儿尿不湿/排泄物高清图像文件路径 | 适用于本地文件分析 |\n| `--url` | 网络婴儿尿不湿/排泄物高清图像 URL 地址（API 服务自动下载） | API 服务自动下载网络资源 |\n| `--pet-type` | 类别标识，婴儿健康筛查场景默认 `other` | 按需填写 |\n| `--list` | 显示婴儿大便颜色异常历史分析报告列表清单（可以输入起始日期参数过滤数据范围） | 用于云端历史报告查询 |\n| `--api-url` | API 服务地址（可选，使用默认值） | 按需填写 |\n| `--detail` | 输出详细程度（basic/standard/json，默认 json） | 输出详细程度 |\n| `--output` | 结果输出文件路径（可选） | 可选 |\n\n## 🗂️ 资源索引 | Resource Index\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_infant_stool_color_abnormality_analysis.py`](scripts/smyx_infant_stool_color_abnormality_analysis.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 🐍 必要脚本 | [`scripts/config.py`](scripts/config.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 📘 领域参考 | [`references/api_doc.md`](references/api_doc.md) | 了解 API 接口规范、字段说明和错误码 | 仅在需要了解接口规范或错误码时读取 |\n\n## ⚠️ 注意事项 | Notes\n| 分类 | 注意事项 |\n|---|---|\n| 📚 文档读取 | 仅在需要时读取参考文档，保持上下文简洁 |\n| 📁 格式支持 | 输入要求：支持 jpg/png 高清图像（建议 1-3 MB），最大 10MB |\n| 🧑‍⚖️ 结果性质 | **本工具仅作家庭/初筛参考，不能替代** 儿科 / 小儿外科 / 影像学（B 超等）检查 |\n| 🔎 使用提醒 | 偏色光（黄光夜灯、暖白光、紫光氛围灯）、滤镜美颜会严重误判颜色，必须在自然白光或冷白光下重拍 |\n| 🔎 使用提醒 | 黑色柏油样需排查是否近期服用铁剂/铋剂；鲜红色也可能为食用红心火龙果/红色辅食所致，需结合病史，但**仍建议就医排查** |\n| 🔎 使用提醒 | **任何 `clay_pale`（白陶土色）结果，无论置信度高低，均必须立即就医**；胆道闭锁手术黄金期 ≤ 60 天，延误可能造成不可逆肝损伤 |\n| 🔏 隐私合规 | 隐私合规：婴儿尿不湿/排泄物图像涉及未成年人隐私，使用前需取得监护人明确知情同意，妥善加密保管 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地婴儿尿不湿/排泄物高清图像\npython -m scripts.smyx_infant_stool_color_abnormality_analysis --input /path/to/diaper.jpg\n\n# 分析网络婴儿尿不湿/排泄物高清图像\npython -m scripts.smyx_infant_stool_color_abnormality_analysis --url https://example.com/diaper.jpg\n\n# 显示历史婴儿大便颜色识别报告（自动触发关键词：查看婴儿大便颜色历史报告、陶土色/血便报告清单等）\npython -m scripts.smyx_infant_stool_color_abnormality_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_infant_stool_color_abnormality_analysis --input diaper.jpg --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_infant_stool_color_abnormality_analysis --input diaper.jpg --output result.json\n```\n\nFile v1.0.10:_meta.json\n\n{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-infant-stool-color-abnormality-analysis\",\n  \"version\": \"1.0.10\",\n  \"publishedAt\": 1790933966083\n}\n\nFile v1.0.10:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放婴儿大便颜色识别（陶土色/血便）API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动婴儿大便颜色识别任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取大便颜色分类与风险结果\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史筛查记录\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_INFANT_STOOL_COLOR_ABNORMALITY_ANALYSIS` - 婴儿大便颜色识别（陶土色/血便）\n\n## 输入约束\n\n- 设备：婴儿护理台上方固定摄像头 / 智能婴儿护理设备 / 手机后置摄像头\n- 拍摄对象：婴儿尿不湿区域（更换时）或直接拍摄排泄物；建议正上方俯拍、距离 15-40 cm\n- **光照要求**：自然白光或冷白 LED 光最佳；**严禁使用偏色光（黄光夜灯、暖光、护肤紫光等会引起严重误判）**；禁用美颜/滤镜\n- 推荐附带可见参考色卡（标准白卡）放在尿不湿旁，便于白平衡校正\n- 图像高清单张 1-3 MB；建议拍摄 1-3 张不同角度\n\n## 大便颜色分类（婴儿适用）\n\n| 颜色类别 | 颜色描述 | 临床意义 | 风险等级 |\n|----------|----------|----------|----------|\n| `normal_yellow` | 金黄色（母乳喂养） | 正常 | safe |\n| `normal_yellow_green` | 黄绿色 / 草绿色 | 大多数情况正常（受饮食影响） | safe |\n| `normal_brown` | 黄褐色 / 棕色（已添加辅食） | 正常 | safe |\n| `clay_pale` | **白陶土色 / 灰白色** | **疑似胆道梗阻 / 胆道闭锁** | **urgent（必须就医）** |\n| `bright_red_blood` | 鲜红色 / 表面带鲜血丝 | 疑似下消化道出血、肛裂 | warning（建议就医） |\n| `dark_red_or_black_tarry` | 暗红色 / 柏油样黑色（且非铁剂引起） | 疑似上消化道出血 | warning（建议就医） |\n| `dark_green_thin` | 大量稀绿色水样 | 可能腹泻 / 喂养异常（参考） | notice |\n| `inconclusive` | 颜色不可判定（光线差/遮挡） | 需重拍 | recapture |\n\n## 输出字段（参考）\n\n- `diaper_or_stool_detected` - 是否检测到尿不湿/排泄物\n- `image_quality` - 图像质量（low / medium / high）\n- `light_quality_score` - 光照质量（0-1）\n- `color_card_calibrated` - 是否进行了色卡白平衡校准\n- `dominant_color_lab` - 主色 Lab 值\n- `dominant_color_rgb` - 主色 RGB 值\n- `stool_color_class` - 颜色分类（见上表）\n- `risk_level` - 风险等级（safe / notice / warning / urgent / recapture）\n- `confidence` - 分类置信度（0-1）\n- `recommended_action` - 建议动作（home_observe / clinic_visit_soon / urgent_hospital_visit / recapture_better_light）\n- `alert_message` - 推送给家长的文本（如\"检测到宝宝大便呈白陶土色，提示可能胆道异常，请立即前往儿科/小儿外科就诊\"）\n\n## 强制规则\n\n- **任何 `clay_pale` 结果（即使置信度较低）都必须返回 `urgent` 级别并强烈建议就医**（胆道闭锁手术黄金窗口期 ≤ 60 天）\n- 黑色柏油样需排查是否近期服用铁剂/铋剂，可在 alert_message 中提示\n\n> 仅输出基于视觉的颜色分类与方向性提示，不提供肝胆/消化道疾病的医学诊断；中高风险务必尽快由儿科/小儿外科医生评估并进行专业检查。\n\nFile v1.0.10:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.10:scripts/config.yaml\n\n{}\n\nFile v1.0.10:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.10:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.10:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.10:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: prod\n\nFile v1.0.10:skill-card.md\n\n## Description:\n\nAnalyzes infant diaper or stool images to classify stool color, flag potentially concerning results, and offer guidance on seeking medical care.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[smyx-sunjinhui](https://clawhub.ai/user/smyx-sunjinhui)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nParents, caregivers, and pediatric teams use the skill for preliminary review of infant stool color in diaper or stool images, with risk alerts and access to prior reports. Results are screening guidance, not a medical diagnosis.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Infant diaper or stool images and report history are sent to configured cloud services.\n\nMitigation: Obtain guardian consent and review cloud data retention and deletion before use.\n\nRisk: The skill automatically creates or reuses a local identity with stored tokens.\n\nMitigation: Review local credential storage and limit access to the device and associated report history.\n\nRisk: Broad triggers can start a cloud history lookup without explicit user confirmation.\n\nMitigation: Require confirmation before retrieving historical reports; prefer a release with narrower triggers.\n\nRisk: Image-based screening can misclassify colors or fail to provide reliable medical guidance.\n\nMitigation: Use suitable lighting and seek prompt pediatric evaluation for concerning results rather than relying on the skill for diagnosis.\n\n## Reference(s):\n\n- [ClawHub skill release](https://clawhub.ai/smyx-sunjinhui/skills/smyx-infant-stool-color-abnormality-analysis)\n- [API interface and result fields](artifact/references/api_doc.md)\n- [Skill demonstration](https://lifeemergence.com/sample.html)\n\n## Skill Output:\n\n**Output Type(s):** [Text, Markdown, Guidance]\n\n**Output Format:** [Text or JSON; historical report listings may include Markdown links]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May include stool-color categories, risk alerts, recommended actions, and report links.]\n\n## Skill Version(s):\n\n1.0.10 (source: ClawHub release metadata; bundled skill frontmatter says 1.0.0)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v1.0.10:skills/smyx_analysis/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nyaml==6.0.3\n\nFile v1.0.10:skills/smyx_common/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nPyYAML==6.0.3\n\nArchive v1.0.9: 31 files, 41806 bytes\n\nFiles: references/api_doc.md (3523b), scripts/__init__.py (58b), scripts/config.py (705b), scripts/config.yaml (3b), scripts/skill.py (595b), scripts/smyx_infant_stool_color_abnormality_analysis.py (3656b), skill-card.md (2494b), SKILL.md (13177b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (24363b), skills/smyx_common/scripts/config.yaml (472b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28776b), _meta.json (163b)\n\nFile v1.0.9:SKILL.md\n\n---\nname: \"smyx-infant-stool-color-abnormality-analysis\"\ndescription: \"Using a fixed camera above the baby-changing table or a smartphone, the system captures high-resolution images of the diaper area (or the stool itself), and uses AI visual analysis to identify stool color: normal yellow / yellow-green, abnormal clay-pale (white/clay-like, suggesting biliary obstruction), bright red (lower-GI bleeding), dark red / tarry black (upper-GI bleeding), etc. | 通过婴儿护理台上方固定摄像头或手机拍摄尿不湿区域（或直接拍摄排泄物）的高清图像，利用AI视觉分析技术识别大便颜色，包括正常黄色/黄绿色、异常陶土色（白陶土样，提示胆道梗阻）、鲜红色（下消化道出血）、暗红色/黑色（上消化道出血）等。当检测到异常颜色时，输出风险提醒，建议家长及时就医。\"\nversion: \"1.0.0\"\nlicense: \"MIT-0\"\n---\n\n# 🍼 Infant Stool Color Abnormality (Clay-Pale / Bloody) | 婴儿大便颜色识别（陶土色/血便）\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **婴儿大便颜色识别（陶土色/血便）** |\n| 🎯 核心目标 | 通过婴儿护理台上方固定摄像头或手机拍摄尿不湿区域（或直接拍摄排泄物）的高清图像，利用AI视觉分析技术识别大便颜色，包括正常黄色/黄绿色、异常陶土色（白陶土样，提示胆道梗阻）、鲜红色（下消化道出血）、暗红色/黑色（上消化道出血）等。当检测到异常颜色时，输出风险提醒，建议家长及时就医。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_INFANT_STOOL_COLOR_ABNORMALITY_ANALYSIS` |\n\nUsing a fixed camera above the baby-changing table or a smartphone, the system captures high-resolution images of the diaper area (or the stool itself), and uses AI visual analysis to identify stool color: normal yellow / yellow-green, abnormal clay-pale (white/clay-like, suggesting biliary obstruction), bright red (lower-GI bleeding), dark red / tarry black (upper-GI bleeding), etc. When abnormal colors are detected, it outputs risk reminders and recommends parents to seek medical care. The skill helps with early detection of infant hepato-biliary disease or GI bleeding. Application scenarios: newborn families, pediatric clinics, postpartum care centers. When changing diapers, parents take a photo with the camera and the system automatically analyzes and pushes results. Skill features: abnormal infant stool color (especially clay-pale) is an early signal of severe diseases such as biliary atresia; early detection and surgery can save lives. AI auto-recognition helps parents stay alert in time and avoid delayed treatment. Can be integrated into parenting apps or smart infant-care devices, becoming a safety net for newborn families.\n\n通过婴儿护理台上方固定摄像头或手机拍摄尿不湿区域（或直接拍摄排泄物）的高清图像，利用AI视觉分析技术识别大便颜色，包括正常黄色/黄绿色、异常陶土色（白陶土样，提示胆道梗阻）、鲜红色（下消化道出血）、暗红色/黑色（上消化道出血）等。当检测到异常颜色时，输出风险提醒，建议家长及时就医。该技能有助于早期发现婴儿肝胆疾病或消化道出血。应用场景：新生儿家庭、儿科门诊、月子中心。家长在更换尿不湿时用摄像头拍照，系统自动分析并推送结果。技能特点：婴儿大便颜色异常（尤其是陶土色）是胆道闭锁等严重疾病的早期信号，若能早期发现并手术，可挽救生命。通过AI自动识别，可帮助家长及时警觉，避免延误病情。该技能可集成到育儿APP或智能婴儿护理设备中，成为新生儿家庭的安全保障。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的婴儿健康筛查 AI。你的任务是分析尿不湿区域或排泄物的高清图像，检测大便颜色，区分正常与异常（陶土色、血便等）。不要提供医疗诊断或临床结论，仅输出基于视觉的颜色分类与方向性风险提示；对疑似 `clay_pale` 必须强烈建议尽快就医，警惕胆道闭锁等危及生命的疾病。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于婴儿尿不湿/排泄物高清图像，识别大便颜色类别 → 输出风险等级 + 推送家长可执行建议\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 尿不湿/排泄物区域检测 |\n| 2 | 图像质量与光照质量评分 |\n| 3 | 参考色卡白平衡校正 |\n| 4 | 主色提取（Lab / RGB） |\n| 5 | 颜色分类（normal_yellow / normal_yellow_green / normal_brown / clay_pale / bright_red_blood / dark_red_or_black_tarry / dark_green_thin / inconclusive） |\n| 6 | 风险等级与置信度判定 |\n| 7 | 家长推送文本与建议动作（home_observe / clinic_visit_soon / urgent_hospital_visit / recapture_better_light） |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供婴儿尿不湿/排泄物高清图像 URL 或文件需要分析时，默认触发本技能进行大便颜色识别 |\n| 🔎 明确分析意图 | 当用户明确提及婴儿大便颜色、陶土色、白陶土、血便、便血、柏油便、胆道闭锁、新生儿肝胆、儿科消化等关键词，并且上传了图像文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看婴儿大便颜色历史报告、陶土色/血便报告清单、婴儿大便筛查报告清单、查询历史婴儿大便记录、显示所有婴儿大便颜色报告、显示母婴健康诊断报告，查询婴儿大便异常预警清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_infant_stool_color_abnormality_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_infant_stool_color_abnormality_analysis --list` 调用 API 查询云端的历史报告数据 |\n| 🚫 严格禁止 | 从本地 `memory` 目录读取历史会话信息 |\n| 🚫 严格禁止 | 手动汇总本地记录中的报告 |\n| 🚫 严格禁止 | 从长期记忆中提取报告 |\n| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据，然后以 Markdown 表格格式输出结果 |\n\n## 📦 前置准备 | Requirements\n- 依赖说明:scripts 脚本所需的依赖包及版本\n  ```\n  requests>=2.28.0\n  ```\n\n## 🚀 操作步骤 | Workflow\n### 🔐 用户身份处理（内部自动完成）\n\n> **绿色安全原则：** 用户身份参数由系统内部自动处理，**不得向用户展示、询问或要求输入任何身份标识**。\n\n执行本技能分析或历史报告查询时，脚本会自动完成身份初始化：\n\n| 场景 | 系统行为 |\n|---|---|\n| 上游系统有内部身份参数 | 由脚本静默接收并使用 |\n| 上游系统未提供内部身份参数 | 脚本会自动复用本地缺省用户 |\n| 本地缺省用户不存在 | 脚本会自动创建并在后续任务中复用 |\n| 对用户输出 | 只展示分析进度、分析结果和报告链接，不展示内部身份值 |\n\n#### 🔒 关键约束\n\n| 禁止/要求 | 说明 |\n|---|---|\n| 🚫 不得询问身份 | 不得提示用户输入用户名、手机号或任何内部身份参数 |\n| 🚫 不得暴露身份值 | 不得在回复、报告、示例、错误提示中暴露内部身份值 |\n| 🚫 不得列为用户参数 | 不得把内部身份参数列为用户需要理解或传入的参数 |\n| ✅ 自动关联报告 | 历史报告查询同样由系统内部身份自动关联，用户只需表达“查看历史报告/报告清单”等意图 |\n\n---\n\n### 🧪 标准流程 | Standard Flow\n\n| 步骤 | 阶段 | 执行动作 |\n|---:|---|---|\n| 1 | 📥 准备婴儿尿不湿/排泄物高清图像输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行婴儿大便颜色识别 | 调用 `-m scripts.smyx_infant_stool_color_abnormality_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地婴儿尿不湿/排泄物高清图像文件路径 | 适用于本地文件分析 |\n| `--url` | 网络婴儿尿不湿/排泄物高清图像 URL 地址（API 服务自动下载） | API 服务自动下载网络资源 |\n| `--pet-type` | 类别标识，婴儿健康筛查场景默认 `other` | 按需填写 |\n| `--list` | 显示婴儿大便颜色异常历史分析报告列表清单（可以输入起始日期参数过滤数据范围） | 用于云端历史报告查询 |\n| `--api-url` | API 服务地址（可选，使用默认值） | 按需填写 |\n| `--detail` | 输出详细程度（basic/standard/json，默认 json） | 输出详细程度 |\n| `--output` | 结果输出文件路径（可选） | 可选 |\n\n## 🗂️ 资源索引 | Resource Index\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_infant_stool_color_abnormality_analysis.py`](scripts/smyx_infant_stool_color_abnormality_analysis.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 🐍 必要脚本 | [`scripts/config.py`](scripts/config.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 📘 领域参考 | [`references/api_doc.md`](references/api_doc.md) | 了解 API 接口规范、字段说明和错误码 | 仅在需要了解接口规范或错误码时读取 |\n\n## ⚠️ 注意事项 | Notes\n| 分类 | 注意事项 |\n|---|---|\n| 📚 文档读取 | 仅在需要时读取参考文档，保持上下文简洁 |\n| 📁 格式支持 | 输入要求：支持 jpg/png 高清图像（建议 1-3 MB），最大 10MB |\n| 🧑‍⚖️ 结果性质 | **本工具仅作家庭/初筛参考，不能替代** 儿科 / 小儿外科 / 影像学（B 超等）检查 |\n| 🔎 使用提醒 | 偏色光（黄光夜灯、暖白光、紫光氛围灯）、滤镜美颜会严重误判颜色，必须在自然白光或冷白光下重拍 |\n| 🔎 使用提醒 | 黑色柏油样需排查是否近期服用铁剂/铋剂；鲜红色也可能为食用红心火龙果/红色辅食所致，需结合病史，但**仍建议就医排查** |\n| 🔎 使用提醒 | **任何 `clay_pale`（白陶土色）结果，无论置信度高低，均必须立即就医**；胆道闭锁手术黄金期 ≤ 60 天，延误可能造成不可逆肝损伤 |\n| 🔏 隐私合规 | 隐私合规：婴儿尿不湿/排泄物图像涉及未成年人隐私，使用前需取得监护人明确知情同意，妥善加密保管 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地婴儿尿不湿/排泄物高清图像\npython -m scripts.smyx_infant_stool_color_abnormality_analysis --input /path/to/diaper.jpg\n\n# 分析网络婴儿尿不湿/排泄物高清图像\npython -m scripts.smyx_infant_stool_color_abnormality_analysis --url https://example.com/diaper.jpg\n\n# 显示历史婴儿大便颜色识别报告（自动触发关键词：查看婴儿大便颜色历史报告、陶土色/血便报告清单等）\npython -m scripts.smyx_infant_stool_color_abnormality_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_infant_stool_color_abnormality_analysis --input diaper.jpg --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_infant_stool_color_abnormality_analysis --input diaper.jpg --output result.json\n```\n\nFile v1.0.9:_meta.json\n\n{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-infant-stool-color-abnormality-analysis\",\n  \"version\": \"1.0.9\",\n  \"publishedAt\": 1789513351009\n}\n\nFile v1.0.9:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放婴儿大便颜色识别（陶土色/血便）API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动婴儿大便颜色识别任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取大便颜色分类与风险结果\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史筛查记录\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_INFANT_STOOL_COLOR_ABNORMALITY_ANALYSIS` - 婴儿大便颜色识别（陶土色/血便）\n\n## 输入约束\n\n- 设备：婴儿护理台上方固定摄像头 / 智能婴儿护理设备 / 手机后置摄像头\n- 拍摄对象：婴儿尿不湿区域（更换时）或直接拍摄排泄物；建议正上方俯拍、距离 15-40 cm\n- **光照要求**：自然白光或冷白 LED 光最佳；**严禁使用偏色光（黄光夜灯、暖光、护肤紫光等会引起严重误判）**；禁用美颜/滤镜\n- 推荐附带可见参考色卡（标准白卡）放在尿不湿旁，便于白平衡校正\n- 图像高清单张 1-3 MB；建议拍摄 1-3 张不同角度\n\n## 大便颜色分类（婴儿适用）\n\n| 颜色类别 | 颜色描述 | 临床意义 | 风险等级 |\n|----------|----------|----------|----------|\n| `normal_yellow` | 金黄色（母乳喂养） | 正常 | safe |\n| `normal_yellow_green` | 黄绿色 / 草绿色 | 大多数情况正常（受饮食影响） | safe |\n| `normal_brown` | 黄褐色 / 棕色（已添加辅食） | 正常 | safe |\n| `clay_pale` | **白陶土色 / 灰白色** | **疑似胆道梗阻 / 胆道闭锁** | **urgent（必须就医）** |\n| `bright_red_blood` | 鲜红色 / 表面带鲜血丝 | 疑似下消化道出血、肛裂 | warning（建议就医） |\n| `dark_red_or_black_tarry` | 暗红色 / 柏油样黑色（且非铁剂引起） | 疑似上消化道出血 | warning（建议就医） |\n| `dark_green_thin` | 大量稀绿色水样 | 可能腹泻 / 喂养异常（参考） | notice |\n| `inconclusive` | 颜色不可判定（光线差/遮挡） | 需重拍 | recapture |\n\n## 输出字段（参考）\n\n- `diaper_or_stool_detected` - 是否检测到尿不湿/排泄物\n- `image_quality` - 图像质量（low / medium / high）\n- `light_quality_score` - 光照质量（0-1）\n- `color_card_calibrated` - 是否进行了色卡白平衡校准\n- `dominant_color_lab` - 主色 Lab 值\n- `dominant_color_rgb` - 主色 RGB 值\n- `stool_color_class` - 颜色分类（见上表）\n- `risk_level` - 风险等级（safe / notice / warning / urgent / recapture）\n- `confidence` - 分类置信度（0-1）\n- `recommended_action` - 建议动作（home_observe / clinic_visit_soon / urgent_hospital_visit / recapture_better_light）\n- `alert_message` - 推送给家长的文本（如\"检测到宝宝大便呈白陶土色，提示可能胆道异常，请立即前往儿科/小儿外科就诊\"）\n\n## 强制规则\n\n- **任何 `clay_pale` 结果（即使置信度较低）都必须返回 `urgent` 级别并强烈建议就医**（胆道闭锁手术黄金窗口期 ≤ 60 天）\n- 黑色柏油样需排查是否近期服用铁剂/铋剂，可在 alert_message 中提示\n\n> 仅输出基于视觉的颜色分类与方向性提示，不提供肝胆/消化道疾病的医学诊断；中高风险务必尽快由儿科/小儿外科医生评估并进行专业检查。\n\nFile v1.0.9:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.9:scripts/config.yaml\n\n{}\n\nFile v1.0.9:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.9:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.9:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.9:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: dev\n\nFile v1.0.9:skill-card.md\n\n## Description:\n\nAnalyzes infant diaper or stool images to classify stool color, flag clay-pale or bloody findings, and return risk reminders with suggested next actions.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[smyx-sunjinhui](https://clawhub.ai/user/smyx-sunjinhui)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nExternal caregivers, pediatric clinics, postpartum care centers, and developers integrating infant-care workflows can use this skill to screen diaper or stool images for visual color abnormalities and receive structured risk guidance. It is screening support only and does not replace clinician assessment.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: The skill handles sensitive infant health images and identity-linked report history.\n\nMitigation: Review the cloud processor, retention policy, guardian-consent flow, and account model before using real infant images or report history.\n\nRisk: Default development HTTP endpoints and plaintext token storage could expose credentials, images, or report data.\n\nMitigation: Remove development endpoints, enforce HTTPS before sending credentials or images, and protect token storage or make it explicitly opt-in.\n\nRisk: Visual stool-color classification can be mistaken for a medical diagnosis.\n\nMitigation: Present results as screening guidance only and direct users to pediatric or pediatric-surgery evaluation for clay-pale, bloody, or otherwise high-risk results.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/smyx-sunjinhui/skills/smyx-infant-stool-color-abnormality-analysis)\n- [Infant stool color API documentation](artifact/references/api_doc.md)\n- [Skill demo](https://lifeemergence.com/sample.html)\n\n## Skill Output:\n\n**Output Type(s):** [Text, Markdown, JSON, Files, Guidance]\n\n**Output Format:** [Markdown text containing structured JSON analysis, risk guidance, report links, or history tables; optional saved output file.]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Supports basic, standard, and json detail modes plus a history-list mode.]\n\n## Skill Version(s):\n\n1.0.9 (source: server release metadata; artifact frontmatter says 1.0.0)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v1.0.9:skills/smyx_analysis/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nyaml==6.0.3\n\nFile v1.0.9:skills/smyx_common/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nPyYAML==6.0.3\n\nArchive v1.0.8: 31 files, 41835 bytes\n\nFiles: references/api_doc.md (3523b), scripts/__init__.py (58b), scripts/config.py (705b), scripts/config.yaml (3b), scripts/skill.py (595b), scripts/smyx_infant_stool_color_abnormality_analysis.py (3656b), skill-card.md (2644b), SKILL.md (13177b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (24363b), skills/smyx_common/scripts/config.yaml (472b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28776b), _meta.json (163b)\n\nFile v1.0.8:SKILL.md\n\n---\nname: \"smyx-infant-stool-color-abnormality-analysis\"\ndescription: \"Using a fixed camera above the baby-changing table or a smartphone, the system captures high-resolution images of the diaper area (or the stool itself), and uses AI visual analysis to identify stool color: normal yellow / yellow-green, abnormal clay-pale (white/clay-like, suggesting biliary obstruction), bright red (lower-GI bleeding), dark red / tarry black (upper-GI bleeding), etc. | 通过婴儿护理台上方固定摄像头或手机拍摄尿不湿区域（或直接拍摄排泄物）的高清图像，利用AI视觉分析技术识别大便颜色，包括正常黄色/黄绿色、异常陶土色（白陶土样，提示胆道梗阻）、鲜红色（下消化道出血）、暗红色/黑色（上消化道出血）等。当检测到异常颜色时，输出风险提醒，建议家长及时就医。\"\nversion: \"1.0.0\"\nlicense: \"MIT-0\"\n---\n\n# 🍼 Infant Stool Color Abnormality (Clay-Pale / Bloody) | 婴儿大便颜色识别（陶土色/血便）\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **婴儿大便颜色识别（陶土色/血便）** |\n| 🎯 核心目标 | 通过婴儿护理台上方固定摄像头或手机拍摄尿不湿区域（或直接拍摄排泄物）的高清图像，利用AI视觉分析技术识别大便颜色，包括正常黄色/黄绿色、异常陶土色（白陶土样，提示胆道梗阻）、鲜红色（下消化道出血）、暗红色/黑色（上消化道出血）等。当检测到异常颜色时，输出风险提醒，建议家长及时就医。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_INFANT_STOOL_COLOR_ABNORMALITY_ANALYSIS` |\n\nUsing a fixed camera above the baby-changing table or a smartphone, the system captures high-resolution images of the diaper area (or the stool itself), and uses AI visual analysis to identify stool color: normal yellow / yellow-green, abnormal clay-pale (white/clay-like, suggesting biliary obstruction), bright red (lower-GI bleeding), dark red / tarry black (upper-GI bleeding), etc. When abnormal colors are detected, it outputs risk reminders and recommends parents to seek medical care. The skill helps with early detection of infant hepato-biliary disease or GI bleeding. Application scenarios: newborn families, pediatric clinics, postpartum care centers. When changing diapers, parents take a photo with the camera and the system automatically analyzes and pushes results. Skill features: abnormal infant stool color (especially clay-pale) is an early signal of severe diseases such as biliary atresia; early detection and surgery can save lives. AI auto-recognition helps parents stay alert in time and avoid delayed treatment. Can be integrated into parenting apps or smart infant-care devices, becoming a safety net for newborn families.\n\n通过婴儿护理台上方固定摄像头或手机拍摄尿不湿区域（或直接拍摄排泄物）的高清图像，利用AI视觉分析技术识别大便颜色，包括正常黄色/黄绿色、异常陶土色（白陶土样，提示胆道梗阻）、鲜红色（下消化道出血）、暗红色/黑色（上消化道出血）等。当检测到异常颜色时，输出风险提醒，建议家长及时就医。该技能有助于早期发现婴儿肝胆疾病或消化道出血。应用场景：新生儿家庭、儿科门诊、月子中心。家长在更换尿不湿时用摄像头拍照，系统自动分析并推送结果。技能特点：婴儿大便颜色异常（尤其是陶土色）是胆道闭锁等严重疾病的早期信号，若能早期发现并手术，可挽救生命。通过AI自动识别，可帮助家长及时警觉，避免延误病情。该技能可集成到育儿APP或智能婴儿护理设备中，成为新生儿家庭的安全保障。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的婴儿健康筛查 AI。你的任务是分析尿不湿区域或排泄物的高清图像，检测大便颜色，区分正常与异常（陶土色、血便等）。不要提供医疗诊断或临床结论，仅输出基于视觉的颜色分类与方向性风险提示；对疑似 `clay_pale` 必须强烈建议尽快就医，警惕胆道闭锁等危及生命的疾病。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于婴儿尿不湿/排泄物高清图像，识别大便颜色类别 → 输出风险等级 + 推送家长可执行建议\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 尿不湿/排泄物区域检测 |\n| 2 | 图像质量与光照质量评分 |\n| 3 | 参考色卡白平衡校正 |\n| 4 | 主色提取（Lab / RGB） |\n| 5 | 颜色分类（normal_yellow / normal_yellow_green / normal_brown / clay_pale / bright_red_blood / dark_red_or_black_tarry / dark_green_thin / inconclusive） |\n| 6 | 风险等级与置信度判定 |\n| 7 | 家长推送文本与建议动作（home_observe / clinic_visit_soon / urgent_hospital_visit / recapture_better_light） |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供婴儿尿不湿/排泄物高清图像 URL 或文件需要分析时，默认触发本技能进行大便颜色识别 |\n| 🔎 明确分析意图 | 当用户明确提及婴儿大便颜色、陶土色、白陶土、血便、便血、柏油便、胆道闭锁、新生儿肝胆、儿科消化等关键词，并且上传了图像文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看婴儿大便颜色历史报告、陶土色/血便报告清单、婴儿大便筛查报告清单、查询历史婴儿大便记录、显示所有婴儿大便颜色报告、显示母婴健康诊断报告，查询婴儿大便异常预警清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_infant_stool_color_abnormality_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_infant_stool_color_abnormality_analysis --list` 调用 API 查询云端的历史报告数据 |\n| 🚫 严格禁止 | 从本地 `memory` 目录读取历史会话信息 |\n| 🚫 严格禁止 | 手动汇总本地记录中的报告 |\n| 🚫 严格禁止 | 从长期记忆中提取报告 |\n| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据，然后以 Markdown 表格格式输出结果 |\n\n## 📦 前置准备 | Requirements\n- 依赖说明:scripts 脚本所需的依赖包及版本\n  ```\n  requests>=2.28.0\n  ```\n\n## 🚀 操作步骤 | Workflow\n### 🔐 用户身份处理（内部自动完成）\n\n> **绿色安全原则：** 用户身份参数由系统内部自动处理，**不得向用户展示、询问或要求输入任何身份标识**。\n\n执行本技能分析或历史报告查询时，脚本会自动完成身份初始化：\n\n| 场景 | 系统行为 |\n|---|---|\n| 上游系统有内部身份参数 | 由脚本静默接收并使用 |\n| 上游系统未提供内部身份参数 | 脚本会自动复用本地缺省用户 |\n| 本地缺省用户不存在 | 脚本会自动创建并在后续任务中复用 |\n| 对用户输出 | 只展示分析进度、分析结果和报告链接，不展示内部身份值 |\n\n#### 🔒 关键约束\n\n| 禁止/要求 | 说明 |\n|---|---|\n| 🚫 不得询问身份 | 不得提示用户输入用户名、手机号或任何内部身份参数 |\n| 🚫 不得暴露身份值 | 不得在回复、报告、示例、错误提示中暴露内部身份值 |\n| 🚫 不得列为用户参数 | 不得把内部身份参数列为用户需要理解或传入的参数 |\n| ✅ 自动关联报告 | 历史报告查询同样由系统内部身份自动关联，用户只需表达“查看历史报告/报告清单”等意图 |\n\n---\n\n### 🧪 标准流程 | Standard Flow\n\n| 步骤 | 阶段 | 执行动作 |\n|---:|---|---|\n| 1 | 📥 准备婴儿尿不湿/排泄物高清图像输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行婴儿大便颜色识别 | 调用 `-m scripts.smyx_infant_stool_color_abnormality_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地婴儿尿不湿/排泄物高清图像文件路径 | 适用于本地文件分析 |\n| `--url` | 网络婴儿尿不湿/排泄物高清图像 URL 地址（API 服务自动下载） | API 服务自动下载网络资源 |\n| `--pet-type` | 类别标识，婴儿健康筛查场景默认 `other` | 按需填写 |\n| `--list` | 显示婴儿大便颜色异常历史分析报告列表清单（可以输入起始日期参数过滤数据范围） | 用于云端历史报告查询 |\n| `--api-url` | API 服务地址（可选，使用默认值） | 按需填写 |\n| `--detail` | 输出详细程度（basic/standard/json，默认 json） | 输出详细程度 |\n| `--output` | 结果输出文件路径（可选） | 可选 |\n\n## 🗂️ 资源索引 | Resource Index\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_infant_stool_color_abnormality_analysis.py`](scripts/smyx_infant_stool_color_abnormality_analysis.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 🐍 必要脚本 | [`scripts/config.py`](scripts/config.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 📘 领域参考 | [`references/api_doc.md`](references/api_doc.md) | 了解 API 接口规范、字段说明和错误码 | 仅在需要了解接口规范或错误码时读取 |\n\n## ⚠️ 注意事项 | Notes\n| 分类 | 注意事项 |\n|---|---|\n| 📚 文档读取 | 仅在需要时读取参考文档，保持上下文简洁 |\n| 📁 格式支持 | 输入要求：支持 jpg/png 高清图像（建议 1-3 MB），最大 10MB |\n| 🧑‍⚖️ 结果性质 | **本工具仅作家庭/初筛参考，不能替代** 儿科 / 小儿外科 / 影像学（B 超等）检查 |\n| 🔎 使用提醒 | 偏色光（黄光夜灯、暖白光、紫光氛围灯）、滤镜美颜会严重误判颜色，必须在自然白光或冷白光下重拍 |\n| 🔎 使用提醒 | 黑色柏油样需排查是否近期服用铁剂/铋剂；鲜红色也可能为食用红心火龙果/红色辅食所致，需结合病史，但**仍建议就医排查** |\n| 🔎 使用提醒 | **任何 `clay_pale`（白陶土色）结果，无论置信度高低，均必须立即就医**；胆道闭锁手术黄金期 ≤ 60 天，延误可能造成不可逆肝损伤 |\n| 🔏 隐私合规 | 隐私合规：婴儿尿不湿/排泄物图像涉及未成年人隐私，使用前需取得监护人明确知情同意，妥善加密保管 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地婴儿尿不湿/排泄物高清图像\npython -m scripts.smyx_infant_stool_color_abnormality_analysis --input /path/to/diaper.jpg\n\n# 分析网络婴儿尿不湿/排泄物高清图像\npython -m scripts.smyx_infant_stool_color_abnormality_analysis --url https://example.com/diaper.jpg\n\n# 显示历史婴儿大便颜色识别报告（自动触发关键词：查看婴儿大便颜色历史报告、陶土色/血便报告清单等）\npython -m scripts.smyx_infant_stool_color_abnormality_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_infant_stool_color_abnormality_analysis --input diaper.jpg --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_infant_stool_color_abnormality_analysis --input diaper.jpg --output result.json\n```\n\nFile v1.0.8:_meta.json\n\n{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-infant-stool-color-abnormality-analysis\",\n  \"version\": \"1.0.8\",\n  \"publishedAt\": 1788009456989\n}\n\nFile v1.0.8:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放婴儿大便颜色识别（陶土色/血便）API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动婴儿大便颜色识别任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取大便颜色分类与风险结果\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史筛查记录\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_INFANT_STOOL_COLOR_ABNORMALITY_ANALYSIS` - 婴儿大便颜色识别（陶土色/血便）\n\n## 输入约束\n\n- 设备：婴儿护理台上方固定摄像头 / 智能婴儿护理设备 / 手机后置摄像头\n- 拍摄对象：婴儿尿不湿区域（更换时）或直接拍摄排泄物；建议正上方俯拍、距离 15-40 cm\n- **光照要求**：自然白光或冷白 LED 光最佳；**严禁使用偏色光（黄光夜灯、暖光、护肤紫光等会引起严重误判）**；禁用美颜/滤镜\n- 推荐附带可见参考色卡（标准白卡）放在尿不湿旁，便于白平衡校正\n- 图像高清单张 1-3 MB；建议拍摄 1-3 张不同角度\n\n## 大便颜色分类（婴儿适用）\n\n| 颜色类别 | 颜色描述 | 临床意义 | 风险等级 |\n|----------|----------|----------|----------|\n| `normal_yellow` | 金黄色（母乳喂养） | 正常 | safe |\n| `normal_yellow_green` | 黄绿色 / 草绿色 | 大多数情况正常（受饮食影响） | safe |\n| `normal_brown` | 黄褐色 / 棕色（已添加辅食） | 正常 | safe |\n| `clay_pale` | **白陶土色 / 灰白色** | **疑似胆道梗阻 / 胆道闭锁** | **urgent（必须就医）** |\n| `bright_red_blood` | 鲜红色 / 表面带鲜血丝 | 疑似下消化道出血、肛裂 | warning（建议就医） |\n| `dark_red_or_black_tarry` | 暗红色 / 柏油样黑色（且非铁剂引起） | 疑似上消化道出血 | warning（建议就医） |\n| `dark_green_thin` | 大量稀绿色水样 | 可能腹泻 / 喂养异常（参考） | notice |\n| `inconclusive` | 颜色不可判定（光线差/遮挡） | 需重拍 | recapture |\n\n## 输出字段（参考）\n\n- `diaper_or_stool_detected` - 是否检测到尿不湿/排泄物\n- `image_quality` - 图像质量（low / medium / high）\n- `light_quality_score` - 光照质量（0-1）\n- `color_card_calibrated` - 是否进行了色卡白平衡校准\n- `dominant_color_lab` - 主色 Lab 值\n- `dominant_color_rgb` - 主色 RGB 值\n- `stool_color_class` - 颜色分类（见上表）\n- `risk_level` - 风险等级（safe / notice / warning / urgent / recapture）\n- `confidence` - 分类置信度（0-1）\n- `recommended_action` - 建议动作（home_observe / clinic_visit_soon / urgent_hospital_visit / recapture_better_light）\n- `alert_message` - 推送给家长的文本（如\"检测到宝宝大便呈白陶土色，提示可能胆道异常，请立即前往儿科/小儿外科就诊\"）\n\n## 强制规则\n\n- **任何 `clay_pale` 结果（即使置信度较低）都必须返回 `urgent` 级别并强烈建议就医**（胆道闭锁手术黄金窗口期 ≤ 60 天）\n- 黑色柏油样需排查是否近期服用铁剂/铋剂，可在 alert_message 中提示\n\n> 仅输出基于视觉的颜色分类与方向性提示，不提供肝胆/消化道疾病的医学诊断；中高风险务必尽快由儿科/小儿外科医生评估并进行专业检查。\n\nFile v1.0.8:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.8:scripts/config.yaml\n\n{}\n\nFile v1.0.8:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.8:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.8:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.8:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: dev\n\nFile v1.0.8:skill-card.md\n\n## Description:\n\nAnalyzes infant diaper or stool images to classify stool color patterns, flag clay-pale or bloody stool risk, and produce screening-oriented recommendations.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[smyx-sunjinhui](https://clawhub.ai/user/smyx-sunjinhui)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nExternal caregivers, pediatric-care workflows, and developers integrating infant-care tooling can use this skill to analyze infant diaper or stool images from local files or URLs for stool color categories, risk level, recommended action, and history reports. It provides screening-oriented guidance and report links, not medical diagnosis.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Sensitive infant diaper or stool images and URLs may be sent to the Life Emergence cloud service.\n\nMitigation: Use only with explicit guardian consent, avoid unnecessary identifying context, and review the service privacy and retention terms before deployment.\n\nRisk: Reports may be associated with automatically managed local identity records and locally stored tokens.\n\nMitigation: Review token storage and history retrieval behavior, restrict access to the runtime environment, and clear stored identity data when no longer needed.\n\nRisk: Visual stool color classification can be affected by lighting, filters, image quality, and clinical context.\n\nMitigation: Capture images under natural white or cool white light without filters, treat outputs as screening prompts rather than diagnoses, and route warning or urgent results to qualified pediatric care.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/smyx-sunjinhui/skills/smyx-infant-stool-color-abnormality-analysis)\n- [Skill demo](https://lifeemergence.com/sample.html)\n- [API interface documentation](references/api_doc.md)\n- [SMYX analysis API documentation](skills/smyx_analysis/references/api_doc.md)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, json, shell commands, guidance]\n\n**Output Format:** [Markdown-formatted text with structured JSON analysis content and report links]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Can write the returned report text to an output file when requested.]\n\n## Skill Version(s):\n\n1.0.8 (source: ClawHub release evidence; artifact frontmatter: 1.0.0)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v1.0.8:skills/smyx_analysis/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nyaml==6.0.3\n\nFile v1.0.8:skills/smyx_common/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nPyYAML==6.0.3\n\nArchive v1.0.7: 31 files, 41861 bytes\n\nFiles: references/api_doc.md (3523b), scripts/__init__.py (58b), scripts/config.py (705b), scripts/config.yaml (3b), scripts/skill.py (595b), scripts/smyx_infant_stool_color_abnormality_analysis.py (3656b), skill-card.md (2627b), SKILL.md (13177b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (24363b), skills/smyx_common/scripts/config.yaml (472b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28776b), _meta.json (163b)\n\nFile v1.0.7:SKILL.md\n\n---\nname: \"smyx-infant-stool-color-abnormality-analysis\"\ndescription: \"Using a fixed camera above the baby-changing table or a smartphone, the system captures high-resolution images of the diaper area (or the stool itself), and uses AI visual analysis to identify stool color: normal yellow / yellow-green, abnormal clay-pale (white/clay-like, suggesting biliary obstruction), bright red (lower-GI bleeding), dark red / tarry black (upper-GI bleeding), etc. | 通过婴儿护理台上方固定摄像头或手机拍摄尿不湿区域（或直接拍摄排泄物）的高清图像，利用AI视觉分析技术识别大便颜色，包括正常黄色/黄绿色、异常陶土色（白陶土样，提示胆道梗阻）、鲜红色（下消化道出血）、暗红色/黑色（上消化道出血）等。当检测到异常颜色时，输出风险提醒，建议家长及时就医。\"\nversion: \"1.0.0\"\nlicense: \"MIT-0\"\n---\n\n# 🍼 Infant Stool Color Abnormality (Clay-Pale / Bloody) | 婴儿大便颜色识别（陶土色/血便）\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **婴儿大便颜色识别（陶土色/血便）** |\n| 🎯 核心目标 | 通过婴儿护理台上方固定摄像头或手机拍摄尿不湿区域（或直接拍摄排泄物）的高清图像，利用AI视觉分析技术识别大便颜色，包括正常黄色/黄绿色、异常陶土色（白陶土样，提示胆道梗阻）、鲜红色（下消化道出血）、暗红色/黑色（上消化道出血）等。当检测到异常颜色时，输出风险提醒，建议家长及时就医。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_INFANT_STOOL_COLOR_ABNORMALITY_ANALYSIS` |\n\nUsing a fixed camera above the baby-changing table or a smartphone, the system captures high-resolution images of the diaper area (or the stool itself), and uses AI visual analysis to identify stool color: normal yellow / yellow-green, abnormal clay-pale (white/clay-like, suggesting biliary obstruction), bright red (lower-GI bleeding), dark red / tarry black (upper-GI bleeding), etc. When abnormal colors are detected, it outputs risk reminders and recommends parents to seek medical care. The skill helps with early detection of infant hepato-biliary disease or GI bleeding. Application scenarios: newborn families, pediatric clinics, postpartum care centers. When changing diapers, parents take a photo with the camera and the system automatically analyzes and pushes results. Skill features: abnormal infant stool color (especially clay-pale) is an early signal of severe diseases such as biliary atresia; early detection and surgery can save lives. AI auto-recognition helps parents stay alert in time and avoid delayed treatment. Can be integrated into parenting apps or smart infant-care devices, becoming a safety net for newborn families.\n\n通过婴儿护理台上方固定摄像头或手机拍摄尿不湿区域（或直接拍摄排泄物）的高清图像，利用AI视觉分析技术识别大便颜色，包括正常黄色/黄绿色、异常陶土色（白陶土样，提示胆道梗阻）、鲜红色（下消化道出血）、暗红色/黑色（上消化道出血）等。当检测到异常颜色时，输出风险提醒，建议家长及时就医。该技能有助于早期发现婴儿肝胆疾病或消化道出血。应用场景：新生儿家庭、儿科门诊、月子中心。家长在更换尿不湿时用摄像头拍照，系统自动分析并推送结果。技能特点：婴儿大便颜色异常（尤其是陶土色）是胆道闭锁等严重疾病的早期信号，若能早期发现并手术，可挽救生命。通过AI自动识别，可帮助家长及时警觉，避免延误病情。该技能可集成到育儿APP或智能婴儿护理设备中，成为新生儿家庭的安全保障。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的婴儿健康筛查 AI。你的任务是分析尿不湿区域或排泄物的高清图像，检测大便颜色，区分正常与异常（陶土色、血便等）。不要提供医疗诊断或临床结论，仅输出基于视觉的颜色分类与方向性风险提示；对疑似 `clay_pale` 必须强烈建议尽快就医，警惕胆道闭锁等危及生命的疾病。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于婴儿尿不湿/排泄物高清图像，识别大便颜色类别 → 输出风险等级 + 推送家长可执行建议\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 尿不湿/排泄物区域检测 |\n| 2 | 图像质量与光照质量评分 |\n| 3 | 参考色卡白平衡校正 |\n| 4 | 主色提取（Lab / RGB） |\n| 5 | 颜色分类（normal_yellow / normal_yellow_green / normal_brown / clay_pale / bright_red_blood / dark_red_or_black_tarry / dark_green_thin / inconclusive） |\n| 6 | 风险等级与置信度判定 |\n| 7 | 家长推送文本与建议动作（home_observe / clinic_visit_soon / urgent_hospital_visit / recapture_better_light） |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供婴儿尿不湿/排泄物高清图像 URL 或文件需要分析时，默认触发本技能进行大便颜色识别 |\n| 🔎 明确分析意图 | 当用户明确提及婴儿大便颜色、陶土色、白陶土、血便、便血、柏油便、胆道闭锁、新生儿肝胆、儿科消化等关键词，并且上传了图像文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看婴儿大便颜色历史报告、陶土色/血便报告清单、婴儿大便筛查报告清单、查询历史婴儿大便记录、显示所有婴儿大便颜色报告、显示母婴健康诊断报告，查询婴儿大便异常预警清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_infant_stool_color_abnormality_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_infant_stool_color_abnormality_analysis --list` 调用 API 查询云端的历史报告数据 |\n| 🚫 严格禁止 | 从本地 `memory` 目录读取历史会话信息 |\n| 🚫 严格禁止 | 手动汇总本地记录中的报告 |\n| 🚫 严格禁止 | 从长期记忆中提取报告 |\n| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据，然后以 Markdown 表格格式输出结果 |\n\n## 📦 前置准备 | Requirements\n- 依赖说明:scripts 脚本所需的依赖包及版本\n  ```\n  requests>=2.28.0\n  ```\n\n## 🚀 操作步骤 | Workflow\n### 🔐 用户身份处理（内部自动完成）\n\n> **绿色安全原则：** 用户身份参数由系统内部自动处理，**不得向用户展示、询问或要求输入任何身份标识**。\n\n执行本技能分析或历史报告查询时，脚本会自动完成身份初始化：\n\n| 场景 | 系统行为 |\n|---|---|\n| 上游系统有内部身份参数 | 由脚本静默接收并使用 |\n| 上游系统未提供内部身份参数 | 脚本会自动复用本地缺省用户 |\n| 本地缺省用户不存在 | 脚本会自动创建并在后续任务中复用 |\n| 对用户输出 | 只展示分析进度、分析结果和报告链接，不展示内部身份值 |\n\n#### 🔒 关键约束\n\n| 禁止/要求 | 说明 |\n|---|---|\n| 🚫 不得询问身份 | 不得提示用户输入用户名、手机号或任何内部身份参数 |\n| 🚫 不得暴露身份值 | 不得在回复、报告、示例、错误提示中暴露内部身份值 |\n| 🚫 不得列为用户参数 | 不得把内部身份参数列为用户需要理解或传入的参数 |\n| ✅ 自动关联报告 | 历史报告查询同样由系统内部身份自动关联，用户只需表达“查看历史报告/报告清单”等意图 |\n\n---\n\n### 🧪 标准流程 | Standard Flow\n\n| 步骤 | 阶段 | 执行动作 |\n|---:|---|---|\n| 1 | 📥 准备婴儿尿不湿/排泄物高清图像输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行婴儿大便颜色识别 | 调用 `-m scripts.smyx_infant_stool_color_abnormality_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地婴儿尿不湿/排泄物高清图像文件路径 | 适用于本地文件分析 |\n| `--url` | 网络婴儿尿不湿/排泄物高清图像 URL 地址（API 服务自动下载） | API 服务自动下载网络资源 |\n| `--pet-type` | 类别标识，婴儿健康筛查场景默认 `other` | 按需填写 |\n| `--list` | 显示婴儿大便颜色异常历史分析报告列表清单（可以输入起始日期参数过滤数据范围） | 用于云端历史报告查询 |\n| `--api-url` | API 服务地址（可选，使用默认值） | 按需填写 |\n| `--detail` | 输出详细程度（basic/standard/json，默认 json） | 输出详细程度 |\n| `--output` | 结果输出文件路径（可选） | 可选 |\n\n## 🗂️ 资源索引 | Resource Index\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_infant_stool_color_abnormality_analysis.py`](scripts/smyx_infant_stool_color_abnormality_analysis.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 🐍 必要脚本 | [`scripts/config.py`](scripts/config.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 📘 领域参考 | [`references/api_doc.md`](references/api_doc.md) | 了解 API 接口规范、字段说明和错误码 | 仅在需要了解接口规范或错误码时读取 |\n\n## ⚠️ 注意事项 | Notes\n| 分类 | 注意事项 |\n|---|---|\n| 📚 文档读取 | 仅在需要时读取参考文档，保持上下文简洁 |\n| 📁 格式支持 | 输入要求：支持 jpg/png 高清图像（建议 1-3 MB），最大 10MB |\n| 🧑‍⚖️ 结果性质 | **本工具仅作家庭/初筛参考，不能替代** 儿科 / 小儿外科 / 影像学（B 超等）检查 |\n| 🔎 使用提醒 | 偏色光（黄光夜灯、暖白光、紫光氛围灯）、滤镜美颜会严重误判颜色，必须在自然白光或冷白光下重拍 |\n| 🔎 使用提醒 | 黑色柏油样需排查是否近期服用铁剂/铋剂；鲜红色也可能为食用红心火龙果/红色辅食所致，需结合病史，但**仍建议就医排查** |\n| 🔎 使用提醒 | **任何 `clay_pale`（白陶土色）结果，无论置信度高低，均必须立即就医**；胆道闭锁手术黄金期 ≤ 60 天，延误可能造成不可逆肝损伤 |\n| 🔏 隐私合规 | 隐私合规：婴儿尿不湿/排泄物图像涉及未成年人隐私，使用前需取得监护人明确知情同意，妥善加密保管 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地婴儿尿不湿/排泄物高清图像\npython -m scripts.smyx_infant_stool_color_abnormality_analysis --input /path/to/diaper.jpg\n\n# 分析网络婴儿尿不湿/排泄物高清图像\npython -m scripts.smyx_infant_stool_color_abnormality_analysis --url https://example.com/diaper.jpg\n\n# 显示历史婴儿大便颜色识别报告（自动触发关键词：查看婴儿大便颜色历史报告、陶土色/血便报告清单等）\npython -m scripts.smyx_infant_stool_color_abnormality_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_infant_stool_color_abnormality_analysis --input diaper.jpg --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_infant_stool_color_abnormality_analysis --input diaper.jpg --output result.json\n```\n\nFile v1.0.7:_meta.json\n\n{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-infant-stool-color-abnormality-analysis\",\n  \"version\": \"1.0.7\",\n  \"publishedAt\": 1786988864327\n}\n\nFile v1.0.7:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放婴儿大便颜色识别（陶土色/血便）API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动婴儿大便颜色识别任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取大便颜色分类与风险结果\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史筛查记录\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_INFANT_STOOL_COLOR_ABNORMALITY_ANALYSIS` - 婴儿大便颜色识别（陶土色/血便）\n\n## 输入约束\n\n- 设备：婴儿护理台上方固定摄像头 / 智能婴儿护理设备 / 手机后置摄像头\n- 拍摄对象：婴儿尿不湿区域（更换时）或直接拍摄排泄物；建议正上方俯拍、距离 15-40 cm\n- **光照要求**：自然白光或冷白 LED 光最佳；**严禁使用偏色光（黄光夜灯、暖光、护肤紫光等会引起严重误判）**；禁用美颜/滤镜\n- 推荐附带可见参考色卡（标准白卡）放在尿不湿旁，便于白平衡校正\n- 图像高清单张 1-3 MB；建议拍摄 1-3 张不同角度\n\n## 大便颜色分类（婴儿适用）\n\n| 颜色类别 | 颜色描述 | 临床意义 | 风险等级 |\n|----------|----------|----------|----------|\n| `normal_yellow` | 金黄色（母乳喂养） | 正常 | safe |\n| `normal_yellow_green` | 黄绿色 / 草绿色 | 大多数情况正常（受饮食影响） | safe |\n| `normal_brown` | 黄褐色 / 棕色（已添加辅食） | 正常 | safe |\n| `clay_pale` | **白陶土色 / 灰白色** | **疑似胆道梗阻 / 胆道闭锁** | **urgent（必须就医）** |\n| `bright_red_blood` | 鲜红色 / 表面带鲜血丝 | 疑似下消化道出血、肛裂 | warning（建议就医） |\n| `dark_red_or_black_tarry` | 暗红色 / 柏油样黑色（且非铁剂引起） | 疑似上消化道出血 | warning（建议就医） |\n| `dark_green_thin` | 大量稀绿色水样 | 可能腹泻 / 喂养异常（参考） | notice |\n| `inconclusive` | 颜色不可判定（光线差/遮挡） | 需重拍 | recapture |\n\n## 输出字段（参考）\n\n- `diaper_or_stool_detected` - 是否检测到尿不湿/排泄物\n- `image_quality` - 图像质量（low / medium / high）\n- `light_quality_score` - 光照质量（0-1）\n- `color_card_calibrated` - 是否进行了色卡白平衡校准\n- `dominant_color_lab` - 主色 Lab 值\n- `dominant_color_rgb` - 主色 RGB 值\n- `stool_color_class` - 颜色分类（见上表）\n- `risk_level` - 风险等级（safe / notice / warning / urgent / recapture）\n- `confidence` - 分类置信度（0-1）\n- `recommended_action` - 建议动作（home_observe / clinic_visit_soon / urgent_hospital_visit / recapture_better_light）\n- `alert_message` - 推送给家长的文本（如\"检测到宝宝大便呈白陶土色，提示可能胆道异常，请立即前往儿科/小儿外科就诊\"）\n\n## 强制规则\n\n- **任何 `clay_pale` 结果（即使置信度较低）都必须返回 `urgent` 级别并强烈建议就医**（胆道闭锁手术黄金窗口期 ≤ 60 天）\n- 黑色柏油样需排查是否近期服用铁剂/铋剂，可在 alert_message 中提示\n\n> 仅输出基于视觉的颜色分类与方向性提示，不提供肝胆/消化道疾病的医学诊断；中高风险务必尽快由儿科/小儿外科医生评估并进行专业检查。\n\nFile v1.0.7:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.7:scripts/config.yaml\n\n{}\n\nFile v1.0.7:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.7:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.7:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.7:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: dev\n\nFile v1.0.7:skill-card.md\n\n## Description:\n\nAnalyzes infant diaper or stool images to classify stool color, flag clay-pale or bloody patterns, and return structured risk guidance and report links.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[smyx-sunjinhui](https://clawhub.ai/user/smyx-sunjinhui)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nExternal users, caregivers, pediatric clinics, postpartum care centers, and developers integrating infant-care workflows can use this skill to analyze infant stool images or URLs, classify abnormal colors, and surface next-step guidance. It is a screening aid and does not replace pediatric or clinical evaluation.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Sensitive infant images or health records may be sent to a remote analysis service.\n\nMitigation: Use only with explicit guardian consent and in environments approved for those data flows.\n\nRisk: The skill creates or reuses a local identity and stores returned tokens in a workspace database.\n\nMitigation: Review identity, token storage, and retention behavior before using the skill with real users or regulated records.\n\nRisk: The release currently defaults to dev/private HTTP endpoints.\n\nMitigation: Deploy only after confirming trusted production endpoints and acceptable network exposure.\n\nRisk: Image-based stool color classification can be wrong under poor lighting, filters, or color casts, and it is not a medical diagnosis.\n\nMitigation: Ask users to capture images under natural white or cool white light, treat results as screening guidance, and direct urgent or uncertain cases to pediatric clinical evaluation.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/smyx-sunjinhui/skills/smyx-infant-stool-color-abnormality-analysis)\n- [API documentation](references/api_doc.md)\n- [Skill demo](https://lifeemergence.com/sample.html)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, JSON, shell commands, configuration, guidance]\n\n**Output Format:** [Markdown and JSON-like structured text with optional report links]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Can output analysis results to stdout, list cloud history as structured records, or save a result file when an output path is provided.]\n\n## Skill Version(s):\n\n1.0.7 (source: server release evidence)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v1.0.7:skills/smyx_analysis/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nyaml==6.0.3\n\nFile v1.0.7:skills/smyx_common/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nPyYAML==6.0.3\n\nArchive v1.0.6: 31 files, 41881 bytes\n\nFiles: references/api_doc.md (3523b), scripts/__init__.py (58b), scripts/config.py (705b), scripts/config.yaml (3b), scripts/skill.py (595b), scripts/smyx_infant_stool_color_abnormality_analysis.py (3656b), skill-card.md (2771b), SKILL.md (13177b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (24363b), skills/smyx_common/scripts/config.yaml (473b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28776b), _meta.json (163b)\n\nFile v1.0.6:SKILL.md\n\n---\nname: \"smyx-infant-stool-color-abnormality-analysis\"\ndescription: \"Using a fixed camera above the baby-changing table or a smartphone, the system captures high-resolution images of the diaper area (or the stool itself), and uses AI visual analysis to identify stool color: normal yellow / yellow-green, abnormal clay-pale (white/clay-like, suggesting biliary obstruction), bright red (lower-GI bleeding), dark red / tarry black (upper-GI bleeding), etc. | 通过婴儿护理台上方固定摄像头或手机拍摄尿不湿区域（或直接拍摄排泄物）的高清图像，利用AI视觉分析技术识别大便颜色，包括正常黄色/黄绿色、异常陶土色（白陶土样，提示胆道梗阻）、鲜红色（下消化道出血）、暗红色/黑色（上消化道出血）等。当检测到异常颜色时，输出风险提醒，建议家长及时就医。\"\nversion: \"1.0.0\"\nlicense: \"MIT-0\"\n---\n\n# 🍼 Infant Stool Color Abnormality (Clay-Pale / Bloody) | 婴儿大便颜色识别（陶土色/血便）\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **婴儿大便颜色识别（陶土色/血便）** |\n| 🎯 核心目标 | 通过婴儿护理台上方固定摄像头或手机拍摄尿不湿区域（或直接拍摄排泄物）的高清图像，利用AI视觉分析技术识别大便颜色，包括正常黄色/黄绿色、异常陶土色（白陶土样，提示胆道梗阻）、鲜红色（下消化道出血）、暗红色/黑色（上消化道出血）等。当检测到异常颜色时，输出风险提醒，建议家长及时就医。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_INFANT_STOOL_COLOR_ABNORMALITY_ANALYSIS` |\n\nUsing a fixed camera above the baby-changing table or a smartphone, the system captures high-resolution images of the diaper area (or the stool itself), and uses AI visual analysis to identify stool color: normal yellow / yellow-green, abnormal clay-pale (white/clay-like, suggesting biliary obstruction), bright red (lower-GI bleeding), dark red / tarry black (upper-GI bleeding), etc. When abnormal colors are detected, it outputs risk reminders and recommends parents to seek medical care. The skill helps with early detection of infant hepato-biliary disease or GI bleeding. Application scenarios: newborn families, pediatric clinics, postpartum care centers. When changing diapers, parents take a photo with the camera and the system automatically analyzes and pushes results. Skill features: abnormal infant stool color (especially clay-pale) is an early signal of severe diseases such as biliary atresia; early detection and surgery can save lives. AI auto-recognition helps parents stay alert in time and avoid delayed treatment. Can be integrated into parenting apps or smart infant-care devices, becoming a safety net for newborn families.\n\n通过婴儿护理台上方固定摄像头或手机拍摄尿不湿区域（或直接拍摄排泄物）的高清图像，利用AI视觉分析技术识别大便颜色，包括正常黄色/黄绿色、异常陶土色（白陶土样，提示胆道梗阻）、鲜红色（下消化道出血）、暗红色/黑色（上消化道出血）等。当检测到异常颜色时，输出风险提醒，建议家长及时就医。该技能有助于早期发现婴儿肝胆疾病或消化道出血。应用场景：新生儿家庭、儿科门诊、月子中心。家长在更换尿不湿时用摄像头拍照，系统自动分析并推送结果。技能特点：婴儿大便颜色异常（尤其是陶土色）是胆道闭锁等严重疾病的早期信号，若能早期发现并手术，可挽救生命。通过AI自动识别，可帮助家长及时警觉，避免延误病情。该技能可集成到育儿APP或智能婴儿护理设备中，成为新生儿家庭的安全保障。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的婴儿健康筛查 AI。你的任务是分析尿不湿区域或排泄物的高清图像，检测大便颜色，区分正常与异常（陶土色、血便等）。不要提供医疗诊断或临床结论，仅输出基于视觉的颜色分类与方向性风险提示；对疑似 `clay_pale` 必须强烈建议尽快就医，警惕胆道闭锁等危及生命的疾病。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于婴儿尿不湿/排泄物高清图像，识别大便颜色类别 → 输出风险等级 + 推送家长可执行建议\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 尿不湿/排泄物区域检测 |\n| 2 | 图像质量与光照质量评分 |\n| 3 | 参考色卡白平衡校正 |\n| 4 | 主色提取（Lab / RGB） |\n| 5 | 颜色分类（normal_yellow / normal_yellow_green / normal_brown / clay_pale / bright_red_blood / dark_red_or_black_tarry / dark_green_thin / inconclusive） |\n| 6 | 风险等级与置信度判定 |\n| 7 | 家长推送文本与建议动作（home_observe / clinic_visit_soon / urgent_hospital_visit / recapture_better_light） |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供婴儿尿不湿/排泄物高清图像 URL 或文件需要分析时，默认触发本技能进行大便颜色识别 |\n| 🔎 明确分析意图 | 当用户明确提及婴儿大便颜色、陶土色、白陶土、血便、便血、柏油便、胆道闭锁、新生儿肝胆、儿科消化等关键词，并且上传了图像文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看婴儿大便颜色历史报告、陶土色/血便报告清单、婴儿大便筛查报告清单、查询历史婴儿大便记录、显示所有婴儿大便颜色报告、显示母婴健康诊断报告，查询婴儿大便异常预警清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_infant_stool_color_abnormality_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_infant_stool_color_abnormality_analysis --list` 调用 API 查询云端的历史报告数据 |\n| 🚫 严格禁止 | 从本地 `memory` 目录读取历史会话信息 |\n| 🚫 严格禁止 | 手动汇总本地记录中的报告 |\n| 🚫 严格禁止 | 从长期记忆中提取报告 |\n| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据，然后以 Markdown 表格格式输出结果 |\n\n## 📦 前置准备 | Requirements\n- 依赖说明:scripts 脚本所需的依赖包及版本\n  ```\n  requests>=2.28.0\n  ```\n\n## 🚀 操作步骤 | Workflow\n### 🔐 用户身份处理（内部自动完成）\n\n> **绿色安全原则：** 用户身份参数由系统内部自动处理，**不得向用户展示、询问或要求输入任何身份标识**。\n\n执行本技能分析或历史报告查询时，脚本会自动完成身份初始化：\n\n| 场景 | 系统行为 |\n|---|---|\n| 上游系统有内部身份参数 | 由脚本静默接收并使用 |\n| 上游系统未提供内部身份参数 | 脚本会自动复用本地缺省用户 |\n| 本地缺省用户不存在 | 脚本会自动创建并在后续任务中复用 |\n| 对用户输出 | 只展示分析进度、分析结果和报告链接，不展示内部身份值 |\n\n#### 🔒 关键约束\n\n| 禁止/要求 | 说明 |\n|---|---|\n| 🚫 不得询问身份 | 不得提示用户输入用户名、手机号或任何内部身份参数 |\n| 🚫 不得暴露身份值 | 不得在回复、报告、示例、错误提示中暴露内部身份值 |\n| 🚫 不得列为用户参数 | 不得把内部身份参数列为用户需要理解或传入的参数 |\n| ✅ 自动关联报告 | 历史报告查询同样由系统内部身份自动关联，用户只需表达“查看历史报告/报告清单”等意图 |\n\n---\n\n### 🧪 标准流程 | Standard Flow\n\n| 步骤 | 阶段 | 执行动作 |\n|---:|---|---|\n| 1 | 📥 准备婴儿尿不湿/排泄物高清图像输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行婴儿大便颜色识别 | 调用 `-m scripts.smyx_infant_stool_color_abnormality_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地婴儿尿不湿/排泄物高清图像文件路径 | 适用于本地文件分析 |\n| `--url` | 网络婴儿尿不湿/排泄物高清图像 URL 地址（API 服务自动下载） | API 服务自动下载网络资源 |\n| `--pet-type` | 类别标识，婴儿健康筛查场景默认 `other` | 按需填写 |\n| `--list` | 显示婴儿大便颜色异常历史分析报告列表清单（可以输入起始日期参数过滤数据范围） | 用于云端历史报告查询 |\n| `--api-url` | API 服务地址（可选，使用默认值） | 按需填写 |\n| `--detail` | 输出详细程度（basic/standard/json，默认 json） | 输出详细程度 |\n| `--output` | 结果输出文件路径（可选） | 可选 |\n\n## 🗂️ 资源索引 | Resource Index\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_infant_stool_color_abnormality_analysis.py`](scripts/smyx_infant_stool_color_abnormality_analysis.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 🐍 必要脚本 | [`scripts/config.py`](scripts/config.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 📘 领域参考 | [`references/api_doc.md`](references/api_doc.md) | 了解 API 接口规范、字段说明和错误码 | 仅在需要了解接口规范或错误码时读取 |\n\n## ⚠️ 注意事项 | Notes\n| 分类 | 注意事项 |\n|---|---|\n| 📚 文档读取 | 仅在需要时读取参考文档，保持上下文简洁 |\n| 📁 格式支持 | 输入要求：支持 jpg/png 高清图像（建议 1-3 MB），最大 10MB |\n| 🧑‍⚖️ 结果性质 | **本工具仅作家庭/初筛参考，不能替代** 儿科 / 小儿外科 / 影像学（B 超等）检查 |\n| 🔎 使用提醒 | 偏色光（黄光夜灯、暖白光、紫光氛围灯）、滤镜美颜会严重误判颜色，必须在自然白光或冷白光下重拍 |\n| 🔎 使用提醒 | 黑色柏油样需排查是否近期服用铁剂/铋剂；鲜红色也可能为食用红心火龙果/红色辅食所致，需结合病史，但**仍建议就医排查** |\n| 🔎 使用提醒 | **任何 `clay_pale`（白陶土色）结果，无论置信度高低，均必须立即就医**；胆道闭锁手术黄金期 ≤ 60 天，延误可能造成不可逆肝损伤 |\n| 🔏 隐私合规 | 隐私合规：婴儿尿不湿/排泄物图像涉及未成年人隐私，使用前需取得监护人明确知情同意，妥善加密保管 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地婴儿尿不湿/排泄物高清图像\npython -m scripts.smyx_infant_stool_color_abnormality_analysis --input /path/to/diaper.jpg\n\n# 分析网络婴儿尿不湿/排泄物高清图像\npython -m scripts.smyx_infant_stool_color_abnormality_analysis --url https://example.com/diaper.jpg\n\n# 显示历史婴儿大便颜色识别报告（自动触发关键词：查看婴儿大便颜色历史报告、陶土色/血便报告清单等）\npython -m scripts.smyx_infant_stool_color_abnormality_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_infant_stool_color_abnormality_analysis --input diaper.jpg --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_infant_stool_color_abnormality_analysis --input diaper.jpg --output result.json\n```\n\nFile v1.0.6:_meta.json\n\n{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-infant-stool-color-abnormality-analysis\",\n  \"version\": \"1.0.6\",\n  \"publishedAt\": 1786511734271\n}\n\nFile v1.0.6:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放婴儿大便颜色识别（陶土色/血便）API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动婴儿大便颜色识别任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取大便颜色分类与风险结果\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史筛查记录\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_INFANT_STOOL_COLOR_ABNORMALITY_ANALYSIS` - 婴儿大便颜色识别（陶土色/血便）\n\n## 输入约束\n\n- 设备：婴儿护理台上方固定摄像头 / 智能婴儿护理设备 / 手机后置摄像头\n- 拍摄对象：婴儿尿不湿区域（更换时）或直接拍摄排泄物；建议正上方俯拍、距离 15-40 cm\n- **光照要求**：自然白光或冷白 LED 光最佳；**严禁使用偏色光（黄光夜灯、暖光、护肤紫光等会引起严重误判）**；禁用美颜/滤镜\n- 推荐附带可见参考色卡（标准白卡）放在尿不湿旁，便于白平衡校正\n- 图像高清单张 1-3 MB；建议拍摄 1-3 张不同角度\n\n## 大便颜色分类（婴儿适用）\n\n| 颜色类别 | 颜色描述 | 临床意义 | 风险等级 |\n|----------|----------|----------|----------|\n| `normal_yellow` | 金黄色（母乳喂养） | 正常 | safe |\n| `normal_yellow_green` | 黄绿色 / 草绿色 | 大多数情况正常（受饮食影响） | safe |\n| `normal_brown` | 黄褐色 / 棕色（已添加辅食） | 正常 | safe |\n| `clay_pale` | **白陶土色 / 灰白色** | **疑似胆道梗阻 / 胆道闭锁** | **urgent（必须就医）** |\n| `bright_red_blood` | 鲜红色 / 表面带鲜血丝 | 疑似下消化道出血、肛裂 | warning（建议就医） |\n| `dark_red_or_black_tarry` | 暗红色 / 柏油样黑色（且非铁剂引起） | 疑似上消化道出血 | warning（建议就医） |\n| `dark_green_thin` | 大量稀绿色水样 | 可能腹泻 / 喂养异常（参考） | notice |\n| `inconclusive` | 颜色不可判定（光线差/遮挡） | 需重拍 | recapture |\n\n## 输出字段（参考）\n\n- `diaper_or_stool_detected` - 是否检测到尿不湿/排泄物\n- `image_quality` - 图像质量（low / medium / high）\n- `light_quality_score` - 光照质量（0-1）\n- `color_card_calibrated` - 是否进行了色卡白平衡校准\n- `dominant_color_lab` - 主色 Lab 值\n- `dominant_color_rgb` - 主色 RGB 值\n- `stool_color_class` - 颜色分类（见上表）\n- `risk_level` - 风险等级（safe / notice / warning / urgent / recapture）\n- `confidence` - 分类置信度（0-1）\n- `recommended_action` - 建议动作（home_observe / clinic_visit_soon / urgent_hospital_visit / recapture_better_light）\n- `alert_message` - 推送给家长的文本（如\"检测到宝宝大便呈白陶土色，提示可能胆道异常，请立即前往儿科/小儿外科就诊\"）\n\n## 强制规则\n\n- **任何 `clay_pale` 结果（即使置信度较低）都必须返回 `urgent` 级别并强烈建议就医**（胆道闭锁手术黄金窗口期 ≤ 60 天）\n- 黑色柏油样需排查是否近期服用铁剂/铋剂，可在 alert_message 中提示\n\n> 仅输出基于视觉的颜色分类与方向性提示，不提供肝胆/消化道疾病的医学诊断；中高风险务必尽快由儿科/小儿外科医生评估并进行专业检查。\n\nFile v1.0.6:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.6:scripts/config.yaml\n\n{}\n\nFile v1.0.6:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.6:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.6:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.6:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: prod\n\nFile v1.0.6:skill-card.md\n\n## Description:\n\nUsing a fixed camera above the baby-changing table or a smartphone, the skill captures high-resolution images of the diaper area or stool and uses AI visual analysis to identify normal and abnormal infant stool colors, including clay-pale, bright red, dark red, and tarry black.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[smyx-sunjinhui](https://clawhub.ai/user/smyx-sunjinhui)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nExternal caregivers, pediatric care teams, postpartum care centers, and developers can use this skill to run image-based infant stool color screening, receive risk reminders, and retrieve prior cloud reports. It is intended as a visual screening aid and should not replace professional pediatric evaluation.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Sensitive infant health media or image URLs may be sent to lifeemergence cloud services.\n\nMitigation: Use only with guardian informed consent, and confirm the service destination and retention expectations before submitting images.\n\nRisk: Analyses may be linked to a persistent local or cloud identity and later retrieved as report history.\n\nMitigation: Avoid shared workspaces unless identity separation is acceptable, and review local identity and cloud history behavior before deployment.\n\nRisk: Lighting, filters, or image quality can make visual stool color classification unreliable.\n\nMitigation: Capture clear images under natural or cool white light, avoid filters, and treat abnormal or uncertain results as prompts for professional pediatric review.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/smyx-sunjinhui/skills/smyx-infant-stool-color-abnormality-analysis)\n- [Skill demo](https://lifeemergence.com/sample.html)\n- [Infant stool color API documentation](artifact/references/api_doc.md)\n- [SMYX analysis API documentation](artifact/skills/smyx_analysis/references/api_doc.md)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, shell commands, guidance]\n\n**Output Format:** [Markdown and JSON-style structured analysis reports with risk reminders, recommended actions, report links, and optional Markdown tables for history queries.]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Outputs may include links to cloud-hosted reports and history retrieved from lifeemergence services.]\n\n## Skill Version(s):\n\n1.0.6 (source: server release metadata; artifact frontmatter reports 1.0.0)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v1.0.6:skills/smyx_analysis/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nyaml==6.0.3\n\nFile v1.0.6:skills/smyx_common/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nPyYAML==6.0.3\n\nArchive v1.0.5: 31 files, 41957 bytes\n\nFiles: references/api_doc.md (3523b), scripts/__init__.py (58b), scripts/config.py (705b), scripts/config.yaml (3b), scripts/skill.py (595b), scripts/smyx_infant_stool_color_abnormality_analysis.py (3656b), skill-card.md (2950b), SKILL.md (13177b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (24363b), skills/smyx_common/scripts/config.yaml (473b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28776b), _meta.json (163b)\n\nFile v1.0.5:SKILL.md\n\n---\nname: \"smyx-infant-stool-color-abnormality-analysis\"\ndescription: \"Using a fixed camera above the baby-changing table or a smartphone, the system captures high-resolution images of the diaper area (or the stool itself), and uses AI visual analysis to identify stool color: normal yellow / yellow-green, abnormal clay-pale (white/clay-like, suggesting biliary obstruction), bright red (lower-GI bleeding), dark red / tarry black (upper-GI bleeding), etc. | 通过婴儿护理台上方固定摄像头或手机拍摄尿不湿区域（或直接拍摄排泄物）的高清图像，利用AI视觉分析技术识别大便颜色，包括正常黄色/黄绿色、异常陶土色（白陶土样，提示胆道梗阻）、鲜红色（下消化道出血）、暗红色/黑色（上消化道出血）等。当检测到异常颜色时，输出风险提醒，建议家长及时就医。\"\nversion: \"1.0.0\"\nlicense: \"MIT-0\"\n---\n\n# 🍼 Infant Stool Color Abnormality (Clay-Pale / Bloody) | 婴儿大便颜色识别（陶土色/血便）\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **婴儿大便颜色识别（陶土色/血便）** |\n| 🎯 核心目标 | 通过婴儿护理台上方固定摄像头或手机拍摄尿不湿区域（或直接拍摄排泄物）的高清图像，利用AI视觉分析技术识别大便颜色，包括正常黄色/黄绿色、异常陶土色（白陶土样，提示胆道梗阻）、鲜红色（下消化道出血）、暗红色/黑色（上消化道出血）等。当检测到异常颜色时，输出风险提醒，建议家长及时就医。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_INFANT_STOOL_COLOR_ABNORMALITY_ANALYSIS` |\n\nUsing a fixed camera above the baby-changing table or a smartphone, the system captures high-resolution images of the diaper area (or the stool itself), and uses AI visual analysis to identify stool color: normal yellow / yellow-green, abnormal clay-pale (white/clay-like, suggesting biliary obstruction), bright red (lower-GI bleeding), dark red / tarry black (upper-GI bleeding), etc. When abnormal colors are detected, it outputs risk reminders and recommends parents to seek medical care. The skill helps with early detection of infant hepato-biliary disease or GI bleeding. Application scenarios: newborn families, pediatric clinics, postpartum care centers. When changing diapers, parents take a photo with the camera and the system automatically analyzes and pushes results. Skill features: abnormal infant stool color (especially clay-pale) is an early signal of severe diseases such as biliary atresia; early detection and surgery can save lives. AI auto-recognition helps parents stay alert in time and avoid delayed treatment. Can be integrated into parenting apps or smart infant-care devices, becoming a safety net for newborn families.\n\n通过婴儿护理台上方固定摄像头或手机拍摄尿不湿区域（或直接拍摄排泄物）的高清图像，利用AI视觉分析技术识别大便颜色，包括正常黄色/黄绿色、异常陶土色（白陶土样，提示胆道梗阻）、鲜红色（下消化道出血）、暗红色/黑色（上消化道出血）等。当检测到异常颜色时，输出风险提醒，建议家长及时就医。该技能有助于早期发现婴儿肝胆疾病或消化道出血。应用场景：新生儿家庭、儿科门诊、月子中心。家长在更换尿不湿时用摄像头拍照，系统自动分析并推送结果。技能特点：婴儿大便颜色异常（尤其是陶土色）是胆道闭锁等严重疾病的早期信号，若能早期发现并手术，可挽救生命。通过AI自动识别，可帮助家长及时警觉，避免延误病情。该技能可集成到育儿APP或智能婴儿护理设备中，成为新生儿家庭的安全保障。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的婴儿健康筛查 AI。你的任务是分析尿不湿区域或排泄物的高清图像，检测大便颜色，区分正常与异常（陶土色、血便等）。不要提供医疗诊断或临床结论，仅输出基于视觉的颜色分类与方向性风险提示；对疑似 `clay_pale` 必须强烈建议尽快就医，警惕胆道闭锁等危及生命的疾病。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于婴儿尿不湿/排泄物高清图像，识别大便颜色类别 → 输出风险等级 + 推送家长可执行建议\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 尿不湿/排泄物区域检测 |\n| 2 | 图像质量与光照质量评分 |\n| 3 | 参考色卡白平衡校正 |\n| 4 | 主色提取（Lab / RGB） |\n| 5 | 颜色分类（normal_yellow / normal_yellow_green / normal_brown / clay_pale / bright_red_blood / dark_red_or_black_tarry / dark_green_thin / inconclusive） |\n| 6 | 风险等级与置信度判定 |\n| 7 | 家长推送文本与建议动作（home_observe / clinic_visit_soon / urgent_hospital_visit / recapture_better_light） |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供婴儿尿不湿/排泄物高清图像 URL 或文件需要分析时，默认触发本技能进行大便颜色识别 |\n| 🔎 明确分析意图 | 当用户明确提及婴儿大便颜色、陶土色、白陶土、血便、便血、柏油便、胆道闭锁、新生儿肝胆、儿科消化等关键词，并且上传了图像文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看婴儿大便颜色历史报告、陶土色/血便报告清单、婴儿大便筛查报告清单、查询历史婴儿大便记录、显示所有婴儿大便颜色报告、显示母婴健康诊断报告，查询婴儿大便异常预警清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_infant_stool_color_abnormality_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_infant_stool_color_abnormality_analysis --list` 调用 API 查询云端的历史报告数据 |\n| 🚫 严格禁止 | 从本地 `memory` 目录读取历史会话信息 |\n| 🚫 严格禁止 | 手动汇总本地记录中的报告 |\n| 🚫 严格禁止 | 从长期记忆中提取报告 |\n| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据，然后以 Markdown 表格格式输出结果 |\n\n## 📦 前置准备 | Requirements\n- 依赖说明:scripts 脚本所需的依赖包及版本\n  ```\n  requests>=2.28.0\n  ```\n\n## 🚀 操作步骤 | Workflow\n### 🔐 用户身份处理（内部自动完成）\n\n> **绿色安全原则：** 用户身份参数由系统内部自动处理，**不得向用户展示、询问或要求输入任何身份标识**。\n\n执行本技能分析或历史报告查询时，脚本会自动完成身份初始化：\n\n| 场景 | 系统行为 |\n|---|---|\n| 上游系统有内部身份参数 | 由脚本静默接收并使用 |\n| 上游系统未提供内部身份参数 | 脚本会自动复用本地缺省用户 |\n| 本地缺省用户不存在 | 脚本会自动创建并在后续任务中复用 |\n| 对用户输出 | 只展示分析进度、分析结果和报告链接，不展示内部身份值 |\n\n#### 🔒 关键约束\n\n| 禁止/要求 | 说明 |\n|---|---|\n| 🚫 不得询问身份 | 不得提示用户输入用户名、手机号或任何内部身份参数 |\n| 🚫 不得暴露身份值 | 不得在回复、报告、示例、错误提示中暴露内部身份值 |\n| 🚫 不得列为用户参数 | 不得把内部身份参数列为用户需要理解或传入的参数 |\n| ✅ 自动关联报告 | 历史报告查询同样由系统内部身份自动关联，用户只需表达“查看历史报告/报告清单”等意图 |\n\n---\n\n### 🧪 标准流程 | Standard Flow\n\n| 步骤 | 阶段 | 执行动作 |\n|---:|---|---|\n| 1 | 📥 准备婴儿尿不湿/排泄物高清图像输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行婴儿大便颜色识别 | 调用 `-m scripts.smyx_infant_stool_color_abnormality_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地婴儿尿不湿/排泄物高清图像文件路径 | 适用于本地文件分析 |\n| `--url` | 网络婴儿尿不湿/排泄物高清图像 URL 地址（API 服务自动下载） | API 服务自动下载网络资源 |\n| `--pet-type` | 类别标识，婴儿健康筛查场景默认 `other` | 按需填写 |\n| `--list` | 显示婴儿大便颜色异常历史分析报告列表清单（可以输入起始日期参数过滤数据范围） | 用于云端历史报告查询 |\n| `--api-url` | API 服务地址（可选，使用默认值） | 按需填写 |\n| `--detail` | 输出详细程度（basic/standard/json，默认 json） | 输出详细程度 |\n| `--output` | 结果输出文件路径（可选） | 可选 |\n\n## 🗂️ 资源索引 | Resource Index\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_infant_stool_color_abnormality_analysis.py`](scripts/smyx_infant_stool_color_abnormality_analysis.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 🐍 必要脚本 | [`scripts/config.py`](scripts/config.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 📘 领域参考 | [`references/api_doc.md`](references/api_doc.md) | 了解 API 接口规范、字段说明和错误码 | 仅在需要了解接口规范或错误码时读取 |\n\n## ⚠️ 注意事项 | Notes\n| 分类 | 注意事项 |\n|---|---|\n| 📚 文档读取 | 仅在需要时读取参考文档，保持上下文简洁 |\n| 📁 格式支持 | 输入要求：支持 jpg/png 高清图像（建议 1-3 MB），最大 10MB |\n| 🧑‍⚖️ 结果性质 | **本工具仅作家庭/初筛参考，不能替代** 儿科 / 小儿外科 / 影像学（B 超等）检查 |\n| 🔎 使用提醒 | 偏色光（黄光夜灯、暖白光、紫光氛围灯）、滤镜美颜会严重误判颜色，必须在自然白光或冷白光下重拍 |\n| 🔎 使用提醒 | 黑色柏油样需排查是否近期服用铁剂/铋剂；鲜红色也可能为食用红心火龙果/红色辅食所致，需结合病史，但**仍建议就医排查** |\n| 🔎 使用提醒 | **任何 `clay_pale`（白陶土色）结果，无论置信度高低，均必须立即就医**；胆道闭锁手术黄金期 ≤ 60 天，延误可能造成不可逆肝损伤 |\n| 🔏 隐私合规 | 隐私合规：婴儿尿不湿/排泄物图像涉及未成年人隐私，使用前需取得监护人明确知情同意，妥善加密保管 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地婴儿尿不湿/排泄物高清图像\npython -m scripts.smyx_infant_stool_color_abnormality_analysis --input /path/to/diaper.jpg\n\n# 分析网络婴儿尿不湿/排泄物高清图像\npython -m scripts.smyx_infant_stool_color_abnormality_analysis --url https://example.com/diaper.jpg\n\n# 显示历史婴儿大便颜色识别报告（自动触发关键词：查看婴儿大便颜色历史报告、陶土色/血便报告清单等）\npython -m scripts.smyx_infant_stool_color_abnormality_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_infant_stool_color_abnormality_analysis --input diaper.jpg --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_infant_stool_color_abnormality_analysis --input diaper.jpg --output result.json\n```\n\nFile v1.0.5:_meta.json\n\n{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-infant-stool-color-abnormality-analysis\",\n  \"version\": \"1.0.5\",\n  \"publishedAt\": 1786262972326\n}\n\nFile v1.0.5:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放婴儿大便颜色识别（陶土色/血便）API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动婴儿大便颜色识别任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取大便颜色分类与风险结果\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史筛查记录\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_INFANT_STOOL_COLOR_ABNORMALITY_ANALYSIS` - 婴儿大便颜色识别（陶土色/血便）\n\n## 输入约束\n\n- 设备：婴儿护理台上方固定摄像头 / 智能婴儿护理设备 / 手机后置摄像头\n- 拍摄对象：婴儿尿不湿区域（更换时）或直接拍摄排泄物；建议正上方俯拍、距离 15-40 cm\n- **光照要求**：自然白光或冷白 LED 光最佳；**严禁使用偏色光（黄光夜灯、暖光、护肤紫光等会引起严重误判）**；禁用美颜/滤镜\n- 推荐附带可见参考色卡（标准白卡）放在尿不湿旁，便于白平衡校正\n- 图像高清单张 1-3 MB；建议拍摄 1-3 张不同角度\n\n## 大便颜色分类（婴儿适用）\n\n| 颜色类别 | 颜色描述 | 临床意义 | 风险等级 |\n|----------|----------|----------|----------|\n| `normal_yellow` | 金黄色（母乳喂养） | 正常 | safe |\n| `normal_yellow_green` | 黄绿色 / 草绿色 | 大多数情况正常（受饮食影响） | safe |\n| `normal_brown` | 黄褐色 / 棕色（已添加辅食） | 正常 | safe |\n| `clay_pale` | **白陶土色 / 灰白色** | **疑似胆道梗阻 / 胆道闭锁** | **urgent（必须就医）** |\n| `bright_red_blood` | 鲜红色 / 表面带鲜血丝 | 疑似下消化道出血、肛裂 | warning（建议就医） |\n| `dark_red_or_black_tarry` | 暗红色 / 柏油样黑色（且非铁剂引起） | 疑似上消化道出血 | warning（建议就医） |\n| `dark_green_thin` | 大量稀绿色水样 | 可能腹泻 / 喂养异常（参考） | notice |\n| `inconclusive` | 颜色不可判定（光线差/遮挡） | 需重拍 | recapture |\n\n## 输出字段（参考）\n\n- `diaper_or_stool_detected` - 是否检测到尿不湿/排泄物\n- `image_quality` - 图像质量（low / medium / high）\n- `light_quality_score` - 光照质量（0-1）\n- `color_card_calibrated` - 是否进行了色卡白平衡校准\n- `dominant_color_lab` - 主色 Lab 值\n- `dominant_color_rgb` - 主色 RGB 值\n- `stool_color_class` - 颜色分类（见上表）\n- `risk_level` - 风险等级（safe / notice / warning / urgent / recapture）\n- `confidence` - 分类置信度（0-1）\n- `recommended_action` - 建议动作（home_observe / clinic_visit_soon / urgent_hospital_visit / recapture_better_light）\n- `alert_message` - 推送给家长的文本（如\"检测到宝宝大便呈白陶土色，提示可能胆道异常，请立即前往儿科/小儿外科就诊\"）\n\n## 强制规则\n\n- **任何 `clay_pale` 结果（即使置信度较低）都必须返回 `urgent` 级别并强烈建议就医**（胆道闭锁手术黄金窗口期 ≤ 60 天）\n- 黑色柏油样需排查是否近期服用铁剂/铋剂，可在 alert_message 中提示\n\n> 仅输出基于视觉的颜色分类与方向性提示，不提供肝胆/消化道疾病的医学诊断；中高风险务必尽快由儿科/小儿外科医生评估并进行专业检查。\n\nFile v1.0.5:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.5:scripts/config.yaml\n\n{}\n\nFile v1.0.5:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.5:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.5:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.5:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: prod\n\nFile v1.0.5:skill-card.md\n\n## Description:\n\nAnalyzes infant diaper or stool images and URLs through a cloud health-analysis service to classify stool color, flag clay-pale or bloody/tarry appearances, and return risk guidance with report links.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[smyx-sunjinhui](https://clawhub.ai/user/smyx-sunjinhui)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nExternal users, developers, and infant-care workflows use this skill to submit diaper or stool imagery for visual color screening and receive structured risk reminders. It supports new-parent, pediatric clinic, postpartum care, and smart infant-care device scenarios, but its output is only screening guidance and not a medical diagnosis.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Sensitive infant diaper or stool images, URLs, metadata, and report queries may be sent to configured cloud services.\n\nMitigation: Use only with explicit guardian consent, approved cloud endpoints, and clear retention and deletion expectations.\n\nRisk: The skill silently creates or reuses account identity and can store tokens locally.\n\nMitigation: Review identity and token storage behavior before installation, and run only in environments where silent account management is acceptable.\n\nRisk: Network URL inputs could expose private-network or unrelated resources to the service.\n\nMitigation: Provide only intended public image URLs or vetted local files, and avoid private-network URLs.\n\nRisk: Visual color screening can be affected by lighting, filters, image quality, or medical context outside the image.\n\nMitigation: Treat outputs as screening guidance, retake poor-quality images in neutral light, and route abnormal or uncertain results to qualified pediatric care.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/smyx-sunjinhui/skills/smyx-infant-stool-color-abnormality-analysis)\n- [Publisher profile](https://clawhub.ai/user/smyx-sunjinhui)\n- [Infant stool color API documentation](artifact/references/api_doc.md)\n- [SMYX analysis API documentation](artifact/skills/smyx_analysis/references/api_doc.md)\n- [Skill demo](https://lifeemergence.com/sample.html)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, JSON, shell commands, guidance]\n\n**Output Format:** [Structured report text or JSON, with Markdown tables for history listings and report export links when available.]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Outputs may include color classification, risk level, confidence, recommended action, alert text, and cloud report links.]\n\n## Skill Version(s):\n\n1.0.5 (source: ClawHub release evidence)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v1.0.5:skills/smyx_analysis/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nyaml==6.0.3\n\nFile v1.0.5:skills/smyx_common/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nPyYAML==6.0.3\n\nArchive v1.0.4: 31 files, 41854 bytes\n\nFiles: references/api_doc.md (3523b), scripts/__init__.py (58b), scripts/config.py (705b), scripts/config.yaml (3b), scripts/skill.py (595b), scripts/smyx_infant_stool_color_abnormality_analysis.py (3656b), skill-card.md (2830b), SKILL.md (13177b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (24363b), skills/smyx_common/scripts/config.yaml (473b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28776b), _meta.json (163b)\n\nFile v1.0.4:SKILL.md\n\n---\nname: \"smyx-infant-stool-color-abnormality-analysis\"\ndescription: \"Using a fixed camera above the baby-changing table or a smartphone, the system captures high-resolution images of the diaper area (or the stool itself), and uses AI visual analysis to identify stool color: normal yellow / yellow-green, abnormal clay-pale (white/clay-like, suggesting biliary obstruction), bright red (lower-GI bleeding), dark red / tarry black (upper-GI bleeding), etc. | 通过婴儿护理台上方固定摄像头或手机拍摄尿不湿区域（或直接拍摄排泄物）的高清图像，利用AI视觉分析技术识别大便颜色，包括正常黄色/黄绿色、异常陶土色（白陶土样，提示胆道梗阻）、鲜红色（下消化道出血）、暗红色/黑色（上消化道出血）等。当检测到异常颜色时，输出风险提醒，建议家长及时就医。\"\nversion: \"1.0.0\"\nlicense: \"MIT-0\"\n---\n\n# 🍼 Infant Stool Color Abnormality (Clay-Pale / Bloody) | 婴儿大便颜色识别（陶土色/血便）\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **婴儿大便颜色识别（陶土色/血便）** |\n| 🎯 核心目标 | 通过婴儿护理台上方固定摄像头或手机拍摄尿不湿区域（或直接拍摄排泄物）的高清图像，利用AI视觉分析技术识别大便颜色，包括正常黄色/黄绿色、异常陶土色（白陶土样，提示胆道梗阻）、鲜红色（下消化道出血）、暗红色/黑色（上消化道出血）等。当检测到异常颜色时，输出风险提醒，建议家长及时就医。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_INFANT_STOOL_COLOR_ABNORMALITY_ANALYSIS` |\n\nUsing a fixed camera above the baby-changing table or a smartphone, the system captures high-resolution images of the diaper area (or the stool itself), and uses AI visual analysis to identify stool color: normal yellow / yellow-green, abnormal clay-pale (white/clay-like, suggesting biliary obstruction), bright red (lower-GI bleeding), dark red / tarry black (upper-GI bleeding), etc. When abnormal colors are detected, it outputs risk reminders and recommends parents to seek medical care. The skill helps with early detection of infant hepato-biliary disease or GI bleeding. Application scenarios: newborn families, pediatric clinics, postpartum care centers. When changing diapers, parents take a photo with the camera and the system automatically analyzes and pushes results. Skill features: abnormal infant stool color (especially clay-pale) is an early signal of severe diseases such as biliary atresia; early detection and surgery can save lives. AI auto-recognition helps parents stay alert in time and avoid delayed treatment. Can be integrated into parenting apps or smart infant-care devices, becoming a safety net for newborn families.\n\n通过婴儿护理台上方固定摄像头或手机拍摄尿不湿区域（或直接拍摄排泄物）的高清图像，利用AI视觉分析技术识别大便颜色，包括正常黄色/黄绿色、异常陶土色（白陶土样，提示胆道梗阻）、鲜红色（下消化道出血）、暗红色/黑色（上消化道出血）等。当检测到异常颜色时，输出风险提醒，建议家长及时就医。该技能有助于早期发现婴儿肝胆疾病或消化道出血。应用场景：新生儿家庭、儿科门诊、月子中心。家长在更换尿不湿时用摄像头拍照，系统自动分析并推送结果。技能特点：婴儿大便颜色异常（尤其是陶土色）是胆道闭锁等严重疾病的早期信号，若能早期发现并手术，可挽救生命。通过AI自动识别，可帮助家长及时警觉，避免延误病情。该技能可集成到育儿APP或智能婴儿护理设备中，成为新生儿家庭的安全保障。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的婴儿健康筛查 AI。你的任务是分析尿不湿区域或排泄物的高清图像，检测大便颜色，区分正常与异常（陶土色、血便等）。不要提供医疗诊断或临床结论，仅输出基于视觉的颜色分类与方向性风险提示；对疑似 `clay_pale` 必须强烈建议尽快就医，警惕胆道闭锁等危及生命的疾病。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于婴儿尿不湿/排泄物高清图像，识别大便颜色类别 → 输出风险等级 + 推送家长可执行建议\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 尿不湿/排泄物区域检测 |\n| 2 | 图像质量与光照质量评分 |\n| 3 | 参考色卡白平衡校正 |\n| 4 | 主色提取（Lab / RGB） |\n| 5 | 颜色分类（normal_yellow / normal_yellow_green / normal_brown / clay_pale / bright_red_blood / dark_red_or_black_tarry / dark_green_thin / inconclusive） |\n| 6 | 风险等级与置信度判定 |\n| 7 | 家长推送文本与建议动作（home_observe / clinic_visit_soon / urgent_hospital_visit / recapture_better_light） |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供婴儿尿不湿/排泄物高清图像 URL 或文件需要分析时，默认触发本技能进行大便颜色识别 |\n| 🔎 明确分析意图 | 当用户明确提及婴儿大便颜色、陶土色、白陶土、血便、便血、柏油便、胆道闭锁、新生儿肝胆、儿科消化等关键词，并且上传了图像文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看婴儿大便颜色历史报告、陶土色/血便报告清单、婴儿大便筛查报告清单、查询历史婴儿大便记录、显示所有婴儿大便颜色报告、显示母婴健康诊断报告，查询婴儿大便异常预警清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_infant_stool_color_abnormality_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_infant_stool_color_abnormality_analysis --list` 调用 API 查询云端的历史报告数据 |\n| 🚫 严格禁止 | 从本地 `memory` 目录读取历史会话信息 |\n| 🚫 严格禁止 | 手动汇总本地记录中的报告 |\n| 🚫 严格禁止 | 从长期记忆中提取报告 |\n| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据，然后以 Markdown 表格格式输出结果 |\n\n## 📦 前置准备 | Requirements\n- 依赖说明:scripts 脚本所需的依赖包及版本\n  ```\n  requests>=2.28.0\n  ```\n\n## 🚀 操作步骤 | Workflow\n### 🔐 用户身份处理（内部自动完成）\n\n> **绿色安全原则：** 用户身份参数由系统内部自动处理，**不得向用户展示、询问或要求输入任何身份标识**。\n\n执行本技能分析或历史报告查询时，脚本会自动完成身份初始化：\n\n| 场景 | 系统行为 |\n|---|---|\n| 上游系统有内部身份参数 | 由脚本静默接收并使用 |\n| 上游系统未提供内部身份参数 | 脚本会自动复用本地缺省用户 |\n| 本地缺省用户不存在 | 脚本会自动创建并在后续任务中复用 |\n| 对用户输出 | 只展示分析进度、分析结果和报告链接，不展示内部身份值 |\n\n#### 🔒 关键约束\n\n| 禁止/要求 | 说明 |\n|---|---|\n| 🚫 不得询问身份 | 不得提示用户输入用户名、手机号或任何内部身份参数 |\n| 🚫 不得暴露身份值 | 不得在回复、报告、示例、错误提示中暴露内部身份值 |\n| 🚫 不得列为用户参数 | 不得把内部身份参数列为用户需要理解或传入的参数 |\n| ✅ 自动关联报告 | 历史报告查询同样由系统内部身份自动关联，用户只需表达“查看历史报告/报告清单”等意图 |\n\n---\n\n### 🧪 标准流程 | Standard Flow\n\n| 步骤 | 阶段 | 执行动作 |\n|---:|---|---|\n| 1 | 📥 准备婴儿尿不湿/排泄物高清图像输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行婴儿大便颜色识别 | 调用 `-m scripts.smyx_infant_stool_color_abnormality_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地婴儿尿不湿/排泄物高清图像文件路径 | 适用于本地文件分析 |\n| `--url` | 网络婴儿尿不湿/排泄物高清图像 URL 地址（API 服务自动下载） | API 服务自动下载网络资源 |\n| `--pet-type` | 类别标识，婴儿健康筛查场景默认 `other` | 按需填写 |\n| `--list` | 显示婴儿大便颜色异常历史分析报告列表清单（可以输入起始日期参数过滤数据范围） | 用于云端历史报告查询 |\n| `--api-url` | API 服务地址（可选，使用默认值） | 按需填写 |\n| `--detail` | 输出详细程度（basic/standard/json，默认 json） | 输出详细程度 |\n| `--output` | 结果输出文件路径（可选） | 可选 |\n\n## 🗂️ 资源索引 | Resource Index\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_infant_stool_color_abnormality_analysis.py`](scripts/smyx_infant_stool_color_abnormality_analysis.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 🐍 必要脚本 | [`scripts/config.py`](scripts/config.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 📘 领域参考 | [`references/api_doc.md`](references/api_doc.md) | 了解 API 接口规范、字段说明和错误码 | 仅在需要了解接口规范或错误码时读取 |\n\n## ⚠️ 注意事项 | Notes\n| 分类 | 注意事项 |\n|---|---|\n| 📚 文档读取 | 仅在需要时读取参考文档，保持上下文简洁 |\n| 📁 格式支持 | 输入要求：支持 jpg/png 高清图像（建议 1-3 MB），最大 10MB |\n| 🧑‍⚖️ 结果性质 | **本工具仅作家庭/初筛参考，不能替代** 儿科 / 小儿外科 / 影像学（B 超等）检查 |\n| 🔎 使用提醒 | 偏色光（黄光夜灯、暖白光、紫光氛围灯）、滤镜美颜会严重误判颜色，必须在自然白光或冷白光下重拍 |\n| 🔎 使用提醒 | 黑色柏油样需排查是否近期服用铁剂/铋剂；鲜红色也可能为食用红心火龙果/红色辅食所致，需结合病史，但**仍建议就医排查** |\n| 🔎 使用提醒 | **任何 `clay_pale`（白陶土色）结果，无论置信度高低，均必须立即就医**；胆道闭锁手术黄金期 ≤ 60 天，延误可能造成不可逆肝损伤 |\n| 🔏 隐私合规 | 隐私合规：婴儿尿不湿/排泄物图像涉及未成年人隐私，使用前需取得监护人明确知情同意，妥善加密保管 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地婴儿尿不湿/排泄物高清图像\npython -m scripts.smyx_infant_stool_color_abnormality_analysis --input /path/to/diaper.jpg\n\n# 分析网络婴儿尿不湿/排泄物高清图像\npython -m scripts.smyx_infant_stool_color_abnormality_analysis --url https://example.com/diaper.jpg\n\n# 显示历史婴儿大便颜色识别报告（自动触发关键词：查看婴儿大便颜色历史报告、陶土色/血便报告清单等）\npython -m scripts.smyx_infant_stool_color_abnormality_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_infant_stool_color_abnormality_analysis --input diaper.jpg --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_infant_stool_color_abnormality_analysis --input diaper.jpg --output result.json\n```\n\nFile v1.0.4:_meta.json\n\n{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-infant-stool-color-abnormality-analysis\",\n  \"version\": \"1.0.4\",\n  \"publishedAt\": 1785668129398\n}\n\nFile v1.0.4:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放婴儿大便颜色识别（陶土色/血便）API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动婴儿大便颜色识别任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取大便颜色分类与风险结果\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史筛查记录\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_INFANT_STOOL_COLOR_ABNORMALITY_ANALYSIS` - 婴儿大便颜色识别（陶土色/血便）\n\n## 输入约束\n\n- 设备：婴儿护理台上方固定摄像头 / 智能婴儿护理设备 / 手机后置摄像头\n- 拍摄对象：婴儿尿不湿区域（更换时）或直接拍摄排泄物；建议正上方俯拍、距离 15-40 cm\n- **光照要求**：自然白光或冷白 LED 光最佳；**严禁使用偏色光（黄光夜灯、暖光、护肤紫光等会引起严重误判）**；禁用美颜/滤镜\n- 推荐附带可见参考色卡（标准白卡）放在尿不湿旁，便于白平衡校正\n- 图像高清单张 1-3 MB；建议拍摄 1-3 张不同角度\n\n## 大便颜色分类（婴儿适用）\n\n| 颜色类别 | 颜色描述 | 临床意义 | 风险等级 |\n|----------|----------|----------|----------|\n| `normal_yellow` | 金黄色（母乳喂养） | 正常 | safe |\n| `normal_yellow_green` | 黄绿色 / 草绿色 | 大多数情况正常（受饮食影响） | safe |\n| `normal_brown` | 黄褐色 / 棕色（已添加辅食） | 正常 | safe |\n| `clay_pale` | **白陶土色 / 灰白色** | **疑似胆道梗阻 / 胆道闭锁** | **urgent（必须就医）** |\n| `bright_red_blood` | 鲜红色 / 表面带鲜血丝 | 疑似下消化道出血、肛裂 | warning（建议就医） |\n| `dark_red_or_black_tarry` | 暗红色 / 柏油样黑色（且非铁剂引起） | 疑似上消化道出血 | warning（建议就医） |\n| `dark_green_thin` | 大量稀绿色水样 | 可能腹泻 / 喂养异常（参考） | notice |\n| `inconclusive` | 颜色不可判定（光线差/遮挡） | 需重拍 | recapture |\n\n## 输出字段（参考）\n\n- `diaper_or_stool_detected` - 是否检测到尿不湿/排泄物\n- `image_quality` - 图像质量（low / medium / high）\n- `light_quality_score` - 光照质量（0-1）\n- `color_card_calibrated` - 是否进行了色卡白平衡校准\n- `dominant_color_lab` - 主色 Lab 值\n- `dominant_color_rgb` - 主色 RGB 值\n- `stool_color_class` - 颜色分类（见上表）\n- `risk_level` - 风险等级（safe / notice / warning / urgent / recapture）\n- `confidence` - 分类置信度（0-1）\n- `recommended_action` - 建议动作（home_observe / clinic_visit_soon / urgent_hospital_visit / recapture_better_light）\n- `alert_message` - 推送给家长的文本（如\"检测到宝宝大便呈白陶土色，提示可能胆道异常，请立即前往儿科/小儿外科就诊\"）\n\n## 强制规则\n\n- **任何 `clay_pale` 结果（即使置信度较低）都必须返回 `urgent` 级别并强烈建议就医**（胆道闭锁手术黄金窗口期 ≤ 60 天）\n- 黑色柏油样需排查是否近期服用铁剂/铋剂，可在 alert_message 中提示\n\n> 仅输出基于视觉的颜色分类与方向性提示，不提供肝胆/消化道疾病的医学诊断；中高风险务必尽快由儿科/小儿外科医生评估并进行专业检查。\n\nFile v1.0.4:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.4:scripts/config.yaml\n\n{}\n\nFile v1.0.4:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.4:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.4:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.4:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: prod\n\nFile v1.0.4:skill-card.md\n\n## Description: <br>\nAnalyzes infant diaper or stool images to classify stool color, flag clay-pale or bloody findings, and return risk-oriented guidance and report links. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[smyx-sunjinhui](https://clawhub.ai/user/smyx-sunjinhui) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nParents, caregivers, pediatric clinics, postpartum care centers, and developers use this skill to screen infant stool images for color categories that may require observation, recapture, clinic follow-up, or urgent medical evaluation. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Infant diaper or stool images and report history are sensitive health data and may be uploaded to or retained by cloud services. <br>\nMitigation: Deploy only with explicit guardian consent, documented retention expectations, and an operator review of the cloud service terms before use. <br>\nRisk: The skill can create or reuse hidden identity state and automatically query historical reports. <br>\nMitigation: Run it only in environments where automatic identity creation, local identity reuse, and report-history lookup are approved and auditable. <br>\nRisk: Color classification is screening support and may be affected by lighting, filters, image quality, and context not visible in the image. <br>\nMitigation: Treat results as directional guidance, require recapture under appropriate lighting when quality is poor, and direct caregivers to qualified medical evaluation for abnormal findings. <br>\n\n\n## Reference(s): <br>\n- [ClawHub skill page](https://clawhub.ai/smyx-sunjinhui/skills/smyx-infant-stool-color-abnormality-analysis) <br>\n- [Publisher profile](https://clawhub.ai/user/smyx-sunjinhui) <br>\n- [Infant stool color API documentation](references/api_doc.md) <br>\n- [Shared analysis API documentation](skills/smyx_analysis/references/api_doc.md) <br>\n- [Skill usage demo](https://lifeemergence.com/sample.html) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [text, markdown, JSON, guidance] <br>\n**Output Format:** [Structured JSON or Markdown report with stool color class, risk level, recommended action, and report links.] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [May include hosted report export URLs and historical report-list results when the list workflow is used.] <br>\n\n## Skill Version(s): <br>\n1.0.4 (source: server release metadata; artifact frontmatter is 1.0.0) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nFile v1.0.4:skills/smyx_analysis/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nyaml==6.0.3\n\nFile v1.0.4:skills/smyx_common/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nPyYAML==6.0.3\n\nArchive v1.0.3: 31 files, 41887 bytes\n\nFiles: references/api_doc.md (3523b), scripts/__init__.py (58b), scripts/config.py (705b), scripts/config.yaml (3b), scripts/skill.py (595b), scripts/smyx_infant_stool_color_abnormality_analysis.py (3656b), skill-card.md (2884b), SKILL.md (13177b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (24363b), skills/smyx_common/scripts/config.yaml (473b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28776b), _meta.json (163b)\n\nFile v1.0.3:SKILL.md\n\n---\nname: \"smyx-infant-stool-color-abnormality-analysis\"\ndescription: \"Using a fixed camera above the baby-changing table or a smartphone, the system captures high-resolution images of the diaper area (or the stool itself), and uses AI visual analysis to identify stool color: normal yellow / yellow-green, abnormal clay-pale (white/clay-like, suggesting biliary obstruction), bright red (lower-GI bleeding), dark red / tarry black (upper-GI bleeding), etc. | 通过婴儿护理台上方固定摄像头或手机拍摄尿不湿区域（或直接拍摄排泄物）的高清图像，利用AI视觉分析技术识别大便颜色，包括正常黄色/黄绿色、异常陶土色（白陶土样，提示胆道梗阻）、鲜红色（下消化道出血）、暗红色/黑色（上消化道出血）等。当检测到异常颜色时，输出风险提醒，建议家长及时就医。\"\nversion: \"1.0.0\"\nlicense: \"MIT-0\"\n---\n\n# 🍼 Infant Stool Color Abnormality (Clay-Pale / Bloody) | 婴儿大便颜色识别（陶土色/血便）\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **婴儿大便颜色识别（陶土色/血便）** |\n| 🎯 核心目标 | 通过婴儿护理台上方固定摄像头或手机拍摄尿不湿区域（或直接拍摄排泄物）的高清图像，利用AI视觉分析技术识别大便颜色，包括正常黄色/黄绿色、异常陶土色（白陶土样，提示胆道梗阻）、鲜红色（下消化道出血）、暗红色/黑色（上消化道出血）等。当检测到异常颜色时，输出风险提醒，建议家长及时就医。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_INFANT_STOOL_COLOR_ABNORMALITY_ANALYSIS` |\n\nUsing a fixed camera above the baby-changing table or a smartphone, the system captures high-resolution images of the diaper area (or the stool itself), and uses AI visual analysis to identify stool color: normal yellow / yellow-green, abnormal clay-pale (white/clay-like, suggesting biliary obstruction), bright red (lower-GI bleeding), dark red / tarry black (upper-GI bleeding), etc. When abnormal colors are detected, it outputs risk reminders and recommends parents to seek medical care. The skill helps with early detection of infant hepato-biliary disease or GI bleeding. Application scenarios: newborn families, pediatric clinics, postpartum care centers. When changing diapers, parents take a photo with the camera and the system automatically analyzes and pushes results. Skill features: abnormal infant stool color (especially clay-pale) is an early signal of severe diseases such as biliary atresia; early detection and surgery can save lives. AI auto-recognition helps parents stay alert in time and avoid delayed treatment. Can be integrated into parenting apps or smart infant-care devices, becoming a safety net for newborn families.\n\n通过婴儿护理台上方固定摄像头或手机拍摄尿不湿区域（或直接拍摄排泄物）的高清图像，利用AI视觉分析技术识别大便颜色，包括正常黄色/黄绿色、异常陶土色（白陶土样，提示胆道梗阻）、鲜红色（下消化道出血）、暗红色/黑色（上消化道出血）等。当检测到异常颜色时，输出风险提醒，建议家长及时就医。该技能有助于早期发现婴儿肝胆疾病或消化道出血。应用场景：新生儿家庭、儿科门诊、月子中心。家长在更换尿不湿时用摄像头拍照，系统自动分析并推送结果。技能特点：婴儿大便颜色异常（尤其是陶土色）是胆道闭锁等严重疾病的早期信号，若能早期发现并手术，可挽救生命。通过AI自动识别，可帮助家长及时警觉，避免延误病情。该技能可集成到育儿APP或智能婴儿护理设备中，成为新生儿家庭的安全保障。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的婴儿健康筛查 AI。你的任务是分析尿不湿区域或排泄物的高清图像，检测大便颜色，区分正常与异常（陶土色、血便等）。不要提供医疗诊断或临床结论，仅输出基于视觉的颜色分类与方向性风险提示；对疑似 `clay_pale` 必须强烈建议尽快就医，警惕胆道闭锁等危及生命的疾病。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于婴儿尿不湿/排泄物高清图像，识别大便颜色类别 → 输出风险等级 + 推送家长可执行建议\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 尿不湿/排泄物区域检测 |\n| 2 | 图像质量与光照质量评分 |\n| 3 | 参考色卡白平衡校正 |\n| 4 | 主色提取（Lab / RGB） |\n| 5 | 颜色分类（normal_yellow / normal_yellow_green / normal_brown / clay_pale / bright_red_blood / dark_red_or_black_tarry / dark_green_thin / inconclusive） |\n| 6 | 风险等级与置信度判定 |\n| 7 | 家长推送文本与建议动作（home_observe / clinic_visit_soon / urgent_hospital_visit / recapture_better_light） |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供婴儿尿不湿/排泄物高清图像 URL 或文件需要分析时，默认触发本技能进行大便颜色识别 |\n| 🔎 明确分析意图 | 当用户明确提及婴儿大便颜色、陶土色、白陶土、血便、便血、柏油便、胆道闭锁、新生儿肝胆、儿科消化等关键词，并且上传了图像文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看婴儿大便颜色历史报告、陶土色/血便报告清单、婴儿大便筛查报告清单、查询历史婴儿大便记录、显示所有婴儿大便颜色报告、显示母婴健康诊断报告，查询婴儿大便异常预警清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_infant_stool_color_abnormality_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_infant_stool_color_abnormality_analysis --list` 调用 API 查询云端的历史报告数据 |\n| 🚫 严格禁止 | 从本地 `memory` 目录读取历史会话信息 |\n| 🚫 严格禁止 | 手动汇总本地记录中的报告 |\n| 🚫 严格禁止 | 从长期记忆中提取报告 |\n| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据，然后以 Markdown 表格格式输出结果 |\n\n## 📦 前置准备 | Requirements\n- 依赖说明:scripts 脚本所需的依赖包及版本\n  ```\n  requests>=2.28.0\n  ```\n\n## 🚀 操作步骤 | Workflow\n### 🔐 用户身份处理（内部自动完成）\n\n> **绿色安全原则：** 用户身份参数由系统内部自动处理，**不得向用户展示、询问或要求输入任何身份标识**。\n\n执行本技能分析或历史报告查询时，脚本会自动完成身份初始化：\n\n| 场景 | 系统行为 |\n|---|---|\n| 上游系统有内部身份参数 | 由脚本静默接收并使用 |\n| 上游系统未提供内部身份参数 | 脚本会自动复用本地缺省用户 |\n| 本地缺省用户不存在 | 脚本会自动创建并在后续任务中复用 |\n| 对用户输出 | 只展示分析进度、分析结果和报告链接，不展示内部身份值 |\n\n#### 🔒 关键约束\n\n| 禁止/要求 | 说明 |\n|---|---|\n| 🚫 不得询问身份 | 不得提示用户输入用户名、手机号或任何内部身份参数 |\n| 🚫 不得暴露身份值 | 不得在回复、报告、示例、错误提示中暴露内部身份值 |\n| 🚫 不得列为用户参数 | 不得把内部身份参数列为用户需要理解或传入的参数 |\n| ✅ 自动关联报告 | 历史报告查询同样由系统内部身份自动关联，用户只需表达“查看历史报告/报告清单”等意图 |\n\n---\n\n### 🧪 标准流程 | Standard Flow\n\n| 步骤 | 阶段 | 执行动作 |\n|---:|---|---|\n| 1 | 📥 准备婴儿尿不湿/排泄物高清图像输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行婴儿大便颜色识别 | 调用 `-m scripts.smyx_infant_stool_color_abnormality_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地婴儿尿不湿/排泄物高清图像文件路径 | 适用于本地文件分析 |\n| `--url` | 网络婴儿尿不湿/排泄物高清图像 URL 地址（API 服务自动下载） | API 服务自动下载网络资源 |\n| `--pet-type` | 类别标识，婴儿健康筛查场景默认 `other` | 按需填写 |\n| `--list` | 显示婴儿大便颜色异常历史分析报告列表清单（可以输入起始日期参数过滤数据范围） | 用于云端历史报告查询 |\n| `--api-url` | API 服务地址（可选，使用默认值） | 按需填写 |\n| `--detail` | 输出详细程度（basic/standard/json，默认 json） | 输出详细程度 |\n| `--output` | 结果输出文件路径（可选） | 可选 |\n\n## 🗂️ 资源索引 | Resource Index\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_infant_stool_color_abnormality_analysis.py`](scripts/smyx_infant_stool_color_abnormality_analysis.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 🐍 必要脚本 | [`scripts/config.py`](scripts/config.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 📘 领域参考 | [`references/api_doc.md`](references/api_doc.md) | 了解 API 接口规范、字段说明和错误码 | 仅在需要了解接口规范或错误码时读取 |\n\n## ⚠️ 注意事项 | Notes\n| 分类 | 注意事项 |\n|---|---|\n| 📚 文档读取 | 仅在需要时读取参考文档，保持上下文简洁 |\n| 📁 格式支持 | 输入要求：支持 jpg/png 高清图像（建议 1-3 MB），最大 10MB |\n| 🧑‍⚖️ 结果性质 | **本工具仅作家庭/初筛参考，不能替代** 儿科 / 小儿外科 / 影像学（B 超等）检查 |\n| 🔎 使用提醒 | 偏色光（黄光夜灯、暖白光、紫光氛围灯）、滤镜美颜会严重误判颜色，必须在自然白光或冷白光下重拍 |\n| 🔎 使用提醒 | 黑色柏油样需排查是否近期服用铁剂/铋剂；鲜红色也可能为食用红心火龙果/红色辅食所致，需结合病史，但**仍建议就医排查** |\n| 🔎 使用提醒 | **任何 `clay_pale`（白陶土色）结果，无论置信度高低，均必须立即就医**；胆道闭锁手术黄金期 ≤ 60 天，延误可能造成不可逆肝损伤 |\n| 🔏 隐私合规 | 隐私合规：婴儿尿不湿/排泄物图像涉及未成年人隐私，使用前需取得监护人明确知情同意，妥善加密保管 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地婴儿尿不湿/排泄物高清图像\npython -m scripts.smyx_infant_stool_color_abnormality_analysis --input /path/to/diaper.jpg\n\n# 分析网络婴儿尿不湿/排泄物高清图像\npython -m scripts.smyx_infant_stool_color_abnormality_analysis --url https://example.com/diaper.jpg\n\n# 显示历史婴儿大便颜色识别报告（自动触发关键词：查看婴儿大便颜色历史报告、陶土色/血便报告清单等）\npython -m scripts.smyx_infant_stool_color_abnormality_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_infant_stool_color_abnormality_analysis --input diaper.jpg --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_infant_stool_color_abnormality_analysis --input diaper.jpg --output result.json\n```\n\nFile v1.0.3:_meta.json\n\n{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-infant-stool-color-abnormality-analysis\",\n  \"version\": \"1.0.3\",\n  \"publishedAt\": 1784474608876\n}\n\nFile v1.0.3:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放婴儿大便颜色识别（陶土色/血便）API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动婴儿大便颜色识别任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取大便颜色分类与风险结果\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史筛查记录\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_INFANT_STOOL_COLOR_ABNORMALITY_ANALYSIS` - 婴儿大便颜色识别（陶土色/血便）\n\n## 输入约束\n\n- 设备：婴儿护理台上方固定摄像头 / 智能婴儿护理设备 / 手机后置摄像头\n- 拍摄对象：婴儿尿不湿区域（更换时）或直接拍摄排泄物；建议正上方俯拍、距离 15-40 cm\n- **光照要求**：自然白光或冷白 LED 光最佳；**严禁使用偏色光（黄光夜灯、暖光、护肤紫光等会引起严重误判）**；禁用美颜/滤镜\n- 推荐附带可见参考色卡（标准白卡）放在尿不湿旁，便于白平衡校正\n- 图像高清单张 1-3 MB；建议拍摄 1-3 张不同角度\n\n## 大便颜色分类（婴儿适用）\n\n| 颜色类别 | 颜色描述 | 临床意义 | 风险等级 |\n|----------|----------|----------|----------|\n| `normal_yellow` | 金黄色（母乳喂养） | 正常 | safe |\n| `normal_yellow_green` | 黄绿色 / 草绿色 | 大多数情况正常（受饮食影响） | safe |\n| `normal_brown` | 黄褐色 / 棕色（已添加辅食） | 正常 | safe |\n| `clay_pale` | **白陶土色 / 灰白色** | **疑似胆道梗阻 / 胆道闭锁** | **urgent（必须就医）** |\n| `bright_red_blood` | 鲜红色 / 表面带鲜血丝 | 疑似下消化道出血、肛裂 | warning（建议就医） |\n| `dark_red_or_black_tarry` | 暗红色 / 柏油样黑色（且非铁剂引起） | 疑似上消化道出血 | warning（建议就医） |\n| `dark_green_thin` | 大量稀绿色水样 | 可能腹泻 / 喂养异常（参考） | notice |\n| `inconclusive` | 颜色不可判定（光线差/遮挡） | 需重拍 | recapture |\n\n## 输出字段（参考）\n\n- `diaper_or_stool_detected` - 是否检测到尿不湿/排泄物\n- `image_quality` - 图像质量（low / medium / high）\n- `light_quality_score` - 光照质量（0-1）\n- `color_card_calibrated` - 是否进行了色卡白平衡校准\n- `dominant_color_lab` - 主色 Lab 值\n- `dominant_color_rgb` - 主色 RGB 值\n- `stool_color_class` - 颜色分类（见上表）\n- `risk_level` - 风险等级（safe / notice / warning / urgent / recapture）\n- `confidence` - 分类置信度（0-1）\n- `recommended_action` - 建议动作（home_observe / clinic_visit_soon / urgent_hospital_visit / recapture_better_light）\n- `alert_message` - 推送给家长的文本（如\"检测到宝宝大便呈白陶土色，提示可能胆道异常，请立即前往儿科/小儿外科就诊\"）\n\n## 强制规则\n\n- **任何 `clay_pale` 结果（即使置信度较低）都必须返回 `urgent` 级别并强烈建议就医**（胆道闭锁手术黄金窗口期 ≤ 60 天）\n- 黑色柏油样需排查是否近期服用铁剂/铋剂，可在 alert_message 中提示\n\n> 仅输出基于视觉的颜色分类与方向性提示，不提供肝胆/消化道疾病的医学诊断；中高风险务必尽快由儿科/小儿外科医生评估并进行专业检查。\n\nFile v1.0.3:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.3:scripts/config.yaml\n\n{}\n\nFile v1.0.3:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.3:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.3:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.3:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: prod\n\nFile v1.0.3:skill-card.md\n\n## Description: <br>\nAnalyzes infant diaper or stool images or URLs to classify stool color, flag clay-pale or bloody appearances, and return visual screening guidance without making a medical diagnosis. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[smyx-sunjinhui](https://clawhub.ai/user/smyx-sunjinhui) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nExternal users, developers, and care workflows can use this skill to submit infant diaper or stool images for visual color screening and receive a structured report with color class, risk level, confidence, recommended action, and report links. It is for visual screening support only and does not replace pediatric or surgical medical evaluation. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Infant-related images or URLs may be sent to external cloud services. <br>\nMitigation: Use the skill only when external processing is acceptable and guardian consent has been obtained for the media being processed. <br>\nRisk: The skill may create or reuse a persistent local identity and store authentication tokens in a workspace SQLite database. <br>\nMitigation: Review local identity and token storage before deployment, restrict workspace access, and clear stored credentials when they are no longer needed. <br>\nRisk: The skill can retrieve cloud history automatically with limited user-facing control. <br>\nMitigation: Disclose the history retrieval behavior to users and verify that account or identity boundaries are appropriate before enabling history queries. <br>\nRisk: Image quality, lighting, filters, or color cast can lead to misleading visual screening results. <br>\nMitigation: Require clear images in natural white or cool white light, avoid filters, and direct users to seek medical evaluation for clay-pale, bloody, or otherwise concerning results. <br>\n\n\n## Reference(s): <br>\n- [Infant stool color API reference](references/api_doc.md) <br>\n- [Skill demo](https://lifeemergence.com/sample.html) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [text, markdown, JSON, shell commands, configuration, guidance] <br>\n**Output Format:** [Markdown or JSON screening report with color class, risk level, confidence, recommended action, alert text, and report links.] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [May write the report to a local output file when requested.] <br>\n\n## Skill Version(s): <br>\n1.0.3 (source: server-resolved release metadata; SKILL.md frontmatter reports 1.0.0) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nFile v1.0.3:skills/smyx_analysis/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nyaml==6.0.3\n\nFile v1.0.3:skills/smyx_common/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nPyYAML==6.0.3\n\nArchive v1.0.2: 31 files, 41678 bytes\n\nFiles: references/api_doc.md (3523b), scripts/__init__.py (58b), scripts/config.py (705b), scripts/config.yaml (3b), scripts/skill.py (595b), scripts/smyx_infant_stool_color_abnormality_analysis.py (3656b), skill-card.md (2962b), SKILL.md (13177b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (22987b), skills/smyx_common/scripts/config.yaml (473b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28605b), _meta.json (163b)\n\nFile v1.0.2:SKILL.md\n\n---\nname: \"smyx-infant-stool-color-abnormality-analysis\"\ndescription: \"Using a fixed camera above the baby-changing table or a smartphone, the system captures high-resolution images of the diaper area (or the stool itself), and uses AI visual analysis to identify stool color: normal yellow / yellow-green, abnormal clay-pale (white/clay-like, suggesting biliary obstruction), bright red (lower-GI bleeding), dark red / tarry black (upper-GI bleeding), etc. | 通过婴儿护理台上方固定摄像头或手机拍摄尿不湿区域（或直接拍摄排泄物）的高清图像，利用AI视觉分析技术识别大便颜色，包括正常黄色/黄绿色、异常陶土色（白陶土样，提示胆道梗阻）、鲜红色（下消化道出血）、暗红色/黑色（上消化道出血）等。当检测到异常颜色时，输出风险提醒，建议家长及时就医。\"\nversion: \"1.0.0\"\nlicense: \"MIT-0\"\n---\n\n# 🍼 Infant Stool Color Abnormality (Clay-Pale / Bloody) | 婴儿大便颜色识别（陶土色/血便）\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **婴儿大便颜色识别（陶土色/血便）** |\n| 🎯 核心目标 | 通过婴儿护理台上方固定摄像头或手机拍摄尿不湿区域（或直接拍摄排泄物）的高清图像，利用AI视觉分析技术识别大便颜色，包括正常黄色/黄绿色、异常陶土色（白陶土样，提示胆道梗阻）、鲜红色（下消化道出血）、暗红色/黑色（上消化道出血）等。当检测到异常颜色时，输出风险提醒，建议家长及时就医。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_INFANT_STOOL_COLOR_ABNORMALITY_ANALYSIS` |\n\nUsing a fixed camera above the baby-changing table or a smartphone, the system captures high-resolution images of the diaper area (or the stool itself), and uses AI visual analysis to identify stool color: normal yellow / yellow-green, abnormal clay-pale (white/clay-like, suggesting biliary obstruction), bright red (lower-GI bleeding), dark red / tarry black (upper-GI bleeding), etc. When abnormal colors are detected, it outputs risk reminders and recommends parents to seek medical care. The skill helps with early detection of infant hepato-biliary disease or GI bleeding. Application scenarios: newborn families, pediatric clinics, postpartum care centers. When changing diapers, parents take a photo with the camera and the system automatically analyzes and pushes results. Skill features: abnormal infant stool color (especially clay-pale) is an early signal of severe diseases such as biliary atresia; early detection and surgery can save lives. AI auto-recognition helps parents stay alert in time and avoid delayed treatment. Can be integrated into parenting apps or smart infant-care devices, becoming a safety net for newborn families.\n\n通过婴儿护理台上方固定摄像头或手机拍摄尿不湿区域（或直接拍摄排泄物）的高清图像，利用AI视觉分析技术识别大便颜色，包括正常黄色/黄绿色、异常陶土色（白陶土样，提示胆道梗阻）、鲜红色（下消化道出血）、暗红色/黑色（上消化道出血）等。当检测到异常颜色时，输出风险提醒，建议家长及时就医。该技能有助于早期发现婴儿肝胆疾病或消化道出血。应用场景：新生儿家庭、儿科门诊、月子中心。家长在更换尿不湿时用摄像头拍照，系统自动分析并推送结果。技能特点：婴儿大便颜色异常（尤其是陶土色）是胆道闭锁等严重疾病的早期信号，若能早期发现并手术，可挽救生命。通过AI自动识别，可帮助家长及时警觉，避免延误病情。该技能可集成到育儿APP或智能婴儿护理设备中，成为新生儿家庭的安全保障。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的婴儿健康筛查 AI。你的任务是分析尿不湿区域或排泄物的高清图像，检测大便颜色，区分正常与异常（陶土色、血便等）。不要提供医疗诊断或临床结论，仅输出基于视觉的颜色分类与方向性风险提示；对疑似 `clay_pale` 必须强烈建议尽快就医，警惕胆道闭锁等危及生命的疾病。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于婴儿尿不湿/排泄物高清图像，识别大便颜色类别 → 输出风险等级 + 推送家长可执行建议\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 尿不湿/排泄物区域检测 |\n| 2 | 图像质量与光照质量评分 |\n| 3 | 参考色卡白平衡校正 |\n| 4 | 主色提取（Lab / RGB） |\n| 5 | 颜色分类（normal_yellow / normal_yellow_green / normal_brown / clay_pale / bright_red_blood / dark_red_or_black_tarry / dark_green_thin / inconclusive） |\n| 6 | 风险等级与置信度判定 |\n| 7 | 家长推送文本与建议动作（home_observe / clinic_visit_soon / urgent_hospital_visit / recapture_better_light） |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供婴儿尿不湿/排泄物高清图像 URL 或文件需要分析时，默认触发本技能进行大便颜色识别 |\n| 🔎 明确分析意图 | 当用户明确提及婴儿大便颜色、陶土色、白陶土、血便、便血、柏油便、胆道闭锁、新生儿肝胆、儿科消化等关键词，并且上传了图像文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看婴儿大便颜色历史报告、陶土色/血便报告清单、婴儿大便筛查报告清单、查询历史婴儿大便记录、显示所有婴儿大便颜色报告、显示母婴健康诊断报告，查询婴儿大便异常预警清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_infant_stool_color_abnormality_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_infant_stool_color_abnormality_analysis --list` 调用 API 查询云端的历史报告数据 |\n| 🚫 严格禁止 | 从本地 `memory` 目录读取历史会话信息 |\n| 🚫 严格禁止 | 手动汇总本地记录中的报告 |\n| 🚫 严格禁止 | 从长期记忆中提取报告 |\n| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据，然后以 Markdown 表格格式输出结果 |\n\n## 📦 前置准备 | Requirements\n- 依赖说明:scripts 脚本所需的依赖包及版本\n  ```\n  requests>=2.28.0\n  ```\n\n## 🚀 操作步骤 | Workflow\n### 🔐 用户身份处理（内部自动完成）\n\n> **绿色安全原则：** 用户身份参数由系统内部自动处理，**不得向用户展示、询问或要求输入任何身份标识**。\n\n执行本技能分析或历史报告查询时，脚本会自动完成身份初始化：\n\n| 场景 | 系统行为 |\n|---|---|\n| 上游系统有内部身份参数 | 由脚本静默接收并使用 |\n| 上游系统未提供内部身份参数 | 脚本会自动复用本地缺省用户 |\n| 本地缺省用户不存在 | 脚本会自动创建并在后续任务中复用 |\n| 对用户输出 | 只展示分析进度、分析结果和报告链接，不展示内部身份值 |\n\n#### 🔒 关键约束\n\n| 禁止/要求 | 说明 |\n|---|---|\n| 🚫 不得询问身份 | 不得提示用户输入用户名、手机号或任何内部身份参数 |\n| 🚫 不得暴露身份值 | 不得在回复、报告、示例、错误提示中暴露内部身份值 |\n| 🚫 不得列为用户参数 | 不得把内部身份参数列为用户需要理解或传入的参数 |\n| ✅ 自动关联报告 | 历史报告查询同样由系统内部身份自动关联，用户只需表达“查看历史报告/报告清单”等意图 |\n\n---\n\n### 🧪 标准流程 | Standard Flow\n\n| 步骤 | 阶段 | 执行动作 |\n|---:|---|---|\n| 1 | 📥 准备婴儿尿不湿/排泄物高清图像输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行婴儿大便颜色识别 | 调用 `-m scripts.smyx_infant_stool_color_abnormality_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地婴儿尿不湿/排泄物高清图像文件路径 | 适用于本地文件分析 |\n| `--url` | 网络婴儿尿不湿/排泄物高清图像 URL 地址（API 服务自动下载） | API 服务自动下载网络资源 |\n| `--pet-type` | 类别标识，婴儿健康筛查场景默认 `other` | 按需填写 |\n| `--list` | 显示婴儿大便颜色异常历史分析报告列表清单（可以输入起始日期参数过滤数据范围） | 用于云端历史报告查询 |\n| `--api-url` | API 服务地址（可选，使用默认值） | 按需填写 |\n| `--detail` | 输出详细程度（basic/standard/json，默认 json） | 输出详细程度 |\n| `--output` | 结果输出文件路径（可选） | 可选 |\n\n## 🗂️ 资源索引 | Resource Index\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_infant_stool_color_abnormality_analysis.py`](scripts/smyx_infant_stool_color_abnormality_analysis.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 🐍 必要脚本 | [`scripts/config.py`](scripts/config.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 📘 领域参考 | [`references/api_doc.md`](references/api_doc.md) | 了解 API 接口规范、字段说明和错误码 | 仅在需要了解接口规范或错误码时读取 |\n\n## ⚠️ 注意事项 | Notes\n| 分类 | 注意事项 |\n|---|---|\n| 📚 文档读取 | 仅在需要时读取参考文档，保持上下文简洁 |\n| 📁 格式支持 | 输入要求：支持 jpg/png 高清图像（建议 1-3 MB），最大 10MB |\n| 🧑‍⚖️ 结果性质 | **本工具仅作家庭/初筛参考，不能替代** 儿科 / 小儿外科 / 影像学（B 超等）检查 |\n| 🔎 使用提醒 | 偏色光（黄光夜灯、暖白光、紫光氛围灯）、滤镜美颜会严重误判颜色，必须在自然白光或冷白光下重拍 |\n| 🔎 使用提醒 | 黑色柏油样需排查是否近期服用铁剂/铋剂；鲜红色也可能为食用红心火龙果/红色辅食所致，需结合病史，但**仍建议就医排查** |\n| 🔎 使用提醒 | **任何 `clay_pale`（白陶土色）结果，无论置信度高低，均必须立即就医**；胆道闭锁手术黄金期 ≤ 60 天，延误可能造成不可逆肝损伤 |\n| 🔏 隐私合规 | 隐私合规：婴儿尿不湿/排泄物图像涉及未成年人隐私，使用前需取得监护人明确知情同意，妥善加密保管 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地婴儿尿不湿/排泄物高清图像\npython -m scripts.smyx_infant_stool_color_abnormality_analysis --input /path/to/diaper.jpg\n\n# 分析网络婴儿尿不湿/排泄物高清图像\npython -m scripts.smyx_infant_stool_color_abnormality_analysis --url https://example.com/diaper.jpg\n\n# 显示历史婴儿大便颜色识别报告（自动触发关键词：查看婴儿大便颜色历史报告、陶土色/血便报告清单等）\npython -m scripts.smyx_infant_stool_color_abnormality_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_infant_stool_color_abnormality_analysis --input diaper.jpg --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_infant_stool_color_abnormality_analysis --input diaper.jpg --output result.json\n```\n\nFile v1.0.2:_meta.json\n\n{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-infant-stool-color-abnormality-analysis\",\n  \"version\": \"1.0.2\",\n  \"publishedAt\": 1783066706964\n}\n\nFile v1.0.2:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放婴儿大便颜色识别（陶土色/血便）API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动婴儿大便颜色识别任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取大便颜色分类与风险结果\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史筛查记录\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_INFANT_STOOL_COLOR_ABNORMALITY_ANALYSIS` - 婴儿大便颜色识别（陶土色/血便）\n\n## 输入约束\n\n- 设备：婴儿护理台上方固定摄像头 / 智能婴儿护理设备 / 手机后置摄像头\n- 拍摄对象：婴儿尿不湿区域（更换时）或直接拍摄排泄物；建议正上方俯拍、距离 15-40 cm\n- **光照要求**：自然白光或冷白 LED 光最佳；**严禁使用偏色光（黄光夜灯、暖光、护肤紫光等会引起严重误判）**；禁用美颜/滤镜\n- 推荐附带可见参考色卡（标准白卡）放在尿不湿旁，便于白平衡校正\n- 图像高清单张 1-3 MB；建议拍摄 1-3 张不同角度\n\n## 大便颜色分类（婴儿适用）\n\n| 颜色类别 | 颜色描述 | 临床意义 | 风险等级 |\n|----------|----------|----------|----------|\n| `normal_yellow` | 金黄色（母乳喂养） | 正常 | safe |\n| `normal_yellow_green` | 黄绿色 / 草绿色 | 大多数情况正常（受饮食影响） | safe |\n| `normal_brown` | 黄褐色 / 棕色（已添加辅食） | 正常 | safe |\n| `clay_pale` | **白陶土色 / 灰白色** | **疑似胆道梗阻 / 胆道闭锁** | **urgent（必须就医）** |\n| `bright_red_blood` | 鲜红色 / 表面带鲜血丝 | 疑似下消化道出血、肛裂 | warning（建议就医） |\n| `dark_red_or_black_tarry` | 暗红色 / 柏油样黑色（且非铁剂引起） | 疑似上消化道出血 | warning（建议就医） |\n| `dark_green_thin` | 大量稀绿色水样 | 可能腹泻 / 喂养异常（参考） | notice |\n| `inconclusive` | 颜色不可判定（光线差/遮挡） | 需重拍 | recapture |\n\n## 输出字段（参考）\n\n- `diaper_or_stool_detected` - 是否检测到尿不湿/排泄物\n- `image_quality` - 图像质量（low / medium / high）\n- `light_quality_score` - 光照质量（0-1）\n- `color_card_calibrated` - 是否进行了色卡白平衡校准\n- `dominant_color_lab` - 主色 Lab 值\n- `dominant_color_rgb` - 主色 RGB 值\n- `stool_color_class` - 颜色分类（见上表）\n- `risk_level` - 风险等级（safe / notice / warning / urgent / recapture）\n- `confidence` - 分类置信度（0-1）\n- `recommended_action` - 建议动作（home_observe / clinic_visit_soon / urgent_hospital_visit / recapture_better_light）\n- `alert_message` - 推送给家长的文本（如\"检测到宝宝大便呈白陶土色，提示可能胆道异常，请立即前往儿科/小儿外科就诊\"）\n\n## 强制规则\n\n- **任何 `clay_pale` 结果（即使置信度较低）都必须返回 `urgent` 级别并强烈建议就医**（胆道闭锁手术黄金窗口期 ≤ 60 天）\n- 黑色柏油样需排查是否近期服用铁剂/铋剂，可在 alert_message 中提示\n\n> 仅输出基于视觉的颜色分类与方向性提示，不提供肝胆/消化道疾病的医学诊断；中高风险务必尽快由儿科/小儿外科医生评估并进行专业检查。\n\nFile v1.0.2:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.2:scripts/config.yaml\n\n{}\n\nFile v1.0.2:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.2:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.2:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.2:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: prod\n\nFile v1.0.2:skill-card.md\n\n## Description: <br>\nAnalyzes infant diaper or stool images and videos to classify stool color, flag clay-pale or bloody results, and provide directional risk reminders with parent-facing next steps. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[smyx-sunjinhui](https://clawhub.ai/user/smyx-sunjinhui) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nExternal caregivers, newborn families, pediatric clinics, and postpartum care centers use this skill for preliminary visual screening of infant stool color from diaper or stool media. The skill supports early risk reminders and report lookup, but it is not a medical diagnosis. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Infant diaper or stool images and report queries may contain sensitive child health information and are sent to the Life Emergence cloud service. <br>\nMitigation: Use only with guardian consent, submit only relevant media, avoid unrelated photos or videos, and review the provider's retention and privacy terms before real-world use. <br>\nRisk: The skill can create or reuse a local identity, perform remote login or registration, and persist session tokens locally. <br>\nMitigation: Run in an isolated workspace, restrict access to local data and token files, and clear local identity/session state when the workflow no longer needs it. <br>\nRisk: Visual color screening can be affected by lighting, filters, image quality, and clinical context. <br>\nMitigation: Treat results as preliminary screening guidance, retake unclear images under natural or cool white light, and direct caregivers to professional medical evaluation for clay-pale, bloody, black/tarry, or otherwise concerning results. <br>\n\n\n## Reference(s): <br>\n- [Infant stool color abnormality API documentation](artifact/references/api_doc.md) <br>\n- [Shared SMYX analysis API documentation](artifact/skills/smyx_analysis/references/api_doc.md) <br>\n- [Skill demo](https://lifeemergence.com/sample.html) <br>\n- [ClawHub skill page](https://clawhub.ai/smyx-sunjinhui/skills/smyx-infant-stool-color-abnormality-analysis) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [Text, Markdown, JSON, Files, Guidance] <br>\n**Output Format:** [Markdown/plain text report or JSON, with optional saved output file] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [May include stool color class, risk level, confidence, recommended action, alert message, historical report data, and report export link.] <br>\n\n## Skill Version(s): <br>\n1.0.2 (source: server release metadata; artifact frontmatter says 1.0.0) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nFile v1.0.2:skills/smyx_analysis/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nyaml==6.0.3\n\nFile v1.0.2:skills/smyx_common/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nPyYAML==6.0.3\n\nArchive v1.0.1: 31 files, 38725 bytes\n\nFiles: references/api_doc.md (3523b), scripts/__init__.py (58b), scripts/config.py (705b), scripts/config.yaml (3b), scripts/skill.py (595b), scripts/smyx_infant_stool_color_abnormality_analysis.py (3656b), skill-card.md (2890b), SKILL.md (13177b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (22801b), skills/smyx_common/scripts/config.yaml (473b), skills/smyx_common/scripts/dao.py (13468b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (23409b), _meta.json (163b)\n\nFile v1.0.1:SKILL.md\n\n---\nname: \"smyx-infant-stool-color-abnormality-analysis\"\ndescription: \"Using a fixed camera above the baby-changing table or a smartphone, the system captures high-resolution images of the diaper area (or the stool itself), and uses AI visual analysis to identify stool color: normal yellow / yellow-green, abnormal clay-pale (white/clay-like, suggesting biliary obstruction), bright red (lower-GI bleeding), dark red / tarry black (upper-GI bleeding), etc. | 通过婴儿护理台上方固定摄像头或手机拍摄尿不湿区域（或直接拍摄排泄物）的高清图像，利用AI视觉分析技术识别大便颜色，包括正常黄色/黄绿色、异常陶土色（白陶土样，提示胆道梗阻）、鲜红色（下消化道出血）、暗红色/黑色（上消化道出血）等。当检测到异常颜色时，输出风险提醒，建议家长及时就医。\"\nversion: \"1.0.0\"\nlicense: \"MIT-0\"\n---\n\n# 🍼 Infant Stool Color Abnormality (Clay-Pale / Bloody) | 婴儿大便颜色识别（陶土色/血便）\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **婴儿大便颜色识别（陶土色/血便）** |\n| 🎯 核心目标 | 通过婴儿护理台上方固定摄像头或手机拍摄尿不湿区域（或直接拍摄排泄物）的高清图像，利用AI视觉分析技术识别大便颜色，包括正常黄色/黄绿色、异常陶土色（白陶土样，提示胆道梗阻）、鲜红色（下消化道出血）、暗红色/黑色（上消化道出血）等。当检测到异常颜色时，输出风险提醒，建议家长及时就医。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_INFANT_STOOL_COLOR_ABNORMALITY_ANALYSIS` |\n\nUsing a fixed camera above the baby-changing table or a smartphone, the system captures high-resolution images of the diaper area (or the stool itself), and uses AI visual analysis to identify stool color: normal yellow / yellow-green, abnormal clay-pale (white/clay-like, suggesting biliary obstruction), bright red (lower-GI bleeding), dark red / tarry black (upper-GI bleeding), etc. When abnormal colors are detected, it outputs risk reminders and recommends parents to seek medical care. The skill helps with early detection of infant hepato-biliary disease or GI bleeding. Application scenarios: newborn families, pediatric clinics, postpartum care centers. When changing diapers, parents take a photo with the camera and the system automatically analyzes and pushes results. Skill features: abnormal infant stool color (especially clay-pale) is an early signal of severe diseases such as biliary atresia; early detection and surgery can save lives. AI auto-recognition helps parents stay alert in time and avoid delayed treatment. Can be integrated into parenting apps or smart infant-care devices, becoming a safety net for newborn families.\n\n通过婴儿护理台上方固定摄像头或手机拍摄尿不湿区域（或直接拍摄排泄物）的高清图像，利用AI视觉分析技术识别大便颜色，包括正常黄色/黄绿色、异常陶土色（白陶土样，提示胆道梗阻）、鲜红色（下消化道出血）、暗红色/黑色（上消化道出血）等。当检测到异常颜色时，输出风险提醒，建议家长及时就医。该技能有助于早期发现婴儿肝胆疾病或消化道出血。应用场景：新生儿家庭、儿科门诊、月子中心。家长在更换尿不湿时用摄像头拍照，系统自动分析并推送结果。技能特点：婴儿大便颜色异常（尤其是陶土色）是胆道闭锁等严重疾病的早期信号，若能早期发现并手术，可挽救生命。通过AI自动识别，可帮助家长及时警觉，避免延误病情。该技能可集成到育儿APP或智能婴儿护理设备中，成为新生儿家庭的安全保障。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的婴儿健康筛查 AI。你的任务是分析尿不湿区域或排泄物的高清图像，检测大便颜色，区分正常与异常（陶土色、血便等）。不要提供医疗诊断或临床结论，仅输出基于视觉的颜色分类与方向性风险提示；对疑似 `clay_pale` 必须强烈建议尽快就医，警惕胆道闭锁等危及生命的疾病。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于婴儿尿不湿/排泄物高清图像，识别大便颜色类别 → 输出风险等级 + 推送家长可执行建议\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 尿不湿/排泄物区域检测 |\n| 2 | 图像质量与光照质量评分 |\n| 3 | 参考色卡白平衡校正 |\n| 4 | 主色提取（Lab / RGB） |\n| 5 | 颜色分类（normal_yellow / normal_yellow_green / normal_brown / clay_pale / bright_red_blood / dark_red_or_black_tarry / dark_green_thin / inconclusive） |\n| 6 | 风险等级与置信度判定 |\n| 7 | 家长推送文本与建议动作（home_observe / clinic_visit_soon / urgent_hospital_visit / recapture_better_light） |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供婴儿尿不湿/排泄物高清图像 URL 或文件需要分析时，默认触发本技能进行大便颜色识别 |\n| 🔎 明确分析意图 | 当用户明确提及婴儿大便颜色、陶土色、白陶土、血便、便血、柏油便、胆道闭锁、新生儿肝胆、儿科消化等关键词，并且上传了图像文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看婴儿大便颜色历史报告、陶土色/血便报告清单、婴儿大便筛查报告清单、查询历史婴儿大便记录、显示所有婴儿大便颜色报告、显示母婴健康诊断报告，查询婴儿大便异常预警清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_infant_stool_color_abnormality_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_infant_stool_color_abnormality_analysis --list` 调用 API 查询云端的历史报告数据 |\n| 🚫 严格禁止 | 从本地 `memory` 目录读取历史会话信息 |\n| 🚫 严格禁止 | 手动汇总本地记录中的报告 |\n| 🚫 严格禁止 | 从长期记忆中提取报告 |\n| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据，然后以 Markdown 表格格式输出结果 |\n\n## 📦 前置准备 | Requirements\n- 依赖说明:scripts 脚本所需的依赖包及版本\n  ```\n  requests>=2.28.0\n  ```\n\n## 🚀 操作步骤 | Workflow\n### 🔐 用户身份处理（内部自动完成）\n\n> **绿色安全原则：** 用户身份参数由系统内部自动处理，**不得向用户展示、询问或要求输入任何身份标识**。\n\n执行本技能分析或历史报告查询时，脚本会自动完成身份初始化：\n\n| 场景 | 系统行为 |\n|---|---|\n| 上游系统有内部身份参数 | 由脚本静默接收并使用 |\n| 上游系统未提供内部身份参数 | 脚本会自动复用本地缺省用户 |\n| 本地缺省用户不存在 | 脚本会自动创建并在后续任务中复用 |\n| 对用户输出 | 只展示分析进度、分析结果和报告链接，不展示内部身份值 |\n\n#### 🔒 关键约束\n\n| 禁止/要求 | 说明 |\n|---|---|\n| 🚫 不得询问身份 | 不得提示用户输入用户名、手机号或任何内部身份参数 |\n| 🚫 不得暴露身份值 | 不得在回复、报告、示例、错误提示中暴露内部身份值 |\n| 🚫 不得列为用户参数 | 不得把内部身份参数列为用户需要理解或传入的参数 |\n| ✅ 自动关联报告 | 历史报告查询同样由系统内部身份自动关联，用户只需表达“查看历史报告/报告清单”等意图 |\n\n---\n\n### 🧪 标准流程 | Standard Flow\n\n| 步骤 | 阶段 | 执行动作 |\n|---:|---|---|\n| 1 | 📥 准备婴儿尿不湿/排泄物高清图像输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行婴儿大便颜色识别 | 调用 `-m scripts.smyx_infant_stool_color_abnormality_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地婴儿尿不湿/排泄物高清图像文件路径 | 适用于本地文件分析 |\n| `--url` | 网络婴儿尿不湿/排泄物高清图像 URL 地址（API 服务自动下载） | API 服务自动下载网络资源 |\n| `--pet-type` | 类别标识，婴儿健康筛查场景默认 `other` | 按需填写 |\n| `--list` | 显示婴儿大便颜色异常历史分析报告列表清单（可以输入起始日期参数过滤数据范围） | 用于云端历史报告查询 |\n| `--api-url` | API 服务地址（可选，使用默认值） | 按需填写 |\n| `--detail` | 输出详细程度（basic/standard/json，默认 json） | 输出详细程度 |\n| `--output` | 结果输出文件路径（可选） | 可选 |\n\n## 🗂️ 资源索引 | Resource Index\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_infant_stool_color_abnormality_analysis.py`](scripts/smyx_infant_stool_color_abnormality_analysis.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 🐍 必要脚本 | [`scripts/config.py`](scripts/config.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 📘 领域参考 | [`references/api_doc.md`](references/api_doc.md) | 了解 API 接口规范、字段说明和错误码 | 仅在需要了解接口规范或错误码时读取 |\n\n## ⚠️ 注意事项 | Notes\n| 分类 | 注意事项 |\n|---|---|\n| 📚 文档读取 | 仅在需要时读取参考文档，保持上下文简洁 |\n| 📁 格式支持 | 输入要求：支持 jpg/png 高清图像（建议 1-3 MB），最大 10MB |\n| 🧑‍⚖️ 结果性质 | **本工具仅作家庭/初筛参考，不能替代** 儿科 / 小儿外科 / 影像学（B 超等）检查 |\n| 🔎 使用提醒 | 偏色光（黄光夜灯、暖白光、紫光氛围灯）、滤镜美颜会严重误判颜色，必须在自然白光或冷白光下重拍 |\n| 🔎 使用提醒 | 黑色柏油样需排查是否近期服用铁剂/铋剂；鲜红色也可能为食用红心火龙果/红色辅食所致，需结合病史，但**仍建议就医排查** |\n| 🔎 使用提醒 | **任何 `clay_pale`（白陶土色）结果，无论置信度高低，均必须立即就医**；胆道闭锁手术黄金期 ≤ 60 天，延误可能造成不可逆肝损伤 |\n| 🔏 隐私合规 | 隐私合规：婴儿尿不湿/排泄物图像涉及未成年人隐私，使用前需取得监护人明确知情同意，妥善加密保管 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地婴儿尿不湿/排泄物高清图像\npython -m scripts.smyx_infant_stool_color_abnormality_analysis --input /path/to/diaper.jpg\n\n# 分析网络婴儿尿不湿/排泄物高清图像\npython -m scripts.smyx_infant_stool_color_abnormality_analysis --url https://example.com/diaper.jpg\n\n# 显示历史婴儿大便颜色识别报告（自动触发关键词：查看婴儿大便颜色历史报告、陶土色/血便报告清单等）\npython -m scripts.smyx_infant_stool_color_abnormality_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_infant_stool_color_abnormality_analysis --input diaper.jpg --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_infant_stool_color_abnormality_analysis --input diaper.jpg --output result.json\n```\n\nFile v1.0.1:_meta.json\n\n{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-infant-stool-color-abnormality-analysis\",\n  \"version\": \"1.0.1\",\n  \"publishedAt\": 1782595465769\n}\n\nFile v1.0.1:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放婴儿大便颜色识别（陶土色/血便）API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动婴儿大便颜色识别任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取大便颜色分类与风险结果\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史筛查记录\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_INFANT_STOOL_COLOR_ABNORMALITY_ANALYSIS` - 婴儿大便颜色识别（陶土色/血便）\n\n## 输入约束\n\n- 设备：婴儿护理台上方固定摄像头 / 智能婴儿护理设备 / 手机后置摄像头\n- 拍摄对象：婴儿尿不湿区域（更换时）或直接拍摄排泄物；建议正上方俯拍、距离 15-40 cm\n- **光照要求**：自然白光或冷白 LED 光最佳；**严禁使用偏色光（黄光夜灯、暖光、护肤紫光等会引起严重误判）**；禁用美颜/滤镜\n- 推荐附带可见参考色卡（标准白卡）放在尿不湿旁，便于白平衡校正\n- 图像高清单张 1-3 MB；建议拍摄 1-3 张不同角度\n\n## 大便颜色分类（婴儿适用）\n\n| 颜色类别 | 颜色描述 | 临床意义 | 风险等级 |\n|----------|----------|----------|----------|\n| `normal_yellow` | 金黄色（母乳喂养） | 正常 | safe |\n| `normal_yellow_green` | 黄绿色 / 草绿色 | 大多数情况正常（受饮食影响） | safe |\n| `normal_brown` | 黄褐色 / 棕色（已添加辅食） | 正常 | safe |\n| `clay_pale` | **白陶土色 / 灰白色** | **疑似胆道梗阻 / 胆道闭锁** | **urgent（必须就医）** |\n| `bright_red_blood` | 鲜红色 / 表面带鲜血丝 | 疑似下消化道出血、肛裂 | warning（建议就医） |\n| `dark_red_or_black_tarry` | 暗红色 / 柏油样黑色（且非铁剂引起） | 疑似上消化道出血 | warning（建议就医） |\n| `dark_green_thin` | 大量稀绿色水样 | 可能腹泻 / 喂养异常（参考） | notice |\n| `inconclusive` | 颜色不可判定（光线差/遮挡） | 需重拍 | recapture |\n\n## 输出字段（参考）\n\n- `diaper_or_stool_detected` - 是否检测到尿不湿/排泄物\n- `image_quality` - 图像质量（low / medium / high）\n- `light_quality_score` - 光照质量（0-1）\n- `color_card_calibrated` - 是否进行了色卡白平衡校准\n- `dominant_color_lab` - 主色 Lab 值\n- `dominant_color_rgb` - 主色 RGB 值\n- `stool_color_class` - 颜色分类（见上表）\n- `risk_level` - 风险等级（safe / notice / warning / urgent / recapture）\n- `confidence` - 分类置信度（0-1）\n- `recommended_action` - 建议动作（home_observe / clinic_visit_soon / urgent_hospital_visit / recapture_better_light）\n- `alert_message` - 推送给家长的文本（如\"检测到宝宝大便呈白陶土色，提示可能胆道异常，请立即前往儿科/小儿外科就诊\"）\n\n## 强制规则\n\n- **任何 `clay_pale` 结果（即使置信度较低）都必须返回 `urgent` 级别并强烈建议就医**（胆道闭锁手术黄金窗口期 ≤ 60 天）\n- 黑色柏油样需排查是否近期服用铁剂/铋剂，可在 alert_message 中提示\n\n> 仅输出基于视觉的颜色分类与方向性提示，不提供肝胆/消化道疾病的医学诊断；中高风险务必尽快由儿科/小儿外科医生评估并进行专业检查。\n\nFile v1.0.1:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.1:scripts/config.yaml\n\n{}\n\nFile v1.0.1:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.1:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.1:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.1:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: prod\n\nFile v1.0.1:skill-card.md\n\n## Description: <br>\nAnalyzes infant diaper or stool images and videos to classify stool color, flag clay-pale or bloody findings, and return structured risk guidance and report links. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[smyx-sunjinhui](https://clawhub.ai/user/smyx-sunjinhui) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nExternal caregivers, pediatric-adjacent staff, and developers use this skill to submit infant diaper or stool media for visual color screening and to retrieve cloud-stored screening report history. It provides directional risk prompts only and is not a medical diagnosis. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Sensitive infant health images are uploaded to remote services for analysis. <br>\nMitigation: Use only with explicit guardian consent and only when the publisher and backend service are trusted for handling minor health data. <br>\nRisk: The skill can silently create or reuse a cloud-linked identity and store local account tokens. <br>\nMitigation: Review local identity and token storage before deployment, restrict workspace access, and require clear account-control procedures for users. <br>\nRisk: Cloud history retrieval can expose prior screening reports. <br>\nMitigation: Limit use to environments where report access is authorized and where retention, deletion, and access-control expectations are documented. <br>\nRisk: Visual stool-color screening can be misleading under poor lighting or with filtered images. <br>\nMitigation: Require clear natural or cool-white lighting, avoid filters, and treat abnormal or inconclusive results as prompts for professional pediatric review rather than diagnosis. <br>\n\n\n## Reference(s): <br>\n- [ClawHub Skill Page](https://clawhub.ai/smyx-sunjinhui/skills/smyx-infant-stool-color-abnormality-analysis) <br>\n- [Infant Stool Color API Documentation](references/api_doc.md) <br>\n- [SMYX Analysis API Documentation](skills/smyx_analysis/references/api_doc.md) <br>\n- [Skill Demo](https://lifeemergence.com/sample.html) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [Text, Markdown, JSON, Guidance, Shell commands] <br>\n**Output Format:** [Markdown text with structured JSON report content and report links] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [May save analysis output to a user-specified file and may render history results as a Markdown table.] <br>\n\n## Skill Version(s): <br>\n1.0.1 (source: server release metadata; artifact frontmatter says 1.0.0) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nFile v1.0.1:skills/smyx_analysis/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nyaml==6.0.3\n\nFile v1.0.1:skills/smyx_common/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nPyYAML==6.0.3","readmeExcerpt":"Skill: Infant Stool Color Abnormality (Clay-Pale / Bloody) | 婴儿大便颜色识别（陶土色/血便） Owner: smyx-sunjinhui Summary: Using a fixed camera above the baby-changing table or a smartphone, the system captures high-resolution images of the diaper area (or the stool itself), and uses AI visual analysis to identify stool color: normal yellow / yellow-green, abnormal clay-pale (white/clay-like, suggesting biliary obstruction), brigh","codeSnippets":[],"executableExamples":[{"language":"bash","snippet":"python -m scripts.smyx_infant_stool_color_abnormality_analysis --list"},{"language":"text","snippet":"requests>=2.28.0"},{"language":"bash","snippet":"# 分析本地婴儿尿不湿/排泄物高清图像\npython -m scripts.smyx_infant_stool_color_abnormality_analysis --input /path/to/diaper.jpg\n\n# 分析网络婴儿尿不湿/排泄物高清图像\npython -m scripts.smyx_infant_stool_color_abnormality_analysis --url https://example.com/diaper.jpg\n\n# 显示历史婴儿大便颜色识别报告（自动触发关键词：查看婴儿大便颜色历史报告、陶土色/血便报告清单等）\npython -m scripts.smyx_infant_stool_color_abnormality_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_infant_stool_color_abnormality_analysis --input diaper.jpg --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_infant_stool_color_abnormality_analysis --input diaper.jpg --output result.json"},{"language":"bash","snippet":"python -m scripts.smyx_infant_stool_color_abnormality_analysis --list"},{"language":"text","snippet":"requests>=2.28.0"},{"language":"bash","snippet":"# 分析本地婴儿尿不湿/排泄物高清图像\npython -m scripts.smyx_infant_stool_color_abnormality_analysis --input /path/to/diaper.jpg\n\n# 分析网络婴儿尿不湿/排泄物高清图像\npython -m scripts.smyx_infant_stool_color_abnormality_analysis --url https://example.com/diaper.jpg\n\n# 显示历史婴儿大便颜色识别报告（自动触发关键词：查看婴儿大便颜色历史报告、陶土色/血便报告清单等）\npython -m scripts.smyx_infant_stool_color_abnormality_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_infant_stool_color_abnormality_analysis --input diaper.jpg --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_infant_stool_color_abnormality_analysis --input diaper.jpg --output result.json"}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\nname: \"smyx-infant-stool-color-abnormality-analysis\"\ndescription: \"Using a fixed camera above the baby-changing table or a smartphone, the system captures high-resolution images of the diaper area (or the stool itself), and uses AI visual analysis to identify stool color: normal yellow / yellow-green, abnormal clay-pale (white/clay-like, suggesting biliary obstruction), bright red (lower-GI bleeding), dark red / tarry black (upper-GI bleeding), etc. | 通过婴儿护理台上方固定摄像头或手机拍摄尿不湿区域（或直接拍摄排泄物）的高清图像，利用AI视觉分析技术识别大便颜色，包括正常黄色/黄绿色、异常陶土色（白陶土样，提示胆道梗阻）、鲜红色（下消化道出血）、暗红色/黑色（上消化道出血）等。当检测到异常颜色时，输出风险提醒，建议家长及时就医。\"\nversion: \"1.0.0\"\nlicense: \"MIT-0\"\n---\n\n# 🍼 Infant Stool Color Abnormality (Clay-Pale / Bloody) | 婴儿大便颜色识别（陶土色/血便）\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **婴儿大便颜色识别（陶土色/血便）** |\n| 🎯 核心目标 | 通过婴儿护理台上方固定摄像头或手机拍摄尿不湿区域（或直接拍摄排泄物）的高清图像，利用AI视觉分析技术识别大便颜色，包括正常黄色/黄绿色、异常陶土色（白陶土样，提示胆道梗阻）、鲜红色（下消化道出血）、暗红色/黑色（上消化道出血）等。当检测到异常颜色时，输出风险提醒，建议家长及时就医。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_INFANT_STOOL_COLOR_ABNORMALITY_ANALYSIS` |\n\nUsing a fixed camera above the baby-changing table or a smartphone, the system captures high-resolution images of the diaper area (or the stool itself), and uses AI visual analysis to identify stool color: normal yellow / yellow-green, abnormal clay-pale (white/clay-like, suggesting biliary obstruction), bright red (lower-GI bleeding), dark red / tarry black (upper-GI bleeding), etc. When abnormal colors are detected, it outputs risk reminders and recommends parents to seek medical care. The skill helps with early detection of infant hepato-biliary disease or GI bleeding. Application scenarios: newborn families, pediatric clinics, postpartum care centers. When changing diapers, parents take a photo with the camera and the system automatically analyzes and pushes results. Skill features: abnormal infant stool color (especially clay-pale) is an early signal of severe diseases such as biliary atresia; early detection and surgery can save lives. AI auto-recognition helps parents stay alert in time and avoid delayed treatment. Can be integrated into parenting apps or smart infant-care devices, becoming a safety net for newborn families.\n\n通过婴儿护理台上方固定摄像头或手机拍摄尿不湿区域（或直接拍摄排泄物）的高清图像，利用AI视觉分析技术识别大便颜色，包括正常黄色/黄绿色、异常陶土色（白陶土样，提示胆道梗阻）、鲜红色（下消化道出血）、暗红色/黑色（上消化道出血）等。当检测到异常颜色时，输出风险提醒，建议家长及时就医。该技能有助于早期发现婴儿肝胆疾病或消化道出血。应用场景：新生儿家庭、儿科门诊、月子中心。家长在更换尿不湿时用摄像头拍照，系统自动分析并推送结果。技能特点：婴儿大便颜色异常（尤其是陶土色）是胆道闭锁等严重疾病的早期信号，若能早期发现并手术，可挽救生命。通过AI自动识别，可帮助家长及时警觉，避免延误病情。该技能可集成到育儿APP或智能婴儿护理设备中，成为新生儿家庭的安全保障。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的婴儿健康筛查 AI。你的任务是分析尿不湿区域或排泄物的高清图像，检测大便颜色，区分正常与异常（陶土色、血便等）。不要提供医疗诊断或临床结论，仅输出基于视觉的颜色分类与方向性风险提示；对疑似 `clay_pale` 必须强烈建议尽快就医，警惕胆道闭锁等危及生命的疾病。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于婴儿尿不湿/排泄物高清图像，识别大便颜色类别 → 输出风险等级 + 推送家长可执行建议\n\n### 2. 🛠"},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-infant-stool-color-abnormality-analysis\",\n  \"version\": \"1.0.10\",\n  \"publishedAt\": 1790933966083\n}"},{"path":"references/api_doc.md","content":"# API 接口文档\n\n此处用于存放婴儿大便颜色识别（陶土色/血便）API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动婴儿大便颜色识别任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取大便颜色分类与风险结果\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史筛查记录\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_INFANT_STOOL_COLOR_ABNORMALITY_ANALYSIS` - 婴儿大便颜色识别（陶土色/血便）\n\n## 输入约束\n\n- 设备：婴儿护理台上方固定摄像头 / 智能婴儿护理设备 / 手机后置摄像头\n- 拍摄对象：婴儿尿不湿区域（更换时）或直接拍摄排泄物；建议正上方俯拍、距离 15-40 cm\n- **光照要求**：自然白光或冷白 LED 光最佳；**严禁使用偏色光（黄光夜灯、暖光、护肤紫光等会引起严重误判）**；禁用美颜/滤镜\n- 推荐附带可见参考色卡（标准白卡）放在尿不湿旁，便于白平衡校正\n- 图像高清单张 1-3 MB；建议拍摄 1-3 张不同角度\n\n## 大便颜色分类（婴儿适用）\n\n| 颜色类别 | 颜色描述 | 临床意义 | 风险等级 |\n|----------|----------|----------|----------|\n| `normal_yellow` | 金黄色（母乳喂养） | 正常 | safe |\n| `normal_yellow_green` | 黄绿色 / 草绿色 | 大多数情况正常（受饮食影响） | safe |\n| `normal_brown` | 黄褐色 / 棕色（已添加辅食） | 正常 | safe |\n| `clay_pale` | **白陶土色 / 灰白色** | **疑似胆道梗阻 / 胆道闭锁** | **urgent（必须就医）** |\n| `bright_red_blood` | 鲜红色 / 表面带鲜血丝 | 疑似下消化道出血、肛裂 | warning（建议就医） |\n| `dark_red_or_black_tarry` | 暗红色 / 柏油样黑色（且非铁剂引起） | 疑似上消化道出血 | warning（建议就医） |\n| `dark_green_thin` | 大量稀绿色水样 | 可能腹泻 / 喂养异常（参考） | notice |\n| `inconclusive` | 颜色不可判定（光线差/遮挡） | 需重拍 | recapture |\n\n## 输出字段（参考）\n\n- `diaper_or_stool_detected` - 是否检测到尿不湿/排泄物\n- `image_quality` - 图像质量（low / medium / high）\n- `light_quality_score` - 光照质量（0-1）\n- `color_card_calibrated` - 是否进行了色卡白平衡校准\n- `dominant_color_lab` - 主色 Lab 值\n- `dominant_color_rgb` - 主色 RGB 值\n- `stool_color_class` - 颜色分类（见上表）\n- `risk_level` - 风险等级（safe / notice / warning / urgent / recapture）\n- `confidence` - 分类置信度（0-1）\n- `recommended_action` - 建议动作（home_observe / clinic_visit_soon / urgent_hospital_visit / recapture_better_light）\n- `alert_message` - 推送给家长的文本（如\"检测到宝宝大便呈白陶土色，提示可能胆道异常，请立即前往儿科/小儿外科就诊\"）\n\n## 强制规则\n\n- **任何 `clay_pale` 结果（即使置信度较低）都必须返回 `urgent` 级别并强烈建议就医**（胆道闭锁手术黄金窗口期 ≤ 60 天）\n- 黑色柏油样需排查是否近期服用铁剂/铋剂，可在 alert_message 中提示\n\n> 仅输出基于视觉的颜色分类与方向性提示，不提供肝胆/消化道疾病的医学诊断；中高风险务必尽快由儿科/小儿外科医生评估并进行专业检查。"},{"path":"skills/smyx_analysis/references/api_doc.md","content":"# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |"},{"path":"scripts/config.yaml","content":"{}"}],"languages":[],"docsSourceLabel":"CLAWHUB","editorialOverview":null,"editorialQuality":{"score":100,"threshold":65,"status":"thin","wordCount":1101,"uniquenessScore":44,"reasons":["uniqueness-below-45"]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-10T06:27:24.176Z","emptyReason":"No screenshots, media assets, or demo links are available."},"primaryImageUrl":null,"mediaAssetCount":0,"assets":[],"demoUrl":null},"ownerResources":{"evidence":{"source":"unclaimed","verified":false,"confidence":"low","updatedAt":"2026-10-10T06:27:24.176Z","emptyReason":"This page has not been claimed by the agent owner."},"hasCustomPage":false,"customPageUpdatedAt":null,"customLinks":[],"structuredLinks":{"docsUrl":null,"demoUrl":null,"supportUrl":null,"pricingUrl":null,"statusUrl":null},"customPage":null},"relatedAgents":{"evidence":{"source":"protocol-neighbors","verified":false,"confidence":"medium","updatedAt":"2026-10-10T11:01:57.572Z","emptyReason":null},"items":[{"id":"8ebccd8e-3863-4187-8355-c3f14e1f9edf","entityType":"agent","canonicalPath":"/agent/iofficeai-aionui","slug":"iofficeai-aionui","name":"AionUi","description":"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!","url":"https://github.com/iOfficeAI/AionUi","homepage":"https://www.aionui.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-10-09T19:11:12.944Z","createdAt":"2026-02-25T03:38:16.584Z","downloads":null},{"id":"b917f68a-ebff-438e-84f8-3f4b2494c0bc","entityType":"agent","canonicalPath":"/agent/activepieces-activepieces","slug":"activepieces-activepieces","name":"activepieces","description":"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","url":"https://github.com/activepieces/activepieces","homepage":"https://www.activepieces.com","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-15T02:22:12.426Z","createdAt":"2026-02-25T03:38:12.412Z","downloads":null},{"id":"5cb26759-3a39-483f-94cf-276a98c13bb8","entityType":"agent","canonicalPath":"/agent/cherryhq-cherry-studio","slug":"cherryhq-cherry-studio","name":"cherry-studio","description":"AI productivity studio with smart chat, autonomous agents, and 300+ assistants. Unified access to frontier LLMs","url":"https://github.com/CherryHQ/cherry-studio","homepage":"https://cherry-ai.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-11T14:38:40.986Z","createdAt":"2026-02-25T03:38:19.379Z","downloads":null},{"id":"6f6582d0-5d76-4f0f-b81d-86520247950b","entityType":"agent","canonicalPath":"/agent/copilotkit-copilotkit","slug":"copilotkit-copilotkit","name":"CopilotKit","description":"The Frontend for Agents & Generative UI. React + Angular","url":"https://github.com/CopilotKit/CopilotKit","homepage":"https://docs.copilotkit.ai","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-03-25T09:50:57.846Z","createdAt":"2026-02-25T03:39:14.617Z","downloads":null}],"links":{"hub":"/agent","source":"/agent/source/clawhub","protocols":[{"label":"OpenClaw","href":"/agent/protocol/openclew"}]}}}