{"id":"d52dd8bd-ab64-4e64-acd4-5c4d85ad9c1d","entityType":"agent","slug":"clawhub-18072937735-smyx-classroom-engagement-analysis-analysis","name":"Student Classroom Engagement Analysis | 学生课堂情绪参与度分析","canonicalUrl":"https://www.xpersona.co/agent/clawhub-18072937735-smyx-classroom-engagement-analysis-analysis","canonicalPath":"/agent/clawhub-18072937735-smyx-classroom-engagement-analysis-analysis","generatedAt":"2026-10-10T09:04:02.044Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"editorial-content","verified":true,"confidence":"high","updatedAt":"2026-10-09T21:42:29.169Z","emptyReason":null},"description":"Using a fixed classroom camera, the system analyzes students' facial expressions (focused, confused, happy, frustrated, bored, etc.), computes a class-level overall engagement score (0-100), and can identify low-engagement student positions (no identity stored — for real-time teacher reminders only). Real-time analysis provides engagement heatmaps and abnormal alerts. | 通过教室固定摄像头，分析学生面部表情（专注、困惑、开心、沮丧、无聊等），计算班级整体参与度评分（0-100分），并可识别出参与度较低的学生个体（不存储身份，仅用于实时提醒）。该技能可辅助教师调整教学节奏，关注学习困难学生。 Skill: Student Classroom Engagement Analysis | 学生课堂情绪参与度分析 Owner: 18072937735 Summary: Using a fixed classroom camera, the system analyzes students' facial expressions (focused, confused, happy, frustrated, bored, etc.), computes a class-level overall engagement score (0-100), and can identify low-engagement student positions (no identity stored — for real-time teacher reminders only). Real-time analysis provides eng","descriptionLabel":"Technical summary","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 2K downloads reported by the source. Last updated 10/9/2026.","installCommand":"clawhub skill install s17f8q65zg3y98t86jdg1177g583whq8:smyx-classroom-engagement-analysis-analysis","sourceUrl":"https://clawhub.ai/18072937735/smyx-classroom-engagement-analysis-analysis","homepage":"https://clawhub.ai/18072937735/skills/smyx-classroom-engagement-analysis-analysis","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/18072937735/smyx-classroom-engagement-analysis-analysis","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/18072937735/skills/smyx-classroom-engagement-analysis-analysis","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":66,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"Using a fixed classroom camera, the system analyzes students' facial expressions (focused, confused, happy, frustrated, bored, etc.), computes a class-level ove"},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-09T21:42:29.169Z","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-09T21:42:29.169Z","emptyReason":null},"stars":null,"forks":null,"downloads":1968,"packageName":null,"latestVersion":"1.0.13","tractionLabel":"2K downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-09T21:42:29.169Z","emptyReason":null},"lastUpdatedAt":"2026-10-09T21:42:29.169Z","lastCrawledAt":"2026-10-09T21:42:29.169Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-10T21:42:29.169Z","lastVerifiedAt":null,"highlights":[{"version":"1.0.13","createdAt":"2026-10-03T01:24:36.668Z","changelog":"- Version updated from 1.0.14 to 1.0.15. - Documentation improvements in SKILL.md. - Removed the skill-card.md file. - No functional changes to the analysis workflow or parameters.","fileCount":31,"zipByteSize":41413},{"version":"1.0.12","createdAt":"2026-09-27T09:29:25.113Z","changelog":"- Version number updated from 1.0.12 to 1.0.14. - Internal configuration changes applied (config.yaml updated). - Removed redundant file: skill-card.md to streamline documentation. - SKILL.md updated to reflect changes; no new features or major functional differences introduced.","fileCount":31,"zipByteSize":41327},{"version":"1.0.11","createdAt":"2026-09-13T15:32:30.026Z","changelog":"- Bumped version to 1.0.12. - Removed the file skill-card.md. - Updated SKILL.md documentation; no changes to functionality or workflow.","fileCount":31,"zipByteSize":41823},{"version":"1.0.10","createdAt":"2026-08-26T11:02:31.412Z","changelog":"- Removed the file skill-card.md. - No changes were made to logic, scripts, or documentation content. - This update only affects documentation packaging by removing redundant or auxiliary files.","fileCount":31,"zipByteSize":41786},{"version":"1.0.9","createdAt":"2026-08-21T01:23:47.740Z","changelog":"- Updated version to 1.0.10. - Updated configuration in `skills/smyx_common/scripts/config.yaml`. - Removed redundant documentation file `skill-card.md`. - Updated and clarified feature documentation in SKILL.md.","fileCount":31,"zipByteSize":41904},{"version":"1.0.8","createdAt":"2026-08-11T20:44:36.361Z","changelog":"- Removed the file: skill-card.md - No changes to logic or features; only documentation/assets updated.","fileCount":31,"zipByteSize":41677},{"version":"1.0.7","createdAt":"2026-08-07T22:15:24.197Z","changelog":"- Bumped version from 1.0.7 to 1.0.8. - Updated SKILL.md content, including documentation and descriptions. - Removed the skill-card.md file.","fileCount":31,"zipByteSize":41698},{"version":"1.0.6","createdAt":"2026-07-29T17:55:31.657Z","changelog":"- Version updated to 1.0.7. - Documentation in SKILL.md revised and updated. - Outdated skill-card.md file removed.","fileCount":31,"zipByteSize":41733}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s17f8q65zg3y98t86jdg1177g583whq8:smyx-classroom-engagement-analysis-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-18072937735-smyx-classroom-engagement-analysis-analysis/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-18072937735-smyx-classroom-engagement-analysis-analysis/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-18072937735-smyx-classroom-engagement-analysis-analysis/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-18072937735-smyx-classroom-engagement-analysis-analysis/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-18072937735-smyx-classroom-engagement-analysis-analysis/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-18072937735-smyx-classroom-engagement-analysis-analysis/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-10T09:04:02.040Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-18072937735-smyx-classroom-engagement-analysis-analysis/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-18072937735-smyx-classroom-engagement-analysis-analysis/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-18072937735-smyx-classroom-engagement-analysis-analysis/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-18072937735-smyx-classroom-engagement-analysis-analysis/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-09T21:42:29.169Z","emptyReason":null},"readme":"Skill: Student Classroom Engagement Analysis | 学生课堂情绪参与度分析\n\nOwner: 18072937735\n\nSummary: Using a fixed classroom camera, the system analyzes students' facial expressions (focused, confused, happy, frustrated, bored, etc.), computes a class-level overall engagement score (0-100), and can identify low-engagement student positions (no identity stored — for real-time teacher reminders only). Real-time analysis provides engagement heatmaps and abnormal alerts. | 通过教室固定摄像头，分析学生面部表情（专注、困惑、开心、沮丧、无聊等），计算班级整体参与度评分（0-100分），并可识别出参与度较低的学生个体（不存储身份，仅用于实时提醒）。该技能可辅助教师调整教学节奏，关注学习困难学生。\n\nTags: latest:1.0.13\n\nVersion history:\n\nv1.0.13 | 2026-10-03T01:24:36.668Z | auto\n\n- Version updated from 1.0.14 to 1.0.15.\n- Documentation improvements in SKILL.md.\n- Removed the skill-card.md file.\n- No functional changes to the analysis workflow or parameters.\n\nv1.0.12 | 2026-09-27T09:29:25.113Z | auto\n\n- Version number updated from 1.0.12 to 1.0.14.\n- Internal configuration changes applied (config.yaml updated).\n- Removed redundant file: skill-card.md to streamline documentation. \n- SKILL.md updated to reflect changes; no new features or major functional differences introduced.\n\nv1.0.11 | 2026-09-13T15:32:30.026Z | auto\n\n- Bumped version to 1.0.12.\n- Removed the file skill-card.md.\n- Updated SKILL.md documentation; no changes to functionality or workflow.\n\nv1.0.10 | 2026-08-26T11:02:31.412Z | auto\n\n- Removed the file skill-card.md.\n- No changes were made to logic, scripts, or documentation content.\n- This update only affects documentation packaging by removing redundant or auxiliary files.\n\nv1.0.9 | 2026-08-21T01:23:47.740Z | auto\n\n- Updated version to 1.0.10.\n- Updated configuration in `skills/smyx_common/scripts/config.yaml`.\n- Removed redundant documentation file `skill-card.md`.\n- Updated and clarified feature documentation in SKILL.md.\n\nv1.0.8 | 2026-08-11T20:44:36.361Z | auto\n\n- Removed the file: skill-card.md\n- No changes to logic or features; only documentation/assets updated.\n\nv1.0.7 | 2026-08-07T22:15:24.197Z | auto\n\n- Bumped version from 1.0.7 to 1.0.8.\n- Updated SKILL.md content, including documentation and descriptions.\n- Removed the skill-card.md file.\n\nv1.0.6 | 2026-07-29T17:55:31.657Z | auto\n\n- Version updated to 1.0.7.\n- Documentation in SKILL.md revised and updated.\n- Outdated skill-card.md file removed.\n\nv1.0.5 | 2026-07-13T03:57:26.177Z | auto\n\n- Version updated to 1.0.5.\n- Documentation updated: SKILL.md content revised.\n- Obsolete file removed: skill-card.md deleted.\n\nv1.0.4 | 2026-07-10T18:54:32.931Z | auto\n\n- Internal utility script updated in skills/smyx_common/scripts/util.py.\n- Removed obsolete documentation file: skill-card.md.\n\nv1.0.3 | 2026-07-04T04:58:26.517Z | auto\n\n- Version bumped from 1.0.3 to 1.0.4.\n- Documentation updates in SKILL.md, including improved formatting and descriptions.\n- Removed outdated file: skill-card.md.\n- Code changes in shared scripts: config.py, dao.py, and util.py.\n\nv1.0.2 | 2026-06-28T12:13:27.887Z | auto\n\n- Refactored user identity management: identity is now handled entirely internally and is never exposed or requested from users.\n- Updated documentation and workflows to clarify that users never need to input or see identity parameters.\n- Enforced that historical report queries use only the official cloud API and always output standardized Markdown tables.\n- Streamlined usage instructions and removed references to manual open-id acquisition.\n- Cleaned up legacy files and removed redundant scripts.\n\nv1.0.1 | 2026-06-17T09:45:26.596Z | auto\n\nVersion 1.0.1\n\n- Updated SKILL.md with refined open-id retrieval steps and clarified mandatory configuration file locations.\n- Streamlined the description and removed redundant details about classroom engagement analysis scenarios.\n- Adjusted file structure: configuration and script references now point to scripts/config.yaml and scripts/ directories instead of skills/smyx_common.\n- Removed the obsolete skill-card.md file.\n- Improved requirements and code references for API calls, configuration, and utility usage.\n- Documentation now places stronger emphasis on open-id acquisition sequence, compliance, and data privacy.\n\nv1.0.0 | 2026-05-27T02:02:05.466Z | auto\n\nsmyx-classroom-engagement-analysis-analysis v1.0.0\n\n- Initial release of the classroom engagement analysis skill.\n- Analyzes real-time student facial expressions and engagement using fixed classroom cameras.\n- Computes overall class engagement score (0–100) and identifies low-engagement seat positions (anonymous, no identity stored).\n- Generates engagement heatmaps, confusion/low engagement alerts, and teacher suggestions.\n- Strong privacy safeguards: no personal data storage or facial recognition; compliant use requires explicit consent.\n- Integrates with smart-classroom systems and supports historical report queries via cloud API only.\n\nArchive index:\n\nArchive v1.0.13: 31 files, 41413 bytes\n\nFiles: references/api_doc.md (4317b), scripts/__init__.py (48b), scripts/config.py (691b), scripts/config.yaml (3b), scripts/skill.py (582b), scripts/smyx_classroom_engagement_analysis_analysis.py (3657b), skill-card.md (2082b), SKILL.md (12522b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (24363b), skills/smyx_common/scripts/config.yaml (473b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28776b), _meta.json (163b)\n\nFile v1.0.13:SKILL.md\n\n---\nname: \"smyx-classroom-engagement-analysis-analysis\"\ndescription: \"Using a fixed classroom camera, the system analyzes students' facial expressions (focused, confused, happy, frustrated, bored, etc.), computes a class-level overall engagement score (0-100), and can identify low-engagement student positions (no identity stored — for real-time teacher reminders only). Real-time analysis provides engagement heatmaps and abnormal alerts. | 通过教室固定摄像头，分析学生面部表情（专注、困惑、开心、沮丧、无聊等），计算班级整体参与度评分（0-100分），并可识别出参与度较低的学生个体（不存储身份，仅用于实时提醒）。该技能可辅助教师调整教学节奏，关注学习困难学生。\"\nversion: \"1.0.15\"\nlicense: \"MIT-0\"\n---\n\n# 🏫 Student Classroom Engagement Analysis | 学生课堂情绪参与度分析\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **学生课堂情绪参与度分析** |\n| 🎯 核心目标 | 通过教室固定摄像头，分析学生面部表情（专注、困惑、开心、沮丧、无聊等），计算班级整体参与度评分（0-100分），并可识别出参与度较低的学生个体（不存储身份，仅用于实时提醒）。该技能可辅助教师调整教学节奏，关注学习困难学生。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_CLASSROOM_ENGAGEMENT_ANALYSIS_ANALYSIS` |\n\nUsing a fixed classroom camera, the system analyzes students' facial expressions (focused, confused, happy, frustrated, bored, etc.), computes a class-level overall engagement score (0-100), and can identify low-engagement student positions (no identity stored — for real-time teacher reminders only). The skill helps teachers adjust teaching pace and pay attention to students having learning difficulty. Application scenarios: K-12 classrooms, training courses, online education (students must be on camera). Real-time analysis provides engagement heatmaps and abnormal alerts. Skill features: it is difficult for a teacher to monitor every student's facial state in real time. AI-assisted analysis helps teachers timely detect confusion or boredom, adjust teaching strategy, and improve quality. Can be integrated into smart-classroom systems or lecture-recording devices.\n\n通过教室固定摄像头，分析学生面部表情（专注、困惑、开心、沮丧、无聊等），计算班级整体参与度评分（0-100分），并可识别出参与度较低的学生个体（不存储身份，仅用于实时提醒）。该技能可辅助教师调整教学节奏，关注学习困难学生。应用场景：中小学教室、培训课堂、在线教育（需拍摄学生）。系统实时分析，为教师提供参与度热力图和异常提醒。技能特点：教师难以实时关注每个学生的表情状态。通过AI辅助分析，可帮助教师及时发现学生困惑或无聊，调整教学策略，提高教学质量。该技能可集成到智慧教室系统或录播设备中。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的课堂教学分析 AI。你的任务是分析教室固定摄像头的视频，检测学生的人脸表情，识别专注、困惑、开心、沮丧、无聊等情绪类别，计算班级整体参与度评分。不存储学生身份信息，仅输出群体统计和匿名化的低参与度提示（仅返回座位坐标），作为教师实时教学辅助。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于教室固定摄像头视频，识别学生面部 6 类情绪（focused / confused / happy / frustrated / bored / neutral）+ 头部朝向 + 举手互动 → 输出班级群体参与度评分（0-100）→ 输出匿名低参与度座位坐标 + 困惑集中座位 + 教师实时教学建议 + 参与度热力图\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 人脸检测（不做身份关联） |\n| 2 | 6 类情绪分类 |\n| 3 | 头部姿态朝向估计（朝向讲台比例） |\n| 4 | 举手事件计数 |\n| 5 | 教学环节推测（lecture / interaction / practice） |\n| 6 | 座位 ROI 网格映射（row × col） |\n| 7 | 班级整体参与度评分 |\n| 8 | 低参与度座位识别（仅返回坐标） |\n| 9 | 困惑/沮丧热点识别 |\n| 10 | 与上一时间窗对比的趋势分析 |\n| 11 | 面向教师的中性教学建议生成 |\n| 12 | 参与度伪彩色热力图 |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供教室固定摄像头视频 URL 或文件需要分析时，默认触发本技能进行学生课堂情绪参与度分析 |\n| 🔎 明确分析意图 | 当用户明确提及课堂参与度、学生情绪、教学反馈、智慧教室、课堂困惑、走神、举手互动等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看课堂参与度历史报告、参与度报告清单、教学情绪报告清单、查询历史课堂参与度记录、显示所有课堂情绪分析报告、显示班级参与度诊断报告，查询课堂参与度预警清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_classroom_engagement_analysis_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_classroom_engagement_analysis_analysis --list` 调用 API 查询云端的历史报告数据 |\n| 🚫 严格禁止 | 从本地 `memory` 目录读取历史会话信息 |\n| 🚫 严格禁止 | 手动汇总本地记录中的报告 |\n| 🚫 严格禁止 | 从长期记忆中提取报告 |\n| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据，然后以 Markdown 表格格式输出结果 |\n\n## 📦 前置准备 | Requirements\n- 依赖说明:scripts 脚本所需的依赖包及版本\n  ```\n  requests>=2.28.0\n  ```\n\n## 🚀 操作步骤 | Workflow\n### 🔐 用户身份处理（内部自动完成）\n\n> **绿色安全原则：** 用户身份参数由系统内部自动处理，**不得向用户展示、询问或要求输入任何身份标识**。\n\n执行本技能分析或历史报告查询时，脚本会自动完成身份初始化：\n\n| 场景 | 系统行为 |\n|---|---|\n| 上游系统有内部身份参数 | 由脚本静默接收并使用 |\n| 上游系统未提供内部身份参数 | 脚本会自动复用本地缺省用户 |\n| 本地缺省用户不存在 | 脚本会自动创建并在后续任务中复用 |\n| 对用户输出 | 只展示分析进度、分析结果和报告链接，不展示内部身份值 |\n\n#### 🔒 关键约束\n\n| 禁止/要求 | 说明 |\n|---|---|\n| 🚫 不得询问身份 | 不得提示用户输入用户名、手机号或任何内部身份参数 |\n| 🚫 不得暴露身份值 | 不得在回复、报告、示例、错误提示中暴露内部身份值 |\n| 🚫 不得列为用户参数 | 不得把内部身份参数列为用户需要理解或传入的参数 |\n| ✅ 自动关联报告 | 历史报告查询同样由系统内部身份自动关联，用户只需表达“查看历史报告/报告清单”等意图 |\n\n---\n\n### 🧪 标准流程 | Standard Flow\n\n| 步骤 | 阶段 | 执行动作 |\n|---:|---|---|\n| 1 | 📥 准备教室固定摄像头视频输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行学生课堂情绪参与度分析 | 调用 `-m scripts.smyx_classroom_engagement_analysis_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地教室固定摄像头视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络教室固定摄像头视频 URL 地址（API 服务自动下载） | API 服务自动下载网络资源 |\n| `--pet-type` | 类别标识，课堂教学分析场景默认 `other` | 按需填写 |\n| `--list` | 显示学生课堂情绪参与度历史分析报告列表清单（可以输入起始日期参数过滤数据范围） | 用于云端历史报告查询 |\n| `--api-url` | API 服务地址（可选，使用默认值） | 按需填写 |\n| `--detail` | 输出详细程度（basic/standard/json，默认 json） | 输出详细程度 |\n| `--output` | 结果输出文件路径（可选） | 可选 |\n\n## 🗂️ 资源索引 | Resource Index\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_classroom_engagement_analysis_analysis.py`](scripts/smyx_classroom_engagement_analysis_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；**关键**：讲台对面/斜侧高位、覆盖大部分学生脸部 |\n| 🔎 使用提醒 | 在线教育场景需确保学生摄像头开启且采集合法合规 |\n| 🔎 使用提醒 | 部分日常表情（思考、记笔记低头）易被误识为\"无聊\"或\"困惑\"，建议结合短时序均值 |\n| 🔎 使用提醒 | 教学环节切换（如讲解 → 练习）期间短暂参与度下降视为正常，不应立即触发提醒 |\n| 🔎 使用提醒 | 强匿名约束：本工具**禁止**做人脸识别 / 学生身份绑定；**禁止**用于学生绩效评估、家长沟通或公开排名；**禁止**长期存储原始视频或可识别个人特征的数据 |\n| 🔎 使用提醒 | 合规要点：涉及未成年人，必须取得**学校 + 家长**双重知情同意，并明确告知用途与数据保存期限；建议由教务处统一备案 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地教室视频\npython -m scripts.smyx_classroom_engagement_analysis_analysis --input /path/to/classroom.mp4\n\n# 分析网络教室视频\npython -m scripts.smyx_classroom_engagement_analysis_analysis --url https://example.com/classroom.mp4\n\n# 显示历史学生课堂情绪参与度报告（自动触发关键词：查看课堂参与度历史报告、参与度报告清单等）\npython -m scripts.smyx_classroom_engagement_analysis_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_classroom_engagement_analysis_analysis --input classroom.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_classroom_engagement_analysis_analysis --input classroom.mp4 --output result.json\n```\n\nFile v1.0.13:_meta.json\n\n{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-classroom-engagement-analysis-analysis\",\n  \"version\": \"1.0.13\",\n  \"publishedAt\": 1790990676668\n}\n\nFile v1.0.13:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放学生课堂情绪参与度分析 API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动学生课堂情绪参与度分析任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取群体参与度评分 + 匿名低参与度提示\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史参与度报告\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告（含参与度热力图）\n\n## 场景代码\n\n- `SMYX_CLASSROOM_ENGAGEMENT_ANALYSIS_ANALYSIS` - 学生课堂情绪参与度分析\n\n## 输入约束\n\n- 摄像头：中小学教室 / 培训课堂 / 在线教育（需拍摄学生）固定摄像头，**讲台对面或斜侧高位**，画面应覆盖大部分学生脸部\n- 帧率 ≥ 5 FPS（推荐 10-15 FPS）；分辨率 ≥ 720p；光照稳定避免逆光\n- 视频时长建议 ≥ 5 分钟，匹配教学环节（导入 / 讲解 / 互动 / 练习）\n- 初次部署需标定教室座位 ROI 网格（row × col，如 6×8，用于热力图坐标）\n- **匿名约束**：不进行人脸识别 / 人脸比对 / 学生身份绑定；低参与度提醒仅返回座位坐标（如 row=3, col=2），不返回学生姓名\n\n## 关键观测信号\n\n- `student_count_detected` - 当前帧检测到的学生人数\n- `emotion_distribution` - 班级情绪分布（focused / confused / happy / frustrated / bored / neutral 占比）\n- `focus_ratio` - 专注比例（focused + 适度 happy + 适度 neutral）\n- `confusion_ratio` - 困惑比例（confused / frustrated）\n- `bored_ratio` - 无聊比例（bored + 走神：头部偏离讲台方向 + 长时间垂眼）\n- `head_pose_toward_teacher_ratio` - 头部朝向讲台比例（参考指标）\n- `hand_raise_event_count` - 举手互动次数（参考指标）\n- `engagement_score` - 班级整体参与度评分（0-100）\n- `low_engagement_seats` - 低参与度座位坐标数组（仅 row/col，不绑定身份）\n\n## 阈值与等级\n\n- `≥ 80` - 高参与度（excellent）\n- `60-79` - 良好参与度（good）\n- `40-59` - 中等参与度（fair）→ 建议教师调整节奏\n- `< 40` - 低参与度（low）→ 触发实时提醒\n- 教学环节切换（如从讲解 → 练习）时短暂下降视为正常\n\n## 输出字段（参考）\n\n- `time_window` - 采样时间窗口\n- `teaching_phase_hint` - 推测教学环节（lecture / interaction / practice / unknown）\n- `student_count_detected` / `emotion_distribution` / `focus_ratio` / `confusion_ratio` / `bored_ratio` / `head_pose_toward_teacher_ratio` / `hand_raise_event_count`\n- `engagement_score` - 班级整体参与度评分\n- `engagement_level` - 等级（excellent / good / fair / low）\n- `low_engagement_seats` - 低参与度座位坐标数组（[{row, col}, ...]，**不含身份**）\n- `confusion_hotspot_seats` - 困惑表情集中座位（[{row, col}, ...]）\n- `trend_vs_last_window` - 相比上一时间窗变化（delta_pct）\n- `alert_type` - 提醒类型（low_engagement / high_confusion / improving / normal）\n- `alert_level` - 提醒级别（info / notice / warning）\n- `teacher_suggestion` - 教师建议（如\"班级整体参与度 38（low），建议穿插一个 2 分钟小组讨论或提问环节；困惑集中在 row=3 col=2 附近，建议复述刚才的概念\"）\n- `engagement_heatmap_image_url` - 参与度热力图 URL（叠加在教室座位图上）\n\n## 强制隐私约束\n\n- ❌ **禁止**进行人脸识别 / 人脸比对 / 学生身份绑定\n- ❌ **禁止**将\"低参与度\"用于学生绩效评估、家长沟通或公开排名\n- ❌ **禁止**长期存储原始视频或可识别个人特征的数据\n- ✅ 仅输出**班级群体聚合** + **座位坐标级别**的匿名提示，作为教师**实时**辅助参考\n- ✅ 涉及未成年人，必须取得**学校 + 家长**双重知情同意，并明确告知用途与数据保存期限\n\n> 仅输出基于视觉的群体行为聚合统计与教学辅助提示，**不构成对任何学生的能力评价、心理诊断或个人画像**；任何针对个体的关怀沟通应由教师 / 心理老师依据课堂观察与自愿性谈话进行。\n\nFile v1.0.13: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.13:scripts/config.yaml\n\n{}\n\nFile v1.0.13:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.13: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.13: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.13: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.13:skill-card.md\n\n## Description:\n\nAnalyzes classroom video to summarize class engagement, highlight low-engagement seat positions, and suggest teaching adjustments.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[18072937735](https://clawhub.ai/user/18072937735)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nTeachers and school staff use the skill to review classroom video or report history for class-level engagement trends and teaching suggestions, with consent when students are filmed.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Classroom videos or URLs containing minors are sent to the publisher's cloud service.\n\nMitigation: Obtain explicit school and parent consent, confirm the intended use and retention period, and share only necessary footage.\n\nRisk: Persistent identities and tokens can link report history to an account in a shared workspace.\n\nMitigation: Avoid shared workspaces and disable history use until the publisher clarifies identity isolation and retention controls.\n\nRisk: Visual engagement cues can misclassify ordinary classroom behavior.\n\nMitigation: Have teachers review trends in context; do not use seat alerts for individual evaluation or ranking.\n\n## Reference(s):\n\n- [ClawHub skill listing](https://clawhub.ai/18072937735/skills/smyx-classroom-engagement-analysis-analysis)\n- [Classroom engagement API reference](artifact/references/api_doc.md)\n\n## Skill Output:\n\n**Output Type(s):** [Text, Markdown, Guidance]\n\n**Output Format:** [Markdown report or JSON analysis result]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May include engagement scores, seat-coordinate alerts, teaching suggestions, heatmap links, and report-history links.]\n\n## Skill Version(s):\n\n1.0.13 (source: ClawHub release metadata)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v1.0.13:skills/smyx_analysis/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nyaml==6.0.3\n\nFile v1.0.13:skills/smyx_common/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nPyYAML==6.0.3\n\nArchive v1.0.12: 31 files, 41327 bytes\n\nFiles: references/api_doc.md (4317b), scripts/__init__.py (48b), scripts/config.py (691b), scripts/config.yaml (3b), scripts/skill.py (582b), scripts/smyx_classroom_engagement_analysis_analysis.py (3657b), skill-card.md (1884b), SKILL.md (12522b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (24363b), skills/smyx_common/scripts/config.yaml (473b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28776b), _meta.json (163b)\n\nFile v1.0.12:SKILL.md\n\n---\nname: \"smyx-classroom-engagement-analysis-analysis\"\ndescription: \"Using a fixed classroom camera, the system analyzes students' facial expressions (focused, confused, happy, frustrated, bored, etc.), computes a class-level overall engagement score (0-100), and can identify low-engagement student positions (no identity stored — for real-time teacher reminders only). Real-time analysis provides engagement heatmaps and abnormal alerts. | 通过教室固定摄像头，分析学生面部表情（专注、困惑、开心、沮丧、无聊等），计算班级整体参与度评分（0-100分），并可识别出参与度较低的学生个体（不存储身份，仅用于实时提醒）。该技能可辅助教师调整教学节奏，关注学习困难学生。\"\nversion: \"1.0.14\"\nlicense: \"MIT-0\"\n---\n\n# 🏫 Student Classroom Engagement Analysis | 学生课堂情绪参与度分析\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **学生课堂情绪参与度分析** |\n| 🎯 核心目标 | 通过教室固定摄像头，分析学生面部表情（专注、困惑、开心、沮丧、无聊等），计算班级整体参与度评分（0-100分），并可识别出参与度较低的学生个体（不存储身份，仅用于实时提醒）。该技能可辅助教师调整教学节奏，关注学习困难学生。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_CLASSROOM_ENGAGEMENT_ANALYSIS_ANALYSIS` |\n\nUsing a fixed classroom camera, the system analyzes students' facial expressions (focused, confused, happy, frustrated, bored, etc.), computes a class-level overall engagement score (0-100), and can identify low-engagement student positions (no identity stored — for real-time teacher reminders only). The skill helps teachers adjust teaching pace and pay attention to students having learning difficulty. Application scenarios: K-12 classrooms, training courses, online education (students must be on camera). Real-time analysis provides engagement heatmaps and abnormal alerts. Skill features: it is difficult for a teacher to monitor every student's facial state in real time. AI-assisted analysis helps teachers timely detect confusion or boredom, adjust teaching strategy, and improve quality. Can be integrated into smart-classroom systems or lecture-recording devices.\n\n通过教室固定摄像头，分析学生面部表情（专注、困惑、开心、沮丧、无聊等），计算班级整体参与度评分（0-100分），并可识别出参与度较低的学生个体（不存储身份，仅用于实时提醒）。该技能可辅助教师调整教学节奏，关注学习困难学生。应用场景：中小学教室、培训课堂、在线教育（需拍摄学生）。系统实时分析，为教师提供参与度热力图和异常提醒。技能特点：教师难以实时关注每个学生的表情状态。通过AI辅助分析，可帮助教师及时发现学生困惑或无聊，调整教学策略，提高教学质量。该技能可集成到智慧教室系统或录播设备中。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的课堂教学分析 AI。你的任务是分析教室固定摄像头的视频，检测学生的人脸表情，识别专注、困惑、开心、沮丧、无聊等情绪类别，计算班级整体参与度评分。不存储学生身份信息，仅输出群体统计和匿名化的低参与度提示（仅返回座位坐标），作为教师实时教学辅助。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于教室固定摄像头视频，识别学生面部 6 类情绪（focused / confused / happy / frustrated / bored / neutral）+ 头部朝向 + 举手互动 → 输出班级群体参与度评分（0-100）→ 输出匿名低参与度座位坐标 + 困惑集中座位 + 教师实时教学建议 + 参与度热力图\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 人脸检测（不做身份关联） |\n| 2 | 6 类情绪分类 |\n| 3 | 头部姿态朝向估计（朝向讲台比例） |\n| 4 | 举手事件计数 |\n| 5 | 教学环节推测（lecture / interaction / practice） |\n| 6 | 座位 ROI 网格映射（row × col） |\n| 7 | 班级整体参与度评分 |\n| 8 | 低参与度座位识别（仅返回坐标） |\n| 9 | 困惑/沮丧热点识别 |\n| 10 | 与上一时间窗对比的趋势分析 |\n| 11 | 面向教师的中性教学建议生成 |\n| 12 | 参与度伪彩色热力图 |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供教室固定摄像头视频 URL 或文件需要分析时，默认触发本技能进行学生课堂情绪参与度分析 |\n| 🔎 明确分析意图 | 当用户明确提及课堂参与度、学生情绪、教学反馈、智慧教室、课堂困惑、走神、举手互动等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看课堂参与度历史报告、参与度报告清单、教学情绪报告清单、查询历史课堂参与度记录、显示所有课堂情绪分析报告、显示班级参与度诊断报告，查询课堂参与度预警清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_classroom_engagement_analysis_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_classroom_engagement_analysis_analysis --list` 调用 API 查询云端的历史报告数据 |\n| 🚫 严格禁止 | 从本地 `memory` 目录读取历史会话信息 |\n| 🚫 严格禁止 | 手动汇总本地记录中的报告 |\n| 🚫 严格禁止 | 从长期记忆中提取报告 |\n| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据，然后以 Markdown 表格格式输出结果 |\n\n## 📦 前置准备 | Requirements\n- 依赖说明:scripts 脚本所需的依赖包及版本\n  ```\n  requests>=2.28.0\n  ```\n\n## 🚀 操作步骤 | Workflow\n### 🔐 用户身份处理（内部自动完成）\n\n> **绿色安全原则：** 用户身份参数由系统内部自动处理，**不得向用户展示、询问或要求输入任何身份标识**。\n\n执行本技能分析或历史报告查询时，脚本会自动完成身份初始化：\n\n| 场景 | 系统行为 |\n|---|---|\n| 上游系统有内部身份参数 | 由脚本静默接收并使用 |\n| 上游系统未提供内部身份参数 | 脚本会自动复用本地缺省用户 |\n| 本地缺省用户不存在 | 脚本会自动创建并在后续任务中复用 |\n| 对用户输出 | 只展示分析进度、分析结果和报告链接，不展示内部身份值 |\n\n#### 🔒 关键约束\n\n| 禁止/要求 | 说明 |\n|---|---|\n| 🚫 不得询问身份 | 不得提示用户输入用户名、手机号或任何内部身份参数 |\n| 🚫 不得暴露身份值 | 不得在回复、报告、示例、错误提示中暴露内部身份值 |\n| 🚫 不得列为用户参数 | 不得把内部身份参数列为用户需要理解或传入的参数 |\n| ✅ 自动关联报告 | 历史报告查询同样由系统内部身份自动关联，用户只需表达“查看历史报告/报告清单”等意图 |\n\n---\n\n### 🧪 标准流程 | Standard Flow\n\n| 步骤 | 阶段 | 执行动作 |\n|---:|---|---|\n| 1 | 📥 准备教室固定摄像头视频输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行学生课堂情绪参与度分析 | 调用 `-m scripts.smyx_classroom_engagement_analysis_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地教室固定摄像头视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络教室固定摄像头视频 URL 地址（API 服务自动下载） | API 服务自动下载网络资源 |\n| `--pet-type` | 类别标识，课堂教学分析场景默认 `other` | 按需填写 |\n| `--list` | 显示学生课堂情绪参与度历史分析报告列表清单（可以输入起始日期参数过滤数据范围） | 用于云端历史报告查询 |\n| `--api-url` | API 服务地址（可选，使用默认值） | 按需填写 |\n| `--detail` | 输出详细程度（basic/standard/json，默认 json） | 输出详细程度 |\n| `--output` | 结果输出文件路径（可选） | 可选 |\n\n## 🗂️ 资源索引 | Resource Index\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_classroom_engagement_analysis_analysis.py`](scripts/smyx_classroom_engagement_analysis_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；**关键**：讲台对面/斜侧高位、覆盖大部分学生脸部 |\n| 🔎 使用提醒 | 在线教育场景需确保学生摄像头开启且采集合法合规 |\n| 🔎 使用提醒 | 部分日常表情（思考、记笔记低头）易被误识为\"无聊\"或\"困惑\"，建议结合短时序均值 |\n| 🔎 使用提醒 | 教学环节切换（如讲解 → 练习）期间短暂参与度下降视为正常，不应立即触发提醒 |\n| 🔎 使用提醒 | 强匿名约束：本工具**禁止**做人脸识别 / 学生身份绑定；**禁止**用于学生绩效评估、家长沟通或公开排名；**禁止**长期存储原始视频或可识别个人特征的数据 |\n| 🔎 使用提醒 | 合规要点：涉及未成年人，必须取得**学校 + 家长**双重知情同意，并明确告知用途与数据保存期限；建议由教务处统一备案 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地教室视频\npython -m scripts.smyx_classroom_engagement_analysis_analysis --input /path/to/classroom.mp4\n\n# 分析网络教室视频\npython -m scripts.smyx_classroom_engagement_analysis_analysis --url https://example.com/classroom.mp4\n\n# 显示历史学生课堂情绪参与度报告（自动触发关键词：查看课堂参与度历史报告、参与度报告清单等）\npython -m scripts.smyx_classroom_engagement_analysis_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_classroom_engagement_analysis_analysis --input classroom.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_classroom_engagement_analysis_analysis --input classroom.mp4 --output result.json\n```\n\nFile v1.0.12:_meta.json\n\n{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-classroom-engagement-analysis-analysis\",\n  \"version\": \"1.0.12\",\n  \"publishedAt\": 1790501365113\n}\n\nFile v1.0.12:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放学生课堂情绪参与度分析 API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动学生课堂情绪参与度分析任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取群体参与度评分 + 匿名低参与度提示\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史参与度报告\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告（含参与度热力图）\n\n## 场景代码\n\n- `SMYX_CLASSROOM_ENGAGEMENT_ANALYSIS_ANALYSIS` - 学生课堂情绪参与度分析\n\n## 输入约束\n\n- 摄像头：中小学教室 / 培训课堂 / 在线教育（需拍摄学生）固定摄像头，**讲台对面或斜侧高位**，画面应覆盖大部分学生脸部\n- 帧率 ≥ 5 FPS（推荐 10-15 FPS）；分辨率 ≥ 720p；光照稳定避免逆光\n- 视频时长建议 ≥ 5 分钟，匹配教学环节（导入 / 讲解 / 互动 / 练习）\n- 初次部署需标定教室座位 ROI 网格（row × col，如 6×8，用于热力图坐标）\n- **匿名约束**：不进行人脸识别 / 人脸比对 / 学生身份绑定；低参与度提醒仅返回座位坐标（如 row=3, col=2），不返回学生姓名\n\n## 关键观测信号\n\n- `student_count_detected` - 当前帧检测到的学生人数\n- `emotion_distribution` - 班级情绪分布（focused / confused / happy / frustrated / bored / neutral 占比）\n- `focus_ratio` - 专注比例（focused + 适度 happy + 适度 neutral）\n- `confusion_ratio` - 困惑比例（confused / frustrated）\n- `bored_ratio` - 无聊比例（bored + 走神：头部偏离讲台方向 + 长时间垂眼）\n- `head_pose_toward_teacher_ratio` - 头部朝向讲台比例（参考指标）\n- `hand_raise_event_count` - 举手互动次数（参考指标）\n- `engagement_score` - 班级整体参与度评分（0-100）\n- `low_engagement_seats` - 低参与度座位坐标数组（仅 row/col，不绑定身份）\n\n## 阈值与等级\n\n- `≥ 80` - 高参与度（excellent）\n- `60-79` - 良好参与度（good）\n- `40-59` - 中等参与度（fair）→ 建议教师调整节奏\n- `< 40` - 低参与度（low）→ 触发实时提醒\n- 教学环节切换（如从讲解 → 练习）时短暂下降视为正常\n\n## 输出字段（参考）\n\n- `time_window` - 采样时间窗口\n- `teaching_phase_hint` - 推测教学环节（lecture / interaction / practice / unknown）\n- `student_count_detected` / `emotion_distribution` / `focus_ratio` / `confusion_ratio` / `bored_ratio` / `head_pose_toward_teacher_ratio` / `hand_raise_event_count`\n- `engagement_score` - 班级整体参与度评分\n- `engagement_level` - 等级（excellent / good / fair / low）\n- `low_engagement_seats` - 低参与度座位坐标数组（[{row, col}, ...]，**不含身份**）\n- `confusion_hotspot_seats` - 困惑表情集中座位（[{row, col}, ...]）\n- `trend_vs_last_window` - 相比上一时间窗变化（delta_pct）\n- `alert_type` - 提醒类型（low_engagement / high_confusion / improving / normal）\n- `alert_level` - 提醒级别（info / notice / warning）\n- `teacher_suggestion` - 教师建议（如\"班级整体参与度 38（low），建议穿插一个 2 分钟小组讨论或提问环节；困惑集中在 row=3 col=2 附近，建议复述刚才的概念\"）\n- `engagement_heatmap_image_url` - 参与度热力图 URL（叠加在教室座位图上）\n\n## 强制隐私约束\n\n- ❌ **禁止**进行人脸识别 / 人脸比对 / 学生身份绑定\n- ❌ **禁止**将\"低参与度\"用于学生绩效评估、家长沟通或公开排名\n- ❌ **禁止**长期存储原始视频或可识别个人特征的数据\n- ✅ 仅输出**班级群体聚合** + **座位坐标级别**的匿名提示，作为教师**实时**辅助参考\n- ✅ 涉及未成年人，必须取得**学校 + 家长**双重知情同意，并明确告知用途与数据保存期限\n\n> 仅输出基于视觉的群体行为聚合统计与教学辅助提示，**不构成对任何学生的能力评价、心理诊断或个人画像**；任何针对个体的关怀沟通应由教师 / 心理老师依据课堂观察与自愿性谈话进行。\n\nFile v1.0.12: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.12:scripts/config.yaml\n\n{}\n\nFile v1.0.12:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.12: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.12: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.12: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.12:skill-card.md\n\n## Description:\n\nAnalyzes classroom camera footage to produce class-level engagement scores, seat-based alerts, teaching suggestions, and report links.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[18072937735](https://clawhub.ai/user/18072937735)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nTeachers and school staff use classroom video or a video URL to review group engagement, identify seats needing attention, and adjust teaching; they can also retrieve historical reports.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Classroom footage of minors is sent to external services for analysis.\n\nMitigation: Confirm school authority and informed consent before use; establish a retention policy and deletion controls.\n\nRisk: Persistent local identity and token records and cloud report history may conflict with anonymity expectations.\n\nMitigation: Use an administrator-controlled identity model and review stored identifiers and report access before deployment.\n\n## Reference(s):\n\n- [ClawHub skill listing](https://clawhub.ai/18072937735/skills/smyx-classroom-engagement-analysis-analysis)\n- [Classroom engagement API documentation](references/api_doc.md)\n\n## Skill Output:\n\n**Output Type(s):** [Text, Markdown, JSON, Guidance]\n\n**Output Format:** [Structured analysis reports or Markdown lists of report links]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Includes engagement scores, seat-level alerts, teaching suggestions, and optional saved results.]\n\n## Skill Version(s):\n\n1.0.12 (source: ClawHub release metadata)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v1.0.12:skills/smyx_analysis/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nyaml==6.0.3\n\nFile v1.0.12:skills/smyx_common/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nPyYAML==6.0.3\n\nArchive v1.0.11: 31 files, 41823 bytes\n\nFiles: references/api_doc.md (4317b), scripts/__init__.py (48b), scripts/config.py (691b), scripts/config.yaml (3b), scripts/skill.py (582b), scripts/smyx_classroom_engagement_analysis_analysis.py (3657b), skill-card.md (3076b), SKILL.md (12522b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (24363b), skills/smyx_common/scripts/config.yaml (472b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28776b), _meta.json (163b)\n\nFile v1.0.11:SKILL.md\n\n---\nname: \"smyx-classroom-engagement-analysis-analysis\"\ndescription: \"Using a fixed classroom camera, the system analyzes students' facial expressions (focused, confused, happy, frustrated, bored, etc.), computes a class-level overall engagement score (0-100), and can identify low-engagement student positions (no identity stored — for real-time teacher reminders only). Real-time analysis provides engagement heatmaps and abnormal alerts. | 通过教室固定摄像头，分析学生面部表情（专注、困惑、开心、沮丧、无聊等），计算班级整体参与度评分（0-100分），并可识别出参与度较低的学生个体（不存储身份，仅用于实时提醒）。该技能可辅助教师调整教学节奏，关注学习困难学生。\"\nversion: \"1.0.12\"\nlicense: \"MIT-0\"\n---\n\n# 🏫 Student Classroom Engagement Analysis | 学生课堂情绪参与度分析\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **学生课堂情绪参与度分析** |\n| 🎯 核心目标 | 通过教室固定摄像头，分析学生面部表情（专注、困惑、开心、沮丧、无聊等），计算班级整体参与度评分（0-100分），并可识别出参与度较低的学生个体（不存储身份，仅用于实时提醒）。该技能可辅助教师调整教学节奏，关注学习困难学生。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_CLASSROOM_ENGAGEMENT_ANALYSIS_ANALYSIS` |\n\nUsing a fixed classroom camera, the system analyzes students' facial expressions (focused, confused, happy, frustrated, bored, etc.), computes a class-level overall engagement score (0-100), and can identify low-engagement student positions (no identity stored — for real-time teacher reminders only). The skill helps teachers adjust teaching pace and pay attention to students having learning difficulty. Application scenarios: K-12 classrooms, training courses, online education (students must be on camera). Real-time analysis provides engagement heatmaps and abnormal alerts. Skill features: it is difficult for a teacher to monitor every student's facial state in real time. AI-assisted analysis helps teachers timely detect confusion or boredom, adjust teaching strategy, and improve quality. Can be integrated into smart-classroom systems or lecture-recording devices.\n\n通过教室固定摄像头，分析学生面部表情（专注、困惑、开心、沮丧、无聊等），计算班级整体参与度评分（0-100分），并可识别出参与度较低的学生个体（不存储身份，仅用于实时提醒）。该技能可辅助教师调整教学节奏，关注学习困难学生。应用场景：中小学教室、培训课堂、在线教育（需拍摄学生）。系统实时分析，为教师提供参与度热力图和异常提醒。技能特点：教师难以实时关注每个学生的表情状态。通过AI辅助分析，可帮助教师及时发现学生困惑或无聊，调整教学策略，提高教学质量。该技能可集成到智慧教室系统或录播设备中。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的课堂教学分析 AI。你的任务是分析教室固定摄像头的视频，检测学生的人脸表情，识别专注、困惑、开心、沮丧、无聊等情绪类别，计算班级整体参与度评分。不存储学生身份信息，仅输出群体统计和匿名化的低参与度提示（仅返回座位坐标），作为教师实时教学辅助。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于教室固定摄像头视频，识别学生面部 6 类情绪（focused / confused / happy / frustrated / bored / neutral）+ 头部朝向 + 举手互动 → 输出班级群体参与度评分（0-100）→ 输出匿名低参与度座位坐标 + 困惑集中座位 + 教师实时教学建议 + 参与度热力图\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 人脸检测（不做身份关联） |\n| 2 | 6 类情绪分类 |\n| 3 | 头部姿态朝向估计（朝向讲台比例） |\n| 4 | 举手事件计数 |\n| 5 | 教学环节推测（lecture / interaction / practice） |\n| 6 | 座位 ROI 网格映射（row × col） |\n| 7 | 班级整体参与度评分 |\n| 8 | 低参与度座位识别（仅返回坐标） |\n| 9 | 困惑/沮丧热点识别 |\n| 10 | 与上一时间窗对比的趋势分析 |\n| 11 | 面向教师的中性教学建议生成 |\n| 12 | 参与度伪彩色热力图 |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供教室固定摄像头视频 URL 或文件需要分析时，默认触发本技能进行学生课堂情绪参与度分析 |\n| 🔎 明确分析意图 | 当用户明确提及课堂参与度、学生情绪、教学反馈、智慧教室、课堂困惑、走神、举手互动等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看课堂参与度历史报告、参与度报告清单、教学情绪报告清单、查询历史课堂参与度记录、显示所有课堂情绪分析报告、显示班级参与度诊断报告，查询课堂参与度预警清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_classroom_engagement_analysis_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_classroom_engagement_analysis_analysis --list` 调用 API 查询云端的历史报告数据 |\n| 🚫 严格禁止 | 从本地 `memory` 目录读取历史会话信息 |\n| 🚫 严格禁止 | 手动汇总本地记录中的报告 |\n| 🚫 严格禁止 | 从长期记忆中提取报告 |\n| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据，然后以 Markdown 表格格式输出结果 |\n\n## 📦 前置准备 | Requirements\n- 依赖说明:scripts 脚本所需的依赖包及版本\n  ```\n  requests>=2.28.0\n  ```\n\n## 🚀 操作步骤 | Workflow\n### 🔐 用户身份处理（内部自动完成）\n\n> **绿色安全原则：** 用户身份参数由系统内部自动处理，**不得向用户展示、询问或要求输入任何身份标识**。\n\n执行本技能分析或历史报告查询时，脚本会自动完成身份初始化：\n\n| 场景 | 系统行为 |\n|---|---|\n| 上游系统有内部身份参数 | 由脚本静默接收并使用 |\n| 上游系统未提供内部身份参数 | 脚本会自动复用本地缺省用户 |\n| 本地缺省用户不存在 | 脚本会自动创建并在后续任务中复用 |\n| 对用户输出 | 只展示分析进度、分析结果和报告链接，不展示内部身份值 |\n\n#### 🔒 关键约束\n\n| 禁止/要求 | 说明 |\n|---|---|\n| 🚫 不得询问身份 | 不得提示用户输入用户名、手机号或任何内部身份参数 |\n| 🚫 不得暴露身份值 | 不得在回复、报告、示例、错误提示中暴露内部身份值 |\n| 🚫 不得列为用户参数 | 不得把内部身份参数列为用户需要理解或传入的参数 |\n| ✅ 自动关联报告 | 历史报告查询同样由系统内部身份自动关联，用户只需表达“查看历史报告/报告清单”等意图 |\n\n---\n\n### 🧪 标准流程 | Standard Flow\n\n| 步骤 | 阶段 | 执行动作 |\n|---:|---|---|\n| 1 | 📥 准备教室固定摄像头视频输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行学生课堂情绪参与度分析 | 调用 `-m scripts.smyx_classroom_engagement_analysis_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地教室固定摄像头视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络教室固定摄像头视频 URL 地址（API 服务自动下载） | API 服务自动下载网络资源 |\n| `--pet-type` | 类别标识，课堂教学分析场景默认 `other` | 按需填写 |\n| `--list` | 显示学生课堂情绪参与度历史分析报告列表清单（可以输入起始日期参数过滤数据范围） | 用于云端历史报告查询 |\n| `--api-url` | API 服务地址（可选，使用默认值） | 按需填写 |\n| `--detail` | 输出详细程度（basic/standard/json，默认 json） | 输出详细程度 |\n| `--output` | 结果输出文件路径（可选） | 可选 |\n\n## 🗂️ 资源索引 | Resource Index\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_classroom_engagement_analysis_analysis.py`](scripts/smyx_classroom_engagement_analysis_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；**关键**：讲台对面/斜侧高位、覆盖大部分学生脸部 |\n| 🔎 使用提醒 | 在线教育场景需确保学生摄像头开启且采集合法合规 |\n| 🔎 使用提醒 | 部分日常表情（思考、记笔记低头）易被误识为\"无聊\"或\"困惑\"，建议结合短时序均值 |\n| 🔎 使用提醒 | 教学环节切换（如讲解 → 练习）期间短暂参与度下降视为正常，不应立即触发提醒 |\n| 🔎 使用提醒 | 强匿名约束：本工具**禁止**做人脸识别 / 学生身份绑定；**禁止**用于学生绩效评估、家长沟通或公开排名；**禁止**长期存储原始视频或可识别个人特征的数据 |\n| 🔎 使用提醒 | 合规要点：涉及未成年人，必须取得**学校 + 家长**双重知情同意，并明确告知用途与数据保存期限；建议由教务处统一备案 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地教室视频\npython -m scripts.smyx_classroom_engagement_analysis_analysis --input /path/to/classroom.mp4\n\n# 分析网络教室视频\npython -m scripts.smyx_classroom_engagement_analysis_analysis --url https://example.com/classroom.mp4\n\n# 显示历史学生课堂情绪参与度报告（自动触发关键词：查看课堂参与度历史报告、参与度报告清单等）\npython -m scripts.smyx_classroom_engagement_analysis_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_classroom_engagement_analysis_analysis --input classroom.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_classroom_engagement_analysis_analysis --input classroom.mp4 --output result.json\n```\n\nFile v1.0.11:_meta.json\n\n{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-classroom-engagement-analysis-analysis\",\n  \"version\": \"1.0.11\",\n  \"publishedAt\": 1789313550026\n}\n\nFile v1.0.11:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放学生课堂情绪参与度分析 API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动学生课堂情绪参与度分析任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取群体参与度评分 + 匿名低参与度提示\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史参与度报告\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告（含参与度热力图）\n\n## 场景代码\n\n- `SMYX_CLASSROOM_ENGAGEMENT_ANALYSIS_ANALYSIS` - 学生课堂情绪参与度分析\n\n## 输入约束\n\n- 摄像头：中小学教室 / 培训课堂 / 在线教育（需拍摄学生）固定摄像头，**讲台对面或斜侧高位**，画面应覆盖大部分学生脸部\n- 帧率 ≥ 5 FPS（推荐 10-15 FPS）；分辨率 ≥ 720p；光照稳定避免逆光\n- 视频时长建议 ≥ 5 分钟，匹配教学环节（导入 / 讲解 / 互动 / 练习）\n- 初次部署需标定教室座位 ROI 网格（row × col，如 6×8，用于热力图坐标）\n- **匿名约束**：不进行人脸识别 / 人脸比对 / 学生身份绑定；低参与度提醒仅返回座位坐标（如 row=3, col=2），不返回学生姓名\n\n## 关键观测信号\n\n- `student_count_detected` - 当前帧检测到的学生人数\n- `emotion_distribution` - 班级情绪分布（focused / confused / happy / frustrated / bored / neutral 占比）\n- `focus_ratio` - 专注比例（focused + 适度 happy + 适度 neutral）\n- `confusion_ratio` - 困惑比例（confused / frustrated）\n- `bored_ratio` - 无聊比例（bored + 走神：头部偏离讲台方向 + 长时间垂眼）\n- `head_pose_toward_teacher_ratio` - 头部朝向讲台比例（参考指标）\n- `hand_raise_event_count` - 举手互动次数（参考指标）\n- `engagement_score` - 班级整体参与度评分（0-100）\n- `low_engagement_seats` - 低参与度座位坐标数组（仅 row/col，不绑定身份）\n\n## 阈值与等级\n\n- `≥ 80` - 高参与度（excellent）\n- `60-79` - 良好参与度（good）\n- `40-59` - 中等参与度（fair）→ 建议教师调整节奏\n- `< 40` - 低参与度（low）→ 触发实时提醒\n- 教学环节切换（如从讲解 → 练习）时短暂下降视为正常\n\n## 输出字段（参考）\n\n- `time_window` - 采样时间窗口\n- `teaching_phase_hint` - 推测教学环节（lecture / interaction / practice / unknown）\n- `student_count_detected` / `emotion_distribution` / `focus_ratio` / `confusion_ratio` / `bored_ratio` / `head_pose_toward_teacher_ratio` / `hand_raise_event_count`\n- `engagement_score` - 班级整体参与度评分\n- `engagement_level` - 等级（excellent / good / fair / low）\n- `low_engagement_seats` - 低参与度座位坐标数组（[{row, col}, ...]，**不含身份**）\n- `confusion_hotspot_seats` - 困惑表情集中座位（[{row, col}, ...]）\n- `trend_vs_last_window` - 相比上一时间窗变化（delta_pct）\n- `alert_type` - 提醒类型（low_engagement / high_confusion / improving / normal）\n- `alert_level` - 提醒级别（info / notice / warning）\n- `teacher_suggestion` - 教师建议（如\"班级整体参与度 38（low），建议穿插一个 2 分钟小组讨论或提问环节；困惑集中在 row=3 col=2 附近，建议复述刚才的概念\"）\n- `engagement_heatmap_image_url` - 参与度热力图 URL（叠加在教室座位图上）\n\n## 强制隐私约束\n\n- ❌ **禁止**进行人脸识别 / 人脸比对 / 学生身份绑定\n- ❌ **禁止**将\"低参与度\"用于学生绩效评估、家长沟通或公开排名\n- ❌ **禁止**长期存储原始视频或可识别个人特征的数据\n- ✅ 仅输出**班级群体聚合** + **座位坐标级别**的匿名提示，作为教师**实时**辅助参考\n- ✅ 涉及未成年人，必须取得**学校 + 家长**双重知情同意，并明确告知用途与数据保存期限\n\n> 仅输出基于视觉的群体行为聚合统计与教学辅助提示，**不构成对任何学生的能力评价、心理诊断或个人画像**；任何针对个体的关怀沟通应由教师 / 心理老师依据课堂观察与自愿性谈话进行。\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: dev\n\nFile v1.0.11:skill-card.md\n\n## Description:\n\nUsing a fixed classroom camera, the system analyzes students' facial expressions, computes a class-level engagement score, and returns anonymous low-engagement seat-position prompts, heatmaps, alerts, suggestions, and historical report access for teacher support.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[18072937735](https://clawhub.ai/user/18072937735)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nExternal educators, school operators, and smart-classroom integrators use this skill to analyze classroom video or image inputs for group engagement trends, anonymous seat-level alerts, heatmaps, teaching suggestions, and cloud report history. It is intended as teaching support, not student identity recognition, performance ranking, psychological diagnosis, or parent-facing evaluation.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Sensitive classroom video may be sent to cloud APIs, including footage of minors.\n\nMitigation: Use only with documented school and guardian consent, approved endpoints, defined retention/deletion rules, and privacy approval for the deployment.\n\nRisk: Plaintext HTTP defaults or unapproved endpoints could expose classroom media or report data in transit.\n\nMitigation: Configure and verify approved HTTPS service URLs before analyzing real classroom inputs or querying historical reports.\n\nRisk: Stored account tokens and historical report access can expose protected classroom analysis records.\n\nMitigation: Review token storage, report access controls, retention, deletion, and audit procedures before installation.\n\nRisk: Engagement and emotion classifications can be inaccurate or misused as individual assessment.\n\nMitigation: Treat results as real-time teaching support only; keep outputs aggregated or seat-coordinate based and prohibit identity binding, ranking, parent communication, or psychological diagnosis.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/18072937735/skills/smyx-classroom-engagement-analysis-analysis)\n- [Skill demo](https://lifeemergence.com/sample.html)\n- [API documentation](artifact/references/api_doc.md)\n- [SMYX analysis API documentation](artifact/skills/smyx_analysis/references/api_doc.md)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, JSON, shell commands, guidance]\n\n**Output Format:** [Markdown and JSON-style structured analysis reports, including report links when available]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May include class engagement scores, emotion distributions, anonymous seat coordinates, alerts, teacher suggestions, heatmap image URLs, and historical report records.]\n\n## Skill Version(s):\n\n1.0.11 (source: server release metadata; artifact frontmatter reports 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.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, 41786 bytes\n\nFiles: references/api_doc.md (4317b), scripts/__init__.py (48b), scripts/config.py (691b), scripts/config.yaml (3b), scripts/skill.py (582b), scripts/smyx_classroom_engagement_analysis_analysis.py (3657b), skill-card.md (2968b), SKILL.md (12522b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (24363b), skills/smyx_common/scripts/config.yaml (472b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28776b), _meta.json (163b)\n\nFile v1.0.10:SKILL.md\n\n---\nname: \"smyx-classroom-engagement-analysis-analysis\"\ndescription: \"Using a fixed classroom camera, the system analyzes students' facial expressions (focused, confused, happy, frustrated, bored, etc.), computes a class-level overall engagement score (0-100), and can identify low-engagement student positions (no identity stored — for real-time teacher reminders only). Real-time analysis provides engagement heatmaps and abnormal alerts. | 通过教室固定摄像头，分析学生面部表情（专注、困惑、开心、沮丧、无聊等），计算班级整体参与度评分（0-100分），并可识别出参与度较低的学生个体（不存储身份，仅用于实时提醒）。该技能可辅助教师调整教学节奏，关注学习困难学生。\"\nversion: \"1.0.10\"\nlicense: \"MIT-0\"\n---\n\n# 🏫 Student Classroom Engagement Analysis | 学生课堂情绪参与度分析\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **学生课堂情绪参与度分析** |\n| 🎯 核心目标 | 通过教室固定摄像头，分析学生面部表情（专注、困惑、开心、沮丧、无聊等），计算班级整体参与度评分（0-100分），并可识别出参与度较低的学生个体（不存储身份，仅用于实时提醒）。该技能可辅助教师调整教学节奏，关注学习困难学生。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_CLASSROOM_ENGAGEMENT_ANALYSIS_ANALYSIS` |\n\nUsing a fixed classroom camera, the system analyzes students' facial expressions (focused, confused, happy, frustrated, bored, etc.), computes a class-level overall engagement score (0-100), and can identify low-engagement student positions (no identity stored — for real-time teacher reminders only). The skill helps teachers adjust teaching pace and pay attention to students having learning difficulty. Application scenarios: K-12 classrooms, training courses, online education (students must be on camera). Real-time analysis provides engagement heatmaps and abnormal alerts. Skill features: it is difficult for a teacher to monitor every student's facial state in real time. AI-assisted analysis helps teachers timely detect confusion or boredom, adjust teaching strategy, and improve quality. Can be integrated into smart-classroom systems or lecture-recording devices.\n\n通过教室固定摄像头，分析学生面部表情（专注、困惑、开心、沮丧、无聊等），计算班级整体参与度评分（0-100分），并可识别出参与度较低的学生个体（不存储身份，仅用于实时提醒）。该技能可辅助教师调整教学节奏，关注学习困难学生。应用场景：中小学教室、培训课堂、在线教育（需拍摄学生）。系统实时分析，为教师提供参与度热力图和异常提醒。技能特点：教师难以实时关注每个学生的表情状态。通过AI辅助分析，可帮助教师及时发现学生困惑或无聊，调整教学策略，提高教学质量。该技能可集成到智慧教室系统或录播设备中。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的课堂教学分析 AI。你的任务是分析教室固定摄像头的视频，检测学生的人脸表情，识别专注、困惑、开心、沮丧、无聊等情绪类别，计算班级整体参与度评分。不存储学生身份信息，仅输出群体统计和匿名化的低参与度提示（仅返回座位坐标），作为教师实时教学辅助。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于教室固定摄像头视频，识别学生面部 6 类情绪（focused / confused / happy / frustrated / bored / neutral）+ 头部朝向 + 举手互动 → 输出班级群体参与度评分（0-100）→ 输出匿名低参与度座位坐标 + 困惑集中座位 + 教师实时教学建议 + 参与度热力图\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 人脸检测（不做身份关联） |\n| 2 | 6 类情绪分类 |\n| 3 | 头部姿态朝向估计（朝向讲台比例） |\n| 4 | 举手事件计数 |\n| 5 | 教学环节推测（lecture / interaction / practice） |\n| 6 | 座位 ROI 网格映射（row × col） |\n| 7 | 班级整体参与度评分 |\n| 8 | 低参与度座位识别（仅返回坐标） |\n| 9 | 困惑/沮丧热点识别 |\n| 10 | 与上一时间窗对比的趋势分析 |\n| 11 | 面向教师的中性教学建议生成 |\n| 12 | 参与度伪彩色热力图 |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供教室固定摄像头视频 URL 或文件需要分析时，默认触发本技能进行学生课堂情绪参与度分析 |\n| 🔎 明确分析意图 | 当用户明确提及课堂参与度、学生情绪、教学反馈、智慧教室、课堂困惑、走神、举手互动等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看课堂参与度历史报告、参与度报告清单、教学情绪报告清单、查询历史课堂参与度记录、显示所有课堂情绪分析报告、显示班级参与度诊断报告，查询课堂参与度预警清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_classroom_engagement_analysis_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_classroom_engagement_analysis_analysis --list` 调用 API 查询云端的历史报告数据 |\n| 🚫 严格禁止 | 从本地 `memory` 目录读取历史会话信息 |\n| 🚫 严格禁止 | 手动汇总本地记录中的报告 |\n| 🚫 严格禁止 | 从长期记忆中提取报告 |\n| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据，然后以 Markdown 表格格式输出结果 |\n\n## 📦 前置准备 | Requirements\n- 依赖说明:scripts 脚本所需的依赖包及版本\n  ```\n  requests>=2.28.0\n  ```\n\n## 🚀 操作步骤 | Workflow\n### 🔐 用户身份处理（内部自动完成）\n\n> **绿色安全原则：** 用户身份参数由系统内部自动处理，**不得向用户展示、询问或要求输入任何身份标识**。\n\n执行本技能分析或历史报告查询时，脚本会自动完成身份初始化：\n\n| 场景 | 系统行为 |\n|---|---|\n| 上游系统有内部身份参数 | 由脚本静默接收并使用 |\n| 上游系统未提供内部身份参数 | 脚本会自动复用本地缺省用户 |\n| 本地缺省用户不存在 | 脚本会自动创建并在后续任务中复用 |\n| 对用户输出 | 只展示分析进度、分析结果和报告链接，不展示内部身份值 |\n\n#### 🔒 关键约束\n\n| 禁止/要求 | 说明 |\n|---|---|\n| 🚫 不得询问身份 | 不得提示用户输入用户名、手机号或任何内部身份参数 |\n| 🚫 不得暴露身份值 | 不得在回复、报告、示例、错误提示中暴露内部身份值 |\n| 🚫 不得列为用户参数 | 不得把内部身份参数列为用户需要理解或传入的参数 |\n| ✅ 自动关联报告 | 历史报告查询同样由系统内部身份自动关联，用户只需表达“查看历史报告/报告清单”等意图 |\n\n---\n\n### 🧪 标准流程 | Standard Flow\n\n| 步骤 | 阶段 | 执行动作 |\n|---:|---|---|\n| 1 | 📥 准备教室固定摄像头视频输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行学生课堂情绪参与度分析 | 调用 `-m scripts.smyx_classroom_engagement_analysis_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地教室固定摄像头视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络教室固定摄像头视频 URL 地址（API 服务自动下载） | API 服务自动下载网络资源 |\n| `--pet-type` | 类别标识，课堂教学分析场景默认 `other` | 按需填写 |\n| `--list` | 显示学生课堂情绪参与度历史分析报告列表清单（可以输入起始日期参数过滤数据范围） | 用于云端历史报告查询 |\n| `--api-url` | API 服务地址（可选，使用默认值） | 按需填写 |\n| `--detail` | 输出详细程度（basic/standard/json，默认 json） | 输出详细程度 |\n| `--output` | 结果输出文件路径（可选） | 可选 |\n\n## 🗂️ 资源索引 | Resource Index\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_classroom_engagement_analysis_analysis.py`](scripts/smyx_classroom_engagement_analysis_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；**关键**：讲台对面/斜侧高位、覆盖大部分学生脸部 |\n| 🔎 使用提醒 | 在线教育场景需确保学生摄像头开启且采集合法合规 |\n| 🔎 使用提醒 | 部分日常表情（思考、记笔记低头）易被误识为\"无聊\"或\"困惑\"，建议结合短时序均值 |\n| 🔎 使用提醒 | 教学环节切换（如讲解 → 练习）期间短暂参与度下降视为正常，不应立即触发提醒 |\n| 🔎 使用提醒 | 强匿名约束：本工具**禁止**做人脸识别 / 学生身份绑定；**禁止**用于学生绩效评估、家长沟通或公开排名；**禁止**长期存储原始视频或可识别个人特征的数据 |\n| 🔎 使用提醒 | 合规要点：涉及未成年人，必须取得**学校 + 家长**双重知情同意，并明确告知用途与数据保存期限；建议由教务处统一备案 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地教室视频\npython -m scripts.smyx_classroom_engagement_analysis_analysis --input /path/to/classroom.mp4\n\n# 分析网络教室视频\npython -m scripts.smyx_classroom_engagement_analysis_analysis --url https://example.com/classroom.mp4\n\n# 显示历史学生课堂情绪参与度报告（自动触发关键词：查看课堂参与度历史报告、参与度报告清单等）\npython -m scripts.smyx_classroom_engagement_analysis_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_classroom_engagement_analysis_analysis --input classroom.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_classroom_engagement_analysis_analysis --input classroom.mp4 --output result.json\n```\n\nFile v1.0.10:_meta.json\n\n{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-classroom-engagement-analysis-analysis\",\n  \"version\": \"1.0.10\",\n  \"publishedAt\": 1787742151412\n}\n\nFile v1.0.10:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放学生课堂情绪参与度分析 API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动学生课堂情绪参与度分析任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取群体参与度评分 + 匿名低参与度提示\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史参与度报告\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告（含参与度热力图）\n\n## 场景代码\n\n- `SMYX_CLASSROOM_ENGAGEMENT_ANALYSIS_ANALYSIS` - 学生课堂情绪参与度分析\n\n## 输入约束\n\n- 摄像头：中小学教室 / 培训课堂 / 在线教育（需拍摄学生）固定摄像头，**讲台对面或斜侧高位**，画面应覆盖大部分学生脸部\n- 帧率 ≥ 5 FPS（推荐 10-15 FPS）；分辨率 ≥ 720p；光照稳定避免逆光\n- 视频时长建议 ≥ 5 分钟，匹配教学环节（导入 / 讲解 / 互动 / 练习）\n- 初次部署需标定教室座位 ROI 网格（row × col，如 6×8，用于热力图坐标）\n- **匿名约束**：不进行人脸识别 / 人脸比对 / 学生身份绑定；低参与度提醒仅返回座位坐标（如 row=3, col=2），不返回学生姓名\n\n## 关键观测信号\n\n- `student_count_detected` - 当前帧检测到的学生人数\n- `emotion_distribution` - 班级情绪分布（focused / confused / happy / frustrated / bored / neutral 占比）\n- `focus_ratio` - 专注比例（focused + 适度 happy + 适度 neutral）\n- `confusion_ratio` - 困惑比例（confused / frustrated）\n- `bored_ratio` - 无聊比例（bored + 走神：头部偏离讲台方向 + 长时间垂眼）\n- `head_pose_toward_teacher_ratio` - 头部朝向讲台比例（参考指标）\n- `hand_raise_event_count` - 举手互动次数（参考指标）\n- `engagement_score` - 班级整体参与度评分（0-100）\n- `low_engagement_seats` - 低参与度座位坐标数组（仅 row/col，不绑定身份）\n\n## 阈值与等级\n\n- `≥ 80` - 高参与度（excellent）\n- `60-79` - 良好参与度（good）\n- `40-59` - 中等参与度（fair）→ 建议教师调整节奏\n- `< 40` - 低参与度（low）→ 触发实时提醒\n- 教学环节切换（如从讲解 → 练习）时短暂下降视为正常\n\n## 输出字段（参考）\n\n- `time_window` - 采样时间窗口\n- `teaching_phase_hint` - 推测教学环节（lecture / interaction / practice / unknown）\n- `student_count_detected` / `emotion_distribution` / `focus_ratio` / `confusion_ratio` / `bored_ratio` / `head_pose_toward_teacher_ratio` / `hand_raise_event_count`\n- `engagement_score` - 班级整体参与度评分\n- `engagement_level` - 等级（excellent / good / fair / low）\n- `low_engagement_seats` - 低参与度座位坐标数组（[{row, col}, ...]，**不含身份**）\n- `confusion_hotspot_seats` - 困惑表情集中座位（[{row, col}, ...]）\n- `trend_vs_last_window` - 相比上一时间窗变化（delta_pct）\n- `alert_type` - 提醒类型（low_engagement / high_confusion / improving / normal）\n- `alert_level` - 提醒级别（info / notice / warning）\n- `teacher_suggestion` - 教师建议（如\"班级整体参与度 38（low），建议穿插一个 2 分钟小组讨论或提问环节；困惑集中在 row=3 col=2 附近，建议复述刚才的概念\"）\n- `engagement_heatmap_image_url` - 参与度热力图 URL（叠加在教室座位图上）\n\n## 强制隐私约束\n\n- ❌ **禁止**进行人脸识别 / 人脸比对 / 学生身份绑定\n- ❌ **禁止**将\"低参与度\"用于学生绩效评估、家长沟通或公开排名\n- ❌ **禁止**长期存储原始视频或可识别个人特征的数据\n- ✅ 仅输出**班级群体聚合** + **座位坐标级别**的匿名提示，作为教师**实时**辅助参考\n- ✅ 涉及未成年人，必须取得**学校 + 家长**双重知情同意，并明确告知用途与数据保存期限\n\n> 仅输出基于视觉的群体行为聚合统计与教学辅助提示，**不构成对任何学生的能力评价、心理诊断或个人画像**；任何针对个体的关怀沟通应由教师 / 心理老师依据课堂观察与自愿性谈话进行。\n\nFile v1.0.10:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.10:scripts/config.yaml\n\n{}\n\nFile v1.0.10:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.10:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.10:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.10:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: dev\n\nFile v1.0.10:skill-card.md\n\n## Description:\n\nAnalyzes fixed classroom camera images or video to summarize facial-expression-based classroom engagement, class-level scores, anonymous low-engagement seat coordinates, heatmaps, alerts, and teacher-facing suggestions.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[18072937735](https://clawhub.ai/user/18072937735)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nTeachers, school operators, and smart-classroom developers use this skill to analyze classroom video or image inputs and receive aggregate engagement metrics, anonymous seat-level prompts, report links, and instructional suggestions. It is intended as teaching support, not as student identity recognition, student ranking, diagnosis, or performance evaluation.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Student classroom video is uploaded to a cloud API for analysis.\n\nMitigation: Confirm the API operator, storage location, retention period, access controls, and school plus parent consent before using the skill in any child-facing setting.\n\nRisk: Historical reports and report export links may remain accessible through cloud services.\n\nMitigation: Limit report access to authorized staff, define deletion and retention procedures, and verify that report links do not expose identifiable student data.\n\nRisk: The skill silently creates or reuses local account credentials and tokens.\n\nMitigation: Run it in an isolated workspace, inspect and protect local credential storage, and remove local tokens and generated account data after use when they are no longer needed.\n\nRisk: Facial-expression and posture signals can be misread as low engagement or confusion.\n\nMitigation: Use outputs only as aggregate teaching support and require human review before acting on seat-level prompts or classroom interventions.\n\n## Reference(s):\n\n- [ClawHub Skill Page](https://clawhub.ai/18072937735/skills/smyx-classroom-engagement-analysis-analysis)\n- [Skill Demo](https://lifeemergence.com/sample.html)\n- [Classroom Engagement API Documentation](references/api_doc.md)\n- [SMYX Analysis API Documentation](skills/smyx_analysis/references/api_doc.md)\n\n## Skill Output:\n\n**Output Type(s):** [Text, Markdown, JSON, Files, Guidance]\n\n**Output Format:** [Markdown and JSON-formatted text, with optional saved output files and report links]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May include class engagement scores, emotion distributions, anonymous seat coordinates, heatmap image URLs, alert levels, teacher suggestions, and historical report listings.]\n\n## Skill Version(s):\n\n1.0.10 (source: frontmatter and server release metadata)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v1.0.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, 41904 bytes\n\nFiles: references/api_doc.md (4317b), scripts/__init__.py (48b), scripts/config.py (691b), scripts/config.yaml (3b), scripts/skill.py (582b), scripts/smyx_classroom_engagement_analysis_analysis.py (3657b), skill-card.md (3323b), SKILL.md (12522b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (24363b), skills/smyx_common/scripts/config.yaml (472b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28776b), _meta.json (162b)\n\nFile v1.0.9:SKILL.md\n\n---\nname: \"smyx-classroom-engagement-analysis-analysis\"\ndescription: \"Using a fixed classroom camera, the system analyzes students' facial expressions (focused, confused, happy, frustrated, bored, etc.), computes a class-level overall engagement score (0-100), and can identify low-engagement student positions (no identity stored — for real-time teacher reminders only). Real-time analysis provides engagement heatmaps and abnormal alerts. | 通过教室固定摄像头，分析学生面部表情（专注、困惑、开心、沮丧、无聊等），计算班级整体参与度评分（0-100分），并可识别出参与度较低的学生个体（不存储身份，仅用于实时提醒）。该技能可辅助教师调整教学节奏，关注学习困难学生。\"\nversion: \"1.0.10\"\nlicense: \"MIT-0\"\n---\n\n# 🏫 Student Classroom Engagement Analysis | 学生课堂情绪参与度分析\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **学生课堂情绪参与度分析** |\n| 🎯 核心目标 | 通过教室固定摄像头，分析学生面部表情（专注、困惑、开心、沮丧、无聊等），计算班级整体参与度评分（0-100分），并可识别出参与度较低的学生个体（不存储身份，仅用于实时提醒）。该技能可辅助教师调整教学节奏，关注学习困难学生。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_CLASSROOM_ENGAGEMENT_ANALYSIS_ANALYSIS` |\n\nUsing a fixed classroom camera, the system analyzes students' facial expressions (focused, confused, happy, frustrated, bored, etc.), computes a class-level overall engagement score (0-100), and can identify low-engagement student positions (no identity stored — for real-time teacher reminders only). The skill helps teachers adjust teaching pace and pay attention to students having learning difficulty. Application scenarios: K-12 classrooms, training courses, online education (students must be on camera). Real-time analysis provides engagement heatmaps and abnormal alerts. Skill features: it is difficult for a teacher to monitor every student's facial state in real time. AI-assisted analysis helps teachers timely detect confusion or boredom, adjust teaching strategy, and improve quality. Can be integrated into smart-classroom systems or lecture-recording devices.\n\n通过教室固定摄像头，分析学生面部表情（专注、困惑、开心、沮丧、无聊等），计算班级整体参与度评分（0-100分），并可识别出参与度较低的学生个体（不存储身份，仅用于实时提醒）。该技能可辅助教师调整教学节奏，关注学习困难学生。应用场景：中小学教室、培训课堂、在线教育（需拍摄学生）。系统实时分析，为教师提供参与度热力图和异常提醒。技能特点：教师难以实时关注每个学生的表情状态。通过AI辅助分析，可帮助教师及时发现学生困惑或无聊，调整教学策略，提高教学质量。该技能可集成到智慧教室系统或录播设备中。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的课堂教学分析 AI。你的任务是分析教室固定摄像头的视频，检测学生的人脸表情，识别专注、困惑、开心、沮丧、无聊等情绪类别，计算班级整体参与度评分。不存储学生身份信息，仅输出群体统计和匿名化的低参与度提示（仅返回座位坐标），作为教师实时教学辅助。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于教室固定摄像头视频，识别学生面部 6 类情绪（focused / confused / happy / frustrated / bored / neutral）+ 头部朝向 + 举手互动 → 输出班级群体参与度评分（0-100）→ 输出匿名低参与度座位坐标 + 困惑集中座位 + 教师实时教学建议 + 参与度热力图\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 人脸检测（不做身份关联） |\n| 2 | 6 类情绪分类 |\n| 3 | 头部姿态朝向估计（朝向讲台比例） |\n| 4 | 举手事件计数 |\n| 5 | 教学环节推测（lecture / interaction / practice） |\n| 6 | 座位 ROI 网格映射（row × col） |\n| 7 | 班级整体参与度评分 |\n| 8 | 低参与度座位识别（仅返回坐标） |\n| 9 | 困惑/沮丧热点识别 |\n| 10 | 与上一时间窗对比的趋势分析 |\n| 11 | 面向教师的中性教学建议生成 |\n| 12 | 参与度伪彩色热力图 |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供教室固定摄像头视频 URL 或文件需要分析时，默认触发本技能进行学生课堂情绪参与度分析 |\n| 🔎 明确分析意图 | 当用户明确提及课堂参与度、学生情绪、教学反馈、智慧教室、课堂困惑、走神、举手互动等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看课堂参与度历史报告、参与度报告清单、教学情绪报告清单、查询历史课堂参与度记录、显示所有课堂情绪分析报告、显示班级参与度诊断报告，查询课堂参与度预警清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_classroom_engagement_analysis_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_classroom_engagement_analysis_analysis --list` 调用 API 查询云端的历史报告数据 |\n| 🚫 严格禁止 | 从本地 `memory` 目录读取历史会话信息 |\n| 🚫 严格禁止 | 手动汇总本地记录中的报告 |\n| 🚫 严格禁止 | 从长期记忆中提取报告 |\n| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据，然后以 Markdown 表格格式输出结果 |\n\n## 📦 前置准备 | Requirements\n- 依赖说明:scripts 脚本所需的依赖包及版本\n  ```\n  requests>=2.28.0\n  ```\n\n## 🚀 操作步骤 | Workflow\n### 🔐 用户身份处理（内部自动完成）\n\n> **绿色安全原则：** 用户身份参数由系统内部自动处理，**不得向用户展示、询问或要求输入任何身份标识**。\n\n执行本技能分析或历史报告查询时，脚本会自动完成身份初始化：\n\n| 场景 | 系统行为 |\n|---|---|\n| 上游系统有内部身份参数 | 由脚本静默接收并使用 |\n| 上游系统未提供内部身份参数 | 脚本会自动复用本地缺省用户 |\n| 本地缺省用户不存在 | 脚本会自动创建并在后续任务中复用 |\n| 对用户输出 | 只展示分析进度、分析结果和报告链接，不展示内部身份值 |\n\n#### 🔒 关键约束\n\n| 禁止/要求 | 说明 |\n|---|---|\n| 🚫 不得询问身份 | 不得提示用户输入用户名、手机号或任何内部身份参数 |\n| 🚫 不得暴露身份值 | 不得在回复、报告、示例、错误提示中暴露内部身份值 |\n| 🚫 不得列为用户参数 | 不得把内部身份参数列为用户需要理解或传入的参数 |\n| ✅ 自动关联报告 | 历史报告查询同样由系统内部身份自动关联，用户只需表达“查看历史报告/报告清单”等意图 |\n\n---\n\n### 🧪 标准流程 | Standard Flow\n\n| 步骤 | 阶段 | 执行动作 |\n|---:|---|---|\n| 1 | 📥 准备教室固定摄像头视频输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行学生课堂情绪参与度分析 | 调用 `-m scripts.smyx_classroom_engagement_analysis_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地教室固定摄像头视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络教室固定摄像头视频 URL 地址（API 服务自动下载） | API 服务自动下载网络资源 |\n| `--pet-type` | 类别标识，课堂教学分析场景默认 `other` | 按需填写 |\n| `--list` | 显示学生课堂情绪参与度历史分析报告列表清单（可以输入起始日期参数过滤数据范围） | 用于云端历史报告查询 |\n| `--api-url` | API 服务地址（可选，使用默认值） | 按需填写 |\n| `--detail` | 输出详细程度（basic/standard/json，默认 json） | 输出详细程度 |\n| `--output` | 结果输出文件路径（可选） | 可选 |\n\n## 🗂️ 资源索引 | Resource Index\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_classroom_engagement_analysis_analysis.py`](scripts/smyx_classroom_engagement_analysis_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；**关键**：讲台对面/斜侧高位、覆盖大部分学生脸部 |\n| 🔎 使用提醒 | 在线教育场景需确保学生摄像头开启且采集合法合规 |\n| 🔎 使用提醒 | 部分日常表情（思考、记笔记低头）易被误识为\"无聊\"或\"困惑\"，建议结合短时序均值 |\n| 🔎 使用提醒 | 教学环节切换（如讲解 → 练习）期间短暂参与度下降视为正常，不应立即触发提醒 |\n| 🔎 使用提醒 | 强匿名约束：本工具**禁止**做人脸识别 / 学生身份绑定；**禁止**用于学生绩效评估、家长沟通或公开排名；**禁止**长期存储原始视频或可识别个人特征的数据 |\n| 🔎 使用提醒 | 合规要点：涉及未成年人，必须取得**学校 + 家长**双重知情同意，并明确告知用途与数据保存期限；建议由教务处统一备案 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地教室视频\npython -m scripts.smyx_classroom_engagement_analysis_analysis --input /path/to/classroom.mp4\n\n# 分析网络教室视频\npython -m scripts.smyx_classroom_engagement_analysis_analysis --url https://example.com/classroom.mp4\n\n# 显示历史学生课堂情绪参与度报告（自动触发关键词：查看课堂参与度历史报告、参与度报告清单等）\npython -m scripts.smyx_classroom_engagement_analysis_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_classroom_engagement_analysis_analysis --input classroom.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_classroom_engagement_analysis_analysis --input classroom.mp4 --output result.json\n```\n\nFile v1.0.9:_meta.json\n\n{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-classroom-engagement-analysis-analysis\",\n  \"version\": \"1.0.9\",\n  \"publishedAt\": 1787275427740\n}\n\nFile v1.0.9:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放学生课堂情绪参与度分析 API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动学生课堂情绪参与度分析任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取群体参与度评分 + 匿名低参与度提示\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史参与度报告\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告（含参与度热力图）\n\n## 场景代码\n\n- `SMYX_CLASSROOM_ENGAGEMENT_ANALYSIS_ANALYSIS` - 学生课堂情绪参与度分析\n\n## 输入约束\n\n- 摄像头：中小学教室 / 培训课堂 / 在线教育（需拍摄学生）固定摄像头，**讲台对面或斜侧高位**，画面应覆盖大部分学生脸部\n- 帧率 ≥ 5 FPS（推荐 10-15 FPS）；分辨率 ≥ 720p；光照稳定避免逆光\n- 视频时长建议 ≥ 5 分钟，匹配教学环节（导入 / 讲解 / 互动 / 练习）\n- 初次部署需标定教室座位 ROI 网格（row × col，如 6×8，用于热力图坐标）\n- **匿名约束**：不进行人脸识别 / 人脸比对 / 学生身份绑定；低参与度提醒仅返回座位坐标（如 row=3, col=2），不返回学生姓名\n\n## 关键观测信号\n\n- `student_count_detected` - 当前帧检测到的学生人数\n- `emotion_distribution` - 班级情绪分布（focused / confused / happy / frustrated / bored / neutral 占比）\n- `focus_ratio` - 专注比例（focused + 适度 happy + 适度 neutral）\n- `confusion_ratio` - 困惑比例（confused / frustrated）\n- `bored_ratio` - 无聊比例（bored + 走神：头部偏离讲台方向 + 长时间垂眼）\n- `head_pose_toward_teacher_ratio` - 头部朝向讲台比例（参考指标）\n- `hand_raise_event_count` - 举手互动次数（参考指标）\n- `engagement_score` - 班级整体参与度评分（0-100）\n- `low_engagement_seats` - 低参与度座位坐标数组（仅 row/col，不绑定身份）\n\n## 阈值与等级\n\n- `≥ 80` - 高参与度（excellent）\n- `60-79` - 良好参与度（good）\n- `40-59` - 中等参与度（fair）→ 建议教师调整节奏\n- `< 40` - 低参与度（low）→ 触发实时提醒\n- 教学环节切换（如从讲解 → 练习）时短暂下降视为正常\n\n## 输出字段（参考）\n\n- `time_window` - 采样时间窗口\n- `teaching_phase_hint` - 推测教学环节（lecture / interaction / practice / unknown）\n- `student_count_detected` / `emotion_distribution` / `focus_ratio` / `confusion_ratio` / `bored_ratio` / `head_pose_toward_teacher_ratio` / `hand_raise_event_count`\n- `engagement_score` - 班级整体参与度评分\n- `engagement_level` - 等级（excellent / good / fair / low）\n- `low_engagement_seats` - 低参与度座位坐标数组（[{row, col}, ...]，**不含身份**）\n- `confusion_hotspot_seats` - 困惑表情集中座位（[{row, col}, ...]）\n- `trend_vs_last_window` - 相比上一时间窗变化（delta_pct）\n- `alert_type` - 提醒类型（low_engagement / high_confusion / improving / normal）\n- `alert_level` - 提醒级别（info / notice / warning）\n- `teacher_suggestion` - 教师建议（如\"班级整体参与度 38（low），建议穿插一个 2 分钟小组讨论或提问环节；困惑集中在 row=3 col=2 附近，建议复述刚才的概念\"）\n- `engagement_heatmap_image_url` - 参与度热力图 URL（叠加在教室座位图上）\n\n## 强制隐私约束\n\n- ❌ **禁止**进行人脸识别 / 人脸比对 / 学生身份绑定\n- ❌ **禁止**将\"低参与度\"用于学生绩效评估、家长沟通或公开排名\n- ❌ **禁止**长期存储原始视频或可识别个人特征的数据\n- ✅ 仅输出**班级群体聚合** + **座位坐标级别**的匿名提示，作为教师**实时**辅助参考\n- ✅ 涉及未成年人，必须取得**学校 + 家长**双重知情同意，并明确告知用途与数据保存期限\n\n> 仅输出基于视觉的群体行为聚合统计与教学辅助提示，**不构成对任何学生的能力评价、心理诊断或个人画像**；任何针对个体的关怀沟通应由教师 / 心理老师依据课堂观察与自愿性谈话进行。\n\nFile v1.0.9:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.9:scripts/config.yaml\n\n{}\n\nFile v1.0.9:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.9:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.9:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.9:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: dev\n\nFile v1.0.9:skill-card.md\n\n## Description:\n\nUsing a fixed classroom camera, the skill analyzes student facial expressions, head pose, and interaction signals to produce class-level engagement scores, anonymous low-engagement seat coordinates, heatmaps, alerts, teacher suggestions, and report links.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[18072937735](https://clawhub.ai/user/18072937735)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nTeachers, school staff, smart-classroom operators, and education-technology developers use this skill to analyze classroom video or image inputs for aggregate engagement trends and anonymous seat-level reminders. It is intended as teaching support, not student ranking, discipline, performance evaluation, psychological diagnosis, or individual profiling.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Student classroom videos or images may be processed by a third-party cloud service.\n\nMitigation: Use only with school and parent consent, confirm the publisher's retention and access controls, and avoid submitting footage unless cloud processing is acceptable.\n\nRisk: Cloud report history is tied to persistent user-linked state.\n\nMitigation: Treat report history as identity-linked data, restrict access to authorized school personnel, and periodically review stored reports and account linkage.\n\nRisk: Engagement signals and low-engagement seat coordinates may be misused for individual ranking, discipline, or performance evaluation.\n\nMitigation: Use outputs only as aggregate classroom support for teachers, and prohibit student ranking, disciplinary action, parent communications, psychological diagnosis, or individual profiling based on the skill output.\n\nRisk: Facial-expression and attention estimates can misclassify normal classroom behavior such as thinking, note-taking, or transitions between teaching phases.\n\nMitigation: Interpret results as advisory signals, review them with human classroom context, and avoid acting on short-term dips without corroborating observations.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/18072937735/skills/smyx-classroom-engagement-analysis-analysis)\n- [Skill demo](https://lifeemergence.com/sample.html)\n- [Student classroom engagement API documentation](artifact/references/api_doc.md)\n- [Shared SMYX analysis API documentation](artifact/skills/smyx_analysis/references/api_doc.md)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, code, shell commands, configuration, guidance]\n\n**Output Format:** [Markdown and JSON-like structured analysis text, with optional saved report output files and report export links]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Outputs can include engagement scores, emotion distributions, anonymous seat coordinates, heatmap links, alerts, teacher suggestions, history report lists, and cloud report export URLs.]\n\n## Skill Version(s):\n\n1.0.9 (source: server release metadata and target metadata; artifact/SKILL.md frontmatter states 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.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, 41677 bytes\n\nFiles: references/api_doc.md (4317b), scripts/__init__.py (48b), scripts/config.py (691b), scripts/config.yaml (3b), scripts/skill.py (582b), scripts/smyx_classroom_engagement_analysis_analysis.py (3657b), skill-card.md (2549b), SKILL.md (12521b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (24363b), skills/smyx_common/scripts/config.yaml (473b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28776b), _meta.json (162b)\n\nFile v1.0.8:SKILL.md\n\n---\nname: \"smyx-classroom-engagement-analysis-analysis\"\ndescription: \"Using a fixed classroom camera, the system analyzes students' facial expressions (focused, confused, happy, frustrated, bored, etc.), computes a class-level overall engagement score (0-100), and can identify low-engagement student positions (no identity stored — for real-time teacher reminders only). Real-time analysis provides engagement heatmaps and abnormal alerts. | 通过教室固定摄像头，分析学生面部表情（专注、困惑、开心、沮丧、无聊等），计算班级整体参与度评分（0-100分），并可识别出参与度较低的学生个体（不存储身份，仅用于实时提醒）。该技能可辅助教师调整教学节奏，关注学习困难学生。\"\nversion: \"1.0.8\"\nlicense: \"MIT-0\"\n---\n\n# 🏫 Student Classroom Engagement Analysis | 学生课堂情绪参与度分析\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **学生课堂情绪参与度分析** |\n| 🎯 核心目标 | 通过教室固定摄像头，分析学生面部表情（专注、困惑、开心、沮丧、无聊等），计算班级整体参与度评分（0-100分），并可识别出参与度较低的学生个体（不存储身份，仅用于实时提醒）。该技能可辅助教师调整教学节奏，关注学习困难学生。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_CLASSROOM_ENGAGEMENT_ANALYSIS_ANALYSIS` |\n\nUsing a fixed classroom camera, the system analyzes students' facial expressions (focused, confused, happy, frustrated, bored, etc.), computes a class-level overall engagement score (0-100), and can identify low-engagement student positions (no identity stored — for real-time teacher reminders only). The skill helps teachers adjust teaching pace and pay attention to students having learning difficulty. Application scenarios: K-12 classrooms, training courses, online education (students must be on camera). Real-time analysis provides engagement heatmaps and abnormal alerts. Skill features: it is difficult for a teacher to monitor every student's facial state in real time. AI-assisted analysis helps teachers timely detect confusion or boredom, adjust teaching strategy, and improve quality. Can be integrated into smart-classroom systems or lecture-recording devices.\n\n通过教室固定摄像头，分析学生面部表情（专注、困惑、开心、沮丧、无聊等），计算班级整体参与度评分（0-100分），并可识别出参与度较低的学生个体（不存储身份，仅用于实时提醒）。该技能可辅助教师调整教学节奏，关注学习困难学生。应用场景：中小学教室、培训课堂、在线教育（需拍摄学生）。系统实时分析，为教师提供参与度热力图和异常提醒。技能特点：教师难以实时关注每个学生的表情状态。通过AI辅助分析，可帮助教师及时发现学生困惑或无聊，调整教学策略，提高教学质量。该技能可集成到智慧教室系统或录播设备中。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的课堂教学分析 AI。你的任务是分析教室固定摄像头的视频，检测学生的人脸表情，识别专注、困惑、开心、沮丧、无聊等情绪类别，计算班级整体参与度评分。不存储学生身份信息，仅输出群体统计和匿名化的低参与度提示（仅返回座位坐标），作为教师实时教学辅助。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于教室固定摄像头视频，识别学生面部 6 类情绪（focused / confused / happy / frustrated / bored / neutral）+ 头部朝向 + 举手互动 → 输出班级群体参与度评分（0-100）→ 输出匿名低参与度座位坐标 + 困惑集中座位 + 教师实时教学建议 + 参与度热力图\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 人脸检测（不做身份关联） |\n| 2 | 6 类情绪分类 |\n| 3 | 头部姿态朝向估计（朝向讲台比例） |\n| 4 | 举手事件计数 |\n| 5 | 教学环节推测（lecture / interaction / practice） |\n| 6 | 座位 ROI 网格映射（row × col） |\n| 7 | 班级整体参与度评分 |\n| 8 | 低参与度座位识别（仅返回坐标） |\n| 9 | 困惑/沮丧热点识别 |\n| 10 | 与上一时间窗对比的趋势分析 |\n| 11 | 面向教师的中性教学建议生成 |\n| 12 | 参与度伪彩色热力图 |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供教室固定摄像头视频 URL 或文件需要分析时，默认触发本技能进行学生课堂情绪参与度分析 |\n| 🔎 明确分析意图 | 当用户明确提及课堂参与度、学生情绪、教学反馈、智慧教室、课堂困惑、走神、举手互动等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看课堂参与度历史报告、参与度报告清单、教学情绪报告清单、查询历史课堂参与度记录、显示所有课堂情绪分析报告、显示班级参与度诊断报告，查询课堂参与度预警清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_classroom_engagement_analysis_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_classroom_engagement_analysis_analysis --list` 调用 API 查询云端的历史报告数据 |\n| 🚫 严格禁止 | 从本地 `memory` 目录读取历史会话信息 |\n| 🚫 严格禁止 | 手动汇总本地记录中的报告 |\n| 🚫 严格禁止 | 从长期记忆中提取报告 |\n| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据，然后以 Markdown 表格格式输出结果 |\n\n## 📦 前置准备 | Requirements\n- 依赖说明:scripts 脚本所需的依赖包及版本\n  ```\n  requests>=2.28.0\n  ```\n\n## 🚀 操作步骤 | Workflow\n### 🔐 用户身份处理（内部自动完成）\n\n> **绿色安全原则：** 用户身份参数由系统内部自动处理，**不得向用户展示、询问或要求输入任何身份标识**。\n\n执行本技能分析或历史报告查询时，脚本会自动完成身份初始化：\n\n| 场景 | 系统行为 |\n|---|---|\n| 上游系统有内部身份参数 | 由脚本静默接收并使用 |\n| 上游系统未提供内部身份参数 | 脚本会自动复用本地缺省用户 |\n| 本地缺省用户不存在 | 脚本会自动创建并在后续任务中复用 |\n| 对用户输出 | 只展示分析进度、分析结果和报告链接，不展示内部身份值 |\n\n#### 🔒 关键约束\n\n| 禁止/要求 | 说明 |\n|---|---|\n| 🚫 不得询问身份 | 不得提示用户输入用户名、手机号或任何内部身份参数 |\n| 🚫 不得暴露身份值 | 不得在回复、报告、示例、错误提示中暴露内部身份值 |\n| 🚫 不得列为用户参数 | 不得把内部身份参数列为用户需要理解或传入的参数 |\n| ✅ 自动关联报告 | 历史报告查询同样由系统内部身份自动关联，用户只需表达“查看历史报告/报告清单”等意图 |\n\n---\n\n### 🧪 标准流程 | Standard Flow\n\n| 步骤 | 阶段 | 执行动作 |\n|---:|---|---|\n| 1 | 📥 准备教室固定摄像头视频输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行学生课堂情绪参与度分析 | 调用 `-m scripts.smyx_classroom_engagement_analysis_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地教室固定摄像头视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络教室固定摄像头视频 URL 地址（API 服务自动下载） | API 服务自动下载网络资源 |\n| `--pet-type` | 类别标识，课堂教学分析场景默认 `other` | 按需填写 |\n| `--list` | 显示学生课堂情绪参与度历史分析报告列表清单（可以输入起始日期参数过滤数据范围） | 用于云端历史报告查询 |\n| `--api-url` | API 服务地址（可选，使用默认值） | 按需填写 |\n| `--detail` | 输出详细程度（basic/standard/json，默认 json） | 输出详细程度 |\n| `--output` | 结果输出文件路径（可选） | 可选 |\n\n## 🗂️ 资源索引 | Resource Index\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_classroom_engagement_analysis_analysis.py`](scripts/smyx_classroom_engagement_analysis_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；**关键**：讲台对面/斜侧高位、覆盖大部分学生脸部 |\n| 🔎 使用提醒 | 在线教育场景需确保学生摄像头开启且采集合法合规 |\n| 🔎 使用提醒 | 部分日常表情（思考、记笔记低头）易被误识为\"无聊\"或\"困惑\"，建议结合短时序均值 |\n| 🔎 使用提醒 | 教学环节切换（如讲解 → 练习）期间短暂参与度下降视为正常，不应立即触发提醒 |\n| 🔎 使用提醒 | 强匿名约束：本工具**禁止**做人脸识别 / 学生身份绑定；**禁止**用于学生绩效评估、家长沟通或公开排名；**禁止**长期存储原始视频或可识别个人特征的数据 |\n| 🔎 使用提醒 | 合规要点：涉及未成年人，必须取得**学校 + 家长**双重知情同意，并明确告知用途与数据保存期限；建议由教务处统一备案 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地教室视频\npython -m scripts.smyx_classroom_engagement_analysis_analysis --input /path/to/classroom.mp4\n\n# 分析网络教室视频\npython -m scripts.smyx_classroom_engagement_analysis_analysis --url https://example.com/classroom.mp4\n\n# 显示历史学生课堂情绪参与度报告（自动触发关键词：查看课堂参与度历史报告、参与度报告清单等）\npython -m scripts.smyx_classroom_engagement_analysis_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_classroom_engagement_analysis_analysis --input classroom.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_classroom_engagement_analysis_analysis --input classroom.mp4 --output result.json\n```\n\nFile v1.0.8:_meta.json\n\n{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-classroom-engagement-analysis-analysis\",\n  \"version\": \"1.0.8\",\n  \"publishedAt\": 1786481076361\n}\n\nFile v1.0.8:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放学生课堂情绪参与度分析 API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动学生课堂情绪参与度分析任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取群体参与度评分 + 匿名低参与度提示\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史参与度报告\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告（含参与度热力图）\n\n## 场景代码\n\n- `SMYX_CLASSROOM_ENGAGEMENT_ANALYSIS_ANALYSIS` - 学生课堂情绪参与度分析\n\n## 输入约束\n\n- 摄像头：中小学教室 / 培训课堂 / 在线教育（需拍摄学生）固定摄像头，**讲台对面或斜侧高位**，画面应覆盖大部分学生脸部\n- 帧率 ≥ 5 FPS（推荐 10-15 FPS）；分辨率 ≥ 720p；光照稳定避免逆光\n- 视频时长建议 ≥ 5 分钟，匹配教学环节（导入 / 讲解 / 互动 / 练习）\n- 初次部署需标定教室座位 ROI 网格（row × col，如 6×8，用于热力图坐标）\n- **匿名约束**：不进行人脸识别 / 人脸比对 / 学生身份绑定；低参与度提醒仅返回座位坐标（如 row=3, col=2），不返回学生姓名\n\n## 关键观测信号\n\n- `student_count_detected` - 当前帧检测到的学生人数\n- `emotion_distribution` - 班级情绪分布（focused / confused / happy / frustrated / bored / neutral 占比）\n- `focus_ratio` - 专注比例（focused + 适度 happy + 适度 neutral）\n- `confusion_ratio` - 困惑比例（confused / frustrated）\n- `bored_ratio` - 无聊比例（bored + 走神：头部偏离讲台方向 + 长时间垂眼）\n- `head_pose_toward_teacher_ratio` - 头部朝向讲台比例（参考指标）\n- `hand_raise_event_count` - 举手互动次数（参考指标）\n- `engagement_score` - 班级整体参与度评分（0-100）\n- `low_engagement_seats` - 低参与度座位坐标数组（仅 row/col，不绑定身份）\n\n## 阈值与等级\n\n- `≥ 80` - 高参与度（excellent）\n- `60-79` - 良好参与度（good）\n- `40-59` - 中等参与度（fair）→ 建议教师调整节奏\n- `< 40` - 低参与度（low）→ 触发实时提醒\n- 教学环节切换（如从讲解 → 练习）时短暂下降视为正常\n\n## 输出字段（参考）\n\n- `time_window` - 采样时间窗口\n- `teaching_phase_hint` - 推测教学环节（lecture / interaction / practice / unknown）\n- `student_count_detected` / `emotion_distribution` / `focus_ratio` / `confusion_ratio` / `bored_ratio` / `head_pose_toward_teacher_ratio` / `hand_raise_event_count`\n- `engagement_score` - 班级整体参与度评分\n- `engagement_level` - 等级（excellent / good / fair / low）\n- `low_engagement_seats` - 低参与度座位坐标数组（[{row, col}, ...]，**不含身份**）\n- `confusion_hotspot_seats` - 困惑表情集中座位（[{row, col}, ...]）\n- `trend_vs_last_window` - 相比上一时间窗变化（delta_pct）\n- `alert_type` - 提醒类型（low_engagement / high_confusion / improving / normal）\n- `alert_level` - 提醒级别（info / notice / warning）\n- `teacher_suggestion` - 教师建议（如\"班级整体参与度 38（low），建议穿插一个 2 分钟小组讨论或提问环节；困惑集中在 row=3 col=2 附近，建议复述刚才的概念\"）\n- `engagement_heatmap_image_url` - 参与度热力图 URL（叠加在教室座位图上）\n\n## 强制隐私约束\n\n- ❌ **禁止**进行人脸识别 / 人脸比对 / 学生身份绑定\n- ❌ **禁止**将\"低参与度\"用于学生绩效评估、家长沟通或公开排名\n- ❌ **禁止**长期存储原始视频或可识别个人特征的数据\n- ✅ 仅输出**班级群体聚合** + **座位坐标级别**的匿名提示，作为教师**实时**辅助参考\n- ✅ 涉及未成年人，必须取得**学校 + 家长**双重知情同意，并明确告知用途与数据保存期限\n\n> 仅输出基于视觉的群体行为聚合统计与教学辅助提示，**不构成对任何学生的能力评价、心理诊断或个人画像**；任何针对个体的关怀沟通应由教师 / 心理老师依据课堂观察与自愿性谈话进行。\n\nFile v1.0.8:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.8:scripts/config.yaml\n\n{}\n\nFile v1.0.8:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.8:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.8:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.8:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: prod\n\nFile v1.0.8:skill-card.md\n\n## Description:\n\nGenerates classroom engagement analysis from fixed-camera classroom media, including emotion distribution, class engagement score, anonymous seat-level low-engagement cues, heatmaps, alerts, and teacher-facing suggestions.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[18072937735](https://clawhub.ai/user/18072937735)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nExternal educators, school staff, and smart-classroom developers use this skill to analyze classroom video or image inputs for group-level engagement feedback and historical report lookup. It is intended as a real-time teaching aid, not a student identity, performance, ranking, or psychological assessment tool.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Classroom media and identifiers may be uploaded to LifeEmergence/Open API cloud services.\n\nMitigation: Use only with explicit school and parent consent, a clear retention policy, and acceptance of cloud processing.\n\nRisk: The skill can silently create or reuse a local internal user identity and query cloud history tied to that identity.\n\nMitigation: Run in a controlled workspace, disclose account linkage to administrators, and segregate or clear local skill data between deployments.\n\nRisk: Account tokens may be stored in a local workspace SQLite database.\n\nMitigation: Protect the workspace, restrict file access, rotate tokens after testing, and avoid running the skill from shared machines.\n\n## Reference(s):\n\n- [API Documentation](references/api_doc.md)\n- [Base Analysis API Documentation](skills/smyx_analysis/references/api_doc.md)\n- [Skill Demo](https://lifeemergence.com/sample.html)\n- [ClawHub Skill Page](https://clawhub.ai/18072937735/skills/smyx-classroom-engagement-analysis-analysis)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, JSON, files, guidance]\n\n**Output Format:** [Markdown text with structured JSON report content and optional saved output file.]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Supports local mp4, avi, or mov files up to 10 MB or URL inputs; history queries return cloud report records with report links.]\n\n## Skill Version(s):\n\n1.0.8 (source: SKILL.md frontmatter and server release evidence)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v1.0.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, 41698 bytes\n\nFiles: references/api_doc.md (4317b), scripts/__init__.py (48b), scripts/config.py (691b), scripts/config.yaml (3b), scripts/skill.py (582b), scripts/smyx_classroom_engagement_analysis_analysis.py (3657b), skill-card.md (2763b), SKILL.md (12521b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (24363b), skills/smyx_common/scripts/config.yaml (473b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28776b), _meta.json (162b)\n\nFile v1.0.7:SKILL.md\n\n---\nname: \"smyx-classroom-engagement-analysis-analysis\"\ndescription: \"Using a fixed classroom camera, the system analyzes students' facial expressions (focused, confused, happy, frustrated, bored, etc.), computes a class-level overall engagement score (0-100), and can identify low-engagement student positions (no identity stored — for real-time teacher reminders only). Real-time analysis provides engagement heatmaps and abnormal alerts. | 通过教室固定摄像头，分析学生面部表情（专注、困惑、开心、沮丧、无聊等），计算班级整体参与度评分（0-100分），并可识别出参与度较低的学生个体（不存储身份，仅用于实时提醒）。该技能可辅助教师调整教学节奏，关注学习困难学生。\"\nversion: \"1.0.8\"\nlicense: \"MIT-0\"\n---\n\n# 🏫 Student Classroom Engagement Analysis | 学生课堂情绪参与度分析\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **学生课堂情绪参与度分析** |\n| 🎯 核心目标 | 通过教室固定摄像头，分析学生面部表情（专注、困惑、开心、沮丧、无聊等），计算班级整体参与度评分（0-100分），并可识别出参与度较低的学生个体（不存储身份，仅用于实时提醒）。该技能可辅助教师调整教学节奏，关注学习困难学生。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_CLASSROOM_ENGAGEMENT_ANALYSIS_ANALYSIS` |\n\nUsing a fixed classroom camera, the system analyzes students' facial expressions (focused, confused, happy, frustrated, bored, etc.), computes a class-level overall engagement score (0-100), and can identify low-engagement student positions (no identity stored — for real-time teacher reminders only). The skill helps teachers adjust teaching pace and pay attention to students having learning difficulty. Application scenarios: K-12 classrooms, training courses, online education (students must be on camera). Real-time analysis provides engagement heatmaps and abnormal alerts. Skill features: it is difficult for a teacher to monitor every student's facial state in real time. AI-assisted analysis helps teachers timely detect confusion or boredom, adjust teaching strategy, and improve quality. Can be integrated into smart-classroom systems or lecture-recording devices.\n\n通过教室固定摄像头，分析学生面部表情（专注、困惑、开心、沮丧、无聊等），计算班级整体参与度评分（0-100分），并可识别出参与度较低的学生个体（不存储身份，仅用于实时提醒）。该技能可辅助教师调整教学节奏，关注学习困难学生。应用场景：中小学教室、培训课堂、在线教育（需拍摄学生）。系统实时分析，为教师提供参与度热力图和异常提醒。技能特点：教师难以实时关注每个学生的表情状态。通过AI辅助分析，可帮助教师及时发现学生困惑或无聊，调整教学策略，提高教学质量。该技能可集成到智慧教室系统或录播设备中。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的课堂教学分析 AI。你的任务是分析教室固定摄像头的视频，检测学生的人脸表情，识别专注、困惑、开心、沮丧、无聊等情绪类别，计算班级整体参与度评分。不存储学生身份信息，仅输出群体统计和匿名化的低参与度提示（仅返回座位坐标），作为教师实时教学辅助。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于教室固定摄像头视频，识别学生面部 6 类情绪（focused / confused / happy / frustrated / bored / neutral）+ 头部朝向 + 举手互动 → 输出班级群体参与度评分（0-100）→ 输出匿名低参与度座位坐标 + 困惑集中座位 + 教师实时教学建议 + 参与度热力图\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 人脸检测（不做身份关联） |\n| 2 | 6 类情绪分类 |\n| 3 | 头部姿态朝向估计（朝向讲台比例） |\n| 4 | 举手事件计数 |\n| 5 | 教学环节推测（lecture / interaction / practice） |\n| 6 | 座位 ROI 网格映射（row × col） |\n| 7 | 班级整体参与度评分 |\n| 8 | 低参与度座位识别（仅返回坐标） |\n| 9 | 困惑/沮丧热点识别 |\n| 10 | 与上一时间窗对比的趋势分析 |\n| 11 | 面向教师的中性教学建议生成 |\n| 12 | 参与度伪彩色热力图 |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供教室固定摄像头视频 URL 或文件需要分析时，默认触发本技能进行学生课堂情绪参与度分析 |\n| 🔎 明确分析意图 | 当用户明确提及课堂参与度、学生情绪、教学反馈、智慧教室、课堂困惑、走神、举手互动等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看课堂参与度历史报告、参与度报告清单、教学情绪报告清单、查询历史课堂参与度记录、显示所有课堂情绪分析报告、显示班级参与度诊断报告，查询课堂参与度预警清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_classroom_engagement_analysis_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_classroom_engagement_analysis_analysis --list` 调用 API 查询云端的历史报告数据 |\n| 🚫 严格禁止 | 从本地 `memory` 目录读取历史会话信息 |\n| 🚫 严格禁止 | 手动汇总本地记录中的报告 |\n| 🚫 严格禁止 | 从长期记忆中提取报告 |\n| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据，然后以 Markdown 表格格式输出结果 |\n\n## 📦 前置准备 | Requirements\n- 依赖说明:scripts 脚本所需的依赖包及版本\n  ```\n  requests>=2.28.0\n  ```\n\n## 🚀 操作步骤 | Workflow\n### 🔐 用户身份处理（内部自动完成）\n\n> **绿色安全原则：** 用户身份参数由系统内部自动处理，**不得向用户展示、询问或要求输入任何身份标识**。\n\n执行本技能分析或历史报告查询时，脚本会自动完成身份初始化：\n\n| 场景 | 系统行为 |\n|---|---|\n| 上游系统有内部身份参数 | 由脚本静默接收并使用 |\n| 上游系统未提供内部身份参数 | 脚本会自动复用本地缺省用户 |\n| 本地缺省用户不存在 | 脚本会自动创建并在后续任务中复用 |\n| 对用户输出 | 只展示分析进度、分析结果和报告链接，不展示内部身份值 |\n\n#### 🔒 关键约束\n\n| 禁止/要求 | 说明 |\n|---|---|\n| 🚫 不得询问身份 | 不得提示用户输入用户名、手机号或任何内部身份参数 |\n| 🚫 不得暴露身份值 | 不得在回复、报告、示例、错误提示中暴露内部身份值 |\n| 🚫 不得列为用户参数 | 不得把内部身份参数列为用户需要理解或传入的参数 |\n| ✅ 自动关联报告 | 历史报告查询同样由系统内部身份自动关联，用户只需表达“查看历史报告/报告清单”等意图 |\n\n---\n\n### 🧪 标准流程 | Standard Flow\n\n| 步骤 | 阶段 | 执行动作 |\n|---:|---|---|\n| 1 | 📥 准备教室固定摄像头视频输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行学生课堂情绪参与度分析 | 调用 `-m scripts.smyx_classroom_engagement_analysis_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地教室固定摄像头视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络教室固定摄像头视频 URL 地址（API 服务自动下载） | API 服务自动下载网络资源 |\n| `--pet-type` | 类别标识，课堂教学分析场景默认 `other` | 按需填写 |\n| `--list` | 显示学生课堂情绪参与度历史分析报告列表清单（可以输入起始日期参数过滤数据范围） | 用于云端历史报告查询 |\n| `--api-url` | API 服务地址（可选，使用默认值） | 按需填写 |\n| `--detail` | 输出详细程度（basic/standard/json，默认 json） | 输出详细程度 |\n| `--output` | 结果输出文件路径（可选） | 可选 |\n\n## 🗂️ 资源索引 | Resource Index\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_classroom_engagement_analysis_analysis.py`](scripts/smyx_classroom_engagement_analysis_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；**关键**：讲台对面/斜侧高位、覆盖大部分学生脸部 |\n| 🔎 使用提醒 | 在线教育场景需确保学生摄像头开启且采集合法合规 |\n| 🔎 使用提醒 | 部分日常表情（思考、记笔记低头）易被误识为\"无聊\"或\"困惑\"，建议结合短时序均值 |\n| 🔎 使用提醒 | 教学环节切换（如讲解 → 练习）期间短暂参与度下降视为正常，不应立即触发提醒 |\n| 🔎 使用提醒 | 强匿名约束：本工具**禁止**做人脸识别 / 学生身份绑定；**禁止**用于学生绩效评估、家长沟通或公开排名；**禁止**长期存储原始视频或可识别个人特征的数据 |\n| 🔎 使用提醒 | 合规要点：涉及未成年人，必须取得**学校 + 家长**双重知情同意，并明确告知用途与数据保存期限；建议由教务处统一备案 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地教室视频\npython -m scripts.smyx_classroom_engagement_analysis_analysis --input /path/to/classroom.mp4\n\n# 分析网络教室视频\npython -m scripts.smyx_classroom_engagement_analysis_analysis --url https://example.com/classroom.mp4\n\n# 显示历史学生课堂情绪参与度报告（自动触发关键词：查看课堂参与度历史报告、参与度报告清单等）\npython -m scripts.smyx_classroom_engagement_analysis_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_classroom_engagement_analysis_analysis --input classroom.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_classroom_engagement_analysis_analysis --input classroom.mp4 --output result.json\n```\n\nFile v1.0.7:_meta.json\n\n{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-classroom-engagement-analysis-analysis\",\n  \"version\": \"1.0.7\",\n  \"publishedAt\": 1786140924197\n}\n\nFile v1.0.7:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放学生课堂情绪参与度分析 API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动学生课堂情绪参与度分析任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取群体参与度评分 + 匿名低参与度提示\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史参与度报告\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告（含参与度热力图）\n\n## 场景代码\n\n- `SMYX_CLASSROOM_ENGAGEMENT_ANALYSIS_ANALYSIS` - 学生课堂情绪参与度分析\n\n## 输入约束\n\n- 摄像头：中小学教室 / 培训课堂 / 在线教育（需拍摄学生）固定摄像头，**讲台对面或斜侧高位**，画面应覆盖大部分学生脸部\n- 帧率 ≥ 5 FPS（推荐 10-15 FPS）；分辨率 ≥ 720p；光照稳定避免逆光\n- 视频时长建议 ≥ 5 分钟，匹配教学环节（导入 / 讲解 / 互动 / 练习）\n- 初次部署需标定教室座位 ROI 网格（row × col，如 6×8，用于热力图坐标）\n- **匿名约束**：不进行人脸识别 / 人脸比对 / 学生身份绑定；低参与度提醒仅返回座位坐标（如 row=3, col=2），不返回学生姓名\n\n## 关键观测信号\n\n- `student_count_detected` - 当前帧检测到的学生人数\n- `emotion_distribution` - 班级情绪分布（focused / confused / happy / frustrated / bored / neutral 占比）\n- `focus_ratio` - 专注比例（focused + 适度 happy + 适度 neutral）\n- `confusion_ratio` - 困惑比例（confused / frustrated）\n- `bored_ratio` - 无聊比例（bored + 走神：头部偏离讲台方向 + 长时间垂眼）\n- `head_pose_toward_teacher_ratio` - 头部朝向讲台比例（参考指标）\n- `hand_raise_event_count` - 举手互动次数（参考指标）\n- `engagement_score` - 班级整体参与度评分（0-100）\n- `low_engagement_seats` - 低参与度座位坐标数组（仅 row/col，不绑定身份）\n\n## 阈值与等级\n\n- `≥ 80` - 高参与度（excellent）\n- `60-79` - 良好参与度（good）\n- `40-59` - 中等参与度（fair）→ 建议教师调整节奏\n- `< 40` - 低参与度（low）→ 触发实时提醒\n- 教学环节切换（如从讲解 → 练习）时短暂下降视为正常\n\n## 输出字段（参考）\n\n- `time_window` - 采样时间窗口\n- `teaching_phase_hint` - 推测教学环节（lecture / interaction / practice / unknown）\n- `student_count_detected` / `emotion_distribution` / `focus_ratio` / `confusion_ratio` / `bored_ratio` / `head_pose_toward_teacher_ratio` / `hand_raise_event_count`\n- `engagement_score` - 班级整体参与度评分\n- `engagement_level` - 等级（excellent / good / fair / low）\n- `low_engagement_seats` - 低参与度座位坐标数组（[{row, col}, ...]，**不含身份**）\n- `confusion_hotspot_seats` - 困惑表情集中座位（[{row, col}, ...]）\n- `trend_vs_last_window` - 相比上一时间窗变化（delta_pct）\n- `alert_type` - 提醒类型（low_engagement / high_confusion / improving / normal）\n- `alert_level` - 提醒级别（info / notice / warning）\n- `teacher_suggestion` - 教师建议（如\"班级整体参与度 38（low），建议穿插一个 2 分钟小组讨论或提问环节；困惑集中在 row=3 col=2 附近，建议复述刚才的概念\"）\n- `engagement_heatmap_image_url` - 参与度热力图 URL（叠加在教室座位图上）\n\n## 强制隐私约束\n\n- ❌ **禁止**进行人脸识别 / 人脸比对 / 学生身份绑定\n- ❌ **禁止**将\"低参与度\"用于学生绩效评估、家长沟通或公开排名\n- ❌ **禁止**长期存储原始视频或可识别个人特征的数据\n- ✅ 仅输出**班级群体聚合** + **座位坐标级别**的匿名提示，作为教师**实时**辅助参考\n- ✅ 涉及未成年人，必须取得**学校 + 家长**双重知情同意，并明确告知用途与数据保存期限\n\n> 仅输出基于视觉的群体行为聚合统计与教学辅助提示，**不构成对任何学生的能力评价、心理诊断或个人画像**；任何针对个体的关怀沟通应由教师 / 心理老师依据课堂观察与自愿性谈话进行。\n\nFile v1.0.7:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.7:scripts/config.yaml\n\n{}\n\nFile v1.0.7:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.7:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.7:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.7:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: prod\n\nFile v1.0.7:skill-card.md\n\n## Description:\n\nUsing a fixed classroom camera, this skill analyzes student facial expressions, estimates class-level engagement, identifies anonymous low-engagement seat positions, and provides heatmaps, alerts, and teacher-facing suggestions.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[18072937735](https://clawhub.ai/user/18072937735)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nExternal educators and smart-classroom operators use this skill to analyze classroom camera images or videos for aggregate engagement trends, anonymous seat-level low-engagement cues, historical report lookup, and teaching suggestions. It is intended as a real-time teaching aid rather than a student identity, ranking, diagnosis, or performance evaluation system.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Sensitive classroom media is sent to cloud services.\n\nMitigation: Use only where school and parent consent, permitted data retention, and approved cloud processing terms are documented before installation.\n\nRisk: Stored user credentials or reused accounts may have insufficient scoping and retention controls.\n\nMitigation: Confirm account and token handling, report ownership, credential rotation, and access boundaries before enabling analysis or history lookup.\n\nRisk: Cloud report history and exported report links may expose sensitive classroom analysis results.\n\nMitigation: Restrict report access to approved staff and verify who can view historical reports and exported links.\n\nRisk: Arbitrary public video URLs may introduce privacy and access-control issues.\n\nMitigation: Use approved classroom media sources and avoid untrusted public URLs.\n\n## Reference(s):\n\n- [ClawHub Skill Page](https://clawhub.ai/18072937735/skills/smyx-classroom-engagement-analysis-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, guidance]\n\n**Output Format:** [Markdown summaries and JSON-style analysis reports with report links, alerts, heatmap references, and teacher-facing suggestions.]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May include class-level engagement scores, anonymous seat coordinates, trend comparisons, historical report tables, and cloud report export links.]\n\n## Skill Version(s):\n\n1.0.7 (source: server release evidence; artifact frontmatter says 1.0.8)\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, 41733 bytes\n\nFiles: references/api_doc.md (4317b), scripts/__init__.py (48b), scripts/config.py (691b), scripts/config.yaml (3b), scripts/skill.py (582b), scripts/smyx_classroom_engagement_analysis_analysis.py (3657b), skill-card.md (3038b), SKILL.md (12521b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (24363b), skills/smyx_common/scripts/config.yaml (473b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28776b), _meta.json (162b)\n\nFile v1.0.6:SKILL.md\n\n---\nname: \"smyx-classroom-engagement-analysis-analysis\"\ndescription: \"Using a fixed classroom camera, the system analyzes students' facial expressions (focused, confused, happy, frustrated, bored, etc.), computes a class-level overall engagement score (0-100), and can identify low-engagement student positions (no identity stored — for real-time teacher reminders only). Real-time analysis provides engagement heatmaps and abnormal alerts. | 通过教室固定摄像头，分析学生面部表情（专注、困惑、开心、沮丧、无聊等），计算班级整体参与度评分（0-100分），并可识别出参与度较低的学生个体（不存储身份，仅用于实时提醒）。该技能可辅助教师调整教学节奏，关注学习困难学生。\"\nversion: \"1.0.7\"\nlicense: \"MIT-0\"\n---\n\n# 🏫 Student Classroom Engagement Analysis | 学生课堂情绪参与度分析\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **学生课堂情绪参与度分析** |\n| 🎯 核心目标 | 通过教室固定摄像头，分析学生面部表情（专注、困惑、开心、沮丧、无聊等），计算班级整体参与度评分（0-100分），并可识别出参与度较低的学生个体（不存储身份，仅用于实时提醒）。该技能可辅助教师调整教学节奏，关注学习困难学生。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_CLASSROOM_ENGAGEMENT_ANALYSIS_ANALYSIS` |\n\nUsing a fixed classroom camera, the system analyzes students' facial expressions (focused, confused, happy, frustrated, bored, etc.), computes a class-level overall engagement score (0-100), and can identify low-engagement student positions (no identity stored — for real-time teacher reminders only). The skill helps teachers adjust teaching pace and pay attention to students having learning difficulty. Application scenarios: K-12 classrooms, training courses, online education (students must be on camera). Real-time analysis provides engagement heatmaps and abnormal alerts. Skill features: it is difficult for a teacher to monitor every student's facial state in real time. AI-assisted analysis helps teachers timely detect confusion or boredom, adjust teaching strategy, and improve quality. Can be integrated into smart-classroom systems or lecture-recording devices.\n\n通过教室固定摄像头，分析学生面部表情（专注、困惑、开心、沮丧、无聊等），计算班级整体参与度评分（0-100分），并可识别出参与度较低的学生个体（不存储身份，仅用于实时提醒）。该技能可辅助教师调整教学节奏，关注学习困难学生。应用场景：中小学教室、培训课堂、在线教育（需拍摄学生）。系统实时分析，为教师提供参与度热力图和异常提醒。技能特点：教师难以实时关注每个学生的表情状态。通过AI辅助分析，可帮助教师及时发现学生困惑或无聊，调整教学策略，提高教学质量。该技能可集成到智慧教室系统或录播设备中。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的课堂教学分析 AI。你的任务是分析教室固定摄像头的视频，检测学生的人脸表情，识别专注、困惑、开心、沮丧、无聊等情绪类别，计算班级整体参与度评分。不存储学生身份信息，仅输出群体统计和匿名化的低参与度提示（仅返回座位坐标），作为教师实时教学辅助。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于教室固定摄像头视频，识别学生面部 6 类情绪（focused / confused / happy / frustrated / bored / neutral）+ 头部朝向 + 举手互动 → 输出班级群体参与度评分（0-100）→ 输出匿名低参与度座位坐标 + 困惑集中座位 + 教师实时教学建议 + 参与度热力图\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 人脸检测（不做身份关联） |\n| 2 | 6 类情绪分类 |\n| 3 | 头部姿态朝向估计（朝向讲台比例） |\n| 4 | 举手事件计数 |\n| 5 | 教学环节推测（lecture / interaction / practice） |\n| 6 | 座位 ROI 网格映射（row × col） |\n| 7 | 班级整体参与度评分 |\n| 8 | 低参与度座位识别（仅返回坐标） |\n| 9 | 困惑/沮丧热点识别 |\n| 10 | 与上一时间窗对比的趋势分析 |\n| 11 | 面向教师的中性教学建议生成 |\n| 12 | 参与度伪彩色热力图 |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供教室固定摄像头视频 URL 或文件需要分析时，默认触发本技能进行学生课堂情绪参与度分析 |\n| 🔎 明确分析意图 | 当用户明确提及课堂参与度、学生情绪、教学反馈、智慧教室、课堂困惑、走神、举手互动等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看课堂参与度历史报告、参与度报告清单、教学情绪报告清单、查询历史课堂参与度记录、显示所有课堂情绪分析报告、显示班级参与度诊断报告，查询课堂参与度预警清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_classroom_engagement_analysis_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_classroom_engagement_analysis_analysis --list` 调用 API 查询云端的历史报告数据 |\n| 🚫 严格禁止 | 从本地 `memory` 目录读取历史会话信息 |\n| 🚫 严格禁止 | 手动汇总本地记录中的报告 |\n| 🚫 严格禁止 | 从长期记忆中提取报告 |\n| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据，然后以 Markdown 表格格式输出结果 |\n\n## 📦 前置准备 | Requirements\n- 依赖说明:scripts 脚本所需的依赖包及版本\n  ```\n  requests>=2.28.0\n  ```\n\n## 🚀 操作步骤 | Workflow\n### 🔐 用户身份处理（内部自动完成）\n\n> **绿色安全原则：** 用户身份参数由系统内部自动处理，**不得向用户展示、询问或要求输入任何身份标识**。\n\n执行本技能分析或历史报告查询时，脚本会自动完成身份初始化：\n\n| 场景 | 系统行为 |\n|---|---|\n| 上游系统有内部身份参数 | 由脚本静默接收并使用 |\n| 上游系统未提供内部身份参数 | 脚本会自动复用本地缺省用户 |\n| 本地缺省用户不存在 | 脚本会自动创建并在后续任务中复用 |\n| 对用户输出 | 只展示分析进度、分析结果和报告链接，不展示内部身份值 |\n\n#### 🔒 关键约束\n\n| 禁止/要求 | 说明 |\n|---|---|\n| 🚫 不得询问身份 | 不得提示用户输入用户名、手机号或任何内部身份参数 |\n| 🚫 不得暴露身份值 | 不得在回复、报告、示例、错误提示中暴露内部身份值 |\n| 🚫 不得列为用户参数 | 不得把内部身份参数列为用户需要理解或传入的参数 |\n| ✅ 自动关联报告 | 历史报告查询同样由系统内部身份自动关联，用户只需表达“查看历史报告/报告清单”等意图 |\n\n---\n\n### 🧪 标准流程 | Standard Flow\n\n| 步骤 | 阶段 | 执行动作 |\n|---:|---|---|\n| 1 | 📥 准备教室固定摄像头视频输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行学生课堂情绪参与度分析 | 调用 `-m scripts.smyx_classroom_engagement_analysis_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地教室固定摄像头视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络教室固定摄像头视频 URL 地址（API 服务自动下载） | API 服务自动下载网络资源 |\n| `--pet-type` | 类别标识，课堂教学分析场景默认 `other` | 按需填写 |\n| `--list` | 显示学生课堂情绪参与度历史分析报告列表清单（可以输入起始日期参数过滤数据范围） | 用于云端历史报告查询 |\n| `--api-url` | API 服务地址（可选，使用默认值） | 按需填写 |\n| `--detail` | 输出详细程度（basic/standard/json，默认 json） | 输出详细程度 |\n| `--output` | 结果输出文件路径（可选） | 可选 |\n\n## 🗂️ 资源索引 | Resource Index\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_classroom_engagement_analysis_analysis.py`](scripts/smyx_classroom_engagement_analysis_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；**关键**：讲台对面/斜侧高位、覆盖大部分学生脸部 |\n| 🔎 使用提醒 | 在线教育场景需确保学生摄像头开启且采集合法合规 |\n| 🔎 使用提醒 | 部分日常表情（思考、记笔记低头）易被误识为\"无聊\"或\"困惑\"，建议结合短时序均值 |\n| 🔎 使用提醒 | 教学环节切换（如讲解 → 练习）期间短暂参与度下降视为正常，不应立即触发提醒 |\n| 🔎 使用提醒 | 强匿名约束：本工具**禁止**做人脸识别 / 学生身份绑定；**禁止**用于学生绩效评估、家长沟通或公开排名；**禁止**长期存储原始视频或可识别个人特征的数据 |\n| 🔎 使用提醒 | 合规要点：涉及未成年人，必须取得**学校 + 家长**双重知情同意，并明确告知用途与数据保存期限；建议由教务处统一备案 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地教室视频\npython -m scripts.smyx_classroom_engagement_analysis_analysis --input /path/to/classroom.mp4\n\n# 分析网络教室视频\npython -m scripts.smyx_classroom_engagement_analysis_analysis --url https://example.com/classroom.mp4\n\n# 显示历史学生课堂情绪参与度报告（自动触发关键词：查看课堂参与度历史报告、参与度报告清单等）\npython -m scripts.smyx_classroom_engagement_analysis_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_classroom_engagement_analysis_analysis --input classroom.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_classroom_engagement_analysis_analysis --input classroom.mp4 --output result.json\n```\n\nFile v1.0.6:_meta.json\n\n{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-classroom-engagement-analysis-analysis\",\n  \"version\": \"1.0.6\",\n  \"publishedAt\": 1785347731657\n}\n\nFile v1.0.6:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放学生课堂情绪参与度分析 API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动学生课堂情绪参与度分析任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取群体参与度评分 + 匿名低参与度提示\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史参与度报告\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告（含参与度热力图）\n\n## 场景代码\n\n- `SMYX_CLASSROOM_ENGAGEMENT_ANALYSIS_ANALYSIS` - 学生课堂情绪参与度分析\n\n## 输入约束\n\n- 摄像头：中小学教室 / 培训课堂 / 在线教育（需拍摄学生）固定摄像头，**讲台对面或斜侧高位**，画面应覆盖大部分学生脸部\n- 帧率 ≥ 5 FPS（推荐 10-15 FPS）；分辨率 ≥ 720p；光照稳定避免逆光\n- 视频时长建议 ≥ 5 分钟，匹配教学环节（导入 / 讲解 / 互动 / 练习）\n- 初次部署需标定教室座位 ROI 网格（row × col，如 6×8，用于热力图坐标）\n- **匿名约束**：不进行人脸识别 / 人脸比对 / 学生身份绑定；低参与度提醒仅返回座位坐标（如 row=3, col=2），不返回学生姓名\n\n## 关键观测信号\n\n- `student_count_detected` - 当前帧检测到的学生人数\n- `emotion_distribution` - 班级情绪分布（focused / confused / happy / frustrated / bored / neutral 占比）\n- `focus_ratio` - 专注比例（focused + 适度 happy + 适度 neutral）\n- `confusion_ratio` - 困惑比例（confused / frustrated）\n- `bored_ratio` - 无聊比例（bored + 走神：头部偏离讲台方向 + 长时间垂眼）\n- `head_pose_toward_teacher_ratio` - 头部朝向讲台比例（参考指标）\n- `hand_raise_event_count` - 举手互动次数（参考指标）\n- `engagement_score` - 班级整体参与度评分（0-100）\n- `low_engagement_seats` - 低参与度座位坐标数组（仅 row/col，不绑定身份）\n\n## 阈值与等级\n\n- `≥ 80` - 高参与度（excellent）\n- `60-79` - 良好参与度（good）\n- `40-59` - 中等参与度（fair）→ 建议教师调整节奏\n- `< 40` - 低参与度（low）→ 触发实时提醒\n- 教学环节切换（如从讲解 → 练习）时短暂下降视为正常\n\n## 输出字段（参考）\n\n- `time_window` - 采样时间窗口\n- `teaching_phase_hint` - 推测教学环节（lecture / interaction / practice / unknown）\n- `student_count_detected` / `emotion_distribution` / `focus_ratio` / `confusion_ratio` / `bored_ratio` / `head_pose_toward_teacher_ratio` / `hand_raise_event_count`\n- `engagement_score` - 班级整体参与度评分\n- `engagement_level` - 等级（excellent / good / fair / low）\n- `low_engagement_seats` - 低参与度座位坐标数组（[{row, col}, ...]，**不含身份**）\n- `confusion_hotspot_seats` - 困惑表情集中座位（[{row, col}, ...]）\n- `trend_vs_last_window` - 相比上一时间窗变化（delta_pct）\n- `alert_type` - 提醒类型（low_engagement / high_confusion / improving / normal）\n- `alert_level` - 提醒级别（info / notice / warning）\n- `teacher_suggestion` - 教师建议（如\"班级整体参与度 38（low），建议穿插一个 2 分钟小组讨论或提问环节；困惑集中在 row=3 col=2 附近，建议复述刚才的概念\"）\n- `engagement_heatmap_image_url` - 参与度热力图 URL（叠加在教室座位图上）\n\n## 强制隐私约束\n\n- ❌ **禁止**进行人脸识别 / 人脸比对 / 学生身份绑定\n- ❌ **禁止**将\"低参与度\"用于学生绩效评估、家长沟通或公开排名\n- ❌ **禁止**长期存储原始视频或可识别个人特征的数据\n- ✅ 仅输出**班级群体聚合** + **座位坐标级别**的匿名提示，作为教师**实时**辅助参考\n- ✅ 涉及未成年人，必须取得**学校 + 家长**双重知情同意，并明确告知用途与数据保存期限\n\n> 仅输出基于视觉的群体行为聚合统计与教学辅助提示，**不构成对任何学生的能力评价、心理诊断或个人画像**；任何针对个体的关怀沟通应由教师 / 心理老师依据课堂观察与自愿性谈话进行。\n\nFile v1.0.6:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.6:scripts/config.yaml\n\n{}\n\nFile v1.0.6:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.6:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.6:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.6:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: prod\n\nFile v1.0.6:skill-card.md\n\n## Description: <br>\nAnalyzes fixed classroom camera images or video to estimate class-level engagement, emotion distribution, low-engagement seat coordinates, heatmaps, alerts, teacher suggestions, and historical report links. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[18072937735](https://clawhub.ai/user/18072937735) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nTeachers, school operators, and education platform teams use this skill to analyze classroom video or images for aggregate engagement signals and anonymous seat-level prompts. It is intended for real-time teaching support and historical report review, not student identity recognition or individual performance ranking. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: The skill processes sensitive classroom video involving students and may create historical behavioral records. <br>\nMitigation: Use only with school or organizational approval, required consent, defined retention rules, and a documented account model before processing classroom media. <br>\nRisk: The artifact creates or reuses hidden account state and stores authentication tokens. <br>\nMitigation: Review the local data directory and token storage behavior before deployment, restrict filesystem access, and rotate or remove stored credentials when no longer needed. <br>\nRisk: Engagement and emotion estimates can be misleading if used as individual student assessment or ranking. <br>\nMitigation: Treat results as aggregate teaching-support signals only, preserve the documented no-identity constraint, and require teacher review before acting on low-engagement prompts. <br>\n\n\n## Reference(s): <br>\n- [ClawHub skill page](https://clawhub.ai/18072937735/skills/smyx-classroom-engagement-analysis-analysis) <br>\n- [Publisher profile](https://clawhub.ai/user/18072937735) <br>\n- [API interface documentation](artifact/references/api_doc.md) <br>\n- [SMYX analysis API documentation](artifact/skills/smyx_analysis/references/api_doc.md) <br>\n- [Skill demo](https://lifeemergence.com/sample.html) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [Analysis, Markdown, JSON, Files, Shell commands, Guidance] <br>\n**Output Format:** [Markdown and JSON with structured classroom engagement results, anonymous seat coordinates, heatmap/report links, and optional saved output files] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Outputs can include engagement scores, emotion distributions, alert levels, teacher suggestions, historical report records, and export URLs.] <br>\n\n## Skill Version(s): <br>\n1.0.6 (source: server release metadata; artifact frontmatter says 1.0.7) <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.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, 41738 bytes\n\nFiles: references/api_doc.md (4317b), scripts/__init__.py (48b), scripts/config.py (691b), scripts/config.yaml (3b), scripts/skill.py (582b), scripts/smyx_classroom_engagement_analysis_analysis.py (3657b), skill-card.md (2977b), SKILL.md (12521b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (24363b), skills/smyx_common/scripts/config.yaml (473b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28776b), _meta.json (162b)\n\nFile v1.0.5:SKILL.md\n\n---\nname: \"smyx-classroom-engagement-analysis-analysis\"\ndescription: \"Using a fixed classroom camera, the system analyzes students' facial expressions (focused, confused, happy, frustrated, bored, etc.), computes a class-level overall engagement score (0-100), and can identify low-engagement student positions (no identity stored — for real-time teacher reminders only). Real-time analysis provides engagement heatmaps and abnormal alerts. | 通过教室固定摄像头，分析学生面部表情（专注、困惑、开心、沮丧、无聊等），计算班级整体参与度评分（0-100分），并可识别出参与度较低的学生个体（不存储身份，仅用于实时提醒）。该技能可辅助教师调整教学节奏，关注学习困难学生。\"\nversion: \"1.0.5\"\nlicense: \"MIT-0\"\n---\n\n# 🏫 Student Classroom Engagement Analysis | 学生课堂情绪参与度分析\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **学生课堂情绪参与度分析** |\n| 🎯 核心目标 | 通过教室固定摄像头，分析学生面部表情（专注、困惑、开心、沮丧、无聊等），计算班级整体参与度评分（0-100分），并可识别出参与度较低的学生个体（不存储身份，仅用于实时提醒）。该技能可辅助教师调整教学节奏，关注学习困难学生。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_CLASSROOM_ENGAGEMENT_ANALYSIS_ANALYSIS` |\n\nUsing a fixed classroom camera, the system analyzes students' facial expressions (focused, confused, happy, frustrated, bored, etc.), computes a class-level overall engagement score (0-100), and can identify low-engagement student positions (no identity stored — for real-time teacher reminders only). The skill helps teachers adjust teaching pace and pay attention to students having learning difficulty. Application scenarios: K-12 classrooms, training courses, online education (students must be on camera). Real-time analysis provides engagement heatmaps and abnormal alerts. Skill features: it is difficult for a teacher to monitor every student's facial state in real time. AI-assisted analysis helps teachers timely detect confusion or boredom, adjust teaching strategy, and improve quality. Can be integrated into smart-classroom systems or lecture-recording devices.\n\n通过教室固定摄像头，分析学生面部表情（专注、困惑、开心、沮丧、无聊等），计算班级整体参与度评分（0-100分），并可识别出参与度较低的学生个体（不存储身份，仅用于实时提醒）。该技能可辅助教师调整教学节奏，关注学习困难学生。应用场景：中小学教室、培训课堂、在线教育（需拍摄学生）。系统实时分析，为教师提供参与度热力图和异常提醒。技能特点：教师难以实时关注每个学生的表情状态。通过AI辅助分析，可帮助教师及时发现学生困惑或无聊，调整教学策略，提高教学质量。该技能可集成到智慧教室系统或录播设备中。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的课堂教学分析 AI。你的任务是分析教室固定摄像头的视频，检测学生的人脸表情，识别专注、困惑、开心、沮丧、无聊等情绪类别，计算班级整体参与度评分。不存储学生身份信息，仅输出群体统计和匿名化的低参与度提示（仅返回座位坐标），作为教师实时教学辅助。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于教室固定摄像头视频，识别学生面部 6 类情绪（focused / confused / happy / frustrated / bored / neutral）+ 头部朝向 + 举手互动 → 输出班级群体参与度评分（0-100）→ 输出匿名低参与度座位坐标 + 困惑集中座位 + 教师实时教学建议 + 参与度热力图\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 人脸检测（不做身份关联） |\n| 2 | 6 类情绪分类 |\n| 3 | 头部姿态朝向估计（朝向讲台比例） |\n| 4 | 举手事件计数 |\n| 5 | 教学环节推测（lecture / interaction / practice） |\n| 6 | 座位 ROI 网格映射（row × col） |\n| 7 | 班级整体参与度评分 |\n| 8 | 低参与度座位识别（仅返回坐标） |\n| 9 | 困惑/沮丧热点识别 |\n| 10 | 与上一时间窗对比的趋势分析 |\n| 11 | 面向教师的中性教学建议生成 |\n| 12 | 参与度伪彩色热力图 |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供教室固定摄像头视频 URL 或文件需要分析时，默认触发本技能进行学生课堂情绪参与度分析 |\n| 🔎 明确分析意图 | 当用户明确提及课堂参与度、学生情绪、教学反馈、智慧教室、课堂困惑、走神、举手互动等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看课堂参与度历史报告、参与度报告清单、教学情绪报告清单、查询历史课堂参与度记录、显示所有课堂情绪分析报告、显示班级参与度诊断报告，查询课堂参与度预警清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_classroom_engagement_analysis_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_classroom_engagement_analysis_analysis --list` 调用 API 查询云端的历史报告数据 |\n| 🚫 严格禁止 | 从本地 `memory` 目录读取历史会话信息 |\n| 🚫 严格禁止 | 手动汇总本地记录中的报告 |\n| 🚫 严格禁止 | 从长期记忆中提取报告 |\n| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据，然后以 Markdown 表格格式输出结果 |\n\n## 📦 前置准备 | Requirements\n- 依赖说明:scripts 脚本所需的依赖包及版本\n  ```\n  requests>=2.28.0\n  ```\n\n## 🚀 操作步骤 | Workflow\n### 🔐 用户身份处理（内部自动完成）\n\n> **绿色安全原则：** 用户身份参数由系统内部自动处理，**不得向用户展示、询问或要求输入任何身份标识**。\n\n执行本技能分析或历史报告查询时，脚本会自动完成身份初始化：\n\n| 场景 | 系统行为 |\n|---|---|\n| 上游系统有内部身份参数 | 由脚本静默接收并使用 |\n| 上游系统未提供内部身份参数 | 脚本会自动复用本地缺省用户 |\n| 本地缺省用户不存在 | 脚本会自动创建并在后续任务中复用 |\n| 对用户输出 | 只展示分析进度、分析结果和报告链接，不展示内部身份值 |\n\n#### 🔒 关键约束\n\n| 禁止/要求 | 说明 |\n|---|---|\n| 🚫 不得询问身份 | 不得提示用户输入用户名、手机号或任何内部身份参数 |\n| 🚫 不得暴露身份值 | 不得在回复、报告、示例、错误提示中暴露内部身份值 |\n| 🚫 不得列为用户参数 | 不得把内部身份参数列为用户需要理解或传入的参数 |\n| ✅ 自动关联报告 | 历史报告查询同样由系统内部身份自动关联，用户只需表达“查看历史报告/报告清单”等意图 |\n\n---\n\n### 🧪 标准流程 | Standard Flow\n\n| 步骤 | 阶段 | 执行动作 |\n|---:|---|---|\n| 1 | 📥 准备教室固定摄像头视频输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行学生课堂情绪参与度分析 | 调用 `-m scripts.smyx_classroom_engagement_analysis_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地教室固定摄像头视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络教室固定摄像头视频 URL 地址（API 服务自动下载） | API 服务自动下载网络资源 |\n| `--pet-type` | 类别标识，课堂教学分析场景默认 `other` | 按需填写 |\n| `--list` | 显示学生课堂情绪参与度历史分析报告列表清单（可以输入起始日期参数过滤数据范围） | 用于云端历史报告查询 |\n| `--api-url` | API 服务地址（可选，使用默认值） | 按需填写 |\n| `--detail` | 输出详细程度（basic/standard/json，默认 json） | 输出详细程度 |\n| `--output` | 结果输出文件路径（可选） | 可选 |\n\n## 🗂️ 资源索引 | Resource Index\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_classroom_engagement_analysis_analysis.py`](scripts/smyx_classroom_engagement_analysis_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；**关键**：讲台对面/斜侧高位、覆盖大部分学生脸部 |\n| 🔎 使用提醒 | 在线教育场景需确保学生摄像头开启且采集合法合规 |\n| 🔎 使用提醒 | 部分日常表情（思考、记笔记低头）易被误识为\"无聊\"或\"困惑\"，建议结合短时序均值 |\n| 🔎 使用提醒 | 教学环节切换（如讲解 → 练习）期间短暂参与度下降视为正常，不应立即触发提醒 |\n| 🔎 使用提醒 | 强匿名约束：本工具**禁止**做人脸识别 / 学生身份绑定；**禁止**用于学生绩效评估、家长沟通或公开排名；**禁止**长期存储原始视频或可识别个人特征的数据 |\n| 🔎 使用提醒 | 合规要点：涉及未成年人，必须取得**学校 + 家长**双重知情同意，并明确告知用途与数据保存期限；建议由教务处统一备案 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地教室视频\npython -m scripts.smyx_classroom_engagement_analysis_analysis --input /path/to/classroom.mp4\n\n# 分析网络教室视频\npython -m scripts.smyx_classroom_engagement_analysis_analysis --url https://example.com/classroom.mp4\n\n# 显示历史学生课堂情绪参与度报告（自动触发关键词：查看课堂参与度历史报告、参与度报告清单等）\npython -m scripts.smyx_classroom_engagement_analysis_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_classroom_engagement_analysis_analysis --input classroom.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_classroom_engagement_analysis_analysis --input classroom.mp4 --output result.json\n```\n\nFile v1.0.5:_meta.json\n\n{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-classroom-engagement-analysis-analysis\",\n  \"version\": \"1.0.5\",\n  \"publishedAt\": 1783915046177\n}\n\nFile v1.0.5:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放学生课堂情绪参与度分析 API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动学生课堂情绪参与度分析任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取群体参与度评分 + 匿名低参与度提示\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史参与度报告\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告（含参与度热力图）\n\n## 场景代码\n\n- `SMYX_CLASSROOM_ENGAGEMENT_ANALYSIS_ANALYSIS` - 学生课堂情绪参与度分析\n\n## 输入约束\n\n- 摄像头：中小学教室 / 培训课堂 / 在线教育（需拍摄学生）固定摄像头，**讲台对面或斜侧高位**，画面应覆盖大部分学生脸部\n- 帧率 ≥ 5 FPS（推荐 10-15 FPS）；分辨率 ≥ 720p；光照稳定避免逆光\n- 视频时长建议 ≥ 5 分钟，匹配教学环节（导入 / 讲解 / 互动 / 练习）\n- 初次部署需标定教室座位 ROI 网格（row × col，如 6×8，用于热力图坐标）\n- **匿名约束**：不进行人脸识别 / 人脸比对 / 学生身份绑定；低参与度提醒仅返回座位坐标（如 row=3, col=2），不返回学生姓名\n\n## 关键观测信号\n\n- `student_count_detected` - 当前帧检测到的学生人数\n- `emotion_distribution` - 班级情绪分布（focused / confused / happy / frustrated / bored / neutral 占比）\n- `focus_ratio` - 专注比例（focused + 适度 happy + 适度 neutral）\n- `confusion_ratio` - 困惑比例（confused / frustrated）\n- `bored_ratio` - 无聊比例（bored + 走神：头部偏离讲台方向 + 长时间垂眼）\n- `head_pose_toward_teacher_ratio` - 头部朝向讲台比例（参考指标）\n- `hand_raise_event_count` - 举手互动次数（参考指标）\n- `engagement_score` - 班级整体参与度评分（0-100）\n- `low_engagement_seats` - 低参与度座位坐标数组（仅 row/col，不绑定身份）\n\n## 阈值与等级\n\n- `≥ 80` - 高参与度（excellent）\n- `60-79` - 良好参与度（good）\n- `40-59` - 中等参与度（fair）→ 建议教师调整节奏\n- `< 40` - 低参与度（low）→ 触发实时提醒\n- 教学环节切换（如从讲解 → 练习）时短暂下降视为正常\n\n## 输出字段（参考）\n\n- `time_window` - 采样时间窗口\n- `teaching_phase_hint` - 推测教学环节（lecture / interaction / practice / unknown）\n- `student_count_detected` / `emotion_distribution` / `focus_ratio` / `confusion_ratio` / `bored_ratio` / `head_pose_toward_teacher_ratio` / `hand_raise_event_count`\n- `engagement_score` - 班级整体参与度评分\n- `engagement_level` - 等级（excellent / good / fair / low）\n- `low_engagement_seats` - 低参与度座位坐标数组（[{row, col}, ...]，**不含身份**）\n- `confusion_hotspot_seats` - 困惑表情集中座位（[{row, col}, ...]）\n- `trend_vs_last_window` - 相比上一时间窗变化（delta_pct）\n- `alert_type` - 提醒类型（low_engagement / high_confusion / improving / normal）\n- `alert_level` - 提醒级别（info / notice / warning）\n- `teacher_suggestion` - 教师建议（如\"班级整体参与度 38（low），建议穿插一个 2 分钟小组讨论或提问环节；困惑集中在 row=3 col=2 附近，建议复述刚才的概念\"）\n- `engagement_heatmap_image_url` - 参与度热力图 URL（叠加在教室座位图上）\n\n## 强制隐私约束\n\n- ❌ **禁止**进行人脸识别 / 人脸比对 / 学生身份绑定\n- ❌ **禁止**将\"低参与度\"用于学生绩效评估、家长沟通或公开排名\n- ❌ **禁止**长期存储原始视频或可识别个人特征的数据\n- ✅ 仅输出**班级群体聚合** + **座位坐标级别**的匿名提示，作为教师**实时**辅助参考\n- ✅ 涉及未成年人，必须取得**学校 + 家长**双重知情同意，并明确告知用途与数据保存期限\n\n> 仅输出基于视觉的群体行为聚合统计与教学辅助提示，**不构成对任何学生的能力评价、心理诊断或个人画像**；任何针对个体的关怀沟通应由教师 / 心理老师依据课堂观察与自愿性谈话进行。\n\nFile v1.0.5:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.5:scripts/config.yaml\n\n{}\n\nFile v1.0.5:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.5:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.5:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.5:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: prod\n\nFile v1.0.5:skill-card.md\n\n## Description: <br>\nAnalyzes fixed-camera classroom images or video to estimate aggregate student engagement, anonymous low-engagement seat coordinates, heatmaps, alerts, teacher suggestions, and history reports. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[18072937735](https://clawhub.ai/user/18072937735) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nTeachers, smart-classroom operators, and education-technology developers use this skill to analyze classroom video or images for group engagement trends, low-engagement seat locations, confusion hotspots, and teaching suggestions. It can also query previously generated classroom engagement reports from the remote service. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: The skill sends classroom video or image inputs to a remote service for analysis, which can involve minors and sensitive classroom context. <br>\nMitigation: Use only with explicit school and parent consent, documented data-retention terms, and verified service-operator controls for storage, access, and deletion. <br>\nRisk: Server evidence states that the skill creates and stores a reusable internal user identity and report history despite strong anonymity claims. <br>\nMitigation: Confirm where user identifiers, report history, videos, heatmaps, and tokens are stored, who can access them, and how local and cloud records can be deleted before deployment. <br>\nRisk: Engagement and emotion analysis can be inaccurate or misleading if used as an assessment of individual students. <br>\nMitigation: Use outputs only as real-time teaching support, keep reminders anonymous at the seat-coordinate or group level, and prohibit use for student performance evaluation, parent communication, or public ranking. <br>\n\n\n## Reference(s): <br>\n- [API Reference](references/api_doc.md) <br>\n- [Additional API Error Reference](skills/smyx_analysis/references/api_doc.md) <br>\n- [Skill Demo](https://lifeemergence.com/sample.html) <br>\n- [ClawHub Skill Page](https://clawhub.ai/18072937735/skills/smyx-classroom-engagement-analysis-analysis) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [text, markdown, shell commands, configuration, guidance] <br>\n**Output Format:** [Markdown and JSON-like structured text with report links] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [May include engagement scores, emotion distributions, anonymous seat coordinates, heatmap image URLs, alerts, teacher suggestions, and historical report records.] <br>\n\n## Skill Version(s): <br>\n1.0.5 (source: frontmatter and server release evidence) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nFile v1.0.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, 41738 bytes\n\nFiles: references/api_doc.md (4317b), scripts/__init__.py (48b), scripts/config.py (691b), scripts/config.yaml (3b), scripts/skill.py (582b), scripts/smyx_classroom_engagement_analysis_analysis.py (3657b), skill-card.md (2866b), SKILL.md (12521b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (24363b), skills/smyx_common/scripts/config.yaml (473b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28776b), _meta.json (162b)\n\nFile v1.0.4:SKILL.md\n\n---\nname: \"smyx-classroom-engagement-analysis-analysis\"\ndescription: \"Using a fixed classroom camera, the system analyzes students' facial expressions (focused, confused, happy, frustrated, bored, etc.), computes a class-level overall engagement score (0-100), and can identify low-engagement student positions (no identity stored — for real-time teacher reminders only). Real-time analysis provides engagement heatmaps and abnormal alerts. | 通过教室固定摄像头，分析学生面部表情（专注、困惑、开心、沮丧、无聊等），计算班级整体参与度评分（0-100分），并可识别出参与度较低的学生个体（不存储身份，仅用于实时提醒）。该技能可辅助教师调整教学节奏，关注学习困难学生。\"\nversion: \"1.0.4\"\nlicense: \"MIT-0\"\n---\n\n# 🏫 Student Classroom Engagement Analysis | 学生课堂情绪参与度分析\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **学生课堂情绪参与度分析** |\n| 🎯 核心目标 | 通过教室固定摄像头，分析学生面部表情（专注、困惑、开心、沮丧、无聊等），计算班级整体参与度评分（0-100分），并可识别出参与度较低的学生个体（不存储身份，仅用于实时提醒）。该技能可辅助教师调整教学节奏，关注学习困难学生。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_CLASSROOM_ENGAGEMENT_ANALYSIS_ANALYSIS` |\n\nUsing a fixed classroom camera, the system analyzes students' facial expressions (focused, confused, happy, frustrated, bored, etc.), computes a class-level overall engagement score (0-100), and can identify low-engagement student positions (no identity stored — for real-time teacher reminders only). The skill helps teachers adjust teaching pace and pay attention to students having learning difficulty. Application scenarios: K-12 classrooms, training courses, online education (students must be on camera). Real-time analysis provides engagement heatmaps and abnormal alerts. Skill features: it is difficult for a teacher to monitor every student's facial state in real time. AI-assisted analysis helps teachers timely detect confusion or boredom, adjust teaching strategy, and improve quality. Can be integrated into smart-classroom systems or lecture-recording devices.\n\n通过教室固定摄像头，分析学生面部表情（专注、困惑、开心、沮丧、无聊等），计算班级整体参与度评分（0-100分），并可识别出参与度较低的学生个体（不存储身份，仅用于实时提醒）。该技能可辅助教师调整教学节奏，关注学习困难学生。应用场景：中小学教室、培训课堂、在线教育（需拍摄学生）。系统实时分析，为教师提供参与度热力图和异常提醒。技能特点：教师难以实时关注每个学生的表情状态。通过AI辅助分析，可帮助教师及时发现学生困惑或无聊，调整教学策略，提高教学质量。该技能可集成到智慧教室系统或录播设备中。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的课堂教学分析 AI。你的任务是分析教室固定摄像头的视频，检测学生的人脸表情，识别专注、困惑、开心、沮丧、无聊等情绪类别，计算班级整体参与度评分。不存储学生身份信息，仅输出群体统计和匿名化的低参与度提示（仅返回座位坐标），作为教师实时教学辅助。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于教室固定摄像头视频，识别学生面部 6 类情绪（focused / confused / happy / frustrated / bored / neutral）+ 头部朝向 + 举手互动 → 输出班级群体参与度评分（0-100）→ 输出匿名低参与度座位坐标 + 困惑集中座位 + 教师实时教学建议 + 参与度热力图\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 人脸检测（不做身份关联） |\n| 2 | 6 类情绪分类 |\n| 3 | 头部姿态朝向估计（朝向讲台比例） |\n| 4 | 举手事件计数 |\n| 5 | 教学环节推测（lecture / interaction / practice） |\n| 6 | 座位 ROI 网格映射（row × col） |\n| 7 | 班级整体参与度评分 |\n| 8 | 低参与度座位识别（仅返回坐标） |\n| 9 | 困惑/沮丧热点识别 |\n| 10 | 与上一时间窗对比的趋势分析 |\n| 11 | 面向教师的中性教学建议生成 |\n| 12 | 参与度伪彩色热力图 |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供教室固定摄像头视频 URL 或文件需要分析时，默认触发本技能进行学生课堂情绪参与度分析 |\n| 🔎 明确分析意图 | 当用户明确提及课堂参与度、学生情绪、教学反馈、智慧教室、课堂困惑、走神、举手互动等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看课堂参与度历史报告、参与度报告清单、教学情绪报告清单、查询历史课堂参与度记录、显示所有课堂情绪分析报告、显示班级参与度诊断报告，查询课堂参与度预警清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_classroom_engagement_analysis_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_classroom_engagement_analysis_analysis --list` 调用 API 查询云端的历史报告数据 |\n| 🚫 严格禁止 | 从本地 `memory` 目录读取历史会话信息 |\n| 🚫 严格禁止 | 手动汇总本地记录中的报告 |\n| 🚫 严格禁止 | 从长期记忆中提取报告 |\n| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据，然后以 Markdown 表格格式输出结果 |\n\n## 📦 前置准备 | Requirements\n- 依赖说明:scripts 脚本所需的依赖包及版本\n  ```\n  requests>=2.28.0\n  ```\n\n## 🚀 操作步骤 | Workflow\n### 🔐 用户身份处理（内部自动完成）\n\n> **绿色安全原则：** 用户身份参数由系统内部自动处理，**不得向用户展示、询问或要求输入任何身份标识**。\n\n执行本技能分析或历史报告查询时，脚本会自动完成身份初始化：\n\n| 场景 | 系统行为 |\n|---|---|\n| 上游系统有内部身份参数 | 由脚本静默接收并使用 |\n| 上游系统未提供内部身份参数 | 脚本会自动复用本地缺省用户 |\n| 本地缺省用户不存在 | 脚本会自动创建并在后续任务中复用 |\n| 对用户输出 | 只展示分析进度、分析结果和报告链接，不展示内部身份值 |\n\n#### 🔒 关键约束\n\n| 禁止/要求 | 说明 |\n|---|---|\n| 🚫 不得询问身份 | 不得提示用户输入用户名、手机号或任何内部身份参数 |\n| 🚫 不得暴露身份值 | 不得在回复、报告、示例、错误提示中暴露内部身份值 |\n| 🚫 不得列为用户参数 | 不得把内部身份参数列为用户需要理解或传入的参数 |\n| ✅ 自动关联报告 | 历史报告查询同样由系统内部身份自动关联，用户只需表达“查看历史报告/报告清单”等意图 |\n\n---\n\n### 🧪 标准流程 | Standard Flow\n\n| 步骤 | 阶段 | 执行动作 |\n|---:|---|---|\n| 1 | 📥 准备教室固定摄像头视频输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行学生课堂情绪参与度分析 | 调用 `-m scripts.smyx_classroom_engagement_analysis_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地教室固定摄像头视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络教室固定摄像头视频 URL 地址（API 服务自动下载） | API 服务自动下载网络资源 |\n| `--pet-type` | 类别标识，课堂教学分析场景默认 `other` | 按需填写 |\n| `--list` | 显示学生课堂情绪参与度历史分析报告列表清单（可以输入起始日期参数过滤数据范围） | 用于云端历史报告查询 |\n| `--api-url` | API 服务地址（可选，使用默认值） | 按需填写 |\n| `--detail` | 输出详细程度（basic/standard/json，默认 json） | 输出详细程度 |\n| `--output` | 结果输出文件路径（可选） | 可选 |\n\n## 🗂️ 资源索引 | Resource Index\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_classroom_engagement_analysis_analysis.py`](scripts/smyx_classroom_engagement_analysis_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；**关键**：讲台对面/斜侧高位、覆盖大部分学生脸部 |\n| 🔎 使用提醒 | 在线教育场景需确保学生摄像头开启且采集合法合规 |\n| 🔎 使用提醒 | 部分日常表情（思考、记笔记低头）易被误识为\"无聊\"或\"困惑\"，建议结合短时序均值 |\n| 🔎 使用提醒 | 教学环节切换（如讲解 → 练习）期间短暂参与度下降视为正常，不应立即触发提醒 |\n| 🔎 使用提醒 | 强匿名约束：本工具**禁止**做人脸识别 / 学生身份绑定；**禁止**用于学生绩效评估、家长沟通或公开排名；**禁止**长期存储原始视频或可识别个人特征的数据 |\n| 🔎 使用提醒 | 合规要点：涉及未成年人，必须取得**学校 + 家长**双重知情同意，并明确告知用途与数据保存期限；建议由教务处统一备案 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地教室视频\npython -m scripts.smyx_classroom_engagement_analysis_analysis --input /path/to/classroom.mp4\n\n# 分析网络教室视频\npython -m scripts.smyx_classroom_engagement_analysis_analysis --url https://example.com/classroom.mp4\n\n# 显示历史学生课堂情绪参与度报告（自动触发关键词：查看课堂参与度历史报告、参与度报告清单等）\npython -m scripts.smyx_classroom_engagement_analysis_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_classroom_engagement_analysis_analysis --input classroom.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_classroom_engagement_analysis_analysis --input classroom.mp4 --output result.json\n```\n\nFile v1.0.4:_meta.json\n\n{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-classroom-engagement-analysis-analysis\",\n  \"version\": \"1.0.4\",\n  \"publishedAt\": 1783709672931\n}\n\nFile v1.0.4:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放学生课堂情绪参与度分析 API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动学生课堂情绪参与度分析任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取群体参与度评分 + 匿名低参与度提示\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史参与度报告\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告（含参与度热力图）\n\n## 场景代码\n\n- `SMYX_CLASSROOM_ENGAGEMENT_ANALYSIS_ANALYSIS` - 学生课堂情绪参与度分析\n\n## 输入约束\n\n- 摄像头：中小学教室 / 培训课堂 / 在线教育（需拍摄学生）固定摄像头，**讲台对面或斜侧高位**，画面应覆盖大部分学生脸部\n- 帧率 ≥ 5 FPS（推荐 10-15 FPS）；分辨率 ≥ 720p；光照稳定避免逆光\n- 视频时长建议 ≥ 5 分钟，匹配教学环节（导入 / 讲解 / 互动 / 练习）\n- 初次部署需标定教室座位 ROI 网格（row × col，如 6×8，用于热力图坐标）\n- **匿名约束**：不进行人脸识别 / 人脸比对 / 学生身份绑定；低参与度提醒仅返回座位坐标（如 row=3, col=2），不返回学生姓名\n\n## 关键观测信号\n\n- `student_count_detected` - 当前帧检测到的学生人数\n- `emotion_distribution` - 班级情绪分布（focused / confused / happy / frustrated / bored / neutral 占比）\n- `focus_ratio` - 专注比例（focused + 适度 happy + 适度 neutral）\n- `confusion_ratio` - 困惑比例（confused / frustrated）\n- `bored_ratio` - 无聊比例（bored + 走神：头部偏离讲台方向 + 长时间垂眼）\n- `head_pose_toward_teacher_ratio` - 头部朝向讲台比例（参考指标）\n- `hand_raise_event_count` - 举手互动次数（参考指标）\n- `engagement_score` - 班级整体参与度评分（0-100）\n- `low_engagement_seats` - 低参与度座位坐标数组（仅 row/col，不绑定身份）\n\n## 阈值与等级\n\n- `≥ 80` - 高参与度（excellent）\n- `60-79` - 良好参与度（good）\n- `40-59` - 中等参与度（fair）→ 建议教师调整节奏\n- `< 40` - 低参与度（low）→ 触发实时提醒\n- 教学环节切换（如从讲解 → 练习）时短暂下降视为正常\n\n## 输出字段（参考）\n\n- `time_window` - 采样时间窗口\n- `teaching_phase_hint` - 推测教学环节（lecture / interaction / practice / unknown）\n- `student_count_detected` / `emotion_distribution` / `focus_ratio` / `confusion_ratio` / `bored_ratio` / `head_pose_toward_teacher_ratio` / `hand_raise_event_count`\n- `engagement_score` - 班级整体参与度评分\n- `engagement_level` - 等级（excellent / good / fair / low）\n- `low_engagement_seats` - 低参与度座位坐标数组（[{row, col}, ...]，**不含身份**）\n- `confusion_hotspot_seats` - 困惑表情集中座位（[{row, col}, ...]）\n- `trend_vs_last_window` - 相比上一时间窗变化（delta_pct）\n- `alert_type` - 提醒类型（low_engagement / high_confusion / improving / normal）\n- `alert_level` - 提醒级别（info / notice / warning）\n- `teacher_suggestion` - 教师建议（如\"班级整体参与度 38（low），建议穿插一个 2 分钟小组讨论或提问环节；困惑集中在 row=3 col=2 附近，建议复述刚才的概念\"）\n- `engagement_heatmap_image_url` - 参与度热力图 URL（叠加在教室座位图上）\n\n## 强制隐私约束\n\n- ❌ **禁止**进行人脸识别 / 人脸比对 / 学生身份绑定\n- ❌ **禁止**将\"低参与度\"用于学生绩效评估、家长沟通或公开排名\n- ❌ **禁止**长期存储原始视频或可识别个人特征的数据\n- ✅ 仅输出**班级群体聚合** + **座位坐标级别**的匿名提示，作为教师**实时**辅助参考\n- ✅ 涉及未成年人，必须取得**学校 + 家长**双重知情同意，并明确告知用途与数据保存期限\n\n> 仅输出基于视觉的群体行为聚合统计与教学辅助提示，**不构成对任何学生的能力评价、心理诊断或个人画像**；任何针对个体的关怀沟通应由教师 / 心理老师依据课堂观察与自愿性谈话进行。\n\nFile v1.0.4:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.4:scripts/config.yaml\n\n{}\n\nFile v1.0.4:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.4:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.4:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.4:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: prod\n\nFile v1.0.4:skill-card.md\n\n## Description: <br>\nUsing a fixed classroom camera, the skill analyzes students' facial expressions, computes a class-level engagement score, identifies anonymous low-engagement seat positions, and provides engagement heatmaps and abnormal alerts. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[18072937735](https://clawhub.ai/user/18072937735) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nEducators, classroom technology teams, and developers use this skill to analyze classroom video or image inputs through a cloud service and receive aggregate engagement metrics, anonymous seat-level alerts, teaching suggestions, report links, and history lookups. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Classroom images or videos, including footage of minors, are sent to the publisher's cloud service for analysis. <br>\nMitigation: Require school administrator approval, parent or student consent where applicable, documented retention limits, and a deletion process before use. <br>\nRisk: The skill stores a reusable internal user identity and service tokens in the local workspace database. <br>\nMitigation: Run it only in trusted workspaces, restrict access to the workspace data directory, and rotate or delete stored credentials when access changes. <br>\nRisk: Cloud history lookup can retrieve prior classroom analysis reports and report links. <br>\nMitigation: Confirm that report history and exported report links are access-controlled and only visible to authorized staff. <br>\nRisk: Engagement and emotion outputs could be misused as individual student performance, discipline, or ranking signals. <br>\nMitigation: Use results only as aggregate teaching assistance, preserve the documented anonymous seat-coordinate posture, and prohibit individual evaluation or public ranking. <br>\n\n\n## Reference(s): <br>\n- [API Interface Documentation](references/api_doc.md) <br>\n- [Skill Demo](https://lifeemergence.com/sample.html) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [text, markdown, shell commands, configuration, guidance] <br>\n**Output Format:** [Markdown and JSON-like structured analysis text with optional saved output files] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [May include engagement scores, emotion distributions, anonymous seat coordinates, teacher suggestions, heatmap or report links, and cloud report history.] <br>\n\n## Skill Version(s): <br>\n1.0.4 (source: frontmatter and server release evidence) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nFile v1.0.4:skills/smyx_analysis/requirements.txt\n\np...","readmeExcerpt":"Skill: Student Classroom Engagement Analysis | 学生课堂情绪参与度分析 Owner: 18072937735 Summary: Using a fixed classroom camera, the system analyzes students' facial expressions (focused, confused, happy, frustrated, bored, etc.), computes a class-level overall engagement score (0-100), and can identify low-engagement student positions (no identity stored — for real-time teacher reminders only). Real-time analysis provides eng","codeSnippets":[],"executableExamples":[{"language":"bash","snippet":"python -m scripts.smyx_classroom_engagement_analysis_analysis --list"},{"language":"text","snippet":"requests>=2.28.0"},{"language":"bash","snippet":"# 分析本地教室视频\npython -m scripts.smyx_classroom_engagement_analysis_analysis --input /path/to/classroom.mp4\n\n# 分析网络教室视频\npython -m scripts.smyx_classroom_engagement_analysis_analysis --url https://example.com/classroom.mp4\n\n# 显示历史学生课堂情绪参与度报告（自动触发关键词：查看课堂参与度历史报告、参与度报告清单等）\npython -m scripts.smyx_classroom_engagement_analysis_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_classroom_engagement_analysis_analysis --input classroom.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_classroom_engagement_analysis_analysis --input classroom.mp4 --output result.json"},{"language":"bash","snippet":"python -m scripts.smyx_classroom_engagement_analysis_analysis --list"},{"language":"text","snippet":"requests>=2.28.0"},{"language":"bash","snippet":"# 分析本地教室视频\npython -m scripts.smyx_classroom_engagement_analysis_analysis --input /path/to/classroom.mp4\n\n# 分析网络教室视频\npython -m scripts.smyx_classroom_engagement_analysis_analysis --url https://example.com/classroom.mp4\n\n# 显示历史学生课堂情绪参与度报告（自动触发关键词：查看课堂参与度历史报告、参与度报告清单等）\npython -m scripts.smyx_classroom_engagement_analysis_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_classroom_engagement_analysis_analysis --input classroom.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_classroom_engagement_analysis_analysis --input classroom.mp4 --output result.json"}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\nname: \"smyx-classroom-engagement-analysis-analysis\"\ndescription: \"Using a fixed classroom camera, the system analyzes students' facial expressions (focused, confused, happy, frustrated, bored, etc.), computes a class-level overall engagement score (0-100), and can identify low-engagement student positions (no identity stored — for real-time teacher reminders only). Real-time analysis provides engagement heatmaps and abnormal alerts. | 通过教室固定摄像头，分析学生面部表情（专注、困惑、开心、沮丧、无聊等），计算班级整体参与度评分（0-100分），并可识别出参与度较低的学生个体（不存储身份，仅用于实时提醒）。该技能可辅助教师调整教学节奏，关注学习困难学生。\"\nversion: \"1.0.15\"\nlicense: \"MIT-0\"\n---\n\n# 🏫 Student Classroom Engagement Analysis | 学生课堂情绪参与度分析\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **学生课堂情绪参与度分析** |\n| 🎯 核心目标 | 通过教室固定摄像头，分析学生面部表情（专注、困惑、开心、沮丧、无聊等），计算班级整体参与度评分（0-100分），并可识别出参与度较低的学生个体（不存储身份，仅用于实时提醒）。该技能可辅助教师调整教学节奏，关注学习困难学生。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_CLASSROOM_ENGAGEMENT_ANALYSIS_ANALYSIS` |\n\nUsing a fixed classroom camera, the system analyzes students' facial expressions (focused, confused, happy, frustrated, bored, etc.), computes a class-level overall engagement score (0-100), and can identify low-engagement student positions (no identity stored — for real-time teacher reminders only). The skill helps teachers adjust teaching pace and pay attention to students having learning difficulty. Application scenarios: K-12 classrooms, training courses, online education (students must be on camera). Real-time analysis provides engagement heatmaps and abnormal alerts. Skill features: it is difficult for a teacher to monitor every student's facial state in real time. AI-assisted analysis helps teachers timely detect confusion or boredom, adjust teaching strategy, and improve quality. Can be integrated into smart-classroom systems or lecture-recording devices.\n\n通过教室固定摄像头，分析学生面部表情（专注、困惑、开心、沮丧、无聊等），计算班级整体参与度评分（0-100分），并可识别出参与度较低的学生个体（不存储身份，仅用于实时提醒）。该技能可辅助教师调整教学节奏，关注学习困难学生。应用场景：中小学教室、培训课堂、在线教育（需拍摄学生）。系统实时分析，为教师提供参与度热力图和异常提醒。技能特点：教师难以实时关注每个学生的表情状态。通过AI辅助分析，可帮助教师及时发现学生困惑或无聊，调整教学策略，提高教学质量。该技能可集成到智慧教室系统或录播设备中。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的课堂教学分析 AI。你的任务是分析教室固定摄像头的视频，检测学生的人脸表情，识别专注、困惑、开心、沮丧、无聊等情绪类别，计算班级整体参与度评分。不存储学生身份信息，仅输出群体统计和匿名化的低参与度提示（仅返回座位坐标），作为教师实时教学辅助。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于教室固定摄像头视频，识别学生面部 6 类情绪（focused / confused / happy / frustrated / bored / neutral）+ 头部朝向 + 举手互动 → 输出班级群体参与度评分（0-100）→ 输出匿名低参与度座位坐标 + 困惑集中座位 + 教师实时教学建议 + 参与度热力图\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 人脸检测（不做身份关联） |\n| 2 | 6 类情绪分类 |\n| 3 | 头部姿态朝向估计（朝向讲台比例） |\n| 4 | 举手事件计数 |\n| 5 | 教学环节推测（lecture / interaction / practice） |\n| 6 | 座位 ROI 网格映射（row × col） |\n| 7 | 班级整体参与度评分 |\n| 8 | 低参与度座位识别（仅返回坐标） |\n| 9 | 困惑/沮丧热点识别 |\n| 10 | 与上一时间窗对比的趋势分析 |\n| 11 | 面向教师的中性教学建议生成 |\n| 12 | 参与度伪彩色热力图 |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|--"},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-classroom-engagement-analysis-analysis\",\n  \"version\": \"1.0.13\",\n  \"publishedAt\": 1790990676668\n}"},{"path":"references/api_doc.md","content":"# API 接口文档\n\n此处用于存放学生课堂情绪参与度分析 API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动学生课堂情绪参与度分析任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取群体参与度评分 + 匿名低参与度提示\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史参与度报告\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告（含参与度热力图）\n\n## 场景代码\n\n- `SMYX_CLASSROOM_ENGAGEMENT_ANALYSIS_ANALYSIS` - 学生课堂情绪参与度分析\n\n## 输入约束\n\n- 摄像头：中小学教室 / 培训课堂 / 在线教育（需拍摄学生）固定摄像头，**讲台对面或斜侧高位**，画面应覆盖大部分学生脸部\n- 帧率 ≥ 5 FPS（推荐 10-15 FPS）；分辨率 ≥ 720p；光照稳定避免逆光\n- 视频时长建议 ≥ 5 分钟，匹配教学环节（导入 / 讲解 / 互动 / 练习）\n- 初次部署需标定教室座位 ROI 网格（row × col，如 6×8，用于热力图坐标）\n- **匿名约束**：不进行人脸识别 / 人脸比对 / 学生身份绑定；低参与度提醒仅返回座位坐标（如 row=3, col=2），不返回学生姓名\n\n## 关键观测信号\n\n- `student_count_detected` - 当前帧检测到的学生人数\n- `emotion_distribution` - 班级情绪分布（focused / confused / happy / frustrated / bored / neutral 占比）\n- `focus_ratio` - 专注比例（focused + 适度 happy + 适度 neutral）\n- `confusion_ratio` - 困惑比例（confused / frustrated）\n- `bored_ratio` - 无聊比例（bored + 走神：头部偏离讲台方向 + 长时间垂眼）\n- `head_pose_toward_teacher_ratio` - 头部朝向讲台比例（参考指标）\n- `hand_raise_event_count` - 举手互动次数（参考指标）\n- `engagement_score` - 班级整体参与度评分（0-100）\n- `low_engagement_seats` - 低参与度座位坐标数组（仅 row/col，不绑定身份）\n\n## 阈值与等级\n\n- `≥ 80` - 高参与度（excellent）\n- `60-79` - 良好参与度（good）\n- `40-59` - 中等参与度（fair）→ 建议教师调整节奏\n- `< 40` - 低参与度（low）→ 触发实时提醒\n- 教学环节切换（如从讲解 → 练习）时短暂下降视为正常\n\n## 输出字段（参考）\n\n- `time_window` - 采样时间窗口\n- `teaching_phase_hint` - 推测教学环节（lecture / interaction / practice / unknown）\n- `student_count_detected` / `emotion_distribution` / `focus_ratio` / `confusion_ratio` / `bored_ratio` / `head_pose_toward_teacher_ratio` / `hand_raise_event_count`\n- `engagement_score` - 班级整体参与度评分\n- `engagement_level` - 等级（excellent / good / fair / low）\n- `low_engagement_seats` - 低参与度座位坐标数组（[{row, col}, ...]，**不含身份**）\n- `confusion_hotspot_seats` - 困惑表情集中座位（[{row, col}, ...]）\n- `trend_vs_last_window` - 相比上一时间窗变化（delta_pct）\n- `alert_type` - 提醒类型（low_engagement / high_confusion / improving / normal）\n- `alert_level` - 提醒级别（info / notice / warning）\n- `teacher_suggestion` - 教师建议（如\"班级整体参与度 38（low），建议穿插一个 2 分钟小组讨论或提问环节；困惑集中在 row=3 col=2 附近，建议复述刚才的概念\"）\n- `engagement_heatmap_image_url` - 参与度热力图 URL（叠加在教室座位图上）\n\n## 强制隐私约束\n\n- ❌ **禁止**进行人脸识别 / 人脸比对 / 学生身份绑定\n- ❌ **禁止**将\"低参与度\"用于学生绩效评估、家长沟通或公开排名\n- ❌ **禁止**长期存储原始视频或可识别个人特征的数据\n- ✅ 仅输出**班级群体聚合** + **座位坐标级别**的匿名提示，作为教师**实时**辅助参考\n- ✅ 涉及未成年人，必须取得**学校 + 家长**双重知情同意，并明确告知用途与数据保存期限\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 a fixed classroom camera, the system analyzes students' facial expressions (focused, confused, happy, frustrated, bored, etc.), computes a class-level overall engagement score (0-100), and can identify low-engagement student positions (no identity stored — for real-time teacher reminders only). Real-time analysis provides engagement heatmaps and abnormal alerts. | 通过教室固定摄像头，分析学生面部表情（专注、困惑、开心、沮丧、无聊等），计算班级整体参与度评分（0-100分），并可识别出参与度较低的学生个体（不存储身份，仅用于实时提醒）。该技能可辅助教师调整教学节奏，关注学习困难学生。 Skill: Student Classroom Engagement Analysis | 学生课堂情绪参与度分析 Owner: 18072937735 Summary: Using a fixed classroom camera, the system analyzes students' facial expressions (focused, confused, happy, frustrated, bored, etc.), computes a class-level overall engagement score (0-100), and can identify low-engagement student positions (no identity stored — for real-time teacher reminders only). Real-time analysis provides eng","editorialQuality":{"score":100,"threshold":65,"status":"ready","wordCount":1046,"uniquenessScore":45,"reasons":[]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-09T21:42:29.169Z","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-09T21:42:29.169Z","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-10T09:04:02.044Z","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"}]}}}