create-apppaaaul 2.0.46 → 2.0.48

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 (215) hide show
  1. package/dist/templates/nextjs-ts-clean/project/.agents/skills/api-design-principles/SKILL.md +528 -0
  2. package/dist/templates/nextjs-ts-clean/project/.agents/skills/api-design-principles/assets/api-design-checklist.md +155 -0
  3. package/dist/templates/nextjs-ts-clean/project/.agents/skills/api-design-principles/assets/rest-api-template.py +182 -0
  4. package/dist/templates/nextjs-ts-clean/project/.agents/skills/api-design-principles/references/graphql-schema-design.md +583 -0
  5. package/dist/templates/nextjs-ts-clean/project/.agents/skills/api-design-principles/references/rest-best-practices.md +408 -0
  6. package/dist/templates/nextjs-ts-clean/project/.agents/skills/better-auth-best-practices/SKILL.md +166 -0
  7. package/dist/templates/nextjs-ts-clean/project/.agents/skills/brainstorming/SKILL.md +96 -0
  8. package/dist/templates/nextjs-ts-clean/project/.agents/skills/changelog-generator/SKILL.md +104 -0
  9. package/dist/templates/nextjs-ts-clean/project/.agents/skills/error-handling-patterns/SKILL.md +641 -0
  10. package/dist/templates/nextjs-ts-clean/project/.agents/skills/interface-design/SKILL.md +391 -0
  11. package/dist/templates/nextjs-ts-clean/project/.agents/skills/interface-design/references/critique.md +67 -0
  12. package/dist/templates/nextjs-ts-clean/project/.agents/skills/interface-design/references/example.md +86 -0
  13. package/dist/templates/nextjs-ts-clean/project/.agents/skills/interface-design/references/principles.md +235 -0
  14. package/dist/templates/nextjs-ts-clean/project/.agents/skills/interface-design/references/validation.md +48 -0
  15. package/dist/templates/nextjs-ts-clean/project/.agents/skills/next-best-practices/SKILL.md +153 -0
  16. package/dist/templates/nextjs-ts-clean/project/.agents/skills/next-best-practices/async-patterns.md +87 -0
  17. package/dist/templates/nextjs-ts-clean/project/.agents/skills/next-best-practices/bundling.md +180 -0
  18. package/dist/templates/nextjs-ts-clean/project/.agents/skills/next-best-practices/data-patterns.md +297 -0
  19. package/dist/templates/nextjs-ts-clean/project/.agents/skills/next-best-practices/debug-tricks.md +105 -0
  20. package/dist/templates/nextjs-ts-clean/project/.agents/skills/next-best-practices/directives.md +73 -0
  21. package/dist/templates/nextjs-ts-clean/project/.agents/skills/next-best-practices/error-handling.md +227 -0
  22. package/dist/templates/nextjs-ts-clean/project/.agents/skills/next-best-practices/file-conventions.md +140 -0
  23. package/dist/templates/nextjs-ts-clean/project/.agents/skills/next-best-practices/font.md +245 -0
  24. package/dist/templates/nextjs-ts-clean/project/.agents/skills/next-best-practices/functions.md +108 -0
  25. package/dist/templates/nextjs-ts-clean/project/.agents/skills/next-best-practices/hydration-error.md +91 -0
  26. package/dist/templates/nextjs-ts-clean/project/.agents/skills/next-best-practices/image.md +173 -0
  27. package/dist/templates/nextjs-ts-clean/project/.agents/skills/next-best-practices/metadata.md +301 -0
  28. package/dist/templates/nextjs-ts-clean/project/.agents/skills/next-best-practices/parallel-routes.md +287 -0
  29. package/dist/templates/nextjs-ts-clean/project/.agents/skills/next-best-practices/route-handlers.md +146 -0
  30. package/dist/templates/nextjs-ts-clean/project/.agents/skills/next-best-practices/rsc-boundaries.md +159 -0
  31. package/dist/templates/nextjs-ts-clean/project/.agents/skills/next-best-practices/runtime-selection.md +39 -0
  32. package/dist/templates/nextjs-ts-clean/project/.agents/skills/next-best-practices/scripts.md +141 -0
  33. package/dist/templates/nextjs-ts-clean/project/.agents/skills/next-best-practices/self-hosting.md +371 -0
  34. package/dist/templates/nextjs-ts-clean/project/.agents/skills/next-best-practices/suspense-boundaries.md +67 -0
  35. package/dist/templates/nextjs-ts-clean/project/.agents/skills/postgresql-table-design/SKILL.md +202 -0
  36. package/dist/templates/nextjs-ts-clean/project/.agents/skills/prompt-engineering-patterns/SKILL.md +480 -0
  37. package/dist/templates/nextjs-ts-clean/project/.agents/skills/prompt-engineering-patterns/assets/few-shot-examples.json +106 -0
  38. package/dist/templates/nextjs-ts-clean/project/.agents/skills/prompt-engineering-patterns/assets/prompt-template-library.md +264 -0
  39. package/dist/templates/nextjs-ts-clean/project/.agents/skills/prompt-engineering-patterns/references/chain-of-thought.md +412 -0
  40. package/dist/templates/nextjs-ts-clean/project/.agents/skills/prompt-engineering-patterns/references/few-shot-learning.md +386 -0
  41. package/dist/templates/nextjs-ts-clean/project/.agents/skills/prompt-engineering-patterns/references/prompt-optimization.md +428 -0
  42. package/dist/templates/nextjs-ts-clean/project/.agents/skills/prompt-engineering-patterns/references/prompt-templates.md +484 -0
  43. package/dist/templates/nextjs-ts-clean/project/.agents/skills/prompt-engineering-patterns/references/system-prompts.md +195 -0
  44. package/dist/templates/nextjs-ts-clean/project/.agents/skills/prompt-engineering-patterns/scripts/optimize-prompt.py +279 -0
  45. package/dist/templates/nextjs-ts-clean/project/.agents/skills/seo-audit/SKILL.md +410 -0
  46. package/dist/templates/nextjs-ts-clean/project/.agents/skills/seo-audit/references/aeo-geo-patterns.md +285 -0
  47. package/dist/templates/nextjs-ts-clean/project/.agents/skills/seo-audit/references/ai-writing-detection.md +200 -0
  48. package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/AGENTS.md +2934 -0
  49. package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/SKILL.md +136 -0
  50. package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/advanced-event-handler-refs.md +55 -0
  51. package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/advanced-init-once.md +42 -0
  52. package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/advanced-use-latest.md +39 -0
  53. package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/async-api-routes.md +38 -0
  54. package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/async-defer-await.md +80 -0
  55. package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/async-dependencies.md +51 -0
  56. package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/async-parallel.md +28 -0
  57. package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/async-suspense-boundaries.md +99 -0
  58. package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/bundle-barrel-imports.md +59 -0
  59. package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/bundle-conditional.md +31 -0
  60. package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/bundle-defer-third-party.md +49 -0
  61. package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/bundle-dynamic-imports.md +35 -0
  62. package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/bundle-preload.md +50 -0
  63. package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/client-event-listeners.md +74 -0
  64. package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/client-localstorage-schema.md +71 -0
  65. package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/client-passive-event-listeners.md +48 -0
  66. package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/client-swr-dedup.md +56 -0
  67. package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/js-batch-dom-css.md +107 -0
  68. package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/js-cache-function-results.md +80 -0
  69. package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/js-cache-property-access.md +28 -0
  70. package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/js-cache-storage.md +70 -0
  71. package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/js-combine-iterations.md +32 -0
  72. package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/js-early-exit.md +50 -0
  73. package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/js-hoist-regexp.md +45 -0
  74. package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/js-index-maps.md +37 -0
  75. package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/js-length-check-first.md +49 -0
  76. package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/js-min-max-loop.md +82 -0
  77. package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/js-set-map-lookups.md +24 -0
  78. package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/js-tosorted-immutable.md +57 -0
  79. package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/rendering-activity.md +26 -0
  80. package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/rendering-animate-svg-wrapper.md +47 -0
  81. package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/rendering-conditional-render.md +40 -0
  82. package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/rendering-content-visibility.md +38 -0
  83. package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/rendering-hoist-jsx.md +46 -0
  84. package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/rendering-hydration-no-flicker.md +82 -0
  85. package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/rendering-hydration-suppress-warning.md +30 -0
  86. package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/rendering-svg-precision.md +28 -0
  87. package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/rendering-usetransition-loading.md +75 -0
  88. package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/rerender-defer-reads.md +39 -0
  89. package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/rerender-dependencies.md +45 -0
  90. package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/rerender-derived-state-no-effect.md +40 -0
  91. package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/rerender-derived-state.md +29 -0
  92. package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/rerender-functional-setstate.md +74 -0
  93. package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/rerender-lazy-state-init.md +58 -0
  94. package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/rerender-memo-with-default-value.md +38 -0
  95. package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/rerender-memo.md +44 -0
  96. package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/rerender-move-effect-to-event.md +45 -0
  97. package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/rerender-simple-expression-in-memo.md +35 -0
  98. package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/rerender-transitions.md +40 -0
  99. package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/rerender-use-ref-transient-values.md +73 -0
  100. package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/server-after-nonblocking.md +73 -0
  101. package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/server-auth-actions.md +96 -0
  102. package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/server-cache-lru.md +41 -0
  103. package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/server-cache-react.md +76 -0
  104. package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/server-dedup-props.md +65 -0
  105. package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/server-parallel-fetching.md +83 -0
  106. package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/server-serialization.md +38 -0
  107. package/dist/templates/nextjs-ts-clean/project/package.json +1 -1
  108. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/api-design-principles/SKILL.md +528 -0
  109. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/api-design-principles/assets/api-design-checklist.md +155 -0
  110. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/api-design-principles/assets/rest-api-template.py +182 -0
  111. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/api-design-principles/references/graphql-schema-design.md +583 -0
  112. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/api-design-principles/references/rest-best-practices.md +408 -0
  113. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/better-auth-best-practices/SKILL.md +166 -0
  114. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/brainstorming/SKILL.md +96 -0
  115. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/changelog-generator/SKILL.md +104 -0
  116. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/error-handling-patterns/SKILL.md +641 -0
  117. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/interface-design/SKILL.md +391 -0
  118. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/interface-design/references/critique.md +67 -0
  119. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/interface-design/references/example.md +86 -0
  120. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/interface-design/references/principles.md +235 -0
  121. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/interface-design/references/validation.md +48 -0
  122. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/next-best-practices/SKILL.md +153 -0
  123. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/next-best-practices/async-patterns.md +87 -0
  124. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/next-best-practices/bundling.md +180 -0
  125. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/next-best-practices/data-patterns.md +297 -0
  126. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/next-best-practices/debug-tricks.md +105 -0
  127. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/next-best-practices/directives.md +73 -0
  128. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/next-best-practices/error-handling.md +227 -0
  129. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/next-best-practices/file-conventions.md +140 -0
  130. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/next-best-practices/font.md +245 -0
  131. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/next-best-practices/functions.md +108 -0
  132. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/next-best-practices/hydration-error.md +91 -0
  133. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/next-best-practices/image.md +173 -0
  134. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/next-best-practices/metadata.md +301 -0
  135. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/next-best-practices/parallel-routes.md +287 -0
  136. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/next-best-practices/route-handlers.md +146 -0
  137. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/next-best-practices/rsc-boundaries.md +159 -0
  138. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/next-best-practices/runtime-selection.md +39 -0
  139. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/next-best-practices/scripts.md +141 -0
  140. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/next-best-practices/self-hosting.md +371 -0
  141. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/next-best-practices/suspense-boundaries.md +67 -0
  142. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/postgresql-table-design/SKILL.md +202 -0
  143. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/prompt-engineering-patterns/SKILL.md +480 -0
  144. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/prompt-engineering-patterns/assets/few-shot-examples.json +106 -0
  145. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/prompt-engineering-patterns/assets/prompt-template-library.md +264 -0
  146. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/prompt-engineering-patterns/references/chain-of-thought.md +412 -0
  147. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/prompt-engineering-patterns/references/few-shot-learning.md +386 -0
  148. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/prompt-engineering-patterns/references/prompt-optimization.md +428 -0
  149. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/prompt-engineering-patterns/references/prompt-templates.md +484 -0
  150. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/prompt-engineering-patterns/references/system-prompts.md +195 -0
  151. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/prompt-engineering-patterns/scripts/optimize-prompt.py +279 -0
  152. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/seo-audit/SKILL.md +410 -0
  153. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/seo-audit/references/aeo-geo-patterns.md +285 -0
  154. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/seo-audit/references/ai-writing-detection.md +200 -0
  155. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/AGENTS.md +2934 -0
  156. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/SKILL.md +136 -0
  157. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/advanced-event-handler-refs.md +55 -0
  158. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/advanced-init-once.md +42 -0
  159. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/advanced-use-latest.md +39 -0
  160. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/async-api-routes.md +38 -0
  161. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/async-defer-await.md +80 -0
  162. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/async-dependencies.md +51 -0
  163. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/async-parallel.md +28 -0
  164. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/async-suspense-boundaries.md +99 -0
  165. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/bundle-barrel-imports.md +59 -0
  166. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/bundle-conditional.md +31 -0
  167. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/bundle-defer-third-party.md +49 -0
  168. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/bundle-dynamic-imports.md +35 -0
  169. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/bundle-preload.md +50 -0
  170. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/client-event-listeners.md +74 -0
  171. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/client-localstorage-schema.md +71 -0
  172. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/client-passive-event-listeners.md +48 -0
  173. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/client-swr-dedup.md +56 -0
  174. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/js-batch-dom-css.md +107 -0
  175. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/js-cache-function-results.md +80 -0
  176. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/js-cache-property-access.md +28 -0
  177. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/js-cache-storage.md +70 -0
  178. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/js-combine-iterations.md +32 -0
  179. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/js-early-exit.md +50 -0
  180. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/js-hoist-regexp.md +45 -0
  181. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/js-index-maps.md +37 -0
  182. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/js-length-check-first.md +49 -0
  183. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/js-min-max-loop.md +82 -0
  184. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/js-set-map-lookups.md +24 -0
  185. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/js-tosorted-immutable.md +57 -0
  186. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/rendering-activity.md +26 -0
  187. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/rendering-animate-svg-wrapper.md +47 -0
  188. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/rendering-conditional-render.md +40 -0
  189. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/rendering-content-visibility.md +38 -0
  190. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/rendering-hoist-jsx.md +46 -0
  191. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/rendering-hydration-no-flicker.md +82 -0
  192. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/rendering-hydration-suppress-warning.md +30 -0
  193. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/rendering-svg-precision.md +28 -0
  194. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/rendering-usetransition-loading.md +75 -0
  195. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/rerender-defer-reads.md +39 -0
  196. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/rerender-dependencies.md +45 -0
  197. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/rerender-derived-state-no-effect.md +40 -0
  198. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/rerender-derived-state.md +29 -0
  199. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/rerender-functional-setstate.md +74 -0
  200. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/rerender-lazy-state-init.md +58 -0
  201. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/rerender-memo-with-default-value.md +38 -0
  202. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/rerender-memo.md +44 -0
  203. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/rerender-move-effect-to-event.md +45 -0
  204. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/rerender-simple-expression-in-memo.md +35 -0
  205. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/rerender-transitions.md +40 -0
  206. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/rerender-use-ref-transient-values.md +73 -0
  207. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/server-after-nonblocking.md +73 -0
  208. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/server-auth-actions.md +96 -0
  209. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/server-cache-lru.md +41 -0
  210. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/server-cache-react.md +76 -0
  211. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/server-dedup-props.md +65 -0
  212. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/server-parallel-fetching.md +83 -0
  213. package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/server-serialization.md +38 -0
  214. package/dist/templates/nextjs-ts-landing-prisma/project/package.json +1 -1
  215. package/package.json +1 -1
@@ -0,0 +1,235 @@
1
+ # Core Craft Principles
2
+
3
+ These apply regardless of design direction. This is the quality floor.
4
+
5
+ ---
6
+
7
+ ## Surface & Token Architecture
8
+
9
+ Professional interfaces don't pick colors randomly — they build systems. Understanding this architecture is the difference between "looks okay" and "feels like a real product."
10
+
11
+ ### The Primitive Foundation
12
+
13
+ Every color in your interface should trace back to a small set of primitives:
14
+
15
+ - **Foreground** — text colors (primary, secondary, muted)
16
+ - **Background** — surface colors (base, elevated, overlay)
17
+ - **Border** — edge colors (default, subtle, strong)
18
+ - **Brand** — your primary accent
19
+ - **Semantic** — functional colors (destructive, warning, success)
20
+
21
+ Don't invent new colors. Map everything to these primitives.
22
+
23
+ ### Surface Elevation Hierarchy
24
+
25
+ Surfaces stack. A dropdown sits above a card which sits above the page. Build a numbered system:
26
+
27
+ ```
28
+ Level 0: Base background (the app canvas)
29
+ Level 1: Cards, panels (same visual plane as base)
30
+ Level 2: Dropdowns, popovers (floating above)
31
+ Level 3: Nested dropdowns, stacked overlays
32
+ Level 4: Highest elevation (rare)
33
+ ```
34
+
35
+ In dark mode, higher elevation = slightly lighter. In light mode, higher elevation = slightly lighter or uses shadow. The principle: **elevated surfaces need visual distinction from what's beneath them.**
36
+
37
+ ### The Subtlety Principle
38
+
39
+ This is where most interfaces fail. Study Vercel, Supabase, Linear — their surfaces are **barely different** but still distinguishable. Their borders are **light but not invisible**.
40
+
41
+ **For surfaces:** The difference between elevation levels should be subtle — a few percentage points of lightness, not dramatic jumps. In dark mode, surface-100 might be 7% lighter than base, surface-200 might be 9%, surface-300 might be 12%. You can barely see it, but you feel it.
42
+
43
+ **For borders:** Borders should define regions without demanding attention. Use low opacity (0.05-0.12 alpha for dark mode, slightly higher for light). The border should disappear when you're not looking for it, but be findable when you need to understand the structure.
44
+
45
+ **The test:** Squint at your interface. You should still perceive the hierarchy — what's above what, where regions begin and end. But no single border or surface should jump out at you. If borders are the first thing you notice, they're too strong. If you can't find where one region ends and another begins, they're too subtle.
46
+
47
+ **Common AI mistakes to avoid:**
48
+ - Borders that are too visible (1px solid gray instead of subtle rgba)
49
+ - Surface jumps that are too dramatic (going from dark to light instead of dark to slightly-less-dark)
50
+ - Using different hues for different surfaces (gray card on blue background)
51
+ - Harsh dividers where subtle borders would do
52
+
53
+ ### Text Hierarchy via Tokens
54
+
55
+ Don't just have "text" and "gray text." Build four levels:
56
+
57
+ - **Primary** — default text, highest contrast
58
+ - **Secondary** — supporting text, slightly muted
59
+ - **Tertiary** — metadata, timestamps, less important
60
+ - **Muted** — disabled, placeholder, lowest contrast
61
+
62
+ Use all four consistently. If you're only using two, your hierarchy is too flat.
63
+
64
+ ### Border Progression
65
+
66
+ Borders aren't binary. Build a scale:
67
+
68
+ - **Default** — standard borders
69
+ - **Subtle/Muted** — softer separation
70
+ - **Strong** — emphasis, hover states
71
+ - **Stronger** — maximum emphasis, focus rings
72
+
73
+ Match border intensity to the importance of the boundary.
74
+
75
+ ### Dedicated Control Tokens
76
+
77
+ Form controls (inputs, checkboxes, selects) have specific needs. Don't just reuse surface tokens — create dedicated ones:
78
+
79
+ - **Control background** — often different from surface backgrounds
80
+ - **Control border** — needs to feel interactive
81
+ - **Control focus** — clear focus indication
82
+
83
+ This separation lets you tune controls independently from layout surfaces.
84
+
85
+ ### Context-Aware Bases
86
+
87
+ Different areas of your app might need different base surfaces:
88
+
89
+ - **Marketing pages** — might use darker/richer backgrounds
90
+ - **Dashboard/app** — might use neutral working backgrounds
91
+ - **Sidebar** — might differ from main canvas
92
+
93
+ The surface hierarchy works the same way — it just starts from a different base.
94
+
95
+ ### Alternative Backgrounds for Depth
96
+
97
+ Beyond shadows, use contrasting backgrounds to create depth. An "alternative" or "inset" background makes content feel recessed. Useful for:
98
+
99
+ - Empty states in data grids
100
+ - Code blocks
101
+ - Inset panels
102
+ - Visual grouping without borders
103
+
104
+ ---
105
+
106
+ ## Spacing System
107
+
108
+ Pick a base unit (4px and 8px are common) and use multiples throughout. The specific number matters less than consistency — every spacing value should be explainable as "X times the base unit."
109
+
110
+ Build a scale for different contexts:
111
+ - Micro spacing (icon gaps, tight element pairs)
112
+ - Component spacing (within buttons, inputs, cards)
113
+ - Section spacing (between related groups)
114
+ - Major separation (between distinct sections)
115
+
116
+ ## Symmetrical Padding
117
+
118
+ TLBR must match. If top padding is 16px, left/bottom/right must also be 16px. Exception: when content naturally creates visual balance.
119
+
120
+ ```css
121
+ /* Good */
122
+ padding: 16px;
123
+ padding: 12px 16px; /* Only when horizontal needs more room */
124
+
125
+ /* Bad */
126
+ padding: 24px 16px 12px 16px;
127
+ ```
128
+
129
+ ## Border Radius Consistency
130
+
131
+ Sharper corners feel technical, rounder corners feel friendly. Pick a scale that fits your product's personality and use it consistently.
132
+
133
+ The key is having a system: small radius for inputs and buttons, medium for cards, large for modals or containers. Don't mix sharp and soft randomly — inconsistent radius is as jarring as inconsistent spacing.
134
+
135
+ ## Depth & Elevation Strategy
136
+
137
+ Match your depth approach to your design direction. Choose ONE and commit:
138
+
139
+ **Borders-only (flat)** — Clean, technical, dense. Works for utility-focused tools where information density matters more than visual lift. Linear, Raycast, and many developer tools use almost no shadows — just subtle borders to define regions.
140
+
141
+ **Subtle single shadows** — Soft lift without complexity. A simple `0 1px 3px rgba(0,0,0,0.08)` can be enough. Works for approachable products that want gentle depth.
142
+
143
+ **Layered shadows** — Rich, premium, dimensional. Multiple shadow layers create realistic depth. Stripe and Mercury use this approach. Best for cards that need to feel like physical objects.
144
+
145
+ **Surface color shifts** — Background tints establish hierarchy without any shadows. A card at `#fff` on a `#f8fafc` background already feels elevated.
146
+
147
+ ```css
148
+ /* Borders-only approach */
149
+ --border: rgba(0, 0, 0, 0.08);
150
+ --border-subtle: rgba(0, 0, 0, 0.05);
151
+ border: 0.5px solid var(--border);
152
+
153
+ /* Single shadow approach */
154
+ --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
155
+
156
+ /* Layered shadow approach */
157
+ --shadow-layered:
158
+ 0 0 0 0.5px rgba(0, 0, 0, 0.05),
159
+ 0 1px 2px rgba(0, 0, 0, 0.04),
160
+ 0 2px 4px rgba(0, 0, 0, 0.03),
161
+ 0 4px 8px rgba(0, 0, 0, 0.02);
162
+ ```
163
+
164
+ ## Card Layouts
165
+
166
+ Monotonous card layouts are lazy design. A metric card doesn't have to look like a plan card doesn't have to look like a settings card.
167
+
168
+ Design each card's internal structure for its specific content — but keep the surface treatment consistent: same border weight, shadow depth, corner radius, padding scale, typography.
169
+
170
+ ## Isolated Controls
171
+
172
+ UI controls deserve container treatment. Date pickers, filters, dropdowns — these should feel like crafted objects.
173
+
174
+ **Never use native form elements for styled UI.** Native `<select>`, `<input type="date">`, and similar elements render OS-native dropdowns that cannot be styled. Build custom components instead:
175
+
176
+ - Custom select: trigger button + positioned dropdown menu
177
+ - Custom date picker: input + calendar popover
178
+ - Custom checkbox/radio: styled div with state management
179
+
180
+ Custom select triggers must use `display: inline-flex` with `white-space: nowrap` to keep text and chevron icons on the same row.
181
+
182
+ ## Typography Hierarchy
183
+
184
+ Build distinct levels that are visually distinguishable at a glance:
185
+
186
+ - **Headlines** — heavier weight, tighter letter-spacing for presence
187
+ - **Body** — comfortable weight for readability
188
+ - **Labels/UI** — medium weight, works at smaller sizes
189
+ - **Data** — often monospace, needs `tabular-nums` for alignment
190
+
191
+ Don't rely on size alone. Combine size, weight, and letter-spacing to create clear hierarchy. If you squint and can't tell headline from body, the hierarchy is too weak.
192
+
193
+ ## Monospace for Data
194
+
195
+ Numbers, IDs, codes, timestamps belong in monospace. Use `tabular-nums` for columnar alignment. Mono signals "this is data."
196
+
197
+ ## Iconography
198
+
199
+ Icons clarify, not decorate — if removing an icon loses no meaning, remove it. Choose a consistent icon set and stick with it throughout the product.
200
+
201
+ Give standalone icons presence with subtle background containers. Icons next to text should align optically, not mathematically.
202
+
203
+ ## Animation
204
+
205
+ Keep it fast and functional. Micro-interactions (hover, focus) should feel instant — around 150ms. Larger transitions (modals, panels) can be slightly longer — 200-250ms.
206
+
207
+ Use smooth deceleration easing (ease-out variants). Avoid spring/bounce effects in professional interfaces — they feel playful, not serious.
208
+
209
+ ## Contrast Hierarchy
210
+
211
+ Build a four-level system: foreground (primary) → secondary → muted → faint. Use all four consistently.
212
+
213
+ ## Color Carries Meaning
214
+
215
+ Gray builds structure. Color communicates — status, action, emphasis, identity. Unmotivated color is noise. Color that reinforces the product's world is character.
216
+
217
+ ## Navigation Context
218
+
219
+ Screens need grounding. A data table floating in space feels like a component demo, not a product. Consider including:
220
+
221
+ - **Navigation** — sidebar or top nav showing where you are in the app
222
+ - **Location indicator** — breadcrumbs, page title, or active nav state
223
+ - **User context** — who's logged in, what workspace/org
224
+
225
+ When building sidebars, consider using the same background as the main content area. Rely on a subtle border for separation rather than different background colors.
226
+
227
+ ## Dark Mode
228
+
229
+ Dark interfaces have different needs:
230
+
231
+ **Borders over shadows** — Shadows are less visible on dark backgrounds. Lean more on borders for definition.
232
+
233
+ **Adjust semantic colors** — Status colors (success, warning, error) often need to be slightly desaturated for dark backgrounds.
234
+
235
+ **Same structure, different values** — The hierarchy system still applies, just with inverted values.
@@ -0,0 +1,48 @@
1
+ # Memory Management
2
+
3
+ When and how to update `.interface-design/system.md`.
4
+
5
+ ## When to Add Patterns
6
+
7
+ Add to system.md when:
8
+ - Component used 2+ times
9
+ - Pattern is reusable across the project
10
+ - Has specific measurements worth remembering
11
+
12
+ ## Pattern Format
13
+
14
+ ```markdown
15
+ ### Button Primary
16
+ - Height: 36px
17
+ - Padding: 12px 16px
18
+ - Radius: 6px
19
+ - Font: 14px, 500 weight
20
+ ```
21
+
22
+ ## Don't Document
23
+
24
+ - One-off components
25
+ - Temporary experiments
26
+ - Variations better handled with props
27
+
28
+ ## Pattern Reuse
29
+
30
+ Before creating a component, check system.md:
31
+ - Pattern exists? Use it.
32
+ - Need variation? Extend, don't create new.
33
+
34
+ Memory compounds: each pattern saved makes future work faster and more consistent.
35
+
36
+ ---
37
+
38
+ # Validation Checks
39
+
40
+ If system.md defines specific values, check consistency:
41
+
42
+ **Spacing** — All values multiples of the defined base?
43
+
44
+ **Depth** — Using the declared strategy throughout? (borders-only means no shadows)
45
+
46
+ **Colors** — Using defined palette, not random hex codes?
47
+
48
+ **Patterns** — Reusing documented patterns instead of creating new?
@@ -0,0 +1,153 @@
1
+ ---
2
+ name: next-best-practices
3
+ description: Next.js best practices - file conventions, RSC boundaries, data patterns, async APIs, metadata, error handling, route handlers, image/font optimization, bundling
4
+ user-invocable: false
5
+ ---
6
+
7
+ # Next.js Best Practices
8
+
9
+ Apply these rules when writing or reviewing Next.js code.
10
+
11
+ ## File Conventions
12
+
13
+ See [file-conventions.md](./file-conventions.md) for:
14
+ - Project structure and special files
15
+ - Route segments (dynamic, catch-all, groups)
16
+ - Parallel and intercepting routes
17
+ - Middleware rename in v16 (middleware → proxy)
18
+
19
+ ## RSC Boundaries
20
+
21
+ Detect invalid React Server Component patterns.
22
+
23
+ See [rsc-boundaries.md](./rsc-boundaries.md) for:
24
+ - Async client component detection (invalid)
25
+ - Non-serializable props detection
26
+ - Server Action exceptions
27
+
28
+ ## Async Patterns
29
+
30
+ Next.js 15+ async API changes.
31
+
32
+ See [async-patterns.md](./async-patterns.md) for:
33
+ - Async `params` and `searchParams`
34
+ - Async `cookies()` and `headers()`
35
+ - Migration codemod
36
+
37
+ ## Runtime Selection
38
+
39
+ See [runtime-selection.md](./runtime-selection.md) for:
40
+ - Default to Node.js runtime
41
+ - When Edge runtime is appropriate
42
+
43
+ ## Directives
44
+
45
+ See [directives.md](./directives.md) for:
46
+ - `'use client'`, `'use server'` (React)
47
+ - `'use cache'` (Next.js)
48
+
49
+ ## Functions
50
+
51
+ See [functions.md](./functions.md) for:
52
+ - Navigation hooks: `useRouter`, `usePathname`, `useSearchParams`, `useParams`
53
+ - Server functions: `cookies`, `headers`, `draftMode`, `after`
54
+ - Generate functions: `generateStaticParams`, `generateMetadata`
55
+
56
+ ## Error Handling
57
+
58
+ See [error-handling.md](./error-handling.md) for:
59
+ - `error.tsx`, `global-error.tsx`, `not-found.tsx`
60
+ - `redirect`, `permanentRedirect`, `notFound`
61
+ - `forbidden`, `unauthorized` (auth errors)
62
+ - `unstable_rethrow` for catch blocks
63
+
64
+ ## Data Patterns
65
+
66
+ See [data-patterns.md](./data-patterns.md) for:
67
+ - Server Components vs Server Actions vs Route Handlers
68
+ - Avoiding data waterfalls (`Promise.all`, Suspense, preload)
69
+ - Client component data fetching
70
+
71
+ ## Route Handlers
72
+
73
+ See [route-handlers.md](./route-handlers.md) for:
74
+ - `route.ts` basics
75
+ - GET handler conflicts with `page.tsx`
76
+ - Environment behavior (no React DOM)
77
+ - When to use vs Server Actions
78
+
79
+ ## Metadata & OG Images
80
+
81
+ See [metadata.md](./metadata.md) for:
82
+ - Static and dynamic metadata
83
+ - `generateMetadata` function
84
+ - OG image generation with `next/og`
85
+ - File-based metadata conventions
86
+
87
+ ## Image Optimization
88
+
89
+ See [image.md](./image.md) for:
90
+ - Always use `next/image` over `<img>`
91
+ - Remote images configuration
92
+ - Responsive `sizes` attribute
93
+ - Blur placeholders
94
+ - Priority loading for LCP
95
+
96
+ ## Font Optimization
97
+
98
+ See [font.md](./font.md) for:
99
+ - `next/font` setup
100
+ - Google Fonts, local fonts
101
+ - Tailwind CSS integration
102
+ - Preloading subsets
103
+
104
+ ## Bundling
105
+
106
+ See [bundling.md](./bundling.md) for:
107
+ - Server-incompatible packages
108
+ - CSS imports (not link tags)
109
+ - Polyfills (already included)
110
+ - ESM/CommonJS issues
111
+ - Bundle analysis
112
+
113
+ ## Scripts
114
+
115
+ See [scripts.md](./scripts.md) for:
116
+ - `next/script` vs native script tags
117
+ - Inline scripts need `id`
118
+ - Loading strategies
119
+ - Google Analytics with `@next/third-parties`
120
+
121
+ ## Hydration Errors
122
+
123
+ See [hydration-error.md](./hydration-error.md) for:
124
+ - Common causes (browser APIs, dates, invalid HTML)
125
+ - Debugging with error overlay
126
+ - Fixes for each cause
127
+
128
+ ## Suspense Boundaries
129
+
130
+ See [suspense-boundaries.md](./suspense-boundaries.md) for:
131
+ - CSR bailout with `useSearchParams` and `usePathname`
132
+ - Which hooks require Suspense boundaries
133
+
134
+ ## Parallel & Intercepting Routes
135
+
136
+ See [parallel-routes.md](./parallel-routes.md) for:
137
+ - Modal patterns with `@slot` and `(.)` interceptors
138
+ - `default.tsx` for fallbacks
139
+ - Closing modals correctly with `router.back()`
140
+
141
+ ## Self-Hosting
142
+
143
+ See [self-hosting.md](./self-hosting.md) for:
144
+ - `output: 'standalone'` for Docker
145
+ - Cache handlers for multi-instance ISR
146
+ - What works vs needs extra setup
147
+
148
+ ## Debug Tricks
149
+
150
+ See [debug-tricks.md](./debug-tricks.md) for:
151
+ - MCP endpoint for AI-assisted debugging
152
+ - Rebuild specific routes with `--debug-build-paths`
153
+
@@ -0,0 +1,87 @@
1
+ # Async Patterns
2
+
3
+ In Next.js 15+, `params`, `searchParams`, `cookies()`, and `headers()` are asynchronous.
4
+
5
+ ## Async Params and SearchParams
6
+
7
+ Always type them as `Promise<...>` and await them.
8
+
9
+ ### Pages and Layouts
10
+
11
+ ```tsx
12
+ type Props = { params: Promise<{ slug: string }> }
13
+
14
+ export default async function Page({ params }: Props) {
15
+ const { slug } = await params
16
+ }
17
+ ```
18
+
19
+ ### Route Handlers
20
+
21
+ ```tsx
22
+ export async function GET(
23
+ request: Request,
24
+ { params }: { params: Promise<{ id: string }> }
25
+ ) {
26
+ const { id } = await params
27
+ }
28
+ ```
29
+
30
+ ### SearchParams
31
+
32
+ ```tsx
33
+ type Props = {
34
+ params: Promise<{ slug: string }>
35
+ searchParams: Promise<{ query?: string }>
36
+ }
37
+
38
+ export default async function Page({ params, searchParams }: Props) {
39
+ const { slug } = await params
40
+ const { query } = await searchParams
41
+ }
42
+ ```
43
+
44
+ ### Synchronous Components
45
+
46
+ Use `React.use()` for non-async components:
47
+
48
+ ```tsx
49
+ import { use } from 'react'
50
+
51
+ type Props = { params: Promise<{ slug: string }> }
52
+
53
+ export default function Page({ params }: Props) {
54
+ const { slug } = use(params)
55
+ }
56
+ ```
57
+
58
+ ### generateMetadata
59
+
60
+ ```tsx
61
+ type Props = { params: Promise<{ slug: string }> }
62
+
63
+ export async function generateMetadata({ params }: Props): Promise<Metadata> {
64
+ const { slug } = await params
65
+ return { title: slug }
66
+ }
67
+ ```
68
+
69
+ ## Async Cookies and Headers
70
+
71
+ ```tsx
72
+ import { cookies, headers } from 'next/headers'
73
+
74
+ export default async function Page() {
75
+ const cookieStore = await cookies()
76
+ const headersList = await headers()
77
+
78
+ const theme = cookieStore.get('theme')
79
+ const userAgent = headersList.get('user-agent')
80
+ }
81
+ ```
82
+
83
+ ## Migration Codemod
84
+
85
+ ```bash
86
+ npx @next/codemod@latest next-async-request-api .
87
+ ```
@@ -0,0 +1,180 @@
1
+ # Bundling
2
+
3
+ Fix common bundling issues with third-party packages.
4
+
5
+ ## Server-Incompatible Packages
6
+
7
+ Some packages use browser APIs (`window`, `document`, `localStorage`) and fail in Server Components.
8
+
9
+ ### Error Signs
10
+
11
+ ```
12
+ ReferenceError: window is not defined
13
+ ReferenceError: document is not defined
14
+ ReferenceError: localStorage is not defined
15
+ Module not found: Can't resolve 'fs'
16
+ ```
17
+
18
+ ### Solution 1: Mark as Client-Only
19
+
20
+ If the package is only needed on client:
21
+
22
+ ```tsx
23
+ // Bad: Fails - package uses window
24
+ import SomeChart from 'some-chart-library'
25
+
26
+ export default function Page() {
27
+ return <SomeChart />
28
+ }
29
+
30
+ // Good: Use dynamic import with ssr: false
31
+ import dynamic from 'next/dynamic'
32
+
33
+ const SomeChart = dynamic(() => import('some-chart-library'), {
34
+ ssr: false,
35
+ })
36
+
37
+ export default function Page() {
38
+ return <SomeChart />
39
+ }
40
+ ```
41
+
42
+ ### Solution 2: Externalize from Server Bundle
43
+
44
+ For packages that should run on server but have bundling issues:
45
+
46
+ ```js
47
+ // next.config.js
48
+ module.exports = {
49
+ serverExternalPackages: ['problematic-package'],
50
+ }
51
+ ```
52
+
53
+ Use this for:
54
+ - Packages with native bindings (sharp, bcrypt)
55
+ - Packages that don't bundle well (some ORMs)
56
+ - Packages with circular dependencies
57
+
58
+ ### Solution 3: Client Component Wrapper
59
+
60
+ Wrap the entire usage in a client component:
61
+
62
+ ```tsx
63
+ // components/ChartWrapper.tsx
64
+ 'use client'
65
+
66
+ import { Chart } from 'chart-library'
67
+
68
+ export function ChartWrapper(props) {
69
+ return <Chart {...props} />
70
+ }
71
+
72
+ // app/page.tsx (server component)
73
+ import { ChartWrapper } from '@/components/ChartWrapper'
74
+
75
+ export default function Page() {
76
+ return <ChartWrapper data={data} />
77
+ }
78
+ ```
79
+
80
+ ## CSS Imports
81
+
82
+ Import CSS files instead of using `<link>` tags. Next.js handles bundling and optimization.
83
+
84
+ ```tsx
85
+ // Bad: Manual link tag
86
+ <link rel="stylesheet" href="/styles.css" />
87
+
88
+ // Good: Import CSS
89
+ import './styles.css'
90
+
91
+ // Good: CSS Modules
92
+ import styles from './Button.module.css'
93
+ ```
94
+
95
+ ## Polyfills
96
+
97
+ Next.js includes common polyfills automatically. Don't load redundant ones from polyfill.io or similar CDNs.
98
+
99
+ Already included: `Array.from`, `Object.assign`, `Promise`, `fetch`, `Map`, `Set`, `Symbol`, `URLSearchParams`, and 50+ others.
100
+
101
+ ```tsx
102
+ // Bad: Redundant polyfills
103
+ <script src="https://polyfill.io/v3/polyfill.min.js?features=fetch,Promise,Array.from" />
104
+
105
+ // Good: Next.js includes these automatically
106
+ ```
107
+
108
+ ## ESM/CommonJS Issues
109
+
110
+ ### Error Signs
111
+
112
+ ```
113
+ SyntaxError: Cannot use import statement outside a module
114
+ Error: require() of ES Module
115
+ Module not found: ESM packages need to be imported
116
+ ```
117
+
118
+ ### Solution: Transpile Package
119
+
120
+ ```js
121
+ // next.config.js
122
+ module.exports = {
123
+ transpilePackages: ['some-esm-package', 'another-package'],
124
+ }
125
+ ```
126
+
127
+ ## Common Problematic Packages
128
+
129
+ | Package | Issue | Solution |
130
+ |---------|-------|----------|
131
+ | `sharp` | Native bindings | `serverExternalPackages: ['sharp']` |
132
+ | `bcrypt` | Native bindings | `serverExternalPackages: ['bcrypt']` or use `bcryptjs` |
133
+ | `canvas` | Native bindings | `serverExternalPackages: ['canvas']` |
134
+ | `recharts` | Uses window | `dynamic(() => import('recharts'), { ssr: false })` |
135
+ | `react-quill` | Uses document | `dynamic(() => import('react-quill'), { ssr: false })` |
136
+ | `mapbox-gl` | Uses window | `dynamic(() => import('mapbox-gl'), { ssr: false })` |
137
+ | `monaco-editor` | Uses window | `dynamic(() => import('@monaco-editor/react'), { ssr: false })` |
138
+ | `lottie-web` | Uses document | `dynamic(() => import('lottie-react'), { ssr: false })` |
139
+
140
+ ## Bundle Analysis
141
+
142
+ Analyze bundle size with the built-in analyzer (Next.js 16.1+):
143
+
144
+ ```bash
145
+ next experimental-analyze
146
+ ```
147
+
148
+ This opens an interactive UI to:
149
+ - Filter by route, environment (client/server), and type
150
+ - Inspect module sizes and import chains
151
+ - View treemap visualization
152
+
153
+ Save output for comparison:
154
+
155
+ ```bash
156
+ next experimental-analyze --output
157
+ # Output saved to .next/diagnostics/analyze
158
+ ```
159
+
160
+ Reference: https://nextjs.org/docs/app/guides/package-bundling
161
+
162
+ ## Migrating from Webpack to Turbopack
163
+
164
+ Turbopack is the default bundler in Next.js 15+. If you have custom webpack config, migrate to Turbopack-compatible alternatives:
165
+
166
+ ```js
167
+ // next.config.js
168
+ module.exports = {
169
+ // Good: Works with Turbopack
170
+ serverExternalPackages: ['package'],
171
+ transpilePackages: ['package'],
172
+
173
+ // Bad: Webpack-only - migrate away from this
174
+ webpack: (config) => {
175
+ // custom webpack config
176
+ },
177
+ }
178
+ ```
179
+
180
+ Reference: https://nextjs.org/docs/app/building-your-application/upgrading/from-webpack-to-turbopack