ai-developer-skill-os 9.1.0 → 9.1.2

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 (39) hide show
  1. package/.agents/AGENTS.md +7 -7
  2. package/.agents/registry/graph.json +50 -34
  3. package/.agents/registry/index.yaml +41 -33
  4. package/.agents/rules/global.md +1 -1
  5. package/.agents/skills/_template/SKILL.md +154 -0
  6. package/.agents/skills/qk-access-policy/SKILL.md +160 -0
  7. package/.agents/skills/qk-agent-observability/SKILL.md +160 -0
  8. package/.agents/skills/qk-ai-builder/SKILL.md +160 -0
  9. package/.agents/skills/qk-api-lifecycle/SKILL.md +160 -0
  10. package/.agents/skills/qk-bug-resolution/SKILL.md +160 -0
  11. package/.agents/skills/qk-code-review/SKILL.md +160 -0
  12. package/.agents/skills/qk-context-loader/SKILL.md +160 -0
  13. package/.agents/skills/qk-data-engineer/SKILL.md +474 -0
  14. package/.agents/skills/qk-data-lifecycle/SKILL.md +160 -0
  15. package/.agents/skills/qk-db-optimizer/SKILL.md +160 -0
  16. package/.agents/skills/qk-design-system-engineering/SKILL.md +160 -0
  17. package/.agents/skills/qk-devops-platform/SKILL.md +160 -0
  18. package/.agents/skills/qk-docs/SKILL.md +160 -0
  19. package/.agents/skills/qk-engineering-standard/SKILL.md +160 -0
  20. package/.agents/skills/qk-fe-api-integration/SKILL.md +160 -0
  21. package/.agents/skills/qk-feature-delivery/SKILL.md +160 -0
  22. package/.agents/skills/qk-frontend-architecture/SKILL.md +160 -0
  23. package/.agents/skills/qk-orchestrator/SKILL.md +160 -0
  24. package/.agents/skills/qk-product-specification/SKILL.md +160 -0
  25. package/.agents/skills/qk-production-release/SKILL.md +160 -0
  26. package/.agents/skills/qk-project-bootstrap/SKILL.md +421 -367
  27. package/.agents/skills/qk-project-health/SKILL.md +160 -0
  28. package/.agents/skills/qk-project-memory/SKILL.md +13 -17
  29. package/.agents/skills/qk-refactor/SKILL.md +160 -0
  30. package/.agents/skills/qk-security-audit/SKILL.md +160 -0
  31. package/.agents/skills/qk-system-evolution/SKILL.md +160 -0
  32. package/.agents/skills/qk-test-engineering/SKILL.md +160 -0
  33. package/.agents/skills/qk-ui-audit/SKILL.md +160 -0
  34. package/.agents/skills/qk-ui-system-builder/SKILL.md +160 -0
  35. package/.agents/skills/qk-validation-gate/SKILL.md +160 -0
  36. package/.agents/skills/qk-web-quality-gate/SKILL.md +160 -0
  37. package/README.md +10 -10
  38. package/package.json +1 -1
  39. package/tooling/sync-versions.js +10 -6
@@ -1,99 +1,105 @@
1
- ---
2
- # ── Identity ───────────────────────────────────────────────
3
- name: qk-project-bootstrap
4
- version: 9.1.0
5
- status: stable
6
- description: "Khởi tạo dự án mới theo chuẩn V8.2 Blueprint Plugin Generator (project.yaml, 4-folder AI RAG hoặc Coding) với cấu trúc kiên cường."
7
- platforms: [antigravity, claude-code, cursor, windsurf, kilo-code]
8
-
9
- # ── V9: Classification ─────────────────────────────────────
10
- type: capability
11
-
12
- intent:
13
- - project-initialization
14
- - setup
15
-
16
- complexity:
17
- level: high
18
- criteria:
19
- files_affected: "10+"
20
- has_behavior_change: true
21
- has_external_dependency: true
22
- has_breaking_change: false
23
-
24
- triggers:
25
- - "khởi tạo project"
26
- - "tạo dự án mới"
27
- - "bootstrap"
28
- - "setup project"
29
- - "init repo"
30
-
31
- # ── V8: References ─────────────────────────────────────────
32
- workflow: feature-delivery
33
-
34
- rules:
35
- - global
36
- - safety
37
- - filesystem-boundary
38
-
39
- tools:
40
- - filesystem
41
- - terminal
42
-
43
- related_skills:
44
- - qk-engineering-standard
45
-
46
- knowledge_scope:
47
- owns:
48
- - project-structure
49
- - initial-setup
50
- references:
51
- - architecture
52
- - security
53
- - anti-patterns
54
-
55
- # ── V8: Verification ───────────────────────────────────────
56
- verification:
57
- required: true
58
- strategy: bootstrap-validation
59
-
60
- selection:
61
- priority: medium
62
- confidence_threshold: 0.85
63
-
64
- examples: []
65
- learnings: []
66
-
67
- # ── V7 Runtime ─────────────────────────────────────────────
68
- execution_mode: deterministic
69
- cost: high
70
- latency: slow
71
- risk: low
72
- side_effects: edit_files
73
- produces: [code, schema, plan]
74
- consumes: [user-description]
75
-
76
- token_budget:
77
- max_files_read: 1
78
- max_lines_per_read: 50
79
- max_shell_commands: 2
80
- stop_early: true
81
-
82
- exit_codes: [SUCCESS, BLOCKED, FAILED, PARTIAL]
83
- ---
84
-
85
- # qk-project-bootstrap — Project Foundation Builder
86
-
87
- > **Language rule:** Code, identifiers, file names → English. Explanations, summaries → Vietnamese.
88
-
89
- ---
90
-
1
+ ---
2
+ # ── Identity ───────────────────────────────────────────────
3
+ name: qk-project-bootstrap
4
+ version: 9.1.0
5
+ status: stable
6
+ description: "Khởi tạo dự án mới theo chuẩn V8.2 Blueprint Plugin Generator (project.yaml, 4-folder AI RAG hoặc Coding) với cấu trúc kiên cường."
7
+ platforms: [antigravity, claude-code, cursor, windsurf, kilo-code]
8
+
9
+ # ── V9: Classification ─────────────────────────────────────
10
+ type: capability
11
+
12
+ intent:
13
+ - project-initialization
14
+ - setup
15
+
16
+ complexity:
17
+ level: high
18
+ criteria:
19
+ files_affected: "10+"
20
+ has_behavior_change: true
21
+ has_external_dependency: true
22
+ has_breaking_change: false
23
+
24
+ triggers:
25
+ - "khởi tạo project"
26
+ - "tạo dự án mới"
27
+ - "bootstrap"
28
+ - "setup project"
29
+ - "init repo"
30
+
31
+ # ── V8: References ─────────────────────────────────────────
32
+ workflow: feature-delivery
33
+
34
+ rules:
35
+ - global
36
+ - safety
37
+ - filesystem-boundary
38
+
39
+ tools:
40
+ - filesystem
41
+ - terminal
42
+
43
+ related_skills:
44
+ - qk-engineering-standard
45
+
46
+ knowledge_scope:
47
+ owns:
48
+ - project-structure
49
+ - initial-setup
50
+ references:
51
+ - architecture
52
+ - security
53
+ - anti-patterns
54
+
55
+ # ── V8: Verification ───────────────────────────────────────
56
+ verification:
57
+ required: true
58
+ strategy: bootstrap-validation
59
+
60
+ selection:
61
+ priority: medium
62
+ confidence_threshold: 0.85
63
+
64
+ examples: []
65
+ learnings: []
66
+
67
+ # ── V7 Runtime ─────────────────────────────────────────────
68
+ execution_mode: deterministic
69
+ cost: high
70
+ latency: slow
71
+ risk: low
72
+ side_effects: edit_files
73
+ produces: [code, schema, plan]
74
+ consumes: [user-description]
75
+
76
+ token_budget:
77
+ max_files_read: 1
78
+ max_lines_per_read: 50
79
+ max_shell_commands: 2
80
+ stop_early: true
81
+
82
+ exit_codes: [SUCCESS, BLOCKED, FAILED, PARTIAL]
83
+ ---
84
+
85
+ # qk-project-bootstrap — Project Foundation Builder
86
+
87
+ > **Language rule:** Code, identifiers, file names → English. Explanations, summaries → Vietnamese.
88
+
89
+ ---
90
+
91
91
  ## Memory Workflow
92
92
 
93
+ ### 0. Self-Init Protocol (Khởi Tạo Bộ Nhớ Local & Gitignore)
94
+ - Trước khi tra cứu hoặc lưu trữ tri thức, BẮT BUỘC kiểm tra sự tồn tại của thư mục `.ai-local/` tại gốc dự án:
95
+ - **Tự động tạo mới:** Nếu `.ai-local/` chưa tồn tại, AI phải tự động tạo cấu trúc thư mục `.ai-local/knowledge/` (và file `index.yaml` nếu cần thiết) cùng `.ai-local/candidates/`. Tuyệt đối không ngưng chạy hay hỏi ý kiến người dùng về thao tác khởi tạo tiêu chuẩn này.
96
+ - **Bảo mật Gitignore:** BẮT BUỘC kiểm tra file `.gitignore` của dự án, nếu chưa có dòng `.ai-local/` thì phải tự động thêm vào để tuyệt đối bảo mật tri thức cá nhân và tránh lộ lọt lên Git.
97
+
98
+ ---
99
+
93
100
  ### Pre-flight Retrieve (Trước khi thực thi)
94
101
  - Trước các task có tính lặp lại, debug, refactor, kiến trúc hoặc rủi ro cao:
95
102
  bắt buộc tra cứu:
96
- - `.agents/knowledge/index.yaml` (Shared Project Knowledge)
97
103
  - `.ai-local/knowledge/index.yaml` (Private Local Knowledge)
98
104
 
99
105
  - Ưu tiên sử dụng các Knowledge đang có trạng thái `Active` thuộc:
@@ -136,7 +142,7 @@ Sau khi hoàn thành task:
136
142
  - Chỉ sau khi được phê duyệt, Candidate Memory mới được chuyển thành Knowledge chính thức:
