@torus-engineering/tas-kit 1.9.0 → 1.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/.claude/commands/ado-create.md +17 -17
  2. package/.claude/commands/ado-delete.md +11 -11
  3. package/.claude/commands/ado-get.md +12 -12
  4. package/.claude/commands/ado-status.md +12 -12
  5. package/.claude/commands/ado-update.md +15 -15
  6. package/.claude/commands/tas-adr.md +33 -33
  7. package/.claude/commands/tas-apitest-plan.md +173 -173
  8. package/.claude/commands/tas-apitest.md +143 -143
  9. package/.claude/commands/tas-brainstorm.md +14 -14
  10. package/.claude/commands/tas-bug.md +113 -113
  11. package/.claude/commands/tas-design.md +37 -37
  12. package/.claude/commands/tas-dev.md +128 -128
  13. package/.claude/commands/tas-e2e-mobile.md +155 -155
  14. package/.claude/commands/tas-e2e-web.md +163 -163
  15. package/.claude/commands/tas-e2e.md +102 -102
  16. package/.claude/commands/tas-epic.md +35 -35
  17. package/.claude/commands/tas-feature.md +47 -47
  18. package/.claude/commands/tas-fix.md +51 -51
  19. package/.claude/commands/tas-functest-mobile.md +144 -144
  20. package/.claude/commands/tas-functest-web.md +192 -192
  21. package/.claude/commands/tas-functest.md +76 -76
  22. package/.claude/commands/tas-init.md +14 -14
  23. package/.claude/commands/tas-plan.md +198 -200
  24. package/.claude/commands/tas-prd.md +37 -37
  25. package/.claude/commands/tas-review.md +111 -111
  26. package/.claude/commands/tas-sad.md +43 -43
  27. package/.claude/commands/tas-security.md +87 -81
  28. package/.claude/commands/tas-spec.md +20 -20
  29. package/.claude/commands/tas-status.md +13 -13
  30. package/.claude/commands/tas-story.md +91 -91
  31. package/.claude/commands/tas-verify.md +51 -51
  32. package/.claude/rules/common/post-review-agent.md +49 -49
  33. package/.claude/rules/common/project-status.md +14 -14
  34. package/.claude/rules/common/stack-detection.md +6 -6
  35. package/.claude/rules/common/token-logging.md +27 -27
  36. package/.claude/rules/csharp/api-testing.md +171 -171
  37. package/.claude/skills/ado-integration/SKILL.md +36 -36
  38. package/.claude/skills/tas-conventions/SKILL.md +32 -32
  39. package/.claude/skills/tas-implementation-complete/SKILL.md +100 -99
  40. package/.claude/skills/tas-tdd/SKILL.md +123 -123
  41. package/.claude/skills/token-logger/SKILL.md +19 -19
  42. package/.tas/README.md +266 -1520
  43. package/.tas/checklists/code-review.md +13 -13
  44. package/.tas/checklists/security.md +3 -3
  45. package/.tas/checklists/story-done.md +11 -11
  46. package/.tas/hooks/README.md +138 -0
  47. package/.tas/hooks/pre-commit +26 -0
  48. package/.tas/hooks/security-scan.js +599 -0
  49. package/.tas/project-status-example.yaml +3 -3
  50. package/.tas/tas-example.yaml +25 -8
  51. package/.tas/templates/ADR.md +16 -16
  52. package/.tas/templates/API-Test-Spec.md +3 -3
  53. package/.tas/templates/Bug.md +12 -12
  54. package/.tas/templates/Design-Spec.md +8 -8
  55. package/.tas/templates/E2E-Execution-Report.md +1 -1
  56. package/.tas/templates/Epic.md +1 -1
  57. package/.tas/templates/Feature.md +10 -10
  58. package/.tas/templates/Func-Test-Spec.md +3 -3
  59. package/.tas/templates/SAD.md +106 -106
  60. package/.tas/templates/Security-Report.md +3 -3
  61. package/.tas/templates/Story.md +9 -9
  62. package/.tas/tools/tas-ado-readme.md +169 -169
  63. package/.tas/tools/tas-ado.py +1 -1
  64. package/CLAUDE-Example.md +37 -58
  65. package/README.md +294 -42
  66. package/bin/cli.js +24 -7
  67. package/lib/install.js +161 -47
  68. package/package.json +1 -1
@@ -3,29 +3,29 @@
3
3
  > **Status:** Proposed | Accepted | Deprecated | Superseded
4
4
  > **Date:** [Date]
5
5
  > **Author:** [SE name]
6
- > **Supersedes:** [ADR-NNN nếu ]
7
- > **Related:** [ADR-NNN nếu ]
6
+ > **Supersedes:** [ADR-NNN if any]
7
+ > **Related:** [ADR-NNN if any]
8
8
 
