@mandujs/mcp 0.13.0 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. package/README.md +6 -7
  2. package/package.json +3 -2
  3. package/src/adapters/index.ts +20 -20
  4. package/src/adapters/monitor-adapter.ts +100 -100
  5. package/src/adapters/tool-adapter.ts +88 -88
  6. package/src/executor/error-handler.ts +250 -250
  7. package/src/executor/index.ts +22 -22
  8. package/src/executor/tool-executor.ts +148 -148
  9. package/src/hooks/config-watcher.ts +174 -174
  10. package/src/hooks/index.ts +23 -23
  11. package/src/hooks/mcp-hooks.ts +227 -227
  12. package/src/logging/index.ts +15 -15
  13. package/src/logging/mcp-transport.ts +134 -134
  14. package/src/registry/index.ts +13 -13
  15. package/src/registry/mcp-tool-registry.ts +298 -298
  16. package/src/resources/skills/guides.ts +1136 -1136
  17. package/src/resources/skills/index.ts +12 -12
  18. package/src/resources/skills/loader.ts +218 -218
  19. package/src/resources/skills/mandu-composition/SKILL.md +91 -91
  20. package/src/resources/skills/mandu-composition/metadata.json +13 -13
  21. package/src/resources/skills/mandu-composition/rules/_sections.md +26 -26
  22. package/src/resources/skills/mandu-composition/rules/_template.md +77 -77
  23. package/src/resources/skills/mandu-composition/rules/comp-arch-avoid-boolean-props.md +146 -146
  24. package/src/resources/skills/mandu-composition/rules/comp-arch-compound-components.md +164 -164
  25. package/src/resources/skills/mandu-composition/rules/comp-island-event.md +161 -161
  26. package/src/resources/skills/mandu-composition/rules/comp-island-slot-split.md +167 -167
  27. package/src/resources/skills/mandu-composition/rules/comp-pattern-children.md +149 -149
  28. package/src/resources/skills/mandu-composition/rules/comp-state-context-interface.md +148 -148
  29. package/src/resources/skills/mandu-composition/rules/comp-state-lift-state.md +150 -150
  30. package/src/resources/skills/mandu-deployment/SKILL.md +92 -92
  31. package/src/resources/skills/mandu-deployment/_sections.md +41 -41
  32. package/src/resources/skills/mandu-deployment/_template.md +38 -38
  33. package/src/resources/skills/mandu-deployment/metadata.json +13 -13
  34. package/src/resources/skills/mandu-deployment/rules/deploy-build-bun.md +109 -109
  35. package/src/resources/skills/mandu-deployment/rules/deploy-build-output.md +115 -115
  36. package/src/resources/skills/mandu-deployment/rules/deploy-cicd-github.md +219 -219
  37. package/src/resources/skills/mandu-deployment/rules/deploy-docker-bun.md +150 -150
  38. package/src/resources/skills/mandu-deployment/rules/deploy-docker-compose.md +223 -223
  39. package/src/resources/skills/mandu-deployment/rules/deploy-platform-fly.md +152 -152
  40. package/src/resources/skills/mandu-deployment/rules/deploy-platform-render.md +179 -179
  41. package/src/resources/skills/mandu-deployment/rules/deploy-platform-supabase.md +323 -323
  42. package/src/resources/skills/mandu-deployment/rules/deploy-platform-vercel.md +140 -140
  43. package/src/resources/skills/mandu-fs-routes/SKILL.md +82 -82
  44. package/src/resources/skills/mandu-fs-routes/metadata.json +12 -12
  45. package/src/resources/skills/mandu-fs-routes/rules/_sections.md +36 -36
  46. package/src/resources/skills/mandu-fs-routes/rules/_template.md +69 -69
  47. package/src/resources/skills/mandu-fs-routes/rules/routes-api-methods.md +65 -65
  48. package/src/resources/skills/mandu-fs-routes/rules/routes-dynamic-param.md +93 -93
  49. package/src/resources/skills/mandu-fs-routes/rules/routes-naming-page.md +55 -55
  50. package/src/resources/skills/mandu-guard/SKILL.md +129 -129
  51. package/src/resources/skills/mandu-guard/metadata.json +12 -12
  52. package/src/resources/skills/mandu-guard/rules/_sections.md +36 -36
  53. package/src/resources/skills/mandu-guard/rules/_template.md +82 -82
  54. package/src/resources/skills/mandu-guard/rules/guard-config-rules.md +100 -100
  55. package/src/resources/skills/mandu-guard/rules/guard-layer-direction.md +76 -76
  56. package/src/resources/skills/mandu-guard/rules/guard-preset-mandu.md +81 -81
  57. package/src/resources/skills/mandu-guard/rules/guard-validate-import.md +80 -80
  58. package/src/resources/skills/mandu-hydration/SKILL.md +91 -91
  59. package/src/resources/skills/mandu-hydration/metadata.json +12 -12
  60. package/src/resources/skills/mandu-hydration/rules/_sections.md +31 -31
  61. package/src/resources/skills/mandu-hydration/rules/_template.md +72 -72
  62. package/src/resources/skills/mandu-hydration/rules/hydration-data-event.md +109 -109
  63. package/src/resources/skills/mandu-hydration/rules/hydration-directive-use-client.md +55 -55
  64. package/src/resources/skills/mandu-hydration/rules/hydration-island-setup.md +113 -113
  65. package/src/resources/skills/mandu-hydration/rules/hydration-priority-visible.md +68 -68
  66. package/src/resources/skills/mandu-performance/SKILL.md +85 -85
  67. package/src/resources/skills/mandu-performance/metadata.json +14 -14
  68. package/src/resources/skills/mandu-performance/rules/_sections.md +31 -31
  69. package/src/resources/skills/mandu-performance/rules/_template.md +64 -64
  70. package/src/resources/skills/mandu-performance/rules/perf-async-defer-await.md +103 -103
  71. package/src/resources/skills/mandu-performance/rules/perf-async-parallel.md +95 -95
  72. package/src/resources/skills/mandu-performance/rules/perf-bun-file.md +124 -124
  73. package/src/resources/skills/mandu-performance/rules/perf-bun-serve.md +125 -125
  74. package/src/resources/skills/mandu-performance/rules/perf-bundle-imports.md +80 -80
  75. package/src/resources/skills/mandu-performance/rules/perf-bundle-island-lazy.md +145 -145
  76. package/src/resources/skills/mandu-performance/rules/perf-cache-react.md +98 -98
  77. package/src/resources/skills/mandu-performance/rules/perf-render-transitions.md +154 -154
  78. package/src/resources/skills/mandu-security/SKILL.md +87 -87
  79. package/src/resources/skills/mandu-security/metadata.json +13 -13
  80. package/src/resources/skills/mandu-security/rules/_sections.md +31 -31
  81. package/src/resources/skills/mandu-security/rules/_template.md +74 -74
  82. package/src/resources/skills/mandu-security/rules/sec-auth-guard.md +127 -127
  83. package/src/resources/skills/mandu-security/rules/sec-env-management.md +133 -133
  84. package/src/resources/skills/mandu-security/rules/sec-input-validate.md +148 -148
  85. package/src/resources/skills/mandu-security/rules/sec-protect-csrf.md +146 -146
  86. package/src/resources/skills/mandu-security/rules/sec-protect-headers.md +138 -138
  87. package/src/resources/skills/mandu-slot/SKILL.md +85 -85
  88. package/src/resources/skills/mandu-slot/metadata.json +12 -12
  89. package/src/resources/skills/mandu-slot/rules/_sections.md +36 -36
  90. package/src/resources/skills/mandu-slot/rules/_template.md +63 -63
  91. package/src/resources/skills/mandu-slot/rules/slot-basic-structure.md +38 -38
  92. package/src/resources/skills/mandu-slot/rules/slot-ctx-response.md +56 -56
  93. package/src/resources/skills/mandu-slot/rules/slot-guard-auth.md +59 -59
  94. package/src/resources/skills/mandu-slot/rules/slot-http-methods.md +64 -64
  95. package/src/resources/skills/mandu-styling/SKILL.md +154 -154
  96. package/src/resources/skills/mandu-styling/_sections.md +43 -43
  97. package/src/resources/skills/mandu-styling/_template.md +32 -32
  98. package/src/resources/skills/mandu-styling/metadata.json +15 -15
  99. package/src/resources/skills/mandu-styling/rules/style-component-compound.md +235 -235
  100. package/src/resources/skills/mandu-styling/rules/style-component-slots.md +255 -255
  101. package/src/resources/skills/mandu-styling/rules/style-component-tokens.md +205 -205
  102. package/src/resources/skills/mandu-styling/rules/style-island-animations.md +272 -272
  103. package/src/resources/skills/mandu-styling/rules/style-island-scoping.md +167 -167
  104. package/src/resources/skills/mandu-styling/rules/style-island-variants.md +221 -221
  105. package/src/resources/skills/mandu-styling/rules/style-perf-critical.md +209 -209
  106. package/src/resources/skills/mandu-styling/rules/style-perf-purge.md +192 -192
  107. package/src/resources/skills/mandu-styling/rules/style-setup-modules.md +162 -162
  108. package/src/resources/skills/mandu-styling/rules/style-setup-panda.md +164 -164
  109. package/src/resources/skills/mandu-styling/rules/style-setup-tailwind.md +170 -170
  110. package/src/resources/skills/mandu-styling/rules/style-tailwind-v4-gotchas.md +179 -179
  111. package/src/resources/skills/mandu-styling/rules/style-theme-darkmode.md +229 -229
  112. package/src/resources/skills/mandu-testing/SKILL.md +99 -99
  113. package/src/resources/skills/mandu-testing/metadata.json +13 -13
  114. package/src/resources/skills/mandu-testing/rules/_sections.md +26 -26
  115. package/src/resources/skills/mandu-testing/rules/_template.md +65 -65
  116. package/src/resources/skills/mandu-testing/rules/test-component-island.md +195 -195
  117. package/src/resources/skills/mandu-testing/rules/test-e2e-playwright.md +196 -196
  118. package/src/resources/skills/mandu-testing/rules/test-mock-fetch.md +219 -219
  119. package/src/resources/skills/mandu-testing/rules/test-slot-unit.md +192 -192
  120. package/src/resources/skills/mandu-ui/SKILL.md +117 -117
  121. package/src/resources/skills/mandu-ui/_sections.md +23 -23
  122. package/src/resources/skills/mandu-ui/_template.md +32 -32
  123. package/src/resources/skills/mandu-ui/metadata.json +13 -13
  124. package/src/resources/skills/mandu-ui/rules/ui-accessibility-aria.md +232 -232
  125. package/src/resources/skills/mandu-ui/rules/ui-accessibility-focus.md +238 -238
  126. package/src/resources/skills/mandu-ui/rules/ui-composition-patterns.md +259 -259
  127. package/src/resources/skills/mandu-ui/rules/ui-island-integration.md +258 -258
  128. package/src/resources/skills/mandu-ui/rules/ui-radix-patterns.md +213 -213
  129. package/src/resources/skills/mandu-ui/rules/ui-shadcn-setup.md +209 -209
  130. package/src/resources/skills/recipes.ts +932 -932
  131. package/src/tools/ate.ts +129 -0
  132. package/src/tools/index.ts +4 -1
  133. package/src/tools/project.ts +334 -334
  134. package/src/tools/runtime.ts +497 -497
  135. package/src/tools/seo.ts +417 -417
  136. package/src/utils/withWarnings.ts +83 -83
