Communitygithub.com

Nextra — Next.js 文档框架

你是一位 Nextra 专家。Nextra 是一个基于 Next.js 的文档框架,能将 MDX 文件渲染成带有全文搜索、深色模式、国际化(i18n)和代码高亮功能的文档站点。你帮助开发者利用 Next.js 与 Markdown 中的 React 组件支持来构建文档网站、博客和知识库。

Nextra — Next.js 文档框架 是什么?

该技能将 AI 代理定位为 Nextra 框架专家,Nextra 是基于 Next.js 构建的现代文档框架。它使用户能够快速搭建支持 MDX 的文档站点,内置功能包括 FlexSearch 驱动的全文搜索、双主题(亮/暗)模式、国际化(i18n)以及代码块语法高亮。技能描述详细指导了如何初始化项目(通过 `create-next-app` 模板或手动安装)、如何配置 `next.config.mjs` 和 `theme.config.tsx` 文件,以及如何利用 `_meta.json` 文件控制侧边栏和导航。其核心能力包括在 Markdown 中无缝使用 React 组件(如 `<Tabs>`、`<Steps>`、`<Cards>` 和 `<FileTree>`),并通过 MDX 实现交互式文档。该技能适用于 Cursor、Claude Code 等 AI 编程代理,在开发文档站点、博客或知识库等场景下提供指导。通过遵循技能提供的设置指南和最佳实践,代理能够高效地启动新文档项目、对现有站点进行配置调整,或利用 Nextra 的内置功能(如 Vercel 的一键部署)来增强文档体验。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/ComeOnOliver/skillshub/tree/HEAD/skills/TerminalSkills/skills/nextra

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

Nextra — Next.js 文档框架 是做什么的?

概述

你是一位 Nextra 专家。Nextra 是一个基于 Next.js 的文档框架,能将 MDX 文件渲染成带有全文搜索、深色模式、国际化(i18n)和代码高亮功能的文档站点。你帮助开发者利用 Next.js 与 Markdown 中的 React 组件支持来构建文档网站、博客和知识库。

指令

设置

npx create-next-app my-docs --example https://github.com/shuding/nextra-docs-template
cd my-docs && npm run dev

# 或者添加到现有 Next.js 项目
npm install nextra nextra-theme-docs

配置

// next.config.mjs
import nextra from "nextra";

const withNextra = nextra({
  theme: "nextra-theme-docs",
  themeConfig: "./theme.config.tsx",
  defaultShowCopyCode: true,
  search: { codeblocks: true },        // 也在代码块内搜索
});

export default withNextra({
  reactStrictMode: true,
});
// theme.config.tsx
import { DocsThemeConfig } from "nextra-theme-docs";

const config: DocsThemeConfig = {
  logo: <span style={{ fontWeight: 800 }}>My SDK</span>,
  project: { link: "https://github.com/org/repo" },
  chat: { link: "https://discord.gg/xxx" },
  docsRepositoryBase: "https://github.com/org/repo/tree/main/docs",
  footer: { text: "MIT License © 2026" },
  useNextSeoProps() {
    return { titleTemplate: "%s — My SDK Docs" };
  },
  head: (
    <>
      <meta name="viewport" content="width=device-width, initial-scale=1.0" />
      <link rel="icon" href="/favicon.ico" />
    </>
  ),
  sidebar: { defaultMenuCollapseLevel: 1, toggleButton: true },
  toc: { float: true, backToTop: true },
  navigation: { prev: true, next: true },
};
export default config;

MDX 页面

---
title: 入门指南
description: My SDK 快速入门指南
---

import { Callout, Tabs, Tab, Steps, Cards, Card, FileTree } from 'nextra/components'

# 入门指南

<Callout type="info">
  本指南假设您已安装 Node.js 18+。
</Callout>

## 安装

<Tabs items={['npm', 'yarn', 'pnpm']}>
  <Tab>```bash npm install my-sdk ```</Tab>
  <Tab>```bash yarn add my-sdk ```</Tab>
  <Tab>```bash pnpm add my-sdk ```</Tab>
</Tabs>

## 快速开始

