ai-developer-skill-os 8.2.1 → 8.3.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 (151) hide show
  1. package/.agents/LICENSE +21 -21
  2. package/.agents/README.md +90 -90
  3. package/.agents/docs/CHI_TIET_SKILLS.md +125 -125
  4. package/.agents/docs/MIGRATION-CLEANUP-V8.1.3.md +36 -36
  5. package/.agents/docs/MIGRATION-STATUS.md +35 -35
  6. package/.agents/docs/MIGRATION-V8.md +10 -10
  7. package/.agents/docs/V8-CERTIFICATION.md +27 -27
  8. package/.agents/docs/decisions/ADR-001-v8-migration.md +58 -58
  9. package/.agents/docs/decisions/ADR-002-workflow-separation.md +50 -50
  10. package/.agents/docs/decisions/ADR-003-registry-generated.md +54 -54
  11. package/.agents/docs/decisions/ADR-008-skill-boundary-review.md +27 -27
  12. package/.agents/registry/capability-graph.yml +67 -25
  13. package/.agents/registry/graph.json +135 -256
  14. package/.agents/registry/index.yaml +68 -95
  15. package/.agents/registry/skills-index.yml +548 -525
  16. package/.agents/rules/anti-patterns.md +45 -0
  17. package/.agents/rules/coding.md +10 -0
  18. package/.agents/rules/command-safety.md +37 -14
  19. package/.agents/rules/priorities.yml +13 -2
  20. package/.agents/rules/security.md +47 -7
  21. package/.agents/rules/skill-quality.md +32 -8
  22. package/.agents/skills/_template/SKILL.md +133 -132
  23. package/.agents/skills/_template/capability.yaml +22 -8
  24. package/.agents/skills/_template/evals/scorecard.yaml +19 -19
  25. package/.agents/skills/qk-access-policy/SKILL.md +5 -2
  26. package/.agents/skills/qk-access-policy/capability.yaml +23 -0
  27. package/.agents/skills/qk-access-policy/evals/scorecard.yaml +36 -0
  28. package/.agents/skills/qk-agent-observability/SKILL.md +112 -1
  29. package/.agents/skills/qk-agent-observability/capability.yaml +29 -0
  30. package/.agents/skills/qk-agent-observability/evals/scorecard.yaml +29 -0
  31. package/.agents/skills/qk-agent-observability/references/scorecard.yaml +80 -0
  32. package/.agents/skills/qk-ai-builder/SKILL.md +75 -6
  33. package/.agents/skills/qk-ai-builder/capability.yaml +23 -0
  34. package/.agents/skills/qk-ai-builder/evals/scorecard.yaml +30 -0
  35. package/.agents/skills/qk-api-lifecycle/SKILL.md +5 -3
  36. package/.agents/skills/qk-api-lifecycle/capability.yaml +23 -0
  37. package/.agents/skills/qk-api-lifecycle/evals/scorecard.yaml +29 -0
  38. package/.agents/skills/qk-bug-resolution/SKILL.md +4 -22
  39. package/.agents/skills/qk-bug-resolution/capability.yaml +25 -0
  40. package/.agents/skills/qk-bug-resolution/evals/scorecard.yaml +30 -0
  41. package/.agents/skills/qk-code-review/SKILL.md +188 -186
  42. package/.agents/skills/qk-code-review/capability.yaml +23 -0
  43. package/.agents/skills/qk-code-review/evals/scorecard.yaml +29 -0
  44. package/.agents/skills/qk-context-loader/SKILL.md +4 -12
  45. package/.agents/skills/qk-context-loader/capability.yaml +23 -0
  46. package/.agents/skills/qk-context-loader/evals/scorecard.yaml +28 -0
  47. package/.agents/skills/qk-data-lifecycle/SKILL.md +7 -2
  48. package/.agents/skills/qk-data-lifecycle/capability.yaml +23 -0
  49. package/.agents/skills/qk-data-lifecycle/evals/scorecard.yaml +29 -0
  50. package/.agents/skills/qk-db-optimizer/SKILL.md +4 -3
  51. package/.agents/skills/qk-db-optimizer/capability.yaml +22 -0
  52. package/.agents/skills/qk-db-optimizer/evals/scorecard.yaml +28 -0
  53. package/.agents/skills/qk-design-system-engineering/SKILL.md +235 -112
  54. package/.agents/skills/qk-design-system-engineering/capability.yaml +25 -0
  55. package/.agents/skills/qk-design-system-engineering/evals/scorecard.yaml +27 -0
  56. package/.agents/skills/qk-devops-platform/SKILL.md +241 -117
  57. package/.agents/skills/qk-devops-platform/capability.yaml +29 -0
  58. package/.agents/skills/qk-devops-platform/evals/scorecard.yaml +28 -0
  59. package/.agents/skills/qk-docs/SKILL.md +4 -2
  60. package/.agents/skills/qk-docs/capability.yaml +23 -0
  61. package/.agents/skills/qk-docs/evals/scorecard.yaml +27 -0
  62. package/.agents/skills/qk-engineering-standard/SKILL.md +5 -76
  63. package/.agents/skills/qk-engineering-standard/capability.yaml +23 -0
  64. package/.agents/skills/qk-engineering-standard/evals/scorecard.yaml +28 -0
  65. package/.agents/skills/qk-engineering-standard/references/anti-patterns.md +121 -0
  66. package/.agents/skills/qk-engineering-standard/rules/frontend.md +1 -1
  67. package/.agents/skills/qk-fe-api-integration/SKILL.md +14 -33
  68. package/.agents/skills/qk-fe-api-integration/capability.yaml +21 -0
  69. package/.agents/skills/qk-fe-api-integration/evals/scorecard.yaml +29 -0
  70. package/.agents/skills/qk-feature-delivery/SKILL.md +54 -222
  71. package/.agents/skills/qk-feature-delivery/capability.yaml +24 -0
  72. package/.agents/skills/qk-feature-delivery/evals/scorecard.yaml +28 -0
  73. package/.agents/skills/qk-frontend-architecture/SKILL.md +258 -134
  74. package/.agents/skills/qk-frontend-architecture/capability.yaml +28 -0
  75. package/.agents/skills/qk-frontend-architecture/evals/scorecard.yaml +28 -0
  76. package/.agents/skills/qk-help/SKILL.md +23 -161
  77. package/.agents/skills/qk-help/capability.yaml +20 -0
  78. package/.agents/skills/qk-help/evals/scorecard.yaml +13 -0
  79. package/.agents/skills/qk-orchestrator/SKILL.md +3 -35
  80. package/.agents/skills/qk-orchestrator/capability.yaml +22 -0
  81. package/.agents/skills/qk-orchestrator/evals/scorecard.yaml +27 -0
  82. package/.agents/skills/qk-orchestrator/references/routing-table.md +15 -3
  83. package/.agents/skills/qk-product-specification/SKILL.md +253 -130
  84. package/.agents/skills/qk-product-specification/capability.yaml +27 -0
  85. package/.agents/skills/qk-product-specification/evals/scorecard.yaml +27 -0
  86. package/.agents/skills/qk-production-release/SKILL.md +33 -68
  87. package/.agents/skills/qk-production-release/capability.yaml +27 -0
  88. package/.agents/skills/qk-production-release/evals/scorecard.yaml +28 -0
  89. package/.agents/skills/qk-project-bootstrap/SKILL.md +59 -8
  90. package/.agents/skills/qk-project-bootstrap/capability.yaml +23 -0
  91. package/.agents/skills/qk-project-bootstrap/evals/scorecard.yaml +28 -0
  92. package/.agents/skills/qk-project-health/SKILL.md +5 -3
  93. package/.agents/skills/qk-project-health/capability.yaml +23 -0
  94. package/.agents/skills/qk-project-health/evals/scorecard.yaml +27 -0
  95. package/.agents/skills/qk-project-memory/SKILL.md +4 -2
  96. package/.agents/skills/qk-project-memory/capability.yaml +23 -0
  97. package/.agents/skills/qk-project-memory/evals/scorecard.yaml +27 -0
  98. package/.agents/skills/qk-refactor/SKILL.md +117 -0
  99. package/.agents/skills/qk-refactor/capability.yaml +26 -0
  100. package/.agents/skills/qk-refactor/evals/scorecard.yaml +27 -0
  101. package/.agents/skills/qk-security-audit/SKILL.md +259 -135
  102. package/.agents/skills/qk-security-audit/capability.yaml +30 -0
  103. package/.agents/skills/qk-security-audit/evals/scorecard.yaml +27 -0
  104. package/.agents/skills/qk-system-evolution/SKILL.md +18 -68
  105. package/.agents/skills/qk-system-evolution/capability.yaml +24 -0
  106. package/.agents/skills/qk-system-evolution/evals/scorecard.yaml +26 -0
  107. package/.agents/skills/qk-test-engineering/SKILL.md +262 -139
  108. package/.agents/skills/qk-test-engineering/capability.yaml +28 -0
  109. package/.agents/skills/qk-test-engineering/evals/scorecard.yaml +26 -0
  110. package/.agents/skills/qk-ui-audit/SKILL.md +17 -90
  111. package/.agents/skills/qk-ui-audit/capability.yaml +23 -0
  112. package/.agents/skills/qk-ui-audit/evals/scorecard.yaml +26 -0
  113. package/.agents/skills/qk-ui-audit/references/anti-slop-checklist.md +2 -2
  114. package/.agents/skills/qk-ui-builder/SKILL.md +482 -509
  115. package/.agents/skills/qk-ui-builder/capability.yaml +29 -0
  116. package/.agents/skills/qk-ui-builder/references/component-cookbook.md +455 -1191
  117. package/.agents/skills/qk-ui-system-builder/SKILL.md +2 -6
  118. package/.agents/skills/qk-ui-system-builder/capability.yaml +25 -0
  119. package/.agents/skills/qk-ui-system-builder/evals/scorecard.yaml +26 -0
  120. package/.agents/skills/qk-validation-gate/SKILL.md +1 -75
  121. package/.agents/skills/qk-validation-gate/capability.yaml +23 -0
  122. package/.agents/skills/qk-validation-gate/evals/scorecard.yaml +26 -0
  123. package/.agents/skills/qk-web-quality-gate/SKILL.md +232 -114
  124. package/.agents/skills/qk-web-quality-gate/capability.yaml +24 -0
  125. package/.agents/skills/qk-web-quality-gate/evals/scorecard.yaml +26 -0
  126. package/.agents/workflows/_schema.yml +146 -109
  127. package/.agents/workflows/bug-resolution.yml +121 -101
  128. package/.agents/workflows/code-review.yml +93 -77
  129. package/.agents/workflows/documentation.yml +90 -75
  130. package/.agents/workflows/feature-delivery.yml +120 -103
  131. package/.agents/workflows/production-release.yml +173 -0
  132. package/.agents/workflows/refactor.yml +99 -81
  133. package/.agents/workflows/research.yml +75 -60
  134. package/.agents/workflows/security-audit.yml +115 -72
  135. package/.agents/workflows/skill-evolution.yml +97 -65
  136. package/.agents/workflows/spec-driven-development.yml +87 -57
  137. package/CHANGELOG.md +27 -0
  138. package/README.md +90 -90
  139. package/bin/install.js +329 -179
  140. package/package.json +4 -2
  141. package/tooling/build-registry.js +186 -186
  142. package/tooling/fix-refactor.js +8 -0
  143. package/tooling/sync-versions.js +49 -0
  144. package/tooling/validate-graph.js +87 -87
  145. package/.agents/CHANGELOG.md +0 -131
  146. package/.agents/learnings/draft/README.md +0 -37
  147. package/.agents/reports/RELEASE-CHECKLIST.md +0 -29
  148. package/.agents/reports/architecture-audit.md +0 -13
  149. package/.agents/reports/graph-health.md +0 -20
  150. package/.agents/reports/skill-audit.md +0 -215
  151. package/tooling/generate-registry.js +0 -157