9
9
  ## Context
10
- [ tả bối cảnh dẫn đến quyết định này. Vấn đề cần giải quyết là gì?]
10
+ [Describe context leading to this decision. What problem needs solving?]
11
11
 
12
12
  ## Decision
13
- [ tả quyết định kiến trúc đã chọn.]
13
+ [Describe the chosen architectural decision.]
14
14
 
15
15
  ## Rationale
16
- [Tại sao chọn hướng này? do kỹ thuật và kinh doanh.]
16
+ [Why choose this approach? Technical and business reasons.]
17
17
 
18
18
  ## Alternatives Considered
19
19
 
20
- ### Alternative 1: [Tên]
21
- - **Pros:** [ưu điểm]
22
- - **Cons:** [nhược điểm]
23
- - ** do không chọn:** [giải thích]
20
+ ### Alternative 1: [Name]
21
+ - **Pros:** [advantages]
22
+ - **Cons:** [disadvantages]
23
+ - **Why not chosen:** [explanation]
24
24
 
25
- ### Alternative 2: [Tên]
26
- - **Pros:** [ưu điểm]
27
- - **Cons:** [nhược điểm]
28
- - ** do không chọn:** [giải thích]
25
+ ### Alternative 2: [Name]
26
+ - **Pros:** [advantages]
27
+ - **Cons:** [disadvantages]
28
+ - **Why not chosen:** [explanation]
29
29
 
30
30
  ## Consequences
31
31
 
@@ -38,9 +38,9 @@
38
38
  - [consequence 2]
39
39
 
40
40
  ### SAD Updates
41
- *(Liệt các thay đổi cần cập nhật vào docs/sad.md - chỉ thêm khi ADR ảnh hưởng đến kiến trúc chung)*
42
- - [ ] [thay đổi 1]
43
- - [ ] [thay đổi 2]
41
+ *(List changes needed to update docs/sad.md - only add when ADR affects overall architecture)*
42
+ - [ ] [change 1]
43
+ - [ ] [change 2]
44
44
 
45
45
  ## Changelog
46
46
  | Date | Changes | Author |
@@ -28,7 +28,7 @@ framework: xUnit
28
28
 
29
29
  ## Version History
30
30
 
31
- > Mỗi API version section riêng biệt. APPEND-ONLY: không sửa version cũ.
31
+ > Each API version has separate section. APPEND-ONLY: don't modify old versions.
32
32
 
33
33
  | Version | Status | Created | Description |
34
34
  |---------|--------|---------|-------------|
@@ -354,7 +354,7 @@ framework: xUnit
354
354
 
355
355
  ## Story-Specific Test Cases (Optional)
356
356
 
357
- > Nếu spec được generate từ Story, thêm AC mapping ở đây.
357
+ > If spec generated from Story, add AC mapping here.
358
358
 
359
359
  | AC ID | AC Description | Test Case IDs |
360
360
  |-------|----------------|---------------|
@@ -365,7 +365,7 @@ framework: xUnit
365
365
 
366
366
  ## Regression Tests (Optional)
367
367
 
368
- > Test cases cho bugs đã được tìm thấy và fix.
368
+ > Test cases for bugs that were found and fixed.
369
369
 
370
370
  | Bug ID | Description | Test Case ID | Date Added |
371
371
  |--------|-------------|--------------|------------|
@@ -19,7 +19,7 @@ parent_ado_id:
19
19
  > **Created:** {Date}
20
20
 
21
21
  ## Description
22
- { tả bug ngắn gọn}
22
+ {Brief bug description}
23
23
 
24
24
  ## Steps to Reproduce
25
25
  1. {Step 1}
@@ -27,22 +27,22 @@ parent_ado_id:
27
27
  3. {Step 3}
28
28
 
29
29
  ## Expected Behavior
30
- {Kết quả mong đợi}
30
+ {Expected result}
31
31
 
32
32
  ## Actual Behavior
33
- {Kết quả thực tế}
33
+ {Actual result}
34
34
 
35
35
  ## Evidence
36
36
  {Screenshots, logs, error messages}
37
37
 
38
38
  ## Root Cause Analysis
39
- *SE điền khi phân tích*
40
- - **Root Cause:** { tả nguyên nhân gốc}
41
- - **Affected Files:** {Danh sách file liên quan}
42
- - **Impact Scope:** {Ảnh hưởng đến những chức năng nào khác}
39
+ *SE fills when analyzing*
40
+ - **Root Cause:** {Root cause description}
41
+ - **Affected Files:** {List of related files}
42
+ - **Impact Scope:** {Affected functionality}
43
43
 
