Skip to content

bandulix/clawdrill

Repository files navigation

ClawDrill

A OpenClaw plugin that turns any group chat into a Strava fitness competition. ClawDrill acts as a charismatic coach — tracking active minutes, running a live leaderboard, and trash-talking the bottom of the pack with love.

Features

  • Auto-created agent — installs itself as a clawdrill agent on first gateway start
  • Group leaderboard — ranks members by active minutes in the last 7 days (from Strava)
  • Auto-sync — refreshes Strava data in the background when it goes stale
  • Secure token storage — Strava OAuth2 tokens are encrypted at rest with AES-256-GCM
  • Editable persona — change the coach's voice without touching any code

Requirements

Installation

openclaw plugins install /path/to/clawdrill

For local development, use --link so OpenClaw references the folder directly instead of copying it:

openclaw plugins install --link /path/to/clawdrill

First-time setup

Step 1 — Create a Strava app (once, by the bot owner)

  1. Go to https://www.strava.com/settings/api and create an application
  2. Note your Client ID and Client Secret

Step 2 — Configure ClawDrill in chat

Send the credentials to the ClawDrill agent in chat:

Set up Strava: client ID is 12345, client secret is abc...xyz

The first person to do this becomes the admin — their sender ID is stored and only they can update the credentials later. No config file editing needed.

Step 3 — Each competitor connects their Strava account

Each user completes the Strava OAuth flow to get their personal refresh_token, then shares it in chat:

Connect my Strava: abc...xyz

ClawDrill calls clawdrill_connect_strava and immediately syncs their activities.

Customization

Coach persona

Edit persona/coach.txt to change the coach's personality, rules, and tone. Plain text — no code required. Restart the gateway to apply changes.

Settings

Edit clawdrill.config.ts:

Setting Default Description
STALE_THRESHOLD_MINUTES 30 How long before Strava data is re-synced automatically
PERSONA_FILE ./persona/coach.txt Path to the coach persona file

Project structure

clawdrill/
├── index.ts                # Plugin entry point — hooks and tools
├── clawdrill.config.ts     # User-editable settings
├── persona/
│   └── coach.txt           # Coach personality (edit freely)
└── src/
    ├── crypto.ts           # AES-256-GCM token encryption
    ├── storage.ts          # Data model and file I/O
    ├── strava.ts           # Strava OAuth2 and activities API
    └── leaderboard.ts      # Leaderboard logic and formatting

Available tools

Tool Description
clawdrill_setup Save Strava app credentials — first caller becomes admin, only they can change them later
clawdrill_save_name Save a member's display name
clawdrill_connect_strava Connect a Strava account via refresh token
clawdrill_sync_activities Manually refresh Strava data (me or all)

Security

  • Strava tokens and the app client secret are encrypted with AES-256-GCM before being written to disk
  • The encryption key is stored at {stateDir}/clawdrill/.key with 0o600 permissions
  • Credentials are entered via chat and never stored in config files
  • Group data files are written with 0o600 permissions via OpenClaw's atomic file writer

License

MIT

About

A OpenClaw plugin that turns any group chat into a Strava fitness competition.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors