{"id":"eb86ef6a-6c1e-49c6-bf3e-1db36b545eb5","entityType":"agent","slug":"clawhub-18072937735-smyx-aggressive-behavior-detection-analysis","name":"Aggressive Behavior Detection | 畜禽争斗行为识别","canonicalUrl":"https://www.xpersona.co/agent/clawhub-18072937735-smyx-aggressive-behavior-detection-analysis","canonicalPath":"/agent/clawhub-18072937735-smyx-aggressive-behavior-detection-analysis","generatedAt":"2026-10-10T23:46:14.201Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"editorial-content","verified":true,"confidence":"high","updatedAt":"2026-10-10T21:19:10.459Z","emptyReason":null},"description":"Detects aggressive interactions in livestock and poultry from continuous barn videos — including fighting, biting, chasing and butting — and outputs behavior type, intensity level and alert level. | 识别打斗、撕咬等攻击行为，及时预警。 Skill: Aggressive Behavior Detection | 畜禽争斗行为识别 Owner: 18072937735 Summary: Detects aggressive interactions in livestock and poultry from continuous barn videos — including fighting, biting, chasing and butting — and outputs behavior type, intensity level and alert level. | 识别打斗、撕咬等攻击行为，及时预警。 Tags: latest:1.0.12 Version history: v1.0.12 | 2026-10-02T12:39:32.953Z | auto - Updated version to 1.0.13. - Modified SKILL.m","descriptionLabel":"Technical summary","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 1.3K downloads reported by the source. Last updated 10/10/2026.","installCommand":"clawhub skill install s17f8q65zg3y98t86jdg1177g583whq8:smyx-aggressive-behavior-detection-analysis","sourceUrl":"https://clawhub.ai/18072937735/smyx-aggressive-behavior-detection-analysis","homepage":"https://clawhub.ai/18072937735/skills/smyx-aggressive-behavior-detection-analysis","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/18072937735/smyx-aggressive-behavior-detection-analysis","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/18072937735/skills/smyx-aggressive-behavior-detection-analysis","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":62,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"Detects aggressive interactions in livestock and poultry from continuous barn videos — including fighting, biting, chasing and butting — and outputs behavior ty"},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-10T21:19:10.459Z","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-10T21:19:10.459Z","emptyReason":null},"stars":null,"forks":null,"downloads":1255,"packageName":null,"latestVersion":"1.0.12","tractionLabel":"1.3K downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-10T21:19:10.446Z","emptyReason":null},"lastUpdatedAt":"2026-10-10T21:19:10.459Z","lastCrawledAt":"2026-10-10T21:19:10.446Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-11T21:19:10.446Z","lastVerifiedAt":null,"highlights":[{"version":"1.0.12","createdAt":"2026-10-02T12:39:32.953Z","changelog":"- Updated version to 1.0.13. - Modified SKILL.md with no major feature or logic changes. - Removed the skill-card.md file.","fileCount":31,"zipByteSize":39389},{"version":"1.0.11","createdAt":"2026-09-26T04:54:33.484Z","changelog":"- Upgrade version to 1.0.12. - Remove skill-card.md for simplified documentation management. - SKILL.md is now the primary and only documentation file for this skill.","fileCount":31,"zipByteSize":39363},{"version":"1.0.10","createdAt":"2026-09-18T07:07:37.944Z","changelog":"smyx-aggressive-behavior-detection-analysis 1.0.10 - Updated documentation in SKILL.md to clarify usage and task flow. - Adjusted or added configuration details in config.yaml. - Removed redundant file: skill-card.md.","fileCount":31,"zipByteSize":39566},{"version":"1.0.9","createdAt":"2026-09-02T18:00:33.836Z","changelog":"- Version updated to 1.0.9. - Documentation refined in SKILL.md; clarifications and adjustments to instructions and constraints. - Obsolete file skill-card.md removed for cleaner structure.","fileCount":31,"zipByteSize":39587},{"version":"1.0.8","createdAt":"2026-08-22T07:27:28.532Z","changelog":"smyx-aggressive-behavior-detection-analysis v1.0.8 - Updated SKILL.md version to 1.0.8 with minor documentation and content changes. - skill-card.md file removed. - Internal configurations updated in scripts/config.yaml.","fileCount":31,"zipByteSize":39587},{"version":"1.0.7","createdAt":"2026-08-13T06:38:45.344Z","changelog":"- Updated version to 1.0.7 - Documentation updates in SKILL.md - Removed skill-card.md file - No changes to underlying capabilities or functionality","fileCount":31,"zipByteSize":39526},{"version":"1.0.6","createdAt":"2026-08-03T20:08:31.157Z","changelog":"- Removed the file: skill-card.md - No changes to functionality or user-facing features. - Version number and documentation remain unchanged.","fileCount":31,"zipByteSize":39730},{"version":"1.0.5","createdAt":"2026-08-01T04:13:29.971Z","changelog":"- Updated documentation in SKILL.md to version 1.0.5 with detailed usage, workflow, and output format descriptions. - Removed redundant or duplicate file: skill-card.md. - No changes to detection features or script behavior; the update is documentation-only.","fileCount":31,"zipByteSize":39637}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s17f8q65zg3y98t86jdg1177g583whq8:smyx-aggressive-behavior-detection-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-aggressive-behavior-detection-analysis/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-18072937735-smyx-aggressive-behavior-detection-analysis/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-18072937735-smyx-aggressive-behavior-detection-analysis/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-18072937735-smyx-aggressive-behavior-detection-analysis/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-18072937735-smyx-aggressive-behavior-detection-analysis/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-18072937735-smyx-aggressive-behavior-detection-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-10T23:46:14.195Z"}},"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-aggressive-behavior-detection-analysis/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-18072937735-smyx-aggressive-behavior-detection-analysis/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-18072937735-smyx-aggressive-behavior-detection-analysis/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-18072937735-smyx-aggressive-behavior-detection-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-10T21:19:10.459Z","emptyReason":null},"readme":"Skill: Aggressive Behavior Detection | 畜禽争斗行为识别\n\nOwner: 18072937735\n\nSummary: Detects aggressive interactions in livestock and poultry from continuous barn videos — including fighting, biting, chasing and butting — and outputs behavior type, intensity level and alert level. | 识别打斗、撕咬等攻击行为，及时预警。\n\nTags: latest:1.0.12\n\nVersion history:\n\nv1.0.12 | 2026-10-02T12:39:32.953Z | auto\n\n- Updated version to 1.0.13.\n- Modified SKILL.md with no major feature or logic changes.\n- Removed the skill-card.md file.\n\nv1.0.11 | 2026-09-26T04:54:33.484Z | auto\n\n- Upgrade version to 1.0.12.\n- Remove skill-card.md for simplified documentation management.\n- SKILL.md is now the primary and only documentation file for this skill.\n\nv1.0.10 | 2026-09-18T07:07:37.944Z | auto\n\nsmyx-aggressive-behavior-detection-analysis 1.0.10\n\n- Updated documentation in SKILL.md to clarify usage and task flow.\n- Adjusted or added configuration details in config.yaml.\n- Removed redundant file: skill-card.md.\n\nv1.0.9 | 2026-09-02T18:00:33.836Z | auto\n\n- Version updated to 1.0.9.\n- Documentation refined in SKILL.md; clarifications and adjustments to instructions and constraints.\n- Obsolete file skill-card.md removed for cleaner structure.\n\nv1.0.8 | 2026-08-22T07:27:28.532Z | auto\n\nsmyx-aggressive-behavior-detection-analysis v1.0.8\n\n- Updated SKILL.md version to 1.0.8 with minor documentation and content changes.\n- skill-card.md file removed.\n- Internal configurations updated in scripts/config.yaml.\n\nv1.0.7 | 2026-08-13T06:38:45.344Z | auto\n\n- Updated version to 1.0.7\n- Documentation updates in SKILL.md\n- Removed skill-card.md file\n- No changes to underlying capabilities or functionality\n\nv1.0.6 | 2026-08-03T20:08:31.157Z | auto\n\n- Removed the file: skill-card.md\n- No changes to functionality or user-facing features.\n- Version number and documentation remain unchanged.\n\nv1.0.5 | 2026-08-01T04:13:29.971Z | auto\n\n- Updated documentation in SKILL.md to version 1.0.5 with detailed usage, workflow, and output format descriptions.\n- Removed redundant or duplicate file: skill-card.md.\n- No changes to detection features or script behavior; the update is documentation-only.\n\nv1.0.4 | 2026-07-14T09:48:27.101Z | auto\n\n- Updated version to 1.0.4.\n- SKILL.md updated; content changes include documentation or metadata adjustments.\n- Removed skill-card.md file.\n- Minor modifications in skills/smyx_common/scripts/util.py.\n- No changes to core detection logic or features.\n\nv1.0.3 | 2026-07-03T13:55:29.582Z | auto\n\nsmyx-aggressive-behavior-detection-analysis 1.0.3 — Comprehensive documentation update\n\n- Added an extensive SKILL.md covering skill overview, supported behaviors, input/output specs, workflow, privacy, and usage examples in both English and Chinese.\n- Clarified user interaction, data sourcing, and security constraints for historical report queries.\n- Provided detailed operational procedures and required environment/dependency information.\n- Standardized Markdown table output format for historical report listings.\n- No functional or API logic changes described; update focused on documentation and usage guidance.\n\nArchive index:\n\nArchive v1.0.12: 31 files, 39389 bytes\n\nFiles: references/api_doc.md (661b), scripts/__init__.py (58b), scripts/config.py (682b), scripts/config.yaml (3b), scripts/skill.py (575b), scripts/smyx_aggressive_behavior_detection_analysis.py (3543b), skill-card.md (2016b), SKILL.md (11946b), 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-aggressive-behavior-detection-analysis\"\ndescription: \"Detects aggressive interactions in livestock and poultry from continuous barn videos — including fighting, biting, chasing and butting — and outputs behavior type, intensity level and alert level. | 识别打斗、撕咬等攻击行为，及时预警。\"\nversion: \"1.0.13\"\nlicense: \"MIT-0\"\n---\n\n# ⚔️ Livestock Aggressive Behavior Detection | 畜禽争斗行为识别\n\n> 识别打斗、撕咬等攻击行为，及时预警。\n>\n> **群体冲突预警中枢** · 畜禽舍连续视频智能分析 · 争斗行为识别 · 强度/预警等级 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **畜禽争斗行为识别** |\n| 🎯 核心目标 | 基于畜禽舍固定摄像头的连续视频，检测个体间的争斗行为（打斗、撕咬、追逐、顶撞等），输出行为类型、强度等级及预警等级 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、争斗行为片段清单、涉事个体位置、强度等级、预警等级、报告链接 |\n| 🏢 适用场景 | 猪/鸡等畜禽的群体冲突预警，减少外伤、应激及生产性能下降造成的经济损失 |\n| 🧩 场景码 | `SMYX_AGGRESSIVE_BEHAVIOR_DETECTION_ANALYSIS` |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n## 🤖 AI 角色 | AI Role\n\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **你是一个专业的畜禽行为安全 AI。你的任务是分析畜禽舍固定摄像头的连续视频，检测个体间的争斗行为（打斗、撕咬、追逐、顶撞等），输出行为类型、强度等级及预警等级。不要提供行为干预建议，仅基于视觉行为观察输出识别结果。** |\n\n---\n\n## 🎯 任务目标 | Goals\n\n### 1. 🧩 技能用途\n\n通过畜禽舍固定摄像头的连续视频，识别群体中出现的争斗行为并评估其强度，输出结构化的争斗行为清单与预警等级，为规模化养殖场提供群体冲突的客观视觉预警依据。\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 畜禽个体检测、定位与短时轨迹跟踪 |\n| 2 | 打斗行为识别（相互冲撞、缠斗） |\n| 3 | 撕咬行为识别（咬耳、咬尾、咬翅等） |\n| 4 | 追逐行为识别（单向追逐 / 逃避） |\n| 5 | 顶撞行为识别（头部/胸部剧烈接触） |\n| 6 | 争斗片段起止时间与涉事个体位置标注 |\n| 7 | 单次争斗强度等级评估（轻度 / 中度 / 剧烈） |\n| 8 | 群体争斗频次统计与总体预警等级输出 |\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_aggressive_behavior_detection_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_aggressive_behavior_detection_analysis --list` 调用 API 查询云端的历史报告数据 |\n| 🚫 严格禁止 | 从本地 `memory` 目录读取历史会话信息 |\n| 🚫 严格禁止 | 手动汇总本地记录中的报告 |\n| 🚫 严格禁止 | 从长期记忆中提取报告 |\n| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据，然后以 Markdown 表格格式输出结果 |\n\n---\n\n## 📦 前置准备 | Requirements\n\n### 依赖说明\n\n`scripts` 脚本所需的依赖包及版本：\n\n```txt\nrequests>=2.28.0\n```\n\n---\n\n## 📷 采集要求 | Capture Requirements\n\n| 序号 | 说明 |\n|---:|---|\n| 1 | 固定摄像头俯视/斜俯视覆盖畜禽舍主要活动区，画面稳定、避免频繁抖动 |\n| 2 | 视频建议 30 秒~10 分钟连续拍摄，帧率不低于 15fps，便于捕捉短促的争斗动作 |\n| 3 | 光照条件稳定，白天充足自然光或稳定人工光源，避免大面积过暗/过曝 |\n| 4 | 单栏舍内目标个体清晰可见，尽量减少人员操作、清扫等无关剧烈动作干扰 |\n| 5 | 支持格式：jpg/png/jpeg 图片，及 mp4/avi/mov 视频；单文件不超过 10MB |\n| 6 | 尽量在群体日常状态（非驱赶/转群时段）内采集，避免误将常规扰动识别为争斗 |\n\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\n## 🧪 标准流程 | Standard Flow\n\n| 步骤 | 阶段 | 执行动作 |\n|---:|---|---|\n| 1 | 📥 准备畜禽舍视频输入 | 提供本地文件路径或网络 URL；确保画面稳定、覆盖群体活动区 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行争斗行为识别 | 调用 `-m scripts.smyx_aggressive_behavior_detection_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看争斗片段清单、涉事个体、强度与预警等级及报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地畜禽舍图像/视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络畜禽舍图像/视频 URL 地址 | API 服务自动下载 |\n| `--pet-type` | 类别标识（畜禽场景保持 other） | 默认 `other`，按需填写 |\n| `--list` | 显示历史分析报告清单 | 可以输入起始日期参数过滤数据范围 |\n| `--api-url` | API 服务地址 | 可选，使用默认值 |\n| `--detail` | 输出详细程度 | `basic` / `standard` / `json`，默认 `json` |\n| `--output` | 结果输出文件路径 | 可选 |\n\n---\n\n## 🗂️ 资源索引 | Resource Index\n\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_aggressive_behavior_detection_analysis.py`](scripts/smyx_aggressive_behavior_detection_analysis.py) | 调用 API 进行争斗行为识别或查询历史报告 | 执行分析或查询时使用 |\n| ⚙️ 配置文件 | [`scripts/config.py`](scripts/config.py) | 场景码 `SMYX_AGGRESSIVE_BEHAVIOR_DETECTION_ANALYSIS`、默认参数配置 | 需要确认默认配置时读取 |\n| 📘 领域参考 | [`references/api_doc.md`](references/api_doc.md) | 了解 API 接口规范、字段说明和错误码 | 仅在需要了解接口规范或错误码时读取 |\n\n---\n\n## ⚠️ 注意事项 | Notes\n\n| 分类 | 注意事项 |\n|---|---|\n| 📚 文档读取 | 仅在需要时读取参考文档，保持上下文简洁 |\n| 📁 格式支持 | 图片支持 `jpg` / `png` / `jpeg`；视频支持 `mp4` / `avi` / `mov`；单文件最大 `10MB` |\n| 🧑‍⚖️ 结果性质 | 识别结果仅供争斗行为预警参考，本技能不提供行为干预建议 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能使用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数无需本地下载，默认为公网地址，API 服务会自动下载 |\n| 📜 报告输出 | 显示历史分析报告清单时，从接口返回 JSON 数据中提取字段作为超链接地址，并自动转化为 Markdown 表格输出 |\n\n---\n\n## 🔒 隐私与数据安全声明 | Privacy & Data Security\n\n| 序号 | 说明 |\n|---:|---|\n| 1 | 仅采集与畜禽争斗行为识别直接相关的图像/视频数据，不采集与争斗识别无关的敏感信息 |\n| 2 | 内部身份参数由系统自动处理，不在任何输出、日志或报告中暴露 |\n| 3 | 分析请求通过服务端 API 完成，网络传输遵循平台既有安全策略 |\n| 4 | 历史报告仅当前身份可读，不做跨养殖场/跨用户汇总或共享 |\n| 5 | 识别结果仅供参考，实际干预与处置请结合养殖场规程与专业动物福利/兽医意见 |\n\n---\n\n## 📜 历史报告清单输出规范 | Report List Format\n\n当显示历史分析报告清单的时候，从接口返回 JSON 数据中提取字段作为超链接地址，且自动转化为如下 Markdown 表格格式输出。\n\n### 📌 固定输出列\n\n| 列名 | 生成规则 |\n|---|---|\n| 报告名称 | 使用 `畜禽争斗行为识别报告-{记录id}` 形式拼接 |\n| 预警等级 | 从接口返回数据中提取（正常 / 关注 / 预警 / 紧急） |\n| 分析时间 | 从接口返回数据中提取 |\n| 点击查看 | 使用 `[🔗 查看报告]()` 格式的超链接 |\n\n### 🧾 表格输出示例\n\n| 报告名称 | 预警等级 | 分析时间 | 点击查看 |\n|----------|----------|----------|----------|\n| 畜禽争斗行为识别报告-20260703160500001 | 预警 | 2026-07-03 16:05:00 | [🔗 查看报告](https://example.com/report?id=xxx) |\n\n---\n\n## 🧰 使用示例 | Examples\n\n### 🐷 分析本地猪舍连续视频\n\n```bash\npython -m scripts.smyx_aggressive_behavior_detection_analysis --input /path/to/pig_barn.mp4\n```\n\n### 🐔 分析本地鸡舍连续视频\n\n```bash\npython -m scripts.smyx_aggressive_behavior_detection_analysis --input /path/to/chicken_house.mp4\n```\n\n### 🌐 分析网络畜禽舍视频\n\n```bash\npython -m scripts.smyx_aggressive_behavior_detection_analysis --url https://example.com/livestock_barn.mp4\n```\n\n### 📚 显示历史分析报告 / 显示分析报告清单列表 / 显示历史争斗行为报告\n\n> 自动触发关键词：查看历史争斗行为报告、历史报告、争斗行为识别清单等。\n\n```bash\npython -m scripts.smyx_aggressive_behavior_detection_analysis --list\n```\n\n### 🪶 输出精简报告\n\n```bash\npython -m scripts.smyx_aggressive_behavior_detection_analysis --input pig_barn.mp4 --detail basic\n```\n\n### 💾 保存结果到文件\n\n```bash\npython -m scripts.smyx_aggressive_behavior_detection_analysis --input chicken_house.mp4 --output result.json\n```\n\nFile v1.0.12:_meta.json\n\n{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-aggressive-behavior-detection-analysis\",\n  \"version\": \"1.0.12\",\n  \"publishedAt\": 1790944772953\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/ai-analysis/v2/start-common-ai-analysis` - 启动畜禽争斗行为识别分析任务\n2. `/web/ai-analysis/get-common-ai-analysis-result` - 获取分析结果\n3. `/web/ai-analysis/page-common-ai-analysis-result` - 分页查询历史报告\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_AGGRESSIVE_BEHAVIOR_DETECTION_ANALYSIS` - 畜禽争斗行为识别\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 barn images and videos for aggressive livestock and poultry interactions, reporting behavior type, intensity, and alert level.\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\nLivestock keepers and farm staff use the skill to screen barn footage for fighting, biting, chasing, and butting, then review alerts and historical reports.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Barn media or supplied URLs are sent to an external cloud service for analysis.\n\nMitigation: Confirm data handling and retention expectations before submitting sensitive footage or URLs.\n\nRisk: The skill creates or reuses cloud identity state and stores tokens in the workspace data directory.\n\nMitigation: Review identity and deletion practices and limit access to the workspace data directory.\n\nRisk: Detection results may not reliably determine when an animal needs intervention.\n\nMitigation: Treat alerts as screening signals and follow farm procedures and veterinary guidance for decisions.\n\n## Reference(s):\n\n- [ClawHub skill listing](https://clawhub.ai/18072937735/skills/smyx-aggressive-behavior-detection-analysis)\n- [Skill demonstration](https://lifeemergence.com/sample.html)\n- [API documentation](references/api_doc.md)\n\n## Skill Output:\n\n**Output Type(s):** [Text, Markdown]\n\n**Output Format:** [Structured analysis report or Markdown table of historical reports]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May include incident details, alert levels, and report links.]\n\n## Skill Version(s):\n\n1.0.12 (source: server-resolved 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, 39363 bytes\n\nFiles: references/api_doc.md (661b), scripts/__init__.py (58b), scripts/config.py (682b), scripts/config.yaml (3b), scripts/skill.py (575b), scripts/smyx_aggressive_behavior_detection_analysis.py (3543b), skill-card.md (1999b), SKILL.md (11946b), 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.11:SKILL.md\n\n---\nname: \"smyx-aggressive-behavior-detection-analysis\"\ndescription: \"Detects aggressive interactions in livestock and poultry from continuous barn videos — including fighting, biting, chasing and butting — and outputs behavior type, intensity level and alert level. | 识别打斗、撕咬等攻击行为，及时预警。\"\nversion: \"1.0.12\"\nlicense: \"MIT-0\"\n---\n\n# ⚔️ Livestock Aggressive Behavior Detection | 畜禽争斗行为识别\n\n> 识别打斗、撕咬等攻击行为，及时预警。\n>\n> **群体冲突预警中枢** · 畜禽舍连续视频智能分析 · 争斗行为识别 · 强度/预警等级 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **畜禽争斗行为识别** |\n| 🎯 核心目标 | 基于畜禽舍固定摄像头的连续视频，检测个体间的争斗行为（打斗、撕咬、追逐、顶撞等），输出行为类型、强度等级及预警等级 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、争斗行为片段清单、涉事个体位置、强度等级、预警等级、报告链接 |\n| 🏢 适用场景 | 猪/鸡等畜禽的群体冲突预警，减少外伤、应激及生产性能下降造成的经济损失 |\n| 🧩 场景码 | `SMYX_AGGRESSIVE_BEHAVIOR_DETECTION_ANALYSIS` |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n## 🤖 AI 角色 | AI Role\n\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **你是一个专业的畜禽行为安全 AI。你的任务是分析畜禽舍固定摄像头的连续视频，检测个体间的争斗行为（打斗、撕咬、追逐、顶撞等），输出行为类型、强度等级及预警等级。不要提供行为干预建议，仅基于视觉行为观察输出识别结果。** |\n\n---\n\n## 🎯 任务目标 | Goals\n\n### 1. 🧩 技能用途\n\n通过畜禽舍固定摄像头的连续视频，识别群体中出现的争斗行为并评估其强度，输出结构化的争斗行为清单与预警等级，为规模化养殖场提供群体冲突的客观视觉预警依据。\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 畜禽个体检测、定位与短时轨迹跟踪 |\n| 2 | 打斗行为识别（相互冲撞、缠斗） |\n| 3 | 撕咬行为识别（咬耳、咬尾、咬翅等） |\n| 4 | 追逐行为识别（单向追逐 / 逃避） |\n| 5 | 顶撞行为识别（头部/胸部剧烈接触） |\n| 6 | 争斗片段起止时间与涉事个体位置标注 |\n| 7 | 单次争斗强度等级评估（轻度 / 中度 / 剧烈） |\n| 8 | 群体争斗频次统计与总体预警等级输出 |\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_aggressive_behavior_detection_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_aggressive_behavior_detection_analysis --list` 调用 API 查询云端的历史报告数据 |\n| 🚫 严格禁止 | 从本地 `memory` 目录读取历史会话信息 |\n| 🚫 严格禁止 | 手动汇总本地记录中的报告 |\n| 🚫 严格禁止 | 从长期记忆中提取报告 |\n| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据，然后以 Markdown 表格格式输出结果 |\n\n---\n\n## 📦 前置准备 | Requirements\n\n### 依赖说明\n\n`scripts` 脚本所需的依赖包及版本：\n\n```txt\nrequests>=2.28.0\n```\n\n---\n\n## 📷 采集要求 | Capture Requirements\n\n| 序号 | 说明 |\n|---:|---|\n| 1 | 固定摄像头俯视/斜俯视覆盖畜禽舍主要活动区，画面稳定、避免频繁抖动 |\n| 2 | 视频建议 30 秒~10 分钟连续拍摄，帧率不低于 15fps，便于捕捉短促的争斗动作 |\n| 3 | 光照条件稳定，白天充足自然光或稳定人工光源，避免大面积过暗/过曝 |\n| 4 | 单栏舍内目标个体清晰可见，尽量减少人员操作、清扫等无关剧烈动作干扰 |\n| 5 | 支持格式：jpg/png/jpeg 图片，及 mp4/avi/mov 视频；单文件不超过 10MB |\n| 6 | 尽量在群体日常状态（非驱赶/转群时段）内采集，避免误将常规扰动识别为争斗 |\n\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\n## 🧪 标准流程 | Standard Flow\n\n| 步骤 | 阶段 | 执行动作 |\n|---:|---|---|\n| 1 | 📥 准备畜禽舍视频输入 | 提供本地文件路径或网络 URL；确保画面稳定、覆盖群体活动区 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行争斗行为识别 | 调用 `-m scripts.smyx_aggressive_behavior_detection_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看争斗片段清单、涉事个体、强度与预警等级及报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地畜禽舍图像/视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络畜禽舍图像/视频 URL 地址 | API 服务自动下载 |\n| `--pet-type` | 类别标识（畜禽场景保持 other） | 默认 `other`，按需填写 |\n| `--list` | 显示历史分析报告清单 | 可以输入起始日期参数过滤数据范围 |\n| `--api-url` | API 服务地址 | 可选，使用默认值 |\n| `--detail` | 输出详细程度 | `basic` / `standard` / `json`，默认 `json` |\n| `--output` | 结果输出文件路径 | 可选 |\n\n---\n\n## 🗂️ 资源索引 | Resource Index\n\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_aggressive_behavior_detection_analysis.py`](scripts/smyx_aggressive_behavior_detection_analysis.py) | 调用 API 进行争斗行为识别或查询历史报告 | 执行分析或查询时使用 |\n| ⚙️ 配置文件 | [`scripts/config.py`](scripts/config.py) | 场景码 `SMYX_AGGRESSIVE_BEHAVIOR_DETECTION_ANALYSIS`、默认参数配置 | 需要确认默认配置时读取 |\n| 📘 领域参考 | [`references/api_doc.md`](references/api_doc.md) | 了解 API 接口规范、字段说明和错误码 | 仅在需要了解接口规范或错误码时读取 |\n\n---\n\n## ⚠️ 注意事项 | Notes\n\n| 分类 | 注意事项 |\n|---|---|\n| 📚 文档读取 | 仅在需要时读取参考文档，保持上下文简洁 |\n| 📁 格式支持 | 图片支持 `jpg` / `png` / `jpeg`；视频支持 `mp4` / `avi` / `mov`；单文件最大 `10MB` |\n| 🧑‍⚖️ 结果性质 | 识别结果仅供争斗行为预警参考，本技能不提供行为干预建议 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能使用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数无需本地下载，默认为公网地址，API 服务会自动下载 |\n| 📜 报告输出 | 显示历史分析报告清单时，从接口返回 JSON 数据中提取字段作为超链接地址，并自动转化为 Markdown 表格输出 |\n\n---\n\n## 🔒 隐私与数据安全声明 | Privacy & Data Security\n\n| 序号 | 说明 |\n|---:|---|\n| 1 | 仅采集与畜禽争斗行为识别直接相关的图像/视频数据，不采集与争斗识别无关的敏感信息 |\n| 2 | 内部身份参数由系统自动处理，不在任何输出、日志或报告中暴露 |\n| 3 | 分析请求通过服务端 API 完成，网络传输遵循平台既有安全策略 |\n| 4 | 历史报告仅当前身份可读，不做跨养殖场/跨用户汇总或共享 |\n| 5 | 识别结果仅供参考，实际干预与处置请结合养殖场规程与专业动物福利/兽医意见 |\n\n---\n\n## 📜 历史报告清单输出规范 | Report List Format\n\n当显示历史分析报告清单的时候，从接口返回 JSON 数据中提取字段作为超链接地址，且自动转化为如下 Markdown 表格格式输出。\n\n### 📌 固定输出列\n\n| 列名 | 生成规则 |\n|---|---|\n| 报告名称 | 使用 `畜禽争斗行为识别报告-{记录id}` 形式拼接 |\n| 预警等级 | 从接口返回数据中提取（正常 / 关注 / 预警 / 紧急） |\n| 分析时间 | 从接口返回数据中提取 |\n| 点击查看 | 使用 `[🔗 查看报告]()` 格式的超链接 |\n\n### 🧾 表格输出示例\n\n| 报告名称 | 预警等级 | 分析时间 | 点击查看 |\n|----------|----------|----------|----------|\n| 畜禽争斗行为识别报告-20260703160500001 | 预警 | 2026-07-03 16:05:00 | [🔗 查看报告](https://example.com/report?id=xxx) |\n\n---\n\n## 🧰 使用示例 | Examples\n\n### 🐷 分析本地猪舍连续视频\n\n```bash\npython -m scripts.smyx_aggressive_behavior_detection_analysis --input /path/to/pig_barn.mp4\n```\n\n### 🐔 分析本地鸡舍连续视频\n\n```bash\npython -m scripts.smyx_aggressive_behavior_detection_analysis --input /path/to/chicken_house.mp4\n```\n\n### 🌐 分析网络畜禽舍视频\n\n```bash\npython -m scripts.smyx_aggressive_behavior_detection_analysis --url https://example.com/livestock_barn.mp4\n```\n\n### 📚 显示历史分析报告 / 显示分析报告清单列表 / 显示历史争斗行为报告\n\n> 自动触发关键词：查看历史争斗行为报告、历史报告、争斗行为识别清单等。\n\n```bash\npython -m scripts.smyx_aggressive_behavior_detection_analysis --list\n```\n\n### 🪶 输出精简报告\n\n```bash\npython -m scripts.smyx_aggressive_behavior_detection_analysis --input pig_barn.mp4 --detail basic\n```\n\n### 💾 保存结果到文件\n\n```bash\npython -m scripts.smyx_aggressive_behavior_detection_analysis --input chicken_house.mp4 --output result.json\n```\n\nFile v1.0.11:_meta.json\n\n{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-aggressive-behavior-detection-analysis\",\n  \"version\": \"1.0.11\",\n  \"publishedAt\": 1790398473484\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/ai-analysis/v2/start-common-ai-analysis` - 启动畜禽争斗行为识别分析任务\n2. `/web/ai-analysis/get-common-ai-analysis-result` - 获取分析结果\n3. `/web/ai-analysis/page-common-ai-analysis-result` - 分页查询历史报告\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_AGGRESSIVE_BEHAVIOR_DETECTION_ANALYSIS` - 畜禽争斗行为识别\n\nFile v1.0.11:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.11:scripts/config.yaml\n\n{}\n\nFile v1.0.11:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.11:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.11:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.11:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: prod\n\nFile v1.0.11:skill-card.md\n\n## Description:\n\nAnalyzes livestock and poultry images or barn videos for fighting, biting, chasing, and butting, and reports behavior, intensity, and alert levels.\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\nLivestock producers and monitoring teams use this skill to flag potentially aggressive behavior in barn footage, review alert levels, and retrieve past analysis reports. Results are for warning and review, not intervention advice.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Submitting barn footage or URLs sends content to the lifeemergence.com analysis service, potentially including sensitive facility or worker imagery.\n\nMitigation: Submit only authorized footage and URLs; avoid sensitive imagery and review applicable sharing policies before use.\n\nRisk: The skill creates or reuses a workspace identity, stores service tokens locally, and can retrieve cloud history reports.\n\nMitigation: Use an isolated workspace, limit access to its stored data, and review or clear the local data database when uninstalling.\n\n## Reference(s):\n\n- [Aggressive behavior detection API reference](references/api_doc.md)\n- [Skill demonstration](https://lifeemergence.com/sample.html)\n\n## Skill Output:\n\n**Output Type(s):** [Text, Markdown, Files]\n\n**Output Format:** [JSON analysis results or Markdown report tables; optional saved result file]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Includes behavior, intensity, and alert levels; history lists can link to full reports.]\n\n## Skill Version(s):\n\n1.0.11 (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.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, 39566 bytes\n\nFiles: references/api_doc.md (661b), scripts/__init__.py (58b), scripts/config.py (682b), scripts/config.yaml (3b), scripts/skill.py (575b), scripts/smyx_aggressive_behavior_detection_analysis.py (3543b), skill-card.md (2486b), SKILL.md (11946b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (24363b), skills/smyx_common/scripts/config.yaml (473b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28776b), _meta.json (163b)\n\nFile v1.0.10:SKILL.md\n\n---\nname: \"smyx-aggressive-behavior-detection-analysis\"\ndescription: \"Detects aggressive interactions in livestock and poultry from continuous barn videos — including fighting, biting, chasing and butting — and outputs behavior type, intensity level and alert level. | 识别打斗、撕咬等攻击行为，及时预警。\"\nversion: \"1.0.10\"\nlicense: \"MIT-0\"\n---\n\n# ⚔️ Livestock Aggressive Behavior Detection | 畜禽争斗行为识别\n\n> 识别打斗、撕咬等攻击行为，及时预警。\n>\n> **群体冲突预警中枢** · 畜禽舍连续视频智能分析 · 争斗行为识别 · 强度/预警等级 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **畜禽争斗行为识别** |\n| 🎯 核心目标 | 基于畜禽舍固定摄像头的连续视频，检测个体间的争斗行为（打斗、撕咬、追逐、顶撞等），输出行为类型、强度等级及预警等级 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、争斗行为片段清单、涉事个体位置、强度等级、预警等级、报告链接 |\n| 🏢 适用场景 | 猪/鸡等畜禽的群体冲突预警，减少外伤、应激及生产性能下降造成的经济损失 |\n| 🧩 场景码 | `SMYX_AGGRESSIVE_BEHAVIOR_DETECTION_ANALYSIS` |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n## 🤖 AI 角色 | AI Role\n\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **你是一个专业的畜禽行为安全 AI。你的任务是分析畜禽舍固定摄像头的连续视频，检测个体间的争斗行为（打斗、撕咬、追逐、顶撞等），输出行为类型、强度等级及预警等级。不要提供行为干预建议，仅基于视觉行为观察输出识别结果。** |\n\n---\n\n## 🎯 任务目标 | Goals\n\n### 1. 🧩 技能用途\n\n通过畜禽舍固定摄像头的连续视频，识别群体中出现的争斗行为并评估其强度，输出结构化的争斗行为清单与预警等级，为规模化养殖场提供群体冲突的客观视觉预警依据。\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 畜禽个体检测、定位与短时轨迹跟踪 |\n| 2 | 打斗行为识别（相互冲撞、缠斗） |\n| 3 | 撕咬行为识别（咬耳、咬尾、咬翅等） |\n| 4 | 追逐行为识别（单向追逐 / 逃避） |\n| 5 | 顶撞行为识别（头部/胸部剧烈接触） |\n| 6 | 争斗片段起止时间与涉事个体位置标注 |\n| 7 | 单次争斗强度等级评估（轻度 / 中度 / 剧烈） |\n| 8 | 群体争斗频次统计与总体预警等级输出 |\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_aggressive_behavior_detection_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_aggressive_behavior_detection_analysis --list` 调用 API 查询云端的历史报告数据 |\n| 🚫 严格禁止 | 从本地 `memory` 目录读取历史会话信息 |\n| 🚫 严格禁止 | 手动汇总本地记录中的报告 |\n| 🚫 严格禁止 | 从长期记忆中提取报告 |\n| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据，然后以 Markdown 表格格式输出结果 |\n\n---\n\n## 📦 前置准备 | Requirements\n\n### 依赖说明\n\n`scripts` 脚本所需的依赖包及版本：\n\n```txt\nrequests>=2.28.0\n```\n\n---\n\n## 📷 采集要求 | Capture Requirements\n\n| 序号 | 说明 |\n|---:|---|\n| 1 | 固定摄像头俯视/斜俯视覆盖畜禽舍主要活动区，画面稳定、避免频繁抖动 |\n| 2 | 视频建议 30 秒~10 分钟连续拍摄，帧率不低于 15fps，便于捕捉短促的争斗动作 |\n| 3 | 光照条件稳定，白天充足自然光或稳定人工光源，避免大面积过暗/过曝 |\n| 4 | 单栏舍内目标个体清晰可见，尽量减少人员操作、清扫等无关剧烈动作干扰 |\n| 5 | 支持格式：jpg/png/jpeg 图片，及 mp4/avi/mov 视频；单文件不超过 10MB |\n| 6 | 尽量在群体日常状态（非驱赶/转群时段）内采集，避免误将常规扰动识别为争斗 |\n\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\n## 🧪 标准流程 | Standard Flow\n\n| 步骤 | 阶段 | 执行动作 |\n|---:|---|---|\n| 1 | 📥 准备畜禽舍视频输入 | 提供本地文件路径或网络 URL；确保画面稳定、覆盖群体活动区 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行争斗行为识别 | 调用 `-m scripts.smyx_aggressive_behavior_detection_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看争斗片段清单、涉事个体、强度与预警等级及报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地畜禽舍图像/视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络畜禽舍图像/视频 URL 地址 | API 服务自动下载 |\n| `--pet-type` | 类别标识（畜禽场景保持 other） | 默认 `other`，按需填写 |\n| `--list` | 显示历史分析报告清单 | 可以输入起始日期参数过滤数据范围 |\n| `--api-url` | API 服务地址 | 可选，使用默认值 |\n| `--detail` | 输出详细程度 | `basic` / `standard` / `json`，默认 `json` |\n| `--output` | 结果输出文件路径 | 可选 |\n\n---\n\n## 🗂️ 资源索引 | Resource Index\n\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_aggressive_behavior_detection_analysis.py`](scripts/smyx_aggressive_behavior_detection_analysis.py) | 调用 API 进行争斗行为识别或查询历史报告 | 执行分析或查询时使用 |\n| ⚙️ 配置文件 | [`scripts/config.py`](scripts/config.py) | 场景码 `SMYX_AGGRESSIVE_BEHAVIOR_DETECTION_ANALYSIS`、默认参数配置 | 需要确认默认配置时读取 |\n| 📘 领域参考 | [`references/api_doc.md`](references/api_doc.md) | 了解 API 接口规范、字段说明和错误码 | 仅在需要了解接口规范或错误码时读取 |\n\n---\n\n## ⚠️ 注意事项 | Notes\n\n| 分类 | 注意事项 |\n|---|---|\n| 📚 文档读取 | 仅在需要时读取参考文档，保持上下文简洁 |\n| 📁 格式支持 | 图片支持 `jpg` / `png` / `jpeg`；视频支持 `mp4` / `avi` / `mov`；单文件最大 `10MB` |\n| 🧑‍⚖️ 结果性质 | 识别结果仅供争斗行为预警参考，本技能不提供行为干预建议 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能使用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数无需本地下载，默认为公网地址，API 服务会自动下载 |\n| 📜 报告输出 | 显示历史分析报告清单时，从接口返回 JSON 数据中提取字段作为超链接地址，并自动转化为 Markdown 表格输出 |\n\n---\n\n## 🔒 隐私与数据安全声明 | Privacy & Data Security\n\n| 序号 | 说明 |\n|---:|---|\n| 1 | 仅采集与畜禽争斗行为识别直接相关的图像/视频数据，不采集与争斗识别无关的敏感信息 |\n| 2 | 内部身份参数由系统自动处理，不在任何输出、日志或报告中暴露 |\n| 3 | 分析请求通过服务端 API 完成，网络传输遵循平台既有安全策略 |\n| 4 | 历史报告仅当前身份可读，不做跨养殖场/跨用户汇总或共享 |\n| 5 | 识别结果仅供参考，实际干预与处置请结合养殖场规程与专业动物福利/兽医意见 |\n\n---\n\n## 📜 历史报告清单输出规范 | Report List Format\n\n当显示历史分析报告清单的时候，从接口返回 JSON 数据中提取字段作为超链接地址，且自动转化为如下 Markdown 表格格式输出。\n\n### 📌 固定输出列\n\n| 列名 | 生成规则 |\n|---|---|\n| 报告名称 | 使用 `畜禽争斗行为识别报告-{记录id}` 形式拼接 |\n| 预警等级 | 从接口返回数据中提取（正常 / 关注 / 预警 / 紧急） |\n| 分析时间 | 从接口返回数据中提取 |\n| 点击查看 | 使用 `[🔗 查看报告]()` 格式的超链接 |\n\n### 🧾 表格输出示例\n\n| 报告名称 | 预警等级 | 分析时间 | 点击查看 |\n|----------|----------|----------|----------|\n| 畜禽争斗行为识别报告-20260703160500001 | 预警 | 2026-07-03 16:05:00 | [🔗 查看报告](https://example.com/report?id=xxx) |\n\n---\n\n## 🧰 使用示例 | Examples\n\n### 🐷 分析本地猪舍连续视频\n\n```bash\npython -m scripts.smyx_aggressive_behavior_detection_analysis --input /path/to/pig_barn.mp4\n```\n\n### 🐔 分析本地鸡舍连续视频\n\n```bash\npython -m scripts.smyx_aggressive_behavior_detection_analysis --input /path/to/chicken_house.mp4\n```\n\n### 🌐 分析网络畜禽舍视频\n\n```bash\npython -m scripts.smyx_aggressive_behavior_detection_analysis --url https://example.com/livestock_barn.mp4\n```\n\n### 📚 显示历史分析报告 / 显示分析报告清单列表 / 显示历史争斗行为报告\n\n> 自动触发关键词：查看历史争斗行为报告、历史报告、争斗行为识别清单等。\n\n```bash\npython -m scripts.smyx_aggressive_behavior_detection_analysis --list\n```\n\n### 🪶 输出精简报告\n\n```bash\npython -m scripts.smyx_aggressive_behavior_detection_analysis --input pig_barn.mp4 --detail basic\n```\n\n### 💾 保存结果到文件\n\n```bash\npython -m scripts.smyx_aggressive_behavior_detection_analysis --input chicken_house.mp4 --output result.json\n```\n\nFile v1.0.10:_meta.json\n\n{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-aggressive-behavior-detection-analysis\",\n  \"version\": \"1.0.10\",\n  \"publishedAt\": 1789715257944\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/ai-analysis/v2/start-common-ai-analysis` - 启动畜禽争斗行为识别分析任务\n2. `/web/ai-analysis/get-common-ai-analysis-result` - 获取分析结果\n3. `/web/ai-analysis/page-common-ai-analysis-result` - 分页查询历史报告\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_AGGRESSIVE_BEHAVIOR_DETECTION_ANALYSIS` - 畜禽争斗行为识别\n\nFile v1.0.10:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.10:scripts/config.yaml\n\n{}\n\nFile v1.0.10:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.10:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.10:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.10:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: prod\n\nFile v1.0.10:skill-card.md\n\n## Description:\n\nDetects aggressive interactions in livestock and poultry from continuous barn videos, including fighting, biting, chasing and butting, and outputs behavior type, intensity level and alert level.\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\nFarm operators, developers, and external users use this skill to analyze livestock or poultry barn images and videos for aggressive behaviors, produce structured findings, and review alert levels and historical reports.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Barn media or media URLs are sent to Life Emergence/Open API services for remote analysis.\n\nMitigation: Install only when this data flow is acceptable, and confirm provider retention and account policies before using sensitive footage.\n\nRisk: The skill creates or reuses a local identity and may store authentication tokens in a workspace SQLite database.\n\nMitigation: Use a separate workspace or disposable identity when containment is required, and review local storage before deployment.\n\nRisk: The security verdict is suspicious because identity and token handling deserve user review.\n\nMitigation: Review and scan the skill before deployment, and limit use to trusted environments until the risk is accepted.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/18072937735/skills/smyx-aggressive-behavior-detection-analysis)\n- [Skill demo](https://lifeemergence.com/sample.html)\n- [API documentation](artifact/references/api_doc.md)\n- [Shared analysis API documentation](artifact/skills/smyx_analysis/references/api_doc.md)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, JSON, files, shell commands, guidance]\n\n**Output Format:** [Markdown or JSON analysis reports, Markdown history tables, and optional saved result files]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Includes behavior type, timestamps or report rows, subject locations when available, intensity level, alert level, and report links.]\n\n## Skill Version(s):\n\n1.0.10 (source: 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.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, 39587 bytes\n\nFiles: references/api_doc.md (661b), scripts/__init__.py (58b), scripts/config.py (682b), scripts/config.yaml (3b), scripts/skill.py (575b), scripts/smyx_aggressive_behavior_detection_analysis.py (3543b), skill-card.md (2524b), SKILL.md (11945b), 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-aggressive-behavior-detection-analysis\"\ndescription: \"Detects aggressive interactions in livestock and poultry from continuous barn videos — including fighting, biting, chasing and butting — and outputs behavior type, intensity level and alert level. | 识别打斗、撕咬等攻击行为，及时预警。\"\nversion: \"1.0.9\"\nlicense: \"MIT-0\"\n---\n\n# ⚔️ Livestock Aggressive Behavior Detection | 畜禽争斗行为识别\n\n> 识别打斗、撕咬等攻击行为，及时预警。\n>\n> **群体冲突预警中枢** · 畜禽舍连续视频智能分析 · 争斗行为识别 · 强度/预警等级 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **畜禽争斗行为识别** |\n| 🎯 核心目标 | 基于畜禽舍固定摄像头的连续视频，检测个体间的争斗行为（打斗、撕咬、追逐、顶撞等），输出行为类型、强度等级及预警等级 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、争斗行为片段清单、涉事个体位置、强度等级、预警等级、报告链接 |\n| 🏢 适用场景 | 猪/鸡等畜禽的群体冲突预警，减少外伤、应激及生产性能下降造成的经济损失 |\n| 🧩 场景码 | `SMYX_AGGRESSIVE_BEHAVIOR_DETECTION_ANALYSIS` |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n## 🤖 AI 角色 | AI Role\n\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **你是一个专业的畜禽行为安全 AI。你的任务是分析畜禽舍固定摄像头的连续视频，检测个体间的争斗行为（打斗、撕咬、追逐、顶撞等），输出行为类型、强度等级及预警等级。不要提供行为干预建议，仅基于视觉行为观察输出识别结果。** |\n\n---\n\n## 🎯 任务目标 | Goals\n\n### 1. 🧩 技能用途\n\n通过畜禽舍固定摄像头的连续视频，识别群体中出现的争斗行为并评估其强度，输出结构化的争斗行为清单与预警等级，为规模化养殖场提供群体冲突的客观视觉预警依据。\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 畜禽个体检测、定位与短时轨迹跟踪 |\n| 2 | 打斗行为识别（相互冲撞、缠斗） |\n| 3 | 撕咬行为识别（咬耳、咬尾、咬翅等） |\n| 4 | 追逐行为识别（单向追逐 / 逃避） |\n| 5 | 顶撞行为识别（头部/胸部剧烈接触） |\n| 6 | 争斗片段起止时间与涉事个体位置标注 |\n| 7 | 单次争斗强度等级评估（轻度 / 中度 / 剧烈） |\n| 8 | 群体争斗频次统计与总体预警等级输出 |\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_aggressive_behavior_detection_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_aggressive_behavior_detection_analysis --list` 调用 API 查询云端的历史报告数据 |\n| 🚫 严格禁止 | 从本地 `memory` 目录读取历史会话信息 |\n| 🚫 严格禁止 | 手动汇总本地记录中的报告 |\n| 🚫 严格禁止 | 从长期记忆中提取报告 |\n| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据，然后以 Markdown 表格格式输出结果 |\n\n---\n\n## 📦 前置准备 | Requirements\n\n### 依赖说明\n\n`scripts` 脚本所需的依赖包及版本：\n\n```txt\nrequests>=2.28.0\n```\n\n---\n\n## 📷 采集要求 | Capture Requirements\n\n| 序号 | 说明 |\n|---:|---|\n| 1 | 固定摄像头俯视/斜俯视覆盖畜禽舍主要活动区，画面稳定、避免频繁抖动 |\n| 2 | 视频建议 30 秒~10 分钟连续拍摄，帧率不低于 15fps，便于捕捉短促的争斗动作 |\n| 3 | 光照条件稳定，白天充足自然光或稳定人工光源，避免大面积过暗/过曝 |\n| 4 | 单栏舍内目标个体清晰可见，尽量减少人员操作、清扫等无关剧烈动作干扰 |\n| 5 | 支持格式：jpg/png/jpeg 图片，及 mp4/avi/mov 视频；单文件不超过 10MB |\n| 6 | 尽量在群体日常状态（非驱赶/转群时段）内采集，避免误将常规扰动识别为争斗 |\n\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\n## 🧪 标准流程 | Standard Flow\n\n| 步骤 | 阶段 | 执行动作 |\n|---:|---|---|\n| 1 | 📥 准备畜禽舍视频输入 | 提供本地文件路径或网络 URL；确保画面稳定、覆盖群体活动区 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行争斗行为识别 | 调用 `-m scripts.smyx_aggressive_behavior_detection_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看争斗片段清单、涉事个体、强度与预警等级及报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地畜禽舍图像/视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络畜禽舍图像/视频 URL 地址 | API 服务自动下载 |\n| `--pet-type` | 类别标识（畜禽场景保持 other） | 默认 `other`，按需填写 |\n| `--list` | 显示历史分析报告清单 | 可以输入起始日期参数过滤数据范围 |\n| `--api-url` | API 服务地址 | 可选，使用默认值 |\n| `--detail` | 输出详细程度 | `basic` / `standard` / `json`，默认 `json` |\n| `--output` | 结果输出文件路径 | 可选 |\n\n---\n\n## 🗂️ 资源索引 | Resource Index\n\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_aggressive_behavior_detection_analysis.py`](scripts/smyx_aggressive_behavior_detection_analysis.py) | 调用 API 进行争斗行为识别或查询历史报告 | 执行分析或查询时使用 |\n| ⚙️ 配置文件 | [`scripts/config.py`](scripts/config.py) | 场景码 `SMYX_AGGRESSIVE_BEHAVIOR_DETECTION_ANALYSIS`、默认参数配置 | 需要确认默认配置时读取 |\n| 📘 领域参考 | [`references/api_doc.md`](references/api_doc.md) | 了解 API 接口规范、字段说明和错误码 | 仅在需要了解接口规范或错误码时读取 |\n\n---\n\n## ⚠️ 注意事项 | Notes\n\n| 分类 | 注意事项 |\n|---|---|\n| 📚 文档读取 | 仅在需要时读取参考文档，保持上下文简洁 |\n| 📁 格式支持 | 图片支持 `jpg` / `png` / `jpeg`；视频支持 `mp4` / `avi` / `mov`；单文件最大 `10MB` |\n| 🧑‍⚖️ 结果性质 | 识别结果仅供争斗行为预警参考，本技能不提供行为干预建议 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能使用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数无需本地下载，默认为公网地址，API 服务会自动下载 |\n| 📜 报告输出 | 显示历史分析报告清单时，从接口返回 JSON 数据中提取字段作为超链接地址，并自动转化为 Markdown 表格输出 |\n\n---\n\n## 🔒 隐私与数据安全声明 | Privacy & Data Security\n\n| 序号 | 说明 |\n|---:|---|\n| 1 | 仅采集与畜禽争斗行为识别直接相关的图像/视频数据，不采集与争斗识别无关的敏感信息 |\n| 2 | 内部身份参数由系统自动处理，不在任何输出、日志或报告中暴露 |\n| 3 | 分析请求通过服务端 API 完成，网络传输遵循平台既有安全策略 |\n| 4 | 历史报告仅当前身份可读，不做跨养殖场/跨用户汇总或共享 |\n| 5 | 识别结果仅供参考，实际干预与处置请结合养殖场规程与专业动物福利/兽医意见 |\n\n---\n\n## 📜 历史报告清单输出规范 | Report List Format\n\n当显示历史分析报告清单的时候，从接口返回 JSON 数据中提取字段作为超链接地址，且自动转化为如下 Markdown 表格格式输出。\n\n### 📌 固定输出列\n\n| 列名 | 生成规则 |\n|---|---|\n| 报告名称 | 使用 `畜禽争斗行为识别报告-{记录id}` 形式拼接 |\n| 预警等级 | 从接口返回数据中提取（正常 / 关注 / 预警 / 紧急） |\n| 分析时间 | 从接口返回数据中提取 |\n| 点击查看 | 使用 `[🔗 查看报告]()` 格式的超链接 |\n\n### 🧾 表格输出示例\n\n| 报告名称 | 预警等级 | 分析时间 | 点击查看 |\n|----------|----------|----------|----------|\n| 畜禽争斗行为识别报告-20260703160500001 | 预警 | 2026-07-03 16:05:00 | [🔗 查看报告](https://example.com/report?id=xxx) |\n\n---\n\n## 🧰 使用示例 | Examples\n\n### 🐷 分析本地猪舍连续视频\n\n```bash\npython -m scripts.smyx_aggressive_behavior_detection_analysis --input /path/to/pig_barn.mp4\n```\n\n### 🐔 分析本地鸡舍连续视频\n\n```bash\npython -m scripts.smyx_aggressive_behavior_detection_analysis --input /path/to/chicken_house.mp4\n```\n\n### 🌐 分析网络畜禽舍视频\n\n```bash\npython -m scripts.smyx_aggressive_behavior_detection_analysis --url https://example.com/livestock_barn.mp4\n```\n\n### 📚 显示历史分析报告 / 显示分析报告清单列表 / 显示历史争斗行为报告\n\n> 自动触发关键词：查看历史争斗行为报告、历史报告、争斗行为识别清单等。\n\n```bash\npython -m scripts.smyx_aggressive_behavior_detection_analysis --list\n```\n\n### 🪶 输出精简报告\n\n```bash\npython -m scripts.smyx_aggressive_behavior_detection_analysis --input pig_barn.mp4 --detail basic\n```\n\n### 💾 保存结果到文件\n\n```bash\npython -m scripts.smyx_aggressive_behavior_detection_analysis --input chicken_house.mp4 --output result.json\n```\n\nFile v1.0.9:_meta.json\n\n{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-aggressive-behavior-detection-analysis\",\n  \"version\": \"1.0.9\",\n  \"publishedAt\": 1788372033836\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/ai-analysis/v2/start-common-ai-analysis` - 启动畜禽争斗行为识别分析任务\n2. `/web/ai-analysis/get-common-ai-analysis-result` - 获取分析结果\n3. `/web/ai-analysis/page-common-ai-analysis-result` - 分页查询历史报告\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_AGGRESSIVE_BEHAVIOR_DETECTION_ANALYSIS` - 畜禽争斗行为识别\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\nDetects aggressive interactions in livestock and poultry from continuous barn videos, including fighting, biting, chasing, and butting, and outputs behavior type, intensity level, and alert level.\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 users and farm operations teams use this skill to analyze fixed-camera livestock or poultry barn video for aggressive interactions and receive structured behavior, intensity, alert-level, and report-link output. The skill is intended for visual warning and reporting workflows, not for animal-care intervention advice.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Barn images, videos, and account-linked report requests may be sent to the publisher's cloud service.\n\nMitigation: Use the skill only when that data sharing is acceptable, and avoid submitting sensitive or unrelated footage.\n\nRisk: The security evidence notes hidden identity handling and local token persistence.\n\nMitigation: Treat any workspace database or token files as sensitive and review storage, retention, and access controls before deployment.\n\nRisk: The security evidence notes plaintext development endpoints.\n\nMitigation: Confirm the package is configured for HTTPS production endpoints before use with real farm data or credentials.\n\n## Reference(s):\n\n- [ClawHub Skill Page](https://clawhub.ai/18072937735/skills/smyx-aggressive-behavior-detection-analysis)\n- [Skill Demo](https://lifeemergence.com/sample.html)\n- [Aggressive Behavior Detection API Documentation](references/api_doc.md)\n- [Shared Analysis API Documentation](skills/smyx_analysis/references/api_doc.md)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, json, files]\n\n**Output Format:** [Markdown or JSON analysis reports with behavior segments, locations, intensity levels, alert levels, and report links.]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Can write result text to a requested output file; historical report lists are returned as Markdown tables.]\n\n## Skill Version(s):\n\n1.0.9 (source: server release metadata and SKILL.md frontmatter)\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, 39587 bytes\n\nFiles: references/api_doc.md (661b), scripts/__init__.py (58b), scripts/config.py (682b), scripts/config.yaml (3b), scripts/skill.py (575b), scripts/smyx_aggressive_behavior_detection_analysis.py (3543b), skill-card.md (2617b), SKILL.md (11945b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (24363b), skills/smyx_common/scripts/config.yaml (472b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28776b), _meta.json (162b)\n\nFile v1.0.8:SKILL.md\n\n---\nname: \"smyx-aggressive-behavior-detection-analysis\"\ndescription: \"Detects aggressive interactions in livestock and poultry from continuous barn videos — including fighting, biting, chasing and butting — and outputs behavior type, intensity level and alert level. | 识别打斗、撕咬等攻击行为，及时预警。\"\nversion: \"1.0.8\"\nlicense: \"MIT-0\"\n---\n\n# ⚔️ Livestock Aggressive Behavior Detection | 畜禽争斗行为识别\n\n> 识别打斗、撕咬等攻击行为，及时预警。\n>\n> **群体冲突预警中枢** · 畜禽舍连续视频智能分析 · 争斗行为识别 · 强度/预警等级 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **畜禽争斗行为识别** |\n| 🎯 核心目标 | 基于畜禽舍固定摄像头的连续视频，检测个体间的争斗行为（打斗、撕咬、追逐、顶撞等），输出行为类型、强度等级及预警等级 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、争斗行为片段清单、涉事个体位置、强度等级、预警等级、报告链接 |\n| 🏢 适用场景 | 猪/鸡等畜禽的群体冲突预警，减少外伤、应激及生产性能下降造成的经济损失 |\n| 🧩 场景码 | `SMYX_AGGRESSIVE_BEHAVIOR_DETECTION_ANALYSIS` |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n## 🤖 AI 角色 | AI Role\n\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **你是一个专业的畜禽行为安全 AI。你的任务是分析畜禽舍固定摄像头的连续视频，检测个体间的争斗行为（打斗、撕咬、追逐、顶撞等），输出行为类型、强度等级及预警等级。不要提供行为干预建议，仅基于视觉行为观察输出识别结果。** |\n\n---\n\n## 🎯 任务目标 | Goals\n\n### 1. 🧩 技能用途\n\n通过畜禽舍固定摄像头的连续视频，识别群体中出现的争斗行为并评估其强度，输出结构化的争斗行为清单与预警等级，为规模化养殖场提供群体冲突的客观视觉预警依据。\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 畜禽个体检测、定位与短时轨迹跟踪 |\n| 2 | 打斗行为识别（相互冲撞、缠斗） |\n| 3 | 撕咬行为识别（咬耳、咬尾、咬翅等） |\n| 4 | 追逐行为识别（单向追逐 / 逃避） |\n| 5 | 顶撞行为识别（头部/胸部剧烈接触） |\n| 6 | 争斗片段起止时间与涉事个体位置标注 |\n| 7 | 单次争斗强度等级评估（轻度 / 中度 / 剧烈） |\n| 8 | 群体争斗频次统计与总体预警等级输出 |\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_aggressive_behavior_detection_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_aggressive_behavior_detection_analysis --list` 调用 API 查询云端的历史报告数据 |\n| 🚫 严格禁止 | 从本地 `memory` 目录读取历史会话信息 |\n| 🚫 严格禁止 | 手动汇总本地记录中的报告 |\n| 🚫 严格禁止 | 从长期记忆中提取报告 |\n| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据，然后以 Markdown 表格格式输出结果 |\n\n---\n\n## 📦 前置准备 | Requirements\n\n### 依赖说明\n\n`scripts` 脚本所需的依赖包及版本：\n\n```txt\nrequests>=2.28.0\n```\n\n---\n\n## 📷 采集要求 | Capture Requirements\n\n| 序号 | 说明 |\n|---:|---|\n| 1 | 固定摄像头俯视/斜俯视覆盖畜禽舍主要活动区，画面稳定、避免频繁抖动 |\n| 2 | 视频建议 30 秒~10 分钟连续拍摄，帧率不低于 15fps，便于捕捉短促的争斗动作 |\n| 3 | 光照条件稳定，白天充足自然光或稳定人工光源，避免大面积过暗/过曝 |\n| 4 | 单栏舍内目标个体清晰可见，尽量减少人员操作、清扫等无关剧烈动作干扰 |\n| 5 | 支持格式：jpg/png/jpeg 图片，及 mp4/avi/mov 视频；单文件不超过 10MB |\n| 6 | 尽量在群体日常状态（非驱赶/转群时段）内采集，避免误将常规扰动识别为争斗 |\n\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\n## 🧪 标准流程 | Standard Flow\n\n| 步骤 | 阶段 | 执行动作 |\n|---:|---|---|\n| 1 | 📥 准备畜禽舍视频输入 | 提供本地文件路径或网络 URL；确保画面稳定、覆盖群体活动区 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行争斗行为识别 | 调用 `-m scripts.smyx_aggressive_behavior_detection_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看争斗片段清单、涉事个体、强度与预警等级及报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地畜禽舍图像/视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络畜禽舍图像/视频 URL 地址 | API 服务自动下载 |\n| `--pet-type` | 类别标识（畜禽场景保持 other） | 默认 `other`，按需填写 |\n| `--list` | 显示历史分析报告清单 | 可以输入起始日期参数过滤数据范围 |\n| `--api-url` | API 服务地址 | 可选，使用默认值 |\n| `--detail` | 输出详细程度 | `basic` / `standard` / `json`，默认 `json` |\n| `--output` | 结果输出文件路径 | 可选 |\n\n---\n\n## 🗂️ 资源索引 | Resource Index\n\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_aggressive_behavior_detection_analysis.py`](scripts/smyx_aggressive_behavior_detection_analysis.py) | 调用 API 进行争斗行为识别或查询历史报告 | 执行分析或查询时使用 |\n| ⚙️ 配置文件 | [`scripts/config.py`](scripts/config.py) | 场景码 `SMYX_AGGRESSIVE_BEHAVIOR_DETECTION_ANALYSIS`、默认参数配置 | 需要确认默认配置时读取 |\n| 📘 领域参考 | [`references/api_doc.md`](references/api_doc.md) | 了解 API 接口规范、字段说明和错误码 | 仅在需要了解接口规范或错误码时读取 |\n\n---\n\n## ⚠️ 注意事项 | Notes\n\n| 分类 | 注意事项 |\n|---|---|\n| 📚 文档读取 | 仅在需要时读取参考文档，保持上下文简洁 |\n| 📁 格式支持 | 图片支持 `jpg` / `png` / `jpeg`；视频支持 `mp4` / `avi` / `mov`；单文件最大 `10MB` |\n| 🧑‍⚖️ 结果性质 | 识别结果仅供争斗行为预警参考，本技能不提供行为干预建议 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能使用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数无需本地下载，默认为公网地址，API 服务会自动下载 |\n| 📜 报告输出 | 显示历史分析报告清单时，从接口返回 JSON 数据中提取字段作为超链接地址，并自动转化为 Markdown 表格输出 |\n\n---\n\n## 🔒 隐私与数据安全声明 | Privacy & Data Security\n\n| 序号 | 说明 |\n|---:|---|\n| 1 | 仅采集与畜禽争斗行为识别直接相关的图像/视频数据，不采集与争斗识别无关的敏感信息 |\n| 2 | 内部身份参数由系统自动处理，不在任何输出、日志或报告中暴露 |\n| 3 | 分析请求通过服务端 API 完成，网络传输遵循平台既有安全策略 |\n| 4 | 历史报告仅当前身份可读，不做跨养殖场/跨用户汇总或共享 |\n| 5 | 识别结果仅供参考，实际干预与处置请结合养殖场规程与专业动物福利/兽医意见 |\n\n---\n\n## 📜 历史报告清单输出规范 | Report List Format\n\n当显示历史分析报告清单的时候，从接口返回 JSON 数据中提取字段作为超链接地址，且自动转化为如下 Markdown 表格格式输出。\n\n### 📌 固定输出列\n\n| 列名 | 生成规则 |\n|---|---|\n| 报告名称 | 使用 `畜禽争斗行为识别报告-{记录id}` 形式拼接 |\n| 预警等级 | 从接口返回数据中提取（正常 / 关注 / 预警 / 紧急） |\n| 分析时间 | 从接口返回数据中提取 |\n| 点击查看 | 使用 `[🔗 查看报告]()` 格式的超链接 |\n\n### 🧾 表格输出示例\n\n| 报告名称 | 预警等级 | 分析时间 | 点击查看 |\n|----------|----------|----------|----------|\n| 畜禽争斗行为识别报告-20260703160500001 | 预警 | 2026-07-03 16:05:00 | [🔗 查看报告](https://example.com/report?id=xxx) |\n\n---\n\n## 🧰 使用示例 | Examples\n\n### 🐷 分析本地猪舍连续视频\n\n```bash\npython -m scripts.smyx_aggressive_behavior_detection_analysis --input /path/to/pig_barn.mp4\n```\n\n### 🐔 分析本地鸡舍连续视频\n\n```bash\npython -m scripts.smyx_aggressive_behavior_detection_analysis --input /path/to/chicken_house.mp4\n```\n\n### 🌐 分析网络畜禽舍视频\n\n```bash\npython -m scripts.smyx_aggressive_behavior_detection_analysis --url https://example.com/livestock_barn.mp4\n```\n\n### 📚 显示历史分析报告 / 显示分析报告清单列表 / 显示历史争斗行为报告\n\n> 自动触发关键词：查看历史争斗行为报告、历史报告、争斗行为识别清单等。\n\n```bash\npython -m scripts.smyx_aggressive_behavior_detection_analysis --list\n```\n\n### 🪶 输出精简报告\n\n```bash\npython -m scripts.smyx_aggressive_behavior_detection_analysis --input pig_barn.mp4 --detail basic\n```\n\n### 💾 保存结果到文件\n\n```bash\npython -m scripts.smyx_aggressive_behavior_detection_analysis --input chicken_house.mp4 --output result.json\n```\n\nFile v1.0.8:_meta.json\n\n{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-aggressive-behavior-detection-analysis\",\n  \"version\": \"1.0.8\",\n  \"publishedAt\": 1787383648532\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/ai-analysis/v2/start-common-ai-analysis` - 启动畜禽争斗行为识别分析任务\n2. `/web/ai-analysis/get-common-ai-analysis-result` - 获取分析结果\n3. `/web/ai-analysis/page-common-ai-analysis-result` - 分页查询历史报告\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_AGGRESSIVE_BEHAVIOR_DETECTION_ANALYSIS` - 畜禽争斗行为识别\n\nFile v1.0.8:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.8:scripts/config.yaml\n\n{}\n\nFile v1.0.8:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.8:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.8:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.8:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: dev\n\nFile v1.0.8:skill-card.md\n\n## Description:\n\nDetects aggressive interactions in livestock and poultry from continuous barn videos, including fighting, biting, chasing, and butting, and outputs behavior type, intensity level, and alert level.\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 users and developers use this skill to analyze barn images, videos, or media URLs for livestock and poultry aggression events, producing structured reports with behavior categories, incident segments, intensity, alert level, and report links.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Barn media or media URLs are sent to the skill's configured service for analysis.\n\nMitigation: Use only approved barn media and approved service endpoints, and confirm data handling requirements before running analysis.\n\nRisk: The skill automatically creates or reuses an identity and may read workspace API-key or identity files.\n\nMitigation: Review identity and API-key handling before installation, restrict workspace access, and avoid running the skill in workspaces that contain unrelated secrets.\n\nRisk: Authentication tokens may be stored in a local workspace database.\n\nMitigation: Review local token storage behavior and apply local retention, access control, and cleanup practices appropriate for the deployment environment.\n\nRisk: The packaged configuration includes development HTTP endpoints.\n\nMitigation: Correct or verify the configuration before use, and prefer approved production HTTPS endpoints.\n\n## Reference(s):\n\n- [ClawHub Skill Page](https://clawhub.ai/18072937735/skills/smyx-aggressive-behavior-detection-analysis)\n- [Skill Demo](https://lifeemergence.com/sample.html)\n- [API 接口文档](references/api_doc.md)\n- [API接口文档](skills/smyx_analysis/references/api_doc.md)\n\n## Skill Output:\n\n**Output Type(s):** [Text, Markdown, JSON, Shell commands]\n\n**Output Format:** [Markdown reports or JSON analysis results]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May include behavior type, intensity level, alert level, incident segments, subject positions, timestamps, and report links.]\n\n## Skill Version(s):\n\n1.0.8 (source: server release metadata and SKILL.md frontmatter)\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, 39526 bytes\n\nFiles: references/api_doc.md (661b), scripts/__init__.py (58b), scripts/config.py (682b), scripts/config.yaml (3b), scripts/skill.py (575b), scripts/smyx_aggressive_behavior_detection_analysis.py (3543b), skill-card.md (2374b), SKILL.md (11945b), 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-aggressive-behavior-detection-analysis\"\ndescription: \"Detects aggressive interactions in livestock and poultry from continuous barn videos — including fighting, biting, chasing and butting — and outputs behavior type, intensity level and alert level. | 识别打斗、撕咬等攻击行为，及时预警。\"\nversion: \"1.0.7\"\nlicense: \"MIT-0\"\n---\n\n# ⚔️ Livestock Aggressive Behavior Detection | 畜禽争斗行为识别\n\n> 识别打斗、撕咬等攻击行为，及时预警。\n>\n> **群体冲突预警中枢** · 畜禽舍连续视频智能分析 · 争斗行为识别 · 强度/预警等级 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **畜禽争斗行为识别** |\n| 🎯 核心目标 | 基于畜禽舍固定摄像头的连续视频，检测个体间的争斗行为（打斗、撕咬、追逐、顶撞等），输出行为类型、强度等级及预警等级 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、争斗行为片段清单、涉事个体位置、强度等级、预警等级、报告链接 |\n| 🏢 适用场景 | 猪/鸡等畜禽的群体冲突预警，减少外伤、应激及生产性能下降造成的经济损失 |\n| 🧩 场景码 | `SMYX_AGGRESSIVE_BEHAVIOR_DETECTION_ANALYSIS` |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n## 🤖 AI 角色 | AI Role\n\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **你是一个专业的畜禽行为安全 AI。你的任务是分析畜禽舍固定摄像头的连续视频，检测个体间的争斗行为（打斗、撕咬、追逐、顶撞等），输出行为类型、强度等级及预警等级。不要提供行为干预建议，仅基于视觉行为观察输出识别结果。** |\n\n---\n\n## 🎯 任务目标 | Goals\n\n### 1. 🧩 技能用途\n\n通过畜禽舍固定摄像头的连续视频，识别群体中出现的争斗行为并评估其强度，输出结构化的争斗行为清单与预警等级，为规模化养殖场提供群体冲突的客观视觉预警依据。\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 畜禽个体检测、定位与短时轨迹跟踪 |\n| 2 | 打斗行为识别（相互冲撞、缠斗） |\n| 3 | 撕咬行为识别（咬耳、咬尾、咬翅等） |\n| 4 | 追逐行为识别（单向追逐 / 逃避） |\n| 5 | 顶撞行为识别（头部/胸部剧烈接触） |\n| 6 | 争斗片段起止时间与涉事个体位置标注 |\n| 7 | 单次争斗强度等级评估（轻度 / 中度 / 剧烈） |\n| 8 | 群体争斗频次统计与总体预警等级输出 |\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_aggressive_behavior_detection_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_aggressive_behavior_detection_analysis --list` 调用 API 查询云端的历史报告数据 |\n| 🚫 严格禁止 | 从本地 `memory` 目录读取历史会话信息 |\n| 🚫 严格禁止 | 手动汇总本地记录中的报告 |\n| 🚫 严格禁止 | 从长期记忆中提取报告 |\n| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据，然后以 Markdown 表格格式输出结果 |\n\n---\n\n## 📦 前置准备 | Requirements\n\n### 依赖说明\n\n`scripts` 脚本所需的依赖包及版本：\n\n```txt\nrequests>=2.28.0\n```\n\n---\n\n## 📷 采集要求 | Capture Requirements\n\n| 序号 | 说明 |\n|---:|---|\n| 1 | 固定摄像头俯视/斜俯视覆盖畜禽舍主要活动区，画面稳定、避免频繁抖动 |\n| 2 | 视频建议 30 秒~10 分钟连续拍摄，帧率不低于 15fps，便于捕捉短促的争斗动作 |\n| 3 | 光照条件稳定，白天充足自然光或稳定人工光源，避免大面积过暗/过曝 |\n| 4 | 单栏舍内目标个体清晰可见，尽量减少人员操作、清扫等无关剧烈动作干扰 |\n| 5 | 支持格式：jpg/png/jpeg 图片，及 mp4/avi/mov 视频；单文件不超过 10MB |\n| 6 | 尽量在群体日常状态（非驱赶/转群时段）内采集，避免误将常规扰动识别为争斗 |\n\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\n## 🧪 标准流程 | Standard Flow\n\n| 步骤 | 阶段 | 执行动作 |\n|---:|---|---|\n| 1 | 📥 准备畜禽舍视频输入 | 提供本地文件路径或网络 URL；确保画面稳定、覆盖群体活动区 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行争斗行为识别 | 调用 `-m scripts.smyx_aggressive_behavior_detection_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看争斗片段清单、涉事个体、强度与预警等级及报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地畜禽舍图像/视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络畜禽舍图像/视频 URL 地址 | API 服务自动下载 |\n| `--pet-type` | 类别标识（畜禽场景保持 other） | 默认 `other`，按需填写 |\n| `--list` | 显示历史分析报告清单 | 可以输入起始日期参数过滤数据范围 |\n| `--api-url` | API 服务地址 | 可选，使用默认值 |\n| `--detail` | 输出详细程度 | `basic` / `standard` / `json`，默认 `json` |\n| `--output` | 结果输出文件路径 | 可选 |\n\n---\n\n## 🗂️ 资源索引 | Resource Index\n\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_aggressive_behavior_detection_analysis.py`](scripts/smyx_aggressive_behavior_detection_analysis.py) | 调用 API 进行争斗行为识别或查询历史报告 | 执行分析或查询时使用 |\n| ⚙️ 配置文件 | [`scripts/config.py`](scripts/config.py) | 场景码 `SMYX_AGGRESSIVE_BEHAVIOR_DETECTION_ANALYSIS`、默认参数配置 | 需要确认默认配置时读取 |\n| 📘 领域参考 | [`references/api_doc.md`](references/api_doc.md) | 了解 API 接口规范、字段说明和错误码 | 仅在需要了解接口规范或错误码时读取 |\n\n---\n\n## ⚠️ 注意事项 | Notes\n\n| 分类 | 注意事项 |\n|---|---|\n| 📚 文档读取 | 仅在需要时读取参考文档，保持上下文简洁 |\n| 📁 格式支持 | 图片支持 `jpg` / `png` / `jpeg`；视频支持 `mp4` / `avi` / `mov`；单文件最大 `10MB` |\n| 🧑‍⚖️ 结果性质 | 识别结果仅供争斗行为预警参考，本技能不提供行为干预建议 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能使用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数无需本地下载，默认为公网地址，API 服务会自动下载 |\n| 📜 报告输出 | 显示历史分析报告清单时，从接口返回 JSON 数据中提取字段作为超链接地址，并自动转化为 Markdown 表格输出 |\n\n---\n\n## 🔒 隐私与数据安全声明 | Privacy & Data Security\n\n| 序号 | 说明 |\n|---:|---|\n| 1 | 仅采集与畜禽争斗行为识别直接相关的图像/视频数据，不采集与争斗识别无关的敏感信息 |\n| 2 | 内部身份参数由系统自动处理，不在任何输出、日志或报告中暴露 |\n| 3 | 分析请求通过服务端 API 完成，网络传输遵循平台既有安全策略 |\n| 4 | 历史报告仅当前身份可读，不做跨养殖场/跨用户汇总或共享 |\n| 5 | 识别结果仅供参考，实际干预与处置请结合养殖场规程与专业动物福利/兽医意见 |\n\n---\n\n## 📜 历史报告清单输出规范 | Report List Format\n\n当显示历史分析报告清单的时候，从接口返回 JSON 数据中提取字段作为超链接地址，且自动转化为如下 Markdown 表格格式输出。\n\n### 📌 固定输出列\n\n| 列名 | 生成规则 |\n|---|---|\n| 报告名称 | 使用 `畜禽争斗行为识别报告-{记录id}` 形式拼接 |\n| 预警等级 | 从接口返回数据中提取（正常 / 关注 / 预警 / 紧急） |\n| 分析时间 | 从接口返回数据中提取 |\n| 点击查看 | 使用 `[🔗 查看报告]()` 格式的超链接 |\n\n### 🧾 表格输出示例\n\n| 报告名称 | 预警等级 | 分析时间 | 点击查看 |\n|----------|----------|----------|----------|\n| 畜禽争斗行为识别报告-20260703160500001 | 预警 | 2026-07-03 16:05:00 | [🔗 查看报告](https://example.com/report?id=xxx) |\n\n---\n\n## 🧰 使用示例 | Examples\n\n### 🐷 分析本地猪舍连续视频\n\n```bash\npython -m scripts.smyx_aggressive_behavior_detection_analysis --input /path/to/pig_barn.mp4\n```\n\n### 🐔 分析本地鸡舍连续视频\n\n```bash\npython -m scripts.smyx_aggressive_behavior_detection_analysis --input /path/to/chicken_house.mp4\n```\n\n### 🌐 分析网络畜禽舍视频\n\n```bash\npython -m scripts.smyx_aggressive_behavior_detection_analysis --url https://example.com/livestock_barn.mp4\n```\n\n### 📚 显示历史分析报告 / 显示分析报告清单列表 / 显示历史争斗行为报告\n\n> 自动触发关键词：查看历史争斗行为报告、历史报告、争斗行为识别清单等。\n\n```bash\npython -m scripts.smyx_aggressive_behavior_detection_analysis --list\n```\n\n### 🪶 输出精简报告\n\n```bash\npython -m scripts.smyx_aggressive_behavior_detection_analysis --input pig_barn.mp4 --detail basic\n```\n\n### 💾 保存结果到文件\n\n```bash\npython -m scripts.smyx_aggressive_behavior_detection_analysis --input chicken_house.mp4 --output result.json\n```\n\nFile v1.0.7:_meta.json\n\n{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-aggressive-behavior-detection-analysis\",\n  \"version\": \"1.0.7\",\n  \"publishedAt\": 1786603125344\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/ai-analysis/v2/start-common-ai-analysis` - 启动畜禽争斗行为识别分析任务\n2. `/web/ai-analysis/get-common-ai-analysis-result` - 获取分析结果\n3. `/web/ai-analysis/page-common-ai-analysis-result` - 分页查询历史报告\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_AGGRESSIVE_BEHAVIOR_DETECTION_ANALYSIS` - 畜禽争斗行为识别\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\nDetects aggressive interactions in livestock and poultry from continuous barn videos, including fighting, biting, chasing and butting, and outputs behavior type, intensity level and alert level.\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\nDevelopers, farm operations teams, and livestock monitoring teams use this skill to analyze barn images or videos for aggressive animal interactions and retrieve structured reports with behavior type, intensity, alert level, affected positions, and report links.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Barn images, videos, or supplied media URLs are sent to the LifeEmergence cloud service for analysis.\n\nMitigation: Install only when cloud processing is acceptable, use a dedicated workspace or account for testing, and avoid providing sensitive non-livestock footage or private URLs.\n\nRisk: The skill creates or reuses an internal identity, can query cloud history, and stores local authentication tokens in the workspace.\n\nMitigation: Review the skill before installation, use a dedicated workspace or account when testing, and limit access to workspaces containing service tokens.\n\n## Reference(s):\n\n- [ClawHub Skill Page](https://clawhub.ai/18072937735/skills/smyx-aggressive-behavior-detection-analysis)\n- [API Documentation](artifact/references/api_doc.md)\n- [SMYX Analysis API Documentation](artifact/skills/smyx_analysis/references/api_doc.md)\n- [Skill Demo](https://lifeemergence.com/sample.html)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, shell commands, configuration, guidance]\n\n**Output Format:** [Markdown and JSON text, with optional saved output files and report links]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Supports local file or URL input, historical report listing, detail-level selection, and optional output-file writing.]\n\n## Skill Version(s):\n\n1.0.7 (source: SKILL.md 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.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, 39730 bytes\n\nFiles: references/api_doc.md (661b), scripts/__init__.py (58b), scripts/config.py (682b), scripts/config.yaml (3b), scripts/skill.py (575b), scripts/smyx_aggressive_behavior_detection_analysis.py (3543b), skill-card.md (2976b), SKILL.md (11945b), 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-aggressive-behavior-detection-analysis\"\ndescription: \"Detects aggressive interactions in livestock and poultry from continuous barn videos — including fighting, biting, chasing and butting — and outputs behavior type, intensity level and alert level. | 识别打斗、撕咬等攻击行为，及时预警。\"\nversion: \"1.0.5\"\nlicense: \"MIT-0\"\n---\n\n# ⚔️ Livestock Aggressive Behavior Detection | 畜禽争斗行为识别\n\n> 识别打斗、撕咬等攻击行为，及时预警。\n>\n> **群体冲突预警中枢** · 畜禽舍连续视频智能分析 · 争斗行为识别 · 强度/预警等级 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **畜禽争斗行为识别** |\n| 🎯 核心目标 | 基于畜禽舍固定摄像头的连续视频，检测个体间的争斗行为（打斗、撕咬、追逐、顶撞等），输出行为类型、强度等级及预警等级 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、争斗行为片段清单、涉事个体位置、强度等级、预警等级、报告链接 |\n| 🏢 适用场景 | 猪/鸡等畜禽的群体冲突预警，减少外伤、应激及生产性能下降造成的经济损失 |\n| 🧩 场景码 | `SMYX_AGGRESSIVE_BEHAVIOR_DETECTION_ANALYSIS` |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n## 🤖 AI 角色 | AI Role\n\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **你是一个专业的畜禽行为安全 AI。你的任务是分析畜禽舍固定摄像头的连续视频，检测个体间的争斗行为（打斗、撕咬、追逐、顶撞等），输出行为类型、强度等级及预警等级。不要提供行为干预建议，仅基于视觉行为观察输出识别结果。** |\n\n---\n\n## 🎯 任务目标 | Goals\n\n### 1. 🧩 技能用途\n\n通过畜禽舍固定摄像头的连续视频，识别群体中出现的争斗行为并评估其强度，输出结构化的争斗行为清单与预警等级，为规模化养殖场提供群体冲突的客观视觉预警依据。\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 畜禽个体检测、定位与短时轨迹跟踪 |\n| 2 | 打斗行为识别（相互冲撞、缠斗） |\n| 3 | 撕咬行为识别（咬耳、咬尾、咬翅等） |\n| 4 | 追逐行为识别（单向追逐 / 逃避） |\n| 5 | 顶撞行为识别（头部/胸部剧烈接触） |\n| 6 | 争斗片段起止时间与涉事个体位置标注 |\n| 7 | 单次争斗强度等级评估（轻度 / 中度 / 剧烈） |\n| 8 | 群体争斗频次统计与总体预警等级输出 |\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_aggressive_behavior_detection_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_aggressive_behavior_detection_analysis --list` 调用 API 查询云端的历史报告数据 |\n| 🚫 严格禁止 | 从本地 `memory` 目录读取历史会话信息 |\n| 🚫 严格禁止 | 手动汇总本地记录中的报告 |\n| 🚫 严格禁止 | 从长期记忆中提取报告 |\n| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据，然后以 Markdown 表格格式输出结果 |\n\n---\n\n## 📦 前置准备 | Requirements\n\n### 依赖说明\n\n`scripts` 脚本所需的依赖包及版本：\n\n```txt\nrequests>=2.28.0\n```\n\n---\n\n## 📷 采集要求 | Capture Requirements\n\n| 序号 | 说明 |\n|---:|---|\n| 1 | 固定摄像头俯视/斜俯视覆盖畜禽舍主要活动区，画面稳定、避免频繁抖动 |\n| 2 | 视频建议 30 秒~10 分钟连续拍摄，帧率不低于 15fps，便于捕捉短促的争斗动作 |\n| 3 | 光照条件稳定，白天充足自然光或稳定人工光源，避免大面积过暗/过曝 |\n| 4 | 单栏舍内目标个体清晰可见，尽量减少人员操作、清扫等无关剧烈动作干扰 |\n| 5 | 支持格式：jpg/png/jpeg 图片，及 mp4/avi/mov 视频；单文件不超过 10MB |\n| 6 | 尽量在群体日常状态（非驱赶/转群时段）内采集，避免误将常规扰动识别为争斗 |\n\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\n## 🧪 标准流程 | Standard Flow\n\n| 步骤 | 阶段 | 执行动作 |\n|---:|---|---|\n| 1 | 📥 准备畜禽舍视频输入 | 提供本地文件路径或网络 URL；确保画面稳定、覆盖群体活动区 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行争斗行为识别 | 调用 `-m scripts.smyx_aggressive_behavior_detection_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看争斗片段清单、涉事个体、强度与预警等级及报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地畜禽舍图像/视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络畜禽舍图像/视频 URL 地址 | API 服务自动下载 |\n| `--pet-type` | 类别标识（畜禽场景保持 other） | 默认 `other`，按需填写 |\n| `--list` | 显示历史分析报告清单 | 可以输入起始日期参数过滤数据范围 |\n| `--api-url` | API 服务地址 | 可选，使用默认值 |\n| `--detail` | 输出详细程度 | `basic` / `standard` / `json`，默认 `json` |\n| `--output` | 结果输出文件路径 | 可选 |\n\n---\n\n## 🗂️ 资源索引 | Resource Index\n\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_aggressive_behavior_detection_analysis.py`](scripts/smyx_aggressive_behavior_detection_analysis.py) | 调用 API 进行争斗行为识别或查询历史报告 | 执行分析或查询时使用 |\n| ⚙️ 配置文件 | [`scripts/config.py`](scripts/config.py) | 场景码 `SMYX_AGGRESSIVE_BEHAVIOR_DETECTION_ANALYSIS`、默认参数配置 | 需要确认默认配置时读取 |\n| 📘 领域参考 | [`references/api_doc.md`](references/api_doc.md) | 了解 API 接口规范、字段说明和错误码 | 仅在需要了解接口规范或错误码时读取 |\n\n---\n\n## ⚠️ 注意事项 | Notes\n\n| 分类 | 注意事项 |\n|---|---|\n| 📚 文档读取 | 仅在需要时读取参考文档，保持上下文简洁 |\n| 📁 格式支持 | 图片支持 `jpg` / `png` / `jpeg`；视频支持 `mp4` / `avi` / `mov`；单文件最大 `10MB` |\n| 🧑‍⚖️ 结果性质 | 识别结果仅供争斗行为预警参考，本技能不提供行为干预建议 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能使用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数无需本地下载，默认为公网地址，API 服务会自动下载 |\n| 📜 报告输出 | 显示历史分析报告清单时，从接口返回 JSON 数据中提取字段作为超链接地址，并自动转化为 Markdown 表格输出 |\n\n---\n\n## 🔒 隐私与数据安全声明 | Privacy & Data Security\n\n| 序号 | 说明 |\n|---:|---|\n| 1 | 仅采集与畜禽争斗行为识别直接相关的图像/视频数据，不采集与争斗识别无关的敏感信息 |\n| 2 | 内部身份参数由系统自动处理，不在任何输出、日志或报告中暴露 |\n| 3 | 分析请求通过服务端 API 完成，网络传输遵循平台既有安全策略 |\n| 4 | 历史报告仅当前身份可读，不做跨养殖场/跨用户汇总或共享 |\n| 5 | 识别结果仅供参考，实际干预与处置请结合养殖场规程与专业动物福利/兽医意见 |\n\n---\n\n## 📜 历史报告清单输出规范 | Report List Format\n\n当显示历史分析报告清单的时候，从接口返回 JSON 数据中提取字段作为超链接地址，且自动转化为如下 Markdown 表格格式输出。\n\n### 📌 固定输出列\n\n| 列名 | 生成规则 |\n|---|---|\n| 报告名称 | 使用 `畜禽争斗行为识别报告-{记录id}` 形式拼接 |\n| 预警等级 | 从接口返回数据中提取（正常 / 关注 / 预警 / 紧急） |\n| 分析时间 | 从接口返回数据中提取 |\n| 点击查看 | 使用 `[🔗 查看报告]()` 格式的超链接 |\n\n### 🧾 表格输出示例\n\n| 报告名称 | 预警等级 | 分析时间 | 点击查看 |\n|----------|----------|----------|----------|\n| 畜禽争斗行为识别报告-20260703160500001 | 预警 | 2026-07-03 16:05:00 | [🔗 查看报告](https://example.com/report?id=xxx) |\n\n---\n\n## 🧰 使用示例 | Examples\n\n### 🐷 分析本地猪舍连续视频\n\n```bash\npython -m scripts.smyx_aggressive_behavior_detection_analysis --input /path/to/pig_barn.mp4\n```\n\n### 🐔 分析本地鸡舍连续视频\n\n```bash\npython -m scripts.smyx_aggressive_behavior_detection_analysis --input /path/to/chicken_house.mp4\n```\n\n### 🌐 分析网络畜禽舍视频\n\n```bash\npython -m scripts.smyx_aggressive_behavior_detection_analysis --url https://example.com/livestock_barn.mp4\n```\n\n### 📚 显示历史分析报告 / 显示分析报告清单列表 / 显示历史争斗行为报告\n\n> 自动触发关键词：查看历史争斗行为报告、历史报告、争斗行为识别清单等。\n\n```bash\npython -m scripts.smyx_aggressive_behavior_detection_analysis --list\n```\n\n### 🪶 输出精简报告\n\n```bash\npython -m scripts.smyx_aggressive_behavior_detection_analysis --input pig_barn.mp4 --detail basic\n```\n\n### 💾 保存结果到文件\n\n```bash\npython -m scripts.smyx_aggressive_behavior_detection_analysis --input chicken_house.mp4 --output result.json\n```\n\nFile v1.0.6:_meta.json\n\n{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-aggressive-behavior-detection-analysis\",\n  \"version\": \"1.0.6\",\n  \"publishedAt\": 1785787711157\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/ai-analysis/v2/start-common-ai-analysis` - 启动畜禽争斗行为识别分析任务\n2. `/web/ai-analysis/get-common-ai-analysis-result` - 获取分析结果\n3. `/web/ai-analysis/page-common-ai-analysis-result` - 分页查询历史报告\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_AGGRESSIVE_BEHAVIOR_DETECTION_ANALYSIS` - 畜禽争斗行为识别\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>\nDetects aggressive interactions in livestock and poultry from continuous barn videos, including fighting, biting, chasing, and butting, and outputs behavior type, intensity level, and alert level. <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>\nExternal users, developers, and farm operations teams use this skill to submit barn image or video inputs for livestock and poultry aggression screening, including fight, bite, chase, and butting detection. It returns structured behavior observations, event timing, involved locations, intensity levels, warning levels, and report links. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Barn images or videos and identity-linked report requests are sent to lifeemergence.com services for cloud analysis. <br>\nMitigation: Use the skill only with media approved for third-party cloud processing, and avoid submitting sensitive footage unless the publisher and service terms are acceptable. <br>\nRisk: The skill may silently create or reuse a local default identity and associate analysis history with that identity. <br>\nMitigation: Review identity handling before deployment and run it in a controlled workspace where generated identities and report access are expected. <br>\nRisk: Service tokens may be stored in the workspace database. <br>\nMitigation: Limit workspace access, treat the local database as sensitive, and remove stored credentials when the skill is no longer needed. <br>\nRisk: The remote service can return billing or recharge instructions when use is rejected for payment reasons. <br>\nMitigation: Confirm commercial and billing expectations with the publisher before operational use. <br>\n\n\n## Reference(s): <br>\n- [API documentation](artifact/references/api_doc.md) <br>\n- [Skill demo](https://lifeemergence.com/sample.html) <br>\n- [ClawHub skill page](https://clawhub.ai/18072937735/skills/smyx-aggressive-behavior-detection-analysis) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [text, markdown, json, shell commands, configuration, guidance] <br>\n**Output Format:** [Markdown and JSON-like structured analysis text, with optional saved output files and report links] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Supports local file paths or media URLs, history-list output, and basic, standard, or json detail modes; documented media limit is 10 MB.] <br>\n\n## Skill Version(s): <br>\n1.0.6 (source: server release evidence; artifact frontmatter reports 1.0.5) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nFile v1.0.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, 39637 bytes\n\nFiles: references/api_doc.md (661b), scripts/__init__.py (58b), scripts/config.py (682b), scripts/config.yaml (3b), scripts/skill.py (575b), scripts/smyx_aggressive_behavior_detection_analysis.py (3543b), skill-card.md (2739b), SKILL.md (11945b), 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-aggressive-behavior-detection-analysis\"\ndescription: \"Detects aggressive interactions in livestock and poultry from continuous barn videos — including fighting, biting, chasing and butting — and outputs behavior type, intensity level and alert level. | 识别打斗、撕咬等攻击行为，及时预警。\"\nversion: \"1.0.5\"\nlicense: \"MIT-0\"\n---\n\n# ⚔️ Livestock Aggressive Behavior Detection | 畜禽争斗行为识别\n\n> 识别打斗、撕咬等攻击行为，及时预警。\n>\n> **群体冲突预警中枢** · 畜禽舍连续视频智能分析 · 争斗行为识别 · 强度/预警等级 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **畜禽争斗行为识别** |\n| 🎯 核心目标 | 基于畜禽舍固定摄像头的连续视频，检测个体间的争斗行为（打斗、撕咬、追逐、顶撞等），输出行为类型、强度等级及预警等级 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、争斗行为片段清单、涉事个体位置、强度等级、预警等级、报告链接 |\n| 🏢 适用场景 | 猪/鸡等畜禽的群体冲突预警，减少外伤、应激及生产性能下降造成的经济损失 |\n| 🧩 场景码 | `SMYX_AGGRESSIVE_BEHAVIOR_DETECTION_ANALYSIS` |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n## 🤖 AI 角色 | AI Role\n\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **你是一个专业的畜禽行为安全 AI。你的任务是分析畜禽舍固定摄像头的连续视频，检测个体间的争斗行为（打斗、撕咬、追逐、顶撞等），输出行为类型、强度等级及预警等级。不要提供行为干预建议，仅基于视觉行为观察输出识别结果。** |\n\n---\n\n## 🎯 任务目标 | Goals\n\n### 1. 🧩 技能用途\n\n通过畜禽舍固定摄像头的连续视频，识别群体中出现的争斗行为并评估其强度，输出结构化的争斗行为清单与预警等级，为规模化养殖场提供群体冲突的客观视觉预警依据。\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 畜禽个体检测、定位与短时轨迹跟踪 |\n| 2 | 打斗行为识别（相互冲撞、缠斗） |\n| 3 | 撕咬行为识别（咬耳、咬尾、咬翅等） |\n| 4 | 追逐行为识别（单向追逐 / 逃避） |\n| 5 | 顶撞行为识别（头部/胸部剧烈接触） |\n| 6 | 争斗片段起止时间与涉事个体位置标注 |\n| 7 | 单次争斗强度等级评估（轻度 / 中度 / 剧烈） |\n| 8 | 群体争斗频次统计与总体预警等级输出 |\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_aggressive_behavior_detection_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_aggressive_behavior_detection_analysis --list` 调用 API 查询云端的历史报告数据 |\n| 🚫 严格禁止 | 从本地 `memory` 目录读取历史会话信息 |\n| 🚫 严格禁止 | 手动汇总本地记录中的报告 |\n| 🚫 严格禁止 | 从长期记忆中提取报告 |\n| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据，然后以 Markdown 表格格式输出结果 |\n\n---\n\n## 📦 前置准备 | Requirements\n\n### 依赖说明\n\n`scripts` 脚本所需的依赖包及版本：\n\n```txt\nrequests>=2.28.0\n```\n\n---\n\n## 📷 采集要求 | Capture Requirements\n\n| 序号 | 说明 |\n|---:|---|\n| 1 | 固定摄像头俯视/斜俯视覆盖畜禽舍主要活动区，画面稳定、避免频繁抖动 |\n| 2 | 视频建议 30 秒~10 分钟连续拍摄，帧率不低于 15fps，便于捕捉短促的争斗动作 |\n| 3 | 光照条件稳定，白天充足自然光或稳定人工光源，避免大面积过暗/过曝 |\n| 4 | 单栏舍内目标个体清晰可见，尽量减少人员操作、清扫等无关剧烈动作干扰 |\n| 5 | 支持格式：jpg/png/jpeg 图片，及 mp4/avi/mov 视频；单文件不超过 10MB |\n| 6 | 尽量在群体日常状态（非驱赶/转群时段）内采集，避免误将常规扰动识别为争斗 |\n\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\n## 🧪 标准流程 | Standard Flow\n\n| 步骤 | 阶段 | 执行动作 |\n|---:|---|---|\n| 1 | 📥 准备畜禽舍视频输入 | 提供本地文件路径或网络 URL；确保画面稳定、覆盖群体活动区 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行争斗行为识别 | 调用 `-m scripts.smyx_aggressive_behavior_detection_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看争斗片段清单、涉事个体、强度与预警等级及报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地畜禽舍图像/视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络畜禽舍图像/视频 URL 地址 | API 服务自动下载 |\n| `--pet-type` | 类别标识（畜禽场景保持 other） | 默认 `other`，按需填写 |\n| `--list` | 显示历史分析报告清单 | 可以输入起始日期参数过滤数据范围 |\n| `--api-url` | API 服务地址 | 可选，使用默认值 |\n| `--detail` | 输出详细程度 | `basic` / `standard` / `json`，默认 `json` |\n| `--output` | 结果输出文件路径 | 可选 |\n\n---\n\n## 🗂️ 资源索引 | Resource Index\n\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_aggressive_behavior_detection_analysis.py`](scripts/smyx_aggressive_behavior_detection_analysis.py) | 调用 API 进行争斗行为识别或查询历史报告 | 执行分析或查询时使用 |\n| ⚙️ 配置文件 | [`scripts/config.py`](scripts/config.py) | 场景码 `SMYX_AGGRESSIVE_BEHAVIOR_DETECTION_ANALYSIS`、默认参数配置 | 需要确认默认配置时读取 |\n| 📘 领域参考 | [`references/api_doc.md`](references/api_doc.md) | 了解 API 接口规范、字段说明和错误码 | 仅在需要了解接口规范或错误码时读取 |\n\n---\n\n## ⚠️ 注意事项 | Notes\n\n| 分类 | 注意事项 |\n|---|---|\n| 📚 文档读取 | 仅在需要时读取参考文档，保持上下文简洁 |\n| 📁 格式支持 | 图片支持 `jpg` / `png` / `jpeg`；视频支持 `mp4` / `avi` / `mov`；单文件最大 `10MB` |\n| 🧑‍⚖️ 结果性质 | 识别结果仅供争斗行为预警参考，本技能不提供行为干预建议 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能使用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数无需本地下载，默认为公网地址，API 服务会自动下载 |\n| 📜 报告输出 | 显示历史分析报告清单时，从接口返回 JSON 数据中提取字段作为超链接地址，并自动转化为 Markdown 表格输出 |\n\n---\n\n## 🔒 隐私与数据安全声明 | Privacy & Data Security\n\n| 序号 | 说明 |\n|---:|---|\n| 1 | 仅采集与畜禽争斗行为识别直接相关的图像/视频数据，不采集与争斗识别无关的敏感信息 |\n| 2 | 内部身份参数由系统自动处理，不在任何输出、日志或报告中暴露 |\n| 3 | 分析请求通过服务端 API 完成，网络传输遵循平台既有安全策略 |\n| 4 | 历史报告仅当前身份可读，不做跨养殖场/跨用户汇总或共享 |\n| 5 | 识别结果仅供参考，实际干预与处置请结合养殖场规程与专业动物福利/兽医意见 |\n\n---\n\n## 📜 历史报告清单输出规范 | Report List Format\n\n当显示历史分析报告清单的时候，从接口返回 JSON 数据中提取字段作为超链接地址，且自动转化为如下 Markdown 表格格式输出。\n\n### 📌 固定输出列\n\n| 列名 | 生成规则 |\n|---|---|\n| 报告名称 | 使用 `畜禽争斗行为识别报告-{记录id}` 形式拼接 |\n| 预警等级 | 从接口返回数据中提取（正常 / 关注 / 预警 / 紧急） |\n| 分析时间 | 从接口返回数据中提取 |\n| 点击查看 | 使用 `[🔗 查看报告]()` 格式的超链接 |\n\n### 🧾 表格输出示例\n\n| 报告名称 | 预警等级 | 分析时间 | 点击查看 |\n|----------|----------|----------|----------|\n| 畜禽争斗行为识别报告-20260703160500001 | 预警 | 2026-07-03 16:05:00 | [🔗 查看报告](https://example.com/report?id=xxx) |\n\n---\n\n## 🧰 使用示例 | Examples\n\n### 🐷 分析本地猪舍连续视频\n\n```bash\npython -m scripts.smyx_aggressive_behavior_detection_analysis --input /path/to/pig_barn.mp4\n```\n\n### 🐔 分析本地鸡舍连续视频\n\n```bash\npython -m scripts.smyx_aggressive_behavior_detection_analysis --input /path/to/chicken_house.mp4\n```\n\n### 🌐 分析网络畜禽舍视频\n\n```bash\npython -m scripts.smyx_aggressive_behavior_detection_analysis --url https://example.com/livestock_barn.mp4\n```\n\n### 📚 显示历史分析报告 / 显示分析报告清单列表 / 显示历史争斗行为报告\n\n> 自动触发关键词：查看历史争斗行为报告、历史报告、争斗行为识别清单等。\n\n```bash\npython -m scripts.smyx_aggressive_behavior_detection_analysis --list\n```\n\n### 🪶 输出精简报告\n\n```bash\npython -m scripts.smyx_aggressive_behavior_detection_analysis --input pig_barn.mp4 --detail basic\n```\n\n### 💾 保存结果到文件\n\n```bash\npython -m scripts.smyx_aggressive_behavior_detection_analysis --input chicken_house.mp4 --output result.json\n```\n\nFile v1.0.5:_meta.json\n\n{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-aggressive-behavior-detection-analysis\",\n  \"version\": \"1.0.5\",\n  \"publishedAt\": 1785557609971\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/ai-analysis/v2/start-common-ai-analysis` - 启动畜禽争斗行为识别分析任务\n2. `/web/ai-analysis/get-common-ai-analysis-result` - 获取分析结果\n3. `/web/ai-analysis/page-common-ai-analysis-result` - 分页查询历史报告\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_AGGRESSIVE_BEHAVIOR_DETECTION_ANALYSIS` - 畜禽争斗行为识别\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>\nDetects aggressive interactions in livestock and poultry from continuous barn videos, including fighting, biting, chasing and butting, and outputs behavior type, intensity level and alert level. <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>\nDevelopers and farm operations teams use this skill to analyze barn image or video inputs for livestock and poultry conflict behavior, then review structured alerts, behavior segments, intensity levels, and historical reports. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Barn media, supplied URLs, and identity-linked analysis data may be sent to the provider's cloud API. <br>\nMitigation: Use only media approved for provider-side processing, avoid sensitive footage where possible, and confirm that the provider's handling of uploaded media is acceptable before deployment. <br>\nRisk: The skill can silently create or reuse identity state and store tokens or profile data in a workspace SQLite database. <br>\nMitigation: Run the skill only in approved workspaces, restrict access to local state files, and monitor or rotate identity and token state according to local security policy. <br>\nRisk: Behavior recognition results are advisory alerts and may be incomplete or incorrect. <br>\nMitigation: Treat reports as screening outputs and require farm operations, animal welfare, or veterinary review before intervention decisions. <br>\n\n\n## Reference(s): <br>\n- [ClawHub skill page](https://clawhub.ai/18072937735/skills/smyx-aggressive-behavior-detection-analysis) <br>\n- [API 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):** [text, markdown, shell commands, configuration, guidance] <br>\n**Output Format:** [Markdown and JSON-compatible structured analysis summaries, with command-line examples] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [May include behavior types, intensity levels, alert levels, report links, and historical report tables.] <br>\n\n## Skill Version(s): <br>\n1.0.5 (source: SKILL.md frontmatter and server release metadata) <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, 39621 bytes\n\nFiles: references/api_doc.md (661b), scripts/__init__.py (58b), scripts/config.py (682b), scripts/config.yaml (3b), scripts/skill.py (575b), scripts/smyx_aggressive_behavior_detection_analysis.py (3543b), skill-card.md (2710b), SKILL.md (11945b), 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-aggressive-behavior-detection-analysis\"\ndescription: \"Detects aggressive interactions in livestock and poultry from continuous barn videos — including fighting, biting, chasing and butting — and outputs behavior type, intensity level and alert level. | 识别打斗、撕咬等攻击行为，及时预警。\"\nversion: \"1.0.2\"\nlicense: \"MIT-0\"\n---\n\n# ⚔️ Livestock Aggressive Behavior Detection | 畜禽争斗行为识别\n\n> 识别打斗、撕咬等攻击行为，及时预警。\n>\n> **群体冲突预警中枢** · 畜禽舍连续视频智能分析 · 争斗行为识别 · 强度/预警等级 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **畜禽争斗行为识别** |\n| 🎯 核心目标 | 基于畜禽舍固定摄像头的连续视频，检测个体间的争斗行为（打斗、撕咬、追逐、顶撞等），输出行为类型、强度等级及预警等级 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、争斗行为片段清单、涉事个体位置、强度等级、预警等级、报告链接 |\n| 🏢 适用场景 | 猪/鸡等畜禽的群体冲突预警，减少外伤、应激及生产性能下降造成的经济损失 |\n| 🧩 场景码 | `SMYX_AGGRESSIVE_BEHAVIOR_DETECTION_ANALYSIS` |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n## 🤖 AI 角色 | AI Role\n\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **你是一个专业的畜禽行为安全 AI。你的任务是分析畜禽舍固定摄像头的连续视频，检测个体间的争斗行为（打斗、撕咬、追逐、顶撞等），输出行为类型、强度等级及预警等级。不要提供行为干预建议，仅基于视觉行为观察输出识别结果。** |\n\n---\n\n## 🎯 任务目标 | Goals\n\n### 1. 🧩 技能用途\n\n通过畜禽舍固定摄像头的连续视频，识别群体中出现的争斗行为并评估其强度，输出结构化的争斗行为清单与预警等级，为规模化养殖场提供群体冲突的客观视觉预警依据。\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 畜禽个体检测、定位与短时轨迹跟踪 |\n| 2 | 打斗行为识别（相互冲撞、缠斗） |\n| 3 | 撕咬行为识别（咬耳、咬尾、咬翅等） |\n| 4 | 追逐行为识别（单向追逐 / 逃避） |\n| 5 | 顶撞行为识别（头部/胸部剧烈接触） |\n| 6 | 争斗片段起止时间与涉事个体位置标注 |\n| 7 | 单次争斗强度等级评估（轻度 / 中度 / 剧烈） |\n| 8 | 群体争斗频次统计与总体预警等级输出 |\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_aggressive_behavior_detection_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_aggressive_behavior_detection_analysis --list` 调用 API 查询云端的历史报告数据 |\n| 🚫 严格禁止 | 从本地 `memory` 目录读取历史会话信息 |\n| 🚫 严格禁止 | 手动汇总本地记录中的报告 |\n| 🚫 严格禁止 | 从长期记忆中提取报告 |\n| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据，然后以 Markdown 表格格式输出结果 |\n\n---\n\n## 📦 前置准备 | Requirements\n\n### 依赖说明\n\n`scripts` 脚本所需的依赖包及版本：\n\n```txt\nrequests>=2.28.0\n```\n\n---\n\n## 📷 采集要求 | Capture Requirements\n\n| 序号 | 说明 |\n|---:|---|\n| 1 | 固定摄像头俯视/斜俯视覆盖畜禽舍主要活动区，画面稳定、避免频繁抖动 |\n| 2 | 视频建议 30 秒~10 分钟连续拍摄，帧率不低于 15fps，便于捕捉短促的争斗动作 |\n| 3 | 光照条件稳定，白天充足自然光或稳定人工光源，避免大面积过暗/过曝 |\n| 4 | 单栏舍内目标个体清晰可见，尽量减少人员操作、清扫等无关剧烈动作干扰 |\n| 5 | 支持格式：jpg/png/jpeg 图片，及 mp4/avi/mov 视频；单文件不超过 10MB |\n| 6 | 尽量在群体日常状态（非驱赶/转群时段）内采集，避免误将常规扰动识别为争斗 |\n\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\n## 🧪 标准流程 | Standard Flow\n\n| 步骤 | 阶段 | 执行动作 |\n|---:|---|---|\n| 1 | 📥 准备畜禽舍视频输入 | 提供本地文件路径或网络 URL；确保画面稳定、覆盖群体活动区 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行争斗行为识别 | 调用 `-m scripts.smyx_aggressive_behavior_detection_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看争斗片段清单、涉事个体、强度与预警等级及报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地畜禽舍图像/视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络畜禽舍图像/视频 URL 地址 | API 服务自动下载 |\n| `--pet-type` | 类别标识（畜禽场景保持 other） | 默认 `other`，按需填写 |\n| `--list` | 显示历史分析报告清单 | 可以输入起始日期参数过滤数据范围 |\n| `--api-url` | API 服务地址 | 可选，使用默认值 |\n| `--detail` | 输出详细程度 | `basic` / `standard` / `json`，默认 `json` |\n| `--output` | 结果输出文件路径 | 可选 |\n\n---\n\n## 🗂️ 资源索引 | Resource Index\n\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_aggressive_behavior_detection_analysis.py`](scripts/smyx_aggressive_behavior_detection_analysis.py) | 调用 API 进行争斗行为识别或查询历史报告 | 执行分析或查询时使用 |\n| ⚙️ 配置文件 | [`scripts/config.py`](scripts/config.py) | 场景码 `SMYX_AGGRESSIVE_BEHAVIOR_DETECTION_ANALYSIS`、默认参数配置 | 需要确认默认配置时读取 |\n| 📘 领域参考 | [`references/api_doc.md`](references/api_doc.md) | 了解 API 接口规范、字段说明和错误码 | 仅在需要了解接口规范或错误码时读取 |\n\n---\n\n## ⚠️ 注意事项 | Notes\n\n| 分类 | 注意事项 |\n|---|---|\n| 📚 文档读取 | 仅在需要时读取参考文档，保持上下文简洁 |\n| 📁 格式支持 | 图片支持 `jpg` / `png` / `jpeg`；视频支持 `mp4` / `avi` / `mov`；单文件最大 `10MB` |\n| 🧑‍⚖️ 结果性质 | 识别结果仅供争斗行为预警参考，本技能不提供行为干预建议 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能使用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数无需本地下载，默认为公网地址，API 服务会自动下载 |\n| 📜 报告输出 | 显示历史分析报告清单时，从接口返回 JSON 数据中提取字段作为超链接地址，并自动转化为 Markdown 表格输出 |\n\n---\n\n## 🔒 隐私与数据安全声明 | Privacy & Data Security\n\n| 序号 | 说明 |\n|---:|---|\n| 1 | 仅采集与畜禽争斗行为识别直接相关的图像/视频数据，不采集与争斗识别无关的敏感信息 |\n| 2 | 内部身份参数由系统自动处理，不在任何输出、日志或报告中暴露 |\n| 3 | 分析请求通过服务端 API 完成，网络传输遵循平台既有安全策略 |\n| 4 | 历史报告仅当前身份可读，不做跨养殖场/跨用户汇总或共享 |\n| 5 | 识别结果仅供参考，实际干预与处置请结合养殖场规程与专业动物福利/兽医意见 |\n\n---\n\n## 📜 历史报告清单输出规范 | Report List Format\n\n当显示历史分析报告清单的时候，从接口返回 JSON 数据中提取字段作为超链接地址，且自动转化为如下 Markdown 表格格式输出。\n\n### 📌 固定输出列\n\n| 列名 | 生成规则 |\n|---|---|\n| 报告名称 | 使用 `畜禽争斗行为识别报告-{记录id}` 形式拼接 |\n| 预警等级 | 从接口返回数据中提取（正常 / 关注 / 预警 / 紧急） |\n| 分析时间 | 从接口返回数据中提取 |\n| 点击查看 | 使用 `[🔗 查看报告]()` 格式的超链接 |\n\n### 🧾 表格输出示例\n\n| 报告名称 | 预警等级 | 分析时间 | 点击查看 |\n|----------|----------|----------|----------|\n| 畜禽争斗行为识别报告-20260703160500001 | 预警 | 2026-07-03 16:05:00 | [🔗 查看报告](https://example.com/report?id=xxx) |\n\n---\n\n## 🧰 使用示例 | Examples\n\n### 🐷 分析本地猪舍连续视频\n\n```bash\npython -m scripts.smyx_aggressive_behavior_detection_analysis --input /path/to/pig_barn.mp4\n```\n\n### 🐔 分析本地鸡舍连续视频\n\n```bash\npython -m scripts.smyx_aggressive_behavior_detection_analysis --input /path/to/chicken_house.mp4\n```\n\n### 🌐 分析网络畜禽舍视频\n\n```bash\npython -m scripts.smyx_aggressive_behavior_detection_analysis --url https://example.com/livestock_barn.mp4\n```\n\n### 📚 显示历史分析报告 / 显示分析报告清单列表 / 显示历史争斗行为报告\n\n> 自动触发关键词：查看历史争斗行为报告、历史报告、争斗行为识别清单等。\n\n```bash\npython -m scripts.smyx_aggressive_behavior_detection_analysis --list\n```\n\n### 🪶 输出精简报告\n\n```bash\npython -m scripts.smyx_aggressive_behavior_detection_analysis --input pig_barn.mp4 --detail basic\n```\n\n### 💾 保存结果到文件\n\n```bash\npython -m scripts.smyx_aggressive_behavior_detection_analysis --input chicken_house.mp4 --output result.json\n```\n\nFile v1.0.4:_meta.json\n\n{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-aggressive-behavior-detection-analysis\",\n  \"version\": \"1.0.4\",\n  \"publishedAt\": 1784022507101\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/ai-analysis/v2/start-common-ai-analysis` - 启动畜禽争斗行为识别分析任务\n2. `/web/ai-analysis/get-common-ai-analysis-result` - 获取分析结果\n3. `/web/ai-analysis/page-common-ai-analysis-result` - 分页查询历史报告\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_AGGRESSIVE_BEHAVIOR_DETECTION_ANALYSIS` - 畜禽争斗行为识别\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>\nDetects aggressive interactions in livestock and poultry from continuous barn videos, including fighting, biting, chasing, and butting, and outputs behavior type, intensity level, and alert level. <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>\nExternal users and agricultural operations teams use this skill to screen barn camera media for livestock or poultry conflict events and receive structured behavior, intensity, alert, and report-link outputs. It supports local media files, media URLs, and cloud history lookup for prior analysis reports. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Uploaded livestock media or supplied media URLs are sent to LifeEmergence cloud APIs for processing. <br>\nMitigation: Install and run the skill only where cloud processing of the media is permitted by the user or organization. <br>\nRisk: The skill can create or reuse internal identity state and query cloud history associated with that identity. <br>\nMitigation: Review the identity and history-query behavior before deployment, and limit use to environments where local identity persistence is acceptable. <br>\nRisk: Service tokens may be stored in a local workspace SQLite database. <br>\nMitigation: Protect the workspace, restrict access to local data files, and remove persisted state when the skill is no longer needed. <br>\n\n\n## Reference(s): <br>\n- [ClawHub skill page](https://clawhub.ai/18072937735/skills/smyx-aggressive-behavior-detection-analysis) <br>\n- [Skill demo](https://lifeemergence.com/sample.html) <br>\n- [API documentation](references/api_doc.md) <br>\n- [Analysis API documentation](skills/smyx_analysis/references/api_doc.md) <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 report links] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Outputs may include behavior classifications, timestamps or segment lists, locations of involved animals, intensity level, alert level, historical report records, and exported report links.] <br>\n\n## Skill Version(s): <br>\n1.0.4 (source: server release metadata) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nFile v1.0.4:skills/smyx_analysis/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nyaml==6.0.3\n\nFile v1.0.4:skills/smyx_common/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nPyYAML==6.0.3\n\nArchive v1.0.3: 31 files, 39629 bytes\n\nFiles: references/api_doc.md (661b), scripts/__init__.py (58b), scripts/config.py (682b), scripts/config.yaml (3b), scripts/skill.py (575b), scripts/smyx_aggressive_behavior_detection_analysis.py (3543b), skill-card.md (3046b), SKILL.md (11945b), 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 (28605b), _meta.json (162b)\n\nFile v1.0.3:SKILL.md\n\n---\nname: \"smyx-aggressive-behavior-detection-analysis\"\ndescription: \"Detects aggressive interactions in livestock and poultry from continuous barn videos — including fighting, biting, chasing and butting — and outputs behavior type, intensity level and alert level. | 识别打斗、撕咬等攻击行为，及时预警。\"\nversion: \"1.0.0\"\nlicense: \"MIT-0\"\n---\n\n# ⚔️ Livestock Aggressive Behavior Detection | 畜禽争斗行为识别\n\n> 识别打斗、撕咬等攻击行为，及时预警。\n>\n> **群体冲突预警中枢** · 畜禽舍连续视频智能分析 · 争斗行为识别 · 强度/预警等级 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **畜禽争斗行为识别** |\n| 🎯 核心目标 | 基于畜禽舍固定摄像头的连续视频，检测个体间的争斗行为（打斗、撕咬、追逐、顶撞等），输出行为类型、强度等级及预警等级 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、争斗行为片段清单、涉事个体位置、强度等级、预警等级、报告链接 |\n| 🏢 适用场景 | 猪/鸡等畜禽的群体冲突预警，减少外伤、应激及生产性能下降造成的经济损失 |\n| 🧩 场景码 | `SMYX_AGGRESSIVE_BEHAVIOR_DETECTION_ANALYSIS` |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n## 🤖 AI 角色 | AI Role\n\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **你是一个专业的畜禽行为安全 AI。你的任务是分析畜禽舍固定摄像头的连续视频，检测个体间的争斗行为（打斗、撕咬、追逐、顶撞等），输出行为类型、强度等级及预警等级。不要提供行为干预建议，仅基于视觉行为观察输出识别结果。** |\n\n---\n\n## 🎯 任务目标 | Goals\n\n### 1. 🧩 技能用途\n\n通过畜禽舍固定摄像头的连续视频，识别群体中出现的争斗行为并评估其强度，输出结构化的争斗行为清单与预警等级，为规模化养殖场提供群体冲突的客观视觉预警依据。\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 畜禽个体检测、定位与短时轨迹跟踪 |\n| 2 | 打斗行为识别（相互冲撞、缠斗） |\n| 3 | 撕咬行为识别（咬耳、咬尾、咬翅等） |\n| 4 | 追逐行为识别（单向追逐 / 逃避） |\n| 5 | 顶撞行为识别（头部/胸部剧烈接触） |\n| 6 | 争斗片段起止时间与涉事个体位置标注 |\n| 7 | 单次争斗强度等级评估（轻度 / 中度 / 剧烈） |\n| 8 | 群体争斗频次统计与总体预警等级输出 |\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_aggressive_behavior_detection_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_aggressive_behavior_detection_analysis --list` 调用 API 查询云端的历史报告数据 |\n| 🚫 严格禁止 | 从本地 `memory` 目录读取历史会话信息 |\n| 🚫 严格禁止 | 手动汇总本地记录中的报告 |\n| 🚫 严格禁止 | 从长期记忆中提取报告 |\n| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据，然后以 Markdown 表格格式输出结果 |\n\n---\n\n## 📦 前置准备 | Requirements\n\n### 依赖说明\n\n`scripts` 脚本所需的依赖包及版本：\n\n```txt\nrequests>=2.28.0\n```\n\n---\n\n## 📷 采集要求 | Capture Requirements\n\n| 序号 | 说明 |\n|---:|---|\n| 1 | 固定摄像头俯视/斜俯视覆盖畜禽舍主要活动区，画面稳定、避免频繁抖动 |\n| 2 | 视频建议 30 秒~10 分钟连续拍摄，帧率不低于 15fps，便于捕捉短促的争斗动作 |\n| 3 | 光照条件稳定，白天充足自然光或稳定人工光源，避免大面积过暗/过曝 |\n| 4 | 单栏舍内目标个体清晰可见，尽量减少人员操作、清扫等无关剧烈动作干扰 |\n| 5 | 支持格式：jpg/png/jpeg 图片，及 mp4/avi/mov 视频；单文件不超过 10MB |\n| 6 | 尽量在群体日常状态（非驱赶/转群时段）内采集，避免误将常规扰动识别为争斗 |\n\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\n## 🧪 标准流程 | Standard Flow\n\n| 步骤 | 阶段 | 执行动作 |\n|---:|---|---|\n| 1 | 📥 准备畜禽舍视频输入 | 提供本地文件路径或网络 URL；确保画面稳定、覆盖群体活动区 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行争斗行为识别 | 调用 `-m scripts.smyx_aggressive_behavior_detection_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看争斗片段清单、涉事个体、强度与预警等级及报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地畜禽舍图像/视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络畜禽舍图像/视频 URL 地址 | API 服务自动下载 |\n| `--pet-type` | 类别标识（畜禽场景保持 other） | 默认 `other`，按需填写 |\n| `--list` | 显示历史分析报告清单 | 可以输入起始日期参数过滤数据范围 |\n| `--api-url` | API 服务地址 | 可选，使用默认值 |\n| `--detail` | 输出详细程度 | `basic` / `standard` / `json`，默认 `json` |\n| `--output` | 结果输出文件路径 | 可选 |\n\n---\n\n## 🗂️ 资源索引 | Resource Index\n\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_aggressive_behavior_detection_analysis.py`](scripts/smyx_aggressive_behavior_detection_analysis.py) | 调用 API 进行争斗行为识别或查询历史报告 | 执行分析或查询时使用 |\n| ⚙️ 配置文件 | [`scripts/config.py`](scripts/config.py) | 场景码 `SMYX_AGGRESSIVE_BEHAVIOR_DETECTION_ANALYSIS`、默认参数配置 | 需要确认默认配置时读取 |\n| 📘 领域参考 | [`references/api_doc.md`](references/api_doc.md) | 了解 API 接口规范、字段说明和错误码 | 仅在需要了解接口规范或错误码时读取 |\n\n---\n\n## ⚠️ 注意事项 | Notes\n\n| 分类 | 注意事项 |\n|---|---|\n| 📚 文档读取 | 仅在需要时读取参考文档，保持上下文简洁 |\n| 📁 格式支持 | 图片支持 `jpg` / `png` / `jpeg`；视频支持 `mp4` / `avi` / `mov`；单文件最大 `10MB` |\n| 🧑‍⚖️ 结果性质 | 识别结果仅供争斗行为预警参考，本技能不提供行为干预建议 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能使用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数无需本地下载，默认为公网地址，API 服务会自动下载 |\n| 📜 报告输出 | 显示历史分析报告清单时，从接口返回 JSON 数据中提取字段作为超链接地址，并自动转化为 Markdown 表格输出 |\n\n---\n\n## 🔒 隐私与数据安全声明 | Privacy & Data Security\n\n| 序号 | 说明 |\n|---:|---|\n| 1 | 仅采集与畜禽争斗行为识别直接相关的图像/视频数据，不采集与争斗识别无关的敏感信息 |\n| 2 | 内部身份参数由系统自动处理，不在任何输出、日志或报告中暴露 |\n| 3 | 分析请求通过服务端 API 完成，网络传输遵循平台既有安全策略 |\n| 4 | 历史报告仅当前身份可读，不做跨养殖场/跨用户汇总或共享 |\n| 5 | 识别结果仅供参考，实际干预与处置请结合养殖场规程与专业动物福利/兽医意见 |\n\n---\n\n## 📜 历史报告清单输出规范 | Report List Format\n\n当显示历史分析报告清单的时候，从接口返回 JSON 数据中提取字段作为超链接地址，且自动转化为如下 Markdown 表格格式输出。\n\n### 📌 固定输出列\n\n| 列名 | 生成规则 |\n|---|---|\n| 报告名称 | 使用 `畜禽争斗行为识别报告-{记录id}` 形式拼接 |\n| 预警等级 | 从接口返回数据中提取（正常 / 关注 / 预警 / 紧急） |\n| 分析时间 | 从接口返回数据中提取 |\n| 点击查看 | 使用 `[🔗 查看报告]()` 格式的超链接 |\n\n### 🧾 表格输出示例\n\n| 报告名称 | 预警等级 | 分析时间 | 点击查看 |\n|----------|----------|----------|----------|\n| 畜禽争斗行为识别报告-20260703160500001 | 预警 | 2026-07-03 16:05:00 | [🔗 查看报告](https://example.com/report?id=xxx) |\n\n---\n\n## 🧰 使用示例 | Examples\n\n### 🐷 分析本地猪舍连续视频\n\n```bash\npython -m scripts.smyx_aggressive_behavior_detection_analysis --input /path/to/pig_barn.mp4\n```\n\n### 🐔 分析本地鸡舍连续视频\n\n```bash\npython -m scripts.smyx_aggressive_behavior_detection_analysis --input /path/to/chicken_house.mp4\n```\n\n### 🌐 分析网络畜禽舍视频\n\n```bash\npython -m scripts.smyx_aggressive_behavior_detection_analysis --url https://example.com/livestock_barn.mp4\n```\n\n### 📚 显示历史分析报告 / 显示分析报告清单列表 / 显示历史争斗行为报告\n\n> 自动触发关键词：查看历史争斗行为报告、历史报告、争斗行为识别清单等。\n\n```bash\npython -m scripts.smyx_aggressive_behavior_detection_analysis --list\n```\n\n### 🪶 输出精简报告\n\n```bash\npython -m scripts.smyx_aggressive_behavior_detection_analysis --input pig_barn.mp4 --detail basic\n```\n\n### 💾 保存结果到文件\n\n```bash\npython -m scripts.smyx_aggressive_behavior_detection_analysis --input chicken_house.mp4 --output result.json\n```\n\nFile v1.0.3:_meta.json\n\n{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-aggressive-behavior-detection-analysis\",\n  \"version\": \"1.0.3\",\n  \"publishedAt\": 1783086929582\n}\n\nFile v1.0.3:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放畜禽争斗行为识别 API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/ai-analysis/v2/start-common-ai-analysis` - 启动畜禽争斗行为识别分析任务\n2. `/web/ai-analysis/get-common-ai-analysis-result` - 获取分析结果\n3. `/web/ai-analysis/page-common-ai-analysis-result` - 分页查询历史报告\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_AGGRESSIVE_BEHAVIOR_DETECTION_ANALYSIS` - 畜禽争斗行为识别\n\nFile v1.0.3:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.3:scripts/config.yaml\n\n{}\n\nFile v1.0.3:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.3:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.3:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.3:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: prod\n\nFile v1.0.3:skill-card.md\n\n## Description: <br>\nDetects aggressive interactions in livestock and poultry from continuous barn videos, including fighting, biting, chasing and butting, and outputs behavior type, intensity level and alert level. <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>\nFarm operators, developers, and livestock monitoring teams use this skill to analyze barn images, videos, or media URLs for aggressive livestock and poultry interactions. It returns structured behavior findings, alert levels, report links, and historical report listings for conflict monitoring workflows. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: The security evidence says barn media or remote video URLs are sent to LifeEmergence services for analysis. <br>\nMitigation: Use only footage approved for that service, review retention and access policies before sending sensitive farm media, and avoid submitting media that contains unrelated sensitive information. <br>\nRisk: The security evidence says the skill may create or reuse a local identity, read a local smyx API key file if present, and store service tokens in a workspace database. <br>\nMitigation: Run the skill in a workspace with controlled file permissions, review any existing smyx API key file before use, and clear local token storage when rotating accounts or moving workspaces. <br>\nRisk: The security evidence says historical reports are associated with the local identity and should be reviewed for account ownership and access. <br>\nMitigation: Confirm which identity is active before querying historical reports and restrict report access to users authorized for the relevant farm or monitoring account. <br>\n\n\n## Reference(s): <br>\n- [ClawHub Skill Page](https://clawhub.ai/18072937735/skills/smyx-aggressive-behavior-detection-analysis) <br>\n- [Skill Demo](https://lifeemergence.com/sample.html) <br>\n- [Aggressive Behavior Detection API Documentation](references/api_doc.md) <br>\n- [Common AI Analysis API Documentation](skills/smyx_analysis/references/api_doc.md) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [Text, Markdown, JSON, Files] <br>\n**Output Format:** [Structured analysis text, Markdown tables for report listings, JSON-style details, and optional saved output files.] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Outputs may include behavior categories, intensity levels, alert levels, timestamps or report listings, and links to exported reports.] <br>\n\n## Skill Version(s): <br>\n1.0.3 (source: ClawHub release metadata; artifact frontmatter says 1.0.0) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nFile v1.0.3:skills/smyx_analysis/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nyaml==6.0.3\n\nFile v1.0.3:skills/smyx_common/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nPyYAML==6.0.3","readmeExcerpt":"Skill: Aggressive Behavior Detection | 畜禽争斗行为识别 Owner: 18072937735 Summary: Detects aggressive interactions in livestock and poultry from continuous barn videos — including fighting, biting, chasing and butting — and outputs behavior type, intensity level and alert level. | 识别打斗、撕咬等攻击行为，及时预警。 Tags: latest:1.0.12 Version history: v1.0.12 | 2026-10-02T12:39:32.953Z | auto - Updated version to 1.0.13. - Modified SKILL.m","codeSnippets":[],"executableExamples":[{"language":"bash","snippet":"python -m scripts.smyx_aggressive_behavior_detection_analysis --list"},{"language":"txt","snippet":"requests>=2.28.0"},{"language":"bash","snippet":"python -m scripts.smyx_aggressive_behavior_detection_analysis --input /path/to/pig_barn.mp4"},{"language":"bash","snippet":"python -m scripts.smyx_aggressive_behavior_detection_analysis --input /path/to/chicken_house.mp4"},{"language":"bash","snippet":"python -m scripts.smyx_aggressive_behavior_detection_analysis --url https://example.com/livestock_barn.mp4"},{"language":"bash","snippet":"python -m scripts.smyx_aggressive_behavior_detection_analysis --list"}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\nname: \"smyx-aggressive-behavior-detection-analysis\"\ndescription: \"Detects aggressive interactions in livestock and poultry from continuous barn videos — including fighting, biting, chasing and butting — and outputs behavior type, intensity level and alert level. | 识别打斗、撕咬等攻击行为，及时预警。\"\nversion: \"1.0.13\"\nlicense: \"MIT-0\"\n---\n\n# ⚔️ Livestock Aggressive Behavior Detection | 畜禽争斗行为识别\n\n> 识别打斗、撕咬等攻击行为，及时预警。\n>\n> **群体冲突预警中枢** · 畜禽舍连续视频智能分析 · 争斗行为识别 · 强度/预警等级 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **畜禽争斗行为识别** |\n| 🎯 核心目标 | 基于畜禽舍固定摄像头的连续视频，检测个体间的争斗行为（打斗、撕咬、追逐、顶撞等），输出行为类型、强度等级及预警等级 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、争斗行为片段清单、涉事个体位置、强度等级、预警等级、报告链接 |\n| 🏢 适用场景 | 猪/鸡等畜禽的群体冲突预警，减少外伤、应激及生产性能下降造成的经济损失 |\n| 🧩 场景码 | `SMYX_AGGRESSIVE_BEHAVIOR_DETECTION_ANALYSIS` |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n## 🤖 AI 角色 | AI Role\n\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **你是一个专业的畜禽行为安全 AI。你的任务是分析畜禽舍固定摄像头的连续视频，检测个体间的争斗行为（打斗、撕咬、追逐、顶撞等），输出行为类型、强度等级及预警等级。不要提供行为干预建议，仅基于视觉行为观察输出识别结果。** |\n\n---\n\n## 🎯 任务目标 | Goals\n\n### 1. 🧩 技能用途\n\n通过畜禽舍固定摄像头的连续视频，识别群体中出现的争斗行为并评估其强度，输出结构化的争斗行为清单与预警等级，为规模化养殖场提供群体冲突的客观视觉预警依据。\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 畜禽个体检测、定位与短时轨迹跟踪 |\n| 2 | 打斗行为识别（相互冲撞、缠斗） |\n| 3 | 撕咬行为识别（咬耳、咬尾、咬翅等） |\n| 4 | 追逐行为识别（单向追逐 / 逃避） |\n| 5 | 顶撞行为识别（头部/胸部剧烈接触） |\n| 6 | 争斗片段起止时间与涉事个体位置标注 |\n| 7 | 单次争斗强度等级评估（轻度 / 中度 / 剧烈） |\n| 8 | 群体争斗频次统计与总体预警等级输出 |\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_aggressive_behavior_detection_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_aggressive_behavior_detection_analysis --list` 调用 API 查询云端的历史报告数据 |\n| 🚫 严格禁止 | 从本地 `memory` 目录读取历史会话信息 |\n| 🚫 严格禁止 | 手动汇总本地记录中的报告 |\n| 🚫 严格禁止 | 从长期记忆中提取报告 |\n| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据，然后以 Markdown 表格格式输出结果 |\n\n---\n\n## 📦 前置准备 | Requirements\n\n### 依赖说明\n\n`scripts` 脚本所需的依赖包及版本：\n\n```txt\nrequests>=2.28.0\n```\n\n---\n\n## 📷 采集要求 | Capture Requirements\n\n| 序号 | 说明 |\n|---:|---|\n| 1 | 固定摄像头俯视/斜俯视覆盖畜禽舍主要活动区，画面稳定、避免频繁抖动 |\n| 2 | 视频建议 30 秒~10 分钟连续拍摄，帧率不低于 15fps，便于捕捉短促的争斗动作 |\n| 3 | 光照条件稳定，白天充足自然光或稳定人工光源，避免大面积过暗/过曝 |\n| 4 | 单栏舍内目标个体清晰可见，尽量减少人员操作、清扫等无关剧烈动作干扰 |\n| 5 | 支持格式：jpg/png/jpeg 图片，及 mp4/avi/mov 视频；单文件不超过 10MB |\n| 6 | 尽量在群体日常状态（非驱赶/转群时段）内采集，避免误将常规扰动识别为争斗 |\n\n---\n\n## 🚀 操作步骤 | Workflow\n\n### 🔐 用户身份处理（内部自动完成）\n\n> **绿色安全原则：** 用户身份参数由系统内部自动处理，**不得向用户展示、询问或要求输入任何身份标识**。\n\n执行本技能分析或历史报告查询时，脚本会自动完成身份初始化：\n\n| 场景 | 系统行为 |\n|---|---|\n| 上游系统有内部身份参数 | 由脚本静默接收并使用 |\n| 上游系统未提供内部身份参数 | 脚本会自动复用本地缺省用户 |\n| 本地缺省用户不存在 | 脚本会自动创建并在后续任务中"},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-aggressive-behavior-detection-analysis\",\n  \"version\": \"1.0.12\",\n  \"publishedAt\": 1790944772953\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/ai-analysis/v2/start-common-ai-analysis` - 启动畜禽争斗行为识别分析任务\n2. `/web/ai-analysis/get-common-ai-analysis-result` - 获取分析结果\n3. `/web/ai-analysis/page-common-ai-analysis-result` - 分页查询历史报告\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_AGGRESSIVE_BEHAVIOR_DETECTION_ANALYSIS` - 畜禽争斗行为识别"},{"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":"Detects aggressive interactions in livestock and poultry from continuous barn videos — including fighting, biting, chasing and butting — and outputs behavior type, intensity level and alert level. | 识别打斗、撕咬等攻击行为，及时预警。 Skill: Aggressive Behavior Detection | 畜禽争斗行为识别 Owner: 18072937735 Summary: Detects aggressive interactions in livestock and poultry from continuous barn videos — including fighting, biting, chasing and butting — and outputs behavior type, intensity level and alert level. | 识别打斗、撕咬等攻击行为，及时预警。 Tags: latest:1.0.12 Version history: v1.0.12 | 2026-10-02T12:39:32.953Z | auto - Updated version to 1.0.13. - Modified SKILL.m","editorialQuality":{"score":100,"threshold":65,"status":"ready","wordCount":760,"uniquenessScore":51,"reasons":[]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-10T21:19:10.459Z","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-10T21:19:10.459Z","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-10T23:46:14.201Z","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"}]}}}