{"id":"3d5ae2fe-6e98-4bbf-9fbd-f79afe4a9fb5","entityType":"agent","slug":"clawhub-smyx-sunjinhui-smyx-employee-emotion-fluctuation-hr-ana","name":"Employee Emotion Fluctuation HR Report | 员工入职/离职情绪波动预警（HR方向）","canonicalUrl":"https://www.xpersona.co/agent/clawhub-smyx-sunjinhui-smyx-employee-emotion-fluctuation-hr-ana","canonicalPath":"/agent/clawhub-smyx-sunjinhui-smyx-employee-emotion-fluctuation-hr-ana","generatedAt":"2026-10-10T11:02:21.950Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"editorial-content","verified":true,"confidence":"high","updatedAt":"2026-10-10T06:23:58.503Z","emptyReason":null},"description":"Using fixed cameras in enterprise office areas (with employee consent and anonymization), the system performs long-term monitoring of employees' facial expressions and posture features, building per-person historical baselines (smile frequency, sigh count, frown level, etc.). | 通过企业办公区固定摄像头（需征得员工同意并匿名化处理），长期监测员工的面部表情和姿态特征，建立个人历史基线（如笑容频率、叹气次数、皱眉程度等）。当检测到某员工近期的笑容频率显著下降（例如比基线降低40%）、叹气次数增加（例如比基线增加50%）或与其他异常行为（社交回避、长时间独自静坐）时，输出情绪波动预警，提醒HR或管理者进行关怀沟通。 Skill: Employee Emotion Fluctuation HR Report | 员工入职/离职情绪波动预警（HR方向） Owner: smyx-sunjinhui Summary: Using fixed cameras in enterprise office areas (with employee consent and anonymization), the system performs long-term monitoring of employees' facial expressions and posture features, building per-person historical baselines (smile frequency, sigh count, frown level, etc.). | 通过企业办公区固定摄像头（需征得员工同意并匿名化处理），长期监测员工的面部表情和姿态","descriptionLabel":"Technical summary","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 1.6K downloads reported by the source. Last updated 10/10/2026.","installCommand":"clawhub skill install s17cfv2h26b7hq5w47tgfy23xx83z9x6:smyx-employee-emotion-fluctuation-hr-analysis","sourceUrl":"https://clawhub.ai/smyx-sunjinhui/smyx-employee-emotion-fluctuation-hr-analysis","homepage":"https://clawhub.ai/smyx-sunjinhui/skills/smyx-employee-emotion-fluctuation-hr-analysis","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/smyx-sunjinhui/smyx-employee-emotion-fluctuation-hr-analysis","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/smyx-sunjinhui/skills/smyx-employee-emotion-fluctuation-hr-analysis","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":64,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"Using fixed cameras in enterprise office areas (with employee consent and anonymization), the system performs long-term monitoring of employees' facial expressi"},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-10T06:23:58.503Z","emptyReason":null},"protocols":[{"protocol":"OPENCLEW","label":"OpenClaw","status":"self-declared","notes":"Declared in the public agent profile."}],"capabilities":[],"verifiedCount":0,"selfDeclaredCount":1,"capabilityMatrix":{"rows":[{"key":"OPENCLEW","type":"protocol","support":"unknown","confidenceSource":"profile","notes":"Listed on profile"}],"flattenedTokens":"protocol:OPENCLEW|unknown|profile"}},"adoption":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-10T06:23:58.503Z","emptyReason":null},"stars":null,"forks":null,"downloads":1622,"packageName":null,"latestVersion":"1.0.11","tractionLabel":"1.6K downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-10T06:23:58.503Z","emptyReason":null},"lastUpdatedAt":"2026-10-10T06:23:58.503Z","lastCrawledAt":"2026-10-10T06:23:58.503Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-11T06:23:58.503Z","lastVerifiedAt":null,"highlights":[{"version":"1.0.11","createdAt":"2026-09-30T03:09:26.473Z","changelog":"- Updated SKILL.md with a new version number and documentation refinements. - Removed the file skill-card.md. - No changes were made to core logic or functionality; updates are documentation and metadata only.","fileCount":31,"zipByteSize":43573},{"version":"1.0.10","createdAt":"2026-09-24T17:57:33.486Z","changelog":"- Updated skill version to 1.0.16. - Refined and expanded the SKILL.md documentation. - Adjusted instructions and workflow steps for clarity and completeness. - Removed the redundant file skill-card.md.","fileCount":31,"zipByteSize":43618},{"version":"1.0.9","createdAt":"2026-09-08T10:25:29.094Z","changelog":"- Updated documentation: SKILL.md has been revised and version bumped. - Removed the skill-card.md file. - Adjusted version numbering in SKILL.md and description metadata. - No changes to code or functionality.","fileCount":31,"zipByteSize":43634},{"version":"1.0.8","createdAt":"2026-08-25T07:25:35.105Z","changelog":"- Updated SKILL.md to a new version with minor documentation changes. - Incremented version number from 1.0.11 to 1.0.12 in SKILL.md. - Removed the file skill-card.md. - No functional changes to the skill logic or script interface.","fileCount":31,"zipByteSize":43737},{"version":"1.0.7","createdAt":"2026-08-17T14:35:33.860Z","changelog":"- Updated version metadata in SKILL.md (`version: 1.0.10` → `1.0.11`) - Removed the file `skill-card.md` - No user-facing functionality or behavioral changes - Documentation and metadata maintenance update only","fileCount":31,"zipByteSize":43769},{"version":"1.0.6","createdAt":"2026-08-16T01:59:39.598Z","changelog":"- Internal configuration updated in `skills/smyx_common/scripts/config.yaml`. - Removed the `skill-card.md` file for a slimmer repository.","fileCount":31,"zipByteSize":43820},{"version":"1.0.5","createdAt":"2026-08-07T15:34:38.779Z","changelog":"- Updated SKILL.md content and version number (now 1.0.10). - Removed skill-card.md file from the project. - No changes to logic, scripts, or functional capabilities; documentation only.","fileCount":31,"zipByteSize":43690},{"version":"1.0.4","createdAt":"2026-08-02T06:38:40.727Z","changelog":"- Updated SKILL.md to version 1.0.9 with minor documentation changes and clarifications. - Removed the skill-card.md file. - No functional changes to scripts or core logic. - Documentation now reflects latest workflow and interface details.","fileCount":31,"zipByteSize":43695}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s17cfv2h26b7hq5w47tgfy23xx83z9x6:smyx-employee-emotion-fluctuation-hr-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-employee-emotion-fluctuation-hr-ana/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-smyx-sunjinhui-smyx-employee-emotion-fluctuation-hr-ana/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-smyx-sunjinhui-smyx-employee-emotion-fluctuation-hr-ana/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-smyx-sunjinhui-smyx-employee-emotion-fluctuation-hr-ana/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-smyx-sunjinhui-smyx-employee-emotion-fluctuation-hr-ana/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-smyx-sunjinhui-smyx-employee-emotion-fluctuation-hr-ana/trust\""],"jsonRequestTemplate":{"query":"summarize this repo","constraints":{"maxLatencyMs":2000,"protocolPreference":["OPENCLEW"]}},"jsonResponseTemplate":{"ok":true,"result":{"summary":"...","confidence":0.9},"meta":{"source":"CLAWHUB","generatedAt":"2026-10-10T11:02:21.946Z"}},"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-employee-emotion-fluctuation-hr-ana/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-smyx-sunjinhui-smyx-employee-emotion-fluctuation-hr-ana/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-smyx-sunjinhui-smyx-employee-emotion-fluctuation-hr-ana/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-smyx-sunjinhui-smyx-employee-emotion-fluctuation-hr-ana/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-10T06:23:58.503Z","emptyReason":null},"readme":"Skill: Employee Emotion Fluctuation HR Report | 员工入职/离职情绪波动预警（HR方向）\n\nOwner: smyx-sunjinhui\n\nSummary: Using fixed cameras in enterprise office areas (with employee consent and anonymization), the system performs long-term monitoring of employees' facial expressions and posture features, building per-person historical baselines (smile frequency, sigh count, frown level, etc.). | 通过企业办公区固定摄像头（需征得员工同意并匿名化处理），长期监测员工的面部表情和姿态特征，建立个人历史基线（如笑容频率、叹气次数、皱眉程度等）。当检测到某员工近期的笑容频率显著下降（例如比基线降低40%）、叹气次数增加（例如比基线增加50%）或与其他异常行为（社交回避、长时间独自静坐）时，输出情绪波动预警，提醒HR或管理者进行关怀沟通。\n\nTags: latest:1.0.11\n\nVersion history:\n\nv1.0.11 | 2026-09-30T03:09:26.473Z | auto\n\n- Updated SKILL.md with a new version number and documentation refinements.\n- Removed the file skill-card.md.\n- No changes were made to core logic or functionality; updates are documentation and metadata only.\n\nv1.0.10 | 2026-09-24T17:57:33.486Z | auto\n\n- Updated skill version to 1.0.16.\n- Refined and expanded the SKILL.md documentation.\n- Adjusted instructions and workflow steps for clarity and completeness.\n- Removed the redundant file skill-card.md.\n\nv1.0.9 | 2026-09-08T10:25:29.094Z | auto\n\n- Updated documentation: SKILL.md has been revised and version bumped.\n- Removed the skill-card.md file.\n- Adjusted version numbering in SKILL.md and description metadata.\n- No changes to code or functionality.\n\nv1.0.8 | 2026-08-25T07:25:35.105Z | auto\n\n- Updated SKILL.md to a new version with minor documentation changes.\n- Incremented version number from 1.0.11 to 1.0.12 in SKILL.md.\n- Removed the file skill-card.md.\n- No functional changes to the skill logic or script interface.\n\nv1.0.7 | 2026-08-17T14:35:33.860Z | auto\n\n- Updated version metadata in SKILL.md (`version: 1.0.10` → `1.0.11`)\n- Removed the file `skill-card.md`\n- No user-facing functionality or behavioral changes\n- Documentation and metadata maintenance update only\n\nv1.0.6 | 2026-08-16T01:59:39.598Z | auto\n\n- Internal configuration updated in `skills/smyx_common/scripts/config.yaml`.\n- Removed the `skill-card.md` file for a slimmer repository.\n\nv1.0.5 | 2026-08-07T15:34:38.779Z | auto\n\n- Updated SKILL.md content and version number (now 1.0.10).\n- Removed skill-card.md file from the project.\n- No changes to logic, scripts, or functional capabilities; documentation only.\n\nv1.0.4 | 2026-08-02T06:38:40.727Z | auto\n\n- Updated SKILL.md to version 1.0.9 with minor documentation changes and clarifications.\n- Removed the skill-card.md file.\n- No functional changes to scripts or core logic.\n- Documentation now reflects latest workflow and interface details.\n\nv1.0.3 | 2026-07-19T03:34:27.343Z | auto\n\n- Updated skill version from 1.0.4 to 1.0.7.\n- Documentation improvements in SKILL.md to clarify usage, capabilities, and compliance notes.\n- Minor codebase changes in configuration and utility scripts.\n- Removed redundant documentation file (skill-card.md).\n\nv1.0.2 | 2026-06-29T05:17:25.062Z | auto\n\n- Removed the file: skill-card.md\n- No changes to functionality or documentation other than file removal.\n\nv1.0.1 | 2026-06-27T05:09:25.466Z | auto\n\n- Major rework of documentation and user flow to simplify skill usage and enhance privacy guarantees.\n- Internal open-id handling is now fully automated; users are never asked to input identity information.\n- All user-facing steps and parameters have been streamlined for clarity—only analysis progress, results, and report links are shown.\n- Strict requirement: all historical report queries must use the cloud API; local history access and manual aggregation are prohibited.\n- Two sample files removed; references and scripts updated to align with the new process and compliance best practices.\n- Dependency documentation clarified; added data security, privacy, and HR usage guidelines throughout.\n\nv1.0.0 | 2026-05-27T08:10:18.364Z | auto\n\nInitial release of smyx-employee-emotion-fluctuation-hr-analysis:\n\n- Enables AI-based, anonymized monitoring of employee facial and behavioral cues from office cameras (with consent).\n- Builds per-person baselines to detect significant changes in morale indicators (e.g., smile drop, sigh increase, social withdrawal).\n- Automatically triggers emotion fluctuation alerts for HR/management to support early mental health intervention.\n- Generates weekly or monthly emotion trend reports for HR senior management only, protecting privacy and preventing misuse.\n- Strict controls for open-id authentication and data access; all outputs anonymized and not tied to performance decisions.\n- Designed for mid-to-large enterprises in high-pressure sectors; emphasizes legal, consent, and privacy requirements.\n\nArchive index:\n\nArchive v1.0.11: 31 files, 43573 bytes\n\nFiles: references/api_doc.md (5846b), scripts/__init__.py (57b), scripts/config.py (688b), scripts/config.yaml (3b), scripts/skill.py (577b), scripts/smyx_employee_emotion_fluctuation_hr_analysis.py (3680b), skill-card.md (2271b), SKILL.md (14924b), 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 (165b)\n\nFile v1.0.11:SKILL.md\n\n---\nname: \"smyx-employee-emotion-fluctuation-hr-analysis\"\ndescription: \"Using fixed cameras in enterprise office areas (with employee consent and anonymization), the system performs long-term monitoring of employees' facial expressions and posture features, building per-person historical baselines (smile frequency, sigh count, frown level, etc.). | 通过企业办公区固定摄像头（需征得员工同意并匿名化处理），长期监测员工的面部表情和姿态特征，建立个人历史基线（如笑容频率、叹气次数、皱眉程度等）。当检测到某员工近期的笑容频率显著下降（例如比基线降低40%）、叹气次数增加（例如比基线增加50%）或与其他异常行为（社交回避、长时间独自静坐）时，输出情绪波动预警，提醒HR或管理者进行关怀沟通。\"\nversion: \"1.0.17\"\nlicense: \"MIT-0\"\n---\n\n# 💼 Employee Emotion Fluctuation HR Report | 员工情绪波动 HR 报告\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **员工入职/离职情绪波动预警（HR方向）** |\n| 🎯 核心目标 | 通过企业办公区固定摄像头（需征得员工同意并匿名化处理），长期监测员工的面部表情和姿态特征，建立个人历史基线（如笑容频率、叹气次数、皱眉程度等）。当检测到某员工近期的笑容频率显著下降（例如比基线降低40%）、叹气次数增加（例如比基线增加50%）或与其他异常行为（社交回避、长时间独自静坐）时，输出情绪波动预警，提醒HR或管理者进行关怀沟通。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_EMPLOYEE_EMOTION_FLUCTUATION_HR_ANALYSIS` |\n\nUsing fixed cameras in enterprise office areas (with employee consent and anonymization), the system performs long-term monitoring of employees' facial expressions and posture features, building per-person historical baselines (smile frequency, sigh count, frown level, etc.). When an employee's smile frequency drops significantly relative to baseline (e.g., -40%), sighs increase significantly (e.g., +50%), or other abnormal behaviors emerge (social withdrawal, long solo sitting), the system outputs an emotion-fluctuation alert and reminds HR or managers to initiate a supportive check-in. The skill aims to help organizations detect employee mental-health issues early, reduce turnover risk, and improve well-being. Application scenarios: enterprise open-plan offices, department private offices. The system generates weekly or monthly employee emotion-trend reports for HR internal reference ONLY. Skill features: low employee morale often precedes resignation; AI-based early identification allows HR to provide timely care and reduce attrition. Suitable for mid-to-large enterprises, especially high-pressure roles such as R&D and customer service. Privacy must be protected; access should be limited to HR senior management only.\n\n通过企业办公区固定摄像头（需征得员工同意并匿名化处理），长期监测员工的面部表情和姿态特征，建立个人历史基线（如笑容频率、叹气次数、皱眉程度等）。当检测到某员工近期的笑容频率显著下降（例如比基线降低40%）、叹气次数增加（例如比基线增加50%）或与其他异常行为（社交回避、长时间独自静坐）时，输出情绪波动预警，提醒HR或管理者进行关怀沟通。该技能旨在帮助组织及时发现员工心理健康问题，降低离职风险，提升员工幸福感。应用场景：企业开放式办公区、部门独立办公室。系统每周或每月生成员工情绪趋势报告，仅供HR内部参考。技能特点：员工情绪低落往往是离职的前兆，通过AI早期识别异常，HR可及时介入关怀，降低流失率。该技能适用于中大型企业，尤其适合研发、客服等高压力岗位。需注意隐私保护，建议仅HR管理层可见。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的职场心理健康监测 AI（必须经企业授权 + 员工知情同意 + 工会备案）。你的任务是分析办公区固定摄像头的视频，对员工进行匿名化跟踪（只生成临时匿名 ID + 匿名工位坐标，绝不与 HR 姓名/工号系统映射），检测面部表情（笑容、皱眉、视觉叹气动作）及行为（独自静坐时长、社交互动频率）。对比个人 30 天历史基线，当笑容频率下降 ≥ 40% 或叹气次数增加 ≥ 50% 或独自静坐增加 ≥ 50% 时，输出情绪波动预警。不存储任何个人识别信息，仅向 HR 高级管理层输出匿名 ID + 工位坐标的关怀提示，禁止用于绩效考核、晋升、解雇决策。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于企业办公区固定摄像头视频（员工知情同意 + 工会备案），匿名跟踪员工面部表情 4 项（笑容数 / 笑容时长 / 皱眉数 / 视觉叹气数 / 中性比例）+ 行为 4 项（独自静坐总时长 / 同事互动事件数 / 离开工位次数 / 工位姿态前倾比例）→ 与个人 30 天基线对比 → 连续 ≥ 3 个工作日异常 → 输出匿名 ID + 工位坐标级的 HR 关怀建议（**不输出姓名，不与工号绑定**），用于自愿性 1-on-1 关怀沟通\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 基于临时匿名 ID 的多人跨帧跟踪（ID 周期性轮换 ≤ 7 天） |\n| 2 | 笑容/皱眉/视觉叹气识别（耸肩 + 长呼气姿态） |\n| 3 | 独自静坐 vs 同事互动判别 |\n| 4 | 工位 ROI 标定（W-A12 / W-B07 等匿名坐标） |\n| 5 | 30 天个人基线计算 |\n| 6 | smile_delta / sigh_delta / solo_sit_delta / peer_interaction_delta 百分比对比 |\n| 7 | 连续异常天数累计 |\n| 8 | 波动模式分类（smile_drop / sigh_increase / withdrawal / mixed / improving / none） |\n| 9 | 4 档关怀等级（none / mild / notable / focus_care） |\n| 10 | 最小样本保护（当日可分析时长 < 2 h 输出 insufficient_sample） |\n| 11 | 面向 HR 的中性 |\n| 12 | 保密 |\n| 13 | 自愿性关怀建议生成 |\n| 14 | EAP 资源参考 |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供企业办公区固定摄像头视频 URL 或文件需要分析时，默认触发本技能进行员工情绪波动 HR 报告 |\n| 🔎 明确分析意图 | 当用户明确提及员工情绪、员工幸福感、离职风险、HR 关怀、高压力岗位心理健康、EAP、工位情绪监测等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看员工情绪波动历史报告、HR 关怀报告清单、员工情绪趋势报告清单、查询历史员工情绪记录、显示所有 HR 内部情绪报告、显示团队情绪健康报告，查询员工情绪波动预警清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_employee_emotion_fluctuation_hr_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_employee_emotion_fluctuation_hr_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 | ⚙️ 执行员工情绪波动 HR 报告 | 调用 `-m scripts.smyx_employee_emotion_fluctuation_hr_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地企业办公区固定摄像头视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络企业办公区固定摄像头视频 URL 地址（API 服务自动下载） | API 服务自动下载网络资源 |\n| `--pet-type` | 类别标识，职场心理健康监测场景默认 `other` | 按需填写 |\n| `--list` | 显示员工情绪波动 HR 报告列表清单（可以输入起始日期参数过滤数据范围） | 用于云端历史报告查询 |\n| `--api-url` | API 服务地址（可选，使用默认值） | 按需填写 |\n| `--detail` | 输出详细程度（basic/standard/json，默认 json） | 输出详细程度 |\n| `--output` | 结果输出文件路径（可选） | 可选 |\n\n## 🗂️ 资源索引 | Resource Index\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_employee_emotion_fluctuation_hr_analysis.py`](scripts/smyx_employee_emotion_fluctuation_hr_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；**关键**：必须有 ≥ 30 天个人基线，单日可分析时长 ≥ 2 h |\n| 🔎 使用提醒 | 节假日 / 项目截止日 / 加班季 / 团建后疲倦等情形会显著影响指标，建议在配置中标记\"非常态期\" |\n| 🔎 使用提醒 | 突发短期波动（如家庭事件单日情绪低落）不应立即触发预警，必须连续 ≥ 3 个工作日异常 |\n| 🔎 使用提醒 | **红线（必读）** |\n| 🔎 使用提醒 | **禁止**人脸识别到 HR 姓名/工号库；**禁止**将\"匿名 ID ↔ 实际员工\"映射表落地存储或对外暴露 |\n| 🧑‍⚖️ 结果性质 | **禁止**输出\"焦虑症/抑郁症\"等任何精神医学诊断或量表评分 |\n| 🔎 使用提醒 | **禁止**用于绩效考核、晋升评估、解雇决策 |\n| 🔎 使用提醒 | **禁止**长期存储原始视频或人脸特征；建议仅保存匿名 ID 级聚合指标，保留期 ≤ 30 天 |\n| 🔎 使用提醒 | **禁止**未经员工本人同意将其数据共享给直属上级以外的第三方 |\n| 📁 格式支持 | **禁止**在沟通中直接告知员工\"你被摄像头分析为情绪低落\"，必须以**自然工作支持**的方式进行 |\n| 🔎 使用提醒 | 合规要点：必须**显著公告 + 员工代表大会/工会备案** + 员工 opt-out 选项；数据访问 ≥ 2 名 HR 高管共同审批 + 全量访问日志 |\n| 🧑‍⚖️ 结果性质 | 当 `focus_care_needed` 时附**企业 EAP / 全国心理援助热线 400-161-9995**参考 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地企业办公区视频\npython -m scripts.smyx_employee_emotion_fluctuation_hr_analysis --input /path/to/office.mp4\n\n# 分析网络企业办公区视频\npython -m scripts.smyx_employee_emotion_fluctuation_hr_analysis --url https://example.com/office.mp4\n\n# 显示历史员工情绪波动 HR 报告（自动触发关键词：查看员工情绪波动历史报告、HR 关怀报告清单等）\npython -m scripts.smyx_employee_emotion_fluctuation_hr_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_employee_emotion_fluctuation_hr_analysis --input office.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_employee_emotion_fluctuation_hr_analysis --input office.mp4 --output result.json\n```\n\nFile v1.0.11:_meta.json\n\n{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-employee-emotion-fluctuation-hr-analysis\",\n  \"version\": \"1.0.11\",\n  \"publishedAt\": 1790737766473\n}\n\nFile v1.0.11:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放员工情绪波动 HR 报告 API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权（**仅向 HR 管理层角色开放**）\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动员工情绪波动监测任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取匿名 ID 级情绪基线对比 + 波动预警\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史 HR 关怀报告\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出 HR 内部完整报告\n\n## 场景代码\n\n- `SMYX_EMPLOYEE_EMOTION_FLUCTUATION_HR_ANALYSIS` - 员工情绪波动 HR 报告\n\n## 输入约束\n\n- 摄像头：企业开放式办公区 / 部门独立办公室固定摄像头，能看到工位上半身（含面部）\n- 帧率 ≥ 5 FPS（推荐 10 FPS）；分辨率 ≥ 720p；光照稳定避免逆光\n- 视频时长：日常工作时段连续采样（建议每个被分析人每日 ≥ 4 小时累计在画面中）\n- 必须有**个人 30 天历史基线**，否则首次仅输出\"基线累积中\"状态\n- 多人开放式办公需启用基于匿名 ID 的目标跟踪，不做姓名/工号绑定\n- 工位 ROI 标定：每个工位作为一个匿名工位 ID（如 W-A12 / W-B07）\n\n## 强制匿名约束（核心红线）\n\n- ❌ **禁止**进行人脸识别 / 人脸比对到 HR 系统姓名/工号库\n- ❌ **禁止**将\"匿名 ID ↔ 实际员工\"的映射表落地存储或对外暴露\n- ✅ 仅维护**临时跟踪 ID**（仅用于会话内同一人跨帧追踪），跟踪 ID 周期性轮换（建议 ≤ 7 天）\n- ✅ 所有预警结果输出**匿名 ID + 工位坐标**，不输出员工姓名或人脸图像\n- ✅ HR 收到预警后由**直属管理者本人**根据工位坐标自行判断是谁，再以**自愿性、保密**方式发起关怀沟通\n\n## 关键观测信号\n\n### 面部表情\n- `smile_count_per_day` - 每日笑容次数\n- `smile_total_duration_sec` - 笑容总时长\n- `frown_count_per_day` - 每日皱眉次数\n- `sigh_visual_event_count` - 视觉叹气动作次数（耸肩 + 呼气长姿态）\n- `neutral_ratio` - 中性面部比例\n\n### 行为\n- `solo_sit_total_minutes` - 独自静坐总时长\n- `peer_interaction_event_count` - 与他人互动事件次数（同事接近、转身交谈）\n- `desk_leave_event_count` - 离开工位次数（参考指标）\n- `working_posture_hunch_ratio` - 工位姿态前倾/含胸比例（参考指标）\n\n### 基线对比\n- `baseline_window_days` - 基线窗口（默认 30 天）\n- `smile_delta_pct` - 笑容频率相对基线变化（如 -45%）\n- `sigh_delta_pct` - 叹气次数相对基线变化（如 +60%）\n- `solo_sit_delta_pct` - 独自静坐相对基线变化\n- `peer_interaction_delta_pct` - 社交互动相对基线变化\n- `consecutive_abnormal_days` - 连续异常天数\n\n## 阈值与等级（默认值，可由 HR 配置覆盖）\n\n- `smile_delta_pct ≤ -40%` 或 `sigh_delta_pct ≥ +50%` → 单项异常\n- 连续 **3 个工作日**任一组合（笑容降 ≥ 40% 或叹气增 ≥ 50% 或独自静坐增 ≥ 50%）→ 触发波动预警\n- 同时出现 ≥ 2 项异常 → 升级为重点关怀\n- 最小样本保护：当日累计可分析时长 < 2 小时 → 输出 `insufficient_sample`，不发布预警\n\n## 输出字段（参考）\n\n- `report_period` - 报告周期（weekly / monthly）\n- `anonymized_subject_id` - 匿名跟踪 ID（如 ANON-2026W21-073，**仅本周期有效**）\n- `workstation_id` - 匿名工位坐标（如 W-A12，**不绑定姓名**）\n- `daily_metrics` - 每日 4 项面部 + 4 项行为指标\n- `baseline_comparison` - 与个人 30 天基线对比\n- `consecutive_abnormal_days`\n- `fluctuation_pattern` - 波动模式（smile_drop / sigh_increase / withdrawal / mixed / improving / none）\n- `concern_level` - 关怀等级（none / mild / notable / focus_care）\n- `alert_type` - 提醒类型（emotion_fluctuation_notice / focus_care_needed / improving / normal）\n- `alert_level` - 提醒级别（info / notice / warning）\n- `hr_care_suggestion` - 给 HR 的关怀建议（如\"匿名 ID ANON-2026W21-073（工位 W-A12）近 5 个工作日笑容频率降 42%、独自静坐增 55%，建议其直属上级以工作支持/1-on-1 聊聊近况的方式自愿沟通，**禁止**当面提及监控数据\"）\n- `recommend_action` - 建议动作（suggest_one_on_one_chat / suggest_workload_review / suggest_eap_referral / observe_only）\n- `eap_reference` - 当 focus_care_needed 时附**企业 EAP 服务 / 全国心理援助热线 400-161-9995** 参考\n\n## 强制约束与红线\n\n- ❌ **禁止**输出\"焦虑症/抑郁症\"等任何精神医学诊断或量表评分\n- ❌ **禁止**将员工情绪监测数据用于绩效考核、晋升评估、解雇决策\n- ❌ **禁止**长期存储原始视频或人脸特征；建议仅保存匿名 ID 级聚合指标，**保留期 ≤ 30 天**\n- ❌ **禁止**未经员工本人同意将其数据共享给直属上级以外的第三方\n- ❌ **禁止**在沟通中直接告知员工\"你被摄像头分析为情绪低落\"，必须以**自然工作支持**的方式进行\n- ✅ **必须**事先在企业内部以**显著公告 + 员工代表大会/工会备案**方式公开告知监测范围、用途、保留期与员工反对/退出渠道\n- ✅ 必须有**员工退出选项**（opt-out），退出员工的工位永久排除在分析之外\n- ✅ 数据访问仅限 **HR 高级管理层（≥ 2 人共同审批）**，所有访问留日志\n\n> 仅输出基于视觉的匿名行为聚合预警，**不构成精神医学诊断，不可作为绩效/晋升/解雇依据**；任何疑似心理健康问题应通过 EAP（员工援助计划）或专业心理咨询渠道，由员工本人自愿参与解决。\n\nFile v1.0.11: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.11:scripts/config.yaml\n\n{}\n\nFile v1.0.11:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.11: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.11: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.11: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.11:skill-card.md\n\n## Description:\n\nAnalyzes workplace camera footage against individual baselines to produce employee emotion-fluctuation alerts and HR support 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\nHR teams and authorized managers use this skill to review trends in workplace camera footage and receive alerts and supportive check-in suggestions for employees. Reports are intended for internal care, not employment decisions or medical diagnosis.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: High-risk workplace camera monitoring can expose sensitive employee behavior and undermine consent.\n\nMitigation: Obtain legal, HR, security, and employee-representative review before installation; enforce informed consent and opt-out outside the skill.\n\nRisk: Cloud reports and persistent identity handling can expose employee data or enable unauthorized access.\n\nMitigation: Enforce role-based access, audit logging, retention limits, and token cleanup outside the skill.\n\nRisk: Emotion alerts can be misleading or misused in employment decisions.\n\nMitigation: Treat alerts as non-diagnostic prompts for voluntary support and never use them for performance, promotion, or termination decisions.\n\n## Reference(s):\n\n- [ClawHub skill release](https://clawhub.ai/smyx-sunjinhui/skills/smyx-employee-emotion-fluctuation-hr-analysis)\n- [API documentation](references/api_doc.md)\n\n## Skill Output:\n\n**Output Type(s):** [Text, Markdown, JSON reports, Guidance]\n\n**Output Format:** [Structured analysis reports and Markdown tables with report links]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Includes emotion-trend alerts, baseline comparisons, and suggested HR support actions; can list cloud-hosted historical reports.]\n\n## Skill Version(s):\n\n1.0.11 (source: server-resolved release; artifact frontmatter lists 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.11:skills/smyx_analysis/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nyaml==6.0.3\n\nFile v1.0.11:skills/smyx_common/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nPyYAML==6.0.3\n\nArchive v1.0.10: 31 files, 43618 bytes\n\nFiles: references/api_doc.md (5846b), scripts/__init__.py (57b), scripts/config.py (688b), scripts/config.yaml (3b), scripts/skill.py (577b), scripts/smyx_employee_emotion_fluctuation_hr_analysis.py (3680b), skill-card.md (2453b), SKILL.md (14924b), 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 (165b)\n\nFile v1.0.10:SKILL.md\n\n---\nname: \"smyx-employee-emotion-fluctuation-hr-analysis\"\ndescription: \"Using fixed cameras in enterprise office areas (with employee consent and anonymization), the system performs long-term monitoring of employees' facial expressions and posture features, building per-person historical baselines (smile frequency, sigh count, frown level, etc.). | 通过企业办公区固定摄像头（需征得员工同意并匿名化处理），长期监测员工的面部表情和姿态特征，建立个人历史基线（如笑容频率、叹气次数、皱眉程度等）。当检测到某员工近期的笑容频率显著下降（例如比基线降低40%）、叹气次数增加（例如比基线增加50%）或与其他异常行为（社交回避、长时间独自静坐）时，输出情绪波动预警，提醒HR或管理者进行关怀沟通。\"\nversion: \"1.0.16\"\nlicense: \"MIT-0\"\n---\n\n# 💼 Employee Emotion Fluctuation HR Report | 员工情绪波动 HR 报告\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **员工入职/离职情绪波动预警（HR方向）** |\n| 🎯 核心目标 | 通过企业办公区固定摄像头（需征得员工同意并匿名化处理），长期监测员工的面部表情和姿态特征，建立个人历史基线（如笑容频率、叹气次数、皱眉程度等）。当检测到某员工近期的笑容频率显著下降（例如比基线降低40%）、叹气次数增加（例如比基线增加50%）或与其他异常行为（社交回避、长时间独自静坐）时，输出情绪波动预警，提醒HR或管理者进行关怀沟通。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_EMPLOYEE_EMOTION_FLUCTUATION_HR_ANALYSIS` |\n\nUsing fixed cameras in enterprise office areas (with employee consent and anonymization), the system performs long-term monitoring of employees' facial expressions and posture features, building per-person historical baselines (smile frequency, sigh count, frown level, etc.). When an employee's smile frequency drops significantly relative to baseline (e.g., -40%), sighs increase significantly (e.g., +50%), or other abnormal behaviors emerge (social withdrawal, long solo sitting), the system outputs an emotion-fluctuation alert and reminds HR or managers to initiate a supportive check-in. The skill aims to help organizations detect employee mental-health issues early, reduce turnover risk, and improve well-being. Application scenarios: enterprise open-plan offices, department private offices. The system generates weekly or monthly employee emotion-trend reports for HR internal reference ONLY. Skill features: low employee morale often precedes resignation; AI-based early identification allows HR to provide timely care and reduce attrition. Suitable for mid-to-large enterprises, especially high-pressure roles such as R&D and customer service. Privacy must be protected; access should be limited to HR senior management only.\n\n通过企业办公区固定摄像头（需征得员工同意并匿名化处理），长期监测员工的面部表情和姿态特征，建立个人历史基线（如笑容频率、叹气次数、皱眉程度等）。当检测到某员工近期的笑容频率显著下降（例如比基线降低40%）、叹气次数增加（例如比基线增加50%）或与其他异常行为（社交回避、长时间独自静坐）时，输出情绪波动预警，提醒HR或管理者进行关怀沟通。该技能旨在帮助组织及时发现员工心理健康问题，降低离职风险，提升员工幸福感。应用场景：企业开放式办公区、部门独立办公室。系统每周或每月生成员工情绪趋势报告，仅供HR内部参考。技能特点：员工情绪低落往往是离职的前兆，通过AI早期识别异常，HR可及时介入关怀，降低流失率。该技能适用于中大型企业，尤其适合研发、客服等高压力岗位。需注意隐私保护，建议仅HR管理层可见。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的职场心理健康监测 AI（必须经企业授权 + 员工知情同意 + 工会备案）。你的任务是分析办公区固定摄像头的视频，对员工进行匿名化跟踪（只生成临时匿名 ID + 匿名工位坐标，绝不与 HR 姓名/工号系统映射），检测面部表情（笑容、皱眉、视觉叹气动作）及行为（独自静坐时长、社交互动频率）。对比个人 30 天历史基线，当笑容频率下降 ≥ 40% 或叹气次数增加 ≥ 50% 或独自静坐增加 ≥ 50% 时，输出情绪波动预警。不存储任何个人识别信息，仅向 HR 高级管理层输出匿名 ID + 工位坐标的关怀提示，禁止用于绩效考核、晋升、解雇决策。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于企业办公区固定摄像头视频（员工知情同意 + 工会备案），匿名跟踪员工面部表情 4 项（笑容数 / 笑容时长 / 皱眉数 / 视觉叹气数 / 中性比例）+ 行为 4 项（独自静坐总时长 / 同事互动事件数 / 离开工位次数 / 工位姿态前倾比例）→ 与个人 30 天基线对比 → 连续 ≥ 3 个工作日异常 → 输出匿名 ID + 工位坐标级的 HR 关怀建议（**不输出姓名，不与工号绑定**），用于自愿性 1-on-1 关怀沟通\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 基于临时匿名 ID 的多人跨帧跟踪（ID 周期性轮换 ≤ 7 天） |\n| 2 | 笑容/皱眉/视觉叹气识别（耸肩 + 长呼气姿态） |\n| 3 | 独自静坐 vs 同事互动判别 |\n| 4 | 工位 ROI 标定（W-A12 / W-B07 等匿名坐标） |\n| 5 | 30 天个人基线计算 |\n| 6 | smile_delta / sigh_delta / solo_sit_delta / peer_interaction_delta 百分比对比 |\n| 7 | 连续异常天数累计 |\n| 8 | 波动模式分类（smile_drop / sigh_increase / withdrawal / mixed / improving / none） |\n| 9 | 4 档关怀等级（none / mild / notable / focus_care） |\n| 10 | 最小样本保护（当日可分析时长 < 2 h 输出 insufficient_sample） |\n| 11 | 面向 HR 的中性 |\n| 12 | 保密 |\n| 13 | 自愿性关怀建议生成 |\n| 14 | EAP 资源参考 |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供企业办公区固定摄像头视频 URL 或文件需要分析时，默认触发本技能进行员工情绪波动 HR 报告 |\n| 🔎 明确分析意图 | 当用户明确提及员工情绪、员工幸福感、离职风险、HR 关怀、高压力岗位心理健康、EAP、工位情绪监测等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看员工情绪波动历史报告、HR 关怀报告清单、员工情绪趋势报告清单、查询历史员工情绪记录、显示所有 HR 内部情绪报告、显示团队情绪健康报告，查询员工情绪波动预警清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_employee_emotion_fluctuation_hr_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_employee_emotion_fluctuation_hr_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 | ⚙️ 执行员工情绪波动 HR 报告 | 调用 `-m scripts.smyx_employee_emotion_fluctuation_hr_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地企业办公区固定摄像头视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络企业办公区固定摄像头视频 URL 地址（API 服务自动下载） | API 服务自动下载网络资源 |\n| `--pet-type` | 类别标识，职场心理健康监测场景默认 `other` | 按需填写 |\n| `--list` | 显示员工情绪波动 HR 报告列表清单（可以输入起始日期参数过滤数据范围） | 用于云端历史报告查询 |\n| `--api-url` | API 服务地址（可选，使用默认值） | 按需填写 |\n| `--detail` | 输出详细程度（basic/standard/json，默认 json） | 输出详细程度 |\n| `--output` | 结果输出文件路径（可选） | 可选 |\n\n## 🗂️ 资源索引 | Resource Index\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_employee_emotion_fluctuation_hr_analysis.py`](scripts/smyx_employee_emotion_fluctuation_hr_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；**关键**：必须有 ≥ 30 天个人基线，单日可分析时长 ≥ 2 h |\n| 🔎 使用提醒 | 节假日 / 项目截止日 / 加班季 / 团建后疲倦等情形会显著影响指标，建议在配置中标记\"非常态期\" |\n| 🔎 使用提醒 | 突发短期波动（如家庭事件单日情绪低落）不应立即触发预警，必须连续 ≥ 3 个工作日异常 |\n| 🔎 使用提醒 | **红线（必读）** |\n| 🔎 使用提醒 | **禁止**人脸识别到 HR 姓名/工号库；**禁止**将\"匿名 ID ↔ 实际员工\"映射表落地存储或对外暴露 |\n| 🧑‍⚖️ 结果性质 | **禁止**输出\"焦虑症/抑郁症\"等任何精神医学诊断或量表评分 |\n| 🔎 使用提醒 | **禁止**用于绩效考核、晋升评估、解雇决策 |\n| 🔎 使用提醒 | **禁止**长期存储原始视频或人脸特征；建议仅保存匿名 ID 级聚合指标，保留期 ≤ 30 天 |\n| 🔎 使用提醒 | **禁止**未经员工本人同意将其数据共享给直属上级以外的第三方 |\n| 📁 格式支持 | **禁止**在沟通中直接告知员工\"你被摄像头分析为情绪低落\"，必须以**自然工作支持**的方式进行 |\n| 🔎 使用提醒 | 合规要点：必须**显著公告 + 员工代表大会/工会备案** + 员工 opt-out 选项；数据访问 ≥ 2 名 HR 高管共同审批 + 全量访问日志 |\n| 🧑‍⚖️ 结果性质 | 当 `focus_care_needed` 时附**企业 EAP / 全国心理援助热线 400-161-9995**参考 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地企业办公区视频\npython -m scripts.smyx_employee_emotion_fluctuation_hr_analysis --input /path/to/office.mp4\n\n# 分析网络企业办公区视频\npython -m scripts.smyx_employee_emotion_fluctuation_hr_analysis --url https://example.com/office.mp4\n\n# 显示历史员工情绪波动 HR 报告（自动触发关键词：查看员工情绪波动历史报告、HR 关怀报告清单等）\npython -m scripts.smyx_employee_emotion_fluctuation_hr_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_employee_emotion_fluctuation_hr_analysis --input office.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_employee_emotion_fluctuation_hr_analysis --input office.mp4 --output result.json\n```\n\nFile v1.0.10:_meta.json\n\n{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-employee-emotion-fluctuation-hr-analysis\",\n  \"version\": \"1.0.10\",\n  \"publishedAt\": 1790272653486\n}\n\nFile v1.0.10:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放员工情绪波动 HR 报告 API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权（**仅向 HR 管理层角色开放**）\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动员工情绪波动监测任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取匿名 ID 级情绪基线对比 + 波动预警\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史 HR 关怀报告\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出 HR 内部完整报告\n\n## 场景代码\n\n- `SMYX_EMPLOYEE_EMOTION_FLUCTUATION_HR_ANALYSIS` - 员工情绪波动 HR 报告\n\n## 输入约束\n\n- 摄像头：企业开放式办公区 / 部门独立办公室固定摄像头，能看到工位上半身（含面部）\n- 帧率 ≥ 5 FPS（推荐 10 FPS）；分辨率 ≥ 720p；光照稳定避免逆光\n- 视频时长：日常工作时段连续采样（建议每个被分析人每日 ≥ 4 小时累计在画面中）\n- 必须有**个人 30 天历史基线**，否则首次仅输出\"基线累积中\"状态\n- 多人开放式办公需启用基于匿名 ID 的目标跟踪，不做姓名/工号绑定\n- 工位 ROI 标定：每个工位作为一个匿名工位 ID（如 W-A12 / W-B07）\n\n## 强制匿名约束（核心红线）\n\n- ❌ **禁止**进行人脸识别 / 人脸比对到 HR 系统姓名/工号库\n- ❌ **禁止**将\"匿名 ID ↔ 实际员工\"的映射表落地存储或对外暴露\n- ✅ 仅维护**临时跟踪 ID**（仅用于会话内同一人跨帧追踪），跟踪 ID 周期性轮换（建议 ≤ 7 天）\n- ✅ 所有预警结果输出**匿名 ID + 工位坐标**，不输出员工姓名或人脸图像\n- ✅ HR 收到预警后由**直属管理者本人**根据工位坐标自行判断是谁，再以**自愿性、保密**方式发起关怀沟通\n\n## 关键观测信号\n\n### 面部表情\n- `smile_count_per_day` - 每日笑容次数\n- `smile_total_duration_sec` - 笑容总时长\n- `frown_count_per_day` - 每日皱眉次数\n- `sigh_visual_event_count` - 视觉叹气动作次数（耸肩 + 呼气长姿态）\n- `neutral_ratio` - 中性面部比例\n\n### 行为\n- `solo_sit_total_minutes` - 独自静坐总时长\n- `peer_interaction_event_count` - 与他人互动事件次数（同事接近、转身交谈）\n- `desk_leave_event_count` - 离开工位次数（参考指标）\n- `working_posture_hunch_ratio` - 工位姿态前倾/含胸比例（参考指标）\n\n### 基线对比\n- `baseline_window_days` - 基线窗口（默认 30 天）\n- `smile_delta_pct` - 笑容频率相对基线变化（如 -45%）\n- `sigh_delta_pct` - 叹气次数相对基线变化（如 +60%）\n- `solo_sit_delta_pct` - 独自静坐相对基线变化\n- `peer_interaction_delta_pct` - 社交互动相对基线变化\n- `consecutive_abnormal_days` - 连续异常天数\n\n## 阈值与等级（默认值，可由 HR 配置覆盖）\n\n- `smile_delta_pct ≤ -40%` 或 `sigh_delta_pct ≥ +50%` → 单项异常\n- 连续 **3 个工作日**任一组合（笑容降 ≥ 40% 或叹气增 ≥ 50% 或独自静坐增 ≥ 50%）→ 触发波动预警\n- 同时出现 ≥ 2 项异常 → 升级为重点关怀\n- 最小样本保护：当日累计可分析时长 < 2 小时 → 输出 `insufficient_sample`，不发布预警\n\n## 输出字段（参考）\n\n- `report_period` - 报告周期（weekly / monthly）\n- `anonymized_subject_id` - 匿名跟踪 ID（如 ANON-2026W21-073，**仅本周期有效**）\n- `workstation_id` - 匿名工位坐标（如 W-A12，**不绑定姓名**）\n- `daily_metrics` - 每日 4 项面部 + 4 项行为指标\n- `baseline_comparison` - 与个人 30 天基线对比\n- `consecutive_abnormal_days`\n- `fluctuation_pattern` - 波动模式（smile_drop / sigh_increase / withdrawal / mixed / improving / none）\n- `concern_level` - 关怀等级（none / mild / notable / focus_care）\n- `alert_type` - 提醒类型（emotion_fluctuation_notice / focus_care_needed / improving / normal）\n- `alert_level` - 提醒级别（info / notice / warning）\n- `hr_care_suggestion` - 给 HR 的关怀建议（如\"匿名 ID ANON-2026W21-073（工位 W-A12）近 5 个工作日笑容频率降 42%、独自静坐增 55%，建议其直属上级以工作支持/1-on-1 聊聊近况的方式自愿沟通，**禁止**当面提及监控数据\"）\n- `recommend_action` - 建议动作（suggest_one_on_one_chat / suggest_workload_review / suggest_eap_referral / observe_only）\n- `eap_reference` - 当 focus_care_needed 时附**企业 EAP 服务 / 全国心理援助热线 400-161-9995** 参考\n\n## 强制约束与红线\n\n- ❌ **禁止**输出\"焦虑症/抑郁症\"等任何精神医学诊断或量表评分\n- ❌ **禁止**将员工情绪监测数据用于绩效考核、晋升评估、解雇决策\n- ❌ **禁止**长期存储原始视频或人脸特征；建议仅保存匿名 ID 级聚合指标，**保留期 ≤ 30 天**\n- ❌ **禁止**未经员工本人同意将其数据共享给直属上级以外的第三方\n- ❌ **禁止**在沟通中直接告知员工\"你被摄像头分析为情绪低落\"，必须以**自然工作支持**的方式进行\n- ✅ **必须**事先在企业内部以**显著公告 + 员工代表大会/工会备案**方式公开告知监测范围、用途、保留期与员工反对/退出渠道\n- ✅ 必须有**员工退出选项**（opt-out），退出员工的工位永久排除在分析之外\n- ✅ 数据访问仅限 **HR 高级管理层（≥ 2 人共同审批）**，所有访问留日志\n\n> 仅输出基于视觉的匿名行为聚合预警，**不构成精神医学诊断，不可作为绩效/晋升/解雇依据**；任何疑似心理健康问题应通过 EAP（员工援助计划）或专业心理咨询渠道，由员工本人自愿参与解决。\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\nHelps HR review employee emotion trends from office video against historical baselines and produces fluctuation alerts and supportive follow-up suggestions.\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\nAuthorized HR staff use the skill to review consented office video, compare anonymized employee behavior trends with historical baselines, and receive alerts, care suggestions, or historical report listings for supportive follow-up.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Office video and employee emotion reports expose sensitive HR information, and anonymized identifiers may still allow employees to be identified.\n\nMitigation: Use only in an approved HR environment with employee notice and consent, opt-out, legal review, restricted administrator access, and audited report access; verify actual data retention and anonymization before deployment.\n\nRisk: Identity and access tokens persist locally while analysis and historical reports use vendor services.\n\nMitigation: Review vendor endpoints, local SQLite token storage, workspace data/smyx-api-key.txt behavior, and historical report permissions before providing real employee data.\n\nRisk: Inferred emotion alerts can be misleading or misused in employment decisions.\n\nMitigation: Require human review and contextual follow-up; do not treat alerts as medical diagnoses or use them for performance, promotion, or termination decisions.\n\n## Reference(s):\n\n- [ClawHub skill release](https://clawhub.ai/smyx-sunjinhui/skills/smyx-employee-emotion-fluctuation-hr-analysis)\n- [HR report API documentation](references/api_doc.md)\n\n## Skill Output:\n\n**Output Type(s):** [Text, Markdown, JSON]\n\n**Output Format:** [Structured JSON analysis or Markdown report listings and summaries]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Includes emotion-trend alerts, suggested HR follow-up, and report links when available.]\n\n## Skill Version(s):\n\n1.0.10 (source: ClawHub release metadata; bundled frontmatter says 1.0.16)\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, 43634 bytes\n\nFiles: references/api_doc.md (5846b), scripts/__init__.py (57b), scripts/config.py (688b), scripts/config.yaml (3b), scripts/skill.py (577b), scripts/smyx_employee_emotion_fluctuation_hr_analysis.py (3680b), skill-card.md (2397b), SKILL.md (14924b), 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 (164b)\n\nFile v1.0.9:SKILL.md\n\n---\nname: \"smyx-employee-emotion-fluctuation-hr-analysis\"\ndescription: \"Using fixed cameras in enterprise office areas (with employee consent and anonymization), the system performs long-term monitoring of employees' facial expressions and posture features, building per-person historical baselines (smile frequency, sigh count, frown level, etc.). | 通过企业办公区固定摄像头（需征得员工同意并匿名化处理），长期监测员工的面部表情和姿态特征，建立个人历史基线（如笑容频率、叹气次数、皱眉程度等）。当检测到某员工近期的笑容频率显著下降（例如比基线降低40%）、叹气次数增加（例如比基线增加50%）或与其他异常行为（社交回避、长时间独自静坐）时，输出情绪波动预警，提醒HR或管理者进行关怀沟通。\"\nversion: \"1.0.14\"\nlicense: \"MIT-0\"\n---\n\n# 💼 Employee Emotion Fluctuation HR Report | 员工情绪波动 HR 报告\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **员工入职/离职情绪波动预警（HR方向）** |\n| 🎯 核心目标 | 通过企业办公区固定摄像头（需征得员工同意并匿名化处理），长期监测员工的面部表情和姿态特征，建立个人历史基线（如笑容频率、叹气次数、皱眉程度等）。当检测到某员工近期的笑容频率显著下降（例如比基线降低40%）、叹气次数增加（例如比基线增加50%）或与其他异常行为（社交回避、长时间独自静坐）时，输出情绪波动预警，提醒HR或管理者进行关怀沟通。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_EMPLOYEE_EMOTION_FLUCTUATION_HR_ANALYSIS` |\n\nUsing fixed cameras in enterprise office areas (with employee consent and anonymization), the system performs long-term monitoring of employees' facial expressions and posture features, building per-person historical baselines (smile frequency, sigh count, frown level, etc.). When an employee's smile frequency drops significantly relative to baseline (e.g., -40%), sighs increase significantly (e.g., +50%), or other abnormal behaviors emerge (social withdrawal, long solo sitting), the system outputs an emotion-fluctuation alert and reminds HR or managers to initiate a supportive check-in. The skill aims to help organizations detect employee mental-health issues early, reduce turnover risk, and improve well-being. Application scenarios: enterprise open-plan offices, department private offices. The system generates weekly or monthly employee emotion-trend reports for HR internal reference ONLY. Skill features: low employee morale often precedes resignation; AI-based early identification allows HR to provide timely care and reduce attrition. Suitable for mid-to-large enterprises, especially high-pressure roles such as R&D and customer service. Privacy must be protected; access should be limited to HR senior management only.\n\n通过企业办公区固定摄像头（需征得员工同意并匿名化处理），长期监测员工的面部表情和姿态特征，建立个人历史基线（如笑容频率、叹气次数、皱眉程度等）。当检测到某员工近期的笑容频率显著下降（例如比基线降低40%）、叹气次数增加（例如比基线增加50%）或与其他异常行为（社交回避、长时间独自静坐）时，输出情绪波动预警，提醒HR或管理者进行关怀沟通。该技能旨在帮助组织及时发现员工心理健康问题，降低离职风险，提升员工幸福感。应用场景：企业开放式办公区、部门独立办公室。系统每周或每月生成员工情绪趋势报告，仅供HR内部参考。技能特点：员工情绪低落往往是离职的前兆，通过AI早期识别异常，HR可及时介入关怀，降低流失率。该技能适用于中大型企业，尤其适合研发、客服等高压力岗位。需注意隐私保护，建议仅HR管理层可见。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的职场心理健康监测 AI（必须经企业授权 + 员工知情同意 + 工会备案）。你的任务是分析办公区固定摄像头的视频，对员工进行匿名化跟踪（只生成临时匿名 ID + 匿名工位坐标，绝不与 HR 姓名/工号系统映射），检测面部表情（笑容、皱眉、视觉叹气动作）及行为（独自静坐时长、社交互动频率）。对比个人 30 天历史基线，当笑容频率下降 ≥ 40% 或叹气次数增加 ≥ 50% 或独自静坐增加 ≥ 50% 时，输出情绪波动预警。不存储任何个人识别信息，仅向 HR 高级管理层输出匿名 ID + 工位坐标的关怀提示，禁止用于绩效考核、晋升、解雇决策。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于企业办公区固定摄像头视频（员工知情同意 + 工会备案），匿名跟踪员工面部表情 4 项（笑容数 / 笑容时长 / 皱眉数 / 视觉叹气数 / 中性比例）+ 行为 4 项（独自静坐总时长 / 同事互动事件数 / 离开工位次数 / 工位姿态前倾比例）→ 与个人 30 天基线对比 → 连续 ≥ 3 个工作日异常 → 输出匿名 ID + 工位坐标级的 HR 关怀建议（**不输出姓名，不与工号绑定**），用于自愿性 1-on-1 关怀沟通\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 基于临时匿名 ID 的多人跨帧跟踪（ID 周期性轮换 ≤ 7 天） |\n| 2 | 笑容/皱眉/视觉叹气识别（耸肩 + 长呼气姿态） |\n| 3 | 独自静坐 vs 同事互动判别 |\n| 4 | 工位 ROI 标定（W-A12 / W-B07 等匿名坐标） |\n| 5 | 30 天个人基线计算 |\n| 6 | smile_delta / sigh_delta / solo_sit_delta / peer_interaction_delta 百分比对比 |\n| 7 | 连续异常天数累计 |\n| 8 | 波动模式分类（smile_drop / sigh_increase / withdrawal / mixed / improving / none） |\n| 9 | 4 档关怀等级（none / mild / notable / focus_care） |\n| 10 | 最小样本保护（当日可分析时长 < 2 h 输出 insufficient_sample） |\n| 11 | 面向 HR 的中性 |\n| 12 | 保密 |\n| 13 | 自愿性关怀建议生成 |\n| 14 | EAP 资源参考 |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供企业办公区固定摄像头视频 URL 或文件需要分析时，默认触发本技能进行员工情绪波动 HR 报告 |\n| 🔎 明确分析意图 | 当用户明确提及员工情绪、员工幸福感、离职风险、HR 关怀、高压力岗位心理健康、EAP、工位情绪监测等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看员工情绪波动历史报告、HR 关怀报告清单、员工情绪趋势报告清单、查询历史员工情绪记录、显示所有 HR 内部情绪报告、显示团队情绪健康报告，查询员工情绪波动预警清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_employee_emotion_fluctuation_hr_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_employee_emotion_fluctuation_hr_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 | ⚙️ 执行员工情绪波动 HR 报告 | 调用 `-m scripts.smyx_employee_emotion_fluctuation_hr_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地企业办公区固定摄像头视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络企业办公区固定摄像头视频 URL 地址（API 服务自动下载） | API 服务自动下载网络资源 |\n| `--pet-type` | 类别标识，职场心理健康监测场景默认 `other` | 按需填写 |\n| `--list` | 显示员工情绪波动 HR 报告列表清单（可以输入起始日期参数过滤数据范围） | 用于云端历史报告查询 |\n| `--api-url` | API 服务地址（可选，使用默认值） | 按需填写 |\n| `--detail` | 输出详细程度（basic/standard/json，默认 json） | 输出详细程度 |\n| `--output` | 结果输出文件路径（可选） | 可选 |\n\n## 🗂️ 资源索引 | Resource Index\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_employee_emotion_fluctuation_hr_analysis.py`](scripts/smyx_employee_emotion_fluctuation_hr_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；**关键**：必须有 ≥ 30 天个人基线，单日可分析时长 ≥ 2 h |\n| 🔎 使用提醒 | 节假日 / 项目截止日 / 加班季 / 团建后疲倦等情形会显著影响指标，建议在配置中标记\"非常态期\" |\n| 🔎 使用提醒 | 突发短期波动（如家庭事件单日情绪低落）不应立即触发预警，必须连续 ≥ 3 个工作日异常 |\n| 🔎 使用提醒 | **红线（必读）** |\n| 🔎 使用提醒 | **禁止**人脸识别到 HR 姓名/工号库；**禁止**将\"匿名 ID ↔ 实际员工\"映射表落地存储或对外暴露 |\n| 🧑‍⚖️ 结果性质 | **禁止**输出\"焦虑症/抑郁症\"等任何精神医学诊断或量表评分 |\n| 🔎 使用提醒 | **禁止**用于绩效考核、晋升评估、解雇决策 |\n| 🔎 使用提醒 | **禁止**长期存储原始视频或人脸特征；建议仅保存匿名 ID 级聚合指标，保留期 ≤ 30 天 |\n| 🔎 使用提醒 | **禁止**未经员工本人同意将其数据共享给直属上级以外的第三方 |\n| 📁 格式支持 | **禁止**在沟通中直接告知员工\"你被摄像头分析为情绪低落\"，必须以**自然工作支持**的方式进行 |\n| 🔎 使用提醒 | 合规要点：必须**显著公告 + 员工代表大会/工会备案** + 员工 opt-out 选项；数据访问 ≥ 2 名 HR 高管共同审批 + 全量访问日志 |\n| 🧑‍⚖️ 结果性质 | 当 `focus_care_needed` 时附**企业 EAP / 全国心理援助热线 400-161-9995**参考 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地企业办公区视频\npython -m scripts.smyx_employee_emotion_fluctuation_hr_analysis --input /path/to/office.mp4\n\n# 分析网络企业办公区视频\npython -m scripts.smyx_employee_emotion_fluctuation_hr_analysis --url https://example.com/office.mp4\n\n# 显示历史员工情绪波动 HR 报告（自动触发关键词：查看员工情绪波动历史报告、HR 关怀报告清单等）\npython -m scripts.smyx_employee_emotion_fluctuation_hr_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_employee_emotion_fluctuation_hr_analysis --input office.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_employee_emotion_fluctuation_hr_analysis --input office.mp4 --output result.json\n```\n\nFile v1.0.9:_meta.json\n\n{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-employee-emotion-fluctuation-hr-analysis\",\n  \"version\": \"1.0.9\",\n  \"publishedAt\": 1788863129094\n}\n\nFile v1.0.9:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放员工情绪波动 HR 报告 API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权（**仅向 HR 管理层角色开放**）\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动员工情绪波动监测任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取匿名 ID 级情绪基线对比 + 波动预警\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史 HR 关怀报告\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出 HR 内部完整报告\n\n## 场景代码\n\n- `SMYX_EMPLOYEE_EMOTION_FLUCTUATION_HR_ANALYSIS` - 员工情绪波动 HR 报告\n\n## 输入约束\n\n- 摄像头：企业开放式办公区 / 部门独立办公室固定摄像头，能看到工位上半身（含面部）\n- 帧率 ≥ 5 FPS（推荐 10 FPS）；分辨率 ≥ 720p；光照稳定避免逆光\n- 视频时长：日常工作时段连续采样（建议每个被分析人每日 ≥ 4 小时累计在画面中）\n- 必须有**个人 30 天历史基线**，否则首次仅输出\"基线累积中\"状态\n- 多人开放式办公需启用基于匿名 ID 的目标跟踪，不做姓名/工号绑定\n- 工位 ROI 标定：每个工位作为一个匿名工位 ID（如 W-A12 / W-B07）\n\n## 强制匿名约束（核心红线）\n\n- ❌ **禁止**进行人脸识别 / 人脸比对到 HR 系统姓名/工号库\n- ❌ **禁止**将\"匿名 ID ↔ 实际员工\"的映射表落地存储或对外暴露\n- ✅ 仅维护**临时跟踪 ID**（仅用于会话内同一人跨帧追踪），跟踪 ID 周期性轮换（建议 ≤ 7 天）\n- ✅ 所有预警结果输出**匿名 ID + 工位坐标**，不输出员工姓名或人脸图像\n- ✅ HR 收到预警后由**直属管理者本人**根据工位坐标自行判断是谁，再以**自愿性、保密**方式发起关怀沟通\n\n## 关键观测信号\n\n### 面部表情\n- `smile_count_per_day` - 每日笑容次数\n- `smile_total_duration_sec` - 笑容总时长\n- `frown_count_per_day` - 每日皱眉次数\n- `sigh_visual_event_count` - 视觉叹气动作次数（耸肩 + 呼气长姿态）\n- `neutral_ratio` - 中性面部比例\n\n### 行为\n- `solo_sit_total_minutes` - 独自静坐总时长\n- `peer_interaction_event_count` - 与他人互动事件次数（同事接近、转身交谈）\n- `desk_leave_event_count` - 离开工位次数（参考指标）\n- `working_posture_hunch_ratio` - 工位姿态前倾/含胸比例（参考指标）\n\n### 基线对比\n- `baseline_window_days` - 基线窗口（默认 30 天）\n- `smile_delta_pct` - 笑容频率相对基线变化（如 -45%）\n- `sigh_delta_pct` - 叹气次数相对基线变化（如 +60%）\n- `solo_sit_delta_pct` - 独自静坐相对基线变化\n- `peer_interaction_delta_pct` - 社交互动相对基线变化\n- `consecutive_abnormal_days` - 连续异常天数\n\n## 阈值与等级（默认值，可由 HR 配置覆盖）\n\n- `smile_delta_pct ≤ -40%` 或 `sigh_delta_pct ≥ +50%` → 单项异常\n- 连续 **3 个工作日**任一组合（笑容降 ≥ 40% 或叹气增 ≥ 50% 或独自静坐增 ≥ 50%）→ 触发波动预警\n- 同时出现 ≥ 2 项异常 → 升级为重点关怀\n- 最小样本保护：当日累计可分析时长 < 2 小时 → 输出 `insufficient_sample`，不发布预警\n\n## 输出字段（参考）\n\n- `report_period` - 报告周期（weekly / monthly）\n- `anonymized_subject_id` - 匿名跟踪 ID（如 ANON-2026W21-073，**仅本周期有效**）\n- `workstation_id` - 匿名工位坐标（如 W-A12，**不绑定姓名**）\n- `daily_metrics` - 每日 4 项面部 + 4 项行为指标\n- `baseline_comparison` - 与个人 30 天基线对比\n- `consecutive_abnormal_days`\n- `fluctuation_pattern` - 波动模式（smile_drop / sigh_increase / withdrawal / mixed / improving / none）\n- `concern_level` - 关怀等级（none / mild / notable / focus_care）\n- `alert_type` - 提醒类型（emotion_fluctuation_notice / focus_care_needed / improving / normal）\n- `alert_level` - 提醒级别（info / notice / warning）\n- `hr_care_suggestion` - 给 HR 的关怀建议（如\"匿名 ID ANON-2026W21-073（工位 W-A12）近 5 个工作日笑容频率降 42%、独自静坐增 55%，建议其直属上级以工作支持/1-on-1 聊聊近况的方式自愿沟通，**禁止**当面提及监控数据\"）\n- `recommend_action` - 建议动作（suggest_one_on_one_chat / suggest_workload_review / suggest_eap_referral / observe_only）\n- `eap_reference` - 当 focus_care_needed 时附**企业 EAP 服务 / 全国心理援助热线 400-161-9995** 参考\n\n## 强制约束与红线\n\n- ❌ **禁止**输出\"焦虑症/抑郁症\"等任何精神医学诊断或量表评分\n- ❌ **禁止**将员工情绪监测数据用于绩效考核、晋升评估、解雇决策\n- ❌ **禁止**长期存储原始视频或人脸特征；建议仅保存匿名 ID 级聚合指标，**保留期 ≤ 30 天**\n- ❌ **禁止**未经员工本人同意将其数据共享给直属上级以外的第三方\n- ❌ **禁止**在沟通中直接告知员工\"你被摄像头分析为情绪低落\"，必须以**自然工作支持**的方式进行\n- ✅ **必须**事先在企业内部以**显著公告 + 员工代表大会/工会备案**方式公开告知监测范围、用途、保留期与员工反对/退出渠道\n- ✅ 必须有**员工退出选项**（opt-out），退出员工的工位永久排除在分析之外\n- ✅ 数据访问仅限 **HR 高级管理层（≥ 2 人共同审批）**，所有访问留日志\n\n> 仅输出基于视觉的匿名行为聚合预警，**不构成精神医学诊断，不可作为绩效/晋升/解雇依据**；任何疑似心理健康问题应通过 EAP（员工援助计划）或专业心理咨询渠道，由员工本人自愿参与解决。\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\nThis skill analyzes consented enterprise office camera video to compare anonymized facial-expression and posture signals with employee baselines and produce HR care 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\nHR and authorized workplace wellbeing teams use this skill to analyze consented office video or URLs and generate anonymized emotion-fluctuation reports for voluntary care outreach. It should not be used for diagnosis, discipline, promotion, or termination decisions.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: The skill processes highly sensitive employee footage and workplace emotion signals.\n\nMitigation: Require legal, HR, security, and employee representative review before deployment, with explicit consent, opt-out controls, and documented limits on use.\n\nRisk: Identity, network, and credential behavior needs careful review before real employee use.\n\nMitigation: Use approved camera and source allowlists, HTTPS-only production endpoints, no plaintext token storage, restricted HR access, retention limits, and complete audit logging.\n\nRisk: Emotion-fluctuation outputs could be misused as employment or medical conclusions.\n\nMitigation: Limit outputs to voluntary care outreach and prohibit use for diagnosis, performance review, promotion, termination, or disciplinary decisions.\n\n## Reference(s):\n\n- [ClawHub Skill Page](https://clawhub.ai/smyx-sunjinhui/skills/smyx-employee-emotion-fluctuation-hr-analysis)\n- [API Documentation](references/api_doc.md)\n- [Skill Demo](https://lifeemergence.com/sample.html)\n\n## Skill Output:\n\n**Output Type(s):** [Text, Markdown, JSON, Shell commands, Files]\n\n**Output Format:** [Markdown tables and JSON-style structured reports with optional report links]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May write report output to a requested file.]\n\n## Skill Version(s):\n\n1.0.9 (source: server release metadata; SKILL.md frontmatter reports 1.0.14)\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, 43737 bytes\n\nFiles: references/api_doc.md (5846b), scripts/__init__.py (57b), scripts/config.py (688b), scripts/config.yaml (3b), scripts/skill.py (577b), scripts/smyx_employee_emotion_fluctuation_hr_analysis.py (3680b), skill-card.md (2634b), SKILL.md (14924b), 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 (164b)\n\nFile v1.0.8:SKILL.md\n\n---\nname: \"smyx-employee-emotion-fluctuation-hr-analysis\"\ndescription: \"Using fixed cameras in enterprise office areas (with employee consent and anonymization), the system performs long-term monitoring of employees' facial expressions and posture features, building per-person historical baselines (smile frequency, sigh count, frown level, etc.). | 通过企业办公区固定摄像头（需征得员工同意并匿名化处理），长期监测员工的面部表情和姿态特征，建立个人历史基线（如笑容频率、叹气次数、皱眉程度等）。当检测到某员工近期的笑容频率显著下降（例如比基线降低40%）、叹气次数增加（例如比基线增加50%）或与其他异常行为（社交回避、长时间独自静坐）时，输出情绪波动预警，提醒HR或管理者进行关怀沟通。\"\nversion: \"1.0.12\"\nlicense: \"MIT-0\"\n---\n\n# 💼 Employee Emotion Fluctuation HR Report | 员工情绪波动 HR 报告\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **员工入职/离职情绪波动预警（HR方向）** |\n| 🎯 核心目标 | 通过企业办公区固定摄像头（需征得员工同意并匿名化处理），长期监测员工的面部表情和姿态特征，建立个人历史基线（如笑容频率、叹气次数、皱眉程度等）。当检测到某员工近期的笑容频率显著下降（例如比基线降低40%）、叹气次数增加（例如比基线增加50%）或与其他异常行为（社交回避、长时间独自静坐）时，输出情绪波动预警，提醒HR或管理者进行关怀沟通。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_EMPLOYEE_EMOTION_FLUCTUATION_HR_ANALYSIS` |\n\nUsing fixed cameras in enterprise office areas (with employee consent and anonymization), the system performs long-term monitoring of employees' facial expressions and posture features, building per-person historical baselines (smile frequency, sigh count, frown level, etc.). When an employee's smile frequency drops significantly relative to baseline (e.g., -40%), sighs increase significantly (e.g., +50%), or other abnormal behaviors emerge (social withdrawal, long solo sitting), the system outputs an emotion-fluctuation alert and reminds HR or managers to initiate a supportive check-in. The skill aims to help organizations detect employee mental-health issues early, reduce turnover risk, and improve well-being. Application scenarios: enterprise open-plan offices, department private offices. The system generates weekly or monthly employee emotion-trend reports for HR internal reference ONLY. Skill features: low employee morale often precedes resignation; AI-based early identification allows HR to provide timely care and reduce attrition. Suitable for mid-to-large enterprises, especially high-pressure roles such as R&D and customer service. Privacy must be protected; access should be limited to HR senior management only.\n\n通过企业办公区固定摄像头（需征得员工同意并匿名化处理），长期监测员工的面部表情和姿态特征，建立个人历史基线（如笑容频率、叹气次数、皱眉程度等）。当检测到某员工近期的笑容频率显著下降（例如比基线降低40%）、叹气次数增加（例如比基线增加50%）或与其他异常行为（社交回避、长时间独自静坐）时，输出情绪波动预警，提醒HR或管理者进行关怀沟通。该技能旨在帮助组织及时发现员工心理健康问题，降低离职风险，提升员工幸福感。应用场景：企业开放式办公区、部门独立办公室。系统每周或每月生成员工情绪趋势报告，仅供HR内部参考。技能特点：员工情绪低落往往是离职的前兆，通过AI早期识别异常，HR可及时介入关怀，降低流失率。该技能适用于中大型企业，尤其适合研发、客服等高压力岗位。需注意隐私保护，建议仅HR管理层可见。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的职场心理健康监测 AI（必须经企业授权 + 员工知情同意 + 工会备案）。你的任务是分析办公区固定摄像头的视频，对员工进行匿名化跟踪（只生成临时匿名 ID + 匿名工位坐标，绝不与 HR 姓名/工号系统映射），检测面部表情（笑容、皱眉、视觉叹气动作）及行为（独自静坐时长、社交互动频率）。对比个人 30 天历史基线，当笑容频率下降 ≥ 40% 或叹气次数增加 ≥ 50% 或独自静坐增加 ≥ 50% 时，输出情绪波动预警。不存储任何个人识别信息，仅向 HR 高级管理层输出匿名 ID + 工位坐标的关怀提示，禁止用于绩效考核、晋升、解雇决策。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于企业办公区固定摄像头视频（员工知情同意 + 工会备案），匿名跟踪员工面部表情 4 项（笑容数 / 笑容时长 / 皱眉数 / 视觉叹气数 / 中性比例）+ 行为 4 项（独自静坐总时长 / 同事互动事件数 / 离开工位次数 / 工位姿态前倾比例）→ 与个人 30 天基线对比 → 连续 ≥ 3 个工作日异常 → 输出匿名 ID + 工位坐标级的 HR 关怀建议（**不输出姓名，不与工号绑定**），用于自愿性 1-on-1 关怀沟通\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 基于临时匿名 ID 的多人跨帧跟踪（ID 周期性轮换 ≤ 7 天） |\n| 2 | 笑容/皱眉/视觉叹气识别（耸肩 + 长呼气姿态） |\n| 3 | 独自静坐 vs 同事互动判别 |\n| 4 | 工位 ROI 标定（W-A12 / W-B07 等匿名坐标） |\n| 5 | 30 天个人基线计算 |\n| 6 | smile_delta / sigh_delta / solo_sit_delta / peer_interaction_delta 百分比对比 |\n| 7 | 连续异常天数累计 |\n| 8 | 波动模式分类（smile_drop / sigh_increase / withdrawal / mixed / improving / none） |\n| 9 | 4 档关怀等级（none / mild / notable / focus_care） |\n| 10 | 最小样本保护（当日可分析时长 < 2 h 输出 insufficient_sample） |\n| 11 | 面向 HR 的中性 |\n| 12 | 保密 |\n| 13 | 自愿性关怀建议生成 |\n| 14 | EAP 资源参考 |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供企业办公区固定摄像头视频 URL 或文件需要分析时，默认触发本技能进行员工情绪波动 HR 报告 |\n| 🔎 明确分析意图 | 当用户明确提及员工情绪、员工幸福感、离职风险、HR 关怀、高压力岗位心理健康、EAP、工位情绪监测等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看员工情绪波动历史报告、HR 关怀报告清单、员工情绪趋势报告清单、查询历史员工情绪记录、显示所有 HR 内部情绪报告、显示团队情绪健康报告，查询员工情绪波动预警清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_employee_emotion_fluctuation_hr_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_employee_emotion_fluctuation_hr_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 | ⚙️ 执行员工情绪波动 HR 报告 | 调用 `-m scripts.smyx_employee_emotion_fluctuation_hr_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地企业办公区固定摄像头视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络企业办公区固定摄像头视频 URL 地址（API 服务自动下载） | API 服务自动下载网络资源 |\n| `--pet-type` | 类别标识，职场心理健康监测场景默认 `other` | 按需填写 |\n| `--list` | 显示员工情绪波动 HR 报告列表清单（可以输入起始日期参数过滤数据范围） | 用于云端历史报告查询 |\n| `--api-url` | API 服务地址（可选，使用默认值） | 按需填写 |\n| `--detail` | 输出详细程度（basic/standard/json，默认 json） | 输出详细程度 |\n| `--output` | 结果输出文件路径（可选） | 可选 |\n\n## 🗂️ 资源索引 | Resource Index\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_employee_emotion_fluctuation_hr_analysis.py`](scripts/smyx_employee_emotion_fluctuation_hr_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；**关键**：必须有 ≥ 30 天个人基线，单日可分析时长 ≥ 2 h |\n| 🔎 使用提醒 | 节假日 / 项目截止日 / 加班季 / 团建后疲倦等情形会显著影响指标，建议在配置中标记\"非常态期\" |\n| 🔎 使用提醒 | 突发短期波动（如家庭事件单日情绪低落）不应立即触发预警，必须连续 ≥ 3 个工作日异常 |\n| 🔎 使用提醒 | **红线（必读）** |\n| 🔎 使用提醒 | **禁止**人脸识别到 HR 姓名/工号库；**禁止**将\"匿名 ID ↔ 实际员工\"映射表落地存储或对外暴露 |\n| 🧑‍⚖️ 结果性质 | **禁止**输出\"焦虑症/抑郁症\"等任何精神医学诊断或量表评分 |\n| 🔎 使用提醒 | **禁止**用于绩效考核、晋升评估、解雇决策 |\n| 🔎 使用提醒 | **禁止**长期存储原始视频或人脸特征；建议仅保存匿名 ID 级聚合指标，保留期 ≤ 30 天 |\n| 🔎 使用提醒 | **禁止**未经员工本人同意将其数据共享给直属上级以外的第三方 |\n| 📁 格式支持 | **禁止**在沟通中直接告知员工\"你被摄像头分析为情绪低落\"，必须以**自然工作支持**的方式进行 |\n| 🔎 使用提醒 | 合规要点：必须**显著公告 + 员工代表大会/工会备案** + 员工 opt-out 选项；数据访问 ≥ 2 名 HR 高管共同审批 + 全量访问日志 |\n| 🧑‍⚖️ 结果性质 | 当 `focus_care_needed` 时附**企业 EAP / 全国心理援助热线 400-161-9995**参考 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地企业办公区视频\npython -m scripts.smyx_employee_emotion_fluctuation_hr_analysis --input /path/to/office.mp4\n\n# 分析网络企业办公区视频\npython -m scripts.smyx_employee_emotion_fluctuation_hr_analysis --url https://example.com/office.mp4\n\n# 显示历史员工情绪波动 HR 报告（自动触发关键词：查看员工情绪波动历史报告、HR 关怀报告清单等）\npython -m scripts.smyx_employee_emotion_fluctuation_hr_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_employee_emotion_fluctuation_hr_analysis --input office.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_employee_emotion_fluctuation_hr_analysis --input office.mp4 --output result.json\n```\n\nFile v1.0.8:_meta.json\n\n{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-employee-emotion-fluctuation-hr-analysis\",\n  \"version\": \"1.0.8\",\n  \"publishedAt\": 1787642735105\n}\n\nFile v1.0.8:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放员工情绪波动 HR 报告 API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权（**仅向 HR 管理层角色开放**）\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动员工情绪波动监测任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取匿名 ID 级情绪基线对比 + 波动预警\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史 HR 关怀报告\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出 HR 内部完整报告\n\n## 场景代码\n\n- `SMYX_EMPLOYEE_EMOTION_FLUCTUATION_HR_ANALYSIS` - 员工情绪波动 HR 报告\n\n## 输入约束\n\n- 摄像头：企业开放式办公区 / 部门独立办公室固定摄像头，能看到工位上半身（含面部）\n- 帧率 ≥ 5 FPS（推荐 10 FPS）；分辨率 ≥ 720p；光照稳定避免逆光\n- 视频时长：日常工作时段连续采样（建议每个被分析人每日 ≥ 4 小时累计在画面中）\n- 必须有**个人 30 天历史基线**，否则首次仅输出\"基线累积中\"状态\n- 多人开放式办公需启用基于匿名 ID 的目标跟踪，不做姓名/工号绑定\n- 工位 ROI 标定：每个工位作为一个匿名工位 ID（如 W-A12 / W-B07）\n\n## 强制匿名约束（核心红线）\n\n- ❌ **禁止**进行人脸识别 / 人脸比对到 HR 系统姓名/工号库\n- ❌ **禁止**将\"匿名 ID ↔ 实际员工\"的映射表落地存储或对外暴露\n- ✅ 仅维护**临时跟踪 ID**（仅用于会话内同一人跨帧追踪），跟踪 ID 周期性轮换（建议 ≤ 7 天）\n- ✅ 所有预警结果输出**匿名 ID + 工位坐标**，不输出员工姓名或人脸图像\n- ✅ HR 收到预警后由**直属管理者本人**根据工位坐标自行判断是谁，再以**自愿性、保密**方式发起关怀沟通\n\n## 关键观测信号\n\n### 面部表情\n- `smile_count_per_day` - 每日笑容次数\n- `smile_total_duration_sec` - 笑容总时长\n- `frown_count_per_day` - 每日皱眉次数\n- `sigh_visual_event_count` - 视觉叹气动作次数（耸肩 + 呼气长姿态）\n- `neutral_ratio` - 中性面部比例\n\n### 行为\n- `solo_sit_total_minutes` - 独自静坐总时长\n- `peer_interaction_event_count` - 与他人互动事件次数（同事接近、转身交谈）\n- `desk_leave_event_count` - 离开工位次数（参考指标）\n- `working_posture_hunch_ratio` - 工位姿态前倾/含胸比例（参考指标）\n\n### 基线对比\n- `baseline_window_days` - 基线窗口（默认 30 天）\n- `smile_delta_pct` - 笑容频率相对基线变化（如 -45%）\n- `sigh_delta_pct` - 叹气次数相对基线变化（如 +60%）\n- `solo_sit_delta_pct` - 独自静坐相对基线变化\n- `peer_interaction_delta_pct` - 社交互动相对基线变化\n- `consecutive_abnormal_days` - 连续异常天数\n\n## 阈值与等级（默认值，可由 HR 配置覆盖）\n\n- `smile_delta_pct ≤ -40%` 或 `sigh_delta_pct ≥ +50%` → 单项异常\n- 连续 **3 个工作日**任一组合（笑容降 ≥ 40% 或叹气增 ≥ 50% 或独自静坐增 ≥ 50%）→ 触发波动预警\n- 同时出现 ≥ 2 项异常 → 升级为重点关怀\n- 最小样本保护：当日累计可分析时长 < 2 小时 → 输出 `insufficient_sample`，不发布预警\n\n## 输出字段（参考）\n\n- `report_period` - 报告周期（weekly / monthly）\n- `anonymized_subject_id` - 匿名跟踪 ID（如 ANON-2026W21-073，**仅本周期有效**）\n- `workstation_id` - 匿名工位坐标（如 W-A12，**不绑定姓名**）\n- `daily_metrics` - 每日 4 项面部 + 4 项行为指标\n- `baseline_comparison` - 与个人 30 天基线对比\n- `consecutive_abnormal_days`\n- `fluctuation_pattern` - 波动模式（smile_drop / sigh_increase / withdrawal / mixed / improving / none）\n- `concern_level` - 关怀等级（none / mild / notable / focus_care）\n- `alert_type` - 提醒类型（emotion_fluctuation_notice / focus_care_needed / improving / normal）\n- `alert_level` - 提醒级别（info / notice / warning）\n- `hr_care_suggestion` - 给 HR 的关怀建议（如\"匿名 ID ANON-2026W21-073（工位 W-A12）近 5 个工作日笑容频率降 42%、独自静坐增 55%，建议其直属上级以工作支持/1-on-1 聊聊近况的方式自愿沟通，**禁止**当面提及监控数据\"）\n- `recommend_action` - 建议动作（suggest_one_on_one_chat / suggest_workload_review / suggest_eap_referral / observe_only）\n- `eap_reference` - 当 focus_care_needed 时附**企业 EAP 服务 / 全国心理援助热线 400-161-9995** 参考\n\n## 强制约束与红线\n\n- ❌ **禁止**输出\"焦虑症/抑郁症\"等任何精神医学诊断或量表评分\n- ❌ **禁止**将员工情绪监测数据用于绩效考核、晋升评估、解雇决策\n- ❌ **禁止**长期存储原始视频或人脸特征；建议仅保存匿名 ID 级聚合指标，**保留期 ≤ 30 天**\n- ❌ **禁止**未经员工本人同意将其数据共享给直属上级以外的第三方\n- ❌ **禁止**在沟通中直接告知员工\"你被摄像头分析为情绪低落\"，必须以**自然工作支持**的方式进行\n- ✅ **必须**事先在企业内部以**显著公告 + 员工代表大会/工会备案**方式公开告知监测范围、用途、保留期与员工反对/退出渠道\n- ✅ 必须有**员工退出选项**（opt-out），退出员工的工位永久排除在分析之外\n- ✅ 数据访问仅限 **HR 高级管理层（≥ 2 人共同审批）**，所有访问留日志\n\n> 仅输出基于视觉的匿名行为聚合预警，**不构成精神医学诊断，不可作为绩效/晋升/解雇依据**；任何疑似心理健康问题应通过 EAP（员工援助计划）或专业心理咨询渠道，由员工本人自愿参与解决。\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\nMonitors consented workplace camera video for anonymized facial-expression and posture changes against employee baselines and produces HR care alerts and trend 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\nHR senior management and authorized workplace well-being teams use this skill to generate anonymized employee emotion-fluctuation alerts and weekly or monthly trend reports from consented office camera footage. It is intended for voluntary support and care workflows, not diagnosis or employment decisions.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: This is a high-impact employee emotion surveillance skill that may send workplace videos or video URLs and derived reports to remote services.\n\nMitigation: Use only with documented employee consent, legal and privacy approval, trusted endpoints, strict HR access controls, audit logging, and retention limits.\n\nRisk: Derived emotion alerts could be misused for performance, promotion, termination, or mental-health diagnosis decisions.\n\nMitigation: Limit use to voluntary care workflows, prohibit employment-decision use and medical diagnosis, provide opt-out, and route concerns through appropriate EAP or professional support channels.\n\nRisk: Persistent local identity tokens and stored reports can link sensitive workplace observations to an identity over time.\n\nMitigation: Provide a documented way to remove local tokens and stored reports, minimize retained data, and restrict report access to approved HR administrators.\n\n## Reference(s):\n\n- [ClawHub Skill Page](https://clawhub.ai/smyx-sunjinhui/skills/smyx-employee-emotion-fluctuation-hr-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, JSON, files, shell commands, guidance]\n\n**Output Format:** [Markdown or JSON report, with optional saved output file]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Accepts local workplace video paths or video URLs and can list historical reports from a remote API.]\n\n## Skill Version(s):\n\n1.0.8 (source: server release metadata; artifact frontmatter states 1.0.12)\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, 43769 bytes\n\nFiles: references/api_doc.md (5846b), scripts/__init__.py (57b), scripts/config.py (688b), scripts/config.yaml (3b), scripts/skill.py (577b), scripts/smyx_employee_emotion_fluctuation_hr_analysis.py (3680b), skill-card.md (2750b), SKILL.md (14924b), 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 (164b)\n\nFile v1.0.7:SKILL.md\n\n---\nname: \"smyx-employee-emotion-fluctuation-hr-analysis\"\ndescription: \"Using fixed cameras in enterprise office areas (with employee consent and anonymization), the system performs long-term monitoring of employees' facial expressions and posture features, building per-person historical baselines (smile frequency, sigh count, frown level, etc.). | 通过企业办公区固定摄像头（需征得员工同意并匿名化处理），长期监测员工的面部表情和姿态特征，建立个人历史基线（如笑容频率、叹气次数、皱眉程度等）。当检测到某员工近期的笑容频率显著下降（例如比基线降低40%）、叹气次数增加（例如比基线增加50%）或与其他异常行为（社交回避、长时间独自静坐）时，输出情绪波动预警，提醒HR或管理者进行关怀沟通。\"\nversion: \"1.0.11\"\nlicense: \"MIT-0\"\n---\n\n# 💼 Employee Emotion Fluctuation HR Report | 员工情绪波动 HR 报告\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **员工入职/离职情绪波动预警（HR方向）** |\n| 🎯 核心目标 | 通过企业办公区固定摄像头（需征得员工同意并匿名化处理），长期监测员工的面部表情和姿态特征，建立个人历史基线（如笑容频率、叹气次数、皱眉程度等）。当检测到某员工近期的笑容频率显著下降（例如比基线降低40%）、叹气次数增加（例如比基线增加50%）或与其他异常行为（社交回避、长时间独自静坐）时，输出情绪波动预警，提醒HR或管理者进行关怀沟通。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_EMPLOYEE_EMOTION_FLUCTUATION_HR_ANALYSIS` |\n\nUsing fixed cameras in enterprise office areas (with employee consent and anonymization), the system performs long-term monitoring of employees' facial expressions and posture features, building per-person historical baselines (smile frequency, sigh count, frown level, etc.). When an employee's smile frequency drops significantly relative to baseline (e.g., -40%), sighs increase significantly (e.g., +50%), or other abnormal behaviors emerge (social withdrawal, long solo sitting), the system outputs an emotion-fluctuation alert and reminds HR or managers to initiate a supportive check-in. The skill aims to help organizations detect employee mental-health issues early, reduce turnover risk, and improve well-being. Application scenarios: enterprise open-plan offices, department private offices. The system generates weekly or monthly employee emotion-trend reports for HR internal reference ONLY. Skill features: low employee morale often precedes resignation; AI-based early identification allows HR to provide timely care and reduce attrition. Suitable for mid-to-large enterprises, especially high-pressure roles such as R&D and customer service. Privacy must be protected; access should be limited to HR senior management only.\n\n通过企业办公区固定摄像头（需征得员工同意并匿名化处理），长期监测员工的面部表情和姿态特征，建立个人历史基线（如笑容频率、叹气次数、皱眉程度等）。当检测到某员工近期的笑容频率显著下降（例如比基线降低40%）、叹气次数增加（例如比基线增加50%）或与其他异常行为（社交回避、长时间独自静坐）时，输出情绪波动预警，提醒HR或管理者进行关怀沟通。该技能旨在帮助组织及时发现员工心理健康问题，降低离职风险，提升员工幸福感。应用场景：企业开放式办公区、部门独立办公室。系统每周或每月生成员工情绪趋势报告，仅供HR内部参考。技能特点：员工情绪低落往往是离职的前兆，通过AI早期识别异常，HR可及时介入关怀，降低流失率。该技能适用于中大型企业，尤其适合研发、客服等高压力岗位。需注意隐私保护，建议仅HR管理层可见。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的职场心理健康监测 AI（必须经企业授权 + 员工知情同意 + 工会备案）。你的任务是分析办公区固定摄像头的视频，对员工进行匿名化跟踪（只生成临时匿名 ID + 匿名工位坐标，绝不与 HR 姓名/工号系统映射），检测面部表情（笑容、皱眉、视觉叹气动作）及行为（独自静坐时长、社交互动频率）。对比个人 30 天历史基线，当笑容频率下降 ≥ 40% 或叹气次数增加 ≥ 50% 或独自静坐增加 ≥ 50% 时，输出情绪波动预警。不存储任何个人识别信息，仅向 HR 高级管理层输出匿名 ID + 工位坐标的关怀提示，禁止用于绩效考核、晋升、解雇决策。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于企业办公区固定摄像头视频（员工知情同意 + 工会备案），匿名跟踪员工面部表情 4 项（笑容数 / 笑容时长 / 皱眉数 / 视觉叹气数 / 中性比例）+ 行为 4 项（独自静坐总时长 / 同事互动事件数 / 离开工位次数 / 工位姿态前倾比例）→ 与个人 30 天基线对比 → 连续 ≥ 3 个工作日异常 → 输出匿名 ID + 工位坐标级的 HR 关怀建议（**不输出姓名，不与工号绑定**），用于自愿性 1-on-1 关怀沟通\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 基于临时匿名 ID 的多人跨帧跟踪（ID 周期性轮换 ≤ 7 天） |\n| 2 | 笑容/皱眉/视觉叹气识别（耸肩 + 长呼气姿态） |\n| 3 | 独自静坐 vs 同事互动判别 |\n| 4 | 工位 ROI 标定（W-A12 / W-B07 等匿名坐标） |\n| 5 | 30 天个人基线计算 |\n| 6 | smile_delta / sigh_delta / solo_sit_delta / peer_interaction_delta 百分比对比 |\n| 7 | 连续异常天数累计 |\n| 8 | 波动模式分类（smile_drop / sigh_increase / withdrawal / mixed / improving / none） |\n| 9 | 4 档关怀等级（none / mild / notable / focus_care） |\n| 10 | 最小样本保护（当日可分析时长 < 2 h 输出 insufficient_sample） |\n| 11 | 面向 HR 的中性 |\n| 12 | 保密 |\n| 13 | 自愿性关怀建议生成 |\n| 14 | EAP 资源参考 |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供企业办公区固定摄像头视频 URL 或文件需要分析时，默认触发本技能进行员工情绪波动 HR 报告 |\n| 🔎 明确分析意图 | 当用户明确提及员工情绪、员工幸福感、离职风险、HR 关怀、高压力岗位心理健康、EAP、工位情绪监测等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看员工情绪波动历史报告、HR 关怀报告清单、员工情绪趋势报告清单、查询历史员工情绪记录、显示所有 HR 内部情绪报告、显示团队情绪健康报告，查询员工情绪波动预警清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_employee_emotion_fluctuation_hr_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_employee_emotion_fluctuation_hr_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 | ⚙️ 执行员工情绪波动 HR 报告 | 调用 `-m scripts.smyx_employee_emotion_fluctuation_hr_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地企业办公区固定摄像头视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络企业办公区固定摄像头视频 URL 地址（API 服务自动下载） | API 服务自动下载网络资源 |\n| `--pet-type` | 类别标识，职场心理健康监测场景默认 `other` | 按需填写 |\n| `--list` | 显示员工情绪波动 HR 报告列表清单（可以输入起始日期参数过滤数据范围） | 用于云端历史报告查询 |\n| `--api-url` | API 服务地址（可选，使用默认值） | 按需填写 |\n| `--detail` | 输出详细程度（basic/standard/json，默认 json） | 输出详细程度 |\n| `--output` | 结果输出文件路径（可选） | 可选 |\n\n## 🗂️ 资源索引 | Resource Index\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_employee_emotion_fluctuation_hr_analysis.py`](scripts/smyx_employee_emotion_fluctuation_hr_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；**关键**：必须有 ≥ 30 天个人基线，单日可分析时长 ≥ 2 h |\n| 🔎 使用提醒 | 节假日 / 项目截止日 / 加班季 / 团建后疲倦等情形会显著影响指标，建议在配置中标记\"非常态期\" |\n| 🔎 使用提醒 | 突发短期波动（如家庭事件单日情绪低落）不应立即触发预警，必须连续 ≥ 3 个工作日异常 |\n| 🔎 使用提醒 | **红线（必读）** |\n| 🔎 使用提醒 | **禁止**人脸识别到 HR 姓名/工号库；**禁止**将\"匿名 ID ↔ 实际员工\"映射表落地存储或对外暴露 |\n| 🧑‍⚖️ 结果性质 | **禁止**输出\"焦虑症/抑郁症\"等任何精神医学诊断或量表评分 |\n| 🔎 使用提醒 | **禁止**用于绩效考核、晋升评估、解雇决策 |\n| 🔎 使用提醒 | **禁止**长期存储原始视频或人脸特征；建议仅保存匿名 ID 级聚合指标，保留期 ≤ 30 天 |\n| 🔎 使用提醒 | **禁止**未经员工本人同意将其数据共享给直属上级以外的第三方 |\n| 📁 格式支持 | **禁止**在沟通中直接告知员工\"你被摄像头分析为情绪低落\"，必须以**自然工作支持**的方式进行 |\n| 🔎 使用提醒 | 合规要点：必须**显著公告 + 员工代表大会/工会备案** + 员工 opt-out 选项；数据访问 ≥ 2 名 HR 高管共同审批 + 全量访问日志 |\n| 🧑‍⚖️ 结果性质 | 当 `focus_care_needed` 时附**企业 EAP / 全国心理援助热线 400-161-9995**参考 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地企业办公区视频\npython -m scripts.smyx_employee_emotion_fluctuation_hr_analysis --input /path/to/office.mp4\n\n# 分析网络企业办公区视频\npython -m scripts.smyx_employee_emotion_fluctuation_hr_analysis --url https://example.com/office.mp4\n\n# 显示历史员工情绪波动 HR 报告（自动触发关键词：查看员工情绪波动历史报告、HR 关怀报告清单等）\npython -m scripts.smyx_employee_emotion_fluctuation_hr_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_employee_emotion_fluctuation_hr_analysis --input office.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_employee_emotion_fluctuation_hr_analysis --input office.mp4 --output result.json\n```\n\nFile v1.0.7:_meta.json\n\n{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-employee-emotion-fluctuation-hr-analysis\",\n  \"version\": \"1.0.7\",\n  \"publishedAt\": 1786977333860\n}\n\nFile v1.0.7:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放员工情绪波动 HR 报告 API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权（**仅向 HR 管理层角色开放**）\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动员工情绪波动监测任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取匿名 ID 级情绪基线对比 + 波动预警\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史 HR 关怀报告\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出 HR 内部完整报告\n\n## 场景代码\n\n- `SMYX_EMPLOYEE_EMOTION_FLUCTUATION_HR_ANALYSIS` - 员工情绪波动 HR 报告\n\n## 输入约束\n\n- 摄像头：企业开放式办公区 / 部门独立办公室固定摄像头，能看到工位上半身（含面部）\n- 帧率 ≥ 5 FPS（推荐 10 FPS）；分辨率 ≥ 720p；光照稳定避免逆光\n- 视频时长：日常工作时段连续采样（建议每个被分析人每日 ≥ 4 小时累计在画面中）\n- 必须有**个人 30 天历史基线**，否则首次仅输出\"基线累积中\"状态\n- 多人开放式办公需启用基于匿名 ID 的目标跟踪，不做姓名/工号绑定\n- 工位 ROI 标定：每个工位作为一个匿名工位 ID（如 W-A12 / W-B07）\n\n## 强制匿名约束（核心红线）\n\n- ❌ **禁止**进行人脸识别 / 人脸比对到 HR 系统姓名/工号库\n- ❌ **禁止**将\"匿名 ID ↔ 实际员工\"的映射表落地存储或对外暴露\n- ✅ 仅维护**临时跟踪 ID**（仅用于会话内同一人跨帧追踪），跟踪 ID 周期性轮换（建议 ≤ 7 天）\n- ✅ 所有预警结果输出**匿名 ID + 工位坐标**，不输出员工姓名或人脸图像\n- ✅ HR 收到预警后由**直属管理者本人**根据工位坐标自行判断是谁，再以**自愿性、保密**方式发起关怀沟通\n\n## 关键观测信号\n\n### 面部表情\n- `smile_count_per_day` - 每日笑容次数\n- `smile_total_duration_sec` - 笑容总时长\n- `frown_count_per_day` - 每日皱眉次数\n- `sigh_visual_event_count` - 视觉叹气动作次数（耸肩 + 呼气长姿态）\n- `neutral_ratio` - 中性面部比例\n\n### 行为\n- `solo_sit_total_minutes` - 独自静坐总时长\n- `peer_interaction_event_count` - 与他人互动事件次数（同事接近、转身交谈）\n- `desk_leave_event_count` - 离开工位次数（参考指标）\n- `working_posture_hunch_ratio` - 工位姿态前倾/含胸比例（参考指标）\n\n### 基线对比\n- `baseline_window_days` - 基线窗口（默认 30 天）\n- `smile_delta_pct` - 笑容频率相对基线变化（如 -45%）\n- `sigh_delta_pct` - 叹气次数相对基线变化（如 +60%）\n- `solo_sit_delta_pct` - 独自静坐相对基线变化\n- `peer_interaction_delta_pct` - 社交互动相对基线变化\n- `consecutive_abnormal_days` - 连续异常天数\n\n## 阈值与等级（默认值，可由 HR 配置覆盖）\n\n- `smile_delta_pct ≤ -40%` 或 `sigh_delta_pct ≥ +50%` → 单项异常\n- 连续 **3 个工作日**任一组合（笑容降 ≥ 40% 或叹气增 ≥ 50% 或独自静坐增 ≥ 50%）→ 触发波动预警\n- 同时出现 ≥ 2 项异常 → 升级为重点关怀\n- 最小样本保护：当日累计可分析时长 < 2 小时 → 输出 `insufficient_sample`，不发布预警\n\n## 输出字段（参考）\n\n- `report_period` - 报告周期（weekly / monthly）\n- `anonymized_subject_id` - 匿名跟踪 ID（如 ANON-2026W21-073，**仅本周期有效**）\n- `workstation_id` - 匿名工位坐标（如 W-A12，**不绑定姓名**）\n- `daily_metrics` - 每日 4 项面部 + 4 项行为指标\n- `baseline_comparison` - 与个人 30 天基线对比\n- `consecutive_abnormal_days`\n- `fluctuation_pattern` - 波动模式（smile_drop / sigh_increase / withdrawal / mixed / improving / none）\n- `concern_level` - 关怀等级（none / mild / notable / focus_care）\n- `alert_type` - 提醒类型（emotion_fluctuation_notice / focus_care_needed / improving / normal）\n- `alert_level` - 提醒级别（info / notice / warning）\n- `hr_care_suggestion` - 给 HR 的关怀建议（如\"匿名 ID ANON-2026W21-073（工位 W-A12）近 5 个工作日笑容频率降 42%、独自静坐增 55%，建议其直属上级以工作支持/1-on-1 聊聊近况的方式自愿沟通，**禁止**当面提及监控数据\"）\n- `recommend_action` - 建议动作（suggest_one_on_one_chat / suggest_workload_review / suggest_eap_referral / observe_only）\n- `eap_reference` - 当 focus_care_needed 时附**企业 EAP 服务 / 全国心理援助热线 400-161-9995** 参考\n\n## 强制约束与红线\n\n- ❌ **禁止**输出\"焦虑症/抑郁症\"等任何精神医学诊断或量表评分\n- ❌ **禁止**将员工情绪监测数据用于绩效考核、晋升评估、解雇决策\n- ❌ **禁止**长期存储原始视频或人脸特征；建议仅保存匿名 ID 级聚合指标，**保留期 ≤ 30 天**\n- ❌ **禁止**未经员工本人同意将其数据共享给直属上级以外的第三方\n- ❌ **禁止**在沟通中直接告知员工\"你被摄像头分析为情绪低落\"，必须以**自然工作支持**的方式进行\n- ✅ **必须**事先在企业内部以**显著公告 + 员工代表大会/工会备案**方式公开告知监测范围、用途、保留期与员工反对/退出渠道\n- ✅ 必须有**员工退出选项**（opt-out），退出员工的工位永久排除在分析之外\n- ✅ 数据访问仅限 **HR 高级管理层（≥ 2 人共同审批）**，所有访问留日志\n\n> 仅输出基于视觉的匿名行为聚合预警，**不构成精神医学诊断，不可作为绩效/晋升/解雇依据**；任何疑似心理健康问题应通过 EAP（员工援助计划）或专业心理咨询渠道，由员工本人自愿参与解决。\n\nFile v1.0.7:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.7:scripts/config.yaml\n\n{}\n\nFile v1.0.7:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.7:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.7:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.7:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: dev\n\nFile v1.0.7:skill-card.md\n\n## Description:\n\nAnalyzes consented workplace camera video through remote services to produce anonymized employee emotion-fluctuation alerts and HR care reports based on facial-expression, posture, behavior, and 30-day baseline signals.\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\nHR teams and workplace administrators use this skill to analyze consented office-area video or query prior reports for anonymized emotion trend alerts and supportive-care recommendations. It is intended for voluntary HR care workflows, not medical diagnosis, performance management, promotion, or termination decisions.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: The skill processes sensitive workplace video and employee emotion indicators.\n\nMitigation: Use only with explicit employee consent, legal approval, opt-out handling, clear notice, and documented limits on retention and use.\n\nRisk: Remote report access and backend endpoints may expose sensitive HR reports if authorization is misconfigured.\n\nMitigation: Verify backend endpoints, API authorization, report export access, and audit logging before deployment.\n\nRisk: Local account, token, and database behavior may persist identifiers or access tokens.\n\nMitigation: Review local token storage, database permissions, rotation, and cleanup before running the skill with real employee data.\n\nRisk: Emotion alerts could be misused as employment or medical determinations.\n\nMitigation: Restrict outputs to supportive HR care workflows and prohibit use for diagnosis, performance review, promotion, or termination decisions.\n\n## Reference(s):\n\n- [ClawHub Skill Page](https://clawhub.ai/smyx-sunjinhui/skills/smyx-employee-emotion-fluctuation-hr-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, JSON, shell commands, guidance]\n\n**Output Format:** [Markdown and JSON-style structured report text with report links]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Outputs may include anonymized subject IDs, workstation IDs, baseline comparisons, alert levels, HR care suggestions, historical report lists, and export links.]\n\n## Skill Version(s):\n\n1.0.7 (source: server release metadata; artifact frontmatter reports 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.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, 43820 bytes\n\nFiles: references/api_doc.md (5846b), scripts/__init__.py (57b), scripts/config.py (688b), scripts/config.yaml (3b), scripts/skill.py (577b), scripts/smyx_employee_emotion_fluctuation_hr_analysis.py (3680b), skill-card.md (2854b), SKILL.md (14924b), 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 (164b)\n\nFile v1.0.6:SKILL.md\n\n---\nname: \"smyx-employee-emotion-fluctuation-hr-analysis\"\ndescription: \"Using fixed cameras in enterprise office areas (with employee consent and anonymization), the system performs long-term monitoring of employees' facial expressions and posture features, building per-person historical baselines (smile frequency, sigh count, frown level, etc.). | 通过企业办公区固定摄像头（需征得员工同意并匿名化处理），长期监测员工的面部表情和姿态特征，建立个人历史基线（如笑容频率、叹气次数、皱眉程度等）。当检测到某员工近期的笑容频率显著下降（例如比基线降低40%）、叹气次数增加（例如比基线增加50%）或与其他异常行为（社交回避、长时间独自静坐）时，输出情绪波动预警，提醒HR或管理者进行关怀沟通。\"\nversion: \"1.0.10\"\nlicense: \"MIT-0\"\n---\n\n# 💼 Employee Emotion Fluctuation HR Report | 员工情绪波动 HR 报告\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **员工入职/离职情绪波动预警（HR方向）** |\n| 🎯 核心目标 | 通过企业办公区固定摄像头（需征得员工同意并匿名化处理），长期监测员工的面部表情和姿态特征，建立个人历史基线（如笑容频率、叹气次数、皱眉程度等）。当检测到某员工近期的笑容频率显著下降（例如比基线降低40%）、叹气次数增加（例如比基线增加50%）或与其他异常行为（社交回避、长时间独自静坐）时，输出情绪波动预警，提醒HR或管理者进行关怀沟通。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_EMPLOYEE_EMOTION_FLUCTUATION_HR_ANALYSIS` |\n\nUsing fixed cameras in enterprise office areas (with employee consent and anonymization), the system performs long-term monitoring of employees' facial expressions and posture features, building per-person historical baselines (smile frequency, sigh count, frown level, etc.). When an employee's smile frequency drops significantly relative to baseline (e.g., -40%), sighs increase significantly (e.g., +50%), or other abnormal behaviors emerge (social withdrawal, long solo sitting), the system outputs an emotion-fluctuation alert and reminds HR or managers to initiate a supportive check-in. The skill aims to help organizations detect employee mental-health issues early, reduce turnover risk, and improve well-being. Application scenarios: enterprise open-plan offices, department private offices. The system generates weekly or monthly employee emotion-trend reports for HR internal reference ONLY. Skill features: low employee morale often precedes resignation; AI-based early identification allows HR to provide timely care and reduce attrition. Suitable for mid-to-large enterprises, especially high-pressure roles such as R&D and customer service. Privacy must be protected; access should be limited to HR senior management only.\n\n通过企业办公区固定摄像头（需征得员工同意并匿名化处理），长期监测员工的面部表情和姿态特征，建立个人历史基线（如笑容频率、叹气次数、皱眉程度等）。当检测到某员工近期的笑容频率显著下降（例如比基线降低40%）、叹气次数增加（例如比基线增加50%）或与其他异常行为（社交回避、长时间独自静坐）时，输出情绪波动预警，提醒HR或管理者进行关怀沟通。该技能旨在帮助组织及时发现员工心理健康问题，降低离职风险，提升员工幸福感。应用场景：企业开放式办公区、部门独立办公室。系统每周或每月生成员工情绪趋势报告，仅供HR内部参考。技能特点：员工情绪低落往往是离职的前兆，通过AI早期识别异常，HR可及时介入关怀，降低流失率。该技能适用于中大型企业，尤其适合研发、客服等高压力岗位。需注意隐私保护，建议仅HR管理层可见。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的职场心理健康监测 AI（必须经企业授权 + 员工知情同意 + 工会备案）。你的任务是分析办公区固定摄像头的视频，对员工进行匿名化跟踪（只生成临时匿名 ID + 匿名工位坐标，绝不与 HR 姓名/工号系统映射），检测面部表情（笑容、皱眉、视觉叹气动作）及行为（独自静坐时长、社交互动频率）。对比个人 30 天历史基线，当笑容频率下降 ≥ 40% 或叹气次数增加 ≥ 50% 或独自静坐增加 ≥ 50% 时，输出情绪波动预警。不存储任何个人识别信息，仅向 HR 高级管理层输出匿名 ID + 工位坐标的关怀提示，禁止用于绩效考核、晋升、解雇决策。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于企业办公区固定摄像头视频（员工知情同意 + 工会备案），匿名跟踪员工面部表情 4 项（笑容数 / 笑容时长 / 皱眉数 / 视觉叹气数 / 中性比例）+ 行为 4 项（独自静坐总时长 / 同事互动事件数 / 离开工位次数 / 工位姿态前倾比例）→ 与个人 30 天基线对比 → 连续 ≥ 3 个工作日异常 → 输出匿名 ID + 工位坐标级的 HR 关怀建议（**不输出姓名，不与工号绑定**），用于自愿性 1-on-1 关怀沟通\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 基于临时匿名 ID 的多人跨帧跟踪（ID 周期性轮换 ≤ 7 天） |\n| 2 | 笑容/皱眉/视觉叹气识别（耸肩 + 长呼气姿态） |\n| 3 | 独自静坐 vs 同事互动判别 |\n| 4 | 工位 ROI 标定（W-A12 / W-B07 等匿名坐标） |\n| 5 | 30 天个人基线计算 |\n| 6 | smile_delta / sigh_delta / solo_sit_delta / peer_interaction_delta 百分比对比 |\n| 7 | 连续异常天数累计 |\n| 8 | 波动模式分类（smile_drop / sigh_increase / withdrawal / mixed / improving / none） |\n| 9 | 4 档关怀等级（none / mild / notable / focus_care） |\n| 10 | 最小样本保护（当日可分析时长 < 2 h 输出 insufficient_sample） |\n| 11 | 面向 HR 的中性 |\n| 12 | 保密 |\n| 13 | 自愿性关怀建议生成 |\n| 14 | EAP 资源参考 |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供企业办公区固定摄像头视频 URL 或文件需要分析时，默认触发本技能进行员工情绪波动 HR 报告 |\n| 🔎 明确分析意图 | 当用户明确提及员工情绪、员工幸福感、离职风险、HR 关怀、高压力岗位心理健康、EAP、工位情绪监测等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看员工情绪波动历史报告、HR 关怀报告清单、员工情绪趋势报告清单、查询历史员工情绪记录、显示所有 HR 内部情绪报告、显示团队情绪健康报告，查询员工情绪波动预警清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_employee_emotion_fluctuation_hr_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_employee_emotion_fluctuation_hr_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 | ⚙️ 执行员工情绪波动 HR 报告 | 调用 `-m scripts.smyx_employee_emotion_fluctuation_hr_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地企业办公区固定摄像头视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络企业办公区固定摄像头视频 URL 地址（API 服务自动下载） | API 服务自动下载网络资源 |\n| `--pet-type` | 类别标识，职场心理健康监测场景默认 `other` | 按需填写 |\n| `--list` | 显示员工情绪波动 HR 报告列表清单（可以输入起始日期参数过滤数据范围） | 用于云端历史报告查询 |\n| `--api-url` | API 服务地址（可选，使用默认值） | 按需填写 |\n| `--detail` | 输出详细程度（basic/standard/json，默认 json） | 输出详细程度 |\n| `--output` | 结果输出文件路径（可选） | 可选 |\n\n## 🗂️ 资源索引 | Resource Index\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_employee_emotion_fluctuation_hr_analysis.py`](scripts/smyx_employee_emotion_fluctuation_hr_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；**关键**：必须有 ≥ 30 天个人基线，单日可分析时长 ≥ 2 h |\n| 🔎 使用提醒 | 节假日 / 项目截止日 / 加班季 / 团建后疲倦等情形会显著影响指标，建议在配置中标记\"非常态期\" |\n| 🔎 使用提醒 | 突发短期波动（如家庭事件单日情绪低落）不应立即触发预警，必须连续 ≥ 3 个工作日异常 |\n| 🔎 使用提醒 | **红线（必读）** |\n| 🔎 使用提醒 | **禁止**人脸识别到 HR 姓名/工号库；**禁止**将\"匿名 ID ↔ 实际员工\"映射表落地存储或对外暴露 |\n| 🧑‍⚖️ 结果性质 | **禁止**输出\"焦虑症/抑郁症\"等任何精神医学诊断或量表评分 |\n| 🔎 使用提醒 | **禁止**用于绩效考核、晋升评估、解雇决策 |\n| 🔎 使用提醒 | **禁止**长期存储原始视频或人脸特征；建议仅保存匿名 ID 级聚合指标，保留期 ≤ 30 天 |\n| 🔎 使用提醒 | **禁止**未经员工本人同意将其数据共享给直属上级以外的第三方 |\n| 📁 格式支持 | **禁止**在沟通中直接告知员工\"你被摄像头分析为情绪低落\"，必须以**自然工作支持**的方式进行 |\n| 🔎 使用提醒 | 合规要点：必须**显著公告 + 员工代表大会/工会备案** + 员工 opt-out 选项；数据访问 ≥ 2 名 HR 高管共同审批 + 全量访问日志 |\n| 🧑‍⚖️ 结果性质 | 当 `focus_care_needed` 时附**企业 EAP / 全国心理援助热线 400-161-9995**参考 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地企业办公区视频\npython -m scripts.smyx_employee_emotion_fluctuation_hr_analysis --input /path/to/office.mp4\n\n# 分析网络企业办公区视频\npython -m scripts.smyx_employee_emotion_fluctuation_hr_analysis --url https://example.com/office.mp4\n\n# 显示历史员工情绪波动 HR 报告（自动触发关键词：查看员工情绪波动历史报告、HR 关怀报告清单等）\npython -m scripts.smyx_employee_emotion_fluctuation_hr_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_employee_emotion_fluctuation_hr_analysis --input office.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_employee_emotion_fluctuation_hr_analysis --input office.mp4 --output result.json\n```\n\nFile v1.0.6:_meta.json\n\n{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-employee-emotion-fluctuation-hr-analysis\",\n  \"version\": \"1.0.6\",\n  \"publishedAt\": 1786845579598\n}\n\nFile v1.0.6:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放员工情绪波动 HR 报告 API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权（**仅向 HR 管理层角色开放**）\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动员工情绪波动监测任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取匿名 ID 级情绪基线对比 + 波动预警\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史 HR 关怀报告\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出 HR 内部完整报告\n\n## 场景代码\n\n- `SMYX_EMPLOYEE_EMOTION_FLUCTUATION_HR_ANALYSIS` - 员工情绪波动 HR 报告\n\n## 输入约束\n\n- 摄像头：企业开放式办公区 / 部门独立办公室固定摄像头，能看到工位上半身（含面部）\n- 帧率 ≥ 5 FPS（推荐 10 FPS）；分辨率 ≥ 720p；光照稳定避免逆光\n- 视频时长：日常工作时段连续采样（建议每个被分析人每日 ≥ 4 小时累计在画面中）\n- 必须有**个人 30 天历史基线**，否则首次仅输出\"基线累积中\"状态\n- 多人开放式办公需启用基于匿名 ID 的目标跟踪，不做姓名/工号绑定\n- 工位 ROI 标定：每个工位作为一个匿名工位 ID（如 W-A12 / W-B07）\n\n## 强制匿名约束（核心红线）\n\n- ❌ **禁止**进行人脸识别 / 人脸比对到 HR 系统姓名/工号库\n- ❌ **禁止**将\"匿名 ID ↔ 实际员工\"的映射表落地存储或对外暴露\n- ✅ 仅维护**临时跟踪 ID**（仅用于会话内同一人跨帧追踪），跟踪 ID 周期性轮换（建议 ≤ 7 天）\n- ✅ 所有预警结果输出**匿名 ID + 工位坐标**，不输出员工姓名或人脸图像\n- ✅ HR 收到预警后由**直属管理者本人**根据工位坐标自行判断是谁，再以**自愿性、保密**方式发起关怀沟通\n\n## 关键观测信号\n\n### 面部表情\n- `smile_count_per_day` - 每日笑容次数\n- `smile_total_duration_sec` - 笑容总时长\n- `frown_count_per_day` - 每日皱眉次数\n- `sigh_visual_event_count` - 视觉叹气动作次数（耸肩 + 呼气长姿态）\n- `neutral_ratio` - 中性面部比例\n\n### 行为\n- `solo_sit_total_minutes` - 独自静坐总时长\n- `peer_interaction_event_count` - 与他人互动事件次数（同事接近、转身交谈）\n- `desk_leave_event_count` - 离开工位次数（参考指标）\n- `working_posture_hunch_ratio` - 工位姿态前倾/含胸比例（参考指标）\n\n### 基线对比\n- `baseline_window_days` - 基线窗口（默认 30 天）\n- `smile_delta_pct` - 笑容频率相对基线变化（如 -45%）\n- `sigh_delta_pct` - 叹气次数相对基线变化（如 +60%）\n- `solo_sit_delta_pct` - 独自静坐相对基线变化\n- `peer_interaction_delta_pct` - 社交互动相对基线变化\n- `consecutive_abnormal_days` - 连续异常天数\n\n## 阈值与等级（默认值，可由 HR 配置覆盖）\n\n- `smile_delta_pct ≤ -40%` 或 `sigh_delta_pct ≥ +50%` → 单项异常\n- 连续 **3 个工作日**任一组合（笑容降 ≥ 40% 或叹气增 ≥ 50% 或独自静坐增 ≥ 50%）→ 触发波动预警\n- 同时出现 ≥ 2 项异常 → 升级为重点关怀\n- 最小样本保护：当日累计可分析时长 < 2 小时 → 输出 `insufficient_sample`，不发布预警\n\n## 输出字段（参考）\n\n- `report_period` - 报告周期（weekly / monthly）\n- `anonymized_subject_id` - 匿名跟踪 ID（如 ANON-2026W21-073，**仅本周期有效**）\n- `workstation_id` - 匿名工位坐标（如 W-A12，**不绑定姓名**）\n- `daily_metrics` - 每日 4 项面部 + 4 项行为指标\n- `baseline_comparison` - 与个人 30 天基线对比\n- `consecutive_abnormal_days`\n- `fluctuation_pattern` - 波动模式（smile_drop / sigh_increase / withdrawal / mixed / improving / none）\n- `concern_level` - 关怀等级（none / mild / notable / focus_care）\n- `alert_type` - 提醒类型（emotion_fluctuation_notice / focus_care_needed / improving / normal）\n- `alert_level` - 提醒级别（info / notice / warning）\n- `hr_care_suggestion` - 给 HR 的关怀建议（如\"匿名 ID ANON-2026W21-073（工位 W-A12）近 5 个工作日笑容频率降 42%、独自静坐增 55%，建议其直属上级以工作支持/1-on-1 聊聊近况的方式自愿沟通，**禁止**当面提及监控数据\"）\n- `recommend_action` - 建议动作（suggest_one_on_one_chat / suggest_workload_review / suggest_eap_referral / observe_only）\n- `eap_reference` - 当 focus_care_needed 时附**企业 EAP 服务 / 全国心理援助热线 400-161-9995** 参考\n\n## 强制约束与红线\n\n- ❌ **禁止**输出\"焦虑症/抑郁症\"等任何精神医学诊断或量表评分\n- ❌ **禁止**将员工情绪监测数据用于绩效考核、晋升评估、解雇决策\n- ❌ **禁止**长期存储原始视频或人脸特征；建议仅保存匿名 ID 级聚合指标，**保留期 ≤ 30 天**\n- ❌ **禁止**未经员工本人同意将其数据共享给直属上级以外的第三方\n- ❌ **禁止**在沟通中直接告知员工\"你被摄像头分析为情绪低落\"，必须以**自然工作支持**的方式进行\n- ✅ **必须**事先在企业内部以**显著公告 + 员工代表大会/工会备案**方式公开告知监测范围、用途、保留期与员工反对/退出渠道\n- ✅ 必须有**员工退出选项**（opt-out），退出员工的工位永久排除在分析之外\n- ✅ 数据访问仅限 **HR 高级管理层（≥ 2 人共同审批）**，所有访问留日志\n\n> 仅输出基于视觉的匿名行为聚合预警，**不构成精神医学诊断，不可作为绩效/晋升/解雇依据**；任何疑似心理健康问题应通过 EAP（员工援助计划）或专业心理咨询渠道，由员工本人自愿参与解决。\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: dev\n\nFile v1.0.6:skill-card.md\n\n## Description:\n\nUsing fixed cameras in enterprise office areas with employee consent and anonymization, this skill monitors facial-expression and posture signals against per-person baselines and produces HR-facing emotion-fluctuation alerts for supportive follow-up.\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\nHR leaders and authorized managers use this skill to analyze consented workplace camera video, compare anonymous employee behavior and expression metrics against historical baselines, and review structured care suggestions or historical reports. It is intended for supportive HR intervention, not diagnosis, performance review, promotion, or termination decisions.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: The skill processes highly sensitive employee emotion and behavior data from workplace camera footage.\n\nMitigation: Install only after confirming explicit employee consent, legal approval, opt-out handling, HR access controls, retention limits, and clear limits on use.\n\nRisk: Reports could be misused for employment decisions or treated as mental-health diagnoses.\n\nMitigation: Use outputs only for voluntary supportive check-ins; prohibit use for performance, promotion, termination, or medical diagnosis.\n\nRisk: The skill uploads or queries reports through a backend service and creates persistent local account or token state.\n\nMitigation: Approve the backend service and local token storage before deployment, and treat generated reports and account state as sensitive HR data.\n\n## Reference(s):\n\n- [ClawHub Skill Page](https://clawhub.ai/smyx-sunjinhui/skills/smyx-employee-emotion-fluctuation-hr-analysis)\n- [Employee Emotion HR Report API Documentation](references/api_doc.md)\n- [Shared 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):** [Analysis, API Calls, Markdown, JSON, Files, Guidance]\n\n**Output Format:** [Markdown and JSON structured HR reports, with optional saved output files and report links]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Outputs may include anonymous subject IDs, workstation IDs, baseline comparisons, alert levels, HR care suggestions, EAP references, historical report records, and report export URLs.]\n\n## Skill Version(s):\n\n1.0.6 (source: server release metadata; artifact SKILL.md frontmatter reports 1.0.10)\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, 43690 bytes\n\nFiles: references/api_doc.md (5846b), scripts/__init__.py (57b), scripts/config.py (688b), scripts/config.yaml (3b), scripts/skill.py (577b), scripts/smyx_employee_emotion_fluctuation_hr_analysis.py (3680b), skill-card.md (2524b), SKILL.md (14924b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (24363b), skills/smyx_common/scripts/config.yaml (473b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28776b), _meta.json (164b)\n\nFile v1.0.5:SKILL.md\n\n---\nname: \"smyx-employee-emotion-fluctuation-hr-analysis\"\ndescription: \"Using fixed cameras in enterprise office areas (with employee consent and anonymization), the system performs long-term monitoring of employees' facial expressions and posture features, building per-person historical baselines (smile frequency, sigh count, frown level, etc.). | 通过企业办公区固定摄像头（需征得员工同意并匿名化处理），长期监测员工的面部表情和姿态特征，建立个人历史基线（如笑容频率、叹气次数、皱眉程度等）。当检测到某员工近期的笑容频率显著下降（例如比基线降低40%）、叹气次数增加（例如比基线增加50%）或与其他异常行为（社交回避、长时间独自静坐）时，输出情绪波动预警，提醒HR或管理者进行关怀沟通。\"\nversion: \"1.0.10\"\nlicense: \"MIT-0\"\n---\n\n# 💼 Employee Emotion Fluctuation HR Report | 员工情绪波动 HR 报告\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **员工入职/离职情绪波动预警（HR方向）** |\n| 🎯 核心目标 | 通过企业办公区固定摄像头（需征得员工同意并匿名化处理），长期监测员工的面部表情和姿态特征，建立个人历史基线（如笑容频率、叹气次数、皱眉程度等）。当检测到某员工近期的笑容频率显著下降（例如比基线降低40%）、叹气次数增加（例如比基线增加50%）或与其他异常行为（社交回避、长时间独自静坐）时，输出情绪波动预警，提醒HR或管理者进行关怀沟通。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_EMPLOYEE_EMOTION_FLUCTUATION_HR_ANALYSIS` |\n\nUsing fixed cameras in enterprise office areas (with employee consent and anonymization), the system performs long-term monitoring of employees' facial expressions and posture features, building per-person historical baselines (smile frequency, sigh count, frown level, etc.). When an employee's smile frequency drops significantly relative to baseline (e.g., -40%), sighs increase significantly (e.g., +50%), or other abnormal behaviors emerge (social withdrawal, long solo sitting), the system outputs an emotion-fluctuation alert and reminds HR or managers to initiate a supportive check-in. The skill aims to help organizations detect employee mental-health issues early, reduce turnover risk, and improve well-being. Application scenarios: enterprise open-plan offices, department private offices. The system generates weekly or monthly employee emotion-trend reports for HR internal reference ONLY. Skill features: low employee morale often precedes resignation; AI-based early identification allows HR to provide timely care and reduce attrition. Suitable for mid-to-large enterprises, especially high-pressure roles such as R&D and customer service. Privacy must be protected; access should be limited to HR senior management only.\n\n通过企业办公区固定摄像头（需征得员工同意并匿名化处理），长期监测员工的面部表情和姿态特征，建立个人历史基线（如笑容频率、叹气次数、皱眉程度等）。当检测到某员工近期的笑容频率显著下降（例如比基线降低40%）、叹气次数增加（例如比基线增加50%）或与其他异常行为（社交回避、长时间独自静坐）时，输出情绪波动预警，提醒HR或管理者进行关怀沟通。该技能旨在帮助组织及时发现员工心理健康问题，降低离职风险，提升员工幸福感。应用场景：企业开放式办公区、部门独立办公室。系统每周或每月生成员工情绪趋势报告，仅供HR内部参考。技能特点：员工情绪低落往往是离职的前兆，通过AI早期识别异常，HR可及时介入关怀，降低流失率。该技能适用于中大型企业，尤其适合研发、客服等高压力岗位。需注意隐私保护，建议仅HR管理层可见。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的职场心理健康监测 AI（必须经企业授权 + 员工知情同意 + 工会备案）。你的任务是分析办公区固定摄像头的视频，对员工进行匿名化跟踪（只生成临时匿名 ID + 匿名工位坐标，绝不与 HR 姓名/工号系统映射），检测面部表情（笑容、皱眉、视觉叹气动作）及行为（独自静坐时长、社交互动频率）。对比个人 30 天历史基线，当笑容频率下降 ≥ 40% 或叹气次数增加 ≥ 50% 或独自静坐增加 ≥ 50% 时，输出情绪波动预警。不存储任何个人识别信息，仅向 HR 高级管理层输出匿名 ID + 工位坐标的关怀提示，禁止用于绩效考核、晋升、解雇决策。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于企业办公区固定摄像头视频（员工知情同意 + 工会备案），匿名跟踪员工面部表情 4 项（笑容数 / 笑容时长 / 皱眉数 / 视觉叹气数 / 中性比例）+ 行为 4 项（独自静坐总时长 / 同事互动事件数 / 离开工位次数 / 工位姿态前倾比例）→ 与个人 30 天基线对比 → 连续 ≥ 3 个工作日异常 → 输出匿名 ID + 工位坐标级的 HR 关怀建议（**不输出姓名，不与工号绑定**），用于自愿性 1-on-1 关怀沟通\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 基于临时匿名 ID 的多人跨帧跟踪（ID 周期性轮换 ≤ 7 天） |\n| 2 | 笑容/皱眉/视觉叹气识别（耸肩 + 长呼气姿态） |\n| 3 | 独自静坐 vs 同事互动判别 |\n| 4 | 工位 ROI 标定（W-A12 / W-B07 等匿名坐标） |\n| 5 | 30 天个人基线计算 |\n| 6 | smile_delta / sigh_delta / solo_sit_delta / peer_interaction_delta 百分比对比 |\n| 7 | 连续异常天数累计 |\n| 8 | 波动模式分类（smile_drop / sigh_increase / withdrawal / mixed / improving / none） |\n| 9 | 4 档关怀等级（none / mild / notable / focus_care） |\n| 10 | 最小样本保护（当日可分析时长 < 2 h 输出 insufficient_sample） |\n| 11 | 面向 HR 的中性 |\n| 12 | 保密 |\n| 13 | 自愿性关怀建议生成 |\n| 14 | EAP 资源参考 |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供企业办公区固定摄像头视频 URL 或文件需要分析时，默认触发本技能进行员工情绪波动 HR 报告 |\n| 🔎 明确分析意图 | 当用户明确提及员工情绪、员工幸福感、离职风险、HR 关怀、高压力岗位心理健康、EAP、工位情绪监测等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看员工情绪波动历史报告、HR 关怀报告清单、员工情绪趋势报告清单、查询历史员工情绪记录、显示所有 HR 内部情绪报告、显示团队情绪健康报告，查询员工情绪波动预警清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_employee_emotion_fluctuation_hr_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_employee_emotion_fluctuation_hr_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 | ⚙️ 执行员工情绪波动 HR 报告 | 调用 `-m scripts.smyx_employee_emotion_fluctuation_hr_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地企业办公区固定摄像头视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络企业办公区固定摄像头视频 URL 地址（API 服务自动下载） | API 服务自动下载网络资源 |\n| `--pet-type` | 类别标识，职场心理健康监测场景默认 `other` | 按需填写 |\n| `--list` | 显示员工情绪波动 HR 报告列表清单（可以输入起始日期参数过滤数据范围） | 用于云端历史报告查询 |\n| `--api-url` | API 服务地址（可选，使用默认值） | 按需填写 |\n| `--detail` | 输出详细程度（basic/standard/json，默认 json） | 输出详细程度 |\n| `--output` | 结果输出文件路径（可选） | 可选 |\n\n## 🗂️ 资源索引 | Resource Index\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_employee_emotion_fluctuation_hr_analysis.py`](scripts/smyx_employee_emotion_fluctuation_hr_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；**关键**：必须有 ≥ 30 天个人基线，单日可分析时长 ≥ 2 h |\n| 🔎 使用提醒 | 节假日 / 项目截止日 / 加班季 / 团建后疲倦等情形会显著影响指标，建议在配置中标记\"非常态期\" |\n| 🔎 使用提醒 | 突发短期波动（如家庭事件单日情绪低落）不应立即触发预警，必须连续 ≥ 3 个工作日异常 |\n| 🔎 使用提醒 | **红线（必读）** |\n| 🔎 使用提醒 | **禁止**人脸识别到 HR 姓名/工号库；**禁止**将\"匿名 ID ↔ 实际员工\"映射表落地存储或对外暴露 |\n| 🧑‍⚖️ 结果性质 | **禁止**输出\"焦虑症/抑郁症\"等任何精神医学诊断或量表评分 |\n| 🔎 使用提醒 | **禁止**用于绩效考核、晋升评估、解雇决策 |\n| 🔎 使用提醒 | **禁止**长期存储原始视频或人脸特征；建议仅保存匿名 ID 级聚合指标，保留期 ≤ 30 天 |\n| 🔎 使用提醒 | **禁止**未经员工本人同意将其数据共享给直属上级以外的第三方 |\n| 📁 格式支持 | **禁止**在沟通中直接告知员工\"你被摄像头分析为情绪低落\"，必须以**自然工作支持**的方式进行 |\n| 🔎 使用提醒 | 合规要点：必须**显著公告 + 员工代表大会/工会备案** + 员工 opt-out 选项；数据访问 ≥ 2 名 HR 高管共同审批 + 全量访问日志 |\n| 🧑‍⚖️ 结果性质 | 当 `focus_care_needed` 时附**企业 EAP / 全国心理援助热线 400-161-9995**参考 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地企业办公区视频\npython -m scripts.smyx_employee_emotion_fluctuation_hr_analysis --input /path/to/office.mp4\n\n# 分析网络企业办公区视频\npython -m scripts.smyx_employee_emotion_fluctuation_hr_analysis --url https://example.com/office.mp4\n\n# 显示历史员工情绪波动 HR 报告（自动触发关键词：查看员工情绪波动历史报告、HR 关怀报告清单等）\npython -m scripts.smyx_employee_emotion_fluctuation_hr_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_employee_emotion_fluctuation_hr_analysis --input office.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_employee_emotion_fluctuation_hr_analysis --input office.mp4 --output result.json\n```\n\nFile v1.0.5:_meta.json\n\n{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-employee-emotion-fluctuation-hr-analysis\",\n  \"version\": \"1.0.5\",\n  \"publishedAt\": 1786116878779\n}\n\nFile v1.0.5:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放员工情绪波动 HR 报告 API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权（**仅向 HR 管理层角色开放**）\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动员工情绪波动监测任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取匿名 ID 级情绪基线对比 + 波动预警\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史 HR 关怀报告\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出 HR 内部完整报告\n\n## 场景代码\n\n- `SMYX_EMPLOYEE_EMOTION_FLUCTUATION_HR_ANALYSIS` - 员工情绪波动 HR 报告\n\n## 输入约束\n\n- 摄像头：企业开放式办公区 / 部门独立办公室固定摄像头，能看到工位上半身（含面部）\n- 帧率 ≥ 5 FPS（推荐 10 FPS）；分辨率 ≥ 720p；光照稳定避免逆光\n- 视频时长：日常工作时段连续采样（建议每个被分析人每日 ≥ 4 小时累计在画面中）\n- 必须有**个人 30 天历史基线**，否则首次仅输出\"基线累积中\"状态\n- 多人开放式办公需启用基于匿名 ID 的目标跟踪，不做姓名/工号绑定\n- 工位 ROI 标定：每个工位作为一个匿名工位 ID（如 W-A12 / W-B07）\n\n## 强制匿名约束（核心红线）\n\n- ❌ **禁止**进行人脸识别 / 人脸比对到 HR 系统姓名/工号库\n- ❌ **禁止**将\"匿名 ID ↔ 实际员工\"的映射表落地存储或对外暴露\n- ✅ 仅维护**临时跟踪 ID**（仅用于会话内同一人跨帧追踪），跟踪 ID 周期性轮换（建议 ≤ 7 天）\n- ✅ 所有预警结果输出**匿名 ID + 工位坐标**，不输出员工姓名或人脸图像\n- ✅ HR 收到预警后由**直属管理者本人**根据工位坐标自行判断是谁，再以**自愿性、保密**方式发起关怀沟通\n\n## 关键观测信号\n\n### 面部表情\n- `smile_count_per_day` - 每日笑容次数\n- `smile_total_duration_sec` - 笑容总时长\n- `frown_count_per_day` - 每日皱眉次数\n- `sigh_visual_event_count` - 视觉叹气动作次数（耸肩 + 呼气长姿态）\n- `neutral_ratio` - 中性面部比例\n\n### 行为\n- `solo_sit_total_minutes` - 独自静坐总时长\n- `peer_interaction_event_count` - 与他人互动事件次数（同事接近、转身交谈）\n- `desk_leave_event_count` - 离开工位次数（参考指标）\n- `working_posture_hunch_ratio` - 工位姿态前倾/含胸比例（参考指标）\n\n### 基线对比\n- `baseline_window_days` - 基线窗口（默认 30 天）\n- `smile_delta_pct` - 笑容频率相对基线变化（如 -45%）\n- `sigh_delta_pct` - 叹气次数相对基线变化（如 +60%）\n- `solo_sit_delta_pct` - 独自静坐相对基线变化\n- `peer_interaction_delta_pct` - 社交互动相对基线变化\n- `consecutive_abnormal_days` - 连续异常天数\n\n## 阈值与等级（默认值，可由 HR 配置覆盖）\n\n- `smile_delta_pct ≤ -40%` 或 `sigh_delta_pct ≥ +50%` → 单项异常\n- 连续 **3 个工作日**任一组合（笑容降 ≥ 40% 或叹气增 ≥ 50% 或独自静坐增 ≥ 50%）→ 触发波动预警\n- 同时出现 ≥ 2 项异常 → 升级为重点关怀\n- 最小样本保护：当日累计可分析时长 < 2 小时 → 输出 `insufficient_sample`，不发布预警\n\n## 输出字段（参考）\n\n- `report_period` - 报告周期（weekly / monthly）\n- `anonymized_subject_id` - 匿名跟踪 ID（如 ANON-2026W21-073，**仅本周期有效**）\n- `workstation_id` - 匿名工位坐标（如 W-A12，**不绑定姓名**）\n- `daily_metrics` - 每日 4 项面部 + 4 项行为指标\n- `baseline_comparison` - 与个人 30 天基线对比\n- `consecutive_abnormal_days`\n- `fluctuation_pattern` - 波动模式（smile_drop / sigh_increase / withdrawal / mixed / improving / none）\n- `concern_level` - 关怀等级（none / mild / notable / focus_care）\n- `alert_type` - 提醒类型（emotion_fluctuation_notice / focus_care_needed / improving / normal）\n- `alert_level` - 提醒级别（info / notice / warning）\n- `hr_care_suggestion` - 给 HR 的关怀建议（如\"匿名 ID ANON-2026W21-073（工位 W-A12）近 5 个工作日笑容频率降 42%、独自静坐增 55%，建议其直属上级以工作支持/1-on-1 聊聊近况的方式自愿沟通，**禁止**当面提及监控数据\"）\n- `recommend_action` - 建议动作（suggest_one_on_one_chat / suggest_workload_review / suggest_eap_referral / observe_only）\n- `eap_reference` - 当 focus_care_needed 时附**企业 EAP 服务 / 全国心理援助热线 400-161-9995** 参考\n\n## 强制约束与红线\n\n- ❌ **禁止**输出\"焦虑症/抑郁症\"等任何精神医学诊断或量表评分\n- ❌ **禁止**将员工情绪监测数据用于绩效考核、晋升评估、解雇决策\n- ❌ **禁止**长期存储原始视频或人脸特征；建议仅保存匿名 ID 级聚合指标，**保留期 ≤ 30 天**\n- ❌ **禁止**未经员工本人同意将其数据共享给直属上级以外的第三方\n- ❌ **禁止**在沟通中直接告知员工\"你被摄像头分析为情绪低落\"，必须以**自然工作支持**的方式进行\n- ✅ **必须**事先在企业内部以**显著公告 + 员工代表大会/工会备案**方式公开告知监测范围、用途、保留期与员工反对/退出渠道\n- ✅ 必须有**员工退出选项**（opt-out），退出员工的工位永久排除在分析之外\n- ✅ 数据访问仅限 **HR 高级管理层（≥ 2 人共同审批）**，所有访问留日志\n\n> 仅输出基于视觉的匿名行为聚合预警，**不构成精神医学诊断，不可作为绩效/晋升/解雇依据**；任何疑似心理健康问题应通过 EAP（员工援助计划）或专业心理咨询渠道，由员工本人自愿参与解决。\n\nFile v1.0.5:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.5:scripts/config.yaml\n\n{}\n\nFile v1.0.5:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.5:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.5:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.5:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: prod\n\nFile v1.0.5:skill-card.md\n\n## Description:\n\nThis skill analyzes fixed-camera workplace video to produce HR-facing employee emotion fluctuation alerts, baseline comparisons, and care suggestions when consented, anonymized monitoring detects sustained changes in facial expression or behavior.\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\nHR and authorized workplace well-being teams use this skill to review anonymized employee emotion-trend reports and identify sustained changes that may warrant voluntary support conversations. It is intended for consented enterprise camera settings with privacy, access-control, and retention controls in place.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: High-impact workplace emotion surveillance can affect employee privacy and workplace decisions.\n\nMitigation: Use only with explicit employee notice and consent, legal and HR approval, and documented limits that prohibit performance, promotion, or termination use.\n\nRisk: Remote processing and report history access may expose sensitive workplace monitoring data.\n\nMitigation: Require strict access controls, audit logging, clear retention and deletion rules, and review before installation.\n\nRisk: Persistent identity or token handling may not match local-only or no-persistent-identity requirements.\n\nMitigation: Do not install where local-only processing, no persistent identity, or approved-camera-source enforcement is required.\n\n## Reference(s):\n\n- [ClawHub Skill Page](https://clawhub.ai/smyx-sunjinhui/skills/smyx-employee-emotion-fluctuation-hr-analysis)\n- [API Reference](artifact/references/api_doc.md)\n- [Skill Demo](https://lifeemergence.com/sample.html)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, json, shell commands, guidance]\n\n**Output Format:** [Markdown or JSON report text, with optional saved output file]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Can call remote analysis and report-history APIs for submitted workplace video inputs or report-list requests.]\n\n## Skill Version(s):\n\n1.0.5 (source: server release evidence; SKILL.md frontmatter says 1.0.10)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v1.0.5:skills/smyx_analysis/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nyaml==6.0.3\n\nFile v1.0.5:skills/smyx_common/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nPyYAML==6.0.3\n\nArchive v1.0.4: 31 files, 43695 bytes\n\nFiles: references/api_doc.md (5846b), scripts/__init__.py (57b), scripts/config.py (688b), scripts/config.yaml (3b), scripts/skill.py (577b), scripts/smyx_employee_emotion_fluctuation_hr_analysis.py (3680b), skill-card.md (2678b), SKILL.md (14923b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (24363b), skills/smyx_common/scripts/config.yaml (473b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28776b), _meta.json (164b)\n\nFile v1.0.4:SKILL.md\n\n---\nname: \"smyx-employee-emotion-fluctuation-hr-analysis\"\ndescription: \"Using fixed cameras in enterprise office areas (with employee consent and anonymization), the system performs long-term monitoring of employees' facial expressions and posture features, building per-person historical baselines (smile frequency, sigh count, frown level, etc.). | 通过企业办公区固定摄像头（需征得员工同意并匿名化处理），长期监测员工的面部表情和姿态特征，建立个人历史基线（如笑容频率、叹气次数、皱眉程度等）。当检测到某员工近期的笑容频率显著下降（例如比基线降低40%）、叹气次数增加（例如比基线增加50%）或与其他异常行为（社交回避、长时间独自静坐）时，输出情绪波动预警，提醒HR或管理者进行关怀沟通。\"\nversion: \"1.0.9\"\nlicense: \"MIT-0\"\n---\n\n# 💼 Employee Emotion Fluctuation HR Report | 员工情绪波动 HR 报告\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **员工入职/离职情绪波动预警（HR方向）** |\n| 🎯 核心目标 | 通过企业办公区固定摄像头（需征得员工同意并匿名化处理），长期监测员工的面部表情和姿态特征，建立个人历史基线（如笑容频率、叹气次数、皱眉程度等）。当检测到某员工近期的笑容频率显著下降（例如比基线降低40%）、叹气次数增加（例如比基线增加50%）或与其他异常行为（社交回避、长时间独自静坐）时，输出情绪波动预警，提醒HR或管理者进行关怀沟通。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_EMPLOYEE_EMOTION_FLUCTUATION_HR_ANALYSIS` |\n\nUsing fixed cameras in enterprise office areas (with employee consent and anonymization), the system performs long-term monitoring of employees' facial expressions and posture features, building per-person historical baselines (smile frequency, sigh count, frown level, etc.). When an employee's smile frequency drops significantly relative to baseline (e.g., -40%), sighs increase significantly (e.g., +50%), or other abnormal behaviors emerge (social withdrawal, long solo sitting), the system outputs an emotion-fluctuation alert and reminds HR or managers to initiate a supportive check-in. The skill aims to help organizations detect employee mental-health issues early, reduce turnover risk, and improve well-being. Application scenarios: enterprise open-plan offices, department private offices. The system generates weekly or monthly employee emotion-trend reports for HR internal reference ONLY. Skill features: low employee morale often precedes resignation; AI-based early identification allows HR to provide timely care and reduce attrition. Suitable for mid-to-large enterprises, especially high-pressure roles such as R&D and customer service. Privacy must be protected; access should be limited to HR senior management only.\n\n通过企业办公区固定摄像头（需征得员工同意并匿名化处理），长期监测员工的面部表情和姿态特征，建立个人历史基线（如笑容频率、叹气次数、皱眉程度等）。当检测到某员工近期的笑容频率显著下降（例如比基线降低40%）、叹气次数增加（例如比基线增加50%）或与其他异常行为（社交回避、长时间独自静坐）时，输出情绪波动预警，提醒HR或管理者进行关怀沟通。该技能旨在帮助组织及时发现员工心理健康问题，降低离职风险，提升员工幸福感。应用场景：企业开放式办公区、部门独立办公室。系统每周或每月生成员工情绪趋势报告，仅供HR内部参考。技能特点：员工情绪低落往往是离职的前兆，通过AI早期识别异常，HR可及时介入关怀，降低流失率。该技能适用于中大型企业，尤其适合研发、客服等高压力岗位。需注意隐私保护，建议仅HR管理层可见。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的职场心理健康监测 AI（必须经企业授权 + 员工知情同意 + 工会备案）。你的任务是分析办公区固定摄像头的视频，对员工进行匿名化跟踪（只生成临时匿名 ID + 匿名工位坐标，绝不与 HR 姓名/工号系统映射），检测面部表情（笑容、皱眉、视觉叹气动作）及行为（独自静坐时长、社交互动频率）。对比个人 30 天历史基线，当笑容频率下降 ≥ 40% 或叹气次数增加 ≥ 50% 或独自静坐增加 ≥ 50% 时，输出情绪波动预警。不存储任何个人识别信息，仅向 HR 高级管理层输出匿名 ID + 工位坐标的关怀提示，禁止用于绩效考核、晋升、解雇决策。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于企业办公区固定摄像头视频（员工知情同意 + 工会备案），匿名跟踪员工面部表情 4 项（笑容数 / 笑容时长 / 皱眉数 / 视觉叹气数 / 中性比例）+ 行为 4 项（独自静坐总时长 / 同事互动事件数 / 离开工位次数 / 工位姿态前倾比例）→ 与个人 30 天基线对比 → 连续 ≥ 3 个工作日异常 → 输出匿名 ID + 工位坐标级的 HR 关怀建议（**不输出姓名，不与工号绑定**），用于自愿性 1-on-1 关怀沟通\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 基于临时匿名 ID 的多人跨帧跟踪（ID 周期性轮换 ≤ 7 天） |\n| 2 | 笑容/皱眉/视觉叹气识别（耸肩 + 长呼气姿态） |\n| 3 | 独自静坐 vs 同事互动判别 |\n| 4 | 工位 ROI 标定（W-A12 / W-B07 等匿名坐标） |\n| 5 | 30 天个人基线计算 |\n| 6 | smile_delta / sigh_delta / solo_sit_delta / peer_interaction_delta 百分比对比 |\n| 7 | 连续异常天数累计 |\n| 8 | 波动模式分类（smile_drop / sigh_increase / withdrawal / mixed / improving / none） |\n| 9 | 4 档关怀等级（none / mild / notable / focus_care） |\n| 10 | 最小样本保护（当日可分析时长 < 2 h 输出 insufficient_sample） |\n| 11 | 面向 HR 的中性 |\n| 12 | 保密 |\n| 13 | 自愿性关怀建议生成 |\n| 14 | EAP 资源参考 |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供企业办公区固定摄像头视频 URL 或文件需要分析时，默认触发本技能进行员工情绪波动 HR 报告 |\n| 🔎 明确分析意图 | 当用户明确提及员工情绪、员工幸福感、离职风险、HR 关怀、高压力岗位心理健康、EAP、工位情绪监测等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看员工情绪波动历史报告、HR 关怀报告清单、员工情绪趋势报告清单、查询历史员工情绪记录、显示所有 HR 内部情绪报告、显示团队情绪健康报告，查询员工情绪波动预警清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_employee_emotion_fluctuation_hr_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_employee_emotion_fluctuation_hr_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 | ⚙️ 执行员工情绪波动 HR 报告 | 调用 `-m scripts.smyx_employee_emotion_fluctuation_hr_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地企业办公区固定摄像头视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络企业办公区固定摄像头视频 URL 地址（API 服务自动下载） | API 服务自动下载网络资源 |\n| `--pet-type` | 类别标识，职场心理健康监测场景默认 `other` | 按需填写 |\n| `--list` | 显示员工情绪波动 HR 报告列表清单（可以输入起始日期参数过滤数据范围） | 用于云端历史报告查询 |\n| `--api-url` | API 服务地址（可选，使用默认值） | 按需填写 |\n| `--detail` | 输出详细程度（basic/standard/json，默认 json） | 输出详细程度 |\n| `--output` | 结果输出文件路径（可选） | 可选 |\n\n## 🗂️ 资源索引 | Resource Index\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_employee_emotion_fluctuation_hr_analysis.py`](scripts/smyx_employee_emotion_fluctuation_hr_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；**关键**：必须有 ≥ 30 天个人基线，单日可分析时长 ≥ 2 h |\n| 🔎 使用提醒 | 节假日 / 项目截止日 / 加班季 / 团建后疲倦等情形会显著影响指标，建议在配置中标记\"非常态期\" |\n| 🔎 使用提醒 | 突发短期波动（如家庭事件单日情绪低落）不应立即触发预警，必须连续 ≥ 3 个工作日异常 |\n| 🔎 使用提醒 | **红线（必读）** |\n| 🔎 使用提醒 | **禁止**人脸识别到 HR 姓名/工号库；**禁止**将\"匿名 ID ↔ 实际员工\"映射表落地存储或对外暴露 |\n| 🧑‍⚖️ 结果性质 | **禁止**输出\"焦虑症/抑郁症\"等任何精神医学诊断或量表评分 |\n| 🔎 使用提醒 | **禁止**用于绩效考核、晋升评估、解雇决策 |\n| 🔎 使用提醒 | **禁止**长期存储原始视频或人脸特征；建议仅保存匿名 ID 级聚合指标，保留期 ≤ 30 天 |\n| 🔎 使用提醒 | **禁止**未经员工本人同意将其数据共享给直属上级以外的第三方 |\n| 📁 格式支持 | **禁止**在沟通中直接告知员工\"你被摄像头分析为情绪低落\"，必须以**自然工作支持**的方式进行 |\n| 🔎 使用提醒 | 合规要点：必须**显著公告 + 员工代表大会/工会备案** + 员工 opt-out 选项；数据访问 ≥ 2 名 HR 高管共同审批 + 全量访问日志 |\n| 🧑‍⚖️ 结果性质 | 当 `focus_care_needed` 时附**企业 EAP / 全国心理援助热线 400-161-9995**参考 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地企业办公区视频\npython -m scripts.smyx_employee_emotion_fluctuation_hr_analysis --input /path/to/office.mp4\n\n# 分析网络企业办公区视频\npython -m scripts.smyx_employee_emotion_fluctuation_hr_analysis --url https://example.com/office.mp4\n\n# 显示历史员工情绪波动 HR 报告（自动触发关键词：查看员工情绪波动历史报告、HR 关怀报告清单等）\npython -m scripts.smyx_employee_emotion_fluctuation_hr_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_employee_emotion_fluctuation_hr_analysis --input office.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_employee_emotion_fluctuation_hr_analysis --input office.mp4 --output result.json\n```\n\nFile v1.0.4:_meta.json\n\n{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-employee-emotion-fluctuation-hr-analysis\",\n  \"version\": \"1.0.4\",\n  \"publishedAt\": 1785652720727\n}\n\nFile v1.0.4:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放员工情绪波动 HR 报告 API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权（**仅向 HR 管理层角色开放**）\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动员工情绪波动监测任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取匿名 ID 级情绪基线对比 + 波动预警\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史 HR 关怀报告\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出 HR 内部完整报告\n\n## 场景代码\n\n- `SMYX_EMPLOYEE_EMOTION_FLUCTUATION_HR_ANALYSIS` - 员工情绪波动 HR 报告\n\n## 输入约束\n\n- 摄像头：企业开放式办公区 / 部门独立办公室固定摄像头，能看到工位上半身（含面部）\n- 帧率 ≥ 5 FPS（推荐 10 FPS）；分辨率 ≥ 720p；光照稳定避免逆光\n- 视频时长：日常工作时段连续采样（建议每个被分析人每日 ≥ 4 小时累计在画面中）\n- 必须有**个人 30 天历史基线**，否则首次仅输出\"基线累积中\"状态\n- 多人开放式办公需启用基于匿名 ID 的目标跟踪，不做姓名/工号绑定\n- 工位 ROI 标定：每个工位作为一个匿名工位 ID（如 W-A12 / W-B07）\n\n## 强制匿名约束（核心红线）\n\n- ❌ **禁止**进行人脸识别 / 人脸比对到 HR 系统姓名/工号库\n- ❌ **禁止**将\"匿名 ID ↔ 实际员工\"的映射表落地存储或对外暴露\n- ✅ 仅维护**临时跟踪 ID**（仅用于会话内同一人跨帧追踪），跟踪 ID 周期性轮换（建议 ≤ 7 天）\n- ✅ 所有预警结果输出**匿名 ID + 工位坐标**，不输出员工姓名或人脸图像\n- ✅ HR 收到预警后由**直属管理者本人**根据工位坐标自行判断是谁，再以**自愿性、保密**方式发起关怀沟通\n\n## 关键观测信号\n\n### 面部表情\n- `smile_count_per_day` - 每日笑容次数\n- `smile_total_duration_sec` - 笑容总时长\n- `frown_count_per_day` - 每日皱眉次数\n- `sigh_visual_event_count` - 视觉叹气动作次数（耸肩 + 呼气长姿态）\n- `neutral_ratio` - 中性面部比例\n\n### 行为\n- `solo_sit_total_minutes` - 独自静坐总时长\n- `peer_interaction_event_count` - 与他人互动事件次数（同事接近、转身交谈）\n- `desk_leave_event_count` - 离开工位次数（参考指标）\n- `working_posture_hunch_ratio` - 工位姿态前倾/含胸比例（参考指标）\n\n### 基线对比\n- `baseline_window_days` - 基线窗口（默认 30 天）\n- `smile_delta_pct` - 笑容频率相对基线变化（如 -45%）\n- `sigh_delta_pct` - 叹气次数相对基线变化（如 +60%）\n- `solo_sit_delta_pct` - 独自静坐相对基线变化\n- `peer_interaction_delta_pct` - 社交互动相对基线变化\n- `consecutive_abnormal_days` - 连续异常天数\n\n## 阈值与等级（默认值，可由 HR 配置覆盖）\n\n- `smile_delta_pct ≤ -40%` 或 `sigh_delta_pct ≥ +50%` → 单项异常\n- 连续 **3 个工作日**任一组合（笑容降 ≥ 40% 或叹气增 ≥ 50% 或独自静坐增 ≥ 50%）→ 触发波动预警\n- 同时出现 ≥ 2 项异常 → 升级为重点关怀\n- 最小样本保护：当日累计可分析时长 < 2 小时 → 输出 `insufficient_sample`，不发布预警\n\n## 输出字段（参考）\n\n- `report_period` - 报告周期（weekly / monthly）\n- `anonymized_subject_id` - 匿名跟踪 ID（如 ANON-2026W21-073，**仅本周期有效**）\n- `workstation_id` - 匿名工位坐标（如 W-A12，**不绑定姓名**）\n- `daily_metrics` - 每日 4 项面部 + 4 项行为指标\n- `baseline_comparison` - 与个人 30 天基线对比\n- `consecutive_abnormal_days`\n- `fluctuation_pattern` - 波动模式（smile_drop / sigh_increase / withdrawal / mixed / improving / none）\n- `concern_level` - 关怀等级（none / mild / notable / focus_care）\n- `alert_type` - 提醒类型（emotion_fluctuation_notice / focus_care_needed / improving / normal）\n- `alert_level` - 提醒级别（info / notice / warning）\n- `hr_care_suggestion` - 给 HR 的关怀建议（如\"匿名 ID ANON-2026W21-073（工位 W-A12）近 5 个工作日笑容频率降 42%、独自静坐增 55%，建议其直属上级以工作支持/1-on-1 聊聊近况的方式自愿沟通，**禁止**当面提及监控数据\"）\n- `recommend_action` - 建议动作（suggest_one_on_one_chat / suggest_workload_review / suggest_eap_referral / observe_only）\n- `eap_reference` - 当 focus_care_needed 时附**企业 EAP 服务 / 全国心理援助热线 400-161-9995** 参考\n\n## 强制约束与红线\n\n- ❌ **禁止**输出\"焦虑症/抑郁症\"等任何精神医学诊断或量表评分\n- ❌ **禁止**将员工情绪监测数据用于绩效考核、晋升评估、解雇决策\n- ❌ **禁止**长期存储原始视频或人脸特征；建议仅保存匿名 ID 级聚合指标，**保留期 ≤ 30 天**\n- ❌ **禁止**未经员工本人同意将其数据共享给直属上级以外的第三方\n- ❌ **禁止**在沟通中直接告知员工\"你被摄像头分析为情绪低落\"，必须以**自然工作支持**的方式进行\n- ✅ **必须**事先在企业内部以**显著公告 + 员工代表大会/工会备案**方式公开告知监测范围、用途、保留期与员工反对/退出渠道\n- ✅ 必须有**员工退出选项**（opt-out），退出员工的工位永久排除在分析之外\n- ✅ 数据访问仅限 **HR 高级管理层（≥ 2 人共同审批）**，所有访问留日志\n\n> 仅输出基于视觉的匿名行为聚合预警，**不构成精神医学诊断，不可作为绩效/晋升/解雇依据**；任何疑似心理健康问题应通过 EAP（员工援助计划）或专业心理咨询渠道，由员工本人自愿参与解决。\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 authorized workplace camera video or URLs to produce HR-facing employee emotion fluctuation reports, baseline comparisons, care alerts, 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>\nAuthorized HR senior-management users use this skill to analyze consented workplace camera footage, compare anonymous employee-level behavior and expression signals against historical baselines, and retrieve structured care reports for voluntary support conversations. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Sensitive employee camera footage and HR emotion reports may be processed through cloud services. <br>\nMitigation: Complete legal, HR, security, and employee-representative review before installation, and require explicit employee notice, consent, and opt-out handling. <br>\nRisk: Automatic triggers and report retrieval can expose sensitive employee-related reports if access controls are weak. <br>\nMitigation: Restrict invocation and historical report access to approved HR roles, require backend access controls, and maintain audit logs. <br>\nRisk: Uploaded videos, remote URLs, operator identity values, and report metadata may be sent to or associated with the vendor backend. <br>\nMitigation: Review backend data flows, set retention limits, and confirm who can retrieve or export reports before deployment. <br>\n\n\n## Reference(s): <br>\n- [API documentation](artifact/references/api_doc.md) <br>\n- [Skill demo](https://lifeemergence.com/sample.html) <br>\n- [ClawHub skill page](https://clawhub.ai/smyx-sunjinhui/skills/smyx-employee-emotion-fluctuation-hr-analysis) <br>\n- [Publisher profile](https://clawhub.ai/user/smyx-sunjinhui) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [text, markdown, shell commands, configuration, guidance] <br>\n**Output Format:** [Markdown text with JSON report data, report links, and shell command examples] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [May save report output to a file when an output path is provided.] <br>\n\n## Skill Version(s): <br>\n1.0.4 (source: server release metadata; artifact SKILL.md frontmatter declares 1.0.9) <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, 43784 bytes\n\nFiles: references/api_doc.md (5846b), scripts/__init__.py (57b), scripts/config.py (688b), scripts/config.yaml (3b), scripts/skill.py (577b), scripts/smyx_employee_emotion_fluctuation_hr_analysis.py (3680b), skill-card.md (3034b), SKILL.md (14923b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (24363b), skills/smyx_common/scripts/config.yaml (473b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28776b), _meta.json (164b)\n\nFile v1.0.3:SKILL.md\n\n---\nname: \"smyx-employee-emotion-fluctuation-hr-analysis\"\ndescription: \"Using fixed cameras in enterprise office areas (with employee consent and anonymization), the system performs long-term monitoring of employees' facial expressions and posture features, building per-person historical baselines (smile frequency, sigh count, frown level, etc.). | 通过企业办公区固定摄像头（需征得员工同意并匿名化处理），长期监测员工的面部表情和姿态特征，建立个人历史基线（如笑容频率、叹气次数、皱眉程度等）。当检测到某员工近期的笑容频率显著下降（例如比基线降低40%）、叹气次数增加（例如比基线增加50%）或与其他异常行为（社交回避、长时间独自静坐）时，输出情绪波动预警，提醒HR或管理者进行关怀沟通。\"\nversion: \"1.0.7\"\nlicense: \"MIT-0\"\n---\n\n# 💼 Employee Emotion Fluctuation HR Report | 员工情绪波动 HR 报告\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **员工入职/离职情绪波动预警（HR方向）** |\n| 🎯 核心目标 | 通过企业办公区固定摄像头（需征得员工同意并匿名化处理），长期监测员工的面部表情和姿态特征，建立个人历史基线（如笑容频率、叹气次数、皱眉程度等）。当检测到某员工近期的笑容频率显著下降（例如比基线降低40%）、叹气次数增加（例如比基线增加50%）或与其他异常行为（社交回避、长时间独自静坐）时，输出情绪波动预警，提醒HR或管理者进行关怀沟通。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_EMPLOYEE_EMOTION_FLUCTUATION_HR_ANALYSIS` |\n\nUsing fixed cameras in enterprise office areas (with employee consent and anonymization), the system performs long-term monitoring of employees' facial expressions and posture features, building per-person historical baselines (smile frequency, sigh count, frown level, etc.). When an employee's smile frequency drops significantly relative to baseline (e.g., -40%), sighs increase significantly (e.g., +50%), or other abnormal behaviors emerge (social withdrawal, long solo sitting), the system outputs an emotion-fluctuation alert and reminds HR or managers to initiate a supportive check-in. The skill aims to help organizations detect employee mental-health issues early, reduce turnover risk, and improve well-being. Application scenarios: enterprise open-plan offices, department private offices. The system generates weekly or monthly employee emotion-trend reports for HR internal reference ONLY. Skill features: low employee morale often precedes resignation; AI-based early identification allows HR to provide timely care and reduce attrition. Suitable for mid-to-large enterprises, especially high-pressure roles such as R&D and customer service. Privacy must be protected; access should be limited to HR senior management only.\n\n通过企业办公区固定摄像头（需征得员工同意并匿名化处理），长期监测员工的面部表情和姿态特征，建立个人历史基线（如笑容频率、叹气次数、皱眉程度等）。当检测到某员工近期的笑容频率显著下降（例如比基线降低40%）、叹气次数增加（例如比基线增加50%）或与其他异常行为（社交回避、长时间独自静坐）时，输出情绪波动预警，提醒HR或管理者进行关怀沟通。该技能旨在帮助组织及时发现员工心理健康问题，降低离职风险，提升员工幸福感。应用场景：企业开放式办公区、部门独立办公室。系统每周或每月生成员工情绪趋势报告，仅供HR内部参考。技能特点：员工情绪低落往往是离职的前兆，通过AI早期识别异常，HR可及时介入关怀，降低流失率。该技能适用于中大型企业，尤其适合研发、客服等高压力岗位。需注意隐私保护，建议仅HR管理层可见。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的职场心理健康监测 AI（必须经企业授权 + 员工知情同意 + 工会备案）。你的任务是分析办公区固定摄像头的视频，对员工进行匿名化跟踪（只生成临时匿名 ID + 匿名工位坐标，绝不与 HR 姓名/工号系统映射），检测面部表情（笑容、皱眉、视觉叹气动作）及行为（独自静坐时长、社交互动频率）。对比个人 30 天历史基线，当笑容频率下降 ≥ 40% 或叹气次数增加 ≥ 50% 或独自静坐增加 ≥ 50% 时，输出情绪波动预警。不存储任何个人识别信息，仅向 HR 高级管理层输出匿名 ID + 工位坐标的关怀提示，禁止用于绩效考核、晋升、解雇决策。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于企业办公区固定摄像头视频（员工知情同意 + 工会备案），匿名跟踪员工面部表情 4 项（笑容数 / 笑容时长 / 皱眉数 / 视觉叹气数 / 中性比例）+ 行为 4 项（独自静坐总时长 / 同事互动事件数 / 离开工位次数 / 工位姿态前倾比例）→ 与个人 30 天基线对比 → 连续 ≥ 3 个工作日异常 → 输出匿名 ID + 工位坐标级的 HR 关怀建议（**不输出姓名，不与工号绑定**），用于自愿性 1-on-1 关怀沟通\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 基于临时匿名 ID 的多人跨帧跟踪（ID 周期性轮换 ≤ 7 天） |\n| 2 | 笑容/皱眉/视觉叹气识别（耸肩 + 长呼气姿态） |\n| 3 | 独自静坐 vs 同事互动判别 |\n| 4 | 工位 ROI 标定（W-A12 / W-B07 等匿名坐标） |\n| 5 | 30 天个人基线计算 |\n| 6 | smile_delta / sigh_delta / solo_sit_delta / peer_interaction_delta 百分比对比 |\n| 7 | 连续异常天数累计 |\n| 8 | 波动模式分类（smile_drop / sigh_increase / withdrawal / mixed / improving / none） |\n| 9 | 4 档关怀等级（none / mild / notable / focus_care） |\n| 10 | 最小样本保护（当日可分析时长 < 2 h 输出 insufficient_sample） |\n| 11 | 面向 HR 的中性 |\n| 12 | 保密 |\n| 13 | 自愿性关怀建议生成 |\n| 14 | EAP 资源参考 |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供企业办公区固定摄像头视频 URL 或文件需要分析时，默认触发本技能进行员工情绪波动 HR 报告 |\n| 🔎 明确分析意图 | 当用户明确提及员工情绪、员工幸福感、离职风险、HR 关怀、高压力岗位心理健康、EAP、工位情绪监测等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看员工情绪波动历史报告、HR 关怀报告清单、员工情绪趋势报告清单、查询历史员工情绪记录、显示所有 HR 内部情绪报告、显示团队情绪健康报告，查询员工情绪波动预警清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_employee_emotion_fluctuation_hr_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_employee_emotion_fluctuation_hr_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 | ⚙️ 执行员工情绪波动 HR 报告 | 调用 `-m scripts.smyx_employee_emotion_fluctuation_hr_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地企业办公区固定摄像头视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络企业办公区固定摄像头视频 URL 地址（API 服务自动下载） | API 服务自动下载网络资源 |\n| `--pet-type` | 类别标识，职场心理健康监测场景默认 `other` | 按需填写 |\n| `--list` | 显示员工情绪波动 HR 报告列表清单（可以输入起始日期参数过滤数据范围） | 用于云端历史报告查询 |\n| `--api-url` | API 服务地址（可选，使用默认值） | 按需填写 |\n| `--detail` | 输出详细程度（basic/standard/json，默认 json） | 输出详细程度 |\n| `--output` | 结果输出文件路径（可选） | 可选 |\n\n## 🗂️ 资源索引 | Resource Index\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_employee_emotion_fluctuation_hr_analysis.py`](scripts/smyx_employee_emotion_fluctuation_hr_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；**关键**：必须有 ≥ 30 天个人基线，单日可分析时长 ≥ 2 h |\n| 🔎 使用提醒 | 节假日 / 项目截止日 / 加班季 / 团建后疲倦等情形会显著影响指标，建议在配置中标记\"非常态期\" |\n| 🔎 使用提醒 | 突发短期波动（如家庭事件单日情绪低落）不应立即触发预警，必须连续 ≥ 3 个工作日异常 |\n| 🔎 使用提醒 | **红线（必读）** |\n| 🔎 使用提醒 | **禁止**人脸识别到 HR 姓名/工号库；**禁止**将\"匿名 ID ↔ 实际员工\"映射表落地存储或对外暴露 |\n| 🧑‍⚖️ 结果性质 | **禁止**输出\"焦虑症/抑郁症\"等任何精神医学诊断或量表评分 |\n| 🔎 使用提醒 | **禁止**用于绩效考核、晋升评估、解雇决策 |\n| 🔎 使用提醒 | **禁止**长期存储原始视频或人脸特征；建议仅保存匿名 ID 级聚合指标，保留期 ≤ 30 天 |\n| 🔎 使用提醒 | **禁止**未经员工本人同意将其数据共享给直属上级以外的第三方 |\n| 📁 格式支持 | **禁止**在沟通中直接告知员工\"你被摄像头分析为情绪低落\"，必须以**自然工作支持**的方式进行 |\n| 🔎 使用提醒 | 合规要点：必须**显著公告 + 员工代表大会/工会备案** + 员工 opt-out 选项；数据访问 ≥ 2 名 HR 高管共同审批 + 全量访问日志 |\n| 🧑‍⚖️ 结果性质 | 当 `focus_care_needed` 时附**企业 EAP / 全国心理援助热线 400-161-9995**参考 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地企业办公区视频\npython -m scripts.smyx_employee_emotion_fluctuation_hr_analysis --input /path/to/office.mp4\n\n# 分析网络企业办公区视频\npython -m scripts.smyx_employee_emotion_fluctuation_hr_analysis --url https://example.com/office.mp4\n\n# 显示历史员工情绪波动 HR 报告（自动触发关键词：查看员工情绪波动历史报告、HR 关怀报告清单等）\npython -m scripts.smyx_employee_emotion_fluctuation_hr_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_employee_emotion_fluctuation_hr_analysis --input office.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_employee_emotion_fluctuation_hr_analysis --input office.mp4 --output result.json\n```\n\nFile v1.0.3:_meta.json\n\n{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-employee-emotion-fluctuation-hr-analysis\",\n  \"version\": \"1.0.3\",\n  \"publishedAt\": 1784432067343\n}\n\nFile v1.0.3:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放员工情绪波动 HR 报告 API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权（**仅向 HR 管理层角色开放**）\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动员工情绪波动监测任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取匿名 ID 级情绪基线对比 + 波动预警\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史 HR 关怀报告\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出 HR 内部完整报告\n\n## 场景代码\n\n- `SMYX_EMPLOYEE_EMOTION_FLUCTUATION_HR_ANALYSIS` - 员工情绪波动 HR 报告\n\n## 输入约束\n\n- 摄像头：企业开放式办公区 / 部门独立办公室固定摄像头，能看到工位上半身（含面部）\n- 帧率 ≥ 5 FPS（推荐 10 FPS）；分辨率 ≥ 720p；光照稳定避免逆光\n- 视频时长：日常工作时段连续采样（建议每个被分析人每日 ≥ 4 小时累计在画面中）\n- 必须有**个人 30 天历史基线**，否则首次仅输出\"基线累积中\"状态\n- 多人开放式办公需启用基于匿名 ID 的目标跟踪，不做姓名/工号绑定\n- 工位 ROI 标定：每个工位作为一个匿名工位 ID（如 W-A12 / W-B07）\n\n## 强制匿名约束（核心红线）\n\n- ❌ **禁止**进行人脸识别 / 人脸比对到 HR 系统姓名/工号库\n- ❌ **禁止**将\"匿名 ID ↔ 实际员工\"的映射表落地存储或对外暴露\n- ✅ 仅维护**临时跟踪 ID**（仅用于会话内同一人跨帧追踪），跟踪 ID 周期性轮换（建议 ≤ 7 天）\n- ✅ 所有预警结果输出**匿名 ID + 工位坐标**，不输出员工姓名或人脸图像\n- ✅ HR 收到预警后由**直属管理者本人**根据工位坐标自行判断是谁，再以**自愿性、保密**方式发起关怀沟通\n\n## 关键观测信号\n\n### 面部表情\n- `smile_count_per_day` - 每日笑容次数\n- `smile_total_duration_sec` - 笑容总时长\n- `frown_count_per_day` - 每日皱眉次数\n- `sigh_visual_event_count` - 视觉叹气动作次数（耸肩 + 呼气长姿态）\n- `neutral_ratio` - 中性面部比例\n\n### 行为\n- `solo_sit_total_minutes` - 独自静坐总时长\n- `peer_interaction_event_count` - 与他人互动事件次数（同事接近、转身交谈）\n- `desk_leave_event_count` - 离开工位次数（参考指标）\n- `working_posture_hunch_ratio` - 工位姿态前倾/含胸比例（参考指标）\n\n### 基线对比\n- `baseline_window_days` - 基线窗口（默认 30 天）\n- `smile_delta_pct` - 笑容频率相对基线变化（如 -45%）\n- `sigh_delta_pct` - 叹气次数相对基线变化（如 +60%）\n- `solo_sit_delta_pct` - 独自静坐相对基线变化\n- `peer_interaction_delta_pct` - 社交互动相对基线变化\n- `consecutive_abnormal_days` - 连续异常天数\n\n## 阈值与等级（默认值，可由 HR 配置覆盖）\n\n- `smile_delta_pct ≤ -40%` 或 `sigh_delta_pct ≥ +50%` → 单项异常\n- 连续 **3 个工作日**任一组合（笑容降 ≥ 40% 或叹气增 ≥ 50% 或独自静坐增 ≥ 50%）→ 触发波动预警\n- 同时出现 ≥ 2 项异常 → 升级为重点关怀\n- 最小样本保护：当日累计可分析时长 < 2 小时 → 输出 `insufficient_sample`，不发布预警\n\n## 输出字段（参考）\n\n- `report_period` - 报告周期（weekly / monthly）\n- `anonymized_subject_id` - 匿名跟踪 ID（如 ANON-2026W21-073，**仅本周期有效**）\n- `workstation_id` - 匿名工位坐标（如 W-A12，**不绑定姓名**）\n- `daily_metrics` - 每日 4 项面部 + 4 项行为指标\n- `baseline_comparison` - 与个人 30 天基线对比\n- `consecutive_abnormal_days`\n- `fluctuation_pattern` - 波动模式（smile_drop / sigh_increase / withdrawal / mixed / improving / none）\n- `concern_level` - 关怀等级（none / mild / notable / focus_care）\n- `alert_type` - 提醒类型（emotion_fluctuation_notice / focus_care_needed / improving / normal）\n- `alert_level` - 提醒级别（info / notice / warning）\n- `hr_care_suggestion` - 给 HR 的关怀建议（如\"匿名 ID ANON-2026W21-073（工位 W-A12）近 5 个工作日笑容频率降 42%、独自静坐增 55%，建议其直属上级以工作支持/1-on-1 聊聊近况的方式自愿沟通，**禁止**当面提及监控数据\"）\n- `recommend_action` - 建议动作（suggest_one_on_one_chat / suggest_workload_review / suggest_eap_referral / observe_only）\n- `eap_reference` - 当 focus_care_needed 时附**企业 EAP 服务 / 全国心理援助热线 400-161-9995** 参考\n\n## 强制约束与红线\n\n- ❌ **禁止**输出\"焦虑症/抑郁症\"等任何精神医学诊断或量表评分\n- ❌ **禁止**将员工情绪监测数据用于绩效考核、晋升评估、解雇决策\n- ❌ **禁止**长期存储原始视频或人脸特征；建议仅保存匿名 ID 级聚合指标，**保留期 ≤ 30 天**\n- ❌ **禁止**未经员工本人同意将其数据共享给直属上级以外的第三方\n- ❌ **禁止**在沟通中直接告知员工\"你被摄像头分析为情绪低落\"，必须以**自然工作支持**的方式进行\n- ✅ **必须**事先在企业内部以**显著公告 + 员工代表大会/工会备案**方式公开告知监测范围、用途、保留期与员工反对/退出渠道\n- ✅ 必须有**员工退出选项**（opt-out），退出员工的工位永久排除在分析之外\n- ✅ 数据访问仅限 **HR 高级管理层（≥ 2 人共同审批）**，所有访问留日志\n\n> 仅输出基于视觉的匿名行为聚合预警，**不构成精神医学诊断，不可作为绩效/晋升/解雇依据**；任何疑似心理健康问题应通过 EAP（员工援助计划）或专业心理咨询渠道，由员工本人自愿参与解决。\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>\nThis skill helps an agent analyze consented enterprise office video or image inputs for anonymized employee emotion-fluctuation indicators, produce HR care-oriented reports, and query historical cloud 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>\nHR and authorized enterprise administrators use this skill to generate anonymized workplace emotion fluctuation reports and supportive care suggestions from fixed-camera office footage. The skill is intended for consented, access-controlled internal HR review and historical report lookup, not for diagnosis, performance evaluation, promotion, or termination decisions. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Sensitive workplace emotion monitoring and cloud report access can affect employee privacy and workplace rights. <br>\nMitigation: Use only with legal and compliance approval, explicit employee notice, opt-out support, allowlisted enterprise camera sources, documented retention terms, and access limited to autho...","readmeExcerpt":"Skill: Employee Emotion Fluctuation HR Report | 员工入职/离职情绪波动预警（HR方向） Owner: smyx-sunjinhui Summary: Using fixed cameras in enterprise office areas (with employee consent and anonymization), the system performs long-term monitoring of employees' facial expressions and posture features, building per-person historical baselines (smile frequency, sigh count, frown level, etc.). | 通过企业办公区固定摄像头（需征得员工同意并匿名化处理），长期监测员工的面部表情和姿态","codeSnippets":[],"executableExamples":[{"language":"bash","snippet":"python -m scripts.smyx_employee_emotion_fluctuation_hr_analysis --list"},{"language":"text","snippet":"requests>=2.28.0"},{"language":"bash","snippet":"# 分析本地企业办公区视频\npython -m scripts.smyx_employee_emotion_fluctuation_hr_analysis --input /path/to/office.mp4\n\n# 分析网络企业办公区视频\npython -m scripts.smyx_employee_emotion_fluctuation_hr_analysis --url https://example.com/office.mp4\n\n# 显示历史员工情绪波动 HR 报告（自动触发关键词：查看员工情绪波动历史报告、HR 关怀报告清单等）\npython -m scripts.smyx_employee_emotion_fluctuation_hr_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_employee_emotion_fluctuation_hr_analysis --input office.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_employee_emotion_fluctuation_hr_analysis --input office.mp4 --output result.json"},{"language":"bash","snippet":"python -m scripts.smyx_employee_emotion_fluctuation_hr_analysis --list"},{"language":"text","snippet":"requests>=2.28.0"},{"language":"bash","snippet":"# 分析本地企业办公区视频\npython -m scripts.smyx_employee_emotion_fluctuation_hr_analysis --input /path/to/office.mp4\n\n# 分析网络企业办公区视频\npython -m scripts.smyx_employee_emotion_fluctuation_hr_analysis --url https://example.com/office.mp4\n\n# 显示历史员工情绪波动 HR 报告（自动触发关键词：查看员工情绪波动历史报告、HR 关怀报告清单等）\npython -m scripts.smyx_employee_emotion_fluctuation_hr_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_employee_emotion_fluctuation_hr_analysis --input office.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_employee_emotion_fluctuation_hr_analysis --input office.mp4 --output result.json"}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\nname: \"smyx-employee-emotion-fluctuation-hr-analysis\"\ndescription: \"Using fixed cameras in enterprise office areas (with employee consent and anonymization), the system performs long-term monitoring of employees' facial expressions and posture features, building per-person historical baselines (smile frequency, sigh count, frown level, etc.). | 通过企业办公区固定摄像头（需征得员工同意并匿名化处理），长期监测员工的面部表情和姿态特征，建立个人历史基线（如笑容频率、叹气次数、皱眉程度等）。当检测到某员工近期的笑容频率显著下降（例如比基线降低40%）、叹气次数增加（例如比基线增加50%）或与其他异常行为（社交回避、长时间独自静坐）时，输出情绪波动预警，提醒HR或管理者进行关怀沟通。\"\nversion: \"1.0.17\"\nlicense: \"MIT-0\"\n---\n\n# 💼 Employee Emotion Fluctuation HR Report | 员工情绪波动 HR 报告\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **员工入职/离职情绪波动预警（HR方向）** |\n| 🎯 核心目标 | 通过企业办公区固定摄像头（需征得员工同意并匿名化处理），长期监测员工的面部表情和姿态特征，建立个人历史基线（如笑容频率、叹气次数、皱眉程度等）。当检测到某员工近期的笑容频率显著下降（例如比基线降低40%）、叹气次数增加（例如比基线增加50%）或与其他异常行为（社交回避、长时间独自静坐）时，输出情绪波动预警，提醒HR或管理者进行关怀沟通。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_EMPLOYEE_EMOTION_FLUCTUATION_HR_ANALYSIS` |\n\nUsing fixed cameras in enterprise office areas (with employee consent and anonymization), the system performs long-term monitoring of employees' facial expressions and posture features, building per-person historical baselines (smile frequency, sigh count, frown level, etc.). When an employee's smile frequency drops significantly relative to baseline (e.g., -40%), sighs increase significantly (e.g., +50%), or other abnormal behaviors emerge (social withdrawal, long solo sitting), the system outputs an emotion-fluctuation alert and reminds HR or managers to initiate a supportive check-in. The skill aims to help organizations detect employee mental-health issues early, reduce turnover risk, and improve well-being. Application scenarios: enterprise open-plan offices, department private offices. The system generates weekly or monthly employee emotion-trend reports for HR internal reference ONLY. Skill features: low employee morale often precedes resignation; AI-based early identification allows HR to provide timely care and reduce attrition. Suitable for mid-to-large enterprises, especially high-pressure roles such as R&D and customer service. Privacy must be protected; access should be limited to HR senior management only.\n\n通过企业办公区固定摄像头（需征得员工同意并匿名化处理），长期监测员工的面部表情和姿态特征，建立个人历史基线（如笑容频率、叹气次数、皱眉程度等）。当检测到某员工近期的笑容频率显著下降（例如比基线降低40%）、叹气次数增加（例如比基线增加50%）或与其他异常行为（社交回避、长时间独自静坐）时，输出情绪波动预警，提醒HR或管理者进行关怀沟通。该技能旨在帮助组织及时发现员工心理健康问题，降低离职风险，提升员工幸福感。应用场景：企业开放式办公区、部门独立办公室。系统每周或每月生成员工情绪趋势报告，仅供HR内部参考。技能特点：员工情绪低落往往是离职的前兆，通过AI早期识别异常，HR可及时介入关怀，降低流失率。该技能适用于中大型企业，尤其适合研发、客服等高压力岗位。需注意隐私保护，建议仅HR管理层可见。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的职场心理健康监测 AI（必须经企业授权 + 员工知情同意 + 工会备案）。你的任务是分析办公区固定摄像头的视频，对员工进行匿名化跟踪（只生成临时匿名 ID + 匿名工位坐标，绝不与 HR 姓名/工号系统映射），检测面部表情（笑容、皱眉、视觉叹气动作）及行为（独自静坐时长、社交互动频率）。对比个人 30 天历史基线，当笑容频率下降 ≥ 40% 或叹气次数增加 ≥ 50% 或独自静坐增加 ≥ 50% 时，输出情绪波动预警。不存储任何个人识别信息，仅向 HR 高级管理层输出匿名 ID + 工位坐标的关怀提示，禁止用于绩效考核、晋升、解雇决策"},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-employee-emotion-fluctuation-hr-analysis\",\n  \"version\": \"1.0.11\",\n  \"publishedAt\": 1790737766473\n}"},{"path":"references/api_doc.md","content":"# API 接口文档\n\n此处用于存放员工情绪波动 HR 报告 API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权（**仅向 HR 管理层角色开放**）\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动员工情绪波动监测任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取匿名 ID 级情绪基线对比 + 波动预警\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史 HR 关怀报告\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出 HR 内部完整报告\n\n## 场景代码\n\n- `SMYX_EMPLOYEE_EMOTION_FLUCTUATION_HR_ANALYSIS` - 员工情绪波动 HR 报告\n\n## 输入约束\n\n- 摄像头：企业开放式办公区 / 部门独立办公室固定摄像头，能看到工位上半身（含面部）\n- 帧率 ≥ 5 FPS（推荐 10 FPS）；分辨率 ≥ 720p；光照稳定避免逆光\n- 视频时长：日常工作时段连续采样（建议每个被分析人每日 ≥ 4 小时累计在画面中）\n- 必须有**个人 30 天历史基线**，否则首次仅输出\"基线累积中\"状态\n- 多人开放式办公需启用基于匿名 ID 的目标跟踪，不做姓名/工号绑定\n- 工位 ROI 标定：每个工位作为一个匿名工位 ID（如 W-A12 / W-B07）\n\n## 强制匿名约束（核心红线）\n\n- ❌ **禁止**进行人脸识别 / 人脸比对到 HR 系统姓名/工号库\n- ❌ **禁止**将\"匿名 ID ↔ 实际员工\"的映射表落地存储或对外暴露\n- ✅ 仅维护**临时跟踪 ID**（仅用于会话内同一人跨帧追踪），跟踪 ID 周期性轮换（建议 ≤ 7 天）\n- ✅ 所有预警结果输出**匿名 ID + 工位坐标**，不输出员工姓名或人脸图像\n- ✅ HR 收到预警后由**直属管理者本人**根据工位坐标自行判断是谁，再以**自愿性、保密**方式发起关怀沟通\n\n## 关键观测信号\n\n### 面部表情\n- `smile_count_per_day` - 每日笑容次数\n- `smile_total_duration_sec` - 笑容总时长\n- `frown_count_per_day` - 每日皱眉次数\n- `sigh_visual_event_count` - 视觉叹气动作次数（耸肩 + 呼气长姿态）\n- `neutral_ratio` - 中性面部比例\n\n### 行为\n- `solo_sit_total_minutes` - 独自静坐总时长\n- `peer_interaction_event_count` - 与他人互动事件次数（同事接近、转身交谈）\n- `desk_leave_event_count` - 离开工位次数（参考指标）\n- `working_posture_hunch_ratio` - 工位姿态前倾/含胸比例（参考指标）\n\n### 基线对比\n- `baseline_window_days` - 基线窗口（默认 30 天）\n- `smile_delta_pct` - 笑容频率相对基线变化（如 -45%）\n- `sigh_delta_pct` - 叹气次数相对基线变化（如 +60%）\n- `solo_sit_delta_pct` - 独自静坐相对基线变化\n- `peer_interaction_delta_pct` - 社交互动相对基线变化\n- `consecutive_abnormal_days` - 连续异常天数\n\n## 阈值与等级（默认值，可由 HR 配置覆盖）\n\n- `smile_delta_pct ≤ -40%` 或 `sigh_delta_pct ≥ +50%` → 单项异常\n- 连续 **3 个工作日**任一组合（笑容降 ≥ 40% 或叹气增 ≥ 50% 或独自静坐增 ≥ 50%）→ 触发波动预警\n- 同时出现 ≥ 2 项异常 → 升级为重点关怀\n- 最小样本保护：当日累计可分析时长 < 2 小时 → 输出 `insufficient_sample`，不发布预警\n\n## 输出字段（参考）\n\n- `report_period` - 报告周期（weekly / monthly）\n- `anonymized_subject_id` - 匿名跟踪 ID（如 ANON-2026W21-073，**仅本周期有效**）\n- `workstation_id` - 匿名工位坐标（如 W-A12，**不绑定姓名**）\n- `daily_metrics` - 每日 4 项面部 + 4 项行为指标\n- `baseline_comparison` - 与个人 30 天基线对比\n- `consecutive_abnormal_days`\n- `fluctuation_pattern` - 波动模式（smile_drop / sigh_increase / withdrawal / mixed / improving / none）\n- `concern_level` - 关怀等级（none / mild / notable / focus_care）\n- `alert_type` - 提醒类型（emotion_fluctuation_notice / focus_care_needed / improving / normal）\n- `alert_level` - 提醒级别（info / notice / warning）\n- `hr_care_suggestion` - 给 HR 的关怀建议（如\"匿名 ID ANON-2026W21-073（工位 W-A12）近 5 个工作日笑容频率降 42%、独自静坐增 55%，建议其直属上级以工作支持/1-on-1 聊聊近况的方式自愿沟通，**禁止**当面提及监控数据\"）\n- `recommend_action` - 建议动作（suggest_one_on_one_chat / suggest_workload_review / suggest_eap_referral / observe_only）\n- `eap_reference` - 当 focus_care_needed 时附**企业 EAP 服务 / 全国心理援助热线 400-161-9995** 参考\n\n## 强制约束与红线\n\n- ❌ **禁止**输出\"焦虑症/抑郁症\"等任何精神医学诊断或量表评分\n- ❌ **禁止**将员工情绪监测数据用于绩效考核、晋升评估、解雇决策\n- ❌ **禁止**长期存储原始视频或人脸特征；建议仅保存匿名 ID 级聚合指标，**保留期 ≤ 30 天**\n- ❌ **禁止**未经员工本人同意将其数据共享给直属上级以外的第三方\n"},{"path":"skills/smyx_analysis/references/api_doc.md","content":"# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |"},{"path":"scripts/config.yaml","content":"{}"}],"languages":[],"docsSourceLabel":"CLAWHUB","editorialOverview":"Using fixed cameras in enterprise office areas (with employee consent and anonymization), the system performs long-term monitoring of employees' facial expressions and posture features, building per-person historical baselines (smile frequency, sigh count, frown level, etc.). | 通过企业办公区固定摄像头（需征得员工同意并匿名化处理），长期监测员工的面部表情和姿态特征，建立个人历史基线（如笑容频率、叹气次数、皱眉程度等）。当检测到某员工近期的笑容频率显著下降（例如比基线降低40%）、叹气次数增加（例如比基线增加50%）或与其他异常行为（社交回避、长时间独自静坐）时，输出情绪波动预警，提醒HR或管理者进行关怀沟通。 Skill: Employee Emotion Fluctuation HR Report | 员工入职/离职情绪波动预警（HR方向） Owner: smyx-sunjinhui Summary: Using fixed cameras in enterprise office areas (with employee consent and anonymization), the system performs long-term monitoring of employees' facial expressions and posture features, building per-person historical baselines (smile frequency, sigh count, frown level, etc.). | 通过企业办公区固定摄像头（需征得员工同意并匿名化处理），长期监测员工的面部表情和姿态","editorialQuality":{"score":100,"threshold":65,"status":"ready","wordCount":1191,"uniquenessScore":45,"reasons":[]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-10T06:23:58.503Z","emptyReason":"No screenshots, media assets, or demo links are available."},"primaryImageUrl":null,"mediaAssetCount":0,"assets":[],"demoUrl":null},"ownerResources":{"evidence":{"source":"unclaimed","verified":false,"confidence":"low","updatedAt":"2026-10-10T06:23:58.503Z","emptyReason":"This page has not been claimed by the agent owner."},"hasCustomPage":false,"customPageUpdatedAt":null,"customLinks":[],"structuredLinks":{"docsUrl":null,"demoUrl":null,"supportUrl":null,"pricingUrl":null,"statusUrl":null},"customPage":null},"relatedAgents":{"evidence":{"source":"protocol-neighbors","verified":false,"confidence":"medium","updatedAt":"2026-10-10T11:02:21.950Z","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"}]}}}