skills/Builder-AI-Context/SKILL.md
# SKILL: uml-model-builder ## Purpose Chuyển đổi chuỗi RawXMLData thành cấu trúc domain.UMLGraph thống nhất (bao gồm trích xuất Nodes, Edges, Attributes, Methods). ## Required Inputs - domain.RawXMLData (chuỗi XML thô từ DrawioParser) ## Expected Output - *domain.UMLGraph (Mô hình OOP hoàn chỉnh) ## Architecture (Interface-Based — DIP) `StandardModelBuilder` là orchestrator thuần tuý, **chỉ phụ thuộc vào 4 internal interfaces**: | Interface | File impl | Trách nhiệm | |---|---|---| | `IXMLPa
npx skillsauth add nguyen-agn/uml_comparator skills/Builder-AI-ContextInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Chuyển đổi chuỗi RawXMLData thành cấu trúc domain.UMLGraph thống nhất (bao gồm trích xuất Nodes, Edges, Attributes, Methods).
StandardModelBuilder là orchestrator thuần tuý, chỉ phụ thuộc vào 4 internal interfaces:
| Interface | File impl | Trách nhiệm |
|---|---|---|
| IXMLParser | xml_parser.go | Parse XML → []mxCell, structural queries |
| ITextSanitizer | html_sanitizer.go | Decode HTML entities, strip tags/stereotypes |
| ITypeDetector | type_detector.go | Phân loại Class/Interface/Abstract/Actor/Enum + RelationType |
| IMemberParser | member_parser.go | Tách Attributes vs Methods từ child cells |
Xem builder/interfaces.go để biết contract đầy đủ.
Xem builder/builder.mmd để thấy sơ đồ class diagram.
cellParser.parse() → []mxCell từ XML stringtypeDetector.nodeType() + memberParser.parseChildren()typeDetector.relationType() + resolve endpoint IDsMỗi concrete struct có var _ Interface = (*struct)(nil) để Go compiler bắt lỗi ngay nếu interface không được implement đầy đủ.
development
# SKILL: drawio-visualizer ## Purpose Render kết quả chấm UML ra 2 loại file HTML self-contained: 1. **Grader Report** (`report_*.html`): Full side-by-side Student vs Solution, summary, deduction feedbacks — dành cho người chấm. 2. **Student Feedback** (`feedback_*.html`): Chỉ hiển thị bài làm SV với color-coded status (đúng/sai/thừa). Không lộ đáp án, không hiện deduction details — gửi cho sinh viên xem lại. ## Execution 1. Pipeline: Parse → Build → Validate → PreMatch → Match → Compare → Grad
development
Chạy test case trên các file UML draw.io để kiểm tra xem Builder + ValidateGraph có phát hiện đúng lỗi. Dùng để verify rằng pipeline xử lý UML bắt được các loại lỗi sai trong file .drawio.
development
# SKILL: batch-grader-reporter ## Purpose Cung cấp chức năng chấm điểm đồng loạt (Batch Grading) cho nhiều file bài làm UML (`.drawio`) của sinh viên đối chiếu với 1 file đáp án mẫu. Kết quả của tất cả các bài nộp được tổng hợp lại thành `BatchGradeResult` và chuyển đền interface `IReporter` để sinh report. ## Execution 1. Cấu trúc: - Load file solution `solution.drawio`. - Quét thư mục `student_dir` tìm các file `.drawio`. - Với mỗi file: Parse → Build → PreMatch → Match → Compare →
development
Skill để tái cấu trúc (refactor) một module bất kỳ theo chuẩn SOLID, áp dụng Interface-first và bổ sung Unit Test hoàn chỉnh.