ai-developer-skill-os 2.1.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.
- package/.agents/AGENTS.md +48 -0
- package/README.md +77 -130
- package/knowledge/frontend/react.md +27 -0
- package/package.json +1 -1
- package/skills/qk-access-policy/SKILL.md +40 -127
- package/skills/qk-ai-builder/SKILL.md +41 -33
- package/skills/qk-api-lifecycle/SKILL.md +62 -420
- package/skills/qk-bug-resolution/SKILL.md +65 -371
- package/skills/qk-context-loader/SKILL.md +47 -206
- package/skills/qk-data-lifecycle/SKILL.md +60 -135
- package/skills/qk-design-to-code/SKILL.md +46 -33
- package/skills/qk-docs/SKILL.md +52 -335
- package/skills/qk-documentation-system/SKILL.md +38 -33
- package/skills/qk-engineering-standard/SKILL.md +61 -171
- package/skills/qk-feature-delivery/SKILL.md +63 -432
- package/skills/qk-help/SKILL.md +37 -95
- package/skills/qk-orchestrator/SKILL.md +52 -272
- package/skills/qk-policy-engine/SKILL.md +52 -33
- package/skills/qk-production-release/SKILL.md +45 -127
- package/skills/qk-project-bootstrap/SKILL.md +43 -33
- package/skills/qk-project-health/SKILL.md +56 -650
- package/skills/qk-project-memory/SKILL.md +35 -33
- package/skills/qk-system-evolution/SKILL.md +63 -315
- package/skills/qk-ui-audit/SKILL.md +58 -152
- package/skills/qk-ui-system-builder/SKILL.md +40 -444
- package/skills/qk-validation-gate/SKILL.md +59 -33
- package/templates/bug-report.md +21 -0
- package/templates/design-report.md +21 -0
- package/templates/feature-report.md +20 -0
- package/templates/review-report.md +21 -0
|
@@ -1,171 +1,61 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: qk-engineering-standard
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
1. **
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
-
|
|
34
|
-
|
|
35
|
-
##
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
-
|
|
58
|
-
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
## Scope
|
|
63
|
-
|
|
64
|
-
- ✅ Decide which state layer to use based on the data's lifecycle and scope
|
|
65
|
-
- ✅ Implement local state (`useState`, `useReducer`, `ref`)
|
|
66
|
-
- ✅ Implement global UI state (Zustand, Pinia, Context, Redux)
|
|
67
|
-
- ✅ Implement server state (React Query, SWR, Apollo)
|
|
68
|
-
- ✅ Ensure state is immutable and updates correctly
|
|
69
|
-
- ✅ Prevent race conditions and stale state bugs
|
|
70
|
-
|
|
71
|
-
---
|
|
72
|
-
|
|
73
|
-
## Non-goals
|
|
74
|
-
|
|
75
|
-
- ❌ Do NOT introduce a new state management library if the project already uses one
|
|
76
|
-
- ❌ Do NOT put server data (API responses) in a global UI store (like Redux) if React Query is available
|
|
77
|
-
- ❌ Do NOT use global state for something that should be local (e.g., a modal's `isOpen` state)
|
|
78
|
-
|
|
79
|
-
---
|
|
80
|
-
|
|
81
|
-
## Workflow
|
|
82
|
-
|
|
83
|
-
### Phase 1 — State Classification
|
|
84
|
-
|
|
85
|
-
Analyze the data the user wants to manage and classify it:
|
|
86
|
-
|
|
87
|
-
1. **Local UI State:** Only needed by one component (e.g., toggle button, input value).
|
|
88
|
-
2. **Shared UI State:** Needed by multiple components, but not saved to DB (e.g., dark mode, cart items, selected filters).
|
|
89
|
-
3. **Server State:** Data fetched from an API. Needs caching, refetching, and loading states.
|
|
90
|
-
4. **URL State:** Data that should be shareable or survive refresh (e.g., search query `?q=shoes`, current page).
|
|
91
|
-
|
|
92
|
-
---
|
|
93
|
-
|
|
94
|
-
### Phase 2 — Strategy Selection
|
|
95
|
-
|
|
96
|
-
Based on the classification and project stack (`project-audit`), choose the tool:
|
|
97
|
-
|
|
98
|
-
| State Type | Recommended Tool |
|
|
99
|
-
|------------|------------------|
|
|
100
|
-
| Local UI | `useState`, `useReducer` |
|
|
101
|
-
| Shared UI | Zustand, Pinia, Redux, Context API |
|
|
102
|
-
| Server | React Query, RTK Query, Apollo, SWR |
|
|
103
|
-
| URL | React Router `useSearchParams`, Next.js `useRouter` |
|
|
104
|
-
|
|
105
|
-
**Rule:** Always respect existing project conventions. If they use Redux for everything, use Redux.
|
|
106
|
-
|
|
107
|
-
---
|
|
108
|
-
|
|
109
|
-
### Phase 3 — Implementation
|
|
110
|
-
|
|
111
|
-
Generate the required code.
|
|
112
|
-
|
|
113
|
-
**Example for Server State (React Query):**
|
|
114
|
-
- Create query key factory
|
|
115
|
-
- Create custom hook (`useUserList`)
|
|
116
|
-
- Handle `isLoading`, `isError`, and `data`
|
|
117
|
-
|
|
118
|
-
**Example for Global UI State (Zustand):**
|
|
119
|
-
- Create store file (`userStore.ts`)
|
|
120
|
-
- Define state interface and initial values
|
|
121
|
-
- Define update actions (mutations)
|
|
122
|
-
|
|
123
|
-
---
|
|
124
|
-
|
|
125
|
-
### Phase 4 — Validation
|
|
126
|
-
|
|
127
|
-
- [ ] Does it update correctly without mutating state directly?
|
|
128
|
-
- [ ] Are unnecessary re-renders avoided?
|
|
129
|
-
- [ ] Is server state properly cached and invalidated after mutations?
|
|
130
|
-
- [ ] Is it placed in the correct directory (e.g., `src/store/` or `src/hooks/`)?
|
|
131
|
-
|
|
132
|
-
---
|
|
133
|
-
|
|
134
|
-
## Decision Tree
|
|
135
|
-
|
|
136
|
-
```
|
|
137
|
-
Is the data fetched from a backend API?
|
|
138
|
-
├── Yes → Use Server State (React Query / SWR / RTK Query)
|
|
139
|
-
└── No → Is the data only needed in one component and its direct children?
|
|
140
|
-
├── Yes → Use Local State (`useState`)
|
|
141
|
-
└── No → Is the data used across many distinct branches of the app?
|
|
142
|
-
├── Yes → Use Global State (Zustand / Redux)
|
|
143
|
-
└── No → Use Context API or lift state up
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
---
|
|
147
|
-
|
|
148
|
-
## Output Format
|
|
149
|
-
|
|
150
|
-
```
|
|
151
|
-
🧠 State Management Plan
|
|
152
|
-
─────────────────────────────────────────────────
|
|
153
|
-
State Type: [Server / Global UI / Local / URL]
|
|
154
|
-
Tool Used: [React Query / Zustand / useState / etc.]
|
|
155
|
-
|
|
156
|
-
Implementation:
|
|
157
|
-
✅ [File 1] — [Store / Hook definition]
|
|
158
|
-
✅ [File 2] — [Component integration]
|
|
159
|
-
|
|
160
|
-
⚠️ Considerations:
|
|
161
|
-
• [Note on caching, stale time, or performance]
|
|
162
|
-
|
|
163
|
-
🔗 Next Steps:
|
|
164
|
-
State is ready. Use the hook in your component.
|
|
165
|
-
```
|
|
166
|
-
|
|
167
|
-
---
|
|
168
|
-
|
|
169
|
-
## Examples
|
|
170
|
-
|
|
171
|
-
See `examples/` folder.
|
|
1
|
+
---
|
|
2
|
+
name: qk-engineering-standard
|
|
3
|
+
version: 3.0.0
|
|
4
|
+
updated: 2026-07-02
|
|
5
|
+
description: Enforce SOLID, DRY, Clean Code, and Naming conventions.
|
|
6
|
+
category: standard
|
|
7
|
+
priority: critical
|
|
8
|
+
tags: [clean-code, architecture, refactoring, solid]
|
|
9
|
+
platforms: [claude-code, cursor, windsurf, gemini-cli]
|
|
10
|
+
trigger: User asks to review code, refactor code, or as part of the pipeline before validation.
|
|
11
|
+
inputs: [Source Code, Target Directory]
|
|
12
|
+
outputs: [Refactored Code, Code Review Report]
|
|
13
|
+
allowed_tools: [grep_search, read_file, write_to_file]
|
|
14
|
+
pipeline: [analyze, review, implement, validate, complete]
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
# 🛠️ qk-engineering-standard - Standard Operating Procedure
|
|
18
|
+
|
|
19
|
+
> **Goal:** Đóng vai trò là "Kiến trúc sư trưởng", rà soát và ép buộc mã nguồn phải tuân thủ chuẩn mực Clean Code, dễ đọc và dễ bảo trì.
|
|
20
|
+
|
|
21
|
+
## 🔄 1. Chain of Thought (SOP)
|
|
22
|
+
1. **Analyze (Context Review):**
|
|
23
|
+
- Scan the target file(s) and determine their role (UI, Logic, API, Config).
|
|
24
|
+
2. **Review (Smell Detection):**
|
|
25
|
+
- Check for Naming violations (e.g., `temp`, `data`, `res` instead of `userData`).
|
|
26
|
+
- Check for Magic Numbers/Strings.
|
|
27
|
+
- Check for God Components (Files > 300 lines or > 3 responsibilities).
|
|
28
|
+
3. **Implement (Refactoring):**
|
|
29
|
+
- Extract inline styles or raw strings into constants.
|
|
30
|
+
- Split large components into smaller, pure components.
|
|
31
|
+
- Separate UI rendering from Business Logic (Custom Hooks).
|
|
32
|
+
4. **Verify (Validation):**
|
|
33
|
+
- Ensure the refactoring did NOT change the business logic or behavior of the app (Regression check).
|
|
34
|
+
|
|
35
|
+
## 🛡️ 2. Constraints & Rules
|
|
36
|
+
- **Code is for Humans:** Write code that junior developers can easily understand. Avoid overly clever or obscure syntax.
|
|
37
|
+
- **Scope Limit:** Do NOT refactor the entire project if the user only asked to review one file. Limit the scope to the current task context.
|
|
38
|
+
- **Preserve Behavior:** Refactoring must strictly preserve backward compatibility.
|
|
39
|
+
|
|
40
|
+
## 🌳 3. Decision Tree
|
|
41
|
+
```text
|
|
42
|
+
Is the file larger than 300 lines?
|
|
43
|
+
├── YES → Propose splitting the file into sub-components or moving logic to hooks.
|
|
44
|
+
└── NO → Continue normal inspection.
|
|
45
|
+
|
|
46
|
+
Does the React Component contain `fetch()` or heavy data mapping?
|
|
47
|
+
├── YES → Extract the logic into a separate `use[Feature]Data.ts` hook.
|
|
48
|
+
└── NO → Pass.
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## 🤝 4. Handoff Pipeline
|
|
52
|
+
1. `validate`: Run static analysis (Linters, TypeScript compiler) to ensure the refactored code has no syntax errors.
|
|
53
|
+
2. `complete`: Generate the review report.
|
|
54
|
+
|
|
55
|
+
## 📝 5. Output Format
|
|
56
|
+
Vui lòng trả kết quả bằng Tiếng Việt. Cấu trúc báo cáo bao gồm:
|
|
57
|
+
- **Tóm tắt (Summary):** File nào vừa được Refactor / Review.
|
|
58
|
+
- **Chi tiết (Changes):** Các thay đổi cụ thể về Tên biến, Cấu trúc.
|
|
59
|
+
- **Nguyên nhân (Reasoning):** Giải thích tại sao code cũ là "Bad Practice" và code mới tốt hơn thế nào.
|
|
60
|
+
- **Xác thực (Verification):** Đảm bảo code chạy không lỗi.
|
|
61
|
+
- **Hành động tiếp (Next Action):** Bàn giao lại cho Pipeline.
|