ai-developer-skill-os 2.0.1 → 3.0.0

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.
@@ -1,152 +1,58 @@
1
- ---
2
- name: qk-ui-audit
3
- purpose: Kiểm toán giao diện (Consistency, Accessibility, Responsive).
4
- mode_supported: [standard]
5
- input: [UI Code]
6
- output: [Audit Report]
7
- workflow: [1. Check Radius/Color -> 2. Check A11y -> 3. Check Mobile]
8
- allowed_tools: [read_file]
9
- handoff_to: [none]
10
- ---
11
-
12
- # 🛠️ qk-ui-audit - Quy Trình Vận Hành Chuẩn (SOP)
13
-
14
- > **Mô tả:** Kiểm toán giao diện (Consistency, Accessibility, Responsive).
15
-
16
- ## 🎯 1. Mục Tiêu (Goal)
17
- - Hoàn thành thành công tác vụ được giao liên quan đến nhiệm vụ của skill.
18
- - Đảm bảo chất lượng mã nguồn và tính nhất quán của hệ thống.
19
-
20
- ## 🔄 2. Chuỗi Hành Động (Chain of Thought / SOP)
21
- *(Bắt buộc AI phải suy nghĩ và làm theo đúng thứ tự)*
22
- 1. **Phân tích (Analyze):** Thu thập ngữ cảnh và hiểu rõ yêu cầu đầu vào.
23
- 2. **Lên kế hoạch (Plan):** Xác định các bước cần thay đổi/tạo mới dựa trên bộ luật (rules).
24
- 3. **Thực thi (Execute):** Tiến hành sửa đổi nguồn hoặc tạo tài liệu.
25
- 4. **Xác thực (Verify):** Đảm bảo đầu ra đáp ứng đúng yêu cầu và không vi phạm quy định.
26
-
27
- ## 🛡️ 3. Ràng Buộc & Quy Tắc (Constraints)
28
- - CẤM bỏ qua việc kiểm tra `qk-engineering-standard` trước khi viết code.
29
- - Mọi quyết định kỹ thuật phải dựa trên nội dung tại phần Deep Knowledge (nếu có).
30
-
31
- ## 🤝 4. Giao Thức Bàn Giao (Handoff Protocol)
32
- - Đích đến: `none`
33
- - Nội dung bàn giao: Chuyển toàn bộ ngữ cảnh và kết quả đã thực thi cho bước tiếp theo.
34
-
35
- ## 📚 5. Kiến Thức Chuyên Sâu (Deep Knowledge)
36
-
37
- *(Nền tảng kiến thức quy tắc chi tiết kế thừa từ kỹ sư)*
38
-
39
- ---
40
-
41
-
42
-
43
- # Accessibility (A11y) Audit
44
-
45
- > **Language rule:**
46
- > Use English for: code, identifiers, file names, architecture terms, technical decisions.
47
- > Use the user's language for: explanations, questions, summaries, and feedback.
48
- > The user may write in any language — detect and match it automatically.
49
-
50
- ---
51
-
52
- ## Trigger
53
-
54
- Activate this skill when:
55
- - User asks to "make this accessible", "fix a11y", or "audit accessibility"
56
- - Building complex interactive components (modals, dropdowns, tabs, sliders)
57
- - Preparing an app for production or public release
58
- - Project audit flags missing semantic HTML or ARIA issues
59
-
60
- ---
61
-
62
- ## Scope
63
-
64
- - ✅ **Keyboard Navigation:** Ensure all interactive elements are reachable via `Tab`, and operable via `Enter`/`Space`/Arrows. Focus management (trapping focus in modals).
65
- - ✅ **Screen Reader Support:** Add proper `aria-` attributes, `alt` text, and visually hidden text (`sr-only`).
66
- - ✅ **Semantic HTML:** Replace `div` soups with `<nav>`, `<main>`, `<article>`, `<button>`, etc.
67
- - ✅ **Color Contrast:** Verify text vs. background contrast meets WCAG AA (4.5:1 for normal text).
68
- - ✅ **Form Labels:** Ensure all inputs have associated `<label>`s or `aria-label`s.
69
-
70
- ---
71
-
72
- ## Non-goals
73
-
74
- - ❌ Do NOT completely redesign the UI visually (unless fixing a severe contrast issue, and even then, ask first).
75
- - ❌ Do NOT overuse ARIA. The first rule of ARIA is: "No ARIA is better than bad ARIA." Use semantic HTML first.
76
-
77
- ---
78
-
79
- ## Workflow
80
-
81
- ### Phase 1 — Semantic HTML Check
82
-
83
- Scan the component for basic HTML semantics:
84
- - Are buttons actually `<button>` elements (not `<div onClick>`)?
85
- - Are links actually `<a>` elements with `href`s?
86
- - Do images have meaningful `alt` text (or `alt=""` if decorative)?
87
- - Are headings (`h1`-`h6`) in a logical, unbroken hierarchy?
88
-
89
- ### Phase 2 — Keyboard & Focus Management
90
-
91
- - Can the user tab through the component logically?
92
- - Does every interactive element have a visible focus state (`:focus-visible`)?
93
- - For Modals/Dialogs: Is focus trapped inside when open? Is focus restored when closed?
94
- - For custom widgets (Tabs/Dropdowns): Implement correct arrow key navigation per WAI-ARIA authoring practices.
95
-
96
- ### Phase 3 — Screen Reader (ARIA) Check
97
-
98
- - Do custom interactive elements have correct `role`s (e.g., `role="tablist"`)?
99
- - Is dynamic state communicated? (`aria-expanded`, `aria-selected`, `aria-invalid`, `aria-busy`).
100
- - Are icon-only buttons properly labeled? (`aria-label` or `<span className="sr-only">Label</span>`).
101
- - Are dynamic live regions used for important announcements (`aria-live="polite"` or `assertive`)?
102
-
103
- ### Phase 4 — Contrast & Visuals
104
-
105
- - Check text colors against backgrounds.
106
- - Ensure form fields have visible borders or indicators.
107
- - Ensure information is not conveyed *only* by color (e.g., a red border for an error must also have error text).
108
-
109
- ---
110
-
111
- ## Decision Tree
112
-
113
- ```
114
- Is the component a native HTML element (e.g., standard `<button>`)?
115
- ├── Yes → Ensure it has accessible text/labels. No ARIA roles needed.
116
- └── No → (e.g., a custom `div` acting as a checkbox)
117
- ├── Can it be refactored to use native HTML?
118
- │ ├── Yes → Refactor to native HTML `<input type="checkbox">`
119
- │ └── No → Apply `role="checkbox"`, `tabIndex={0}`, `aria-checked`, and keyboard event handlers.
120
- ```
121
-
122
- ---
123
-
124
- ## Output Format
125
-
126
- ```
127
- ♿ Accessibility Audit Report
128
- ─────────────────────────────────────────────────
129
- Component: [ComponentName]
130
-
131
- Issues Found & Fixed:
132
- ✅ Semantic HTML: Replaced `<div onClick>` with `<button>`
133
- ✅ Screen Readers: Added `aria-label` to icon-only close button
134
- ✅ Keyboard: Added focus trap inside the Modal
135
- ✅ Forms: Associated `<label htmlFor="email">` with Input
136
-
137
- ⚠️ Remaining Warnings (Manual Check Required):
138
- - Please verify color contrast of primary button in light mode (needs 4.5:1 ratio).
139
-
140
- 🔗 Next Steps:
141
- Code updated. Recommend testing with a screen reader (VoiceOver/NVDA).
142
- ```
143
-
144
- ---
145
-
146
- ## Validation Checklist
147
-
148
- - [ ] Semantic HTML preferred over ARIA
149
- - [ ] Keyboard navigation (Tab + Enter/Space) works correctly
150
- - [ ] Focus is visible on all interactive elements
151
- - [ ] Forms have proper labels
152
- - [ ] Icon-only buttons have accessible names
1
+ ---
2
+ name: qk-ui-audit
3
+ version: 3.0.0
4
+ updated: 2026-07-02
5
+ description: Audit UI for Consistency, Accessibility, Responsive, and Performance.
6
+ category: validation
7
+ priority: medium
8
+ tags: [ui, audit, frontend, a11y, responsive]
9
+ platforms: [claude-code, cursor, windsurf, gemini-cli]
10
+ trigger: User asks to check the UI, review styling, or run an audit on a component.
11
+ inputs: [Target UI component, File path]
12
+ outputs: [UI Audit Score, Fix recommendations]
13
+ allowed_tools: [grep_search, read_file]
14
+ pipeline: [analyze, review, validate, complete]
15
+ ---
16
+
17
+ # 🛠️ qk-ui-audit - Standard Operating Procedure
18
+
19
+ > **Goal:** Kiểm toán chất lượng Giao diện Người dùng (UI QA). Tìm ra các lỗi hiển thị, sự thiếu đồng nhất và vi phạm Accessibility (a11y).
20
+
21
+ ## 🔄 1. Chain of Thought (SOP)
22
+ 1. **Analyze (Scan UI):**
23
+ - Read the UI component's source code.
24
+ - Look for inline styles (`style={{...}}`) and hardcoded magic numbers (e.g., `px`, `%` instead of standard tokens).
25
+ 2. **Review (Consistency & Responsive):**
26
+ - Check if standard Design System tokens (e.g., Tailwind classes like `p-4`, `text-lg`) are used.
27
+ - Check for mobile-first implementation (e.g., base classes for mobile, `md:` for desktop).
28
+ 3. **Validate (Accessibility - A11y):**
29
+ - Verify `<img>` tags have `alt` attributes.
30
+ - Verify `<button>` tags without text have `aria-label`.
31
+ - Verify interactive `<div>` elements have `role="button"` and `tabIndex`.
32
+ 4. **Complete (Report):**
33
+ - Calculate a rough score (0-100) based on violations.
34
+
35
+ ## 🛡️ 2. Constraints & Rules
36
+ - **Audit Only:** Do not modify the code automatically unless the user explicitly requests you to apply the fixes.
37
+ - **Evidence Based:** Point out the exact line number where the violation occurs.
38
+
39
+ ## 🌳 3. Decision Tree
40
+ ```text
41
+ Does the component contain hardcoded `#hex` colors or `px` values?
42
+ ├── YES → Deduct Consistency score. Recommend using Design Tokens.
43
+ └── NO Pass.
44
+
45
+ Does the component have clickable `<div>` elements?
46
+ ├── YES Deduct A11y score. Recommend using `<button>` or adding roles.
47
+ └── NO Pass.
48
+ ```
49
+
50
+ ## 🤝 4. Handoff Pipeline
51
+ 1. `complete`: Generate the UI Audit Report.
52
+
53
+ ## 📝 5. Output Format
54
+ Vui lòng trả kết quả bằng Tiếng Việt.
55
+ - **Tóm tắt (Summary):** Chấm điểm Giao diện (Score: X/100).
56
+ - **Chi tiết (Changes):** Liệt các lỗi Consistency, A11y, Responsive (ghi rõ dòng).
57
+ - **Nguyên nhân (Reasoning):** Tại sao lại đánh lỗi điểm đó.
58
+ - **Hành động tiếp (Next Action):** Hỏi User muốn tự động sửa các lỗi này không.