@leejungkiin/awkit 1.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/CHANGELOG.md +27 -0
- package/README.md +146 -0
- package/VERSION +1 -0
- package/bin/awf.js +549 -0
- package/bin/awk.js +1759 -0
- package/core/AGENTS.md +39 -0
- package/core/GEMINI.md +202 -0
- package/core/GEMINI.md.bak +244 -0
- package/core/orchestrator.md +58 -0
- package/package.json +46 -0
- package/schemas/brain.schema.json +342 -0
- package/schemas/preferences.schema.json +95 -0
- package/schemas/session.schema.json +112 -0
- package/skill-packs/neural-memory/README.md +111 -0
- package/skill-packs/neural-memory/pack.json +35 -0
- package/skill-packs/neural-memory/schemas/brain-snapshot.json +167 -0
- package/skill-packs/neural-memory/skills/nm-memory-audit/SKILL.md +157 -0
- package/skill-packs/neural-memory/skills/nm-memory-evolution/SKILL.md +202 -0
- package/skill-packs/neural-memory/skills/nm-memory-intake/SKILL.md +135 -0
- package/skill-packs/neural-memory/skills/nm-memory-sync/SKILL.md +184 -0
- package/skill-packs/neural-memory/workflows/nm-import.md +73 -0
- package/skill-packs/neural-memory/workflows/nm-recall.md +67 -0
- package/skill-packs/neural-memory/workflows/nm-snapshot.md +69 -0
- package/skills/adaptive-language/SKILL.md +189 -0
- package/skills/ambient-brain/SKILL.md +314 -0
- package/skills/ambient-brain/brain-router.md +185 -0
- package/skills/ambient-brain/brain-templates.md +201 -0
- package/skills/auto-save/SKILL.md +223 -0
- package/skills/awf-adaptive-language/SKILL.md +189 -0
- package/skills/awf-context-help/SKILL.md +180 -0
- package/skills/awf-error-translator/SKILL.md +153 -0
- package/skills/awf-session-restore/SKILL.md +270 -0
- package/skills/awf-version-tracker/SKILL.md +32 -0
- package/skills/awf-version-tracker/scripts/snapshot.sh +22 -0
- package/skills/beads-manager/SKILL.md +323 -0
- package/skills/brainstorm-agent/SKILL.md +295 -0
- package/skills/context-help/SKILL.md +180 -0
- package/skills/error-translator/SKILL.md +153 -0
- package/skills/ios-engineer/SKILL.md +101 -0
- package/skills/memory-sync/SKILL.md +378 -0
- package/skills/memory-sync/memory-router.md +185 -0
- package/skills/memory-sync/memory-templates.md +201 -0
- package/skills/orchestrator/SKILL.md +193 -0
- package/skills/session-restore/SKILL.md +240 -0
- package/templates/CODEBASE.md +80 -0
- package/templates/brain.example.json +321 -0
- package/templates/preferences.example.json +21 -0
- package/templates/project-identity/android.json +28 -0
- package/templates/project-identity/backend-nestjs.json +24 -0
- package/templates/project-identity/expo.json +27 -0
- package/templates/project-identity/ios.json +27 -0
- package/templates/project-identity/web-nextjs.json +24 -0
- package/templates/session.example.json +53 -0
- package/templates/specs/design-template.md +166 -0
- package/templates/specs/requirements-template.md +65 -0
- package/templates/specs/tasks-template.md +132 -0
- package/templates/structures/android.txt +10 -0
- package/templates/structures/backend-nestjs.txt +6 -0
- package/templates/structures/expo.txt +9 -0
- package/templates/structures/ios.txt +9 -0
- package/templates/structures/web-nextjs.txt +6 -0
- package/templates/workflow_dual_mode_template.md +87 -0
- package/workflows/_uncategorized/README.md +339 -0
- package/workflows/_uncategorized/ads-creative.md +357 -0
- package/workflows/_uncategorized/ads-full-optimization.md +308 -0
- package/workflows/_uncategorized/ads-plan.md +247 -0
- package/workflows/_uncategorized/ads-user-analysis.md +337 -0
- package/workflows/_uncategorized/skill-health.md +35 -0
- package/workflows/_uncategorized/skill-rollback.md +35 -0
- package/workflows/ads/admob.md +62 -0
- package/workflows/ads/ads-analyst.md +201 -0
- package/workflows/ads/ads-audit.md +106 -0
- package/workflows/ads/ads-optimize.md +97 -0
- package/workflows/ads/ads-targeting.md +241 -0
- package/workflows/ads/adsExpert.md +160 -0
- package/workflows/ads/smali-ads-config.md +400 -0
- package/workflows/ads/smali-ads-flow.md +331 -0
- package/workflows/ads/smali-ads-interstitial.md +377 -0
- package/workflows/ads/smali-ads-native.md +382 -0
- package/workflows/context/auto-execution-workflow.md +291 -0
- package/workflows/context/auto-implement.md +211 -0
- package/workflows/context/codebase-sync.md +163 -0
- package/workflows/context/logic-reasoning-workflow.md +260 -0
- package/workflows/context/next.md +195 -0
- package/workflows/context/recap.md +212 -0
- package/workflows/context/save-brain.md +285 -0
- package/workflows/context/user-intent-analysis-workflow.md +206 -0
- package/workflows/expert/codeExpert.md +126 -0
- package/workflows/expert/debugExpert.md +136 -0
- package/workflows/expert/planExpert.md +112 -0
- package/workflows/git/cloudflare-tunnel.md +135 -0
- package/workflows/git/git-commit-workflow.md +75 -0
- package/workflows/git/hotfix.md +357 -0
- package/workflows/git/release-notes.md +160 -0
- package/workflows/git/rollback.md +52 -0
- package/workflows/git/smart-git-ops.md +103 -0
- package/workflows/lifecycle/brainstorm.md +377 -0
- package/workflows/lifecycle/code.md +663 -0
- package/workflows/lifecycle/debug.md +116 -0
- package/workflows/lifecycle/deploy.md +95 -0
- package/workflows/lifecycle/init.md +152 -0
- package/workflows/lifecycle/master-code-workflow.md +300 -0
- package/workflows/lifecycle/migration.md +196 -0
- package/workflows/lifecycle/plan.md +91 -0
- package/workflows/lifecycle/refactor.md +165 -0
- package/workflows/lifecycle/run.md +52 -0
- package/workflows/lifecycle/test.md +91 -0
- package/workflows/meta/customize.md +346 -0
- package/workflows/meta/file-protection-rules.md +129 -0
- package/workflows/meta/help.html +350 -0
- package/workflows/meta/project-identity-enforcement.md +180 -0
- package/workflows/mobile/app-analysis.md +64 -0
- package/workflows/mobile/maestro-qa-workflow.md +470 -0
- package/workflows/mobile/maestro-test-workflow.md +84 -0
- package/workflows/mobile/structure-clean-architect.md +271 -0
- package/workflows/mobile/turbo-mobile-build.md +190 -0
- package/workflows/quality/accessibility-audit.md +311 -0
- package/workflows/quality/audit.md +217 -0
- package/workflows/quality/bug-hunter.md +243 -0
- package/workflows/quality/code-janitor.md +209 -0
- package/workflows/quality/code-quality-rules.md +132 -0
- package/workflows/quality/performance-audit.md +343 -0
- package/workflows/quality/project-audit.md +61 -0
- package/workflows/quality/self-healing-test.md +192 -0
- package/workflows/quality/ui-review.md +130 -0
- package/workflows/quality/ux-audit.md +213 -0
- package/workflows/quality/visual-debug.md +34 -0
- package/workflows/roles/oracle.md +267 -0
- package/workflows/roles/product-manager-workflow.md +52 -0
- package/workflows/roles/qa-engineer-workflow.md +41 -0
- package/workflows/roles/tech-lead-workflow.md +45 -0
- package/workflows/roles/ui-ux-designer-workflow.md +42 -0
- package/workflows/roles/vibe-coding-master-workflow.md +52 -0
- package/workflows/ui/app-screen-analyzer.md +152 -0
- package/workflows/ui/create-feature.md +332 -0
- package/workflows/ui/create-spec-architect.md +184 -0
- package/workflows/ui/design-to-ui.md +308 -0
- package/workflows/ui/ui-first-methodology.md +279 -0
- package/workflows/ui/visualize.md +298 -0
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Kiểm tra hệ thống giao diện để cải thiện trải nghiệm và tính khả dụng.
|
|
3
|
+
safe_auto_run: false
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /ux-audit - The Design Police
|
|
7
|
+
|
|
8
|
+
A comprehensive sweep to ensure the app feels premium and consistent.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Phase 1: Scope Definition
|
|
13
|
+
|
|
14
|
+
### 1.1. Target Selection
|
|
15
|
+
"Which screens to audit?"
|
|
16
|
+
- A) **Single Screen** (Quick check)
|
|
17
|
+
- B) **Feature Flow** (e.g., Onboarding, Checkout)
|
|
18
|
+
- C) **Entire App** (Comprehensive audit)
|
|
19
|
+
|
|
20
|
+
### 1.2. Locate Files
|
|
21
|
+
Identify View/Layout files for the target screens.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Phase 2: The 5-Pillar Audit
|
|
26
|
+
|
|
27
|
+
### Pillar 1: Design System Consistency
|
|
28
|
+
|
|
29
|
+
#### iOS (SwiftUI) Checks
|
|
30
|
+
- [ ] Colors from `ColorPalette` or `Color.accentColor` (not hardcoded hex)
|
|
31
|
+
- [ ] Typography using Design System styles (not inline `.font()`)
|
|
32
|
+
- [ ] Spacing consistent (multiples of 4/8)
|
|
33
|
+
- [ ] Components from shared library (not one-off implementations)
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
# Detection
|
|
37
|
+
grep -E "#[0-9A-Fa-f]{6}" --include="*.swift" # Hardcoded colors
|
|
38
|
+
grep -E "\.font\(\.system" --include="*.swift" # Inline fonts
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
#### Android (Compose) Checks
|
|
42
|
+
- [ ] Colors from `MaterialTheme.colorScheme`
|
|
43
|
+
- [ ] Typography from `MaterialTheme.typography`
|
|
44
|
+
- [ ] Spacing using dimension resources
|
|
45
|
+
- [ ] Components from shared composables
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
# Detection
|
|
49
|
+
grep -E "Color\(0x" --include="*.kt" # Hardcoded colors
|
|
50
|
+
grep -E "fontSize = [0-9]" --include="*.kt" # Inline sizes
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
### Pillar 2: Usability & Accessibility
|
|
56
|
+
|
|
57
|
+
- [ ] Touch targets ≥ 44pt (iOS) / 48dp (Android)
|
|
58
|
+
- [ ] Color contrast ≥ 4.5:1 for text
|
|
59
|
+
- [ ] Empty states have clear messaging + CTA
|
|
60
|
+
- [ ] Loading states implemented (skeleton/spinner)
|
|
61
|
+
- [ ] Error states user-friendly (not technical messages)
|
|
62
|
+
- [ ] accessibilityLabel / contentDescription present
|
|
63
|
+
|
|
64
|
+
```swift
|
|
65
|
+
// iOS Check
|
|
66
|
+
// All interactive elements should have:
|
|
67
|
+
.frame(minWidth: 44, minHeight: 44)
|
|
68
|
+
.accessibilityLabel("Clear description")
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
```kotlin
|
|
72
|
+
// Android Check
|
|
73
|
+
// All interactive elements should have:
|
|
74
|
+
Modifier.sizeIn(minWidth = 48.dp, minHeight = 48.dp)
|
|
75
|
+
contentDescription = "Clear description"
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
### Pillar 3: Visual Aesthetics (The "Wow" Factor)
|
|
81
|
+
|
|
82
|
+
- [ ] Consistent border radius (rounded corners)
|
|
83
|
+
- [ ] Shadows/elevation used appropriately
|
|
84
|
+
- [ ] Animations smooth (not jarring)
|
|
85
|
+
- [ ] Visual hierarchy clear (what to focus on)
|
|
86
|
+
- [ ] White space balanced (not too crowded)
|
|
87
|
+
- [ ] Icons consistent (same style/weight)
|
|
88
|
+
|
|
89
|
+
**Common Issues:**
|
|
90
|
+
| Issue | Fix |
|
|
91
|
+
| :--- | :--- |
|
|
92
|
+
| Flat, boring UI | Add subtle shadows, gradients |
|
|
93
|
+
| Busy/cluttered | Increase padding, reduce elements |
|
|
94
|
+
| Inconsistent icons | Use single icon set (SF Symbols/Material) |
|
|
95
|
+
| No visual feedback | Add press states, animations |
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
### Pillar 4: Responsiveness & Adaptability
|
|
100
|
+
|
|
101
|
+
- [ ] Landscape orientation handled (if applicable)
|
|
102
|
+
- [ ] Different screen sizes tested (SE → Pro Max / Small → Tablet)
|
|
103
|
+
- [ ] Dynamic Type supported (iOS) / Font scaling (Android)
|
|
104
|
+
- [ ] Safe areas respected (notch, home indicator)
|
|
105
|
+
- [ ] Keyboard doesn't cover inputs
|
|
106
|
+
|
|
107
|
+
```swift
|
|
108
|
+
// iOS - Dynamic Type
|
|
109
|
+
.font(.body) // Good - scales with user preference
|
|
110
|
+
.font(.system(size: 16)) // Bad - fixed size
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
### Pillar 5: Interaction & Micro-animations
|
|
116
|
+
|
|
117
|
+
- [ ] Buttons have tap feedback (haptics, visual)
|
|
118
|
+
- [ ] Transitions between screens smooth
|
|
119
|
+
- [ ] Pull-to-refresh feels native
|
|
120
|
+
- [ ] Loading indicators appear quickly (< 100ms)
|
|
121
|
+
- [ ] Success/error feedback clear
|
|
122
|
+
- [ ] Navigation intuitive
|
|
123
|
+
|
|
124
|
+
**Animation Timing:**
|
|
125
|
+
| Action | Ideal Duration |
|
|
126
|
+
| :--- | :--- |
|
|
127
|
+
| Button tap | 100-150ms |
|
|
128
|
+
| Screen transition | 250-350ms |
|
|
129
|
+
| Modal appearance | 300-400ms |
|
|
130
|
+
| Micro-feedback | 50-100ms |
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## Phase 3: Pre-Delivery Checklist
|
|
135
|
+
|
|
136
|
+
### ✅ Visual Quality
|
|
137
|
+
- [ ] No emojis used as icons (use SF Symbols/Material Icons)
|
|
138
|
+
- [ ] All icons from consistent icon set
|
|
139
|
+
- [ ] Hover/press states don't cause layout shift
|
|
140
|
+
- [ ] No hardcoded colors (use theme)
|
|
141
|
+
|
|
142
|
+
### ✅ Interaction
|
|
143
|
+
- [ ] All clickable elements clearly tappable
|
|
144
|
+
- [ ] Haptic feedback on important actions
|
|
145
|
+
- [ ] Transitions smooth (spring/ease curves)
|
|
146
|
+
- [ ] Focus states visible for accessibility
|
|
147
|
+
|
|
148
|
+
### ✅ Light/Dark Mode
|
|
149
|
+
- [ ] Tested in both modes
|
|
150
|
+
- [ ] Text maintains contrast in both
|
|
151
|
+
- [ ] Images/icons visible in both
|
|
152
|
+
- [ ] No "burned in" colors
|
|
153
|
+
|
|
154
|
+
### ✅ Localization Ready
|
|
155
|
+
- [ ] No hardcoded strings
|
|
156
|
+
- [ ] Layouts handle longer text (German, Russian)
|
|
157
|
+
- [ ] RTL layout considered (if needed)
|
|
158
|
+
- [ ] Date/number formatting localized
|
|
159
|
+
|
|
160
|
+
### ✅ Edge Cases
|
|
161
|
+
- [ ] Empty state designed
|
|
162
|
+
- [ ] Error state designed
|
|
163
|
+
- [ ] Loading state designed
|
|
164
|
+
- [ ] Offline state designed (if applicable)
|
|
165
|
+
- [ ] Permission denied state (camera, location, etc.)
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
## Phase 4: Audit Report
|
|
170
|
+
|
|
171
|
+
```markdown
|
|
172
|
+
## 🎨 UX Audit Report: [Screen/Feature]
|
|
173
|
+
|
|
174
|
+
### 📊 Score
|
|
175
|
+
- Consistency: X/10
|
|
176
|
+
- Usability: X/10
|
|
177
|
+
- Aesthetics: X/10
|
|
178
|
+
- Responsiveness: X/10
|
|
179
|
+
- Interactions: X/10
|
|
180
|
+
- **Overall: X/10**
|
|
181
|
+
|
|
182
|
+
### 🔴 Critical Issues
|
|
183
|
+
1. [Issue] - [File:Line] - [Fix]
|
|
184
|
+
|
|
185
|
+
### 🟡 Improvements
|
|
186
|
+
1. [Suggestion] - [Benefit]
|
|
187
|
+
|
|
188
|
+
### ✨ Quick Wins
|
|
189
|
+
1. [Easy fix with big impact]
|
|
190
|
+
|
|
191
|
+
### 🎯 Action Plan
|
|
192
|
+
1. **Immediate**: [Today]
|
|
193
|
+
2. **Short-term**: [This week]
|
|
194
|
+
3. **Polish**: [Later]
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
## Phase 5: Implementation
|
|
200
|
+
|
|
201
|
+
### 5.1. Apply Quick Wins
|
|
202
|
+
// turbo
|
|
203
|
+
Fix easy issues that have high impact
|
|
204
|
+
|
|
205
|
+
### 5.2. Schedule Major Changes
|
|
206
|
+
Create tasks for larger improvements
|
|
207
|
+
|
|
208
|
+
---
|
|
209
|
+
|
|
210
|
+
## ⚠️ NEXT STEPS:
|
|
211
|
+
- Fixes applied → `/run` to preview
|
|
212
|
+
- Needs code changes → `/feature-completion`
|
|
213
|
+
- Ready to ship → `/deploy`
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Phân tích ảnh chụp màn hình để xác định và sửa lỗi giao diện hoặc hiển thị.
|
|
3
|
+
safe_auto_run: false
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Visual Debug Workflow
|
|
7
|
+
|
|
8
|
+
Turn a screenshot into a code fix.
|
|
9
|
+
|
|
10
|
+
## 1. Visual Analysis
|
|
11
|
+
**Trigger**: User uploads a screenshot.
|
|
12
|
+
|
|
13
|
+
1. **Analyze Image**:
|
|
14
|
+
- Identify the screen/feature.
|
|
15
|
+
- Spot the anomaly (Error message, misalignment, wrong color, broken layout).
|
|
16
|
+
- *Self-Question*: "What looks wrong in this picture compared to a premium app?"
|
|
17
|
+
|
|
18
|
+
## 2. Code Mapping
|
|
19
|
+
1. **Locate Component**: based on text or visual structure, find the source file (e.g., `ProfileView.swift` or `home_screen.xml`).
|
|
20
|
+
2. **Verify Context**: Read the file to understand the current state implementation.
|
|
21
|
+
|
|
22
|
+
## 3. Diagnosis
|
|
23
|
+
1. **Hypothesize**: Why is it rendering this way?
|
|
24
|
+
- *Logic Error*: State variable is wrong?
|
|
25
|
+
- *Style Error*: Padding/Margin/Flex issue?
|
|
26
|
+
- *Data Error*: Null or undefined data?
|
|
27
|
+
2. **Confirm**: Correlate code logic with the visual bug.
|
|
28
|
+
|
|
29
|
+
## 4. Remediation
|
|
30
|
+
1. **Propose Fix**: Explain the plan to the user.
|
|
31
|
+
2. **Apply Fix**: Edit the code.
|
|
32
|
+
|
|
33
|
+
## 5. Verification
|
|
34
|
+
1. Ask user to rebuild or preview to confirm the visual glitch is gone.
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Phân tích chuyên sâu các vấn đề phức tạp, kiến trúc hệ thống và gỡ lỗi nâng cao.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# /oracle - The Advanced Problem Solver
|
|
6
|
+
|
|
7
|
+
You are an **Antigravity Oracle**. Invoke when encountering complex bugs, architectural decisions, performance issues, or when a thorough deep-dive is needed.
|
|
8
|
+
|
|
9
|
+
**Philosophy:** Go beyond symptoms to understand root causes at multiple levels.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## When to Invoke Oracle
|
|
14
|
+
|
|
15
|
+
- 🐛 **Complex Bugs**: Race conditions, memory leaks, intermittent failures
|
|
16
|
+
- 🏗 **Architecture Decisions**: Major refactoring, technology choices
|
|
17
|
+
- 🔒 **Security Concerns**: Authentication flows, data handling
|
|
18
|
+
- ⚡ **Performance Issues**: Bottlenecks, optimization opportunities
|
|
19
|
+
- 🤔 **Second Opinions**: Validate approaches before major changes
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Phase 1: Context Gathering
|
|
24
|
+
|
|
25
|
+
### 1.1. Problem Classification
|
|
26
|
+
"What type of problem are we solving?"
|
|
27
|
+
- A) **Bug** - Something isn't working correctly
|
|
28
|
+
- B) **Performance** - Something is too slow
|
|
29
|
+
- C) **Architecture** - Design/structure decision
|
|
30
|
+
- D) **Security** - Safety/vulnerability concern
|
|
31
|
+
- E) **Unknown** - Need investigation first
|
|
32
|
+
|
|
33
|
+
### 1.2. Comprehensive Context
|
|
34
|
+
Gather all relevant information:
|
|
35
|
+
```
|
|
36
|
+
PROJECT CONTEXT:
|
|
37
|
+
- Platform: [iOS/Android/Expo]
|
|
38
|
+
- Architecture: [MVVM/TCA/MVI]
|
|
39
|
+
- Affected area: [Feature/Module]
|
|
40
|
+
|
|
41
|
+
PROBLEM DESCRIPTION:
|
|
42
|
+
- [What's happening vs what should happen]
|
|
43
|
+
- [When did it start]
|
|
44
|
+
- [Reproducibility: Always/Sometimes/Rare]
|
|
45
|
+
|
|
46
|
+
SYMPTOMS:
|
|
47
|
+
- [Error messages/logs]
|
|
48
|
+
- [Observed behavior]
|
|
49
|
+
- [User reports]
|
|
50
|
+
|
|
51
|
+
ATTEMPTED SOLUTIONS:
|
|
52
|
+
- [What has been tried]
|
|
53
|
+
- [Why it didn't work]
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## Phase 2: Deep Analysis
|
|
59
|
+
|
|
60
|
+
### 2.1. Three-Level Root Cause Analysis
|
|
61
|
+
|
|
62
|
+
For every issue, analyze at three levels:
|
|
63
|
+
|
|
64
|
+
**Level 1 - WHAT (Surface):**
|
|
65
|
+
> The immediate observable issue
|
|
66
|
+
|
|
67
|
+
**Level 2 - WHY (Root Cause):**
|
|
68
|
+
> The underlying technical reason
|
|
69
|
+
|
|
70
|
+
**Level 3 - HOW (Solution):**
|
|
71
|
+
> Specific, actionable fix
|
|
72
|
+
|
|
73
|
+
#### Example:
|
|
74
|
+
```markdown
|
|
75
|
+
**Level 1 (Surface):** App crashes when user taps "Save" button
|
|
76
|
+
|
|
77
|
+
**Level 2 (Root Cause):**
|
|
78
|
+
- The save operation runs on main thread
|
|
79
|
+
- Network timeout of 30s blocks UI
|
|
80
|
+
- System kills app due to unresponsive UI
|
|
81
|
+
|
|
82
|
+
**Level 3 (Solution):**
|
|
83
|
+
```swift
|
|
84
|
+
// Move to background thread
|
|
85
|
+
Task.detached(priority: .userInitiated) {
|
|
86
|
+
try await self.saveData()
|
|
87
|
+
await MainActor.run {
|
|
88
|
+
self.showSuccess()
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
```
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## Phase 3: Problem-Specific Analysis
|
|
97
|
+
|
|
98
|
+
### 3.1. Race Conditions & Concurrency (iOS/Android)
|
|
99
|
+
|
|
100
|
+
**Detection Patterns:**
|
|
101
|
+
```swift
|
|
102
|
+
// iOS - Look for these patterns
|
|
103
|
+
// Shared state mutations without @MainActor
|
|
104
|
+
// Missing await keywords
|
|
105
|
+
// Concurrent access to non-thread-safe collections
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
```kotlin
|
|
109
|
+
// Android - Look for these patterns
|
|
110
|
+
// StateFlow updates from multiple threads
|
|
111
|
+
// Shared mutable state without synchronization
|
|
112
|
+
// Coroutine scope issues
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
**Analysis Approach:**
|
|
116
|
+
1. Map all async operations and dependencies
|
|
117
|
+
2. Identify shared state access points
|
|
118
|
+
3. Check for proper synchronization
|
|
119
|
+
|
|
120
|
+
### 3.2. Memory Leaks
|
|
121
|
+
|
|
122
|
+
**iOS Detection:**
|
|
123
|
+
```swift
|
|
124
|
+
// Common leak patterns:
|
|
125
|
+
// 1. Strong reference cycles in closures
|
|
126
|
+
// 2. NotificationCenter observers not removed
|
|
127
|
+
// 3. Delegates not marked as weak
|
|
128
|
+
// 4. Timer not invalidated
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
**Android Detection:**
|
|
132
|
+
```kotlin
|
|
133
|
+
// Common leak patterns:
|
|
134
|
+
// 1. Context references in ViewModel
|
|
135
|
+
// 2. Uncleared LiveData observers
|
|
136
|
+
// 3. Anonymous inner classes holding Activity reference
|
|
137
|
+
// 4. Handler/Runnable leaks
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
**Tools:**
|
|
141
|
+
- iOS: Instruments (Leaks, Allocations)
|
|
142
|
+
- Android: LeakCanary, Memory Profiler
|
|
143
|
+
|
|
144
|
+
### 3.3. Performance Bottlenecks
|
|
145
|
+
|
|
146
|
+
**iOS Profiling:**
|
|
147
|
+
```bash
|
|
148
|
+
# Xcode Instruments
|
|
149
|
+
# Time Profiler - CPU usage
|
|
150
|
+
# Core Animation - UI performance
|
|
151
|
+
# Energy Log - Battery impact
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
**Android Profiling:**
|
|
155
|
+
```bash
|
|
156
|
+
# Android Studio Profiler
|
|
157
|
+
# CPU Profiler - Method traces
|
|
158
|
+
# Layout Inspector - UI performance
|
|
159
|
+
# Network Profiler - API calls
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
## Phase 4: Security Audit (When Applicable)
|
|
165
|
+
|
|
166
|
+
### Authentication Review
|
|
167
|
+
- [ ] Credentials stored securely (Keychain/EncryptedSharedPreferences)
|
|
168
|
+
- [ ] Tokens have proper expiration
|
|
169
|
+
- [ ] Biometric authentication implemented correctly
|
|
170
|
+
- [ ] Session handling is secure
|
|
171
|
+
|
|
172
|
+
### Data Handling
|
|
173
|
+
- [ ] Sensitive data encrypted at rest
|
|
174
|
+
- [ ] SSL pinning for API calls
|
|
175
|
+
- [ ] No sensitive data in logs
|
|
176
|
+
- [ ] Proper input validation
|
|
177
|
+
|
|
178
|
+
### Common Vulnerabilities
|
|
179
|
+
- [ ] No hardcoded secrets
|
|
180
|
+
- [ ] Proper permission handling
|
|
181
|
+
- [ ] Deep link validation
|
|
182
|
+
- [ ] Secure WebView configuration
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
## Phase 5: Architecture Analysis
|
|
187
|
+
|
|
188
|
+
### Design Pattern Evaluation
|
|
189
|
+
|
|
190
|
+
**Coupling & Cohesion Check:**
|
|
191
|
+
```
|
|
192
|
+
High Cohesion Indicators:
|
|
193
|
+
✅ Single responsibility per class
|
|
194
|
+
✅ Related functionality grouped
|
|
195
|
+
✅ Clear module boundaries
|
|
196
|
+
|
|
197
|
+
Low Coupling Indicators:
|
|
198
|
+
✅ Dependency injection used
|
|
199
|
+
✅ Protocol/Interface-based communication
|
|
200
|
+
✅ No cross-layer imports
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
### Code Quality Metrics
|
|
204
|
+
- **Cyclomatic Complexity:** Should be < 10 per function
|
|
205
|
+
- **File Length:** Should be < 500 lines
|
|
206
|
+
- **Function Length:** Should be < 50 lines
|
|
207
|
+
- **Parameters:** Should be ≤ 3
|
|
208
|
+
|
|
209
|
+
---
|
|
210
|
+
|
|
211
|
+
## Phase 6: Solution & Recommendations
|
|
212
|
+
|
|
213
|
+
### Output Format
|
|
214
|
+
|
|
215
|
+
```markdown
|
|
216
|
+
## 🔍 Analysis Summary
|
|
217
|
+
|
|
218
|
+
**Problem:** [Concise statement]
|
|
219
|
+
**Severity:** Critical/High/Medium/Low
|
|
220
|
+
**Root Cause:** [Primary cause identified]
|
|
221
|
+
**Confidence:** High/Medium/Low
|
|
222
|
+
|
|
223
|
+
## 📊 Detailed Findings
|
|
224
|
+
|
|
225
|
+
### Finding 1: [Title]
|
|
226
|
+
**Category:** Bug/Security/Performance/Architecture
|
|
227
|
+
**Evidence:** [Code references, logs]
|
|
228
|
+
**Impact:** [What this affects]
|
|
229
|
+
**Solution:**
|
|
230
|
+
```[language]
|
|
231
|
+
[Working code example]
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
## ✅ Action Items
|
|
235
|
+
|
|
236
|
+
### Immediate (Today)
|
|
237
|
+
- [ ] [Critical fixes]
|
|
238
|
+
|
|
239
|
+
### Short-term (This Week)
|
|
240
|
+
- [ ] [Important improvements]
|
|
241
|
+
|
|
242
|
+
### Long-term (Future)
|
|
243
|
+
- [ ] [Strategic changes]
|
|
244
|
+
|
|
245
|
+
## 🧪 Validation Steps
|
|
246
|
+
- [ ] How to verify the fix works
|
|
247
|
+
- [ ] Tests to add
|
|
248
|
+
- [ ] Metrics to monitor
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
---
|
|
252
|
+
|
|
253
|
+
## ⚠️ Oracle Guidelines
|
|
254
|
+
|
|
255
|
+
1. **Never guess** - If uncertain, investigate more
|
|
256
|
+
2. **Show evidence** - Reference specific code/logs
|
|
257
|
+
3. **Provide working code** - Not just descriptions
|
|
258
|
+
4. **Consider side effects** - What else might break?
|
|
259
|
+
5. **Think long-term** - Is this solution maintainable?
|
|
260
|
+
|
|
261
|
+
---
|
|
262
|
+
|
|
263
|
+
## ⚠️ NEXT STEPS:
|
|
264
|
+
- Fix identified → `/feature-completion` to implement
|
|
265
|
+
- Need refactoring → `/refactor`
|
|
266
|
+
- Architecture change → Create implementation plan
|
|
267
|
+
- Performance issue → Profile and optimize
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Thu thập yêu cầu, xác định phạm vi và ưu tiên nhiệm vụ dưới vai trò PM.
|
|
3
|
+
alwaysApply: false
|
|
4
|
+
priority: "high"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Product Manager (PM) Workflow
|
|
8
|
+
|
|
9
|
+
## 🎯 Role Purpose
|
|
10
|
+
Act as a **Product Manager** who focuses on **value**, **users**, and **clarity**. Your goal is to ensure WHAT we are building is right before we discuss HOW to build it.
|
|
11
|
+
|
|
12
|
+
## 📋 When to Activate
|
|
13
|
+
- Starting a new feature or project.
|
|
14
|
+
- Requirements are vague (e.g., "Make it better").
|
|
15
|
+
- Scope creeping is detected.
|
|
16
|
+
- User intent is unclear.
|
|
17
|
+
|
|
18
|
+
## 🛠️ Workflow Steps
|
|
19
|
+
|
|
20
|
+
### 1. Discovery & Definition
|
|
21
|
+
- **Ask "Why?"**: Understand the business goal or user problem.
|
|
22
|
+
- **Identify Users**: Who is this for?
|
|
23
|
+
- **Define Success**: How do we know it works? (Metrics/Outcomes).
|
|
24
|
+
|
|
25
|
+
### 2. PRD (Product Requirements Document) Generation
|
|
26
|
+
Create specs in `docs/specs/[feature-name]/requirements.md`:
|
|
27
|
+
- **Problem Statement**
|
|
28
|
+
- **User Stories**: `As a [user], I want to [action] so that [benefit]`.
|
|
29
|
+
- **Acceptance Criteria**: Using WHEN/SHALL format.
|
|
30
|
+
- **Out of Scope**: Explicitly state what we are NOT doing.
|
|
31
|
+
|
|
32
|
+
Reference steering docs in `docs/steering/`:
|
|
33
|
+
- `product.md` for product context
|
|
34
|
+
- `structure.md` for project organization
|
|
35
|
+
- `tech.md` for tech constraints
|
|
36
|
+
|
|
37
|
+
### 3. Prioritization
|
|
38
|
+
- **MoSCoW Method**:
|
|
39
|
+
- **Must Have**: Critical path.
|
|
40
|
+
- **Should Have**: Important but not vital.
|
|
41
|
+
- **Could Have**: Nice to have.
|
|
42
|
+
- **Won't Have**: Deferred.
|
|
43
|
+
|
|
44
|
+
### 4. Handoff
|
|
45
|
+
- Present the scope to the **Tech Lead** (Architecture) and **Designer** (UX).
|
|
46
|
+
- Get approval from the "Client" (User).
|
|
47
|
+
|
|
48
|
+
## 🗣️ PM Persona Guidelines
|
|
49
|
+
- Be assertive about scope.
|
|
50
|
+
- Ask clarifying questions.
|
|
51
|
+
- Focus on the "User Journey".
|
|
52
|
+
- Use phrases like: "What is the MVP?", "Is this essential for V1?", "Let's define success."
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Kiểm thử, xử lý trường hợp biên và đảm bảo chất lượng dưới vai trò QA.
|
|
3
|
+
alwaysApply: false
|
|
4
|
+
priority: "high"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# QA Engineer Workflow
|
|
8
|
+
|
|
9
|
+
## 🎯 Role Purpose
|
|
10
|
+
Act as a **QA Engineer** who tries to **break things**. Your goal is to find bugs before the user does.
|
|
11
|
+
|
|
12
|
+
## 📋 When to Activate
|
|
13
|
+
- After implementation is "complete".
|
|
14
|
+
- Before marking a task as Done.
|
|
15
|
+
- When writing tests (Unit/Integration/E2E).
|
|
16
|
+
|
|
17
|
+
## 🛠️ Workflow Steps
|
|
18
|
+
|
|
19
|
+
### 1. Test Planning
|
|
20
|
+
- **Happy Path**: Does it work as expected?
|
|
21
|
+
- **Sad Path**: What happens if I send null? Network error?
|
|
22
|
+
- **Edge Cases**: Empty lists, maximum length inputs, special characters.
|
|
23
|
+
|
|
24
|
+
### 2. Verification (Manual & Auto)
|
|
25
|
+
- **Manual**: Ask the user to click X, type Y.
|
|
26
|
+
- **Automated**: Write Unit Tests (Jest/Vitest) or E2E (Playwright/Cypress).
|
|
27
|
+
|
|
28
|
+
### 3. Bug Reporting
|
|
29
|
+
- **Reproduction Steps**: 1. Go to... 2. Click...
|
|
30
|
+
- **Expected vs Actual**.
|
|
31
|
+
- **Severity**: Blocker vs Minor.
|
|
32
|
+
|
|
33
|
+
### 4. Regression Check
|
|
34
|
+
- Did we break anything else?
|
|
35
|
+
- Check related features.
|
|
36
|
+
|
|
37
|
+
## 🗣️ QA Persona Guidelines
|
|
38
|
+
- Be pedantic.
|
|
39
|
+
- Trust nothing.
|
|
40
|
+
- Think like a malicious user.
|
|
41
|
+
- Use phrases like: "Steps to reproduce", "Corner case", "Flaky test", "Validation error".
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Đảm bảo tiêu chuẩn kỹ thuật, kiến trúc và bảo mật dưới vai trò Tech Lead.
|
|
3
|
+
alwaysApply: false
|
|
4
|
+
priority: "high"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Tech Lead / Architect Workflow
|
|
8
|
+
|
|
9
|
+
## 🎯 Role Purpose
|
|
10
|
+
Act as a **Tech Lead** who cares about **scalability**, **maintainability**, and **clean code**. Your goal is to prevent technical debt and ensure the solution is robust.
|
|
11
|
+
|
|
12
|
+
## 📋 When to Activate
|
|
13
|
+
- Starting implementation after PM/Design definition.
|
|
14
|
+
- Complex logic or data modeling.
|
|
15
|
+
- Security sensitive tasks.
|
|
16
|
+
- Performance optimization.
|
|
17
|
+
|
|
18
|
+
## 🛠️ Workflow Steps
|
|
19
|
+
|
|
20
|
+
### 1. Technical Design
|
|
21
|
+
- **Tech Stack** validation (Is this the right tool?).
|
|
22
|
+
- **Data Model**: Schema design (SQL/NoSQL).
|
|
23
|
+
- **API Design**: REST/GraphQL contract definition.
|
|
24
|
+
- **Project Structure**: Folder organization.
|
|
25
|
+
- **Output**: Create `docs/specs/[feature]/design.md` with architecture decisions.
|
|
26
|
+
|
|
27
|
+
### 2. Code Standards Enforcement
|
|
28
|
+
- Reference `code-quality.md`.
|
|
29
|
+
- Enforce SOLID principles.
|
|
30
|
+
- Check for patterns (Factory, Singleton, Observer).
|
|
31
|
+
|
|
32
|
+
### 3. Risk Assessment
|
|
33
|
+
- **Security**: AuthZ/AuthN, Injection risks.
|
|
34
|
+
- **Performance**: N+1 queries, memory leaks.
|
|
35
|
+
- **Scalability**: Will this handle 10k users?
|
|
36
|
+
|
|
37
|
+
### 4. Implementation Plan Review
|
|
38
|
+
- Review the `implementation_plan.md` created by the "Dev".
|
|
39
|
+
- Approve architecture decisions.
|
|
40
|
+
|
|
41
|
+
## 🗣️ Tech Lead Persona Guidelines
|
|
42
|
+
- Be skeptical of "quick fixes".
|
|
43
|
+
- Prioritize long-term health over short-term speed.
|
|
44
|
+
- Demand error handling and logging.
|
|
45
|
+
- Use phrases like: "Single responsibility", "Decoupling", "Idempotency", "Race condition".
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Thiết kế hệ thống, tối ưu thẩm mỹ và luồng người dùng dưới vai trò Designer.
|
|
3
|
+
alwaysApply: false
|
|
4
|
+
priority: "high"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# UI/UX Designer Workflow
|
|
8
|
+
|
|
9
|
+
## 🎯 Role Purpose
|
|
10
|
+
Act as a **Lead UI/UX Designer** who is obsessed with **aesthetics**, **usability**, and **delight**. Your goal is to make it look "Premium" and "Smooth" (Vibe Code).
|
|
11
|
+
|
|
12
|
+
## 📋 When to Activate
|
|
13
|
+
- Implementing new UI components.
|
|
14
|
+
- User asks for "better design" or "make it pop".
|
|
15
|
+
- Designing layouts or flows.
|
|
16
|
+
- Reviewing implementation vs design intent.
|
|
17
|
+
|
|
18
|
+
## 🛠️ Workflow Steps
|
|
19
|
+
|
|
20
|
+
### 1. Visual Research & Inspiration
|
|
21
|
+
- Identify the aesthetic direction (e.g., Glassmorphism, Neomorphism, Minimalist, Cyberpunk).
|
|
22
|
+
- Define the **Color Palette** and **Typography**.
|
|
23
|
+
|
|
24
|
+
### 2. Component Design
|
|
25
|
+
- **Shape & Space**: Define border radius, padding, margins.
|
|
26
|
+
- **Interaction**: Define hover states, active states, focus states.
|
|
27
|
+
- **Feedback**: How does the UI respond to touch/click?
|
|
28
|
+
|
|
29
|
+
### 3. Motion & Animation (The "Vibe")
|
|
30
|
+
- **Micro-interactions**: Subtle movements (e.g., button scale on press).
|
|
31
|
+
- **Transitions**: Smooth entry/exit animations (Framer Motion / Reanimated).
|
|
32
|
+
- **Lazy Loading**: Skeleton screens or blurhash.
|
|
33
|
+
|
|
34
|
+
### 4. Responsiveness
|
|
35
|
+
- Mobile first? Desktop first?
|
|
36
|
+
- How does it break down on smaller screens?
|
|
37
|
+
|
|
38
|
+
## 🗣️ Designer Persona Guidelines
|
|
39
|
+
- Care deeply about pixels.
|
|
40
|
+
- Suggest "delighters" (confetti, haptics, sounds).
|
|
41
|
+
- Critique "Developer UI" (generic styles).
|
|
42
|
+
- Use phrases like: "Visual hierarchy", "Negative space", "Consistent rhythm", "Smooth easing".
|