moicle 1.3.1 → 1.4.0

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.
@@ -10,16 +10,16 @@ Automated workflow that reads codebase and existing docs to generate a complete,
10
10
  ## Workflow Overview
11
11
 
12
12
  ```
13
- ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐
14
- │ 1. SCAN │──▶│2. GENERATE──▶│ 3. REVIEW │──▶│4. COMPLETE│
15
- └──────────┘ └──────────┘ └──────────┘ └──────────┘
16
- ▲ │
17
- │ Feedback │
18
- └──────────────┘
19
- (loop until pass)
13
+ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐
14
+ │ 1. SCAN │──▶│1.5 CONFIRM──▶│2. GENERATE──▶│ 3. REVIEW │──▶│4. COMPLETE│
15
+ └──────────┘ └──────────┘ └──────────┘ └──────────┘ └──────────┘
16
+ ▲ │
17
+ │ Feedback │
18
+ └──────────────┘
19
+ (loop until pass)
20
20
  ```
21
21
 
22
- **Key**: Phase 3 REVIEW automatically loops back to Phase 2 GENERATE if issues are found. The loop continues until all checks pass.
22
+ **Key**: Phase 1.5 CONFIRM asks user to choose between REFACTOR (full restructure) or UPDATE (keep structure, update & link only). Phase 3 REVIEW automatically loops back to Phase 2 GENERATE if issues are found.
23
23
 
24
24
  ---
25
25
 
@@ -89,7 +89,7 @@ Automated workflow that reads codebase and existing docs to generate a complete,
89
89
 
90
90
  ### Docs Output Plan
91
91
  - docs/README.md (index)
92
- - docs/business.md (business overview - ngôn ngữ nghiệp vụ, không technical)
92
+ - docs/business.md (business overview - non-technical, business language only)
93
93
  - docs/architecture.md
94
94
  - docs/use-cases/[usecase-name].md (per use case)
95
95
  - docs/diagrams/ (embedded in use case files via mermaid)
@@ -103,16 +103,57 @@ Automated workflow that reads codebase and existing docs to generate a complete,
103
103
 
104
104
  ---
105
105
 
106
+ ## Phase 1.5: CONFIRM
107
+
108
+ **Goal**: Ask the user how they want to handle docs before generating.
109
+
110
+ ### Actions
111
+
112
+ 1. **Present scan results** from Phase 1 to the user (current structure, identified use cases, docs plan)
113
+
114
+ 2. **Ask the user**:
115
+ ```
116
+ How would you like to proceed with the docs?
117
+
118
+ 1. Refactor - Restructure docs into the standard template (docs/README.md, business.md, architecture.md, use-cases/) and relink everything
119
+ 2. Update & Link only - Keep the current docs structure as-is, only update content and fix linking
120
+
121
+ (Choose 1 or 2)
122
+ ```
123
+
124
+ 3. **Based on the choice, set the mode for Phase 2**:
125
+ - **REFACTOR mode (choice 1)**: Run Phase 2 GENERATE in full - create new structure, migrate useful content from old docs into the new template, remove/replace old doc files that are no longer needed
126
+ - **UPDATE mode (choice 2)**: Run Phase 2 in update-only mode - preserve existing file/folder structure, only update content inside existing files to match current code, add/fix links between files, add mermaid diagrams where missing, DO NOT move/rename/delete existing files
127
+
128
+ ### Gate
129
+ - [ ] User has chosen a mode (REFACTOR or UPDATE)
130
+ - [ ] Mode is recorded for Phase 2 to handle accordingly
131
+
132
+ ---
133
+
106
134
  ## Phase 2: GENERATE
107
135
 
