# AGENTS.md This file provides guidance for AI agents working on the XL Prison Management System codebase. ## Project Overview XL监狱综合管理平台 - A prison management platform built on the Yudao (芋道) framework. **Tech Stack**: Java 17, Spring Boot 3.5.9, MyBatis-Plus, Vue 3.5.12, TypeScript 5.3.3, Element Plus, MySQL 8.0+ ## Essential Commands ### Backend (Maven) ```bash # Build all modules cd backend && mvn clean install -DskipTests # Build prison module only cd backend/yudao-module-prison && mvn clean package # Run dev server (port 48080) cd backend/yudao-server && mvn spring-boot:run # Run all tests cd backend/yudao-module-prison && mvn test # Run single test class mvn test -Dtest=PrisonAreaControllerTest # Force update dependencies mvn clean install -U ``` ### Frontend (pnpm) ```bash cd frontend # Install dependencies pnpm install # Dev server (local mode) pnpm dev # TypeScript checking pnpm ts:check # Build for different environments pnpm build:local # Uses .env.local pnpm build:dev # Uses .env.dev pnpm build:prod # Uses .env.prod # Linting pnpm lint:eslint # ESLint check & fix (.js,.ts,.vue) pnpm lint:format # Prettier format pnpm lint:style # Stylelint fix ``` ### Quick Start with Make ```bash make frontend # Start frontend dev server make backend # Start backend dev server make run # Start both ``` ## Code Style Guidelines ### Java (Backend) **Imports**: Grouped by: Spring → Yudao → Third-party → Java stdlib. No wildcard imports. **Naming Conventions**: - Classes: PascalCase (e.g., `PrisonAreaController`, `ScoreDO`) - Variables/Methods: camelCase (e.g., `getPage()`, `updateTime`) - Constants: UPPER_SNAKE_CASE (e.g., `DEFAULT_PAGE_SIZE`) - Package: `cn.iocoder.yudao.module.prison.{module}` **VO Naming**: `SaveReqVO`, `PageReqVO`, `RespVO` suffixes required. **Annotations**: Place on separate lines. Order: `@RestController` → `@RequestMapping` → `@Tag` → `@PreAuthorize`. **Error Handling**: Use `CommonResult` return type. Throw `ServiceException` for business errors with error codes from `ErrorCodeConstants`. **Comments**: No comments unless explaining complex business logic. Javadoc only on public APIs. ### TypeScript/Vue (Frontend) **Imports**: Sorted alphabetically. No unused imports. Use absolute imports (`@/`). **Naming**: - Interfaces: PascalCase (e.g., `Area`, `QuestionnaireRecord`) - Variables/Props: camelCase - Components: PascalCase file names, kebab-case usage **Types**: Avoid `any`. Use explicit types or `unknown` for union types. **Vue Composition API**: Use `