-
Notifications
You must be signed in to change notification settings - Fork 0
third test run #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
third test run #12
Conversation
|
Now I have all the information needed to evaluate this PR. Let me produce the comprehensive review: PR Evaluation ReportSummaryThis PR adds PostHog analytics integration to a Next.js 15 Pages Router todo application. It includes client-side initialization via
Confidence score: 2/5 ❌
File changes
App sanity check: 2/5 ❌
Issues
|
| Criteria | Result | Description |
|---|---|---|
| PostHog SDKs installed | No | posthog-js and posthog-node not in package.json dependencies |
| PostHog client initialized | Partial | instrumentation-client.ts has init code but file is never imported in _app.tsx |
| capture() | Yes | 14 custom events tracked across client and server |
| identify() | No | No user identification implemented |
| Error tracking | Yes | captureException() calls in client code; capture_exceptions: true in config |
| Reverse proxy | Yes | Correctly configured in next.config.ts with /ingest rewrites to PostHog |
Issues
- SDK packages missing from package.json: Application will not build without
posthog-jsandposthog-nodeinstalled. [CRITICAL] - Client initialization not loaded:
instrumentation-client.tsexists but is never imported. Addimport '@/instrumentation-client'topages/_app.tsx. [CRITICAL] - Invalid
defaultsoption: Removedefaults: '2025-05-24'from PostHog init - this is not a valid option. [MEDIUM] - No user identification: All server-side events use hardcoded
distinctId: 'anonymous'. Consider implementing proper user identification for meaningful analytics. [MEDIUM] - Server-side host config mismatch:
posthog-server.tsusesNEXT_PUBLIC_POSTHOG_HOSTbut should bypass the reverse proxy for server-to-server calls. Currently set tohttps://us.i.posthog.comwhich is correct. [LOW]
Other completed criteria
- Correct API host configuration (
/ingestfor client, direct host for server) - Debug mode enabled in development
- Exception capture enabled
- Proper singleton pattern for server-side client
- Shutdown handler provided for server client
skipTrailingSlashRedirectset for PostHog compatibility- Static asset rewrites included for reverse proxy
PostHog insights and events: 4/5 ✅
| Filename | PostHog events | Description |
|---|---|---|
todo-list.tsx |
todo_created, todo_completed, todo_uncompleted, todo_deleted, todo_create_failed, todo_update_failed, todo_delete_failed, todos_fetch_failed, captureException |
Comprehensive client-side tracking of all todo operations and errors. Events include relevant properties like todo_id, has_description, title_length |
about.tsx |
about_page_viewed |
Page view tracking for funnel analysis |
api/todos/index.ts |
api_todo_validation_error, api_todo_create_error |
Server-side error tracking with validation details |
api/todos/[id].ts |
api_todo_not_found, api_todo_validation_error, api_todo_update_error, api_todo_delete_error |
Server-side error tracking with operation context and todo_id |
Issues
- No success tracking on server-side: Only errors are tracked server-side. Consider adding
api_todo_created,api_todo_updated,api_todo_deletedsuccess events for complete picture. [LOW] - Missing homepage pageview: No
$pageviewor custom page view event for the main todo list page. [LOW]
Other completed criteria
- Events capture real user actions (create, complete, delete todos)
- Error events capture exception messages for debugging
- Events enriched with relevant properties (todo_id, operation type, error messages)
- Event naming follows consistent snake_case convention
- Events documented in
.posthog-events.jsonwith descriptions - Both success and failure paths covered for client-side operations
- Validation errors tracked separately from server errors
Reviewed by wizard workbench PR evaluator
|
The output from It's a little overkill and verbose rn, but I think AI reviews are gonna help us stay sane and spare us from looking at millions of Wizard runs @PostHog/team-docs-wizard |
Resources manifest
{ "version": "1.0", "buildVersion": "dev", "buildTimestamp": "2025-12-07T21:20:06.738Z", "resources": { "workflows": [ { "id": "basic-integration-begin", "name": "PostHog Setup - Begin", "description": "Start the event tracking setup process by analyzing the project and creating an event tracking plan", "file": "prompts/basic-integration/1.0-begin.md", "order": 1, "uri": "posthog://workflows/basic-integration/begin", "nextStepId": "basic-integration-edit", "nextStepUri": "posthog://workflows/basic-integration/edit" }, { "id": "basic-integration-edit", "name": "PostHog Setup - Edit", "description": "Implement PostHog event tracking in the identified files, following best practices and the example project", "file": "prompts/basic-integration/1.1-edit.md", "order": 1.1, "uri": "posthog://workflows/basic-integration/edit", "nextStepId": "basic-integration-revise", "nextStepUri": "posthog://workflows/basic-integration/revise" }, { "id": "basic-integration-revise", "name": "PostHog Setup - Revise", "description": "Review and fix any errors in the PostHog integration implementation", "file": "prompts/basic-integration/1.2-revise.md", "order": 1.2, "uri": "posthog://workflows/basic-integration/revise" }, { "id": "legacy-setup-begin", "name": "Event Setup - Begin (Legacy URI)", "description": "Start the event tracking setup process (legacy URI for backward compatibility)", "file": "prompts/basic-integration/1.0-begin.md", "order": 1, "uri": "posthog://integration/workflow/setup/begin", "nextStepId": "basic-integration-edit", "nextStepUri": "posthog://workflows/basic-integration/edit" } ], "docs": [ { "id": "identify", "name": "Identify Users docs", "description": "PostHog documentation on identifying users", "uri": "posthog://docs/identify", "url": "https://posthog.com/docs/getting-started/identify-users.md" } ], "prompts": [ { "id": "posthog-setup", "name": "posthog-setup", "title": "Setup a deep PostHog integration", "description": "Automatically instrument your project with PostHog event tracking, user identification, and error tracking. Available frameworks: nextjs-app-router, nextjs-pages-router, react-react-router", "messages": [ { "role": "user", "content": { "type": "text", "text": "Setup automatic PostHog event tracking in this project.\n\nUse these MCP resources:\n- posthog://workflows/basic-integration/begin - The event setup workflow guide (start here)\n- posthog://docs/frameworks/{framework} - Integration documentation per framework\n- posthog://examples/{framework} - Example projects with known-good PostHog integrations\n\nFollow the workflow guide to implement a deep PostHog integration." } }, { "role": "assistant", "content": { "type": "text", "text": "I'll set up PostHog event tracking in your project using the provided workflow guide and documentation." } } ] } ] }, "templates": [ { "name": "PostHog example projects", "uriPattern": "posthog://examples/{framework}", "description": "Example project code showing PostHog integration for various frameworks", "parameterName": "framework", "items": [ { "id": "nextjs-app-router", "file": "nextjs-app-router.md" }, { "id": "nextjs-pages-router", "file": "nextjs-pages-router.md" }, { "id": "react-react-router", "file": "react-react-router.md" } ] }, { "name": "PostHog framework integration documentation", "uriPattern": "posthog://docs/frameworks/{framework}", "description": "PostHog integration documentation for various frameworks", "parameterName": "framework", "items": [ { "id": "nextjs-app-router", "url": "https://posthog.com/docs/libraries/next-js.md" }, { "id": "nextjs-pages-router", "url": "https://posthog.com/docs/libraries/next-js.md" }, { "id": "react-react-router", "url": "https://posthog.com/docs/libraries/react.md" } ] } ] }