108
- **Goal**: Generate all documentation files with proper structure
136
+ **Goal**: Generate all documentation files based on the selected mode from Phase 1.5
137
+
138
+ ### Mode Selection
139
+
140
+ - **REFACTOR mode**: Create an entirely new docs structure following the template below. If old docs exist, migrate useful content into the new structure. May remove/replace old files.
141
+ - **UPDATE mode**: Preserve the existing file/folder structure. Only perform:
142
+ - Update content in existing doc files to match current code
143
+ - Add/fix links between files (relative links)
144
+ - Add mermaid diagrams to existing files where missing
145
+ - Add new files ONLY when there are undocumented use cases/features
146
+ - DO NOT move, rename, or delete existing files
147
+ - Ensure there is 1 index file (README.md or existing index) linking to all docs
148
+
149
+ > **The templates below apply fully to REFACTOR mode. For UPDATE mode, use them as content/format reference only — do NOT force the structure.**
109
150
 
110
151
  ### Output Structure
111
152
 
112
153
  ```
113
154
  docs/
114
155
  ├── README.md # Index - links to all sub-files
115
- ├── business.md # Business overview - ngôn ngữ nghiệp vụ, không technical
156
+ ├── business.md # Business overview - non-technical, business language only
116
157
  ├── architecture.md # Architecture overview + system diagram
117
158
  └── use-cases/
118
159
  ├── [use-case-1].md # Use case doc + sequence diagram
@@ -134,7 +175,7 @@ docs/
134
175
  ## Table of Contents
135
176
 
136
177
  ### Business
137
- - [Business Overview](./business.md) - Tổng quan nghiệp vụ, mục tiêu, đối tượng sử dụng
178
+ - [Business Overview](./business.md) - Business overview, goals, target users
138
179
 
139
180
  ### Architecture
140
181
  - [Architecture Overview](./architecture.md) - System architecture, layers, and patterns
@@ -162,84 +203,84 @@ docs/
162
203
 
163
204
  ### 2.2 Generate `docs/business.md` (Business Overview)
164
205
 
165
- File này viết hoàn toàn bằng ngôn ngữ nghiệp vụ. KHÔNG chứa code, KHÔNG chứa tên class/function, KHÔNG chứa thuật ngữ technical. Đối tượng đọc là stakeholder, product owner, business analyst - những người không cần biết code.
206
+ This file is written entirely in business language. NO code, NO class/function names, NO technical jargon. Target audience: stakeholders, product owners, business analysts - people who don't need to know the code.
166
207
 
167
208
  ```markdown
168
- # [Project Name] - Tổng Quan Nghiệp Vụ
209
+ # [Project Name] - Business Overview
169
210
 
170
- ## Sản phẩm gì?
211
+ ## What is this product?
171
212
 
