skills/create-nextjs-ddd-auth-db/SKILL.md
Create a new fullstack Next.js. Use this skill when the user asks to create a new Next.js project or application.
npx skillsauth add micheleangioni/agent-skills create-nextjs-ddd-auth-dbInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Create a brand new Next.js app that satisfies all requested architecture and feature requirements. It includes App Router API endpoints, frontend pages, DDD structure, database integration, Google authentication with better-auth, tests, and linter. Keep the skill itself code-free: generate application code only inside the user-selected target folder.
Follow this sequence exactly.
Ask the user:
mongoosedynamooseprismaConfirm the final choices before continuing.
Create a concrete implementation plan and present it to the user before changing files. Wait for explicit approval.
The plan must include:
instrumentation.ts file setup to:
Before any installation, verify latest stable versions and usage from official sources:
Use the latest stable versions available at execution time. Do not assume versions from memory.
Create the app in the chosen folder with the chosen name and latest Next.js setup. Use current recommended options from Next.js docs, including App Router and src/ structure.
Install and configure:
better-auth (Google Auth)Create the following structure:
<app_name>/src/__tests__<app_name>/src/app<app_name>/src/app/api<app_name>/src/application<app_name>/src/domain<app_name>/src/infrastructure<app_name>/src/shared<app_name>/src/shared/logger<app_name>/docsImplement all of the following:
src/infrastructure, aligned with the selected database and librarysrc/shared/logger that can be used across the appBaseEntity with the following methods:
addDomainEvent(domainEvent: DomainEventInterface)releaseDomainEvents(): DomainEventInterface[]where DomainEventInterface is:
interface DomainEventInterface {
getEventAggregate(): string;
getEventName(): string;
getEventData(): Record<string, unknown>;
}
User entity in domain layer extending BaseEntityUser-related event) so the event catalog is not emptyUser repository abstraction + implementationGET /users endpoint in App Router under src/app/api, with limit and offset query parameters, returning paginated userssrc/__tests__Create:
.env.example with every required variable (app URL, auth values, Google OAuth credentials, DB settings, and anything else needed)docs/endpoints.yaml listing available endpoints with method, path, purpose, and auth requirements in OpenAPI formatdocs/asyncapi.yaml as the event catalog source of truth, using a valid AsyncAPI document that describes emitted domain events onlyasyncapi and info with basic title and versioncomponents when payload structures are sharedUpdate the app's README.md with setup, environment, run, test, lint, endpoint usage instructions, and where docs/asyncapi.yaml lives and how it should be used as the event catalog.
Run lint and tests. Fix failures and re-run until passing.
Verify:
/users endpoint worksdocs/asyncapi.yaml exists and documents the emitted events implemented in codeIf any requirement is unmet, iterate until complete.
development
Use this skill when the user asks for a review, audit, evaluation or analysis of a codebase, to identify bugs, security vulnerabilities, outdated dependencies or runtimes, performance bottlenecks, or code quality concerns.
data-ai
Evaluate AGENTS.md or CLAUDE.md for repo agentic readiness. Use when the user asks for an assessment of the agentic readiness of a repository, or when they ask for an evaluation of AGENTS.md or CLAUDE.md files.
databases
Run the macOS Parallels smoke harness with Discord end-to-end roundtrip verification, including guest send, host verification, host reply, and guest readback.
databases
Run the macOS Parallels smoke harness with Discord end-to-end roundtrip verification, including guest send, host verification, host reply, and guest readback.