up-cc 0.3.3 → 0.4.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/LICENSE +21 -0
- package/README.md +259 -49
- package/agents/up-api-tester.md +405 -0
- package/agents/up-arquiteto.md +461 -0
- package/agents/up-backend-specialist.md +158 -0
- package/agents/up-blind-validator.md +259 -0
- package/agents/up-clone-crawler.md +234 -0
- package/agents/up-clone-design-extractor.md +227 -0
- package/agents/up-clone-feature-mapper.md +225 -0
- package/agents/up-clone-prd-writer.md +169 -0
- package/agents/up-clone-verifier.md +227 -0
- package/agents/up-code-reviewer.md +225 -0
- package/agents/up-database-specialist.md +152 -0
- package/agents/up-devops-agent.md +203 -0
- package/agents/up-executor.md +45 -5
- package/agents/up-exhaustive-tester.md +348 -0
- package/agents/up-frontend-specialist.md +135 -0
- package/agents/up-product-analyst.md +192 -0
- package/agents/up-qa-agent.md +171 -0
- package/agents/up-requirements-validator.md +230 -0
- package/agents/up-security-reviewer.md +137 -0
- package/agents/up-system-designer.md +332 -0
- package/agents/up-technical-writer.md +188 -0
- package/agents/up-visual-critic.md +358 -0
- package/bin/up-tools.cjs +84 -2
- package/commands/clone-builder.md +67 -0
- package/commands/dashboard.md +48 -0
- package/commands/depurar.md +1 -1
- package/commands/mobile-first.md +71 -0
- package/commands/modo-builder.md +178 -0
- package/commands/ux-tester.md +63 -0
- package/package.json +1 -1
- package/references/blueprints/audit.md +29 -0
- package/references/blueprints/booking.md +49 -0
- package/references/blueprints/community.md +48 -0
- package/references/blueprints/crm.md +40 -0
- package/references/blueprints/dashboard.md +48 -0
- package/references/blueprints/data-management.md +42 -0
- package/references/blueprints/ecommerce.md +51 -0
- package/references/blueprints/marketplace.md +48 -0
- package/references/blueprints/notifications.md +32 -0
- package/references/blueprints/saas-users.md +50 -0
- package/references/blueprints/settings.md +31 -0
- package/references/engineering-principles.md +205 -0
- package/references/production-requirements.md +106 -0
- package/references/state-persistence.md +74 -0
- package/templates/builder-defaults.md +73 -0
- package/templates/delivery.md +279 -0
- package/templates/design-tokens.md +151 -0
- package/workflows/builder-e2e.md +501 -0
- package/workflows/builder.md +2248 -0
- package/workflows/clone-builder.md +320 -0
- package/workflows/executar-fase.md +28 -2
- package/workflows/executar-plano.md +404 -6
- package/workflows/mobile-first.md +692 -0
- package/workflows/novo-projeto.md +22 -0
- package/workflows/rapido.md +1 -1
- package/workflows/ux-tester.md +500 -0
|
@@ -0,0 +1,692 @@
|
|
|
1
|
+
<purpose>
|
|
2
|
+
Mobile First: abrir o sistema no browser, testar em multiplos viewports, identificar o que quebra no mobile/tablet e corrigir automaticamente SEM mexer na experiencia desktop.
|
|
3
|
+
|
|
4
|
+
Desktop e a referencia sagrada. Cada fix mobile e verificado contra desktop: se desktop mudou, reverte.
|
|
5
|
+
|
|
6
|
+
Dois modos:
|
|
7
|
+
- **Standalone:** `/up:mobile-first` — roda em qualquer projeto, qualquer momento
|
|
8
|
+
- **Builder:** roda no Estagio 4 (Polish) automaticamente
|
|
9
|
+
</purpose>
|
|
10
|
+
|
|
11
|
+
<golden_rule>
|
|
12
|
+
## Regra de Ouro: Desktop e Sagrado
|
|
13
|
+
|
|
14
|
+
TODA correcao mobile segue este protocolo:
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
1. Screenshot desktop ANTES (referencia)
|
|
18
|
+
2. Snapshot desktop ANTES (estrutura de referencia)
|
|
19
|
+
3. Aplicar fix
|
|
20
|
+
4. Screenshot + snapshot mobile → melhorou?
|
|
21
|
+
NAO → reverter, tentar outra abordagem
|
|
22
|
+
5. Screenshot + snapshot desktop → IGUAL a referencia?
|
|
23
|
+
SIM → commit
|
|
24
|
+
NAO → git checkout -- [arquivos] → tentar abordagem diferente (max 3 tentativas)
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Se apos 3 tentativas nao conseguir corrigir mobile sem afetar desktop: registrar como "necessita refatoracao manual" e seguir.
|
|
28
|
+
</golden_rule>
|
|
29
|
+
|
|
30
|
+
<tools_required>
|
|
31
|
+
Ferramentas Playwright MCP:
|
|
32
|
+
- `browser_navigate` — navegar para URL
|
|
33
|
+
- `browser_snapshot` — capturar acessibilidade (verificar estrutura)
|
|
34
|
+
- `browser_take_screenshot` — capturar visual (comparar antes/depois)
|
|
35
|
+
- `browser_click` — clicar
|
|
36
|
+
- `browser_type` — digitar
|
|
37
|
+
- `browser_fill_form` — preencher formularios
|
|
38
|
+
- `browser_hover` — hover
|
|
39
|
+
- `browser_resize` — CRITICO: mudar viewport
|
|
40
|
+
- `browser_evaluate` — detectar overflow, elementos fora da tela
|
|
41
|
+
- `browser_console_messages` — erros JS
|
|
42
|
+
- `browser_close` — fechar
|
|
43
|
+
|
|
44
|
+
Ferramentas de codigo:
|
|
45
|
+
- Read, Write, Edit, Glob, Grep, Bash — para implementar correcoes
|
|
46
|
+
</tools_required>
|
|
47
|
+
|
|
48
|
+
<viewports>
|
|
49
|
+
## Viewports de Teste
|
|
50
|
+
|
|
51
|
+
| Nome | Width | Height | Representa |
|
|
52
|
+
|------|-------|--------|------------|
|
|
53
|
+
| mobile-se | 375 | 667 | iPhone SE |
|
|
54
|
+
| mobile | 390 | 844 | iPhone 14 |
|
|
55
|
+
| mobile-android | 412 | 915 | Android medio |
|
|
56
|
+
| tablet | 768 | 1024 | iPad |
|
|
57
|
+
| tablet-landscape | 1024 | 768 | iPad landscape |
|
|
58
|
+
| desktop | 1280 | 800 | Laptop |
|
|
59
|
+
| desktop-wide | 1920 | 1080 | Monitor full HD |
|
|
60
|
+
|
|
61
|
+
**Viewport principal de teste:** mobile (390x844) — se funciona aqui, funciona nos outros.
|
|
62
|
+
**Viewport de verificacao desktop:** desktop-wide (1920x1080) — referencia sagrada.
|
|
63
|
+
**Extras testados no scan:** todos os acima para relatorio completo.
|
|
64
|
+
</viewports>
|
|
65
|
+
|
|
66
|
+
<process>
|
|
67
|
+
|
|
68
|
+
## Passo 1: Setup
|
|
69
|
+
|
|
70
|
+
### 1.1 Detectar Stack CSS
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
# Detectar framework CSS
|
|
74
|
+
if [ -f tailwind.config.js ] || [ -f tailwind.config.ts ]; then
|
|
75
|
+
echo "TAILWIND"
|
|
76
|
+
elif grep -q "styled-components\|@emotion" package.json 2>/dev/null; then
|
|
77
|
+
echo "CSS_IN_JS"
|
|
78
|
+
elif ls src/**/*.module.css 2>/dev/null | head -1; then
|
|
79
|
+
echo "CSS_MODULES"
|
|
80
|
+
else
|
|
81
|
+
echo "CSS_PLAIN"
|
|
82
|
+
fi
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Definir `$CSS_STACK` = tailwind | css_in_js | css_modules | css_plain
|
|
86
|
+
|
|
87
|
+
**Ler config do Tailwind (se existir):**
|
|
88
|
+
```bash
|
|
89
|
+
cat tailwind.config.* 2>/dev/null | head -30
|
|
90
|
+
```
|
|
91
|
+
Extrair breakpoints customizados (screens: { sm, md, lg, xl }).
|
|
92
|
+
|
|
93
|
+
### 1.2 Subir Dev Server
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
# Detectar e subir (mesmo processo dos outros workflows)
|
|
97
|
+
if [ -f package.json ]; then
|
|
98
|
+
node -e "const p=require('./package.json'); console.log(JSON.stringify(p.scripts||{}))"
|
|
99
|
+
fi
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Subir em background, esperar ate 30s.
|
|
103
|
+
|
|
104
|
+
### 1.3 Descobrir Paginas
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
# Next.js App Router
|
|
108
|
+
find app -name "page.tsx" -o -name "page.ts" 2>/dev/null | grep -v node_modules | head -30
|
|
109
|
+
|
|
110
|
+
# Next.js Pages Router
|
|
111
|
+
find pages -name "*.tsx" -o -name "*.ts" 2>/dev/null | grep -v node_modules | grep -v "_app\|_document" | head -30
|
|
112
|
+
|
|
113
|
+
# Vite/React (routes)
|
|
114
|
+
grep -r "path:" src/ --include="*.tsx" --include="*.ts" 2>/dev/null | head -20
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Se `--page` foi especificado: testar apenas essa pagina.
|
|
118
|
+
|
|
119
|
+
### 1.4 Criar Diretorios
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
mkdir -p .plano/mobile-review/screenshots/desktop .plano/mobile-review/screenshots/mobile .plano/mobile-review/screenshots/tablet .plano/mobile-review/screenshots/fixes
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## Passo 2: SCAN — Mapear Estado Atual
|
|
126
|
+
|
|
127
|
+
### 2.1 Capturar Referencia Desktop
|
|
128
|
+
|
|
129
|
+
Para cada pagina:
|
|
130
|
+
|
|
131
|
+
```
|
|
132
|
+
browser_resize(width: 1920, height: 1080)
|
|
133
|
+
browser_navigate(url: "$BASE_URL/[rota]")
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Esperar 2s para carregamento completo.
|
|
137
|
+
|
|
138
|
+
```
|
|
139
|
+
browser_take_screenshot(
|
|
140
|
+
type: "png",
|
|
141
|
+
filename: ".plano/mobile-review/screenshots/desktop/[rota-slug].png"
|
|
142
|
+
)
|
|
143
|
+
browser_snapshot(
|
|
144
|
+
filename: ".plano/mobile-review/screenshots/desktop/[rota-slug]-snapshot.md"
|
|
145
|
+
)
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
**Salvar snapshot desktop como REFERENCIA** — sera comparado depois de cada fix.
|
|
149
|
+
|
|
150
|
+
### 2.2 Capturar Mobile
|
|
151
|
+
|
|
152
|
+
```
|
|
153
|
+
browser_resize(width: 390, height: 844)
|
|
154
|
+
browser_navigate(url: "$BASE_URL/[rota]")
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
```
|
|
158
|
+
browser_take_screenshot(
|
|
159
|
+
type: "png",
|
|
160
|
+
filename: ".plano/mobile-review/screenshots/mobile/[rota-slug].png"
|
|
161
|
+
)
|
|
162
|
+
browser_snapshot(
|
|
163
|
+
filename: ".plano/mobile-review/screenshots/mobile/[rota-slug]-snapshot.md"
|
|
164
|
+
)
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
### 2.3 Capturar Tablet
|
|
168
|
+
|
|
169
|
+
```
|
|
170
|
+
browser_resize(width: 768, height: 1024)
|
|
171
|
+
browser_navigate(url: "$BASE_URL/[rota]")
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
```
|
|
175
|
+
browser_take_screenshot(
|
|
176
|
+
type: "png",
|
|
177
|
+
filename: ".plano/mobile-review/screenshots/tablet/[rota-slug].png"
|
|
178
|
+
)
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
### 2.4 Detectar Problemas por Pagina
|
|
182
|
+
|
|
183
|
+
Para cada pagina no viewport mobile (390x844):
|
|
184
|
+
|
|
185
|
+
**A. Overflow horizontal:**
|
|
186
|
+
```javascript
|
|
187
|
+
browser_evaluate(function: "() => {
|
|
188
|
+
const hasOverflow = document.documentElement.scrollWidth > document.documentElement.clientWidth;
|
|
189
|
+
const overflowPx = document.documentElement.scrollWidth - document.documentElement.clientWidth;
|
|
190
|
+
return JSON.stringify({ hasOverflow, overflowPx });
|
|
191
|
+
}")
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
**B. Elementos fora da viewport:**
|
|
195
|
+
```javascript
|
|
196
|
+
browser_evaluate(function: "() => {
|
|
197
|
+
const vw = window.innerWidth;
|
|
198
|
+
const issues = [];
|
|
199
|
+
document.querySelectorAll('*').forEach(el => {
|
|
200
|
+
const rect = el.getBoundingClientRect();
|
|
201
|
+
if (rect.width > 0 && rect.height > 0) {
|
|
202
|
+
if (rect.right > vw + 5) {
|
|
203
|
+
issues.push({
|
|
204
|
+
tag: el.tagName.toLowerCase(),
|
|
205
|
+
class: (el.className || '').toString().slice(0, 80),
|
|
206
|
+
id: el.id || '',
|
|
207
|
+
width: Math.round(rect.width),
|
|
208
|
+
overflow: Math.round(rect.right - vw)
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
return JSON.stringify(issues.slice(0, 30));
|
|
214
|
+
}")
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
**C. Texto ilegivel (muito pequeno):**
|
|
218
|
+
```javascript
|
|
219
|
+
browser_evaluate(function: "() => {
|
|
220
|
+
const issues = [];
|
|
221
|
+
document.querySelectorAll('p, span, a, li, td, th, label, input, button, h1, h2, h3, h4, h5, h6').forEach(el => {
|
|
222
|
+
const style = getComputedStyle(el);
|
|
223
|
+
const fontSize = parseFloat(style.fontSize);
|
|
224
|
+
if (fontSize > 0 && fontSize < 12 && el.textContent.trim().length > 0) {
|
|
225
|
+
issues.push({
|
|
226
|
+
tag: el.tagName.toLowerCase(),
|
|
227
|
+
text: el.textContent.trim().slice(0, 40),
|
|
228
|
+
fontSize: fontSize,
|
|
229
|
+
class: (el.className || '').toString().slice(0, 60)
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
});
|
|
233
|
+
return JSON.stringify(issues.slice(0, 20));
|
|
234
|
+
}")
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
**D. Alvos de toque muito pequenos:**
|
|
238
|
+
```javascript
|
|
239
|
+
browser_evaluate(function: "() => {
|
|
240
|
+
const issues = [];
|
|
241
|
+
document.querySelectorAll('a, button, input, select, textarea, [role=button], [onclick]').forEach(el => {
|
|
242
|
+
const rect = el.getBoundingClientRect();
|
|
243
|
+
if (rect.width > 0 && rect.height > 0) {
|
|
244
|
+
if (rect.width < 44 || rect.height < 44) {
|
|
245
|
+
issues.push({
|
|
246
|
+
tag: el.tagName.toLowerCase(),
|
|
247
|
+
text: (el.textContent || el.value || '').trim().slice(0, 30),
|
|
248
|
+
width: Math.round(rect.width),
|
|
249
|
+
height: Math.round(rect.height),
|
|
250
|
+
class: (el.className || '').toString().slice(0, 60)
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
});
|
|
255
|
+
return JSON.stringify(issues.slice(0, 20));
|
|
256
|
+
}")
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
**E. Overlapping/sobreposicao:**
|
|
260
|
+
```javascript
|
|
261
|
+
browser_evaluate(function: "() => {
|
|
262
|
+
const issues = [];
|
|
263
|
+
const interactive = document.querySelectorAll('a, button, input, [role=button]');
|
|
264
|
+
const rects = Array.from(interactive).map(el => ({
|
|
265
|
+
el: el.tagName + '.' + (el.className || '').toString().slice(0, 30),
|
|
266
|
+
rect: el.getBoundingClientRect()
|
|
267
|
+
})).filter(r => r.rect.width > 0);
|
|
268
|
+
for (let i = 0; i < rects.length; i++) {
|
|
269
|
+
for (let j = i + 1; j < rects.length; j++) {
|
|
270
|
+
const a = rects[i].rect, b = rects[j].rect;
|
|
271
|
+
if (a.left < b.right && a.right > b.left && a.top < b.bottom && a.bottom > b.top) {
|
|
272
|
+
issues.push({ el1: rects[i].el, el2: rects[j].el });
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
return JSON.stringify(issues.slice(0, 10));
|
|
277
|
+
}")
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
**F. Checar console por erros:**
|
|
281
|
+
```
|
|
282
|
+
browser_console_messages(level: "error")
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
### 2.5 Compilar Lista de Problemas
|
|
286
|
+
|
|
287
|
+
Para cada pagina, classificar problemas encontrados:
|
|
288
|
+
|
|
289
|
+
| Severidade | Criterio |
|
|
290
|
+
|-----------|---------|
|
|
291
|
+
| **Critico** | Pagina inutilizavel (overflow total, conteudo invisivel, form inacessivel) |
|
|
292
|
+
| **Grave** | Funcionalidade comprometida (botao inatingivel, texto cortado, navegacao quebrada) |
|
|
293
|
+
| **Moderado** | Experiencia ruim (espacamento errado, fonte pequena, alvo de toque pequeno) |
|
|
294
|
+
| **Menor** | Cosmetico (alinhamento, margem, visual) |
|
|
295
|
+
|
|
296
|
+
## Passo 3: ANALYZE — Entender o Codigo
|
|
297
|
+
|
|
298
|
+
### 3.1 Mapear Problema → Arquivo
|
|
299
|
+
|
|
300
|
+
Para cada problema detectado:
|
|
301
|
+
|
|
302
|
+
1. Identificar o componente/elemento pelo snapshot (tag, class, id)
|
|
303
|
+
2. Buscar no codigo:
|
|
304
|
+
```bash
|
|
305
|
+
# Buscar por className ou componente
|
|
306
|
+
grep -r "[classe-do-elemento]" src/ --include="*.tsx" --include="*.ts" --include="*.css" | head -10
|
|
307
|
+
```
|
|
308
|
+
3. Ler o arquivo fonte
|
|
309
|
+
4. Analisar estilos atuais (tem responsive? media queries? classes Tailwind responsive?)
|
|
310
|
+
|
|
311
|
+
### 3.2 Determinar Estrategia de Fix
|
|
312
|
+
|
|
313
|
+
**Tailwind:**
|
|
314
|
+
- Priorizar classes responsivas existentes: `sm:`, `md:`, `lg:`
|
|
315
|
+
- Mobile-first approach: estilo base = mobile, breakpoints = desktop
|
|
316
|
+
- Classes comuns: `w-full md:w-1/2`, `flex-col md:flex-row`, `text-sm md:text-base`
|
|
317
|
+
- `hidden md:block` / `md:hidden` para show/hide por viewport
|
|
318
|
+
|
|
319
|
+
**CSS Modules / CSS puro:**
|
|
320
|
+
- Adicionar media queries: `@media (max-width: 768px) { ... }`
|
|
321
|
+
- Priorizar min-width (mobile-first): `@media (min-width: 768px) { ... }` para desktop
|
|
322
|
+
|
|
323
|
+
**CSS-in-JS:**
|
|
324
|
+
- Adicionar media queries inline ou via theme breakpoints
|
|
325
|
+
|
|
326
|
+
### 3.3 Plano de Correcoes
|
|
327
|
+
|
|
328
|
+
Criar lista ordenada por severidade:
|
|
329
|
+
|
|
330
|
+
```
|
|
331
|
+
MOB-001 [critico] /dashboard — overflow horizontal (tabela de 1200px sem scroll)
|
|
332
|
+
→ Arquivo: src/components/DataTable.tsx
|
|
333
|
+
→ Fix: adicionar overflow-x-auto no container, max-w-full
|
|
334
|
+
|
|
335
|
+
MOB-002 [grave] /settings — form com inputs lado a lado (nao cabem)
|
|
336
|
+
→ Arquivo: src/app/settings/page.tsx
|
|
337
|
+
→ Fix: flex-col sm:flex-row nos form groups
|
|
338
|
+
|
|
339
|
+
MOB-003 [moderado] /home — hero image distorcida
|
|
340
|
+
→ Arquivo: src/components/Hero.tsx
|
|
341
|
+
→ Fix: object-cover + h-auto + max-w-full
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
## Passo 4: FIX — Corrigir Mobile (Sem Quebrar Desktop)
|
|
345
|
+
|
|
346
|
+
**NAO corrigir se flag `--no-fix` estiver presente. Pular para Passo 5.**
|
|
347
|
+
|
|
348
|
+
Para cada problema (ordenado: critico → grave → moderado → menor):
|
|
349
|
+
|
|
350
|
+
### 4.1 Capturar Referencia Desktop (Pre-Fix)
|
|
351
|
+
|
|
352
|
+
```
|
|
353
|
+
browser_resize(width: 1920, height: 1080)
|
|
354
|
+
browser_navigate(url: "$BASE_URL/[rota-do-problema]")
|
|
355
|
+
browser_take_screenshot(
|
|
356
|
+
type: "png",
|
|
357
|
+
filename: ".plano/mobile-review/screenshots/fixes/MOB-[NNN]-desktop-antes.png"
|
|
358
|
+
)
|
|
359
|
+
browser_snapshot()
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
Salvar snapshot como `$DESKTOP_REFERENCE`.
|
|
363
|
+
|
|
364
|
+
### 4.2 Implementar Fix
|
|
365
|
+
|
|
366
|
+
Ler arquivo alvo → aplicar correcao.
|
|
367
|
+
|
|
368
|
+
**Estrategias por tipo de problema:**
|
|
369
|
+
|
|
370
|
+
**Overflow horizontal:**
|
|
371
|
+
```
|
|
372
|
+
# Tailwind
|
|
373
|
+
<div className="overflow-x-auto"> ← container com scroll
|
|
374
|
+
<table className="min-w-full"> ← tabela full width
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
```
|
|
378
|
+
# CSS
|
|
379
|
+
.table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
**Grid/Flex nao responsivo:**
|
|
383
|
+
```
|
|
384
|
+
# Tailwind (antes)
|
|
385
|
+
<div className="grid grid-cols-3 gap-4">
|
|
386
|
+
|
|
387
|
+
# Tailwind (depois)
|
|
388
|
+
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4">
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
**Sidebar fixa:**
|
|
392
|
+
```
|
|
393
|
+
# Adicionar drawer/overlay no mobile
|
|
394
|
+
<aside className="hidden md:block md:w-64"> ← desktop: sidebar visivel
|
|
395
|
+
<Sheet>...</Sheet> ← mobile: drawer
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
**Navegacao:**
|
|
399
|
+
```
|
|
400
|
+
# Desktop: nav horizontal
|
|
401
|
+
<nav className="hidden md:flex gap-4">...</nav>
|
|
402
|
+
|
|
403
|
+
# Mobile: hamburger menu
|
|
404
|
+
<Sheet>
|
|
405
|
+
<SheetTrigger className="md:hidden">
|
|
406
|
+
<Menu />
|
|
407
|
+
</SheetTrigger>
|
|
408
|
+
<SheetContent>...</SheetContent>
|
|
409
|
+
</Sheet>
|
|
410
|
+
```
|
|
411
|
+
|
|
412
|
+
**Texto/fonte:**
|
|
413
|
+
```
|
|
414
|
+
# Tailwind
|
|
415
|
+
<h1 className="text-2xl md:text-4xl">
|
|
416
|
+
<p className="text-sm md:text-base">
|
|
417
|
+
```
|
|
418
|
+
|
|
419
|
+
**Espacamento:**
|
|
420
|
+
```
|
|
421
|
+
# Tailwind
|
|
422
|
+
<div className="p-4 md:p-8">
|
|
423
|
+
<section className="my-4 md:my-8">
|
|
424
|
+
```
|
|
425
|
+
|
|
426
|
+
**Imagens:**
|
|
427
|
+
```
|
|
428
|
+
<img className="w-full h-auto max-w-full object-cover" />
|
|
429
|
+
```
|
|
430
|
+
|
|
431
|
+
**Modais:**
|
|
432
|
+
```
|
|
433
|
+
# Fullscreen no mobile, dialog no desktop
|
|
434
|
+
<Dialog>
|
|
435
|
+
<DialogContent className="w-full h-full sm:w-auto sm:h-auto sm:max-w-lg">
|
|
436
|
+
```
|
|
437
|
+
|
|
438
|
+
### 4.3 Verificar Mobile
|
|
439
|
+
|
|
440
|
+
```
|
|
441
|
+
browser_resize(width: 390, height: 844)
|
|
442
|
+
browser_navigate(url: "$BASE_URL/[rota]")
|
|
443
|
+
browser_take_screenshot(
|
|
444
|
+
type: "png",
|
|
445
|
+
filename: ".plano/mobile-review/screenshots/fixes/MOB-[NNN]-mobile-depois.png"
|
|
446
|
+
)
|
|
447
|
+
```
|
|
448
|
+
|
|
449
|
+
Re-rodar deteccao especifica do problema:
|
|
450
|
+
- Se era overflow: checar `scrollWidth > clientWidth`
|
|
451
|
+
- Se era texto pequeno: checar fontSize
|
|
452
|
+
- Se era alvo pequeno: checar dimensoes
|
|
453
|
+
|
|
454
|
+
**Se mobile NAO melhorou:** Reverter e tentar abordagem diferente.
|
|
455
|
+
|
|
456
|
+
### 4.4 Verificar Desktop (CRITICO)
|
|
457
|
+
|
|
458
|
+
```
|
|
459
|
+
browser_resize(width: 1920, height: 1080)
|
|
460
|
+
browser_navigate(url: "$BASE_URL/[rota]")
|
|
461
|
+
browser_take_screenshot(
|
|
462
|
+
type: "png",
|
|
463
|
+
filename: ".plano/mobile-review/screenshots/fixes/MOB-[NNN]-desktop-depois.png"
|
|
464
|
+
)
|
|
465
|
+
browser_snapshot()
|
|
466
|
+
```
|
|
467
|
+
|
|
468
|
+
**Comparar snapshot com `$DESKTOP_REFERENCE`:**
|
|
469
|
+
- Estrutura de elementos: mesmos elementos presentes?
|
|
470
|
+
- Layout: mesmo numero de colunas/linhas?
|
|
471
|
+
- Navegacao: mesmos items visiveis?
|
|
472
|
+
|
|
473
|
+
**Se desktop MUDOU de forma indesejada:**
|
|
474
|
+
```bash
|
|
475
|
+
git checkout -- [arquivos modificados]
|
|
476
|
+
```
|
|
477
|
+
Tentar abordagem diferente (max 3 tentativas por problema).
|
|
478
|
+
|
|
479
|
+
### 4.5 Commit
|
|
480
|
+
|
|
481
|
+
Se mobile melhorou E desktop intacto:
|
|
482
|
+
|
|
483
|
+
```bash
|
|
484
|
+
node "$HOME/.claude/up/bin/up-tools.cjs" commit "responsive(MOB-[NNN]): [descricao curta]" --files [arquivos]
|
|
485
|
+
```
|
|
486
|
+
|
|
487
|
+
### 4.6 Proximo Problema
|
|
488
|
+
|
|
489
|
+
Repetir 4.1-4.5 para o proximo problema.
|
|
490
|
+
|
|
491
|
+
## Passo 5: REPORT — Relatorio
|
|
492
|
+
|
|
493
|
+
Criar `.plano/mobile-review/MOBILE-REPORT.md`:
|
|
494
|
+
|
|
495
|
+
```markdown
|
|
496
|
+
---
|
|
497
|
+
tested: [timestamp]
|
|
498
|
+
server: [dev command] @ [port]
|
|
499
|
+
css_stack: [tailwind/css_modules/css_plain/css_in_js]
|
|
500
|
+
pages_tested: [N]
|
|
501
|
+
problems_found: [N]
|
|
502
|
+
problems_fixed: [N]
|
|
503
|
+
problems_failed: [N]
|
|
504
|
+
---
|
|
505
|
+
|
|
506
|
+
# Relatorio Mobile First
|
|
507
|
+
|
|
508
|
+
## Resumo
|
|
509
|
+
|
|
510
|
+
**Score de Responsividade:** [1-10]
|
|
511
|
+
(1=totalmente quebrado, 10=experiencia mobile impecavel)
|
|
512
|
+
|
|
513
|
+
| Viewport | Paginas OK | Paginas com Problemas |
|
|
514
|
+
|----------|-----------|----------------------|
|
|
515
|
+
| Mobile (390px) | [N] | [N] |
|
|
516
|
+
| Tablet (768px) | [N] | [N] |
|
|
517
|
+
| Desktop (1920px) | [N] (referencia) | -- |
|
|
518
|
+
|
|
519
|
+
## Problemas por Pagina
|
|
520
|
+
|
|
521
|
+
### /[rota]
|
|
522
|
+
|
|
523
|
+
| ID | Severidade | Problema | Status | Screenshot |
|
|
524
|
+
|----|-----------|---------|--------|------------|
|
|
525
|
+
| MOB-001 | Critico | Overflow horizontal | Corrigido | fixes/MOB-001-*.png |
|
|
526
|
+
| MOB-002 | Grave | Form nao cabe | Corrigido | fixes/MOB-002-*.png |
|
|
527
|
+
| MOB-003 | Moderado | Fonte pequena | Nao corrigido (quebraria desktop) | -- |
|
|
528
|
+
|
|
529
|
+
## Correcoes Implementadas
|
|
530
|
+
|
|
531
|
+
| ID | Problema | Arquivo(s) | O que foi feito | Commit |
|
|
532
|
+
|----|---------|-----------|----------------|--------|
|
|
533
|
+
| MOB-001 | Overflow tabela | DataTable.tsx | overflow-x-auto + max-w-full | [hash] |
|
|
534
|
+
| MOB-002 | Form horizontal | settings/page.tsx | flex-col sm:flex-row | [hash] |
|
|
535
|
+
|
|
536
|
+
## Antes vs Depois
|
|
537
|
+
|
|
538
|
+
### MOB-001: Overflow da Tabela
|
|
539
|
+
| Desktop Antes | Desktop Depois | Mobile Antes | Mobile Depois |
|
|
540
|
+
|--------------|---------------|-------------|--------------|
|
|
541
|
+
| fixes/MOB-001-desktop-antes.png | fixes/MOB-001-desktop-depois.png | mobile/dashboard.png | fixes/MOB-001-mobile-depois.png |
|
|
542
|
+
|
|
543
|
+
## Nao Corrigidos
|
|
544
|
+
|
|
545
|
+
| ID | Problema | Motivo |
|
|
546
|
+
|----|---------|--------|
|
|
547
|
+
| MOB-003 | [desc] | Todas tentativas quebraram desktop |
|
|
548
|
+
|
|
549
|
+
## Screenshots Comparativos (Todas Paginas)
|
|
550
|
+
|
|
551
|
+
| Pagina | Desktop | Tablet | Mobile |
|
|
552
|
+
|--------|---------|--------|--------|
|
|
553
|
+
| / | desktop/index.png | tablet/index.png | mobile/index.png |
|
|
554
|
+
| /dashboard | desktop/dashboard.png | tablet/dashboard.png | mobile/dashboard.png |
|
|
555
|
+
```
|
|
556
|
+
|
|
557
|
+
## Passo 6: Cleanup
|
|
558
|
+
|
|
559
|
+
```bash
|
|
560
|
+
kill $DEV_PID 2>/dev/null
|
|
561
|
+
```
|
|
562
|
+
|
|
563
|
+
`browser_close()`
|
|
564
|
+
|
|
565
|
+
```
|
|
566
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
567
|
+
UP > MOBILE FIRST — COMPLETO
|
|
568
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
569
|
+
|
|
570
|
+
**Score de Responsividade:** [N]/10
|
|
571
|
+
|
|
572
|
+
| Viewport | Status |
|
|
573
|
+
|----------|--------|
|
|
574
|
+
| Desktop (1920px) | Intacto (referencia) |
|
|
575
|
+
| Tablet (768px) | [N] problemas → [M] corrigidos |
|
|
576
|
+
| Mobile (390px) | [N] problemas → [M] corrigidos |
|
|
577
|
+
|
|
578
|
+
**Problemas:** [N] encontrados | [M] corrigidos | [K] nao corrigiveis sem refatoracao
|
|
579
|
+
**Desktop:** Verificado intacto apos cada correcao
|
|
580
|
+
|
|
581
|
+
Relatorio: .plano/mobile-review/MOBILE-REPORT.md
|
|
582
|
+
Screenshots: .plano/mobile-review/screenshots/
|
|
583
|
+
|
|
584
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
585
|
+
```
|
|
586
|
+
|
|
587
|
+
</process>
|
|
588
|
+
|
|
589
|
+
<css_patterns>
|
|
590
|
+
## Padroes de Correcao por Stack
|
|
591
|
+
|
|
592
|
+
### Tailwind CSS (Preferido)
|
|
593
|
+
|
|
594
|
+
**Principio:** Mobile-first. Estilo base = mobile. Breakpoints adicionam desktop.
|
|
595
|
+
|
|
596
|
+
```
|
|
597
|
+
# Layout responsivo
|
|
598
|
+
flex-col md:flex-row
|
|
599
|
+
grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3
|
|
600
|
+
|
|
601
|
+
# Visibilidade
|
|
602
|
+
hidden md:block ← aparece so no desktop
|
|
603
|
+
md:hidden ← aparece so no mobile
|
|
604
|
+
|
|
605
|
+
# Espacamento
|
|
606
|
+
p-4 md:p-6 lg:p-8
|
|
607
|
+
gap-2 md:gap-4
|
|
608
|
+
|
|
609
|
+
# Tipografia
|
|
610
|
+
text-sm md:text-base lg:text-lg
|
|
611
|
+
text-2xl md:text-4xl
|
|
612
|
+
|
|
613
|
+
# Larguras
|
|
614
|
+
w-full md:w-1/2 lg:w-1/3
|
|
615
|
+
max-w-full
|
|
616
|
+
|
|
617
|
+
# Overflow
|
|
618
|
+
overflow-x-auto ← tabelas, conteudo largo
|
|
619
|
+
|
|
620
|
+
# Imagens
|
|
621
|
+
w-full h-auto object-cover
|
|
622
|
+
```
|
|
623
|
+
|
|
624
|
+
### CSS Puro / Modules
|
|
625
|
+
|
|
626
|
+
```css
|
|
627
|
+
/* Mobile first */
|
|
628
|
+
.container { padding: 1rem; }
|
|
629
|
+
.grid { display: flex; flex-direction: column; gap: 0.5rem; }
|
|
630
|
+
|
|
631
|
+
/* Tablet */
|
|
632
|
+
@media (min-width: 768px) {
|
|
633
|
+
.container { padding: 1.5rem; }
|
|
634
|
+
.grid { flex-direction: row; gap: 1rem; }
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
/* Desktop */
|
|
638
|
+
@media (min-width: 1024px) {
|
|
639
|
+
.container { padding: 2rem; }
|
|
640
|
+
}
|
|
641
|
+
```
|
|
642
|
+
|
|
643
|
+
### Componentes Novos (se necessario)
|
|
644
|
+
|
|
645
|
+
**Hamburger Menu (quando nav nao cabe):**
|
|
646
|
+
- Usar Sheet/Drawer do shadcn se disponivel
|
|
647
|
+
- Ou criar componente com estado open/close
|
|
648
|
+
- Desktop: nav normal. Mobile: botao hamburguer + drawer
|
|
649
|
+
|
|
650
|
+
**Tabela Responsiva (quando tabela estoura):**
|
|
651
|
+
- Desktop: tabela normal
|
|
652
|
+
- Mobile: card layout ou scroll horizontal com indicador
|
|
653
|
+
|
|
654
|
+
**Modal Responsivo:**
|
|
655
|
+
- Desktop: dialog centralizado com max-width
|
|
656
|
+
- Mobile: fullscreen com close button no topo
|
|
657
|
+
</css_patterns>
|
|
658
|
+
|
|
659
|
+
<failure_handling>
|
|
660
|
+
## Tratamento de Falhas
|
|
661
|
+
|
|
662
|
+
**Dev server nao sobe:** Sair com erro.
|
|
663
|
+
|
|
664
|
+
**Fix quebra desktop:**
|
|
665
|
+
- Reverter: `git checkout -- [arquivos]`
|
|
666
|
+
- Tentar abordagem diferente (max 3 tentativas)
|
|
667
|
+
- Se todas falham: registrar como "necessita refatoracao manual"
|
|
668
|
+
|
|
669
|
+
**Componente complexo (ex: chart, mapa, canvas):**
|
|
670
|
+
- Priorizar container responsivo ao inves de mudar o componente
|
|
671
|
+
- `overflow-x-auto` + `min-width` como fallback seguro
|
|
672
|
+
|
|
673
|
+
**CSS-in-JS sem acesso direto:**
|
|
674
|
+
- Wrapper div com classes responsivas
|
|
675
|
+
- Media queries no styled-component
|
|
676
|
+
|
|
677
|
+
**Principio:** Nunca quebrar desktop. Se nao da pra corrigir mobile sem afetar desktop, registrar e seguir.
|
|
678
|
+
</failure_handling>
|
|
679
|
+
|
|
680
|
+
<success_criteria>
|
|
681
|
+
- [ ] Dev server subiu
|
|
682
|
+
- [ ] Todas paginas escaneadas em 3 viewports (mobile, tablet, desktop)
|
|
683
|
+
- [ ] Screenshots de referencia desktop capturados
|
|
684
|
+
- [ ] Problemas detectados e classificados por severidade
|
|
685
|
+
- [ ] Stack CSS identificada (tailwind/css/etc.)
|
|
686
|
+
- [ ] Cada fix verificado: mobile melhorou E desktop intacto
|
|
687
|
+
- [ ] Fixes revertidos quando desktop afetado
|
|
688
|
+
- [ ] Commits atomicos por correcao
|
|
689
|
+
- [ ] MOBILE-REPORT.md gerado com antes/depois
|
|
690
|
+
- [ ] Dev server fechado
|
|
691
|
+
- [ ] Browser fechado
|
|
692
|
+
</success_criteria>
|
|
@@ -672,6 +672,28 @@ Use AskUserQuestion:
|
|
|
672
672
|
node "$HOME/.claude/up/bin/up-tools.cjs" commit "docs: criar roteiro ([N] fases)" --files .plano/ROADMAP.md .plano/STATE.md .plano/REQUIREMENTS.md
|
|
673
673
|
```
|
|
674
674
|
|
|
675
|
+
## 7.5. Injetar persistência no CLAUDE.md do projeto
|
|
676
|
+
|
|
677
|
+
Verificar se `./CLAUDE.md` existe. Se existir, verificar se já contém a seção "UP: Persistência de Estado". Se não contém, adicionar ao final:
|
|
678
|
+
|
|
679
|
+
```markdown
|
|
680
|
+
|
|
681
|
+
## UP: Persistência de Estado
|
|
682
|
+
|
|
683
|
+
Este projeto usa o sistema UP. Se `.plano/STATE.md` existir:
|
|
684
|
+
- Ao final de trabalho significativo, salvar estado: `node "$HOME/.claude/up/bin/up-tools.cjs" state save-session --summary "o que foi feito"`
|
|
685
|
+
- Se houve decisão importante, adicionar: `--decision "decisão" --phase N`
|
|
686
|
+
- Isso garante continuidade entre sessões mesmo sem usar comandos /up:
|
|
687
|
+
```
|
|
688
|
+
|
|
689
|
+
Se `./CLAUDE.md` não existe, criar com o conteúdo acima.
|
|
690
|
+
|
|
691
|
+
Commitar:
|
|
692
|
+
|
|
693
|
+
```bash
|
|
694
|
+
node "$HOME/.claude/up/bin/up-tools.cjs" commit "docs: adicionar persistência de estado ao CLAUDE.md" --files CLAUDE.md
|
|
695
|
+
```
|
|
696
|
+
|
|
675
697
|
## 8. Finalizado
|
|
676
698
|
|
|
677
699
|
```
|