Skip to content

feat(feature-flags): add framework-aware wizard program - #1037

Open
hacktivist123 wants to merge 7 commits into
PostHog:mainfrom
hacktivist123:feature-flags-wizard
Open

feat(feature-flags): add framework-aware wizard program#1037
hacktivist123 wants to merge 7 commits into
PostHog:mainfrom
hacktivist123:feature-flags-wizard

Conversation

@hacktivist123

Copy link
Copy Markdown

Problem

The Wizard can run arbitrary Context Mill skills, but it does not have a dedicated Feature Flags program that owns skill selection, access, setup, verification, and the developer handoff.

Engineers should be able to add one real feature flag to an app that already has PostHog installed without choosing a generic skill or assembling the workflow themselves.

Depends on PostHog/context-mill#294. That PR must be merged and released before the published Wizard can install the updated feature flag workflow.

Changes

  • Add wizard feature-flags as a framework-aware program for apps with an existing PostHog SDK integration.
  • Select and install the matching Feature Flags skill at runtime, starting with the Next.js variant.
  • Request the PostHog feature flag scopes required to create or reuse a real flag.
  • Stop with actionable guidance when the SDK, matching skill, or feature flag access is unavailable.
  • Add a Feature Flags Learn deck covering safe fallbacks, evaluation location, both flag states, live evaluation, and rollout restoration.
  • Add a project-specific outro with a direct Feature Flags link, verification checklist, generated report, and coding-agent handoff.
  • Make the shared skill intro render programs whose skill is selected at runtime.
  • Add CLI, prompt, OAuth, intro-screen, and command-mounting coverage.

Test plan

  • npx --yes vitest run - 120 test files and 1,687 tests passed before the final release rebase.
  • npx --yes vitest run src/lib/programs/__tests__/feature-flags-prompt.test.ts src/__tests__/programs-cli.test.ts src/utils/__tests__/oauth.test.ts src/ui/tui/__tests__/agent-skill-intro.test.ts - 53 tests passed after rebasing onto main.
  • git diff --check origin/main...HEAD
  • npx --no-install tsx bin.ts feature-flags --help
  • Ran the program against a Next.js App Router fixture and a live PostHog project to exercise skill selection, flag setup, application changes, the Learn pane, and report generation.
  • The companion Context Mill workflow passes 139 tests, builds all 363 skills, and pins the abort contract consumed by this program.

LLM context

Codex was used as a pair-programming and review partner for repository exploration, implementation support, test execution, and focused code and content reviews. The PostHog Wizard agent was tested against the Context Mill skill during the end-to-end workflow.

@hacktivist123
hacktivist123 requested a review from a team as a code owner July 30, 2026 13:29

@gewenyu99 gewenyu99 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This generally looks like a good shape. Some suspicious tests caught. Running this and giving it a review locally rn

Comment thread src/lib/programs/__tests__/feature-flags-prompt.test.ts
harness: Harness.anthropic,
model: SONNET_5_MODEL,
},
'feature-flags': DEFAULT_BINDING,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did you try running this with the other harnesses and models? just curious

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no not at all, I didn't have the time to test it with others but i tried to follow the patterns in the codebase to make it work with other harnesses. If i had more time, that's something I'd love to do as i use Pi as my daily driver.

Comment thread src/lib/programs/feature-flags/content/index.tsx Outdated
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.

3 participants