ai-developer-skill-os 9.0.0 → 9.1.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 (104) hide show
  1. package/.agents/AGENTS.md +7 -7
  2. package/.agents/registry/graph.json +33 -33
  3. package/.agents/registry/index.yaml +33 -33
  4. package/.agents/rules/global.md +1 -1
  5. package/.agents/skills/_template/SKILL.md +129 -1
  6. package/.agents/skills/_template/capability.yaml +1 -1
  7. package/.agents/skills/qk-access-policy/SKILL.md +134 -1
  8. package/.agents/skills/qk-access-policy/capability.yaml +1 -1
  9. package/.agents/skills/qk-access-policy/evals/scorecard.yaml +1 -1
  10. package/.agents/skills/qk-agent-observability/SKILL.md +134 -1
  11. package/.agents/skills/qk-agent-observability/capability.yaml +1 -1
  12. package/.agents/skills/qk-agent-observability/evals/scorecard.yaml +1 -1
  13. package/.agents/skills/qk-ai-builder/SKILL.md +134 -1
  14. package/.agents/skills/qk-ai-builder/capability.yaml +1 -1
  15. package/.agents/skills/qk-ai-builder/evals/scorecard.yaml +1 -1
  16. package/.agents/skills/qk-api-lifecycle/SKILL.md +134 -1
  17. package/.agents/skills/qk-api-lifecycle/capability.yaml +1 -1
  18. package/.agents/skills/qk-api-lifecycle/evals/scorecard.yaml +1 -1
  19. package/.agents/skills/qk-bug-resolution/SKILL.md +134 -1
  20. package/.agents/skills/qk-bug-resolution/capability.yaml +1 -1
  21. package/.agents/skills/qk-bug-resolution/evals/scorecard.yaml +1 -1
  22. package/.agents/skills/qk-code-review/SKILL.md +134 -1
  23. package/.agents/skills/qk-code-review/capability.yaml +1 -1
  24. package/.agents/skills/qk-code-review/evals/scorecard.yaml +1 -1
  25. package/.agents/skills/qk-context-loader/SKILL.md +134 -1
  26. package/.agents/skills/qk-context-loader/capability.yaml +1 -1
  27. package/.agents/skills/qk-context-loader/evals/scorecard.yaml +1 -1
  28. package/.agents/skills/qk-data-lifecycle/SKILL.md +134 -1
  29. package/.agents/skills/qk-data-lifecycle/capability.yaml +1 -1
  30. package/.agents/skills/qk-data-lifecycle/evals/scorecard.yaml +1 -1
  31. package/.agents/skills/qk-db-optimizer/SKILL.md +134 -1
  32. package/.agents/skills/qk-db-optimizer/capability.yaml +1 -1
  33. package/.agents/skills/qk-db-optimizer/evals/scorecard.yaml +1 -1
  34. package/.agents/skills/qk-design-system-engineering/SKILL.md +134 -1
  35. package/.agents/skills/qk-design-system-engineering/capability.yaml +1 -1
  36. package/.agents/skills/qk-design-system-engineering/evals/scorecard.yaml +1 -1
  37. package/.agents/skills/qk-devops-platform/SKILL.md +134 -1
  38. package/.agents/skills/qk-devops-platform/capability.yaml +1 -1
  39. package/.agents/skills/qk-devops-platform/evals/scorecard.yaml +1 -1
  40. package/.agents/skills/qk-docs/SKILL.md +134 -1
  41. package/.agents/skills/qk-docs/capability.yaml +1 -1
  42. package/.agents/skills/qk-docs/evals/scorecard.yaml +1 -1
  43. package/.agents/skills/qk-engineering-standard/SKILL.md +134 -1
  44. package/.agents/skills/qk-engineering-standard/capability.yaml +1 -1
  45. package/.agents/skills/qk-engineering-standard/evals/scorecard.yaml +1 -1
  46. package/.agents/skills/qk-fe-api-integration/SKILL.md +134 -1
  47. package/.agents/skills/qk-fe-api-integration/capability.yaml +1 -1
  48. package/.agents/skills/qk-fe-api-integration/evals/scorecard.yaml +1 -1
  49. package/.agents/skills/qk-feature-delivery/SKILL.md +134 -1
  50. package/.agents/skills/qk-feature-delivery/capability.yaml +1 -1
  51. package/.agents/skills/qk-feature-delivery/evals/scorecard.yaml +1 -1
  52. package/.agents/skills/qk-frontend-architecture/SKILL.md +134 -1
  53. package/.agents/skills/qk-frontend-architecture/capability.yaml +1 -1
  54. package/.agents/skills/qk-frontend-architecture/evals/scorecard.yaml +1 -1
  55. package/.agents/skills/qk-help/SKILL.md +1 -1
  56. package/.agents/skills/qk-help/capability.yaml +1 -1
  57. package/.agents/skills/qk-help/evals/scorecard.yaml +1 -1
  58. package/.agents/skills/qk-orchestrator/SKILL.md +134 -1
  59. package/.agents/skills/qk-orchestrator/capability.yaml +1 -1
  60. package/.agents/skills/qk-orchestrator/evals/scorecard.yaml +1 -1
  61. package/.agents/skills/qk-product-specification/SKILL.md +134 -1
  62. package/.agents/skills/qk-product-specification/capability.yaml +1 -1
  63. package/.agents/skills/qk-product-specification/evals/scorecard.yaml +1 -1
  64. package/.agents/skills/qk-production-release/SKILL.md +134 -1
  65. package/.agents/skills/qk-production-release/capability.yaml +1 -1
  66. package/.agents/skills/qk-production-release/evals/scorecard.yaml +1 -1
  67. package/.agents/skills/qk-project-bootstrap/SKILL.md +393 -366
  68. package/.agents/skills/qk-project-bootstrap/capability.yaml +1 -1
  69. package/.agents/skills/qk-project-bootstrap/evals/scorecard.yaml +1 -1
  70. package/.agents/skills/qk-project-health/SKILL.md +134 -1
  71. package/.agents/skills/qk-project-health/capability.yaml +1 -1
  72. package/.agents/skills/qk-project-health/evals/scorecard.yaml +1 -1
  73. package/.agents/skills/qk-project-memory/SKILL.md +14 -18
  74. package/.agents/skills/qk-project-memory/capability.yaml +1 -1
  75. package/.agents/skills/qk-project-memory/evals/scorecard.yaml +1 -1
  76. package/.agents/skills/qk-refactor/SKILL.md +134 -1
  77. package/.agents/skills/qk-refactor/capability.yaml +1 -1
  78. package/.agents/skills/qk-refactor/evals/scorecard.yaml +1 -1
  79. package/.agents/skills/qk-security-audit/SKILL.md +134 -1
  80. package/.agents/skills/qk-security-audit/capability.yaml +1 -1
  81. package/.agents/skills/qk-security-audit/evals/scorecard.yaml +1 -1
  82. package/.agents/skills/qk-system-evolution/SKILL.md +134 -1
  83. package/.agents/skills/qk-system-evolution/capability.yaml +1 -1
  84. package/.agents/skills/qk-system-evolution/evals/scorecard.yaml +1 -1
  85. package/.agents/skills/qk-test-engineering/SKILL.md +134 -1
  86. package/.agents/skills/qk-test-engineering/capability.yaml +1 -1
  87. package/.agents/skills/qk-test-engineering/evals/scorecard.yaml +1 -1
  88. package/.agents/skills/qk-ui-audit/SKILL.md +134 -1
  89. package/.agents/skills/qk-ui-audit/capability.yaml +1 -1
  90. package/.agents/skills/qk-ui-audit/evals/scorecard.yaml +1 -1
  91. package/.agents/skills/qk-ui-builder/capability.yaml +1 -1
  92. package/.agents/skills/qk-ui-builder/evals/scorecard.yaml +1 -1
  93. package/.agents/skills/qk-ui-system-builder/SKILL.md +134 -1
  94. package/.agents/skills/qk-ui-system-builder/capability.yaml +1 -1
  95. package/.agents/skills/qk-ui-system-builder/evals/scorecard.yaml +1 -1
  96. package/.agents/skills/qk-validation-gate/SKILL.md +134 -1
  97. package/.agents/skills/qk-validation-gate/capability.yaml +1 -1
  98. package/.agents/skills/qk-validation-gate/evals/scorecard.yaml +1 -1
  99. package/.agents/skills/qk-web-quality-gate/SKILL.md +134 -1
  100. package/.agents/skills/qk-web-quality-gate/capability.yaml +1 -1
  101. package/.agents/skills/qk-web-quality-gate/evals/scorecard.yaml +1 -1
  102. package/README.md +7 -7
  103. package/package.json +2 -2
  104. package/tooling/sync-versions.js +11 -7
