Communitygithub.com

BIGboss248/nextjs-wordpress

逐步工作流程,用於設計和建置 Next.js App Router 頁面(RSC page.tsx、載入骨架、中繼資料、JSON-LD 結構化資料與動態靜態參數)。觸發詞為「/nextjs-page-dev」、「create page」、「new page」、「develop page」、「build route」或「implement page」。

nextjs-wordpress 是什麼?

此技能「nextjs-page-dev」提供了一個專門的工作流程,用於在 Next.js App Router 中建立可供生產環境使用的頁面。它強調使用非同步路由參數、在地化翻譯字典、動態中繼資料、型別安全的 JSON-LD 結構化資料(透過 schema-dts)以及靜態預先渲染(generateStaticParams)。此技能涵蓋了從規劃到驗證的完整開發生命週期,包括從 project.json 讀取專案設定、填充在地化字典、建立載入骨架(loading.tsx)、實作頁面元件(page.tsx)以及執行驗證腳本。對於需要遵循嚴格 SEO、結構化資料及串流邊界標準的開發團隊而言,此技能特別有用,適合在 Cursor、Claude Code 或 Codex 等 AI 代理程式中使用。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/BIGboss248/nextjs-wordpress/tree/HEAD/.agents/skills/nextjs-page-dev

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

Next.js 頁面與路由開發 (nextjs-page-dev)

專門的工作流程,用於建立可供生產環境使用的 Next.js App Router 頁面,包含非同步路由參數、在地化翻譯字典、動態中繼資料、型別安全的 JSON-LD 結構化資料(schema-dts)以及靜態預先渲染。

[!TIP] 模組化資源與深度指南:


架構規則與標準

1. 規劃情境與路由註冊表

  • 讀取 docs/project.json 以解析 supported_languages、dictionaries_dir(預設值:"messages")以及 new_component_dir。
  • 所有導航 URL 必須引用來自 @/lib/routes 或 @/i18n/navigation 的 ROUTES。
  • 目標頁面路徑階層:app/[locale]/<route-path>/page.tsx(若是非在地化的頁面,則為 app/<route-path>/page.tsx)。

2. 零硬編碼與字典填充

  • 無硬編碼文字: 在撰寫 JSX 之前,必須先將頁面標題、大標題、描述及靜態標籤新增到所有 supported_languages 的 messages/[locale].json 檔案中。
  • RSC 翻譯: 在伺服器元件中使用 await getTranslations('<namespace>') 讀取翻譯。

3. SEO、中繼資料與 JSON-LD

  • 動態中繼資料: 匯出 generateMetadata({ params, searchParams }: Props) 以提供動態的 title、description 和標準網址(alternates: { canonical: ... })。
  • 結構化資料: 使用 schema-dts(WithContext<T>)注入型別化的 JSON-LD,並包裹在 <script type="application/ld+json"> 中,且將 < 字元跳脫為 \u003c。
  • 請參閱 references/seo-structured-data-guide.md 以了解結構定義。

4. 靜態預先渲染 (generateStaticParams)

  • 如果頁面位於 [locale] 動態區段(或任何動態區段)之下,且 supported_languages 包含多於一個地區設定,則匯出 generateStaticParams(),針對所有支援的地區設定回傳 { locale }。

5. 即時導航與細粒度 Suspense 下推

  • 細粒度載入狀態:將 <Suspense> 下推到特定的動態子元件,以便靜態/快取區段(頁首、英雄區塊、快取的產品資訊)能立即提升至靜態外殼與應用程式外殼中。
  • 選擇退出:如果某個區段本質上是動態的,且不需要即時回饋,則可設定 export const instant = false。
  • 請參閱 references/streaming-and-boundaries.md 以了解串流模式。

工作流程步驟

  • 步驟 0:產生實作計畫與核准關卡

    • 讀取 docs/project.json 以及在 lib/routes.ts 中的目標路由定義。
    • 規劃頁面中繼資料、JSON-LD 結構化資料類型、翻譯命名空間以及元件佈局。
    • 如果正在建立主要的新頁面,請向使用者呈現簡潔的實作計畫。
  • 步驟 1:填充翻譯字典

    • 在專用的頁面命名空間下,將頁面標題、中繼描述以及頁面內文新增到所有地區設定檔案(messages/en.json、messages/fa.json 等)中。
  • 步驟 2:建立伴隨骨架 (loading.tsx)

  • 步驟 3:實作頁面元件 (page.tsx)

    • 部署並自訂 page.tsx.template:
      1. 定義非同步 props 介面(params: Promise<{ locale: string, ... }>、searchParams)。
      2. 匯出 generateMetadata() 以解析動態標題和標準替代網址。
      3. 為在地化/動態路由匯出 generateStaticParams()。
      4. 實作頁面 RSC,組合來自 <new_component_dir>/<page-name>/ 的區段元件。
      5. 渲染 <JsonLd> 結構化資料元件。
  • 步驟 4:驗證與完整性檢查

    • 執行頁面驗證腳本:
      • Windows (PowerShell):
        pwsh .agents/skills/nextjs-page-dev/scripts/verify-page.ps1 -RoutePath <route_dir>
        
      • Linux / macOS (Bash):
        bash .agents/skills/nextjs-page-dev/scripts/verify-page.sh <route_dir>
        
    • 確保沒有 TypeScript 錯誤或缺少字典的錯誤。
  • 步驟 5:同步實作計畫檢查清單

    • 在 docs/plan/05-pages-and-components.md 中,將已完成頁面基礎架構項目(page.tsx、loading.tsx、error.tsx、generateMetadata、JSON-LD Schema、generateStaticParams())標記為已完成。
    • 如果此頁面的所有子元件檢查清單與頁面基礎架構任務皆已完成,請將父層頁面項目標記為已完成(- [x])。

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

>- 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

>- Build Next.js e-commerce frontends backed by WooCommerce APIs, handling ISR catalogs, cart sessions, and JWT authentication. Use when building or querying Next.js stores with WooCommerce.

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...

相關技能