feat(docs): add Slack reporting for interesting docs bot prompts#1091
Open
sarinali wants to merge 3 commits intotrycua:mainfrom
Open
feat(docs): add Slack reporting for interesting docs bot prompts#1091sarinali wants to merge 3 commits intotrycua:mainfrom
sarinali wants to merge 3 commits intotrycua:mainfrom
Conversation
Analyze each user prompt with Haiku to score on actionability, traction signal, and use case insight. Post interesting prompts (score >= 7/10) to a Slack channel via incoming webhook. - prompt-analyzer.ts: Haiku classification, threshold filtering - slack-reporter.ts: Slack Block Kit formatting, webhook posting - route.ts: fire-and-forget async hook, hoisted categorization - .env.example: added SLACK_WEBHOOK_URL - typescript-typecheck.js: fix lockfile restore to prevent pre-commit "files were modified" false failure Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one) (1)
Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing touches🧪 Generate unit tests (beta)
Comment |
Contributor
|
@sarinali is attempting to deploy a commit to the Cua Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Replace the inline fire-and-forget approach with a Vercel cron job that queries PostHog as a derived data source. This decouples prompt reporting from the request path and makes the data source swappable. - Revert inline hook from copilotkit route.ts - Refactor prompt-analyzer.ts for batch analysis (one Haiku call) - Refactor slack-reporter.ts for batch digest format - Add posthog-query.ts to fetch events via PostHog API - Add cron route at /api/cron/prompt-digest (hourly) - Add vercel.json with cron schedule - Add POSTHOG_PERSONAL_API_KEY, POSTHOG_PROJECT_ID, CRON_SECRET to .env.example Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Auto-derive API host from NEXT_PUBLIC_POSTHOG_HOST by stripping the ingestion subdomain (eu.i. → eu., us.i. → us.) - Add ?hours=N query param to cron endpoint for testing - Add debug logging for PostHog query URL and error bodies Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Changes
docs/src/lib/prompt-analyzer.ts— Haiku classification call with threshold filteringdocs/src/lib/slack-reporter.ts— Slack Block Kit message formatting and webhook postingdocs/src/app/api/copilotkit/route.ts— async hook after PostHog capture, hoisted categorizationdocs/.env.example— addedSLACK_WEBHOOK_URLscripts/typescript-typecheck.js— restore lockfile after install to fix pre-commitTest plan
SLACK_WEBHOOK_URLenv var in Vercel/localSLACK_WEBHOOK_URLis unset🤖 Generated with Claude Code