137
143
 
138
144
  ```
139
- .ai-local/candidates/ ──(Approve)──> .agents/knowledge/index.yaml
145
+ .ai-local/candidates/ ──(Approve)──> .ai-local/knowledge/index.yaml
140
146
  ```
141
147
 
142
148
  - Project Knowledge phải được xem như tài sản kỹ thuật của dự án:
@@ -161,6 +167,33 @@ Không lưu:
161
167
  > **AI quan sát → Đề xuất → Con người phê duyệt → Dự án tiến hóa.**
162
168
 
163
169
  ---
170
+
171
+
172
+
173
+ ### 0. Self-Init Protocol (Khởi Tạo Bộ Nhớ Local & Gitignore)
174
+ - Trước khi tra cứu hoặc lưu trữ tri thức, BẮT BUỘC kiểm tra sự tồn tại của thư mục `.ai-local/` tại gốc dự án:
175
+ - **Tự động tạo mới:** Nếu `.ai-local/` chưa tồn tại, AI phải tự động tạo cấu trúc thư mục `.ai-local/knowledge/` (và file `index.yaml` nếu cần thiết) cùng `.ai-local/candidates/`. Tuyệt đối không ngưng chạy hay hỏi ý kiến người dùng về thao tác khởi tạo tiêu chuẩn này.
176
+ - **Bảo mật Gitignore:** BẮT BUỘC kiểm tra file `.gitignore` của dự án, nếu chưa có dòng `.ai-local/` thì phải tự động thêm vào để tuyệt đối bảo mật tri thức cá nhân và tránh lộ lọt lên Git.
177
+
178
+ ---
179
+
180
+ ### Pre-flight Retrieve (Trước khi thực thi)
181
+ - Trước các task có tính lặp lại, debug, refactor, kiến trúc hoặc rủi ro cao:
182
+ bắt buộc tra cứu:
183
+ - `.ai-local/knowledge/index.yaml` (Private Local Knowledge)
184
+
185
+ - Ưu tiên sử dụng các Knowledge đang có trạng thái `Active` thuộc:
186
+ - Architecture
187
+ - Hard Bug
188
+ - Convention
189
+ - Pattern
190
+ - Tech Debt Pattern
191
+ - 👉 *Domain Focus:* Architecture / Convention (vd: mô hình 4-folder RAG/Agent, blueprint quy chuẩn V9).
192
+
193
+ - Memory chỉ đóng vai trò **Navigator (bản đồ chỉ đường)**.
194
+ Không được xem Memory là Source of Truth.
195
+ Luôn xác minh lại bằng source code, configuration và trạng thái hiện tại của dự án trước khi áp dụng.
196
+
164
197
  ---
165
198
 
166
199
  ### Learning Flow (AI tự học có kiểm soát)
@@ -189,7 +222,7 @@ Sau khi hoàn thành task:
189
222
  - Chỉ sau khi được phê duyệt, Candidate Memory mới được chuyển thành Knowledge chính thức:
190
223
 
191
224
  ```
192
- .ai-local/candidates/ ──(Approve)──> .agents/knowledge/index.yaml
225
+ .ai-local/candidates/ ──(Approve)──> .ai-local/knowledge/index.yaml
193
226
  ```
194
227
 
195
228
  - Project Knowledge phải được xem như tài sản kỹ thuật của dự án:
@@ -214,6 +247,33 @@ Không lưu:
214
247
  > **AI quan sát → Đề xuất → Con người phê duyệt → Dự án tiến hóa.**
215
248
 
216
249
  ---
250
+
251
+
252
+
253
+ ### 0. Self-Init Protocol (Khởi Tạo Bộ Nhớ Local & Gitignore)
254
+ - Trước khi tra cứu hoặc lưu trữ tri thức, BẮT BUỘC kiểm tra sự tồn tại của thư mục `.ai-local/` tại gốc dự án:
255
+ - **Tự động tạo mới:** Nếu `.ai-local/` chưa tồn tại, AI phải tự động tạo cấu trúc thư mục `.ai-local/knowledge/` (và file `index.yaml` nếu cần thiết) cùng `.ai-local/candidates/`. Tuyệt đối không ngưng chạy hay hỏi ý kiến người dùng về thao tác khởi tạo tiêu chuẩn này.
256
+ - **Bảo mật Gitignore:** BẮT BUỘC kiểm tra file `.gitignore` của dự án, nếu chưa có dòng `.ai-local/` thì phải tự động thêm vào để tuyệt đối bảo mật tri thức cá nhân và tránh lộ lọt lên Git.
257
+
258
+ ---
259
+
260
+ ### Pre-flight Retrieve (Trước khi thực thi)
261
+ - Trước các task có tính lặp lại, debug, refactor, kiến trúc hoặc rủi ro cao:
262
+ bắt buộc tra cứu:
263
+ - `.ai-local/knowledge/index.yaml` (Private Local Knowledge)
264
+
265
+ - Ưu tiên sử dụng các Knowledge đang có trạng thái `Active` thuộc:
266
+ - Architecture
267
+ - Hard Bug
268
+ - Convention
269
+ - Pattern
270
+ - Tech Debt Pattern
271
+ - 👉 *Domain Focus:* Architecture / Convention (vd: mô hình 4-folder RAG/Agent, blueprint quy chuẩn V9).
272
+
273
+ - Memory chỉ đóng vai trò **Navigator (bản đồ chỉ đường)**.
274
+ Không được xem Memory là Source of Truth.
275
+ Luôn xác minh lại bằng source code, configuration và trạng thái hiện tại của dự án trước khi áp dụng.
276
+
217
277
  ---
