ai-developer-skill-os 3.0.0 → 3.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 (43) hide show
  1. package/.agents/AGENTS.md +79 -46
  2. package/.github/workflows/ci.yml +56 -0
  3. package/CHANGELOG.md +53 -36
  4. package/README.md +97 -77
  5. package/bin/install.js +14 -2
  6. package/docs/GOVERNANCE.md +40 -0
  7. package/docs/SPEC.md +37 -0
  8. package/docs/adr/0001-intent-based-architecture.md +19 -0
  9. package/docs/adr/0002-kernel-freeze.md +21 -0
  10. package/docs/adr/0003-risk-based-verification.md +20 -0
  11. package/docs/adr/0004-progressive-evidence.md +19 -0
  12. package/docs/skill-classification.md +25 -0
  13. package/knowledge/backend/nodejs.md +52 -0
  14. package/knowledge/frontend/react.md +54 -0
  15. package/package.json +44 -34
  16. package/skills/qk-access-policy/SKILL.md +8 -1
  17. package/skills/qk-ai-builder/SKILL.md +8 -1
  18. package/skills/qk-api-lifecycle/SKILL.md +9 -1
  19. package/skills/qk-bug-resolution/SKILL.md +11 -2
  20. package/skills/qk-context-loader/SKILL.md +9 -1
  21. package/skills/qk-data-lifecycle/SKILL.md +9 -1
  22. package/skills/qk-design-to-code/SKILL.md +8 -1
  23. package/skills/qk-docs/SKILL.md +9 -1
  24. package/skills/qk-documentation-system/SKILL.md +8 -1
  25. package/skills/qk-engineering-standard/SKILL.md +10 -2
  26. package/skills/qk-feature-delivery/SKILL.md +12 -2
  27. package/skills/qk-help/SKILL.md +8 -1
  28. package/skills/qk-orchestrator/SKILL.md +9 -1
  29. package/skills/qk-policy-engine/SKILL.md +9 -1
  30. package/skills/qk-production-release/SKILL.md +9 -2
  31. package/skills/qk-project-bootstrap/SKILL.md +8 -1
  32. package/skills/qk-project-health/SKILL.md +10 -2
  33. package/skills/qk-project-memory/SKILL.md +8 -1
  34. package/skills/qk-system-evolution/SKILL.md +10 -2
  35. package/skills/qk-ui-audit/SKILL.md +10 -2
  36. package/skills/qk-ui-system-builder/SKILL.md +8 -1
  37. package/skills/qk-validation-gate/SKILL.md +10 -2
  38. package/skills.json +433 -556
  39. package/templates/skill-template.md +38 -0
  40. package/tests/install-script.test.js +38 -0
  41. package/tests/registry.test.js +111 -0
  42. package/tests/spec-compliance.test.js +193 -0
  43. package/vitest.config.js +11 -0
package/.agents/AGENTS.md CHANGED
@@ -1,48 +1,81 @@
1
1
  # Global Agent Policies
