一键导入
mandu-fs-routes
파일 시스템 라우팅 규칙. layout에 html/head/body 금지. app/ 폴더, page.tsx, route.ts, layout.tsx, [id] 작업 시 자동 호출.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
파일 시스템 라우팅 규칙. layout에 html/head/body 금지. app/ 폴더, page.tsx, route.ts, layout.tsx, [id] 작업 시 자동 호출.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Canonical Mandu agent workflow. Use first in Mandu projects before direct source edits so Codex, Claude Code, Gemini CLI, and other agents follow the same context -> plan -> apply -> verify -> repair loop.
React composition patterns for Mandu applications. Use when designing Island components, managing shared state, or building reusable component APIs. Triggers on compound components, context providers, boolean props, or component architecture tasks.
Production deployment patterns for Mandu applications
File-system based routing for Mandu. Use when creating pages, API routes, layouts, or dynamic routes. Triggers on tasks involving app/ folder, page.tsx, route.ts, layout.tsx, [id], [...slug], or URL patterns.
Architecture guard system for Mandu. Use when checking layer dependencies, enforcing architecture rules, or validating file locations. Triggers on tasks involving architecture, layers, dependencies, or guard commands.
Island Hydration pattern for Mandu. Use when creating interactive components, client-side state, or partial hydration. Triggers on tasks involving "use client", client.tsx, useState, useEffect, Island, or hydration.
| name | mandu-fs-routes |
| description | 파일 시스템 라우팅 규칙. layout에 html/head/body 금지. app/ 폴더, page.tsx, route.ts, layout.tsx, [id] 작업 시 자동 호출. |
파일 시스템 기반 라우팅. app/ 폴더의 파일 구조가 URL이 됩니다.
| File | Purpose | Export |
|---|---|---|
page.tsx | Page component | default function component |
route.ts | API handler | default Mandu.filling() chain |
layout.tsx | Shared layout | default function with children prop |
loading.tsx | Loading UI | default function component |
error.tsx | Error UI | default function component |
| File Path | URL |
|---|---|
app/page.tsx | / |
app/about/page.tsx | /about |
app/blog/[slug]/page.tsx | /blog/:slug |
app/users/[id]/page.tsx | /users/:id |
app/docs/[...path]/page.tsx | /docs/* (catch-all) |
app/(auth)/login/page.tsx | /login (grouped) |
app/api/users/route.ts | /api/users |
app/api/users/[id]/route.ts | /api/users/:id |
Layout MUST NOT include <html>, <head>, or <body> tags.
Mandu SSR generates these automatically.
// app/layout.tsx - CORRECT
export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<div className="min-h-screen bg-background font-sans antialiased">
{children}
</div>
);
}
// app/layout.tsx - WRONG (causes double-wrapping)
export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html> // <-- DO NOT include
<head /> // <-- DO NOT include
<body> // <-- DO NOT include
{children}
</body>
</html>
);
}
Nested layouts wrap child pages:
app/layout.tsx -> wraps ALL pages
app/dashboard/layout.tsx -> wraps /dashboard/* pages
// app/dashboard/page.tsx
export default function DashboardPage() {
return (
<main>
<h1>Dashboard</h1>
</main>
);
}
Pages are server-rendered by default. No "use client" needed unless using Islands.
// app/api/users/route.ts
import { Mandu } from "@mandujs/core";
export default Mandu.filling()
.get((ctx) => ctx.ok({ users: [] }))
.post(async (ctx) => {
const body = await ctx.body<{ name: string }>();
return ctx.created({ user: body });
});
API routes use .ts extension (NOT .tsx).
// app/users/[id]/page.tsx
export default function UserPage({ params }: { params: { id: string } }) {
return <h1>User {params.id}</h1>;
}
// app/docs/[...path]/page.tsx
export default function DocsPage({ params }: { params: { path: string[] } }) {
return <h1>Doc: {params.path.join("/")}</h1>;
}
Parenthesized folders create logical groups without affecting the URL:
app/(marketing)/about/page.tsx -> /about
app/(marketing)/pricing/page.tsx -> /pricing
app/(app)/dashboard/page.tsx -> /dashboard
<html>/<head>/<body> in layout.tsx (SSR does this)route.tsx instead of route.ts for API handlersmandu-mcp-create-flow — 라우트 추가 시 mandu_add_route + contract + generate 순서