@haposoft/cafekit 0.3.11 → 0.3.12

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haposoft/cafekit",
3
- "version": "0.3.11",
3
+ "version": "0.3.12",
4
4
  "description": "Spec-Driven Development workflow for AI coding assistants. Supports Claude Code and Antigravity with spec-first and code-test-review workflows.",
5
5
  "author": "Haposoft <nghialt@haposoft.com>",
6
6
  "license": "MIT",
@@ -1,54 +1,54 @@
1
- # Change Detection - Phát Hiện Thay Đổi
1
+ # Change Detection - Detecting Changes
2
2
 
3
- Phương pháp phát hiện phân loại code changes để phân tích tác động.
3
+ Methods for detecting and classifying code changes for impact analysis.
4
4
 
5
5
  ## Git Commands
6
6
 
7
7
  ### 1. Detect Recent Changes
8
8
 
9
9
  ```bash
10
- # Changes chưa commit
10
+ # Uncommitted changes
11
11
  git diff --name-only
12
12
 
13
- # Changes đã staged
13
+ # Staged changes
14
14
  git diff --cached --name-only
15
15
 
16
- # Changes trong commit gần nhất
16
+ # Changes in last commit
17
17
  git diff --name-only HEAD~1
18
18
 
19
- # Changes so với branch khác
19
+ # Changes compared to another branch
20
20
  git diff --name-only main...HEAD
21
21
 
22
- # Xem chi tiết thay đổi
22
+ # View detailed changes
23
23
  git diff HEAD~1
24
24
 
25
- # Xem thống kê
25
+ # View statistics
26
26
  git diff --stat HEAD~1
27
27
  ```
28
28
 
29
29
  ### 2. Get Change Details
30
30
 
31
31
  ```bash
32
- # Số dòng thay đổi
32
+ # Lines changed
33
33
  git diff --numstat HEAD~1
34
34
 
35
- # Files số lượng changes
35
+ # Files and change count
36
36
  git diff --shortstat HEAD~1
37
37
 
38
- # Chỉ xem added/deleted files
38
+ # Only view added/deleted files
39
39
  git diff --diff-filter=AD --name-only HEAD~1
40
40
  ```
41
41
 
42
42
  ### 3. Historical Analysis
43
43
 
44
44
  ```bash
45
- # Xem lịch sử file
45
+ # View file history
46
46
  git log --oneline -10 {file}
47
47
 
48
- # Xem ai sửa dòng nào
48
+ # See who modified which line
49
49
  git blame {file}
50
50
 
51
- # Xem changes của commit cụ thể
51
+ # View changes in specific commit
52
52
  git show {commit-hash}
53
53
  ```
54
54
 
@@ -57,7 +57,7 @@ git show {commit-hash}
57
57
  ### Backend Changes
58
58
 
59
59
  **Indicators:**
60
- - Files: `*.ts`, `*.js`, `*.py`, `*.go` trong `src/api/`, `src/services/`, `src/controllers/`
60
+ - Files: `*.ts`, `*.js`, `*.py`, `*.go` in `src/api/`, `src/services/`, `src/controllers/`
61
61
  - Patterns: API routes, database queries, business logic
62
62
 
63
63
  **Risk Level:**
@@ -79,7 +79,7 @@ grep -r "SELECT\|INSERT\|UPDATE\|DELETE" {changed-files}
79
79
  ### Frontend Changes
80
80
 
81
81
  **Indicators:**
82
- - Files: `*.tsx`, `*.jsx`, `*.vue`, `*.svelte` trong `src/components/`, `src/pages/`
82
+ - Files: `*.tsx`, `*.jsx`, `*.vue`, `*.svelte` in `src/components/`, `src/pages/`
83
83
  - Patterns: Components, hooks, state management
84
84
 
85
85
  **Risk Level:**
@@ -1,12 +1,12 @@
1
- # Dependency Scouting - Tìm Files Bị Ảnh Hưởng
1
+ # Dependency Scouting - Finding Affected Files
2
2
 
3
- Phương pháp tìm kiếm phân tích dependencies để xác định phạm vi tác động.
3
+ Methods for finding and analyzing dependencies to determine impact scope.
4
4
 
5
5
  ## Scouting Strategies
6
6
 
7
7
  ### 1. Import Analysis (Direct Dependencies)
8
8
 
9
- Tìm files import code đã sửa:
9
+ Find files that import the modified code:
10
10
 