44
44
  ## Regression Test Cases
45
- *SE thiết kế trước khi fix*
45
+ *SE designs before fixing*
46
46
 
47
47
  | ID | Description | Input | Expected | Status |
48
48
  |----|-------------|-------|----------|--------|
@@ -50,13 +50,13 @@ parent_ado_id:
50
50
  | RT-2 | Related regression | {input} | {expected} | - |
51
51
 
52
52
  ## Fix Notes
53
- *SE ghi sau khi fix*
54
- - **Fix Description:** { tả cách fix}
55
- - **Files Changed:** {Danh sách file đã sửa}
53
+ *SE fills after fixing*
54
+ - **Fix Description:** {Fix description}
55
+ - **Files Changed:** {List of changed files}
56
56
  - **Commit:** {commit hash}
57
57
 
58
58
  ## Verify Notes
59
- *PE ghi khi verify*
59
+ *PE fills when verifying*
60
60
 
61
61
  | Date | Environment | Result | Verified by | Notes |
62
62
  |------|-------------|--------|-------------|-------|
@@ -8,26 +8,26 @@
8
8
  ---
9
9
 
10
10
  ## 1. Overview
11
- {Tổng quan design}
11
+ {Design overview}
12
12
 
13
13
  ## 2. User Flows
14
- <!-- Dùng Mermaid flowchart, :::mermaid wrapper, không dùng () -->
14
+ <!-- Use Mermaid flowchart, :::mermaid wrapper, no () -->
15
15
 
16
16
  ## 3. Screen Descriptions
17
17
 
18
18
  ### Screen 1: {Name}
19
- - **Purpose:** {mục đích}
20
- - **Key Elements:** {thành phần chính}
21
- - **Actions Available:** {hành động người dùng có thể thực hiện}
19
+ - **Purpose:** {purpose}
20
+ - **Key Elements:** {key elements}
21
+ - **Actions Available:** {user actions available}
22
22
 
23
23
  ## 4. Navigation Structure
24
- <!-- Dùng Mermaid flowchart -->
24
+ <!-- Use Mermaid flowchart -->
25
25
 
26
26
  ## 5. Interaction Patterns
27
- { tả patterns: form submission, search, pagination...}
27
+ {Describe patterns: form submission, search, pagination...}
28
28
 
29
29
  ## 6. Responsive Behavior
30
- { tả breakpoints behavior thay đổi}
30
+ {Describe breakpoints and behavior changes}
31
31
 
32
32
  ---
33
33
 
@@ -51,7 +51,7 @@ environment: # dev | staging | prod
51
51
  ### {Test ID}: {Test Description}
52
52
 
53
53
  **AC Reference**: AC-{N}
54
- **Failure Reason**: { tả ngắn gọn DO fail dụ: "Button 'Submit' không hiển thị sau khi nhập email hợp lệ", "API trả về 401 thay 200", "Timeout sau 5s chờ màn hình Home load"}
54
+ **Failure Reason**: {Brief description of WHY it failede.g.: "Button 'Submit' not visible after entering valid email", "API returns 401 instead of 200", "Timeout after 5s waiting for Home screen to load"}
55
55
  **Error Type**: {Assertion Failure | Timeout | Crash | Element Not Found}
56
56
  **Error Message**:
