From ai-first-engineering
Generates lean Vietnamese PRDs focused on business rules and workflows for AI-first engineering and BDD. Interviews for details, outputs feed prd-to-gherkin for scenarios and prd-to-mockup for wireframes.
npx claudepluginhub cuongtl1992/vibe-skills --plugin ai-first-engineeringThis skill uses the workspace's default tool permissions.
Viết PRD rút gọn cho AI-first engineering. Output tập trung vào **Business Rules** (mỗi rule = 1 testable contract) và **Workflow** (state machine) để:
Generates Product Requirements Documents (PRDs) with user stories, success metrics, scope, technical considerations, and risks for product features.
Generates structured Product Requirements Documents (PRDs) with sections for overview, categorized requirements, user stories, technical considerations, out-of-scope items, and checklists.
Generates structured Product Requirements Documents (PRDs) using proven PM template. Useful for creating, drafting, or helping with PRDs, product specs, feature specs, or product docs.
Share bugs, ideas, or general feedback.
Viết PRD rút gọn cho AI-first engineering. Output tập trung vào Business Rules (mỗi rule = 1 testable contract) và Workflow (state machine) để:
prd-to-gherkin chuyển thành Gherkin feature file không cần đoánprd-to-mockup render wireframe từ Screen StatesPRD không phải tài liệu giao tiếp — PRD là executable specification.
Mỗi phần trong output đều có consumer rõ ràng:
Lean PRD section → Consumer
────────────────────────────────────
Bối cảnh → Feature: description (Gherkin)
Domain Context → Step language + domain models
Workflow → State machine code + scenario ordering
Business Rules → Rule: blocks (Gherkin) + validation logic
Screen States → prd-to-mockup → UI components
Open Questions → # TODO: comments (Gherkin)
Bỏ: Success Metrics, Timeline, Assumptions, Dependencies → tách doc riêng nếu cần.
Luôn dùng tiếng Việt cho toàn bộ nội dung PRD. Chỉ dùng tiếng Anh cho:
Không bao giờ viết spec ngay. Hỏi trước, nhưng gọn và có mục đích.
Câu mở đầu:
"Trước khi viết spec, mô tả giúp mình: feature này giải quyết vấn đề gì, cho ai, và luồng chính (happy path) trông như thế nào?"
Hỏi thêm chỉ khi thiếu:
| Thiếu gì | Hỏi gì |
|---|---|
| Luồng chính chưa rõ | "Mô tả step-by-step: user bắt đầu từ đâu, làm gì, kết thúc ở đâu?" |
| Business rules mờ | "Có rule nào bắt buộc không? VD: ai được phép, điều kiện gì phải đúng, giới hạn gì?" |
| Edge cases | "Trường hợp nào user KHÔNG được làm? Hoặc hệ thống phải từ chối?" |
| Scope boundary | "Có gì chắc chắn KHÔNG nằm trong scope lần này?" |
Dừng hỏi khi đã có: luồng chính, 3+ business rules cụ thể, và biết scope in/out. Thường 2-4 lượt trao đổi.
Nếu feature phức tạp (nhiều luồng, nhiều role, integration), đọc references/interview-guide.md để chọn bộ câu hỏi phù hợp loại feature.
Sau phỏng vấn, generate full spec theo template bên dưới.
Mọi thứ user nói "bắt buộc phải", "không được phép" → Must Have
Mọi thứ user nói "nên có", "quan trọng nhưng..." → Should Have
Mọi thứ user nói "sau này", "nếu kịp" → Won't Have
Mỗi rule PHẢI thỏa:
Ví dụ tốt vs xấu:
✅ Business Rule đúng chuẩn:
| BR-M01 | Chỉ merchant có gói trả phí active mới được xuất hóa đơn |
| | Pre: merchant.subscription = active_paid |
| | Trigger: merchant gửi yêu cầu xuất hóa đơn |
| | Expected: hóa đơn được tạo, status = "Draft" |
| | Exception: từ chối + thông báo "Cần nâng cấp gói" |
❌ Sai — không testable:
"Hệ thống phải xử lý hóa đơn nhanh chóng" → nhanh là bao nhiêu?
❌ Sai — UI detail:
"Nút Submit phải ở góc phải màn hình" → không phải business rule
❌ Sai — implementation detail:
"Dùng message queue để xử lý async" → đó là technical decision
Xem thêm references/business-rules-patterns.md cho 10 pattern phổ biến.
Workflow mô tả vòng đời (lifecycle) của entity chính trong feature. Mỗi transition phải gắn với 1+ Business Rule ID.
Nguyên tắc:
- Mỗi state = trạng thái observable của entity
- Mỗi transition = hành động (trigger) + điều kiện (guard = rule ID)
- Nếu feature có nhiều entity → vẽ nhiều diagram, mỗi cái cho 1 entity
- Nếu feature không có state machine (VD: pure calculation) → dùng flowchart
Screen States mô tả user nhìn thấy gì tại mỗi bước trong workflow. Đây là input cho prd-to-mockup để render wireframe.
Nguyên tắc:
- Mỗi Screen State = 1 snapshot của UI tại 1 thời điểm
- Gắn với state trong workflow diagram
- Liệt kê: data hiển thị, field editable, actions available
- Mô tả error state khi rule bị vi phạm
- KHÔNG mô tả styling (màu, font, layout) — đó là việc của designer/mockup skill
Sau khi present draft, hỏi:
"Business Rules có miss rule nào quan trọng không? Đặc biệt các trường hợp hệ thống phải từ chối hoặc giới hạn?"
Rồi:
"Workflow diagram có đúng với luồng thực tế không? Có transition nào thiếu?"
Cuối cùng:
"Screen States — user nhìn thấy gì ở mỗi bước có đúng không? Có màn nào thiếu?"
Luôn dùng đúng structure này. Mỗi section bắt buộc — ghi "N/A" nếu không applicable, không được skip.
# Lean PRD: [Tên Feature]
## Metadata
| Field | Value |
|---|---|
| Status | Draft / In Review / Approved |
| Author | [tên] |
| Ngày | [YYYY-MM-DD] |
| Version | 1.0 |
| Confluence | [link tới trang Confluence nếu có] |
| Jira Epic | [link tới Jira epic nếu có] |
---
## Bối cảnh
[2-3 câu. Ai gặp vấn đề gì, hiện tại xử lý ra sao, tại sao cần giải quyết. Không dùng ngôn ngữ giải pháp.]
---
## Domain Context
### Entities
| Entity | Mô tả | Thuộc tính chính | Invariants |
|--------|-------|-----------------|------------|
| [Entity 1] | [mô tả ngắn] | [attr1, attr2, ...] | [ràng buộc luôn đúng] |
| [Entity 2] | [mô tả ngắn] | [attr1, attr2, ...] | [ràng buộc luôn đúng] |
### Thuật ngữ (nếu có term đặc thù domain)
| Thuật ngữ | Định nghĩa | Dùng thay cho |
|-----------|-----------| --------------|
| [term] | [nghĩa] | [từ khác không dùng] |
---
## User Stories
As a [role cụ thể],
I want [khả năng],
So that [giá trị / kết quả].
[1-3 stories. Mỗi story = 1 mục tiêu riêng biệt của user.]
---
## Workflow
### State Machine
```mermaid
stateDiagram-v2
[*] --> State1 : trigger()
State1 --> State2 : action() [BR-M01]
State2 --> State3 : action() [BR-M02]
State2 --> State1 : failed [BR-M02]
State3 --> [*]
| Từ | Đến | Trigger | Guard (Rule ID) | Mô tả |
|---|---|---|---|---|
| [State1] | [State2] | [hành động] | [BR-Mxx] | [giải thích ngắn] |
Không có những rule này, feature không hoạt động.
| ID | Rule Statement | Pre-condition | Trigger | Expected Outcome | Exception |
|---|---|---|---|---|---|
| BR-M01 | [Hệ thống phải enforce/enable gì] | [điều kiện ban đầu] | [hành động kích hoạt] | [kết quả mong đợi] | [xử lý khi vi phạm] |
| BR-M02 | [Rule statement] | [pre-condition] | [trigger] | [expected] | [exception] |
Quan trọng nhưng feature vẫn ship được nếu thiếu.
| ID | Rule Statement | Pre-condition | Trigger | Expected Outcome | Exception |
|---|---|---|---|---|---|
| BR-S01 | [Rule statement] | [pre-condition] | [trigger] | [expected] | [exception] |
Tạm hoãn — đặt kỳ vọng rõ ràng.
| Item | Lý do hoãn |
|---|---|
| [Khả năng bị hoãn] | [lý do ngắn] |
...
Câu hỏi cần trả lời trước khi dev:
Câu hỏi có thể giải quyết trong lúc dev:
---
## Lưu PRD
PRD là tài liệu của Product, lưu trên **Confluence** (nguồn sự thật cho "tại sao làm feature này").
Khi engineer cần gen Gherkin từ PRD, chỉ cần cung cấp link Confluence. Gherkin feature file sẽ reference ngược về PRD bằng comment:
```gherkin
# PRD: https://your-site.atlassian.net/wiki/spaces/PROJ/pages/123456
# Generated from Lean PRD v1.0
Không lưu PRD vào living docs repo — repo đó chỉ chứa Gherkin + automation tests.
Trước khi finalize, verify:
prd-to-gherkin để gen Gherkin scenariosprd-to-mockup để render wireframeRule: block trong feature fileGiven, Trigger → When, Expected → Then (happy), Exception → Scenario: error path# TODO: comment trong feature filereferences/interview-guide.md — Câu hỏi phỏng vấn theo loại feature (CRUD, workflow, integration, notification, calculation)references/business-rules-patterns.md — Pattern business rules phổ biến với ví dụ tốt/xấu