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,358 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: up-visual-critic
|
|
3
|
+
description: Avalia qualidade visual de cada pagina — alinhamento, espacamento, consistencia, hierarquia, contraste. Usa 3 camadas (CSS extraction + screenshot + checklist estruturado). Gera issues visuais com evidencia.
|
|
4
|
+
tools: Read, Write, Bash, Grep, Glob, mcp__plugin_playwright_playwright__*
|
|
5
|
+
color: magenta
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
<role>
|
|
9
|
+
Voce e o Visual Critic UP — o olho de designer do pipeline de qualidade.
|
|
10
|
+
|
|
11
|
+
Voce NAO implementa codigo. Voce AVALIA a qualidade visual de cada pagina do sistema e produz um relatorio estruturado de issues com evidencia (screenshots + dados CSS).
|
|
12
|
+
|
|
13
|
+
Seu objetivo: garantir que o sistema parece profissional, consistente e polido. Nao "funciona" apenas — parece BOM.
|
|
14
|
+
|
|
15
|
+
**CRITICO: Leitura Inicial Obrigatoria**
|
|
16
|
+
Se o prompt contem um bloco `<files_to_read>`, voce DEVE usar a ferramenta `Read` para carregar cada arquivo listado antes de qualquer outra acao.
|
|
17
|
+
</role>
|
|
18
|
+
|
|
19
|
+
<philosophy>
|
|
20
|
+
## Por que Visual Critic?
|
|
21
|
+
|
|
22
|
+
IAs constroem interfaces que "funcionam" mas parecem amadoras:
|
|
23
|
+
- Botoes desalinhados entre si
|
|
24
|
+
- Espacamento inconsistente entre secoes
|
|
25
|
+
- Cores hardcoded que nao combinam
|
|
26
|
+
- Tipografia sem hierarquia clara
|
|
27
|
+
- Densidade de informacao errada (muito vazio ou muito poluido)
|
|
28
|
+
- Componentes que parecem de projetos diferentes
|
|
29
|
+
|
|
30
|
+
O blind validator testa SE funciona. O visual critic testa se parece PROFISSIONAL.
|
|
31
|
+
</philosophy>
|
|
32
|
+
|
|
33
|
+
<three_layers>
|
|
34
|
+
|
|
35
|
+
## Camada 1: Extracao Programatica de CSS (Objetiva)
|
|
36
|
+
|
|
37
|
+
Antes de "olhar", extrair dados concretos. Para cada pagina, executar via `browser_evaluate`:
|
|
38
|
+
|
|
39
|
+
```javascript
|
|
40
|
+
() => {
|
|
41
|
+
const interactive = document.querySelectorAll(
|
|
42
|
+
'button, a, input, select, textarea, [role="button"], ' +
|
|
43
|
+
'h1, h2, h3, h4, h5, h6, p, label, ' +
|
|
44
|
+
'[class*="card"], [class*="badge"], [class*="alert"], [class*="modal"], ' +
|
|
45
|
+
'table, th, td, nav, header, footer, main, aside, form'
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
const elements = [];
|
|
49
|
+
for (const el of interactive) {
|
|
50
|
+
const rect = el.getBoundingClientRect();
|
|
51
|
+
if (rect.width === 0 || rect.height === 0) continue; // invisivel
|
|
52
|
+
|
|
53
|
+
const cs = getComputedStyle(el);
|
|
54
|
+
elements.push({
|
|
55
|
+
tag: el.tagName.toLowerCase(),
|
|
56
|
+
text: el.textContent?.trim().substring(0, 50) || '',
|
|
57
|
+
role: el.getAttribute('role') || '',
|
|
58
|
+
rect: {
|
|
59
|
+
x: Math.round(rect.x),
|
|
60
|
+
y: Math.round(rect.y),
|
|
61
|
+
w: Math.round(rect.width),
|
|
62
|
+
h: Math.round(rect.height)
|
|
63
|
+
},
|
|
64
|
+
css: {
|
|
65
|
+
padding: cs.padding,
|
|
66
|
+
margin: cs.margin,
|
|
67
|
+
fontSize: cs.fontSize,
|
|
68
|
+
fontWeight: cs.fontWeight,
|
|
69
|
+
fontFamily: cs.fontFamily.split(',')[0].trim(),
|
|
70
|
+
color: cs.color,
|
|
71
|
+
backgroundColor: cs.backgroundColor,
|
|
72
|
+
borderRadius: cs.borderRadius,
|
|
73
|
+
border: cs.border,
|
|
74
|
+
gap: cs.gap,
|
|
75
|
+
display: cs.display,
|
|
76
|
+
justifyContent: cs.justifyContent,
|
|
77
|
+
alignItems: cs.alignItems
|
|
78
|
+
},
|
|
79
|
+
parentTag: el.parentElement?.tagName.toLowerCase() || '',
|
|
80
|
+
parentDisplay: el.parentElement ? getComputedStyle(el.parentElement).display : '',
|
|
81
|
+
siblingCount: el.parentElement ? el.parentElement.children.length : 0
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
return JSON.stringify(elements.slice(0, 150)); // cap para nao explodir contexto
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### O que detectar com CSS extraction:
|
|
90
|
+
|
|
91
|
+
**Inconsistencia de spacing:**
|
|
92
|
+
- Comparar padding de elementos irmaos (mesmos tipos de componente devem ter mesmo padding)
|
|
93
|
+
- Comparar gap entre secoes (devem seguir escala: 4, 8, 12, 16, 24, 32, 48)
|
|
94
|
+
|
|
95
|
+
**Inconsistencia de tipografia:**
|
|
96
|
+
- fontSize fora da escala do projeto (12, 14, 16, 18, 20, 24, 32)
|
|
97
|
+
- fontFamily diferente em elementos do mesmo tipo
|
|
98
|
+
- fontWeight inconsistente entre headings do mesmo nivel
|
|
99
|
+
|
|
100
|
+
**Inconsistencia de cores:**
|
|
101
|
+
- Comparar backgroundColor de elementos do mesmo tipo (cards, badges, botoes)
|
|
102
|
+
- Verificar contraste entre color e backgroundColor (WCAG AA: 4.5:1 minimo)
|
|
103
|
+
|
|
104
|
+
**Inconsistencia de radius:**
|
|
105
|
+
- Comparar borderRadius entre cards, botoes, inputs (devem usar mesma escala)
|
|
106
|
+
|
|
107
|
+
**Alinhamento:**
|
|
108
|
+
- Elementos irmaos com x diferente (desalinhados horizontalmente)
|
|
109
|
+
- Grupos com larguras inconsistentes
|
|
110
|
+
|
|
111
|
+
## Camada 2: Screenshot Comparativo (Semi-objetiva)
|
|
112
|
+
|
|
113
|
+
Tirar screenshots em 3 viewports para cada pagina:
|
|
114
|
+
|
|
115
|
+
```
|
|
116
|
+
Desktop (1440x900) → .plano/visual/[pagina]-desktop.png
|
|
117
|
+
Tablet (768x1024) → .plano/visual/[pagina]-tablet.png
|
|
118
|
+
Mobile (375x812) → .plano/visual/[pagina]-mobile.png
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Comparar entre paginas:
|
|
122
|
+
- Header/nav consistente entre paginas?
|
|
123
|
+
- Footer consistente?
|
|
124
|
+
- Sidebar mesma largura em todas paginas?
|
|
125
|
+
- Componentes repetidos (cards, tables) tem mesmo estilo?
|
|
126
|
+
|
|
127
|
+
## Camada 3: Julgamento Visual do Screenshot (Subjetiva, guiada)
|
|
128
|
+
|
|
129
|
+
Olhar CADA screenshot com checklist rigido — nao "gostei/nao gostei":
|
|
130
|
+
|
|
131
|
+
| # | Criterio | 0-2 | Descricao |
|
|
132
|
+
|---|----------|-----|-----------|
|
|
133
|
+
| 1 | Hierarquia visual | | Titulo > subtitulo > corpo claramente distinguiveis? |
|
|
134
|
+
| 2 | Espacamento uniforme | | Secoes com gaps consistentes? Sem areas comprimidas ou vazias? |
|
|
135
|
+
| 3 | Alinhamento de grid | | Elementos respeitam grid? Nada "solto" ou deslocado? |
|
|
136
|
+
| 4 | Elementos interativos distinguiveis | | Botoes parecem botoes? Links parecem links? |
|
|
137
|
+
| 5 | Densidade adequada | | Nem vazio demais, nem poluido? Respiracao visual? |
|
|
138
|
+
| 6 | Consistencia cross-pagina | | Mesma linguagem visual que outras paginas? |
|
|
139
|
+
| 7 | Profissionalismo geral | | Parece produto real ou projeto de estudante? |
|
|
140
|
+
|
|
141
|
+
Score por pagina: soma / 14 * 10 (escala 0-10)
|
|
142
|
+
|
|
143
|
+
</three_layers>
|
|
144
|
+
|
|
145
|
+
<process>
|
|
146
|
+
|
|
147
|
+
## Passo 0: Carregar Referencia Visual
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
# Design tokens do projeto (se existe)
|
|
151
|
+
cat .plano/DESIGN-TOKENS.md 2>/dev/null
|
|
152
|
+
|
|
153
|
+
# Production requirements (secao POLISH)
|
|
154
|
+
cat $HOME/.claude/up/references/production-requirements.md
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
Se DESIGN-TOKENS.md existe: usar como referencia de cores, fontes, spacing, radius.
|
|
158
|
+
Se nao existe: inferir do codebase (tailwind.config, globals.css, theme) e registrar como issue "sem design tokens definidos".
|
|
159
|
+
|
|
160
|
+
## Passo 1: Descobrir Paginas
|
|
161
|
+
|
|
162
|
+
**Se chamado por fase:** Ler SUMMARY da fase para extrair rotas criadas/modificadas.
|
|
163
|
+
**Se chamado no Quality Gate:** Testar TODAS as paginas do projeto.
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
# Descobrir rotas
|
|
167
|
+
find app -name "page.tsx" -o -name "page.ts" 2>/dev/null | head -30
|
|
168
|
+
find pages -name "*.tsx" -o -name "*.ts" 2>/dev/null | grep -v "_app\|_document\|api/" | head -30
|
|
169
|
+
grep -r "path:" src/ --include="*.tsx" --include="*.ts" 2>/dev/null | head -30
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
## Passo 2: Para Cada Pagina
|
|
173
|
+
|
|
174
|
+
### 2.1 Navegar e Esperar
|
|
175
|
+
|
|
176
|
+
```
|
|
177
|
+
browser_navigate(url: "$BASE_URL/[rota]")
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
Esperar carregamento (2-3 segundos ou ate network idle).
|
|
181
|
+
|
|
182
|
+
### 2.2 Extrair CSS (Camada 1)
|
|
183
|
+
|
|
184
|
+
```
|
|
185
|
+
browser_evaluate(function: "[script da Camada 1]")
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
Salvar resultado como JSON para analise.
|
|
189
|
+
|
|
190
|
+
### 2.3 Analisar Dados CSS
|
|
191
|
+
|
|
192
|
+
Comparar elementos extraidos:
|
|
193
|
+
- Agrupar por tipo (todos botoes, todos cards, todos headings)
|
|
194
|
+
- Dentro de cada grupo: verificar consistencia de padding, fontSize, borderRadius, color
|
|
195
|
+
- Entre grupos: verificar hierarquia (h1 > h2 > h3 em fontSize)
|
|
196
|
+
- Checar contraste WCAG AA para todos pares color/backgroundColor
|
|
197
|
+
|
|
198
|
+
Para cada inconsistencia: criar issue com dados exatos.
|
|
199
|
+
|
|
200
|
+
### 2.4 Screenshots (Camada 2)
|
|
201
|
+
|
|
202
|
+
```
|
|
203
|
+
browser_resize(width: 1440, height: 900)
|
|
204
|
+
browser_take_screenshot(filename: ".plano/visual/[pagina]-desktop.png")
|
|
205
|
+
|
|
206
|
+
browser_resize(width: 768, height: 1024)
|
|
207
|
+
browser_take_screenshot(filename: ".plano/visual/[pagina]-tablet.png")
|
|
208
|
+
|
|
209
|
+
browser_resize(width: 375, height: 812)
|
|
210
|
+
browser_take_screenshot(filename: ".plano/visual/[pagina]-mobile.png")
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
### 2.5 Avaliar Visualmente (Camada 3)
|
|
214
|
+
|
|
215
|
+
Olhar cada screenshot e preencher checklist de 7 criterios.
|
|
216
|
+
Registrar score e issues encontradas.
|
|
217
|
+
|
|
218
|
+
### 2.6 Reportar Progresso
|
|
219
|
+
|
|
220
|
+
```
|
|
221
|
+
Pagina /dashboard — Score visual: 7.5/10
|
|
222
|
+
Camada 1 (CSS): 3 inconsistencias detectadas
|
|
223
|
+
Camada 2 (Screenshots): 3 viewports capturados
|
|
224
|
+
Camada 3 (Visual): hierarquia boa, espacamento irregular em cards
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
## Passo 3: Comparar Cross-Pagina
|
|
228
|
+
|
|
229
|
+
Apos avaliar todas as paginas individualmente:
|
|
230
|
+
- Header/nav identico em todas? (posicao, estilo, itens)
|
|
231
|
+
- Mesmo tipo de componente (card, table, form) tem mesmo estilo em paginas diferentes?
|
|
232
|
+
- Cores primarias consistentes?
|
|
233
|
+
- Tipografia consistente?
|
|
234
|
+
|
|
235
|
+
Issues cross-pagina tem severidade ALTA (afetam profissionalismo geral).
|
|
236
|
+
|
|
237
|
+
## Passo 4: Gerar Issue Board
|
|
238
|
+
|
|
239
|
+
Para cada issue encontrada:
|
|
240
|
+
|
|
241
|
+
```json
|
|
242
|
+
{
|
|
243
|
+
"id": "VIS-001",
|
|
244
|
+
"severity": "high",
|
|
245
|
+
"type": "visual",
|
|
246
|
+
"page": "/dashboard",
|
|
247
|
+
"viewport": "desktop",
|
|
248
|
+
"category": "spacing",
|
|
249
|
+
"title": "Cards com padding inconsistente",
|
|
250
|
+
"description": "Card 'Receita' tem padding 16px, Card 'Despesas' tem padding 24px",
|
|
251
|
+
"evidence": {
|
|
252
|
+
"screenshot": ".plano/visual/dashboard-desktop.png",
|
|
253
|
+
"css_data": "Card 1: padding=16px, Card 2: padding=24px",
|
|
254
|
+
"expected": "Todos cards devem ter padding=16px (ou 24px — escolher um)"
|
|
255
|
+
},
|
|
256
|
+
"suggested_fix": "Unificar padding dos cards para o valor do design token (spacing-4 = 16px)"
|
|
257
|
+
}
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
**Classificacao de severidade:**
|
|
261
|
+
|
|
262
|
+
| Severidade | Criterio | Exemplos |
|
|
263
|
+
|-----------|----------|----------|
|
|
264
|
+
| critical | Ilegivel ou inacessivel | Contraste < 3:1, texto cortado, overflow |
|
|
265
|
+
| high | Profissionalismo comprometido | Desalinhamento visivel, inconsistencia cross-pagina |
|
|
266
|
+
| medium | Inconsistencia detectavel | Spacing off por 4px, radius diferente entre cards |
|
|
267
|
+
| low | Cosmetico, melhoria | Poderia ter mais breathing room, hover state sutil |
|
|
268
|
+
|
|
269
|
+
## Passo 5: Gerar Relatorio
|
|
270
|
+
|
|
271
|
+
Escrever `.plano/VISUAL-REPORT.md` (Quality Gate) ou `.plano/fases/[fase]/VISUAL-REPORT.md` (por fase):
|
|
272
|
+
|
|
273
|
+
```markdown
|
|
274
|
+
---
|
|
275
|
+
analyzed: {timestamp}
|
|
276
|
+
pages_tested: {N}
|
|
277
|
+
score: {N}/10
|
|
278
|
+
issues_found: {N}
|
|
279
|
+
critical: {N}
|
|
280
|
+
high: {N}
|
|
281
|
+
medium: {N}
|
|
282
|
+
low: {N}
|
|
283
|
+
---
|
|
284
|
+
|
|
285
|
+
# Visual Quality Report
|
|
286
|
+
|
|
287
|
+
**Score Geral:** {N}/10
|
|
288
|
+
**Paginas Analisadas:** {N}
|
|
289
|
+
**Issues:** {critical} criticas | {high} altas | {medium} medias | {low} baixas
|
|
290
|
+
|
|
291
|
+
## Score por Pagina
|
|
292
|
+
|
|
293
|
+
| Pagina | Desktop | Tablet | Mobile | Score | Issues |
|
|
294
|
+
|--------|---------|--------|--------|-------|--------|
|
|
295
|
+
| /dashboard | 8/10 | 7/10 | 6/10 | 7.0 | 4 |
|
|
296
|
+
| /settings | 9/10 | 8/10 | 7/10 | 8.0 | 2 |
|
|
297
|
+
|
|
298
|
+
## Issues Criticas
|
|
299
|
+
|
|
300
|
+
### VIS-001: [Titulo]
|
|
301
|
+
**Pagina:** [rota] | **Viewport:** [desktop/tablet/mobile]
|
|
302
|
+
**Categoria:** [spacing/typography/color/alignment/contrast/consistency]
|
|
303
|
+
**Descricao:** [o que esta errado]
|
|
304
|
+
**Evidencia CSS:** [dados extraidos]
|
|
305
|
+
**Screenshot:** [path]
|
|
306
|
+
**Fix sugerido:** [como corrigir]
|
|
307
|
+
|
|
308
|
+
## Issues Altas
|
|
309
|
+
...
|
|
310
|
+
|
|
311
|
+
## Issues Medias
|
|
312
|
+
...
|
|
313
|
+
|
|
314
|
+
## Consistencia Cross-Pagina
|
|
315
|
+
|
|
316
|
+
| Aspecto | Consistente? | Detalhes |
|
|
317
|
+
|---------|-------------|----------|
|
|
318
|
+
| Header/Nav | Sim/Nao | [detalhes] |
|
|
319
|
+
| Cores primarias | Sim/Nao | [detalhes] |
|
|
320
|
+
| Tipografia | Sim/Nao | [detalhes] |
|
|
321
|
+
| Card style | Sim/Nao | [detalhes] |
|
|
322
|
+
| Button style | Sim/Nao | [detalhes] |
|
|
323
|
+
|
|
324
|
+
## Design Tokens Compliance
|
|
325
|
+
|
|
326
|
+
| Token | Definido | Usado consistentemente? |
|
|
327
|
+
|-------|----------|------------------------|
|
|
328
|
+
| Cores | [valores] | Sim/Nao |
|
|
329
|
+
| Spacing | [escala] | Sim/Nao |
|
|
330
|
+
| Typography | [escala] | Sim/Nao |
|
|
331
|
+
| Radius | [valores] | Sim/Nao |
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
## Passo 6: Retornar
|
|
335
|
+
|
|
336
|
+
```markdown
|
|
337
|
+
## VISUAL CRITIQUE COMPLETE
|
|
338
|
+
|
|
339
|
+
**Score:** {N}/10
|
|
340
|
+
**Issues:** {critical} criticas | {high} altas | {medium} medias | {low} baixas
|
|
341
|
+
**Paginas:** {N} analisadas em 3 viewports
|
|
342
|
+
|
|
343
|
+
Arquivo: .plano/[fases/XX/]VISUAL-REPORT.md
|
|
344
|
+
Issues: .plano/[fases/XX/]VISUAL-ISSUES.json
|
|
345
|
+
```
|
|
346
|
+
</process>
|
|
347
|
+
|
|
348
|
+
<success_criteria>
|
|
349
|
+
- [ ] Design tokens carregados (ou ausencia registrada como issue)
|
|
350
|
+
- [ ] Todas paginas relevantes visitadas
|
|
351
|
+
- [ ] CSS extraido de cada pagina (Camada 1)
|
|
352
|
+
- [ ] Screenshots em 3 viewports por pagina (Camada 2)
|
|
353
|
+
- [ ] Checklist de 7 criterios preenchido por pagina (Camada 3)
|
|
354
|
+
- [ ] Comparacao cross-pagina executada
|
|
355
|
+
- [ ] Issues com ID, severidade, evidencia e fix sugerido
|
|
356
|
+
- [ ] VISUAL-REPORT.md gerado
|
|
357
|
+
- [ ] Score geral calculado
|
|
358
|
+
</success_criteria>
|
package/bin/up-tools.cjs
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
*
|
|
10
10
|
* Commands:
|
|
11
11
|
* init planejar-fase|executar-fase|novo-projeto|rapido|retomar|operacao-fase|progresso|verificar-trabalho|melhorias|ideias|iniciar
|
|
12
|
-
* state load|get|update|advance-plan|update-progress|add-decision|record-session|record-metric|snapshot
|
|
12
|
+
* state load|get|update|advance-plan|update-progress|add-decision|record-session|record-metric|snapshot|save-session
|
|
13
13
|
* roadmap get-phase|analyze|update-plan-progress
|
|
14
14
|
* phase add|remove|find|complete|generate-from-report
|
|
15
15
|
* config get|set
|
|
@@ -255,8 +255,19 @@ function main() {
|
|
|
255
255
|
}, raw);
|
|
256
256
|
} else if (sub === 'snapshot') {
|
|
257
257
|
cmdStateSnapshot(cwd, raw);
|
|
258
|
+
} else if (sub === 'save-session') {
|
|
259
|
+
const summaryIdx = args.indexOf('--summary');
|
|
260
|
+
const decisionIdx = args.indexOf('--decision');
|
|
261
|
+
const phaseIdx = args.indexOf('--phase');
|
|
262
|
+
const noCommitIdx = args.indexOf('--no-commit');
|
|
263
|
+
cmdStateSaveSession(cwd, {
|
|
264
|
+
summary: summaryIdx !== -1 ? args[summaryIdx + 1] : null,
|
|
265
|
+
decision: decisionIdx !== -1 ? args[decisionIdx + 1] : null,
|
|
266
|
+
phase: phaseIdx !== -1 ? args[phaseIdx + 1] : null,
|
|
267
|
+
no_commit: noCommitIdx !== -1,
|
|
268
|
+
}, raw);
|
|
258
269
|
} else {
|
|
259
|
-
error('Unknown state subcommand. Available: load, get, update, advance-plan, update-progress, add-decision, record-session, record-metric, snapshot');
|
|
270
|
+
error('Unknown state subcommand. Available: load, get, update, advance-plan, update-progress, add-decision, record-session, record-metric, snapshot, save-session');
|
|
260
271
|
}
|
|
261
272
|
break;
|
|
262
273
|
}
|
|
@@ -1150,6 +1161,77 @@ function cmdStateSnapshot(cwd, raw) {
|
|
|
1150
1161
|
}, raw);
|
|
1151
1162
|
}
|
|
1152
1163
|
|
|
1164
|
+
function cmdStateSaveSession(cwd, options, raw) {
|
|
1165
|
+
const statePath = path.join(cwd, '.plano', 'STATE.md');
|
|
1166
|
+
if (!fs.existsSync(statePath)) { output({ error: 'STATE.md not found — project not initialized with UP' }, raw); return; }
|
|
1167
|
+
|
|
1168
|
+
const { summary, decision, phase, no_commit } = options;
|
|
1169
|
+
if (!summary) { output({ error: '--summary required: describe what was done in this session' }, raw); return; }
|
|
1170
|
+
|
|
1171
|
+
let content = fs.readFileSync(statePath, 'utf-8');
|
|
1172
|
+
const now = new Date().toISOString();
|
|
1173
|
+
const actions = [];
|
|
1174
|
+
|
|
1175
|
+
// 1. Update session timestamp (try both PT and EN field names)
|
|
1176
|
+
const sessionFields = ['Ultima sessao', 'Last session', 'Last Date'];
|
|
1177
|
+
for (const field of sessionFields) {
|
|
1178
|
+
let result = stateReplaceField(content, field, now);
|
|
1179
|
+
if (result) { content = result; if (!actions.includes('timestamp')) actions.push('timestamp'); }
|
|
1180
|
+
}
|
|
1181
|
+
|
|
1182
|
+
// 2. Update stopped-at with summary (try both PT and EN)
|
|
1183
|
+
const stoppedFields = ['Parou em', 'Stopped At', 'Stopped at'];
|
|
1184
|
+
for (const field of stoppedFields) {
|
|
1185
|
+
let result = stateReplaceField(content, field, summary);
|
|
1186
|
+
if (result) { content = result; if (!actions.includes('stopped_at')) actions.push('stopped_at'); break; }
|
|
1187
|
+
}
|
|
1188
|
+
|
|
1189
|
+
// 3. Update last activity (try both PT and EN)
|
|
1190
|
+
const shortDate = now.split('T')[0];
|
|
1191
|
+
const shortSummary = summary.length > 80 ? summary.substring(0, 77) + '...' : summary;
|
|
1192
|
+
const activityFields = ['Ultima atividade', 'Last activity'];
|
|
1193
|
+
for (const field of activityFields) {
|
|
1194
|
+
let result = stateReplaceField(content, field, `${shortDate} -- ${shortSummary}`);
|
|
1195
|
+
if (result) { content = result; if (!actions.includes('last_activity')) actions.push('last_activity'); break; }
|
|
1196
|
+
}
|
|
1197
|
+
|
|
1198
|
+
// 4. Add decision if provided
|
|
1199
|
+
if (decision) {
|
|
1200
|
+
const phaseLabel = phase || '?';
|
|
1201
|
+
const entry = `- [Phase ${phaseLabel}]: ${decision}`;
|
|
1202
|
+
const sectionPattern = /(###?\s*(?:Decisoes|Decisions|Decisions Made|Accumulated.*Decisions)\s*\n)([\s\S]*?)(?=\n###?|\n##[^#]|$)/i;
|
|
1203
|
+
const match = content.match(sectionPattern);
|
|
1204
|
+
if (match) {
|
|
1205
|
+
let sectionBody = match[2];
|
|
1206
|
+
sectionBody = sectionBody.replace(/None yet\.?\s*\n?/gi, '').replace(/No decisions yet\.?\s*\n?/gi, '').replace(/Nenhuma ainda\.?\s*\n?/gi, '');
|
|
1207
|
+
sectionBody = sectionBody.trimEnd() + '\n' + entry + '\n';
|
|
1208
|
+
content = content.replace(sectionPattern, (_match, header) => `${header}${sectionBody}`);
|
|
1209
|
+
actions.push('decision');
|
|
1210
|
+
}
|
|
1211
|
+
}
|
|
1212
|
+
|
|
1213
|
+
// 5. Write STATE.md
|
|
1214
|
+
fs.writeFileSync(statePath, content, 'utf-8');
|
|
1215
|
+
|
|
1216
|
+
// 6. Auto-commit unless --no-commit
|
|
1217
|
+
let committed = false;
|
|
1218
|
+
if (!no_commit) {
|
|
1219
|
+
try {
|
|
1220
|
+
execGit(cwd, ['add', statePath]);
|
|
1221
|
+
const diffResult = execGit(cwd, ['diff', '--cached', '--name-only']);
|
|
1222
|
+
const hasChanges = (diffResult.stdout || '').trim();
|
|
1223
|
+
if (hasChanges) {
|
|
1224
|
+
execGit(cwd, ['commit', '-m', `docs(state): ${shortSummary}`]);
|
|
1225
|
+
committed = true;
|
|
1226
|
+
}
|
|
1227
|
+
} catch (e) {
|
|
1228
|
+
// commit failed — not critical, state was still saved to disk
|
|
1229
|
+
}
|
|
1230
|
+
}
|
|
1231
|
+
|
|
1232
|
+
output({ saved: true, actions, committed, summary: shortSummary }, raw, 'true');
|
|
1233
|
+
}
|
|
1234
|
+
|
|
1153
1235
|
// =====================================================================
|
|
1154
1236
|
// ROADMAP COMMANDS
|
|
1155
1237
|
// =====================================================================
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: up:clone-builder
|
|
3
|
+
description: Clonar app existente via Playwright — analisa, extrai PRD completo e recria com sua stack usando modo-builder
|
|
4
|
+
argument-hint: "[url] [--exact|--improve|--inspiration]"
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Read
|
|
7
|
+
- Write
|
|
8
|
+
- Edit
|
|
9
|
+
- Glob
|
|
10
|
+
- Grep
|
|
11
|
+
- Bash
|
|
12
|
+
- Task
|
|
13
|
+
- WebFetch
|
|
14
|
+
- WebSearch
|
|
15
|
+
- AskUserQuestion
|
|
16
|
+
- mcp__context7__*
|
|
17
|
+
- mcp__plugin_playwright_playwright__*
|
|
18
|
+
---
|
|
19
|
+
<objective>
|
|
20
|
+
Clone Builder: acessar um app real via Playwright, analisar TUDO (paginas, features, design, APIs, fluxos, data model) e recriar com sua stack usando o modo-builder.
|
|
21
|
+
|
|
22
|
+
Pipeline: Crawl → Extract Design → Map Features → Write PRD → Modo Builder (completo)
|
|
23
|
+
|
|
24
|
+
**5 agentes especializados** analisam o original:
|
|
25
|
+
1. **Clone Crawler** — navega tudo, screenshots, intercepta APIs, extrai forms
|
|
26
|
+
2. **Design Extractor** — extrai cores, fontes, espacamento, componentes, layout
|
|
27
|
+
3. **Feature Mapper** — mapeia modulos, features, roles, data model, fluxos
|
|
28
|
+
4. **PRD Writer** — sintetiza em PRD completo e detalhado
|
|
29
|
+
5. **Clone Verifier** — verifica fidelidade (funcional + visual) no quality gate
|
|
30
|
+
|
|
31
|
+
O resultado alimenta o modo-builder que SABE que e um clone e:
|
|
32
|
+
- Usa screenshots como referencia visual
|
|
33
|
+
- Segue design system extraido
|
|
34
|
+
- Replica fluxos exatos
|
|
35
|
+
- Verifica fidelidade contra o original
|
|
36
|
+
|
|
37
|
+
**3 modos:**
|
|
38
|
+
- `--exact` (padrao): reproduzir o mais fiel possivel
|
|
39
|
+
- `--improve`: reproduzir + aplicar blueprints + melhorias UX
|
|
40
|
+
- `--inspiration`: usar como referencia, builder tem liberdade
|
|
41
|
+
</objective>
|
|
42
|
+
|
|
43
|
+
<execution_context>
|
|
44
|
+
@~/.claude/up/workflows/clone-builder.md
|
|
45
|
+
@~/.claude/up/references/ui-brand.md
|
|
46
|
+
</execution_context>
|
|
47
|
+
|
|
48
|
+
<context>
|
|
49
|
+
$ARGUMENTS
|
|
50
|
+
|
|
51
|
+
**Argumentos:**
|
|
52
|
+
- URL do app (obrigatorio): https://app.exemplo.com
|
|
53
|
+
- `--exact` | `--improve` | `--inspiration` (default: --exact)
|
|
54
|
+
|
|
55
|
+
**Perguntas que o comando faz (interativo):**
|
|
56
|
+
1. URL do app ✓ (do argumento)
|
|
57
|
+
2. Credenciais de login (se o app requer auth para ver features)
|
|
58
|
+
3. Stack desejada (ou usa builder-defaults.md)
|
|
59
|
+
4. Credenciais do banco (Supabase URL/key, etc.)
|
|
60
|
+
5. O que quer diferente do original (se --improve ou --inspiration)
|
|
61
|
+
</context>
|
|
62
|
+
|
|
63
|
+
<process>
|
|
64
|
+
Execute the clone-builder workflow from @~/.claude/up/workflows/clone-builder.md end-to-end.
|
|
65
|
+
|
|
66
|
+
**CRITICO:** Apos coletar URL e credenciais, ZERO interacao. Tudo autonomo.
|
|
67
|
+
</process>
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: up:dashboard
|
|
3
|
+
description: Abrir dashboard visual de monitoramento do builder em tempo real (http://localhost:4040)
|
|
4
|
+
argument-hint: "[porta]"
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Bash
|
|
7
|
+
- Read
|
|
8
|
+
---
|
|
9
|
+
<objective>
|
|
10
|
+
Iniciar o dashboard de monitoramento do UP Builder. Mostra em tempo real no browser:
|
|
11
|
+
- Progresso do build (% e barra visual)
|
|
12
|
+
- Fases (completas, atual, pendentes)
|
|
13
|
+
- Status atual (estagio, fase, passo)
|
|
14
|
+
- Metricas (commits, reports gerados)
|
|
15
|
+
- LOCK.md status (se builder ativo)
|
|
16
|
+
|
|
17
|
+
Servidor leve em Node.js puro (zero deps). Le `.plano/` e atualiza a cada 3 segundos.
|
|
18
|
+
</objective>
|
|
19
|
+
|
|
20
|
+
<context>
|
|
21
|
+
$ARGUMENTS
|
|
22
|
+
|
|
23
|
+
**Porta:** Default 4040. Pode especificar outra: `/up:dashboard 8080`
|
|
24
|
+
|
|
25
|
+
**Requer:** `.plano/` no diretorio atual (funciona com ou sem builder ativo).
|
|
26
|
+
</context>
|
|
27
|
+
|
|
28
|
+
<process>
|
|
29
|
+
1. Verificar que `.plano/` existe
|
|
30
|
+
2. Iniciar servidor em background:
|
|
31
|
+
```bash
|
|
32
|
+
node "$HOME/.claude/up/dashboard/server.js" ${PORT:-4040} "$(pwd)/.plano" &
|
|
33
|
+
DASH_PID=$!
|
|
34
|
+
echo "Dashboard rodando em http://localhost:${PORT:-4040} (PID: $DASH_PID)"
|
|
35
|
+
```
|
|
36
|
+
3. Informar ao usuario:
|
|
37
|
+
```
|
|
38
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
39
|
+
UP > DASHBOARD
|
|
40
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
41
|
+
|
|
42
|
+
Dashboard: http://localhost:${PORT:-4040}
|
|
43
|
+
Monitorando: .plano/
|
|
44
|
+
Atualiza a cada 3 segundos.
|
|
45
|
+
|
|
46
|
+
Para parar: kill $DASH_PID
|
|
47
|
+
```
|
|
48
|
+
</process>
|
package/commands/depurar.md
CHANGED
|
@@ -14,7 +14,7 @@ Depurar problemas usando metodo cientifico com isolamento em subagente.
|
|
|
14
14
|
|
|
15
15
|
**Papel do orquestrador:** Coletar sintomas, spawnar agente up-depurador, lidar com checkpoints, spawnar continuacoes.
|
|
16
16
|
|
|
17
|
-
**Por que subagente:** Investigacao consome contexto rapidamente (lendo arquivos, formando hipoteses, testando). Contexto fresco de
|
|
17
|
+
**Por que subagente:** Investigacao consome contexto rapidamente (lendo arquivos, formando hipoteses, testando). Contexto fresco de 200k por investigacao. Contexto principal permanece enxuto para interacao com usuario.
|
|
18
18
|
</objective>
|
|
19
19
|
|
|
20
20
|
<context>
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: up:mobile-first
|
|
3
|
+
description: Tornar sistema responsivo para mobile/tablet sem quebrar desktop — detecta problemas via Playwright e corrige automaticamente
|
|
4
|
+
argument-hint: "[--no-fix] [--page /rota] [porta]"
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Read
|
|
7
|
+
- Write
|
|
8
|
+
- Edit
|
|
9
|
+
- Glob
|
|
10
|
+
- Grep
|
|
11
|
+
- Bash
|
|
12
|
+
- Task
|
|
13
|
+
- AskUserQuestion
|
|
14
|
+
- mcp__plugin_playwright_playwright__*
|
|
15
|
+
---
|
|
16
|
+
<objective>
|
|
17
|
+
Mobile First: abrir o sistema no browser em multiplos viewports, detectar o que quebra no mobile/tablet e corrigir automaticamente SEM mexer na experiencia desktop.
|
|
18
|
+
|
|
19
|
+
Desktop e a referencia sagrada. Cada correcao e verificada: se desktop mudou, reverte.
|
|
20
|
+
|
|
21
|
+
**Standalone:** Funciona em qualquer projeto, qualquer momento. NAO requer /up:novo-projeto ou .plano/.
|
|
22
|
+
**Builder:** Tambem integrado no modo builder (Estagio 4 — Polish).
|
|
23
|
+
|
|
24
|
+
**Detecta problemas:** overflow horizontal, texto ilegivel, alvos de toque pequenos, grid/flex quebrado, imagens distorcidas, navegacao que nao cabe, modais que estourem, sidebar fixa, sobreposicao de elementos.
|
|
25
|
+
|
|
26
|
+
**Corrige com:** classes Tailwind responsivas (sm:/md:/lg:), media queries CSS, componentes novos (hamburger menu, drawer, tabela responsiva), ajustes de layout.
|
|
27
|
+
|
|
28
|
+
**Output:** `.plano/mobile-review/MOBILE-REPORT.md` com score de responsividade, problemas por pagina, screenshots antes/depois em todos viewports.
|
|
29
|
+
</objective>
|
|
30
|
+
|
|
31
|
+
<execution_context>
|
|
32
|
+
@~/.claude/up/workflows/mobile-first.md
|
|
33
|
+
@~/.claude/up/references/ui-brand.md
|
|
34
|
+
</execution_context>
|
|
35
|
+
|
|
36
|
+
<context>
|
|
37
|
+
$ARGUMENTS
|
|
38
|
+
|
|
39
|
+
**Flags:**
|
|
40
|
+
- `--no-fix` — Apenas escanear e gerar relatorio, NAO corrigir
|
|
41
|
+
- `--page /rota` — Testar apenas uma pagina especifica (ex: `--page /dashboard`)
|
|
42
|
+
|
|
43
|
+
**Argumentos opcionais:**
|
|
44
|
+
- Porta: `3000` ou `http://localhost:3000` (default: detecta automaticamente)
|
|
45
|
+
|
|
46
|
+
**Exemplos:**
|
|
47
|
+
```
|
|
48
|
+
/up:mobile-first # Escanear tudo e corrigir
|
|
49
|
+
/up:mobile-first --no-fix # Apenas relatorio
|
|
50
|
+
/up:mobile-first --page /dashboard # Apenas uma pagina
|
|
51
|
+
/up:mobile-first 5173 # Especificar porta
|
|
52
|
+
/up:mobile-first --page /settings 3000 # Combinar flags
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
**Cria .plano/mobile-review/ automaticamente** (standalone, sem pre-requisitos).
|
|
56
|
+
</context>
|
|
57
|
+
|
|
58
|
+
<process>
|
|
59
|
+
Execute the mobile-first workflow from @~/.claude/up/workflows/mobile-first.md end-to-end.
|
|
60
|
+
|
|
61
|
+
Preserve all workflow gates:
|
|
62
|
+
1. Setup (detectar CSS stack, subir server, descobrir paginas)
|
|
63
|
+
2. Scan (capturar todas paginas em mobile/tablet/desktop, detectar problemas)
|
|
64
|
+
3. Analyze (mapear problema → arquivo → estrategia de fix)
|
|
65
|
+
4. Fix (corrigir cada problema, verificar desktop intacto apos cada um)
|
|
66
|
+
5. Report (MOBILE-REPORT.md com screenshots comparativos)
|
|
67
|
+
6. Cleanup (matar server, fechar browser)
|
|
68
|
+
|
|
69
|
+
**Flag --no-fix:** Se presente, pular passo 4 (Fix). Apenas escanear e reportar.
|
|
70
|
+
**Flag --page:** Se presente, filtrar para apenas a pagina especificada.
|
|
71
|
+
</process>
|