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 是什么?

该技能为开发人员提供了一套专门的工作流,用于在 Next.js App Router 中创建生产就绪的页面。它涵盖了完整的页面开发生命周期:从读取项目配置(如支持的语言和字典路径),到填充多语言翻译字典、生成动态元数据和 JSON-LD 结构化数据,再到实现静态预渲染和流式加载边界。技能支持异步路由参数、类型安全的 JSON-LD 模式(使用 schema-dts)、基于 Suspense 的细粒度加载状态,并提供了可复用的模板和验证脚本。主要适用于 Next.js 项目,帮助开发者以标准化、模块化的方式快速构建符合 SEO 和高性能要求的页面。

兼容平台~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 和规范 URL(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)

    • 如果页面流式传输内容或获取数据,则根据 loading.tsx.template 部署 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...

相关技能