172
- [2-3 đoạn tả sản phẩm bằng ngôn ngữ thường ngày. Giải thích sản phẩm giải quyết vấn đề gì, cho ai, tại sao cần nó.]
213
+ [2-3 paragraphs describing the product in everyday language. Explain what problem it solves, for whom, and why it's needed.]
173
214
 
174
- ## Đối tượng sử dụng
215
+ ## Target Users
175
216
 
176
- ### [Vai trò 1] - dụ: Người dùng cuối
177
- - **Là ai**: [mô tả]
178
- - **Nhu cầu**: [họ cần từ sản phẩm]
179
- - **Họ làm gì trên hệ thống**: [các hành động chính]
217
+ ### [Role 1] - e.g., End User
218
+ - **Who**: [description]
219
+ - **Needs**: [what they need from the product]
220
+ - **What they do**: [key actions on the system]
180
221
 
181
- ### [Vai trò 2] - dụ: Quản trị viên
182
- - **Là ai**: [mô tả]
183
- - **Nhu cầu**: [họ cần ]
184
- - **Họ làm gì trên hệ thống**: [các hành động chính]
222
+ ### [Role 2] - e.g., Administrator
223
+ - **Who**: [description]
224
+ - **Needs**: [what they need]
225
+ - **What they do**: [key actions on the system]
185
226
 
186
- ## Quy trình nghiệp vụ chính
227
+ ## Core Business Processes
187
228
 
188
- ### [Quy trình 1] - dụ: Đăng và sử dụng lần đầu
189
- [ tả từng bước quy trình từ góc nhìn người dùng. Không đề cập API, database hay bất kỳ chi tiết kỹ thuật nào.]
229
+ ### [Process 1] - e.g., Registration and first-time use
230
+ [Describe each step from the user's perspective. No mention of API, database, or any technical details.]
190
231
 
191
- 1. [Bước 1 - người dùng làm ]
192
- 2. [Bước 2 - hệ thống phản hồi gì]
193
- 3. [Bước N]
232
+ 1. [Step 1 - what the user does]
233
+ 2. [Step 2 - how the system responds]
234
+ 3. [Step N]
194
235
 
195
- ### [Quy trình 2] - dụ: Đặt hàng
196
- [Tương tự - tả từ góc nhìn nghiệp vụ]
236
+ ### [Process 2] - e.g., Placing an order
237
+ [Same approach - describe from a business perspective]
197
238
 
198
- ## Các tính năng chính
239
+ ## Key Features
199
240
 
200
- | Tính năng | tả | Ai sử dụng |
201
- |-----------|--------|-------------|
202
- | [Tính năng 1] | [giải thích bằng ngôn ngữ nghiệp vụ] | [vai trò] |
203
- | [Tính năng 2] | [giải thích] | [vai trò] |
241
+ | Feature | Description | Used by |
242
+ |---------|-------------|---------|
243
+ | [Feature 1] | [explain in business language] | [role] |
244
+ | [Feature 2] | [explain] | [role] |
204
245
 
205
- ## Quy tắc nghiệp vụ
246
+ ## Business Rules
206
247
 
207
- Các quy tắc quan trọng mà hệ thống tuân theo:
248
+ Key rules the system follows:
208
249
 
209
- 1. **[Quy tắc 1]**: [giải thích - dụ: "Mỗi đơn hàng phải ít nhất 1 sản phẩm"]
210
- 2. **[Quy tắc 2]**: [giải thích - dụ: "Người dùng chỉ được hoàn trả trong vòng 7 ngày"]
211
- 3. **[Quy tắc N]**: [giải thích]
250
+ 1. **[Rule 1]**: [explain - e.g., "Every order must contain at least 1 product"]
251
+ 2. **[Rule 2]**: [explain - e.g., "Users can only request a refund within 7 days"]
252
+ 3. **[Rule N]**: [explain]
212
253
 
213
- ## Mối quan hệ giữa các đối tượng nghiệp vụ
254
+ ## Business Entity Relationships
214
255
 
215
- [ tả bằng text các mối quan hệ chính, ví dụ:]
216
- - Một **khách hàng** thể tạo nhiều **đơn hàng**
217
- - Một **đơn hàng** chứa nhiều **sản phẩm**
218
- - Một **sản phẩm** thuộc về một **danh mục**
256
+ [Describe key relationships in plain text, e.g.:]
257
+ - A **customer** can create multiple **orders**
258
+ - An **order** contains multiple **products**
259
+ - A **product** belongs to a **category**
219
260
 
220
- ## Luồng giá trị (Value Flow)
261
+ ## Value Flow
221
262
 
222
- [ tả cách sản phẩm tạo ra giá trị cho từng đối tượng:]
263
+ [Describe how the product creates value for each stakeholder:]
223
264
 
224
- - **Đối với [vai trò 1]**: [giá trị họ nhận được]
225
- - **Đối với [vai trò 2]**: [giá trị họ nhận được]
226
- - **Đối với doanh nghiệp**: [giá trị business nhận được]
265
+ - **For [role 1]**: [value they receive]
266
+ - **For [role 2]**: [value they receive]
267
+ - **For the business**: [value the business receives]
227
268
 
228
- ## Thuật ngữ nghiệp vụ (Glossary)
269
+ ## Business Glossary
229
270
 
230
- | Thuật ngữ | Định nghĩa |
231
- |-----------|------------|
232
- | [Thuật ngữ 1] | [giải thích trong ngữ cảnh sản phẩm] |
233
- | [Thuật ngữ 2] | [giải thích] |
271
+ | Term | Definition |
272
+ |------|-----------|
273
+ | [Term 1] | [explain in the product's context] |
274
+ | [Term 2] | [explain] |
234
275
  ```
235
276
 
236
- **QUAN TRỌNG khi viết business.md**:
237
- - KHÔNG dùng từ: API, endpoint, database, repository, controller, service, model, schema, query, migration, route, middleware, component, module, class, function, method, interface, type
238
- - KHÔNG code block nào
239
- - KHÔNG reference file path hay tên file code
240
- - Viết như đang giải thích cho người không biết lập trình
241
- - Dùng ngôn ngữ business domain của project ( dụ: "đơn hàng" thay "Order entity", "người dùng" thay "User model")
242
- - Extract business rules từ code logic (validation, conditions, constraints) diễn đạt bằng ngôn ngữ nghiệp vụ
277
+ **IMPORTANT rules for business.md**:
278
+ - DO NOT use words like: API, endpoint, database, repository, controller, service, model, schema, query, migration, route, middleware, component, module, class, function, method, interface, type
279
+ - NO code blocks whatsoever
280
+ - NO file path references or code file names
281
+ - Write as if explaining to someone who doesn't know programming
282
+ - Use the project's business domain language (e.g., "order" instead of "Order entity", "user" instead of "User model")
283
+ - Extract business rules from code logic (validation, conditions, constraints) and express them in business language
243
284
 
244
285
  ### 2.3 Generate `docs/architecture.md` (Technical)
245
286
 
@@ -382,12 +423,12 @@ Run through ALL checks below. If ANY check fails, fix and re-check.
382
423
  - [ ] All relative links in README.md point to existing files
383
424
 
384
425
  #### 3.2 Business Check
385
- - [ ] `docs/business.md` chứa KHÔNG thuật ngữ technical (API, endpoint, database, repository, controller, service, model, schema, query, migration, route, middleware, component, module, class, function, method, interface, type)
386
- - [ ] `docs/business.md` KHÔNG code block nào
387
- - [ ] `docs/business.md` KHÔNG reference file path
388
- - [ ] Quy trình nghiệp vụ được tả đầy đủ từ góc nhìn người dùng
389
- - [ ] Quy tắc nghiệp vụ được extract đúng từ logic trong code
390
- - [ ] Glossary đầy đủ thuật ngữ domain
426
+ - [ ] `docs/business.md` contains NO technical jargon (API, endpoint, database, repository, controller, service, model, schema, query, migration, route, middleware, component, module, class, function, method, interface, type)
427
+ - [ ] `docs/business.md` has NO code blocks
428
+ - [ ] `docs/business.md` does NOT reference file paths
429
+ - [ ] Business processes are fully described from the user's perspective
430
+ - [ ] Business rules are correctly extracted from code logic
431
+ - [ ] Glossary contains all domain-specific terms
391
432
 
392
433
  #### 3.3 Content Check
393
434
  - [ ] Architecture diagram reflects actual codebase layers
@@ -517,14 +558,14 @@ docs/
517
558
 
518
559
  ### Review Loop
519
560
  ```
520
- Generate → Review → Pass? → Complete
521
- → Fail? → Fix → Review again (max 3x)
561
+ Scan → Confirm (Refactor/Update?) → Generate → Review → Pass? → Complete
562
+ → Fail? → Fix → Review again (max 3x)
522
563
  ```
523
564
 
524
565
  ## Success Criteria
525
566
 
526
567
  Documentation sync is complete when:
527
- 1. Business overview viết hoàn toàn bằng ngôn ngữ nghiệp vụ, không technical
568
+ 1. Business overview written entirely in business language, no technical jargon
528
569
  2. All codebase features are documented as use cases
529
570
  3. Architecture accurately reflects codebase
530
571
  4. Every use case has a sequence diagram