Token导航 LogoToken导航TokenDH.com
前端设计需要联网github未标认证来源可访问许可证需确认审计通过

scaffold-nextjs-appscaffold Next.js 应用

Agent Skill

用于辅助前端页面、组件、样式和交互逻辑的开发与维护。它适合让 Agent 生成或审查 React、Next.js、Vue、Tailwind、CSS 等相关代码,整理组件结构,或定位布局和性能问题。使用时需要结合项目现有设计系统、路由和构建方式,避免只生成孤立片段;涉及页面改动时,应配合本地预览和构建检查确认视觉效果。

总安装

432

周安装

18

GitHub Stars

12

下载量

144
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:scaffold-nextjs-app(scaffold Next.js 应用)
来源仓库:https://github.com/pjt222/development-guides
仓库路径:skills/scaffold-nextjs-app
安装命令:
npx skills add https://github.com/pjt222/development-guides --skill scaffold-nextjs-app
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/pjt222/development-guides --skill scaffold-nextjs-app

简介

scaffold-nextjs-app 为 Next.js 应用提供页面与组件脚手架支持。

  • 适用于快速搭建全栈应用的前端结构与交互逻辑。
  • 通过 npx skills add 命令从 development-guides 仓库安装调用。
  • 需确认 Tailwind、TypeScript 等依赖已正确配置。
  • 建议结合路由定义与 API 层进行端到端测试验证。

SKILL.md

Scaffold Next.js App

Create a new Next.js application with App Router, TypeScript, and production-ready defaults.

When to Use

  • Starting a new web application project
  • Creating a React-based frontend with server-side rendering
  • Building a full-stack application with API routes
  • Setting up a TypeScript web project

Inputs

  • Required: Application name
  • Required: Package manager preference (npm, yarn, pnpm)
  • Optional: Whether to include Tailwind CSS (default: yes)
  • Optional: Whether to include ESLint (default: yes)
  • Optional: src/ directory structure (default: yes)

Procedure

Step 1: Create Project

npx create-next-app@latest my-app \
  --typescript \
  --tailwind \
  --eslint \
  --app \
  --src-dir \
  --import-alias "@/*"

Answer prompts or use flags to set all options non-interactively.

Expected: Project directory created with all dependencies installed.

On failure: Check Node.js version (node --version, must be >= 18.17). Ensure npx is available. If the command hangs on prompts, add the --use-npm flag (or --use-pnpm/--use-yarn) to skip the package manager prompt.

Step 2: Verify Project Structure

my-app/
├── src/
│   ├── app/
│   │   ├── layout.tsx        # Root layout
│   │   ├── page.tsx          # Home page
│   │   ├── globals.css       # Global styles
│   │   └── favicon.ico
│   └── lib/                  # Shared utilities (create manually)
├── public/                   # Static assets
├── next.config.ts            # Next.js configuration
├── tailwind.config.ts        # Tailwind configuration
├── tsconfig.json             # TypeScript configuration
├── package.json
└── .eslintrc.json

Expected: All listed directories and files are present.

On failure: If src/ directory is missing, the --src-dir flag was not passed. Re-run create-next-app with the flag, or move files manually into src/app/.

Step 3: Configure Next.js

Edit next.config.ts for project needs:

import type { NextConfig } from "next";

const nextConfig: NextConfig = {
  // Enable React strict mode
  reactStrictMode: true,

  // Image optimization domains
  images: {
    remotePatterns: [
      {
        protocol: "https",
        hostname: "example.com",
      },
    ],
  },
};

export default nextConfig;

Expected: next.config.ts saved without TypeScript errors.

On failure: If the file uses .js extension instead of .ts, rename it. Ensure NextConfig type is imported from "next".

Step 4: Set Up Directory Conventions

Create common directories:

mkdir -p src/app/api
mkdir -p src/components
mkdir -p src/lib
mkdir -p src/types

Expected: All four directories created under src/.

On failure: If src/ does not exist, create it first or adjust paths to match the project structure (non-src layout uses app/ at the root).

Step 5: Create Base Layout

Edit src/app/layout.tsx:

import type { Metadata } from "next";
import { Inter } from "next/font/google";
import "./globals.css";

const inter = Inter({ subsets: ["latin"] });

export const metadata: Metadata = {
  title: "My Application",
  description: "Application description",
};

export default function RootLayout({
  children,
}: {
  children: React.ReactNode;
}) {
  return (
    <html lang="en">
      <body className={inter.className}>{children}</body>
    </html>
  );
}

Expected: Layout renders with the Inter font and wraps all pages.

On failure: If font fails to load, check network access. Replace Inter with a system font fallback as a temporary workaround.

Step 6: Add Example API Route

Create src/app/api/health/route.ts:

import { NextResponse } from "next/server";

export async function GET() {
  return NextResponse.json({ status: "ok", timestamp: new Date().toISOString() });
}

Expected: File created at src/app/api/health/route.ts.

On failure: Ensure the api/health/ directory exists. The file must export named HTTP method handlers (GET, POST, etc.), not a default export.

Step 7: Run Development Server

cd my-app
npm run dev

Expected: Application running at http://localhost:3000.

On failure: Check Node.js version (>= 18.17). Run npm install if dependencies are missing.

Validation

  • npm run dev starts without errors
  • Home page loads at localhost:3000
  • TypeScript compilation succeeds
  • Tailwind CSS classes are applied
  • API route responds at /api/health
  • ESLint runs without errors (npm run lint)

Common Pitfalls

  • Node.js version: Next.js requires Node.js >= 18.17. Check with node --version.
  • Port conflicts: Default port 3000 may be in use. Use npm run dev -- -p 3001.
  • Import alias confusion: @/* maps to src/*. Don't confuse with node_modules imports.
  • Pages vs App Router: Ensure you're using App Router (src/app/) not Pages Router (src/pages/).

Related Skills

  • setup-tailwind-typescript - detailed Tailwind and TypeScript configuration
  • deploy-to-vercel - deploy the scaffolded app
  • configure-git-repository - version control setup

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

34.68%
按下载量换算50

Claude

30.91%
按下载量换算45

Cursor

17.04%
按下载量换算25

Gemini CLI

9.04%
按下载量换算13

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills