.agents/skills/csharp-business-service/SKILL.md
Sử dụng kỹ năng này khi người dùng yêu cầu xử lý logic nghiệp vụ (Business Logic), tính toán dữ liệu, xử lý giỏ hàng/thanh toán, hoặc thiết kế kiến trúc Service Layer trong C# ASP.NET Core. Kỹ năng này đảm bảo code tuân thủ nguyên tắc Dependency Injection (DI), sử dụng Interfaces, và tách biệt hoàn toàn logic khỏi Controller.
npx skillsauth add Namhahaha1110/WebTrangSuc csharp-business-serviceInstall 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.
Khi được yêu cầu viết logic backend hoặc xử lý dữ liệu nghiệp vụ, bạn BẮT BUỘC phải tuân thủ các tiêu chuẩn kỹ thuật sau:
DbContext bên trong Controller.OrderService). Luôn phải tạo Interface đi kèm (Ví dụ: IOrderService) và inject nó qua constructor.IDbContextTransaction để đảm bảo tính toàn vẹn dữ liệu (Rollback nếu có lỗi).23DH114467 hoặc 467 cho các mã ID hoặc mã đơn hàng.catch (Exception ex). Hãy quăng ra (throw) các Exception cụ thể có ý nghĩa nghiệp vụ (Ví dụ: InvalidOperationException("Sản phẩm đã hết hàng"), UnauthorizedAccessException(...)).// 1. Interface
public interface ICartService
{
Task<CartViewModel> GetCartDetailsAsync(string userId);
Task<bool> AddToCartAsync(string userId, string productId, int quantity);
}
// 2. Implementation
public class CartService : ICartService
{
private readonly ApplicationDbContext _context;
public CartService(ApplicationDbContext context)
{
_context = context;
}
public async Task<bool> AddToCartAsync(string userId, string productId, int quantity)
{
if (quantity <= 0) throw new ArgumentException("Số lượng phải lớn hơn 0");
var product = await _context.Products.FindAsync(productId);
if (product == null || product.Stock < quantity)
{
throw new InvalidOperationException("Sản phẩm không tồn tại hoặc không đủ số lượng.");
}
// Logic thêm vào giỏ hàng...
await _context.SaveChangesAsync();
return true;
}
}
development
Optimize website and web application performance including loading speed, Core Web Vitals, bundle size, caching strategies, and runtime performance
tools
UI/UX design intelligence for web and mobile. Includes 50+ styles, 161 color palettes, 57 font pairings, 161 product types, 99 UX guidelines, and 25 chart types across 10 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind, shadcn/ui, and HTML/CSS). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, and check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, and mobile app. Elements: button, modal, navbar, sidebar, card, table, form, and chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, and flat design. Topics: color systems, accessibility, animation, layout, typography, font pairing, spacing, interaction states, shadow, and gradient. Integrations: shadcn/ui MCP for component search and examples.
development
Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, artifacts, posters, or applications (examples include websites, landing pages, dashboards, React components, HTML/CSS layouts, or when styling/beautifying any web UI). Generates creative, polished code and UI design that avoids generic AI aesthetics.
development
Sử dụng kỹ năng này khi có yêu cầu liên quan đến Cơ sở dữ liệu (Database), thiết kế Entity Models, hoặc viết các câu truy vấn LINQ bằng Entity Framework Core. Kỹ năng này đảm bảo việc thực thi các tác vụ CRUD được tối ưu hiệu suất, tránh lỗi N+1 query, và xử lý quan hệ dữ liệu chuẩn xác.