57
57
  ```
@@ -15,7 +15,7 @@ last_ado_sync:
15
15
  > **PRD Reference:** {link to PRD section}
16
16
 
17
17
  ## Business Value
18
- { tả giá trị kinh doanh}
18
+ {Business value description}
19
19
 
20
20
  ## Scope
21
21
  ### In Scope
@@ -14,10 +14,10 @@ parent_ado_id:
14
14
  > **Epic:** Epic-{NNN}
15
15
  > **Owner:** {PE name}
16
16
  > **Created:** {Date}
17
- > **Verified Date:** {Date khi status = Verified}
17
+ > **Verified Date:** {Date when status = Verified}
18
18
 
19
19
  ## Description
20
- { tả chức năng}
20
+ {Feature description}
21
21
 
22
22
  ## User Stories
23
23
  | ID | Story | Priority | Estimate | Status |
@@ -29,26 +29,26 @@ parent_ado_id:
29
29
  - [ ] AC-2: {criteria}
30
30
 
31
31
  ## UI/UX Notes
32
- {Nếu có, reference đến design-spec.md}
32
+ {If any, reference to design-spec.md}
33
33
 
34
34
  ## Technical Notes
35
- {Nếu có, reference đến SAD/ADR}
35
+ {If any, reference to SAD/ADR}
36
36
 
37
37
  ## Integration Test Cases
38
- PE thiết kế khi tạo Feature. SE implement trong code.
38
+ PE designs when creating Feature. SE implements in code.
39
39
 
40
40
  | ID | AC Ref | Scenario | Expected Result | Status |
41
41
  |----|--------|----------|-----------------|--------|
42
- | IT-1 | AC-1 | { tả flow liên kết} | {Kết quả mong đợi} | - |
43
- | IT-2 | AC-2 | { tả flow liên kết} | {Kết quả mong đợi} | - |
42
+ | IT-1 | AC-1 | {Integration flow description} | {Expected result} | - |
43
+ | IT-2 | AC-2 | {Integration flow description} | {Expected result} | - |
44
44
 
45
45
  ## E2E / Acceptance Test Cases
46
- PE thiết kế khi tạo Feature. PE verify trên Staging Phase 2 bằng /tas-verify.
46
+ PE designs when creating Feature. PE verifies on Staging in Phase 2 using /tas-verify.
47
47
 
48
48
  | ID | AC Ref | User Scenario | Steps | Expected Result | Status | Verified Date |
49
49
  |----|--------|---------------|-------|-----------------|--------|---------------|
50
- | E2E-1 | AC-1 | {Scenario} | {Bước thực hiện} | {Kết quả mong đợi} | - | - |
51
- | E2E-2 | AC-2 | {Scenario} | {Bước thực hiện} | {Kết quả mong đợi} | - | - |
50
+ | E2E-1 | AC-1 | {Scenario} | {Execution steps} | {Expected result} | - | - |
51
+ | E2E-2 | AC-2 | {Scenario} | {Execution steps} | {Expected result} | - | - |
52
52
 
53
53
  ## Changelog
54
54
  | Date | Changes | Author |
@@ -23,7 +23,7 @@ platform: # mobile | web | backend
23
23
 
24
24
  ## Test Case Naming Convention
25
25
 
26
- > Functional Tests dung type code **FT** theo format chuẩn TAS
26
+ > Functional Tests use type code **FT** following TAS standard format
27
27
 
28
28
  ### Format
29
29
  ```
@@ -60,8 +60,8 @@ AL_E002_F002_S001_FT_003_E - Functional Test Edge case
60
60
 
61
61
  ## AC to Functional Test Mapping
62
62
 
63
- > QUAN TRONG: Moi FT case PHAI reference AC-ID de dam bao traceability.
64
- > Khi AC thay doi, grep theo AC-ID de biet FT nao can update.
63
+ > IMPORTANT: Every FT case MUST reference AC-ID to ensure traceability.
64
+ > When AC changes, grep by AC-ID to know which FTs need update.
65
65
 
66
66
  | AC ID | AC Description (Given/When/Then) | FT Test ID | Test Scenario | Modifier | Priority | Status |
67
67
  |-------|----------------------------------|------------|---------------|----------|----------|--------|
@@ -8,12 +8,12 @@
8
8
 
9
9
  ## 1. Executive Summary
10
10
 
11
- <!-- MANDATORY. Viết cho người đọc không có technical background.
12
- Bắt buộc:
13
- - 1.1 Purpose: Tại sao SAD này tồn tại, vấn đề cần giải quyết
14
- - 1.2 Scope: Hệ thống nào, ranh giới nào được/không được cover
15
- - 1.3 Key Objectives: 3-5 mục tiêu kiến trúc cụ thể, đo lường được
16
- Format: Prose ngắn, tối đa 1 trang tổng cộng -->
11
+ <!-- MANDATORY. Written for readers without technical background.
12
+ Required:
13
+ - 1.1 Purpose: Why this SAD exists, what problem it solves
14
+ - 1.2 Scope: Which systems, boundaries are/aren't covered
15
+ - 1.3 Key Objectives: 3-5 specific, measurable architecture objectives
16
+ Format: Short prose, max 1 page total -->
17
17
 
18
18
  ### 1.1 Purpose
19
19
  ### 1.2 Scope
@@ -24,12 +24,12 @@
24
24
  ## 2. Architecture Vision
25
25
 
26
26
  <!-- MANDATORY.
27
- Bắt buộc:
28
- - 2.1 Vision Statement: 1-2 câu tả "kiến trúc này hướng tới điều gì"
29
- - 2.2 Architecture Principles: 4-8 nguyên tắc dẫn dắt quyết định thiết kế
30
- (vd: Stateless services, API-first, Defense in depth, Fail fast)
31
- - 2.3 Constraints & Assumptions: Ràng buộc kỹ thuật/tổ chức, giả định đang được chấp nhận
32
- Format: Bullet list cho principles constraints -->
27
+ Required:
28
+ - 2.1 Vision Statement: 1-2 sentences describing "what this architecture aims for"
29
+ - 2.2 Architecture Principles: 4-8 principles guiding design decisions
30
+ (e.g.: Stateless services, API-first, Defense in depth, Fail fast)
31
+ - 2.3 Constraints & Assumptions: Technical/organizational constraints, accepted assumptions
32
+ Format: Bullet list for principles and constraints -->
33
33
 
