Communitygithub.com

BIGboss248/nextjs-wordpress

WooCommerce API를 기반으로 한 Next.js 전자상거래 프론트엔드를 구축하여, ISR 카탈로그, 장바구니 세션 및 JWT 인증을 처리합니다. Next.js 상점을 WooCommerce와 함께 구축하거나 쿼리할 때 사용하세요.

nextjs-wordpress란 무엇인가요?

이 스킬은 WooCommerce를 헤드리스 백엔드로 사용하는 Next.js 전자상거래 애플리케이션을 구축하기 위한 포괄적인 운영 런북을 제공합니다. WPGraphQL, WooGraphQL 및 JWT 인증을 통해 Next.js 14+ App Router 프로젝트를 WooCommerce와 통합하는 방법을 단계별로 설명합니다. 주요 기능으로는 ISR/SSG를 활용한 공개 제품 카탈로그 구축, JWT 토큰 기반 사용자 인증 파이프라인 구현, 보호된 사용자 프로필 및 주문 내역 표시, 그리고 WooCommerce 네이티브 체크아웃으로 연결되는 장바구니 세션 관리 등이 있습니다. 이 스킬은 폴리모픽 프래그먼트 누락이나 쿠키로 인한 SSR 비최적화와 같은 일반적인 함정을 피하기 위한 구체적인 코드 패턴과 에지 케이스 처리를 제공합니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/BIGboss248/nextjs-wordpress/tree/HEAD/.agents/skills/nextjs-woocommerce

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

Next.js WooCommerce 통합 (nextjs-woocommerce)

WPGraphQL, WooGraphQL 및 JWT 인증을 통해 Next.js App Router 애플리케이션을 헤드리스 WooCommerce 백엔드와 아키텍처, 쿼리 및 통합하기 위한 운영 런북 및 체크리스트입니다.


사전 요구 사항 및 문서 참조

  • Next.js 14+ 프로젝트가 App Router 및 TypeScript로 초기화되어 있어야 합니다.
  • WPGraphQL, WooGraphQL 및 wp-graphql-jwt-authentication 플러그인이 설치된 활성 WooCommerce 백엔드가 있어야 합니다.
  • 완전한 API 스키마 및 Next.js 코드 패턴은 nextjs-woocommerce-reference.md를 참조하세요.
  • 재사용 가능한 데이터 페칭 클라이언트 구현은 woocommerce-fetcher.ts를 참조하세요.

단계별 구현 체크리스트

flowchart TD
    S1["1. 환경 및 클라이언트 설정"] --> S2["2. 공개 제품 카탈로그 (ISR/SSG)"]
    S2 --> S3["3. 사용자 인증 (JWT + 쿠키)"]
    S3 --> S4["4. 보호된 프로필 및 주문 내역"]
    S4 --> S5["5. 장바구니 세션 및 네이티브 체크아웃 브리지"]

1단계: 환경 및 클라이언트 구성

  • 환경 변수 구성:
    • .env.example 및 .env.development 파일에 NEXT_PUBLIC_WORDPRESS_API_URL=https://your-store.com/graphql을 추가합니다.
    • 체크아웃 리디렉션을 위해 NEXT_PUBLIC_WORDPRESS_URL=https://your-store.com을 추가합니다.
  • 범용 페처 설정:

2단계: 공개 제품 카탈로그 및 분류 체계

  • 카테고리 탐색: 헤더 및 카테고리 메뉴를 위해 hideEmpty: true 옵션과 함께 productCategories를 쿼리합니다.
  • 제품 그리드 아카이브: 유니온 프래그먼트(... on SimpleProduct, ... on VariableProduct)를 사용하여 products를 쿼리합니다. next: { revalidate: 300, tags: ['products'] }를 구성합니다.
  • 제품 상세 페이지: 모든 제품 슬러그를 쿼리하는 generateStaticParams()와 함께 동적 라우트(app/products/[slug]/page.tsx)를 사전 렌더링합니다.

3단계: JWT 인증 파이프라인

  • 로그인 뮤테이션: login(input: { username, password })를 실행하는 서버 액션을 구현합니다.
  • 쿠키 저장: 반환된 authToken을 보안 HttpOnly 쿠키(auth_token)에 저장합니다.
  • 세션 바인딩: 고객이 sessionToken을 반환하는 경우 wc_session 쿠키에 저장합니다.
  • 로그아웃: 사용자 로그아웃 시 인증 쿠키를 삭제합니다.

4단계: 보호된 사용자 데이터 및 주문

  • 고객 프로필: Authorization: Bearer <authToken> 헤더와 함께 viewer { id name email }을 쿼리합니다.
  • 주문 내역: cache: 'no-store'와 함께 customer { orders { nodes { id orderNumber total status } } }를 쿼리합니다.

