[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7FC85FC81P5C3AJ899TV4BJ":3,"skill-same:01M7FC85FC81P5C3AJ899TV4BJ":52},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":6,"ownerDescription":30,"updatedAt":31,"install":32,"resources":45},"01M7FC85FC81P5C3AJ899TV4BJ","sensing-track",null,"Query flow event logs to answer questions about past sensing events — \"Have you seen anybody between 10pm and 12pm?\", \"Is there any motion in the last hour?\", \"What happened while I was away?\".","lza6\u002FArmor-piercing-system-prompts","lza6","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F128880206?v=4","01M7EB3K7WPX5T28EJ2NVHE6EG","Chinese-tingfeng","01M7EB3K97E1KQ16QWKJMFNGX8",11,"MIT","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F06-前端与设计\u002Fsensing-track\u002FSKILL.md",[],[],"2026-11-16 10:05:34",false,"---\nname: sensing-track\ndescription: Query flow event logs to answer questions about past sensing events — \"Have you seen anybody between 10pm and 12pm?\", \"Is there any motion in the last hour?\", \"What happened while I was away?\".\n---\n\n# Sensing Event History\n\n## Quick Start\n\nThe primary data source is the **flow events JSONL** at `\u002Froot\u002Flocal\u002Fflow_events_YYYY-MM-DD.jsonl`. Each file covers one calendar day (7-day retention, no size-rotation mid-day). Use Bash + `jq` to query it.\n\n> **Important:** Always use the absolute path `\u002Froot\u002Flocal\u002F` — the `read` tool cannot access files outside the workspace, so use `exec` (Bash) for all JSONL queries.\n\nPersistent camera snapshots are stored under `\u002Fvar\u002Flib\u002Fhal\u002Fsnapshots\u002Fsensing_\u003Cprefix>\u002F\u003Cms>.jpg` (72h TTL, 50 MB cap) — one subdir per event kind:\n\n| Event type | Folder |\n|---|---|\n| `presence.enter`, `presence.leave` | `sensing_face\u002F` |\n| `motion.activity` | `sensing_motion_activity\u002F` |\n| `emotion.detected` | `sensing_emotion\u002F` |\n\nReference these when the user asks what happened visually.\n\n## JSONL format\n\nEach line is a JSON object:\n\n```json\n{\"kind\":\"enter\",\"node\":\"sensing_input\",\"ts\":1712345678.123,\"seq\":42,\"trace_id\":\"run-abc\",\"data\":{\"type\":\"presence.enter\",\"message\":\"Person detected — 1 face(s) visible (friend (gray))\\n[snapshot: \u002Fvar\u002Flib\u002Fhal\u002Fsnapshots\u002Fsensing_face\u002F1712345678123.jpg]\"},\"version\":\"1.2.3\"}\n{\"kind\":\"exit\",\"node\":\"sensing_input\",\"ts\":1712345678.456,\"seq\":43,\"trace_id\":\"run-abc\",\"duration_ms\":332,\"data\":{\"path\":\"agent\",\"run_id\":\"run-abc\"},\"version\":\"1.2.3\"}\n```\n\nKey fields:\n- `node` — filter on `\"sensing_input\"` for sensing events\n- `kind` — `\"enter\"` = event received, `\"exit\"` = event processed (with `duration_ms`)\n- `data.type` — event type: `presence.enter`, `presence.leave`, `motion`, `motion.activity`, `sound`, `light.level`, `voice`, `voice_command`, `emotion.detected`, `speech_emotion.detected`\n- `data.message` — natural-language description; may contain `[snapshot: \u002Fvar\u002Flib\u002Fhal\u002Fsnapshots\u002Fsensing_\u003Cprefix>\u002F\u003Cms>.jpg]`\n- `data.path` — in `exit` records: `\"agent\"` (forwarded), `\"local\"` (handled locally), or has `\"error\"` key (failed\u002Fdropped)\n- `ts` — Unix timestamp (seconds with fractional ms)\n- `trace_id` — correlates enter\u002Fexit and links to agent turn\n\n## Tools\n\n**Bash** — `jq`, `cat`, date arithmetic. No writes.\n\n---\n\n## Query recipes\n\n### Timezone — always set before date arithmetic\n\n```bash\nexport TZ=$(cat \u002Fetc\u002Ftimezone)\n```\n\n### All sensing events in a time range\n\n```bash\nexport TZ=$(cat \u002Fetc\u002Ftimezone)\nDATE=\"$(date +%Y-%m-%d)\"\nFROM_TS=$(date -d \"$DATE 22:00:00\" +%s)\nTO_TS=$(date -d \"$DATE 23:59:59\" +%s)\njq -c 'select(.node==\"sensing_input\" and .kind==\"enter\" and .ts >= '\"$FROM_TS\"' and .ts \u003C= '\"$TO_TS\"')' \\\n  \"\u002Froot\u002Flocal\u002Fflow_events_${DATE}.jsonl\"\n```\n\n### Events of a specific type in the last N hours\n\nUse `\"motion\"` for raw motion, `\"motion.activity\"` for activity analysis (HAL-categorised — bucket names `drink`\u002F`break`\u002F`celebrate` and raw Kinetics sedentary labels like `using computer`, `writing`, `reading`). Most queries want both:\n\n```bash\nexport TZ=$(cat \u002Fetc\u002Ftimezone)\nSINCE=$(date -d \"1 hour ago\" +%s)\nTODAY=$(date +%Y-%m-%d)\njq -c 'select(.node==\"sensing_input\" and .kind==\"enter\" and .ts >= '\"$SINCE\"' and (.data.type==\"motion\" or .data.type==\"motion.activity\"))' \\\n  \"\u002Froot\u002Flocal\u002Fflow_events_${TODAY}.jsonl\"\n```\n\n### Any activity in the last N minutes\n\n```bash\nexport TZ=$(cat \u002Fetc\u002Ftimezone)\nSINCE=$(date -d \"30 minutes ago\" +%s)\nTODAY=$(date +%Y-%m-%d)\njq -c 'select(.node==\"sensing_input\" and .kind==\"enter\" and .ts >= '\"$SINCE\"')' \\\n  \"\u002Froot\u002Flocal\u002Fflow_events_${TODAY}.jsonl\"\n```\n\n### Presence events only (who came by)\n\nNames in messages are lowercase (`friend (gray)`). Use `test()` with `\"i\"` flag for case-insensitive search:\n\n```bash\nTODAY=$(date +%Y-%m-%d)\n# All presence events\njq -c 'select(.node==\"sensing_input\" and .kind==\"enter\" and (.data.type==\"presence.enter\" or .data.type==\"presence.leave\"))' \\\n  \"\u002Froot\u002Flocal\u002Fflow_events_${TODAY}.jsonl\"\n# Search for a specific person (case-insensitive)\njq -c 'select(.node==\"sensing_input\" and .kind==\"enter\" and .data.type==\"presence.enter\" and (.data.message | test(\"gray\";\"i\")))' \\\n  \"\u002Froot\u002Flocal\u002Fflow_events_${TODAY}.jsonl\"\n```\n\n### Events spanning multiple days\n\n```bash\nexport TZ=$(cat \u002Fetc\u002Ftimezone)\nYESTERDAY=$(date -d \"yesterday\" +%Y-%m-%d)\nTODAY=$(date +%Y-%m-%d)\ncat \"\u002Froot\u002Flocal\u002Fflow_events_${YESTERDAY}.jsonl\" \"\u002Froot\u002Flocal\u002Fflow_events_${TODAY}.jsonl\" \\\n  | jq -c 'select(.node==\"sensing_input\" and .kind==\"enter\" and .ts >= '\"$FROM_TS\"' and .ts \u003C= '\"$TO_TS\"')'\n```\n\n### Dropped events (agent was busy)\n\n```bash\nTODAY=$(date +%Y-%m-%d)\njq -c 'select(.node==\"sensing_input\" and .kind==\"exit\" and .data.error != null)' \\\n  \"\u002Froot\u002Flocal\u002Fflow_events_${TODAY}.jsonl\"\n```\n\n### List snapshots (72h TTL — older files may be purged)\n\nSnapshots are bucketed into `sensing_face\u002F` (presence), `sensing_motion_activity\u002F`, `sensing_emotion\u002F`. Recurse into subdirs:\n\n```bash\n# Most-recent snapshots across all categories\nfind \u002Fvar\u002Flib\u002Fhal\u002Fsnapshots -type f -name '*.jpg' -printf '%T@ %p\\n' | sort -rn | head -20 | cut -d' ' -f2-\n\n# Only a specific category\nls -lt \u002Fvar\u002Flib\u002Fhal\u002Fsnapshots\u002Fsensing_motion_activity\u002F | head -20\n```\n\n### Pose buckets (posture history)\n\nPosture snapshots are NOT in `\u002Fvar\u002Flib\u002Fhal\u002Fsnapshots\u002F` — they live in tmp under a per-window bucket layout at `\u002Ftmp\u002Fhal-sensing-snapshots\u002Fsensing_pose\u002Fbuckets\u002F\u003Cbucket_id>\u002F`. A bucket only exists when a tumbling window closed with bad posture (`bad_ratio >= POSE_BAD_RATIO`). Kept buckets survive ~2 days (`POSE_BUCKET_KEEP_S`); windows that didn't fire a nudge are deleted immediately, so the buckets you can see are by definition \"bad posture\" sessions.\n\nEach kept bucket contains:\n\n- `\u003Csample_ts>_\u003Cscore>.jpg` — annotated frame per sample (skeleton overlay + RULA score)\n- `bucket.json` — manifest:\n  - `bucket_id`, `window_start_ts`, `window_end_ts`, `kept: true`\n  - `summary` — same shape as the `[posture_summary:]` block on `motion.activity` (`bad_ratio`, `dominant_region`, `samples`, …)\n  - `samples[]` — `{ts, score, risk_level, filename, left, right}` (per-side RULA body_scores + angles)\n  - `worst_snapshots[]` — pre-selected worst filenames (the ones the device auto-attaches to `\u002Fdm` on posture nudges)\n\n```bash\n# List recent buckets (newest first)\nls -lt \u002Ftmp\u002Fhal-sensing-snapshots\u002Fsensing_pose\u002Fbuckets\u002F | head -10\n\n# Read a specific bucket's manifest\njq . \u002Ftmp\u002Fhal-sensing-snapshots\u002Fsensing_pose\u002Fbuckets\u002F1779259742\u002Fbucket.json\n\n# Buckets that closed in the last 2 hours\nfind \u002Ftmp\u002Fhal-sensing-snapshots\u002Fsensing_pose\u002Fbuckets -maxdepth 1 -type d -mmin -120 -name '[0-9]*' | sort\n\n# Worst-frame paths from the latest kept bucket\nLATEST=$(ls -t \u002Ftmp\u002Fhal-sensing-snapshots\u002Fsensing_pose\u002Fbuckets\u002F | head -1)\njq -r '.worst_snapshots[]' \"\u002Ftmp\u002Fhal-sensing-snapshots\u002Fsensing_pose\u002Fbuckets\u002F${LATEST}\u002Fbucket.json\" \\\n  | sed \"s|^|\u002Ftmp\u002Fhal-sensing-snapshots\u002Fsensing_pose\u002Fbuckets\u002F${LATEST}\u002F|\"\n\n# Today's bad-posture sessions — bucket id == window_start unix-seconds\nTODAY_START=$(date -d \"today 00:00\" +%s)\nfor b in \u002Ftmp\u002Fhal-sensing-snapshots\u002Fsensing_pose\u002Fbuckets\u002F*\u002Fbucket.json; do\n  jq --arg start \"$TODAY_START\" 'select((.window_start_ts | floor) >= ($start | tonumber)) | {bucket_id, dominant: .summary.dominant_region, bad_ratio: .summary.bad_ratio, started: .window_start_ts}' \"$b\"\ndone\n```\n\nNote: `motion.activity` event messages contain `[pose_bucket: \u003Cid>]` and `[pose_worst: \u003Cfn1>,\u003Cfn2>,...]` markers — parse these out of `data.message` when you need to map a sensing_input record to its bucket. Markers are present whenever a posture nudge folded in.\n\n---\n\n## Fallback: system log\n\nFor detailed debugging or when you need Go-side log context (errors, warnings, lifecycle details), fall back to `${OS_LOG:-\u002Fvar\u002Flog\u002Fos-server.log}`:\n\n```bash\nLOG=\"${OS_LOG:-\u002Fvar\u002Flog\u002Fos-server.log}\"\nsed 's\u002F\\x1b\\[[0-9;]*m\u002F\u002Fg' \"$LOG\" | grep \"sensing event received\"\n```\n\nThe system log uses lumberjack rotation (1 MB cap, 3 backups) — it may miss data during high traffic. Use it only when JSONL doesn't have enough detail, or when investigating bugs.\n\n---\n\n## Mood history\n\nA dedicated mood history log tracks **user mood** per user. Only the user's emotional state is logged — not system events or device emotions. Each user's mood data lives in their own directory.\n\n**Read API:**\n```bash\n# Current user's mood history (auto-detects who's present)\ncurl -s \"http:\u002F\u002F127.0.0.1:5000\u002Fapi\u002Fopenclaw\u002Fmood-history?date=$(date +%Y-%m-%d)&last=100\"\n\n# Specific user's mood history\ncurl -s \"http:\u002F\u002F127.0.0.1:5000\u002Fapi\u002Fopenclaw\u002Fmood-history?user=gray&date=$(date +%Y-%m-%d)&last=100\"\n```\n\n**Write:** Follow the **Mood** skill to log user mood from camera or conversation.\n\n```json\n{\"ts\":1776138500,\"seq\":1,\"hour\":10,\"mood\":\"happy\",\"source\":\"camera\",\"trigger\":\"laughing\"}\n{\"ts\":1776139200,\"seq\":2,\"hour\":10,\"mood\":\"stressed\",\"source\":\"conversation\",\"trigger\":\"user said feeling overwhelmed\"}\n```\n\nStorage: `\u002Froot\u002Flocal\u002Fusers\u002F{name}\u002Fmood\u002FYYYY-MM-DD.jsonl` (30-day retention).\n\n---\n\n## Rules\n\n- **Never write to any log file** — they are owned by the system.\n- **Answer conversationally** — translate results into natural language. Never dump raw JSON to the user.\n- **Handle empty results** — if no matching events, say \"I didn't detect any [type] events in that window.\"\n- **Mention dropped events when relevant** — check `exit` records with `data.error` for events the agent missed. Mention it: \"There was motion at 10:45 PM but I was mid-conversation and missed it.\"\n- **Resolve relative times** — translate \"last hour\", \"this morning\", \"while I was away\" into concrete Unix timestamps using `date -d` before filtering.\n- **Span multiple days** — for questions covering more than today, `cat` multiple JSONL files together.\n- **Parse the message field** for who\u002Fwhat details — `friend (gray)`, `friend (chloe)`, `stranger (stranger_1)`, `Large movement detected`, etc.\n- **Reference snapshots** — when the user asks \"what did you see?\", extract the `[snapshot: ...]` path from the message. Path format is `\u002Fvar\u002Flib\u002Fhal\u002Fsnapshots\u002Fsensing_\u003Cprefix>\u002F\u003Cms>.jpg` (category subdir per event kind). Snapshots have 72h TTL — check the file exists before referencing (`test -f \u003Cpath>`).\n- **Posture history** — for questions about the user's posture (\"how was I sitting this morning?\", \"show me my worst posture today\"), scan `\u002Ftmp\u002Fhal-sensing-snapshots\u002Fsensing_pose\u002Fbuckets\u002F`. Only sessions that crossed the bad-ratio threshold survive here, so the bucket list itself answers \"when did my posture get bad today?\". Read each bucket's `bucket.json` for `summary.dominant_region` and `summary.bad_ratio`, then reference `worst_snapshots[]` for representative frames.\n\n---\n\n## Examples\n\n**Input:** \"Have you seen anybody between 10pm and 12pm?\"\n**Action:** Query `data.type` in `[\"presence.enter\"]` between 22:00 and 00:00 from today's JSONL.\n**Response:** \"Yes — I detected a stranger at 10:03 PM and again at 10:07 PM.\" or \"No one came by between 10 PM and midnight.\"\n\n---\n\n**Input:** \"Is there any motion in the last hour?\"\n**Action:** Query `data.type` in `[\"motion\", \"motion.activity\"]` with `SINCE=$(date -d \"1 hour ago\" +%s)`.\n**Response:** \"Yes, I detected large movement 3 times — at 9:29, 9:59, and 10:12.\" or \"No motion in the last hour.\"\n\n---\n\n**Input:** \"What happened while I was away?\"\n**Action:** Ask the user when they left, or find the last `presence.leave` and query all events after that timestamp.\n**Response:** \"After around 3 PM — I saw motion at 4:30 PM and again at 5:15 PM. No one was identified though. I have snapshots from those moments if you want to see.\"\n\n---\n\n**Input:** \"How was my posture today?\"\n**Action:** List today's pose buckets and aggregate `summary.dominant_region` + `summary.bad_ratio` from each `bucket.json`.\n**Response:** \"You had 3 bad-posture sessions today: a neck-flexion one at 10:14 AM (77% bad), another neck stretch at 1:39 PM (100% bad), and one trunk lean at 3:20 PM (62% bad). The worst frames are in the bucket dirs if you want me to pull one up.\"\n","# Sensing Event History\n\n## Quick Start\n\nThe primary data source is the **flow events JSONL** at `\u002Froot\u002Flocal\u002Fflow_events_YYYY-MM-DD.jsonl`. Each file covers one calendar day (7-day retention, no size-rotation mid-day). Use Bash + `jq` to query it.\n\n> **Important:** Always use the absolute path `\u002Froot\u002Flocal\u002F` — the `read` tool cannot access files outside the workspace, so use `exec` (Bash) for all JSONL queries.\n\nPersistent camera snapshots are stored under `\u002Fvar\u002Flib\u002Fhal\u002Fsnapshots\u002Fsensing_\u003Cprefix>\u002F\u003Cms>.jpg` (72h TTL, 50 MB cap) — one subdir per event kind:\n\n| Event type | Folder |\n|---|---|\n| `presence.enter`, `presence.leave` | `sensing_face\u002F` |\n| `motion.activity` | `sensing_motion_activity\u002F` |\n| `emotion.detected` | `sensing_emotion\u002F` |\n\nReference these when the user asks what happened visually.\n\n## JSONL format\n\nEach line is a JSON object:\n\n```json\n{\"kind\":\"enter\",\"node\":\"sensing_input\",\"ts\":1712345678.123,\"seq\":42,\"trace_id\":\"run-abc\",\"data\":{\"type\":\"presence.enter\",\"message\":\"Person detected — 1 face(s) visible (friend (gray))\\n[snapshot: \u002Fvar\u002Flib\u002Fhal\u002Fsnapshots\u002Fsensing_face\u002F1712345678123.jpg]\"},\"version\":\"1.2.3\"}\n{\"kind\":\"exit\",\"node\":\"sensing_input\",\"ts\":1712345678.456,\"seq\":43,\"trace_id\":\"run-abc\",\"duration_ms\":332,\"data\":{\"path\":\"agent\",\"run_id\":\"run-abc\"},\"version\":\"1.2.3\"}\n```\n\nKey fields:\n- `node` — filter on `\"sensing_input\"` for sensing events\n- `kind` — `\"enter\"` = event received, `\"exit\"` = event processed (with `duration_ms`)\n- `data.type` — event type: `presence.enter`, `presence.leave`, `motion`, `motion.activity`, `sound`, `light.level`, `voice`, `voice_command`, `emotion.detected`, `speech_emotion.detected`\n- `data.message` — natural-language description; may contain `[snapshot: \u002Fvar\u002Flib\u002Fhal\u002Fsnapshots\u002Fsensing_\u003Cprefix>\u002F\u003Cms>.jpg]`\n- `data.path` — in `exit` records: `\"agent\"` (forwarded), `\"local\"` (handled locally), or has `\"error\"` key (failed\u002Fdropped)\n- `ts` — Unix timestamp (seconds with fractional ms)\n- `trace_id` — correlates enter\u002Fexit and links to agent turn\n\n## Tools\n\n**Bash** — `jq`, `cat`, date arithmetic. No writes.\n\n---\n\n## Query recipes\n\n### Timezone — always set before date arithmetic\n\n```bash\nexport TZ=$(cat \u002Fetc\u002Ftimezone)\n```\n\n### All sensing events in a time range\n\n```bash\nexport TZ=$(cat \u002Fetc\u002Ftimezone)\nDATE=\"$(date +%Y-%m-%d)\"\nFROM_TS=$(date -d \"$DATE 22:00:00\" +%s)\nTO_TS=$(date -d \"$DATE 23:59:59\" +%s)\njq -c 'select(.node==\"sensing_input\" and .kind==\"enter\" and .ts >= '\"$FROM_TS\"' and .ts \u003C= '\"$TO_TS\"')' \\\n  \"\u002Froot\u002Flocal\u002Fflow_events_${DATE}.jsonl\"\n```\n\n### Events of a specific type in the last N hours\n\nUse `\"motion\"` for raw motion, `\"motion.activity\"` for activity analysis (HAL-categorised — bucket names `drink`\u002F`break`\u002F`celebrate` and raw Kinetics sedentary labels like `using computer`, `writing`, `reading`). Most queries want both:\n\n```bash\nexport TZ=$(cat \u002Fetc\u002Ftimezone)\nSINCE=$(date -d \"1 hour ago\" +%s)\nTODAY=$(date +%Y-%m-%d)\njq -c 'select(.node==\"sensing_input\" and .kind==\"enter\" and .ts >= '\"$SINCE\"' and (.data.type==\"motion\" or .data.type==\"motion.activity\"))' \\\n  \"\u002Froot\u002Flocal\u002Fflow_events_${TODAY}.jsonl\"\n```\n\n### Any activity in the last N minutes\n\n```bash\nexport TZ=$(cat \u002Fetc\u002Ftimezone)\nSINCE=$(date -d \"30 minutes ago\" +%s)\nTODAY=$(date +%Y-%m-%d)\njq -c 'select(.node==\"sensing_input\" and .kind==\"enter\" and .ts >= '\"$SINCE\"')' \\\n  \"\u002Froot\u002Flocal\u002Fflow_events_${TODAY}.jsonl\"\n```\n\n### Presence events only (who came by)\n\nNames in messages are lowercase (`friend (gray)`). Use `test()` with `\"i\"` flag for case-insensitive search:\n\n```bash\nTODAY=$(date +%Y-%m-%d)\n# All presence events\njq -c 'select(.node==\"sensing_input\" and .kind==\"enter\" and (.data.type==\"presence.enter\" or .data.type==\"presence.leave\"))' \\\n  \"\u002Froot\u002Flocal\u002Fflow_events_${TODAY}.jsonl\"\n# Search for a specific person (case-insensitive)\njq -c 'select(.node==\"sensing_input\" and .kind==\"enter\" and .data.type==\"presence.enter\" and (.data.message | test(\"gray\";\"i\")))' \\\n  \"\u002Froot\u002Flocal\u002Fflow_events_${TODAY}.jsonl\"\n```\n\n### Events spanning multiple days\n\n```bash\nexport TZ=$(cat \u002Fetc\u002Ftimezone)\nYESTERDAY=$(date -d \"yesterday\" +%Y-%m-%d)\nTODAY=$(date +%Y-%m-%d)\ncat \"\u002Froot\u002Flocal\u002Fflow_events_${YESTERDAY}.jsonl\" \"\u002Froot\u002Flocal\u002Fflow_events_${TODAY}.jsonl\" \\\n  | jq -c 'select(.node==\"sensing_input\" and .kind==\"enter\" and .ts >= '\"$FROM_TS\"' and .ts \u003C= '\"$TO_TS\"')'\n```\n\n### Dropped events (agent was busy)\n\n```bash\nTODAY=$(date +%Y-%m-%d)\njq -c 'select(.node==\"sensing_input\" and .kind==\"exit\" and .data.error != null)' \\\n  \"\u002Froot\u002Flocal\u002Fflow_events_${TODAY}.jsonl\"\n```\n\n### List snapshots (72h TTL — older files may be purged)\n\nSnapshots are bucketed into `sensing_face\u002F` (presence), `sensing_motion_activity\u002F`, `sensing_emotion\u002F`. Recurse into subdirs:\n\n```bash\n# Most-recent snapshots across all categories\nfind \u002Fvar\u002Flib\u002Fhal\u002Fsnapshots -type f -name '*.jpg' -printf '%T@ %p\\n' | sort -rn | head -20 | cut -d' ' -f2-\n\n# Only a specific category\nls -lt \u002Fvar\u002Flib\u002Fhal\u002Fsnapshots\u002Fsensing_motion_activity\u002F | head -20\n```\n\n### Pose buckets (posture history)\n\nPosture snapshots are NOT in `\u002Fvar\u002Flib\u002Fhal\u002Fsnapshots\u002F` — they live in tmp under a per-window bucket layout at `\u002Ftmp\u002Fhal-sensing-snapshots\u002Fsensing_pose\u002Fbuckets\u002F\u003Cbucket_id>\u002F`. A bucket only exists when a tumbling window closed with bad posture (`bad_ratio >= POSE_BAD_RATIO`). Kept buckets survive ~2 days (`POSE_BUCKET_KEEP_S`); windows that didn't fire a nudge are deleted immediately, so the buckets you can see are by definition \"bad posture\" sessions.\n\nEach kept bucket contains:\n\n- `\u003Csample_ts>_\u003Cscore>.jpg` — annotated frame per sample (skeleton overlay + RULA score)\n- `bucket.json` — manifest:\n  - `bucket_id`, `window_start_ts`, `window_end_ts`, `kept: true`\n  - `summary` — same shape as the `[posture_summary:]` block on `motion.activity` (`bad_ratio`, `dominant_region`, `samples`, …)\n  - `samples[]` — `{ts, score, risk_level, filename, left, right}` (per-side RULA body_scores + angles)\n  - `worst_snapshots[]` — pre-selected worst filenames (the ones the device auto-attaches to `\u002Fdm` on posture nudges)\n\n```bash\n# List recent buckets (newest first)\nls -lt \u002Ftmp\u002Fhal-sensing-snapshots\u002Fsensing_pose\u002Fbuckets\u002F | head -10\n\n# Read a specific bucket's manifest\njq . \u002Ftmp\u002Fhal-sensing-snapshots\u002Fsensing_pose\u002Fbuckets\u002F1779259742\u002Fbucket.json\n\n# Buckets that closed in the last 2 hours\nfind \u002Ftmp\u002Fhal-sensing-snapshots\u002Fsensing_pose\u002Fbuckets -maxdepth 1 -type d -mmin -120 -name '[0-9]*' | sort\n\n# Worst-frame paths from the latest kept bucket\nLATEST=$(ls -t \u002Ftmp\u002Fhal-sensing-snapshots\u002Fsensing_pose\u002Fbuckets\u002F | head -1)\njq -r '.worst_snapshots[]' \"\u002Ftmp\u002Fhal-sensing-snapshots\u002Fsensing_pose\u002Fbuckets\u002F${LATEST}\u002Fbucket.json\" \\\n  | sed \"s|^|\u002Ftmp\u002Fhal-sensing-snapshots\u002Fsensing_pose\u002Fbuckets\u002F${LATEST}\u002F|\"\n\n# Today's bad-posture sessions — bucket id == window_start unix-seconds\nTODAY_START=$(date -d \"today 00:00\" +%s)\nfor b in \u002Ftmp\u002Fhal-sensing-snapshots\u002Fsensing_pose\u002Fbuckets\u002F*\u002Fbucket.json; do\n  jq --arg start \"$TODAY_START\" 'select((.window_start_ts | floor) >= ($start | tonumber)) | {bucket_id, dominant: .summary.dominant_region, bad_ratio: .summary.bad_ratio, started: .window_start_ts}' \"$b\"\ndone\n```\n\nNote: `motion.activity` event messages contain `[pose_bucket: \u003Cid>]` and `[pose_worst: \u003Cfn1>,\u003Cfn2>,...]` markers — parse these out of `data.message` when you need to map a sensing_input record to its bucket. Markers are present whenever a posture nudge folded in.\n\n---\n\n## Fallback: system log\n\nFor detailed debugging or when you need Go-side log context (errors, warnings, lifecycle details), fall back to `${OS_LOG:-\u002Fvar\u002Flog\u002Fos-server.log}`:\n\n```bash\nLOG=\"${OS_LOG:-\u002Fvar\u002Flog\u002Fos-server.log}\"\nsed 's\u002F\\x1b\\[[0-9;]*m\u002F\u002Fg' \"$LOG\" | grep \"sensing event received\"\n```\n\nThe system log uses lumberjack rotation (1 MB cap, 3 backups) — it may miss data during high traffic. Use it only when JSONL doesn't have enough detail, or when investigating bugs.\n\n---\n\n## Mood history\n\nA dedicated mood history log tracks **user mood** per user. Only the user's emotional state is logged — not system events or device emotions. Each user's mood data lives in their own directory.\n\n**Read API:**\n```bash\n# Current user's mood history (auto-detects who's present)\ncurl -s \"http:\u002F\u002F127.0.0.1:5000\u002Fapi\u002Fopenclaw\u002Fmood-history?date=$(date +%Y-%m-%d)&last=100\"\n\n# Specific user's mood history\ncurl -s \"http:\u002F\u002F127.0.0.1:5000\u002Fapi\u002Fopenclaw\u002Fmood-history?user=gray&date=$(date +%Y-%m-%d)&last=100\"\n```\n\n**Write:** Follow the **Mood** skill to log user mood from camera or conversation.\n\n```json\n{\"ts\":1776138500,\"seq\":1,\"hour\":10,\"mood\":\"happy\",\"source\":\"camera\",\"trigger\":\"laughing\"}\n{\"ts\":1776139200,\"seq\":2,\"hour\":10,\"mood\":\"stressed\",\"source\":\"conversation\",\"trigger\":\"user said feeling overwhelmed\"}\n```\n\nStorage: `\u002Froot\u002Flocal\u002Fusers\u002F{name}\u002Fmood\u002FYYYY-MM-DD.jsonl` (30-day retention).\n\n---\n\n## Rules\n\n- **Never write to any log file** — they are owned by the system.\n- **Answer conversationally** — translate results into natural language. Never dump raw JSON to the user.\n- **Handle empty results** — if no matching events, say \"I didn't detect any [type] events in that window.\"\n- **Mention dropped events when relevant** — check `exit` records with `data.error` for events the agent missed. Mention it: \"There was motion at 10:45 PM but I was mid-conversation and missed it.\"\n- **Resolve relative times** — translate \"last hour\", \"this morning\", \"while I was away\" into concrete Unix timestamps using `date -d` before filtering.\n- **Span multiple days** — for questions covering more than today, `cat` multiple JSONL files together.\n- **Parse the message field** for who\u002Fwhat details — `friend (gray)`, `friend (chloe)`, `stranger (stranger_1)`, `Large movement detected`, etc.\n- **Reference snapshots** — when the user asks \"what did you see?\", extract the `[snapshot: ...]` path from the message. Path format is `\u002Fvar\u002Flib\u002Fhal\u002Fsnapshots\u002Fsensing_\u003Cprefix>\u002F\u003Cms>.jpg` (category subdir per event kind). Snapshots have 72h TTL — check the file exists before referencing (`test -f \u003Cpath>`).\n- **Posture history** — for questions about the user's posture (\"how was I sitting this morning?\", \"show me my worst posture today\"), scan `\u002Ftmp\u002Fhal-sensing-snapshots\u002Fsensing_pose\u002Fbuckets\u002F`. Only sessions that crossed the bad-ratio threshold survive here, so the bucket list itself answers \"when did my posture get bad today?\". Read each bucket's `bucket.json` for `summary.dominant_region` and `summary.bad_ratio`, then reference `worst_snapshots[]` for representative frames.\n\n---\n\n## Examples\n\n**Input:** \"Have you seen anybody between 10pm and 12pm?\"\n**Action:** Query `data.type` in `[\"presence.enter\"]` between 22:00 and 00:00 from today's JSONL.\n**Response:** \"Yes — I detected a stranger at 10:03 PM and again at 10:07 PM.\" or \"No one came by between 10 PM and midnight.\"\n\n---\n\n**Input:** \"Is there any motion in the last hour?\"\n**Action:** Query `data.type` in `[\"motion\", \"motion.activity\"]` with `SINCE=$(date -d \"1 hour ago\" +%s)`.\n**Response:** \"Yes, I detected large movement 3 times — at 9:29, 9:59, and 10:12.\" or \"No motion in the last hour.\"\n\n---\n\n**Input:** \"What happened while I was away?\"\n**Action:** Ask the user when they left, or find the last `presence.leave` and query all events after that timestamp.\n**Response:** \"After around 3 PM — I saw motion at 4:30 PM and again at 5:15 PM. No one was identified though. I have snapshots from those moments if you want to see.\"\n\n---\n\n**Input:** \"How was my posture today?\"\n**Action:** List today's pose buckets and aggregate `summary.dominant_region` + `summary.bad_ratio` from each `bucket.json`.\n**Response:** \"You had 3 bad-posture sessions today: a neck-flexion one at 10:14 AM (77% bad), another neck stretch at 1:39 PM (100% bad), and one trunk lean at 3:20 PM (62% bad). The worst frames are in the bucket dirs if you want me to pull one up.\"\n",{"name":5,"description":7},"main","d69096e239f2a89aabc2cd078c47664a9d3b1e11","06-前端与设计\u002Fsensing-track",3,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts","https:\u002F\u002Fgithub.com\u002Flza6","个人vx：Tf00798\r\n个人✈：@TFGY999","2026-10-08 14:29:22",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add lza6\u002FArmor-piercing-system-prompts --skill sensing-track",{"tool":38,"command":39},"bunx","bunx skills add lza6\u002FArmor-piercing-system-prompts --skill sensing-track",{"tool":41,"command":42},"pnpm","pnpm dlx skills add lza6\u002FArmor-piercing-system-prompts --skill sensing-track","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F06-前端与设计\u002Fsensing-track\u002FSKILL.md",true,[46],{"path":47,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":50,"sourceHtmlUrl":51},"skill.json","REFERENCE","参考文档",69,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F06-前端与设计\u002Fsensing-track\u002Fskill.json",[53,60,65,72,79,86],{"skillNo":54,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":57,"categories":58,"keywords":59,"publishedAt":19},"01M7FFG485KY83TD6HSC4YPCMC","obsidian-clipper-template-creator","Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator\u002FSKILL.md",[],[],{"skillNo":61,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":62,"categories":63,"keywords":64,"publishedAt":19},"01M7FFG0T6AZ0STEJPSB3CX84K","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator-antigravity-awesome-skills-main\u002FSKILL.md",[],[],{"skillNo":66,"name":67,"nameZh":6,"description":68,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":19},"01M7FFFY0QEM14SKWPDYGMXM2P","python-api","Programmatic Object-Detection-Metrics API guidance for BoundingBox, BoundingBoxes, Evaluator, enums, coordinate conversion, AP\u002FmAP semantics, and source-style import diagnostics.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Fpython-api\u002FSKILL.md",[],[],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":19},"01M7FFFVZQZ2GJ0C0TGP7JHD20","file-evaluation","Folder-based PASCAL VOC AP\u002FmAP evaluation from ground-truth and detection text files.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Ffile-evaluation\u002FSKILL.md",[],[],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":19},"01M7FFFSFNYSE77SJ6PE1CK2DA","object-detection-metrics","Guides legacy Object-Detection-Metrics PASCAL VOC AP\u002FmAP evaluation from detection text folders and direct Python API classes.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":19},"01M7FFFP0GCK1RVXBCPQ8APBMT","nx-workspace-patterns","Configure and optimize Nx monorepo workspaces. Use when setting up Nx, configuring project boundaries, optimizing build caching, or implementing affected commands.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fnx-workspace-patterns\u002FSKILL.md",[],[]]