@@ -0,0 +1,117 @@
1
+ ---
2
+ name: qk-refactor
3
+ version: 8.3.1
4
+ status: stable
5
+ description: "Tái cấu trúc và dọn dẹp mã nguồn để dễ bảo trì hơn mà không làm thay đổi logic hoạt động bên ngoài."
6
+ platforms: [antigravity, claude-code, cursor, windsurf, kilo-code]
7
+
8
+ type: capability
9
+
10
+ intent:
11
+ - refactoring
12
+ - code-cleanup
13
+ - complexity-reduction
14
+
15
+ complexity:
16
+ level: medium
17
+ criteria:
18
+ files_affected: "2-5"
19
+ has_behavior_change: false
20
+ has_external_dependency: false
21
+ has_breaking_change: false
22
+
23
+ triggers:
24
+ - refactor
25
+ - tái cấu trúc
26
+ - clean up this code
27
+ - simplify
28
+ - reduce complexity
29
+ - dẫn cấu trúc code
30
+
31
+ selection:
32
+ priority: medium
33
+ confidence_threshold: 0.80
34
+
35
+ workflow: refactor
36
+
37
+ rules:
38
+ - global
39
+ - coding
40
+ - safety
41
+
42
+ tools:
43
+ - filesystem
44
+ - terminal
45
+
46
+ related_skills:
47
+ - qk-engineering-standard
48
+ - qk-project-health
49
+
50
+ knowledge_scope:
51
+ owns:
52
+ - refactoring-patterns
53
+ - code-smells
54
+ references:
55
+ - architecture
56
+ - coding-standards
57
+
58
+ verification:
59
+ required: true
60
+ strategy: refactor
61
+
62
+ examples: []
63
+ learnings: []
64
+
65
+ execution_mode: deterministic
66
+ cost: medium
67
+ latency: medium
68
+ risk: medium
69
+ side_effects: edit_files
70
+ produces: [code, report]
71
+ consumes: [source-code]
72
+
73
+ token_budget:
74
+ max_files_read: 3
75
+ max_lines_per_read: 150
76
+ max_shell_commands: 2
77
+ stop_early: true
78
+
79
+ exit_codes: [SUCCESS, BLOCKED, FAILED, PARTIAL]
80
+ ---
81
+
82
+ # qk-refactor - Safe Refactor
83
+
84
+ > Language rule: Code, identifiers, file names → English. Explanations, summaries → Vietnamese.
85
+
86
+ ## Preconditions
87
+ - [ ] Target file(s) or module(s) are specified
88
+ - [ ] Tests exist for the target code (or can be created)
89
+
90
+ On missing precondition:
91
+ EXIT: BLOCKED
92
+ Message: "Missing: target files or test coverage"
93
+
94
+ ## Scope
95
+ - Improve internal code quality without changing external behavior
96
+ - Reduce complexity, improve naming, extract functions
97
+ - Remove dead code and duplication
98
+
99
+ ## Non-Goals
100
+ - Add new functionality
101
+ - Change public API signatures
102
+ - Modify behavior or business logic
103
+
104
+ ## Workflow
105
+ 1. Establish baseline (current behavior + tests)
106
+ 2. Plan refactor steps
107
+ 3. Execute step by step
108
+ 4. Verify behavior unchanged
109
+ 5. Run validation gate
110
+
111
+ ## Exit Codes
112
+ | Code | Meaning |
113
+ |------|---------|
114
+ | SUCCESS | Refactor complete, behavior preserved, tests pass |
115
+ | PARTIAL | Refactor done, some tests need attention |
116
+ | BLOCKED | Missing preconditions |
117
+ | FAILED | Behavior changed or tests broken |
@@ -0,0 +1,26 @@
1
+ schema_version: 1
2
+ id: "qk-refactor"
3
+ version: "8.3.1"
4
+ description: "Tái cấu trúc và dọn dẹp mã nguồn để dễ bảo trì hơn mà không làm thay đổi logic hoạt động bên ngoài."
5
+ dependencies:
6
+ - "refactor"
7
+ tools:
8
+ - "filesystem"
9
+ - "terminal"
10
+ knowledge:
11
+ owns:
12
+ - "refactoring-patterns"
13
+ - "code-smells"
14
+ references:
15
+ - "architecture"
16
+ - "coding-standards"
17
+ eval:
18
+ scorecard: "evals/scorecard.yaml"
19
+ decision_boundary:
20
+ owns:
21
+ - "refactoring-patterns"
22
+ does_not_own:
23
+ - "new-functionality"
24
+ - "api-changes"
25
+ conflicts_with: []
26
+ delegates_to: []
@@ -0,0 +1,27 @@
1
+ name: qk-refactor-eval
2
+ description: Đánh giá an toàn và hiệu quả của tiến trình Refactor
3
+ version: 8.3.1
4
+ threshold: 90 # Yêu cầu an toàn rất cao, refactor không được làm hỏng tính năng
5
+
6
+ metrics:
7
+ - id: behavior_preservation
8
+ name: Bảo toàn Logic (Behavior Preservation)
9
+ description: Tái cấu trúc có làm thay đổi logic hoạt động hoặc API public không?
10
+ weight: 40
11
+ criteria:
12
+ - Tuyệt đối không thêm tính năng mới trong quá trình refactor (20đ)
13
+ - Không thay đổi chữ ký (signature) của các public API (20đ)
14
+
15
+ - id: test_coverage_precondition
16
+ name: Tiền điều kiện Kiểm thử (Tests)
17
+ description: Agent có từ chối refactor nếu không có Tests bảo vệ không?
18
+ weight: 35
19
+ criteria:
20
+ - Chặn (BLOCKED) và yêu cầu viết test nếu code chưa có coverage (35đ)
21
+
22
+ - id: complexity_reduction
23
+ name: Giảm Độ phức tạp (Complexity Reduction)
24
+ description: Kết quả refactor có thực sự làm code sạch và dễ bảo trì hơn không?
25
+ weight: 25
26
+ criteria:
27
+ - Tách hàm, loại bỏ code chết, giảm cyclomatic complexity rõ rệt (25đ)
@@ -1,135 +1,259 @@
1
- ---
2
- # ── Identity ───────────────────────────────────────────────
3
- name: qk-security-audit
4
- version: 8.1.0
5
- status: experimental
6
- description: "Security audit (OWASP, dependency security, secret detection, permission model)."
7
- platforms: [antigravity, claude-code, cursor, windsurf, kilo-code]
8
-
9
- # ── V8: Classification ─────────────────────────────────────
10
- type: capability
11
-
12
- intent:
13
- - security-audit
14
- - vulnerability-scan
15
- - secret-detection
16
- - permission-review
17
-
18
- complexity:
19
- level: high
20
- criteria:
21
- files_affected: "1-10"
22
- has_behavior_change: true
23
- has_external_dependency: true
24
- has_breaking_change: false
25
-
26
- triggers:
27
- - "kiểm tra bảo mật"
28
- - "scan lỗ hổng"
29
- - "audit code"
30
- - "tìm secret leak"
31
-
32
- # ── V8: References ─────────────────────────────────────────
33
- workflow: security-audit
34
-
35
- rules:
36
- - global
37
- - security
38
-
39
- tools:
40
- - filesystem
41
- - terminal
42
-
43
- related_skills:
44
- - qk-access-policy
45
-
46
- knowledge_scope:
47
- domain:
48
- - security-practices
49
- - vulnerability-detection
50
- concepts:
51
- - owasp
52
- - secret-detection
53
- references:
54
- - architecture
55
-
56
- decision_boundary:
57
- owns:
58
- - application-security
59
- - agent-security
60
- - prompt-injection
61
- - dependency-risk
62
- does_not_own:
63
- - access control implementation
64
- - penetration testing
65
- - compliance certification
66
- conflicts_with: []
67
- delegates_to:
68
- - qk-validation-gate
69
-
70
- # ── V8: Verification ───────────────────────────────────────
71
- verification:
72
- required: true
73
- strategy: feature
74
-
75
- lifecycle:
76
- promotion_gate:
77
- requirements:
78
- tests:
79
- minimum_pass_rate: 0.95
80
- usage:
81
- minimum_runs: 20
82
- conflicts:
83
- zero_boundary_violation: true
84
- evidence:
85
- required:
86
- - evaluation_report
87
- - usage_history
88
- - boundary_audit
89
- demotion_gate:
90
- triggers:
91
- - repeated_failure
92
- - boundary_violation
93
- - outdated_reference
94
- action:
95
- change_status: "stable -> experimental"
96
-
97
- selection:
98
- priority: high
99
- confidence_threshold: 0.85
100
-
101
- examples: []
102
- learnings: []
103
-
104
- # ── V7 Runtime ─────────────────────────────────────────────
105
- execution_mode: deterministic
106
- cost: medium
107
- latency: slow
108
- risk: low
109
- side_effects: read_only
110
- produces: [report, security_fixes]
111
- consumes: [user-description]
112
-
113
- token_budget:
114
- max_files_read: 10
115
- max_lines_per_read: 150
116
- max_shell_commands: 2
117
- stop_early: true
118
-
119
- exit_codes: [SUCCESS, BLOCKED, FAILED, PARTIAL]
120
- ---
121
-
122
- # qk-security-audit — Security Auditor
123
-
124
- > **Language rule:** Code, identifiers, file names → English. Explanations, summaries → Vietnamese.
125
-
126
- ## Preconditions
127
- - [ ] Tuân thủ `security.md`.
128
- - [ ] Xác định phạm vi codebase cần audit.
129
-
130
- ## Scope
131
- - Quét và phát hiện các rủi ro bảo mật từ dependencies bên thứ ba.
132
- - Nhận diện secret bị hardcode/leak (API keys, passwords, tokens).
133
- - soát hình phân quyền (RBAC, ABAC) kiểm tra lỗ hổng logic (BOLA, Broken Auth).
134
- - Check dựa trên OWASP Top 10.
135
- - Khuyến nghị bản bảo mật tương ứng.
1
+ ---
2
+ # ── Identity ───────────────────────────────────────────────
3
+ name: qk-security-audit
4
+ version: 8.3.1
5
+ status: experimental
6
+ description: "Security audit (OWASP, dependency security, secret detection, permission model)."
7
+ platforms: [antigravity, claude-code, cursor, windsurf, kilo-code]
8
+
9
+ # ── V8: Classification ─────────────────────────────────────
10
+ type: capability
11
+
12
+ intent:
13
+ - security-audit
14
+ - vulnerability-scan
15
+ - secret-detection
16
+ - permission-review
17
+
18
+ complexity:
19
+ level: high
20
+ criteria:
21
+ files_affected: "1-10"
22
+ has_behavior_change: true
23
+ has_external_dependency: true
24
+ has_breaking_change: false
25
+
26
+ triggers:
27
+ - "kiểm tra bảo mật"
28
+ - "scan lỗ hổng"
29
+ - "audit code"
30
+ - "tìm secret leak"
31
+
32
+ # ── V8: References ─────────────────────────────────────────
33
+ workflow: security-audit
34
+
35
+ rules:
36
+ - global
37
+ - security
38
+
39
+ tools:
40
+ - filesystem
41
+ - terminal
42
+
43
+ related_skills:
44
+ - qk-access-policy
45
+
46
+ knowledge_scope:
47
+ domain:
48
+ - security-practices
49
+ - vulnerability-detection
50
+ concepts:
51
+ - owasp
52
+ - secret-detection
53
+ references:
54
+ - architecture
55
+ - security
56
+ - anti-patterns
57
+
58
+ decision_boundary:
59
+ owns:
60
+ - application-security
61
+ - agent-security
62
+ - prompt-injection
63
+ - dependency-risk
64
+ does_not_own:
65
+ - access control implementation
66
+ - penetration testing
67
+ - compliance certification
68
+ conflicts_with: []
69
+ delegates_to:
70
+ - qk-validation-gate
71
+
72
+ # ── V8: Verification ───────────────────────────────────────
73
+ verification:
74
+ required: true
75
+ strategy: feature
76
+
77
+ lifecycle:
78
+ promotion_gate:
79
+ requirements:
80
+ tests:
81
+ minimum_pass_rate: 0.95
82
+ usage:
83
+ minimum_runs: 20
84
+ conflicts:
85
+ zero_boundary_violation: true
86
+ evidence:
87
+ required:
88
+ - evaluation_report
89
+ - usage_history
90
+ - boundary_audit
91
+ demotion_gate:
92
+ triggers:
93
+ - repeated_failure
94
+ - boundary_violation
95
+ - outdated_reference
96
+ action:
97
+ change_status: "stable -> experimental"
98
+
99
+ selection:
100
+ priority: high
101
+ confidence_threshold: 0.85
102
+
103
+ examples: []
104
+ learnings: []
105
+
106
+ # ── V7 Runtime ─────────────────────────────────────────────
107
+ execution_mode: deterministic
108
+ cost: medium
109
+ latency: slow
110
+ risk: low
111
+ side_effects: read_only
112
+ produces: [report, security_fixes]
113
+ consumes: [user-description]
114
+
115
+ token_budget:
116
+ max_files_read: 10
117
+ max_lines_per_read: 150
118
+ max_shell_commands: 2
119
+ stop_early: true
120
+
121
+ exit_codes: [SUCCESS, BLOCKED, FAILED, PARTIAL]
122
+ ---
123
+
124
+ # qk-security-audit Security Auditor
125
+
126
+ > **Language rule:** Code, identifiers, file names → English. Explanations, summaries → Vietnamese.
127
+
128
+ ## Preconditions
129
+ - [ ] Tuân thủ `security.md`.
130
+ - [ ] Xác định phạm vi codebase cần audit.
131
+
132
+ ## Scope
133
+ - Quét phát hiện các rủi ro bảo mật từ dependencies bên thứ ba.
134
+ - Nhận diện secret bị hardcode/leak (API keys, passwords, tokens).
135
+ - soát hình phân quyền (RBAC, ABAC) và kiểm tra lỗ hổng logic (BOLA, Broken Auth).
136
+ - **Quét lỗ hổng Prompt Injection và xác minh ranh giới Zero-Trust theo đúng R-SEC-04.**
137
+ - Check dựa trên OWASP Top 10.
138
+ - Khuyến nghị bản vá bảo mật tương ứng.
139
+
140
+ ## Non-Goals
141
+ - ❌ Provide implementation outside of Security Vulnerability Detection scope
142
+ - ❌ Override explicit user directives without explanation
143
+ - ❌ Guess ambiguous requirements without asking
144
+
145
+ ## Priority Order
146
+
147
+ | Priority | Task | Skip Threshold |
148
+ |----------|------|----------------|
149
+ | P1 | Core Security Vulnerability Detection analysis and decision making | Never |
150
+ | P2 | Validation of existing patterns | Budget < 30% |
151
+ | P3 | Detailed documentation generation | Budget < 50% |
152
+ | P4 | Edge case exploration | Budget < 70% |
153
+
154
+ ## Workflow
155
+
156
+ ### Phase 1 — Context Loading
157
+ **Steps:**
158
+ 1. Read existing configuration and requirements related to Security Vulnerability Detection.
159
+ 2. Check for missing preconditions.
160
+
161
+ **Decision:**
162
+ ```
163
+ IF context is clear
164
+ → Confidence: HIGH → go to Phase 2
165
+ ELSE
166
+ → EXIT: BLOCKED — ask user
167
+ ```
168
+
169
+ ### Phase 2 — Analysis & Strategy
170
+ **Steps:**
171
+ 1. Analyze the current state against Security Vulnerability Detection best practices.
172
+ 2. Formulate strategy or audit report based on findings.
173
+
174
+ **Decision:**
175
+ ```
176
+ IF strategy/audit is complete
177
+ → Confidence: HIGH → go to Phase 3
178
+ ELSE IF minor gaps exist
179
+ → Confidence: MEDIUM → proceed with assumptions noted
180
+ ```
181
+
182
+ ### Phase 3 — Finalization
183
+ **Steps:**
184
+ 1. Generate final report or configuration.
185
+ 2. Prepare handoff data for subsequent skills.
186
+
187
+ ## Confidence Model
188
+
189
+ | Level | Condition | Action |
190
+ |-------|-----------|--------|
191
+ | HIGH | All preconditions met, context fully understood | Proceed directly |
192
+ | MEDIUM | Some context missing but safe defaults exist | Proceed and note assumptions |
193
+ | LOW | Core requirements missing | EXIT: BLOCKED |
194
+
195
+ ## Severity (for findings)
196
+
197
+ | Level | Definition |
198
+ |-------|-----------|
199
+ | CRITICAL | Severe violation of Security Vulnerability Detection principles |
200
+ | HIGH | Significant risk or technical debt |
201
+ | MEDIUM | Suboptimal pattern but functional |
202
+ | LOW | Minor style or documentation issue |
203
+
204
+ ## Evidence Format
205
+
206
+ ```
207
+ [SEVERITY] Context/File
208
+ Issue: [what was found]
209
+ Confidence: HIGH
210
+ Recommendation: [actionable advice]
211
+ ```
212
+
213
+ ## Retry Policy
214
+ ```
215
+ Task fails due to missing context
216
+ └─ Ask user for clarification
217
+ ├─ Provided → Retry Phase 1
218
+ └─ Not provided → EXIT: BLOCKED
219
+ ```
220
+
221
+ ## Escalation Rules
222
+
223
+ ```
224
+ BLOCKED: Missing critical context for Security Vulnerability Detection
225
+ Missing:
226
+ - [Specific requirement]
227
+ Questions:
228
+ 1. Bạn có thể cung cấp thêm thông tin về yêu cầu này không?
229
+ 2. Mục tiêu chính của bạn là gì?
230
+ Recommended Assumptions: none
231
+ ```
232
+
233
+ ## Handoff Contract
234
+
235
+ ### Consumes
236
+ ```json
237
+ {
238
+ "from": "user or qk-orchestrator",
239
+ "required_fields": ["context"],
240
+ "optional_fields": ["existing_config"]
241
+ }
242
+ ```
243
+
244
+ ### Produces
245
+ ```json
246
+ {
247
+ "to": "user or downstream skill",
248
+ "output_fields": ["strategy_report", "exit_code"]
249
+ }
250
+ ```
251
+
252
+ ## Exit Codes
253
+
254
+ | Code | Meaning | When |
255
+ |------|---------|------|
256
+ | SUCCESS | Security Vulnerability Detection task completed successfully | Strategy/audit generated |
257
+ | PARTIAL | Task completed with assumptions | Medium confidence |
258
+ | BLOCKED | Missing context | Cannot proceed |
259
+ | FAILED | Critical conflict or error | Unresolvable constraint |
@@ -0,0 +1,30 @@
1
+ # Auto-generated from SKILL.md frontmatter
2
+ schema_version: 1
3
+ id: "qk-security-audit"
4
+ version: "8.3.1"
5
+ description: "Security audit (OWASP, dependency security, secret detection, permission model)."
6
+ tools:
7
+ - "filesystem"
8
+ - "terminal"
9
+ knowledge:
10
+ owns:
11
+ - "qk-security-audit"
12
+ references:
13
+ - "architecture"
14
+ - "security"
15
+ - "anti-patterns"
16
+ eval:
17
+ scorecard: "evals/scorecard.yaml"
18
+ decision_boundary:
19
+ owns:
20
+ - "application-security"
21
+ - "agent-security"
22
+ - "prompt-injection"
23
+ - "dependency-risk"
24
+ does_not_own:
25
+ - "access control implementation"
26
+ - "penetration testing"
27
+ - "compliance certification"
28
+ conflicts_with: []
29
+ delegates_to:
30
+ - "qk-validation-gate"
@@ -0,0 +1,27 @@
1
+ name: qk-security-audit-eval
2
+ description: Đánh giá chất lượng Kiểm toán Bảo mật
3
+ version: 8.3.1
4
+ threshold: 95 # Threshold gần như tuyệt đối vì đây là lưới lọc bảo mật cuối cùng
5
+
6
+ metrics:
7
+ - id: secret_leak_detection
8
+ name: Nhận diện rò rỉ Secret (Secret Leak)
9
+ description: Agent có phát hiện được API keys/Passwords bị hardcode không?
10
+ weight: 40
11
+ criteria:
12
+ - Rà quét và chỉ điểm chính xác file/line chứa secret bị hardcode (40đ)
13
+
14
+ - id: r_sec_04_enforcement
15
+ name: Rà soát Zero-Trust & Phân quyền
16
+ description: Có kiểm tra các lỗ hổng RBAC/ABAC và Prompt Injection không?
17
+ weight: 35
18
+ criteria:
19
+ - Đánh giá mô hình quyền hạn xem có lỗ hổng BOLA hoặc Broken Auth không (15đ)
20
+ - Quét nguy cơ Prompt Injection (nếu có LLM integration) theo chuẩn R-SEC-04 (20đ)
21
+
22
+ - id: owasp_and_dependencies
23
+ name: Lỗ hổng OWASP & Dependencies
24
+ description: Có kiểm tra các thư viện lỗi thời hoặc lỗ hổng phổ biến không?
25
+ weight: 25
26
+ criteria:
27
+ - Đưa ra danh sách cảnh báo dựa trên OWASP Top 10 và Dependency Tree (25đ)