218
278
 
219
279
  ### Learning Flow (AI tự học có kiểm soát)
@@ -242,7 +302,7 @@ Sau khi hoàn thành task:
242
302
  - Chỉ sau khi được phê duyệt, Candidate Memory mới được chuyển thành Knowledge chính thức:
243
303
 
244
304
  ```
245
- .ai-local/candidates/ ──(Approve)──> .agents/knowledge/index.yaml
305
+ .ai-local/candidates/ ──(Approve)──> .ai-local/knowledge/index.yaml
246
306
  ```
247
307
 
248
308
  - Project Knowledge phải được xem như tài sản kỹ thuật của dự án:
@@ -267,280 +327,274 @@ Không lưu:
267
327
  > **AI quan sát → Đề xuất → Con người phê duyệt → Dự án tiến hóa.**
268
328
 
269
329
  ---
330
+
331
+ ## Preconditions
332
+ - [ ] Framework/language preference is stated (or ask before proceeding)
333
+ - [ ] Project purpose is clear (web app, API, CLI, library)
334
+
335
+ ```
336
+ On missing precondition:
337
+ EXIT: BLOCKED
338
+ Message: "Vui lòng cho biết: framework (React/Next.js/NestJS/Express...) và mục đích dự án."
339
+ ```
340
+
270
341
  ---
342
+
343
+ ## Scope & V8.2 Blueprint Generator
344
+ - ✅ **One-Click Blueprint Selection:** Choose from Blueprint Plugins (`coding`, `rag`, `workflow`, `enterprise`).
345
+ - ✅ **Generate `project.yaml`:** Copy appropriate manifest from `.agents/blueprints/<type>/project.yaml.tpl` to workspace root.
346
+ - ✅ **Initialize Project Scaffolding:** Create standard directory structure (including the **4-Folder RAG Architecture** for AI projects).
347
+ - ✅ **Initialize Project Knowledge V1:** Setup Local Private Memory architecture (`.ai-local/` directory with automatic `.gitignore` entry included by default) containing concise `AGENTS.md` (<100 lines) and `knowledge/index.yaml` (4 core types: Architecture, Convention, Pattern, Hard Bug).
348
+ - ✅ **Configure Tooling:** Linter, Prettier, TypeScript strict mode, or Python environment depending on stack.
349
+ - ✅ **Generate `DESIGN.md`:** Mandatory brand & token contract for any UI project.
350
+
351
+ ## Non-Goals
352
+ - ❌ Skip `project.yaml` workspace manifest initialization
353
+ - ❌ Skip Project Knowledge V1 (`AGENTS.md` & `index.yaml` memory setup in `.ai-local/`)
354
+ - ❌ Skip DESIGN.md for UI projects
355
+ - ❌ Hardcode outdated dependency versions or absolute machine disk paths
356
+ - ❌ Skip README or documentation
357
+
271
358
  ---
