Skip to content

feat: promote programs via post-install "Recommended next" screen#668

Draft
sarahxsanders wants to merge 1 commit into
mainfrom
posthog-code/recommended-next-discoverability
Draft

feat: promote programs via post-install "Recommended next" screen#668
sarahxsanders wants to merge 1 commit into
mainfrom
posthog-code/recommended-next-discoverability

Conversation

@sarahxsanders

Copy link
Copy Markdown
Collaborator

Summary

Keeps the main wizard flow install-only and surfaces other programs (revenue analytics today; data-warehouse / LLM-analytics next) as discoverable follow-ups once install succeeds. No flow or UI overhaul — this is the interim, modular discoverability layer agreed in Slack while the new TUI / orchestrator is sidelined for self-driving product.

Per Edwin's steer: keep programs separate, just add discoverability now; merge into the orchestrator later.

How it works

  • ProgramConfig.promotable metadata — a program opts into promotion by declaring its detection feature, label, and description in one registry entry. The screen holds no product knowledge; it just iterates the registry.
  • promotable.ts — the producer side: given what the detect step found, which registered programs should we recommend?
  • RecommendedNextScreen — a new post-install, show-gated step. Renders detected candidates; when none are detected the router skips it entirely. The user's picks land in session.recommendedFollowUps — the modular seam a future orchestrator/queue consumes unchanged.
  • Interim action — the seam renders as copy-paste npx @posthog/wizard <cmd> lines on exit (exit-line.ts). No queue/orchestration yet; that's a deliberate fast-follow.

Notable

  • DiscoveredFeature is extracted into a dependency-free leaf module (discovered-features.ts) so program configs can reference its enum values at module-init without a module-load cycle. It's re-exported from wizard-session so every existing @lib/wizard-session consumer is unaffected.

Testing

  • pnpm build (incl. smoke test) ✓
  • pnpm jest — new promotable.test.ts + extended exit-line.test.ts pass; only failure is the pre-existing order-dependent provision-cli flake (fails on clean main too) ✓
  • pnpm lint — 0 errors ✓

🤖 Generated with Claude Code

Keeps the main wizard flow install-only and surfaces other programs
(revenue analytics, and future data-warehouse/LLM-analytics) as
discoverable follow-ups once install succeeds — no flow/UI overhaul.

- `ProgramConfig.promotable` metadata: a program opts into promotion by
  declaring its detection `feature`, `label`, and `description`. The
  screen stays product-agnostic and just iterates the registry.
- `promotable.ts` answers "given what `detect` found, which registered
  programs should we recommend?" — the producer side of discoverability.
- New post-install `RecommendedNextScreen` (a `show`-gated step) renders
  detected candidates; the user's picks land in
  `session.recommendedFollowUps` — the modular seam a future
  orchestrator/queue consumes.
- Interim, the seam renders as copy-paste `npx @posthog/wizard <cmd>`
  lines on exit (exit-line.ts). No queue/orchestration yet.
- `DiscoveredFeature` extracted into a dependency-free leaf module so
  program configs can reference its values at module-init without a
  module-load cycle; re-exported from wizard-session for back-compat.

Generated-By: PostHog Code
Task-Id: 3fd67ecf-5927-4839-b042-38d1c2685925
@github-actions

Copy link
Copy Markdown

🧙 Wizard CI

Run the Wizard CI and test your changes against wizard-workbench example apps by replying with a GitHub comment using one of the following commands:

Test all apps:

  • /wizard-ci all

Test all apps in a directory:

  • /wizard-ci basic-integration
  • /wizard-ci error-tracking-upload-source-maps
  • /wizard-ci misc
  • /wizard-ci revenue

Test an individual app:

  • /wizard-ci basic-integration/android
  • /wizard-ci basic-integration/angular
  • /wizard-ci basic-integration/astro
Show more apps
  • /wizard-ci basic-integration/django
  • /wizard-ci basic-integration/fastapi
  • /wizard-ci basic-integration/flask
  • /wizard-ci basic-integration/javascript-node
  • /wizard-ci basic-integration/javascript-web
  • /wizard-ci basic-integration/laravel
  • /wizard-ci basic-integration/next-js
  • /wizard-ci basic-integration/nuxt
  • /wizard-ci basic-integration/python
  • /wizard-ci basic-integration/rails
  • /wizard-ci basic-integration/react-native
  • /wizard-ci basic-integration/react-router
  • /wizard-ci basic-integration/sveltekit
  • /wizard-ci basic-integration/swift
  • /wizard-ci basic-integration/tanstack-router
  • /wizard-ci basic-integration/tanstack-start
  • /wizard-ci basic-integration/vue
  • /wizard-ci error-tracking-upload-source-maps/android
  • /wizard-ci error-tracking-upload-source-maps/cicd-docker-node-raw
  • /wizard-ci error-tracking-upload-source-maps/cicd-github-actions-docker-node-raw
  • /wizard-ci error-tracking-upload-source-maps/cicd-github-actions-nested-docker-node-raw
  • /wizard-ci error-tracking-upload-source-maps/cicd-github-actions-node-raw
  • /wizard-ci error-tracking-upload-source-maps/cicd-gitlab-node-raw
  • /wizard-ci error-tracking-upload-source-maps/cicd-ssh-vps-node-raw
  • /wizard-ci error-tracking-upload-source-maps/flutter
  • /wizard-ci error-tracking-upload-source-maps/ios
  • /wizard-ci error-tracking-upload-source-maps/next
  • /wizard-ci error-tracking-upload-source-maps/next-no-posthog
  • /wizard-ci error-tracking-upload-source-maps/node-raw
  • /wizard-ci error-tracking-upload-source-maps/node-rollup
  • /wizard-ci error-tracking-upload-source-maps/node-rollup-typescript-plugin
  • /wizard-ci error-tracking-upload-source-maps/node-webpack
  • /wizard-ci error-tracking-upload-source-maps/nuxt-3-6
  • /wizard-ci error-tracking-upload-source-maps/nuxt-4-3
  • /wizard-ci error-tracking-upload-source-maps/react-native
  • /wizard-ci error-tracking-upload-source-maps/react-vite
  • /wizard-ci error-tracking-upload-source-maps/rust
  • /wizard-ci misc/quack-quack
  • /wizard-ci revenue/stripe

Results will be posted here when complete.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant