create-apppaaaul 2.0.44 → 2.0.47
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.
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/api-design-principles/SKILL.md +528 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/api-design-principles/assets/api-design-checklist.md +155 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/api-design-principles/assets/rest-api-template.py +182 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/api-design-principles/references/graphql-schema-design.md +583 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/api-design-principles/references/rest-best-practices.md +408 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/better-auth-best-practices/SKILL.md +166 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/brainstorming/SKILL.md +96 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/changelog-generator/SKILL.md +104 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/error-handling-patterns/SKILL.md +641 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/interface-design/SKILL.md +391 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/interface-design/references/critique.md +67 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/interface-design/references/example.md +86 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/interface-design/references/principles.md +235 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/interface-design/references/validation.md +48 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/next-best-practices/SKILL.md +153 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/next-best-practices/async-patterns.md +87 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/next-best-practices/bundling.md +180 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/next-best-practices/data-patterns.md +297 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/next-best-practices/debug-tricks.md +105 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/next-best-practices/directives.md +73 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/next-best-practices/error-handling.md +227 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/next-best-practices/file-conventions.md +140 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/next-best-practices/font.md +245 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/next-best-practices/functions.md +108 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/next-best-practices/hydration-error.md +91 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/next-best-practices/image.md +173 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/next-best-practices/metadata.md +301 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/next-best-practices/parallel-routes.md +287 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/next-best-practices/route-handlers.md +146 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/next-best-practices/rsc-boundaries.md +159 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/next-best-practices/runtime-selection.md +39 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/next-best-practices/scripts.md +141 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/next-best-practices/self-hosting.md +371 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/next-best-practices/suspense-boundaries.md +67 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/postgresql-table-design/SKILL.md +202 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/prompt-engineering-patterns/SKILL.md +480 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/prompt-engineering-patterns/assets/few-shot-examples.json +106 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/prompt-engineering-patterns/assets/prompt-template-library.md +264 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/prompt-engineering-patterns/references/chain-of-thought.md +412 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/prompt-engineering-patterns/references/few-shot-learning.md +386 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/prompt-engineering-patterns/references/prompt-optimization.md +428 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/prompt-engineering-patterns/references/prompt-templates.md +484 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/prompt-engineering-patterns/references/system-prompts.md +195 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/prompt-engineering-patterns/scripts/optimize-prompt.py +279 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/seo-audit/SKILL.md +410 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/seo-audit/references/aeo-geo-patterns.md +285 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/seo-audit/references/ai-writing-detection.md +200 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/AGENTS.md +2934 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/SKILL.md +136 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/advanced-event-handler-refs.md +55 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/advanced-init-once.md +42 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/advanced-use-latest.md +39 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/async-api-routes.md +38 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/async-defer-await.md +80 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/async-dependencies.md +51 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/async-parallel.md +28 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/async-suspense-boundaries.md +99 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/bundle-barrel-imports.md +59 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/bundle-conditional.md +31 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/bundle-defer-third-party.md +49 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/bundle-dynamic-imports.md +35 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/bundle-preload.md +50 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/client-event-listeners.md +74 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/client-localstorage-schema.md +71 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/client-passive-event-listeners.md +48 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/client-swr-dedup.md +56 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/js-batch-dom-css.md +107 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/js-cache-function-results.md +80 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/js-cache-property-access.md +28 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/js-cache-storage.md +70 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/js-combine-iterations.md +32 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/js-early-exit.md +50 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/js-hoist-regexp.md +45 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/js-index-maps.md +37 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/js-length-check-first.md +49 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/js-min-max-loop.md +82 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/js-set-map-lookups.md +24 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/js-tosorted-immutable.md +57 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/rendering-activity.md +26 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/rendering-animate-svg-wrapper.md +47 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/rendering-conditional-render.md +40 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/rendering-content-visibility.md +38 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/rendering-hoist-jsx.md +46 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/rendering-hydration-no-flicker.md +82 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/rendering-hydration-suppress-warning.md +30 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/rendering-svg-precision.md +28 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/rendering-usetransition-loading.md +75 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/rerender-defer-reads.md +39 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/rerender-dependencies.md +45 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/rerender-derived-state-no-effect.md +40 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/rerender-derived-state.md +29 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/rerender-functional-setstate.md +74 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/rerender-lazy-state-init.md +58 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/rerender-memo-with-default-value.md +38 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/rerender-memo.md +44 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/rerender-move-effect-to-event.md +45 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/rerender-simple-expression-in-memo.md +35 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/rerender-transitions.md +40 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/rerender-use-ref-transient-values.md +73 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/server-after-nonblocking.md +73 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/server-auth-actions.md +96 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/server-cache-lru.md +41 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/server-cache-react.md +76 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/server-dedup-props.md +65 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/server-parallel-fetching.md +83 -0
- package/dist/templates/nextjs-ts-clean/project/.agents/skills/vercel-react-best-practices/rules/server-serialization.md +38 -0
- package/dist/templates/nextjs-ts-clean/project/eslint.config.mjs +6 -8
- package/dist/templates/nextjs-ts-clean/project/package.json +1 -1
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/api-design-principles/SKILL.md +528 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/api-design-principles/assets/api-design-checklist.md +155 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/api-design-principles/assets/rest-api-template.py +182 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/api-design-principles/references/graphql-schema-design.md +583 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/api-design-principles/references/rest-best-practices.md +408 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/better-auth-best-practices/SKILL.md +166 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/brainstorming/SKILL.md +96 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/changelog-generator/SKILL.md +104 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/error-handling-patterns/SKILL.md +641 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/interface-design/SKILL.md +391 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/interface-design/references/critique.md +67 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/interface-design/references/example.md +86 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/interface-design/references/principles.md +235 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/interface-design/references/validation.md +48 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/next-best-practices/SKILL.md +153 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/next-best-practices/async-patterns.md +87 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/next-best-practices/bundling.md +180 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/next-best-practices/data-patterns.md +297 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/next-best-practices/debug-tricks.md +105 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/next-best-practices/directives.md +73 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/next-best-practices/error-handling.md +227 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/next-best-practices/file-conventions.md +140 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/next-best-practices/font.md +245 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/next-best-practices/functions.md +108 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/next-best-practices/hydration-error.md +91 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/next-best-practices/image.md +173 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/next-best-practices/metadata.md +301 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/next-best-practices/parallel-routes.md +287 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/next-best-practices/route-handlers.md +146 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/next-best-practices/rsc-boundaries.md +159 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/next-best-practices/runtime-selection.md +39 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/next-best-practices/scripts.md +141 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/next-best-practices/self-hosting.md +371 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/next-best-practices/suspense-boundaries.md +67 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/postgresql-table-design/SKILL.md +202 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/prompt-engineering-patterns/SKILL.md +480 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/prompt-engineering-patterns/assets/few-shot-examples.json +106 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/prompt-engineering-patterns/assets/prompt-template-library.md +264 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/prompt-engineering-patterns/references/chain-of-thought.md +412 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/prompt-engineering-patterns/references/few-shot-learning.md +386 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/prompt-engineering-patterns/references/prompt-optimization.md +428 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/prompt-engineering-patterns/references/prompt-templates.md +484 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/prompt-engineering-patterns/references/system-prompts.md +195 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/prompt-engineering-patterns/scripts/optimize-prompt.py +279 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/seo-audit/SKILL.md +410 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/seo-audit/references/aeo-geo-patterns.md +285 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/seo-audit/references/ai-writing-detection.md +200 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/AGENTS.md +2934 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/SKILL.md +136 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/advanced-event-handler-refs.md +55 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/advanced-init-once.md +42 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/advanced-use-latest.md +39 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/async-api-routes.md +38 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/async-defer-await.md +80 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/async-dependencies.md +51 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/async-parallel.md +28 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/async-suspense-boundaries.md +99 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/bundle-barrel-imports.md +59 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/bundle-conditional.md +31 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/bundle-defer-third-party.md +49 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/bundle-dynamic-imports.md +35 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/bundle-preload.md +50 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/client-event-listeners.md +74 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/client-localstorage-schema.md +71 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/client-passive-event-listeners.md +48 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/client-swr-dedup.md +56 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/js-batch-dom-css.md +107 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/js-cache-function-results.md +80 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/js-cache-property-access.md +28 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/js-cache-storage.md +70 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/js-combine-iterations.md +32 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/js-early-exit.md +50 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/js-hoist-regexp.md +45 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/js-index-maps.md +37 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/js-length-check-first.md +49 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/js-min-max-loop.md +82 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/js-set-map-lookups.md +24 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/js-tosorted-immutable.md +57 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/rendering-activity.md +26 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/rendering-animate-svg-wrapper.md +47 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/rendering-conditional-render.md +40 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/rendering-content-visibility.md +38 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/rendering-hoist-jsx.md +46 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/rendering-hydration-no-flicker.md +82 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/rendering-hydration-suppress-warning.md +30 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/rendering-svg-precision.md +28 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/rendering-usetransition-loading.md +75 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/rerender-defer-reads.md +39 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/rerender-dependencies.md +45 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/rerender-derived-state-no-effect.md +40 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/rerender-derived-state.md +29 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/rerender-functional-setstate.md +74 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/rerender-lazy-state-init.md +58 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/rerender-memo-with-default-value.md +38 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/rerender-memo.md +44 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/rerender-move-effect-to-event.md +45 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/rerender-simple-expression-in-memo.md +35 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/rerender-transitions.md +40 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/rerender-use-ref-transient-values.md +73 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/server-after-nonblocking.md +73 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/server-auth-actions.md +96 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/server-cache-lru.md +41 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/server-cache-react.md +76 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/server-dedup-props.md +65 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/server-parallel-fetching.md +83 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/.agents/skills/vercel-react-best-practices/rules/server-serialization.md +38 -0
- package/dist/templates/nextjs-ts-landing-prisma/project/eslint.config.mjs +6 -8
- package/dist/templates/nextjs-ts-landing-prisma/project/package.json +2 -2
- package/dist/templates/nextjs-ts-landing-prisma/project/pnpm-lock.yaml +6 -18
- package/package.json +1 -1
|
@@ -0,0 +1,408 @@
|
|
|
1
|
+
# REST API Best Practices
|
|
2
|
+
|
|
3
|
+
## URL Structure
|
|
4
|
+
|
|
5
|
+
### Resource Naming
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
# Good - Plural nouns
|
|
9
|
+
GET /api/users
|
|
10
|
+
GET /api/orders
|
|
11
|
+
GET /api/products
|
|
12
|
+
|
|
13
|
+
# Bad - Verbs or mixed conventions
|
|
14
|
+
GET /api/getUser
|
|
15
|
+
GET /api/user (inconsistent singular)
|
|
16
|
+
POST /api/createOrder
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### Nested Resources
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
# Shallow nesting (preferred)
|
|
23
|
+
GET /api/users/{id}/orders
|
|
24
|
+
GET /api/orders/{id}
|
|
25
|
+
|
|
26
|
+
# Deep nesting (avoid)
|
|
27
|
+
GET /api/users/{id}/orders/{orderId}/items/{itemId}/reviews
|
|
28
|
+
# Better:
|
|
29
|
+
GET /api/order-items/{id}/reviews
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## HTTP Methods and Status Codes
|
|
33
|
+
|
|
34
|
+
### GET - Retrieve Resources
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
GET /api/users → 200 OK (with list)
|
|
38
|
+
GET /api/users/{id} → 200 OK or 404 Not Found
|
|
39
|
+
GET /api/users?page=2 → 200 OK (paginated)
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### POST - Create Resources
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
POST /api/users
|
|
46
|
+
Body: {"name": "John", "email": "john@example.com"}
|
|
47
|
+
→ 201 Created
|
|
48
|
+
Location: /api/users/123
|
|
49
|
+
Body: {"id": "123", "name": "John", ...}
|
|
50
|
+
|
|
51
|
+
POST /api/users (validation error)
|
|
52
|
+
→ 422 Unprocessable Entity
|
|
53
|
+
Body: {"errors": [...]}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### PUT - Replace Resources
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
PUT /api/users/{id}
|
|
60
|
+
Body: {complete user object}
|
|
61
|
+
→ 200 OK (updated)
|
|
62
|
+
→ 404 Not Found (doesn't exist)
|
|
63
|
+
|
|
64
|
+
# Must include ALL fields
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### PATCH - Partial Update
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
PATCH /api/users/{id}
|
|
71
|
+
Body: {"name": "Jane"} (only changed fields)
|
|
72
|
+
→ 200 OK
|
|
73
|
+
→ 404 Not Found
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### DELETE - Remove Resources
|
|
77
|
+
|
|
78
|
+
```
|
|
79
|
+
DELETE /api/users/{id}
|
|
80
|
+
→ 204 No Content (deleted)
|
|
81
|
+
→ 404 Not Found
|
|
82
|
+
→ 409 Conflict (can't delete due to references)
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Filtering, Sorting, and Searching
|
|
86
|
+
|
|
87
|
+
### Query Parameters
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
# Filtering
|
|
91
|
+
GET /api/users?status=active
|
|
92
|
+
GET /api/users?role=admin&status=active
|
|
93
|
+
|
|
94
|
+
# Sorting
|
|
95
|
+
GET /api/users?sort=created_at
|
|
96
|
+
GET /api/users?sort=-created_at (descending)
|
|
97
|
+
GET /api/users?sort=name,created_at
|
|
98
|
+
|
|
99
|
+
# Searching
|
|
100
|
+
GET /api/users?search=john
|
|
101
|
+
GET /api/users?q=john
|
|
102
|
+
|
|
103
|
+
# Field selection (sparse fieldsets)
|
|
104
|
+
GET /api/users?fields=id,name,email
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## Pagination Patterns
|
|
108
|
+
|
|
109
|
+
### Offset-Based Pagination
|
|
110
|
+
|
|
111
|
+
```python
|
|
112
|
+
GET /api/users?page=2&page_size=20
|
|
113
|
+
|
|
114
|
+
Response:
|
|
115
|
+
{
|
|
116
|
+
"items": [...],
|
|
117
|
+
"page": 2,
|
|
118
|
+
"page_size": 20,
|
|
119
|
+
"total": 150,
|
|
120
|
+
"pages": 8
|
|
121
|
+
}
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Cursor-Based Pagination (for large datasets)
|
|
125
|
+
|
|
126
|
+
```python
|
|
127
|
+
GET /api/users?limit=20&cursor=eyJpZCI6MTIzfQ
|
|
128
|
+
|
|
129
|
+
Response:
|
|
130
|
+
{
|
|
131
|
+
"items": [...],
|
|
132
|
+
"next_cursor": "eyJpZCI6MTQzfQ",
|
|
133
|
+
"has_more": true
|
|
134
|
+
}
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### Link Header Pagination (RESTful)
|
|
138
|
+
|
|
139
|
+
```
|
|
140
|
+
GET /api/users?page=2
|
|
141
|
+
|
|
142
|
+
Response Headers:
|
|
143
|
+
Link: <https://api.example.com/users?page=3>; rel="next",
|
|
144
|
+
<https://api.example.com/users?page=1>; rel="prev",
|
|
145
|
+
<https://api.example.com/users?page=1>; rel="first",
|
|
146
|
+
<https://api.example.com/users?page=8>; rel="last"
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
## Versioning Strategies
|
|
150
|
+
|
|
151
|
+
### URL Versioning (Recommended)
|
|
152
|
+
|
|
153
|
+
```
|
|
154
|
+
/api/v1/users
|
|
155
|
+
/api/v2/users
|
|
156
|
+
|
|
157
|
+
Pros: Clear, easy to route
|
|
158
|
+
Cons: Multiple URLs for same resource
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
### Header Versioning
|
|
162
|
+
|
|
163
|
+
```
|
|
164
|
+
GET /api/users
|
|
165
|
+
Accept: application/vnd.api+json; version=2
|
|
166
|
+
|
|
167
|
+
Pros: Clean URLs
|
|
168
|
+
Cons: Less visible, harder to test
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### Query Parameter
|
|
172
|
+
|
|
173
|
+
```
|
|
174
|
+
GET /api/users?version=2
|
|
175
|
+
|
|
176
|
+
Pros: Easy to test
|
|
177
|
+
Cons: Optional parameter can be forgotten
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
## Rate Limiting
|
|
181
|
+
|
|
182
|
+
### Headers
|
|
183
|
+
|
|
184
|
+
```
|
|
185
|
+
X-RateLimit-Limit: 1000
|
|
186
|
+
X-RateLimit-Remaining: 742
|
|
187
|
+
X-RateLimit-Reset: 1640000000
|
|
188
|
+
|
|
189
|
+
Response when limited:
|
|
190
|
+
429 Too Many Requests
|
|
191
|
+
Retry-After: 3600
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
### Implementation Pattern
|
|
195
|
+
|
|
196
|
+
```python
|
|
197
|
+
from fastapi import HTTPException, Request
|
|
198
|
+
from datetime import datetime, timedelta
|
|
199
|
+
|
|
200
|
+
class RateLimiter:
|
|
201
|
+
def __init__(self, calls: int, period: int):
|
|
202
|
+
self.calls = calls
|
|
203
|
+
self.period = period
|
|
204
|
+
self.cache = {}
|
|
205
|
+
|
|
206
|
+
def check(self, key: str) -> bool:
|
|
207
|
+
now = datetime.now()
|
|
208
|
+
if key not in self.cache:
|
|
209
|
+
self.cache[key] = []
|
|
210
|
+
|
|
211
|
+
# Remove old requests
|
|
212
|
+
self.cache[key] = [
|
|
213
|
+
ts for ts in self.cache[key]
|
|
214
|
+
if now - ts < timedelta(seconds=self.period)
|
|
215
|
+
]
|
|
216
|
+
|
|
217
|
+
if len(self.cache[key]) >= self.calls:
|
|
218
|
+
return False
|
|
219
|
+
|
|
220
|
+
self.cache[key].append(now)
|
|
221
|
+
return True
|
|
222
|
+
|
|
223
|
+
limiter = RateLimiter(calls=100, period=60)
|
|
224
|
+
|
|
225
|
+
@app.get("/api/users")
|
|
226
|
+
async def get_users(request: Request):
|
|
227
|
+
if not limiter.check(request.client.host):
|
|
228
|
+
raise HTTPException(
|
|
229
|
+
status_code=429,
|
|
230
|
+
headers={"Retry-After": "60"}
|
|
231
|
+
)
|
|
232
|
+
return {"users": [...]}
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
## Authentication and Authorization
|
|
236
|
+
|
|
237
|
+
### Bearer Token
|
|
238
|
+
|
|
239
|
+
```
|
|
240
|
+
Authorization: Bearer eyJhbGciOiJIUzI1NiIs...
|
|
241
|
+
|
|
242
|
+
401 Unauthorized - Missing/invalid token
|
|
243
|
+
403 Forbidden - Valid token, insufficient permissions
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
### API Keys
|
|
247
|
+
|
|
248
|
+
```
|
|
249
|
+
X-API-Key: your-api-key-here
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
## Error Response Format
|
|
253
|
+
|
|
254
|
+
### Consistent Structure
|
|
255
|
+
|
|
256
|
+
```json
|
|
257
|
+
{
|
|
258
|
+
"error": {
|
|
259
|
+
"code": "VALIDATION_ERROR",
|
|
260
|
+
"message": "Request validation failed",
|
|
261
|
+
"details": [
|
|
262
|
+
{
|
|
263
|
+
"field": "email",
|
|
264
|
+
"message": "Invalid email format",
|
|
265
|
+
"value": "not-an-email"
|
|
266
|
+
}
|
|
267
|
+
],
|
|
268
|
+
"timestamp": "2025-10-16T12:00:00Z",
|
|
269
|
+
"path": "/api/users"
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
### Status Code Guidelines
|
|
275
|
+
|
|
276
|
+
- `200 OK`: Successful GET, PATCH, PUT
|
|
277
|
+
- `201 Created`: Successful POST
|
|
278
|
+
- `204 No Content`: Successful DELETE
|
|
279
|
+
- `400 Bad Request`: Malformed request
|
|
280
|
+
- `401 Unauthorized`: Authentication required
|
|
281
|
+
- `403 Forbidden`: Authenticated but not authorized
|
|
282
|
+
- `404 Not Found`: Resource doesn't exist
|
|
283
|
+
- `409 Conflict`: State conflict (duplicate email, etc.)
|
|
284
|
+
- `422 Unprocessable Entity`: Validation errors
|
|
285
|
+
- `429 Too Many Requests`: Rate limited
|
|
286
|
+
- `500 Internal Server Error`: Server error
|
|
287
|
+
- `503 Service Unavailable`: Temporary downtime
|
|
288
|
+
|
|
289
|
+
## Caching
|
|
290
|
+
|
|
291
|
+
### Cache Headers
|
|
292
|
+
|
|
293
|
+
```
|
|
294
|
+
# Client caching
|
|
295
|
+
Cache-Control: public, max-age=3600
|
|
296
|
+
|
|
297
|
+
# No caching
|
|
298
|
+
Cache-Control: no-cache, no-store, must-revalidate
|
|
299
|
+
|
|
300
|
+
# Conditional requests
|
|
301
|
+
ETag: "33a64df551425fcc55e4d42a148795d9f25f89d4"
|
|
302
|
+
If-None-Match: "33a64df551425fcc55e4d42a148795d9f25f89d4"
|
|
303
|
+
→ 304 Not Modified
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
## Bulk Operations
|
|
307
|
+
|
|
308
|
+
### Batch Endpoints
|
|
309
|
+
|
|
310
|
+
```python
|
|
311
|
+
POST /api/users/batch
|
|
312
|
+
{
|
|
313
|
+
"items": [
|
|
314
|
+
{"name": "User1", "email": "user1@example.com"},
|
|
315
|
+
{"name": "User2", "email": "user2@example.com"}
|
|
316
|
+
]
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
Response:
|
|
320
|
+
{
|
|
321
|
+
"results": [
|
|
322
|
+
{"id": "1", "status": "created"},
|
|
323
|
+
{"id": null, "status": "failed", "error": "Email already exists"}
|
|
324
|
+
]
|
|
325
|
+
}
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
## Idempotency
|
|
329
|
+
|
|
330
|
+
### Idempotency Keys
|
|
331
|
+
|
|
332
|
+
```
|
|
333
|
+
POST /api/orders
|
|
334
|
+
Idempotency-Key: unique-key-123
|
|
335
|
+
|
|
336
|
+
If duplicate request:
|
|
337
|
+
→ 200 OK (return cached response)
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
## CORS Configuration
|
|
341
|
+
|
|
342
|
+
```python
|
|
343
|
+
from fastapi.middleware.cors import CORSMiddleware
|
|
344
|
+
|
|
345
|
+
app.add_middleware(
|
|
346
|
+
CORSMiddleware,
|
|
347
|
+
allow_origins=["https://example.com"],
|
|
348
|
+
allow_credentials=True,
|
|
349
|
+
allow_methods=["*"],
|
|
350
|
+
allow_headers=["*"],
|
|
351
|
+
)
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
## Documentation with OpenAPI
|
|
355
|
+
|
|
356
|
+
```python
|
|
357
|
+
from fastapi import FastAPI
|
|
358
|
+
|
|
359
|
+
app = FastAPI(
|
|
360
|
+
title="My API",
|
|
361
|
+
description="API for managing users",
|
|
362
|
+
version="1.0.0",
|
|
363
|
+
docs_url="/docs",
|
|
364
|
+
redoc_url="/redoc"
|
|
365
|
+
)
|
|
366
|
+
|
|
367
|
+
@app.get(
|
|
368
|
+
"/api/users/{user_id}",
|
|
369
|
+
summary="Get user by ID",
|
|
370
|
+
response_description="User details",
|
|
371
|
+
tags=["Users"]
|
|
372
|
+
)
|
|
373
|
+
async def get_user(
|
|
374
|
+
user_id: str = Path(..., description="The user ID")
|
|
375
|
+
):
|
|
376
|
+
"""
|
|
377
|
+
Retrieve user by ID.
|
|
378
|
+
|
|
379
|
+
Returns full user profile including:
|
|
380
|
+
- Basic information
|
|
381
|
+
- Contact details
|
|
382
|
+
- Account status
|
|
383
|
+
"""
|
|
384
|
+
pass
|
|
385
|
+
```
|
|
386
|
+
|
|
387
|
+
## Health and Monitoring Endpoints
|
|
388
|
+
|
|
389
|
+
```python
|
|
390
|
+
@app.get("/health")
|
|
391
|
+
async def health_check():
|
|
392
|
+
return {
|
|
393
|
+
"status": "healthy",
|
|
394
|
+
"version": "1.0.0",
|
|
395
|
+
"timestamp": datetime.now().isoformat()
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
@app.get("/health/detailed")
|
|
399
|
+
async def detailed_health():
|
|
400
|
+
return {
|
|
401
|
+
"status": "healthy",
|
|
402
|
+
"checks": {
|
|
403
|
+
"database": await check_database(),
|
|
404
|
+
"redis": await check_redis(),
|
|
405
|
+
"external_api": await check_external_api()
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
```
|
package/dist/templates/nextjs-ts-clean/project/.agents/skills/better-auth-best-practices/SKILL.md
ADDED
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: better-auth-best-practices
|
|
3
|
+
description: Skill for integrating Better Auth - the comprehensive TypeScript authentication framework.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Better Auth Integration Guide
|
|
7
|
+
|
|
8
|
+
**Always consult [better-auth.com/docs](https://better-auth.com/docs) for code examples and latest API.**
|
|
9
|
+
|
|
10
|
+
Better Auth is a TypeScript-first, framework-agnostic auth framework supporting email/password, OAuth, magic links, passkeys, and more via plugins.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Quick Reference
|
|
15
|
+
|
|
16
|
+
### Environment Variables
|
|
17
|
+
- `BETTER_AUTH_SECRET` - Encryption secret (min 32 chars). Generate: `openssl rand -base64 32`
|
|
18
|
+
- `BETTER_AUTH_URL` - Base URL (e.g., `https://example.com`)
|
|
19
|
+
|
|
20
|
+
Only define `baseURL`/`secret` in config if env vars are NOT set.
|
|
21
|
+
|
|
22
|
+
### File Location
|
|
23
|
+
CLI looks for `auth.ts` in: `./`, `./lib`, `./utils`, or under `./src`. Use `--config` for custom path.
|
|
24
|
+
|
|
25
|
+
### CLI Commands
|
|
26
|
+
- `npx @better-auth/cli@latest migrate` - Apply schema (built-in adapter)
|
|
27
|
+
- `npx @better-auth/cli@latest generate` - Generate schema for Prisma/Drizzle
|
|
28
|
+
- `npx @better-auth/cli mcp --cursor` - Add MCP to AI tools
|
|
29
|
+
|
|
30
|
+
**Re-run after adding/changing plugins.**
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Core Config Options
|
|
35
|
+
|
|
36
|
+
| Option | Notes |
|
|
37
|
+
|--------|-------|
|
|
38
|
+
| `appName` | Optional display name |
|
|
39
|
+
| `baseURL` | Only if `BETTER_AUTH_URL` not set |
|
|
40
|
+
| `basePath` | Default `/api/auth`. Set `/` for root. |
|
|
41
|
+
| `secret` | Only if `BETTER_AUTH_SECRET` not set |
|
|
42
|
+
| `database` | Required for most features. See adapters docs. |
|
|
43
|
+
| `secondaryStorage` | Redis/KV for sessions & rate limits |
|
|
44
|
+
| `emailAndPassword` | `{ enabled: true }` to activate |
|
|
45
|
+
| `socialProviders` | `{ google: { clientId, clientSecret }, ... }` |
|
|
46
|
+
| `plugins` | Array of plugins |
|
|
47
|
+
| `trustedOrigins` | CSRF whitelist |
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## Database
|
|
52
|
+
|
|
53
|
+
**Direct connections:** Pass `pg.Pool`, `mysql2` pool, `better-sqlite3`, or `bun:sqlite` instance.
|
|
54
|
+
|
|
55
|
+
**ORM adapters:** Import from `better-auth/adapters/drizzle`, `better-auth/adapters/prisma`, `better-auth/adapters/mongodb`.
|
|
56
|
+
|
|
57
|
+
**Critical:** Better Auth uses adapter model names, NOT underlying table names. If Prisma model is `User` mapping to table `users`, use `modelName: "user"` (Prisma reference), not `"users"`.
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Session Management
|
|
62
|
+
|
|
63
|
+
**Storage priority:**
|
|
64
|
+
1. If `secondaryStorage` defined → sessions go there (not DB)
|
|
65
|
+
2. Set `session.storeSessionInDatabase: true` to also persist to DB
|
|
66
|
+
3. No database + `cookieCache` → fully stateless mode
|
|
67
|
+
|
|
68
|
+
**Cookie cache strategies:**
|
|
69
|
+
- `compact` (default) - Base64url + HMAC. Smallest.
|
|
70
|
+
- `jwt` - Standard JWT. Readable but signed.
|
|
71
|
+
- `jwe` - Encrypted. Maximum security.
|
|
72
|
+
|
|
73
|
+
**Key options:** `session.expiresIn` (default 7 days), `session.updateAge` (refresh interval), `session.cookieCache.maxAge`, `session.cookieCache.version` (change to invalidate all sessions).
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## User & Account Config
|
|
78
|
+
|
|
79
|
+
**User:** `user.modelName`, `user.fields` (column mapping), `user.additionalFields`, `user.changeEmail.enabled` (disabled by default), `user.deleteUser.enabled` (disabled by default).
|
|
80
|
+
|
|
81
|
+
**Account:** `account.modelName`, `account.accountLinking.enabled`, `account.storeAccountCookie` (for stateless OAuth).
|
|
82
|
+
|
|
83
|
+
**Required for registration:** `email` and `name` fields.
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## Email Flows
|
|
88
|
+
|
|
89
|
+
- `emailVerification.sendVerificationEmail` - Must be defined for verification to work
|
|
90
|
+
- `emailVerification.sendOnSignUp` / `sendOnSignIn` - Auto-send triggers
|
|
91
|
+
- `emailAndPassword.sendResetPassword` - Password reset email handler
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## Security
|
|
96
|
+
|
|
97
|
+
**In `advanced`:**
|
|
98
|
+
- `useSecureCookies` - Force HTTPS cookies
|
|
99
|
+
- `disableCSRFCheck` - ⚠️ Security risk
|
|
100
|
+
- `disableOriginCheck` - ⚠️ Security risk
|
|
101
|
+
- `crossSubDomainCookies.enabled` - Share cookies across subdomains
|
|
102
|
+
- `ipAddress.ipAddressHeaders` - Custom IP headers for proxies
|
|
103
|
+
- `database.generateId` - Custom ID generation or `"serial"`/`"uuid"`/`false`
|
|
104
|
+
|
|
105
|
+
**Rate limiting:** `rateLimit.enabled`, `rateLimit.window`, `rateLimit.max`, `rateLimit.storage` ("memory" | "database" | "secondary-storage").
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## Hooks
|
|
110
|
+
|
|
111
|
+
**Endpoint hooks:** `hooks.before` / `hooks.after` - Array of `{ matcher, handler }`. Use `createAuthMiddleware`. Access `ctx.path`, `ctx.context.returned` (after), `ctx.context.session`.
|
|
112
|
+
|
|
113
|
+
**Database hooks:** `databaseHooks.user.create.before/after`, same for `session`, `account`. Useful for adding default values or post-creation actions.
|
|
114
|
+
|
|
115
|
+
**Hook context (`ctx.context`):** `session`, `secret`, `authCookies`, `password.hash()`/`verify()`, `adapter`, `internalAdapter`, `generateId()`, `tables`, `baseURL`.
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## Plugins
|
|
120
|
+
|
|
121
|
+
**Import from dedicated paths for tree-shaking:**
|
|
122
|
+
```
|
|
123
|
+
import { twoFactor } from "better-auth/plugins/two-factor"
|
|
124
|
+
```
|
|
125
|
+
NOT `from "better-auth/plugins"`.
|
|
126
|
+
|
|
127
|
+
**Popular plugins:** `twoFactor`, `organization`, `passkey`, `magicLink`, `emailOtp`, `username`, `phoneNumber`, `admin`, `apiKey`, `bearer`, `jwt`, `multiSession`, `sso`, `oauthProvider`, `oidcProvider`, `openAPI`, `genericOAuth`.
|
|
128
|
+
|
|
129
|
+
Client plugins go in `createAuthClient({ plugins: [...] })`.
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
## Client
|
|
134
|
+
|
|
135
|
+
Import from: `better-auth/client` (vanilla), `better-auth/react`, `better-auth/vue`, `better-auth/svelte`, `better-auth/solid`.
|
|
136
|
+
|
|
137
|
+
Key methods: `signUp.email()`, `signIn.email()`, `signIn.social()`, `signOut()`, `useSession()`, `getSession()`, `revokeSession()`, `revokeSessions()`.
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
## Type Safety
|
|
142
|
+
|
|
143
|
+
Infer types: `typeof auth.$Infer.Session`, `typeof auth.$Infer.Session.user`.
|
|
144
|
+
|
|
145
|
+
For separate client/server projects: `createAuthClient<typeof auth>()`.
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
## Common Gotchas
|
|
150
|
+
|
|
151
|
+
1. **Model vs table name** - Config uses ORM model name, not DB table name
|
|
152
|
+
2. **Plugin schema** - Re-run CLI after adding plugins
|
|
153
|
+
3. **Secondary storage** - Sessions go there by default, not DB
|
|
154
|
+
4. **Cookie cache** - Custom session fields NOT cached, always re-fetched
|
|
155
|
+
5. **Stateless mode** - No DB = session in cookie only, logout on cache expiry
|
|
156
|
+
6. **Change email flow** - Sends to current email first, then new email
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
## Resources
|
|
161
|
+
|
|
162
|
+
- [Docs](https://better-auth.com/docs)
|
|
163
|
+
- [Options Reference](https://better-auth.com/docs/reference/options)
|
|
164
|
+
- [LLMs.txt](https://better-auth.com/llms.txt)
|
|
165
|
+
- [GitHub](https://github.com/better-auth/better-auth)
|
|
166
|
+
- [Init Options Source](https://github.com/better-auth/better-auth/blob/main/packages/core/src/types/init-options.ts)
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: brainstorming
|
|
3
|
+
description: "You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Brainstorming Ideas Into Designs
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Help turn ideas into fully formed designs and specs through natural collaborative dialogue.
|
|
11
|
+
|
|
12
|
+
Start by understanding the current project context, then ask questions one at a time to refine the idea. Once you understand what you're building, present the design and get user approval.
|
|
13
|
+
|
|
14
|
+
<HARD-GATE>
|
|
15
|
+
Do NOT invoke any implementation skill, write any code, scaffold any project, or take any implementation action until you have presented a design and the user has approved it. This applies to EVERY project regardless of perceived simplicity.
|
|
16
|
+
</HARD-GATE>
|
|
17
|
+
|
|
18
|
+
## Anti-Pattern: "This Is Too Simple To Need A Design"
|
|
19
|
+
|
|
20
|
+
Every project goes through this process. A todo list, a single-function utility, a config change — all of them. "Simple" projects are where unexamined assumptions cause the most wasted work. The design can be short (a few sentences for truly simple projects), but you MUST present it and get approval.
|
|
21
|
+
|
|
22
|
+
## Checklist
|
|
23
|
+
|
|
24
|
+
You MUST create a task for each of these items and complete them in order:
|
|
25
|
+
|
|
26
|
+
1. **Explore project context** — check files, docs, recent commits
|
|
27
|
+
2. **Ask clarifying questions** — one at a time, understand purpose/constraints/success criteria
|
|
28
|
+
3. **Propose 2-3 approaches** — with trade-offs and your recommendation
|
|
29
|
+
4. **Present design** — in sections scaled to their complexity, get user approval after each section
|
|
30
|
+
5. **Write design doc** — save to `docs/plans/YYYY-MM-DD-<topic>-design.md` and commit
|
|
31
|
+
6. **Transition to implementation** — invoke writing-plans skill to create implementation plan
|
|
32
|
+
|
|
33
|
+
## Process Flow
|
|
34
|
+
|
|
35
|
+
```dot
|
|
36
|
+
digraph brainstorming {
|
|
37
|
+
"Explore project context" [shape=box];
|
|
38
|
+
"Ask clarifying questions" [shape=box];
|
|
39
|
+
"Propose 2-3 approaches" [shape=box];
|
|
40
|
+
"Present design sections" [shape=box];
|
|
41
|
+
"User approves design?" [shape=diamond];
|
|
42
|
+
"Write design doc" [shape=box];
|
|
43
|
+
"Invoke writing-plans skill" [shape=doublecircle];
|
|
44
|
+
|
|
45
|
+
"Explore project context" -> "Ask clarifying questions";
|
|
46
|
+
"Ask clarifying questions" -> "Propose 2-3 approaches";
|
|
47
|
+
"Propose 2-3 approaches" -> "Present design sections";
|
|
48
|
+
"Present design sections" -> "User approves design?";
|
|
49
|
+
"User approves design?" -> "Present design sections" [label="no, revise"];
|
|
50
|
+
"User approves design?" -> "Write design doc" [label="yes"];
|
|
51
|
+
"Write design doc" -> "Invoke writing-plans skill";
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
**The terminal state is invoking writing-plans.** Do NOT invoke frontend-design, mcp-builder, or any other implementation skill. The ONLY skill you invoke after brainstorming is writing-plans.
|
|
56
|
+
|
|
57
|
+
## The Process
|
|
58
|
+
|
|
59
|
+
**Understanding the idea:**
|
|
60
|
+
- Check out the current project state first (files, docs, recent commits)
|
|
61
|
+
- Ask questions one at a time to refine the idea
|
|
62
|
+
- Prefer multiple choice questions when possible, but open-ended is fine too
|
|
63
|
+
- Only one question per message - if a topic needs more exploration, break it into multiple questions
|
|
64
|
+
- Focus on understanding: purpose, constraints, success criteria
|
|
65
|
+
|
|
66
|
+
**Exploring approaches:**
|
|
67
|
+
- Propose 2-3 different approaches with trade-offs
|
|
68
|
+
- Present options conversationally with your recommendation and reasoning
|
|
69
|
+
- Lead with your recommended option and explain why
|
|
70
|
+
|
|
71
|
+
**Presenting the design:**
|
|
72
|
+
- Once you believe you understand what you're building, present the design
|
|
73
|
+
- Scale each section to its complexity: a few sentences if straightforward, up to 200-300 words if nuanced
|
|
74
|
+
- Ask after each section whether it looks right so far
|
|
75
|
+
- Cover: architecture, components, data flow, error handling, testing
|
|
76
|
+
- Be ready to go back and clarify if something doesn't make sense
|
|
77
|
+
|
|
78
|
+
## After the Design
|
|
79
|
+
|
|
80
|
+
**Documentation:**
|
|
81
|
+
- Write the validated design to `docs/plans/YYYY-MM-DD-<topic>-design.md`
|
|
82
|
+
- Use elements-of-style:writing-clearly-and-concisely skill if available
|
|
83
|
+
- Commit the design document to git
|
|
84
|
+
|
|
85
|
+
**Implementation:**
|
|
86
|
+
- Invoke the writing-plans skill to create a detailed implementation plan
|
|
87
|
+
- Do NOT invoke any other skill. writing-plans is the next step.
|
|
88
|
+
|
|
89
|
+
## Key Principles
|
|
90
|
+
|
|
91
|
+
- **One question at a time** - Don't overwhelm with multiple questions
|
|
92
|
+
- **Multiple choice preferred** - Easier to answer than open-ended when possible
|
|
93
|
+
- **YAGNI ruthlessly** - Remove unnecessary features from all designs
|
|
94
|
+
- **Explore alternatives** - Always propose 2-3 approaches before settling
|
|
95
|
+
- **Incremental validation** - Present design, get approval before moving on
|
|
96
|
+
- **Be flexible** - Go back and clarify when something doesn't make sense
|