359
+
360
+ ## V8.2 Blueprint Plugins & Directory Structures
361
+
362
+ ### 1. RAG & AI Agents (The 4-Folder Architecture Blueprint)
363
+ *Activated when building AI agents, RAG engines, or domain automation.*
364
+ ```text
365
+ project.yaml # ⭐ V8.2 Workspace Manifest (Profiles & Capabilities)
366
+ .ai-local/ # ⭐ V1 Private Project Memory (Self-Init & Gitignored by default)
367
+ ├── AGENTS.md # Project roadmap & quick actions (<100 lines)
368
+ └── knowledge/
369
+ └── index.yaml # Architecture, Convention, Pattern & Hard Bug repository
370
+ prompts/ # Prompt instructions managed as code
371
+ ├── system/
372
+ ├── tasks/
373
+ └── tools/
374
+ data/ # Strict data discipline
375
+ ├── raw/ # IMMUTABLE original files (PDFs, Excel, Revit/CAD)
376
+ └── processed/ # Cleaned, standardized chunks for AI ingestion
377
+ agents/ # Agent configurations and domain micro-skills
378
+ ├── skills/
379
+ └── tools/
380
+ evals/ # Quantitative validation evidence
381
+ ├── tests/
382
+ ├── traces/ # Audit execution traces
383
+ └── scorecards/ # scorecard.yaml eval rubrics
384
+ ```
385
+
386
+ ### 2. Standard Coding Workspaces (Next.js / React / Node)
387
+ *Activated when developing software applications or UI components.*
388
+ ```text
389
+ project.yaml # ⭐ V8.2 Workspace Manifest
390
+ .ai-local/ # ⭐ V1 Private Project Memory (Self-Init & Gitignored by default)
391
+ ├── AGENTS.md # Project roadmap & quick actions (<100 lines)
392
+ └── knowledge/
393
+ └── index.yaml # Architecture, Convention, Pattern & Hard Bug repository
394
+ src/
395
+ ├── app/ # Pages or App Router
396
+ ├── components/ # Shared UI components & Design system primitives
397
+ ├── hooks/
398
+ ├── lib/
399
+ ├── services/ # API integration & State stores
400
+ ├── types/
401
+ └── styles/
402
+ DESIGN.md # Brand & Design Contract
403
+ ```
404
+
405
+ ### 3. Automation Workflows (n8n & Data ETL)
406
+ ```text
407
+ project.yaml # ⭐ V8.2 Workspace Manifest
408
+ .ai-local/ # ⭐ V1 Private Project Memory (Self-Init & Gitignored by default)
409
+ workflows/ # Automation graphs & JSON blueprints
410
+ connectors/ # API & Database integrations
411
+ pipelines/ # Transformation scripts
412
+ evals/ # Traceability logs
413
+ ```
414
+
415
+ ---
416
+
417
+ ## Required Files Checklist
418
+ ```
419
+ [ ] project.yaml — V8.2 Machine-readable Workspace Manifest
420
+ [ ] .ai-local/AGENTS.md — V1 Project Architecture Navigator (<100 lines)
421
+ [ ] .ai-local/knowledge/index.yaml — V1 Actionable Knowledge Base (Self-Init on demand)
422
+ [ ] package.json / pyproject.toml — dependencies and scripts
423
+ [ ] tsconfig.json — strict mode enabled (if TypeScript)
424
+ [ ] .eslintrc / .prettierrc — project standard linting and formatting
425
+ [ ] .gitignore — standard entries (MUST include .ai-local/ to protect personal project memory)
426
+ [ ] README.md — project description + setup instructions
427
+ [ ] DESIGN.md — (UI projects) brand contract with color/font/spacing tokens
428
+ [ ] evals/scorecard.yaml — (AI/RAG/Workflow projects) eval standard
429
+ [ ] .agents/rules/anti-patterns.md — Bắt buộc phải có (chuẩn V8.3 R-C-09)
430
+ [ ] .agents/rules/security.md — Bắt buộc phải có (chuẩn V8.3 R-SEC-04)
431
+ ```
432
+ -----
433
+
434
+ ## DESIGN.md Minimum Template
435
+ ```markdown
436
+ # Design System
437
+
438
+ ## Colors (HSL)
439
+ --color-primary: hsl(220, 80%, 55%);
440
+ --color-surface: hsl(220, 15%, 12%);
441
+ --color-text: hsl(220, 10%, 90%);
442
+
443
+ ## Spacing Scale (4px base)
444
+ --space-1: 4px; --space-2: 8px; --space-3: 16px;
445
+ --space-4: 24px; --space-5: 32px; --space-6: 48px;
446
+
447
+ ## Typography
448
+ --font-sans: 'Inter', system-ui, sans-serif;
449
+ --font-size-base: 1rem;
450
+ --font-size-lg: 1.25rem;
451
+
452
+ ## Border Radius
453
+ --radius-sm: 4px; --radius-md: 8px; --radius-lg: 16px;
454
+
455
+ ## Animation
456
+ --transition-fast: 150ms ease;
457
+ --transition-base: 250ms ease;
458
+ ```
459
+
460
+ ---
461
+
462
+ ## Workflow
463
+
464
+ ### Phase 1 — Blueprint Selection
465
+ **Steps:**
466
+ 1. Assess Preconditions to determine framework/purpose.
467
+ 2. Select appropriate blueprint (coding, rag, workflow, enterprise).
468
+
469
+ **Decision:**
470
+ ```
471
+ IF framework/purpose is clear
472
+ → Confidence: HIGH → go to Phase 2
473
+ ELSE
474
+ → EXIT: BLOCKED — ask user
475
+ ```
476
+
477
+ ### Phase 2 — Scaffold Generation
478
+ **Steps:**
479
+ 1. Generate `project.yaml` manifest.
480
+ 2. Create directory tree structure based on blueprint.
481
+ 3. Configure tooling and generate `DESIGN.md` if UI project.
482
+
483
+ **Decision:**
484
+ ```
485
+ IF directories and files are generated
486
+ → Confidence: HIGH → go to Phase 3
487
+ ELSE
488
+ → EXIT: FAILED
489
+ ```
490
+
491
+ ### Phase 3 — Verification
492
+ **Steps:**
493
+ 1. Check Required Files Checklist against what was actually created.
494
+ 2. Ensure no mandatory files are missing.
495
+
496
+ **Decision:**
497
+ ```
498
+ IF all required files exist
499
+ → EXIT: SUCCESS
500
+ ELSE
501
+ → EXIT: PARTIAL
502
+ ```
503
+
272
504
  ---
273
505
 
