flyee 0.1.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/LICENSE +21 -0
- package/README.md +134 -0
- package/bin/install.js +357 -0
- package/bridge/bridge.py +1780 -0
- package/bridge/local_tracker.py +722 -0
- package/core/agents/backend-specialist.md +266 -0
- package/core/agents/code-archaeologist.md +106 -0
- package/core/agents/database-architect.md +226 -0
- package/core/agents/debugger.md +225 -0
- package/core/agents/devops-engineer.md +323 -0
- package/core/agents/documentation-writer.md +104 -0
- package/core/agents/explorer-agent.md +73 -0
- package/core/agents/frontend-specialist.md +743 -0
- package/core/agents/game-developer.md +162 -0
- package/core/agents/mobile-developer.md +377 -0
- package/core/agents/orchestrator.md +416 -0
- package/core/agents/penetration-tester.md +188 -0
- package/core/agents/performance-optimizer.md +187 -0
- package/core/agents/product-manager.md +112 -0
- package/core/agents/product-owner.md +95 -0
- package/core/agents/project-planner.md +470 -0
- package/core/agents/qa-automation-engineer.md +103 -0
- package/core/agents/security-auditor.md +170 -0
- package/core/agents/seo-specialist.md +111 -0
- package/core/agents/stitch-designer.md +190 -0
- package/core/agents/tdd-reviewer.md +282 -0
- package/core/agents/test-engineer.md +158 -0
- package/core/scripts/auto_preview.py +148 -0
- package/core/scripts/checklist.py +243 -0
- package/core/scripts/cost_report.py +149 -0
- package/core/scripts/doc-sync-check.py +461 -0
- package/core/scripts/parse_user_stories.py +79 -0
- package/core/scripts/prepare_notion_updates.py +172 -0
- package/core/scripts/print_create_payload.py +18 -0
- package/core/scripts/session_manager.py +120 -0
- package/core/scripts/task_complete.py +127 -0
- package/core/scripts/verify_all.py +327 -0
- package/core/skills/analytics-strategy/SKILL.md +128 -0
- package/core/skills/api-patterns/SKILL.md +81 -0
- package/core/skills/api-patterns/api-style.md +42 -0
- package/core/skills/api-patterns/auth.md +24 -0
- package/core/skills/api-patterns/documentation.md +26 -0
- package/core/skills/api-patterns/graphql.md +41 -0
- package/core/skills/api-patterns/rate-limiting.md +31 -0
- package/core/skills/api-patterns/response.md +37 -0
- package/core/skills/api-patterns/rest.md +40 -0
- package/core/skills/api-patterns/scripts/api_validator.py +211 -0
- package/core/skills/api-patterns/security-testing.md +122 -0
- package/core/skills/api-patterns/trpc.md +41 -0
- package/core/skills/api-patterns/versioning.md +22 -0
- package/core/skills/app-builder/SKILL.md +75 -0
- package/core/skills/app-builder/agent-coordination.md +71 -0
- package/core/skills/app-builder/feature-building.md +53 -0
- package/core/skills/app-builder/project-detection.md +34 -0
- package/core/skills/app-builder/scaffolding.md +118 -0
- package/core/skills/app-builder/tech-stack.md +40 -0
- package/core/skills/app-builder/templates/SKILL.md +39 -0
- package/core/skills/app-builder/templates/astro-static/TEMPLATE.md +76 -0
- package/core/skills/app-builder/templates/chrome-extension/TEMPLATE.md +92 -0
- package/core/skills/app-builder/templates/cli-tool/TEMPLATE.md +88 -0
- package/core/skills/app-builder/templates/electron-desktop/TEMPLATE.md +88 -0
- package/core/skills/app-builder/templates/express-api/TEMPLATE.md +83 -0
- package/core/skills/app-builder/templates/flutter-app/TEMPLATE.md +90 -0
- package/core/skills/app-builder/templates/monorepo-turborepo/TEMPLATE.md +90 -0
- package/core/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +82 -0
- package/core/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +100 -0
- package/core/skills/app-builder/templates/nextjs-static/TEMPLATE.md +106 -0
- package/core/skills/app-builder/templates/nuxt-app/TEMPLATE.md +101 -0
- package/core/skills/app-builder/templates/python-fastapi/TEMPLATE.md +83 -0
- package/core/skills/app-builder/templates/react-native-app/TEMPLATE.md +93 -0
- package/core/skills/architecture/SKILL.md +55 -0
- package/core/skills/architecture/context-discovery.md +43 -0
- package/core/skills/architecture/examples.md +94 -0
- package/core/skills/architecture/pattern-selection.md +68 -0
- package/core/skills/architecture/patterns-reference.md +50 -0
- package/core/skills/architecture/trade-off-analysis.md +77 -0
- package/core/skills/atomic-design/SKILL.md +282 -0
- package/core/skills/atomic-design/references/classification-guide.md +132 -0
- package/core/skills/atomic-design/references/quality-checklist.md +60 -0
- package/core/skills/atomic-design/references/stacks/stack-blade.md +254 -0
- package/core/skills/atomic-design/references/stacks/stack-nextjs.md +272 -0
- package/core/skills/atomic-design/references/stacks/stack-react.md +239 -0
- package/core/skills/atomic-design/references/stacks/stack-vue.md +224 -0
- package/core/skills/bash-linux/SKILL.md +199 -0
- package/core/skills/behavioral-modes/SKILL.md +242 -0
- package/core/skills/brainstorming/SKILL.md +163 -0
- package/core/skills/brainstorming/dynamic-questioning.md +373 -0
- package/core/skills/checkpointing-patterns/SKILL.md +163 -0
- package/core/skills/clean-code/SKILL.md +201 -0
- package/core/skills/code-review-checklist/SKILL.md +109 -0
- package/core/skills/code-truth-validation/SKILL.md +149 -0
- package/core/skills/component-library-discovery/SKILL.md +154 -0
- package/core/skills/content-strategy/SKILL.md +222 -0
- package/core/skills/context-budget/SKILL.md +155 -0
- package/core/skills/context-gathering-patterns/SKILL.md +278 -0
- package/core/skills/cost-tracking/SKILL.md +206 -0
- package/core/skills/database-design/SKILL.md +52 -0
- package/core/skills/database-design/database-selection.md +43 -0
- package/core/skills/database-design/indexing.md +39 -0
- package/core/skills/database-design/migrations.md +48 -0
- package/core/skills/database-design/optimization.md +36 -0
- package/core/skills/database-design/orm-selection.md +30 -0
- package/core/skills/database-design/schema-design.md +56 -0
- package/core/skills/database-design/scripts/schema_validator.py +172 -0
- package/core/skills/deployment-procedures/SKILL.md +295 -0
- package/core/skills/design-md/README.md +34 -0
- package/core/skills/design-md/SKILL.md +172 -0
- package/core/skills/design-md/examples/DESIGN.md +154 -0
- package/core/skills/design-system-enforcement/SKILL.md +339 -0
- package/core/skills/doc.md +177 -0
- package/core/skills/document-registry/SKILL.md +130 -0
- package/core/skills/documentation-publishing/SKILL.md +174 -0
- package/core/skills/documentation-templates/SKILL.md +194 -0
- package/core/skills/enhance-prompt/README.md +34 -0
- package/core/skills/enhance-prompt/SKILL.md +204 -0
- package/core/skills/enhance-prompt/references/KEYWORDS.md +114 -0
- package/core/skills/frontend-design/SKILL.md +430 -0
- package/core/skills/frontend-design/animation-guide.md +331 -0
- package/core/skills/frontend-design/color-system.md +311 -0
- package/core/skills/frontend-design/decision-trees.md +418 -0
- package/core/skills/frontend-design/motion-graphics.md +306 -0
- package/core/skills/frontend-design/scripts/accessibility_checker.py +183 -0
- package/core/skills/frontend-design/scripts/ux_audit.py +722 -0
- package/core/skills/frontend-design/typography-system.md +345 -0
- package/core/skills/frontend-design/ux-psychology.md +541 -0
- package/core/skills/frontend-design/visual-effects.md +383 -0
- package/core/skills/game-development/2d-games/SKILL.md +119 -0
- package/core/skills/game-development/3d-games/SKILL.md +135 -0
- package/core/skills/game-development/SKILL.md +167 -0
- package/core/skills/game-development/game-art/SKILL.md +185 -0
- package/core/skills/game-development/game-audio/SKILL.md +190 -0
- package/core/skills/game-development/game-design/SKILL.md +129 -0
- package/core/skills/game-development/mobile-games/SKILL.md +108 -0
- package/core/skills/game-development/multiplayer/SKILL.md +132 -0
- package/core/skills/game-development/pc-games/SKILL.md +144 -0
- package/core/skills/game-development/vr-ar/SKILL.md +123 -0
- package/core/skills/game-development/web-games/SKILL.md +150 -0
- package/core/skills/geo-fundamentals/SKILL.md +156 -0
- package/core/skills/geo-fundamentals/scripts/geo_checker.py +289 -0
- package/core/skills/git-workflow/SKILL.md +263 -0
- package/core/skills/history-check-patterns/SKILL.md +125 -0
- package/core/skills/i18n-localization/SKILL.md +154 -0
- package/core/skills/i18n-localization/scripts/i18n_checker.py +241 -0
- package/core/skills/integration-completeness/SKILL.md +219 -0
- package/core/skills/intelligent-routing/SKILL.md +370 -0
- package/core/skills/lint-and-validate/SKILL.md +45 -0
- package/core/skills/lint-and-validate/scripts/lint_runner.py +173 -0
- package/core/skills/lint-and-validate/scripts/type_coverage.py +173 -0
- package/core/skills/local-verification/SKILL.md +195 -0
- package/core/skills/mcp-builder/SKILL.md +176 -0
- package/core/skills/mobile-design/SKILL.md +394 -0
- package/core/skills/mobile-design/decision-trees.md +516 -0
- package/core/skills/mobile-design/mobile-backend.md +491 -0
- package/core/skills/mobile-design/mobile-color-system.md +420 -0
- package/core/skills/mobile-design/mobile-debugging.md +122 -0
- package/core/skills/mobile-design/mobile-design-thinking.md +357 -0
- package/core/skills/mobile-design/mobile-navigation.md +458 -0
- package/core/skills/mobile-design/mobile-performance.md +767 -0
- package/core/skills/mobile-design/mobile-testing.md +356 -0
- package/core/skills/mobile-design/mobile-typography.md +433 -0
- package/core/skills/mobile-design/platform-android.md +666 -0
- package/core/skills/mobile-design/platform-ios.md +561 -0
- package/core/skills/mobile-design/scripts/mobile_audit.py +670 -0
- package/core/skills/mobile-design/touch-psychology.md +537 -0
- package/core/skills/nextjs-react-expert/1-async-eliminating-waterfalls.md +312 -0
- package/core/skills/nextjs-react-expert/2-bundle-bundle-size-optimization.md +240 -0
- package/core/skills/nextjs-react-expert/3-server-server-side-performance.md +490 -0
- package/core/skills/nextjs-react-expert/4-client-client-side-data-fetching.md +264 -0
- package/core/skills/nextjs-react-expert/5-rerender-re-render-optimization.md +581 -0
- package/core/skills/nextjs-react-expert/6-rendering-rendering-performance.md +432 -0
- package/core/skills/nextjs-react-expert/7-js-javascript-performance.md +684 -0
- package/core/skills/nextjs-react-expert/8-advanced-advanced-patterns.md +150 -0
- package/core/skills/nextjs-react-expert/SKILL.md +267 -0
- package/core/skills/nextjs-react-expert/scripts/convert_rules.py +222 -0
- package/core/skills/nextjs-react-expert/scripts/react_performance_checker.py +252 -0
- package/core/skills/nodejs-best-practices/SKILL.md +333 -0
- package/core/skills/notion-task-patterns/SKILL.md +2529 -0
- package/core/skills/page-specifications/SKILL.md +367 -0
- package/core/skills/parallel-agents/SKILL.md +175 -0
- package/core/skills/performance-profiling/SKILL.md +143 -0
- package/core/skills/performance-profiling/scripts/lighthouse_audit.py +76 -0
- package/core/skills/plan-writing/SKILL.md +190 -0
- package/core/skills/powershell-windows/SKILL.md +167 -0
- package/core/skills/project-foundation/SKILL.md +117 -0
- package/core/skills/project-setup/SKILL.md +141 -0
- package/core/skills/project-tracking-patterns/SKILL.md +357 -0
- package/core/skills/project-type-discovery/SKILL.md +239 -0
- package/core/skills/python-patterns/SKILL.md +441 -0
- package/core/skills/qa-test-generation/SKILL.md +156 -0
- package/core/skills/react-components/README.md +36 -0
- package/core/skills/react-components/SKILL.md +47 -0
- package/core/skills/react-components/examples/gold-standard-card.tsx +80 -0
- package/core/skills/react-components/package-lock.json +231 -0
- package/core/skills/react-components/package.json +16 -0
- package/core/skills/react-components/resources/architecture-checklist.md +15 -0
- package/core/skills/react-components/resources/component-template.tsx +37 -0
- package/core/skills/react-components/resources/stitch-api-reference.md +14 -0
- package/core/skills/react-components/resources/style-guide.json +27 -0
- package/core/skills/react-components/scripts/fetch-stitch.sh +30 -0
- package/core/skills/react-components/scripts/validate.js +68 -0
- package/core/skills/red-team-tactics/SKILL.md +199 -0
- package/core/skills/remotion/README.md +105 -0
- package/core/skills/remotion/SKILL.md +393 -0
- package/core/skills/remotion/examples/WalkthroughComposition.tsx +78 -0
- package/core/skills/remotion/examples/screens.json +56 -0
- package/core/skills/remotion/resources/composition-checklist.md +124 -0
- package/core/skills/remotion/resources/screen-slide-template.tsx +123 -0
- package/core/skills/remotion/scripts/download-stitch-asset.sh +38 -0
- package/core/skills/seo-fundamentals/SKILL.md +129 -0
- package/core/skills/seo-fundamentals/scripts/seo_checker.py +219 -0
- package/core/skills/server-management/SKILL.md +161 -0
- package/core/skills/session-resilience/SKILL.md +199 -0
- package/core/skills/shadcn-ui/README.md +248 -0
- package/core/skills/shadcn-ui/SKILL.md +326 -0
- package/core/skills/shadcn-ui/examples/auth-layout.tsx +177 -0
- package/core/skills/shadcn-ui/examples/data-table.tsx +313 -0
- package/core/skills/shadcn-ui/examples/form-pattern.tsx +177 -0
- package/core/skills/shadcn-ui/resources/component-catalog.md +481 -0
- package/core/skills/shadcn-ui/resources/customization-guide.md +516 -0
- package/core/skills/shadcn-ui/resources/migration-guide.md +463 -0
- package/core/skills/shadcn-ui/resources/setup-guide.md +412 -0
- package/core/skills/shadcn-ui/scripts/verify-setup.sh +134 -0
- package/core/skills/state-machine/SKILL.md +264 -0
- package/core/skills/stitch-loop/README.md +54 -0
- package/core/skills/stitch-loop/SKILL.md +203 -0
- package/core/skills/stitch-loop/examples/SITE.md +73 -0
- package/core/skills/stitch-loop/examples/next-prompt.md +25 -0
- package/core/skills/stitch-loop/resources/baton-schema.md +61 -0
- package/core/skills/stitch-loop/resources/site-template.md +104 -0
- package/core/skills/systematic-debugging/SKILL.md +109 -0
- package/core/skills/tailwind-patterns/SKILL.md +284 -0
- package/core/skills/tdd-validation/SKILL.md +243 -0
- package/core/skills/tdd-workflow/SKILL.md +284 -0
- package/core/skills/testing-patterns/SKILL.md +196 -0
- package/core/skills/testing-patterns/scripts/test_runner.py +219 -0
- package/core/skills/ui-ux-discovery/SKILL.md +329 -0
- package/core/skills/ui-validation/SKILL.md +190 -0
- package/core/skills/ui-validation/scripts/ui_antipattern_check.py +317 -0
- package/core/skills/verification-gate/SKILL.md +205 -0
- package/core/skills/vulnerability-scanner/SKILL.md +276 -0
- package/core/skills/vulnerability-scanner/checklists.md +121 -0
- package/core/skills/vulnerability-scanner/scripts/security_scan.py +458 -0
- package/core/skills/web-design-guidelines/SKILL.md +57 -0
- package/core/skills/webapp-testing/SKILL.md +187 -0
- package/core/skills/webapp-testing/scripts/playwright_runner.py +173 -0
- package/core/templates/ARCHITECTURE.template.md +407 -0
- package/core/templates/project-resources.example.json +71 -0
- package/core/workflows/atomic.md +182 -0
- package/core/workflows/brainstorm.md +134 -0
- package/core/workflows/check-task.md +242 -0
- package/core/workflows/copy-collect.md +306 -0
- package/core/workflows/create-agent.md +33 -0
- package/core/workflows/create-skill.md +39 -0
- package/core/workflows/create-workflow.md +33 -0
- package/core/workflows/create.md +92 -0
- package/core/workflows/debug.md +186 -0
- package/core/workflows/demand.md +443 -0
- package/core/workflows/deploy.md +260 -0
- package/core/workflows/discovery.md +267 -0
- package/core/workflows/document.md +272 -0
- package/core/workflows/ds-components.md +296 -0
- package/core/workflows/ds-init.md +58 -0
- package/core/workflows/ds-refactor.md +245 -0
- package/core/workflows/ds-references.md +197 -0
- package/core/workflows/ds-styleguide.md +237 -0
- package/core/workflows/ds-token-diff.md +103 -0
- package/core/workflows/ds-tokens.md +317 -0
- package/core/workflows/ds-validate.md +309 -0
- package/core/workflows/execute.md +483 -0
- package/core/workflows/extract-template.md +278 -0
- package/core/workflows/fix-failed-tests.md +160 -0
- package/core/workflows/init-project.md +386 -0
- package/core/workflows/legacy-project.md +849 -0
- package/core/workflows/log.md +97 -0
- package/core/workflows/new-project.md +610 -0
- package/core/workflows/new-project.md.bak +3292 -0
- package/core/workflows/new-task.md +404 -0
- package/core/workflows/orchestrate.md +237 -0
- package/core/workflows/page-build.md +296 -0
- package/core/workflows/plan.md +89 -0
- package/core/workflows/prd.md +255 -0
- package/core/workflows/preview.md +81 -0
- package/core/workflows/review-page.md +304 -0
- package/core/workflows/status.md +86 -0
- package/core/workflows/stitch.md +226 -0
- package/core/workflows/task-complete.md +473 -0
- package/core/workflows/task-update.md +163 -0
- package/core/workflows/tdd.md +344 -0
- package/core/workflows/test.md +251 -0
- package/core/workflows/ui-ux-pro-max.md +437 -0
- package/core/workflows/ux-mobile-optimize.md +262 -0
- package/core/workflows/ux-mobile-validate.md +297 -0
- package/engine-files/GEMINI.md +69 -0
- package/package.json +47 -0
- package/runtime-adapters/antigravity.js +26 -0
- package/runtime-adapters/claude.js +57 -0
- package/runtime-adapters/codex.js +51 -0
- package/runtime-adapters/copilot.js +51 -0
- package/runtime-adapters/cursor.js +51 -0
- package/runtime-adapters/gemini-cli.js +30 -0
- package/runtime-adapters/opencode.js +51 -0
- package/runtime-adapters/windsurf.js +51 -0
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ui-validation
|
|
3
|
+
description: Automated UI anti-pattern validation. Detects emojis as icons, missing cursor-pointer, contrast issues, and Design System violations. Use after implementing UI components and before marking styling complete.
|
|
4
|
+
allowed-tools: Read, Glob, Grep, Bash
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# UI Validation Skill
|
|
8
|
+
|
|
9
|
+
> **Purpose:** Automated detection of common UI anti-patterns that make interfaces look unprofessional.
|
|
10
|
+
> **When to Use:** After implementing UI components, before marking Phase complete.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## 🔴 Anti-Patterns Detected
|
|
15
|
+
|
|
16
|
+
| Anti-Pattern | Why It's Bad | Detection |
|
|
17
|
+
|--------------|--------------|-----------|
|
|
18
|
+
| **Emojis as icons** | Unprofessional, inconsistent sizing | Grep for common emojis |
|
|
19
|
+
| **Missing cursor-pointer** | Users don't know element is clickable | Check Links/Buttons |
|
|
20
|
+
| **Hardcoded colors** | Breaks Design System | Grep for hex codes |
|
|
21
|
+
| **Layout-shifting hovers** | Poor UX, janky feel | Check for scale transforms |
|
|
22
|
+
| **Missing transitions** | Abrupt state changes | Check for transition classes |
|
|
23
|
+
| **Wrong @theme syntax** | Tailwind classes won't work | Check globals.css |
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## ⚠️ Tailwind v4 @theme Validation
|
|
28
|
+
|
|
29
|
+
> [!CAUTION]
|
|
30
|
+
> **CRÍTICO:** Se cores/classes Tailwind não funcionam, verificar `globals.css`.
|
|
31
|
+
|
|
32
|
+
### Sintaxe Correta (Tailwind v4)
|
|
33
|
+
|
|
34
|
+
```css
|
|
35
|
+
/* ✅ CORRETO - Valores diretos dentro de @theme */
|
|
36
|
+
@theme {
|
|
37
|
+
--color-primary: #C6F135;
|
|
38
|
+
--color-bg-dark: #0F0F0F;
|
|
39
|
+
--font-sans: 'Plus Jakarta Sans', sans-serif;
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Sintaxe Incorreta
|
|
44
|
+
|
|
45
|
+
```css
|
|
46
|
+
/* ❌ ERRADO - Não usar :root + @theme inline com var() */
|
|
47
|
+
:root {
|
|
48
|
+
--color-primary: #C6F135;
|
|
49
|
+
}
|
|
50
|
+
@theme inline {
|
|
51
|
+
--color-primary: var(--color-primary); /* NÃO FUNCIONA */
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Verificação Manual
|
|
56
|
+
|
|
57
|
+
```powershell
|
|
58
|
+
# Verificar se globals.css usa @theme corretamente
|
|
59
|
+
Select-String -Path "src/app/globals.css" -Pattern "@theme inline"
|
|
60
|
+
# Se encontrar "@theme inline" → CORRIGIR para "@theme {}"
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## 🛠️ Usage
|
|
64
|
+
|
|
65
|
+
### Option 1: Run Script (Recommended)
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
python .agent/skills/ui-validation/scripts/ui_antipattern_check.py <project_path>
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
**Example:**
|
|
72
|
+
```bash
|
|
73
|
+
python .agent/skills/ui-validation/scripts/ui_antipattern_check.py .
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Option 2: Manual Commands (PowerShell)
|
|
77
|
+
|
|
78
|
+
```powershell
|
|
79
|
+
# 1. Emojis as icons (PROIBIDO)
|
|
80
|
+
Get-ChildItem -Path "src" -Recurse -Include "*.tsx","*.jsx" | Select-String -Pattern "[🔍⚡📊🎨🚀⚙️✨💡🔧📈📌🎯🏆💎🔥⭐🌟✅❌➡️⬅️🔴🟢🟡📁📂💻🖥️📱]"
|
|
81
|
+
|
|
82
|
+
# 2. Links sem cursor-pointer
|
|
83
|
+
Get-ChildItem -Path "src" -Recurse -Include "*.tsx","*.jsx" | Select-String -Pattern "<Link[^>]+>" | Where-Object { $_ -notmatch "cursor-pointer" -and $_ -notmatch "cursor:" }
|
|
84
|
+
|
|
85
|
+
# 3. Buttons sem cursor-pointer
|
|
86
|
+
Get-ChildItem -Path "src" -Recurse -Include "*.tsx","*.jsx" | Select-String -Pattern "<button[^>]+>" | Where-Object { $_ -notmatch "cursor-pointer" }
|
|
87
|
+
|
|
88
|
+
# 4. Hardcoded hex colors (should use CSS variables)
|
|
89
|
+
Get-ChildItem -Path "src" -Recurse -Include "*.tsx","*.jsx" | Select-String -Pattern '#[0-9A-Fa-f]{6}' | Where-Object { $_ -notmatch "shadow" }
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## 📋 Validation Checklist
|
|
95
|
+
|
|
96
|
+
### Visual Quality
|
|
97
|
+
- [ ] **No emojis as icons** - Use SVG (Heroicons, Lucide, Simple Icons)
|
|
98
|
+
- [ ] **Consistent icon set** - Don't mix icon libraries
|
|
99
|
+
- [ ] **Theme colors only** - No hardcoded hex values in components
|
|
100
|
+
|
|
101
|
+
### Interaction
|
|
102
|
+
- [ ] **cursor-pointer on clickables** - Links, buttons, cards with onClick
|
|
103
|
+
- [ ] **Hover feedback** - Visual change on interactive elements
|
|
104
|
+
- [ ] **Smooth transitions** - 150-300ms on state changes
|
|
105
|
+
- [ ] **Focus states visible** - For keyboard navigation
|
|
106
|
+
|
|
107
|
+
### Layout
|
|
108
|
+
- [ ] **No layout-shifting hovers** - Avoid scale transforms that move content
|
|
109
|
+
- [ ] **Responsive** - 375px, 768px, 1024px, 1440px breakpoints
|
|
110
|
+
- [ ] **No horizontal scroll** - On any device width
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## 🔧 Fixing Violations
|
|
115
|
+
|
|
116
|
+
### Emoji → SVG Icon
|
|
117
|
+
|
|
118
|
+
```tsx
|
|
119
|
+
// ❌ WRONG
|
|
120
|
+
<div className="icon">🔍</div>
|
|
121
|
+
|
|
122
|
+
// ✅ CORRECT
|
|
123
|
+
import { MagnifyingGlassIcon } from "@heroicons/react/24/outline";
|
|
124
|
+
<MagnifyingGlassIcon className="w-6 h-6" />
|
|
125
|
+
|
|
126
|
+
// Alternative: Lucide
|
|
127
|
+
import { Search } from "lucide-react";
|
|
128
|
+
<Search className="w-6 h-6" />
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### Missing cursor-pointer
|
|
132
|
+
|
|
133
|
+
```tsx
|
|
134
|
+
// ❌ WRONG
|
|
135
|
+
<Link href="/about">About</Link>
|
|
136
|
+
|
|
137
|
+
// ✅ CORRECT
|
|
138
|
+
<Link href="/about" className="cursor-pointer hover:text-primary transition-colors">
|
|
139
|
+
About
|
|
140
|
+
</Link>
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### Hardcoded Colors
|
|
144
|
+
|
|
145
|
+
```tsx
|
|
146
|
+
// ❌ WRONG
|
|
147
|
+
<div className="bg-[#C6F135]">...</div>
|
|
148
|
+
|
|
149
|
+
// ✅ CORRECT (using CSS variables via Tailwind)
|
|
150
|
+
<div className="bg-primary">...</div>
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
## 🔗 Workflow Integration
|
|
156
|
+
|
|
157
|
+
This skill is called by:
|
|
158
|
+
|
|
159
|
+
| Workflow | Phase | Trigger |
|
|
160
|
+
|----------|-------|---------|
|
|
161
|
+
| `/new-project` | Phase 5.3 Gate | Before marking UI Styling complete |
|
|
162
|
+
| `/new-task` | Fase 3.7 Gate | If feature has UI changes |
|
|
163
|
+
| `/legacy-project` | Phase 5.5 Gate | Before proceeding to tests |
|
|
164
|
+
| `/ui-ux-pro-max` | Final Validation | Pre-Delivery Checklist |
|
|
165
|
+
|
|
166
|
+
### How Workflows Should Call This Skill
|
|
167
|
+
|
|
168
|
+
```markdown
|
|
169
|
+
> [!CAUTION]
|
|
170
|
+
> **ANTES DE MARCAR COMPLETO:** Execute validação de UI.
|
|
171
|
+
> Skill: `ui-validation` → `python .agent/skills/ui-validation/scripts/ui_antipattern_check.py .`
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
## Scripts
|
|
177
|
+
|
|
178
|
+
| Script | Purpose | Usage |
|
|
179
|
+
|--------|---------|-------|
|
|
180
|
+
| `scripts/ui_antipattern_check.py` | Full UI validation | `python scripts/ui_antipattern_check.py <path>` |
|
|
181
|
+
|
|
182
|
+
---
|
|
183
|
+
|
|
184
|
+
## Related Skills
|
|
185
|
+
|
|
186
|
+
| Skill | Relationship |
|
|
187
|
+
|-------|--------------|
|
|
188
|
+
| `frontend-design` | Design principles (use BEFORE coding) |
|
|
189
|
+
| `web-design-guidelines` | Accessibility audit (use AFTER this) |
|
|
190
|
+
| `lint-and-validate` | Code quality (separate concern) |
|
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
UI Anti-Pattern Validation Script
|
|
4
|
+
Detects common UI issues that make interfaces look unprofessional.
|
|
5
|
+
|
|
6
|
+
Usage:
|
|
7
|
+
python ui_antipattern_check.py <project_path>
|
|
8
|
+
python ui_antipattern_check.py .
|
|
9
|
+
|
|
10
|
+
Exit codes:
|
|
11
|
+
0 - No violations found
|
|
12
|
+
1 - Violations found (blocks completion)
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
import os
|
|
16
|
+
import re
|
|
17
|
+
import sys
|
|
18
|
+
import io
|
|
19
|
+
from pathlib import Path
|
|
20
|
+
from typing import List, Tuple
|
|
21
|
+
|
|
22
|
+
# Fix encoding for Windows terminals
|
|
23
|
+
# encoding fix removed
|
|
24
|
+
|
|
25
|
+
# Common emojis used incorrectly as icons
|
|
26
|
+
EMOJI_PATTERN = r'[🔍⚡📊🎨🚀⚙️✨💡🔧📈📌🎯🏆💎🔥⭐🌟✅❌➡️⬅️🔴🟢🟡📁📂💻🖥️📱🎉💪🙌👋👍👎🤔💭📧📞🏠🔒🔓🛒💳📦🎁🔔🔕⚠️❗❓✏️🗑️📝📄🔗🌐🎵🎶📸🖼️🎬📹🎤🎧💾📀💿🖨️⌨️🖱️🔋🔌💰💵💸🏦📊📉📈🗓️📅⏰⏱️⌛⏳🔄🔃↩️↪️⬆️⬇️↔️↕️🔀🔁🔂▶️⏸️⏹️⏺️⏭️⏮️🔇🔈🔉🔊]'
|
|
27
|
+
|
|
28
|
+
# Hex color pattern (potential hardcoded colors)
|
|
29
|
+
HEX_COLOR_PATTERN = r'(?:bg-|text-|border-|fill-|stroke-)\[#[0-9A-Fa-f]{3,8}\]'
|
|
30
|
+
|
|
31
|
+
# File extensions to check
|
|
32
|
+
EXTENSIONS = ['.tsx', '.jsx', '.vue', '.svelte']
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
class Violation:
|
|
36
|
+
def __init__(self, file: str, line: int, content: str, violation_type: str, severity: str):
|
|
37
|
+
self.file = file
|
|
38
|
+
self.line = line
|
|
39
|
+
self.content = content.strip()[:100] # Truncate for readability
|
|
40
|
+
self.violation_type = violation_type
|
|
41
|
+
self.severity = severity
|
|
42
|
+
|
|
43
|
+
def __str__(self):
|
|
44
|
+
clean_content = self.content.encode('ascii', 'ignore').decode('ascii')
|
|
45
|
+
return f"VIOLATION|{self.file}|{self.line}|{self.violation_type}|{clean_content}"
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def find_files(project_path: str) -> List[Path]:
|
|
49
|
+
"""Find all relevant UI files in the project."""
|
|
50
|
+
files = []
|
|
51
|
+
for ext in EXTENSIONS:
|
|
52
|
+
files.extend(Path(project_path).rglob(f"*{ext}"))
|
|
53
|
+
|
|
54
|
+
# Exclude common directories
|
|
55
|
+
excluded = ['node_modules', '.next', 'dist', 'build', '.git', 'coverage']
|
|
56
|
+
return [f for f in files if not any(ex in str(f) for ex in excluded)]
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def check_emojis(file_path: Path) -> List[Violation]:
|
|
60
|
+
"""Check for emojis used as icons."""
|
|
61
|
+
violations = []
|
|
62
|
+
try:
|
|
63
|
+
with open(file_path, 'r', encoding='utf-8') as f:
|
|
64
|
+
for line_num, line in enumerate(f, 1):
|
|
65
|
+
# Skip comments and strings that might be content (not icons)
|
|
66
|
+
if '// ' in line and re.search(EMOJI_PATTERN, line.split('// ')[1] if len(line.split('// ')) > 1 else ''):
|
|
67
|
+
continue
|
|
68
|
+
|
|
69
|
+
# Check if emoji is used in JSX (likely as icon)
|
|
70
|
+
matches = re.findall(EMOJI_PATTERN, line)
|
|
71
|
+
if matches:
|
|
72
|
+
# Check if it's in a className or text content context
|
|
73
|
+
# Emojis in feature cards, icons, etc. are violations
|
|
74
|
+
if '<' in line or 'className' in line or 'Icon' not in line:
|
|
75
|
+
violations.append(Violation(
|
|
76
|
+
str(file_path),
|
|
77
|
+
line_num,
|
|
78
|
+
line,
|
|
79
|
+
"EMOJI_AS_ICON",
|
|
80
|
+
"ERROR"
|
|
81
|
+
))
|
|
82
|
+
except Exception as e:
|
|
83
|
+
print(f"Warning: Could not read {file_path}: {e}")
|
|
84
|
+
return violations
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
def check_cursor_pointer(file_path: Path) -> List[Violation]:
|
|
88
|
+
"""Check for missing cursor-pointer on interactive elements."""
|
|
89
|
+
violations = []
|
|
90
|
+
try:
|
|
91
|
+
with open(file_path, 'r', encoding='utf-8') as f:
|
|
92
|
+
content = f.read()
|
|
93
|
+
lines = content.split('\n')
|
|
94
|
+
|
|
95
|
+
for line_num, line in enumerate(lines, 1):
|
|
96
|
+
# Check Link elements without cursor-pointer
|
|
97
|
+
if '<Link' in line and 'className' in line:
|
|
98
|
+
if 'cursor-pointer' not in line and 'cursor:' not in line:
|
|
99
|
+
# Check if it's a simple navigation link (might be ok)
|
|
100
|
+
# but card-like Links should have cursor
|
|
101
|
+
if 'hover:' in line: # Has hover but no cursor
|
|
102
|
+
violations.append(Violation(
|
|
103
|
+
str(file_path),
|
|
104
|
+
line_num,
|
|
105
|
+
line,
|
|
106
|
+
"LINK_NO_CURSOR",
|
|
107
|
+
"WARNING"
|
|
108
|
+
))
|
|
109
|
+
|
|
110
|
+
# Check button elements
|
|
111
|
+
if '<button' in line.lower() and 'className' in line:
|
|
112
|
+
if 'cursor-pointer' not in line and 'cursor:' not in line:
|
|
113
|
+
# Buttons should always be obvious as clickable
|
|
114
|
+
violations.append(Violation(
|
|
115
|
+
str(file_path),
|
|
116
|
+
line_num,
|
|
117
|
+
line,
|
|
118
|
+
"BUTTON_NO_CURSOR",
|
|
119
|
+
"WARNING"
|
|
120
|
+
))
|
|
121
|
+
|
|
122
|
+
# Check div/article with onClick
|
|
123
|
+
if 'onClick=' in line and 'cursor-pointer' not in line:
|
|
124
|
+
violations.append(Violation(
|
|
125
|
+
str(file_path),
|
|
126
|
+
line_num,
|
|
127
|
+
line,
|
|
128
|
+
"CLICKABLE_NO_CURSOR",
|
|
129
|
+
"ERROR"
|
|
130
|
+
))
|
|
131
|
+
|
|
132
|
+
except Exception as e:
|
|
133
|
+
print(f"Warning: Could not read {file_path}: {e}")
|
|
134
|
+
return violations
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
def check_hardcoded_colors(file_path: Path) -> List[Violation]:
|
|
138
|
+
"""Check for hardcoded hex colors instead of CSS variables."""
|
|
139
|
+
violations = []
|
|
140
|
+
try:
|
|
141
|
+
with open(file_path, 'r', encoding='utf-8') as f:
|
|
142
|
+
for line_num, line in enumerate(f, 1):
|
|
143
|
+
matches = re.findall(HEX_COLOR_PATTERN, line)
|
|
144
|
+
if matches:
|
|
145
|
+
# Allow certain exceptions (shadows, specific overrides)
|
|
146
|
+
if 'shadow' not in line.lower():
|
|
147
|
+
violations.append(Violation(
|
|
148
|
+
str(file_path),
|
|
149
|
+
line_num,
|
|
150
|
+
line,
|
|
151
|
+
"HARDCODED_COLOR",
|
|
152
|
+
"WARNING"
|
|
153
|
+
))
|
|
154
|
+
except Exception as e:
|
|
155
|
+
print(f"Warning: Could not read {file_path}: {e}")
|
|
156
|
+
return violations
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
def check_transitions(file_path: Path) -> List[Violation]:
|
|
160
|
+
"""Check for hover states without transitions."""
|
|
161
|
+
violations = []
|
|
162
|
+
try:
|
|
163
|
+
with open(file_path, 'r', encoding='utf-8') as f:
|
|
164
|
+
for line_num, line in enumerate(f, 1):
|
|
165
|
+
# If element has hover state but no transition
|
|
166
|
+
if 'hover:' in line and 'className' in line:
|
|
167
|
+
if 'transition' not in line and 'duration-' not in line:
|
|
168
|
+
violations.append(Violation(
|
|
169
|
+
str(file_path),
|
|
170
|
+
line_num,
|
|
171
|
+
line,
|
|
172
|
+
"HOVER_NO_TRANSITION",
|
|
173
|
+
"INFO"
|
|
174
|
+
))
|
|
175
|
+
except Exception as e:
|
|
176
|
+
print(f"Warning: Could not read {file_path}: {e}")
|
|
177
|
+
return violations
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
def check_tailwind_theme(project_path: str) -> List[Violation]:
|
|
181
|
+
"""Check for incorrect Tailwind v4 @theme syntax in globals.css."""
|
|
182
|
+
violations = []
|
|
183
|
+
globals_paths = [
|
|
184
|
+
Path(project_path) / "src" / "app" / "globals.css",
|
|
185
|
+
Path(project_path) / "src" / "styles" / "globals.css",
|
|
186
|
+
Path(project_path) / "app" / "globals.css",
|
|
187
|
+
]
|
|
188
|
+
|
|
189
|
+
for globals_path in globals_paths:
|
|
190
|
+
if globals_path.exists():
|
|
191
|
+
try:
|
|
192
|
+
with open(globals_path, 'r', encoding='utf-8') as f:
|
|
193
|
+
content = f.read()
|
|
194
|
+
lines = content.split('\n')
|
|
195
|
+
|
|
196
|
+
for line_num, line in enumerate(lines, 1):
|
|
197
|
+
# Check for problematic @theme inline pattern
|
|
198
|
+
if '@theme inline' in line:
|
|
199
|
+
violations.append(Violation(
|
|
200
|
+
str(globals_path),
|
|
201
|
+
line_num,
|
|
202
|
+
line,
|
|
203
|
+
"THEME_INLINE_WRONG",
|
|
204
|
+
"ERROR"
|
|
205
|
+
))
|
|
206
|
+
|
|
207
|
+
# Check for var() inside @theme block (doesn't work in v4)
|
|
208
|
+
if 'var(--' in line and '@theme' in content[:content.find(line)]:
|
|
209
|
+
# Check if we're inside @theme block
|
|
210
|
+
theme_start = content.rfind('@theme', 0, content.find(line))
|
|
211
|
+
if theme_start != -1:
|
|
212
|
+
between = content[theme_start:content.find(line)]
|
|
213
|
+
if '{' in between and '}' not in between: # Inside @theme
|
|
214
|
+
violations.append(Violation(
|
|
215
|
+
str(globals_path),
|
|
216
|
+
line_num,
|
|
217
|
+
line,
|
|
218
|
+
"VAR_INSIDE_THEME",
|
|
219
|
+
"ERROR"
|
|
220
|
+
))
|
|
221
|
+
except Exception as e:
|
|
222
|
+
print(f"Warning: Could not read {globals_path}: {e}")
|
|
223
|
+
|
|
224
|
+
return violations
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
def main():
|
|
228
|
+
if len(sys.argv) < 2:
|
|
229
|
+
print("Usage: python ui_antipattern_check.py <project_path>")
|
|
230
|
+
print("Example: python ui_antipattern_check.py .")
|
|
231
|
+
sys.exit(1)
|
|
232
|
+
|
|
233
|
+
project_path = sys.argv[1]
|
|
234
|
+
|
|
235
|
+
if not os.path.exists(project_path):
|
|
236
|
+
print(f"Error: Path '{project_path}' does not exist")
|
|
237
|
+
sys.exit(1)
|
|
238
|
+
|
|
239
|
+
print("=" * 60)
|
|
240
|
+
print("UI ANTI-PATTERN VALIDATION")
|
|
241
|
+
print("=" * 60)
|
|
242
|
+
print(f"Scanning: {os.path.abspath(project_path)}")
|
|
243
|
+
print()
|
|
244
|
+
|
|
245
|
+
files = find_files(project_path)
|
|
246
|
+
print(f"Found {len(files)} UI files to check")
|
|
247
|
+
print()
|
|
248
|
+
|
|
249
|
+
all_violations: List[Violation] = []
|
|
250
|
+
|
|
251
|
+
# Run all checks
|
|
252
|
+
for file_path in files:
|
|
253
|
+
print(f"DEBUG: Checking {file_path}")
|
|
254
|
+
all_violations.extend(check_emojis(file_path))
|
|
255
|
+
all_violations.extend(check_cursor_pointer(file_path))
|
|
256
|
+
all_violations.extend(check_hardcoded_colors(file_path))
|
|
257
|
+
all_violations.extend(check_transitions(file_path))
|
|
258
|
+
|
|
259
|
+
# Check Tailwind theme config
|
|
260
|
+
all_violations.extend(check_tailwind_theme(project_path))
|
|
261
|
+
|
|
262
|
+
# Categorize violations
|
|
263
|
+
errors = [v for v in all_violations if v.severity == "ERROR"]
|
|
264
|
+
warnings = [v for v in all_violations if v.severity == "WARNING"]
|
|
265
|
+
infos = [v for v in all_violations if v.severity == "INFO"]
|
|
266
|
+
|
|
267
|
+
# Print results
|
|
268
|
+
if errors:
|
|
269
|
+
print("ERRORS (MUST FIX):")
|
|
270
|
+
print("-" * 40)
|
|
271
|
+
for v in errors:
|
|
272
|
+
print(f" {v}")
|
|
273
|
+
print()
|
|
274
|
+
|
|
275
|
+
if warnings:
|
|
276
|
+
print("WARNINGS (SHOULD FIX):")
|
|
277
|
+
print("-" * 40)
|
|
278
|
+
for v in warnings:
|
|
279
|
+
print(f" {v}")
|
|
280
|
+
print()
|
|
281
|
+
|
|
282
|
+
if infos:
|
|
283
|
+
print("INFO (CONSIDER):")
|
|
284
|
+
print("-" * 40)
|
|
285
|
+
for v in infos:
|
|
286
|
+
print(f" {v}")
|
|
287
|
+
print()
|
|
288
|
+
|
|
289
|
+
# Summary
|
|
290
|
+
print("=" * 60)
|
|
291
|
+
print("SUMMARY")
|
|
292
|
+
print("=" * 60)
|
|
293
|
+
print(f" Errors: {len(errors)}")
|
|
294
|
+
print(f" Warnings: {len(warnings)}")
|
|
295
|
+
print(f" Info: {len(infos)}")
|
|
296
|
+
print()
|
|
297
|
+
|
|
298
|
+
if errors:
|
|
299
|
+
print("VALIDATION FAILED - Fix errors before proceeding")
|
|
300
|
+
print()
|
|
301
|
+
print("Quick Fixes:")
|
|
302
|
+
print(" - EMOJI_AS_ICON: Replace with Heroicons or Lucide icons")
|
|
303
|
+
print(" - CLICKABLE_NO_CURSOR: Add cursor-pointer to className")
|
|
304
|
+
print(" - THEME_INLINE_WRONG: Use @theme {} not @theme inline")
|
|
305
|
+
print(" - VAR_INSIDE_THEME: Put values directly in @theme, not var()")
|
|
306
|
+
sys.exit(1)
|
|
307
|
+
elif warnings:
|
|
308
|
+
print("VALIDATION PASSED WITH WARNINGS")
|
|
309
|
+
print(" Consider fixing warnings for better UX")
|
|
310
|
+
sys.exit(0)
|
|
311
|
+
else:
|
|
312
|
+
print("VALIDATION PASSED - No issues found!")
|
|
313
|
+
sys.exit(0)
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
if __name__ == "__main__":
|
|
317
|
+
main()
|