Skip to content
Back to skills

Presence Duration

ASecurity

统计在家时长。当用户询问在家多久、在家时间、停留时间时使用。

  • 97 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 8, 2026
tools

Security analysis

A100/100

Scanned November 8, 2026

npx -y skills add ahang1598/doubao-workbuddy-qwenwork-skills --skill presence-duration --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Presence Duration?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Presence Duration
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ahang1598-presence-duration/badge)](https://www.skillsdirectory.com/skills/ahang1598-presence-duration)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: presence-duration
description: "统计在家时长。当用户询问在家多久、在家时间、停留时间时使用。"
---

# 在家时长统计

## 功能说明

根据门锁记录,统计家庭成员今日或指定日期的在家时长。

## 统计逻辑

### 计算方法

1. **单次在家时长**:出门时间 - 进门时间
2. **总在家时长**:所有单次在家时长的总和
3. **当前连续在家时长**:当前时间 - 最近一次进门时间(如尚未出门)

### 数据要求

- 需要完整的进门和出门记录配对
- 门锁需支持记录操作方向(从内/从外开门)
- 或需要关门记录来辅助判断

## 使用流程

1. 查询指定日期的门锁历史记录
2. 提取指定成员的进门和出门记录
3. 按时间顺序配对进门和出门记录
4. 计算每次在家的时长
5. 汇总总在家时长
6. 返回统计结果

## 回复格式

### 统计今日在家时长
```
张三今日在家时长统计:
- 08:30 - 12:15:在家3小时45分钟
- 13:00 - 18:10:在家5小时10分钟
- 今日总在家时长:8小时55分钟
```

### 当前连续在家时长
```
张三当前已连续在家2小时30分钟。
(于14:30进门,尚未出门)
```

### 数据不足时
```
根据现有数据,无法准确统计在家时长。

原因:
- 门锁记录不完整,缺少出门记录
- 无法准确判断出门时间

建议:
- 确保门锁正常记录所有操作
```

## 注意事项

1. **数据完整性**:说明统计基于的记录是否完整
2. **时间范围**:明确说明统计的时间范围
3. **计算说明**:解释在此时长的计算方法
4. **当前状态**:如成员当前在家,说明已连续在家时长

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in tools →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.