Skip to main content

AI-Assisted Development

NestForge Pro is designed from the ground up to work well with AI coding agents such as Claude Code, Cursor, GitHub Copilot, and similar tools.

CLAUDE.md

The CLAUDE.md file at the project root provides AI agents with complete context about the codebase: the tech stack, repository structure, module priority, Prisma schema, coding standards, and environment variable reference.

When starting a session with an AI coding agent, point it at this file. Most tools pick it up automatically when it exists in the project root.

Why NestForge works well with AI

Predictable architecture

Every domain module follows the same pattern:

modules/
└── <domain>/
├── <domain>.module.ts # NestJS module definition
├── <domain>.controller.ts # HTTP layer (routes, validation, Swagger)
├── <domain>.service.ts # Business logic
├── <domain>.service.spec.ts # Unit tests
└── dto/ # Request/response DTOs with class-validator decorators

AI agents perform best when patterns are consistent. Once the agent understands one module, it can work with any module in the project.

Explicit interfaces and named exports

API contracts are defined as TypeScript interfaces and constants in packages/shared/src/. DTOs use class-validator decorators for runtime validation; Zod is used only for environment config. There are no implicit types or magic string conventions for the agent to guess at.

Co-located types

Types live next to the code that uses them. Request/response DTOs sit in a dto/ folder inside each module. Shared types and plan constants live in packages/shared/src/. The agent does not need to search across unrelated directories to find type definitions.

Swagger documentation

Every API endpoint has Swagger decorators. The generated documentation at /api/docs serves as a machine-readable API reference that agents can use to understand request/response shapes without reading implementation code.

Tips for using AI with NestForge

  1. Point your agent at CLAUDE.md -- This gives it the full project context in one read. Claude Code and Cursor load it automatically.

  2. Use the Swagger docs -- The interactive API documentation at http://localhost:4000/api/docs is useful both for humans and as a reference for AI agents when working on frontend integration.

  3. Follow the module pattern -- When asking an AI agent to create a new feature, reference an existing module (e.g., "follow the same pattern as modules/teams"). The consistent structure makes generation more reliable.

  4. Leverage the shared package -- When defining new API contracts, add types to packages/shared/src/ so both the API and frontend stay in sync. AI agents handle this well when they can see the existing type definitions.

  5. Run tests after changes -- Ask the agent to run npx turbo test after making changes. The test suite catches regressions quickly and gives the agent feedback to self-correct.