Update skill documentation to reflect the addition of a new Cursor Skill, increasing the total from 25 to 26 in both English and Vietnamese README files.
This commit is contained in:
@@ -8,7 +8,7 @@ Cursor Skills are specialized knowledge modules that guide AI assistants in foll
|
||||
|
||||
## Available Skills
|
||||
|
||||
The GoodGo platform includes **25 Cursor Skills** organized by category:
|
||||
The GoodGo platform includes **26 Cursor Skills** organized by category:
|
||||
|
||||
### API & Data Layer
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ Cursor Skills là các module kiến thức chuyên biệt hướng dẫn AI ass
|
||||
|
||||
## Các Skills Có Sẵn
|
||||
|
||||
GoodGo platform bao gồm **25 Cursor Skills** được tổ chức theo danh mục:
|
||||
GoodGo platform bao gồm **26 Cursor Skills** được tổ chức theo danh mục:
|
||||
|
||||
### API & Data Layer
|
||||
|
||||
|
||||
162
docs/vi/skills/microservices-development-process.md
Normal file
162
docs/vi/skills/microservices-development-process.md
Normal file
@@ -0,0 +1,162 @@
|
||||
# Quy Trình Phát Triển Microservices (Microservices Development Process)
|
||||
|
||||
Standard development process for creating and maintaining microservices in GoodGo platform. Use when creating new services, migrating services, refactoring services, or planning service implementations.
|
||||
> Quy trình phát triển chuẩn để tạo và duy trì microservices trong nền tảng GoodGo. Sử dụng khi tạo services mới, migrate services, refactor services, hoặc lập kế hoạch implement services.
|
||||
|
||||
## Tổng Quan
|
||||
|
||||
The microservices development process provides a structured 8-phase approach to building services, ensuring comprehensive coverage from planning to deployment.
|
||||
|
||||
Quy trình phát triển microservices cung cấp cách tiếp cận có cấu trúc 8 giai đoạn để xây dựng services, đảm bảo bao phủ toàn diện từ lập kế hoạch đến triển khai.
|
||||
|
||||
## Khi Nào Sử Dụng
|
||||
|
||||
Use this skill when:
|
||||
- Creating a new microservice from scratch
|
||||
- Migrating or refactoring an existing service
|
||||
- Planning service implementation with multiple phases
|
||||
- Ensuring comprehensive coverage of all development aspects
|
||||
|
||||
Sử dụng skill này khi:
|
||||
- Tạo microservice mới từ đầu
|
||||
- Migrate hoặc refactor service hiện có
|
||||
- Lập kế hoạch implement service với nhiều giai đoạn
|
||||
- Đảm bảo bao phủ toàn diện tất cả các khía cạnh phát triển
|
||||
|
||||
## Quy Trình 8 Giai Đoạn
|
||||
|
||||
The microservices development process follows these phases:
|
||||
Quy trình phát triển microservices theo các giai đoạn sau:
|
||||
|
||||
1. **Planning & Impact Analysis** - Define scope, impact, dependencies / Định nghĩa scope, impact, dependencies
|
||||
2. **Foundation Setup** - Service structure, configs, infrastructure / Cấu trúc service, configs, infrastructure
|
||||
3. **Core Implementation** - Business logic, APIs, data layer / Business logic, APIs, data layer
|
||||
4. **Integration** - Routes, middleware, external services / Routes, middleware, external services
|
||||
5. **Testing** - Unit, integration, E2E tests / Unit, integration, E2E tests
|
||||
6. **Documentation** - API docs, README, guides / API docs, README, guides
|
||||
7. **Cleanup & Verification** - Remove temporary files, verify completeness / Xóa file tạm, xác minh hoàn chỉnh
|
||||
8. **Deployment** - Staging deployment, production deployment / Staging deployment, production deployment
|
||||
|
||||
## Các Giai Đoạn Chính
|
||||
|
||||
### Phase 1: Planning & Impact Analysis / Giai Đoạn 1: Lập Kế Hoạch & Phân Tích Tác Động
|
||||
|
||||
**Scope Definition / Định Nghĩa Scope:**
|
||||
- Service Purpose: What business capability does it provide? / Mục đích service: Cung cấp khả năng kinh doanh gì?
|
||||
- API Surface: What endpoints are needed? / API Surface: Cần endpoints nào?
|
||||
- Data Models: What data structures are required? / Data Models: Cần cấu trúc dữ liệu nào?
|
||||
- Dependencies: What services/packages does it depend on? / Dependencies: Phụ thuộc vào services/packages nào?
|
||||
|
||||
**Impact Analysis Checklist / Checklist Phân Tích Tác Động:**
|
||||
- [ ] Service directory: `services/service-name/`
|
||||
- [ ] Prisma schema: `services/service-name/prisma/schema.prisma`
|
||||
- [ ] Dockerfile: `services/service-name/Dockerfile`
|
||||
- [ ] Update `deployments/local/docker-compose.yml`
|
||||
- [ ] Update `infra/traefik/dynamic/routes.yml`
|
||||
|
||||
### Phase 2: Foundation Setup / Giai Đoạn 2: Thiết Lập Nền Tảng
|
||||
|
||||
**Service Structure / Cấu Trúc Service:**
|
||||
```bash
|
||||
# EN: Copy template
|
||||
# VI: Copy template
|
||||
cp -r services/_template services/new-service-name
|
||||
cd services/new-service-name
|
||||
```
|
||||
|
||||
**Acceptance Criteria / Tiêu Chí Chấp Nhận:**
|
||||
- [ ] Service starts: `pnpm dev` (health check passes) / Service khởi động: `pnpm dev` (health check pass)
|
||||
- [ ] Docker build succeeds / Docker build thành công
|
||||
- [ ] Service accessible via Traefik / Service có thể truy cập qua Traefik
|
||||
|
||||
### Phase 3: Core Implementation / Giai Đoạn 3: Implementation Cốt Lõi
|
||||
|
||||
**Implementation Order / Thứ Tự Implementation:**
|
||||
1. **DTOs** - Zod schemas for validation / Zod schemas cho validation
|
||||
2. **Repository** - Prisma-based data access / Data access dựa trên Prisma
|
||||
3. **Service** - Business logic / Business logic
|
||||
4. **Controller** - HTTP request handling / Xử lý HTTP requests
|
||||
5. **Module** - Wire up components / Kết nối các components
|
||||
|
||||
### Phase 4: Integration / Giai Đoạn 4: Tích Hợp
|
||||
|
||||
**Required Middlewares / Middlewares Bắt Buộc:**
|
||||
1. Correlation middleware
|
||||
2. Logging middleware
|
||||
3. Metrics middleware
|
||||
4. CORS middleware
|
||||
5. Rate limiting middleware
|
||||
6. Authentication middleware (if needed) / (nếu cần)
|
||||
7. Error middleware (always last) / (luôn cuối cùng)
|
||||
|
||||
### Phase 5: Testing / Giai Đoạn 5: Kiểm Thử
|
||||
|
||||
**Test Coverage Targets / Mục Tiêu Test Coverage:**
|
||||
- Minimum: 70% coverage / Tối thiểu: 70% coverage
|
||||
- Critical paths: 90%+ coverage / Đường dẫn quan trọng: 90%+ coverage
|
||||
- Repositories: 80%+ coverage
|
||||
- Services: 80%+ coverage
|
||||
|
||||
**Testing Checklist / Checklist Testing:**
|
||||
- [ ] Unit tests pass / Unit tests pass
|
||||
- [ ] Integration tests pass / Integration tests pass
|
||||
- [ ] E2E tests pass / E2E tests pass
|
||||
- [ ] Coverage meets thresholds / Coverage đạt ngưỡng
|
||||
|
||||
### Phase 6: Documentation / Giai Đoạn 6: Tài Liệu
|
||||
|
||||
**Required Documentation / Tài Liệu Bắt Buộc:**
|
||||
- Service README (bilingual EN/VI) / README service (song ngữ EN/VI)
|
||||
- Swagger/OpenAPI spec / Swagger/OpenAPI spec
|
||||
- Architecture docs (if complex) / Tài liệu kiến trúc (nếu phức tạp)
|
||||
|
||||
### Phase 7: Cleanup & Verification / Giai Đoạn 7: Dọn Dẹp & Xác Minh
|
||||
|
||||
**Verification Steps / Các Bước Xác Minh:**
|
||||
- [ ] TypeScript check: `pnpm typecheck` / Kiểm tra TypeScript
|
||||
- [ ] Lint check: `pnpm lint` / Kiểm tra lint
|
||||
- [ ] Test check: `pnpm test` / Kiểm tra test
|
||||
- [ ] Build check: `pnpm build` / Kiểm tra build
|
||||
- [ ] Docker build succeeds / Docker build thành công
|
||||
|
||||
### Phase 8: Deployment / Giai Đoạn 8: Triển Khai
|
||||
|
||||
**Staging Deployment / Triển Khai Staging:**
|
||||
```bash
|
||||
# EN: Build and push Docker image
|
||||
# VI: Build và push Docker image
|
||||
docker build -t goodgo/service-name:latest .
|
||||
docker push goodgo/service-name:latest
|
||||
|
||||
# EN: Apply Kubernetes configs
|
||||
# VI: Áp dụng configs Kubernetes
|
||||
kubectl apply -f deployments/staging/kubernetes/service-name.yaml
|
||||
```
|
||||
|
||||
## Best Practices / Thực Hành Tốt
|
||||
|
||||
1. **Always Plan First**: Complete impact analysis before coding / Luôn lập kế hoạch trước: Hoàn thành phân tích tác động trước khi code
|
||||
2. **Follow Phases**: Don't skip verification steps / Tuân theo các giai đoạn: Không bỏ qua các bước xác minh
|
||||
3. **Test Early**: Write tests alongside implementation / Test sớm: Viết tests cùng với implementation
|
||||
4. **Document as You Go**: Don't leave documentation for the end / Tài liệu khi làm: Không để tài liệu đến cuối
|
||||
5. **Verify Comprehensively**: Use checklists to ensure nothing is missed / Xác minh toàn diện: Sử dụng checklists để đảm bảo không bỏ sót
|
||||
|
||||
## Common Pitfalls to Avoid / Các Lỗi Thường Gặp Cần Tránh
|
||||
|
||||
1. **Skipping Impact Analysis**: Leads to missing updates / Bỏ qua phân tích tác động: Dẫn đến thiếu cập nhật
|
||||
2. **No Verification Steps**: Misses broken references / Không có bước xác minh: Bỏ sót references bị hỏng
|
||||
3. **Incomplete Testing**: Missing edge cases / Testing không đầy đủ: Thiếu edge cases
|
||||
4. **Poor Documentation**: Makes maintenance difficult / Tài liệu kém: Làm khó bảo trì
|
||||
|
||||
## Skills Liên Quan
|
||||
|
||||
- [Project Rules](./project-rules.md) - Architecture and conventions / Kiến trúc và conventions
|
||||
- [API Design](./api-design.md) - API design patterns / Các patterns thiết kế API
|
||||
- [Testing Patterns](./testing-patterns.md) - Testing best practices / Best practices về testing
|
||||
- [Documentation](./documentation.md) - Documentation guidelines / Hướng dẫn tài liệu
|
||||
- [Database Prisma](./database-prisma.md) - Prisma patterns / Các patterns Prisma
|
||||
|
||||
## Tài Nguyên
|
||||
|
||||
- Service Template: `services/_template/` - Template service
|
||||
- Skill Source: `.cursor/skills/microservices-development-process/SKILL.md` - Source file đầy đủ
|
||||
Reference in New Issue
Block a user