11
11
  ```bash
12
12
  # JavaScript/TypeScript
@@ -35,7 +35,7 @@ grep -r "from.*utils/auth" src/
35
35
 
36
36
  ### 2. Function/Class Usage (Reverse Dependencies)
37
37
 
38
- Tìm nơi sử dụng functions/classes:
38
+ Find where functions/classes are used:
39
39
 
40
40
  ```bash
41
41
  # Function calls
@@ -60,7 +60,7 @@ grep -r "validateEmail(" src/
60
60
 
61
61
  ### 3. API Endpoint Consumers
62
62
 
63
- Nếu sửa backend API, tìm frontend calls:
63
+ If backend API is modified, find frontend calls:
64
64
 
65
65
  ```bash
66
66
  # Fetch/Axios calls
@@ -84,7 +84,7 @@ grep -r "api/users" src/
84
84
 
85
85
  ### 4. Database Dependencies
86
86
 
87
- Nếu sửa database schema:
87
+ If database schema is modified:
88
88
 
89
89
  ```bash
90
90
  # Table usage
@@ -109,7 +109,7 @@ grep -r "prisma.user.findMany" src/
109
109
 
110
110
  ### 5. Type/Interface Dependencies
111
111
 
112
- Tìm nơi sử dụng types:
112
+ Find where types are used:
113
113
 
114
114
  ```bash
115
115
  # TypeScript interfaces
@@ -134,7 +134,7 @@ grep -r "as User" src/
134
134
 
135
135
  ## Using /ck:scout for Parallel Scouting
136
136
 
137
- Khi nhiều files thay đổi, sử dụng `/ck:scout` để parallel search:
137
+ When multiple files change, use `/ck:scout` for parallel search:
138
138
 
139
139
  ```
140
140
  /ck:scout Scout dependencies for changes.
@@ -1,6 +1,6 @@
1
- # Edge Case Identification - Xác Định Edge Cases
1
+ # Edge Case Identification - Identifying Edge Cases
2
2
 
3
- Phương pháp phát hiện phân tích edge cases để tránh bugs tiềm ẩn.
3
+ Methods for detecting and analyzing edge cases to avoid potential bugs.
4
4
 
5
5
  ## Edge Case Categories
6
6
 