@@ -1,99 +1,105 @@
1
- ---
2
- # ── Identity ───────────────────────────────────────────────
3
- name: qk-project-bootstrap
4
- version: 9.0.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,280 +247,274 @@ 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
+ ## Preconditions
252
+ - [ ] Framework/language preference is stated (or ask before proceeding)
253
+ - [ ] Project purpose is clear (web app, API, CLI, library)
254
+
255
+ ```
256
+ On missing precondition:
257
+ EXIT: BLOCKED
258
+ Message: "Vui lòng cho biết: framework (React/Next.js/NestJS/Express...) và mục đích dự án."
259
+ ```
260
+
217
261
  ---
262
+
263
+ ## Scope & V8.2 Blueprint Generator
264
+ - ✅ **One-Click Blueprint Selection:** Choose from Blueprint Plugins (`coding`, `rag`, `workflow`, `enterprise`).
265
+ - ✅ **Generate `project.yaml`:** Copy appropriate manifest from `.agents/blueprints/<type>/project.yaml.tpl` to workspace root.
266
+ - ✅ **Initialize Project Scaffolding:** Create standard directory structure (including the **4-Folder RAG Architecture** for AI projects).
267
+ - ✅ **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).
268
+ - ✅ **Configure Tooling:** Linter, Prettier, TypeScript strict mode, or Python environment depending on stack.
269
+ - ✅ **Generate `DESIGN.md`:** Mandatory brand & token contract for any UI project.
270
+
271
+ ## Non-Goals
272
+ - ❌ Skip `project.yaml` workspace manifest initialization
273
+ - ❌ Skip Project Knowledge V1 (`AGENTS.md` & `index.yaml` memory setup in `.ai-local/`)
274
+ - ❌ Skip DESIGN.md for UI projects
275
+ - ❌ Hardcode outdated dependency versions or absolute machine disk paths
276
+ - ❌ Skip README or documentation
277
+
218
278
  ---