34
34
  ### 2.1 Vision Statement
35
35
  ### 2.2 Architecture Principles
@@ -40,14 +40,14 @@
40
40
  ## 3. Business Requirements
41
41
 
42
42
  <!-- MANDATORY.
43
- Bắt buộc:
44
- - 3.1 Business Problem: tả bài toán kinh doanh cần giải quyết
45
- - 3.2 Stakeholders: Bảng stakeholder (role, concerns, influence)
46
- - 3.3 Functional Requirements: Danh sách FR-xxx, mỗi item ID để trace
47
- - 3.4 Non-Functional Requirements: Danh sách NFR với metric cụ thể
48
- (vd: Latency P99 < 300ms, Availability 99.9%, RPS 5000)
49
- Nên có: Priority (Must/Should/Could) cho mỗi requirement
50
- Format: Table hoặc numbered list với ID (FR-001, NFR-001) -->
43
+ Required:
44
+ - 3.1 Business Problem: Describe the business problem to solve
45
+ - 3.2 Stakeholders: Stakeholder table (role, concerns, influence)
46
+ - 3.3 Functional Requirements: List FR-xxx, each item has ID for traceability
47
+ - 3.4 Non-Functional Requirements: List NFR with specific metrics
48
+ (e.g.: Latency P99 < 300ms, Availability 99.9%, RPS 5000)
49
+ Should have: Priority (Must/Should/Could) for each requirement
50
+ Format: Table or numbered list with ID (FR-001, NFR-001) -->
51
51
 
52
52
  ### 3.1 Business Problem
53
53
  ### 3.2 Stakeholders
@@ -59,13 +59,13 @@
59
59
  ## 4. Technology Baseline
60
60
 
61
61
  <!-- MANDATORY.
62
- Bắt buộc:
63
- - 4.1 Current State: Hệ thống hiện tại (nếu greenfield thì ghi rõ)
64
- - 4.2 Technology Stack: Bảng layer → technology → version → rationale
62
+ Required:
63
+ - 4.1 Current State: Current system (specify if greenfield)
64
+ - 4.2 Technology Stack: Table layer → technology → version → rationale
65
65
  (Frontend / Backend / Database / Infrastructure / Messaging / Monitoring)
66
66
  - 4.3 Dependencies: External services, third-party APIs, shared platforms
67
- Nên có: Diagram current-state nếu migration/modernization
68
- Format: Table cho Technology Stack -->
67
+ Should have: Current-state diagram if migration/modernization
68
+ Format: Table for Technology Stack -->
69
69
 
70
70
  ### 4.1 Current State
71
71
  ### 4.2 Technology Stack
@@ -75,14 +75,14 @@
75
75
 
76
76
  ## 5. System Context (C4 Level 1)
77
77
 
78
- <!-- MANDATORY. Trả lời: "Hệ thống này nằm đâu trong hệ sinh thái?"
79
- Bắt buộc:
80
- - Mermaid flowchart: hệ thống ở giữa, xung quanh là users external systems
81
- - Chú thích mỗi external system: tên, vai trò, protocol giao tiếp
82
- Không cần: chi tiết nội bộ của hệ thống (để C4 Level 2)
83
- Format: Mermaid flowchart (dùng :::mermaid wrapper, không dùng () trong node label)
78
+ <!-- MANDATORY. Answers: "Where does this system sit in the ecosystem?"
79
+ Required:
80
+ - Mermaid flowchart: system in center, users and external systems around it
81
+ - Annotate each external system: name, role, communication protocol
82
+ Not needed: internal system details (leave for C4 Level 2)
83
+ Format: Mermaid flowchart (use :::mermaid wrapper, no () in node labels)
84
84
 
85
- Ví dụ:
85
+ Example:
86
86
  :::mermaid
87
87
  flowchart TD
88
88
  U[fa:fa-user End User] -- |HTTPS| SYS[Your System]
@@ -95,33 +95,33 @@
95
95
 
96
96
  ## 6. Logical View (C4 Level 2 — Container)
97
97
 
