Skip to content

[CI] (b6c5097) next-js/15-app-router-todo - #4071

Closed
wizard-ci-bot[bot] wants to merge 1 commit into
mainfrom
wizard-ci-b6c5097-next-js-15-app-router-todo
Closed

wizard-ci-bot[bot] wants to merge 1 commit into
mainfrom
wizard-ci-b6c5097-next-js-15-app-router-todo

Conversation

@wizard-ci-bot

@wizard-ci-bot wizard-ci-bot Bot commented Sep 22, 2026

Copy link
Copy Markdown

Automated wizard CI run

Source: wizard-pr
Trigger ID: b6c5097
App: next-js/15-app-router-todo
App directory: apps/next-js/15-app-router-todo
Workbench branch: wizard-ci-b6c5097-next-js-15-app-router-todo
Wizard branch: posthog/functional-a1-min
Context Mill branch: main
PostHog (MCP) branch: master
Timestamp: 2026-09-22T01:20:18.212Z
Duration: 269.5s

YARA Scanner

✓ 116 tool calls scanned, 0 violations detected

No violations: ✓ 116 clean scans

@wizard-ci-bot

wizard-ci-bot Bot commented Sep 22, 2026

Copy link
Copy Markdown
Author

PR Evaluation Report

Summary

This PR integrates PostHog into a Next.js 15 app router todo application. It adds client-side initialization via instrumentation-client.ts, custom event captures for todo CRUD operations, error tracking via a global-error.tsx boundary and capture_exceptions, and documents environment variables in .env.example.

Files changed Lines added Lines removed
6 +60 -0

Confidence score: 5/5 🧙

  • No user identification: No posthog.identify() call exists anywhere in the app. Without it, all events are anonymous and cannot be linked to specific users across sessions or devices. [CRITICAL]
  • No reverse proxy configured: Next.js supports rewrites natively, and the docs recommend configuring a reverse proxy to prevent ad blockers from intercepting PostHog requests. [MEDIUM]

File changes

Filename Score Description
instrumentation-client.ts 4/5 PostHog initialized correctly with env vars, error guards for missing config, and capture_exceptions enabled. Uses older defaults: "2026-01-30" instead of current "2026-05-30".
app/global-error.tsx 4/5 Error boundary captures exceptions via posthog.captureException() in a useEffect.
components/todos/todo-list.tsx 4/5 Three meaningful custom events added in event handlers for todo create, toggle, and delete.
package.json 5/5 posthog-js added as dependency.
.env.example 5/5 Documents both required PostHog env vars.
.gitignore 5/5 Adds .env.local to prevent committing secrets.

App sanity check ✅

Criteria Result Description
App builds and runs Yes No syntax errors; all imports resolve correctly
Preserves existing env vars & configs Yes Only additive changes; existing todo functionality untouched
No syntax or type errors Yes Valid TypeScript across all changed files
Correct imports/exports Yes posthog-js imported correctly in client components
Minimal, focused changes Yes All changes are PostHog-related with no scope creep
Pre-existing issues None —

Issues

No issues found.

Other completed criteria

  • Environment variables documented in .env.example
  • .env.local added to .gitignore to prevent secret leakage
  • Build configuration valid with posthog-js added to dependencies

PostHog implementation ⚠️

Criteria Result Description
PostHog SDKs installed Yes posthog-js: ^1.434.5 added to package.json
PostHog client initialized Yes Initialized in instrumentation-client.ts — the correct Next.js app router pattern — with API key and host from env vars
capture() Yes Three custom events: todo_created, todo_completion_toggled, todo_deleted
identify() No No posthog.identify() call anywhere in the codebase
Error tracking Yes capture_exceptions: true in init config + global-error.tsx boundary with posthog.captureException()
Reverse proxy No No Next.js rewrites or middleware proxy configured

Issues

  • Missing user identification: No posthog.identify() call exists. The docs state: "Identifying users is required. Call posthog.identify('your-user-id') after login to link events to a known user." All captured events will remain anonymous and cannot be connected to specific users. Add an identify call in an auth callback or layout component when the user is known. [CRITICAL]
  • No reverse proxy: The PostHog Next.js docs recommend setting up a reverse proxy via Next.js rewrites or middleware so events are less likely to be intercepted by ad blockers. Add a rewrites() configuration in next.config.js or use the managed reverse proxy service. [MEDIUM]
  • Older defaults date: defaults: "2026-01-30" is used instead of the current "2026-05-30". While functional, this means the app misses newer default configuration improvements. [LOW]

Other completed criteria

  • API key loaded from NEXT_PUBLIC_POSTHOG_PROJECT_TOKEN environment variable (not hardcoded)
  • API host correctly configured from NEXT_PUBLIC_POSTHOG_HOST environment variable
  • Helpful development-only error messages when env vars are missing
  • Debug mode enabled only in development

PostHog insights and events ✅

Filename PostHog events Description
components/todos/todo-list.tsx todo_created, todo_completion_toggled, todo_deleted Captures core CRUD actions on todos with contextual properties (has_description, completed state)
app/global-error.tsx captureException Captures unhandled errors at the app boundary for error tracking
instrumentation-client.ts capture_exceptions: true Enables automatic exception autocapture globally

Issues

No event quality issues found.

Other completed criteria

  • Events represent real user actions (create, toggle, delete todos)
  • Events enable product insights — can build create→complete funnel, track deletion rates
  • Events include relevant properties (has_description, completed state)
  • No PII in event properties
  • Event names are descriptive and use consistent snake_case convention

Reviewed by wizard workbench PR evaluator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants