fix(content): version-gate the Next.js client init rule#236
Closed
gewenyu99 wants to merge 1 commit into
Closed
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
Results will be posted here when complete. |
gewenyu99
force-pushed
the
posthog-code/nextjs-version-gate-report-wrapper
branch
from
July 14, 2026 18:05
9e7403e to
045e424
Compare
instrumentation-client.ts is ignored on Next.js below 15.3, so client-side PostHog silently never initializes there. The nextjs commandment now states which init location to use for which version. Generated-By: PostHog Code Task-Id: f3b2162f-9a47-4d22-a83e-0a66900ed730
gewenyu99
force-pushed
the
posthog-code/nextjs-version-gate-report-wrapper
branch
from
July 14, 2026 18:08
045e424 to
4628353
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
instrumentation-client.tsonly runs on Next.js 15.3+. On older versions it is silently ignored, so an agent following our guidance leaves client-side PostHog uninitialized (seen in a benchmark run against a Next.js 14.2.5 app). The existingnextjscommandment recommendedinstrumentation-client.tswith no version check and no alternative.What
One line in
context/commandments.yaml— thenextjsinit commandment now says which init location to use for which version:Commandments fold into every skill tagged
nextjsat build time, so this reaches all Next.js skills without touching them individually.Verification
npm test— 107/107 passnpm run build— clean; the new rule appears in every built Next.jsSKILL.mdunderdist/marketplaceCreated with PostHog Code