98
- <!-- MANDATORY. Trả lời: "Hệ thống gồm những container nào?"
99
- Bắt buộc:
100
- - Mermaid flowchart: tất cả containers (web app, API, DB, cache, queue, ...)
101
- - Mỗi container: tên, technology, vai trò chính
102
- - Luồng tương tác giữa containers với protocol/label
103
- Nên có: Phân nhóm theo bounded context nếu hệ thống lớn
104
- Format: Mermaid flowchart với subgraph để nhóm theo domain
98
+ <!-- MANDATORY. Answers: "What containers does this system consist of?"
99
+ Required:
100
+ - Mermaid flowchart: all containers (web app, API, DB, cache, queue, ...)
101
+ - Each container: name, technology, main role
102
+ - Interaction flows between containers with protocol/label
103
+ Should have: Group by bounded context if large system
104
+ Format: Mermaid flowchart with subgraph to group by domain
105
105
 
106
- dụ node: WebApp["Web App\n(Next.js / Vercel)"] -->
106
+ Example node: WebApp["Web App\n(Next.js / Vercel)"] -->
107
107
 
108
108
  ---
109
109
 
110
110
  ## 7. Component View (C4 Level 3)
111
111
 
112
- <!-- CONDITIONAL — Bắt buộc nếu hệ thống độ phức tạp cao hoặc team mới.
113
- Trả lời: "Bên trong mỗi container components nào?"
114
- Hướng dẫn:
115
- - Mỗi container phức tạp một subsection riêng (7.1, 7.2, ...)
116
- - Container đơn giản (chỉ proxy, static file, thin wrapper) → bỏ qua
117
- - Không cần drill vào mọi container — chỉ những container internal logic đáng kể
118
- Mỗi subsection bắt buộc:
119
- - Mermaid flowchart liệt components bên trong container đó
120
- - Mỗi component: tên, trách nhiệm chính, interface exposed
121
- - Dependency direction giữa components (tránh circular)
122
- Format: Mermaid flowchart với subgraph bao ngoài (tên container), nodes components
123
-
124
- Ví dụ:
112
+ <!-- CONDITIONAL — Required if system has high complexity or new team.
113
+ Answers: "What components are inside each container?"
114
+ Guidelines:
115
+ - Each complex container → separate subsection (7.1, 7.2, ...)
116
+ - Simple containers (proxy only, static files, thin wrapper) → skip
117
+ - Don't drill into every container — only those with significant internal logic
118
+ Each subsection requires:
119
+ - Mermaid flowchart listing components inside that container
120
+ - Each component: name, main responsibility, exposed interface
121
+ - Dependency direction between components (avoid circular)
122
+ Format: Mermaid flowchart with subgraph wrapper (container name), nodes are components
123
+
124
+ Example:
125
125
  :::mermaid
126
126
  flowchart TD
127
127
  subgraph API["API Service (NestJS)"]
@@ -135,89 +135,89 @@
135
135
 
136
136
  ### 7.1 [Container Name]
137
137
 
138
- <!-- Bắt buộc: Mermaid component diagram như hướng dẫn trên.
139
- Nên có: tả ngắn vai trò của container này trước diagram. -->
138
+ <!-- Required: Mermaid component diagram as per above guidelines.
139
+ Should have: Brief description of this container's role before diagram. -->
140
140
 
141
141
  ### 7.2 [Container Name]
142
142
 
143
- <!-- Thêm subsection cho mỗi container phức tạp. Xóa subsection này nếu không cần. -->
143
+ <!-- Add subsection for each complex container. Delete this subsection if not needed. -->
144
144
 
145
145
  ---
146
146
 
147
147
  ## 8. Data Architecture & ERD
148
148
 
149
- <!-- MANDATORY nếu hệ thống persistence layer.
150
- Bắt buộc:
151
- - ERD: entities, attributes (chỉ key fields), relationships với cardinality
152
- - Data flow overview: data đi từ đâu đến đâu, transform ở đâu
153
- Nên có:
154
- - Data classification: PII / Sensitive / Internal / Public cho mỗi entity
155
- - Retention policy nếu compliance requirement
156
- - Sharding/partitioning strategy nếu data scale lớn
157
- Format: Mermaid erDiagram cho ERD -->
149
+ <!-- MANDATORY if system has persistence layer.
150
+ Required:
151
+ - ERD: entities, attributes (key fields only), relationships with cardinality
152
+ - Data flow overview: where data comes from/goes to, transforms where
153
+ Should have:
154
+ - Data classification: PII / Sensitive / Internal / Public for each entity
155
+ - Retention policy if compliance requirement exists
156
+ - Sharding/partitioning strategy if large data scale
157
+ Format: Mermaid erDiagram for ERD -->
158
158
 
159
159
  ---
160
160
 
161
161
  ## 9. Integration & Data Flow
162
162
 
