Foreword¶
If you leave the question “What should I do about insomnia?” to a general large language model, the answers tend to be scattered: jumping between sleep schedules and relaxation techniques, rarely following the rhythm of Cognitive Behavioral Therapy for Insomnia (CBT-I) to inquire about sleep windows, sleep efficiency, and stimulus control. To stably follow the line of Assessment → Quantification → Strategy → Weekly Plan in a conversation, a protocol written into SKILL.md is required, rather than a makeshift prompt.
Below is an introduction to the SkillHub community skill @user_70c2f807/insomnia-cbt (Chinese name: “Insomnia Cognitive Behavior”, version 1.0.0). It solidifies the self-help process of CBT-I into executable steps and output templates for Agents. It is suitable for integration in life service scenarios and is marked requires_api_key=false, meaning it does not depend on additional API keys.
What is this¶
One-sentence positioning: When users discuss topics such as insomnia, sleeplessness, CBT-I, sleep restriction, difficulty falling asleep, or early awakening, this skill provides structured self-help plans based on CBT-I principles (sleep restriction, stimulus control, cognitive restructuring, sleep hygiene, and a 4–6 week plan).
Maintenance and Source: SkillHub Category life-service, Source community, Publisher user_70c2f807. The page coordinate is @user_70c2f807/insomnia-cbt.
Explicitly Not Covering: Diagnosis of sleep disorders, sleeping pill prescriptions, sleep apnea, and other situations requiring medical intervention; the skill uses NOT for to clarify boundaries internally.
Core Functions¶
The following capabilities are derived from the SKILL.md description of this Skill. Upon installation, the Agent will follow them when matching trigger words.
- Insomnia Pattern Assessment: Distinguishes between difficulty falling asleep, difficulty maintaining sleep, and early awakening; collects bed/wake times, estimates actual sleep duration, and surveys existing coping mechanisms and medication usage.
- Sleep Efficiency Calculation: Sleep Efficiency = (Actual Sleep Time / Time in Bed) × 100%. Uses >85% as a reference for adjustment and sets the initial sleep window accordingly.
- Four CBT-I Strategies: Sleep restriction (fixed window and wake time), Stimulus control (including rules like “if you can’t sleep for about 20 minutes, leave the bed”), Cognitive restructuring for sleep anxiety, and a sleep hygiene checklist.
- Progressive Adjustment: Evaluates efficiency weekly; expands the window if efficiency continuously meets targets, and tightens it if efficiency is low; recommends a minimum cycle of 4 weeks before re-evaluation.
- Safety and Referral Prompts: Provides referral or medical advice for scenarios involving snoring with daytime sleepiness, self-discontinuation of medication, or severe anxiety; declares that it does not store user sleep data or provide diagnoses.
The skill also defines a unified output skeleton (Insomnia Type, Current Efficiency, Sleep Window, Explanation of Three Core Strategies, Hygiene Checklist, and Weekly Plan Table) to facilitate user execution and comparison across multiple turns of conversation.
Installation and Activation¶
The installation method provided on the SkillHub page is: instruct the Agent to read the SkillHub Installation Documentation and install @user_70c2f807/insomnia-cbt.
1. Install SkillHub CLI (if not already installed)¶
command -v skillhub && skillhub --version
If not installed, you can execute the official script (complete installation includes default Skills):
curl -fsSL https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/install.sh | bash
2. Install this Skill to the current Agent’s skills directory¶
When installing, you must use --dir to point to the skills directory recognized by your current client; otherwise, it defaults to ./skills/ and may not be loaded.
skillhub install @user_70c2f807/insomnia-cbt --dir ~/.cursor/skills/
Other common paths (from official installation documentation, select one based on the client you are actually using):
- Claude Code:
~/.claude/skills/ - Codex:
~/.codex/skills/or.agents/skills/under the project - Gemini CLI:
~/.gemini/skills/
After installation is complete, restart or refresh the skill list according to the requirements of your client so that the SKILL.md is read by the Agent.
Typical Usage¶
The skill provides trigger scenarios and conversation examples in its SKILL.md, which can be directly reproduced in environments like Cursor.
| User Statement | Agent Expectation |
|---|---|
| My insomnia is severe, what should I do? | First understand the insomnia pattern, then introduce core CBT-I strategies |
| What is sleep restriction? | Explain the principles and guide the calculation of personal sleep window |
| Tossing and turning in bed | Apply stimulus control (including leaving bed and returning when sleepy) |
| Always worried about not sleeping | Cognitive restructuring, challenging catastrophic sleep beliefs |
| Help me make a plan to improve sleep | Output a ~4-week CBT-I self-help plan |
The execution process is broken down into four steps within the skill: Assess insomnia pattern → Calculate sleep efficiency and initial window → Implement sleep restriction/stimulus control/cognitive restructuring/hygiene → Evaluate weekly and adjust window. The output emphasizes a fixed wake time, a window no less than approx. 5 hours, and 15-minute adjustment rules when efficiency is above/below thresholds.
Applicable Scenarios and Notes¶
Who is it for
- Teams that need to provide “non-pharmacological, evidence-based” insomnia self-help conversations within Agent products, rather than one-off popular science.
- Teams that want outputs containing sleep efficiency, sleep windows, and weekly plan tables for users to check off against.
Limitations and Pitfalls
- Time to effect: The skill description states CBT-I usually requires 2–6 weeks for stable improvement; sleep restriction may cause more sleepiness initially, which needs to be explained in advance during conversation.
- Medical boundaries: Situations like apnea, bipolar manic episodes, and epilepsy are not suitable for self-administered sleep restriction; those currently using sleeping pills should not stop medication on their own.
- Execution granularity: The skill suggests avoiding overwhelming users with all strategies at once; introduce one item at a time. It also reminds users not to rely on daytime naps to “make up” for nighttime sleep.
- Platform Data: The SkillHub page shows a rating of 100,000 and approx. 827 downloads (community statistics, subject to change over time);
requires_api_key=falseindicates no additional Key configuration items.
Conclusion¶
“Insomnia Cognitive Behavior” writes CBT-I assessment, quantitative metrics, and three core strategies into a standard Skill format, allowing Agents to have a structured approach when insomnia-related topics arise, while using NOT for and error handling tables to clarify the boundaries regarding medical and psychological crises. To install or view metadata, please open the SkillHub skill page: https://www.skillhub.cn/skills/user_70c2f807/insomnia-cbt .