279
+
280
+ ## V8.2 Blueprint Plugins & Directory Structures
281
+
282
+ ### 1. RAG & AI Agents (The 4-Folder Architecture Blueprint)
283
+ *Activated when building AI agents, RAG engines, or domain automation.*
284
+ ```text
285
+ project.yaml # ⭐ V8.2 Workspace Manifest (Profiles & Capabilities)
286
+ .ai-local/ # ⭐ V1 Private Project Memory (Self-Init & Gitignored by default)
287
+ ├── AGENTS.md # Project roadmap & quick actions (<100 lines)
288
+ └── knowledge/
289
+ └── index.yaml # Architecture, Convention, Pattern & Hard Bug repository
290
+ prompts/ # Prompt instructions managed as code
291
+ ├── system/
292
+ ├── tasks/
293
+ └── tools/
294
+ data/ # Strict data discipline
295
+ ├── raw/ # IMMUTABLE original files (PDFs, Excel, Revit/CAD)
296
+ └── processed/ # Cleaned, standardized chunks for AI ingestion
297
+ agents/ # Agent configurations and domain micro-skills
298
+ ├── skills/
299
+ └── tools/
300
+ evals/ # Quantitative validation evidence
301
+ ├── tests/
302
+ ├── traces/ # Audit execution traces
303
+ └── scorecards/ # scorecard.yaml eval rubrics
304
+ ```
305
+
306
+ ### 2. Standard Coding Workspaces (Next.js / React / Node)
307
+ *Activated when developing software applications or UI components.*
308
+ ```text
309
+ project.yaml # ⭐ V8.2 Workspace Manifest
310
+ .ai-local/ # ⭐ V1 Private Project Memory (Self-Init & Gitignored by default)
311
+ ├── AGENTS.md # Project roadmap & quick actions (<100 lines)
312
+ └── knowledge/
313
+ └── index.yaml # Architecture, Convention, Pattern & Hard Bug repository
314
+ src/
315
+ ├── app/ # Pages or App Router
316
+ ├── components/ # Shared UI components & Design system primitives
317
+ ├── hooks/
318
+ ├── lib/
319
+ ├── services/ # API integration & State stores
320
+ ├── types/
321
+ └── styles/
322
+ DESIGN.md # Brand & Design Contract
323
+ ```
324
+
325
+ ### 3. Automation Workflows (n8n & Data ETL)
326
+ ```text
327
+ project.yaml # ⭐ V8.2 Workspace Manifest
328
+ .ai-local/ # ⭐ V1 Private Project Memory (Self-Init & Gitignored by default)
329
+ workflows/ # Automation graphs & JSON blueprints
330
+ connectors/ # API & Database integrations
331
+ pipelines/ # Transformation scripts
332
+ evals/ # Traceability logs
333
+ ```
334
+
335
+ ---
336
+
337
+ ## Required Files Checklist
338
+ ```
339
+ [ ] project.yaml — V8.2 Machine-readable Workspace Manifest
340
+ [ ] .ai-local/AGENTS.md — V1 Project Architecture Navigator (<100 lines)
341
+ [ ] .ai-local/knowledge/index.yaml — V1 Actionable Knowledge Base (Self-Init on demand)
342
+ [ ] package.json / pyproject.toml — dependencies and scripts
343
+ [ ] tsconfig.json — strict mode enabled (if TypeScript)
344
+ [ ] .eslintrc / .prettierrc — project standard linting and formatting
345
+ [ ] .gitignore — standard entries (MUST include .ai-local/ to protect personal project memory)
346
+ [ ] README.md — project description + setup instructions
347
+ [ ] DESIGN.md — (UI projects) brand contract with color/font/spacing tokens
348
+ [ ] evals/scorecard.yaml — (AI/RAG/Workflow projects) eval standard
349
+ [ ] .agents/rules/anti-patterns.md — Bắt buộc phải có (chuẩn V8.3 R-C-09)
350
+ [ ] .agents/rules/security.md — Bắt buộc phải có (chuẩn V8.3 R-SEC-04)
351
+ ```
352
+ -----
353
+
354
+ ## DESIGN.md Minimum Template
355
+ ```markdown
356
+ # Design System
357
+
358
+ ## Colors (HSL)
359
+ --color-primary: hsl(220, 80%, 55%);
360
+ --color-surface: hsl(220, 15%, 12%);
361
+ --color-text: hsl(220, 10%, 90%);
362
+
363
+ ## Spacing Scale (4px base)
364
+ --space-1: 4px; --space-2: 8px; --space-3: 16px;
365
+ --space-4: 24px; --space-5: 32px; --space-6: 48px;
366
+
367
+ ## Typography
368
+ --font-sans: 'Inter', system-ui, sans-serif;
369
+ --font-size-base: 1rem;
370
+ --font-size-lg: 1.25rem;
371
+
372
+ ## Border Radius
373
+ --radius-sm: 4px; --radius-md: 8px; --radius-lg: 16px;
374
+
375
+ ## Animation
376
+ --transition-fast: 150ms ease;
377
+ --transition-base: 250ms ease;
378
+ ```
379
+
219
380
  ---
