I want to create a skill I can use to pull my Whoop data. I want to be able to get a view of my sleep, recovery and strain daily for the past.
How would you go about building that? What do you need from me?
Assistant
Great idea. Let me first look at how skills are structured in your setup so I can give you an accurate plan.
Assistant
Let me check the notion skill as a pattern reference since it makes API calls with auth.
Assistant
Let me get the Whoop API details.
Assistant
Let me fetch the actual API documentation.
User
stop
Assistant
Got it. I have enough to lay out the plan.
Here's how I'd build a whoop skill and exactly what I need from you.
User
Let's try the perplexity_search again
Assistant
Still failing — same undefined is not an object (evaluating 'sources.length') error on both sonar and sonar-pro. That's an internal error in the Perplexity tool's response handling (it's getting back something malformed, not a real search result), not something we can fix by rephrasing the query.
Want me to try a different approach to get the Whoop API specifics — e.g. I can fetch the relevant docs pages directly via curl from developer.whoop.com/docs/... and parse them? The pages themselves were returning redirects earlier, but I can chase the redirect targets. Or if you have the Whoop dev dashboard open, you could paste the base URLs / endpoints you see there and I'll build from those.
User
Try again
Assistant
That worked this time. Now I have the full picture. Here's the concrete plan.
Scopes: offline read:recovery read:cycles read:sleep (and read:profile is nice-to-have). offline is required to get a refresh token.
(all need ):
The shape of the skill
code
skills/whoop/
├── SKILL.md # frontmatter + instructions for the agent
├── scripts/
│ ├── auth.sh # OAuth2 token exchange + refresh
│ └── fetch.sh # pulls sleep/recovery/strain for a date range
└── references/
└── endpoints.md # endpoint reference for the agent
The hard part is authentication. Whoop uses OAuth2 with an authorization-code flow (not simple client credentials). That means a one-time browser consent → you get an authorization code → exchange it for an access_token + refresh_token, then the script refreshes the access token automatically thereafter. Tokens get stored locally (e.g. ~/.config/whoop-skill/tokens.json, chmod 600).
The fetch.sh (or .py) script would hit the three endpoints you care about:
GET /v2/recovery (with start/end query params)
GET /v2/activity/sleep / /v2/cycle/sleep
GET /v2/cycle (strain)
…and render a compact daily table: date | sleep score / duration | recovery % | strain.
a redirect URI (set it to http://localhost:8484/callback — I'll run a tiny local server to capture the auth code)
Share those two values with me (or tell me you'd rather I read them from an env var / a local file you drop them into). Best approach: put them in ~/.config/whoop-skill/credentials.json (I'll create the file + chmod 600, you paste the values), and the scripts read from there so nothing is hardcoded.
Confirm scope. Just "daily sleep, recovery, strain for the past N days" — do you want a fixed lookback (e.g. last 14/30 days) or an argument like whoop 7? I'll default to "last 7 days, overridable by an argument."
Output format preference — plain terminal table, or also write a Markdown file somewhere (the way weekly-planning does)? I'd suggest both: print the table and save notes/whoop-YYYY-MM-DD.md.
Once you've created the app and given me the client id/secret (or pointed me at where you'll put them), I'll build the whole skill end to end and run the first auth flow with you.
Want me to go ahead and scaffold the skill files now with the credentials read from ~/.config/whoop-skill/credentials.json so it's ready the moment you drop the values in?
Data endpoints
Authorization: Bearer <token>
Recovery: GET /developer/v1/recovery?start=&end=
Sleep: GET /developer/v1/activity/sleep?start=&end=
Strain (daily): GET /developer/v1/cycle?start=&end=
All support start/end (ISO 8601) + pagination via nextToken.
What the skill will do
scripts/auth.sh — runs a tiny local HTTP server on localhost:8484, opens the browser for consent, captures the code, exchanges it for tokens, saves to ~/.config/whoop-skill/tokens.json (chmod 600). One-time run.
scripts/fetch.py — loads tokens, refreshes if expired, calls the 3 endpoints for a date range, prints a daily table: