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.
- package/.agents/AGENTS.md +44 -88
- package/.agents/CHANGELOG.md +70 -0
- package/.agents/LICENSE +21 -0
- package/.agents/README.md +100 -0
- package/.agents/docs/CHI_TIET_SKILLS.md +126 -0
- package/.agents/docs/GOVERNANCE.md +40 -0
- package/.agents/docs/HUONG_DAN_SU_DUNG.md +120 -0
- package/.agents/docs/SPEC.md +87 -0
- package/.agents/docs/adr/0001-intent-based-architecture.md +19 -0
- package/.agents/docs/adr/0002-kernel-freeze.md +21 -0
- package/.agents/docs/adr/0003-risk-based-verification.md +20 -0
- package/.agents/docs/adr/0004-progressive-evidence.md +19 -0
- package/.agents/docs/skill-classification.md +25 -0
- package/.agents/skills/qk-access-policy/SKILL.md +179 -0
- package/.agents/skills/qk-ai-builder/SKILL.md +215 -0
- package/.agents/skills/qk-api-lifecycle/SKILL.md +176 -0
- package/.agents/skills/qk-bug-resolution/SKILL.md +307 -0
- package/.agents/skills/qk-context-loader/SKILL.md +218 -0
- package/.agents/skills/qk-data-lifecycle/SKILL.md +192 -0
- package/.agents/skills/qk-db-optimizer/SKILL.md +196 -0
- package/.agents/skills/qk-docs/SKILL.md +198 -0
- package/.agents/skills/qk-engineering-standard/SKILL.md +351 -0
- package/.agents/skills/qk-engineering-standard/rules/backend.md +122 -0
- package/.agents/skills/qk-engineering-standard/rules/database.md +3 -0
- package/.agents/skills/qk-engineering-standard/rules/frontend.md +152 -0
- package/.agents/skills/qk-engineering-standard/rules/security.md +3 -0
- package/.agents/skills/qk-engineering-standard/rules/testing.md +3 -0
- package/.agents/skills/qk-fe-api-integration/SKILL.md +326 -0
- package/.agents/skills/qk-feature-delivery/SKILL.md +305 -0
- package/.agents/skills/qk-help/SKILL.md +193 -0
- package/.agents/skills/qk-orchestrator/SKILL.md +278 -0
- package/.agents/skills/qk-orchestrator/references/routing-table.md +78 -0
- package/.agents/skills/qk-production-release/SKILL.md +284 -0
- package/.agents/skills/qk-project-bootstrap/SKILL.md +235 -0
- package/.agents/skills/qk-project-health/SKILL.md +199 -0
- package/.agents/skills/qk-project-memory/SKILL.md +218 -0
- package/.agents/skills/qk-system-evolution/SKILL.md +281 -0
- package/.agents/skills/qk-ui-audit/SKILL.md +315 -0
- package/.agents/skills/qk-ui-audit/references/anti-slop-checklist.md +136 -0
- package/.agents/skills/qk-ui-builder/SKILL.md +446 -0
- package/.agents/skills/qk-ui-builder/references/anti-patterns.md +295 -0
- package/.agents/skills/qk-ui-builder/references/color.md +115 -0
- package/.agents/skills/qk-ui-builder/references/component-cookbook.md +1194 -0
- package/.agents/skills/qk-ui-builder/references/copy.md +250 -0
- package/.agents/skills/qk-ui-builder/references/interaction-and-states.md +115 -0
- package/.agents/skills/qk-ui-builder/references/layout-and-space.md +111 -0
- package/.agents/skills/qk-ui-builder/references/macrostructures/01-bento-grid.md +48 -0
- package/.agents/skills/qk-ui-builder/references/macrostructures/02-long-document.md +50 -0
- package/.agents/skills/qk-ui-builder/references/macrostructures/03-marquee-hero.md +51 -0
- package/.agents/skills/qk-ui-builder/references/macrostructures/04-stat-led.md +49 -0
- package/.agents/skills/qk-ui-builder/references/macrostructures/05-workbench.md +44 -0
- package/.agents/skills/qk-ui-builder/references/macrostructures/06-conversational-faq.md +50 -0
- package/.agents/skills/qk-ui-builder/references/macrostructures/07-manifesto.md +51 -0
- package/.agents/skills/qk-ui-builder/references/macrostructures/08-photographic.md +50 -0
- package/.agents/skills/qk-ui-builder/references/macrostructures/09-quote-led.md +50 -0
- package/.agents/skills/qk-ui-builder/references/macrostructures/11-catalogue.md +49 -0
- package/.agents/skills/qk-ui-builder/references/macrostructures/12-letter.md +49 -0
- package/.agents/skills/qk-ui-builder/references/macrostructures/13-index-first.md +49 -0
- package/.agents/skills/qk-ui-builder/references/macrostructures/14-narrative-workflow.md +48 -0
- package/.agents/skills/qk-ui-builder/references/macrostructures/15-split-studio.md +48 -0
- package/.agents/skills/qk-ui-builder/references/macrostructures/16-feature-stack.md +51 -0
- package/.agents/skills/qk-ui-builder/references/macrostructures/17-type-specimen.md +48 -0
- package/.agents/skills/qk-ui-builder/references/macrostructures/18-portfolio-grid.md +48 -0
- package/.agents/skills/qk-ui-builder/references/macrostructures/19-map-diagram.md +50 -0
- package/.agents/skills/qk-ui-builder/references/macrostructures/20-ecosystem-index.md +48 -0
- package/.agents/skills/qk-ui-builder/references/macrostructures/21-component-playground.md +45 -0
- package/.agents/skills/qk-ui-builder/references/macrostructures.md +38 -0
- package/.agents/skills/qk-ui-builder/references/motion.md +95 -0
- package/.agents/skills/qk-ui-builder/references/responsive.md +115 -0
- package/.agents/skills/qk-ui-builder/references/slop-test.md +135 -0
- package/.agents/skills/qk-ui-builder/references/structure.md +280 -0
- package/.agents/skills/qk-ui-builder/references/themes/atmospheric.md +53 -0
- package/.agents/skills/qk-ui-builder/references/themes/carnival.md +52 -0
- package/.agents/skills/qk-ui-builder/references/themes/cobalt.md +52 -0
- package/.agents/skills/qk-ui-builder/references/themes/editorial.md +52 -0
- package/.agents/skills/qk-ui-builder/references/themes/garden.md +52 -0
- package/.agents/skills/qk-ui-builder/references/themes/hum.md +52 -0
- package/.agents/skills/qk-ui-builder/references/themes/lumen.md +52 -0
- package/.agents/skills/qk-ui-builder/references/themes/midnight.md +52 -0
- package/.agents/skills/qk-ui-builder/references/themes/modern-minimal.md +52 -0
- package/.agents/skills/qk-ui-builder/references/themes/playful.md +52 -0
- package/.agents/skills/qk-ui-builder/references/themes/specimen.md +52 -0
- package/.agents/skills/qk-ui-builder/references/themes/terminal.md +52 -0
- package/.agents/skills/qk-ui-builder/references/typography.md +129 -0
- package/.agents/skills/qk-ui-system-builder/SKILL.md +221 -0
- package/.agents/skills/qk-validation-gate/SKILL.md +359 -0
- package/.agents/skills.json +819 -0
- package/.github/workflows/ci.yml +1 -1
- package/CHANGELOG.md +2 -1
- package/CLAUDE.md +110 -0
- package/README.md +52 -10
- package/add_lang.js +21 -0
- package/add_lang.py +25 -0
- package/add_sections.py +53 -0
- package/bin/install.js +225 -170
- package/bin/lint.js +123 -0
- package/docs/CHI_TIET_SKILLS.md +27 -26
- package/docs/HUONG_DAN_SU_DUNG.md +3 -3
- package/docs/SPEC.md +70 -20
- package/framework/decision-primitives.md +2 -1
- package/framework/skill-schema.md +310 -0
- package/package.json +16 -5
- package/patch.js +15 -0
- package/patch.py +89 -0
- package/patch2.py +83 -0
- package/skills/_archive_old_skills/qk-accessibility-audit/SKILL.md +1 -0
- package/skills/_archive_old_skills/qk-agent-orchestrator/SKILL.md +1 -0
- package/skills/_archive_old_skills/qk-api-integration/SKILL.md +1 -0
- package/skills/_archive_old_skills/qk-auth-security/SKILL.md +1 -0
- package/skills/_archive_old_skills/qk-backend-architecture/SKILL.md +1 -0
- package/skills/_archive_old_skills/qk-bug-fix/SKILL.md +1 -0
- package/skills/_archive_old_skills/qk-component-generator/SKILL.md +1 -0
- package/skills/_archive_old_skills/qk-context-manager/SKILL.md +1 -0
- package/skills/_archive_old_skills/qk-database-engineer/SKILL.md +1 -0
- package/skills/_archive_old_skills/qk-deployment/SKILL.md +1 -0
- package/skills/_archive_old_skills/qk-design-system/SKILL.md +1 -0
- package/skills/_archive_old_skills/qk-form-builder/SKILL.md +1 -0
- package/skills/_archive_old_skills/qk-frontend-architecture/SKILL.md +1 -0
- package/skills/_archive_old_skills/qk-frontend-debug/SKILL.md +1 -0
- package/skills/_archive_old_skills/qk-frontend-performance/SKILL.md +1 -0
- package/skills/_archive_old_skills/qk-frontend-testing/SKILL.md +1 -0
- package/skills/_archive_old_skills/qk-git-engineer/SKILL.md +1 -0
- package/skills/_archive_old_skills/qk-help/SKILL.md +1 -0
- package/skills/_archive_old_skills/qk-migration/SKILL.md +1 -0
- package/skills/_archive_old_skills/qk-project-audit/SKILL.md +1 -0
- package/skills/_archive_old_skills/qk-refactor/SKILL.md +1 -0
- package/skills/_archive_old_skills/qk-state-management/SKILL.md +1 -0
- package/skills/_archive_old_skills/qk-table-crud-generator/SKILL.md +1 -0
- package/skills/_archive_old_skills/qk-ui-builder/SKILL.md +1 -0
- package/skills/_template/SKILL.md +239 -0
- package/skills/qk-access-policy/SKILL.md +180 -39
- package/skills/qk-ai-builder/SKILL.md +216 -40
- package/skills/qk-api-lifecycle/SKILL.md +177 -46
- package/skills/qk-bug-resolution/SKILL.md +308 -46
- package/skills/qk-context-loader/SKILL.md +219 -43
- package/skills/qk-data-lifecycle/SKILL.md +193 -44
- package/skills/qk-db-optimizer/SKILL.md +197 -41
- package/skills/qk-docs/SKILL.md +199 -40
- package/skills/qk-engineering-standard/SKILL.md +352 -42
- package/skills/qk-fe-api-integration/SKILL.md +327 -55
- package/skills/qk-feature-delivery/SKILL.md +306 -48
- package/skills/qk-help/SKILL.md +179 -23
- package/skills/qk-orchestrator/SKILL.md +279 -42
- package/skills/qk-orchestrator/references/routing-table.md +78 -0
- package/skills/qk-production-release/SKILL.md +285 -41
- package/skills/qk-project-bootstrap/SKILL.md +236 -38
- package/skills/qk-project-health/SKILL.md +200 -40
- package/skills/qk-project-memory/SKILL.md +219 -40
- package/skills/qk-system-evolution/SKILL.md +282 -40
- package/skills/qk-ui-audit/SKILL.md +316 -42
- package/skills/qk-ui-audit/references/anti-slop-checklist.md +136 -0
- package/skills/qk-ui-builder/SKILL.md +447 -0
- package/skills/qk-ui-builder/references/anti-patterns.md +295 -0
- package/skills/qk-ui-builder/references/color.md +115 -0
- package/skills/qk-ui-builder/references/component-cookbook.md +1194 -0
- package/skills/qk-ui-builder/references/copy.md +250 -0
- package/skills/qk-ui-builder/references/interaction-and-states.md +115 -0
- package/skills/qk-ui-builder/references/layout-and-space.md +111 -0
- package/skills/qk-ui-builder/references/macrostructures/01-bento-grid.md +48 -0
- package/skills/qk-ui-builder/references/macrostructures/02-long-document.md +50 -0
- package/skills/qk-ui-builder/references/macrostructures/03-marquee-hero.md +51 -0
- package/skills/qk-ui-builder/references/macrostructures/04-stat-led.md +49 -0
- package/skills/qk-ui-builder/references/macrostructures/05-workbench.md +44 -0
- package/skills/qk-ui-builder/references/macrostructures/06-conversational-faq.md +50 -0
- package/skills/qk-ui-builder/references/macrostructures/07-manifesto.md +51 -0
- package/skills/qk-ui-builder/references/macrostructures/08-photographic.md +50 -0
- package/skills/qk-ui-builder/references/macrostructures/09-quote-led.md +50 -0
- package/skills/qk-ui-builder/references/macrostructures/11-catalogue.md +49 -0
- package/skills/qk-ui-builder/references/macrostructures/12-letter.md +49 -0
- package/skills/qk-ui-builder/references/macrostructures/13-index-first.md +49 -0
- package/skills/qk-ui-builder/references/macrostructures/14-narrative-workflow.md +48 -0
- package/skills/qk-ui-builder/references/macrostructures/15-split-studio.md +48 -0
- package/skills/qk-ui-builder/references/macrostructures/16-feature-stack.md +51 -0
- package/skills/qk-ui-builder/references/macrostructures/17-type-specimen.md +48 -0
- package/skills/qk-ui-builder/references/macrostructures/18-portfolio-grid.md +48 -0
- package/skills/qk-ui-builder/references/macrostructures/19-map-diagram.md +50 -0
- package/skills/qk-ui-builder/references/macrostructures/20-ecosystem-index.md +48 -0
- package/skills/qk-ui-builder/references/macrostructures/21-component-playground.md +45 -0
- package/skills/qk-ui-builder/references/macrostructures.md +38 -0
- package/skills/qk-ui-builder/references/motion.md +95 -0
- package/skills/qk-ui-builder/references/responsive.md +115 -0
- package/skills/qk-ui-builder/references/slop-test.md +135 -0
- package/skills/qk-ui-builder/references/structure.md +280 -0
- package/skills/qk-ui-builder/references/themes/atmospheric.md +53 -0
- package/skills/qk-ui-builder/references/themes/carnival.md +52 -0
- package/skills/qk-ui-builder/references/themes/cobalt.md +52 -0
- package/skills/qk-ui-builder/references/themes/editorial.md +52 -0
- package/skills/qk-ui-builder/references/themes/garden.md +52 -0
- package/skills/qk-ui-builder/references/themes/hum.md +52 -0
- package/skills/qk-ui-builder/references/themes/lumen.md +52 -0
- package/skills/qk-ui-builder/references/themes/midnight.md +52 -0
- package/skills/qk-ui-builder/references/themes/modern-minimal.md +52 -0
- package/skills/qk-ui-builder/references/themes/playful.md +52 -0
- package/skills/qk-ui-builder/references/themes/specimen.md +52 -0
- package/skills/qk-ui-builder/references/themes/terminal.md +52 -0
- package/skills/qk-ui-builder/references/typography.md +129 -0
- package/skills/qk-ui-system-builder/SKILL.md +222 -43
- package/skills/qk-validation-gate/SKILL.md +360 -40
- package/skills.json +815 -825
- package/specs/fixtures/user-payload.json +12 -0
- package/specs/regressions/api-integration-null-fields.yaml +19 -0
- package/temp_fix.js +61 -0
- package/tests/registry.test.js +1 -1
- package/update_template.js +28 -0
- package/skills/qk-design-to-code/SKILL.md +0 -46
- package/skills/qk-policy-engine/SKILL.md +0 -39
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: qk-engineering-standard
|
|
3
|
+
category: qa
|
|
4
|
+
version: 7.5.0
|
|
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.0
|
|
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.0
|
|
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.0
|
|
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.0
|
|
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.0
|
|
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.0
|
|
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.0
|
|
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.0
|
|
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.0
|
|
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.0
|
|
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.0
|
|
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.0
|
|
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.0
|
|
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.0
|
|
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.0
|
|
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.0
|
|
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.0
|
|
343
|
+
runtime_version: 1
|
|
344
|
+
schema_version: 2
|
|
345
|
+
---
|
|
346
|
+
|
|
347
|
+
## References
|
|
348
|
+
- Detailed thresholds with rationale: `references/thresholds.md`
|
|
349
|
+
|
|
350
|
+
---
|
|
351
|
+
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
# Backend Rules
|
|
2
|
+
|
|
3
|
+
- Define rules here.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 🔄 [Merged from qk-backend-architecture]
|
|
8
|
+
|
|
9
|
+
# Backend Architecture
|
|
10
|
+
|
|
11
|
+
> **Language rule:**
|
|
12
|
+
> Use English for: code, identifiers, file names, architecture terms, technical decisions.
|
|
13
|
+
> Use the user's language for: explanations, questions, summaries, and feedback.
|
|
14
|
+
> The user may write in any language — detect and match it automatically.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Trigger
|
|
19
|
+
|
|
20
|
+
Activate this skill when:
|
|
21
|
+
- Creating new backend API endpoints, services, or models
|
|
22
|
+
- User asks "where should I put this business logic?"
|
|
23
|
+
- Project audit flags mixed concerns (e.g., SQL queries inside a controller)
|
|
24
|
+
- Inheriting or setting up a Node.js, Python, or Go backend
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Scope
|
|
29
|
+
|
|
30
|
+
- ✅ Discover existing backend folder structure
|
|
31
|
+
- ✅ Enforce Layered Architecture (Controller → Service → Data Access)
|
|
32
|
+
- ✅ Enforce Domain/Module-based structure if applicable (`src/users/`, `src/orders/`)
|
|
33
|
+
- ✅ Define where validation, mapping, and error handling should live
|
|
34
|
+
- ✅ Validate file placement before code generation
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## Non-goals
|
|
39
|
+
|
|
40
|
+
- ❌ Do NOT rewrite the architecture unless requested
|
|
41
|
+
- ❌ Do NOT write the actual database queries (delegate to `database-engineer`)
|
|
42
|
+
- ❌ Do NOT configure server infrastructure (delegate to `deployment`)
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Severity Levels
|
|
47
|
+
|
|
48
|
+
| Level | Meaning |
|
|
49
|
+
|-------|---------|
|
|
50
|
+
| P0 | Circular dependency or security bypass in architecture |
|
|
51
|
+
| P1 | Mixed concerns (e.g., ORM logic in route handler) |
|
|
52
|
+
| P2 | Inconsistent folder or file naming |
|
|
53
|
+
| P3 | Minor deviation from convention |
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Workflow
|
|
58
|
+
|
|
59
|
+
### Phase 1 — Architecture Discovery
|
|
60
|
+
|
|
61
|
+
Analyze the project structure:
|
|
62
|
+
1. **Classic MVC / Layered:** `controllers/`, `services/`, `models/`, `routes/`
|
|
63
|
+
2. **Domain-Driven (Module):** `src/modules/user/{controller, service, repository}`
|
|
64
|
+
3. **Framework-specific:** NestJS (`.controller.ts`, `.service.ts`), Django apps, Express monolithic.
|
|
65
|
+
4. **Serverless:** `functions/`, `handlers/`
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
### Phase 2 — Rule Extraction
|
|
70
|
+
|
|
71
|
+
Extract conventions:
|
|
72
|
+
- **Routes/Controllers:** Should only handle HTTP req/res, params validation, and calling services. No business logic.
|
|
73
|
+
- **Services:** Pure business logic. Does not know about HTTP (`req`/`res`).
|
|
74
|
+
- **Repositories/Data Access:** Only layer that interacts with the DB.
|
|
75
|
+
- **Error Handling:** Centralized error middleware vs local try/catch.
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
### Phase 3 — File Placement & Routing
|
|
80
|
+
|
|
81
|
+
Map a new requirement to the architecture:
|
|
82
|
+
|
|
83
|
+
*Request: "Add an endpoint to update user profile"*
|
|
84
|
+
- Route: `PUT /api/users/:id` mapped in `src/routes/user.routes.ts`
|
|
85
|
+
- Controller: `updateProfile(req, res)` in `src/controllers/user.controller.ts`
|
|
86
|
+
- Service: `updateUserProfile(userId, data)` in `src/services/user.service.ts`
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## Decision Tree
|
|
91
|
+
|
|
92
|
+
```
|
|
93
|
+
Does the project group files by Layer or by Domain?
|
|
94
|
+
├── Layer → Place in `src/controllers/` and `src/services/`
|
|
95
|
+
└── Domain → Place in `src/modules/users/`
|
|
96
|
+
|
|
97
|
+
Where does data validation happen?
|
|
98
|
+
├── Middleware → Add Zod/Joi validation at the router level
|
|
99
|
+
└── Controller → Validate inside the controller function before calling service
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## Output Format
|
|
105
|
+
|
|
106
|
+
```
|
|
107
|
+
🏗️ Backend Architecture Plan
|
|
108
|
+
─────────────────────────────────────────────────
|
|
109
|
+
Structure Type: [Layered / Domain-based / Framework-specific]
|
|
110
|
+
|
|
111
|
+
Layer Mapping:
|
|
112
|
+
✅ Controller: [path/to/controller.ts] — handles HTTP
|
|
113
|
+
✅ Service: [path/to/service.ts] — business logic
|
|
114
|
+
✅ Repo/DB: [handled by database-engineer]
|
|
115
|
+
|
|
116
|
+
⚠️ Constraints enforced:
|
|
117
|
+
• Do not pass `req` or `res` objects into the Service layer.
|
|
118
|
+
• Validate all inputs at the Controller/Route level.
|
|
119
|
+
|
|
120
|
+
🔗 Next Steps:
|
|
121
|
+
Proceeding to implement the layers.
|
|
122
|
+
```
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
# Frontend Rules
|
|
2
|
+
|
|
3
|
+
- Define rules here.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 🔄 [Merged from qk-frontend-architecture]
|
|
8
|
+
|
|
9
|
+
# Frontend Architecture
|
|
10
|
+
|
|
11
|
+
> **Language rule:**
|
|
12
|
+
> Use English for: code, identifiers, file names, architecture terms, technical decisions.
|
|
13
|
+
> Use the user's language for: explanations, questions, summaries, and feedback.
|
|
14
|
+
> The user may write in any language — detect and match it automatically.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Trigger
|
|
19
|
+
|
|
20
|
+
Activate this skill when:
|
|
21
|
+
- About to create new files or components
|
|
22
|
+
- User asks "where should I put this file?" or "how should I organize this?"
|
|
23
|
+
- Moving or refactoring code across different modules
|
|
24
|
+
- Inheriting an unfamiliar frontend project
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Scope
|
|
29
|
+
|
|
30
|
+
- ✅ Discover the existing frontend folder structure
|
|
31
|
+
- ✅ Define where new components, hooks, services, and types should be placed
|
|
32
|
+
- ✅ Enforce separation of concerns (e.g., UI vs. Business Logic vs. Data)
|
|
33
|
+
- ✅ Identify architectural patterns in use (e.g., Feature-based, Layer-based)
|
|
34
|
+
- ✅ Validate file placement before execution by other skills
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## Non-goals
|
|
39
|
+
|
|
40
|
+
- ❌ Do NOT rewrite the entire project architecture unless explicitly asked
|
|
41
|
+
- ❌ Do NOT generate code (delegate to `component-generator` or `ui-builder`)
|
|
42
|
+
- ❌ Do NOT enforce personal preferences over established project conventions
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Severity Levels
|
|
47
|
+
|
|
48
|
+
| Level | Meaning |
|
|
49
|
+
|-------|---------|
|
|
50
|
+
| P0 | Architectural violation that breaks the build or creates circular dependencies |
|
|
51
|
+
| P1 | File placed in completely wrong layer (e.g., API logic in UI component) |
|
|
52
|
+
| P2 | Inconsistent folder or file naming |
|
|
53
|
+
| P3 | Minor deviation from convention |
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Workflow
|
|
58
|
+
|
|
59
|
+
### Phase 1 — Structure Discovery
|
|
60
|
+
|
|
61
|
+
*(Relies on `context-manager` if already loaded)*
|
|
62
|
+
|
|
63
|
+
Analyze the root source directory (e.g., `src/`, `app/`):
|
|
64
|
+
1. **Layer-based:** `components/`, `hooks/`, `services/`, `utils/`, `types/`
|
|
65
|
+
2. **Feature-based:** `features/auth/`, `features/products/`
|
|
66
|
+
3. **Framework-specific:** `app/` (Next.js App Router), `pages/` (Next.js Pages Router, Nuxt)
|
|
67
|
+
4. **Domain-driven:** `domains/user/`, `domains/payment/`
|
|
68
|
+
5. **FSD (Feature Sliced Design):** `app/`, `processes/`, `pages/`, `widgets/`, `features/`, `entities/`, `shared/`
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
### Phase 2 — Rule Extraction
|
|
73
|
+
|
|
74
|
+
Based on discovery, define the project's rules for:
|
|
75
|
+
- **Components:** Are they flat? Grouped by feature? Atomic design?
|
|
76
|
+
- **Hooks:** Shared in `src/hooks/` or collocated with components?
|
|
77
|
+
- **State:** Global store vs. feature stores?
|
|
78
|
+
- **API/Services:** Where are HTTP calls made?
|
|
79
|
+
- **Types:** Centralized `types/` or collocated?
|
|
80
|
+
- **Naming Conventions:** PascalCase, camelCase, kebab-case, `index.ts` usage?
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
### Phase 3 — File Placement Decision
|
|
85
|
+
|
|
86
|
+
When a new feature/component is requested, map it to the structure:
|
|
87
|
+
|
|
88
|
+
**Input:** "Create a User Profile card that fetches user data."
|
|
89
|
+
**Decision:**
|
|
90
|
+
- UI Component: `src/features/user/components/UserProfileCard.tsx`
|
|
91
|
+
- API Hook: `src/features/user/api/useUser.ts`
|
|
92
|
+
- Types: `src/features/user/types/index.ts`
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
### Phase 4 — Enforcement & Validation
|
|
97
|
+
|
|
98
|
+
Before passing control to a generation skill (like `ui-builder`), ensure the plan adheres to the rules.
|
|
99
|
+
|
|
100
|
+
- [ ] Does it mix concerns? (e.g., putting an API call directly in a shared UI button)
|
|
101
|
+
- [ ] Does it violate import boundaries? (e.g., a shared component importing from a specific feature)
|
|
102
|
+
- [ ] Is the naming consistent?
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## Decision Tree
|
|
107
|
+
|
|
108
|
+
```
|
|
109
|
+
Is the project using a Feature-based structure?
|
|
110
|
+
├── Yes → Place feature-specific code in `features/<feature-name>/`
|
|
111
|
+
└── No → Use Layer-based structure (`components/`, `hooks/`, etc.)
|
|
112
|
+
|
|
113
|
+
Is the code shared across multiple domains/features?
|
|
114
|
+
├── Yes → Place in `shared/` or global `components/` / `hooks/`
|
|
115
|
+
└── No → Collocate with the specific domain/feature
|
|
116
|
+
|
|
117
|
+
Are there existing examples of this type of file?
|
|
118
|
+
├── Yes → Copy their placement and naming pattern
|
|
119
|
+
└── No → Propose a standard location and ask user to confirm
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## Output Format
|
|
125
|
+
|
|
126
|
+
```
|
|
127
|
+
🏗️ Frontend Architecture Plan
|
|
128
|
+
─────────────────────────────────────────────────
|
|
129
|
+
Structure Type: [Feature-based / Layer-based / FSD / etc.]
|
|
130
|
+
Naming: [PascalCase for components, camelCase for functions]
|
|
131
|
+
|
|
132
|
+
File Placement:
|
|
133
|
+
📄 [path/to/new/file1.tsx] — [Why it goes here]
|
|
134
|
+
📄 [path/to/new/file2.ts] — [Why it goes here]
|
|
135
|
+
|
|
136
|
+
⚠️ Constraints enforced:
|
|
137
|
+
• [Constraint 1, e.g., "API calls must be in hooks, not components"]
|
|
138
|
+
• [Constraint 2, e.g., "Shared UI components cannot import from features/"]
|
|
139
|
+
|
|
140
|
+
🔗 Next Steps:
|
|
141
|
+
Delegating to `[skill-name]` to generate the files.
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## Validation Checklist
|
|
147
|
+
|
|
148
|
+
- [ ] Structure type identified correctly
|
|
149
|
+
- [ ] File placement follows existing conventions
|
|
150
|
+
- [ ] Naming matches project standards
|
|
151
|
+
- [ ] Separation of concerns maintained
|
|
152
|
+
- [ ] Plan ready to be executed by generation skills
|