@@ -23,10 +23,10 @@ function getUser(id: string) {
23
23
  ```
24
24
 
25
25
  **Check:**
26
- - [ ] check null/undefined trước khi access?
27
- - [ ] Optional chaining (`?.`) được sử dụng?
28
- - [ ] Nullish coalescing (`??`) cho default values?
29
- - [ ] Type guards cho union types?
26
+ - [ ] Check null/undefined before access?
27
+ - [ ] Optional chaining (`?.`) used?
28
+ - [ ] Nullish coalescing (`??`) for default values?
29
+ - [ ] Type guards for union types?
30
30
 
31
31
  #### Empty Collections
32
32
 
@@ -39,9 +39,9 @@ const firstUser = users.length > 0 ? users[0].name : null;
39
39
  ```
40
40
 
41
41
  **Check:**
42
- - [ ] Array.length check trước khi access index?
43
- - [ ] Empty array handling trong map/filter/reduce?
44
- - [ ] Object.keys() check trước khi iterate?
42
+ - [ ] Array.length check before accessing index?
43
+ - [ ] Empty array handling in map/filter/reduce?
44
+ - [ ] Object.keys() check before iterating?
45
45
 
46
46
  #### Type Coercion
47
47
 
@@ -54,8 +54,8 @@ if (value !== null && value !== undefined) { }
54
54
  ```
55
55
 
56
56
  **Check:**
57
- - [ ] Strict equality (`===`) thay loose (`==`)?
58
- - [ ] Explicit type checks cho boolean logic?
57
+ - [ ] Strict equality (`===`) instead of loose (`==`)?
58
+ - [ ] Explicit type checks for boolean logic?
59
59
  - [ ] Number validation (isNaN, isFinite)?
60
60
 
61
61
  ### 2. Boundary Conditions
@@ -1,10 +1,10 @@
1
1
  # Industry Techniques - Code Change Impact Analysis
2
2
 
3
- Tổng hợp các kỹ thuật công cụ phân tích tác động code changes từ industry research.
3
+ Compilation of techniques and tools for analyzing code change impacts from industry and research.
4
4
 
5
- ## 📚 Nguồn Tham Khảo
5
+ ## 📚 References
6
6
 
7
- Dựa trên research industry best practices từ:
7
+ Based on research and industry best practices from:
8
8
  - Academic papers (ACM, ResearchGate, arXiv)
9
9
  - Static analysis tools (NDepend, CppDepend, SonarQube)
10
10
  - Software engineering practices
@@ -12,22 +12,22 @@ Dựa trên research và industry best practices từ:
12
12
 
13
13
  ---
14
14
 
15
- ## 🎯 Các Phương Pháp Chính
15
+ ## 🎯 Main Methods
16
16
 
17
17
  ### 1. Traceability-Based Impact Analysis
18
18
 
19
- **Khái niệm:**
20
- Sử dụng links giữa requirements, specifications, design elements, tests để xác định phạm vi thay đổi.
19
+ **Concept:**
20
+ Use links between requirements, specifications, design elements, and tests to determine scope of changes.
21
21
 
22
- **Cách hoạt động:**
22
+ **How it works:**
23
23
  ```
24
24
  Requirement → Design → Code → Tests
25
25
  ↓ ↓ ↓ ↓
26
26
  Change → Impact → Affected → Test Cases
27
27
  ```
28
28
 
29
- **Ứng dụng trong Impact Analysis:**
30
- - Map code changes về requirements
29
+ **Application in Impact Analysis:**
30
+ - Map code changes to requirements
31
31
  - Identify affected user stories
32
32
  - Generate test scenarios từ requirements
33
33
 
@@ -53,10 +53,10 @@ Requirement → Design → Code → Tests
53
53
 
54
54
  ### 2. Dependency-Based Impact Analysis
55
55
 
56
- **Khái niệm:**
57
- Phân tích dependencies (imports, function calls, class usage) để tìm affected files.
56
+ **Concept:**
57
+ Analyze dependencies (imports, function calls, class usage) to find affected files.
58
58
 
59
- **Cách hoạt động:**
59
+ **How it works:**
60
60
 
61
61
  #### A. Call Graph Analysis
62
62
  ```
@@ -92,7 +92,7 @@ Module B imports Module C
92
92
  - **Madge** (JavaScript): Circular dependency detection
93
93
  - **jdeps** (Java): Package dependencies
94
94
 
95
- **Ứng dụng:**
95
+ **Application:**
96
96
  ```bash
97
97
  # Find all files importing authService
98
98
  grep -r "from.*authService" src/
@@ -108,10 +108,10 @@ madge --image graph.png src/
108
108
 
109
109
  ### 3. AST-Based Impact Analysis
110
110
 
111
- **Khái niệm:**
112
- Sử dụng Abstract Syntax Tree để phân tích code structure detect changes semantic level.
111
+ **Concept:**
112
+ Use Abstract Syntax Tree to analyze code structure and detect changes at semantic level.
113
113
 
114
- **Cách hoạt động:**
114
+ **How it works:**
115
115
  ```
116
116
  Source Code → Parser → AST → Analysis → Impact Report
117
117
  ```
@@ -147,9 +147,9 @@ function login(email, password, rememberMe) {
147
147
  - **Python ast module**: Python AST analysis
148
148
  - **Roslyn** (.NET): C# AST analysis
149
149
 
150
- **Ứng dụng:**
150
+ **Application:**
151
151
  ```javascript
152
- // Detect function signature changes
152
+ # Detect function signature changes
153
153
  const ast = parse(sourceCode);
154
154
  ast.body.forEach(node => {
155
155
  if (node.type === 'FunctionDeclaration') {
@@ -163,8 +163,8 @@ ast.body.forEach(node => {
163
163
 
164
164
  ### 4. Static Analysis-Based Impact
165
165
 
166
- **Khái niệm:**
167
- Analyze code without executing để detect issues, dependencies, potential impacts.
166
+ **Concept:**
167
+ Analyze code without executing to detect issues, dependencies, and potential impacts.
168
168
 
169
169
  **Techniques:**
170
170
 
@@ -244,10 +244,10 @@ interface User {
244
244
 
245
245
  ### 5. Model-Based Impact Analysis
246
246
 
247
- **Khái niệm:**
248
- Sử dụng models (UML, architecture diagrams) để predict impact trước khi code.
247
+ **Concept:**
248
+ Use models (UML, architecture diagrams) to predict impact before coding.
249
249
 
250
- **Cách hoạt động:**
250
+ **How it works:**
251
251
  ```
252
252
  Architecture Model → Component Dependencies → Impact Prediction
253
253
  ```
@@ -272,10 +272,10 @@ Architecture Model → Component Dependencies → Impact Prediction
272
272
 
273
273
  ### 6. Test-Based Impact Analysis
274
274
 
275
- **Khái niệm:**
276
- Sử dụng test coverage để identify affected tests features.
275
+ **Concept:**
276
+ Use test coverage to identify affected tests and features.
277
277
 
278
- **Cách hoạt động:**
278
+ **How it works:**
279
279
  ```
280
280
  Code Change → Test Coverage Map → Affected Tests → Affected Features
281
281
  ```
@@ -299,7 +299,7 @@ Code Change → Test Coverage Map → Affected Tests → Affected Features
299
299
  - **JaCoCo**: Java code coverage
300
300
  - **Istanbul**: JavaScript coverage
301
301
 
302
- **Ứng dụng:**
302
+ **Application:**
303
303
  ```bash
304
304
  # Run tests with coverage
305
305
  npm test -- --coverage
@@ -315,10 +315,10 @@ jest --coverage --coverageReporters=html
315
315
 
316
316
  ### 7. Behavior-Driven Impact Analysis
317
317
 
318
- **Khái niệm:**
319
- Map code changes về user behaviors scenarios (BDD approach).
318
+ **Concept:**
319
+ Map code changes to user behaviors and scenarios (BDD approach).
320
320
 
321
- **Cách hoạt động:**
321
+ **How it works:**
322
322
  ```
323
323
  Code Change → Feature Mapping → User Scenarios → Test Scenarios
324
324
  ```
@@ -367,8 +367,8 @@ describe('Biometric Login', () => {
367
367
 
368
368
  ### 8. Feature Mapping Techniques
369
369
 
370
- **Khái niệm:**
371
- Map code files về features user actions.
370
+ **Concept:**
371
+ Map code files to features and user actions.
372
372
 
373
373
  **Techniques:**
374
374
 
@@ -423,10 +423,10 @@ export function login(email: string, password: string) {
423
423
 
424
424
  ### 9. Machine Learning-Based Impact Analysis
425
425
 
426
- **Khái niệm:**
427
- Sử dụng ML models để predict impact dựa trên historical data.
426
+ **Concept:**
427
+ Use ML models to predict impact based on historical data.
428
428
 
429
- **Cách hoạt động:**
429
+ **How it works:**
430
430
  ```
431
431
  Historical Changes + Outcomes → ML Model → Predict Impact
432
432
  ```
@@ -547,7 +547,7 @@ Code Change → Feature Impact → User Action Impact → Test Scenarios
547
547
 
548
548
  ### 4. Prioritize by Risk
549
549
 
550
- Sử dụng risk scoring:
550
+ Use risk scoring:
551
551
 
552
552
  ```javascript
553
553
  const riskScore =
@@ -14,8 +14,8 @@ Document này cung cấp:
14
14
 
15
15
  ## 🎯 Technique #1: Dependency Analysis (MUST HAVE)
16
16
 
17
- ### Mục Đích
18
- Tìm tất cả files bị ảnh hưởng bởi code changes.
17
+ ### Purpose
18
+ Find all files affected by code changes.
19
19
 
20
20
  ### Tools & Commands
21
21
 
@@ -23,7 +23,7 @@ Tìm tất cả files bị ảnh hưởng bởi code changes.
23
23
 
24
24
  **1. Find Direct Imports**
25
25
  ```bash
26
- # Tìm files import module đã sửa
26
+ # Find files importing modified module
27
27
  grep -r "from.*authService" src/ --include="*.ts" --include="*.tsx"
28
28
  grep -r "import.*authService" src/ --include="*.ts" --include="*.tsx"
29
29
 
@@ -33,7 +33,7 @@ rg "from.*authService" src/ -t ts -t tsx
33
33
 
34
34
  **2. Find Function Calls**
35
35
  ```bash
36
- # Tìm files gọi function đã sửa
36
+ # Find files calling modified function
37
37
  grep -r "login\(" src/ --include="*.ts" --include="*.tsx"
38
38
 
39
39
  # Exclude test files
@@ -57,7 +57,7 @@ madge src/services/authService.ts
57
57
 
58
58
  **4. Find API Consumers**
59
59
  ```bash
60
- # Tìm frontend components gọi API
60
+ # Find frontend components calling API
61
61
  grep -r "fetch.*\/api\/auth" src/
62
62
  grep -r "axios.*\/api\/auth" src/
63
63
  grep -r "\/api\/auth" src/ --include="*.ts" --include="*.tsx"
@@ -67,7 +67,7 @@ grep -r "\/api\/auth" src/ --include="*.ts" --include="*.tsx"
67
67
 
68
68
  **Find Component Usage**
69
69
  ```bash
70
- # Tìm components sử dụng component đã sửa
70
+ # Find components using modified component
71
71
  grep -r "<LoginButton" src/ --include="*.tsx"
72
72
  grep -r "LoginButton" src/ --include="*.tsx" | grep "import"
73
73
  ```
@@ -111,8 +111,8 @@ grep -r "login(" . --include="*.py"
111
111
 
112
112
  ## 🎯 Technique #2: AST-Based Analysis (NICE TO HAVE)
113
113
 
114
- ### Mục Đích
115
- Phát hiện semantic changes (function signature, type changes, breaking changes).
114
+ ### Purpose
115
+ Detect semantic changes (function signature, type changes, breaking changes).
116
116
 
117
117
  ### Tools & Setup
118
118
 
@@ -222,8 +222,8 @@ diff /tmp/before.json /tmp/after.json
222
222
 
223
223
  ## 🎯 Technique #3: Static Analysis (NICE TO HAVE)
224
224
 
225
- ### Mục Đích
226
- Phát hiện code quality issues, security issues, potential bugs.
225
+ ### Purpose
226
+ Detect code quality issues, security issues, and potential bugs.
227
227
 
228
228
  ### Tools
229
229
 
@@ -284,8 +284,8 @@ sonar-scanner \
284
284
 
285
285
  ## 🎯 Technique #4: Test Coverage Analysis (SHOULD HAVE)
286
286
 
287
- ### Mục Đích
288
- Tìm tests bị ảnh hưởng và identify untested code.
287
+ ### Purpose
288
+ Find affected tests and identify untested code.
289
289
 
290
290
  ### Tools & Commands
291
291
 
@@ -370,8 +370,8 @@ pytest --collect-only | grep auth_service
370
370
 
371
371
  ## 🎯 Technique #5: Feature Mapping (MUST HAVE)
372
372
 
373
- ### Mục Đích
374
- Map code changes về features user actions.
373
+ ### Purpose
374
+ Map code changes to features and user actions.
375
375
 
376
376
  ### Implementation
377
377
 
@@ -478,8 +478,8 @@ function mapFeatures(changedFiles) {
478
478
 
479
479
  ## 🎯 Technique #6: Risk Scoring (SHOULD HAVE)
480
480
 
481
- ### Mục Đích
482
- Đánh giá mức độ risk của changes.
481
+ ### Purpose
482
+ Assess risk level of changes.
483
483
 
484
484
  ### Algorithm
485
485
 
@@ -1,6 +1,6 @@
1
1
  # Project Detection - Auto-Adapt Impact Analysis
2
2
 
3
- Hệ thống tự động detect adapt Impact Analysis cho nhiều loại projects.
3
+ System to automatically detect and adapt Impact Analysis for different project types.
4
4
 
5
5
  ## Project Type Detection
6
6
 
@@ -1,6 +1,6 @@
1
- # Report Template - Mẫu Báo Cáo Impact Analysis
1
+ # Report Template - Impact Analysis Report Template
2
2
 
3
- Template chuẩn cho báo cáo phân tích tác động và hướng dẫn test.
3
+ Standard template for impact analysis reports and test guidance.
4
4
 
5
5
  ## Full Report Template
6
6
 
@@ -1,15 +1,15 @@
1
1
  # Impact Analysis Scripts
2
2
 
3
- Helper scripts để thực hiện advanced impact analysis techniques.
3
+ Helper scripts for performing advanced impact analysis techniques.
4
4
 
5
5
  ## 📋 Overview
6
6
 
7
- Các scripts này implement industry techniques từ `references/industry-techniques.md`:
7
+ These scripts implement industry techniques from `references/industry-techniques.md`:
8
8
 
9
9
  1. **ast-analyze.js** - AST-based analysis (Technique #3)
10
10
  2. **find-dependencies.sh** - Dependency analysis (Technique #2)
11
11
  3. **calculate-risk.js** - Risk scoring (Technique #6)
12
- 4. **run-analysis.sh** - Master script chạy tất cả
12
+ 4. **run-analysis.sh** - Master script that runs all
13
13
 
14
14
  ## 🚀 Quick Start
15
15