163
- <!-- MANDATORY nếu hệ thống tích hợp với external services hoặc async flows.
164
- Bắt buộc:
165
- - Sequence diagram cho mỗi critical flow (auth, payment, order, ...)
166
- - Async flows: queue/event-driven patterns phải được diagram
167
- Nên có: Error/retry flows cho critical paths
168
- Format: Mermaid sequenceDiagram, một diagram per flow -->
163
+ <!-- MANDATORY if system integrates with external services or has async flows.
164
+ Required:
165
+ - Sequence diagram for each critical flow (auth, payment, order, ...)
166
+ - Async flows: queue/event-driven patterns must be clearly diagrammed
167
+ Should have: Error/retry flows for critical paths
168
+ Format: Mermaid sequenceDiagram, one diagram per flow -->
169
169
 
170
170
  ### 9.1 API Design Principles
171
171
 
172
- <!-- MANDATORY nếu hệ thống expose API (internal hoặc external).
173
- Bắt buộc:
174
- - API Style: REST / GraphQL / gRPC / Event-driven — lý do chọn
172
+ <!-- MANDATORY if system exposes API (internal or external).
173
+ Required:
174
+ - API Style: REST / GraphQL / gRPC / Event-driven — and rationale
175
175
  - Versioning strategy: URL path (/v1/) vs header vs query param
176
176
  - Authentication scheme: Bearer JWT / API Key / OAuth2 / mTLS
177
177
  - Standard error format: HTTP status codes, error body structure
178
- Nên có:
178
+ Should have:
179
179
  - Rate limiting approach (per-user, per-IP, tiered)
180
180
  - Pagination convention (cursor vs offset)
181
- - Idempotency handling cho mutating operations
182
- Không đưa vào đây: endpoint list, request/response schema chi tiết
183
- Những thứ đó thuộc API Contract document riêng (viết khi implement)
184
- Format: Bullet list hoặc table ngắn gọn -->
181
+ - Idempotency handling for mutating operations
182
+ Don't include here: endpoint list, detailed request/response schemas
183
+ Those belong to separate API Contract document (written when implementing)
184
+ Format: Bullet list or short table -->
185
185
 
186
186
  ---
187
187
 
188
188
  ## 10. Security Architecture
189
189
 
190
- <!-- MANDATORY. Đây architectural concern, không phải implementation detail.
191
- Bắt buộc:
192
- - Threat Model: attack surfaces, trust boundaries, top threats (dùng STRIDE nếu cần)
190
+ <!-- MANDATORY. This is an architectural concern, not implementation detail.
191
+ Required:
192
+ - Threat Model: attack surfaces, trust boundaries, top threats (use STRIDE if needed)
193
193
  - Identity & Auth Flow: AuthN/AuthZ mechanism, token lifecycle, privilege escalation path
194
194
  - Data Classification: PII / Sensitive / Internal / Public — handling rules per class
195
- - Network Security Zones: public / DMZ / private / data tier rules giữa các zones
196
- - Encryption: at-rest (algorithm, key management) in-transit (TLS version, cert strategy)
197
- Nên có:
195
+ - Network Security Zones: public / DMZ / private / data tier and rules between zones
196
+ - Encryption: at-rest (algorithm, key management) and in-transit (TLS version, cert strategy)
197
+ Should have:
198
198
  - Secrets management approach (Vault, AWS SSM, env vars strategy)
199
199
  - Audit logging scope: what events must be logged, retention
200
- - Compliance requirements: GDPR, PCI-DSS, SOC2, ... nếu applicable
200
+ - Compliance requirements: GDPR, PCI-DSS, SOC2, ... if applicable
201
201
  Format:
202
202
  - Threat model: table (Threat | Vector | Mitigation)
203
203
  - Auth flow: Mermaid sequenceDiagram
204
- - Network zones: Mermaid flowchart với subgraph per zone -->
204
+ - Network zones: Mermaid flowchart with subgraph per zone -->
205
205
 
206
206
  ---
207
207
 
208
208
  ## 11. NFR Strategies
209
209
 
210
- <!-- MANDATORY. Mỗi NFR-xxx trong Section 3.4 phải strategy tương ứng ở đây (reference bằng ID).
211
- Bắt buộc — cover các categories sau nếu NFR liên quan:
210
+ <!-- MANDATORY. Each NFR-xxx in Section 3.4 must have corresponding strategy here (reference by ID).
211
+ Required — cover following categories if related NFR exists:
212
212
  - Performance: caching strategy (L1/L2/CDN), DB indexing, query optimization approach
213
213
  - Scalability: horizontal vs vertical, stateless design, queue-based decoupling
214
214
  - Availability: redundancy model (Active-Active/Active-Passive), failover mechanism, SLA target
