ai-developer-skill-os 2.0.1 → 3.0.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 +48 -0
- package/README.md +77 -130
- package/knowledge/frontend/react.md +27 -0
- package/package.json +1 -1
- package/skills/qk-access-policy/SKILL.md +40 -127
- package/skills/qk-ai-builder/SKILL.md +41 -33
- package/skills/qk-api-lifecycle/SKILL.md +62 -420
- package/skills/qk-bug-resolution/SKILL.md +65 -371
- package/skills/qk-context-loader/SKILL.md +47 -206
- package/skills/qk-data-lifecycle/SKILL.md +60 -135
- package/skills/qk-design-to-code/SKILL.md +46 -33
- package/skills/qk-docs/SKILL.md +52 -335
- package/skills/qk-documentation-system/SKILL.md +38 -33
- package/skills/qk-engineering-standard/SKILL.md +61 -171
- package/skills/qk-feature-delivery/SKILL.md +63 -432
- package/skills/qk-help/SKILL.md +37 -95
- package/skills/qk-orchestrator/SKILL.md +52 -272
- package/skills/qk-policy-engine/SKILL.md +52 -33
- package/skills/qk-production-release/SKILL.md +45 -127
- package/skills/qk-project-bootstrap/SKILL.md +43 -33
- package/skills/qk-project-health/SKILL.md +56 -650
- package/skills/qk-project-memory/SKILL.md +35 -33
- package/skills/qk-system-evolution/SKILL.md +63 -315
- package/skills/qk-ui-audit/SKILL.md +58 -152
- package/skills/qk-ui-system-builder/SKILL.md +40 -444
- package/skills/qk-validation-gate/SKILL.md +59 -33
- package/templates/bug-report.md +21 -0
- package/templates/design-report.md +21 -0
- package/templates/feature-report.md +20 -0
- package/templates/review-report.md +21 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Global Agent Policies
|
|
2
|
+
|
|
3
|
+
These policies apply to ALL agents and skills. They establish the baseline behavior, engineering standards, and communication format for every interaction.
|
|
4
|
+
|
|
5
|
+
## 1. Global Principles
|
|
6
|
+
- **Evidence over assumptions:** Base your decisions on logs, code snippets, and actual data. Do not guess.
|
|
7
|
+
- **Minimal changes over rewrites:** Fix the exact problem. Do not refactor unrelated code.
|
|
8
|
+
- **Root cause over symptom:** Find out why a bug happened, not just how to hide the error.
|
|
9
|
+
- **Read before write:** Always understand the context and existing code before modifying it.
|
|
10
|
+
- **Verify before complete:** Test your changes or provide verification steps.
|
|
11
|
+
- **Preserve backward compatibility:** Do not break existing APIs or components unless explicitly instructed.
|
|
12
|
+
- **Never fabricate:** If you don't know, ask. Never invent APIs, packages, or code that doesn't exist.
|
|
13
|
+
|
|
14
|
+
## 2. Execution Principles
|
|
15
|
+
- **Read before Write:** Gather context using grep/read_file before touching any code.
|
|
16
|
+
- **Search before Modify:** Find all usages of a function/variable before changing its signature.
|
|
17
|
+
- **Understand before Refactor:** Do not start refactoring until you comprehend the business logic.
|
|
18
|
+
- **Verify before Complete:** Run tests, linters, or check logs before handing off the task.
|
|
19
|
+
- **Explain before Suggest:** Provide the rationale before outputting the code fix.
|
|
20
|
+
|
|
21
|
+
## 3. Language Policy
|
|
22
|
+
- **Use English for:** Code, reasoning, architecture terms, file names, variables, technical decisions, Git commit messages, logs, and prompt logic (Workflow, Checklist).
|
|
23
|
+
- **Use Vietnamese for:** User-facing explanations, questions, summaries, progress updates, and the final report.
|
|
24
|
+
- **Never translate:** Code snippets, stack traces, file paths, shell commands, configuration keys, environment variables.
|
|
25
|
+
|
|
26
|
+
## 4. Decision Policy
|
|
27
|
+
- Do not guess.
|
|
28
|
+
- Do not fabricate facts or hallucinate APIs.
|
|
29
|
+
- If required information is missing, ask the user first.
|
|
30
|
+
- State your assumptions explicitly.
|
|
31
|
+
- Prefer evidence over assumptions.
|
|
32
|
+
|
|
33
|
+
## 5. Engineering Policy
|
|
34
|
+
- Fix the root cause, not the symptom.
|
|
35
|
+
- Keep changes minimal and isolated.
|
|
36
|
+
- Follow existing project conventions (naming, folder structure, styling).
|
|
37
|
+
- Avoid unnecessary refactoring.
|
|
38
|
+
- Do not introduce new third-party dependencies unless strictly required.
|
|
39
|
+
- Remove temporary debugging code (`console.log`, `debugger`) before finishing.
|
|
40
|
+
|
|
41
|
+
## 6. Output Policy
|
|
42
|
+
Always use the exact required reporting structure. When reporting back to the user, include:
|
|
43
|
+
- **Summary:** What was done (briefly).
|
|
44
|
+
- **Changes:** Exactly which files and lines were modified.
|
|
45
|
+
- **Reason:** Why this approach was taken.
|
|
46
|
+
- **Verification:** How this was tested or how the user can test it.
|
|
47
|
+
- **Risks/Side Effects:** Potential impacts on other parts of the system.
|
|
48
|
+
- **Next Action:** What should happen next.
|
package/README.md
CHANGED
|
@@ -1,130 +1,77 @@
|
|
|
1
|
-
# 🚀 AI Developer Skill OS (ai-developer-skill-os)
|
|
2
|
-
|
|
3
|
-
> Một hệ điều hành (AI-OS) và Nền tảng Kiến trúc Kỹ thuật (Engineering Platform) tối thượng dành cho AI Coding Agents (Cursor, Windsurf,
|
|
4
|
-
|
|
5
|
-
Thay vì cung cấp các "công cụ rời rạc" (Toolbox)
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## 🏗️ Kiến Trúc
|
|
10
|
-
|
|
11
|
-
Hệ thống được thiết kế hoàn hảo
|
|
12
|
-
|
|
13
|
-
###
|
|
14
|
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
- `
|
|
21
|
-
|
|
22
|
-
###
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
- `qk-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
## 💡 Ví Dụ Thực Tế (Common Examples)
|
|
79
|
-
|
|
80
|
-
Dưới đây là một số ví dụ sử dụng các kỹ năng phổ biến và mạnh mẽ nhất trong quá trình code hàng ngày của bạn:
|
|
81
|
-
|
|
82
|
-
### 1. `qk-orchestrator` (Trợ lý điều phối trung tâm)
|
|
83
|
-
Nếu bạn không biết nên dùng skill nào, hãy gọi Orchestrator. Nó sẽ tự động phân tích và kích hoạt đúng các skill bên dưới.
|
|
84
|
-
```bash
|
|
85
|
-
./qk-orchestrator "Tôi muốn tạo một trang Dashboard hiển thị doanh thu bằng React"
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
### 2. `qk-feature-delivery` (Phát triển tính năng E2E)
|
|
89
|
-
Dùng khi bạn muốn xây dựng trọn vẹn một tính năng từ DB, API đến UI và Test.
|
|
90
|
-
```bash
|
|
91
|
-
./qk-feature-delivery "Tạo luồng thanh toán giỏ hàng (Cart Checkout), lưu vào bảng orders và gọi API thanh toán Stripe"
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
### 3. `qk-bug-resolution` (Chẩn đoán và diệt Bug triệt để)
|
|
95
|
-
Tuyệt đối không dùng prompt thường để sửa lỗi. Dùng kỹ năng này để ép AI tìm Root Cause và viết Regression Test.
|
|
96
|
-
```bash
|
|
97
|
-
./qk-bug-resolution "API /users/profile đang trả về 500 khi user chưa có avatar, stack trace như sau..."
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
### 4. `qk-ui-system-builder` (Chuẩn hóa giao diện)
|
|
101
|
-
Dùng khi thiết kế các component dùng chung (Button, Card, Form) để đảm bảo không bị rác CSS.
|
|
102
|
-
```bash
|
|
103
|
-
./qk-ui-system-builder "Tạo một Data Table Component có hỗ trợ phân trang và filter, sử dụng Design Token hiện tại"
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
### 5. `qk-api-lifecycle` (Thiết kế và Code API)
|
|
107
|
-
Dành cho Backend Engineer, đi từ spec đến code, type và test.
|
|
108
|
-
```bash
|
|
109
|
-
./qk-api-lifecycle "Thiết kế API cập nhật mật khẩu, yêu cầu validate JWT token và mã hóa bcrypt"
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
---
|
|
113
|
-
|
|
114
|
-
## 💻 Cách Cài Đặt (Installation)
|
|
115
|
-
|
|
116
|
-
Sử dụng npm:
|
|
117
|
-
```bash
|
|
118
|
-
npm i -g ai-developer-skill-os
|
|
119
|
-
```
|
|
120
|
-
Hoặc sử dụng qua `npx`:
|
|
121
|
-
```bash
|
|
122
|
-
npx ai-developer-skill-os init
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
## 🚀 Tra Cứu (Help)
|
|
126
|
-
|
|
127
|
-
Để tra cứu danh sách toàn bộ 22 Kỹ năng và các mẹo sử dụng, hãy gọi:
|
|
128
|
-
```bash
|
|
129
|
-
./qk-help "Hiển thị tất cả các skill liên quan đến Frontend"
|
|
130
|
-
```
|
|
1
|
+
# 🚀 AI Developer Skill OS (ai-developer-skill-os) v3.0
|
|
2
|
+
|
|
3
|
+
> Một hệ điều hành (AI-OS) và Nền tảng Kiến trúc Kỹ thuật (Engineering Platform) tối thượng dành cho AI Coding Agents (Claude Code, Cursor, Windsurf, Gemini).
|
|
4
|
+
|
|
5
|
+
Thay vì cung cấp các "công cụ rời rạc" (Toolbox) hoặc những prompt cồng kềnh, **AI Developer Skill OS v3.0** được thiết kế lại hoàn toàn theo chuẩn **Enterprise-ready Agentic Framework**. Nó biến Agent của bạn thành một **Senior Engineer / Chief Architect** thực thụ với khả năng tự suy luận bằng Tiếng Anh, nhưng lại báo cáo thân thiện bằng Tiếng Việt.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 🏗️ Kiến Trúc 5 Tầng (The 5-Tier Architecture)
|
|
10
|
+
|
|
11
|
+
Hệ thống được thiết kế decoupled (phân tách) hoàn hảo để chống tràn Context Window và tối ưu khả năng suy luận của LLM:
|
|
12
|
+
|
|
13
|
+
### 1. Global Policy (`.agents/AGENTS.md`)
|
|
14
|
+
Chứa các bộ luật thép toàn cục (Agent-wide rules):
|
|
15
|
+
- **Language Policy:** Suy luận kỹ thuật bằng Tiếng Anh, giao tiếp với người dùng bằng Tiếng Việt.
|
|
16
|
+
- **Execution Principles:** `Read before Write`, `Verify before Complete`.
|
|
17
|
+
- **Engineering Policy:** Trị bệnh tận gốc (Fix root cause), giữ nguyên chuẩn cũ.
|
|
18
|
+
|
|
19
|
+
### 2. Core Templates (`templates/`)
|
|
20
|
+
Chứa các format báo cáo chuẩn (như `bug-report.md`, `feature-report.md`, `review-report.md`). AI không cần "học lại" cách viết báo cáo, giúp đầu ra luôn nhất quán 100%.
|
|
21
|
+
|
|
22
|
+
### 3. Skill Definition (`skills/`)
|
|
23
|
+
Bộ 20+ kỹ năng (Skills) cốt lõi được cấu trúc siêu chuẩn xác với **Metadata 12 trường** (Version, Category, Pipeline, Allowed Tools...). Toàn bộ SOP (Standard Operating Procedure), Decision Tree và Constraints được viết 100% bằng Tiếng Anh để tối ưu hóa khả năng hiểu kỹ thuật của AI.
|
|
24
|
+
|
|
25
|
+
### 4. Knowledge Library (`knowledge/`)
|
|
26
|
+
Tri thức chuyên sâu được tách rời hoàn toàn khỏi Prompt. Ví dụ: Kiến thức về React (`knowledge/frontend/react.md`) chỉ được gọi (On-demand RAG) khi AI thực sự làm việc với React.
|
|
27
|
+
|
|
28
|
+
### 5. Output Format (Vietnamese Report)
|
|
29
|
+
Toàn bộ kết quả trả về cho bạn đều tuân thủ Output Policy: Báo cáo bằng Tiếng Việt, chia mục rõ ràng (Summary, Changes, Root Cause, Risks, Next Actions).
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## 🧩 Danh sách 20+ Master Skills
|
|
34
|
+
|
|
35
|
+
Các skill được chia thành các nhóm (Category) rõ ràng:
|
|
36
|
+
- **Orchestration:** `qk-orchestrator`, `qk-context-loader`, `qk-policy-engine`, `qk-access-policy`
|
|
37
|
+
- **Engineering / Dev:** `qk-feature-delivery`, `qk-api-lifecycle`, `qk-data-lifecycle`, `qk-design-to-code`, `qk-ui-system-builder`
|
|
38
|
+
- **Validation & Standards:** `qk-validation-gate`, `qk-engineering-standard`, `qk-ui-audit`, `qk-project-health`, `qk-bug-resolution`
|
|
39
|
+
- **Ops & AI:** `qk-system-evolution`, `qk-production-release`, `qk-ai-builder`, `qk-project-bootstrap`
|
|
40
|
+
- **Docs & Utils:** `qk-docs`, `qk-documentation-system`, `qk-project-memory`, `qk-help`
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## 🔄 Luồng Handoff Pipeline Khép Kín
|
|
45
|
+
|
|
46
|
+
Bất cứ một tính năng hay lỗi nào cũng được đi qua một đường ống khép kín (Abstract Pipeline):
|
|
47
|
+
```text
|
|
48
|
+
analyze
|
|
49
|
+
↓
|
|
50
|
+
implement
|
|
51
|
+
↓
|
|
52
|
+
engineering-standard (Ép chuẩn Code, Naming, SOLID)
|
|
53
|
+
↓
|
|
54
|
+
validate (Chạy Linter, Tests, Security Check)
|
|
55
|
+
↓
|
|
56
|
+
complete (Tạo báo cáo bằng tiếng Việt)
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## 💻 Cách Cài Đặt (Installation)
|
|
62
|
+
|
|
63
|
+
Sử dụng npm:
|
|
64
|
+
```bash
|
|
65
|
+
npm i -g ai-developer-skill-os
|
|
66
|
+
```
|
|
67
|
+
Hoặc sử dụng qua `npx`:
|
|
68
|
+
```bash
|
|
69
|
+
npx ai-developer-skill-os init
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## 🚀 Tra Cứu (Help)
|
|
73
|
+
|
|
74
|
+
Để tra cứu danh sách toàn bộ 20+ Kỹ năng và các mẹo sử dụng, hãy gọi:
|
|
75
|
+
```bash
|
|
76
|
+
./qk-help "Hiển thị tất cả các skill"
|
|
77
|
+
```
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: react-knowledge-base
|
|
3
|
+
domain: frontend
|
|
4
|
+
tags: [react, hooks, components, state]
|
|
5
|
+
priority: high
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# React Knowledge Base
|
|
9
|
+
|
|
10
|
+
## State Management Rules
|
|
11
|
+
- Use `useState` for strictly local UI state (e.g., dropdown toggle).
|
|
12
|
+
- Use `useContext` or global stores (Zustand/Redux) when prop drilling exceeds 3 levels.
|
|
13
|
+
- Never store derived data in state. Compute it on the fly during render.
|
|
14
|
+
- Never store API responses in Redux if a Server State tool (React Query/SWR) is available.
|
|
15
|
+
|
|
16
|
+
## Hooks Best Practices
|
|
17
|
+
- **useEffect:** Avoid using `useEffect` for data transformation or syncing state. Only use it for actual side effects (subscriptions, API calls, manual DOM mutations).
|
|
18
|
+
- **useMemo / useCallback:** Only use when passing props to heavily memoized child components or when the computation is extremely expensive. Do not use them blindly.
|
|
19
|
+
- **Custom Hooks:** Extract complex logic out of UI components into custom hooks. Prefix them with `use` (e.g., `useUserAuth`).
|
|
20
|
+
|
|
21
|
+
## Component Boundaries
|
|
22
|
+
- Follow Single Responsibility Principle. A component should either handle logic (Container) or handle rendering UI (Presentational), ideally not both if it's complex.
|
|
23
|
+
- Keep files under 300 lines. If a file is larger, break it down.
|
|
24
|
+
|
|
25
|
+
## Performance Gotchas
|
|
26
|
+
- Stale Closures: Always include all reactive variables in the dependency array of `useEffect` or `useCallback`.
|
|
27
|
+
- Keys in Lists: Always use unique IDs for `key` props. Never use array indices unless the list is completely static.
|
package/package.json
CHANGED
|
@@ -1,127 +1,40 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: qk-access-policy
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
1. **
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
# Auth & Security Engineer
|
|
44
|
-
|
|
45
|
-
> **Language rule:**
|
|
46
|
-
> Use English for: code, identifiers, file names, architecture terms, technical decisions.
|
|
47
|
-
> Use the user's language for: explanations, questions, summaries, and feedback.
|
|
48
|
-
> The user may write in any language — detect and match it automatically.
|
|
49
|
-
|
|
50
|
-
---
|
|
51
|
-
|
|
52
|
-
## Trigger
|
|
53
|
-
|
|
54
|
-
Activate this skill when:
|
|
55
|
-
- User asks to "add login", "protect this route", or "implement OAuth"
|
|
56
|
-
- Defining user roles and permissions (Admin vs User)
|
|
57
|
-
- Project audit flags security vulnerabilities (P0/P1)
|
|
58
|
-
- Handling sensitive data (passwords, PII, API keys)
|
|
59
|
-
|
|
60
|
-
---
|
|
61
|
-
|
|
62
|
-
## Scope
|
|
63
|
-
|
|
64
|
-
- ✅ **Authentication:** JWT, Session Cookies, OAuth2 (Google, GitHub, etc.), Magic Links.
|
|
65
|
-
- ✅ **Authorization:** Role-Based Access Control (RBAC), Middleware guards.
|
|
66
|
-
- ✅ **Data Protection:** Hashing passwords (bcrypt, Argon2), encrypting sensitive fields.
|
|
67
|
-
- ✅ **Vulnerability Prevention:** CSRF protection, Rate Limiting, CORS config, input sanitization (SQLi/XSS).
|
|
68
|
-
|
|
69
|
-
---
|
|
70
|
-
|
|
71
|
-
## Non-goals
|
|
72
|
-
|
|
73
|
-
- ❌ Do NOT store passwords in plain text. Ever.
|
|
74
|
-
- ❌ Do NOT hardcode secrets or private keys in the code (use `.env`).
|
|
75
|
-
- ❌ Do NOT store JWTs in `localStorage` if cookies (`httpOnly`) are an option, unless explicitly requested.
|
|
76
|
-
|
|
77
|
-
---
|
|
78
|
-
|
|
79
|
-
## Workflow
|
|
80
|
-
|
|
81
|
-
### Phase 1 — Strategy Selection
|
|
82
|
-
|
|
83
|
-
Determine the auth mechanism:
|
|
84
|
-
1. **Stateless (JWT):** Good for mobile/SPAs, distributed systems.
|
|
85
|
-
2. **Stateful (Sessions):** Good for traditional web apps, easier revocation.
|
|
86
|
-
3. **Third-party (OAuth / Auth0 / NextAuth / Supabase):** Offload auth complexity.
|
|
87
|
-
|
|
88
|
-
### Phase 2 — Implementation
|
|
89
|
-
|
|
90
|
-
**For JWT + Cookies (Recommended Web Pattern):**
|
|
91
|
-
1. Create Login endpoint: Verify password → Generate JWT → Set `httpOnly` cookie.
|
|
92
|
-
2. Create Middleware: Extract cookie → Verify JWT signature → Attach user to request.
|
|
93
|
-
3. Create Logout endpoint: Clear the cookie.
|
|
94
|
-
|
|
95
|
-
**For Authorization:**
|
|
96
|
-
1. Define roles (e.g., `enum Role { ADMIN, USER }`).
|
|
97
|
-
2. Create Role Middleware: Check `req.user.role`.
|
|
98
|
-
|
|
99
|
-
### Phase 3 — Security Audit
|
|
100
|
-
|
|
101
|
-
Verify:
|
|
102
|
-
- Passwords are hashed with a salt (e.g., `bcrypt.hash(password, 10)`).
|
|
103
|
-
- Cookies are `httpOnly`, `Secure` (in prod), and `SameSite`.
|
|
104
|
-
- CORS is configured to only allow trusted origins.
|
|
105
|
-
|
|
106
|
-
---
|
|
107
|
-
|
|
108
|
-
## Output Format
|
|
109
|
-
|
|
110
|
-
```
|
|
111
|
-
🛡️ Auth & Security Report
|
|
112
|
-
─────────────────────────────────────────────────
|
|
113
|
-
Mechanism: [JWT in httpOnly Cookie / OAuth / Session]
|
|
114
|
-
Roles: [Admin, User]
|
|
115
|
-
|
|
116
|
-
Components Implemented:
|
|
117
|
-
✅ Login/Logout handlers
|
|
118
|
-
✅ Auth Middleware (Guard)
|
|
119
|
-
✅ Password hashing (bcrypt)
|
|
120
|
-
|
|
121
|
-
Security measures enforced:
|
|
122
|
-
• `httpOnly`, `Secure`, `SameSite=Strict` on cookies
|
|
123
|
-
• CORS restricted to frontend origin
|
|
124
|
-
|
|
125
|
-
🔗 Next Steps:
|
|
126
|
-
Remember to add `JWT_SECRET` to your production environment variables.
|
|
127
|
-
```
|
|
1
|
+
---
|
|
2
|
+
name: qk-access-policy
|
|
3
|
+
version: 3.0.0
|
|
4
|
+
updated: 2026-07-02
|
|
5
|
+
description: Manage RBAC, ABAC, and security boundaries.
|
|
6
|
+
category: security
|
|
7
|
+
priority: high
|
|
8
|
+
tags: [security, rbac, auth, permissions]
|
|
9
|
+
platforms: [claude-code, cursor, windsurf, gemini-cli]
|
|
10
|
+
trigger: User asks to add roles, restrict access, or implement authentication logic.
|
|
11
|
+
inputs: [Auth requirements, RBAC Matrix]
|
|
12
|
+
outputs: [Access control logic, Middleware]
|
|
13
|
+
allowed_tools: [grep_search, run_command, write_to_file]
|
|
14
|
+
pipeline: [analyze, implement, engineering-standard, validate, complete]
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
# 🛠️ qk-access-policy - Standard Operating Procedure
|
|
18
|
+
|
|
19
|
+
> **Goal:** "Bảo vệ cổng" (Security Guard). Xác định xem người dùng có đủ thẩm quyền để truy cập vào một Component UI hoặc một Endpoint API hay không.
|
|
20
|
+
|
|
21
|
+
## 🔄 1. Chain of Thought (SOP)
|
|
22
|
+
1. **Analyze (Role Assessment):**
|
|
23
|
+
- Identify the user roles (Guest, User, Admin, SuperAdmin).
|
|
24
|
+
2. **Implement (Boundary Definition):**
|
|
25
|
+
- Implement UI Guards (e.g., hiding a Delete button).
|
|
26
|
+
- Implement API Middleware (e.g., blocking the `/api/delete` endpoint).
|
|
27
|
+
3. **Validate (Least Privilege Check):**
|
|
28
|
+
- Ensure you didn't grant broad access by default.
|
|
29
|
+
|
|
30
|
+
## 🛡️ 2. Constraints & Rules
|
|
31
|
+
- **Full Stack Protection:** Never hide UI elements without also securing the corresponding backend API.
|
|
32
|
+
|
|
33
|
+
## 🤝 3. Handoff Pipeline
|
|
34
|
+
1. `validate`: Trigger `qk-validation-gate` to check for security flaws.
|
|
35
|
+
2. `complete`: Generate the Access Control Report.
|
|
36
|
+
|
|
37
|
+
## 📝 4. Output Format
|
|
38
|
+
Vui lòng trả kết quả bằng Tiếng Việt.
|
|
39
|
+
- **Tóm tắt (Summary):** Các role vừa được setup.
|
|
40
|
+
- **Chi tiết (Changes):** UI và API nào đã được bảo vệ.
|
|
@@ -1,33 +1,41 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: qk-ai-builder
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
1. **
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
-
|
|
30
|
-
|
|
31
|
-
##
|
|
32
|
-
-
|
|
33
|
-
|
|
1
|
+
---
|
|
2
|
+
name: qk-ai-builder
|
|
3
|
+
version: 3.0.0
|
|
4
|
+
updated: 2026-07-02
|
|
5
|
+
description: Design AI Logic, Prompts, RAG pipelines, and Agents.
|
|
6
|
+
category: ai
|
|
7
|
+
priority: medium
|
|
8
|
+
tags: [ai, llm, prompt-engineering, rag, agents]
|
|
9
|
+
platforms: [claude-code, cursor, windsurf, gemini-cli]
|
|
10
|
+
trigger: User asks to build a chatbot, add AI features, or write prompts.
|
|
11
|
+
inputs: [AI Requirements]
|
|
12
|
+
outputs: [AI Logic, Prompts, RAG setup]
|
|
13
|
+
allowed_tools: [run_command, write_to_file]
|
|
14
|
+
pipeline: [analyze, design, implement, validate, complete]
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
# 🛠️ qk-ai-builder - Standard Operating Procedure
|
|
18
|
+
|
|
19
|
+
> **Goal:** "AI Engineer". Xây dựng các tính năng thông minh bằng LLM (Chatbot, RAG pipeline, Agent workflows).
|
|
20
|
+
|
|
21
|
+
## 🔄 1. Chain of Thought (SOP)
|
|
22
|
+
1. **Analyze (Task Breakdown):**
|
|
23
|
+
- Determine the AI use case (Classification, Generation, Chat, Search).
|
|
24
|
+
2. **Design (Prompt Engineering):**
|
|
25
|
+
- Write clear System Prompts. Treat prompts like code (use variables, constraints).
|
|
26
|
+
3. **Implement (Integration):**
|
|
27
|
+
- Use the appropriate SDK (LangChain, OpenAI SDK, Vercel AI).
|
|
28
|
+
4. **Validate (Safety Check):**
|
|
29
|
+
- Ensure API keys are not hardcoded.
|
|
30
|
+
|
|
31
|
+
## 🛡️ 2. Constraints & Rules
|
|
32
|
+
- **JSON Parsing:** Always enforce JSON outputs if the AI response is consumed by the app, and handle parse errors.
|
|
33
|
+
|
|
34
|
+
## 🤝 3. Handoff Pipeline
|
|
35
|
+
1. `validate`: Send to validation gate.
|
|
36
|
+
2. `complete`: Output the AI Integration Report.
|
|
37
|
+
|
|
38
|
+
## 📝 4. Output Format
|
|
39
|
+
Vui lòng trả kết quả bằng Tiếng Việt.
|
|
40
|
+
- **Tóm tắt (Summary):** Luồng AI đã thiết lập.
|
|
41
|
+
- **Chi tiết (Changes):** Prompt và logic gọi API.
|