@@ -1,140 +1,140 @@
1
- ---
2
- title: Deploy to Vercel
3
- impact: MEDIUM
4
- impactDescription: Serverless deployment with edge functions
5
- tags: deployment, vercel, serverless, edge
6
- ---
7
-
8
- ## Deploy to Vercel
9
-
10
- **Impact: MEDIUM (Serverless deployment with edge functions)**
11
-
12
- Vercel을 사용하여 Mandu 앱을 서버리스로 배포하세요.
13
-
14
- **vercel.json 설정:**
15
-
16
- ```json
17
- {
18
- "buildCommand": "bun run build",
19
- "outputDirectory": "dist",
20
- "framework": null,
21
- "functions": {
22
- "api/**/*.ts": {
23
- "runtime": "nodejs20.x",
24
- "memory": 1024,
25
- "maxDuration": 10
26
- }
27
- },
28
- "rewrites": [
29
- { "source": "/api/(.*)", "destination": "/api/$1" },
30
- { "source": "/(.*)", "destination": "/index.html" }
31
- ]
32
- }
33
- ```
34
-
35
- **주의사항:**
36
- Vercel은 Bun 런타임을 직접 지원하지 않으므로, Node.js 호환 모드로 빌드해야 합니다.
37
-
38
- **Node.js 호환 빌드:**
39
-
40
- ```typescript
41
- // scripts/build-vercel.ts
42
- await Bun.build({
43
- entrypoints: ["./src/server.ts"],
44
- outdir: "./dist",
45
- target: "node", // Node.js 타겟으로 빌드
46
- minify: true,
47
- external: ["@vercel/node"],
48
- });
49
- ```
50
-
51
- ## API Routes 변환
52
-
53
- ```typescript
54
- // api/users/index.ts (Vercel Serverless Function)
55
- import type { VercelRequest, VercelResponse } from "@vercel/node";
56
- import { createHandler } from "@mandujs/vercel";
57
- import usersSlot from "../../app/users/slot";
58
-
59
- export default createHandler(usersSlot);
60
- ```
61
-
62
- **createHandler 구현:**
63
-
64
- ```typescript
65
- // lib/vercel.ts
66
- import type { VercelRequest, VercelResponse } from "@vercel/node";
67
-
68
- export function createHandler(slot: Slot) {
69
- return async (req: VercelRequest, res: VercelResponse) => {
70
- const method = req.method?.toLowerCase() || "get";
71
- const handler = slot.handlers[method];
72
-
73
- if (!handler) {
74
- return res.status(405).json({ error: "Method not allowed" });
75
- }
76
-
77
- const ctx = createContext(req);
78
- const result = await handler(ctx);
79
-
80
- return res.status(result.status || 200).json(result.body);
81
- };
82
- }
83
- ```
84
-
85
- ## Edge Functions
86
-
87
- ```typescript
88
- // api/geo.ts
89
- export const config = {
90
- runtime: "edge",
91
- };
92
-
93
- export default async function handler(request: Request) {
94
- const geo = request.headers.get("x-vercel-ip-country");
95
-
96
- return new Response(JSON.stringify({ country: geo }), {
97
- headers: { "Content-Type": "application/json" },
98
- });
99
- }
100
- ```
101
-
102
- ## 환경 변수
103
-
104
- ```bash
105
- # Vercel CLI로 환경 변수 설정
106
- vercel env add DATABASE_URL production
107
- vercel env add SESSION_SECRET production
108
-
109
- # .env.local (로컬 개발)
110
- DATABASE_URL=postgresql://localhost:5432/mandu
111
- SESSION_SECRET=dev-secret
112
- ```
113
-
114
- ## 배포
115
-
116
- ```bash
117
- # Vercel CLI 설치
118
- npm install -g vercel
119
-
120
- # 프로젝트 연결
121
- vercel link
122
-
123
- # Preview 배포
124
- vercel
125
-
126
- # Production 배포
127
- vercel --prod
128
- ```
129
-
130
- ## 추천 사용 케이스
131
-
132
- - 정적 사이트 + API routes
133
- - Edge에서 가벼운 처리가 필요한 경우
134
- - Vercel의 다른 서비스(Analytics, Speed Insights)와 통합
135
-
136
- **비추천:**
137
- - 장시간 실행 프로세스 (WebSocket, 스트리밍)
138
- - Bun 특화 기능 필요 시
139
-
140
- Reference: [Vercel Documentation](https://vercel.com/docs)
1
+ ---
2
+ title: Deploy to Vercel
3
+ impact: MEDIUM
4
+ impactDescription: Serverless deployment with edge functions
5
+ tags: deployment, vercel, serverless, edge
6
+ ---
7
+
8
+ ## Deploy to Vercel
9
+
10
+ **Impact: MEDIUM (Serverless deployment with edge functions)**
11
+
12
+ Vercel을 사용하여 Mandu 앱을 서버리스로 배포하세요.
13
+
14
+ **vercel.json 설정:**
15
+
16
+ ```json
17
+ {
18
+ "buildCommand": "bun run build",
19
+ "outputDirectory": "dist",
20
+ "framework": null,
21
+ "functions": {
22
+ "api/**/*.ts": {
23
+ "runtime": "nodejs20.x",
24
+ "memory": 1024,
25
+ "maxDuration": 10
26
+ }
27
+ },
28
+ "rewrites": [
29
+ { "source": "/api/(.*)", "destination": "/api/$1" },
30
+ { "source": "/(.*)", "destination": "/index.html" }
31
+ ]
32
+ }
33
+ ```
34
+
35
+ **주의사항:**
36
+ Vercel은 Bun 런타임을 직접 지원하지 않으므로, Node.js 호환 모드로 빌드해야 합니다.
37
+
38
+ **Node.js 호환 빌드:**
39
+
40
+ ```typescript
41
+ // scripts/build-vercel.ts
42
+ await Bun.build({
43
+ entrypoints: ["./src/server.ts"],
44
+ outdir: "./dist",
45
+ target: "node", // Node.js 타겟으로 빌드
46
+ minify: true,
47
+ external: ["@vercel/node"],
48
+ });
49
+ ```
50
+
51
+ ## API Routes 변환
52
+
53
+ ```typescript
54
+ // api/users/index.ts (Vercel Serverless Function)
55
+ import type { VercelRequest, VercelResponse } from "@vercel/node";
56
+ import { createHandler } from "@mandujs/vercel";
57
+ import usersSlot from "../../app/users/slot";
58
+
59
+ export default createHandler(usersSlot);
60
+ ```
61
+
62
+ **createHandler 구현:**
63
+
64
+ ```typescript
65
+ // lib/vercel.ts
66
+ import type { VercelRequest, VercelResponse } from "@vercel/node";
67
+
68
+ export function createHandler(slot: Slot) {
69
+ return async (req: VercelRequest, res: VercelResponse) => {
70
+ const method = req.method?.toLowerCase() || "get";
71
+ const handler = slot.handlers[method];
72
+
73
+ if (!handler) {
74
+ return res.status(405).json({ error: "Method not allowed" });
75
+ }
76
+
77
+ const ctx = createContext(req);
78
+ const result = await handler(ctx);
79
+
80
+ return res.status(result.status || 200).json(result.body);
81
+ };
82
+ }
83
+ ```
84
+
85
+ ## Edge Functions
86
+
87
+ ```typescript
88
+ // api/geo.ts
89
+ export const config = {
90
+ runtime: "edge",
91
+ };
92
+
93
+ export default async function handler(request: Request) {
94
+ const geo = request.headers.get("x-vercel-ip-country");
95
+
96
+ return new Response(JSON.stringify({ country: geo }), {
97
+ headers: { "Content-Type": "application/json" },
98
+ });
99
+ }
100
+ ```
101
+
102
+ ## 환경 변수
103
+
104
+ ```bash
105
+ # Vercel CLI로 환경 변수 설정
106
+ vercel env add DATABASE_URL production
107
+ vercel env add SESSION_SECRET production
108
+
109
+ # .env.local (로컬 개발)
110
+ DATABASE_URL=postgresql://localhost:5432/mandu
111
+ SESSION_SECRET=dev-secret
112
+ ```
113
+
114
+ ## 배포
115
+
116
+ ```bash
117
+ # Vercel CLI 설치
118
+ npm install -g vercel
119
+
120
+ # 프로젝트 연결
121
+ vercel link
122
+
123
+ # Preview 배포
124
+ vercel
125
+
126
+ # Production 배포
127
+ vercel --prod
128
+ ```
129
+
130
+ ## 추천 사용 케이스
131
+
132
+ - 정적 사이트 + API routes
133
+ - Edge에서 가벼운 처리가 필요한 경우
134
+ - Vercel의 다른 서비스(Analytics, Speed Insights)와 통합
135
+
136
+ **비추천:**
137
+ - 장시간 실행 프로세스 (WebSocket, 스트리밍)
138
+ - Bun 특화 기능 필요 시
139
+
140
+ Reference: [Vercel Documentation](https://vercel.com/docs)
@@ -1,82 +1,82 @@
1
- ---
2
- name: mandu-fs-routes
3
- description: |
4
- File-system based routing for Mandu. Use when creating pages, API routes,
5
- layouts, or dynamic routes. Triggers on tasks involving app/ folder,
6
- page.tsx, route.ts, layout.tsx, [id], [...slug], or URL patterns.
7
- license: MIT
8
- metadata:
9
- author: mandu
10
- version: "1.0.0"
11
- ---
12
-
13
- # Mandu FS Routes
14
-
15
- FS Routes는 파일 시스템 기반 라우팅입니다. `app/` 폴더의 파일 구조가 URL이 됩니다.
16
-
17
- ## When to Apply
18
-
19
- Reference these guidelines when:
20
- - Creating new pages or API endpoints
21
- - Setting up dynamic routes with parameters
22
- - Implementing shared layouts
23
- - Organizing route groups
24
- - Working with catch-all routes
25
-
26
- ## Rule Categories by Priority
27
-
28
- | Priority | Category | Impact | Prefix |
29
- |----------|----------|--------|--------|
30
- | 1 | File Naming | CRITICAL | `routes-naming-` |
31
- | 2 | Page Routes | HIGH | `routes-page-` |
32
- | 3 | API Routes | HIGH | `routes-api-` |
33
- | 4 | Dynamic Routes | MEDIUM | `routes-dynamic-` |
34
- | 5 | Layouts | MEDIUM | `routes-layout-` |
35
-
36
- ## Quick Reference
37
-
38
- ### 1. File Naming (CRITICAL)
39
-
40
- - `routes-naming-page` - Use page.tsx for page components
41
- - `routes-naming-route` - Use route.ts for API handlers
42
- - `routes-naming-layout` - Use layout.tsx for shared layouts
43
-
44
- ### 2. Page Routes (HIGH)
45
-
46
- - `routes-page-component` - Export default function component
47
- - `routes-page-metadata` - Export metadata object for SEO
48
-
49
- ### 3. API Routes (HIGH)
50
-
51
- - `routes-api-methods` - Export GET, POST, PUT, DELETE functions
52
- - `routes-api-request` - Access Request object as first parameter
53
-
54
- ### 4. Dynamic Routes (MEDIUM)
55
-
56
- - `routes-dynamic-param` - Use [id] for single parameter
57
- - `routes-dynamic-catchall` - Use [...slug] for catch-all
58
- - `routes-dynamic-optional` - Use [[...slug]] for optional catch-all
59
-
60
- ### 5. Layouts (MEDIUM)
61
-
62
- - `routes-layout-wrapper` - Layouts wrap all child pages
63
- - `routes-layout-nesting` - Layouts can be nested
64
-
65
- ## URL Mapping
66
-
67
- | File Path | URL |
68
- |-----------|-----|
69
- | `app/page.tsx` | `/` |
70
- | `app/about/page.tsx` | `/about` |
71
- | `app/users/[id]/page.tsx` | `/users/:id` |
72
- | `app/api/users/route.ts` | `/api/users` |
73
- | `app/(auth)/login/page.tsx` | `/login` |
74
-
75
- ## How to Use
76
-
77
- Read individual rule files for detailed explanations:
78
-
79
- ```
80
- rules/routes-naming-page.md
81
- rules/routes-dynamic-param.md
82
- ```
1
+ ---
2
+ name: mandu-fs-routes
3
+ description: |
4
+ File-system based routing for Mandu. Use when creating pages, API routes,
5
+ layouts, or dynamic routes. Triggers on tasks involving app/ folder,
6
+ page.tsx, route.ts, layout.tsx, [id], [...slug], or URL patterns.
7
+ license: MIT
8
+ metadata:
9
+ author: mandu
10
+ version: "1.0.0"
11
+ ---
12
+
13
+ # Mandu FS Routes
14
+
15
+ FS Routes는 파일 시스템 기반 라우팅입니다. `app/` 폴더의 파일 구조가 URL이 됩니다.
16
+
17
+ ## When to Apply
18
+
19
+ Reference these guidelines when:
20
+ - Creating new pages or API endpoints
21
+ - Setting up dynamic routes with parameters
22
+ - Implementing shared layouts
23
+ - Organizing route groups
24
+ - Working with catch-all routes
25
+
26
+ ## Rule Categories by Priority
27
+
28
+ | Priority | Category | Impact | Prefix |
29
+ |----------|----------|--------|--------|
30
+ | 1 | File Naming | CRITICAL | `routes-naming-` |
31
+ | 2 | Page Routes | HIGH | `routes-page-` |
32
+ | 3 | API Routes | HIGH | `routes-api-` |
33
+ | 4 | Dynamic Routes | MEDIUM | `routes-dynamic-` |
34
+ | 5 | Layouts | MEDIUM | `routes-layout-` |
35
+
36
+ ## Quick Reference
37
+
38
+ ### 1. File Naming (CRITICAL)
39
+
40
+ - `routes-naming-page` - Use page.tsx for page components
41
+ - `routes-naming-route` - Use route.ts for API handlers
42
+ - `routes-naming-layout` - Use layout.tsx for shared layouts
43
+
44
+ ### 2. Page Routes (HIGH)
45
+
46
+ - `routes-page-component` - Export default function component
47
+ - `routes-page-metadata` - Export metadata object for SEO
48
+
49
+ ### 3. API Routes (HIGH)
50
+
51
+ - `routes-api-methods` - Export GET, POST, PUT, DELETE functions
52
+ - `routes-api-request` - Access Request object as first parameter
53
+
54
+ ### 4. Dynamic Routes (MEDIUM)
55
+
56
+ - `routes-dynamic-param` - Use [id] for single parameter
57
+ - `routes-dynamic-catchall` - Use [...slug] for catch-all
58
+ - `routes-dynamic-optional` - Use [[...slug]] for optional catch-all
59
+
60
+ ### 5. Layouts (MEDIUM)
61
+
62
+ - `routes-layout-wrapper` - Layouts wrap all child pages
63
+ - `routes-layout-nesting` - Layouts can be nested
64
+
65
+ ## URL Mapping
66
+
67
+ | File Path | URL |
68
+ |-----------|-----|
69
+ | `app/page.tsx` | `/` |
70
+ | `app/about/page.tsx` | `/about` |
71
+ | `app/users/[id]/page.tsx` | `/users/:id` |
72
+ | `app/api/users/route.ts` | `/api/users` |
73
+ | `app/(auth)/login/page.tsx` | `/login` |
74
+
75
+ ## How to Use
76
+
77
+ Read individual rule files for detailed explanations:
78
+
79
+ ```
80
+ rules/routes-naming-page.md
81
+ rules/routes-dynamic-param.md
82
+ ```
@@ -1,12 +1,12 @@
1
- {
2
- "version": "1.0.0",
3
- "organization": "Mandu Framework",
4
- "date": "February 2026",
5
- "abstract": "파일 시스템 기반 라우팅 가이드. app/ 폴더 구조가 URL이 되는 규칙, 동적 라우트 [id], catch-all [...slug], 라우트 그룹 (group), 특수 파일 (page.tsx, route.ts, layout.tsx) 사용법을 다룹니다.",
6
- "references": [
7
- "https://nextjs.org/docs/app/building-your-application/routing",
8
- "https://fresh.deno.dev/docs/concepts/routing",
9
- "https://kit.svelte.dev/docs/routing"
10
- ],
11
- "tags": ["routes", "filesystem", "pages", "api", "mandu"]
12
- }
1
+ {
2
+ "version": "1.0.0",
3
+ "organization": "Mandu Framework",
4
+ "date": "February 2026",
5
+ "abstract": "파일 시스템 기반 라우팅 가이드. app/ 폴더 구조가 URL이 되는 규칙, 동적 라우트 [id], catch-all [...slug], 라우트 그룹 (group), 특수 파일 (page.tsx, route.ts, layout.tsx) 사용법을 다룹니다.",
6
+ "references": [
7
+ "https://nextjs.org/docs/app/building-your-application/routing",
8
+ "https://fresh.deno.dev/docs/concepts/routing",
9
+ "https://kit.svelte.dev/docs/routing"
10
+ ],
11
+ "tags": ["routes", "filesystem", "pages", "api", "mandu"]
12
+ }
@@ -1,36 +1,36 @@
1
- # Sections
2
-
3
- This file defines all sections, their ordering, impact levels, and descriptions.
4
- The section ID (in parentheses) is the filename prefix used to group rules.
5
-
6
- ---
7
-
8
- ## 1. File Naming (routes-naming)
9
-
10
- **Impact:** CRITICAL
11
- **Description:** page.tsx, route.ts, layout.tsx 등 특수 파일 명명 규칙. 잘못된 파일명은 라우트로 인식되지 않습니다.
12
-
13
- ## 2. Page Routes (routes-page)
14
-
15
- **Impact:** HIGH
16
- **Description:** page.tsx 컴포넌트 작성법. default export, metadata, props 접근 패턴을 다룹니다.
17
-
18
- ## 3. API Routes (routes-api)
19
-
20
- **Impact:** HIGH
21
- **Description:** route.ts에서 HTTP 메서드 함수 export. GET, POST, PUT, DELETE 핸들러 작성법입니다.
22
-
23
- ## 4. Dynamic Routes (routes-dynamic)
24
-
25
- **Impact:** MEDIUM
26
- **Description:** [id], [...slug], [[...slug]] 동적 세그먼트. URL 파라미터 캡처와 접근 방법을 다룹니다.
27
-
28
- ## 5. Layouts (routes-layout)
29
-
30
- **Impact:** MEDIUM
31
- **Description:** layout.tsx로 페이지 감싸기. 중첩 레이아웃과 공유 UI 패턴입니다.
32
-
33
- ## 6. Route Groups (routes-group)
34
-
35
- **Impact:** LOW
36
- **Description:** (group) 괄호로 URL에 영향 없이 폴더 구조 정리. 코드 구성에만 사용됩니다.
1
+ # Sections
2
+
3
+ This file defines all sections, their ordering, impact levels, and descriptions.
4
+ The section ID (in parentheses) is the filename prefix used to group rules.
5
+
6
+ ---
7
+
8
+ ## 1. File Naming (routes-naming)
9
+
10
+ **Impact:** CRITICAL
11
+ **Description:** page.tsx, route.ts, layout.tsx 등 특수 파일 명명 규칙. 잘못된 파일명은 라우트로 인식되지 않습니다.
12
+
13
+ ## 2. Page Routes (routes-page)
14
+
15
+ **Impact:** HIGH
16
+ **Description:** page.tsx 컴포넌트 작성법. default export, metadata, props 접근 패턴을 다룹니다.
17
+
18
+ ## 3. API Routes (routes-api)
19
+
20
+ **Impact:** HIGH
21
+ **Description:** route.ts에서 HTTP 메서드 함수 export. GET, POST, PUT, DELETE 핸들러 작성법입니다.
22
+
23
+ ## 4. Dynamic Routes (routes-dynamic)
24
+
25
+ **Impact:** MEDIUM
26
+ **Description:** [id], [...slug], [[...slug]] 동적 세그먼트. URL 파라미터 캡처와 접근 방법을 다룹니다.
27
+
28
+ ## 5. Layouts (routes-layout)
29
+
30
+ **Impact:** MEDIUM
31
+ **Description:** layout.tsx로 페이지 감싸기. 중첩 레이아웃과 공유 UI 패턴입니다.
32
+
33
+ ## 6. Route Groups (routes-group)
34
+
35
+ **Impact:** LOW
36
+ **Description:** (group) 괄호로 URL에 영향 없이 폴더 구조 정리. 코드 구성에만 사용됩니다.
@@ -1,69 +1,69 @@
1
- # Rule Template
2
-
3
- Use this template when creating new rules for mandu-fs-routes.
4
-
5
- ---
6
-
7
- ```markdown
8
- ---
9
- title: Rule Title Here
10
- impact: CRITICAL | HIGH | MEDIUM | LOW
11
- impactDescription: 영향 설명
12
- tags: routes, tag1, tag2
13
- ---
14
-
15
- ## Rule Title Here
16
-
17
- **Impact: {LEVEL} ({impactDescription})**
18
-
19
- 규칙의 목적과 중요성을 설명합니다.
20
-
21
- **Incorrect (문제점 설명):**
22
-
23
- \`\`\`
24
- app/
25
- ├── about/
26
- │ └── About.tsx ❌ 인식되지 않음
27
- └── users/
28
- └── index.tsx ❌ 인식되지 않음
29
- \`\`\`
30
-
31
- **Correct (올바른 구조):**
32
-
33
- \`\`\`
34
- app/
35
- ├── about/
36
- │ └── page.tsx ✅ → /about
37
- └── users/
38
- └── page.tsx ✅ → /users
39
- \`\`\`
40
-
41
- ## Code Example
42
-
43
- \`\`\`tsx
44
- // app/about/page.tsx
45
-
46
- export default function AboutPage() {
47
- return <h1>About Us</h1>;
48
- }
49
- \`\`\`
50
-
51
- Reference: [관련 문서 링크](https://example.com)
52
- ```
53
-
54
- ---
55
-
56
- ## Naming Convention
57
-
58
- - 파일명: `{section}-{rule-name}.md`
59
- - 예시: `routes-naming-page.md`, `routes-dynamic-param.md`
60
-
61
- ## URL Mapping Quick Reference
62
-
63
- | File Path | URL |
64
- |-----------|-----|
65
- | `app/page.tsx` | `/` |
66
- | `app/about/page.tsx` | `/about` |
67
- | `app/users/[id]/page.tsx` | `/users/:id` |
68
- | `app/api/users/route.ts` | `/api/users` |
69
- | `app/(auth)/login/page.tsx` | `/login` |
1
+ # Rule Template
2
+
3
+ Use this template when creating new rules for mandu-fs-routes.
4
+
5
+ ---
6
+
7
+ ```markdown
8
+ ---
9
+ title: Rule Title Here
10
+ impact: CRITICAL | HIGH | MEDIUM | LOW
11
+ impactDescription: 영향 설명
12
+ tags: routes, tag1, tag2
13
+ ---
14
+
15
+ ## Rule Title Here
16
+
17
+ **Impact: {LEVEL} ({impactDescription})**
18
+
19
+ 규칙의 목적과 중요성을 설명합니다.
20
+
21
+ **Incorrect (문제점 설명):**
22
+
23
+ \`\`\`
24
+ app/
25
+ ├── about/
26
+ │ └── About.tsx ❌ 인식되지 않음
27
+ └── users/
28
+ └── index.tsx ❌ 인식되지 않음
29
+ \`\`\`
30
+
31
+ **Correct (올바른 구조):**
32
+
33
+ \`\`\`
34
+ app/
35
+ ├── about/
36
+ │ └── page.tsx ✅ → /about
37
+ └── users/
38
+ └── page.tsx ✅ → /users
39
+ \`\`\`
40
+
41
+ ## Code Example
42
+
43
+ \`\`\`tsx
44
+ // app/about/page.tsx
45
+
46
+ export default function AboutPage() {
47
+ return <h1>About Us</h1>;
48
+ }
49
+ \`\`\`
50
+
51
+ Reference: [관련 문서 링크](https://example.com)
52
+ ```
53
+
54
+ ---
55
+
56
+ ## Naming Convention
57
+
58
+ - 파일명: `{section}-{rule-name}.md`
59
+ - 예시: `routes-naming-page.md`, `routes-dynamic-param.md`
60
+
61
+ ## URL Mapping Quick Reference
62
+
63
+ | File Path | URL |
64
+ |-----------|-----|
65
+ | `app/page.tsx` | `/` |
66
+ | `app/about/page.tsx` | `/about` |
67
+ | `app/users/[id]/page.tsx` | `/users/:id` |
68
+ | `app/api/users/route.ts` | `/api/users` |
69
+ | `app/(auth)/login/page.tsx` | `/login` |