Skip to content

[feat] Capture implicit first-agent intent - #5086

Merged
mmabrouk merged 1 commit into
big-agentsfrom
feat/onboarding-intent-analytics
Jul 6, 2026
Merged

[feat] Capture implicit first-agent intent#5086
mmabrouk merged 1 commit into
big-agentsfrom
feat/onboarding-intent-analytics

Conversation

@mmabrouk

@mmabrouk mmabrouk commented Jul 6, 2026

Copy link
Copy Markdown
Member

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_intent PostHog event fires from onboarding actions the user already takes:

  • Template pick (home cards, playground quick-pick, template gallery): source template, tagged with the template name and mode.
  • Composer free-text submit: source composer, with the message (truncated to 500 chars) and a coarse keyword bucket (support / research / ops / content / coding / data / other) written as the first_agent_intent_v1 person property.
  • Browse-templates and skip actions: recorded as intent-avoidance signals with no person-property write.

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-fix green; types:check shows no new errors.
  • Local dev has no PostHog key, so events no-op locally. Verify in an env with the key set.

How to QA

Prerequisites: Dev stack with NEXT_PUBLIC_POSTHOG_API_KEY set, agent-home onboarding visible.

Steps:

  1. On the /apps onboarding, click a template.
  2. Separately, type a description in the composer and create an agent.
  3. Click "Browse all" / browse templates.

Expected result: PostHog receives first_agent_intent events with source template, composer (carrying the message and a first_agent_intent_v1 bucket person property), and browse_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, not composer).

Automated tests: None (analytics). Verified manually plus lint and types.

https://claude.ai/code/session_01AuS2c7XQhyECUGg3afeZQ9

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
@vercel

vercel Bot commented Jul 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agenta-documentation Ready Ready Preview, Comment Jul 6, 2026 4:15pm

Request Review

@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. feature request New feature or request frontend labels Jul 6, 2026
@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 7a103dc5-5736-4979-8c60-0141b5054ad1

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • ✅ Review completed - (🔄 Check again to review again)
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/onboarding-intent-analytics

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature request New feature or request frontend size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant