Coding
PromptBeginner5 minmarkdown
Markdown Converter
Agent skill for markdown-converter
21
Instructions for AI coding agents working in this pnpm monorepo.
Sign in to like and favorite skills
Instructions for AI coding agents working in this pnpm monorepo.
apps/backend - NestJS 11 API (TypeORM, PostgreSQL, Auth0, Stripe)apps/frontend - Next.js 14 (React 19, Tailwind CSS 4, React Query)apps/backend-e2e - E2E tests for backend APIlibs/project-setup - Project initialization utilitiespnpm run build # Build all packages (excludes backend-e2e, frontend) pnpm run test # Run tests across all packages pnpm run lint # Lint all packages pnpm run mill:dev # Start local dev (docker + backend + frontend) pnpm run knip # Check for unused code/dependencies
apps/backend)pnpm run build # Build the backend pnpm run start # Start in watch mode (development) pnpm run lint # Lint with auto-fix pnpm run test # Run all tests (Vitest) pnpm run up # Start Docker services (PostgreSQL, Redis) pnpm run down # Stop Docker services pnpm run db:run # Run database migrations pnpm run db:gen # Generate new migration
# Backend - run specific test file (Vitest) cd apps/backend && pnpm run test src/course-files/services/file-scrambler.service.test.ts # Backend - run tests matching pattern cd apps/backend && pnpm run test --testNamePattern="partition" # Backend E2E tests cd apps/backend-e2e && pnpm run test:e # Project setup tests (Vitest) cd libs/project-setup && pnpm run test
apps/frontend)pnpm run build # Build for production pnpm run start # Start development server pnpm run lint # Run Next.js linting
All strict checks enabled:
strict, noImplicitAny, strictNullChecks, strictPropertyInitialization, noUnusedLocals, noImplicitReturns
This project uses ESM (
"type": "module"). Use .js extensions for local imports:
import { MyService } from "./my-service.js"; // Correct import { MyService } from "./my-service"; // Incorrect
| Type | Pattern | Example |
|---|---|---|
| Entities | | |
| DTOs | | |
| Services | | |
| Controllers | | |
| Modules | | |
| Unit tests | | |
| E2E tests | | |
| React components | | |
| React hooks | | |
PascalCasecamelCasecamelCase or UPPER_CASEUPPER_CASEis, should, has, can, did, or willcamelCase (no leading underscore)@darraghor/nest-backend-libs).js extension for backend)// Example backend import order import { Injectable, Logger } from "@nestjs/common"; import { Repository } from "typeorm"; import { InjectRepository } from "@nestjs/typeorm"; import { RequestUser } from "@darraghor/nest-backend-libs"; import { MyEntity } from "../models/my-entity.entity.js"; import { HelperService } from "./helper-service.js";
Use NestJS built-in exceptions:
import { ForbiddenException, NotFoundException } from "@nestjs/common"; if (!hasPermission) { throw new ForbiddenException( "You do not have permission to perform this action", ); } if (!entity) { throw new NotFoundException("Resource not found"); }
Use a Logger instance per service:
private readonly logger = new Logger(MyService.name);
@Entity() export class MyEntity { @PrimaryGeneratedColumn() @ApiProperty() id!: number; @Column() @ApiProperty() name!: string; } export class CreateMyDto { @IsString() @ApiProperty() name!: string; @IsOptional() @IsUrl() @ApiPropertyOptional() url?: string; }
describe("MyService", () => { const service = new MyService(); describe("myMethod", () => { it("should return expected result", () => { expect(service.myMethod("input")).toBe("expected"); }); test.each([ { input: "a", expected: "A" }, { input: "b", expected: "B" }, ])("should handle $input", ({ input, expected }) => { expect(service.myMethod(input)).toBe(expected); }); }); });
Uses Conventional Commits:
feat:, fix:, refactor:, docs:, test:, chore: