event-store-design – skill Thiết kế & UI cho agent AI
Thiết kế và triển khai event store cho hệ thống event-sourced. Dùng khi xây dựng hạ tầng event sourcing, chọn công nghệ event store, hoặc triển khai các mẫu lưu trữ sự kiện.
Cài skill event-store-design bằng một lệnh
Chọn công cụ bạn đang dùng, copy lệnh và dán vào terminal. Skill sẽ nằm trong thư mục skills của công cụ đó và sẵn sàng dùng ở phiên làm việc tiếp theo.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/event-store-design-55f49.tgz | tar xz -C ~/.claude/skills
Gọi trong Claude Code: /event-store-design – rồi mô tả công việc bạn muốn làm.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/event-store-design-55f49.tgz | tar xz -C ~/.codex/skills
Gọi trong Codex: $event-store-design – rồi mô tả công việc bạn muốn làm.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/event-store-design-55f49.tgz | tar xz -C ~/.hermes/skills
Gọi trong Hermes Agent: /event-store-design – rồi mô tả công việc bạn muốn làm.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/event-store-design-55f49.tgz | tar xz -C ~/.deepcode/skills
Gọi trong DeepSeek: /event-store-design – rồi mô tả công việc bạn muốn làm.
Nội dung SKILL.md
Nội dung SKILL.md gốc bằng tiếng Anh.
Event Store Design
Comprehensive guide to designing event stores for event-sourced applications.
When to Use This Skill
- Designing event sourcing infrastructure
- Choosing between event store technologies
- Implementing custom event stores
- Optimizing event storage and retrieval
- Setting up event store schemas
- Planning for event store scaling
Core Concepts
1. Event Store Architecture
┌─────────────────────────────────────────────────────┐
│ Event Store │
├─────────────────────────────────────────────────────┤
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ Stream 1 │ │ Stream 2 │ │ Stream 3 │ │
│ │ (Aggregate) │ │ (Aggregate) │ │ (Aggregate) │ │
│ ├─────────────┤ ├─────────────┤ ├─────────────┤ │
│ │ Event 1 │ │ Event 1 │ │ Event 1 │ │
│ │ Event 2 │ │ Event 2 │ │ Event 2 │ │
│ │ Event 3 │ │ ... │ │ Event 3 │ │
│ │ ... │ │ │ │ Event 4 │ │
│ └─────────────┘ └─────────────┘ └─────────────┘ │
├─────────────────────────────────────────────────────┤
│ Global Position: 1 → 2 → 3 → 4 → 5 → 6 → ... │
└─────────────────────────────────────────────────────┘2. Event Store Requirements
| Requirement | Description |
| ----------------- | ---------------------------------- |
| Append-only | Events are immutable, only appends |
| Ordered | Per-stream and global ordering |
| Versioned | Optimistic concurrency control |
| Subscriptions | Real-time event notifications |
| Idempotent | Handle duplicate writes safely |
Technology Comparison
| Technology | Best For | Limitations |
| ---------------- | ------------------------- | -------------------------------- |
| EventStoreDB | Pure event sourcing | Single-purpose |
| PostgreSQL | Existing Postgres stack | Manual implementation |
| Kafka | High-throughput streaming | Not ideal for per-stream queries |
| DynamoDB | Serverless, AWS-native | Query limitations |
| Marten | .NET ecosystems | .NET specific |
Templates and detailed worked examples
Full template library and detailed worked examples live in references/details.md. Read that file when you need the concrete templates.
Best Practices
Do's
- Use stream IDs that include aggregate type -
Order-{uuid} - Include correlation/causation IDs - For tracing
- Version events from day one - Plan for schema evolution
- Implement idempotency - Use event IDs for deduplication
- Index appropriately - For your query patterns
Don'ts
- Don't update or delete events - They're immutable facts
- Don't store large payloads - Keep events small
- Don't skip optimistic concurrency - Prevents data corruption
- Don't ignore backpressure - Handle slow consumers
Skill liên quan
- hunt-dom – Săn lỗ hổng DOM phía client — DOM Clobbering (ghi đè biến JS toàn cục qua chèn HTML)…
- design-md – Soạn thảo, kiểm tra và xuất các tệp token spec DESIGN.md của Google.
- application-performance-performance-optimization – Tối ưu hiệu năng ứng dụng toàn diện với profiling, observability và tinh chỉnh…
- hunt-file-upload – Săn lỗi upload file — RCE qua webshell, XSS qua SVG/HTML, SSRF qua XXE trong DOCX, path…
- chro-advisor – Lãnh đạo nhân sự cho công ty đang mở rộng. Chiến lược tuyển dụng, thiết kế lương thưởng…
- hunt-http-smuggling – Săn HTTP request smuggling (CL.TE, TE.CL, H2.CL, H2.TE). Nguyên nhân: proxy phía trước…
- churn-prevention – Giảm churn tự nguyện và không tự nguyện thông qua thiết kế luồng hủy, ưu đãi giữ chân…
- duckduckgo-search – Tìm kiếm web, tin tức và hình ảnh miễn phí, không cần khóa API qua ddgs.