ai-developer-skill-os 9.1.1 → 9.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/AGENTS.md +139 -42
- package/.agents/DEV_PROFILE.md +95 -0
- package/.agents/registry/capability-graph.yml +171 -334
- package/.agents/registry/graph.json +52 -18
- package/.agents/registry/index.yaml +66 -12
- package/.agents/registry/skills-index.yml +204 -447
- package/.agents/rules/coding.md +23 -0
- package/.agents/rules/global.md +44 -30
- package/.agents/skills/_template/SKILL.md +2 -300
- package/.agents/skills/qk-access-policy/SKILL.md +98 -393
- package/.agents/skills/qk-agent-observability/SKILL.md +3 -359
- package/.agents/skills/qk-ai-builder/SKILL.md +132 -485
- package/.agents/skills/qk-api-consumer/SKILL.md +256 -0
- package/.agents/skills/qk-api-consumer/capability.yaml +21 -0
- package/.agents/skills/qk-api-consumer/evals/scorecard.yaml +29 -0
- package/.agents/skills/qk-api-lifecycle/SKILL.md +133 -376
- package/.agents/skills/qk-bug-resolution/SKILL.md +128 -481
- package/.agents/skills/qk-code-review/SKILL.md +142 -340
- package/.agents/skills/qk-context-loader/SKILL.md +99 -391
- package/.agents/skills/qk-data-engineer/SKILL.md +253 -0
- package/.agents/skills/qk-data-lifecycle/SKILL.md +89 -408
- package/.agents/skills/qk-db-optimizer/SKILL.md +102 -408
- package/.agents/skills/qk-design-system-engineering/SKILL.md +76 -381
- package/.agents/skills/qk-devops-platform/SKILL.md +77 -383
- package/.agents/skills/qk-docs/SKILL.md +88 -414
- package/.agents/skills/qk-engineering-standard/SKILL.md +4 -508
- package/.agents/skills/qk-fe-api-integration/SKILL.md +343 -263
- package/.agents/skills/qk-fe-api-integration/evals/scorecard.yaml +29 -29
- package/.agents/skills/qk-feature-delivery/SKILL.md +137 -365
- package/.agents/skills/qk-feature-delivery/evals/scorecard.yaml +1 -1
- package/.agents/skills/qk-frontend-architecture/SKILL.md +5 -399
- package/.agents/skills/qk-help/evals/scorecard.yaml +13 -13
- package/.agents/skills/qk-orchestrator/SKILL.md +63 -422
- package/.agents/skills/qk-orchestrator/references/routing-table.md +10 -14
- package/.agents/skills/qk-product-specification/SKILL.md +70 -399
- package/.agents/skills/qk-production-release/SKILL.md +80 -457
- package/.agents/skills/qk-project-audit/SKILL.md +174 -0
- package/.agents/skills/qk-project-bootstrap/SKILL.md +244 -392
- package/.agents/skills/qk-project-health/SKILL.md +97 -416
- package/.agents/skills/qk-project-memory/SKILL.md +76 -21
- package/.agents/skills/qk-refactor/SKILL.md +167 -304
- package/.agents/skills/qk-security-audit/SKILL.md +141 -383
- package/.agents/skills/qk-security-audit/capability.yaml +1 -2
- package/.agents/skills/qk-system-evolution/SKILL.md +343 -263
- package/.agents/skills/qk-system-evolution/evals/scorecard.yaml +26 -26
- package/.agents/skills/qk-test-engineering/SKILL.md +119 -429
- package/.agents/skills/qk-ui-audit/SKILL.md +73 -457
- package/.agents/skills/qk-ui-builder/SKILL.md +521 -482
- package/.agents/skills/qk-ui-system-builder/SKILL.md +68 -434
- package/.agents/skills/qk-upgrade/SKILL.md +301 -0
- package/.agents/skills/qk-upgrade/capability.yaml +24 -0
- package/.agents/skills/qk-upgrade/evals/scorecard.yaml +26 -0
- package/.agents/skills/qk-validation-gate/SKILL.md +4 -523
- package/.agents/skills/qk-web-quality-gate/SKILL.md +85 -383
- package/.agents/workflows/bug-resolution.yml +6 -6
- package/.agents/workflows/context-discovery.yml +94 -0
- package/.agents/workflows/feature-delivery.yml +8 -4
- package/.agents/workflows/refactor.yml +6 -3
- package/.agents/workflows/shared/quality-gate.yml +94 -0
- package/.agents/workflows/skin-governance.yml +115 -0
- package/README.md +152 -67
- package/package.json +2 -2
- package/tooling/build-registry.js +30 -8
|
@@ -1,520 +1,372 @@
|
|
|
1
1
|
---
|
|
2
2
|
# ── Identity ───────────────────────────────────────────────
|
|
3
3
|
name: qk-project-bootstrap
|
|
4
|
-
version: 9.
|
|
4
|
+
version: 9.2.0
|
|
5
5
|
status: stable
|
|
6
|
-
description: "Khởi tạo dự án mới
|
|
6
|
+
description: "Khởi tạo dự án mới HOẶC setup DEV_PROFILE.md cho dự án đang chạy — auto-detect stack từ manifest files, không hỏi lại những gì đã có thể đọc được. Dùng skill này khi user nhắc đến: khởi tạo dự án, project setup, scaffold, bootstrap, new app, setup dev profile, detect stack, cấu hình skin — kể cả khi chỉ nói 'bắt đầu dự án mới'."
|
|
7
7
|
platforms: [antigravity, claude-code, cursor, windsurf, kilo-code]
|
|
8
8
|
|
|
9
|
-
# ──
|
|
9
|
+
# ── Classification ─────────────────────────────────────────
|
|
10
10
|
type: capability
|
|
11
11
|
|
|
12
12
|
intent:
|
|
13
13
|
- project-initialization
|
|
14
|
-
- setup
|
|
14
|
+
- dev-profile-setup
|
|
15
|
+
- stack-detection
|
|
16
|
+
- scaffolding
|
|
15
17
|
|
|
16
18
|
complexity:
|
|
17
19
|
level: high
|
|
18
20
|
criteria:
|
|
19
21
|
files_affected: "10+"
|
|
20
|
-
has_behavior_change:
|
|
21
|
-
has_external_dependency:
|
|
22
|
+
has_behavior_change: false
|
|
23
|
+
has_external_dependency: false
|
|
22
24
|
has_breaking_change: false
|
|
23
25
|
|
|
24
26
|
triggers:
|
|
25
|
-
- "khởi tạo
|
|
26
|
-
- "
|
|
27
|
+
- "khởi tạo dự án"
|
|
28
|
+
- "project setup"
|
|
29
|
+
- "scaffold"
|
|
27
30
|
- "bootstrap"
|
|
28
|
-
- "
|
|
29
|
-
- "
|
|
31
|
+
- "new app"
|
|
32
|
+
- "setup dev profile"
|
|
33
|
+
- "detect stack"
|
|
34
|
+
- "cấu hình skin"
|
|
30
35
|
|
|
31
|
-
# ──
|
|
36
|
+
# ── References ─────────────────────────────────────────────
|
|
32
37
|
workflow: feature-delivery
|
|
33
38
|
|
|
34
39
|
rules:
|
|
35
40
|
- global
|
|
36
41
|
- safety
|
|
37
|
-
- filesystem-boundary
|
|
38
42
|
|
|
39
43
|
tools:
|
|
40
44
|
- filesystem
|
|
41
45
|
- terminal
|
|
42
46
|
|
|
43
47
|
related_skills:
|
|
44
|
-
- qk-
|
|
48
|
+
- qk-context-loader # Load sau khi DEV_PROFILE.md đã được tạo
|
|
45
49
|
|
|
46
50
|
knowledge_scope:
|
|
47
51
|
owns:
|
|
48
52
|
- project-structure
|
|
49
|
-
-
|
|
53
|
+
- dev-profile-setup
|
|
54
|
+
- stack-detection
|
|
50
55
|
references:
|
|
51
56
|
- architecture
|
|
52
57
|
- security
|
|
53
|
-
- anti-patterns
|
|
54
58
|
|
|
55
|
-
# ──
|
|
59
|
+
# ── Verification ───────────────────────────────────────────
|
|
56
60
|
verification:
|
|
57
61
|
required: true
|
|
58
|
-
strategy: bootstrap
|
|
59
|
-
|
|
60
|
-
selection:
|
|
61
|
-
priority: medium
|
|
62
|
-
confidence_threshold: 0.85
|
|
62
|
+
strategy: bootstrap
|
|
63
63
|
|
|
64
64
|
examples: []
|
|
65
65
|
learnings: []
|
|
66
66
|
|
|
67
|
-
# ──
|
|
67
|
+
# ── Runtime ────────────────────────────────────────────────
|
|
68
68
|
execution_mode: deterministic
|
|
69
|
-
cost:
|
|
70
|
-
latency:
|
|
69
|
+
cost: low
|
|
70
|
+
latency: fast
|
|
71
71
|
risk: low
|
|
72
|
-
side_effects:
|
|
73
|
-
produces: [
|
|
74
|
-
consumes: [user-description]
|
|
72
|
+
side_effects: create_files
|
|
73
|
+
produces: [dev-profile, scaffold]
|
|
74
|
+
consumes: [manifest-files, user-description]
|
|
75
75
|
|
|
76
76
|
token_budget:
|
|
77
|
-
max_files_read:
|
|
78
|
-
max_lines_per_read:
|
|
77
|
+
max_files_read: 10
|
|
78
|
+
max_lines_per_read: 80
|
|
79
79
|
max_shell_commands: 2
|
|
80
80
|
stop_early: true
|
|
81
81
|
|
|
82
82
|
exit_codes: [SUCCESS, BLOCKED, FAILED, PARTIAL]
|
|
83
83
|
---
|
|
84
84
|
|
|
85
|
-
# qk-project-bootstrap — Project
|
|
85
|
+
# qk-project-bootstrap — Project Setup & Stack Detection
|
|
86
86
|
|
|
87
87
|
> **Language rule:** Code, identifiers, file names → English. Explanations, summaries → Vietnamese.
|
|
88
88
|
|
|
89
89
|
---
|
|
90
90
|
|
|
91
|
-
##
|
|
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
|
-
|
|
100
|
-
### Pre-flight Retrieve (Trước khi thực thi)
|
|
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:
|
|
102
|
-
bắt buộc tra cứu:
|
|
103
|
-
- `.ai-local/knowledge/index.yaml` (Private Local Knowledge)
|
|
104
|
-
|
|
105
|
-
- Ưu tiên sử dụng các Knowledge đang có trạng thái `Active` thuộc:
|
|
106
|
-
- Architecture
|
|
107
|
-
- Hard Bug
|
|
108
|
-
- Convention
|
|
109
|
-
- Pattern
|
|
110
|
-
- Tech Debt Pattern
|
|
111
|
-
- 👉 *Domain Focus:* Architecture / Convention (vd: mô hình 4-folder RAG/Agent, blueprint quy chuẩn V9).
|
|
112
|
-
|
|
113
|
-
- Memory chỉ đóng vai trò **Navigator (bản đồ chỉ đường)**.
|
|
114
|
-
Không được xem Memory là Source of Truth.
|
|
115
|
-
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.
|
|
116
|
-
|
|
117
|
-
---
|
|
118
|
-
|
|
119
|
-
### Learning Flow (AI tự học có kiểm soát)
|
|
120
|
-
- 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:
|
|
121
|
-
- Hard Bug có khả năng tái diễn.
|
|
122
|
-
- Pattern làm việc lặp lại trong dự án.
|
|
123
|
-
- Convention hoặc quy tắc kiến trúc mới.
|
|
124
|
-
- Quyết định Architecture quan trọng.
|
|
125
|
-
- Tech Debt Pattern hoặc Code Smell có tính hệ thống.
|
|
126
|
-
- 👉 *Domain Harvest:* Cấu trúc thư mục hoặc template scaffold mẫu mới của dự án.
|
|
127
|
-
|
|
128
|
-
- Candidate Memory chỉ là bản nháp quan sát, chưa phải tri thức chính thức.
|
|
129
|
-
- Candidate Memory có thể lưu tạm tại: `.ai-local/candidates/`
|
|
130
|
-
- AI không được tự động Promote Candidate Memory thành Project Knowledge.
|
|
131
|
-
|
|
132
|
-
---
|
|
133
|
-
|
|
134
|
-
### Post-flight Harvest (Đề xuất → Phê duyệt)
|
|
135
|
-
Sau khi hoàn thành task:
|
|
136
|
-
- AI đánh giá các Candidate Memory đã tạo.
|
|
137
|
-
- Nếu phát hiện tri thức có giá trị tái sử dụng:
|
|
138
|
-
- Đề xuất người dùng xem xét.
|
|
139
|
-
- Gửi yêu cầu phê duyệt thông qua:
|
|
140
|
-
- `/learn`
|
|
141
|
-
- `qk-project-memory`
|
|
142
|
-
- Chỉ sau khi được phê duyệt, Candidate Memory mới được chuyển thành Knowledge chính thức:
|
|
143
|
-
|
|
144
|
-
```
|
|
145
|
-
.ai-local/candidates/ ──(Approve)──> .ai-local/knowledge/index.yaml
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
- Project Knowledge phải được xem như tài sản kỹ thuật của dự án:
|
|
149
|
-
- Có thể review, cập nhật, loại bỏ và có lịch sử thay đổi.
|
|
150
|
-
|
|
151
|
-
---
|
|
152
|
-
|
|
153
|
-
### Ignore (Không đưa vào Memory)
|
|
154
|
-
Không lưu:
|
|
155
|
-
- Trace log của một session đơn lẻ.
|
|
156
|
-
- Temporary debugging data.
|
|
157
|
-
- Output của một lần chạy test/scan.
|
|
158
|
-
- Report health tạm thời của một đợt kiểm tra.
|
|
159
|
-
- Lỗi nhỏ chỉ xảy ra một lần.
|
|
160
|
-
- Thông tin không có khả năng tái sử dụng.
|
|
161
|
-
- 👉 *Domain Ignore:* File cấu hình local rác (đã đưa vào gitignore).
|
|
91
|
+
## Preconditions
|
|
162
92
|
|
|
163
|
-
|
|
93
|
+
Trước khi khởi tạo dự án hoặc setup DEV_PROFILE.md, AI BẮT BUỘC kiểm tra:
|
|
164
94
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
95
|
+
- [ ] Xác định thư mục root của dự án.
|
|
96
|
+
- [ ] Kiểm tra xem thư mục có file manifest nào tồn tại không (`package.json`, `requirements.txt`, `go.mod`, `Cargo.toml`, v.v.) để chọn Mode A (dự án mới) hay Mode B (dự án hiện có).
|
|
97
|
+
- [ ] Kiểm tra xem `.agents/DEV_PROFILE.md` đã tồn tại chưa. Nếu đã có và user không yêu cầu ghi đè:
|
|
98
|
+
→ **EXIT: PARTIAL**
|
|
99
|
+
→ Đề xuất cập nhật hoặc giữ nguyên thay vì overwrite toàn bộ.
|
|
168
100
|
|
|
169
101
|
---
|
|
170
102
|
|
|
103
|
+
## Hai chế độ hoạt động
|
|
171
104
|
|
|
105
|
+
**Mode A — New Project:** Tạo project mới từ đầu theo Blueprint template
|
|
106
|
+
**Mode B — Existing Project:** Scan project đang có, detect stack, tạo/cập nhật `DEV_PROFILE.md`
|
|
172
107
|
|
|
173
|
-
|
|
174
|
-
-
|
|
175
|
-
|
|
176
|
-
|
|
108
|
+
AI tự xác định mode dựa vào context:
|
|
109
|
+
- Có `package.json` / `requirements.txt` / `go.mod` tồn tại → **Mode B**
|
|
110
|
+
- Không có gì → **Mode A**
|
|
111
|
+
- User nói rõ → follow user
|
|
177
112
|
|
|
178
113
|
---
|
|
179
114
|
|
|
180
|
-
|
|
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)
|
|
115
|
+
## Scope
|
|
184
116
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
- 👉 *Domain Focus:* Architecture / Convention (vd: mô hình 4-folder RAG/Agent, blueprint quy chuẩn V9).
|
|
117
|
+
✅ Skill này làm:
|
|
118
|
+
- Auto-detect tech stack từ manifest files
|
|
119
|
+
- Tạo / cập nhật `.agents/DEV_PROFILE.md` với stack được detect
|
|
120
|
+
- Tạo cấu trúc project theo Blueprint template đúng loại
|
|
121
|
+
- Setup `.gitignore`, `.env.example`, `README.md` ban đầu
|
|
122
|
+
- Gợi ý skills phù hợp với stack được detect
|
|
192
123
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
124
|
+
❌ Skill này KHÔNG làm:
|
|
125
|
+
- Viết business logic hay feature code
|
|
126
|
+
- Setup CI/CD pipeline (→ `qk-devops-platform`)
|
|
127
|
+
- Deploy hay publish (→ `qk-production-release`)
|
|
128
|
+
- Viết test (→ `qk-test-engineering`)
|
|
196
129
|
|
|
197
130
|
---
|
|
198
131
|
|
|
199
|
-
|
|
200
|
-
- 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:
|
|
201
|
-
- Hard Bug có khả năng tái diễn.
|
|
202
|
-
- Pattern làm việc lặp lại trong dự án.
|
|
203
|
-
- Convention hoặc quy tắc kiến trúc mới.
|
|
204
|
-
- Quyết định Architecture quan trọng.
|
|
205
|
-
- Tech Debt Pattern hoặc Code Smell có tính hệ thống.
|
|
206
|
-
- 👉 *Domain Harvest:* Cấu trúc thư mục hoặc template scaffold mẫu mới của dự án.
|
|
132
|
+
## Execution Steps — Mode B: Detect Stack cho dự án đang có
|
|
207
133
|
|
|
208
|
-
|
|
209
|
-
- Candidate Memory có thể lưu tạm tại: `.ai-local/candidates/`
|
|
210
|
-
- AI không được tự động Promote Candidate Memory thành Project Knowledge.
|
|
134
|
+
> Đây là mode quan trọng nhất — dùng khi muốn setup skin cho project hiện tại.
|
|
211
135
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
### Post-flight Harvest (Đề xuất → Phê duyệt)
|
|
215
|
-
Sau khi hoàn thành task:
|
|
216
|
-
- AI đánh giá các Candidate Memory đã tạo.
|
|
217
|
-
- Nếu phát hiện tri thức có giá trị tái sử dụng:
|
|
218
|
-
- Đề xuất người dùng xem xét.
|
|
219
|
-
- Gửi yêu cầu phê duyệt thông qua:
|
|
220
|
-
- `/learn`
|
|
221
|
-
- `qk-project-memory`
|
|
222
|
-
- Chỉ sau khi được phê duyệt, Candidate Memory mới được chuyển thành Knowledge chính thức:
|
|
223
|
-
|
|
224
|
-
```
|
|
225
|
-
.ai-local/candidates/ ──(Approve)──> .ai-local/knowledge/index.yaml
|
|
136
|
+
### Step 1 — Scan Manifest Files
|
|
226
137
|
```
|
|
138
|
+
Actions (chạy song song, đọc lần lượt từng file nếu tồn tại):
|
|
227
139
|
|
|
228
|
-
|
|
229
|
-
-
|
|
140
|
+
JavaScript / TypeScript:
|
|
141
|
+
- package.json → dependencies, devDependencies, scripts
|
|
142
|
+
- tsconfig.json → strict mode, paths, target
|
|
143
|
+
- .nvmrc / .node-version → Node version
|
|
230
144
|
|
|
231
|
-
|
|
145
|
+
Python:
|
|
146
|
+
- requirements.txt / requirements/*.txt
|
|
147
|
+
- pyproject.toml (poetry/pdm sections)
|
|
148
|
+
- setup.py / setup.cfg
|
|
149
|
+
- Pipfile
|
|
232
150
|
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
- Trace log của một session đơn lẻ.
|
|
236
|
-
- Temporary debugging data.
|
|
237
|
-
- Output của một lần chạy test/scan.
|
|
238
|
-
- Report health tạm thời của một đợt kiểm tra.
|
|
239
|
-
- Lỗi nhỏ chỉ xảy ra một lần.
|
|
240
|
-
- Thông tin không có khả năng tái sử dụng.
|
|
241
|
-
- 👉 *Domain Ignore:* File cấu hình local rác (đã đưa vào gitignore).
|
|
151
|
+
Go:
|
|
152
|
+
- go.mod → module name, Go version, dependencies
|
|
242
153
|
|
|
243
|
-
|
|
154
|
+
Rust:
|
|
155
|
+
- Cargo.toml
|
|
244
156
|
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
> **AI quan sát → Đề xuất → Con người phê duyệt → Dự án tiến hóa.**
|
|
157
|
+
Java / Kotlin:
|
|
158
|
+
- pom.xml / build.gradle / build.gradle.kts
|
|
248
159
|
|
|
249
|
-
|
|
160
|
+
Data / AI:
|
|
161
|
+
- dbt_project.yml → dbt version, profile
|
|
162
|
+
- airflow.cfg / dag folder structure
|
|
163
|
+
- mlflow.yml / kedro.yml
|
|
164
|
+
- .env.example → DB_URL, OPENAI_API_KEY hints
|
|
250
165
|
|
|
251
|
-
|
|
252
|
-
-
|
|
253
|
-
-
|
|
166
|
+
Infrastructure:
|
|
167
|
+
- docker-compose.yml → services (db type, cache, queue)
|
|
168
|
+
- Dockerfile → base image → language + version
|
|
169
|
+
- .github/workflows/ → CI tools
|
|
170
|
+
- terraform/ / pulumi/ → infra provider
|
|
254
171
|
|
|
172
|
+
Output: raw_detected = { language, frameworks[], databases[], tools[] }
|
|
255
173
|
```
|
|
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
|
-
|
|
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
174
|
|
|
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
|
|
175
|
+
### Step 2 — Classify Stack
|
|
304
176
|
```
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
177
|
+
Inputs: raw_detected
|
|
178
|
+
Actions:
|
|
179
|
+
Determine role từ stack combination:
|
|
180
|
+
|
|
181
|
+
fe: React/Vue/Angular + NO backend framework trong cùng repo
|
|
182
|
+
be: Express/FastAPI/NestJS/Django + NO React/Vue trong cùng repo
|
|
183
|
+
fullstack: Frontend framework + Backend framework TRONG CÙNG REPO
|
|
184
|
+
(Next.js = fullstack mặc định; Nuxt = fullstack mặc định)
|
|
185
|
+
data: dbt / Airflow / Spark / Dagster / Prefect / Pandas heavy
|
|
186
|
+
ai-engineer: LangChain / LlamaIndex / OpenAI SDK + vector DB
|
|
187
|
+
devops: Terraform / Pulumi / GitHub Actions heavy, ít application code
|
|
188
|
+
|
|
189
|
+
Nếu ambiguous → default: fullstack, ghi chú để user confirm
|
|
190
|
+
|
|
191
|
+
Map dependencies → specific stack fields:
|
|
192
|
+
|
|
193
|
+
frontend: next → "Next.js", nuxt → "Nuxt 3", react (no next) → "React",
|
|
194
|
+
vue → "Vue 3", angular → "Angular", svelte → "SvelteKit"
|
|
195
|
+
backend: express → "Express", fastapi → "FastAPI", nestjs → "NestJS",
|
|
196
|
+
django → "Django", laravel → "Laravel", gin → "Gin (Go)"
|
|
197
|
+
database: pg/postgres → "PostgreSQL", mysql → "MySQL",
|
|
198
|
+
mongodb → "MongoDB", sqlite → "SQLite",
|
|
199
|
+
supabase → "Supabase", prisma → also check schema.prisma
|
|
200
|
+
orm: prisma → "Prisma", typeorm → "TypeORM", drizzle → "Drizzle",
|
|
201
|
+
sqlalchemy → "SQLAlchemy", sequelize → "Sequelize"
|
|
202
|
+
css: tailwind → "Tailwind CSS", sass/scss → "SCSS",
|
|
203
|
+
styled-components → "Styled Components", @emotion → "Emotion"
|
|
204
|
+
state: zustand → "Zustand", redux → "Redux Toolkit",
|
|
205
|
+
jotai → "Jotai", pinia → "Pinia", @tanstack/query → "React Query"
|
|
206
|
+
auth: next-auth/auth.js → "NextAuth", clerk → "Clerk",
|
|
207
|
+
passport → "Passport.js", supabase/auth → "Supabase Auth"
|
|
208
|
+
test: jest → "Jest", vitest → "Vitest", pytest → "Pytest",
|
|
209
|
+
playwright → "Playwright", cypress → "Cypress"
|
|
210
|
+
language: typescript in deps → "TypeScript", python → "Python",
|
|
211
|
+
go.mod exists → "Go"
|
|
212
|
+
|
|
213
|
+
Output: classified_stack = fully mapped stack object
|
|
323
214
|
```
|
|
324
215
|
|
|
325
|
-
### 3
|
|
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
|
|
216
|
+
### Step 3 — Tạo / Cập nhật DEV_PROFILE.md
|
|
333
217
|
```
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
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)
|
|
218
|
+
Inputs: classified_stack, detected role
|
|
219
|
+
Actions:
|
|
220
|
+
- Đọc DEV_PROFILE.md hiện tại nếu tồn tại (không overwrite những gì user đã điền)
|
|
221
|
+
- Điền các field detect được, giữ nguyên field user đã điền tay
|
|
222
|
+
- Để trống những field không detect được (không đoán mò)
|
|
223
|
+
- Thêm comment "# auto-detected" sau mỗi giá trị được detect
|
|
224
|
+
- Nếu có conflict giữa detected và existing → giữ existing, ghi chú
|
|
225
|
+
|
|
226
|
+
Output: .agents/DEV_PROFILE.md được điền đầy đủ phần detect được
|
|
351
227
|
```
|
|
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
228
|
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
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;
|
|
229
|
+
### Step 4 — Report & Suggest Next Steps
|
|
230
|
+
```
|
|
231
|
+
Actions:
|
|
232
|
+
- Hiển thị detected stack summary cho user confirm
|
|
233
|
+
- List những field còn trống cần user điền tay
|
|
234
|
+
- Suggest 3 skills phù hợp nhất để bắt đầu với stack này
|
|
235
|
+
- Suggest conventions dựa trên stack (ví dụ: Next.js → feature-based folder)
|
|
378
236
|
```
|
|
379
237
|
|
|
380
238
|
---
|
|
381
239
|
|
|
382
|
-
##
|
|
240
|
+
## Execution Steps — Mode A: New Project
|
|
383
241
|
|
|
384
|
-
###
|
|
385
|
-
**Steps:**
|
|
386
|
-
1. Assess Preconditions to determine framework/purpose.
|
|
387
|
-
2. Select appropriate blueprint (coding, rag, workflow, enterprise).
|
|
242
|
+
### Blueprint Types
|
|
388
243
|
|
|
389
|
-
**
|
|
244
|
+
**Type 1: Standard Web App** (fe / be / fullstack)
|
|
390
245
|
```
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
246
|
+
Cấu trúc:
|
|
247
|
+
src/
|
|
248
|
+
├── features/ # Feature-based modules
|
|
249
|
+
├── components/ # Shared UI components
|
|
250
|
+
├── lib/ # Utilities, helpers
|
|
251
|
+
├── hooks/ # Custom React hooks (nếu React)
|
|
252
|
+
├── types/ # TypeScript interfaces
|
|
253
|
+
├── api/ # API layer / service functions
|
|
254
|
+
└── config/ # App configuration
|
|
255
|
+
|
|
256
|
+
Files sinh ra:
|
|
257
|
+
.gitignore, .env.example, README.md,
|
|
258
|
+
DESIGN.md (placeholder), .agents/DEV_PROFILE.md (pre-filled)
|
|
395
259
|
```
|
|
396
260
|
|
|
397
|
-
|
|
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:**
|
|
261
|
+
**Type 2: RAG / AI Agent** (ai-engineer)
|
|
404
262
|
```
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
263
|
+
Cấu trúc (4-folder chuẩn):
|
|
264
|
+
prompts/ # System prompts, few-shot examples
|
|
265
|
+
data/
|
|
266
|
+
├── raw/ # Source data — KHÔNG bao giờ edit
|
|
267
|
+
├── processed/ # Cleaned, chunked
|
|
268
|
+
└── embeddings/ # Vector representations
|
|
269
|
+
agents/ # Agent definitions, tool configs
|
|
270
|
+
evals/
|
|
271
|
+
├── traces/ # Execution logs
|
|
272
|
+
├── datasets/ # Golden Q&A sets
|
|
273
|
+
└── scorecards/ # Metric definitions
|
|
274
|
+
|
|
275
|
+
Files sinh ra:
|
|
276
|
+
.gitignore (data/raw/, .env), .env.example,
|
|
277
|
+
README.md, .agents/DEV_PROFILE.md (ai-engineer role pre-filled)
|
|
409
278
|
```
|
|
410
279
|
|
|
411
|
-
|
|
412
|
-
**Steps:**
|
|
413
|
-
1. Check Required Files Checklist against what was actually created.
|
|
414
|
-
2. Ensure no mandatory files are missing.
|
|
415
|
-
|
|
416
|
-
**Decision:**
|
|
280
|
+
**Type 3: Data Pipeline** (data)
|
|
417
281
|
```
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
→
|
|
282
|
+
Cấu trúc:
|
|
283
|
+
dags/ / pipelines/ # DAG definitions
|
|
284
|
+
models/
|
|
285
|
+
├── staging/ # Raw → cleaned
|
|
286
|
+
├── intermediate/ # Business transforms
|
|
287
|
+
└── mart/ # Final analytics tables
|
|
288
|
+
tests/ # Data quality tests
|
|
289
|
+
docs/ # Data lineage docs
|
|
290
|
+
seeds/ # Static reference data
|
|
291
|
+
|
|
292
|
+
Files sinh ra:
|
|
293
|
+
.gitignore, .env.example, README.md,
|
|
294
|
+
dbt_project.yml (nếu dbt), .agents/DEV_PROFILE.md (data role)
|
|
422
295
|
```
|
|
423
296
|
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
## Evidence Format
|
|
427
|
-
|
|
297
|
+
**Type 4: DevOps / Platform** (devops)
|
|
428
298
|
```
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
299
|
+
Cấu trúc:
|
|
300
|
+
.github/workflows/ # CI/CD pipelines
|
|
301
|
+
terraform/ / pulumi/ # IaC modules
|
|
302
|
+
scripts/ # Automation scripts
|
|
303
|
+
docs/
|
|
304
|
+
├── runbooks/ # Incident response
|
|
305
|
+
└── architecture/ # System diagrams
|
|
306
|
+
|
|
307
|
+
Files sinh ra:
|
|
308
|
+
.gitignore, .env.example, README.md,
|
|
309
|
+
.agents/DEV_PROFILE.md (devops role)
|
|
433
310
|
```
|
|
434
311
|
|
|
435
312
|
---
|
|
436
313
|
|
|
437
|
-
##
|
|
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% |
|
|
314
|
+
## Prompt Template
|
|
446
315
|
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
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 |
|
|
316
|
+
```
|
|
317
|
+
Mode: [new / existing / profile-only]
|
|
318
|
+
Role: [fe / be / fullstack / data / ai-engineer / devops — hoặc "auto-detect"]
|
|
319
|
+
Name: [Tên project]
|
|
320
|
+
Mô tả: [1-2 câu app làm gì]
|
|
321
|
+
Stack: [Nếu biết rồi — hoặc để trống để AI detect]
|
|
322
|
+
```
|
|
464
323
|
|
|
465
324
|
---
|
|
466
325
|
|
|
467
|
-
|
|
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 |
|
|
326
|
+
### Ví dụ theo từng tình huống:
|
|
474
327
|
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
## Retry Policy
|
|
328
|
+
**Tình huống 1 — Dự án đang có, muốn setup DEV_PROFILE nhanh**
|
|
478
329
|
```
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
└─ Permission error → EXIT: FAILED, report exact path
|
|
483
|
-
└─ Do NOT retry more than 1 time per file
|
|
330
|
+
Mode: existing
|
|
331
|
+
Role: auto-detect
|
|
332
|
+
Name: (đọc từ project)
|
|
484
333
|
```
|
|
334
|
+
→ AI scan `package.json`, detect `Next.js + Prisma + Tailwind + TypeScript`,
|
|
335
|
+
điền DEV_PROFILE.md với `role: fullstack`, toàn bộ stack fields,
|
|
336
|
+
gợi ý: "Tiếp theo dùng `qk-feature-delivery` để build feature đầu tiên".
|
|
485
337
|
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
## Escalation Rules
|
|
338
|
+
**Tình huống 2 — Dự án mới Fullstack**
|
|
489
339
|
```
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
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
|
|
340
|
+
Mode: new
|
|
341
|
+
Role: fullstack
|
|
342
|
+
Name: ecommerce-platform
|
|
343
|
+
Mô tả: Nền tảng thương mại điện tử B2C — quản lý sản phẩm, đơn hàng, thanh toán
|
|
344
|
+
Stack: Next.js 14 + Prisma + PostgreSQL + Tailwind + TypeScript
|
|
499
345
|
```
|
|
346
|
+
→ AI tạo: folder structure theo Standard Web App blueprint,
|
|
347
|
+
`.env.example` với `DATABASE_URL`, `NEXTAUTH_SECRET`, `STRIPE_SECRET_KEY`,
|
|
348
|
+
`README.md` với setup instructions, `DEV_PROFILE.md` pre-filled.
|
|
500
349
|
|
|
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
|
-
}
|
|
350
|
+
**Tình huống 3 — Setup RAG pipeline**
|
|
511
351
|
```
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
}
|
|
352
|
+
Mode: new
|
|
353
|
+
Role: ai-engineer
|
|
354
|
+
Name: internal-kb-assistant
|
|
355
|
+
Mô tả: Q&A bot trả lời từ tài liệu nội bộ công ty (PDF, Confluence)
|
|
356
|
+
Stack: OpenAI GPT-4o + pgvector + LangChain + FastAPI
|
|
518
357
|
```
|
|
358
|
+
→ AI tạo: 4-folder AI structure, `prompts/system.txt` placeholder,
|
|
359
|
+
`evals/scorecards/rag_metrics.yml` template (faithfulness, relevance, groundedness),
|
|
360
|
+
`DEV_PROFILE.md` với `role: ai-engineer`, full `data_stack` filled.
|
|
519
361
|
|
|
520
|
-
|
|
362
|
+
**Tình huống 4 — Data pipeline mới**
|
|
363
|
+
```
|
|
364
|
+
Mode: new
|
|
365
|
+
Role: data
|
|
366
|
+
Name: sales-analytics
|
|
367
|
+
Mô tả: Pipeline load sales data từ Salesforce → BigQuery, build mart cho dashboard
|
|
368
|
+
Stack: dbt + Airflow + BigQuery + Python
|
|
369
|
+
```
|
|
370
|
+
→ AI tạo: dbt project structure (staging/intermediate/mart),
|
|
371
|
+
`dbt_project.yml`, Airflow DAG folder, `DEV_PROFILE.md` với `role: data`,
|
|
372
|
+
full `data_stack` (pipeline: "dbt + Airflow", warehouse: "BigQuery").
|