ai-developer-skill-os 7.0.2 → 7.5.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 (206) hide show
  1. package/.agents/AGENTS.md +44 -88
  2. package/.agents/CHANGELOG.md +70 -0
  3. package/.agents/LICENSE +21 -0
  4. package/.agents/README.md +100 -0
  5. package/.agents/docs/CHI_TIET_SKILLS.md +126 -0
  6. package/.agents/docs/GOVERNANCE.md +40 -0
  7. package/.agents/docs/HUONG_DAN_SU_DUNG.md +120 -0
  8. package/.agents/docs/SPEC.md +87 -0
  9. package/.agents/docs/adr/0001-intent-based-architecture.md +19 -0
  10. package/.agents/docs/adr/0002-kernel-freeze.md +21 -0
  11. package/.agents/docs/adr/0003-risk-based-verification.md +20 -0
  12. package/.agents/docs/adr/0004-progressive-evidence.md +19 -0
  13. package/.agents/docs/skill-classification.md +25 -0
  14. package/.agents/skills/qk-access-policy/SKILL.md +179 -0
  15. package/.agents/skills/qk-ai-builder/SKILL.md +215 -0
  16. package/.agents/skills/qk-api-lifecycle/SKILL.md +176 -0
  17. package/.agents/skills/qk-bug-resolution/SKILL.md +307 -0
  18. package/.agents/skills/qk-context-loader/SKILL.md +218 -0
  19. package/.agents/skills/qk-data-lifecycle/SKILL.md +192 -0
  20. package/.agents/skills/qk-db-optimizer/SKILL.md +196 -0
  21. package/.agents/skills/qk-docs/SKILL.md +198 -0
  22. package/.agents/skills/qk-engineering-standard/SKILL.md +351 -0
  23. package/.agents/skills/qk-engineering-standard/rules/backend.md +122 -0
  24. package/.agents/skills/qk-engineering-standard/rules/database.md +3 -0
  25. package/.agents/skills/qk-engineering-standard/rules/frontend.md +152 -0
  26. package/.agents/skills/qk-engineering-standard/rules/security.md +3 -0
  27. package/.agents/skills/qk-engineering-standard/rules/testing.md +3 -0
  28. package/.agents/skills/qk-fe-api-integration/SKILL.md +326 -0
  29. package/.agents/skills/qk-feature-delivery/SKILL.md +305 -0
  30. package/.agents/skills/qk-help/SKILL.md +193 -0
  31. package/.agents/skills/qk-orchestrator/SKILL.md +278 -0
  32. package/.agents/skills/qk-orchestrator/references/routing-table.md +78 -0
  33. package/.agents/skills/qk-production-release/SKILL.md +284 -0
  34. package/.agents/skills/qk-project-bootstrap/SKILL.md +235 -0
  35. package/.agents/skills/qk-project-health/SKILL.md +199 -0
  36. package/.agents/skills/qk-project-memory/SKILL.md +218 -0
  37. package/.agents/skills/qk-system-evolution/SKILL.md +281 -0
  38. package/.agents/skills/qk-ui-audit/SKILL.md +315 -0
  39. package/.agents/skills/qk-ui-audit/references/anti-slop-checklist.md +136 -0
  40. package/.agents/skills/qk-ui-builder/SKILL.md +446 -0
  41. package/.agents/skills/qk-ui-builder/references/anti-patterns.md +295 -0
  42. package/.agents/skills/qk-ui-builder/references/color.md +115 -0
  43. package/.agents/skills/qk-ui-builder/references/component-cookbook.md +1194 -0
  44. package/.agents/skills/qk-ui-builder/references/copy.md +250 -0
  45. package/.agents/skills/qk-ui-builder/references/interaction-and-states.md +115 -0
  46. package/.agents/skills/qk-ui-builder/references/layout-and-space.md +111 -0
  47. package/.agents/skills/qk-ui-builder/references/macrostructures/01-bento-grid.md +48 -0
  48. package/.agents/skills/qk-ui-builder/references/macrostructures/02-long-document.md +50 -0
  49. package/.agents/skills/qk-ui-builder/references/macrostructures/03-marquee-hero.md +51 -0
  50. package/.agents/skills/qk-ui-builder/references/macrostructures/04-stat-led.md +49 -0
  51. package/.agents/skills/qk-ui-builder/references/macrostructures/05-workbench.md +44 -0
  52. package/.agents/skills/qk-ui-builder/references/macrostructures/06-conversational-faq.md +50 -0
  53. package/.agents/skills/qk-ui-builder/references/macrostructures/07-manifesto.md +51 -0
  54. package/.agents/skills/qk-ui-builder/references/macrostructures/08-photographic.md +50 -0
  55. package/.agents/skills/qk-ui-builder/references/macrostructures/09-quote-led.md +50 -0
  56. package/.agents/skills/qk-ui-builder/references/macrostructures/11-catalogue.md +49 -0
  57. package/.agents/skills/qk-ui-builder/references/macrostructures/12-letter.md +49 -0
  58. package/.agents/skills/qk-ui-builder/references/macrostructures/13-index-first.md +49 -0
  59. package/.agents/skills/qk-ui-builder/references/macrostructures/14-narrative-workflow.md +48 -0
  60. package/.agents/skills/qk-ui-builder/references/macrostructures/15-split-studio.md +48 -0
  61. package/.agents/skills/qk-ui-builder/references/macrostructures/16-feature-stack.md +51 -0
  62. package/.agents/skills/qk-ui-builder/references/macrostructures/17-type-specimen.md +48 -0
  63. package/.agents/skills/qk-ui-builder/references/macrostructures/18-portfolio-grid.md +48 -0
  64. package/.agents/skills/qk-ui-builder/references/macrostructures/19-map-diagram.md +50 -0
  65. package/.agents/skills/qk-ui-builder/references/macrostructures/20-ecosystem-index.md +48 -0
  66. package/.agents/skills/qk-ui-builder/references/macrostructures/21-component-playground.md +45 -0
  67. package/.agents/skills/qk-ui-builder/references/macrostructures.md +38 -0
  68. package/.agents/skills/qk-ui-builder/references/motion.md +95 -0
  69. package/.agents/skills/qk-ui-builder/references/responsive.md +115 -0
  70. package/.agents/skills/qk-ui-builder/references/slop-test.md +135 -0
  71. package/.agents/skills/qk-ui-builder/references/structure.md +280 -0
  72. package/.agents/skills/qk-ui-builder/references/themes/atmospheric.md +53 -0
  73. package/.agents/skills/qk-ui-builder/references/themes/carnival.md +52 -0
  74. package/.agents/skills/qk-ui-builder/references/themes/cobalt.md +52 -0
  75. package/.agents/skills/qk-ui-builder/references/themes/editorial.md +52 -0
  76. package/.agents/skills/qk-ui-builder/references/themes/garden.md +52 -0
  77. package/.agents/skills/qk-ui-builder/references/themes/hum.md +52 -0
  78. package/.agents/skills/qk-ui-builder/references/themes/lumen.md +52 -0
  79. package/.agents/skills/qk-ui-builder/references/themes/midnight.md +52 -0
  80. package/.agents/skills/qk-ui-builder/references/themes/modern-minimal.md +52 -0
  81. package/.agents/skills/qk-ui-builder/references/themes/playful.md +52 -0
  82. package/.agents/skills/qk-ui-builder/references/themes/specimen.md +52 -0
  83. package/.agents/skills/qk-ui-builder/references/themes/terminal.md +52 -0
  84. package/.agents/skills/qk-ui-builder/references/typography.md +129 -0
  85. package/.agents/skills/qk-ui-system-builder/SKILL.md +221 -0
  86. package/.agents/skills/qk-validation-gate/SKILL.md +359 -0
  87. package/.agents/skills.json +819 -0
  88. package/.github/workflows/ci.yml +1 -1
  89. package/CHANGELOG.md +2 -1
  90. package/CLAUDE.md +110 -0
  91. package/README.md +52 -10
  92. package/add_lang.js +21 -0
  93. package/add_lang.py +25 -0
  94. package/add_sections.py +53 -0
  95. package/bin/install.js +225 -170
  96. package/bin/lint.js +123 -0
  97. package/docs/CHI_TIET_SKILLS.md +27 -26
  98. package/docs/HUONG_DAN_SU_DUNG.md +3 -3
  99. package/docs/SPEC.md +70 -20
  100. package/framework/decision-primitives.md +2 -1
  101. package/framework/skill-schema.md +310 -0
  102. package/package.json +16 -5
  103. package/patch.js +15 -0
  104. package/patch.py +89 -0
  105. package/patch2.py +83 -0
  106. package/skills/_archive_old_skills/qk-accessibility-audit/SKILL.md +1 -0
  107. package/skills/_archive_old_skills/qk-agent-orchestrator/SKILL.md +1 -0
  108. package/skills/_archive_old_skills/qk-api-integration/SKILL.md +1 -0
  109. package/skills/_archive_old_skills/qk-auth-security/SKILL.md +1 -0
  110. package/skills/_archive_old_skills/qk-backend-architecture/SKILL.md +1 -0
  111. package/skills/_archive_old_skills/qk-bug-fix/SKILL.md +1 -0
  112. package/skills/_archive_old_skills/qk-component-generator/SKILL.md +1 -0
  113. package/skills/_archive_old_skills/qk-context-manager/SKILL.md +1 -0
  114. package/skills/_archive_old_skills/qk-database-engineer/SKILL.md +1 -0
  115. package/skills/_archive_old_skills/qk-deployment/SKILL.md +1 -0
  116. package/skills/_archive_old_skills/qk-design-system/SKILL.md +1 -0
  117. package/skills/_archive_old_skills/qk-form-builder/SKILL.md +1 -0
  118. package/skills/_archive_old_skills/qk-frontend-architecture/SKILL.md +1 -0
  119. package/skills/_archive_old_skills/qk-frontend-debug/SKILL.md +1 -0
  120. package/skills/_archive_old_skills/qk-frontend-performance/SKILL.md +1 -0
  121. package/skills/_archive_old_skills/qk-frontend-testing/SKILL.md +1 -0
  122. package/skills/_archive_old_skills/qk-git-engineer/SKILL.md +1 -0
  123. package/skills/_archive_old_skills/qk-help/SKILL.md +1 -0
  124. package/skills/_archive_old_skills/qk-migration/SKILL.md +1 -0
  125. package/skills/_archive_old_skills/qk-project-audit/SKILL.md +1 -0
  126. package/skills/_archive_old_skills/qk-refactor/SKILL.md +1 -0
  127. package/skills/_archive_old_skills/qk-state-management/SKILL.md +1 -0
  128. package/skills/_archive_old_skills/qk-table-crud-generator/SKILL.md +1 -0
  129. package/skills/_archive_old_skills/qk-ui-builder/SKILL.md +1 -0
  130. package/skills/_template/SKILL.md +239 -0
  131. package/skills/qk-access-policy/SKILL.md +180 -39
  132. package/skills/qk-ai-builder/SKILL.md +216 -40
  133. package/skills/qk-api-lifecycle/SKILL.md +177 -46
  134. package/skills/qk-bug-resolution/SKILL.md +308 -46
  135. package/skills/qk-context-loader/SKILL.md +219 -43
  136. package/skills/qk-data-lifecycle/SKILL.md +193 -44
  137. package/skills/qk-db-optimizer/SKILL.md +197 -41
  138. package/skills/qk-docs/SKILL.md +199 -40
  139. package/skills/qk-engineering-standard/SKILL.md +352 -42
  140. package/skills/qk-fe-api-integration/SKILL.md +327 -55
  141. package/skills/qk-feature-delivery/SKILL.md +306 -48
  142. package/skills/qk-help/SKILL.md +179 -23
  143. package/skills/qk-orchestrator/SKILL.md +279 -42
  144. package/skills/qk-orchestrator/references/routing-table.md +78 -0
  145. package/skills/qk-production-release/SKILL.md +285 -41
  146. package/skills/qk-project-bootstrap/SKILL.md +236 -38
  147. package/skills/qk-project-health/SKILL.md +200 -40
  148. package/skills/qk-project-memory/SKILL.md +219 -40
  149. package/skills/qk-system-evolution/SKILL.md +282 -40
  150. package/skills/qk-ui-audit/SKILL.md +316 -42
  151. package/skills/qk-ui-audit/references/anti-slop-checklist.md +136 -0
  152. package/skills/qk-ui-builder/SKILL.md +447 -0
  153. package/skills/qk-ui-builder/references/anti-patterns.md +295 -0
  154. package/skills/qk-ui-builder/references/color.md +115 -0
  155. package/skills/qk-ui-builder/references/component-cookbook.md +1194 -0
  156. package/skills/qk-ui-builder/references/copy.md +250 -0
  157. package/skills/qk-ui-builder/references/interaction-and-states.md +115 -0
  158. package/skills/qk-ui-builder/references/layout-and-space.md +111 -0
  159. package/skills/qk-ui-builder/references/macrostructures/01-bento-grid.md +48 -0
  160. package/skills/qk-ui-builder/references/macrostructures/02-long-document.md +50 -0
  161. package/skills/qk-ui-builder/references/macrostructures/03-marquee-hero.md +51 -0
  162. package/skills/qk-ui-builder/references/macrostructures/04-stat-led.md +49 -0
  163. package/skills/qk-ui-builder/references/macrostructures/05-workbench.md +44 -0
  164. package/skills/qk-ui-builder/references/macrostructures/06-conversational-faq.md +50 -0
  165. package/skills/qk-ui-builder/references/macrostructures/07-manifesto.md +51 -0
  166. package/skills/qk-ui-builder/references/macrostructures/08-photographic.md +50 -0
  167. package/skills/qk-ui-builder/references/macrostructures/09-quote-led.md +50 -0
  168. package/skills/qk-ui-builder/references/macrostructures/11-catalogue.md +49 -0
  169. package/skills/qk-ui-builder/references/macrostructures/12-letter.md +49 -0
  170. package/skills/qk-ui-builder/references/macrostructures/13-index-first.md +49 -0
  171. package/skills/qk-ui-builder/references/macrostructures/14-narrative-workflow.md +48 -0
  172. package/skills/qk-ui-builder/references/macrostructures/15-split-studio.md +48 -0
  173. package/skills/qk-ui-builder/references/macrostructures/16-feature-stack.md +51 -0
  174. package/skills/qk-ui-builder/references/macrostructures/17-type-specimen.md +48 -0
  175. package/skills/qk-ui-builder/references/macrostructures/18-portfolio-grid.md +48 -0
  176. package/skills/qk-ui-builder/references/macrostructures/19-map-diagram.md +50 -0
  177. package/skills/qk-ui-builder/references/macrostructures/20-ecosystem-index.md +48 -0
  178. package/skills/qk-ui-builder/references/macrostructures/21-component-playground.md +45 -0
  179. package/skills/qk-ui-builder/references/macrostructures.md +38 -0
  180. package/skills/qk-ui-builder/references/motion.md +95 -0
  181. package/skills/qk-ui-builder/references/responsive.md +115 -0
  182. package/skills/qk-ui-builder/references/slop-test.md +135 -0
  183. package/skills/qk-ui-builder/references/structure.md +280 -0
  184. package/skills/qk-ui-builder/references/themes/atmospheric.md +53 -0
  185. package/skills/qk-ui-builder/references/themes/carnival.md +52 -0
  186. package/skills/qk-ui-builder/references/themes/cobalt.md +52 -0
  187. package/skills/qk-ui-builder/references/themes/editorial.md +52 -0
  188. package/skills/qk-ui-builder/references/themes/garden.md +52 -0
  189. package/skills/qk-ui-builder/references/themes/hum.md +52 -0
  190. package/skills/qk-ui-builder/references/themes/lumen.md +52 -0
  191. package/skills/qk-ui-builder/references/themes/midnight.md +52 -0
  192. package/skills/qk-ui-builder/references/themes/modern-minimal.md +52 -0
  193. package/skills/qk-ui-builder/references/themes/playful.md +52 -0
  194. package/skills/qk-ui-builder/references/themes/specimen.md +52 -0
  195. package/skills/qk-ui-builder/references/themes/terminal.md +52 -0
  196. package/skills/qk-ui-builder/references/typography.md +129 -0
  197. package/skills/qk-ui-system-builder/SKILL.md +222 -43
  198. package/skills/qk-validation-gate/SKILL.md +360 -40
  199. package/skills.json +815 -825
  200. package/specs/fixtures/user-payload.json +12 -0
  201. package/specs/regressions/api-integration-null-fields.yaml +19 -0
  202. package/temp_fix.js +61 -0
  203. package/tests/registry.test.js +1 -1
  204. package/update_template.js +28 -0
  205. package/skills/qk-design-to-code/SKILL.md +0 -46
  206. package/skills/qk-policy-engine/SKILL.md +0 -39
