sleep-need-guide

Provides suggested sleep-duration ranges and routine tips based mainly on age, combined with height, weight, and daily activity level. Suitable for user questions such as “how long should I sleep,” “how to adjust routine for insomnia,” and “sleep duration for children or elderly.” Recommendations are for reference only and do not constitute medical diagnosis.

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "sleep-need-guide" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-4b97e83ea832cce2b667f04f8c32ee38103f984462667df717d0037be08db6da. Verify the upstream source and version against https://skillhub.cn/skills/user_f1b049da/dfo20265797 before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

skillhub.cn

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Provides suggested sleep-duration ranges and routine tips based mainly on age, combined with height, weight, and daily activity level. Suitable for user questions such as “how long should I sleep,” “how to adjust routine for insomnia,” and “sleep duration for children or elderly.” Recommendations are for reference only and do not constitute medical diagnosis.

0 Downloads

Introduction source: third_party · user_f1b049da · 1.0.0 Reference

SkillPi interpretation

Tasks
Translation pending; see source documentation.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: sleep-need-guide
slug: dfo20265797
displayName: 睡眠需求评估
version: 1.0.0
summary: 按年龄为主、结合身高体重活动等因素,给出建议睡眠时长区间与作息提示。
license: MIT
description: 按年龄为主、结合身高体重活动等因素,给出建议睡眠时长区间与作息提示。当用户问该睡多久、失眠作息、小孩老人睡眠时长时使用。非医疗诊断。

睡眠需求评估

原创科普试算:以年龄段建议睡眠时长(对齐常见公共卫生建议量级)为主,再按活动量、班次、妊娠、咖啡因等做小幅调整说明;身高/体重用于粗算 BMI 与恢复负荷提示,身高本身不是睡眠小时数的强决定因素。

非诊疗;持续失眠、呼吸暂停嫌疑、儿童发育问题请就医。

何时使用

  • 「我这个年龄该睡多久」
  • 「小孩/老人睡眠时间」
  • 「上夜班怎么补觉」

硬约束

  1. 主输入必填:年龄(或年龄段)。身高、体重、活动等为可选修正。
  2. 输出必须是区间小时(如 7–9),附「可能合适 / 偏少需观察」口径,禁止断言精确到 0.1 小时的「科学定值」。
  3. 调整规则写清:单因子修正一般 ≤±1 小时,多因子叠加后仍夹在年龄硬上下限内(见下表)。
  4. 身高单独出现时说明:无体重则仅作体型描述,不因身高加减睡眠;有体重则算 BMI 提示。
  5. 文末免责 + 就医红线(白天嗜睡、打鼾憋气、儿童突然大幅变少睡等)。

年龄基准(小时/天)

年龄段 key 建议区间
0–3 月 newborn 14–17
4–11 月 infant 12–15
1–2 岁 toddler 11–14
3–5 岁 preschool 10–13
6–12 岁 school 9–12
13–17 岁 teen 8–10
18–64 岁 adult 7–9
≥65 岁 older 7–8

(量级参考美国国家睡眠基金会等常见公开建议;表述为「参考区间」。)

修正因子(说明型,非诊断)

因子 处理
高强度运动日 / 体力劳动 可向区间上限靠,提示恢复
久坐极少活动 不自动减睡;提示作息与日间光照
BMI≥28(粗算) 不直接加小时;提示关注睡眠呼吸问题就医
孕期 可能更需睡眠与午睡,区间内偏上 + 就医咨询
夜班/轮班 给「锚点睡眠 + 短午睡」策略,不单改总时长数字
咖啡因下午后仍摄入 提示推迟入睡风险,不改基准表
身高 仅辅助描述;有体重才算 BMI

推荐实现要点

export type AgeBand =
  | 'newborn' | 'infant' | 'toddler' | 'preschool'
  | 'school' | 'teen' | 'adult' | 'older'

export const SLEEP_BANDS: Record<AgeBand, { label: string; min: number; max: number }> = {
  newborn: { label: '0–3月', min: 14, max: 17 },
  infant: { label: '4–11月', min: 12, max: 15 },
  toddler: { label: '1–2岁', min: 11, max: 14 },
  preschool: { label: '3–5岁', min: 10, max: 13 },
  school: { label: '6–12岁', min: 9, max: 12 },
  teen: { label: '13–17岁', min: 8, max: 10 },
  adult: { label: '18–64岁', min: 7, max: 9 },
  older: { label: '65岁及以上', min: 7, max: 8 },
}

export function ageToBand(ageYears: number): AgeBand {
  if (ageYears < 0.25) return 'newborn'
  if (ageYears < 1) return 'infant'
  if (ageYears < 3) return 'toddler'
  if (ageYears < 6) return 'preschool'
  if (ageYears < 13) return 'school'
  if (ageYears < 18) return 'teen'
  if (ageYears < 65) return 'adult'
  return 'older'
}

export function bmi(heightCm?: number, weightKg?: number): number | null {
  if (!heightCm || !weightKg || heightCm <= 0) return null
  const m = heightCm / 100
  return +(weightKg / (m * m)).toFixed(1)
}

export function suggestSleep(input: {
  ageYears: number
  heightCm?: number
  weightKg?: number
  activity?: 'low' | 'normal' | 'high'
  shiftWork?: boolean
  pregnant?: boolean
}) {
  const band = ageToBand(input.ageYears)
  const base = SLEEP_BANDS[band]
  const tips: string[] = []
  let lean: 'low' | 'mid' | 'high' = 'mid'

  if (input.activity === 'high') {
    lean = 'high'
    tips.push('活动量大时,可优先接近建议区间上限,并保证固定起床点。')
  }
  if (input.pregnant) {
    lean = 'high'
    tips.push('孕期困倦常见,可在医生指导下增加夜间睡眠或短午睡。')
  }
  if (input.shiftWork) {
    tips.push('轮班重在「24小时内总睡眠」与遮光、固定核心睡眠段,而非只盯晚上。')
  }
  const body = bmi(input.heightCm, input.weightKg)
  if (body != null && body >= 28) {
    tips.push('BMI 偏高时若打鼾/白天嗜睡,建议排查睡眠呼吸问题(就医)。')
  }
  if (input.heightCm && input.weightKg == null) {
    tips.push('仅提供身高时不据此加减睡眠小时;补充体重可粗算 BMI 提示。')
  }

  const target =
    lean === 'high' ? [base.min + 0.5, base.max] :
    lean === 'low' ? [base.min, base.max - 0.5] :
    [base.min, base.max]

  return {
    band: base.label,
    hours: target as [number, number],
    bmi: body,
    tips,
    disclaimer: '参考区间,因人而异;持续睡眠障碍请咨询医疗机构。',
  }
}

Agent 执行步骤

  1. 询问年龄;可选身高、体重、活动、是否轮班/孕期。
  2. 输出:建议小时区间、所属年龄段、修正说明、3 条作息建议(固定起床、咖啡因截止、午休上限)。
  3. 出现红线症状 → 明确建议就医,不给药物方案。

附加

Current listing version

1.0.0

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value78/100

Highlights

  • 覆盖多年龄段与特殊场景(轮班、孕期、BMI 提示),实用性强
  • 提供可操作的作息建议与就医红线,非简单套壳工具
Trigger Precision88/100

Highlights

  • 触发描述清晰完整,覆盖常见用户问题变体
  • 边界明确,不易与其他健康类 Skill 混淆
Structure and Standards92/100

Highlights

  • 结构清晰,含硬约束、基准表、修正因子与实现示例
  • frontmatter 完整,步骤与出口条件明确
Execution Reliability86/100

Areas to improve

  • 引用文件缺失 Reported severity: Minor

    SKILL.md 引用了 README.md、reference.md、templates/usage.md 但未传入

    Recommendation: 建议补充引用文件或移除引用链接

  • description 重复 Reported severity: Minor

    frontmatter 与 skill_body 均含 description,存在冗余

    Recommendation: 保留一处即可,避免重复

Highlights

  • 逻辑健壮,BMI 计算防异常,输出为安全区间
  • 含就医红线与免责声明,规避医疗风险
Evidence Verifiability (mean of the first four)86/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These common operations were not identified in the main document. This does not mean no permissions or risks exist.

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.