<Steps>
### 安装 SDK
```bash
npm install my-sdk

初始化客户端

import { SDK } from "my-sdk";
const client = new SDK({ apiKey: process.env.API_KEY });

发起您的第一个请求

const users = await client.users.list();
console.log(users);

项目结构

相关资源

自动导航

## 基于文件的路由
pages/
  index.mdx           → /
  getting-started.mdx  → /getting-started
  guide/
    _meta.json         → 侧边栏顺序和标签
    installation.mdx   → /guide/installation
    configuration.mdx  → /guide/configuration
  api/
    _meta.json
    reference.mdx      → /api/reference

## _meta.json — 控制侧边栏顺序
{
  "installation": "安装",
  "configuration": "配置",
  "authentication": "认证",
  "-- Separator": { "type": "separator", "title": "高级" },
  "plugins": "插件",
  "migration": "迁移指南"
}

安装

npm install nextra nextra-theme-docs

示例

示例 1: 用户要求设置 nextra

用户:“帮我为我的项目设置 nextra”

代理应:

  1. 检查系统要求和先决条件
  2. 安装或配置 nextra
  3. 设置初始项目结构
  4. 验证设置是否正确工作

示例 2: 用户要求使用 nextra 构建功能

用户:“使用 nextra 创建一个仪表盘”

代理应:

  1. 搭建组件或配置脚手架
  2. 连接到适当的数据源
  3. 实现请求的功能
  4. 测试并验证输出

指南

  1. MDX 实现交互性 — 在文档中使用 React 组件(标签页、提示框、交互式示例);MDX 使得这一切无缝衔接
  2. 使用 _meta.json 组织内容 — 通过 _meta.json 控制侧边栏顺序和标签;不要依赖按字母顺序的文件排序
  3. 内置搜索 — Nextra 包含基于 FlexSearch 的全文搜索;中小型站点无需配置 Algolia
  4. Next.js 特性 — 您可以利用 SSR、ISR、API 路由以及整个 Next.js 生态系统;这对于交互式文档非常有用
  5. 代码块功能 — 启用 defaultShowCopyCode、文件名标签和代码块中的行高亮
  6. 内置深色模式 — Nextra 的文档主题包含深色模式切换按钮;所有组件都会自动适配
  7. 国际化(i18n)支持 — 内置国际化功能;创建具有相同结构的语言文件夹(en/、ja/、zh/)即可
  8. 部署到 Vercel — 一键部署;每次包含文档更改的 PR 都会自动生成预览部署

Individual skills in this repo

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

ComeOnOliver/skillshub

Create stunning, animation-rich HTML presentations from scratch or by converting PowerPoint files. Use when the user wants to build a presentation, convert a PPT/PPTX to web, or create slides for a talk/pitch. Helps non-designers discover their aesthetic through visual exploration rather than abstract choices.

ComeOnOliver/skillshub

Next.js 16+ 和 Turbopack — 增量打包、文件系统缓存、开发速度,以及何时使用 Turbopack 与 webpack。

ComeOnOliver/skillshub

SwiftUI architecture patterns, state management with @Observable, view composition, navigation, performance optimization, and modern iOS/macOS UI best practices.

ComeOnOliver/skillshub

See, Understand, Act on video and audio. See- ingest from local files, URLs, RTSP/live feeds, or live record desktop; return realtime context and playable stream links. Understand- extract frames, build visual/semantic/temporal indexes, and search moments with timestamps and auto-clips. Act- transcode and normalize (codec, fps, resolution, aspect ratio), perform timeline edits (subtitles, text/image overlays, branding, audio overlays, dubbing, translation), generate media assets (image, audio, video), and create real time alerts for events from live streams or desktop capture.

ComeOnOliver/skillshub

AI-assisted video editing workflows for cutting, structuring, and augmenting real footage. Covers the full pipeline from raw capture through FFmpeg, Remotion, ElevenLabs, fal.ai, and final polish in Descript or CapCut. Use when the user wants to edit video, cut footage, create vlogs, or build video content.

ComeOnOliver/skillshub

Next.js 15 애플리케이션을 위한 프론트엔드 개발 가이드라인. React 19, TypeScript, Shadcn/ui, Tailwind CSS를 사용한 모던 패턴. Server Components, Client Components, App Router, 파일 구조, Shadcn/ui 컴포넌트, 성능 최적화, TypeScript 모범 사례 포함. 컴포넌트, 페이지, 기능 생성, 데이터 페칭, 스타일링, 라우팅, 프론트엔드 코드 작업 시 사용.

ComeOnOliver/skillshub

Provides Tamagui patterns for config v4, compiler optimization, styled context, and cross-platform styling. Must use when working with Tamagui projects (tamagui.config.ts, @tamagui imports).

ComeOnOliver/skillshub

Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.

ComeOnOliver/skillshub

Create high-converting, visually distinctive landing pages. Use when building marketing pages, product launches, SaaS homepages, or any single-page conversion-focused website. Guides section-by-section composition with anti-AI-slop principles.

ComeOnOliver/skillshub

Auto-loaded context for Portfolio Buddy 2 development. Use for ANY task involving: React 19 development, TypeScript, portfolio analysis features, metrics calculations, trading strategy comparison, or working with the Portfolio Buddy 2 codebase. Contains tech stack, known issues, and architectural constraints.

ComeOnOliver/skillshub

Next.js development tooling via MCP. Inspect routes, components, build info, and debug Next.js apps. Use when working on Next.js applications, debugging routing, or inspecting app structure. NOT for general React or non-Next.js projects.

ComeOnOliver/skillshub

Implement UI using Shadcn MCP (atoms/theme) and 21st.dev MCP (complex sections). Use when adding buttons, layouts, or generating landing pages.

ComeOnOliver/skillshub

A conceptual skill for building an API client in Next.js that handles JWT tokens

ComeOnOliver/skillshub

Best practices and patterns for Next.js App Router, Server Actions, and Routing in this project.

ComeOnOliver/skillshub

The Design System, Theme, and UX rules for the Physical AI Hub.

ComeOnOliver/skillshub

Comprehensive frontend development skill for building modern, performant web applications using ReactJS, NextJS, TypeScript, Tailwind CSS. Includes component scaffolding, performance optimization, bundle analysis, and UI best practices. Use when developing frontend features, optimizing performance, implementing UI/UX designs, managing state, or reviewing frontend code.

ComeOnOliver/skillshub

This document captures learnings from fixing keyboard navigation issues when floating components (Select, DropdownMenu, Popover) have CSS open/close animations.

ComeOnOliver/skillshub

Build Next.js 16 applications with correct patterns and distinctive design. Use when creating pages, layouts, dynamic routes, upgrading from Next.js 15, or implementing proxy.ts. Covers breaking changes (async params/searchParams, Turbopack, cacheComponents) and frontend aesthetics. NOT when building non-React or backend-only applications.

ComeOnOliver/skillshub

Comprehensive Framer Motion animation library for React. Covers motion components, variants, gestures, page transitions, and scroll animations. Use when adding animations to React/Next.js applications.

ComeOnOliver/skillshub

Build interfaces that resonate, not just render. This skill enforces bold, intentional

相关技能