5단계: 장바구니 관리 및 체크아웃 전략

  • 장바구니 상태: addToCart 뮤테이션에서 반환된 woocommerce-session 헤더를 캡처하고 유지합니다.
  • 네이티브 체크아웃 브리지:
    • 사용자를 https://your-store.com/checkout으로 리디렉션하여 맞춤형 게이트웨이 재작성 없이 네이티브 WooCommerce 결제 게이트웨이(ZarinPal, Mellat, Stripe), 지역 물류 및 규정 준수 인증을 활용합니다.

에지 케이스 및 알려진 함정

  1. 정적 vs 동적 최적화 저하: 루트 레이아웃 또는 제품 페이지에서 쿠키를 읽으면 Next.js가 전체 SSR 동적 모드로 전환됩니다. 인증 쿠키는 서버 액션, 라우트 핸들러 또는 분리된 계정 대시보드 서브 트리(app/account/...) 내에서만 읽으십시오.
  2. 다형성 프래그먼트: products { nodes { price } }와 같은 직접 쿼리는 WooCommerce GraphQL에서 유효성 검사에 실패합니다. 가격 및 변형은 항상 ... on SimpleProduct 및 ... on VariableProduct로 래핑하십시오.
  3. 세션 손실: 장바구니에 항목을 추가할 때 woocommerce-session 헤더를 다시 보내지 않으면 모든 뮤테이션에서 새 빈 장바구니가 생성됩니다.
  4. GraphQL 엔드포인트의 CORS: WordPress가 Next.js 도메인에 대해 Access-Control-Allow-Origin 및 Access-Control-Allow-Headers: Authorization, Content-Type, woocommerce-session 헤더를 보내는지 확인하십시오.

검증 및 사전 점검 테스트

  • pnpm build가 제품 페이지의 정적 생성과 함께 성공합니다.
  • 로그인 양식이 auth_token을 발행하고 대시보드로 리디렉션되는지 테스트합니다.
  • 계정 페이지가 유효한 토큰으로 고객 세부 정보 및 주문 목록을 렌더링합니다.
  • 장바구니 추가가 여러 클라이언트 요청에서 장바구니 항목 수를 업데이트합니다.

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

BIGboss248/nextjs-wordpress

Create, configure, manage, and validate Google Antigravity customizations including skills, rules, MCP servers, lifecycle hooks, plugins, and custom JSON configs. Use when adding new capabilities to Antigravity, configuring MCP servers, writing rules, creating skills, setting up hooks, or modernizing legacy workflows.

BIGboss248/nextjs-wordpress

Spawn multiple agents into a shared conversation where they debate, disagree, and converge on a solution via a shared chat.json file. Use for architecture decisions, code review debates, design trade-offs, or any problem that benefits from adversarial reasoning. Triggers on "chatroom", "agent debate", "have agents discuss", "agent chatroom", "debate this", or /agent-chatrooms. Also triggers on phrases like "have 3 agents argue about", "multi-agent discussion", or "let them debate".

BIGboss248/nextjs-wordpress

Always-active code intelligence, search, and navigation skill utilizing the codebase-memory MCP server. Enforces an index-first protocol (verifying and refreshing the knowledge graph via index_repository or index_status before searching, required because background auto_watch is disabled to eliminate editor stutter and system lag), followed by graph-first exploration (search_graph, trace_path, get_code_snippet, query_graph, get_architecture, detect_changes) instead of naive text grep or full-file reads. Always activate before searching the codebase, inspecting unknown architecture, finding symbols, or tracing callers/callees.

BIGboss248/nextjs-wordpress

>- Discover, interview, and craft comprehensive UX/UI design specifications (design-spec.md) and design tokens for web components. Triggers on "/component-design", "design component", "design section", "design UI", "wireframe component", or "create design spec".

BIGboss248/nextjs-wordpress

>- Configure and query WooCommerce APIs including WPGraphQL, WooGraphQL, and JWT auth for headless frontends. Use when connecting Next.js to WooCommerce or fetching store catalog data.

BIGboss248/nextjs-wordpress

Orchestrate parallel browser automation using multiple Chrome DevTools MCP instances. Use when a task requires doing the same browser action across many targets simultaneously (e.g., submitting contact forms, filling applications, scraping pages that need JS rendering). Spin up 1-5 parallel Chrome agents.

BIGboss248/nextjs-wordpress

Workflow for spawning an independent subagent to conduct unbiased code reviews and inject adversarial edge-case tests ([ComponentName].edge.test.tsx).

BIGboss248/nextjs-wordpress

>- Build Next.js App Router React components with Suspense skeletons, semantic OKLCH tokens, Jest + RTL unit tests, Playwright visual/hydration checks, and Tailwind logical styling. Triggers on "/nextjs-component-dev", "create component", "new component", "build component", or "develop component".

BIGboss248/nextjs-wordpress

>- Bootstrap, configure, and verify the complete Next.js App Router development environment, developer tooling, testing suites, MCP servers, Docker containerization, and CI/CD. Triggers on "/nextjs-dev-setup", "setup nextjs dev environment", "start a nextjs project", or "containerize nextjs app".

