From 83bfc7f88d74de7ab7f8406db5c7aa7847b4f73c Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Mon, 16 Mar 2026 02:44:59 -0500 Subject: [PATCH] feat: add /setup-team-dashboard skill, post-ship leaderboard callout Interactive 8-step setup skill for deploying dashboard + edge functions. Post-ship callout shows team leaderboard after successful sync. Co-Authored-By: Claude Opus 4.6 (1M context) --- setup-team-dashboard/SKILL.md | 118 ++++++++++++++++++++++++++++++++++ ship/SKILL.md.tmpl | 6 ++ 2 files changed, 124 insertions(+) create mode 100644 setup-team-dashboard/SKILL.md diff --git a/setup-team-dashboard/SKILL.md b/setup-team-dashboard/SKILL.md new file mode 100644 index 00000000..a7089561 --- /dev/null +++ b/setup-team-dashboard/SKILL.md @@ -0,0 +1,118 @@ +# /setup-team-dashboard + +Interactive setup for the gstack team dashboard, regression alerts, and weekly digest. + +**Prerequisites:** +- Supabase project created (https://app.supabase.com) +- GitHub OAuth configured in Supabase Auth settings +- `gstack sync setup` completed (team sync working) + +## Steps + +### Step 1: Check Supabase CLI + +```bash +which supabase || echo "NOT_INSTALLED" +``` + +If NOT_INSTALLED, tell the user: +``` +Install the Supabase CLI: + brew install supabase/tap/supabase +``` +Wait for confirmation before continuing. + +### Step 2: Link project + +Ask the user for their Supabase project ref (found in project settings or URL). + +```bash +cd +supabase link --project-ref +``` + +If already linked, skip. + +### Step 3: Run migrations + +```bash +supabase db push +``` + +This creates the `team_settings`, `alert_cooldowns` tables and `create_team()` RPC function. + +### Step 4: Deploy edge functions + +Deploy all 3 edge functions: + +```bash +supabase functions deploy dashboard --no-verify-jwt +supabase functions deploy regression-alert +supabase functions deploy weekly-digest +``` + +Note: `dashboard` uses `--no-verify-jwt` because it serves a public HTML page (auth happens client-side). + +### Step 5: Set up database webhook for regression alerts + +Tell the user to go to Supabase Dashboard > Database > Webhooks and create: +- **Name:** regression-alert +- **Table:** eval_runs +- **Events:** INSERT +- **Type:** Supabase Edge Function +- **Function:** regression-alert + +### Step 6: Set up pg_cron for weekly digest + +Tell the user to enable the `pg_cron` extension in Supabase Dashboard > Database > Extensions. + +Then run in the SQL editor: +```sql +select cron.schedule( + 'weekly-digest', + '0 9 * * 1', -- Every Monday at 9am UTC + $$ + select net.http_post( + url := '/functions/v1/weekly-digest', + headers := '{"Authorization": "Bearer "}'::jsonb, + body := '{}'::jsonb + ); + $$ +); +``` + +Replace `` and `` with actual values. + +### Step 7: Configure Slack webhook + +Ask the user for their Slack webhook URL (from https://api.slack.com/messaging/webhooks). + +```bash +gstack team set slack-webhook +gstack team set digest-enabled true +``` + +### Step 8: Verify + +Open the dashboard URL: +``` +https://.supabase.co/functions/v1/dashboard +``` + +Expected: login page with "Sign in with GitHub" button. After login, dashboard shows team data. + +Test regression alert: +```bash +# Push a test eval with low pass rate to trigger alert +gstack eval push +``` + +Check Slack channel for the regression alert. + +## Troubleshooting + +- **"Function not found"**: Re-run `supabase functions deploy ` +- **OAuth redirect fails**: Check that `.supabase.co/functions/v1/dashboard` is in your Supabase Auth redirect URLs +- **No data on dashboard**: Run `gstack sync pull` to verify data exists, then check browser console for errors +- **Regression alert not firing**: Check Database > Webhooks in Supabase dashboard, verify the webhook is active +- **Weekly digest not sending**: Check Extensions > pg_cron is enabled, verify the cron schedule in SQL editor diff --git a/ship/SKILL.md.tmpl b/ship/SKILL.md.tmpl index 7ebf12f2..4e0682a9 100644 --- a/ship/SKILL.md.tmpl +++ b/ship/SKILL.md.tmpl @@ -425,6 +425,12 @@ Substitute actual values from the preceding steps. Use `0` for Greptile fields i ~/.claude/skills/gstack/bin/gstack-sync push-transcript 2>/dev/null || true ``` +3. Leaderboard callout (non-fatal): After sync, show the user their position on the team leaderboard this week: +```bash +~/.claude/skills/gstack/bin/gstack-eval leaderboard 2>/dev/null | head -15 || true +``` +If leaderboard data is available, print the table. If sync is not configured or no data exists, silently skip. + --- ## Important Rules