220
381
 
221
- ## Preconditions
222
- - [ ] Framework/language preference is stated (or ask before proceeding)
223
- - [ ] Project purpose is clear (web app, API, CLI, library)
224
-
225
- ```
226
- On missing precondition:
227
- EXIT: BLOCKED
228
- Message: "Vui lòng cho biết: framework (React/Next.js/NestJS/Express...) và mục đích dự án."
229
- ```
230
-
231
- ---
232
-
233
- ## Scope & V8.2 Blueprint Generator
234
- - ✅ **One-Click Blueprint Selection:** Choose from Blueprint Plugins (`coding`, `rag`, `workflow`, `enterprise`).
235
- - ✅ **Generate `project.yaml`:** Copy appropriate manifest from `.agents/blueprints/<type>/project.yaml.tpl` to workspace root.
236
- - **Initialize Project Scaffolding:** Create standard directory structure (including the **4-Folder RAG Architecture** for AI projects).
237
- - ✅ **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).
238
- - **Configure Tooling:** Linter, Prettier, TypeScript strict mode, or Python environment depending on stack.
239
- - ✅ **Generate `DESIGN.md`:** Mandatory brand & token contract for any UI project.
240
-
241
- ## Non-Goals
242
- - ❌ Skip `project.yaml` workspace manifest initialization
243
- - ❌ Skip Project Knowledge V1 (`AGENTS.md` & `index.yaml` memory setup)
244
- - Skip DESIGN.md for UI projects
245
- - Hardcode outdated dependency versions or absolute machine disk paths
246
- - ❌ Skip README or documentation
247
-
248
- ---
249
-
250
- ## V8.2 Blueprint Plugins & Directory Structures
251
-
252
- ### 1. RAG & AI Agents (The 4-Folder Architecture Blueprint)
253
- *Activated when building AI agents, RAG engines, or domain automation.*
254
- ```text
255
- project.yaml # ⭐ V8.2 Workspace Manifest (Profiles & Capabilities)
256
- .ai-local/ # ⭐ V1 Private Project Memory (Gitignored) OR .agents/ Shared Memory
257
- ├── AGENTS.md # Project roadmap & quick actions (<100 lines)
258
- └── knowledge/
259
- └── index.yaml # Architecture, Convention, Pattern & Hard Bug repository
260
- prompts/ # Prompt instructions managed as code
261
- ├── system/
262
- ├── tasks/
263
- └── tools/
264
- data/ # Strict data discipline
265
- ├── raw/ # IMMUTABLE original files (PDFs, Excel, Revit/CAD)
266
- └── processed/ # Cleaned, standardized chunks for AI ingestion
267
- agents/ # Agent configurations and domain micro-skills
268
- ├── skills/
269
- └── tools/
270
- evals/ # Quantitative validation evidence
271
- ├── tests/
272
- ├── traces/ # Audit execution traces
273
- └── scorecards/ # scorecard.yaml eval rubrics
274
- ```
275
-
276
- ### 2. Standard Coding Workspaces (Next.js / React / Node)
277
- *Activated when developing software applications or UI components.*
278
- ```text
279
- project.yaml # ⭐ V8.2 Workspace Manifest
280
- .ai-local/ # V1 Private Project Memory (Gitignored) OR .agents/ Shared Memory
281
- ├── AGENTS.md # Project roadmap & quick actions (<100 lines)
282
- └── knowledge/
283
- └── index.yaml # Architecture, Convention, Pattern & Hard Bug repository
284
- src/
285
- ├── app/ # Pages or App Router
286
- ├── components/ # Shared UI components & Design system primitives
287
- ├── hooks/
288
- ├── lib/
289
- ├── services/ # API integration & State stores
290
- ├── types/
291
- └── styles/
292
- DESIGN.md # Brand & Design Contract
293
- ```
294
-
295
- ### 3. Automation Workflows (n8n & Data ETL)
296
- ```text
297
- project.yaml # V8.2 Workspace Manifest
298
- .ai-local/ # V1 Private Project Memory (Gitignored) OR .agents/ Shared Memory
299
- workflows/ # Automation graphs & JSON blueprints
300
- connectors/ # API & Database integrations
301
- pipelines/ # Transformation scripts
302
- evals/ # Traceability logs
303
- ```
304
-
305
- ---
306
-
307
- ## Required Files Checklist
308
- ```
309
- [ ] project.yaml V8.2 Machine-readable Workspace Manifest
310
- [ ] .ai-local/AGENTS.md OR .agents/AGENTS.md V1 Project Architecture Navigator (<100 lines)
311
- [ ] .ai-local/knowledge/index.yaml OR .agents/knowledge/index.yaml V1 Actionable Knowledge Base
312
- [ ] package.json / pyproject.toml dependencies and scripts
313
- [ ] tsconfig.json — strict mode enabled (if TypeScript)
314
- [ ] .eslintrc / .prettierrc — project standard linting and formatting
315
- [ ] .gitignore — standard entries (MUST include .ai-local/ if Private Mode)
316
- [ ] README.md — project description + setup instructions
317
- [ ] DESIGN.md — (UI projects) brand contract with color/font/spacing tokens
318
- [ ] evals/scorecard.yaml — (AI/RAG/Workflow projects) eval standard
319
- [ ] .agents/rules/anti-patterns.md Bắt buộc phải có (chuẩn V8.3 R-C-09)
320
- [ ] .agents/rules/security.md Bắt buộc phải có (chuẩn V8.3 R-SEC-04)
321
- ```
322
- -----
323
-
324
- ## DESIGN.md Minimum Template
325
- ```markdown
326
- # Design System
327
-
328
- ## Colors (HSL)
329
- --color-primary: hsl(220, 80%, 55%);
330
- --color-surface: hsl(220, 15%, 12%);
331
- --color-text: hsl(220, 10%, 90%);
332
-
333
- ## Spacing Scale (4px base)
334
- --space-1: 4px; --space-2: 8px; --space-3: 16px;
335
- --space-4: 24px; --space-5: 32px; --space-6: 48px;
336
-
337
- ## Typography
338
- --font-sans: 'Inter', system-ui, sans-serif;
339
- --font-size-base: 1rem;
340
- --font-size-lg: 1.25rem;
341
-
342
- ## Border Radius
343
- --radius-sm: 4px; --radius-md: 8px; --radius-lg: 16px;
344
-
345
- ## Animation
346
- --transition-fast: 150ms ease;
347
- --transition-base: 250ms ease;
348
- ```
349
-
350
- ---
351
-
352
- ---
353
-
354
- ## Workflow
355
-
356
- ### Phase 1 — Blueprint Selection
357
- **Steps:**
358
- 1. Assess Preconditions to determine framework/purpose.
359
- 2. Select appropriate blueprint (coding, rag, workflow, enterprise).
360
-
361
- **Decision:**
362
- ```
363
- IF framework/purpose is clear
364
- → Confidence: HIGH → go to Phase 2
365
- ELSE
366
- → EXIT: BLOCKED — ask user
367
- ```
368
-
369
- ### Phase 2 — Scaffold Generation
370
- **Steps:**
371
- 1. Generate `project.yaml` manifest.
372
- 2. Create directory tree structure based on blueprint.
373
- 3. Configure tooling and generate `DESIGN.md` if UI project.
374
-
375
- **Decision:**
376
- ```
377
- IF directories and files are generated
378
- → Confidence: HIGH → go to Phase 3
379
- ELSE
380
- → EXIT: FAILED
381
- ```
382
-
383
- ### Phase 3 — Verification
384
- **Steps:**
385
- 1. Check Required Files Checklist against what was actually created.
386
- 2. Ensure no mandatory files are missing.
387
-
388
- **Decision:**
389
- ```
390
- IF all required files exist
391
- → EXIT: SUCCESS
392
- ELSE
393
- → EXIT: PARTIAL
394
- ```
395
-
396
- ---
397
-
398
- ## Evidence Format
399
-
400
- ```
401
- [SEVERITY] path/to/expected-file
402
- Issue: [MISSING_MANIFEST | MISSING_DESIGN_MD | WRONG_STRUCTURE]
403
- Confidence: HIGH
404
- Fix: [specific file to create]
405
- ```
406
-
407
- ---
408
-
409
- ## Priority Order
410
-
411
- | Priority | Task | Skip Threshold |
412
- |----------|------|----------------|
413
- | P1 | project.yaml manifest created | Never |
414
- | P2 | Core scaffolding per blueprint type | Never |
415
- | P3 | Tooling config | Budget < 40% |
416
- | P4 | DESIGN.md for UI projects | Never for UI |
417
- | P5 | README | Budget < 60% |
418
-
419
- ---
420
- ## Exit Codes
421
- | Code | Meaning | When |
422
- |------|---------|------|
423
- | SUCCESS | All required files created, structure matches framework standard | Full bootstrap complete |
424
- | PARTIAL | Structure created but DESIGN.md incomplete (UI project) | Follow-up needed |
425
- | BLOCKED | Framework/purpose not specified | Ask user |
426
- | FAILED | Cannot initialize (permission error, invalid framework) | Report error |
427
-
428
- ---
429
-
430
- ## Confidence Model
431
- | Level | Condition | Action |
432
- |-------|-----------|--------|
433
- | HIGH | Framework explicitly stated, directory structure clear | Build directly |
434
- | MEDIUM | Framework inferred from context (found React imports) | Note assumption, proceed |
435
- | LOW | Cannot determine framework or project type | EXIT: BLOCKED |
436
-
437
- ---
438
-
439
- ## Severity
440
- | Level | Definition | Example |
441
- |-------|-----------|----------|
442
- | CRITICAL | Security misconfiguration in bootstrap | .env with real secrets committed |
443
- | HIGH | Missing mandatory file blocks all future work | No DESIGN.md for UI project |
444
- | MEDIUM | Incomplete setup reduces developer experience | Missing ESLint config |
445
- | LOW | Cosmetic or optional file missing | Missing .editorconfig |
446
-
447
- ---
448
-
449
- ## Retry Policy
450
- ```
451
- File creation fails
452
- └─ Check: permission issue vs path error
453
- ├─ Path error → correct path and retry
454
- └─ Permission error → EXIT: FAILED, report exact path
455
- └─ Do NOT retry more than 1 time per file
456
- ```
457
-
458
- ---
459
-
460
- ## Escalation Rules
461
- ```
462
- BLOCKED: Framework or project type not specified
463
- Missing:
464
- - Framework name (React, Next.js, NestJS, Express, etc.)
465
- - Project purpose (web app, API, CLI, library)
466
- Questions:
467
- 1. Framework nào bạn muốn dùng?
468
- 2. Dự án này là web app, API server, hay CLI tool?
469
- Recommended Assumptions (if proceeding):
470
- - Default: Next.js 14 (App Router) + TypeScript + ESLint
471
- ```
472
-
473
- ---
474
-
475
- ## Handoff Contract
476
- ### Consumes
477
- ```json
478
- {
479
- "from": "user",
480
- "required_fields": ["framework", "project_purpose"],
481
- "optional_fields": ["project_name", "existing_dir"]
482
- }
483
- ```
484
- ### Produces
485
- ```json
486
- {
487
- "to": "qk-feature-delivery or qk-ui-builder",
488
- "output_fields": ["project_structure", "design_md_path", "tooling_config", "exit_code"]
489
- }
490
- ```
491
-
492
- ---
493
-
382
+ ## Workflow
383
+
384
+ ### Phase 1 Blueprint Selection
385
+ **Steps:**
386
+ 1. Assess Preconditions to determine framework/purpose.
387
+ 2. Select appropriate blueprint (coding, rag, workflow, enterprise).
388
+
389
+ **Decision:**
390
+ ```
391
+ IF framework/purpose is clear
392
+ → Confidence: HIGH → go to Phase 2
393
+ ELSE
394
+ EXIT: BLOCKED ask user
395
+ ```
396
+
397
+ ### Phase 2 Scaffold Generation
398
+ **Steps:**
399
+ 1. Generate `project.yaml` manifest.
400
+ 2. Create directory tree structure based on blueprint.
401
+ 3. Configure tooling and generate `DESIGN.md` if UI project.
402
+
403
+ **Decision:**
404
+ ```
405
+ IF directories and files are generated
406
+ Confidence: HIGH go to Phase 3
407
+ ELSE
408
+ → EXIT: FAILED
409
+ ```
410
+
411
+ ### Phase 3 Verification
412
+ **Steps:**
413
+ 1. Check Required Files Checklist against what was actually created.
414
+ 2. Ensure no mandatory files are missing.
415
+
416
+ **Decision:**
417
+ ```
418
+ IF all required files exist
419
+ EXIT: SUCCESS
420
+ ELSE
421
+ EXIT: PARTIAL
422
+ ```
423
+
424
+ ---
425
+
426
+ ## Evidence Format
427
+
428
+ ```
429
+ [SEVERITY] path/to/expected-file
430
+ Issue: [MISSING_MANIFEST | MISSING_DESIGN_MD | WRONG_STRUCTURE]
431
+ Confidence: HIGH
432
+ Fix: [specific file to create]
433
+ ```
434
+
435
+ ---
436
+
437
+ ## Priority Order
438
+
439
+ | Priority | Task | Skip Threshold |
440
+ |----------|------|----------------|
441
+ | P1 | project.yaml manifest created | Never |
442
+ | P2 | Core scaffolding per blueprint type | Never |
443
+ | P3 | Tooling config | Budget < 40% |
444
+ | P4 | DESIGN.md for UI projects | Never for UI |
445
+ | P5 | README | Budget < 60% |
446
+
447
+ ---
448
+ ## Exit Codes
449
+ | Code | Meaning | When |
450
+ |------|---------|------|
451
+ | SUCCESS | All required files created, structure matches framework standard | Full bootstrap complete |
452
+ | PARTIAL | Structure created but DESIGN.md incomplete (UI project) | Follow-up needed |
453
+ | BLOCKED | Framework/purpose not specified | Ask user |
454
+ | FAILED | Cannot initialize (permission error, invalid framework) | Report error |
455
+
456
+ ---
457
+
458
+ ## Confidence Model
459
+ | Level | Condition | Action |
460
+ |-------|-----------|--------|
461
+ | HIGH | Framework explicitly stated, directory structure clear | Build directly |
462
+ | MEDIUM | Framework inferred from context (found React imports) | Note assumption, proceed |
463
+ | LOW | Cannot determine framework or project type | EXIT: BLOCKED |
464
+
465
+ ---
466
+
467
+ ## Severity
468
+ | Level | Definition | Example |
469
+ |-------|-----------|----------|
470
+ | CRITICAL | Security misconfiguration in bootstrap | .env with real secrets committed |
471
+ | HIGH | Missing mandatory file blocks all future work | No DESIGN.md for UI project |
472
+ | MEDIUM | Incomplete setup reduces developer experience | Missing ESLint config |
473
+ | LOW | Cosmetic or optional file missing | Missing .editorconfig |
474
+
475
+ ---
476
+
477
+ ## Retry Policy
478
+ ```
479
+ File creation fails
480
+ └─ Check: permission issue vs path error
481
+ ├─ Path error correct path and retry
482
+ └─ Permission error → EXIT: FAILED, report exact path
483
+ └─ Do NOT retry more than 1 time per file
484
+ ```
485
+
486
+ ---
487
+
488
+ ## Escalation Rules
489
+ ```
490
+ BLOCKED: Framework or project type not specified
491
+ Missing:
492
+ - Framework name (React, Next.js, NestJS, Express, etc.)
493
+ - Project purpose (web app, API, CLI, library)
494
+ Questions:
495
+ 1. Framework nào bạn muốn dùng?
496
+ 2. Dự án này web app, API server, hay CLI tool?
497
+ Recommended Assumptions (if proceeding):
498
+ - Default: Next.js 14 (App Router) + TypeScript + ESLint
499
+ ```
500
+
501
+ ---
502
+
503
+ ## Handoff Contract
504
+ ### Consumes
505
+ ```json
506
+ {
507
+ "from": "user",
508
+ "required_fields": ["framework", "project_purpose"],
509
+ "optional_fields": ["project_name", "existing_dir"]
510
+ }
511
+ ```
512
+ ### Produces
513
+ ```json
514
+ {
515
+ "to": "qk-feature-delivery or qk-ui-builder",
516
+ "output_fields": ["project_structure", "design_md_path", "tooling_config", "exit_code"]
517
+ }
518
+ ```
519
+
520
+ ---