274
- ## Preconditions
275
- - [ ] Framework/language preference is stated (or ask before proceeding)
276
- - [ ] Project purpose is clear (web app, API, CLI, library)
277
-
278
- ```
279
- On missing precondition:
280
- EXIT: BLOCKED
281
- Message: "Vui lòng cho biết: framework (React/Next.js/NestJS/Express...) và mục đích dự án."
282
- ```
283
-
284
- ---
285
-
286
- ## Scope & V8.2 Blueprint Generator
287
- - **One-Click Blueprint Selection:** Choose from Blueprint Plugins (`coding`, `rag`, `workflow`, `enterprise`).
288
- - ✅ **Generate `project.yaml`:** Copy appropriate manifest from `.agents/blueprints/<type>/project.yaml.tpl` to workspace root.
289
- - **Initialize Project Scaffolding:** Create standard directory structure (including the **4-Folder RAG Architecture** for AI projects).
290
- - **Initialize Project Knowledge V1:** Setup Dual-Mode Memory architecture (`.ai-local/` Private Mode with `.gitignore` entry by default, or `.agents/` Shared Mode) containing concise `AGENTS.md` (<100 lines) and `knowledge/index.yaml` (4 core types: Architecture, Convention, Pattern, Hard Bug).
291
- - **Configure Tooling:** Linter, Prettier, TypeScript strict mode, or Python environment depending on stack.
292
- - **Generate `DESIGN.md`:** Mandatory brand & token contract for any UI project.
293
-
294
- ## Non-Goals
295
- - ❌ Skip `project.yaml` workspace manifest initialization
296
- - Skip Project Knowledge V1 (`AGENTS.md` & `index.yaml` memory setup)
297
- - Skip DESIGN.md for UI projects
298
- - ❌ Hardcode outdated dependency versions or absolute machine disk paths
299
- - Skip README or documentation
300
-
301
- ---
302
-
303
- ## V8.2 Blueprint Plugins & Directory Structures
304
-
305
- ### 1. RAG & AI Agents (The 4-Folder Architecture Blueprint)
306
- *Activated when building AI agents, RAG engines, or domain automation.*
307
- ```text
308
- project.yaml # ⭐ V8.2 Workspace Manifest (Profiles & Capabilities)
309
- .ai-local/ # V1 Private Project Memory (Gitignored) OR .agents/ Shared Memory
310
- ├── AGENTS.md # Project roadmap & quick actions (<100 lines)
311
- └── knowledge/
312
- └── index.yaml # Architecture, Convention, Pattern & Hard Bug repository
313
- prompts/ # Prompt instructions managed as code
314
- ├── system/
315
- ├── tasks/
316
- └── tools/
317
- data/ # Strict data discipline
318
- ├── raw/ # IMMUTABLE original files (PDFs, Excel, Revit/CAD)
319
- └── processed/ # Cleaned, standardized chunks for AI ingestion
320
- agents/ # Agent configurations and domain micro-skills
321
- ├── skills/
322
- └── tools/
323
- evals/ # Quantitative validation evidence
324
- ├── tests/
325
- ├── traces/ # Audit execution traces
326
- └── scorecards/ # scorecard.yaml eval rubrics
327
- ```
328
-
329
- ### 2. Standard Coding Workspaces (Next.js / React / Node)
330
- *Activated when developing software applications or UI components.*
331
- ```text
332
- project.yaml # ⭐ V8.2 Workspace Manifest
333
- .ai-local/ # ⭐ V1 Private Project Memory (Gitignored) OR .agents/ Shared Memory
334
- ├── AGENTS.md # Project roadmap & quick actions (<100 lines)
335
- └── knowledge/
336
- └── index.yaml # Architecture, Convention, Pattern & Hard Bug repository
337
- src/
338
- ├── app/ # Pages or App Router
339
- ├── components/ # Shared UI components & Design system primitives
340
- ├── hooks/
341
- ├── lib/
342
- ├── services/ # API integration & State stores
343
- ├── types/
344
- └── styles/
345
- DESIGN.md # Brand & Design Contract
346
- ```
347
-
348
- ### 3. Automation Workflows (n8n & Data ETL)
349
- ```text
350
- project.yaml # ⭐ V8.2 Workspace Manifest
351
- .ai-local/ # V1 Private Project Memory (Gitignored) OR .agents/ Shared Memory
352
- workflows/ # Automation graphs & JSON blueprints
353
- connectors/ # API & Database integrations
354
- pipelines/ # Transformation scripts
355
- evals/ # Traceability logs
356
- ```
357
-
358
- ---
359
-
360
- ## Required Files Checklist
361
- ```
362
- [ ] project.yaml — V8.2 Machine-readable Workspace Manifest
363
- [ ] .ai-local/AGENTS.md OR .agents/AGENTS.md — V1 Project Architecture Navigator (<100 lines)
364
- [ ] .ai-local/knowledge/index.yaml OR .agents/knowledge/index.yaml — V1 Actionable Knowledge Base
365
- [ ] package.json / pyproject.toml — dependencies and scripts
366
- [ ] tsconfig.json — strict mode enabled (if TypeScript)
367
- [ ] .eslintrc / .prettierrc — project standard linting and formatting
368
- [ ] .gitignore — standard entries (MUST include .ai-local/ if Private Mode)
369
- [ ] README.md — project description + setup instructions
370
- [ ] DESIGN.md — (UI projects) brand contract with color/font/spacing tokens
371
- [ ] evals/scorecard.yaml — (AI/RAG/Workflow projects) eval standard
372
- [ ] .agents/rules/anti-patterns.md — Bắt buộc phải có (chuẩn V8.3 R-C-09)
373
- [ ] .agents/rules/security.md — Bắt buộc phải có (chuẩn V8.3 R-SEC-04)
374
- ```
375
- -----
376
-
377
- ## DESIGN.md Minimum Template
378
- ```markdown
379
- # Design System
380
-
381
- ## Colors (HSL)
382
- --color-primary: hsl(220, 80%, 55%);
383
- --color-surface: hsl(220, 15%, 12%);
384
- --color-text: hsl(220, 10%, 90%);
385
-
386
- ## Spacing Scale (4px base)
387
- --space-1: 4px; --space-2: 8px; --space-3: 16px;
388
- --space-4: 24px; --space-5: 32px; --space-6: 48px;
389
-
390
- ## Typography
391
- --font-sans: 'Inter', system-ui, sans-serif;
392
- --font-size-base: 1rem;
393
- --font-size-lg: 1.25rem;
394
-
395
- ## Border Radius
396
- --radius-sm: 4px; --radius-md: 8px; --radius-lg: 16px;
397
-
398
- ## Animation
399
- --transition-fast: 150ms ease;
400
- --transition-base: 250ms ease;
401
- ```
402
-
403
- ---
404
-
405
- ---
406
-
407
- ## Workflow
408
-
409
- ### Phase 1 — Blueprint Selection
410
- **Steps:**
411
- 1. Assess Preconditions to determine framework/purpose.
412
- 2. Select appropriate blueprint (coding, rag, workflow, enterprise).
413
-
414
- **Decision:**
415
- ```
416
- IF framework/purpose is clear
417
- → Confidence: HIGH → go to Phase 2
418
- ELSE
419
- → EXIT: BLOCKED — ask user
420
- ```
421
-
422
- ### Phase 2 — Scaffold Generation
423
- **Steps:**
424
- 1. Generate `project.yaml` manifest.
425
- 2. Create directory tree structure based on blueprint.
426
- 3. Configure tooling and generate `DESIGN.md` if UI project.
427
-
428
- **Decision:**
429
- ```
430
- IF directories and files are generated
431
- → Confidence: HIGH → go to Phase 3
432
- ELSE
433
- → EXIT: FAILED
434
- ```
435
-
436
- ### Phase 3 — Verification
437
- **Steps:**
438
- 1. Check Required Files Checklist against what was actually created.
439
- 2. Ensure no mandatory files are missing.
440
-
441
- **Decision:**
442
- ```
443
- IF all required files exist
444
- → EXIT: SUCCESS
445
- ELSE
446
- → EXIT: PARTIAL
447
- ```
448
-
449
- ---
450
-
451
- ## Evidence Format
452
-
453
- ```
454
- [SEVERITY] path/to/expected-file
455
- Issue: [MISSING_MANIFEST | MISSING_DESIGN_MD | WRONG_STRUCTURE]
456
- Confidence: HIGH
457
- Fix: [specific file to create]
458
- ```
459
-
460
- ---
461
-
462
- ## Priority Order
463
-
464
- | Priority | Task | Skip Threshold |
465
- |----------|------|----------------|
466
- | P1 | project.yaml manifest created | Never |
467
- | P2 | Core scaffolding per blueprint type | Never |
468
- | P3 | Tooling config | Budget < 40% |
469
- | P4 | DESIGN.md for UI projects | Never for UI |
470
- | P5 | README | Budget < 60% |
471
-
472
- ---
473
- ## Exit Codes
474
- | Code | Meaning | When |
475
- |------|---------|------|
476
- | SUCCESS | All required files created, structure matches framework standard | Full bootstrap complete |
477
- | PARTIAL | Structure created but DESIGN.md incomplete (UI project) | Follow-up needed |
478
- | BLOCKED | Framework/purpose not specified | Ask user |
479
- | FAILED | Cannot initialize (permission error, invalid framework) | Report error |
480
-
481
- ---
482
-
483
- ## Confidence Model
484
- | Level | Condition | Action |
485
- |-------|-----------|--------|
486
- | HIGH | Framework explicitly stated, directory structure clear | Build directly |
487
- | MEDIUM | Framework inferred from context (found React imports) | Note assumption, proceed |
488
- | LOW | Cannot determine framework or project type | EXIT: BLOCKED |
489
-
490
- ---
491
-
492
- ## Severity
493
- | Level | Definition | Example |
494
- |-------|-----------|----------|
495
- | CRITICAL | Security misconfiguration in bootstrap | .env with real secrets committed |
496
- | HIGH | Missing mandatory file blocks all future work | No DESIGN.md for UI project |
497
- | MEDIUM | Incomplete setup reduces developer experience | Missing ESLint config |
498
- | LOW | Cosmetic or optional file missing | Missing .editorconfig |
499
-
500
- ---
501
-
502
- ## Retry Policy
503
- ```
504
- File creation fails
505
- └─ Check: permission issue vs path error
506
- ├─ Path error → correct path and retry
507
- └─ Permission error → EXIT: FAILED, report exact path
508
- └─ Do NOT retry more than 1 time per file
509
- ```
510
-
511
- ---
512
-
513
- ## Escalation Rules
514
- ```
515
- BLOCKED: Framework or project type not specified
516
- Missing:
517
- - Framework name (React, Next.js, NestJS, Express, etc.)
518
- - Project purpose (web app, API, CLI, library)
519
- Questions:
520
- 1. Framework nào bạn muốn dùng?
521
- 2. Dự án này là web app, API server, hay CLI tool?
522
- Recommended Assumptions (if proceeding):
523
- - Default: Next.js 14 (App Router) + TypeScript + ESLint
524
- ```
525
-
526
- ---
527
-
528
- ## Handoff Contract
529
- ### Consumes
530
- ```json
531
- {
532
- "from": "user",
533
- "required_fields": ["framework", "project_purpose"],
534
- "optional_fields": ["project_name", "existing_dir"]
535
- }
536
- ```
537
- ### Produces
538
- ```json
539
- {
540
- "to": "qk-feature-delivery or qk-ui-builder",
541
- "output_fields": ["project_structure", "design_md_path", "tooling_config", "exit_code"]
542
- }
543
- ```
544
-
545
- ---
546
-
506
+ ## Evidence Format
507
+
508
+ ```
509
+ [SEVERITY] path/to/expected-file
510
+ Issue: [MISSING_MANIFEST | MISSING_DESIGN_MD | WRONG_STRUCTURE]
511
+ Confidence: HIGH
512
+ Fix: [specific file to create]
513
+ ```
514
+
515
+ ---
516
+
517
+ ## Priority Order
518
+
519
+ | Priority | Task | Skip Threshold |
520
+ |----------|------|----------------|
521
+ | P1 | project.yaml manifest created | Never |
522
+ | P2 | Core scaffolding per blueprint type | Never |
523
+ | P3 | Tooling config | Budget < 40% |
524
+ | P4 | DESIGN.md for UI projects | Never for UI |
525
+ | P5 | README | Budget < 60% |
526
+
527
+ ---
528
+ ## Exit Codes
529
+ | Code | Meaning | When |
530
+ |------|---------|------|
531
+ | SUCCESS | All required files created, structure matches framework standard | Full bootstrap complete |
532
+ | PARTIAL | Structure created but DESIGN.md incomplete (UI project) | Follow-up needed |
533
+ | BLOCKED | Framework/purpose not specified | Ask user |
534
+ | FAILED | Cannot initialize (permission error, invalid framework) | Report error |
535
+
536
+ ---
537
+
538
+ ## Confidence Model
539
+ | Level | Condition | Action |
540
+ |-------|-----------|--------|
541
+ | HIGH | Framework explicitly stated, directory structure clear | Build directly |
542
+ | MEDIUM | Framework inferred from context (found React imports) | Note assumption, proceed |
543
+ | LOW | Cannot determine framework or project type | EXIT: BLOCKED |
544
+
545
+ ---
546
+
547
+ ## Severity
548
+ | Level | Definition | Example |
549
+ |-------|-----------|----------|
550
+ | CRITICAL | Security misconfiguration in bootstrap | .env with real secrets committed |
551
+ | HIGH | Missing mandatory file blocks all future work | No DESIGN.md for UI project |
552
+ | MEDIUM | Incomplete setup reduces developer experience | Missing ESLint config |
553
+ | LOW | Cosmetic or optional file missing | Missing .editorconfig |
554
+
555
+ ---
556
+
557
+ ## Retry Policy
558
+ ```
559
+ File creation fails
560
+ └─ Check: permission issue vs path error
561
+ ├─ Path error correct path and retry
562
+ └─ Permission error EXIT: FAILED, report exact path
563
+ └─ Do NOT retry more than 1 time per file
564
+ ```
565
+
566
+ ---
567
+
568
+ ## Escalation Rules
569
+ ```
570
+ BLOCKED: Framework or project type not specified
571
+ Missing:
572
+ - Framework name (React, Next.js, NestJS, Express, etc.)
573
+ - Project purpose (web app, API, CLI, library)
574
+ Questions:
575
+ 1. Framework nào bạn muốn dùng?
576
+ 2. Dự án này là web app, API server, hay CLI tool?
577
+ Recommended Assumptions (if proceeding):
578
+ - Default: Next.js 14 (App Router) + TypeScript + ESLint
579
+ ```
580
+
581
+ ---
582
+
583
+ ## Handoff Contract
584
+ ### Consumes
585
+ ```json
586
+ {
587
+ "from": "user",
588
+ "required_fields": ["framework", "project_purpose"],
589
+ "optional_fields": ["project_name", "existing_dir"]
590
+ }
591
+ ```
592
+ ### Produces
593
+ ```json
594
+ {
595
+ "to": "qk-feature-delivery or qk-ui-builder",
596
+ "output_fields": ["project_structure", "design_md_path", "tooling_config", "exit_code"]
597
+ }
598
+ ```
599
+
600
+ ---