Analyze and Improve Sleep Patterns
Scores sleep quality and consistency, flags insomnia and apnea risk, and correlates sleep with lifestyle factors.
Why it matters
Gain deep insights into your sleep health by analyzing sleep data, identifying patterns, and receiving personalized recommendations for improvement.
Outcomes
What it gets done
Analyze sleep duration, efficiency, and consistency trends.
Assess sleep quality and identify key influencing factors.
Detect potential sleep issues like insomnia or apnea risk.
Generate personalized advice for sleep hygiene and lifestyle adjustments.
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/ag-sleep-analyzer | bash Overview
Sleep Analyzer Skill
A personal sleep data analyzer that scores sleep quality and schedule consistency, screens for insomnia and apnea risk via STOP-BANG, and correlates sleep with exercise, caffeine, mood, and chronic-disease data. Use to review sleep trends, get a quality or consistency score, or check correlations with lifestyle factors - route persistent insomnia or a STOP-BANG score of 3+ to a sleep specialist.
What it does
Sleep Analyzer analyzes sleep data, identifies sleep patterns, evaluates sleep quality, and produces personalized sleep-improvement recommendations. It has five functional modules: sleep trend analysis (duration, efficiency, bedtime/wake-time patterns, a sleep-consistency score, and weekday-vs-weekend social jetlag); sleep quality assessment (PSQI score tracking, subjective quality distribution, nighttime-awakening analysis, sleep-stage proportions, and morning recovery feeling); sleep problem identification (insomnia patterns like onset latency over 30 minutes, maintenance difficulty, early waking, and mixed insomnia; sleep apnea risk via the STOP-BANG questionnaire; and irregular-schedule detection, sleep debt, and social jetlag); correlation analysis linking sleep to exercise, caffeine and diet, mood, and chronic disease; and personalized recommendation generation covering bedtime adjustments, pre-sleep routine design, sleep-environment optimization, lifestyle changes, and CBT-I elements such as stimulus control, sleep restriction, and cognitive restructuring.
When to use - and when NOT to
Use this when analyzing sleep duration, efficiency, schedule regularity, or sleep quality, when the task involves insomnia patterns, nighttime awakening, PSQI scoring, or sleep-problem identification, or when correlating sleep with mood, exercise, or other health factors. It carries an explicit medical safety boundary. What it can do: analyze sleep data and patterns, identify sleep-problem risk, provide sleep-hygiene advice, and assess correlations with other health metrics. What it explicitly cannot do: diagnose conditions like insomnia or sleep apnea, prescribe sleep medication or treatment, replace professional sleep medicine care, or manage a severe sleep disorder. Medical consultation is flagged for insomnia lasting over 3 months, a STOP-BANG score of 3 or higher, severe daytime sleepiness affecting driving safety, or a sudden serious sleep problem.
Inputs and outputs
Reads a main sleep-tracker file plus daily sleep logs, correlating against fitness, hypertension, diabetes, diet, and mood-tracker data where available. The sleep quality score weights duration at 30% (10 points for 7-9 hours, tapering for shorter or longer), efficiency at 25%, sleep-onset latency at 20% (10 points at 15 minutes or under), nighttime awakenings at 15% (deducting 2 points per awakening), and subjective quality at 10%. A separate sleep-consistency score (0-100) starts at 100 and deducts for bedtime standard deviation, wake-time standard deviation, sleep-duration standard deviation, and the weekday-vs-weekend duration gap. Correlation analysis uses the Pearson coefficient, with an optional lag-day parameter for delayed effects, classifying strength as weak (below 0.3), moderate (0.3-0.7), or strong (above 0.7), and flags statistical significance at p<0.05. The output report includes a sleep quality summary, trend charts, an efficiency and consistency breakdown, a nighttime-awakening cause breakdown, PSQI sub-component changes, insomnia and STOP-BANG assessments, per-factor correlation findings with actual coefficients, and a prioritized, time-boxed action plan with specific target metrics for sleep duration, efficiency, PSQI, and consistency.
Integrations
A worked example in the source correlates sleep against exercise (workday vs rest-day duration and time-of-day effects, illustrated with a moderate positive r=0.42), caffeine intake (a moderate negative r=-0.38 for post-2pm caffeine), and mood (a strong bidirectional r=0.65 between sleep quality and next-day mood). It references public standards: AASM sleep scoring standards, the PSQI questionnaire, the STOP-BANG questionnaire, and CBT-I treatment literature.
Who it's for
Users tracking their own sleep who want trend analysis, a quality score, insomnia and apnea-risk screening, correlation with lifestyle factors, and a concrete, prioritized improvement plan, while being routed to a sleep specialist for anything resembling a diagnosable disorder rather than attempting to diagnose or treat it directly.
FAQ
Common questions
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.