[CI] (gpt5-trial-2) next-js/15-app-router-todo#2403
Closed
wizard-ci-bot[bot] wants to merge 1 commit into
Closed
Conversation
Author
PR Evaluation ReportSummaryThis PR integrates PostHog into a Next.js 15 App Router todo application. It adds client-side initialization via
Confidence score: 4/5 👍
File changes
App sanity check
|
| Criteria | Result | Description |
|---|---|---|
| App builds and runs | Yes | No syntax errors, valid TypeScript, proper imports |
| Preserves existing env vars & configs | Yes | Only adds PostHog-related config; existing next.config comment removed but harmless |
| No syntax or type errors | Yes | All code is syntactically valid; optional chaining used appropriately |
| Correct imports/exports | Yes | posthog-js on client, posthog-node on server, correct separation |
| Minimal, focused changes | Yes | All changes are PostHog-related |
| Pre-existing issues | None | Base app appears clean |
Issues
- Environment variables not documented:
NEXT_PUBLIC_POSTHOG_PROJECT_TOKENandNEXT_PUBLIC_POSTHOG_HOSTare used but no.env.exampleor README is updated to document them. Collaborators won't know what to set. [MEDIUM]
Other completed criteria
- Build configuration is valid —
next.config.tsexports properNextConfigwith rewrites - All changes are relevant to PostHog integration
- Code follows existing codebase patterns (TypeScript, async/await, error handling structure)
PostHog implementation ⚠️
| Criteria | Result | Description |
|---|---|---|
| PostHog SDKs installed | Yes | posthog-js@^1.396.6 and posthog-node@^5.39.4 in package.json |
| PostHog client initialized | Yes | Client via instrumentation-client.ts with env var token, reverse proxy host, and capture_exceptions: true. Server via singleton in lib/posthog-server.ts with flushAt: 1 |
| capture() | Yes | 4 client-side captures (todo_created, todo_completed, todo_uncompleted, todo_deleted) and 5 server-side captures |
| identify() | No | No posthog.identify() call anywhere — not on login, not on page load, not in any component. All events are anonymous |
| Error tracking | Yes | capture_exceptions: true in init config enables exception autocapture; api_validation_error events capture server-side validation failures |
| Reverse proxy | Yes | Correctly configured in next.config.ts with /ingest/static/* and /ingest/array/* → us-assets.i.posthog.com, catch-all → us.i.posthog.com, plus skipTrailingSlashRedirect: true |
Issues
- No user identification:
posthog.identify()is never called. The PostHog docs explicitly state this is required for linking frontend captures, session replays, and error tracking to known users. Without it, all data is anonymous and cannot be associated with user profiles. [CRITICAL] - Fabricated
'server'fallback distinct_id: Whenx-posthog-distinct-idheader is missing, server routes use'server'as the distinct_id. This creates a single fake "user" that accumulates all unidentified server events, producing misleading analytics. Should use a request-scoped identifier or skip the capture. [MEDIUM]
Other completed criteria
- API key loaded from
process.env.NEXT_PUBLIC_POSTHOG_PROJECT_TOKENenvironment variable, not hardcoded - API host correctly configured — client points to
/ingest(reverse proxy), server usesNEXT_PUBLIC_POSTHOG_HOST posthog.reset()not present but acceptable since there's no auth/logout flow in the todo app
PostHog insights and events ⚠️
| Filename | PostHog events | Description |
|---|---|---|
components/todos/todo-list.tsx |
todo_created, todo_completed, todo_uncompleted, todo_deleted |
Client-side user action tracking with properties like todo_id, has_description, title_length |
app/api/todos/route.ts |
api_todos_listed, api_todo_created, api_validation_error |
Server-side tracking of list/create operations and validation failures |
app/api/todos/[id]/route.ts |
api_todo_updated, api_todo_deleted, api_validation_error |
Server-side tracking of update/delete operations and validation failures |
instrumentation-client.ts |
captureException (via capture_exceptions: true) |
Automatic exception autocapture for unhandled errors |
Issues
- Duplicate client+server events: Both client and server capture the same actions (e.g.,
todo_createdon client ANDapi_todo_createdon server). While not necessarily wrong, this creates double-counting unless carefully filtered. Consider whether both layers need to capture. [LOW] api_todos_listedis noisy: Fires on every GET/api/todosrequest (page load, refresh, etc.). This is not a deliberate user action and will generate high event volume with low analytical value. [LOW]
Other completed criteria
- Events use descriptive snake_case naming convention consistently
- Event properties are enriched with contextual data (
todo_id,has_description,title_length,count,errors) - No PII in event properties — no emails, names, or personal data in capture() calls
- Events enable product insights — can build a create → complete → delete funnel from client events
Reviewed by wizard workbench PR evaluator
Draft
5 tasks
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.
Automated wizard CI run
Source: manual
Trigger ID:
gpt5-trial-2App:
next-js/15-app-router-todoApp directory:
apps/next-js/15-app-router-todoWorkbench branch:
wizard-ci-gpt5-trial-2-next-js-15-app-router-todoWizard branch:
1eb16c89a1ac295f0887a96381fff7314e999b05Context Mill branch:
mainPostHog (MCP) branch:
masterTimestamp: 2026-07-03T16:21:00.299Z
Duration: 420.7s
YARA Scanner