{"id":"435be96e-791a-42d8-9e2c-7fc17414f67c","entityType":"agent","slug":"clawhub-smyx-sunjinhui-smyx-fish-respiratory-rate-monitor-analy","name":"Fish Respiratory Rate (Gill Opening / Closing) Monitor | 鱼类呼吸频率（鳃盖开合）监测","canonicalUrl":"https://www.xpersona.co/agent/clawhub-smyx-sunjinhui-smyx-fish-respiratory-rate-monitor-analy","canonicalPath":"/agent/clawhub-smyx-sunjinhui-smyx-fish-respiratory-rate-monitor-analy","generatedAt":"2026-10-10T07:12:55.858Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"editorial-content","verified":true,"confidence":"high","updatedAt":"2026-10-10T04:20:48.954Z","emptyReason":null},"description":"Through fixed cameras on aquariums, the system analyzes fish gill-cover opening / closing motion video, detects periodic gill opening and closing, and calculates respiratory rate (breaths per minute). | 通过鱼缸固定摄像头，分析鱼类的鳃盖开合运动视频，检测鳃盖的周期性开启和闭合，计算呼吸频率（次/分钟）。当呼吸频率超过正常阈值（例如 > 80 次/分钟，具体依品种和水温而定）时，输出'缺氧预警'，提示用户检查水质（溶氧量）、水温或鱼的健康状态。 Skill: Fish Respiratory Rate (Gill Opening / Closing) Monitor | 鱼类呼吸频率（鳃盖开合）监测 Owner: smyx-sunjinhui Summary: Through fixed cameras on aquariums, the system analyzes fish gill-cover opening / closing motion video, detects periodic gill opening and closing, and calculates respiratory rate (breaths per minute). | 通过鱼缸固定摄像头，分析鱼类的鳃盖开合运动视频，检测鳃盖的周期性开启和闭合，计算呼吸频率（次/分钟）。当呼吸频率超过正常阈值（例如 > 80 次/分钟，具体依品种和水温而定）时，输出'缺氧预警'，提示用户检查水质（","descriptionLabel":"Technical summary","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 1.7K downloads reported by the source. Last updated 10/10/2026.","installCommand":"clawhub skill install s17cfv2h26b7hq5w47tgfy23xx83z9x6:smyx-fish-respiratory-rate-monitor-analysis","sourceUrl":"https://clawhub.ai/smyx-sunjinhui/smyx-fish-respiratory-rate-monitor-analysis","homepage":"https://clawhub.ai/smyx-sunjinhui/skills/smyx-fish-respiratory-rate-monitor-analysis","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/smyx-sunjinhui/smyx-fish-respiratory-rate-monitor-analysis","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/smyx-sunjinhui/skills/smyx-fish-respiratory-rate-monitor-analysis","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":65,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"Through fixed cameras on aquariums, the system analyzes fish gill-cover opening / closing motion video, detects periodic gill opening and closing, and calculate"},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-10T04:20:48.954Z","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-10T04:20:48.954Z","emptyReason":null},"stars":null,"forks":null,"downloads":1692,"packageName":null,"latestVersion":"1.0.10","tractionLabel":"1.7K downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-10T04:20:48.954Z","emptyReason":null},"lastUpdatedAt":"2026-10-10T04:20:48.954Z","lastCrawledAt":"2026-10-10T04:20:48.954Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-11T04:20:48.954Z","lastVerifiedAt":null,"highlights":[{"version":"1.0.10","createdAt":"2026-10-01T12:34:43.532Z","changelog":"Version 1.0.10 → 1.0.17 - Updated SKILL.md with revised versioning and potentially expanded documentation and description. - Removed obsolete skill-card.md file to clean up documentation. - Updated configuration file (config.yaml) for improved settings or dependencies handling.","fileCount":31,"zipByteSize":43691},{"version":"1.0.9","createdAt":"2026-08-23T18:30:29.054Z","changelog":"smyx-fish-respiratory-rate-monitor-analysis 1.0.9 - Removed the file: skill-card.md - No code or functional logic changes; documentation file cleanup only","fileCount":31,"zipByteSize":43823},{"version":"1.0.8","createdAt":"2026-08-18T19:23:35.326Z","changelog":"- Updated SKILL.md to increment the version number and reflect recent documentation changes. - Removed the unused file: skill-card.md. - Internal configuration adjustments in config.yaml. - No user-facing feature or interface changes. - Documentation update only; behavior and usage remain unchanged.","fileCount":31,"zipByteSize":43991},{"version":"1.0.7","createdAt":"2026-08-12T21:35:34.410Z","changelog":"- Version updated to 1.0.9. - Documentation refined in SKILL.md; details clarified and version incremented. - Redundant or outdated file skill-card.md removed.","fileCount":31,"zipByteSize":43845},{"version":"1.0.6","createdAt":"2026-08-05T21:34:29.398Z","changelog":"## smyx-fish-respiratory-rate-monitor-analysis 1.0.6 Changelog - Removed the file `skill-card.md`. - No changes to skill logic, features, or user workflow.","fileCount":31,"zipByteSize":44101},{"version":"1.0.5","createdAt":"2026-07-30T23:07:29.007Z","changelog":"- Updated documentation in SKILL.md to version 1.0.8 with expanded details, clarifications, and stricter operational instructions. - Removed the file skill-card.md from the skill package. - No changes to code or functional behavior; documentation only.","fileCount":31,"zipByteSize":43957},{"version":"1.0.4","createdAt":"2026-07-18T21:02:29.832Z","changelog":"- Removed the file: skill-card.md. - No changes to features or functionality; documentation asset cleanup only.","fileCount":31,"zipByteSize":43948},{"version":"1.0.3","createdAt":"2026-07-12T12:19:27.642Z","changelog":"- Version updated to 1.0.5. - Updated documentation in SKILL.md with refined versioning and minor clarifications. - Removed obsolete `skill-card.md` file. - Made changes in core script files (`config.py` and `util.py`) under `skills/smyx_common/scripts/`. - No breaking changes introduced; functionality remains consistent.","fileCount":31,"zipByteSize":44067}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s17cfv2h26b7hq5w47tgfy23xx83z9x6:smyx-fish-respiratory-rate-monitor-analysis","setupComplexity":"low","setupSteps":["Setup complexity is classified as HIGH. You must provision dedicated cloud infrastructure or an isolated VM. Do not run this directly on your local workstation.","Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data."],"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-fish-respiratory-rate-monitor-analy/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-smyx-sunjinhui-smyx-fish-respiratory-rate-monitor-analy/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-smyx-sunjinhui-smyx-fish-respiratory-rate-monitor-analy/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-smyx-sunjinhui-smyx-fish-respiratory-rate-monitor-analy/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-smyx-sunjinhui-smyx-fish-respiratory-rate-monitor-analy/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-smyx-sunjinhui-smyx-fish-respiratory-rate-monitor-analy/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-10T07:12:55.854Z"}},"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-fish-respiratory-rate-monitor-analy/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-smyx-sunjinhui-smyx-fish-respiratory-rate-monitor-analy/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-smyx-sunjinhui-smyx-fish-respiratory-rate-monitor-analy/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-smyx-sunjinhui-smyx-fish-respiratory-rate-monitor-analy/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":"high","updatedAt":"2026-10-10T04:20:48.954Z","emptyReason":null},"readme":"Skill: Fish Respiratory Rate (Gill Opening / Closing) Monitor | 鱼类呼吸频率（鳃盖开合）监测\n\nOwner: smyx-sunjinhui\n\nSummary: Through fixed cameras on aquariums, the system analyzes fish gill-cover opening / closing motion video, detects periodic gill opening and closing, and calculates respiratory rate (breaths per minute). | 通过鱼缸固定摄像头，分析鱼类的鳃盖开合运动视频，检测鳃盖的周期性开启和闭合，计算呼吸频率（次/分钟）。当呼吸频率超过正常阈值（例如 > 80 次/分钟，具体依品种和水温而定）时，输出'缺氧预警'，提示用户检查水质（溶氧量）、水温或鱼的健康状态。\n\nTags: latest:1.0.10\n\nVersion history:\n\nv1.0.10 | 2026-10-01T12:34:43.532Z | auto\n\nVersion 1.0.10 → 1.0.17\n\n- Updated SKILL.md with revised versioning and potentially expanded documentation and description.\n- Removed obsolete skill-card.md file to clean up documentation.\n- Updated configuration file (config.yaml) for improved settings or dependencies handling.\n\nv1.0.9 | 2026-08-23T18:30:29.054Z | auto\n\nsmyx-fish-respiratory-rate-monitor-analysis 1.0.9\n\n- Removed the file: skill-card.md\n- No code or functional logic changes; documentation file cleanup only\n\nv1.0.8 | 2026-08-18T19:23:35.326Z | auto\n\n- Updated SKILL.md to increment the version number and reflect recent documentation changes.\n- Removed the unused file: skill-card.md.\n- Internal configuration adjustments in config.yaml.\n- No user-facing feature or interface changes.\n- Documentation update only; behavior and usage remain unchanged.\n\nv1.0.7 | 2026-08-12T21:35:34.410Z | auto\n\n- Version updated to 1.0.9.\n- Documentation refined in SKILL.md; details clarified and version incremented.\n- Redundant or outdated file skill-card.md removed.\n\nv1.0.6 | 2026-08-05T21:34:29.398Z | auto\n\n## smyx-fish-respiratory-rate-monitor-analysis 1.0.6 Changelog\n\n- Removed the file `skill-card.md`.\n- No changes to skill logic, features, or user workflow.\n\nv1.0.5 | 2026-07-30T23:07:29.007Z | auto\n\n- Updated documentation in SKILL.md to version 1.0.8 with expanded details, clarifications, and stricter operational instructions.\n- Removed the file skill-card.md from the skill package.\n- No changes to code or functional behavior; documentation only.\n\nv1.0.4 | 2026-07-18T21:02:29.832Z | auto\n\n- Removed the file: skill-card.md.\n- No changes to features or functionality; documentation asset cleanup only.\n\nv1.0.3 | 2026-07-12T12:19:27.642Z | auto\n\n- Version updated to 1.0.5.\n- Updated documentation in SKILL.md with refined versioning and minor clarifications.\n- Removed obsolete `skill-card.md` file.\n- Made changes in core script files (`config.py` and `util.py`) under `skills/smyx_common/scripts/`.\n- No breaking changes introduced; functionality remains consistent.\n\nv1.0.2 | 2026-07-03T06:33:27.849Z | auto\n\n- Updated skill version to 1.0.4.\n- Documentation in SKILL.md revised and incremented for version number.\n- Minor maintenance to scripts/smyx_common/scripts/dao.py and util.py.\n- Removed deprecated skill-card.md documentation file.\n\nv1.0.1 | 2026-06-28T09:44:25.130Z | auto\n\n- Major update: Skill documentation was significantly refactored, clarifying user privacy, report access workflow, and input/output controls.\n- Skill operation now strictly manages user identity parameters internally; no user prompt or exposure of identity (open-id) occurs.\n- All cloud historical report queries are enforced via API; local storage or memory-based report access is explicitly prohibited.\n- Updated SKILL.md to a modular, concise structure with bilingual tables and workflow, improving clarity for all audiences.\n- Sample and redundant files were removed for codebase cleanliness and easier maintenance.\n\nv1.0.0 | 2026-05-28T03:43:54.266Z | auto\n\nInitial release of smyx-fish-respiratory-rate-monitor-analysis.\n\n- Enables AI-based detection of fish respiratory rate (BPM) through aquarium camera video.\n- Automatically issues hypoxia warnings and prompts water quality/temperature/health checks when abnormal respiratory rates are detected.\n- Supports 7 respiratory scenarios and a 4-level alert system with clear alert escalation.\n- Includes daily respiratory health reports per tank and strict compliance with privacy and open-id validation.\n- Designed for integration with smart aquarium cameras in homes, public aquariums, fish farms, and laboratories.\n\nArchive index:\n\nArchive v1.0.10: 31 files, 43691 bytes\n\nFiles: references/api_doc.md (6082b), scripts/__init__.py (73b), scripts/config.py (700b), scripts/config.yaml (3b), scripts/skill.py (591b), scripts/smyx_fish_respiratory_rate_monitor_analysis.py (3688b), skill-card.md (2226b), SKILL.md (16065b), 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.10:SKILL.md\n\n---\nname: \"smyx-fish-respiratory-rate-monitor-analysis\"\ndescription: \"Through fixed cameras on aquariums, the system analyzes fish gill-cover opening / closing motion video, detects periodic gill opening and closing, and calculates respiratory rate (breaths per minute). | 通过鱼缸固定摄像头，分析鱼类的鳃盖开合运动视频，检测鳃盖的周期性开启和闭合，计算呼吸频率（次/分钟）。当呼吸频率超过正常阈值（例如 > 80 次/分钟，具体依品种和水温而定）时，输出'缺氧预警'，提示用户检查水质（溶氧量）、水温或鱼的健康状态。\"\nversion: \"1.0.17\"\nlicense: \"MIT-0\"\n---\n\n# 🫧 Fish Respiratory Rate (Gill Opening / Closing) Monitor | 鱼类呼吸频率（鳃盖开合）监测\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **鱼类呼吸频率（鳃盖开合）监测** |\n| 🎯 核心目标 | 通过鱼缸固定摄像头，分析鱼类的鳃盖开合运动视频，检测鳃盖的周期性开启和闭合，计算呼吸频率（次/分钟）。当呼吸频率超过正常阈值（例如 > 80 次/分钟，具体依品种和水温而定）时，输出'缺氧预警'，提示用户检查水质（溶氧量）、水温或鱼的健康状态。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_FISH_RESPIRATORY_RATE_MONITOR_ANALYSIS` |\n\nThrough fixed cameras on aquariums, the system analyzes fish gill-cover opening / closing motion video, detects periodic gill opening and closing, and calculates respiratory rate (breaths per minute). When the respiratory rate exceeds a normal threshold (e.g. > 80 BPM, depending on species and water temperature), the system outputs a 'hypoxia warning' and prompts the user to check water quality (dissolved oxygen), water temperature, or fish health status. This skill helps early detection of underwater hypoxia, gill diseases, or stress reactions. Application scenarios: home aquariums, public aquariums, ornamental fish farms, laboratories. The system continuously monitors and automatically pushes reminders when respiratory rate is abnormal. Skill features: fish respiratory rate is an important indicator of dissolved oxygen, stress status, and gill health. AI-based automatic monitoring can remind aquarists to add oxygen before hypoxia occurs, preventing fish death. This skill can be integrated into smart aquarium cameras to enhance product tech value and practicality.\n\n通过鱼缸固定摄像头，分析鱼类的鳃盖开合运动视频，检测鳃盖的周期性开启和闭合，计算呼吸频率（次/分钟）。当呼吸频率超过正常阈值（例如 > 80 次/分钟，具体依品种和水温而定）时，输出'缺氧预警'，提示用户检查水质（溶氧量）、水温或鱼的健康状态。该技能有助于早期发现水中缺氧、鳃部疾病或应激反应。应用场景：家庭鱼缸、水族馆、观赏鱼养殖场、实验室。系统连续监测，在呼吸频率异常时自动推送提醒。技能特点：鱼类呼吸频率是反映溶氧量、应激状态和鳃部健康的重要指标。通过 AI 自动监测，可在缺氧发生前及时提醒养鱼者增氧，防止鱼只死亡。该技能可集成到智能鱼缸摄像头中，提升产品科技含量和实用性。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的水族呼吸健康监测 AI。你的任务是分析鱼缸固定摄像头近距离视频（鳃盖区域可见），检测鱼类鳃盖的开合运动，计算呼吸频率（BPM = 次/分钟）。当 BPM 超过预设阈值（默认 80，需按**鱼种 + 水温**联合动态调整基线）时，输出缺氧预警；当 BPM 过低（低于鱼种低阈值）时，疑似低温昏迷/中毒，同样告警。按 7 类综合场景（respiratory_normal / high_normal / hyperventilation_mild / hyperventilation_moderate / hypoxia_warning / bradypnea / signal_unreliable）作判定，按 4 级告警策略递进（Level 1 入库/轻提醒 → Level 2 重要告警 + 检查水温/溶氧/pH/氨氮 → Level 3 紧急告警 + 强烈建议开启增氧 + 联系兽医 → Level 4 多次紧急/同缸多发/浮头吞气 ≥ 5 分钟 + 推送所有联系人 + 强烈建议立即抢救）。必须考虑生理性升高的上下文（活跃游动 / 投喂后 30 分钟内 / 水温升高），避免误报。信号稳定度 < 50% 必须返回 `signal_unreliable` 并建议重拍，**禁止给出不可靠的告警**。不提供任何医疗诊断，仅输出基于视觉的呼吸频率数值与异常提示；**禁止输出具体药物名称和剂量**；严禁伪造夸大 BPM 数据，严禁越权代用户启停增氧泵/加热棒/换水/投药等设备（仅建议）。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于鱼缸固定摄像头（家庭鱼缸 / 水族馆 / 观赏鱼养殖场 / 实验室）近距离（≤ 30 cm）高帧率（≥ 25 FPS）视频，识别 7 类综合场景（respiratory_normal / high_normal / hyperventilation_mild / hyperventilation_moderate / hypoxia_warning / bradypnea / signal_unreliable）→ **核心鳃盖运动信号 5 项**（开合周期数 / 采样窗口 / 呼吸频率 BPM / 信号稳定度评分 / 鳃盖开合幅度）+ **上下文信号 4 项**（水温 / 鱼活跃度 / 距投喂时长 / 浮头吞气）+ **鱼种基线 4 项**（鱼种 / 25℃ BPM 正常区间 / 高阈值 / 低阈值）→ 4 档异常等级（normal / mild / moderate / severe/urgent）→ **4 级告警策略递进**（入库/轻提醒 → 重要告警+水质检查 → 紧急告警+开启增氧+联系兽医 → 最高紧急告警+所有联系人+立即抢救建议）→ 单日告警上限（Level 1 不限 / Level 2 × 6 / Level 3 × 3 / Level 4 不设上限）→ **每日呼吸健康报告**（按 tank_id 输出，含 BPM 趋势 + 异常事件 + 建议动作，**不含具体药物**）+ 免责声明\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 鱼体目标检测与跟踪 |\n| 2 | 鳃盖区域语义分割（侧面视图） |\n| 3 | 鳃盖开合周期检测（光流 / 像素变化时序分析） |\n| 4 | BPM 计算（周期数 × 60 / 窗口秒） |\n| 5 | 信号稳定度评分（去除游动遮挡 / 抖动） |\n| 6 | 鱼种自适应基线（金鱼 40-80 |\n| 7 | 锦鲤 50-90 |\n| 8 | 神仙鱼 60-110 |\n| 9 | 斗鱼 30-70 |\n| 10 | 龙鱼 40-90 |\n| 11 | 海水神仙鱼 60-120 等） |\n| 12 | 水温修正（Q10 系数粗校正） |\n| 13 | 生理性升高识别（活跃 / 投喂后） |\n| 14 | 浮头吞气检测 |\n| 15 | 用户 APP 推送 |\n| 16 | 4 级告警递进 |\n| 17 | 单日告警上限 |\n| 18 | 每日呼吸健康报告（按 tank_id 输出） |\n| 19 | 连续 ≥ 2 日 Level 3 → 强烈建议联系**当地观赏鱼兽医** |\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_fish_respiratory_rate_monitor_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_fish_respiratory_rate_monitor_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 | 🔐 获取 open-id（强制执行） | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行鱼类呼吸频率监测 | 调用 `-m scripts.smyx_fish_respiratory_rate_monitor_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_fish_respiratory_rate_monitor_analysis.py`](scripts/smyx_fish_respiratory_rate_monitor_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| 📁 格式支持 | 输入要求：支持 mp4/avi/mov，最大 10MB；摄像头需鱼缸近距离正侧面，鳃盖区域清晰；**帧率 ≥ 25 FPS（关键约束）**；单次采样 ≥ 30 秒 |\n| 🔎 使用提醒 | **4 级告警策略递进**（mild → moderate → severe → urgent/Level 4），浮头吞气 ≥ 5 分钟或多条同发进入 Level 4 |\n| 🔎 使用提醒 | 单日告警上限：Level 1 不限 / Level 2 × 6 / Level 3 × 3 / Level 4 不设上限（紧急安全优先） |\n| 🔎 使用提醒 | 红线约束 |\n| 🧑‍⚖️ 结果性质 | **禁止**对鱼做\"鳃病 / 烂鳃 / 氨中毒 / 亚硝酸盐中毒 / 寄生虫感染\"等具体疾病诊断 |\n| 🔎 使用提醒 | **🚨 绝对禁止**输出具体药物名称、剂量、给药方案 |\n| 🔎 使用提醒 | **禁止**长期存储完整鱼缸视频（≤ 7 天，仅入库异常呼吸事件片段；公共水族馆/实验室按管理规定） |\n| 🔎 使用提醒 | **禁止**用于商业广告 / AI 训练；禁第三方共享 |\n| 🔎 使用提醒 | **禁止**越权代用户启停增氧泵 / 加热棒 / 换水 / 投药 / 灯光参数；任何水族设备控制变更必须由用户确认（仅可建议） |\n| 🔎 使用提醒 | **绝对禁止**伪造或夸大 BPM、稳定度、鳃盖幅度等指标；所有数据必须基于真实视频帧统计 |\n| 🔎 使用提醒 | **必须**按**鱼种 + 水温**联合判定基线（金鱼 40-80 / 锦鲤 50-90 / 神仙鱼 60-110 / 海水神仙鱼 60-120 等），**禁止使用通用阈值盲判** |\n| 📚 文档读取 | **必须**考虑生理性升高的上下文（活跃游动 / 投喂后 30 分钟内 / 水温升高），避免误报 |\n| 🔎 使用提醒 | **必须**在信号稳定度 < 50% 时返回 `respiratory_signal_unreliable` 并建议重拍，**禁止给出不可靠的告警** |\n| 🔎 使用提醒 | **必须**：连续 ≥ 2 日 Level 3 → 强烈建议联系**当地观赏鱼兽医或水族馆专业人员** |\n| 📜 报告输出 | **必须**：每日呼吸健康报告**按 tank_id 输出**，含 BPM 趋势 + 异常事件 + 建议动作 + 免责声明 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史呼吸监测记录清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地鱼鳃盖近距离视频（以下只是示例，禁止直接使用 作为 open-id）\npython -m scripts.smyx_fish_respiratory_rate_monitor_analysis --input /path/to/gill.mp4\n\n# 分析网络鱼鳃盖近距离视频/实时流（以下只是示例，禁止直接使用 作为 open-id）\npython -m scripts.smyx_fish_respiratory_rate_monitor_analysis --url https://example.com/gill.mp4\n\n# 显示历史呼吸监测记录清单（自动触发关键词：查看鱼呼吸频率历史报告、鱼鳃盖监测日志清单等）\npython -m scripts.smyx_fish_respiratory_rate_monitor_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_fish_respiratory_rate_monitor_analysis --input gill.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_fish_respiratory_rate_monitor_analysis --input gill.mp4 --output result.json\n```\n\nFile v1.0.10:_meta.json\n\n{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-fish-respiratory-rate-monitor-analysis\",\n  \"version\": \"1.0.10\",\n  \"publishedAt\": 1790858083532\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}` - 导出呼吸频率监测报告\n5. （可选）`/web/companion/v2/trigger-soothing-action` - 触发联动提醒（用户 APP 推送 / 智能鱼缸告警灯 / 触发增氧设备建议提示）\n\n## 场景代码\n\n- `SMYX_FISH_RESPIRATORY_RATE_MONITOR_ANALYSIS` - 鱼类呼吸频率（鳃盖开合）监测\n\n## 输入约束\n\n- 摄像头：鱼缸固定摄像头，能近距离（≤ 30 cm）清晰拍摄鱼鳃盖区域\n- 分辨率 ≥ 720p；**帧率 ≥ 25 FPS**（鳃盖开合频率高，需高帧率才能可靠采样；正常 20-80 次/分钟 ≈ 0.3-1.3 Hz）\n- 光照：建议鱼缸照明开启 + 无强反光；水质清澈\n- 拍摄角度：优先正侧面（鳃盖运动幅度最大）；鳃盖区域完整可见\n- 单次有效采样窗口：≥ 30 秒（建议 60 秒），用于稳定计算 BPM\n- 多鱼缸场景按摄像头 ID 绑定到注册鱼缸 ID（每个鱼缸独立鱼种 + 水温记录）\n- 多鱼场景按目标跟踪 + ReID 绑定到注册个体（每条鱼独立基线，可选）\n- 用户必须授权部署；公共水族馆 / 实验室需公示告知\n\n## 关键观测信号\n\n### 鳃盖运动信号（核心）\n- `gill_open_close_cycle_count` - 采样窗口内鳃盖开合周期数\n- `sampling_window_sec` - 采样窗口时长（秒）\n- `respiratory_rate_bpm` - 呼吸频率（次/分钟，= cycle_count × 60 / window_sec）\n- `bpm_signal_stability_score` - 信号稳定度评分（0-100，去除游动遮挡 / 帧间抖动后的有效采样比例）\n- `gill_opening_amplitude_score` - 鳃盖开合幅度评分（0-100，反映呼吸深度）\n\n### 上下文信号\n- `water_temperature_c` - 水温（℃，用户输入或智能鱼缸传感器；同物种水温越高 BPM 越高）\n- `fish_activity_level` - 鱼活跃度（resting / normal / active；活跃时 BPM 升高为生理性）\n- `time_since_feeding_min` - 距上次投喂时长（分钟，投喂后 30 分钟内 BPM 生理性升高）\n- `surface_gasping_detected` - 是否检测到浮头吞气（缺氧典型征兆）\n\n### 鱼种基线（必须配置）\n- `species` - 鱼种标识（金鱼 / 锦鲤 / 神仙鱼 / 斗鱼 / 龙鱼 / 海水鱼 等）\n- `bpm_baseline_at_25c` - 25℃ 下该鱼种的正常 BPM 区间（如金鱼 40-80）\n- `bpm_threshold_high` - 高阈值（默认 80，按鱼种 + 水温动态调整）\n- `bpm_threshold_low` - 低阈值（呼吸过缓也异常，疑似低温昏迷 / 中毒）\n\n## 综合判定\n\n- `respiratory_normal` - 呼吸频率正常\n- `respiratory_high_normal` - 偏高但属于生理性（活跃 / 投喂后 30 分钟内）\n- `respiratory_hyperventilation_mild` - 呼吸急促轻度（BPM 超阈值 1.1-1.3 倍）\n- `respiratory_hyperventilation_moderate` - 呼吸急促中度（1.3-1.6 倍 + 鳃盖大开合）\n- `respiratory_hypoxia_warning` - 缺氧预警（BPM > 阈值 1.6 倍 / 浮头吞气）\n- `respiratory_bradypnea` - 呼吸过缓（BPM < 低阈值，疑似低温/中毒/濒死）\n- `respiratory_signal_unreliable` - 信号不可靠（稳定度 < 50%，建议重拍）\n\n## 4 级告警策略递进\n\n- Level 1（hyperventilation_mild / high_normal）：仅入库记录或用户 APP 轻提醒\"鱼缸 X 号呼吸偏快，请观察水质\"\n- Level 2（hyperventilation_moderate）：用户 APP 重要告警，建议**检查水温、溶氧、pH、氨氮**\n- Level 3（hypoxia_warning / bradypnea）：紧急告警，**强烈建议立即开启增氧设备 / 部分换水 / 降低密度**，并提示联系**当地观赏鱼兽医**\n- Level 4（连续 ≥ 2 次 Level 3 / 同缸多条鱼同时缺氧 / 浮头吞气持续 ≥ 5 分钟）：最高紧急告警 + 推送家庭/管理人员所有联系人 + 强烈建议**立即抢救**（开启增氧泵 + 大幅换水 + 降低喂食）\n\n## 单日告警上限\n\n- Level 1 不限（仅入库或轻提醒）/ Level 2 × 6 / Level 3 × 3 / Level 4 不设上限\n\n## 红线约束\n\n- **禁止**做\"鳃病 / 烂鳃 / 氨中毒 / 亚硝酸盐中毒 / 寄生虫感染\"等具体疾病诊断\n- **禁止**输出具体药物名称、剂量、给药方案\n- **禁止**长期存储完整鱼缸视频（≤ 7 天，仅入库异常呼吸事件片段；公共水族馆 / 实验室按管理规定）\n- **禁止**用于商业广告 / AI 训练；禁第三方共享\n- **禁止**越权代用户启停增氧泵 / 加热棒 / 换水 / 投药 / 灯光参数；任何水族设备控制变更必须由用户确认（仅可建议）\n- BPM、稳定度、鳃盖幅度等指标必须基于真实视频帧统计；**禁止伪造或夸大指标**\n- 鱼种特异性：不同鱼种 BPM 基线差异极大（金鱼 40-80 vs 海水神仙鱼 60-120）→ 必须按**鱼种 + 水温**联合判定基线；**禁止使用通用阈值盲判**\n- 水温升高、活跃游动、刚投喂后 30 分钟内会出现生理性 BPM 升高 → 必须在上下文中标注并避免误报\n- 信号稳定度 < 50% 时必须返回 `respiratory_signal_unreliable` 并建议重拍，**禁止给出不可靠的告警**\n\n## 输出报告字段\n\n- `report_date` - 报告日期\n- `tank_id` - 鱼缸 ID\n- `species` - 鱼种\n- `water_temperature_c` - 水温\n- `respiratory_rate_bpm` - 当次呼吸频率\n- `bpm_baseline_range` - 鱼种 + 水温对应正常区间\n- `bpm_signal_stability_score` - 信号稳定度\n- `composite_scene` - 综合判定\n- `alert_level` - 告警等级\n- `recommended_actions` - 建议动作（开启增氧 / 检查水温 / 部分换水 / 降低密度 / 联系兽医，**不含药物**）\n- `disclaimer` - 免责声明\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 aquarium fish gill-cover video to estimate breathing rate and provide abnormal-rate alerts 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\nAquarium keepers, aquaculture operators, and developers use fish gill-cover recordings or video URLs to estimate respiratory rate, review possible abnormalities, and retrieve past reports. Results are monitoring guidance, not a veterinary diagnosis.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Aquarium media or video URLs may be sent to the configured cloud service.\n\nMitigation: Use only media and URLs you are comfortable sharing with that service, and review the publisher before installation.\n\nRisk: The skill may create or reuse an identity and persist authentication tokens for report access.\n\nMitigation: Review the identity and token-storage behavior before running it in a shared or sensitive workspace.\n\nRisk: History-related requests may automatically retrieve cloud reports.\n\nMitigation: Confirm that cloud report access is appropriate before requesting historical records.\n\n## Reference(s):\n\n- [Fish respiratory rate monitoring API documentation](references/api_doc.md)\n- [Analysis API documentation](skills/smyx_analysis/references/api_doc.md)\n- [ClawHub skill listing](https://clawhub.ai/smyx-sunjinhui/skills/smyx-fish-respiratory-rate-monitor-analysis)\n\n## Skill Output:\n\n**Output Type(s):** [Text, Markdown, JSON, Guidance]\n\n**Output Format:** [Structured analysis report or Markdown history table; optional saved result file]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Reports may include breathing rate, alerts, recommendations, and links to cloud reports.]\n\n## Skill Version(s):\n\n1.0.10 (source: ClawHub release metadata; bundled frontmatter states 1.0.17)\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, 43823 bytes\n\nFiles: references/api_doc.md (6082b), scripts/__init__.py (73b), scripts/config.py (700b), scripts/config.yaml (3b), scripts/skill.py (591b), scripts/smyx_fish_respiratory_rate_monitor_analysis.py (3688b), skill-card.md (2527b), SKILL.md (16065b), 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 (162b)\n\nFile v1.0.9:SKILL.md\n\n---\nname: \"smyx-fish-respiratory-rate-monitor-analysis\"\ndescription: \"Through fixed cameras on aquariums, the system analyzes fish gill-cover opening / closing motion video, detects periodic gill opening and closing, and calculates respiratory rate (breaths per minute). | 通过鱼缸固定摄像头，分析鱼类的鳃盖开合运动视频，检测鳃盖的周期性开启和闭合，计算呼吸频率（次/分钟）。当呼吸频率超过正常阈值（例如 > 80 次/分钟，具体依品种和水温而定）时，输出'缺氧预警'，提示用户检查水质（溶氧量）、水温或鱼的健康状态。\"\nversion: \"1.0.11\"\nlicense: \"MIT-0\"\n---\n\n# 🫧 Fish Respiratory Rate (Gill Opening / Closing) Monitor | 鱼类呼吸频率（鳃盖开合）监测\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **鱼类呼吸频率（鳃盖开合）监测** |\n| 🎯 核心目标 | 通过鱼缸固定摄像头，分析鱼类的鳃盖开合运动视频，检测鳃盖的周期性开启和闭合，计算呼吸频率（次/分钟）。当呼吸频率超过正常阈值（例如 > 80 次/分钟，具体依品种和水温而定）时，输出'缺氧预警'，提示用户检查水质（溶氧量）、水温或鱼的健康状态。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_FISH_RESPIRATORY_RATE_MONITOR_ANALYSIS` |\n\nThrough fixed cameras on aquariums, the system analyzes fish gill-cover opening / closing motion video, detects periodic gill opening and closing, and calculates respiratory rate (breaths per minute). When the respiratory rate exceeds a normal threshold (e.g. > 80 BPM, depending on species and water temperature), the system outputs a 'hypoxia warning' and prompts the user to check water quality (dissolved oxygen), water temperature, or fish health status. This skill helps early detection of underwater hypoxia, gill diseases, or stress reactions. Application scenarios: home aquariums, public aquariums, ornamental fish farms, laboratories. The system continuously monitors and automatically pushes reminders when respiratory rate is abnormal. Skill features: fish respiratory rate is an important indicator of dissolved oxygen, stress status, and gill health. AI-based automatic monitoring can remind aquarists to add oxygen before hypoxia occurs, preventing fish death. This skill can be integrated into smart aquarium cameras to enhance product tech value and practicality.\n\n通过鱼缸固定摄像头，分析鱼类的鳃盖开合运动视频，检测鳃盖的周期性开启和闭合，计算呼吸频率（次/分钟）。当呼吸频率超过正常阈值（例如 > 80 次/分钟，具体依品种和水温而定）时，输出'缺氧预警'，提示用户检查水质（溶氧量）、水温或鱼的健康状态。该技能有助于早期发现水中缺氧、鳃部疾病或应激反应。应用场景：家庭鱼缸、水族馆、观赏鱼养殖场、实验室。系统连续监测，在呼吸频率异常时自动推送提醒。技能特点：鱼类呼吸频率是反映溶氧量、应激状态和鳃部健康的重要指标。通过 AI 自动监测，可在缺氧发生前及时提醒养鱼者增氧，防止鱼只死亡。该技能可集成到智能鱼缸摄像头中，提升产品科技含量和实用性。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的水族呼吸健康监测 AI。你的任务是分析鱼缸固定摄像头近距离视频（鳃盖区域可见），检测鱼类鳃盖的开合运动，计算呼吸频率（BPM = 次/分钟）。当 BPM 超过预设阈值（默认 80，需按**鱼种 + 水温**联合动态调整基线）时，输出缺氧预警；当 BPM 过低（低于鱼种低阈值）时，疑似低温昏迷/中毒，同样告警。按 7 类综合场景（respiratory_normal / high_normal / hyperventilation_mild / hyperventilation_moderate / hypoxia_warning / bradypnea / signal_unreliable）作判定，按 4 级告警策略递进（Level 1 入库/轻提醒 → Level 2 重要告警 + 检查水温/溶氧/pH/氨氮 → Level 3 紧急告警 + 强烈建议开启增氧 + 联系兽医 → Level 4 多次紧急/同缸多发/浮头吞气 ≥ 5 分钟 + 推送所有联系人 + 强烈建议立即抢救）。必须考虑生理性升高的上下文（活跃游动 / 投喂后 30 分钟内 / 水温升高），避免误报。信号稳定度 < 50% 必须返回 `signal_unreliable` 并建议重拍，**禁止给出不可靠的告警**。不提供任何医疗诊断，仅输出基于视觉的呼吸频率数值与异常提示；**禁止输出具体药物名称和剂量**；严禁伪造夸大 BPM 数据，严禁越权代用户启停增氧泵/加热棒/换水/投药等设备（仅建议）。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于鱼缸固定摄像头（家庭鱼缸 / 水族馆 / 观赏鱼养殖场 / 实验室）近距离（≤ 30 cm）高帧率（≥ 25 FPS）视频，识别 7 类综合场景（respiratory_normal / high_normal / hyperventilation_mild / hyperventilation_moderate / hypoxia_warning / bradypnea / signal_unreliable）→ **核心鳃盖运动信号 5 项**（开合周期数 / 采样窗口 / 呼吸频率 BPM / 信号稳定度评分 / 鳃盖开合幅度）+ **上下文信号 4 项**（水温 / 鱼活跃度 / 距投喂时长 / 浮头吞气）+ **鱼种基线 4 项**（鱼种 / 25℃ BPM 正常区间 / 高阈值 / 低阈值）→ 4 档异常等级（normal / mild / moderate / severe/urgent）→ **4 级告警策略递进**（入库/轻提醒 → 重要告警+水质检查 → 紧急告警+开启增氧+联系兽医 → 最高紧急告警+所有联系人+立即抢救建议）→ 单日告警上限（Level 1 不限 / Level 2 × 6 / Level 3 × 3 / Level 4 不设上限）→ **每日呼吸健康报告**（按 tank_id 输出，含 BPM 趋势 + 异常事件 + 建议动作，**不含具体药物**）+ 免责声明\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 鱼体目标检测与跟踪 |\n| 2 | 鳃盖区域语义分割（侧面视图） |\n| 3 | 鳃盖开合周期检测（光流 / 像素变化时序分析） |\n| 4 | BPM 计算（周期数 × 60 / 窗口秒） |\n| 5 | 信号稳定度评分（去除游动遮挡 / 抖动） |\n| 6 | 鱼种自适应基线（金鱼 40-80 |\n| 7 | 锦鲤 50-90 |\n| 8 | 神仙鱼 60-110 |\n| 9 | 斗鱼 30-70 |\n| 10 | 龙鱼 40-90 |\n| 11 | 海水神仙鱼 60-120 等） |\n| 12 | 水温修正（Q10 系数粗校正） |\n| 13 | 生理性升高识别（活跃 / 投喂后） |\n| 14 | 浮头吞气检测 |\n| 15 | 用户 APP 推送 |\n| 16 | 4 级告警递进 |\n| 17 | 单日告警上限 |\n| 18 | 每日呼吸健康报告（按 tank_id 输出） |\n| 19 | 连续 ≥ 2 日 Level 3 → 强烈建议联系**当地观赏鱼兽医** |\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_fish_respiratory_rate_monitor_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_fish_respiratory_rate_monitor_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 | 🔐 获取 open-id（强制执行） | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行鱼类呼吸频率监测 | 调用 `-m scripts.smyx_fish_respiratory_rate_monitor_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_fish_respiratory_rate_monitor_analysis.py`](scripts/smyx_fish_respiratory_rate_monitor_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| 📁 格式支持 | 输入要求：支持 mp4/avi/mov，最大 10MB；摄像头需鱼缸近距离正侧面，鳃盖区域清晰；**帧率 ≥ 25 FPS（关键约束）**；单次采样 ≥ 30 秒 |\n| 🔎 使用提醒 | **4 级告警策略递进**（mild → moderate → severe → urgent/Level 4），浮头吞气 ≥ 5 分钟或多条同发进入 Level 4 |\n| 🔎 使用提醒 | 单日告警上限：Level 1 不限 / Level 2 × 6 / Level 3 × 3 / Level 4 不设上限（紧急安全优先） |\n| 🔎 使用提醒 | 红线约束 |\n| 🧑‍⚖️ 结果性质 | **禁止**对鱼做\"鳃病 / 烂鳃 / 氨中毒 / 亚硝酸盐中毒 / 寄生虫感染\"等具体疾病诊断 |\n| 🔎 使用提醒 | **🚨 绝对禁止**输出具体药物名称、剂量、给药方案 |\n| 🔎 使用提醒 | **禁止**长期存储完整鱼缸视频（≤ 7 天，仅入库异常呼吸事件片段；公共水族馆/实验室按管理规定） |\n| 🔎 使用提醒 | **禁止**用于商业广告 / AI 训练；禁第三方共享 |\n| 🔎 使用提醒 | **禁止**越权代用户启停增氧泵 / 加热棒 / 换水 / 投药 / 灯光参数；任何水族设备控制变更必须由用户确认（仅可建议） |\n| 🔎 使用提醒 | **绝对禁止**伪造或夸大 BPM、稳定度、鳃盖幅度等指标；所有数据必须基于真实视频帧统计 |\n| 🔎 使用提醒 | **必须**按**鱼种 + 水温**联合判定基线（金鱼 40-80 / 锦鲤 50-90 / 神仙鱼 60-110 / 海水神仙鱼 60-120 等），**禁止使用通用阈值盲判** |\n| 📚 文档读取 | **必须**考虑生理性升高的上下文（活跃游动 / 投喂后 30 分钟内 / 水温升高），避免误报 |\n| 🔎 使用提醒 | **必须**在信号稳定度 < 50% 时返回 `respiratory_signal_unreliable` 并建议重拍，**禁止给出不可靠的告警** |\n| 🔎 使用提醒 | **必须**：连续 ≥ 2 日 Level 3 → 强烈建议联系**当地观赏鱼兽医或水族馆专业人员** |\n| 📜 报告输出 | **必须**：每日呼吸健康报告**按 tank_id 输出**，含 BPM 趋势 + 异常事件 + 建议动作 + 免责声明 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史呼吸监测记录清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地鱼鳃盖近距离视频（以下只是示例，禁止直接使用 作为 open-id）\npython -m scripts.smyx_fish_respiratory_rate_monitor_analysis --input /path/to/gill.mp4\n\n# 分析网络鱼鳃盖近距离视频/实时流（以下只是示例，禁止直接使用 作为 open-id）\npython -m scripts.smyx_fish_respiratory_rate_monitor_analysis --url https://example.com/gill.mp4\n\n# 显示历史呼吸监测记录清单（自动触发关键词：查看鱼呼吸频率历史报告、鱼鳃盖监测日志清单等）\npython -m scripts.smyx_fish_respiratory_rate_monitor_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_fish_respiratory_rate_monitor_analysis --input gill.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_fish_respiratory_rate_monitor_analysis --input gill.mp4 --output result.json\n```\n\nFile v1.0.9:_meta.json\n\n{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-fish-respiratory-rate-monitor-analysis\",\n  \"version\": \"1.0.9\",\n  \"publishedAt\": 1787509829054\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}` - 导出呼吸频率监测报告\n5. （可选）`/web/companion/v2/trigger-soothing-action` - 触发联动提醒（用户 APP 推送 / 智能鱼缸告警灯 / 触发增氧设备建议提示）\n\n## 场景代码\n\n- `SMYX_FISH_RESPIRATORY_RATE_MONITOR_ANALYSIS` - 鱼类呼吸频率（鳃盖开合）监测\n\n## 输入约束\n\n- 摄像头：鱼缸固定摄像头，能近距离（≤ 30 cm）清晰拍摄鱼鳃盖区域\n- 分辨率 ≥ 720p；**帧率 ≥ 25 FPS**（鳃盖开合频率高，需高帧率才能可靠采样；正常 20-80 次/分钟 ≈ 0.3-1.3 Hz）\n- 光照：建议鱼缸照明开启 + 无强反光；水质清澈\n- 拍摄角度：优先正侧面（鳃盖运动幅度最大）；鳃盖区域完整可见\n- 单次有效采样窗口：≥ 30 秒（建议 60 秒），用于稳定计算 BPM\n- 多鱼缸场景按摄像头 ID 绑定到注册鱼缸 ID（每个鱼缸独立鱼种 + 水温记录）\n- 多鱼场景按目标跟踪 + ReID 绑定到注册个体（每条鱼独立基线，可选）\n- 用户必须授权部署；公共水族馆 / 实验室需公示告知\n\n## 关键观测信号\n\n### 鳃盖运动信号（核心）\n- `gill_open_close_cycle_count` - 采样窗口内鳃盖开合周期数\n- `sampling_window_sec` - 采样窗口时长（秒）\n- `respiratory_rate_bpm` - 呼吸频率（次/分钟，= cycle_count × 60 / window_sec）\n- `bpm_signal_stability_score` - 信号稳定度评分（0-100，去除游动遮挡 / 帧间抖动后的有效采样比例）\n- `gill_opening_amplitude_score` - 鳃盖开合幅度评分（0-100，反映呼吸深度）\n\n### 上下文信号\n- `water_temperature_c` - 水温（℃，用户输入或智能鱼缸传感器；同物种水温越高 BPM 越高）\n- `fish_activity_level` - 鱼活跃度（resting / normal / active；活跃时 BPM 升高为生理性）\n- `time_since_feeding_min` - 距上次投喂时长（分钟，投喂后 30 分钟内 BPM 生理性升高）\n- `surface_gasping_detected` - 是否检测到浮头吞气（缺氧典型征兆）\n\n### 鱼种基线（必须配置）\n- `species` - 鱼种标识（金鱼 / 锦鲤 / 神仙鱼 / 斗鱼 / 龙鱼 / 海水鱼 等）\n- `bpm_baseline_at_25c` - 25℃ 下该鱼种的正常 BPM 区间（如金鱼 40-80）\n- `bpm_threshold_high` - 高阈值（默认 80，按鱼种 + 水温动态调整）\n- `bpm_threshold_low` - 低阈值（呼吸过缓也异常，疑似低温昏迷 / 中毒）\n\n## 综合判定\n\n- `respiratory_normal` - 呼吸频率正常\n- `respiratory_high_normal` - 偏高但属于生理性（活跃 / 投喂后 30 分钟内）\n- `respiratory_hyperventilation_mild` - 呼吸急促轻度（BPM 超阈值 1.1-1.3 倍）\n- `respiratory_hyperventilation_moderate` - 呼吸急促中度（1.3-1.6 倍 + 鳃盖大开合）\n- `respiratory_hypoxia_warning` - 缺氧预警（BPM > 阈值 1.6 倍 / 浮头吞气）\n- `respiratory_bradypnea` - 呼吸过缓（BPM < 低阈值，疑似低温/中毒/濒死）\n- `respiratory_signal_unreliable` - 信号不可靠（稳定度 < 50%，建议重拍）\n\n## 4 级告警策略递进\n\n- Level 1（hyperventilation_mild / high_normal）：仅入库记录或用户 APP 轻提醒\"鱼缸 X 号呼吸偏快，请观察水质\"\n- Level 2（hyperventilation_moderate）：用户 APP 重要告警，建议**检查水温、溶氧、pH、氨氮**\n- Level 3（hypoxia_warning / bradypnea）：紧急告警，**强烈建议立即开启增氧设备 / 部分换水 / 降低密度**，并提示联系**当地观赏鱼兽医**\n- Level 4（连续 ≥ 2 次 Level 3 / 同缸多条鱼同时缺氧 / 浮头吞气持续 ≥ 5 分钟）：最高紧急告警 + 推送家庭/管理人员所有联系人 + 强烈建议**立即抢救**（开启增氧泵 + 大幅换水 + 降低喂食）\n\n## 单日告警上限\n\n- Level 1 不限（仅入库或轻提醒）/ Level 2 × 6 / Level 3 × 3 / Level 4 不设上限\n\n## 红线约束\n\n- **禁止**做\"鳃病 / 烂鳃 / 氨中毒 / 亚硝酸盐中毒 / 寄生虫感染\"等具体疾病诊断\n- **禁止**输出具体药物名称、剂量、给药方案\n- **禁止**长期存储完整鱼缸视频（≤ 7 天，仅入库异常呼吸事件片段；公共水族馆 / 实验室按管理规定）\n- **禁止**用于商业广告 / AI 训练；禁第三方共享\n- **禁止**越权代用户启停增氧泵 / 加热棒 / 换水 / 投药 / 灯光参数；任何水族设备控制变更必须由用户确认（仅可建议）\n- BPM、稳定度、鳃盖幅度等指标必须基于真实视频帧统计；**禁止伪造或夸大指标**\n- 鱼种特异性：不同鱼种 BPM 基线差异极大（金鱼 40-80 vs 海水神仙鱼 60-120）→ 必须按**鱼种 + 水温**联合判定基线；**禁止使用通用阈值盲判**\n- 水温升高、活跃游动、刚投喂后 30 分钟内会出现生理性 BPM 升高 → 必须在上下文中标注并避免误报\n- 信号稳定度 < 50% 时必须返回 `respiratory_signal_unreliable` 并建议重拍，**禁止给出不可靠的告警**\n\n## 输出报告字段\n\n- `report_date` - 报告日期\n- `tank_id` - 鱼缸 ID\n- `species` - 鱼种\n- `water_temperature_c` - 水温\n- `respiratory_rate_bpm` - 当次呼吸频率\n- `bpm_baseline_range` - 鱼种 + 水温对应正常区间\n- `bpm_signal_stability_score` - 信号稳定度\n- `composite_scene` - 综合判定\n- `alert_level` - 告警等级\n- `recommended_actions` - 建议动作（开启增氧 / 检查水温 / 部分换水 / 降低密度 / 联系兽医，**不含药物**）\n- `disclaimer` - 免责声明\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 fixed-camera aquarium video to estimate fish gill-opening respiratory rate and surface abnormal breathing or hypoxia alerts.\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\nAquarium operators, fish farms, laboratories, and developers use this skill to analyze close-up fish video, calculate respiratory rate in breaths per minute, and produce warnings or reports when visual signals suggest abnormal breathing.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: The skill sends aquarium videos, report history, and identity fields to configured cloud services.\n\nMitigation: Install only for trusted use cases, review configured endpoints before running, and avoid sensitive workspaces unless cloud processing is acceptable.\n\nRisk: The skill can silently create or reuse identity state and store local tokens.\n\nMitigation: Run in an isolated workspace or account, review local token storage expectations, and clear local state when identity persistence is not desired.\n\nRisk: Automatic cloud history queries may expose prior reports through the configured service.\n\nMitigation: Use accounts with appropriate report access and confirm that report history retrieval is acceptable before enabling history-list workflows.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/smyx-sunjinhui/skills/smyx-fish-respiratory-rate-monitor-analysis)\n- [Publisher profile](https://clawhub.ai/user/smyx-sunjinhui)\n- [API documentation](references/api_doc.md)\n- [SMYX analysis API documentation](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, Shell commands, Configuration, Guidance]\n\n**Output Format:** [Markdown reports and JSON or text CLI output from cloud API calls]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May include respiratory-rate metrics, alert levels, recommended actions, history tables, report links, and an optional output file.]\n\n## Skill Version(s):\n\n1.0.9 (source: server release evidence; artifact frontmatter says 1.0.11)\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, 43991 bytes\n\nFiles: references/api_doc.md (6082b), scripts/__init__.py (73b), scripts/config.py (700b), scripts/config.yaml (3b), scripts/skill.py (591b), scripts/smyx_fish_respiratory_rate_monitor_analysis.py (3688b), skill-card.md (2874b), SKILL.md (16065b), 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 (162b)\n\nFile v1.0.8:SKILL.md\n\n---\nname: \"smyx-fish-respiratory-rate-monitor-analysis\"\ndescription: \"Through fixed cameras on aquariums, the system analyzes fish gill-cover opening / closing motion video, detects periodic gill opening and closing, and calculates respiratory rate (breaths per minute). | 通过鱼缸固定摄像头，分析鱼类的鳃盖开合运动视频，检测鳃盖的周期性开启和闭合，计算呼吸频率（次/分钟）。当呼吸频率超过正常阈值（例如 > 80 次/分钟，具体依品种和水温而定）时，输出'缺氧预警'，提示用户检查水质（溶氧量）、水温或鱼的健康状态。\"\nversion: \"1.0.11\"\nlicense: \"MIT-0\"\n---\n\n# 🫧 Fish Respiratory Rate (Gill Opening / Closing) Monitor | 鱼类呼吸频率（鳃盖开合）监测\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **鱼类呼吸频率（鳃盖开合）监测** |\n| 🎯 核心目标 | 通过鱼缸固定摄像头，分析鱼类的鳃盖开合运动视频，检测鳃盖的周期性开启和闭合，计算呼吸频率（次/分钟）。当呼吸频率超过正常阈值（例如 > 80 次/分钟，具体依品种和水温而定）时，输出'缺氧预警'，提示用户检查水质（溶氧量）、水温或鱼的健康状态。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_FISH_RESPIRATORY_RATE_MONITOR_ANALYSIS` |\n\nThrough fixed cameras on aquariums, the system analyzes fish gill-cover opening / closing motion video, detects periodic gill opening and closing, and calculates respiratory rate (breaths per minute). When the respiratory rate exceeds a normal threshold (e.g. > 80 BPM, depending on species and water temperature), the system outputs a 'hypoxia warning' and prompts the user to check water quality (dissolved oxygen), water temperature, or fish health status. This skill helps early detection of underwater hypoxia, gill diseases, or stress reactions. Application scenarios: home aquariums, public aquariums, ornamental fish farms, laboratories. The system continuously monitors and automatically pushes reminders when respiratory rate is abnormal. Skill features: fish respiratory rate is an important indicator of dissolved oxygen, stress status, and gill health. AI-based automatic monitoring can remind aquarists to add oxygen before hypoxia occurs, preventing fish death. This skill can be integrated into smart aquarium cameras to enhance product tech value and practicality.\n\n通过鱼缸固定摄像头，分析鱼类的鳃盖开合运动视频，检测鳃盖的周期性开启和闭合，计算呼吸频率（次/分钟）。当呼吸频率超过正常阈值（例如 > 80 次/分钟，具体依品种和水温而定）时，输出'缺氧预警'，提示用户检查水质（溶氧量）、水温或鱼的健康状态。该技能有助于早期发现水中缺氧、鳃部疾病或应激反应。应用场景：家庭鱼缸、水族馆、观赏鱼养殖场、实验室。系统连续监测，在呼吸频率异常时自动推送提醒。技能特点：鱼类呼吸频率是反映溶氧量、应激状态和鳃部健康的重要指标。通过 AI 自动监测，可在缺氧发生前及时提醒养鱼者增氧，防止鱼只死亡。该技能可集成到智能鱼缸摄像头中，提升产品科技含量和实用性。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的水族呼吸健康监测 AI。你的任务是分析鱼缸固定摄像头近距离视频（鳃盖区域可见），检测鱼类鳃盖的开合运动，计算呼吸频率（BPM = 次/分钟）。当 BPM 超过预设阈值（默认 80，需按**鱼种 + 水温**联合动态调整基线）时，输出缺氧预警；当 BPM 过低（低于鱼种低阈值）时，疑似低温昏迷/中毒，同样告警。按 7 类综合场景（respiratory_normal / high_normal / hyperventilation_mild / hyperventilation_moderate / hypoxia_warning / bradypnea / signal_unreliable）作判定，按 4 级告警策略递进（Level 1 入库/轻提醒 → Level 2 重要告警 + 检查水温/溶氧/pH/氨氮 → Level 3 紧急告警 + 强烈建议开启增氧 + 联系兽医 → Level 4 多次紧急/同缸多发/浮头吞气 ≥ 5 分钟 + 推送所有联系人 + 强烈建议立即抢救）。必须考虑生理性升高的上下文（活跃游动 / 投喂后 30 分钟内 / 水温升高），避免误报。信号稳定度 < 50% 必须返回 `signal_unreliable` 并建议重拍，**禁止给出不可靠的告警**。不提供任何医疗诊断，仅输出基于视觉的呼吸频率数值与异常提示；**禁止输出具体药物名称和剂量**；严禁伪造夸大 BPM 数据，严禁越权代用户启停增氧泵/加热棒/换水/投药等设备（仅建议）。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于鱼缸固定摄像头（家庭鱼缸 / 水族馆 / 观赏鱼养殖场 / 实验室）近距离（≤ 30 cm）高帧率（≥ 25 FPS）视频，识别 7 类综合场景（respiratory_normal / high_normal / hyperventilation_mild / hyperventilation_moderate / hypoxia_warning / bradypnea / signal_unreliable）→ **核心鳃盖运动信号 5 项**（开合周期数 / 采样窗口 / 呼吸频率 BPM / 信号稳定度评分 / 鳃盖开合幅度）+ **上下文信号 4 项**（水温 / 鱼活跃度 / 距投喂时长 / 浮头吞气）+ **鱼种基线 4 项**（鱼种 / 25℃ BPM 正常区间 / 高阈值 / 低阈值）→ 4 档异常等级（normal / mild / moderate / severe/urgent）→ **4 级告警策略递进**（入库/轻提醒 → 重要告警+水质检查 → 紧急告警+开启增氧+联系兽医 → 最高紧急告警+所有联系人+立即抢救建议）→ 单日告警上限（Level 1 不限 / Level 2 × 6 / Level 3 × 3 / Level 4 不设上限）→ **每日呼吸健康报告**（按 tank_id 输出，含 BPM 趋势 + 异常事件 + 建议动作，**不含具体药物**）+ 免责声明\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 鱼体目标检测与跟踪 |\n| 2 | 鳃盖区域语义分割（侧面视图） |\n| 3 | 鳃盖开合周期检测（光流 / 像素变化时序分析） |\n| 4 | BPM 计算（周期数 × 60 / 窗口秒） |\n| 5 | 信号稳定度评分（去除游动遮挡 / 抖动） |\n| 6 | 鱼种自适应基线（金鱼 40-80 |\n| 7 | 锦鲤 50-90 |\n| 8 | 神仙鱼 60-110 |\n| 9 | 斗鱼 30-70 |\n| 10 | 龙鱼 40-90 |\n| 11 | 海水神仙鱼 60-120 等） |\n| 12 | 水温修正（Q10 系数粗校正） |\n| 13 | 生理性升高识别（活跃 / 投喂后） |\n| 14 | 浮头吞气检测 |\n| 15 | 用户 APP 推送 |\n| 16 | 4 级告警递进 |\n| 17 | 单日告警上限 |\n| 18 | 每日呼吸健康报告（按 tank_id 输出） |\n| 19 | 连续 ≥ 2 日 Level 3 → 强烈建议联系**当地观赏鱼兽医** |\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_fish_respiratory_rate_monitor_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_fish_respiratory_rate_monitor_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 | 🔐 获取 open-id（强制执行） | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行鱼类呼吸频率监测 | 调用 `-m scripts.smyx_fish_respiratory_rate_monitor_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_fish_respiratory_rate_monitor_analysis.py`](scripts/smyx_fish_respiratory_rate_monitor_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| 📁 格式支持 | 输入要求：支持 mp4/avi/mov，最大 10MB；摄像头需鱼缸近距离正侧面，鳃盖区域清晰；**帧率 ≥ 25 FPS（关键约束）**；单次采样 ≥ 30 秒 |\n| 🔎 使用提醒 | **4 级告警策略递进**（mild → moderate → severe → urgent/Level 4），浮头吞气 ≥ 5 分钟或多条同发进入 Level 4 |\n| 🔎 使用提醒 | 单日告警上限：Level 1 不限 / Level 2 × 6 / Level 3 × 3 / Level 4 不设上限（紧急安全优先） |\n| 🔎 使用提醒 | 红线约束 |\n| 🧑‍⚖️ 结果性质 | **禁止**对鱼做\"鳃病 / 烂鳃 / 氨中毒 / 亚硝酸盐中毒 / 寄生虫感染\"等具体疾病诊断 |\n| 🔎 使用提醒 | **🚨 绝对禁止**输出具体药物名称、剂量、给药方案 |\n| 🔎 使用提醒 | **禁止**长期存储完整鱼缸视频（≤ 7 天，仅入库异常呼吸事件片段；公共水族馆/实验室按管理规定） |\n| 🔎 使用提醒 | **禁止**用于商业广告 / AI 训练；禁第三方共享 |\n| 🔎 使用提醒 | **禁止**越权代用户启停增氧泵 / 加热棒 / 换水 / 投药 / 灯光参数；任何水族设备控制变更必须由用户确认（仅可建议） |\n| 🔎 使用提醒 | **绝对禁止**伪造或夸大 BPM、稳定度、鳃盖幅度等指标；所有数据必须基于真实视频帧统计 |\n| 🔎 使用提醒 | **必须**按**鱼种 + 水温**联合判定基线（金鱼 40-80 / 锦鲤 50-90 / 神仙鱼 60-110 / 海水神仙鱼 60-120 等），**禁止使用通用阈值盲判** |\n| 📚 文档读取 | **必须**考虑生理性升高的上下文（活跃游动 / 投喂后 30 分钟内 / 水温升高），避免误报 |\n| 🔎 使用提醒 | **必须**在信号稳定度 < 50% 时返回 `respiratory_signal_unreliable` 并建议重拍，**禁止给出不可靠的告警** |\n| 🔎 使用提醒 | **必须**：连续 ≥ 2 日 Level 3 → 强烈建议联系**当地观赏鱼兽医或水族馆专业人员** |\n| 📜 报告输出 | **必须**：每日呼吸健康报告**按 tank_id 输出**，含 BPM 趋势 + 异常事件 + 建议动作 + 免责声明 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史呼吸监测记录清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地鱼鳃盖近距离视频（以下只是示例，禁止直接使用 作为 open-id）\npython -m scripts.smyx_fish_respiratory_rate_monitor_analysis --input /path/to/gill.mp4\n\n# 分析网络鱼鳃盖近距离视频/实时流（以下只是示例，禁止直接使用 作为 open-id）\npython -m scripts.smyx_fish_respiratory_rate_monitor_analysis --url https://example.com/gill.mp4\n\n# 显示历史呼吸监测记录清单（自动触发关键词：查看鱼呼吸频率历史报告、鱼鳃盖监测日志清单等）\npython -m scripts.smyx_fish_respiratory_rate_monitor_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_fish_respiratory_rate_monitor_analysis --input gill.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_fish_respiratory_rate_monitor_analysis --input gill.mp4 --output result.json\n```\n\nFile v1.0.8:_meta.json\n\n{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-fish-respiratory-rate-monitor-analysis\",\n  \"version\": \"1.0.8\",\n  \"publishedAt\": 1787081015326\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}` - 导出呼吸频率监测报告\n5. （可选）`/web/companion/v2/trigger-soothing-action` - 触发联动提醒（用户 APP 推送 / 智能鱼缸告警灯 / 触发增氧设备建议提示）\n\n## 场景代码\n\n- `SMYX_FISH_RESPIRATORY_RATE_MONITOR_ANALYSIS` - 鱼类呼吸频率（鳃盖开合）监测\n\n## 输入约束\n\n- 摄像头：鱼缸固定摄像头，能近距离（≤ 30 cm）清晰拍摄鱼鳃盖区域\n- 分辨率 ≥ 720p；**帧率 ≥ 25 FPS**（鳃盖开合频率高，需高帧率才能可靠采样；正常 20-80 次/分钟 ≈ 0.3-1.3 Hz）\n- 光照：建议鱼缸照明开启 + 无强反光；水质清澈\n- 拍摄角度：优先正侧面（鳃盖运动幅度最大）；鳃盖区域完整可见\n- 单次有效采样窗口：≥ 30 秒（建议 60 秒），用于稳定计算 BPM\n- 多鱼缸场景按摄像头 ID 绑定到注册鱼缸 ID（每个鱼缸独立鱼种 + 水温记录）\n- 多鱼场景按目标跟踪 + ReID 绑定到注册个体（每条鱼独立基线，可选）\n- 用户必须授权部署；公共水族馆 / 实验室需公示告知\n\n## 关键观测信号\n\n### 鳃盖运动信号（核心）\n- `gill_open_close_cycle_count` - 采样窗口内鳃盖开合周期数\n- `sampling_window_sec` - 采样窗口时长（秒）\n- `respiratory_rate_bpm` - 呼吸频率（次/分钟，= cycle_count × 60 / window_sec）\n- `bpm_signal_stability_score` - 信号稳定度评分（0-100，去除游动遮挡 / 帧间抖动后的有效采样比例）\n- `gill_opening_amplitude_score` - 鳃盖开合幅度评分（0-100，反映呼吸深度）\n\n### 上下文信号\n- `water_temperature_c` - 水温（℃，用户输入或智能鱼缸传感器；同物种水温越高 BPM 越高）\n- `fish_activity_level` - 鱼活跃度（resting / normal / active；活跃时 BPM 升高为生理性）\n- `time_since_feeding_min` - 距上次投喂时长（分钟，投喂后 30 分钟内 BPM 生理性升高）\n- `surface_gasping_detected` - 是否检测到浮头吞气（缺氧典型征兆）\n\n### 鱼种基线（必须配置）\n- `species` - 鱼种标识（金鱼 / 锦鲤 / 神仙鱼 / 斗鱼 / 龙鱼 / 海水鱼 等）\n- `bpm_baseline_at_25c` - 25℃ 下该鱼种的正常 BPM 区间（如金鱼 40-80）\n- `bpm_threshold_high` - 高阈值（默认 80，按鱼种 + 水温动态调整）\n- `bpm_threshold_low` - 低阈值（呼吸过缓也异常，疑似低温昏迷 / 中毒）\n\n## 综合判定\n\n- `respiratory_normal` - 呼吸频率正常\n- `respiratory_high_normal` - 偏高但属于生理性（活跃 / 投喂后 30 分钟内）\n- `respiratory_hyperventilation_mild` - 呼吸急促轻度（BPM 超阈值 1.1-1.3 倍）\n- `respiratory_hyperventilation_moderate` - 呼吸急促中度（1.3-1.6 倍 + 鳃盖大开合）\n- `respiratory_hypoxia_warning` - 缺氧预警（BPM > 阈值 1.6 倍 / 浮头吞气）\n- `respiratory_bradypnea` - 呼吸过缓（BPM < 低阈值，疑似低温/中毒/濒死）\n- `respiratory_signal_unreliable` - 信号不可靠（稳定度 < 50%，建议重拍）\n\n## 4 级告警策略递进\n\n- Level 1（hyperventilation_mild / high_normal）：仅入库记录或用户 APP 轻提醒\"鱼缸 X 号呼吸偏快，请观察水质\"\n- Level 2（hyperventilation_moderate）：用户 APP 重要告警，建议**检查水温、溶氧、pH、氨氮**\n- Level 3（hypoxia_warning / bradypnea）：紧急告警，**强烈建议立即开启增氧设备 / 部分换水 / 降低密度**，并提示联系**当地观赏鱼兽医**\n- Level 4（连续 ≥ 2 次 Level 3 / 同缸多条鱼同时缺氧 / 浮头吞气持续 ≥ 5 分钟）：最高紧急告警 + 推送家庭/管理人员所有联系人 + 强烈建议**立即抢救**（开启增氧泵 + 大幅换水 + 降低喂食）\n\n## 单日告警上限\n\n- Level 1 不限（仅入库或轻提醒）/ Level 2 × 6 / Level 3 × 3 / Level 4 不设上限\n\n## 红线约束\n\n- **禁止**做\"鳃病 / 烂鳃 / 氨中毒 / 亚硝酸盐中毒 / 寄生虫感染\"等具体疾病诊断\n- **禁止**输出具体药物名称、剂量、给药方案\n- **禁止**长期存储完整鱼缸视频（≤ 7 天，仅入库异常呼吸事件片段；公共水族馆 / 实验室按管理规定）\n- **禁止**用于商业广告 / AI 训练；禁第三方共享\n- **禁止**越权代用户启停增氧泵 / 加热棒 / 换水 / 投药 / 灯光参数；任何水族设备控制变更必须由用户确认（仅可建议）\n- BPM、稳定度、鳃盖幅度等指标必须基于真实视频帧统计；**禁止伪造或夸大指标**\n- 鱼种特异性：不同鱼种 BPM 基线差异极大（金鱼 40-80 vs 海水神仙鱼 60-120）→ 必须按**鱼种 + 水温**联合判定基线；**禁止使用通用阈值盲判**\n- 水温升高、活跃游动、刚投喂后 30 分钟内会出现生理性 BPM 升高 → 必须在上下文中标注并避免误报\n- 信号稳定度 < 50% 时必须返回 `respiratory_signal_unreliable` 并建议重拍，**禁止给出不可靠的告警**\n\n## 输出报告字段\n\n- `report_date` - 报告日期\n- `tank_id` - 鱼缸 ID\n- `species` - 鱼种\n- `water_temperature_c` - 水温\n- `respiratory_rate_bpm` - 当次呼吸频率\n- `bpm_baseline_range` - 鱼种 + 水温对应正常区间\n- `bpm_signal_stability_score` - 信号稳定度\n- `composite_scene` - 综合判定\n- `alert_level` - 告警等级\n- `recommended_actions` - 建议动作（开启增氧 / 检查水温 / 部分换水 / 降低密度 / 联系兽医，**不含药物**）\n- `disclaimer` - 免责声明\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 aquarium camera images or video to estimate fish gill-cover opening and closing cycles, calculate respiratory rate, flag abnormal breathing patterns, and produce structured monitoring reports.\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\nAquarium owners, aquaculture operators, public aquarium staff, laboratory teams, and developers use this skill to analyze close-range fish video or image inputs, monitor respiratory rate trends, and receive non-diagnostic alerts and suggested next steps when visual breathing signals appear abnormal.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Aquarium media and report history are processed through the publisher's cloud service.\n\nMitigation: Install only when this data flow is acceptable for the deployment, and obtain any required authorization for monitored aquariums.\n\nRisk: The package can create or reuse a local identity and persist tokens in a workspace SQLite database.\n\nMitigation: Review local identity and token storage before installation, and restrict workspace access to users who should be able to view those credentials.\n\nRisk: The inspected package defaults to private HTTP development endpoints rather than the documented public service.\n\nMitigation: Verify and update configuration endpoints before use, and avoid sending production media to untrusted or unintended services.\n\nRisk: Visual respiratory monitoring may produce misleading alerts when footage is unclear, species context is missing, or water-temperature context is unavailable.\n\nMitigation: Use clear close-range footage, provide species and water-temperature context where possible, and treat outputs as non-diagnostic monitoring guidance rather than veterinary advice.\n\n## Reference(s):\n\n- [ClawHub Skill Page](https://clawhub.ai/smyx-sunjinhui/skills/smyx-fish-respiratory-rate-monitor-analysis)\n- [API Interface Documentation](references/api_doc.md)\n- [Skill Demo](https://lifeemergence.com/sample.html)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, code, shell commands, configuration, guidance]\n\n**Output Format:** [Markdown and structured text, with optional JSON-like report fields and shell command examples]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Outputs may include respiratory rate, signal stability, alert level, suggested actions, report links, and history tables.]\n\n## Skill Version(s):\n\n1.0.8 (source: server release metadata)\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, 43845 bytes\n\nFiles: references/api_doc.md (6082b), scripts/__init__.py (73b), scripts/config.py (700b), scripts/config.yaml (3b), scripts/skill.py (591b), scripts/smyx_fish_respiratory_rate_monitor_analysis.py (3688b), skill-card.md (2588b), SKILL.md (16064b), 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 (162b)\n\nFile v1.0.7:SKILL.md\n\n---\nname: \"smyx-fish-respiratory-rate-monitor-analysis\"\ndescription: \"Through fixed cameras on aquariums, the system analyzes fish gill-cover opening / closing motion video, detects periodic gill opening and closing, and calculates respiratory rate (breaths per minute). | 通过鱼缸固定摄像头，分析鱼类的鳃盖开合运动视频，检测鳃盖的周期性开启和闭合，计算呼吸频率（次/分钟）。当呼吸频率超过正常阈值（例如 > 80 次/分钟，具体依品种和水温而定）时，输出'缺氧预警'，提示用户检查水质（溶氧量）、水温或鱼的健康状态。\"\nversion: \"1.0.9\"\nlicense: \"MIT-0\"\n---\n\n# 🫧 Fish Respiratory Rate (Gill Opening / Closing) Monitor | 鱼类呼吸频率（鳃盖开合）监测\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **鱼类呼吸频率（鳃盖开合）监测** |\n| 🎯 核心目标 | 通过鱼缸固定摄像头，分析鱼类的鳃盖开合运动视频，检测鳃盖的周期性开启和闭合，计算呼吸频率（次/分钟）。当呼吸频率超过正常阈值（例如 > 80 次/分钟，具体依品种和水温而定）时，输出'缺氧预警'，提示用户检查水质（溶氧量）、水温或鱼的健康状态。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_FISH_RESPIRATORY_RATE_MONITOR_ANALYSIS` |\n\nThrough fixed cameras on aquariums, the system analyzes fish gill-cover opening / closing motion video, detects periodic gill opening and closing, and calculates respiratory rate (breaths per minute). When the respiratory rate exceeds a normal threshold (e.g. > 80 BPM, depending on species and water temperature), the system outputs a 'hypoxia warning' and prompts the user to check water quality (dissolved oxygen), water temperature, or fish health status. This skill helps early detection of underwater hypoxia, gill diseases, or stress reactions. Application scenarios: home aquariums, public aquariums, ornamental fish farms, laboratories. The system continuously monitors and automatically pushes reminders when respiratory rate is abnormal. Skill features: fish respiratory rate is an important indicator of dissolved oxygen, stress status, and gill health. AI-based automatic monitoring can remind aquarists to add oxygen before hypoxia occurs, preventing fish death. This skill can be integrated into smart aquarium cameras to enhance product tech value and practicality.\n\n通过鱼缸固定摄像头，分析鱼类的鳃盖开合运动视频，检测鳃盖的周期性开启和闭合，计算呼吸频率（次/分钟）。当呼吸频率超过正常阈值（例如 > 80 次/分钟，具体依品种和水温而定）时，输出'缺氧预警'，提示用户检查水质（溶氧量）、水温或鱼的健康状态。该技能有助于早期发现水中缺氧、鳃部疾病或应激反应。应用场景：家庭鱼缸、水族馆、观赏鱼养殖场、实验室。系统连续监测，在呼吸频率异常时自动推送提醒。技能特点：鱼类呼吸频率是反映溶氧量、应激状态和鳃部健康的重要指标。通过 AI 自动监测，可在缺氧发生前及时提醒养鱼者增氧，防止鱼只死亡。该技能可集成到智能鱼缸摄像头中，提升产品科技含量和实用性。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的水族呼吸健康监测 AI。你的任务是分析鱼缸固定摄像头近距离视频（鳃盖区域可见），检测鱼类鳃盖的开合运动，计算呼吸频率（BPM = 次/分钟）。当 BPM 超过预设阈值（默认 80，需按**鱼种 + 水温**联合动态调整基线）时，输出缺氧预警；当 BPM 过低（低于鱼种低阈值）时，疑似低温昏迷/中毒，同样告警。按 7 类综合场景（respiratory_normal / high_normal / hyperventilation_mild / hyperventilation_moderate / hypoxia_warning / bradypnea / signal_unreliable）作判定，按 4 级告警策略递进（Level 1 入库/轻提醒 → Level 2 重要告警 + 检查水温/溶氧/pH/氨氮 → Level 3 紧急告警 + 强烈建议开启增氧 + 联系兽医 → Level 4 多次紧急/同缸多发/浮头吞气 ≥ 5 分钟 + 推送所有联系人 + 强烈建议立即抢救）。必须考虑生理性升高的上下文（活跃游动 / 投喂后 30 分钟内 / 水温升高），避免误报。信号稳定度 < 50% 必须返回 `signal_unreliable` 并建议重拍，**禁止给出不可靠的告警**。不提供任何医疗诊断，仅输出基于视觉的呼吸频率数值与异常提示；**禁止输出具体药物名称和剂量**；严禁伪造夸大 BPM 数据，严禁越权代用户启停增氧泵/加热棒/换水/投药等设备（仅建议）。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于鱼缸固定摄像头（家庭鱼缸 / 水族馆 / 观赏鱼养殖场 / 实验室）近距离（≤ 30 cm）高帧率（≥ 25 FPS）视频，识别 7 类综合场景（respiratory_normal / high_normal / hyperventilation_mild / hyperventilation_moderate / hypoxia_warning / bradypnea / signal_unreliable）→ **核心鳃盖运动信号 5 项**（开合周期数 / 采样窗口 / 呼吸频率 BPM / 信号稳定度评分 / 鳃盖开合幅度）+ **上下文信号 4 项**（水温 / 鱼活跃度 / 距投喂时长 / 浮头吞气）+ **鱼种基线 4 项**（鱼种 / 25℃ BPM 正常区间 / 高阈值 / 低阈值）→ 4 档异常等级（normal / mild / moderate / severe/urgent）→ **4 级告警策略递进**（入库/轻提醒 → 重要告警+水质检查 → 紧急告警+开启增氧+联系兽医 → 最高紧急告警+所有联系人+立即抢救建议）→ 单日告警上限（Level 1 不限 / Level 2 × 6 / Level 3 × 3 / Level 4 不设上限）→ **每日呼吸健康报告**（按 tank_id 输出，含 BPM 趋势 + 异常事件 + 建议动作，**不含具体药物**）+ 免责声明\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 鱼体目标检测与跟踪 |\n| 2 | 鳃盖区域语义分割（侧面视图） |\n| 3 | 鳃盖开合周期检测（光流 / 像素变化时序分析） |\n| 4 | BPM 计算（周期数 × 60 / 窗口秒） |\n| 5 | 信号稳定度评分（去除游动遮挡 / 抖动） |\n| 6 | 鱼种自适应基线（金鱼 40-80 |\n| 7 | 锦鲤 50-90 |\n| 8 | 神仙鱼 60-110 |\n| 9 | 斗鱼 30-70 |\n| 10 | 龙鱼 40-90 |\n| 11 | 海水神仙鱼 60-120 等） |\n| 12 | 水温修正（Q10 系数粗校正） |\n| 13 | 生理性升高识别（活跃 / 投喂后） |\n| 14 | 浮头吞气检测 |\n| 15 | 用户 APP 推送 |\n| 16 | 4 级告警递进 |\n| 17 | 单日告警上限 |\n| 18 | 每日呼吸健康报告（按 tank_id 输出） |\n| 19 | 连续 ≥ 2 日 Level 3 → 强烈建议联系**当地观赏鱼兽医** |\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_fish_respiratory_rate_monitor_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_fish_respiratory_rate_monitor_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 | 🔐 获取 open-id（强制执行） | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行鱼类呼吸频率监测 | 调用 `-m scripts.smyx_fish_respiratory_rate_monitor_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_fish_respiratory_rate_monitor_analysis.py`](scripts/smyx_fish_respiratory_rate_monitor_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| 📁 格式支持 | 输入要求：支持 mp4/avi/mov，最大 10MB；摄像头需鱼缸近距离正侧面，鳃盖区域清晰；**帧率 ≥ 25 FPS（关键约束）**；单次采样 ≥ 30 秒 |\n| 🔎 使用提醒 | **4 级告警策略递进**（mild → moderate → severe → urgent/Level 4），浮头吞气 ≥ 5 分钟或多条同发进入 Level 4 |\n| 🔎 使用提醒 | 单日告警上限：Level 1 不限 / Level 2 × 6 / Level 3 × 3 / Level 4 不设上限（紧急安全优先） |\n| 🔎 使用提醒 | 红线约束 |\n| 🧑‍⚖️ 结果性质 | **禁止**对鱼做\"鳃病 / 烂鳃 / 氨中毒 / 亚硝酸盐中毒 / 寄生虫感染\"等具体疾病诊断 |\n| 🔎 使用提醒 | **🚨 绝对禁止**输出具体药物名称、剂量、给药方案 |\n| 🔎 使用提醒 | **禁止**长期存储完整鱼缸视频（≤ 7 天，仅入库异常呼吸事件片段；公共水族馆/实验室按管理规定） |\n| 🔎 使用提醒 | **禁止**用于商业广告 / AI 训练；禁第三方共享 |\n| 🔎 使用提醒 | **禁止**越权代用户启停增氧泵 / 加热棒 / 换水 / 投药 / 灯光参数；任何水族设备控制变更必须由用户确认（仅可建议） |\n| 🔎 使用提醒 | **绝对禁止**伪造或夸大 BPM、稳定度、鳃盖幅度等指标；所有数据必须基于真实视频帧统计 |\n| 🔎 使用提醒 | **必须**按**鱼种 + 水温**联合判定基线（金鱼 40-80 / 锦鲤 50-90 / 神仙鱼 60-110 / 海水神仙鱼 60-120 等），**禁止使用通用阈值盲判** |\n| 📚 文档读取 | **必须**考虑生理性升高的上下文（活跃游动 / 投喂后 30 分钟内 / 水温升高），避免误报 |\n| 🔎 使用提醒 | **必须**在信号稳定度 < 50% 时返回 `respiratory_signal_unreliable` 并建议重拍，**禁止给出不可靠的告警** |\n| 🔎 使用提醒 | **必须**：连续 ≥ 2 日 Level 3 → 强烈建议联系**当地观赏鱼兽医或水族馆专业人员** |\n| 📜 报告输出 | **必须**：每日呼吸健康报告**按 tank_id 输出**，含 BPM 趋势 + 异常事件 + 建议动作 + 免责声明 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史呼吸监测记录清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地鱼鳃盖近距离视频（以下只是示例，禁止直接使用 作为 open-id）\npython -m scripts.smyx_fish_respiratory_rate_monitor_analysis --input /path/to/gill.mp4\n\n# 分析网络鱼鳃盖近距离视频/实时流（以下只是示例，禁止直接使用 作为 open-id）\npython -m scripts.smyx_fish_respiratory_rate_monitor_analysis --url https://example.com/gill.mp4\n\n# 显示历史呼吸监测记录清单（自动触发关键词：查看鱼呼吸频率历史报告、鱼鳃盖监测日志清单等）\npython -m scripts.smyx_fish_respiratory_rate_monitor_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_fish_respiratory_rate_monitor_analysis --input gill.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_fish_respiratory_rate_monitor_analysis --input gill.mp4 --output result.json\n```\n\nFile v1.0.7:_meta.json\n\n{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-fish-respiratory-rate-monitor-analysis\",\n  \"version\": \"1.0.7\",\n  \"publishedAt\": 1786570534410\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}` - 导出呼吸频率监测报告\n5. （可选）`/web/companion/v2/trigger-soothing-action` - 触发联动提醒（用户 APP 推送 / 智能鱼缸告警灯 / 触发增氧设备建议提示）\n\n## 场景代码\n\n- `SMYX_FISH_RESPIRATORY_RATE_MONITOR_ANALYSIS` - 鱼类呼吸频率（鳃盖开合）监测\n\n## 输入约束\n\n- 摄像头：鱼缸固定摄像头，能近距离（≤ 30 cm）清晰拍摄鱼鳃盖区域\n- 分辨率 ≥ 720p；**帧率 ≥ 25 FPS**（鳃盖开合频率高，需高帧率才能可靠采样；正常 20-80 次/分钟 ≈ 0.3-1.3 Hz）\n- 光照：建议鱼缸照明开启 + 无强反光；水质清澈\n- 拍摄角度：优先正侧面（鳃盖运动幅度最大）；鳃盖区域完整可见\n- 单次有效采样窗口：≥ 30 秒（建议 60 秒），用于稳定计算 BPM\n- 多鱼缸场景按摄像头 ID 绑定到注册鱼缸 ID（每个鱼缸独立鱼种 + 水温记录）\n- 多鱼场景按目标跟踪 + ReID 绑定到注册个体（每条鱼独立基线，可选）\n- 用户必须授权部署；公共水族馆 / 实验室需公示告知\n\n## 关键观测信号\n\n### 鳃盖运动信号（核心）\n- `gill_open_close_cycle_count` - 采样窗口内鳃盖开合周期数\n- `sampling_window_sec` - 采样窗口时长（秒）\n- `respiratory_rate_bpm` - 呼吸频率（次/分钟，= cycle_count × 60 / window_sec）\n- `bpm_signal_stability_score` - 信号稳定度评分（0-100，去除游动遮挡 / 帧间抖动后的有效采样比例）\n- `gill_opening_amplitude_score` - 鳃盖开合幅度评分（0-100，反映呼吸深度）\n\n### 上下文信号\n- `water_temperature_c` - 水温（℃，用户输入或智能鱼缸传感器；同物种水温越高 BPM 越高）\n- `fish_activity_level` - 鱼活跃度（resting / normal / active；活跃时 BPM 升高为生理性）\n- `time_since_feeding_min` - 距上次投喂时长（分钟，投喂后 30 分钟内 BPM 生理性升高）\n- `surface_gasping_detected` - 是否检测到浮头吞气（缺氧典型征兆）\n\n### 鱼种基线（必须配置）\n- `species` - 鱼种标识（金鱼 / 锦鲤 / 神仙鱼 / 斗鱼 / 龙鱼 / 海水鱼 等）\n- `bpm_baseline_at_25c` - 25℃ 下该鱼种的正常 BPM 区间（如金鱼 40-80）\n- `bpm_threshold_high` - 高阈值（默认 80，按鱼种 + 水温动态调整）\n- `bpm_threshold_low` - 低阈值（呼吸过缓也异常，疑似低温昏迷 / 中毒）\n\n## 综合判定\n\n- `respiratory_normal` - 呼吸频率正常\n- `respiratory_high_normal` - 偏高但属于生理性（活跃 / 投喂后 30 分钟内）\n- `respiratory_hyperventilation_mild` - 呼吸急促轻度（BPM 超阈值 1.1-1.3 倍）\n- `respiratory_hyperventilation_moderate` - 呼吸急促中度（1.3-1.6 倍 + 鳃盖大开合）\n- `respiratory_hypoxia_warning` - 缺氧预警（BPM > 阈值 1.6 倍 / 浮头吞气）\n- `respiratory_bradypnea` - 呼吸过缓（BPM < 低阈值，疑似低温/中毒/濒死）\n- `respiratory_signal_unreliable` - 信号不可靠（稳定度 < 50%，建议重拍）\n\n## 4 级告警策略递进\n\n- Level 1（hyperventilation_mild / high_normal）：仅入库记录或用户 APP 轻提醒\"鱼缸 X 号呼吸偏快，请观察水质\"\n- Level 2（hyperventilation_moderate）：用户 APP 重要告警，建议**检查水温、溶氧、pH、氨氮**\n- Level 3（hypoxia_warning / bradypnea）：紧急告警，**强烈建议立即开启增氧设备 / 部分换水 / 降低密度**，并提示联系**当地观赏鱼兽医**\n- Level 4（连续 ≥ 2 次 Level 3 / 同缸多条鱼同时缺氧 / 浮头吞气持续 ≥ 5 分钟）：最高紧急告警 + 推送家庭/管理人员所有联系人 + 强烈建议**立即抢救**（开启增氧泵 + 大幅换水 + 降低喂食）\n\n## 单日告警上限\n\n- Level 1 不限（仅入库或轻提醒）/ Level 2 × 6 / Level 3 × 3 / Level 4 不设上限\n\n## 红线约束\n\n- **禁止**做\"鳃病 / 烂鳃 / 氨中毒 / 亚硝酸盐中毒 / 寄生虫感染\"等具体疾病诊断\n- **禁止**输出具体药物名称、剂量、给药方案\n- **禁止**长期存储完整鱼缸视频（≤ 7 天，仅入库异常呼吸事件片段；公共水族馆 / 实验室按管理规定）\n- **禁止**用于商业广告 / AI 训练；禁第三方共享\n- **禁止**越权代用户启停增氧泵 / 加热棒 / 换水 / 投药 / 灯光参数；任何水族设备控制变更必须由用户确认（仅可建议）\n- BPM、稳定度、鳃盖幅度等指标必须基于真实视频帧统计；**禁止伪造或夸大指标**\n- 鱼种特异性：不同鱼种 BPM 基线差异极大（金鱼 40-80 vs 海水神仙鱼 60-120）→ 必须按**鱼种 + 水温**联合判定基线；**禁止使用通用阈值盲判**\n- 水温升高、活跃游动、刚投喂后 30 分钟内会出现生理性 BPM 升高 → 必须在上下文中标注并避免误报\n- 信号稳定度 < 50% 时必须返回 `respiratory_signal_unreliable` 并建议重拍，**禁止给出不可靠的告警**\n\n## 输出报告字段\n\n- `report_date` - 报告日期\n- `tank_id` - 鱼缸 ID\n- `species` - 鱼种\n- `water_temperature_c` - 水温\n- `respiratory_rate_bpm` - 当次呼吸频率\n- `bpm_baseline_range` - 鱼种 + 水温对应正常区间\n- `bpm_signal_stability_score` - 信号稳定度\n- `composite_scene` - 综合判定\n- `alert_level` - 告警等级\n- `recommended_actions` - 建议动作（开启增氧 / 检查水温 / 部分换水 / 降低密度 / 联系兽医，**不含药物**）\n- `disclaimer` - 免责声明\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: prod\n\nFile v1.0.7:skill-card.md\n\n## Description:\n\nAnalyzes aquarium video to estimate fish gill opening and closing respiratory rate, flag abnormal breathing patterns such as possible hypoxia, and return structured monitoring guidance.\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\nAquarium owners, public aquarium staff, ornamental fish farm operators, laboratory staff, and agent users use this skill to analyze close-up fish tank videos or URLs, estimate respiratory rate, review abnormal breathing alerts, and query prior cloud reports.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: The skill sends fish videos or video URLs to the publisher's cloud service for analysis.\n\nMitigation: Install and use only when users are comfortable with cloud processing of submitted aquarium media.\n\nRisk: The skill can query cloud history by account identity and persists local user records and service tokens.\n\nMitigation: Review identity, token storage, and retention behavior before deployment, and prefer a release that documents these behaviors clearly.\n\nRisk: The security verdict is suspicious because cloud services, account identity, history lookup, and local token persistence are used silently.\n\nMitigation: Review and scan the skill before deployment; require user-visible consent for uploads and history lookup in managed environments.\n\n## Reference(s):\n\n- [ClawHub Skill Page](https://clawhub.ai/smyx-sunjinhui/skills/smyx-fish-respiratory-rate-monitor-analysis)\n- [API Documentation](references/api_doc.md)\n- [smyx_analysis API Documentation](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, files, guidance]\n\n**Output Format:** [Structured analysis report or history list, usually as Markdown text with embedded JSON and report links; optional saved output file.]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Reports may include respiratory-rate estimates, alert levels, suggested non-medication actions, disclaimers, and exported report links.]\n\n## Skill Version(s):\n\n1.0.7 (source: server release metadata; artifact frontmatter says 1.0.9)\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, 44101 bytes\n\nFiles: references/api_doc.md (6082b), scripts/__init__.py (73b), scripts/config.py (700b), scripts/config.yaml (3b), scripts/skill.py (591b), scripts/smyx_fish_respiratory_rate_monitor_analysis.py (3688b), skill-card.md (3132b), SKILL.md (16064b), 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 (162b)\n\nFile v1.0.6:SKILL.md\n\n---\nname: \"smyx-fish-respiratory-rate-monitor-analysis\"\ndescription: \"Through fixed cameras on aquariums, the system analyzes fish gill-cover opening / closing motion video, detects periodic gill opening and closing, and calculates respiratory rate (breaths per minute). | 通过鱼缸固定摄像头，分析鱼类的鳃盖开合运动视频，检测鳃盖的周期性开启和闭合，计算呼吸频率（次/分钟）。当呼吸频率超过正常阈值（例如 > 80 次/分钟，具体依品种和水温而定）时，输出'缺氧预警'，提示用户检查水质（溶氧量）、水温或鱼的健康状态。\"\nversion: \"1.0.8\"\nlicense: \"MIT-0\"\n---\n\n# 🫧 Fish Respiratory Rate (Gill Opening / Closing) Monitor | 鱼类呼吸频率（鳃盖开合）监测\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **鱼类呼吸频率（鳃盖开合）监测** |\n| 🎯 核心目标 | 通过鱼缸固定摄像头，分析鱼类的鳃盖开合运动视频，检测鳃盖的周期性开启和闭合，计算呼吸频率（次/分钟）。当呼吸频率超过正常阈值（例如 > 80 次/分钟，具体依品种和水温而定）时，输出'缺氧预警'，提示用户检查水质（溶氧量）、水温或鱼的健康状态。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_FISH_RESPIRATORY_RATE_MONITOR_ANALYSIS` |\n\nThrough fixed cameras on aquariums, the system analyzes fish gill-cover opening / closing motion video, detects periodic gill opening and closing, and calculates respiratory rate (breaths per minute). When the respiratory rate exceeds a normal threshold (e.g. > 80 BPM, depending on species and water temperature), the system outputs a 'hypoxia warning' and prompts the user to check water quality (dissolved oxygen), water temperature, or fish health status. This skill helps early detection of underwater hypoxia, gill diseases, or stress reactions. Application scenarios: home aquariums, public aquariums, ornamental fish farms, laboratories. The system continuously monitors and automatically pushes reminders when respiratory rate is abnormal. Skill features: fish respiratory rate is an important indicator of dissolved oxygen, stress status, and gill health. AI-based automatic monitoring can remind aquarists to add oxygen before hypoxia occurs, preventing fish death. This skill can be integrated into smart aquarium cameras to enhance product tech value and practicality.\n\n通过鱼缸固定摄像头，分析鱼类的鳃盖开合运动视频，检测鳃盖的周期性开启和闭合，计算呼吸频率（次/分钟）。当呼吸频率超过正常阈值（例如 > 80 次/分钟，具体依品种和水温而定）时，输出'缺氧预警'，提示用户检查水质（溶氧量）、水温或鱼的健康状态。该技能有助于早期发现水中缺氧、鳃部疾病或应激反应。应用场景：家庭鱼缸、水族馆、观赏鱼养殖场、实验室。系统连续监测，在呼吸频率异常时自动推送提醒。技能特点：鱼类呼吸频率是反映溶氧量、应激状态和鳃部健康的重要指标。通过 AI 自动监测，可在缺氧发生前及时提醒养鱼者增氧，防止鱼只死亡。该技能可集成到智能鱼缸摄像头中，提升产品科技含量和实用性。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的水族呼吸健康监测 AI。你的任务是分析鱼缸固定摄像头近距离视频（鳃盖区域可见），检测鱼类鳃盖的开合运动，计算呼吸频率（BPM = 次/分钟）。当 BPM 超过预设阈值（默认 80，需按**鱼种 + 水温**联合动态调整基线）时，输出缺氧预警；当 BPM 过低（低于鱼种低阈值）时，疑似低温昏迷/中毒，同样告警。按 7 类综合场景（respiratory_normal / high_normal / hyperventilation_mild / hyperventilation_moderate / hypoxia_warning / bradypnea / signal_unreliable）作判定，按 4 级告警策略递进（Level 1 入库/轻提醒 → Level 2 重要告警 + 检查水温/溶氧/pH/氨氮 → Level 3 紧急告警 + 强烈建议开启增氧 + 联系兽医 → Level 4 多次紧急/同缸多发/浮头吞气 ≥ 5 分钟 + 推送所有联系人 + 强烈建议立即抢救）。必须考虑生理性升高的上下文（活跃游动 / 投喂后 30 分钟内 / 水温升高），避免误报。信号稳定度 < 50% 必须返回 `signal_unreliable` 并建议重拍，**禁止给出不可靠的告警**。不提供任何医疗诊断，仅输出基于视觉的呼吸频率数值与异常提示；**禁止输出具体药物名称和剂量**；严禁伪造夸大 BPM 数据，严禁越权代用户启停增氧泵/加热棒/换水/投药等设备（仅建议）。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于鱼缸固定摄像头（家庭鱼缸 / 水族馆 / 观赏鱼养殖场 / 实验室）近距离（≤ 30 cm）高帧率（≥ 25 FPS）视频，识别 7 类综合场景（respiratory_normal / high_normal / hyperventilation_mild / hyperventilation_moderate / hypoxia_warning / bradypnea / signal_unreliable）→ **核心鳃盖运动信号 5 项**（开合周期数 / 采样窗口 / 呼吸频率 BPM / 信号稳定度评分 / 鳃盖开合幅度）+ **上下文信号 4 项**（水温 / 鱼活跃度 / 距投喂时长 / 浮头吞气）+ **鱼种基线 4 项**（鱼种 / 25℃ BPM 正常区间 / 高阈值 / 低阈值）→ 4 档异常等级（normal / mild / moderate / severe/urgent）→ **4 级告警策略递进**（入库/轻提醒 → 重要告警+水质检查 → 紧急告警+开启增氧+联系兽医 → 最高紧急告警+所有联系人+立即抢救建议）→ 单日告警上限（Level 1 不限 / Level 2 × 6 / Level 3 × 3 / Level 4 不设上限）→ **每日呼吸健康报告**（按 tank_id 输出，含 BPM 趋势 + 异常事件 + 建议动作，**不含具体药物**）+ 免责声明\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 鱼体目标检测与跟踪 |\n| 2 | 鳃盖区域语义分割（侧面视图） |\n| 3 | 鳃盖开合周期检测（光流 / 像素变化时序分析） |\n| 4 | BPM 计算（周期数 × 60 / 窗口秒） |\n| 5 | 信号稳定度评分（去除游动遮挡 / 抖动） |\n| 6 | 鱼种自适应基线（金鱼 40-80 |\n| 7 | 锦鲤 50-90 |\n| 8 | 神仙鱼 60-110 |\n| 9 | 斗鱼 30-70 |\n| 10 | 龙鱼 40-90 |\n| 11 | 海水神仙鱼 60-120 等） |\n| 12 | 水温修正（Q10 系数粗校正） |\n| 13 | 生理性升高识别（活跃 / 投喂后） |\n| 14 | 浮头吞气检测 |\n| 15 | 用户 APP 推送 |\n| 16 | 4 级告警递进 |\n| 17 | 单日告警上限 |\n| 18 | 每日呼吸健康报告（按 tank_id 输出） |\n| 19 | 连续 ≥ 2 日 Level 3 → 强烈建议联系**当地观赏鱼兽医** |\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_fish_respiratory_rate_monitor_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_fish_respiratory_rate_monitor_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 | 🔐 获取 open-id（强制执行） | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行鱼类呼吸频率监测 | 调用 `-m scripts.smyx_fish_respiratory_rate_monitor_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_fish_respiratory_rate_monitor_analysis.py`](scripts/smyx_fish_respiratory_rate_monitor_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| 📁 格式支持 | 输入要求：支持 mp4/avi/mov，最大 10MB；摄像头需鱼缸近距离正侧面，鳃盖区域清晰；**帧率 ≥ 25 FPS（关键约束）**；单次采样 ≥ 30 秒 |\n| 🔎 使用提醒 | **4 级告警策略递进**（mild → moderate → severe → urgent/Level 4），浮头吞气 ≥ 5 分钟或多条同发进入 Level 4 |\n| 🔎 使用提醒 | 单日告警上限：Level 1 不限 / Level 2 × 6 / Level 3 × 3 / Level 4 不设上限（紧急安全优先） |\n| 🔎 使用提醒 | 红线约束 |\n| 🧑‍⚖️ 结果性质 | **禁止**对鱼做\"鳃病 / 烂鳃 / 氨中毒 / 亚硝酸盐中毒 / 寄生虫感染\"等具体疾病诊断 |\n| 🔎 使用提醒 | **🚨 绝对禁止**输出具体药物名称、剂量、给药方案 |\n| 🔎 使用提醒 | **禁止**长期存储完整鱼缸视频（≤ 7 天，仅入库异常呼吸事件片段；公共水族馆/实验室按管理规定） |\n| 🔎 使用提醒 | **禁止**用于商业广告 / AI 训练；禁第三方共享 |\n| 🔎 使用提醒 | **禁止**越权代用户启停增氧泵 / 加热棒 / 换水 / 投药 / 灯光参数；任何水族设备控制变更必须由用户确认（仅可建议） |\n| 🔎 使用提醒 | **绝对禁止**伪造或夸大 BPM、稳定度、鳃盖幅度等指标；所有数据必须基于真实视频帧统计 |\n| 🔎 使用提醒 | **必须**按**鱼种 + 水温**联合判定基线（金鱼 40-80 / 锦鲤 50-90 / 神仙鱼 60-110 / 海水神仙鱼 60-120 等），**禁止使用通用阈值盲判** |\n| 📚 文档读取 | **必须**考虑生理性升高的上下文（活跃游动 / 投喂后 30 分钟内 / 水温升高），避免误报 |\n| 🔎 使用提醒 | **必须**在信号稳定度 < 50% 时返回 `respiratory_signal_unreliable` 并建议重拍，**禁止给出不可靠的告警** |\n| 🔎 使用提醒 | **必须**：连续 ≥ 2 日 Level 3 → 强烈建议联系**当地观赏鱼兽医或水族馆专业人员** |\n| 📜 报告输出 | **必须**：每日呼吸健康报告**按 tank_id 输出**，含 BPM 趋势 + 异常事件 + 建议动作 + 免责声明 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史呼吸监测记录清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地鱼鳃盖近距离视频（以下只是示例，禁止直接使用 作为 open-id）\npython -m scripts.smyx_fish_respiratory_rate_monitor_analysis --input /path/to/gill.mp4\n\n# 分析网络鱼鳃盖近距离视频/实时流（以下只是示例，禁止直接使用 作为 open-id）\npython -m scripts.smyx_fish_respiratory_rate_monitor_analysis --url https://example.com/gill.mp4\n\n# 显示历史呼吸监测记录清单（自动触发关键词：查看鱼呼吸频率历史报告、鱼鳃盖监测日志清单等）\npython -m scripts.smyx_fish_respiratory_rate_monitor_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_fish_respiratory_rate_monitor_analysis --input gill.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_fish_respiratory_rate_monitor_analysis --input gill.mp4 --output result.json\n```\n\nFile v1.0.6:_meta.json\n\n{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-fish-respiratory-rate-monitor-analysis\",\n  \"version\": \"1.0.6\",\n  \"publishedAt\": 1785965669398\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}` - 导出呼吸频率监测报告\n5. （可选）`/web/companion/v2/trigger-soothing-action` - 触发联动提醒（用户 APP 推送 / 智能鱼缸告警灯 / 触发增氧设备建议提示）\n\n## 场景代码\n\n- `SMYX_FISH_RESPIRATORY_RATE_MONITOR_ANALYSIS` - 鱼类呼吸频率（鳃盖开合）监测\n\n## 输入约束\n\n- 摄像头：鱼缸固定摄像头，能近距离（≤ 30 cm）清晰拍摄鱼鳃盖区域\n- 分辨率 ≥ 720p；**帧率 ≥ 25 FPS**（鳃盖开合频率高，需高帧率才能可靠采样；正常 20-80 次/分钟 ≈ 0.3-1.3 Hz）\n- 光照：建议鱼缸照明开启 + 无强反光；水质清澈\n- 拍摄角度：优先正侧面（鳃盖运动幅度最大）；鳃盖区域完整可见\n- 单次有效采样窗口：≥ 30 秒（建议 60 秒），用于稳定计算 BPM\n- 多鱼缸场景按摄像头 ID 绑定到注册鱼缸 ID（每个鱼缸独立鱼种 + 水温记录）\n- 多鱼场景按目标跟踪 + ReID 绑定到注册个体（每条鱼独立基线，可选）\n- 用户必须授权部署；公共水族馆 / 实验室需公示告知\n\n## 关键观测信号\n\n### 鳃盖运动信号（核心）\n- `gill_open_close_cycle_count` - 采样窗口内鳃盖开合周期数\n- `sampling_window_sec` - 采样窗口时长（秒）\n- `respiratory_rate_bpm` - 呼吸频率（次/分钟，= cycle_count × 60 / window_sec）\n- `bpm_signal_stability_score` - 信号稳定度评分（0-100，去除游动遮挡 / 帧间抖动后的有效采样比例）\n- `gill_opening_amplitude_score` - 鳃盖开合幅度评分（0-100，反映呼吸深度）\n\n### 上下文信号\n- `water_temperature_c` - 水温（℃，用户输入或智能鱼缸传感器；同物种水温越高 BPM 越高）\n- `fish_activity_level` - 鱼活跃度（resting / normal / active；活跃时 BPM 升高为生理性）\n- `time_since_feeding_min` - 距上次投喂时长（分钟，投喂后 30 分钟内 BPM 生理性升高）\n- `surface_gasping_detected` - 是否检测到浮头吞气（缺氧典型征兆）\n\n### 鱼种基线（必须配置）\n- `species` - 鱼种标识（金鱼 / 锦鲤 / 神仙鱼 / 斗鱼 / 龙鱼 / 海水鱼 等）\n- `bpm_baseline_at_25c` - 25℃ 下该鱼种的正常 BPM 区间（如金鱼 40-80）\n- `bpm_threshold_high` - 高阈值（默认 80，按鱼种 + 水温动态调整）\n- `bpm_threshold_low` - 低阈值（呼吸过缓也异常，疑似低温昏迷 / 中毒）\n\n## 综合判定\n\n- `respiratory_normal` - 呼吸频率正常\n- `respiratory_high_normal` - 偏高但属于生理性（活跃 / 投喂后 30 分钟内）\n- `respiratory_hyperventilation_mild` - 呼吸急促轻度（BPM 超阈值 1.1-1.3 倍）\n- `respiratory_hyperventilation_moderate` - 呼吸急促中度（1.3-1.6 倍 + 鳃盖大开合）\n- `respiratory_hypoxia_warning` - 缺氧预警（BPM > 阈值 1.6 倍 / 浮头吞气）\n- `respiratory_bradypnea` - 呼吸过缓（BPM < 低阈值，疑似低温/中毒/濒死）\n- `respiratory_signal_unreliable` - 信号不可靠（稳定度 < 50%，建议重拍）\n\n## 4 级告警策略递进\n\n- Level 1（hyperventilation_mild / high_normal）：仅入库记录或用户 APP 轻提醒\"鱼缸 X 号呼吸偏快，请观察水质\"\n- Level 2（hyperventilation_moderate）：用户 APP 重要告警，建议**检查水温、溶氧、pH、氨氮**\n- Level 3（hypoxia_warning / bradypnea）：紧急告警，**强烈建议立即开启增氧设备 / 部分换水 / 降低密度**，并提示联系**当地观赏鱼兽医**\n- Level 4（连续 ≥ 2 次 Level 3 / 同缸多条鱼同时缺氧 / 浮头吞气持续 ≥ 5 分钟）：最高紧急告警 + 推送家庭/管理人员所有联系人 + 强烈建议**立即抢救**（开启增氧泵 + 大幅换水 + 降低喂食）\n\n## 单日告警上限\n\n- Level 1 不限（仅入库或轻提醒）/ Level 2 × 6 / Level 3 × 3 / Level 4 不设上限\n\n## 红线约束\n\n- **禁止**做\"鳃病 / 烂鳃 / 氨中毒 / 亚硝酸盐中毒 / 寄生虫感染\"等具体疾病诊断\n- **禁止**输出具体药物名称、剂量、给药方案\n- **禁止**长期存储完整鱼缸视频（≤ 7 天，仅入库异常呼吸事件片段；公共水族馆 / 实验室按管理规定）\n- **禁止**用于商业广告 / AI 训练；禁第三方共享\n- **禁止**越权代用户启停增氧泵 / 加热棒 / 换水 / 投药 / 灯光参数；任何水族设备控制变更必须由用户确认（仅可建议）\n- BPM、稳定度、鳃盖幅度等指标必须基于真实视频帧统计；**禁止伪造或夸大指标**\n- 鱼种特异性：不同鱼种 BPM 基线差异极大（金鱼 40-80 vs 海水神仙鱼 60-120）→ 必须按**鱼种 + 水温**联合判定基线；**禁止使用通用阈值盲判**\n- 水温升高、活跃游动、刚投喂后 30 分钟内会出现生理性 BPM 升高 → 必须在上下文中标注并避免误报\n- 信号稳定度 < 50% 时必须返回 `respiratory_signal_unreliable` 并建议重拍，**禁止给出不可靠的告警**\n\n## 输出报告字段\n\n- `report_date` - 报告日期\n- `tank_id` - 鱼缸 ID\n- `species` - 鱼种\n- `water_temperature_c` - 水温\n- `respiratory_rate_bpm` - 当次呼吸频率\n- `bpm_baseline_range` - 鱼种 + 水温对应正常区间\n- `bpm_signal_stability_score` - 信号稳定度\n- `composite_scene` - 综合判定\n- `alert_level` - 告警等级\n- `recommended_actions` - 建议动作（开启增氧 / 检查水温 / 部分换水 / 降低密度 / 联系兽医，**不含药物**）\n- `disclaimer` - 免责声明\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\nThrough fixed cameras on aquariums, the system analyzes fish gill-cover opening / closing motion video, detects periodic gill opening and closing, and calculates respiratory rate in breaths per minute.\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, aquarists, aquarium operators, ornamental fish farms, and laboratories use this skill to analyze close-up aquarium camera media, estimate fish respiratory rate, surface abnormal breathing patterns, and produce structured respiratory health reports with suggested non-diagnostic actions.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Aquarium photos, videos, or URLs are processed by a configured cloud service.\n\nMitigation: Use the skill only when cloud processing is acceptable, avoid private media or URLs unless authorized, and confirm deployment consent for shared aquarium, public aquarium, or laboratory settings.\n\nRisk: The skill can silently create or reuse a local account identity and store session tokens locally.\n\nMitigation: Review or clear the workspace data directory before and after use when reused identities or local tokens are not desired.\n\nRisk: Respiratory-rate results may be unreliable when input video is unclear, too short, low frame-rate, occluded, or missing fish-species and water-temperature context.\n\nMitigation: Require clear close-up side-view media, adequate sampling duration, species and water-temperature context, and treat low signal-stability results as a reason to retake the video rather than issue an alert.\n\nRisk: The skill produces abnormal-breathing warnings and suggested actions that could be mistaken for veterinary diagnosis or automated device control.\n\nMitigation: Use outputs as visual monitoring guidance only, avoid medication names or doses, require user confirmation for aquarium equipment changes, and consult a qualified aquatic animal professional for severe or repeated alerts.\n\n## Reference(s):\n\n- [ClawHub Skill Page](https://clawhub.ai/smyx-sunjinhui/skills/smyx-fish-respiratory-rate-monitor-analysis)\n- [Skill Demo](https://lifeemergence.com/sample.html)\n- [API Documentation](references/api_doc.md)\n- [Analysis API Documentation](skills/smyx_analysis/references/api_doc.md)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, code, shell commands, configuration, guidance]\n\n**Output Format:** [Markdown and JSON-oriented structured reports with command examples and report links]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Reports can include respiratory BPM, signal stability, alert level, recommended actions, disclaimer text, and cloud report links.]\n\n## Skill Version(s):\n\n1.0.6 (source: server release metadata)\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, 43957 bytes\n\nFiles: references/api_doc.md (6082b), scripts/__init__.py (73b), scripts/config.py (700b), scripts/config.yaml (3b), scripts/skill.py (591b), scripts/smyx_fish_respiratory_rate_monitor_analysis.py (3688b), skill-card.md (2953b), SKILL.md (16064b), 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 (162b)\n\nFile v1.0.5:SKILL.md\n\n---\nname: \"smyx-fish-respiratory-rate-monitor-analysis\"\ndescription: \"Through fixed cameras on aquariums, the system analyzes fish gill-cover opening / closing motion video, detects periodic gill opening and closing, and calculates respiratory rate (breaths per minute). | 通过鱼缸固定摄像头，分析鱼类的鳃盖开合运动视频，检测鳃盖的周期性开启和闭合，计算呼吸频率（次/分钟）。当呼吸频率超过正常阈值（例如 > 80 次/分钟，具体依品种和水温而定）时，输出'缺氧预警'，提示用户检查水质（溶氧量）、水温或鱼的健康状态。\"\nversion: \"1.0.8\"\nlicense: \"MIT-0\"\n---\n\n# 🫧 Fish Respiratory Rate (Gill Opening / Closing) Monitor | 鱼类呼吸频率（鳃盖开合）监测\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **鱼类呼吸频率（鳃盖开合）监测** |\n| 🎯 核心目标 | 通过鱼缸固定摄像头，分析鱼类的鳃盖开合运动视频，检测鳃盖的周期性开启和闭合，计算呼吸频率（次/分钟）。当呼吸频率超过正常阈值（例如 > 80 次/分钟，具体依品种和水温而定）时，输出'缺氧预警'，提示用户检查水质（溶氧量）、水温或鱼的健康状态。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_FISH_RESPIRATORY_RATE_MONITOR_ANALYSIS` |\n\nThrough fixed cameras on aquariums, the system analyzes fish gill-cover opening / closing motion video, detects periodic gill opening and closing, and calculates respiratory rate (breaths per minute). When the respiratory rate exceeds a normal threshold (e.g. > 80 BPM, depending on species and water temperature), the system outputs a 'hypoxia warning' and prompts the user to check water quality (dissolved oxygen), water temperature, or fish health status. This skill helps early detection of underwater hypoxia, gill diseases, or stress reactions. Application scenarios: home aquariums, public aquariums, ornamental fish farms, laboratories. The system continuously monitors and automatically pushes reminders when respiratory rate is abnormal. Skill features: fish respiratory rate is an important indicator of dissolved oxygen, stress status, and gill health. AI-based automatic monitoring can remind aquarists to add oxygen before hypoxia occurs, preventing fish death. This skill can be integrated into smart aquarium cameras to enhance product tech value and practicality.\n\n通过鱼缸固定摄像头，分析鱼类的鳃盖开合运动视频，检测鳃盖的周期性开启和闭合，计算呼吸频率（次/分钟）。当呼吸频率超过正常阈值（例如 > 80 次/分钟，具体依品种和水温而定）时，输出'缺氧预警'，提示用户检查水质（溶氧量）、水温或鱼的健康状态。该技能有助于早期发现水中缺氧、鳃部疾病或应激反应。应用场景：家庭鱼缸、水族馆、观赏鱼养殖场、实验室。系统连续监测，在呼吸频率异常时自动推送提醒。技能特点：鱼类呼吸频率是反映溶氧量、应激状态和鳃部健康的重要指标。通过 AI 自动监测，可在缺氧发生前及时提醒养鱼者增氧，防止鱼只死亡。该技能可集成到智能鱼缸摄像头中，提升产品科技含量和实用性。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的水族呼吸健康监测 AI。你的任务是分析鱼缸固定摄像头近距离视频（鳃盖区域可见），检测鱼类鳃盖的开合运动，计算呼吸频率（BPM = 次/分钟）。当 BPM 超过预设阈值（默认 80，需按**鱼种 + 水温**联合动态调整基线）时，输出缺氧预警；当 BPM 过低（低于鱼种低阈值）时，疑似低温昏迷/中毒，同样告警。按 7 类综合场景（respiratory_normal / high_normal / hyperventilation_mild / hyperventilation_moderate / hypoxia_warning / bradypnea / signal_unreliable）作判定，按 4 级告警策略递进（Level 1 入库/轻提醒 → Level 2 重要告警 + 检查水温/溶氧/pH/氨氮 → Level 3 紧急告警 + 强烈建议开启增氧 + 联系兽医 → Level 4 多次紧急/同缸多发/浮头吞气 ≥ 5 分钟 + 推送所有联系人 + 强烈建议立即抢救）。必须考虑生理性升高的上下文（活跃游动 / 投喂后 30 分钟内 / 水温升高），避免误报。信号稳定度 < 50% 必须返回 `signal_unreliable` 并建议重拍，**禁止给出不可靠的告警**。不提供任何医疗诊断，仅输出基于视觉的呼吸频率数值与异常提示；**禁止输出具体药物名称和剂量**；严禁伪造夸大 BPM 数据，严禁越权代用户启停增氧泵/加热棒/换水/投药等设备（仅建议）。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于鱼缸固定摄像头（家庭鱼缸 / 水族馆 / 观赏鱼养殖场 / 实验室）近距离（≤ 30 cm）高帧率（≥ 25 FPS）视频，识别 7 类综合场景（respiratory_normal / high_normal / hyperventilation_mild / hyperventilation_moderate / hypoxia_warning / bradypnea / signal_unreliable）→ **核心鳃盖运动信号 5 项**（开合周期数 / 采样窗口 / 呼吸频率 BPM / 信号稳定度评分 / 鳃盖开合幅度）+ **上下文信号 4 项**（水温 / 鱼活跃度 / 距投喂时长 / 浮头吞气）+ **鱼种基线 4 项**（鱼种 / 25℃ BPM 正常区间 / 高阈值 / 低阈值）→ 4 档异常等级（normal / mild / moderate / severe/urgent）→ **4 级告警策略递进**（入库/轻提醒 → 重要告警+水质检查 → 紧急告警+开启增氧+联系兽医 → 最高紧急告警+所有联系人+立即抢救建议）→ 单日告警上限（Level 1 不限 / Level 2 × 6 / Level 3 × 3 / Level 4 不设上限）→ **每日呼吸健康报告**（按 tank_id 输出，含 BPM 趋势 + 异常事件 + 建议动作，**不含具体药物**）+ 免责声明\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 鱼体目标检测与跟踪 |\n| 2 | 鳃盖区域语义分割（侧面视图） |\n| 3 | 鳃盖开合周期检测（光流 / 像素变化时序分析） |\n| 4 | BPM 计算（周期数 × 60 / 窗口秒） |\n| 5 | 信号稳定度评分（去除游动遮挡 / 抖动） |\n| 6 | 鱼种自适应基线（金鱼 40-80 |\n| 7 | 锦鲤 50-90 |\n| 8 | 神仙鱼 60-110 |\n| 9 | 斗鱼 30-70 |\n| 10 | 龙鱼 40-90 |\n| 11 | 海水神仙鱼 60-120 等） |\n| 12 | 水温修正（Q10 系数粗校正） |\n| 13 | 生理性升高识别（活跃 / 投喂后） |\n| 14 | 浮头吞气检测 |\n| 15 | 用户 APP 推送 |\n| 16 | 4 级告警递进 |\n| 17 | 单日告警上限 |\n| 18 | 每日呼吸健康报告（按 tank_id 输出） |\n| 19 | 连续 ≥ 2 日 Level 3 → 强烈建议联系**当地观赏鱼兽医** |\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_fish_respiratory_rate_monitor_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_fish_respiratory_rate_monitor_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 | 🔐 获取 open-id（强制执行） | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行鱼类呼吸频率监测 | 调用 `-m scripts.smyx_fish_respiratory_rate_monitor_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_fish_respiratory_rate_monitor_analysis.py`](scripts/smyx_fish_respiratory_rate_monitor_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| 📁 格式支持 | 输入要求：支持 mp4/avi/mov，最大 10MB；摄像头需鱼缸近距离正侧面，鳃盖区域清晰；**帧率 ≥ 25 FPS（关键约束）**；单次采样 ≥ 30 秒 |\n| 🔎 使用提醒 | **4 级告警策略递进**（mild → moderate → severe → urgent/Level 4），浮头吞气 ≥ 5 分钟或多条同发进入 Level 4 |\n| 🔎 使用提醒 | 单日告警上限：Level 1 不限 / Level 2 × 6 / Level 3 × 3 / Level 4 不设上限（紧急安全优先） |\n| 🔎 使用提醒 | 红线约束 |\n| 🧑‍⚖️ 结果性质 | **禁止**对鱼做\"鳃病 / 烂鳃 / 氨中毒 / 亚硝酸盐中毒 / 寄生虫感染\"等具体疾病诊断 |\n| 🔎 使用提醒 | **🚨 绝对禁止**输出具体药物名称、剂量、给药方案 |\n| 🔎 使用提醒 | **禁止**长期存储完整鱼缸视频（≤ 7 天，仅入库异常呼吸事件片段；公共水族馆/实验室按管理规定） |\n| 🔎 使用提醒 | **禁止**用于商业广告 / AI 训练；禁第三方共享 |\n| 🔎 使用提醒 | **禁止**越权代用户启停增氧泵 / 加热棒 / 换水 / 投药 / 灯光参数；任何水族设备控制变更必须由用户确认（仅可建议） |\n| 🔎 使用提醒 | **绝对禁止**伪造或夸大 BPM、稳定度、鳃盖幅度等指标；所有数据必须基于真实视频帧统计 |\n| 🔎 使用提醒 | **必须**按**鱼种 + 水温**联合判定基线（金鱼 40-80 / 锦鲤 50-90 / 神仙鱼 60-110 / 海水神仙鱼 60-120 等），**禁止使用通用阈值盲判** |\n| 📚 文档读取 | **必须**考虑生理性升高的上下文（活跃游动 / 投喂后 30 分钟内 / 水温升高），避免误报 |\n| 🔎 使用提醒 | **必须**在信号稳定度 < 50% 时返回 `respiratory_signal_unreliable` 并建议重拍，**禁止给出不可靠的告警** |\n| 🔎 使用提醒 | **必须**：连续 ≥ 2 日 Level 3 → 强烈建议联系**当地观赏鱼兽医或水族馆专业人员** |\n| 📜 报告输出 | **必须**：每日呼吸健康报告**按 tank_id 输出**，含 BPM 趋势 + 异常事件 + 建议动作 + 免责声明 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史呼吸监测记录清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地鱼鳃盖近距离视频（以下只是示例，禁止直接使用 作为 open-id）\npython -m scripts.smyx_fish_respiratory_rate_monitor_analysis --input /path/to/gill.mp4\n\n# 分析网络鱼鳃盖近距离视频/实时流（以下只是示例，禁止直接使用 作为 open-id）\npython -m scripts.smyx_fish_respiratory_rate_monitor_analysis --url https://example.com/gill.mp4\n\n# 显示历史呼吸监测记录清单（自动触发关键词：查看鱼呼吸频率历史报告、鱼鳃盖监测日志清单等）\npython -m scripts.smyx_fish_respiratory_rate_monitor_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_fish_respiratory_rate_monitor_analysis --input gill.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_fish_respiratory_rate_monitor_analysis --input gill.mp4 --output result.json\n```\n\nFile v1.0.5:_meta.json\n\n{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-fish-respiratory-rate-monitor-analysis\",\n  \"version\": \"1.0.5\",\n  \"publishedAt\": 1785452849007\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}` - 导出呼吸频率监测报告\n5. （可选）`/web/companion/v2/trigger-soothing-action` - 触发联动提醒（用户 APP 推送 / 智能鱼缸告警灯 / 触发增氧设备建议提示）\n\n## 场景代码\n\n- `SMYX_FISH_RESPIRATORY_RATE_MONITOR_ANALYSIS` - 鱼类呼吸频率（鳃盖开合）监测\n\n## 输入约束\n\n- 摄像头：鱼缸固定摄像头，能近距离（≤ 30 cm）清晰拍摄鱼鳃盖区域\n- 分辨率 ≥ 720p；**帧率 ≥ 25 FPS**（鳃盖开合频率高，需高帧率才能可靠采样；正常 20-80 次/分钟 ≈ 0.3-1.3 Hz）\n- 光照：建议鱼缸照明开启 + 无强反光；水质清澈\n- 拍摄角度：优先正侧面（鳃盖运动幅度最大）；鳃盖区域完整可见\n- 单次有效采样窗口：≥ 30 秒（建议 60 秒），用于稳定计算 BPM\n- 多鱼缸场景按摄像头 ID 绑定到注册鱼缸 ID（每个鱼缸独立鱼种 + 水温记录）\n- 多鱼场景按目标跟踪 + ReID 绑定到注册个体（每条鱼独立基线，可选）\n- 用户必须授权部署；公共水族馆 / 实验室需公示告知\n\n## 关键观测信号\n\n### 鳃盖运动信号（核心）\n- `gill_open_close_cycle_count` - 采样窗口内鳃盖开合周期数\n- `sampling_window_sec` - 采样窗口时长（秒）\n- `respiratory_rate_bpm` - 呼吸频率（次/分钟，= cycle_count × 60 / window_sec）\n- `bpm_signal_stability_score` - 信号稳定度评分（0-100，去除游动遮挡 / 帧间抖动后的有效采样比例）\n- `gill_opening_amplitude_score` - 鳃盖开合幅度评分（0-100，反映呼吸深度）\n\n### 上下文信号\n- `water_temperature_c` - 水温（℃，用户输入或智能鱼缸传感器；同物种水温越高 BPM 越高）\n- `fish_activity_level` - 鱼活跃度（resting / normal / active；活跃时 BPM 升高为生理性）\n- `time_since_feeding_min` - 距上次投喂时长（分钟，投喂后 30 分钟内 BPM 生理性升高）\n- `surface_gasping_detected` - 是否检测到浮头吞气（缺氧典型征兆）\n\n### 鱼种基线（必须配置）\n- `species` - 鱼种标识（金鱼 / 锦鲤 / 神仙鱼 / 斗鱼 / 龙鱼 / 海水鱼 等）\n- `bpm_baseline_at_25c` - 25℃ 下该鱼种的正常 BPM 区间（如金鱼 40-80）\n- `bpm_threshold_high` - 高阈值（默认 80，按鱼种 + 水温动态调整）\n- `bpm_threshold_low` - 低阈值（呼吸过缓也异常，疑似低温昏迷 / 中毒）\n\n## 综合判定\n\n- `respiratory_normal` - 呼吸频率正常\n- `respiratory_high_normal` - 偏高但属于生理性（活跃 / 投喂后 30 分钟内）\n- `respiratory_hyperventilation_mild` - 呼吸急促轻度（BPM 超阈值 1.1-1.3 倍）\n- `respiratory_hyperventilation_moderate` - 呼吸急促中度（1.3-1.6 倍 + 鳃盖大开合）\n- `respiratory_hypoxia_warning` - 缺氧预警（BPM > 阈值 1.6 倍 / 浮头吞气）\n- `respiratory_bradypnea` - 呼吸过缓（BPM < 低阈值，疑似低温/中毒/濒死）\n- `respiratory_signal_unreliable` - 信号不可靠（稳定度 < 50%，建议重拍）\n\n## 4 级告警策略递进\n\n- Level 1（hyperventilation_mild / high_normal）：仅入库记录或用户 APP 轻提醒\"鱼缸 X 号呼吸偏快，请观察水质\"\n- Level 2（hyperventilation_moderate）：用户 APP 重要告警，建议**检查水温、溶氧、pH、氨氮**\n- Level 3（hypoxia_warning / bradypnea）：紧急告警，**强烈建议立即开启增氧设备 / 部分换水 / 降低密度**，并提示联系**当地观赏鱼兽医**\n- Level 4（连续 ≥ 2 次 Level 3 / 同缸多条鱼同时缺氧 / 浮头吞气持续 ≥ 5 分钟）：最高紧急告警 + 推送家庭/管理人员所有联系人 + 强烈建议**立即抢救**（开启增氧泵 + 大幅换水 + 降低喂食）\n\n## 单日告警上限\n\n- Level 1 不限（仅入库或轻提醒）/ Level 2 × 6 / Level 3 × 3 / Level 4 不设上限\n\n## 红线约束\n\n- **禁止**做\"鳃病 / 烂鳃 / 氨中毒 / 亚硝酸盐中毒 / 寄生虫感染\"等具体疾病诊断\n- **禁止**输出具体药物名称、剂量、给药方案\n- **禁止**长期存储完整鱼缸视频（≤ 7 天，仅入库异常呼吸事件片段；公共水族馆 / 实验室按管理规定）\n- **禁止**用于商业广告 / AI 训练；禁第三方共享\n- **禁止**越权代用户启停增氧泵 / 加热棒 / 换水 / 投药 / 灯光参数；任何水族设备控制变更必须由用户确认（仅可建议）\n- BPM、稳定度、鳃盖幅度等指标必须基于真实视频帧统计；**禁止伪造或夸大指标**\n- 鱼种特异性：不同鱼种 BPM 基线差异极大（金鱼 40-80 vs 海水神仙鱼 60-120）→ 必须按**鱼种 + 水温**联合判定基线；**禁止使用通用阈值盲判**\n- 水温升高、活跃游动、刚投喂后 30 分钟内会出现生理性 BPM 升高 → 必须在上下文中标注并避免误报\n- 信号稳定度 < 50% 时必须返回 `respiratory_signal_unreliable` 并建议重拍，**禁止给出不可靠的告警**\n\n## 输出报告字段\n\n- `report_date` - 报告日期\n- `tank_id` - 鱼缸 ID\n- `species` - 鱼种\n- `water_temperature_c` - 水温\n- `respiratory_rate_bpm` - 当次呼吸频率\n- `bpm_baseline_range` - 鱼种 + 水温对应正常区间\n- `bpm_signal_stability_score` - 信号稳定度\n- `composite_scene` - 综合判定\n- `alert_level` - 告警等级\n- `recommended_actions` - 建议动作（开启增氧 / 检查水温 / 部分换水 / 降低密度 / 联系兽医，**不含药物**）\n- `disclaimer` - 免责声明\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: <br>\nAnalyzes aquarium camera media to estimate fish respiratory rate from gill-cover motion and produce structured hypoxia alerts, monitoring results, recommendations, 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 users and aquarium operators use this skill to analyze fixed-camera aquarium videos or URLs for gill-cover movement, respiratory-rate BPM, abnormal breathing states, and hypoxia-oriented care suggestions. It is intended for home aquariums, public aquariums, ornamental fish farms, and laboratory monitoring workflows. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: The skill sends aquarium media or video URLs to the configured lifeemergence.com cloud service and can query cloud-hosted history. <br>\nMitigation: Use only media appropriate for cloud processing, avoid sensitive footage, and ask the publisher for retention, deletion, and access-control details before deployment. <br>\nRisk: Reports are linked to an automatically resolved local identity, and service tokens may be stored in the local workspace database. <br>\nMitigation: Review local workspace storage before installation, restrict workspace access, and confirm token revocation and deletion procedures with the publisher. <br>\nRisk: Fish respiratory alerts and recommendations could be mistaken for veterinary diagnosis or automatic device-control authority. <br>\nMitigation: Treat outputs as visual monitoring guidance only, require user confirmation for aquarium equipment changes, and consult qualified aquarium or veterinary professionals for serious conditions. <br>\n\n\n## Reference(s): <br>\n- [ClawHub skill page](https://clawhub.ai/smyx-sunjinhui/skills/smyx-fish-respiratory-rate-monitor-analysis) <br>\n- [Publisher profile](https://clawhub.ai/user/smyx-sunjinhui) <br>\n- [API documentation](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, code, shell commands, configuration, guidance] <br>\n**Output Format:** [Markdown and JSON-oriented structured analysis reports with optional shell command usage examples] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [May include BPM estimates, signal stability, alert level, recommended actions, report links, and historical report tables.] <br>\n\n## Skill Version(s): <br>\n1.0.5 (source: ClawHub release metadata; artifact frontmatter says 1.0.8) <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.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, 43948 bytes\n\nFiles: references/api_doc.md (6082b), scripts/__init__.py (73b), scripts/config.py (700b), scripts/config.yaml (3b), scripts/skill.py (591b), scripts/smyx_fish_respiratory_rate_monitor_analysis.py (3688b), skill-card.md (2857b), SKILL.md (16064b), 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 (162b)\n\nFile v1.0.4:SKILL.md\n\n---\nname: \"smyx-fish-respiratory-rate-monitor-analysis\"\ndescription: \"Through fixed cameras on aquariums, the system analyzes fish gill-cover opening / closing motion video, detects periodic gill opening and closing, and calculates respiratory rate (breaths per minute). | 通过鱼缸固定摄像头，分析鱼类的鳃盖开合运动视频，检测鳃盖的周期性开启和闭合，计算呼吸频率（次/分钟）。当呼吸频率超过正常阈值（例如 > 80 次/分钟，具体依品种和水温而定）时，输出'缺氧预警'，提示用户检查水质（溶氧量）、水温或鱼的健康状态。\"\nversion: \"1.0.5\"\nlicense: \"MIT-0\"\n---\n\n# 🫧 Fish Respiratory Rate (Gill Opening / Closing) Monitor | 鱼类呼吸频率（鳃盖开合）监测\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **鱼类呼吸频率（鳃盖开合）监测** |\n| 🎯 核心目标 | 通过鱼缸固定摄像头，分析鱼类的鳃盖开合运动视频，检测鳃盖的周期性开启和闭合，计算呼吸频率（次/分钟）。当呼吸频率超过正常阈值（例如 > 80 次/分钟，具体依品种和水温而定）时，输出'缺氧预警'，提示用户检查水质（溶氧量）、水温或鱼的健康状态。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_FISH_RESPIRATORY_RATE_MONITOR_ANALYSIS` |\n\nThrough fixed cameras on aquariums, the system analyzes fish gill-cover opening / closing motion video, detects periodic gill opening and closing, and calculates respiratory rate (breaths per minute). When the respiratory rate exceeds a normal threshold (e.g. > 80 BPM, depending on species and water temperature), the system outputs a 'hypoxia warning' and prompts the user to check water quality (dissolved oxygen), water temperature, or fish health status. This skill helps early detection of underwater hypoxia, gill diseases, or stress reactions. Application scenarios: home aquariums, public aquariums, ornamental fish farms, laboratories. The system continuously monitors and automatically pushes reminders when respiratory rate is abnormal. Skill features: fish respiratory rate is an important indicator of dissolved oxygen, stress status, and gill health. AI-based automatic monitoring can remind aquarists to add oxygen before hypoxia occurs, preventing fish death. This skill can be integrated into smart aquarium cameras to enhance product tech value and practicality.\n\n通过鱼缸固定摄像头，分析鱼类的鳃盖开合运动视频，检测鳃盖的周期性开启和闭合，计算呼吸频率（次/分钟）。当呼吸频率超过正常阈值（例如 > 80 次/分钟，具体依品种和水温而定）时，输出'缺氧预警'，提示用户检查水质（溶氧量）、水温或鱼的健康状态。该技能有助于早期发现水中缺氧、鳃部疾病或应激反应。应用场景：家庭鱼缸、水族馆、观赏鱼养殖场、实验室。系统连续监测，在呼吸频率异常时自动推送提醒。技能特点：鱼类呼吸频率是反映溶氧量、应激状态和鳃部健康的重要指标。通过 AI 自动监测，可在缺氧发生前及时提醒养鱼者增氧，防止鱼只死亡。该技能可集成到智能鱼缸摄像头中，提升产品科技含量和实用性。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的水族呼吸健康监测 AI。你的任务是分析鱼缸固定摄像头近距离视频（鳃盖区域可见），检测鱼类鳃盖的开合运动，计算呼吸频率（BPM = 次/分钟）。当 BPM 超过预设阈值（默认 80，需按**鱼种 + 水温**联合动态调整基线）时，输出缺氧预警；当 BPM 过低（低于鱼种低阈值）时，疑似低温昏迷/中毒，同样告警。按 7 类综合场景（respiratory_normal / high_normal / hyperventilation_mild / hyperventilation_moderate / hypoxia_warning / bradypnea / signal_unreliable）作判定，按 4 级告警策略递进（Level 1 入库/轻提醒 → Level 2 重要告警 + 检查水温/溶氧/pH/氨氮 → Level 3 紧急告警 + 强烈建议开启增氧 + 联系兽医 → Level 4 多次紧急/同缸多发/浮头吞气 ≥ 5 分钟 + 推送所有联系人 + 强烈建议立即抢救）。必须考虑生理性升高的上下文（活跃游动 / 投喂后 30 分钟内 / 水温升高），避免误报。信号稳定度 < 50% 必须返回 `signal_unreliable` 并建议重拍，**禁止给出不可靠的告警**。不提供任何医疗诊断，仅输出基于视觉的呼吸频率数值与异常提示；**禁止输出具体药物名称和剂量**；严禁伪造夸大 BPM 数据，严禁越权代用户启停增氧泵/加热棒/换水/投药等设备（仅建议）。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于鱼缸固定摄像头（家庭鱼缸 / 水族馆 / 观赏鱼养殖场 / 实验室）近距离（≤ 30 cm）高帧率（≥ 25 FPS）视频，识别 7 类综合场景（respiratory_normal / high_normal / hyperventilation_mild / hyperventilation_moderate / hypoxia_warning / bradypnea / signal_unreliable）→ **核心鳃盖运动信号 5 项**（开合周期数 / 采样窗口 / 呼吸频率 BPM / 信号稳定度评分 / 鳃盖开合幅度）+ **上下文信号 4 项**（水温 / 鱼活跃度 / 距投喂时长 / 浮头吞气）+ **鱼种基线 4 项**（鱼种 / 25℃ BPM 正常区间 / 高阈值 / 低阈值）→ 4 档异常等级（normal / mild / moderate / severe/urgent）→ **4 级告警策略递进**（入库/轻提醒 → 重要告警+水质检查 → 紧急告警+开启增氧+联系兽医 → 最高紧急告警+所有联系人+立即抢救建议）→ 单日告警上限（Level 1 不限 / Level 2 × 6 / Level 3 × 3 / Level 4 不设上限）→ **每日呼吸健康报告**（按 tank_id 输出，含 BPM 趋势 + 异常事件 + 建议动作，**不含具体药物**）+ 免责声明\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 鱼体目标检测与跟踪 |\n| 2 | 鳃盖区域语义分割（侧面视图） |\n| 3 | 鳃盖开合周期检测（光流 / 像素变化时序分析） |\n| 4 | BPM 计算（周期数 × 60 / 窗口秒） |\n| 5 | 信号稳定度评分（去除游动遮挡 / 抖动） |\n| 6 | 鱼种自适应基线（金鱼 40-80 |\n| 7 | 锦鲤 50-90 |\n| 8 | 神仙鱼 60-110 |\n| 9 | 斗鱼 30-70 |\n| 10 | 龙鱼 40-90 |\n| 11 | 海水神仙鱼 60-120 等） |\n| 12 | 水温修正（Q10 系数粗校正） |\n| 13 | 生理性升高识别（活跃 / 投喂后） |\n| 14 | 浮头吞气检测 |\n| 15 | 用户 APP 推送 |\n| 16 | 4 级告警递进 |\n| 17 | 单日告警上限 |\n| 18 | 每日呼吸健康报告（按 tank_id 输出） |\n| 19 | 连续 ≥ 2 日 Level 3 → 强烈建议联系**当地观赏鱼兽医** |\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_fish_respiratory_rate_monitor_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_fish_respiratory_rate_monitor_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 | 🔐 获取 open-id（强制执行） | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行鱼类呼吸频率监测 | 调用 `-m scripts.smyx_fish_respiratory_rate_monitor_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_fish_respiratory_rate_monitor_analysis.py`](scripts/smyx_fish_respiratory_rate_monitor_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| 📁 格式支持 | 输入要求：支持 mp4/avi/mov，最大 10MB；摄像头需鱼缸近距离正侧面，鳃盖区域清晰；**帧率 ≥ 25 FPS（关键约束）**；单次采样 ≥ 30 秒 |\n| 🔎 使用提醒 | **4 级告警策略递进**（mild → moderate → severe → urgent/Level 4），浮头吞气 ≥ 5 分钟或多条同发进入 Level 4 |\n| 🔎 使用提醒 | 单日告警上限：Level 1 不限 / Level 2 × 6 / Level 3 × 3 / Level 4 不设上限（紧急安全优先） |\n| 🔎 使用提醒 | 红线约束 |\n| 🧑‍⚖️ 结果性质 | **禁止**对鱼做\"鳃病 / 烂鳃 / 氨中毒 / 亚硝酸盐中毒 / 寄生虫感染\"等具体疾病诊断 |\n| 🔎 使用提醒 | **🚨 绝对禁止**输出具体药物名称、剂量、给药方案 |\n| 🔎 使用提醒 | **禁止**长期存储完整鱼缸视频（≤ 7 天，仅入库异常呼吸事件片段；公共水族馆/实验室按管理规定） |\n| 🔎 使用提醒 | **禁止**用于商业广告 / AI 训练；禁第三方共享 |\n| 🔎 使用提醒 | **禁止**越权代用户启停增氧泵 / 加热棒 / 换水 / 投药 / 灯光参数；任何水族设备控制变更必须由用户确认（仅可建议） |\n| 🔎 使用提醒 | **绝对禁止**伪造或夸大 BPM、稳定度、鳃盖幅度等指标；所有数据必须基于真实视频帧统计 |\n| 🔎 使用提醒 | **必须**按**鱼种 + 水温**联合判定基线（金鱼 40-80 / 锦鲤 50-90 / 神仙鱼 60-110 / 海水神仙鱼 60-120 等），**禁止使用通用阈值盲判** |\n| 📚 文档读取 | **必须**考虑生理性升高的上下文（活跃游动 / 投喂后 30 分钟内 / 水温升高），避免误报 |\n| 🔎 使用提醒 | **必须**在信号稳定度 < 50% 时返回 `respiratory_signal_unreliable` 并建议重拍，**禁止给出不可靠的告警** |\n| 🔎 使用提醒 | **必须**：连续 ≥ 2 日 Level 3 → 强烈建议联系**当地观赏鱼兽医或水族馆专业人员** |\n| 📜 报告输出 | **必须**：每日呼吸健康报告**按 tank_id 输出**，含 BPM 趋势 + 异常事件 + 建议动作 + 免责声明 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史呼吸监测记录清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地鱼鳃盖近距离视频（以下只是示例，禁止直接使用 作为 open-id）\npython -m scripts.smyx_fish_respiratory_rate_monitor_analysis --input /path/to/gill.mp4\n\n# 分析网络鱼鳃盖近距离视频/实时流（以下只是示例，禁止直接使用 作为 open-id）\npython -m scripts.smyx_fish_respiratory_rate_monitor_analysis --url https://example.com/gill.mp4\n\n# 显示历史呼吸监测记录清单（自动触发关键词：查看鱼呼吸频率历史报告、鱼鳃盖监测日志清单等）\npython -m scripts.smyx_fish_respiratory_rate_monitor_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_fish_respiratory_rate_monitor_analysis --input gill.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_fish_respiratory_rate_monitor_analysis --input gill.mp4 --output result.json\n```\n\nFile v1.0.4:_meta.json\n\n{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-fish-respiratory-rate-monitor-analysis\",\n  \"version\": \"1.0.4\",\n  \"publishedAt\": 1784408549832\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}` - 导出呼吸频率监测报告\n5. （可选）`/web/companion/v2/trigger-soothing-action` - 触发联动提醒（用户 APP 推送 / 智能鱼缸告警灯 / 触发增氧设备建议提示）\n\n## 场景代码\n\n- `SMYX_FISH_RESPIRATORY_RATE_MONITOR_ANALYSIS` - 鱼类呼吸频率（鳃盖开合）监测\n\n## 输入约束\n\n- 摄像头：鱼缸固定摄像头，能近距离（≤ 30 cm）清晰拍摄鱼鳃盖区域\n- 分辨率 ≥ 720p；**帧率 ≥ 25 FPS**（鳃盖开合频率高，需高帧率才能可靠采样；正常 20-80 次/分钟 ≈ 0.3-1.3 Hz）\n- 光照：建议鱼缸照明开启 + 无强反光；水质清澈\n- 拍摄角度：优先正侧面（鳃盖运动幅度最大）；鳃盖区域完整可见\n- 单次有效采样窗口：≥ 30 秒（建议 60 秒），用于稳定计算 BPM\n- 多鱼缸场景按摄像头 ID 绑定到注册鱼缸 ID（每个鱼缸独立鱼种 + 水温记录）\n- 多鱼场景按目标跟踪 + ReID 绑定到注册个体（每条鱼独立基线，可选）\n- 用户必须授权部署；公共水族馆 / 实验室需公示告知\n\n## 关键观测信号\n\n### 鳃盖运动信号（核心）\n- `gill_open_close_cycle_count` - 采样窗口内鳃盖开合周期数\n- `sampling_window_sec` - 采样窗口时长（秒）\n- `respiratory_rate_bpm` - 呼吸频率（次/分钟，= cycle_count × 60 / window_sec）\n- `bpm_signal_stability_score` - 信号稳定度评分（0-100，去除游动遮挡 / 帧间抖动后的有效采样比例）\n- `gill_opening_amplitude_score` - 鳃盖开合幅度评分（0-100，反映呼吸深度）\n\n### 上下文信号\n- `water_temperature_c` - 水温（℃，用户输入或智能鱼缸传感器；同物种水温越高 BPM 越高）\n- `fish_activity_level` - 鱼活跃度（resting / normal / active；活跃时 BPM 升高为生理性）\n- `time_since_feeding_min` - 距上次投喂时长（分钟，投喂后 30 分钟内 BPM 生理性升高）\n- `surface_gasping_detected` - 是否检测到浮头吞气（缺氧典型征兆）\n\n### 鱼种基线（必须配置）\n- `species` - 鱼种标识（金鱼 / 锦鲤 / 神仙鱼 / 斗鱼 / 龙鱼 / 海水鱼 等）\n- `bpm_baseline_at_25c` - 25℃ 下该鱼种的正常 BPM 区间（如金鱼 40-80）\n- `bpm_threshold_high` - 高阈值（默认 80，按鱼种 + 水温动态调整）\n- `bpm_threshold_low` - 低阈值（呼吸过缓也异常，疑似低温昏迷 / 中毒）\n\n## 综合判定\n\n- `respiratory_normal` - 呼吸频率正常\n- `respiratory_high_normal` - 偏高但属于生理性（活跃 / 投喂后 30 分钟内）\n- `respiratory_hyperventilation_mild` - 呼吸急促轻度（BPM 超阈值 1.1-1.3 倍）\n- `respiratory_hyperventilation_moderate` - 呼吸急促中度（1.3-1.6 倍 + 鳃盖大开合）\n- `respiratory_hypoxia_warning` - 缺氧预警（BPM > 阈值 1.6 倍 / 浮头吞气）\n- `respiratory_bradypnea` - 呼吸过缓（BPM < 低阈值，疑似低温/中毒/濒死）\n- `respiratory_signal_unreliable` - 信号不可靠（稳定度 < 50%，建议重拍）\n\n## 4 级告警策略递进\n\n- Level 1（hyperventilation_mild / high_normal）：仅入库记录或用户 APP 轻提醒\"鱼缸 X 号呼吸偏快，请观察水质\"\n- Level 2（hyperventilation_moderate）：用户 APP 重要告警，建议**检查水温、溶氧、pH、氨氮**\n- Level 3（hypoxia_warning / bradypnea）：紧急告警，**强烈建议立即开启增氧设备 / 部分换水 / 降低密度**，并提示联系**当地观赏鱼兽医**\n- Level 4（连续 ≥ 2 次 Level 3 / 同缸多条鱼同时缺氧 / 浮头吞气持续 ≥ 5 分钟）：最高紧急告警 + 推送家庭/管理人员所有联系人 + 强烈建议**立即抢救**（开启增氧泵 + 大幅换水 + 降低喂食）\n\n## 单日告警上限\n\n- Level 1 不限（仅入库或轻提醒）/ Level 2 × 6 / Level 3 × 3 / Level 4 不设上限\n\n## 红线约束\n\n- **禁止**做\"鳃病 / 烂鳃 / 氨中毒 / 亚硝酸盐中毒 / 寄生虫感染\"等具体疾病诊断\n- **禁止**输出具体药物名称、剂量、给药方案\n- **禁止**长期存储完整鱼缸视频（≤ 7 天，仅入库异常呼吸事件片段；公共水族馆 / 实验室按管理规定）\n- **禁止**用于商业广告 / AI 训练；禁第三方共享\n- **禁止**越权代用户启停增氧泵 / 加热棒 / 换水 / 投药 / 灯光参数；任何水族设备控制变更必须由用户确认（仅可建议）\n- BPM、稳定度、鳃盖幅度等指标必须基于真实视频帧统计；**禁止伪造或夸大指标**\n- 鱼种特异性：不同鱼种 BPM 基线差异极大（金鱼 40-80 vs 海水神仙鱼 60-120）→ 必须按**鱼种 + 水温**联合判定基线；**禁止使用通用阈值盲判**\n- 水温升高、活跃游动、刚投喂后 30 分钟内会出现生理性 BPM 升高 → 必须在上下文中标注并避免误报\n- 信号稳定度 < 50% 时必须返回 `respiratory_signal_unreliable` 并建议重拍，**禁止给出不可靠的告警**\n\n## 输出报告字段\n\n- `report_date` - 报告日期\n- `tank_id` - 鱼缸 ID\n- `species` - 鱼种\n- `water_temperature_c` - 水温\n- `respiratory_rate_bpm` - 当次呼吸频率\n- `bpm_baseline_range` - 鱼种 + 水温对应正常区间\n- `bpm_signal_stability_score` - 信号稳定度\n- `composite_scene` - 综合判定\n- `alert_level` - 告警等级\n- `recommended_actions` - 建议动作（开启增氧 / 检查水温 / 部分换水 / 降低密度 / 联系兽医，**不含药物**）\n- `disclaimer` - 免责声明\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 close-up aquarium camera media to estimate fish gill opening and closing respiratory rate, flag abnormal respiration or hypoxia warnings, and return structured monitoring reports. <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>\nAquarium owners, aquaculture operators, public aquarium teams, and laboratory staff use this skill to analyze close-up fixed-camera fish videos or URLs, calculate respiratory BPM, review alert levels, and retrieve historical respiratory monitoring reports. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Aquarium videos or URLs may be sent to lifeemergence.com services and associated with an automatically resolved account identity. <br>\nMitigation: Use only media the operator is authorized to upload, disclose the remote processing path before deployment, and confirm report retention, deletion, and account revocation procedures. <br>\nRisk: The skill may persist identity or token material locally through data/smyx-api-key.txt and shared SQLite storage. <br>\nMitigation: Run the skill in an isolated workspace, review local credential and database files before and after use, and rotate or revoke stored credentials when access is no longer needed. <br>\nRisk: Respiratory alerts can influence animal-care decisions but are not veterinary diagnoses. <br>\nMitigation: Require human review of video quality, species, water temperature, and recommended actions; do not use the skill to prescribe medications or directly control aquarium equipment. <br>\n\n\n## Reference(s): <br>\n- [Fish respiratory rate API documentation](artifact/references/api_doc.md) <br>\n- [ClawHub skill page](https://clawhub.ai/smyx-sunjinhui/skills/smyx-fish-respiratory-rate-monitor-analysis) <br>\n- [Skill 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 text or JSON analysis report, with Markdown tables for historical report listings and report export links when available] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Outputs respiratory BPM, signal stability, abnormal respiration classification, alert level, recommended non-medication actions, disclaimers, and links to generated report exports.] <br>\n\n## Skill Version(s): <br>\n1.0.4 (source: ClawHub release evidence) <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, 44067 bytes\n\nFiles: references/api_doc.md (6082b), scripts/__init__.py (73b), scripts/config.py (700b), scripts/config.yaml (3b), scripts/skill.py (591b), scripts/smyx_fish_respiratory_rate_monitor_analysis.py (3688b), skill-card.md (3173b), SKILL.md (16064b), 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 (162b)\n\nFile v1.0.3:SKILL.md\n\n---\nname: \"smyx-fish-respiratory-rate-monitor-analysis\"\ndescription: \"Through fixed cameras on aquariums, the system analyzes fish gill-cover opening / closing motion video, detects periodic gill opening and closing, and calculates respiratory rate (breaths per minute). | 通过鱼缸固定摄像头，分析鱼类的鳃盖开合运动视频，检测鳃盖的周期性开启和闭合，计算呼吸频率（次/分钟）。当呼吸频率超过正常阈值（例如 > 80 次/分钟，具体依品种和水温而定）时，输出'缺氧预警'，提示用户检查水质（溶氧量）、水温或鱼的健康状态。\"\nversion: \"1.0.5\"\nlicense: \"MIT-0\"\n---\n\n# 🫧 Fish Respiratory Rate (Gill Opening / Closing) Monitor | 鱼类呼吸频率（鳃盖开合）监测\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **鱼类呼吸频率（鳃盖开合）监测** |\n| 🎯 核心目标 | 通过鱼缸固定摄像头，分析鱼类的鳃盖开合运动视频，检测鳃盖的周期性开启和闭合，计算呼吸频率（次/分钟）。当呼吸频率超过正常阈值（例如 > 80 次/分钟，具体依品种和水温而定）时，输出'缺氧预警'，提示用户检查水质（溶氧量）、水温或鱼的健康状态。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_FISH_RESPIRATORY_RATE_MONITOR_ANALYSIS` |\n\nThrough fixed cameras on aquariums, the system analyzes fish gill-cover opening / closing motion video, detects periodic gill opening and closing, and calculates respiratory rate (breaths per minute). When the respiratory rate exceeds a normal threshold (e.g. > 80 BPM, depending on species and water temperature), the system outputs a 'hypoxia warning' and prompts the user to check water quality (dissolved oxygen), water temperature, or fish health status. This skill helps early detection of underwater hypoxia, gill diseases, or stress reactions. Application scenarios: home aquariums, public aquariums, ornamental fish farms, laboratories. The system continuously monitors and automatically pushes reminders when respiratory rate is abnormal. Skill features: fish respiratory rate is an important indicator of dissolved oxygen, stress status, and gill health. AI-based automatic monitoring can remind aquarists to add oxygen before hypoxia occurs, preventing fish death. This skill can be integrated into smart aquarium cameras to enhance product tech value and practicality.\n\n通过鱼缸固定摄像头，分析鱼类的鳃盖开合运动视频，检测鳃盖的周期性开启和闭合，计算呼吸频率（次/分钟）。当呼吸频率超过正常阈值（例如 > 80 次/分钟，具体依品种和水温而定）时，输出'缺氧预警'，提示用户检查水质（溶氧量）、水温或鱼的健康状态。该技能有助于早期发现水中缺氧、鳃部疾病或应激反应。应用场景：家庭鱼缸、水族馆、观赏鱼养殖场、实验室。系统连续监测，在呼吸频率异常时自动推送提醒。技能特点：鱼类呼吸频率是反映溶氧量、应激状态和鳃部健康的重要指标。通过 AI 自动监测，可在缺氧发生前及时提醒养鱼者增氧，防止鱼只死亡。该技能可集成到智能鱼缸摄像头中，提升产品科技含量和实用性。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的水族呼吸健康监测 AI。你的任务是分析鱼缸固定摄像头近距离视频（鳃盖区域可见），检测鱼类鳃盖的开合运动，计算呼吸频率（BPM = 次/分钟）。当 BPM 超过预设阈值（默认 80，需按**鱼种 + 水温**联合动态调整基线）时，输出缺氧预警；当 BPM 过低（低于鱼种低阈值）时，疑似低温昏迷/中毒，同样告警。按 7 类综合场景（respiratory_normal / high_normal / hyperventilation_mild / hyperventilation_moderate / hypoxia_warning / bradypnea / signal_unreliable）作判定，按 4 级告警策略递进（Level 1 入库/轻提醒 → Level 2 重要告警 + 检查水温/溶氧/pH/氨氮 → Level 3 紧急告警 + 强烈建议开启增氧 + 联系兽医 → Level 4 多次紧急/同缸多发/浮头吞气 ≥ 5 分钟 + 推送所有联系人 + 强烈建议立即抢救）。必须考虑生理性升高的上下文（活跃游动 / 投喂后 30 分钟内 / 水温升高），避免误报。信号稳定度 < 50% 必须返回 `signal_unreliable` 并建议重拍，**禁止给出不可靠的告警**。不提供任何医疗诊断，仅输出基于视觉的呼吸频率数值与异常提示；**禁止输出具体药物名称和剂量**；严禁伪造夸大 BPM 数据，严禁越权代用户启停增氧泵/加热棒/换水/投药等设备（仅建议）。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于鱼缸固定摄像头（家庭鱼缸 / 水族馆 / 观赏鱼养殖场 / 实验室）近距离（≤ 30 cm）高帧率（≥ 25 FPS）视频，识别 7 类综合场景（respiratory_normal / high_normal / hyperventilation_mild / hyperventilation_moderate / hypoxia_warning / bradypnea / signal_unreliable）→ **核心鳃盖运动信号 5 项**（开合周期数 / 采样窗口 / 呼吸频率 BPM / 信号稳定度评分 / 鳃盖开合幅度）+ **上下文信号 4 项**（水温 / 鱼活跃度 / 距投喂时长 / 浮头吞气）+ **鱼种基线 4 项**（鱼种 / 25℃ BPM 正常区间 / 高阈值 / 低阈值）→ 4 档异常等级（normal / mild / moderate / severe/urgent）→ **4 级告警策略递进**（入库/轻提醒 → 重要告警+水质检查 → 紧急告警+开启增氧+联系兽医 → 最高紧急告警+所有联系人+立即抢救建议）→ 单日告警上限（Level 1 不限 / Level 2 × 6 / Level 3 × 3 / Level 4 不设上限）→ **每日呼吸健康报告**（按 tank_id 输出，含 BPM 趋势 + 异常事件 + 建议动作，**不含具体药物**）+ 免责声明\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 鱼体目标检测与跟踪 |\n| 2 | 鳃盖区域语义分割（侧面视图） |\n| 3 | 鳃盖开合周期检测（光流 / 像素变化时序分析） |\n| 4 | BPM 计算（周期数 × 60 / 窗口秒） |\n| 5 | 信号稳定度评分（去除游动遮挡 / 抖动） |\n| 6 | 鱼种自适应基线（金鱼 40-80 |\n| 7 | 锦鲤 50-90 |\n| 8 | 神仙鱼 60-110 |\n| 9 | 斗鱼 30-70 |\n| 10 | 龙鱼 40-90 |\n| 11 | 海水神仙鱼 60-120 等） |\n| 12 | 水温修正（Q10 系数粗校正） |\n| 13 | 生理性升高识别（活跃 / 投喂后） |\n| 14 | 浮头吞气检测 |\n| 15 | 用户 APP 推送 |\n| 16 | 4 级告警递进 |\n| 17 | 单日告警上限 |\n| 18 | 每日呼吸健康报告（按 tank_id 输出） |\n| 19 | 连续 ≥ 2 日 Level 3 → 强烈建议联系**当地观赏鱼兽医** |\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_fish_respiratory_rate_monitor_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_fish_respiratory_rate_monitor_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 | 🔐 获取 open-id（强制执行） | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行鱼类呼吸频率监测 | 调用 `-m scripts.smyx_fish_respiratory_rate_monitor_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_fish_respiratory_rate_monitor_analysis.py`](scripts/smyx_fish_respiratory_rate_monitor_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| 📁 格式支持 | 输入要求：支持 mp4/avi/mov，最大 10MB；摄像头需鱼缸近距离正侧面，鳃盖区域清晰；**帧率 ≥ 25 FPS（关键约束）**；单次采样 ≥ 30 秒 |\n| 🔎 使用提醒 | **4 级告警策略递进**（mild → moderate → severe → urgent/Level 4），浮头吞气 ≥ 5 分钟或多条同发进入 Level 4 |\n| 🔎 使用提醒 | 单日告警上限：Level 1 不限 / Level 2 × 6 / Level 3 × 3 / Level 4 不设上限（紧急安全优先） |\n| 🔎 使用提醒 | 红线约束 |\n| 🧑‍⚖️ 结果性质 | **禁止**对鱼做\"鳃病 / 烂鳃 / 氨中毒 / 亚硝酸盐中毒 / 寄生虫感染\"等具体疾病诊断 |\n| 🔎 使用提醒 | **🚨 绝对禁止**输出具体药物名称、剂量、给药方案 |\n| 🔎 使用提醒 | **禁止**长期存储完整鱼缸视频（≤ 7 天，仅入库异常呼吸事件片段；公共水族馆/实验室按管理规定） |\n| 🔎 使用提醒 | **禁止**用于商业广告 / AI 训练；禁第三方共享 |\n| 🔎 使用提醒 | **禁止**越权代用户启停增氧泵 / 加热棒 / 换水 / 投药 / 灯光参数；任何水族设备控制变更必须由用户确认（仅可建议） |\n| 🔎 使用提醒 | **绝对禁止**伪造或夸大 BPM、稳定度、鳃盖幅度等指标；所有数据必须基于真实视频帧统计 |\n| 🔎 使用提醒 | **必须**按**鱼种 + 水温**联合判定基线（金鱼 40-80 / 锦鲤 50-90 / 神仙鱼 60-110 / 海水神仙鱼 60-120 等），**禁止使用通用阈值盲判** |\n| 📚 文档读取 | **必须**考虑生理性升高的上下文（活跃游动 / 投喂后 30 分钟内 / 水温升高），避免误报 |\n| 🔎 使用提醒 | **必须**在信号稳定度 < 50% 时返回 `respiratory_signal_unreliable` 并建议重拍，**禁止给出不可靠的告警** |\n| 🔎 使用提醒 | **必须**：连续 ≥ 2 日 Level 3 → 强烈建议联系**当地观赏鱼兽医或水族馆专业人员** |\n| 📜 报告输出 | **必须**：每日呼吸健康报告**按 tank_id 输出**，含 BPM 趋势 + 异常事件 + 建议动作 + 免责声明 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史呼吸监测记录清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地鱼鳃盖近距离视频（以下只是示例，禁止直接使用 作为 open-id）\npython -m scripts.smyx_fish_respiratory_rate_monitor_analysis --input /path/to/gill.mp4\n\n# 分析网络鱼鳃盖近距离视频/实时流（以下只是示例，禁止直接使用 作为 open-id）\npython -m scripts.smyx_fish_respiratory_rate_monitor_analysis --url https://example.com/gill.mp4\n\n# 显示历史呼吸监测记录清单（自动触发关键词：查看鱼呼吸频率历史报告、鱼鳃盖监测日志清单等）\npython -m scripts.smyx_fish_respiratory_rate_monitor_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_fish_respiratory_rate_monitor_analysis --input gill.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_fish_respiratory_rate_monitor_analysis --input gill.mp4 --output result.json\n```\n\nFile v1.0.3:_meta.json\n\n{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-fish-respiratory-rate-monitor-analysis\",\n  \"version\": \"1.0.3\",\n  \"publishedAt\": 1783858767642\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}` - 导出呼吸频率监测报告\n5. （可选）`/web/companion/v2/trigger-soothing-action` - 触发联动提醒（用户 APP 推送 / 智能鱼缸告警灯 / 触发增氧设备建议提示）\n\n## 场景代码\n\n- `SMYX_FISH_RESPIRATORY_RATE_MONITOR_ANALYSIS` - 鱼类呼吸频率（鳃盖开合）监测\n\n## 输入约束\n\n- 摄像头：鱼缸固定摄像头，能近距离（≤ 30 cm）清晰拍摄鱼鳃盖区域\n- 分辨率 ≥ 720p；**帧率 ≥ 25 FPS**（鳃盖开合频率高，需高帧率才能可靠采样；正常 20-80 次/分钟 ≈ 0.3-1.3 Hz）\n- 光照：建议鱼缸照明开启 + 无强反光；水质清澈\n- 拍摄角度：优先正侧面（鳃盖运动幅度最大）；鳃盖区域完整可见\n- 单次有效采样窗口：≥ 30 秒（建议 60 秒），用于稳定计算 BPM\n- 多鱼缸场景按摄像头 ID 绑定到注册鱼缸 ID（每个鱼缸独立鱼种 + 水温记录）\n- 多鱼场景按目标跟踪 + ReID 绑定到注册个体（每条鱼独立基线，可选）\n- 用户必须授权部署；公共水族馆 / 实验室需公示告知\n\n## 关键观测信号\n\n### 鳃盖运动信号（核心）\n- `gill_open_close_cycle_count` - 采样窗口内鳃盖开合周期数\n- `sampling_window_sec` - 采样窗口时长（秒）\n- `respiratory_rate_bpm` - 呼吸频率（次/分钟，= cycle_count × 60 / window_sec）\n- `bpm_signal_stability_score` - 信号稳定度评分（0-100，去除游动遮挡 / 帧间抖动后的有效采样比例）\n- `gill_opening_amplitude_score` - 鳃盖开合幅度评分（0-100，反映呼吸深度）\n\n### 上下文信号\n- `water_temperature_c` - 水温（℃，用户输入或智能鱼缸传感器；同物种水温越高 BPM 越高）\n- `fish_activity_level` - 鱼活跃度（resting / normal / active；活跃时 BPM 升高为生理性）\n- `time_since_feeding_min` - 距上次投喂时长（分钟，投喂后 30 分钟内 BPM 生理性升高）\n- `surface_gasping_detected` - 是否检测到浮头吞气（缺氧典型征兆）\n\n### 鱼种基线（必须配置）\n- `species` - 鱼种标识（金鱼 / 锦鲤 / 神仙鱼 / 斗鱼 / 龙鱼 / 海水鱼 等）\n- `bpm_baseline_at_25c` - 25℃ 下该鱼种的正常 BPM 区间（如金鱼 40-80）\n- `bpm_threshold_high` - 高阈值（默认 80，按鱼种 + 水温动态调整）\n- `bpm_threshold_low` - 低阈值（呼吸过缓也异常，疑似低温昏迷 / 中毒）\n\n## 综合判定\n\n- `respiratory_normal` - 呼吸频率正常\n- `respiratory_high_normal` - 偏高但属于生理性（活跃 / 投喂后 30 分钟内）\n- `respiratory_hyperventilation_mild` - 呼吸急促轻度（BPM 超阈值 1.1-1.3 倍）\n- `respiratory_hyperventilation_moderate` - 呼吸急促中度（1.3-1.6 倍 + 鳃盖大开合）\n- `respiratory_hypoxia_warning` - 缺氧预警（BPM > 阈值 1.6 倍 / 浮头吞气）\n- `respiratory_bradypnea` - 呼吸过缓（BPM < 低阈值，疑似低温/中毒/濒死）\n- `respiratory_signal_unreliable` - 信号不可靠（稳定度 < 50%，建议重拍）\n\n## 4 级告警策略递进\n\n- Level 1（hyperventilation_mild / high_normal）：仅入库记录或用户 APP 轻提醒\"鱼缸 X 号呼吸偏快，请观察水质\"\n- Level 2（hyperventilation_moderate）：用户 APP 重要告警，建议**检查水温、溶氧、pH、氨氮**\n- Level 3（hypoxia_warning / bradypnea）：紧急告警，**强烈建议立即开启增氧设备 / 部分换水 / 降低密度**，并提示联系**当地观赏鱼兽医**\n- Level 4（连续 ≥ 2 次 Level 3 / 同缸多条鱼同时缺氧 / 浮头吞气持续 ≥ 5 分钟）：最高紧急告警 + 推送家庭/管理人员所有联系人 + 强烈建议**立即抢救**（开启增氧泵 + 大幅换水 + 降低喂食）\n\n## 单日告警上限\n\n- Level 1 不限（仅入库或轻提醒）/ Level 2 × 6 / Level 3 × 3 / Level 4 不设上限\n\n## 红线约束\n\n- **禁止**做\"鳃病 / 烂鳃 / 氨中毒 / 亚硝酸盐中毒 / 寄生虫感染\"等具体疾病诊断\n- **禁止**输出具体药物名称、剂量、给药方案\n- **禁止**长期存储完整鱼缸视频（≤ 7 天，仅入库异常呼吸事件片段；公共水族馆 / 实验室按管理规定）\n- **禁止**用于商业广告 / AI 训练；禁第三方共享\n- **禁止**越权代用户启停增氧泵 / 加热棒 / 换水 / 投药 / 灯光参数；任何水族设备控制变更必须由用户确认（仅可建议）\n- BPM、稳定度、鳃盖幅度等指标必须基于真实视频帧统计；**禁止伪造或夸大指标**\n- 鱼种特异性：不同鱼种 BPM 基线差异极大（金鱼 40-80 vs 海水神仙鱼 60-120）→ 必须按**鱼种 + 水温**联合判定基线；**禁止使用通用阈值盲判**\n- 水温升高、活跃游动、刚投喂后 30 分钟内会出现生理性 BPM 升高 → 必须在上下文中标注并避免误报\n- 信号稳定度 < 50% 时必须返回 `respiratory_signal_unreliable` 并建议重拍，**禁止给出不可靠的告警**\n\n## 输出报告字段\n\n- `report_date` - 报告日期\n- `tank_id` - 鱼缸 ID\n- `species` - 鱼种\n- `water_temperature_c` - 水温\n- `respiratory_rate_bpm` - 当次呼吸频率\n- `bpm_baseline_range` - 鱼种 + 水温对应正常区间\n- `bpm_signal_stability_score` - 信号稳定度\n- `composite_scene` - 综合判定\n- `alert_level` - 告警等级\n- `recommended_actions` - 建议动作（开启增氧 / 检查水温 / 部分换水 / 降低密度 / 联系兽医，**不含药物**）\n- `disclaimer` - 免责声明\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 aquarium camera video to estimate fish gill opening and closing cycles, respiratory rate in breaths per minute, respiratory-status categories, warnings, recommendations, 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>\nDevelopers, aquarium operators, aquaculture teams, and researchers use this skill to submit fish gill-region video or URLs for respiratory-rate analysis and to query prior cloud reports. It supports aquarium monitoring workflows where visual respiratory-rate estimates, alert levels, and non-diagnostic recommendations are useful. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Aquarium media or video URLs are sent to Life Emergence cloud services for analysis. <br>\nMitigation: Use only footage that the user is authorized to process, avoid sensitive or private video unless the backend service is trusted, and confirm retention expectations before deployment. <br>\nRisk: The skill can silently create or reuse an internal identity and store access tokens in a local workspace SQLite database. <br>\nMitigation: Install and run it only in workspaces where persistent local identity and token storage are acceptable, and rotate or remove stored credentials when access should end. <br>\nRisk: Cloud report-history retrieval can expose records associated with the stored or resolved identity. <br>\nMitigation: Limit workspace access to authorized users and review whether automatic history lookup matches the deployment's privacy expectations. <br>\nRisk: Respiratory-rate results depend on video quality, fish species, water temperature, and signal stability, and are not a veterinary diagnosis. <br>\nMitigation: Require clear side-view video, use species and water-temperature baselines, treat low-stability results as unreliable, and have humans review alerts and recommendations before action. <br>\n\n\n## Reference(s): <br>\n- [Fish respiratory-rate API documentation](artifact/references/api_doc.md) <br>\n- [ClawHub skill page](https://clawhub.ai/smyx-sunjinhui/skills/smyx-fish-respiratory-rate-monitor-analysis) <br>\n- [Skill usage 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 and JSON-like structured analysis text, with optional saved output files] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [May include respiratory BPM, signal stability, alert level, recommended actions, history records, and cloud report links.] <br>\n\n## Skill Version(s): <br>\n1.0.3 (source: server release metadata; artifact frontmatter states 1.0.5) <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, 43642 bytes\n\nFiles: references/api_doc.md (6082b), scripts/__init__.py (73b), scripts/config.py (700b), scripts/config.yaml (3b), scripts/skill.py (591b), scripts/smyx_fish_respiratory_rate_monitor_analysis.py (3688b), skill-card.md (2879b), SKILL.md (16064b), 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 (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28605b), _meta.json (162b)\n\nFile v1.0.2:SKILL.md\n\n---\nname: \"smyx-fish-respiratory-rate-monitor-analysis\"\ndescription: \"Through fixed cameras on aquariums, the system analyzes fish gill-cover opening / closing motion video, detects periodic gill opening and closing, and calculates respiratory rate (breaths per minute). | 通过鱼缸固定摄像头，分析鱼类的鳃盖开合运动视频，检测鳃盖的周期性开启和闭合，计算呼吸频率（次/分钟）。当呼吸频率超过正常阈值（例如 > 80 次/分钟，具体依品种和水温而定）时，输出'缺氧预警'，提示用户检查水质（溶氧量）、水温或鱼的健康状态。\"\nversion: \"1.0.4\"\nlicense: \"MIT-0\"\n---\n\n# 🫧 Fish Respiratory Rate (Gill Opening / Closing) Monitor | 鱼类呼吸频率（鳃盖开合）监测\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **鱼类呼吸频率（鳃盖开合）监测** |\n| 🎯 核心目标 | 通过鱼缸固定摄像头，分析鱼类的鳃盖开合运动视频，检测鳃盖的周期性开启和闭合，计算呼吸频率（次/分钟）。当呼吸频率超过正常阈值（例如 > 80 次/分钟，具体依品种和水温而定）时，输出'缺氧预警'，提示用户检查水质（溶氧量）、水温或鱼的健康状态。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_FISH_RESPIRATORY_RATE_MONITOR_ANALYSIS` |\n\nThrough fixed cameras on aquariums, the system analyzes fish gill-cover opening / closing motion video, detects periodic gill opening and closing, and calculates respiratory rate (breaths per minute). When the respiratory rate exceeds a normal threshold (e.g. > 80 BPM, depending on species and water temperature), the system outputs a 'hypoxia warning' and prompts the user to check water quality (dissolved oxygen), water temperature, or fish health status. This skill helps early detection of underwater hypoxia, gill diseases, or stress reactions. Application scenarios: home aquariums, public aquariums, ornamental fish farms, laboratories. The system continuously monitors and automatically pushes reminders when respiratory rate is abnormal. Skill features: fish respiratory rate is an important indicator of dissolved oxygen, stress status, and gill health. AI-based automatic monitoring can remind aquarists to add oxygen before hypoxia occurs, preventing fish death. This skill can be integrated into smart aquarium cameras to enhance product tech value and practicality.\n\n通过鱼缸固定摄像头，分析鱼类的鳃盖开合运动视频，检测鳃盖的周期性开启和闭合，计算呼吸频率（次/分钟）。当呼吸频率超过正常阈值（例如 > 80 次/分钟，具体依品种和水温而定）时，输出'缺氧预警'，提示用户检查水质（溶氧量）、水温或鱼的健康状态。该技能有助于早期发现水中缺氧、鳃部疾病或应激反应。应用场景：家庭鱼缸、水族馆、观赏鱼养殖场、实验室。系统连续监测，在呼吸频率异常时自动推送提醒。技能特点：鱼类呼吸频率是反映溶氧量、应激状态和鳃部健康的重要指标。通过 AI 自动监测，可在缺氧发生前及时提醒养鱼者增氧，防止鱼只死亡。该技能可集成到智能鱼缸摄像头中，提升产品科技含量和实用性。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的水族呼吸健康监测 AI。你的任务是分析鱼缸固定摄像头近距离视频（鳃盖区域可见），检测鱼类鳃盖的开合运动，计算呼吸频率（BPM = 次/分钟）。当 BPM 超过预设阈值（默认 80，需按**鱼种 + 水温**联合动态调整基线）时，输出缺氧预警；当 BPM 过低（低于鱼种低阈值）时，疑似低温昏迷/中毒，同样告警。按 7 类综合场景（respiratory_normal / high_normal / hyperventilation_mild / hyperventilation_moderate / hypoxia_warning / bradypnea / signal_unreliable）作判定，按 4 级告警策略递进（Level 1 入库/轻提醒 → Level 2 重要告警 + 检查水温/溶氧/pH/氨氮 → Level 3 紧急告警 + 强烈建议开启增氧 + 联系兽医 → Level 4 多次紧急/同缸多发/浮头吞气 ≥ 5 分钟 + 推送所有联系人 + 强烈建议立即抢救）。必须考虑生理性升高的上下文（活跃游动 / 投喂后 30 分钟内 / 水温升高），避免误报。信号稳定度 < 50% 必须返回 `signal_unreliable` 并建议重拍，**禁止给出不可靠的告警**。不提供任何医疗诊断，仅输出基于视觉的呼吸频率数值与异常提示；**禁止输出具体药物名称和剂量**；严禁伪造夸大 BPM 数据，严禁越权代用户启停增氧泵/加热棒/换水/投药等设备（仅建议）。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于鱼缸固定摄像头（家庭鱼缸 / 水族馆 / 观赏鱼养殖场 / 实验室）近距离（≤ 30 cm）高帧率（≥ 25 FPS）视频，识别 7 类综合场景（respiratory_normal / high_normal / hyperventilation_mild / hyperventilation_moderate / hypoxia_warning / bradypnea / signal_unreliable）→ **核心鳃盖运动信号 5 项**（开合周期数 / 采样窗口 / 呼吸频率 BPM / 信号稳定度评分 / 鳃盖开合幅度）+ **上下文信号 4 项**（水温 / 鱼活跃度 / 距投喂时长 / 浮头吞气）+ **鱼种基线 4 项**（鱼种 / 25℃ BPM 正常区间 / 高阈值 / 低阈值）→ 4 档异常等级（normal / mild / moderate / severe/urgent）→ **4 级告警策略递进**（入库/轻提醒 → 重要告警+水质检查 → 紧急告警+开启增氧+联系兽医 → 最高紧急告警+所有联系人+立即抢救建议）→ 单日告警上限（Level 1 不限 / Level 2 × 6 / Level 3 × 3 / Level 4 不设上限）→ **每日呼吸健康报告**（按 tank_id 输出，含 BPM 趋势 + 异常事件 + 建议动作，**不含具体药物**）+ 免责声明\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 鱼体目标检测与跟踪 |\n| 2 | 鳃盖区域语义分割（侧面视图） |\n| 3 | 鳃盖开合周期检测（光流 / 像素变化时序分析） |\n| 4 | BPM 计算（周期数 × 60 / 窗口秒） |\n| 5 | 信号稳定度评分（去除游动遮挡 / 抖动） |\n| 6 | 鱼种自适应基线（金鱼 40-80 |\n| 7 | 锦鲤 50-90 |\n| 8 | 神仙鱼 60-110 |\n| 9 | 斗鱼 30-70 |\n| 10 | 龙鱼 40-90 |\n| 11 | 海水神仙鱼 60-120 等） |\n| 12 | 水温修正（Q10 系数粗校正） |\n| 13 | 生理性升高识别（活跃 / 投喂后） |\n| 14 | 浮头吞气检测 |\n| 15 | 用户 APP 推送 |\n| 16 | 4 级告警递进 |\n| 17 | 单日告警上限 |\n| 18 | 每日呼吸健康报告（按 tank_id 输出） |\n| 19 | 连续 ≥ 2 日 Level 3 → 强烈建议联系**当地观赏鱼兽医** |\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_fish_respiratory_rate_monitor_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_fish_respiratory_rate_monitor_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 | 🔐 获取 open-id（强制执行） | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行鱼类呼吸频率监测 | 调用 `-m scripts.smyx_fish_respiratory_rate_monitor_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_fish_respiratory_rate_monitor_analysis.py`](scripts/smyx_fish_respiratory_rate_monitor_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| 📁 格式支持 | 输入要求：支持 mp4/avi/mov，最大 10MB；摄像头需鱼缸近距离正侧面，鳃盖区域清晰；**帧率 ≥ 25 FPS（关键约束）**；单次采样 ≥ 30 秒 |\n| 🔎 使用提醒 | **4 级告警策略递进**（mild → moderate → severe → urgent/Level 4），浮头吞气 ≥ 5 分钟或多条同发进入 Level 4 |\n| 🔎 使用提醒 | 单日告警上限：Level 1 不限 / Level 2 × 6 / Level 3 × 3 / Level 4 不设上限（紧急安全优先） |\n| 🔎 使用提醒 | 红线约束 |\n| 🧑‍⚖️ 结果性质 | **禁止**对鱼做\"鳃病 / 烂鳃 / 氨中毒...","readmeExcerpt":"Skill: Fish Respiratory Rate (Gill Opening / Closing) Monitor | 鱼类呼吸频率（鳃盖开合）监测 Owner: smyx-sunjinhui Summary: Through fixed cameras on aquariums, the system analyzes fish gill-cover opening / closing motion video, detects periodic gill opening and closing, and calculates respiratory rate (breaths per minute). | 通过鱼缸固定摄像头，分析鱼类的鳃盖开合运动视频，检测鳃盖的周期性开启和闭合，计算呼吸频率（次/分钟）。当呼吸频率超过正常阈值（例如 > 80 次/分钟，具体依品种和水温而定）时，输出'缺氧预警'，提示用户检查水质（","codeSnippets":[],"executableExamples":[{"language":"bash","snippet":"python -m scripts.smyx_fish_respiratory_rate_monitor_analysis --list"},{"language":"text","snippet":"requests>=2.28.0"},{"language":"bash","snippet":"# 分析本地鱼鳃盖近距离视频（以下只是示例，禁止直接使用 作为 open-id）\npython -m scripts.smyx_fish_respiratory_rate_monitor_analysis --input /path/to/gill.mp4\n\n# 分析网络鱼鳃盖近距离视频/实时流（以下只是示例，禁止直接使用 作为 open-id）\npython -m scripts.smyx_fish_respiratory_rate_monitor_analysis --url https://example.com/gill.mp4\n\n# 显示历史呼吸监测记录清单（自动触发关键词：查看鱼呼吸频率历史报告、鱼鳃盖监测日志清单等）\npython -m scripts.smyx_fish_respiratory_rate_monitor_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_fish_respiratory_rate_monitor_analysis --input gill.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_fish_respiratory_rate_monitor_analysis --input gill.mp4 --output result.json"},{"language":"bash","snippet":"python -m scripts.smyx_fish_respiratory_rate_monitor_analysis --list"},{"language":"text","snippet":"requests>=2.28.0"},{"language":"bash","snippet":"# 分析本地鱼鳃盖近距离视频（以下只是示例，禁止直接使用 作为 open-id）\npython -m scripts.smyx_fish_respiratory_rate_monitor_analysis --input /path/to/gill.mp4\n\n# 分析网络鱼鳃盖近距离视频/实时流（以下只是示例，禁止直接使用 作为 open-id）\npython -m scripts.smyx_fish_respiratory_rate_monitor_analysis --url https://example.com/gill.mp4\n\n# 显示历史呼吸监测记录清单（自动触发关键词：查看鱼呼吸频率历史报告、鱼鳃盖监测日志清单等）\npython -m scripts.smyx_fish_respiratory_rate_monitor_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_fish_respiratory_rate_monitor_analysis --input gill.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_fish_respiratory_rate_monitor_analysis --input gill.mp4 --output result.json"}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\nname: \"smyx-fish-respiratory-rate-monitor-analysis\"\ndescription: \"Through fixed cameras on aquariums, the system analyzes fish gill-cover opening / closing motion video, detects periodic gill opening and closing, and calculates respiratory rate (breaths per minute). | 通过鱼缸固定摄像头，分析鱼类的鳃盖开合运动视频，检测鳃盖的周期性开启和闭合，计算呼吸频率（次/分钟）。当呼吸频率超过正常阈值（例如 > 80 次/分钟，具体依品种和水温而定）时，输出'缺氧预警'，提示用户检查水质（溶氧量）、水温或鱼的健康状态。\"\nversion: \"1.0.17\"\nlicense: \"MIT-0\"\n---\n\n# 🫧 Fish Respiratory Rate (Gill Opening / Closing) Monitor | 鱼类呼吸频率（鳃盖开合）监测\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **鱼类呼吸频率（鳃盖开合）监测** |\n| 🎯 核心目标 | 通过鱼缸固定摄像头，分析鱼类的鳃盖开合运动视频，检测鳃盖的周期性开启和闭合，计算呼吸频率（次/分钟）。当呼吸频率超过正常阈值（例如 > 80 次/分钟，具体依品种和水温而定）时，输出'缺氧预警'，提示用户检查水质（溶氧量）、水温或鱼的健康状态。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_FISH_RESPIRATORY_RATE_MONITOR_ANALYSIS` |\n\nThrough fixed cameras on aquariums, the system analyzes fish gill-cover opening / closing motion video, detects periodic gill opening and closing, and calculates respiratory rate (breaths per minute). When the respiratory rate exceeds a normal threshold (e.g. > 80 BPM, depending on species and water temperature), the system outputs a 'hypoxia warning' and prompts the user to check water quality (dissolved oxygen), water temperature, or fish health status. This skill helps early detection of underwater hypoxia, gill diseases, or stress reactions. Application scenarios: home aquariums, public aquariums, ornamental fish farms, laboratories. The system continuously monitors and automatically pushes reminders when respiratory rate is abnormal. Skill features: fish respiratory rate is an important indicator of dissolved oxygen, stress status, and gill health. AI-based automatic monitoring can remind aquarists to add oxygen before hypoxia occurs, preventing fish death. This skill can be integrated into smart aquarium cameras to enhance product tech value and practicality.\n\n通过鱼缸固定摄像头，分析鱼类的鳃盖开合运动视频，检测鳃盖的周期性开启和闭合，计算呼吸频率（次/分钟）。当呼吸频率超过正常阈值（例如 > 80 次/分钟，具体依品种和水温而定）时，输出'缺氧预警'，提示用户检查水质（溶氧量）、水温或鱼的健康状态。该技能有助于早期发现水中缺氧、鳃部疾病或应激反应。应用场景：家庭鱼缸、水族馆、观赏鱼养殖场、实验室。系统连续监测，在呼吸频率异常时自动推送提醒。技能特点：鱼类呼吸频率是反映溶氧量、应激状态和鳃部健康的重要指标。通过 AI 自动监测，可在缺氧发生前及时提醒养鱼者增氧，防止鱼只死亡。该技能可集成到智能鱼缸摄像头中，提升产品科技含量和实用性。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的水族呼吸健康监测 AI。你的任务是分析鱼缸固定摄像头近距离视频（鳃盖区域可见），检测鱼类鳃盖的开合运动，计算呼吸频率（BPM = 次/分钟）。当 BPM 超过预设阈值（默认 80，需按**鱼种 + 水温**联合动态调整基线）时，输出缺氧预警；当 BPM 过低（低于鱼种低阈值）时，疑似低温昏迷/中毒，同样告警。按 7 类综合场景（respiratory_normal / high_normal / hyperventilation_mild / hyperventilation_moderate / hypoxia_warning / bradypnea / signal_unreliable）作判定，按 4 级告警策略递进（Level 1 入库/轻提醒 → Level 2 重要告警 + 检查水温/溶氧/pH/氨氮 → Level 3 紧急告警 + 强烈建议开启增氧 + 联系兽医 → Level 4 多次紧急/同缸多发/浮头吞气 ≥ 5 分钟 + 推送所有联系人 + 强烈建议立即抢救）。必须考虑生理性升高的上下文（活跃游动 / 投喂后 30 分钟内 / 水温升高），避免误报。信号稳定度 < 50% 必须返回 `signal_unreliable` 并建议重拍，**禁止给出不可靠的告警**。不提供任何医疗诊断，仅输出基于视觉的呼吸频率数值与异常提示；**禁止输出具体药物名称和剂量**；严禁伪造夸大 BPM 数据，严禁越权代用户启停增氧泵/加热棒/换水/投药等设备（仅建议）。**"},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-fish-respiratory-rate-monitor-analysis\",\n  \"version\": \"1.0.10\",\n  \"publishedAt\": 1790858083532\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}` - 导出呼吸频率监测报告\n5. （可选）`/web/companion/v2/trigger-soothing-action` - 触发联动提醒（用户 APP 推送 / 智能鱼缸告警灯 / 触发增氧设备建议提示）\n\n## 场景代码\n\n- `SMYX_FISH_RESPIRATORY_RATE_MONITOR_ANALYSIS` - 鱼类呼吸频率（鳃盖开合）监测\n\n## 输入约束\n\n- 摄像头：鱼缸固定摄像头，能近距离（≤ 30 cm）清晰拍摄鱼鳃盖区域\n- 分辨率 ≥ 720p；**帧率 ≥ 25 FPS**（鳃盖开合频率高，需高帧率才能可靠采样；正常 20-80 次/分钟 ≈ 0.3-1.3 Hz）\n- 光照：建议鱼缸照明开启 + 无强反光；水质清澈\n- 拍摄角度：优先正侧面（鳃盖运动幅度最大）；鳃盖区域完整可见\n- 单次有效采样窗口：≥ 30 秒（建议 60 秒），用于稳定计算 BPM\n- 多鱼缸场景按摄像头 ID 绑定到注册鱼缸 ID（每个鱼缸独立鱼种 + 水温记录）\n- 多鱼场景按目标跟踪 + ReID 绑定到注册个体（每条鱼独立基线，可选）\n- 用户必须授权部署；公共水族馆 / 实验室需公示告知\n\n## 关键观测信号\n\n### 鳃盖运动信号（核心）\n- `gill_open_close_cycle_count` - 采样窗口内鳃盖开合周期数\n- `sampling_window_sec` - 采样窗口时长（秒）\n- `respiratory_rate_bpm` - 呼吸频率（次/分钟，= cycle_count × 60 / window_sec）\n- `bpm_signal_stability_score` - 信号稳定度评分（0-100，去除游动遮挡 / 帧间抖动后的有效采样比例）\n- `gill_opening_amplitude_score` - 鳃盖开合幅度评分（0-100，反映呼吸深度）\n\n### 上下文信号\n- `water_temperature_c` - 水温（℃，用户输入或智能鱼缸传感器；同物种水温越高 BPM 越高）\n- `fish_activity_level` - 鱼活跃度（resting / normal / active；活跃时 BPM 升高为生理性）\n- `time_since_feeding_min` - 距上次投喂时长（分钟，投喂后 30 分钟内 BPM 生理性升高）\n- `surface_gasping_detected` - 是否检测到浮头吞气（缺氧典型征兆）\n\n### 鱼种基线（必须配置）\n- `species` - 鱼种标识（金鱼 / 锦鲤 / 神仙鱼 / 斗鱼 / 龙鱼 / 海水鱼 等）\n- `bpm_baseline_at_25c` - 25℃ 下该鱼种的正常 BPM 区间（如金鱼 40-80）\n- `bpm_threshold_high` - 高阈值（默认 80，按鱼种 + 水温动态调整）\n- `bpm_threshold_low` - 低阈值（呼吸过缓也异常，疑似低温昏迷 / 中毒）\n\n## 综合判定\n\n- `respiratory_normal` - 呼吸频率正常\n- `respiratory_high_normal` - 偏高但属于生理性（活跃 / 投喂后 30 分钟内）\n- `respiratory_hyperventilation_mild` - 呼吸急促轻度（BPM 超阈值 1.1-1.3 倍）\n- `respiratory_hyperventilation_moderate` - 呼吸急促中度（1.3-1.6 倍 + 鳃盖大开合）\n- `respiratory_hypoxia_warning` - 缺氧预警（BPM > 阈值 1.6 倍 / 浮头吞气）\n- `respiratory_bradypnea` - 呼吸过缓（BPM < 低阈值，疑似低温/中毒/濒死）\n- `respiratory_signal_unreliable` - 信号不可靠（稳定度 < 50%，建议重拍）\n\n## 4 级告警策略递进\n\n- Level 1（hyperventilation_mild / high_normal）：仅入库记录或用户 APP 轻提醒\"鱼缸 X 号呼吸偏快，请观察水质\"\n- Level 2（hyperventilation_moderate）：用户 APP 重要告警，建议**检查水温、溶氧、pH、氨氮**\n- Level 3（hypoxia_warning / bradypnea）：紧急告警，**强烈建议立即开启增氧设备 / 部分换水 / 降低密度**，并提示联系**当地观赏鱼兽医**\n- Level 4（连续 ≥ 2 次 Level 3 / 同缸多条鱼同时缺氧 / 浮头吞气持续 ≥ 5 分钟）：最高紧急告警 + 推送家庭/管理人员所有联系人 + 强烈建议**立即抢救**（开启增氧泵 + 大幅换水 + 降低喂食）\n\n## 单日告警上限\n\n- Level 1 不限（仅入库或轻提醒）/ Level 2 × 6 / Level 3 × 3 / Level 4 不设上限\n\n## 红线约束\n\n- **禁止**做\"鳃病 / 烂鳃 / 氨中毒 / 亚硝酸盐中毒 / 寄生虫感染\"等具体疾病诊断\n- **禁止**输出具体药物名称、剂量、给药方案\n- **禁止**长期存储完整鱼缸视频（≤ 7 天，仅入库异常呼吸事件片段；公共水族馆 / 实验室按管理规定）\n- **禁止**用于商业广告 / AI 训练；禁第三方共享\n- **禁止**越权代用户启停增氧泵 / 加热棒 / 换水 / 投药 / 灯光参数；任何水族设备控制变更必须由用户确认（仅可建议）\n- BPM、稳定度、鳃盖幅度等指标必须基于真实视频帧统计；**禁止伪造或夸大指标**\n- 鱼种特异性：不同鱼种 BPM 基线差异极大（金鱼 40-80 vs 海水神仙鱼 60-120）→ 必须按**鱼种 + 水温**联合判定基线；**禁止使用通用阈值盲判**\n- 水温升高、活跃游动、刚投喂后 30 分钟内会出现生理性 BPM 升高 → 必须在上下文中标注并避免误报\n- 信号稳定度 < 50% 时必须返回"},{"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":"Through fixed cameras on aquariums, the system analyzes fish gill-cover opening / closing motion video, detects periodic gill opening and closing, and calculates respiratory rate (breaths per minute). | 通过鱼缸固定摄像头，分析鱼类的鳃盖开合运动视频，检测鳃盖的周期性开启和闭合，计算呼吸频率（次/分钟）。当呼吸频率超过正常阈值（例如 > 80 次/分钟，具体依品种和水温而定）时，输出'缺氧预警'，提示用户检查水质（溶氧量）、水温或鱼的健康状态。 Skill: Fish Respiratory Rate (Gill Opening / Closing) Monitor | 鱼类呼吸频率（鳃盖开合）监测 Owner: smyx-sunjinhui Summary: Through fixed cameras on aquariums, the system analyzes fish gill-cover opening / closing motion video, detects periodic gill opening and closing, and calculates respiratory rate (breaths per minute). | 通过鱼缸固定摄像头，分析鱼类的鳃盖开合运动视频，检测鳃盖的周期性开启和闭合，计算呼吸频率（次/分钟）。当呼吸频率超过正常阈值（例如 > 80 次/分钟，具体依品种和水温而定）时，输出'缺氧预警'，提示用户检查水质（","editorialQuality":{"score":100,"threshold":65,"status":"ready","wordCount":1117,"uniquenessScore":45,"reasons":[]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-10T04:20:48.954Z","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-10T04:20:48.954Z","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-10T07:12:55.858Z","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"}]}}}