

※ Tips for getting started:
1. Press Esc twice to reset the input box.
2. Shift + Enter to add a new line while typing.
3. Press / to use commands, @ to mention files.
> /init
● I'll analyze this codebase and create a CODEBUDDY.md file with the essential
information for future CodeBuddy Code instances. Let me start by exploring the
repository structure and key files.
● Todo
⎿ ◻ Explore repository structure and identify key files
◻ Check for existing documentation files (README, CLAUDE.md, etc.)
◻ Analyze package.json/build files for available commands
◻ Understand code architecture and structure
◻ Create CODEBUDDY.md with essential information初始化后,会根据我的项目自动生成 CODEBUDDY.md 文件,质量也还不错。
# CODEBUDDY.md
## 项目架构概览
这是一个基于**领域驱动设计(DDD)**的Java微服务项目,采用**Maven多模块**结构。项目使用中文进行开发和文档编写,严格遵循TDD(测试驱动开发)流程。
### 核心技术栈
- **Java 17** + **Spring Boot 3.3.9**
- **Apache Dubbo 3.2.9** (微服务RPC通信)
- **MyBatis-Plus 3.5.5** + **MySQL 8.0.33** (数据持久化)
- **Azure Service Bus** (消息队列)
- **Redisson 3.17.0** (分布式缓存)
- **Zookeeper** (服务注册中心)
- **Maven 3.9.9** (构建工具)
## Maven构建命令
### 基础构建命令
```bash
# 完整构建所有模块
mvn clean install -DskipTests
# 构建并运行测试
mvn clean test
# 仅构建API模块(共享库)
mvn clean install -P api-only -DskipTests
# 打包特定服务
mvn clean package -pl {服务名}-bootstrap -am# 编译项目
mvn compile
# 运行单个测试类
mvn test -Dtest=ClassName
# 运行特定测试方法
mvn test -Dtest=ClassName#methodName
# 跳过测试构建
mvn clean install -DskipTests
# 查看依赖树
mvn dependency:tree每个业务领域按照以下6层架构组织:
{领域名}/
├── {领域名}-api/ # 接口模块(共享库) - Dubbo服务接口和DTO
├── {领域名}-context/ # 上下文模块(共享库) - 领域事件、枚举、常量、异常
├── {领域名}-domain/ # 领域模块 - 实体、聚合根、领域服务、仓储接口
├── {领域名}-application/ # 应用服务模块 - 用例编排、事件处理、DTO转换
├── {领域名}-infrastructure/ # 基础设施模块 - 仓储实现、外部集成、缓存、消息队列
└── {领域名}-bootstrap/ # 启动模块 - Spring Boot应用入口{领域}-api ← {领域}-application → {领域}-domain ← {领域}-infrastructure
↑ ↑
└─────{领域}-context────┘