BIGboss248/nextjs-wordpress

>- Configure production health monitoring endpoints (/api/health), Docker Compose probes, and runtime metrics in Next.js App Router applications. Use when asked to "setup health check", "add health endpoint", "docker compose healthcheck nextjs", "configure health monitor", or "/nextjs-healthcheck".

BIGboss248/nextjs-wordpress

Bootstrap, configure, and verify next-intl App Router internationalization (proxy.ts/middleware.ts, next/root-params, [locale] layout, routing). Triggers on "/nextjs-i18n-setup", "setup i18n", "install next-intl", "configure next-intl", "add internationalization", "setup locale routing", "migrate to [locale]".

BIGboss248/nextjs-wordpress

Read/write translation dictionaries (messages/[locale].json), next-intl hooks (getTranslations/useTranslations), providers (Storybook/tests/subtrees), and BiDi styling. Triggers on "/nextjs-i18n-usage", "i18n dictionary", "use translations", "read dictionary", "i18n provider", "next-intl hooks", "storybook i18n", "test i18n", "add translation keys", "localize component", "create a component", "update a component".

BIGboss248/nextjs-wordpress

>- Configure, test, and verify OpenTelemetry (OTel) observability in Next.js App Router applications. Triggers on "/nextjs-otel", "setup otel", "configure opentelemetry", "test otel", or "verify opentelemetry".

BIGboss248/nextjs-wordpress

Step-by-step workflow for designing and building Next.js App Router pages (RSC page.tsx, loading skeleton, metadata, JSON-LD schema, and dynamic static params). Triggers on "/nextjs-page-dev", "create page", "new page", "develop page", "build route", or "implement page".

BIGboss248/nextjs-wordpress

>- Orchestrate end-to-end planning for Next.js App Router projects, generating canonical specifications, design systems, and a 7-phase modular implementation roadmap in docs/plan/. Triggers on "/nextjs-plan", "plan a nextjs project", "plan nextjs app", "create nextjs project plan", "outline nextjs architecture", or "generate plan".

BIGboss248/nextjs-wordpress

Workflow and engineering standards for crafting co-located Storybook CSF3 stories ([ComponentName].stories.tsx) with interactive controls, action spies, and 4 canonical theme variants.

BIGboss248/nextjs-wordpress

Self-correcting rules engine and feedback loop that learns from user corrections, mistakes, and project-specific constraints by maintaining a persistent autofix ruleset. Scans learned rules before starting any task, resolves conflicts, and automatically appends new rules upon corrections. Triggers on user corrections ("no, do it this way", "never do X", "always use Y"), /learn, "self repair", "add rule", "update rules", or when diagnosing assumptions and bugs. CRITICAL ALWAYS-ACTIVE LIFECYCLE SKILL. Must always be kept in context, loaded at session start, and consulted before starting ANY task to read and apply active constraints from autofix.json. MUST ALWAYS be triggered immediately whenever the user provides ANY correction, preference, criticism, rejection of an approach, or adjustment ("no", "don't do X", "use Y", "remember", "prefer"), or when any mistake/bug is identified. Automatically and immediately formulates and appends the new imperative rule to the project's autofix.json ruleset file.

BIGboss248/nextjs-wordpress

Setup, automate, and execute SEO audits, CI/CD pre-push/pre-deploy checks, and ranking optimizations using the seo CLI and MCP server.

BIGboss248/nextjs-wordpress

End-to-end repository onboarding and development environment setup skill. Scans repository structure, configures project metadata (docs/project.json), sets up the codebase-memory-mcp code intelligence knowledge graph server (in workspace mcp.json and globally for AGY only), configures git hooks with Husky and Commitlint, establishes multi-stage production Docker containerization, and automates credit-optimized Release Please CI/CD with multi-arch (AMD64 & ARM64) GHCR package deployment. Triggers on "/setup-repository", "setup repository", "setup repo", "initialize repository", "new repo setup", or when preparing any repository for development and AI agent workflows.

BIGboss248/nextjs-wordpress

AI screen scaffolding, layout generation, and variant exploration workflow powered by Google Stitch (StitchMCP). Consumes a component design specification (docs/design/components/[page name]/[component name]/design-spec.md), verifies and reuses the central Stitch project in docs/project.json (or creates/persists one if absent), seeds the project's design system into Stitch, synthesizes layout prompts to generate a screen and create one variant of the given design spec file, downloads and saves Stitch JPG screenshots and HTML code files directly into docs/design/components/[page name]/[component name]/stitch/ using binary-safe PowerShell Invoke-WebRequest, outputs image prompts to the user if visual assets are needed (without calling generate_image to conserve tokens), updates design-spec.md with Stitch layout benchmarks, and audits asset download integrity with an independent subagent. Triggers on "/stitch-design", "generate stitch screen", "create stitch variant", "scaffold screen with stitch", or "stitch...

관련 스킬