Gamified AI-adoption leaderboard

Automatically measures AI-assistant usage with no effort from staff and turns it into friendly recognition through a leaderboard and chat highlights, with company-only sign-in and role-protected data.

Problem

A company rolling out AI coding assistants across several departments had no visibility into who was using them or how much, and no light-touch way to encourage adoption. Asking staff to self-report would not have worked.

Goal

Automatically measure AI-assistant usage with zero effort from staff, and turn it into friendly, visible recognition through a leaderboard and chat highlights, with sign-in restricted to the company and data protected by role.

My role

Sole engineer. I conceived the concept and the gamification design, and built the workstation hook and installer, the backend, the dashboard, the chat bot and the deploy tooling.

Solution

A zero-touch telemetry and gamification pipeline: a session-end hook on each workstation, an authenticated serverless API, a document database guarded by security rules, a static real-time dashboard and a scheduled chat bot.

How it works

A cross-platform installer sets up a dependency-free Python hook and runs a one-time installed-app OAuth sign-in through a local callback. The resulting refresh token is stored with owner-only file permissions.

When each coding session ends, the hook reads the local session logs for token usage by model and posts a submission with an ID token. Failed posts go to a retry queue, and an import mode brings in earlier history.

A cloud function verifies the token and the company domain and writes the per-session record. Then, inside one transaction so concurrent submissions cannot corrupt totals, it updates the user's totals and tier; advances, resets or keeps the streak using the user's own local calendar date, validated on the server so a streak never breaks at midnight UTC; and only then evaluates badges, so a streak badge fires on the day it is earned. Imported history counts toward totals and tiers but never toward streaks, so importing old sessions cannot fake consistency.

A trigger on each new user sends a welcome card to the team chat.

A static dashboard reads the database directly under role-based security rules: personal stats and progress, team standings, achievements and an admin tab.

A scheduled script posts daily and weekly leaderboard cards and rotating tips.

A deploy script pulls configuration from a secret manager, injects it into placeholders, deploys and restores the placeholders, and a guard run before each deploy fails it if a placeholder or a real value would end up in the wrong place.

Technical challenges

Zero-effort collection on macOS, Windows and Linux with no extra dependencies.

Desktop sign-in for a command-line hook without a browser session to lean on.

Consistent totals, streaks and badges under concurrent submissions.

Fair streaks across time zones, and a history import that cannot inflate streaks.

Ordering badge evaluation after state changes inside one transaction.

A static dashboard that reads the database directly while each person sees only what their role allows.

Capabilities

  • Automatic usage capture per session and per model
  • Company-restricted sign-in
  • Tiers, streaks and badges
  • Personal and team dashboards
  • Admin view
  • Chat welcome cards and daily and weekly highlights
  • Import of earlier history
  • Retry queue for failed submissions

Technology

  • Python standard library
  • OAuth 2.0 installed-app flow with a local callback
  • Serverless backend platform
  • Cloud functions and a document database
  • Hosting and authentication
  • Node.js
  • Database security rules
  • JavaScript with no framework
  • HTML and CSS
  • Cloud scripting platform for scheduled chat posts
  • Chat cards and webhooks
  • Shell deploy tooling with a secret manager

Impact

Automatic visibility of AI-tool adoption with no manual reporting, turned into a visible, friendly team game. No usage figures are claimed.

Skills demonstrated

  • Full-stack serverless development
  • Authentication for desktop tools
  • Data modelling and security rules
  • Transactional consistency
  • Gamification and product design
  • Developer-experience tooling
  • Secret handling in deployment

Demo

Live demo

An invented company with three teams and nine people. End a coding session on any laptop and watch it travel from the hook to the API, the database, the dashboard and the team chat, then see tiers, streaks counted by each person’s own local day, badges and team standings change. Try a guest account the API refuses, a laptop that is offline and queues its sessions, two sessions arriving at once, an import of earlier history that never counts toward a streak, and the bot’s welcome card and daily and weekly highlights.

Try the demo

A demo here uses only invented names and data.

Have a similar project?

Currently engaged; open to select remote AI automation projects (UTC+8).

Describe it in a short message on the contact page.

Describe your project

All work