integration-nextjs-app-router — community integration-nextjs-app-router, peerpull, nicholasmartin, community, ai agent skill, ide skills, agent automation, AI agent skills, Claude Code, Cursor, Windsurf

v1.8.1
GitHub

About this Skill

Perfect for Frontend Agents needing seamless PostHog analytics integration in Next.js App Router applications. PostHog integration for Next.js App Router applications

nicholasmartin nicholasmartin
[0]
[0]
Updated: 3/8/2026

Quality Score

Top 5%
34
Excellent
Based on code quality & docs
Installation
SYS Universal Install (Auto-Detect)
> npx killer-skills add nicholasmartin/peerpull/integration-nextjs-app-router
Supports 19+ Platforms
Cursor
Windsurf
VS Code
Trae
Claude
OpenClaw
+12 more

Agent Capability Analysis

The integration-nextjs-app-router skill by nicholasmartin is an open-source community AI agent skill for Claude Code and other IDE workflows, helping agents execute tasks with better context, repeatability, and domain-specific guidance.

Ideal Agent Persona

Perfect for Frontend Agents needing seamless PostHog analytics integration in Next.js App Router applications.

Core Value

Empowers agents to track user behavior and optimize Next.js apps using PostHog analytics, providing a workflow for setup and integration with Next.js App Router, leveraging PostHog's event tracking and analytics capabilities.

Capabilities Granted for integration-nextjs-app-router

Integrating PostHog analytics into Next.js App Router applications
Tracking user behavior and optimizing app performance
Setting up PostHog analytics workflows for Next.js App Router

! Prerequisites & Limits

  • Requires PostHog setup and configuration
  • Specific to Next.js App Router applications
  • Follows a predefined workflow for integration
Project
SKILL.md
2.7 KB
.cursorrules
1.2 KB
package.json
240 B
Ready
UTF-8

# Tags

[No tags]
SKILL.md
Readonly

PostHog integration for Next.js App Router

This skill helps you add PostHog analytics to Next.js App Router applications.

Workflow

Follow these steps in order to complete the integration:

  1. basic-integration-1.0-begin.md - PostHog Setup - Begin ← Start here
  2. basic-integration-1.1-edit.md - PostHog Setup - Edit
  3. basic-integration-1.2-revise.md - PostHog Setup - Revise
  4. basic-integration-1.3-conclude.md - PostHog Setup - Conclusion

Reference files

  • EXAMPLE.md - Next.js App Router example project code
  • next-js.md - Next.js - docs
  • identify-users.md - Identify users - docs
  • basic-integration-1.0-begin.md - PostHog setup - begin
  • basic-integration-1.1-edit.md - PostHog setup - edit
  • basic-integration-1.2-revise.md - PostHog setup - revise
  • basic-integration-1.3-conclude.md - PostHog setup - conclusion

The example project shows the target implementation pattern. Consult the documentation for API details.

Key principles

  • Environment variables: Always use environment variables for PostHog keys. Never hardcode them.
  • Minimal changes: Add PostHog code alongside existing integrations. Don't replace or restructure existing code.
  • Match the example: Your implementation should follow the example project's patterns as closely as possible.

Framework guidelines

  • For Next.js 15.3+, initialize PostHog in instrumentation-client.ts for the simplest setup
  • For feature flags, use useFeatureFlagEnabled() or useFeatureFlagPayload() hooks - they handle loading states and external sync automatically
  • Add analytics capture in event handlers where user actions occur, NOT in useEffect reacting to state changes
  • Do NOT use useEffect for data transformation - calculate derived values during render instead
  • Do NOT use useEffect to respond to user events - put that logic in the event handler itself
  • Do NOT use useEffect to chain state updates - calculate all related updates together in the event handler
  • Do NOT use useEffect to notify parent components - call the parent callback alongside setState in the event handler
  • To reset component state when a prop changes, pass the prop as the component's key instead of using useEffect
  • useEffect is ONLY for synchronizing with external systems (non-React widgets, browser APIs, network subscriptions)

Identifying users

Identify users during login and signup events. Refer to the example code and documentation for the correct identify pattern for this framework. If both frontend and backend code exist, pass the client-side session and distinct ID using X-POSTHOG-DISTINCT-ID and X-POSTHOG-SESSION-ID headers to maintain correlation.

Error tracking

Add PostHog error tracking to relevant files, particularly around critical user flows and API boundaries.

FAQ & Installation Steps

These questions and steps mirror the structured data on this page for better search understanding.

? Frequently Asked Questions

What is integration-nextjs-app-router?

Perfect for Frontend Agents needing seamless PostHog analytics integration in Next.js App Router applications. PostHog integration for Next.js App Router applications

How do I install integration-nextjs-app-router?

Run the command: npx killer-skills add nicholasmartin/peerpull/integration-nextjs-app-router. It works with Cursor, Windsurf, VS Code, Claude Code, and 19+ other IDEs.

What are the use cases for integration-nextjs-app-router?

Key use cases include: Integrating PostHog analytics into Next.js App Router applications, Tracking user behavior and optimizing app performance, Setting up PostHog analytics workflows for Next.js App Router.

Which IDEs are compatible with integration-nextjs-app-router?

This skill is compatible with Cursor, Windsurf, VS Code, Trae, Claude Code, OpenClaw, Aider, Codex, OpenCode, Goose, Cline, Roo Code, Kiro, Augment Code, Continue, GitHub Copilot, Sourcegraph Cody, and Amazon Q Developer. Use the Killer-Skills CLI for universal one-command installation.

Are there any limitations for integration-nextjs-app-router?

Requires PostHog setup and configuration. Specific to Next.js App Router applications. Follows a predefined workflow for integration.

How To Install

  1. 1. Open your terminal

    Open the terminal or command line in your project directory.

  2. 2. Run the install command

    Run: npx killer-skills add nicholasmartin/peerpull/integration-nextjs-app-router. The CLI will automatically detect your IDE or AI agent and configure the skill.

  3. 3. Start using the skill

    The skill is now active. Your AI agent can use integration-nextjs-app-router immediately in the current project.

Related Skills

Looking for an alternative to integration-nextjs-app-router or another community skill for your workflow? Explore these related open-source skills.

View All

widget-generator

Logo of f
f

Generate customizable widget plugins for the prompts.chat feed system

149.6k
0
Design

linear

Logo of lobehub
lobehub

Linear issue management. MUST USE when: (1) user mentions LOBE-xxx issue IDs (e.g. LOBE-4540), (2) user says linear, linear issue, link linear, (3) creating PRs that reference Linear issues. Provides

73.4k
0
Communication

testing

Logo of lobehub
lobehub

Testing guide using Vitest. Use when writing tests (.test.ts, .test.tsx), fixing failing tests, improving test coverage, or debugging test issues. Triggers on test creation, test debugging, mock setup

73.3k
0
Communication

zustand

Logo of lobehub
lobehub

Zustand state management guide. Use when working with store code (src/store/**), implementing actions, managing state, or creating slices. Triggers on Zustand store development, state management questions, or action implementation.

72.8k
0
Communication