Files
solution-erp/CLAUDE.md
pqhuy1987 661f8595f8
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 2m47s
[CLAUDE] Skill: thêm 3 skill ops project-specific
Khảo sát alirezarezvani/claude-skills repo — phần lớn skill đã có ở
user-level (code-reviewer, sql-database-assistant, focused-fix,
senior-frontend, mcp-builder...). Bulk import sẽ trùng + nhiều skill
là doc-dump generic không có YAML when-to-use.

Thay vào đó: viết 3 skill PROJECT-SPECIFIC encode kiến thức
SOLUTION_ERP-only mà generic không thể biết:

- dependency-audit-erp: dotnet list --vulnerable + npm audit cho
  fe-admin/fe-user, respect pin constraint MediatR 12.4.1 +
  Swashbuckle 6.9.0 + Node 20.x, dẫn chiếu gotchas, output template
  + CI integration TODO Phase 5.1

- ef-core-migration: 8 migration history + 3-file rule + Design
  TimeDbContextFactory + 6 pitfalls cụ thể (bao gồm cascade vs
  restrict cho WorkflowDefinitionId), workflow add entity mới end-
  to-end, prod apply via idempotent script

- iis-deploy-runbook: 3 IIS site topology + win-acme cert + NSSM
  gitea-runner shared VIETREPORT + LibreOffice 25.8.6 headless,
  debug playbook 500/502/SignalR/login, deploy steps + manual
  emergency, rotate creds + backup commands, dẫn chiếu gotcha #25/26/28/29

Skills README cập nhật: 6 skill (3 domain + 3 ops). CLAUDE.md
+ docs/CLAUDE.md sync count.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-22 23:44:24 +07:00

4.8 KiB

CLAUDE.md — AI Agent Context

Full content: docs/CLAUDE.md


SOLUTION_ERP — Hệ thống Quản lý Hợp đồng Nhà cung cấp / Thầu phụ / Tổ đội cho Công ty TNHH Xây dựng Solutions.

Kiến trúc: .NET 10 Clean Architecture + 2 React FE (admin + user) + SQL Server + IIS.

🚀 BẮT ĐẦU SESSION — 4 file đọc trước tiên

1. docs/STATUS.md                        ← Snapshot HIỆN TẠI (phase nào, việc gì đang làm)
2. docs/PROJECT-MAP.md                   ← Bản đồ toàn cảnh (nên đọc đầu dự án)
3. docs/changelog/migration-todos.md     ← Atomic tasks theo từng phase
4. docs/workflow-contract.md             ← ⭐ State machine 9 phase — ảnh hưởng mọi thiết kế

Quick Rules

Backend — .NET 10 Clean Architecture

  • Solution: SolutionErp.slnx ở root, projects ở src/Backend/
  • 4 layer: Api → Application ← Domain + Infrastructure → Application
  • Pattern: CQRS + MediatR, FluentValidation, AutoMapper
  • Repository qua IApplicationDbContext interface (Application layer)
  • Auth: JWT Bearer + ASP.NET Identity
  • DB: SQL Server (LocalDB dev / SQL Server prod), EF Core 10 Code-First migrations
  • Error handling: GlobalExceptionMiddleware map exception → HTTP status
  • Commit scope tech stack: Api · App · Domain · Infra

Frontend — 2 app React 18 + Vite + TS + shadcn/ui + TanStack Query

  • fe-admin/ (port 8082) · fe-user/ (port 8080)
  • Vite proxy /api → http://localhost:5443 (SolutionErp.Api)
  • Named export, không default export (trừ App)
  • shadcn/ui copy-paste, duplicate giữa 2 app là CÓ CHỦ ĐÍCH (mỗi app UX riêng)
  • Auth context: solution-erp-admin-token / solution-erp-user-tokenlocalStorage
  • TanStack Query cho data fetching
  • Node pin >=20 trong engines; CI pin 20.x qua .nvmrc (bài học NamGroup — KHÔNG dùng Node latest trên CI)
  • UI 100% tiếng Việt

Database conventions

  • Schema: dbo (single schema)
  • Table: PascalCase tiếng Anh (Contracts, Suppliers, Projects, ContractApprovals, ...)
  • PK: Id (Guid), FK: {Entity}Id
  • Audit fields: CreatedAt, UpdatedAt, CreatedBy, UpdatedBy (BaseEntity)
  • Soft delete: IsDeleted, DeletedAt, DeletedBy (AuditableEntity)
  • Migrations: dotnet ef migrations add <Name> --project src/Backend/SolutionErp.Infrastructure --startup-project src/Backend/SolutionErp.Api

Commit convention

[CLAUDE] <scope>: <imperative message>

Scope: Contract · Form · Workflow · Supplier · Auth · Admin · Api · App · Domain · Infra · FE-Admin · FE-User · Docs · CICD · Scripts

📖 Tài liệu quan trọng

File Nội dung
docs/STATUS.md 🔥 Current state — đọc đầu tiên
docs/HANDOFF.md Brief 5 phút: session trước làm gì + next tasks
docs/rules.md Coding conventions (BE Clean Arch, FE React, DB, Git, Docs)
docs/architecture.md Layered architecture + request lifecycle + deployment
docs/PROJECT-MAP.md Bản đồ tổng quan
docs/changelog/migration-todos.md Roadmap 5 phase + atomic tasks
docs/CLAUDE.md Full context — tech stack chi tiết
docs/workflow-contract.md State machine 9 phase + role matrix
docs/forms-spec.md Catalog 8 form + quy định mã HĐ RG-001
docs/database/database-guide.md DB conventions + migration workflow + cheatsheet
docs/database/schema-diagram.md ERD + luồng DB + data flow 19 table
docs/flows/README.md Index 6 flow (auth, permission, contract, form, SLA)
docs/gotchas.md 26 bẫy đã gặp — đọc trước khi debug tương tự
.claude/skills/ 6 skill: contract-workflow, form-engine, permission-matrix, dependency-audit-erp, ef-core-migration, iis-deploy-runbook
docs/guides/vps-setup.md Master runbook deploy VPS shared với VIETREPORT

⚠️ Kết thúc session

  1. Update docs/STATUS.md (In ProgressRecently Done)
  2. Tick checklist tương ứng trong docs/changelog/migration-todos.md
  3. Tạo session log docs/changelog/sessions/YYYY-MM-DD-HHMM-{topic}.md nếu đáng ghi
  4. Commit [CLAUDE] <scope>: <message>
  5. ⚠️ Update SolutionErp.slnx nếu có .cs/.csproj mới

Bỏ qua nếu chỉ trả lời câu hỏi, không sửa file nào.