[feat] Capture implicit first-agent intent - #5086
Conversation
Instead of asking in a survey what a user wants to build, record their first real onboarding action. Fire a first_agent_intent PostHog event from template picks (home cards, playground quick-pick, template gallery), composer free-text submits (message plus a coarse keyword bucket as the first_agent_intent_v1 person property), and browse/skip actions as intent-avoidance signals. Capture at the specific UI call sites rather than the shared create-agent choke point, so a template-seeded builder message fires once as a template intent and never double-counts as a composer submit. Analytics are fire-and-forget and never block onboarding. Claude-Session: https://claude.ai/code/session_01AuS2c7XQhyECUGg3afeZQ9
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Context
We want to know what a new user wants their first agent to do, without adding another survey screen. Every screen before the product costs activation, and the survey answers only ever go to PostHog. The more useful signal is the user's first real action in onboarding.
Changes
A new
first_agent_intentPostHog event fires from onboarding actions the user already takes:template, tagged with the template name and mode.composer, with the message (truncated to 500 chars) and a coarse keyword bucket (support / research / ops / content / coding / data / other) written as thefirst_agent_intent_v1person property.Instrumentation sits at the specific UI call sites rather than the shared create-agent path, so a template-seeded builder message fires once as a template intent and never double-counts as a composer submit. All captures are fire-and-forget and never block or throw into onboarding.
Scope / risk
Analytics only. No onboarding behavior or UX changes. One new helper file plus event calls in agent-home. Independent of the survey and legacy-removal PRs (disjoint files).
Tests / notes
pnpm lint-fixgreen;types:checkshows no new errors.How to QA
Prerequisites: Dev stack with
NEXT_PUBLIC_POSTHOG_API_KEYset, agent-home onboarding visible.Steps:
/appsonboarding, click a template.Expected result: PostHog receives
first_agent_intentevents with sourcetemplate,composer(carrying the message and afirst_agent_intent_v1bucket person property), andbrowse_templates. A template pick does not also emit a composer event.Edge cases: Pick a template that seeds a builder message, then confirm only one event fires (source
template, notcomposer).Automated tests: None (analytics). Verified manually plus lint and types.
https://claude.ai/code/session_01AuS2c7XQhyECUGg3afeZQ9