Repository navigation
feat(feature-flags): add the wizard feature-flags command - #1322
Conversation
🧙 Wizard CIRun 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:
Test all apps in a directory:
Test an individual app:
Show more apps
Test against a Context Mill branch:
Add Results will be posted here when complete. |
adab746 to
f3eb515
Compare
34213e2 to
b70460a
Compare
b977652 to
e745ea0
Compare
PR overviewAll previously flagged issues have been addressed. No open security concerns remain on this pull request. Security reviewNo open security issues remain on this pull request. Fixed/addressed: 1 · PR risk: 0/10 |
12287c0 to
31a9b18
Compare
Adds `wizard feature-flags`: an orchestrator flow with bundled prompts that creates one example flag per side of the app (backend, frontend), inactive at 0%, evaluates each once on its own side, and writes a report with an optional check that the evaluations reach PostHog.
The feature-flags program gets its own intro screen, a run-screen learn deck explaining what flags are and what the run sets up, and sidebar tips, in place of the generic agent-skill screens.
Give feature-flags its own OAuth scope list and share the step skill id between the evaluate prompt and the intro screen.
A Django run whose templates load no app JavaScript added a PostHog snippet to host the frontend flag. The seed now defines the frontend by JavaScript the app owns and loads, including through import maps or Vite, and names script-less server templates as backend-only.
Point the feature-flags program, deck, intro screen and test at the paths #1375 moved them to, and register the command in main.ts.
31a9b18 to
52c59db
Compare
A live repair on PostHog/wizard#1322 committed its merge on keep-mergeable through a temporary worktree, because the sandbox blocked writing the repo's tracked .claude/skills files, and left the checkout HEAD detached at the old pull request head. The handoff read HEAD and reported no-change. The prompt tells the session to commit on keep-mergeable, so the handoff now reads, bundles and fetches refs/heads/keep-mergeable. Not-tested: a session that commits on a branch other than keep-mergeable is still dropped as no-change (review NIT, low confidence) Confidence: high Scope-risk: narrow
Route feature-flags in the registry binding test, export the prompt parser from the @agent entry for the bundled-prompt test, and tidy comments. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gewenyu99
left a comment
There was a problem hiding this comment.
Overall much better than the initial version!
I have some copy suggestions + questions about why there's another agent prompt pass in. I can't quite figure out why we needed this exception here.
I labelled my bot comments for your bot to address.
I think we can land this after these tweaks, great work!
# Conflicts: # src/programs/program-step.ts
The feature-flags test imported @programs/program-registry, which lives in the entry project that references feature-flags, so tsc -b failed with TS6307 in the Lint job. Assert the program's own oauthScopeAdditions there and move the registry-level scope check into program-registry.test.ts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tebook Review on #1322 asked why feature-flags shipped its agent prompts inside the wizard. Every other orchestrator flow loads them from context-mill, so the bundled agentPrompts seam is gone and the agent layer, program-step.ts and run-program.ts match main again. The prompts move to context-mill/context/agents/feature-flags. The report now goes through publish_handoff into a PostHog notebook (handoffNotebook) instead of a file, and the in-run verify-flag check is gone: it sat on a running agent and ingestion lag made it flaky. The outro next steps say how to find the evaluation in PostHog instead. KMP aborts before login, as in error-tracking, since its skill variants carry no framework tag. The intro shows the Program row and the shorter tagline, and the run deck follows the posthog-integration deck: third-person voice, the status hint first, and a blank line above each code example. Constraint: run.reportFile stays because ProgramRun requires it; the orchestrated outro never reads it Constraint: needs the context-mill feature-flags prompts published before a run can start Rejected: shared abortUnsupportedPlatform helper | would touch error-tracking and replay-vision, out of scope Confidence: medium Scope-risk: moderate Not-tested: workbench e2e against the context-mill prompts branch, which does not exist yet Ticket: feature-flags-review-update/U1 Ticket: feature-flags-review-update/U4
edwinyjlim
left a comment
There was a problem hiding this comment.
ship after addressing Vincent's comments. We can improve after it's in prod since we aren't promoting this program yet
Every comment is addressed in 2d405ae and PostHog/context-mill#428; replies are on each thread.
Problem
Feedback wanted: ready to merge. Approve or request changes. The command works once context-mill 1.57.0 (PostHog/context-mill#426) is published and PostHog/charts#16288 is deployed.
Setting up a first feature flag means creating it in PostHog, installing the right SDKs, and evaluating it correctly: once per request, with the identified distinct id, the key in one place, and the evaluation reported back. The wizard has no command for this.
Companion PRs: context-mill agents (PostHog/context-mill#428, merged), context-mill step skill (PostHog/context-mill#405, merged), wizard-workbench grading (PostHog/wizard-workbench#4483, merged), and gateway admission (https://github.com/PostHog/charts/pull/16288).
Changes
wizard feature-flags: a native command running thefeature-flagsorchestrator flow. Its agents (seed, install, init, create-flag, evaluate, report) are fetched from context-mill like every other flow.wizard-example-backend-flagandwizard-example-frontend-flag, inactive at 0% rollout, and reuses an existing flag with the same key unchanged.integration-v2-feature-flags-stepskill for the framework's flag docs.handoffNotebook), and the outro links it. The outro's next steps say how to trigger an evaluation, find it on the flag's page, and turn the flags on.feature-flags-introscreen and a run-screen learn deck explaining what flags are (gating code, gradual rollout, targeting, the off switch, experiments) and what the run sets up. The intro offers only Cancel while detection runs, when no framework is detected, when the framework version is unsupported, or for Kotlin Multiplatform, so a run never reaches login without a supported framework. Headless runs abort the same cases inciPreRun.feature_flag:read,feature_flag:write), registry entry, and e2e profile.Before merge:
feature-flagsmust be inWIZARD_GATEWAY_PROGRAM_IDS(PostHog/charts#16288), and a gateway operator must add awizard:feature-flagsbudget row. Until then the gateway refuses the mint withprogram_unknown.Test plan
pnpm typecheck,pnpm lint, andpnpm testpass.pnpm wizard-ci feature-flags/<app> --e2e, served feat(feature-flags): add the feature-flags orchestrator agents context-mill#428 locally, passed every check:next-js/15-app-router-saascreated both flags inactive at 0% with the keys inlib/posthog-feature-flags.ts.django/django3-saascreated only the backend flag, with the key indashboard/feature_flags.py.LLM context
Written with Claude Code.