Skip to content

ariushieu/ruleset

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Claude Code — AI Working Rules

Bộ quy tắc làm việc dành cho Claude Code khi phát triển dự án Spring Boot.
Copy 3 file này vào root của project là AI sẽ tự động nạp và tuân theo toàn bộ quy tắc.


Cấu trúc

project-root/
├── CLAUDE.md        # Quy tắc chính — Claude Code tự đọc khi khởi động
├── RULE.md          # Quy tắc vận hành (được CLAUDE.md tham chiếu)
├── .claudeignore    # Danh sách file/thư mục AI không được đọc
└── README.md        # File này

Tác dụng từng file

CLAUDE.md

File trung tâm. Claude Code tự động đọc file này khi bắt đầu session.
Bao gồm:

  • Default Behavior — load RULE.md trước khi làm bất cứ thứ gì
  • Planning Files — quy định vị trí và quy trình tạo plan (/plan/YYYYMMDD-feature.md)
  • Project Structure — kiến trúc layered chuẩn Spring Boot
  • Coding Standards — các quy tắc bắt buộc:
    • Constructor injection via @RequiredArgsConstructor (cấm @Autowired)
    • Lombok cho boilerplate, MapStruct cho DTO ↔ Entity mapping
    • Pagination bắt buộc cho mọi GET collection (Page<T> + Pageable)
    • Soft Delete qua isDeleted thay vì xóa vật lý
    • RESTful API, DTO tách biệt, Bean Validation, exception handling tập trung
  • Development Workflow — Backend trước, API contract trước Frontend
  • File Reading Efficiency — đọc có chọn lọc, tham chiếu .claudeignore

RULE.md

Quy tắc vận hành chi tiết, được load ngay sau CLAUDE.md.
Điểm khác biệt so với Claude Code mặc định:

  • Không dùng bash để explore (ls, cat, find) — thay bằng tool list_dir, view_file, grep_search
  • Đọc song song nhiều file một lúc, không đọc tuần tự
  • Code ngay sau khi đủ context, không viết analysis trung gian
  • Không chạy build/start command — user tự quản lý mvn, gradle, npm run

.claudeignore

Danh sách path AI bỏ qua hoàn toàn.
Bao gồm: target/, .idea/, node_modules/, .env, *.class, *.jar, logs, temp files, v.v.


Cách dùng

# Copy vào root của project
cp CLAUDE.md RULE.md .claudeignore README.md /path/to/your-project/

# Mở Claude Code trong project
claude

Claude sẽ tự đọc CLAUDE.md → load RULE.md → áp dụng toàn bộ quy tắc ngay từ đầu session.


Yêu cầu tối thiểu của project

Các dependency cần có trong pom.xml để rules hoạt động đúng:

<!-- Lombok -->
<dependency>
    <groupId>org.projectlombok</groupId>
    <artifactId>lombok</artifactId>
    <optional>true</optional>
</dependency>

<!-- MapStruct -->
<dependency>
    <groupId>org.mapstruct</groupId>
    <artifactId>mapstruct</artifactId>
    <version>1.5.5.Final</version>
</dependency>

<!-- Spring Data (Pageable) -->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>

<!-- Validation -->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-validation</artifactId>
</dependency>

About

Bộ quy tắc làm việc dành cho Claude Code khi phát triển dự án Spring Boot.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors