agentleFS
shashankswe2020-uxshashankswe2020-ux/whoop-mcp/.github/copilot-instructions.md

whoop-mcp

Copilot instructions165 starsChanged 8 months agoMITView on GitHub

An MCP server wrapping the WHOOP REST API for AI assistant access to health/fitness data.

The file

We split this copilot-instructions.md into the rules it gives an agent

9 rules. About 0 are common, 7 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    Write tests before code (TDD)

    line 31
  2. Distinctive:

    Test hierarchy: unit > integration > e2e (use the lowest level that captures the behavior)

    line 33
  3. Very specific:

    Run npm test after every change

    line 36
  4. Distinctive:

    Every PR must pass: lint, type check, tests, build

    line 40
  5. Distinctive:

    No secrets in code or version control

    line 41
  6. Distinctive:

    Never mix formatting changes with behavior changes

    line 46
  7. Distinctive:

    All 10 tasks complete (scaffold, types, token store, API client, OAuth, MCP server shell, tool implementations, error handling, entry point …

    line 56
  8. Distinctive:

    Always: Run tests before commits, validate input with Zod, store tokens securely (0600)

    line 63
  9. Very specific:

    Never: Commit secrets, remove failing tests, skip verification, use any, hit real WHOOP API in tests

    line 65

≈ “Common” is an estimate: at least 1 in 5 of the 1,644 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
copilot-instructions.md

Project: whoop-mcp

An MCP server wrapping the WHOOP REST API for AI assistant access to health/fitness data.

Tech Stack

  • TypeScript ~5.x (strict, no any), Node.js >= 18, native fetch
  • @modelcontextprotocol/sdk, Zod, Vitest, ESLint, Prettier
  • Build: tsc — no bundler. No runtime deps beyond SDK + Zod.

Commands

npm run build       # Build TypeScript
npm test            # Run tests (Vitest)
npm run lint        # ESLint
npm run lint:fix    # ESLint + fix
npm run format      # Prettier
npm run typecheck   # tsc --noEmit
npm run dev         # Dev mode (tsx)

Code Conventions

  • Files: kebab-case.ts | Types: PascalCase | Functions: camelCase | Constants: SCREAMING_SNAKE_CASE
  • MCP tool names: snake_case (MCP convention)
  • Named exports only (no default exports)
  • Explicit return types on all exported functions
  • One tool per file — handler + Zod schema co-located
  • Errors throw typed errors, never return error codes
  • Tests mirror src/ structure in tests/ directory

Testing

  • Write tests before code (TDD)
  • For bugs: write a failing test first, then fix (Prove-It pattern)
  • Test hierarchy: unit > integration > e2e (use the lowest level that captures the behavior)
  • Mock the WHOOP API — never hit real API in tests. Use vi.fn() for fetch.
  • Coverage target: >80% on src/auth/ and src/api/, >70% overall
  • Run npm test after every change

Code Quality

  • Review across five axes: correctness, readability, architecture, security, performance
  • Every PR must pass: lint, type check, tests, build
  • No secrets in code or version control

Implementation

  • Build in small, verifiable increments
  • Each increment: implement → test → verify → commit
  • Never mix formatting changes with behavior changes

Key References

  • Spec: docs/specs/whoop-mcp-server.md
  • Implementation plan: docs/specs/implementation-plan.md
  • Code review: docs/reviews/code-review-checkpoint-1.md (Tasks 1–5 approved)
  • WHOOP API base: https://api.prod.whoop.com/developer (v2 endpoints)
  • OAuth: Authorization Code flow, tokens at ~/.whoop-mcp/tokens.json (0600 perms)

Implementation Status

  • All 10 tasks complete (scaffold, types, token store, API client, OAuth, MCP server shell, tool implementations, error handling, entry point + CLI, docs + publish prep)
  • 212 tests passing, typecheck clean, build clean, lint clean
  • ✅ MCP Inspector integration tested 2026-04-12 — OAuth flow, get_profile tool returning real data
  • ✅ Claude Desktop integration tested 2026-04-12 — server connected, OAuth completed, tools accessible
  • ✅ Published to npm 2026-04-12 — whoop-ai-mcp@0.1.0 at https://www.npmjs.com/package/whoop-ai-mcp

Boundaries

  • Always: Run tests before commits, validate input with Zod, store tokens securely (0600)
  • Ask first: New runtime dependencies, token storage changes, new API endpoints, OAuth flow changes
  • Never: Commit secrets, remove failing tests, skip verification, use any, hit real WHOOP API in tests

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.