Skip to main content

create-next-app-existing-dir

When running create-next-app in an existing directory (e.g. backend/): remove or rename existing package.json if the tool refuses to overwrite; prefer absolute path for target; for API-only setups, strip UI (layout, page, globals, public) and clear .next before re-running type-check. Use when scaffolding Next.js in an existing folder.

跳到安装

来源信息

仓库
pmarashian/cursor-agent-skills
最近来源活动
2026年2月13日 19:51
检测到的 SKILL.md 语言
英语
星标
2
分支
1

安装方式

默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。

检查来源文件

决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。

正在显示 SKILL.md

SKILL.md
来源说明 · 只读预览
name
create-next-app-existing-dir
description
When running create-next-app in an existing directory (e.g. backend/): remove or rename existing package.json if the tool refuses to overwrite; prefer absolute path for target; for API-only setups, strip UI (layout, page, globals, public) and clear .next before re-running type-check. Use when scaffolding Next.js in an existing folder.
# Create-Next-App in Existing Directory When running create-next-app **inside an existing directory** (e.g. `backend/`): ## Checklist 1. **Existing package.json**: If the tool refuses to overwrite, remove or rename the existing `package.json` in that directory before re-running. 2. **Target path**: Prefer an **absolute path** for the target directory to avoid `cd`/sandbox issues. 3. **API-only setup**: For API-only backends, after scaffolding: strip UI (layout, page, globals, public) as needed and clear `.next` before re-running type-check. ## Optional - Link to **monorepo-backend-layout** so the agent treats the backend directory as the app root. ## Why This Matters Tasks have lost ~20–25 seconds to create-next-app retries (existing package.json, then path issues). A short checklist prevents repeated failures.
在 GitHub 查看