Preface

In environments like Cursor and Claude Code, users often casually ask things like “I haven’t been sleeping well lately” or “How can I improve my sleep?” Generic conversations tend to produce vague advice and lack a fixed intake sequence, output structure, and safety boundaries (for example, not recommending medications and advising medical care for persistent insomnia). If you want an Agent to follow the same process to collect sleep data, analyze the problem type, and provide actionable routine and environmental recommendations, you can install the community Skill “Sleep Optimizer” (@user_70c2f807/sleep-optimizer) from SkillHub into your client’s skills directory. When the model detects a sleep-related intent, it will automatically follow the steps and constraints in SKILL.md.

What This Is

“Sleep Optimizer” is an Agent Skill designed for life-service scenarios. Its coordinates are @user_70c2f807/sleep-optimizer, version 1.0.0, source community, and it is maintained by the publisher user_70c2f807. The Skill’s tags indicate requires_api_key=false, meaning it does not depend on an external API key.

Positioning (per the official SKILL.md): Help users record sleep data, analyze potential influencing factors such as daily routine, diet, environment, and stress, and generate personalized improvement plans. It covers common issues such as difficulty falling asleep, light sleep, daytime sleepiness, and irregular sleep schedules. It explicitly is not intended for treating sleep disorders, recommending sleeping pills, or providing medical diagnosis.

SkillHub page: https://www.skillhub.cn/skills/user_70c2f807/sleep-optimizer
API metadata URL: https://api.skillhub.cn/user_70c2f807/sleep-optimizer

Core Features

All capabilities below come from the installed SKILL.md (v1.0.0) and are executed by the Agent during conversations:

  1. Current-state intake: bedtime/wake time, sleep onset latency, number of nighttime awakenings, daytime energy level, and possible influencing factors.
  2. Problem classification: distinguish difficulty falling asleep, difficulty staying asleep, and early morning awakening; evaluate whether total sleep duration is sufficient, sleep continuity, and daytime alertness.
  3. Plan output: targeted strategies, a pre-sleep routine, sleep environment adjustments (temperature/light/sound), schedule adjustments (including weekends and napping guidance), and sleep-onset techniques (e.g., 4-7-8 breathing, body scan).
  4. Tracking and trends: maintain records and analysis based on user descriptions or wearable data (cannot auto-monitor; requires user input).
  5. Boundaries and exception handling: ask follow-up questions when information is insufficient; recommend seeking medical care for severe or persistent insomnia; refuse to recommend sleeping pills or sleep supplements; emphasize that habit changes typically take 2–4 weeks to show effects.

Example trigger keywords: 睡眠, 失眠, 睡不好, sleep optimization, insomnia, sleep quality, and cases where the user explicitly requests sleep improvement.

Installation and Enablement

Below is how to install it via the SkillHub CLI into a directory recognized by the current Agent. Installation instructions follow https://skillhub.cn/install/skillhub.md.

1. Check or install the skillhub CLI

command -v skillhub && skillhub --version

If it is not installed, you can run the full installation (CLI + default Skills):

curl -fsSL https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/install.sh | bash

2. Install Sleep Optimizer

You must use --dir to point to the skills directory of the current environment; otherwise, it defaults to ./skills/, which may not be loaded by the client.

skillhub install sleep-optimizer --namespace user_70c2f807 --dir ~/.cursor/skills/

Other common paths (listed in the same documentation; replace --dir according to your client):

  • Claude Code: ~/.claude/skills/
  • Codex: ~/.codex/skills/ or .agents/skills/ under the project
  • Gemini CLI: ~/.gemini/skills/

You can also ask the AI in-chat to install @user_70c2f807/sleep-optimizer following the prompts on the SkillHub page and referencing https://skillhub.cn/install/skillhub.md.

After successful installation, the package contains SKILL.md (main instructions) and _meta.json (metadata such as slug and version). After modifying the skills directory, restart or refresh the Agent as required by your client so the new Skill takes effect.

Typical Usage

The Skill is triggered via natural language and requires no separate command. The quick-start examples in the official SKILL.md can be reproduced directly:

User: I haven’t been sleeping well lately
→ Agent follows the Skill to ask: difficulty falling asleep vs. waking easily, approximate sleep duration, etc.

User: I went to bed at midnight last night, woke up at 7, and woke up twice during the night
→ Record the data, evaluate quality, and provide analysis

User: How can I improve my sleep?
→ Output a personalized improvement plan based on the problem type

User: I always overthink and can’t fall asleep
→ Analyze the cause of sleep-onset difficulty and recommend relaxation techniques

User: Is it helpful to catch up on sleep on weekends?
→ Explain pros/cons and provide schedule guidance

The execution flow is fixed in the Skill as three steps: understand the current sleep situation → analyze the problem (duration/quality/type/cause) → formulate a plan (strategies, pre-sleep routine, environment, schedule). The output should include a sleep data table, multi-dimensional status descriptions, a list of influencing factors, and segmented improvement recommendations. If there is no improvement after about 4 weeks, the Skill requires clearly recommending medical care.

Use Cases and Cautions

Suitable for: when you want the Agent to use a unified approach to collect sleep information, classify problem types, and provide non-medical lifestyle recommendations; when users are willing to actively describe or provide wearable device data; when you need to emphasize habit formation such as a fixed wake time, disconnecting before bed, and using the bed only for sleep.

Not suitable for (explicitly stated by the Skill): diagnosis of sleep disorders; recommending sleeping pills or supplements; suspected sleep apnea (requires professional monitoring); insomnia caused by severe anxiety/depression (should seek psychological therapy/medical care).

Other limitations:

  • It cannot replace a doctor; severe or persistent insomnia lasting more than about 4 weeks should be evaluated medically.
  • Improvement depends on the user consistently tracking and following recommendations; expectations of short-term “quick results” should be adjusted upfront.
  • SkillHub’s scraped metadata shows: category life-service, rating 100000, 1075 downloads (page statistics may change; SkillHub is authoritative).

If skillhub install returns a 404 due to an incorrect slug, include --namespace user_70c2f807, consistent with the install prompt shown in search results.

Closing

“Sleep Optimizer” encodes sleep-related intake, analysis, plan output, and safety red lines into SKILL.md, making it suitable as a life-service Skill for clients that support Agent Skills, such as Cursor. For installation and details, see SkillHub: https://www.skillhub.cn/skills/user_70c2f807/sleep-optimizer , metadata API: https://api.skillhub.cn/user_70c2f807/sleep-optimizer .