@@ -1,40 +1,199 @@
1
- ---
2
- name: qk-docs
3
- category: documentation
4
- version: 7.0.0
5
- description: "Viết và duy trì tài liệu dự án chính xác tuyệt đối, cấm bịa đặt."
6
- ---
7
-
8
- # qk-docs
9
-
10
- ## Scope
11
- - Technical documentation, Readme files, and inline comments (Execute)
12
-
13
- ## Verbs
14
- - `[DOCUMENT]`: Synchronize documentation with the actual implementation.
15
-
16
- ## Constraints
17
- ```yaml
18
- must:
19
- - "Ensure documentation matches the exact implementation in the codebase"
20
- - "Update documentation whenever corresponding code is changed"
21
- must_not:
22
- - "Hallucinate or guess API parameters not present in the code"
23
- - "Write generic or useless comments (e.g., '// gets the user')"
24
- ```
25
-
26
- ## Policies
27
- ```yaml
28
- prefer:
29
- - "Self-documenting code over excessive inline comments"
30
- - "Living documentation (e.g., Swagger/JSDoc) over isolated Markdown files"
31
- ```
32
-
33
- ## Escalation
34
- ```yaml
35
- stop:
36
- - "Documentation requests conflict with actual codebase implementation"
37
- ```
38
-
39
- ## Output
40
- - Accurate documentation files or inline comments.
1
+ ---
2
+ name: qk-docs
3
+ category: documentation
4
+ version: 7.5.1
5
+ description: "Viết và duy trì tài liệu chính xác tuyệt đối — phải match code thực tế, cấm bịa đặt."
6
+ platforms: [antigravity, claude-code, cursor, windsurf, kilo-code]
7
+ execution_mode: deterministic
8
+ cost: low
9
+ latency: fast
10
+ risk: low
11
+ side_effects: edit_files
12
+ produces: [report]
13
+ consumes: [source-code]
14
+ token_budget:
15
+ max_files_read: 3
16
+ max_lines_per_read: 100
17
+ max_shell_commands: 0
18
+ stop_early: true
19
+ exit_codes: [SUCCESS, BLOCKED, FAILED, PARTIAL]
20
+ skill_version: 7.5.1
21
+ runtime_version: 1
22
+ schema_version: 2
23
+ ---
24
+
25
+ # qk-docs — Technical Writer & Documentation Maintainer
26
+
27
+ > **Language rule:** Code, identifiers, file names ? English. Explanations, summaries ? Vietnamese.
28
+
29
+ ---
30
+
31
+ ## Preconditions
32
+ - [ ] Target code file or module is specified
33
+
34
+ ```
35
+ On missing precondition:
36
+ EXIT: BLOCKED
37
+ Message: "Chỉ định file cần viết docs."
38
+ ```
39
+
40
+ ---
41
+
42
+ ## Scope
43
+ - ✅ Document ONLY what exists in code — never invent params/behavior
44
+ - ✅ Update docs whenever corresponding code changes
45
+ - ✅ Use living documentation (JSDoc/TSDoc/Swagger) over isolated Markdown
46
+
47
+ ## Non-Goals
48
+ - ❌ Guess API params not in the code
49
+ - ❌ Write generic/useless comments (`// gets the user`)
50
+ - ❌ Write docs for code that hasn't been read yet
51
+
52
+ ---
53
+
54
+ ## Priority Order
55
+ | P | Task | Skip Threshold |
56
+ |---|------|----------------|
57
+ | P1 | Read source code first (never write before reading) | Never |
58
+ | P2 | Document public API (exported functions/classes) | Never |
59
+ | P3 | Document complex logic with WHY (not WHAT) | Budget < 40% |
60
+ | P4 | Update README if public interface changed | Budget < 60% |
61
+
62
+ ---
63
+
64
+ ## Workflow
65
+
66
+ ### Phase 1 — Read Code
67
+ 1. `view_file[targeted]` — read function/class signatures
68
+ 2. Identify: params, return type, side effects, error cases
69
+
70
+ **Decision:** `IF code is not readable → EXIT: BLOCKED — read code first`
71
+
72
+ ### Phase 2 — Write Documentation
73
+ 1. JSDoc/TSDoc format for functions: `@param`, `@returns`, `@throws`
74
+ 2. Comment: WHY (not WHAT) — code already shows what
75
+ 3. Example usage for complex APIs
76
+
77
+ ### Phase 3 — Verify Accuracy
78
+ 1. Re-read written docs vs code → spot check each param name
79
+
80
+ **Decision:**
81
+ ```
82
+ IF docs match code exactly → EXIT: SUCCESS
83
+ IF any param name or type mismatch → fix immediately
84
+ ```
85
+
86
+ ---
87
+
88
+ ## Documentation Templates
89
+
90
+ ### Function (JSDoc)
91
+ ```typescript
92
+ /**
93
+ * [One sentence — what it does and WHY it exists]
94
+ *
95
+ * @param {Type} paramName - [description]
96
+ * @returns {Type} [description of return value]
97
+ * @throws {ErrorType} [when this error is thrown]
98
+ * @example
99
+ * const result = functionName(arg);
100
+ */
101
+ ```
102
+
103
+ ### README Section
104
+ ```markdown
105
+ ## [Feature Name]
106
+ [What it does — user-facing description]
107
+
108
+ ### Usage
109
+ [Code example]
110
+
111
+ ### Configuration
112
+ | Option | Type | Default | Description |
113
+ ```
114
+
115
+ ---
116
+
117
+ ## Evidence Format
118
+ ```
119
+ [SEVERITY] path/to/file.ts:LINE
120
+ Issue: [MISSING_PARAM | WRONG_TYPE | STALE_DOC | GENERIC_COMMENT]
121
+ Confidence: HIGH
122
+ Fix: [specific correction]
123
+ ```
124
+
125
+ ---
126
+
127
+ ## Exit Codes
128
+ | Code | Meaning | When |
129
+ |------|---------|------|
130
+ | SUCCESS | Docs written and verified against source code | Execution complete |
131
+ | PARTIAL | Docs written but some parts inferred (not verified) | MEDIUM confidence |
132
+ | BLOCKED | Target source file missing or inaccessible | Cannot read source |
133
+ | FAILED | Documentation fundamentally misrepresents the code | Gross error |
134
+
135
+ ---
136
+
137
+ ## Confidence Model
138
+ | Level | Condition | Action |
139
+ |-------|-----------|--------|
140
+ | HIGH | Target code read, behavior understood | Write docs definitively |
141
+ | MEDIUM | Target code too large, inferred from types/tests | Write with disclaimer |
142
+ | LOW | "Write docs for this feature" without pointing to code | EXIT: BLOCKED |
143
+
144
+ ---
145
+
146
+ ## Severity
147
+ | Level | Definition | Example |
148
+ |-------|-----------|---------|
149
+ | CRITICAL | Docs instruct user to do something dangerous | Documenting destructive API without warnings |
150
+ | HIGH | API params documented incorrectly | Says string instead of object |
151
+ | MEDIUM | Missing docs for edge cases | Doesn't explain error throws |
152
+ | LOW | Typo or poor formatting | Misaligned markdown table |
153
+
154
+ ---
155
+
156
+ ## Retry Policy
157
+ ```
158
+ Doc verification fails
159
+ └─ Target code changed during doc writing
160
+ ├─ Re-read target code
161
+ └─ Do NOT retry more than 1 time
162
+ ```
163
+
164
+ ---
165
+
166
+ ## Escalation Rules
167
+ ```
168
+ BLOCKED: Target source file missing
169
+ Missing:
170
+ - Exact path to the code that needs documenting
171
+ Questions:
172
+ 1. File code nào bạn muốn viết doc? (Xin đường dẫn)
173
+ 2. Mục tiêu của doc này là cho user hay cho developer nội bộ?
174
+ Recommended Assumptions:
175
+ - Developer-facing JSDoc if inside source files
176
+ ```
177
+
178
+ ---
179
+
180
+ ## Handoff Contract
181
+ ### Consumes
182
+ ```json
183
+ {
184
+ "from": "user",
185
+ "required_fields": ["target_file", "doc_type"],
186
+ "optional_fields": ["context"]
187
+ }
188
+ ```
189
+ ### Produces
190
+ ```json
191
+ {
192
+ "to": "user",
193
+ "output_fields": ["updated_files", "exit_code"]
194
+ }
195
+ ```
196
+
197
+ ---
198
+
199
+
@@ -1,42 +1,352 @@
1
- ---
2
- name: qk-engineering-standard
3
- category: qa
4
- version: 7.0.0
5
- description: "Ép buộc áp dụng SOLID, DRY, Clean Code, chống Spaghetti code."
6
- ---
7
-
8
- # qk-engineering-standard
9
-
10
- ## Scope
11
- - Code Quality, Architecture, and Standards Enforcement (Audit)
12
-
13
- ## Verbs
14
- - `[ENFORCE]`: Reject code that violates engineering standards.
15
-
16
- ## Constraints
17
- ```yaml
18
- must:
19
- - "Enforce SOLID principles and DRY"
20
- - "Keep cyclomatic complexity low (Functions must do ONE thing)"
21
- - "Enforce strict naming conventions"
22
- must_not:
23
- - "Allow spaghetti code or mega-functions"
24
- - "Merge logic that mixes UI, State, and Network in one file"
25
- ```
26
-
27
- ## Policies
28
- ```yaml
29
- prefer:
30
- - "Composition over inheritance"
31
- - "Early returns and guard clauses"
32
- ```
33
-
34
- ## Escalation
35
- ```yaml
36
- stop:
37
- - "Cyclomatic complexity exceeds acceptable thresholds"
38
- - "Code violates V7 Anti-Slop architectural rules"
39
- ```
40
-
41
- ## Output
42
- - Refactored code or Audit rejection report.
1
+ ---
2
+ name: qk-engineering-standard
3
+ category: qa
4
+ version: 7.5.1
5
+ description: "Ép buộc SOLID, DRY, Clean Code với ngưỡng số liệu cụ thể — không có rule mơ hồ."
6
+ platforms: [antigravity, claude-code, cursor, windsurf, kilo-code]
7
+ execution_mode: deterministic
8
+
9
+ cost: medium
10
+ latency: medium
11
+ risk: low
12
+ side_effects: read_only
13
+ produces: [report]
14
+ consumes: [source-code]
15
+
16
+ token_budget:
17
+ max_files_read: 5
18
+ max_lines_per_read: 150
19
+ max_shell_commands: 1
20
+ stop_early: true
21
+
22
+ exit_codes: [SUCCESS, BLOCKED, FAILED, PARTIAL]
23
+ skill_version: 7.5.1
24
+ runtime_version: 1
25
+ schema_version: 2
26
+ ---
27
+
28
+ # qk-engineering-standard — Code Quality Enforcer
29
+
30
+ > **Language rule:** Code, identifiers, file names ? English. Explanations, summaries ? Vietnamese.
31
+
32
+ skill_version: 7.5.1
33
+ runtime_version: 1
34
+ schema_version: 2
35
+ ---
36
+
37
+ ## Preconditions
38
+ - [ ] Target file(s) or module(s) are specified
39
+
40
+ ```
41
+ On missing precondition:
42
+ EXIT: BLOCKED
43
+ Message: "Vui lòng chỉ định file hoặc module cần kiểm tra."
44
+ ```
45
+
46
+ skill_version: 7.5.1
47
+ runtime_version: 1
48
+ schema_version: 2
49
+ ---
50
+
51
+ ## Scope
52
+ - ✅ Detect violations with exact file:line references
53
+ - ✅ Classify by severity with concrete thresholds
54
+ - ✅ Suggest minimal, targeted refactors
55
+
56
+ ## Non-Goals
57
+ - ❌ Auto-fix code — report only (fixes go to qk-bug-resolution or qk-feature-delivery)
58
+ - ❌ Rewrite architecture
59
+ - ❌ Touch files outside the specified scope
60
+
61
+ skill_version: 7.5.1
62
+ runtime_version: 1
63
+ schema_version: 2
64
+ ---
65
+
66
+ ## Concrete Thresholds (Non-Negotiable)
67
+
68
+ ```yaml
69
+ function:
70
+ max_lines: 30 # Lines of code, excluding comments/blanks
71
+ max_cyclomatic_complexity: 10
72
+ max_parameters: 4
73
+
74
+ file:
75
+ max_lines: 300
76
+ max_public_methods_per_class: 10 # God Class threshold
77
+
78
+ dry:
79
+ violation_threshold: 3 # Same logic duplicated in ≥ 3 places
80
+
81
+ separation_of_concerns:
82
+ violation: "File mixes UI rendering + API calls + State management"
83
+
84
+ naming:
85
+ min_variable_name_length: 2 # Single-letter vars (except i,j,k in loops)
86
+ max_abbreviation_ratio: 0.3 # > 30% abbreviations in identifiers = violation
87
+
88
+ dependency:
89
+ max_imports_per_file: 15 # Beyond this: likely a God File
90
+ ```
91
+
92
+ skill_version: 7.5.1
93
+ runtime_version: 1
94
+ schema_version: 2
95
+ ---
96
+
97
+ ## Priority Order
98
+
99
+ | Priority | Check | Severity | Skip Threshold |
100
+ |----------|-------|----------|----------------|
101
+ | P1 | Security violations (hardcoded secrets, SQL injection) | CRITICAL | Never |
102
+ | P2 | God Functions > 30 lines / complexity > 10 | HIGH | Budget < 30% |
103
+ | P3 | God Files > 300 lines / God Classes | HIGH | Budget < 40% |
104
+ | P4 | DRY violations (3+ duplicates) | MEDIUM | Budget < 50% |
105
+ | P5 | Mixed concerns in single file | MEDIUM | Budget < 60% |
106
+ | P6 | Naming convention violations | LOW | Budget < 70% |
107
+ | P7 | Excessive imports / coupling | LOW | Budget < 80% |
108
+
109
+ skill_version: 7.5.1
110
+ runtime_version: 1
111
+ schema_version: 2
112
+ ---
113
+
114
+ ## Workflow
115
+
116
+ ### Phase 1 — Scan for Critical & High Violations
117
+
118
+ **Steps:**
119
+ 1. `grep_search` — search for: hardcoded secrets, `console.log`, `eval(`, `any` types
120
+ 2. `view_file[targeted]` — read function definitions to count lines and parameters
121
+ 3. Log each violation with Evidence Format
122
+
123
+ **Decision:**
124
+ ```
125
+ IF CRITICAL violation found (e.g., hardcoded API key)
126
+ → Report immediately, mark EXIT: FAILED
127
+ → Still continue scanning (don't stop at first critical)
128
+
129
+ IF function line count > 30 OR complexity > 10
130
+ → Log as [HIGH]
131
+
132
+ IF file line count > 300
133
+ → Log as [HIGH] — God File suspected
134
+ ```
135
+
136
+ **Exit When:**
137
+ - All P1+P2+P3 checks done → go to Phase 2
138
+ - Token budget < 30% → go to Phase 3 directly with PARTIAL flag
139
+
140
+ skill_version: 7.5.1
141
+ runtime_version: 1
142
+ schema_version: 2
143
+ ---
144
+
145
+ ### Phase 2 — Scan for Medium & Low Violations
146
+
147
+ **Steps:**
148
+ 1. `grep_search` — find duplicate logic patterns (copy-paste code)
149
+ 2. Check import counts per file
150
+ 3. Check naming conventions
151
+
152
+ **Decision:**
153
+ ```
154
+ IF same logic block appears ≥ 3 times
155
+ → Log as [MEDIUM] DRY violation
156
+
157
+ IF file has > 15 imports
158
+ → Log as [LOW] — potential God File or tight coupling
159
+
160
+ IF token budget < 50%
161
+ → Skip P6+P7, go to Phase 3
162
+ ```
163
+
164
+ skill_version: 7.5.1
165
+ runtime_version: 1
166
+ schema_version: 2
167
+ ---
168
+
169
+ ### Phase 3 — Score & Report
170
+
171
+ **Steps:**
172
+ 1. Count violations by severity
173
+ 2. Calculate health score: start at 100, deduct per violation
174
+ 3. Generate report
175
+
176
+ **Deduction Scale:**
177
+ ```
178
+ CRITICAL: -25 pts each
179
+ HIGH: -10 pts each
180
+ MEDIUM: -5 pts each
181
+ LOW: -2 pts each
182
+ ```
183
+
184
+ **Decision:**
185
+ ```
186
+ IF score ≥ 80 AND no CRITICAL violations
187
+ → EXIT: SUCCESS
188
+
189
+ IF score 60–79 OR any HIGH violations
190
+ → EXIT: PARTIAL — list fixes needed
191
+
192
+ IF score < 60 OR any CRITICAL violations
193
+ → EXIT: FAILED — requires immediate action
194
+ ```
195
+
196
+ skill_version: 7.5.1
197
+ runtime_version: 1
198
+ schema_version: 2
199
+ ---
200
+
201
+ ## Confidence Model
202
+
203
+ | Level | Condition | Action |
204
+ |-------|-----------|--------|
205
+ | HIGH | Direct line count, exact pattern match | Report as violation |
206
+ | MEDIUM | Inferred cyclomatic complexity without tool | Note estimate |
207
+ | LOW | Architectural smell inferred from structure | Mark as "suspected — verify manually" |
208
+
209
+ skill_version: 7.5.1
210
+ runtime_version: 1
211
+ schema_version: 2
212
+ ---
213
+
214
+ ## Severity
215
+
216
+ | Level | Definition | Example |
217
+ |-------|-----------|---------|
218
+ | CRITICAL | Security risk or data integrity | Hardcoded secret, SQL injection via string concat |
219
+ | HIGH | Technical debt that blocks scaling | Function 80 lines, God Class 15+ methods |
220
+ | MEDIUM | DRY or SoC violation, fixable in < 1 hour | Same validation logic in 3 components |
221
+ | LOW | Style/naming issue, non-blocking | Single-letter variable `x` outside loop |
222
+
223
+ skill_version: 7.5.1
224
+ runtime_version: 1
225
+ schema_version: 2
226
+ ---
227
+
228
+ ## Evidence Format
229
+
230
+ ```
231
+ [SEVERITY] path/to/file.ts:LINE
232
+ Rule: [FUNCTION_LENGTH | COMPLEXITY | DRY | SOC | NAMING | GOD_CLASS | SECRET]
233
+ Reason: [specific measurement vs threshold]
234
+ Confidence: [HIGH|MEDIUM|LOW]
235
+ Fix: [one-line suggestion]
236
+ Deduction: -N pts
237
+ ```
238
+
239
+ **Example:**
240
+ ```
241
+ [HIGH] src/services/order.service.ts:45
242
+ Rule: FUNCTION_LENGTH
243
+ Reason: Function `processOrder` is 87 lines (threshold: 30)
244
+ Confidence: HIGH
245
+ Fix: Extract payment logic to `processPayment()`, shipping to `scheduleShipment()`
246
+ Deduction: -10 pts
247
+ ```
248
+
249
+ skill_version: 7.5.1
250
+ runtime_version: 1
251
+ schema_version: 2
252
+ ---
253
+
254
+ ## Retry Policy
255
+ ```
256
+ Audit is read-only — no retry needed.
257
+ If file is inaccessible → skip and note in report as PARTIAL.
258
+ ```
259
+
260
+ skill_version: 7.5.1
261
+ runtime_version: 1
262
+ schema_version: 2
263
+ ---
264
+
265
+ ## Escalation Rules
266
+
267
+ ```
268
+ BLOCKED: No target specified
269
+ Missing:
270
+ - File path or module name to audit
271
+ Questions:
272
+ 1. Bạn muốn kiểm tra file nào hoặc toàn bộ module nào?
273
+ 2. Có ngưỡng cụ thể nào bạn muốn thay đổi không? (mặc định: 30 lines/function)
274
+ ```
275
+
276
+ skill_version: 7.5.1
277
+ runtime_version: 1
278
+ schema_version: 2
279
+ ---
280
+
281
+ ## Handoff Contract
282
+
283
+ ### Consumes
284
+ ```json
285
+ {
286
+ "from": "user or qk-orchestrator",
287
+ "required_fields": ["target_files_or_module"],
288
+ "optional_fields": ["custom_thresholds"]
289
+ }
290
+ ```
291
+
292
+ ### Produces
293
+ ```json
294
+ {
295
+ "to": "user",
296
+ "output_fields": ["health_score", "violations_list", "severity_counts", "exit_code"]
297
+ }
298
+ ```
299
+
300
+ skill_version: 7.5.1
301
+ runtime_version: 1
302
+ schema_version: 2
303
+ ---
304
+
305
+ ## Output Format
306
+
307
+ ```
308
+ ⚙️ Engineering Standard Audit
309
+ ─────────────────────────────────────────────────
310
+ Target: [file or module]
311
+
312
+ Health Score: [X/100]
313
+ CRITICAL violations: [N] (-Npts)
314
+ HIGH violations: [N] (-Npts)
315
+ MEDIUM violations: [N] (-Npts)
316
+ LOW violations: [N] (-Npts)
317
+
318
+ Violations (priority order):
319
+ [SEVERITY] file:LINE — Rule — reason — Fix — (-Xpts)
320
+
321
+ Required Actions:
322
+ 1. [Most critical fix]
323
+ 2. [Second fix]
324
+
325
+ Exit Code: [SUCCESS | PARTIAL | FAILED]
326
+ ```
327
+
328
+ skill_version: 7.5.1
329
+ runtime_version: 1
330
+ schema_version: 2
331
+ ---
332
+
333
+ ## Exit Codes
334
+
335
+ | Code | Meaning | When |
336
+ |------|---------|------|
337
+ | SUCCESS | Score ≥ 80, no CRITICAL | Code meets V7.5 standards |
338
+ | PARTIAL | Score 60–79 or incomplete scan | Some categories skipped |
339
+ | BLOCKED | No target specified | Cannot audit without scope |
340
+ | FAILED | Score < 60 or CRITICAL found | Immediate action required |
341
+
342
+ skill_version: 7.5.1
343
+ runtime_version: 1
344
+ schema_version: 2
345
+ ---
346
+
347
+ ## References
348
+ - Detailed thresholds with rationale: `references/thresholds.md`
349
+
350
+ ---
351
+
352
+