ai-developer-skill-os 3.1.5 → 6.0.0-rc1
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/README.md +15 -19
- package/_template/BEHAVIOR_SPEC.md +96 -0
- package/docs/GOVERNANCE.md +1 -1
- package/fix_seeds.js +22 -0
- package/framework/KERNEL.md +83 -0
- package/framework/bias-library/cosmetic-refactor.md +21 -0
- package/framework/bias-library/enterprise-crud.md +21 -0
- package/framework/bias-library/fake-ui-slop.md +20 -0
- package/framework/bias-library/hallucinated-tools.md +20 -0
- package/framework/bias-library/missing-ui-states.md +19 -0
- package/framework/bias-library/over-indexing.md +20 -0
- package/framework/bias-library/swallow-errors.md +19 -0
- package/framework/bias-library/ui-only-security.md +17 -0
- package/framework/decision-primitives.md +47 -0
- package/framework/dial-library/complexity-budget.md +13 -0
- package/framework/dial-library/granularity.md +13 -0
- package/framework/dial-library/optimization-strategy.md +13 -0
- package/framework/dial-library/strictness.md +13 -0
- package/framework/rule-library/delegation-only.md +9 -0
- package/framework/rule-library/minimal-diff.md +9 -0
- package/migrate-to-v6.js +130 -0
- package/migrate.js +147 -0
- package/migrate.py +133 -0
- package/migrate_all.cjs +96 -0
- package/package.json +2 -2
- package/skills/qk-access-policy/SKILL.md +30 -42
- package/skills/qk-ai-builder/SKILL.md +32 -43
- package/skills/qk-api-lifecycle/SKILL.md +28 -62
- package/skills/qk-bug-resolution/SKILL.md +29 -66
- package/skills/qk-context-loader/SKILL.md +25 -44
- package/skills/qk-data-lifecycle/SKILL.md +25 -58
- package/skills/qk-db-optimizer/SKILL.md +25 -53
- package/skills/qk-design-to-code/SKILL.md +32 -48
- package/skills/qk-docs/SKILL.md +26 -52
- package/skills/qk-engineering-standard/SKILL.md +28 -59
- package/skills/qk-feature-delivery/SKILL.md +29 -64
- package/skills/qk-help/SKILL.md +30 -40
- package/skills/qk-orchestrator/SKILL.md +25 -51
- package/skills/qk-policy-engine/SKILL.md +24 -49
- package/skills/qk-production-release/SKILL.md +31 -48
- package/skills/qk-project-bootstrap/SKILL.md +32 -46
- package/skills/qk-project-health/SKILL.md +26 -54
- package/skills/qk-project-memory/SKILL.md +31 -38
- package/skills/qk-system-evolution/SKILL.md +25 -61
- package/skills/qk-ui-audit/SKILL.md +25 -56
- package/skills/qk-ui-system-builder/SKILL.md +30 -42
- package/skills/qk-validation-gate/SKILL.md +26 -57
- package/specs/contracts/behavior-contract.yaml +40 -0
- package/specs/expectations/qk-bug-resolution.yaml +35 -0
- package/specs/scenarios/fix-login-nullref.yaml +3 -0
- package/taste-skill/.claude-plugin/marketplace.json +20 -0
- package/taste-skill/.claude-plugin/plugin.json +19 -0
- package/taste-skill/.github/FUNDING.yml +1 -0
- package/taste-skill/.github/copilot-instructions.md +11 -0
- package/taste-skill/CHANGELOG.md +111 -0
- package/taste-skill/LICENSE +21 -0
- package/taste-skill/README.md +212 -0
- package/taste-skill/assets/.gitkeep +0 -0
- package/taste-skill/assets/readme-banner.webp +0 -0
- package/taste-skill/assets/readme-buttons/btn-agent-skills.webp +0 -0
- package/taste-skill/assets/readme-buttons/btn-changelog.webp +0 -0
- package/taste-skill/assets/readme-buttons/btn-mit.webp +0 -0
- package/taste-skill/assets/readme-buttons/btn-site.webp +0 -0
- package/taste-skill/assets/readme-buttons/btn-tools.webp +0 -0
- package/taste-skill/assets/readme-cta-tasteskill.svg +5 -0
- package/taste-skill/assets/sponsors/animations-dev.webp +0 -0
- package/taste-skill/assets/sponsors/emil-animations-dev.webp +0 -0
- package/taste-skill/assets/taste-skill-logo.png +0 -0
- package/taste-skill/assets/taste-skill-logo.webp +0 -0
- package/taste-skill/assets/vercel-oss-program-badge.svg +44 -0
- package/taste-skill/examples/floria-bottom.webp +0 -0
- package/taste-skill/examples/floria-full.webp +0 -0
- package/taste-skill/examples/floria-top.webp +0 -0
- package/taste-skill/research/README.md +8 -0
- package/taste-skill/research/laziness/README.md +25 -0
- package/taste-skill/research/laziness/findings/empirical-results.md +58 -0
- package/taste-skill/research/laziness/findings/references.md +20 -0
- package/taste-skill/research/laziness/remediation/architectural-patterns.md +55 -0
- package/taste-skill/research/laziness/remediation/parameter-tuning.md +44 -0
- package/taste-skill/research/laziness/remediation/prompt-engineering.md +52 -0
- package/taste-skill/research/laziness/remediation/reference-prompts.md +79 -0
- package/taste-skill/research/laziness/root-causes/cognitive-shortcuts.md +23 -0
- package/taste-skill/research/laziness/root-causes/output-limits.md +39 -0
- package/taste-skill/research/laziness/root-causes/rlhf-and-compute.md +27 -0
- package/taste-skill/research/laziness/root-causes/training-data-bias.md +28 -0
- package/taste-skill/scripts/build-emil-sponsor-row.mjs +41 -0
- package/taste-skill/scripts/convert-readme-assets-webp.mjs +142 -0
- package/taste-skill/scripts/process-readme-buttons.mjs +108 -0
- package/taste-skill/scripts/process-sponsor-badge.mjs +83 -0
- package/taste-skill/skill.sh +25 -0
- package/taste-skill/skills/brandkit/SKILL.md +798 -0
- package/taste-skill/skills/brutalist-skill/SKILL.md +92 -0
- package/taste-skill/skills/gpt-tasteskill/SKILL.md +74 -0
- package/taste-skill/skills/image-to-code-skill/SKILL.md +1228 -0
- package/taste-skill/skills/imagegen-frontend-mobile/SKILL.md +1465 -0
- package/taste-skill/skills/imagegen-frontend-web/SKILL.md +987 -0
- package/taste-skill/skills/llms.txt +13 -0
- package/taste-skill/skills/minimalist-skill/SKILL.md +85 -0
- package/taste-skill/skills/output-skill/SKILL.md +49 -0
- package/taste-skill/skills/redesign-skill/SKILL.md +178 -0
- package/taste-skill/skills/soft-skill/SKILL.md +98 -0
- package/taste-skill/skills/stitch-skill/DESIGN.md +121 -0
- package/taste-skill/skills/stitch-skill/SKILL.md +184 -0
- package/taste-skill/skills/taste-skill/SKILL.md +1206 -0
- package/taste-skill/skills/taste-skill-v1/SKILL.md +226 -0
- package/tests/behavior-conformance.test.js +151 -0
- package/_template/SKILL.md +0 -154
- package/tests/spec-compliance.test.js +0 -193
package/README.md
CHANGED
|
@@ -1,32 +1,28 @@
|
|
|
1
|
-
# 🚀 AI Developer Skill OS (ai-developer-skill-os)
|
|
1
|
+
# 🚀 AI Developer Skill OS (ai-developer-skill-os) v6.0
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> **Rule-Skins v6 is a Behavior Specification Format (BSF), not a prompt library, not an agent framework, and not a programming language. It defines reusable behavioral contracts that can be interpreted by different AI runtimes while remaining implementation-agnostic.**
|
|
4
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, **
|
|
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, **Rule-Skins v6** được tái thiết kế hoàn toàn theo chuẩn **Behavior Specification Format**. Các hành vi (Behaviors) giờ đây là các bản Hợp đồng (Contracts) rõ ràng, bao gồm Policies, Capabilities, và Reasoning Boundaries.
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
-
## 🏗️ Kiến Trúc 5 Tầng (
|
|
9
|
+
## 🏗️ Kiến Trúc 5 Tầng (Agent OS Kernel)
|
|
10
10
|
|
|
11
|
-
Hệ thống được thiết kế decoupled
|
|
11
|
+
Hệ thống được thiết kế decoupled hoàn hảo:
|
|
12
12
|
|
|
13
|
-
### 1.
|
|
14
|
-
|
|
15
|
-
- **Intent-Based Policies:** Skills are classified into 4 groups (Static Analysis, Development, Validation, Maintenance) rather than micromanaged with individual exceptions.
|
|
16
|
-
- **Progressive Evidence Collection:** Agents collect context incrementally (1 file → 3 files) and stop at a 80% Confidence Threshold, eliminating "hallucination loops".
|
|
17
|
-
- **Risk-based Verification:** Tests and builds are only run based on the risk level of the change, strictly guided by the Cost and Escalation policies.
|
|
13
|
+
### 1. BSF Kernel (`framework/KERNEL.md`)
|
|
14
|
+
Trái tim của hệ thống định nghĩa BSF Meta-Model, OS Policy (Invariants), Knowledge Layer, Validation Rules, và Design Principles.
|
|
18
15
|
|
|
19
|
-
### 2.
|
|
20
|
-
|
|
16
|
+
### 2. Thư Viện Độc Lập (Library Modules)
|
|
17
|
+
- `framework/bias-library/`: Sửa các lỗi tư duy mặc định của AI.
|
|
18
|
+
- `framework/dial-library/`: Định nghĩa các cấu hình điều khiển hành vi.
|
|
19
|
+
- `framework/rule-library/`: Các tiêu chí xuất xưởng bắt buộc.
|
|
21
20
|
|
|
22
|
-
### 3.
|
|
23
|
-
Bộ
|
|
21
|
+
### 3. Behavior Specifications (`skills/`)
|
|
22
|
+
Bộ 23 Behavior cốt lõi được cấu trúc theo chuẩn BSF (`_template/BEHAVIOR_SPEC.md`). Toàn bộ logic nội bộ được quy hoạch thành các Contracts (Quyền hạn), Policies (Quyết định, Bằng chứng) và Protocol (State Machine tùy chọn).
|
|
24
23
|
|
|
25
|
-
### 4.
|
|
26
|
-
|
|
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).
|
|
24
|
+
### 4. Output Contract (Decision Summary)
|
|
25
|
+
Toàn bộ kết quả trả về cho bạn đều tuân thủ Output Contract: Báo cáo bằng Tiếng Việt, bảo đảm Invariants, và vượt qua các Quality Gates.
|
|
30
26
|
|
|
31
27
|
---
|
|
32
28
|
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: qk-[tên-behavior]
|
|
3
|
+
version: 6.0.0
|
|
4
|
+
updated: 2026-07-10
|
|
5
|
+
description: Behavior Specification theo chuẩn BSF v6.0.
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# 📜 Behavior Specification: [Tên Behavior]
|
|
9
|
+
|
|
10
|
+
## 1. Behavior (Định danh Hành vi)
|
|
11
|
+
```yaml
|
|
12
|
+
Mission: [Mục tiêu tối thượng của hành vi này]
|
|
13
|
+
Authority: [Thẩm quyền tối đa được phép]
|
|
14
|
+
Responsibility: [Trách nhiệm cốt lõi]
|
|
15
|
+
Limitation: [Giới hạn tuyệt đối không được vượt qua]
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## 2. Contracts (Hợp đồng)
|
|
19
|
+
|
|
20
|
+
### 2.1. Capability Contract
|
|
21
|
+
```yaml
|
|
22
|
+
Can:
|
|
23
|
+
- [Hành động được phép: VD - read_docs, execute_tests]
|
|
24
|
+
Must:
|
|
25
|
+
- [Hành động bắt buộc: VD - verify assumptions before coding]
|
|
26
|
+
Cannot:
|
|
27
|
+
- [Hành động cấm: VD - invent API, drop database]
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### 2.2. Output Contract
|
|
31
|
+
```yaml
|
|
32
|
+
Artifacts:
|
|
33
|
+
- [Artifact 1: VD - plan.md]
|
|
34
|
+
- [Artifact 2: VD - summary_report]
|
|
35
|
+
Completion: "Artifacts generated & Quality Gates passed."
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## 3. Policies (Chính sách)
|
|
39
|
+
|
|
40
|
+
### 3.1. Context Policy
|
|
41
|
+
```yaml
|
|
42
|
+
Scope: [current_repo | whole_workspace | external_docs]
|
|
43
|
+
Priority:
|
|
44
|
+
1: Project Docs
|
|
45
|
+
2: Current Conversation
|
|
46
|
+
3: Source Code
|
|
47
|
+
Trust: "official docs > code > assumptions"
|
|
48
|
+
Fallback: ask_user
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### 3.2. Reasoning Boundary
|
|
52
|
+
```yaml
|
|
53
|
+
May infer: [VD: Variable naming, Local scope logic]
|
|
54
|
+
Must verify: [VD: Business logic, Auth rules]
|
|
55
|
+
Must ask: [VD: Missing edge cases, Vague requirements]
|
|
56
|
+
Must refuse: [VD: Unsafe assumptions, Security risks]
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### 3.3. Decision Policy
|
|
60
|
+
```yaml
|
|
61
|
+
Priority:
|
|
62
|
+
1: correctness
|
|
63
|
+
2: safety
|
|
64
|
+
3: maintainability
|
|
65
|
+
4: performance
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### 3.4. Evidence Policy
|
|
69
|
+
```yaml
|
|
70
|
+
Accept: [logs, unit tests, profiling data]
|
|
71
|
+
Prefer: [official vendor docs, architecture repo docs]
|
|
72
|
+
Reject: [guess, outdated internet search, agent memory]
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### 3.5. Escalation Policy
|
|
76
|
+
```yaml
|
|
77
|
+
Warning: [Cảnh báo rủi ro (VD: Rename file)]
|
|
78
|
+
Confirmation: [Cần user cho phép (VD: Override config)]
|
|
79
|
+
Stop: [Dừng ngay lập tức (VD: Đụng vào Auth, Permission Denied)]
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## 4. Protocol (Tùy chọn)
|
|
83
|
+
*(Chỉ sử dụng nếu behavior này yêu cầu quy trình nhiều bước (State Machine). Xóa phần này nếu không cần thiết).*
|
|
84
|
+
|
|
85
|
+
```yaml
|
|
86
|
+
States:
|
|
87
|
+
- collect_context
|
|
88
|
+
- clarify
|
|
89
|
+
- execute
|
|
90
|
+
|
|
91
|
+
Transitions:
|
|
92
|
+
collect_context:
|
|
93
|
+
if context_missing: -> clarify
|
|
94
|
+
else: -> execute
|
|
95
|
+
# ... (Các rule chuyển trạng thái khác) ...
|
|
96
|
+
```
|
package/docs/GOVERNANCE.md
CHANGED
|
@@ -30,7 +30,7 @@ A change is considered **Breaking** if it:
|
|
|
30
30
|
|
|
31
31
|
## 5. Versioning Strategy (Semantic Versioning)
|
|
32
32
|
We strictly adhere to SemVer based on the framework's architecture, not just content.
|
|
33
|
-
- **MAJOR (e.g., v4.0.0 to
|
|
33
|
+
- **MAJOR (e.g., v4.0.0 to v6.0.0):** Breaking changes to the Kernel (`AGENTS.md`), Metadata Contract (`SPEC.md`), or fundamental routing.
|
|
34
34
|
- **MINOR (e.g., v4.0.0 to v4.1.0):** Adding new Capabilities, new default Skills, new Knowledge docs, or new Templates.
|
|
35
35
|
- **PATCH (e.g., v4.0.0 to v4.0.1):** Fixing typos in docs, updating README, or minor bug fixes within an individual skill's SOP.
|
|
36
36
|
|
package/fix_seeds.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const yaml = require('js-yaml'); // Note: might not be installed
|
|
4
|
+
|
|
5
|
+
const skillsDir = 'd:\\ai-code-skin-mcp\\rules-skill\\skills';
|
|
6
|
+
const seeds = ['qk-bug-resolution', 'qk-feature-delivery', 'qk-access-policy', 'qk-engineering-standard', 'qk-context-loader', 'qk-orchestrator'];
|
|
7
|
+
|
|
8
|
+
seeds.forEach(seed => {
|
|
9
|
+
const specPath = path.join(skillsDir, seed, 'BEHAVIOR_SPEC.md');
|
|
10
|
+
const skillPath = path.join(skillsDir, seed, 'SKILL.md');
|
|
11
|
+
if (fs.existsSync(specPath)) {
|
|
12
|
+
const raw = fs.readFileSync(specPath, 'utf8');
|
|
13
|
+
// Using simple string parsing since js-yaml might not be available
|
|
14
|
+
let md = ---\nname: + seed + \nversion: 6.0.0\n---\n\n;
|
|
15
|
+
md += # + seed + \n\n;
|
|
16
|
+
md += This file follows the 6-Field Minimal Core v6 architecture.\n\n;
|
|
17
|
+
md += raw;
|
|
18
|
+
fs.writeFileSync(skillPath, md);
|
|
19
|
+
fs.unlinkSync(specPath);
|
|
20
|
+
console.log('Fixed', seed);
|
|
21
|
+
}
|
|
22
|
+
});
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# 📘 Behavior Specification Format (BSF) - Kernel v6.0
|
|
2
|
+
|
|
3
|
+
> **Rule-Skins v6 is a Behavior Specification Format.**
|
|
4
|
+
> BSF không phải thư viện prompt, không phải agent framework.
|
|
5
|
+
> BSF định nghĩa **Behavioral Constraints** (Ràng buộc hành vi) thay vì cố gắng chỉ dạy AI "phải làm gì".
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 🧭 1. Kernel Principles (Nguyên tắc Hạt nhân)
|
|
10
|
+
|
|
11
|
+
Đây là 5 nguyên tắc tối thượng chi phối toàn bộ kiến trúc Rule-Skins v6.
|
|
12
|
+
|
|
13
|
+
1. **Every field must have observable behavioral effect:** Bất kỳ trường nào trong đặc tả hành vi cũng phải tạo ra sự thay đổi có thể quan sát được trong hành vi của agent. Nếu không, nó là nhiễu (noise) và phải bị xóa.
|
|
14
|
+
2. **Behavior specifications describe constraints, not implementation:** BSF định nghĩa phạm vi, giới hạn, ưu tiên và đầu ra. Cách suy luận và lên kế hoạch được nhường lại cho LLM tự tối ưu.
|
|
15
|
+
3. **Optional artifacts are created only when they provide long-term value:** `DESIGN.md`, `RATIONALE.md` hay thư mục `specs/` chỉ được tạo ra khi độ phức tạp của hành vi đòi hỏi. Đừng tạo các file/thư mục rỗng.
|
|
16
|
+
4. **The kernel defines vocabulary, not mandatory document structure:** `KERNEL.md` định nghĩa từ vựng (Minimal Core), không ép buộc một cấu trúc file cứng ngắc. Skill nào cần trường nào thì dùng trường đó.
|
|
17
|
+
5. **Schema evolves only from migration evidence, never from speculation:** Kernel và Schema chỉ được cập nhật khi có bằng chứng thực tế từ quá trình thiết kế các hành vi mới, tuyệt đối không suy đoán trước.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## 💎 2. Minimal Core Vocabulary
|
|
22
|
+
|
|
23
|
+
Thay vì một schema cố định, BSF cung cấp bộ từ vựng lõi. Mỗi `BEHAVIOR_SPEC.md` có thể chọn lọc sử dụng:
|
|
24
|
+
|
|
25
|
+
- **`metadata`**: Định danh phục vụ tooling, con người và registry.
|
|
26
|
+
- **`scope`**: Thiết lập ranh giới (Ví dụ: "Existing defects only" để ngăn AI code thêm tính năng mới).
|
|
27
|
+
- **`constraints`**: Chứa các semantic rules `must` và `must_not` (Các ràng buộc bắt buộc tuân thủ).
|
|
28
|
+
- **`policies`**: Chứa các `prefer` và `trade-offs` (Hướng dẫn AI chọn đường đi khi có nhiều lựa chọn hợp lệ).
|
|
29
|
+
- **`escalation`**: Kích hoạt điều kiện "Dừng và Hỏi" hoặc "Từ chối".
|
|
30
|
+
- **`output`**: Quy định định dạng artifact phải trả về.
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## 🛡️ 3. OS-Level Invariants (Luật Bất biến)
|
|
35
|
+
|
|
36
|
+
Dưới đây là các ràng buộc áp dụng cho mọi skill mà không cần khai báo lại:
|
|
37
|
+
|
|
38
|
+
```yaml
|
|
39
|
+
OS_Invariants:
|
|
40
|
+
Security:
|
|
41
|
+
never:
|
|
42
|
+
- guess_passwords
|
|
43
|
+
- hardcode_secrets
|
|
44
|
+
- bypass_auth
|
|
45
|
+
UX_Interaction:
|
|
46
|
+
never:
|
|
47
|
+
- expose_internal_contract
|
|
48
|
+
- expose_internal_policy
|
|
49
|
+
- expose_internal_reasoning
|
|
50
|
+
- quote_yaml_sections
|
|
51
|
+
must:
|
|
52
|
+
- communicate_like_senior_engineer
|
|
53
|
+
- ask_only_necessary_questions
|
|
54
|
+
- explain_decisions_in_user_language
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## 📁 4. Kiến trúc Thư mục (v6)
|
|
60
|
+
|
|
61
|
+
```text
|
|
62
|
+
rules-skill/
|
|
63
|
+
├── framework/
|
|
64
|
+
│ ├── KERNEL.md (Bộ luật lõi)
|
|
65
|
+
│ └── behavior-patterns.md (Lưu trữ các mẫu hành vi nguyên thủy)
|
|
66
|
+
└── skills/ (Tập hợp các Behavior Specification)
|
|
67
|
+
├── qk-help/
|
|
68
|
+
│ └── BEHAVIOR_SPEC.md (Skill đơn giản chỉ cần 1 file)
|
|
69
|
+
└── qk-bug-resolution/
|
|
70
|
+
├── BEHAVIOR_SPEC.md
|
|
71
|
+
├── RATIONALE.md (Lưu trữ tri thức thiết kế)
|
|
72
|
+
└── specs/ (Kịch bản kiểm chứng tự đóng gói)
|
|
73
|
+
└── login-failed.yaml
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## 🚀 5. Definition of Done (Cho một Skill)
|
|
79
|
+
|
|
80
|
+
Một skill được xem là đã hoàn thành quy trình BSF v6 khi:
|
|
81
|
+
1. Có `BEHAVIOR_SPEC.md` với các trường có tác động hành vi rõ rệt.
|
|
82
|
+
2. Nếu phức tạp, có thêm `RATIONALE.md` giải thích lý do thiết kế.
|
|
83
|
+
3. Nếu cần test, có các file `.yaml` chứa kịch bản và kỳ vọng khép kín trong `specs/`.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: cosmetic-refactor
|
|
3
|
+
type: bias
|
|
4
|
+
description: LLM frequently rename variables or restructures code purely for aesthetic reasons without architectural improvement.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Detection:
|
|
8
|
+
- Did I only rename variables (e.g. `data` to `userData`)?
|
|
9
|
+
- Did I fail to split God Objects or reduce coupling?
|
|
10
|
+
|
|
11
|
+
Risk:
|
|
12
|
+
- High noise in Git diffs.
|
|
13
|
+
- Low return on investment (ROI).
|
|
14
|
+
- Potential regression for zero architectural gain.
|
|
15
|
+
|
|
16
|
+
Correction:
|
|
17
|
+
- Reject cosmetic-only changes.
|
|
18
|
+
- Focus strictly on decoupling, dependency injection, or SOLID violations.
|
|
19
|
+
|
|
20
|
+
Evidence:
|
|
21
|
+
- Explain explicitly why the new structure scales better or is more decoupled.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: enterprise-crud
|
|
3
|
+
type: bias
|
|
4
|
+
description: LLM suggests overly complex architectures (Kafka, Redis, Microservices) for simple CRUD operations.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Detection:
|
|
8
|
+
- Did I introduce message queues, caching layers, or gRPC for a simple REST API?
|
|
9
|
+
- Did I split a simple app into multiple microservices?
|
|
10
|
+
|
|
11
|
+
Risk:
|
|
12
|
+
- Severe over-engineering.
|
|
13
|
+
- Unnecessary infrastructure costs.
|
|
14
|
+
- Reduced maintainability for small teams.
|
|
15
|
+
|
|
16
|
+
Correction:
|
|
17
|
+
- Default to Monolith + PostgreSQL.
|
|
18
|
+
- Only introduce caching or queues if a specific bottleneck is identified by evidence.
|
|
19
|
+
|
|
20
|
+
Evidence:
|
|
21
|
+
- Must provide exact metrics or requirements that justify the complex architecture.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: fake-ui-slop
|
|
3
|
+
type: bias
|
|
4
|
+
description: LLM draws fake charts, images, or dashboard UI elements using generic div blocks instead of integrating real assets.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Detection:
|
|
8
|
+
- Did I use `<div class="bg-blue-500 w-full h-32">Fake Chart</div>`?
|
|
9
|
+
- Did I forget to add placeholders for real images?
|
|
10
|
+
|
|
11
|
+
Risk:
|
|
12
|
+
- Unprofessional UI design.
|
|
13
|
+
- Technical debt for the frontend developer.
|
|
14
|
+
|
|
15
|
+
Correction:
|
|
16
|
+
- Insert a comment like `<!-- TODO: Insert real image -->`.
|
|
17
|
+
- Use high-quality placeholder services (e.g., picsum).
|
|
18
|
+
|
|
19
|
+
Evidence:
|
|
20
|
+
- Highlight the exact placeholder used.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: hallucinated-tools
|
|
3
|
+
type: bias
|
|
4
|
+
description: LLM invents APIs, tools, or shell commands that do not exist in the current environment.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Detection:
|
|
8
|
+
- Did I attempt to call a CLI tool without verifying it is installed?
|
|
9
|
+
- Did I invent a non-existent method on a standard library?
|
|
10
|
+
|
|
11
|
+
Risk:
|
|
12
|
+
- Execution failure.
|
|
13
|
+
- Broken workflows.
|
|
14
|
+
|
|
15
|
+
Correction:
|
|
16
|
+
- Verify tools and APIs before using them.
|
|
17
|
+
- Stick to standard, known commands.
|
|
18
|
+
|
|
19
|
+
Evidence:
|
|
20
|
+
- Provide documentation or link to the specific tool usage.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: missing-ui-states
|
|
3
|
+
type: bias
|
|
4
|
+
description: LLM writes frontend components assuming the "happy path" only, ignoring Loading, Error, and Empty states.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Detection:
|
|
8
|
+
- Did I write a fetch component without a loading spinner?
|
|
9
|
+
- Did I forget to handle the case where the data array is empty?
|
|
10
|
+
|
|
11
|
+
Risk:
|
|
12
|
+
- Poor user experience.
|
|
13
|
+
- UI crashes on undefined data.
|
|
14
|
+
|
|
15
|
+
Correction:
|
|
16
|
+
- Always implement Loading, Error, and Empty states for any asynchronous UI component.
|
|
17
|
+
|
|
18
|
+
Evidence:
|
|
19
|
+
- Point to the conditional rendering logic.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: over-indexing
|
|
3
|
+
type: bias
|
|
4
|
+
description: LLM recommends adding database indexes to every column to "improve performance", ignoring write penalties.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Detection:
|
|
8
|
+
- Did I suggest indexing a column with low cardinality (e.g., boolean status)?
|
|
9
|
+
- Did I suggest indexing multiple columns without analyzing query patterns?
|
|
10
|
+
|
|
11
|
+
Risk:
|
|
12
|
+
- Slower INSERT/UPDATE operations.
|
|
13
|
+
- Increased database storage costs.
|
|
14
|
+
|
|
15
|
+
Correction:
|
|
16
|
+
- Only recommend indexes for Foreign Keys or heavily filtered/sorted columns.
|
|
17
|
+
- Suggest resolving N+1 queries first.
|
|
18
|
+
|
|
19
|
+
Evidence:
|
|
20
|
+
- Provide the exact slow query that justifies the index.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: swallow-errors
|
|
3
|
+
type: bias
|
|
4
|
+
description: LLM wraps code in a try/catch block but leaves the catch block empty or just logs to console, effectively hiding fatal errors.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Detection:
|
|
8
|
+
- Did I write `catch (e) { console.error(e) }` without throwing or returning an error state?
|
|
9
|
+
- Did I fail to surface the error to the UI?
|
|
10
|
+
|
|
11
|
+
Risk:
|
|
12
|
+
- Silent failures.
|
|
13
|
+
- Extremely difficult debugging.
|
|
14
|
+
|
|
15
|
+
Correction:
|
|
16
|
+
- Always handle the error gracefully (e.g., return a unified error object or show a toast notification).
|
|
17
|
+
|
|
18
|
+
Evidence:
|
|
19
|
+
- Point to the specific error handling logic.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: ui-only-security
|
|
3
|
+
type: bias
|
|
4
|
+
description: LLM hides a button on the UI for unauthorized users but forgets to secure the backend API endpoint.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Detection:
|
|
8
|
+
- Did I add a role check in the React component but not in the Node.js controller?
|
|
9
|
+
|
|
10
|
+
Risk:
|
|
11
|
+
- Critical security vulnerability (users can bypass UI and hit the API directly).
|
|
12
|
+
|
|
13
|
+
Correction:
|
|
14
|
+
- Security must always be enforced at the Backend/API layer first. UI hiding is just for UX.
|
|
15
|
+
|
|
16
|
+
Evidence:
|
|
17
|
+
- Point to the backend middleware or controller where the permission is checked.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# 🧩 Bảng Tuần Hoàn: Decision Primitives (v6.0)
|
|
2
|
+
|
|
3
|
+
Rule-Skins v6 không coi các Agent là những "con người ảo" (Personas), mà coi chúng là những **Cỗ máy Ra Quyết định (Decision Engines)**.
|
|
4
|
+
Mọi hành vi phức tạp của bất kỳ Agent nào trong hệ thống đều được cấu thành từ sự lắp ghép của **6 Decision Primitives** cốt lõi dưới đây.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## 1. 🧲 Collect (Thu thập)
|
|
9
|
+
- **Bản chất:** Đi tìm kiếm thông tin, tải bối cảnh từ bên ngoài vào bộ nhớ.
|
|
10
|
+
- **Trigger:** Thiếu context hoặc nhận một task yêu cầu đọc dữ liệu.
|
|
11
|
+
- **Evidence Required:** Quyền truy cập repository, cấu trúc file, URL.
|
|
12
|
+
- **Ví dụ Skills:** `qk-context-loader`, bước đầu của `qk-bug-resolution`.
|
|
13
|
+
|
|
14
|
+
## 2. 🩺 Diagnose (Chẩn đoán)
|
|
15
|
+
- **Bản chất:** Phân tích một triệu chứng (symptom) dựa trên bằng chứng để tìm ra nguyên nhân gốc rễ (root cause).
|
|
16
|
+
- **Trigger:** Có lỗi (Bug report, error log, test failure).
|
|
17
|
+
- **Evidence Required:** Stack trace, logs, test output.
|
|
18
|
+
- **Ví dụ Skills:** `qk-bug-resolution`, `qk-project-health`.
|
|
19
|
+
|
|
20
|
+
## 3. 🗺️ Plan (Lập Kế hoạch)
|
|
21
|
+
- **Bản chất:** Vạch ra một lộ trình các bước cần làm trước khi trực tiếp nhúng tay vào việc.
|
|
22
|
+
- **Trigger:** Yêu cầu một tính năng mới hoặc một nhiệm vụ quá phức tạp để làm một bước.
|
|
23
|
+
- **Evidence Required:** Yêu cầu (Requirements), Specs, Architecture.
|
|
24
|
+
- **Ví dụ Skills:** `qk-feature-delivery`, `qk-api-lifecycle`.
|
|
25
|
+
|
|
26
|
+
## 4. ⚖️ Evaluate (Đánh giá)
|
|
27
|
+
- **Bản chất:** Đối chiếu một sản phẩm (artifact) có sẵn với một tiêu chuẩn (standard/policy) để đưa ra phán quyết (Pass/Fail) hoặc gợi ý sửa đổi.
|
|
28
|
+
- **Trigger:** Một đoạn code mới, một bản thiết kế, một PR.
|
|
29
|
+
- **Evidence Required:** Artifact cần review, Guidelines, Linter rules.
|
|
30
|
+
- **Ví dụ Skills:** `qk-engineering-standard`, `qk-validation-gate`, `qk-ui-audit`.
|
|
31
|
+
|
|
32
|
+
## 5. 🛠️ Execute (Thực thi)
|
|
33
|
+
- **Bản chất:** Trực tiếp sửa đổi trạng thái hệ thống (viết code, xóa file, sửa file).
|
|
34
|
+
- **Trigger:** Đã có kế hoạch rõ ràng hoặc đã xác định xong lỗi.
|
|
35
|
+
- **Evidence Required:** Codebase hiện tại, Kế hoạch.
|
|
36
|
+
- **Ví dụ Skills:** `qk-feature-delivery` (bước sau), `qk-design-to-code`.
|
|
37
|
+
|
|
38
|
+
## 6. 🚦 Delegate / Govern (Điều phối / Quản trị)
|
|
39
|
+
- **Bản chất:** Không trực tiếp làm việc, mà làm nhiệm vụ định tuyến (routing) công việc cho Agent khác hoặc kiểm soát quyền (deny/allow) dựa trên luật lệ.
|
|
40
|
+
- **Trigger:** Nhận task không thuộc chuyên môn, hoặc nhận yêu cầu xác thực quyền hạn.
|
|
41
|
+
- **Evidence Required:** Danh sách các Skills khác, Policies (RBAC/ABAC).
|
|
42
|
+
- **Ví dụ Skills:** `qk-orchestrator`, `qk-access-policy`.
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
> **Nguyên tắc Thiết kế Hệ thống:**
|
|
47
|
+
> Khi tạo một Skill mới, đừng cố gắng mô tả "tính cách" của nó. Hãy tự hỏi: *Nó cần dùng những Primitives nào để hoàn thành nhiệm vụ?*
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: complexity-budget
|
|
3
|
+
type: dial
|
|
4
|
+
description: Defines the ceiling for architectural and code complexity.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Levels:
|
|
8
|
+
- **Level 1 (Prototype):** Hardcode data, skip tests, minimal validation. Goal is highest speed.
|
|
9
|
+
- **Level 5 (Standard):** Monolith, basic SQL/ORM, Zod validation, essential error states.
|
|
10
|
+
- **Level 10 (Enterprise):** Event-driven architecture, CQRS, strict rate limiting, 100% test coverage.
|
|
11
|
+
|
|
12
|
+
Usage:
|
|
13
|
+
- The AI must infer the current budget based on the Project Scale (MVP vs Enterprise) and stick to it. Never exceed the budget.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: granularity
|
|
3
|
+
type: dial
|
|
4
|
+
description: Defines the level of detail for access control policies.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Levels:
|
|
8
|
+
- **Level 1 (Coarse):** Role-based (Admin vs User).
|
|
9
|
+
- **Level 5 (Fine-grained):** Attribute-based (Owner of the resource).
|
|
10
|
+
- **Level 10 (Micro):** Field-level permissions (Can edit Title but not Price).
|
|
11
|
+
|
|
12
|
+
Usage:
|
|
13
|
+
- Adjust based on the project scale. For MVP, stick to Level 1.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: optimization-strategy
|
|
3
|
+
type: dial
|
|
4
|
+
description: Defines the approach to database and performance optimization.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Levels:
|
|
8
|
+
- **Level 1 (Query Fixes):** Resolve N+1 issues and add basic indexes.
|
|
9
|
+
- **Level 5 (Caching):** Introduce Redis or Memcached for heavy read paths.
|
|
10
|
+
- **Level 10 (Architecture):** CQRS, Read Replicas, Sharding.
|
|
11
|
+
|
|
12
|
+
Usage:
|
|
13
|
+
- Start at Level 1. Never jump to Level 5 or 10 without explicit bottleneck evidence.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: strictness
|
|
3
|
+
type: dial
|
|
4
|
+
description: Defines how rigidly the AI enforces patterns and rules.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Levels:
|
|
8
|
+
- **Level 1 (Lenient):** Fix only syntax errors and fatal bugs. Ignore bad architecture.
|
|
9
|
+
- **Level 5 (Balanced):** Suggest improvements but don't rewrite entire files.
|
|
10
|
+
- **Level 10 (Draconian):** Fail immediately on any Linter warning. Enforce strict SOLID principles.
|
|
11
|
+
|
|
12
|
+
Usage:
|
|
13
|
+
- Adjust based on the user's intent. If they just want a quick fix, lower the strictness. If they ask for an audit, raise it.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: delegation-only
|
|
3
|
+
type: rule
|
|
4
|
+
description: Restricts the skill from making direct system modifications.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Condition:
|
|
8
|
+
- The skill must ONLY plan, analyze, and dispatch instructions to sub-skills.
|
|
9
|
+
- It must NEVER write code, execute CLI commands, or modify files directly.
|