ai-developer-skill-os 9.1.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 (38) 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 +77 -0
  6. package/.agents/skills/qk-access-policy/SKILL.md +80 -0
  7. package/.agents/skills/qk-agent-observability/SKILL.md +80 -0
  8. package/.agents/skills/qk-ai-builder/SKILL.md +80 -0
  9. package/.agents/skills/qk-api-lifecycle/SKILL.md +80 -0
  10. package/.agents/skills/qk-bug-resolution/SKILL.md +80 -0
  11. package/.agents/skills/qk-code-review/SKILL.md +80 -0
  12. package/.agents/skills/qk-context-loader/SKILL.md +80 -0
  13. package/.agents/skills/qk-data-lifecycle/SKILL.md +80 -0
  14. package/.agents/skills/qk-db-optimizer/SKILL.md +80 -0
  15. package/.agents/skills/qk-design-system-engineering/SKILL.md +80 -0
  16. package/.agents/skills/qk-devops-platform/SKILL.md +80 -0
  17. package/.agents/skills/qk-docs/SKILL.md +80 -0
  18. package/.agents/skills/qk-engineering-standard/SKILL.md +80 -0
  19. package/.agents/skills/qk-fe-api-integration/SKILL.md +80 -0
  20. package/.agents/skills/qk-feature-delivery/SKILL.md +80 -0
  21. package/.agents/skills/qk-frontend-architecture/SKILL.md +80 -0
  22. package/.agents/skills/qk-orchestrator/SKILL.md +80 -0
  23. package/.agents/skills/qk-product-specification/SKILL.md +80 -0
  24. package/.agents/skills/qk-production-release/SKILL.md +80 -0
  25. package/.agents/skills/qk-project-bootstrap/SKILL.md +375 -401
  26. package/.agents/skills/qk-project-health/SKILL.md +80 -0
  27. package/.agents/skills/qk-project-memory/SKILL.md +13 -17
  28. package/.agents/skills/qk-refactor/SKILL.md +80 -0
  29. package/.agents/skills/qk-security-audit/SKILL.md +80 -0
  30. package/.agents/skills/qk-system-evolution/SKILL.md +80 -0
  31. package/.agents/skills/qk-test-engineering/SKILL.md +80 -0
  32. package/.agents/skills/qk-ui-audit/SKILL.md +80 -0
  33. package/.agents/skills/qk-ui-system-builder/SKILL.md +80 -0
  34. package/.agents/skills/qk-validation-gate/SKILL.md +80 -0
  35. package/.agents/skills/qk-web-quality-gate/SKILL.md +80 -0
  36. package/README.md +7 -7
  37. package/package.json +1 -1
  38. 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,333 +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
  ---
218
262
 
219
- ### Learning Flow (AI tự học có kiểm soát)
220
- - Trong quá trình làm việc, AI được phép tự phát hiện và tạo **Candidate Memory** khi nhận thấy:
221
- - Hard Bug khả năng tái diễn.
222
- - Pattern làm việc lặp lại trong dự án.
223
- - Convention hoặc quy tắc kiến trúc mới.
224
- - Quyết định Architecture quan trọng.
225
- - Tech Debt Pattern hoặc Code Smell tính hệ thống.
226
- - 👉 *Domain Harvest:* Cấu trúc thư mục hoặc template scaffold mẫu mới của dự án.
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
227
277
 
228
- - Candidate Memory chỉ là bản nháp quan sát, chưa phải tri thức chính thức.
229
- - Candidate Memory có thể lưu tạm tại: `.ai-local/candidates/`
230
- - AI không được tự động Promote Candidate Memory thành Project Knowledge.
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
+ ```
231
334
 
232
335
  ---
233
336
 
234
- ### Post-flight Harvest (Đề xuất → Phê duyệt)
235
- Sau khi hoàn thành task:
236
- - AI đánh giá các Candidate Memory đã tạo.
237
- - Nếu phát hiện tri thức giá trị tái sử dụng:
238
- - Đề xuất người dùng xem xét.
239
- - Gửi yêu cầu phê duyệt thông qua:
240
- - `/learn`
241
- - `qk-project-memory`
242
- - Chỉ sau khi được phê duyệt, Candidate Memory mới được chuyển thành Knowledge chính thức:
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%);
243
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;
244
378
  ```
245
- .ai-local/candidates/ ──(Approve)──> .agents/knowledge/index.yaml
379
+
380
+ ---
381
+
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
246
395
  ```
247
396
 
248
- - Project Knowledge phải được xem như tài sản kỹ thuật của dự án:
249
- - Có thể review, cập nhật, loại bỏ và có lịch sử thay đổi.
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
+ ```
250
423
 
251
424
  ---
252
425
 
253
- ### Ignore (Không đưa vào Memory)
254
- Không lưu:
255
- - Trace log của một session đơn lẻ.
256
- - Temporary debugging data.
257
- - Output của một lần chạy test/scan.
258
- - Report health tạm thời của một đợt kiểm tra.
259
- - Lỗi nhỏ chỉ xảy ra một lần.
260
- - Thông tin không có khả năng tái sử dụng.
261
- - 👉 *Domain Ignore:* File cấu hình local rác (đã đưa vào gitignore).
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
+ ```
262
434
 
263
435
  ---
264
436
 
265
- ### Golden Rule
266
- > **AI được phép học, nhưng không được tự quyết định tri thức chính thức.**
267
- > **AI quan sát Đề xuất → Con người phê duyệt → Dự án tiến hóa.**
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 |
268
464
 
269
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
+
270
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
+
271
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 là web app, API server, hay CLI tool?
497
+ Recommended Assumptions (if proceeding):
498
+ - Default: Next.js 14 (App Router) + TypeScript + ESLint
499
+ ```
500
+
272
501
  ---
273
502
 
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
-
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
+ ---