215
215
  - Resilience: circuit breaker, retry with backoff, bulkhead, timeout policy
216
216
  - Observability: structured logging, distributed tracing, metrics & alerting thresholds
217
- Nên có:
217
+ Should have:
218
218
  - Capacity planning baseline: expected load, growth projection, scale trigger points
219
219
  - DR strategy: RPO/RTO targets, backup frequency, restore procedure overview
220
- Format: Table với cột NFR ID để trace ngược về Section 3.4
220
+ Format: Table with NFR ID column to trace back to Section 3.4
221
221
  | NFR ID | Category | Target | Strategy | Notes |
222
222
  |--------|----------|--------|----------|-------|
223
223
  | NFR-001 | Latency | P99 < 300ms | Redis cache L2, read replicas | Cache TTL 5m |
@@ -227,28 +227,28 @@
227
227
 
228
228
  ## 12. Deployment Topology
229
229
 
230
- <!-- MANDATORY. Trả lời: "Các components chạy đâu trong infrastructure?"
231
- Bắt buộc:
230
+ <!-- MANDATORY. Answers: "Where do components run in the infrastructure?"
231
+ Required:
232
232
  - Infrastructure diagram: regions, AZs, VPC/subnets, load balancers, entry points
233
233
  - Component-to-infrastructure mapping: service X → ECS Fargate, DB → RDS Multi-AZ, ...
234
234
  - Traffic entry points: CDN → ALB → API Gateway → Service flow
235
- - Environment matrix: dev / staging / prod — sự khác nhau về scale, config, isolation
236
- Nên có:
237
- - Network topology: public subnet / private subnet / data subnet routing rules
238
- - CI/CD pipeline overview: build → test → deploy flow approval gates
239
- - Container orchestration config nếu dùng K8s/ECS (namespace, resource limits)
235
+ - Environment matrix: dev / staging / prod — differences in scale, config, isolation
236
+ Should have:
237
+ - Network topology: public subnet / private subnet / data subnet and routing rules
238
+ - CI/CD pipeline overview: build → test → deploy flow and approval gates
239
+ - Container orchestration config if using K8s/ECS (namespace, resource limits)
240
240
  Format:
241
- - Mermaid flowchart với subgraph per environment tier hoặc per network zone
241
+ - Mermaid flowchart with subgraph per environment tier or per network zone
242
242
  - Environment matrix: table (Component | Dev | Staging | Prod) -->
243
243
 
244
244
  ---
245
245
 
246
246
  ## 13. Architectural Decisions
247
247
 
248
- <!-- MANDATORY. Ghi lại mọi quyết định kiến trúc quan trọng và lý do.
249
- Bắt buộc: Mỗi ADR entry gồm Decision, Status, Date, Rationale
250
- Nên có: Alternatives considered tại sao không chọn
251
- Format: Table — thêm row mỗi khi quyết định mới
248
+ <!-- MANDATORY. Record all important architectural decisions and rationale.
249
+ Required: Each ADR entry includes Decision, Status, Date, Rationale
250
+ Should have: Alternatives considered and why not chosen
251
+ Format: Table — add row when new decision is made
252
252
  Status values: Proposed | Accepted | Deprecated | Superseded -->
253
253
 
254
254
  | ID | Decision | Status | Date | Rationale |
@@ -259,9 +259,9 @@
259
259
  ## 14. Risks & Mitigation
260
260
 
261
261
  <!-- MANDATORY.
262
- Bắt buộc: Risk, Impact (H/M/L), Probability (H/M/L), Mitigation action
263
- Nên có: Owner review date cho mỗi risk
264
- Format: Table, sắp xếp theo Impact × Probability giảm dần -->
262
+ Required: Risk, Impact (H/M/L), Probability (H/M/L), Mitigation action
263
+ Should have: Owner and review date for each risk
264
+ Format: Table, sorted by Impact × Probability descending -->
265
265
 
266
266
  | Risk | Impact | Probability | Mitigation | Owner |
267
267
  |------|--------|-------------|------------|-------|
@@ -18,9 +18,9 @@
18
18
  - **Severity:** Critical | High | Medium | Low
19
19
  - **Status:** Open | In Progress | Fixed | Accepted Risk
20
20
  - **Location:** {file:line}
21
- - **Description:** { tả vấn đề}
22
- - **Recommended Fix:** {Cách fix cụ thể}
23
- - **Fixed Date:** {Date, nếu đã fix}
21
+ - **Description:** {Issue description}
22
+ - **Recommended Fix:** {Specific fix approach}
23
+ - **Fixed Date:** {Date, if fixed}
24
24
 
25
25
  ## Scan History
26
26
  | Date | Scope | New Findings | Fixed | Remaining |