agentleFS
Itsokay-coItsokay-co/bio-vibing/skills/pull/SKILL.md

pull

Skill17 starsChanged 9 months agoApache-2.0View on GitHub

Pull wearable biometric data for analysis. Use when the user wants to see their sleep, HRV, readiness, heart rate, temperature, activity, or stress data. Arguments: number of days (default 14). Currently supports Oura Ring, Whoop, Fitbit, and Apple Health.

6 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Files
SKILL.md

Pull

Fetch wearable biometric data and present human-readable insights.

Arguments

  • First argument: number of days to pull (default: 14)

Steps

  1. Fetch and analyze biometric data:
DAYS=${1:-14}
python3 << PYEOF
import sys, os
sys.path.insert(0, os.path.join(os.environ.get('CLAUDE_PLUGIN_ROOT', '.'), 'lib'))
from fetch import fetch_biometrics
from statistics import mean

DAYS = int("$DAYS")
data = fetch_biometrics(days=DAYS)

print(f"Pulling {DAYS} days from {data['provider']}: {data['period_start']} to {data['period_end']}")

# --- SLEEP ---
sleep = [s for s in data['sleep'] if s.get('sleep_type') == 'long_sleep'] or data['sleep']
if sleep:
    scores = [s['score'] for s in sleep if s.get('score')]
    deep = [s['deep_sleep_seconds']/60 for s in sleep if s.get('deep_sleep_seconds')]
    rem = [s['rem_sleep_seconds']/60 for s in sleep if s.get('rem_sleep_seconds')]
    light = [s['light_sleep_seconds']/60 for s in sleep if s.get('light_sleep_seconds')]
    total = [s['total_sleep_seconds']/60 for s in sleep if s.get('total_sleep_seconds')]
    efficiency = [s['efficiency'] for s in sleep if s.get('efficiency')]
    hrv = [s['avg_hrv_ms'] for s in sleep if s.get('avg_hrv_ms')]
    hr = [s['avg_resting_hr_bpm'] for s in sleep if s.get('avg_resting_hr_bpm')]

    def fmt(vals, unit=''):
        if not vals: return 'N/A'
        avg = mean(vals)
        return f'{avg:.1f}{unit} avg (range {min(vals):.1f}-{max(vals):.1f})'

    print(f'\nSLEEP ({len(sleep)} nights)')
    if scores: print(f'  Score: {mean(scores):.0f} avg (range {min(scores)}-{max(scores)})')
    if total: print(f'  Total sleep: {fmt(total, " min")}')
    if deep: print(f'  Deep: {fmt(deep, " min")}')
    if rem: print(f'  REM: {fmt(rem, " min")}')
    if light: print(f'  Light: {fmt(light, " min")}')
    if efficiency: print(f'  Efficiency: {fmt(efficiency, "%")}')
    if hrv: print(f'  Avg HRV: {fmt(hrv, " ms")}')
    if hr: print(f'  Avg resting HR: {fmt(hr, " bpm")}')

    scored = [s for s in sleep if s.get('score')]
    if scored:
        best = max(scored, key=lambda s: s['score'])
        worst = min(scored, key=lambda s: s['score'])
        print(f'  Best night: {best["day"]} (score {best["score"]})')
        print(f'  Worst night: {worst["day"]} (score {worst["score"]})')
else:
    print('\nNo sleep data found.')

# --- READINESS ---
readiness = data['readiness']
if readiness:
    scores = [r['score'] for r in readiness if r.get('score')]
    if scores:
        print(f'\nREADINESS ({len(readiness)} days)')
        print(f'  Score: {mean(scores):.0f} avg (range {min(scores)}-{max(scores)})')
        best = max(readiness, key=lambda r: r.get('score', 0))
        worst = min(readiness, key=lambda r: r.get('score', 0))
        print(f'  Best day: {best["day"]} (score {best.get("score", "N/A")})')
        print(f'  Worst day: {worst["day"]} (score {worst.get("score", "N/A")})')

        # Contributors
        for key, label in [
            ('temp_deviation_c', 'Temp Deviation'),
            ('hrv_balance_score', 'HRV Balance'),
            ('recovery_index_score', 'Recovery Index'),
            ('sleep_balance_score', 'Sleep Balance'),
            ('activity_balance_score', 'Activity Balance'),
        ]:
            vals = [r[key] for r in readiness if r.get(key) is not None]
            if vals:
                print(f'  {label}: {mean(vals):.0f} avg')

# --- ACTIVITY ---
activity = data['activity']
if activity:
    scores = [a['score'] for a in activity if a.get('score')]
    steps = [a['steps'] for a in activity if a.get('steps')]
    cals = [a['total_calories'] for a in activity if a.get('total_calories')]

    print(f'\nACTIVITY ({len(activity)} days)')
    if scores: print(f'  Score: {mean(scores):.0f} avg (range {min(scores)}-{max(scores)})')
    if steps: print(f'  Steps: {mean(steps):.0f} avg/day (range {min(steps)}-{max(steps)})')
    if cals: print(f'  Calories: {mean(cals):.0f} avg/day')

# --- STRESS ---
stress = data['stress']
if stress:
    stress_high = [s['stress_high_minutes'] for s in stress if s.get('stress_high_minutes') is not None]
    recovery = [s['recovery_high_minutes'] for s in stress if s.get('recovery_high_minutes') is not None]

    print(f'\nSTRESS ({len(stress)} days)')
    if stress_high: print(f'  High stress minutes: {mean(stress_high):.0f} avg/day')
    if recovery: print(f'  Recovery minutes: {mean(recovery):.0f} avg/day')

# --- BODY COMPOSITION ---
body_comp = data.get('body_composition', [])
if body_comp:
    latest = body_comp[-1]
    parts = []
    if latest.get('weight_kg'): parts.append(f"{latest['weight_kg']:.1f}kg")
    if latest.get('body_fat_pct'): parts.append(f"{latest['body_fat_pct']:.1f}% body fat")
    if latest.get('bmi'): parts.append(f"BMI {latest['bmi']:.1f}")
    if parts:
        print(f'\nBODY COMPOSITION')
        print(f'  Latest: {", ".join(parts)}')

# --- RESPIRATION ---
respiration = data.get('respiration', [])
if respiration:
    resp_vals = [r['avg_respiratory_rate'] for r in respiration if r.get('avg_respiratory_rate')]
    if resp_vals:
        print(f'\nRESPIRATION ({len(respiration)} days)')
        print(f'  Avg respiratory rate: {mean(resp_vals):.1f} brpm')

PYEOF

Output Format

Present results grouped by category with trend arrows:

  • Up arrow (trending up from first half to second half of period)
  • Down arrow (trending down)
  • Flat (within 5% change)

End with a one-line summary: "Your [best metric] is strong. [Worst metric] needs attention."

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.