2
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.
3
+ These policies act as the OS Kernel for all AI agents.
4
+ They establish the baseline behavior, engineering standards, and execution lifecycle.
5
+ Skills follow the standard classifications defined in `docs/skill-classification.md`.
6
+
7
+ ## 1. Core Principles
8
+ **Rules:**
9
+ - **MUST** fix the root cause, not the symptom.
10
+ - **MUST NOT** fabricate facts, APIs, packages, or code that doesn't exist.
11
+ - **MUST NOT** guess the shape of APIs or data. Use evidence.
12
+ - **MUST NOT** redesign the system or overengineer unless explicitly requested.
13
+ - **MUST** preserve backward compatibility unless instructed otherwise.
14
+
15
+ **Guidelines:**
16
+ - **Prefer** solving today's problem over speculative future-proofing.
17
+ - **Prefer** keeping changes minimal and isolated.
18
+
19
+ ## 2. Priority Resolution
20
+ If multiple objectives or skills overlap, resolve them in this order:
21
+ 1. Safety
22
+ 2. Correctness
23
+ 3. User Request
24
+ 4. Performance
25
+ 5. Style
26
+
27
+ ## 3. Planning & Context
28
+ **Rules:**
29
+ - **MUST** read before write. Always understand context before modifying code.
30
+ - **MUST NOT** read the whole project unless explicitly required.
31
+
32
+ **Guidelines:**
33
+ - **Context Budget:** Prefer reading `1 file` → `3 files` → `directory` → `project`.
34
+ - **Evidence Priority:** User input Existing context → Source code → Types → Logs → Runtime → External knowledge.
35
+
36
+ ## 4. Evidence Collection & Confidence
37
+ **Rules:**
38
+ - **MUST NOT** execute speculative actions.
39
+ - **Decision Confidence:** Proceed only when the next action is supported by sufficient evidence. Avoid speculative execution.
40
+
41
+ **Guidelines:**
42
+ - **Progressive Collection:** Collect incrementally. Do not gather all possible information upfront.
43
+ - **Stop early:** Stop collecting evidence as soon as there is sufficient confidence to proceed. If confidence is low, collect exactly *one* additional piece of evidence and repeat.
44
+
45
+ ## 5. Tool Usage
46
+ **Rules:**
47
+ - **MUST** determine if the answer can be derived from the current context before calling any tool.
48
+ - **MUST NOT** use shell commands merely to explore the project (e.g., `pwd`, `ls`, `tree`, `find`) when structure is known.
49
+
50
+ **Guidelines:**
51
+ - **Order of Preference:** Current context → `read_file` → `grep_search` → `search_code` → `run_command`.
52
+ - **Batch Commands:** Batch related operations (e.g., `git status && git diff`).
53
+ - **Command Budget:** Maximum 3 shell commands before producing an initial diagnosis.
54
+
55
+ ## 6. Execution & Repair Loop
56
+ **Rules:**
57
+ - **Repair Loop:** MUST follow: `Observe` → `Hypothesis` → `Evidence` → `Fix` → `Verify` → `Done`. Do NOT jump directly from Observe to Fix.
58
+ - **Escalation Policy:** If 2 consecutive attempts fail (e.g., build fail, permission denied): Stop. Explain the blocker. Request user confirmation before continuing.
59
+ - **Stopping Criteria:** Stop immediately when: Root cause identified, task completed, required evidence collected, or sufficient confidence reached.
60
+
61
+ **Guidelines:**
62
+ - **Cost Policy:** Optimize for: Correctness > Minimal Changes > Minimal Context > Minimal Tool Usage > Minimal Runtime.
63
+
64
+ ## 7. Verification
65
+ **Rules:**
66
+ - **MUST** use the lowest verification level sufficient for the task.
67
+ - **MUST NOT** run build/test unless required by the task or needed for verification.
68
+
69
+ **Guidelines:**
70
+ - **Risk-based Verification:**
71
+ - **Level 0 (Low Risk):** Comment, typo, string changes. Static analysis only.
72
+ - **Level 1:** Read source code.
73
+ - **Level 2 (Medium Risk):** Logic changes. Run targeted test.
74
+ - **Level 3 (High Risk):** Auth, payment, database. Run full validation.
75
+
76
+ ## 8. Output Policy
77
+ **Rules:**
78
+ - **MUST** use English for: Code, reasoning, architecture terms, file names, variables, technical decisions, Git commit messages, logs, and prompt logic (Workflow, Checklist).
79
+ - **MUST** use Vietnamese for: User-facing explanations, questions, summaries, progress updates, and the final report.
80
+ - **MUST NOT** translate: Code snippets, stack traces, file paths, shell commands, config keys, environment variables.
81
+ - **MUST** follow the required reporting structure (Summary, Changes, Reason, Verification, Risks, Next Action).
@@ -0,0 +1,56 @@
1
+ name: CI / Spec Compliance & Registry Validation
2
+
3
+ on:
4
+ pull_request:
5
+ paths:
6
+ - 'skills/**'
7
+ - 'skills.json'
8
+ - 'docs/SPEC.md'
9
+ - 'bin/install.js'
10
+ push:
11
+ branches: [ main ]
12
+ paths:
13
+ - 'skills/**'
14
+ - 'skills.json'
15
+ - 'docs/SPEC.md'
16
+ - 'bin/install.js'
17
+
18
+ jobs:
19
+ lint-and-validate:
20
+ runs-on: windows-latest
21
+ steps:
22
+ - name: Checkout
23
+ uses: actions/checkout@v4
24
+
25
+ - name: Setup Node.js
26
+ uses: actions/setup-node@v4
27
+ with:
28
+ node-version: '20.x'
29
+
30
+ - name: Install dependencies
31
+ run: npm install
32
+
33
+ - name: Validate Skills Registry vs Filesystem
34
+ run: npm run test:registry
35
+
36
+ - name: Validate SKILL.md Spec Compliance
37
+ run: npm run test
38
+
39
+ snapshot:
40
+ runs-on: windows-latest
41
+ needs: lint-and-validate
42
+ if: github.ref == 'refs/heads/main'
43
+ steps:
44
+ - name: Checkout
45
+ uses: actions/checkout@v4
46
+
47
+ - name: Setup Node.js
48
+ uses: actions/setup-node@v4
49
+ with:
50
+ node-version: '20.x'
51
+
52
+ - name: Install dependencies
53
+ run: npm install
54
+
55
+ - name: Generate Registry Snapshot
56
+ run: node bin/install.js --ide=7 --scope=2
package/CHANGELOG.md CHANGED
@@ -1,36 +1,53 @@
1
- # Changelog
2
-
3
- All notable changes to the **AI Developer Skill OS** project will be documented in this file.
4
-
5
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
-
8
- ## [1.0.1] - 2026-07-01
9
- ### Fixed
10
- - Standardized Language rule across all 23 SKILL.md files for consistency.
11
- - Updated registry version to match package.json.
12
-
13
- ## [1.0.0] - 2026-07-01
14
-
15
- ### Added
16
- - Released the complete AI Developer Skill OS with 23 targeted skills for coding agents.
17
- - **Engineering Core (8 skills):**
18
- - `agent-orchestrator` for planning and delegating tasks.
19
- - `context-manager` for project context and file selection.
20
- - `project-audit` for 3-mode health checks.
21
- - `bug-fix` with root cause analysis.
22
- - `refactor` for safe, behavior-preserving code restructuring.
23
- - `migration` for dependency updates and library swapping.
24
- - `api-integration` for robust API connections.
25
- - `git-engineer` for commit messages and PR documentation.
26
- - **Frontend Core (11 skills):**
27
- - `frontend-architecture`, `design-system`, `ui-builder`, `component-generator`.
28
- - `state-management`, `form-builder`, `table-crud-generator`.
29
- - `frontend-debug`, `frontend-testing`, `accessibility-audit`, `frontend-performance`.
30
- - **Backend Core (4 skills):**
31
- - `backend-architecture`, `database-engineer`, `auth-security`, `deployment`.
32
- - Added comprehensive `skills.json` registry with dependencies and trigger keywords.
33
- - Added bilingual `README.md` (English/Vietnamese).
34
- - Added detailed user documentation in `docs/HUONG_DAN_SU_DUNG.md` and `docs/CHI_TIET_SKILLS.md`.
35
- - Translated all skill frontmatter descriptions to Vietnamese for better UX in agent terminals.
36
- - Included generic English and Vietnamese usage examples in `_template/examples/`.
1
+ # Changelog
2
+
3
+ All notable changes to the **AI Developer Skill OS** project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [4.0.0] - 2026-07-02
9
+
10
+ ### Changed (Major Architecture Upgrade)
11
+ - **Intent-Based Agent Architecture:** Replaced rule-based individual skill exceptions with global behavioral group classifications (Static Analysis, Development, Validation, Maintenance).
12
+ - **OS Kernel Refactor:** Completely rewrote `AGENTS.md` (the "OS Kernel") into a strictly organized, lightweight structure under 100 lines.
13
+ - **Progressive Evidence Collection:** Agents now enforce an 80% Confidence Threshold and incremental Context Budget (`1 file` → `3 files`) to prevent over-fetching and hallucination loops.
14
+ - **Cost & Escalation Policies:** Introduced strict cost-optimization logic, Stopping Criteria, and Escalation protocols to prevent infinite `run_command` retries.
15
+ - **Risk-based Verification:** Dynamic test execution based on the risk level of changes (Levels 0-3).
16
+
17
+ ### Added
18
+ - **Registry Validation Suite:** Full Vitest test suite enforcing SKILL.md frontmatter compliance against `docs/SPEC.md`.
19
+ - **GitHub Actions CI:** Automated validation on every PR and push to main.
20
+ - **Idempotent Installer:** `bin/install.js` now detects and updates existing rule blocks instead of duplicating them.
21
+ - **Kilo Code Native Support:** First-class support for `CLAUDE.md` + `kilo.json` config generation.
22
+ - **Governance Docs:** `docs/GOVERNANCE.md`, ADRs, and skill classification policy for enterprise maintainability.
23
+ - **Engineering Standards:** `qk-engineering-standard` and `qk-validation-gate` skills enforce SOLID, DRY, Clean Code, and mandatory quality gates.
24
+
25
+ ## [1.0.1] - 2026-07-01
26
+ ### Fixed
27
+ - Standardized Language rule across all 23 SKILL.md files for consistency.
28
+ - Updated registry version to match package.json.
29
+
30
+ ## [1.0.0] - 2026-07-01
31
+
32
+ ### Added
33
+ - Released the complete AI Developer Skill OS with 23 targeted skills for coding agents.
34
+ - **Engineering Core (8 skills):**
35
+ - `agent-orchestrator` for planning and delegating tasks.
36
+ - `context-manager` for project context and file selection.
37
+ - `project-audit` for 3-mode health checks.
38
+ - `bug-fix` with root cause analysis.
39
+ - `refactor` for safe, behavior-preserving code restructuring.
40
+ - `migration` for dependency updates and library swapping.
41
+ - `api-integration` for robust API connections.
42
+ - `git-engineer` for commit messages and PR documentation.
43
+ - **Frontend Core (11 skills):**
44
+ - `frontend-architecture`, `design-system`, `ui-builder`, `component-generator`.
45
+ - `state-management`, `form-builder`, `table-crud-generator`.
46
+ - `frontend-debug`, `frontend-testing`, `accessibility-audit`, `frontend-performance`.
47
+ - **Backend Core (4 skills):**
48
+ - `backend-architecture`, `database-engineer`, `auth-security`, `deployment`.
49
+ - Added comprehensive `skills.json` registry with dependencies and trigger keywords.
50
+ - Added bilingual `README.md` (English/Vietnamese).
51
+ - Added detailed user documentation in `docs/HUONG_DAN_SU_DUNG.md` and `docs/CHI_TIET_SKILLS.md`.
52
+ - Translated all skill frontmatter descriptions to Vietnamese for better UX in agent terminals.
53
+ - Included generic English and Vietnamese usage examples in `_template/examples/`.
package/README.md CHANGED
@@ -1,77 +1,97 @@
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 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
- ```
1
+ # 🚀 AI Developer Skill OS (ai-developer-skill-os) v4.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, Kilo).
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 v4.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. OS Kernel (`.agents/AGENTS.md`)
14
+ The core of the system is a lightweight, heavily optimized OS Kernel that dictates agent behavior across all tasks.
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.
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
+ ## 🧪 Testing
73
+
74
+ This project includes a full test suite to ensure registry integrity and SKILL.md spec compliance:
75
+
76
+ ```bash
77
+ npm test
78
+ ```
79
+
80
+ CI runs automatically on every PR via GitHub Actions, enforcing:
81
+ - Registry matches filesystem
82
+ - All SKILL.md frontmatters comply with `docs/SPEC.md`
83
+ - Install script idempotency
84
+
85
+ ## 🗑️ Cách Gỡ Cài Đặt (Uninstallation)
86
+
87
+ Nếu bạn đã cài đặt thông qua npm global, bạn có thể gỡ bỏ bằng lệnh:
88
+ ```bash
89
+ npm uninstall -g ai-developer-skill-os
90
+ ```
91
+
92
+ ## 🚀 Tra Cứu (Help)
93
+
94
+ Để 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:
95
+ ```bash
96
+ ./qk-help "Hiển thị tất cả các skill"
97
+ ```
package/bin/install.js CHANGED
@@ -237,8 +237,20 @@ Nếu người dùng sử dụng tham số (argument), bạn BẮT BUỘC phải
237
237
  }
238
238
 
239
239
  if (fs.existsSync(ruleFilePath)) {
240
- fs.appendFileSync(ruleFilePath, "\n\n" + writeContent);
241
- console.log(`✅ Đã GHI THÊM cấu hình tự động vào file: ${ruleFilePath}`);
240
+ const existingContent = fs.readFileSync(ruleFilePath, 'utf8');
241
+ const marker = isGemini ? '<RULE[ai_skill_os]>' : '[Role]\nYou are an elite AI Software Engineer.';
242
+ const markerIndex = existingContent.indexOf(marker);
243
+ if (markerIndex !== -1) {
244
+ const before = existingContent.substring(0, markerIndex);
245
+ const after = existingContent.substring(markerIndex).split('\n').slice(isGemini ? 2 : 1).join('\n');
246
+ const lastMarkerEnd = after.indexOf(isGemini ? '</RULE[ai_skill_os]>' : '[Trigger Mechanism]');
247
+ const actualAfter = lastMarkerEnd !== -1 ? after.substring(lastMarkerEnd + (isGemini ? 19 : 18)).trimStart() : after;
248
+ fs.writeFileSync(ruleFilePath, before + writeContent.trimStart() + (actualAfter ? '\n' + actualAfter : '') + '\n');
249
+ console.log(`✅ Đã CẬP NHẬT cấu hình tự động trong file: ${ruleFilePath}`);
250
+ } else {
251
+ fs.appendFileSync(ruleFilePath, "\n\n" + writeContent);
252
+ console.log(`✅ Đã GHI THÊM cấu hình tự động vào file: ${ruleFilePath}`);
253
+ }
242
254
  } else {
243
255
  fs.writeFileSync(ruleFilePath, writeContent);
244
256
  console.log(`✅ Đã TẠO MỚI file cấu hình: ${ruleFilePath}`);
@@ -0,0 +1,40 @@
1
+ # Project Governance
2
+
3
+ This document serves as the "Constitution" for the AI Developer Skill OS. It dictates how the project evolves, when core files can be modified, and how versions are incremented.
4
+
5
+ ## 1. Core Philosophy
6
+ **Architecture-first, features-second.**
7
+ Before submitting any Pull Request, ask yourself:
8
+ 1. *Does this change require modifying the OS Kernel (`AGENTS.md`)?*
9
+ 2. *If not, can this be solved at the Skill, Knowledge, or Template layer?*
10
+
11
+ If the problem can be solved in a Skill, Knowledge document, or Template, **do not touch the Kernel**.
12
+
13
+ ## 2. When to modify `AGENTS.md` (The Kernel)
14
+ The Kernel is **frozen**. Modifications to `AGENTS.md` are strictly prohibited unless:
15
+ - The change introduces a fundamentally new paradigm for ALL agents (e.g., a completely new approach to token management).
16
+ - A critical, framework-breaking hallucination loop is discovered that cannot be solved via Skill guidelines.
17
+ - **Requirement:** Any modification to `AGENTS.md` MUST be accompanied by a new Architecture Decision Record (ADR).
18
+
19
+ ## 3. When to create an ADR (Architecture Decision Record)
20
+ ADRs (located in `docs/adr/`) must be created when:
21
+ - Modifying `AGENTS.md` or `SPEC.md`.
22
+ - Introducing a new lifecycle phase to the pipeline.
23
+ - Deprecating an existing core feature or standard tool.
24
+
25
+ ## 4. Definition of a "Breaking Change"
26
+ A change is considered **Breaking** if it:
27
+ - Alters the required YAML frontmatter contract in `SPEC.md`.
28
+ - Changes the fundamental routing logic or expected `behavior` / `intent` mappings.
29
+ - Removes an existing global policy that downstream agents rely on.
30
+
31
+ ## 5. Versioning Strategy (Semantic Versioning)
32
+ We strictly adhere to SemVer based on the framework's architecture, not just content.
33
+ - **MAJOR (e.g., v4.0.0 to v5.0.0):** Breaking changes to the Kernel (`AGENTS.md`), Metadata Contract (`SPEC.md`), or fundamental routing.
34
+ - **MINOR (e.g., v4.0.0 to v4.1.0):** Adding new Capabilities, new default Skills, new Knowledge docs, or new Templates.
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
+
37
+ ## 6. PR Review Process
38
+ 1. **Architecture Compliance:** Does the PR violate the Kernel Freeze? Are all skills compliant with `SPEC.md`?
39
+ 2. **Documentation Consistency:** Are the changes reflected in `CHANGELOG.md`?
40
+ 3. **No Redundancy:** Ensure the PR does not re-introduce tool usage rules or verification overrides into individual skills.
package/docs/SPEC.md ADDED
@@ -0,0 +1,37 @@
1
+ # AI Developer Skill OS - Specification (v4)
2
+
3
+ This document defines the strict contract and schema for developing Custom Skills in the AI Developer Skill OS. The metadata frontmatter is frozen to ensure cross-platform compatibility (Cursor, Claude Code, Windsurf, Gemini).
4
+
5
+ ## 1. Frontmatter Contract (YAML)
6
+
7
+ Every `SKILL.md` must begin with this exact YAML structure. Do not add, remove, or rename fields.
8
+
9
+ ```yaml
10
+ ---
11
+ name: qk-[skill-name]
12
+ version: X.Y.Z
13
+ updated: YYYY-MM-DD
14
+ description: Brief summary of what this skill accomplishes.
15
+ behavior: static-analysis | development | validation | maintenance
16
+ intent: review-code | fix-bug | implement-feature | validate | maintain
17
+ priority: low | medium | high | critical
18
+ tags: [tag1, tag2]
19
+ platforms: [claude-code, cursor, windsurf, gemini-cli]
20
+ trigger: Natural language phrase that activates this skill.
21
+ inputs: [Required inputs]
22
+ outputs: [Expected outputs]
23
+ allowed_tools: [Tool1, Tool2]
24
+ pipeline: [analyze, plan, implement, validate, complete]
25
+ ---
26
+ ```
27
+
28
+ ## 2. Skill Body Structure (Markdown)
29
+
30
+ The body of the `SKILL.md` file MUST contain the following sections:
31
+
32
+ 1. **Goal:** The core objective of the skill.
33
+ 2. **Chain of Thought (SOP):** The exact step-by-step reasoning the agent must follow.
34
+ 3. **Constraints & Rules:** Hard boundaries and limits for this specific skill.
35
+ 4. **Handoff Pipeline (Optional):** How this skill transitions to the next phase (e.g. passing to validation).
36
+
37
+ *Note: Skill documents MUST NOT declare Verification Levels or override Tool Efficiency policies. Those are exclusively managed by the Global Kernel (`AGENTS.md`).*
@@ -0,0 +1,19 @@
1
+ # 1. Intent-Based Architecture
2
+
3
+ Date: 2026-07-02
4
+
5
+ ## Status
6
+ Accepted
7
+
8
+ ## Context
9
+ As the framework grew from 5 to 20+ skills, managing individual tool permissions and specific verification overrides within each `SKILL.md` became a maintenance nightmare (violating DRY). Agents were also suffering from "context bloat" because they had to read sprawling, repetitive rules across different skills.
10
+
11
+ ## Decision
12
+ We transitioned from a "Rule-Based" architecture to an "Intent-Based" architecture.
13
+ - Skills no longer define their own verification exceptions or tool usage logic.
14
+ - Instead, skills declare their `behavior` and `intent` via frozen YAML metadata.
15
+ - The OS Kernel (`AGENTS.md`) intercepts these intents and automatically applies the correct global routing and execution constraints based on the categorized behavior.
16
+
17
+ ## Consequences
18
+ - **Positive:** Massive reduction in skill file size. Easier to scale to 100+ skills. Centralized logic in the Kernel. Agent routing is drastically improved due to clear `intent` mapping.
19
+ - **Negative:** Less granular control over unique outliers, but this enforces better standardization.
@@ -0,0 +1,21 @@
1
+ # 2. Kernel Freeze
2
+
3
+ Date: 2026-07-02
4
+
5
+ ## Status
6
+ Accepted
7
+
8
+ ## Context
9
+ The Global Policy file (`AGENTS.md`), which acts as the OS Kernel, was continuously expanding. Policies like Language, Decision, Engineering, Output, Tool Efficiency, Context Budget, and Escapation were all piled into a single document, threatening to balloon past 1,000 lines. A bloated kernel leads to Agent Hallucinations (due to context window pressure) and conflicting priorities.
10
+
11
+ ## Decision
12
+ We officially "Freeze" the Kernel (`AGENTS.md`) at v4.0.0. The file is strictly rewritten to under 100 lines using absolute Rules (MUST/MUST NOT) and Guidelines (Prefer/Avoid).
13
+ Moving forward, no new policies will be added to the Kernel. All future expansions must occur at the higher layers:
14
+ - New Capabilities
15
+ - New Skills
16
+ - New Knowledge documents
17
+ - New Templates
18
+
19
+ ## Consequences
20
+ - **Positive:** The baseline ruleset is locked, highly token-efficient, and easily digestible by any LLM. The framework achieves enterprise stability.
21
+ - **Negative:** Feature requests that require global policy shifts will be rejected by default unless they fundamentally rewrite the OS paradigm.
@@ -0,0 +1,20 @@
1
+ # 3. Risk-based Verification
2
+
3
+ Date: 2026-07-02
4
+
5
+ ## Status
6
+ Accepted
7
+
8
+ ## Context
9
+ Previously, Verification Levels were hardcoded into the Skill Classification (e.g., Development skills automatically forced Level 2 Verification, meaning test suites were run regardless of the actual change). This caused conflicting behavior. For example, fixing a typo in a comment using the `qk-bug-resolution` skill would still trigger a test run, wasting time and resources.
10
+
11
+ ## Decision
12
+ We completely decoupled Verification Levels from Skill Classifications.
13
+ Skills now only define their "Preferred Evidence Strategy". The actual depth of verification is determined strictly by the **Risk-based Verification Policy** in the Kernel (`AGENTS.md`).
14
+ - Level 0 (Low Risk): Comments, typos (Static Analysis only).
15
+ - Level 2 (Medium Risk): Logic changes (Targeted tests).
16
+ - Level 3 (High Risk): Auth, DB (Full validation).
17
+
18
+ ## Consequences
19
+ - **Positive:** Agents no longer blindly run tests for trivial changes. Verification scales with the danger of the code being modified, vastly improving speed and token efficiency.
20
+ - **Negative:** Agents must use logic to evaluate the "Risk" of their own changes before deciding whether to run a test.