stribus/pygerengastos / .agents/skills/reversa-screen-translator
reversa-screen-translator
VerifiedQuinto agente do Time de Migração. Traduz as telas do sistema legado em especificações executáveis, fechando a lacuna entre o catálogo do design-system e o código pronto. Opera em duas fases. Fase 1: detecta plataforma origem/alvo, apresenta os modos (literal, modernizado, híbrido) e exige decisão humana, produzindo screen_modernization_decision.md. Fase 2: gera target_screens.md, screen_deviation_log.md e, quando o oráculo legado roda, golden files com manifest.yaml para o Inspector consumir. Ativação: /reversa-screen-translator (geralmente invocado por /reversa-migrate, entre Designer e Inspector).
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 18.6 KB |
| references/adapter-pairs.md | markdown | 6.6 KB |
| references/platform-detection.md | markdown | 5.9 KB |
| references/templates/golden_manifest.yaml | config | 2.8 KB |
| references/templates/inventory.schema.json | config | 5.1 KB |
| references/templates/screen_deviation_log.md | markdown | 2.2 KB |
| references/templates/screen_modernization_decision.md | markdown | 4.7 KB |
| references/templates/target_screens.md | markdown | 6.7 KB |
references/templates/target_screens.md
View on GitHub---
schemaVersion: 1
generatedAt: <ISO-8601>
reversa:
version: "x.y.z"
kind: target_screens
producedBy: screen-translator
mode: literal | modernized | hybrid
sourcePlatform: <slug>
targetPlatform: <slug>
adapter: <adapters/origem__alvo>
screenCount: <int>
hash: "sha256:<hash do corpo abaixo do front-matter>"
---
# Target Screens
> Especificação executável de cada tela do sistema novo, derivada do legado segundo o modo aprovado em `screen_modernization_decision.md`. Conteúdo textual preservado literalmente, salvo aprovação explícita de revisão linguística.
> Leitura primária para o codificador. Cada seção é um contrato.
## Resumo
- **Modo aplicado**: <literal | modernizado | híbrido>
- **Telas geradas**: <N>
- **Adapter**: <slug>
- **Tokens consumidos**: ver `_reversa_sdd/design-system/tokens.md` e `tokens-derived.md` quando aplicável
- **Golden files**: <N> em `_reversa_sdd/screens/golden/` (manifest em `golden/manifest.yaml`)
- **Deviations registradas**: <N> em `screen_deviation_log.md`
> Caso o legado não possua UI (sistema batch / API / daemon), substituir esta seção por:
> "Nenhuma tela detectada. Agente pulado em modo `skipped`. Próximo agente: Inspector."
---
## Tela: <nome-canonical>
**Origem**: `<arquivo-legado>:<linha-ou-paragrafo>`
**Modo aplicado**: literal | modernizado
**Componentes do design-system**: [<token1>, <token2>, ...]
**Pontos de interpolação**: `{{var1}}`, `{{var2}}`
**Transições de saída**: [<próxima tela ou evento>]
**Tela crítica?**: sim | não (consulta `reversa-detective` quando disponível)
### Especificação
> O bloco abaixo varia conforme o par origem→alvo e o modo. Veja `references/adapter-pairs.md` para o formato canônico de cada par. Exemplos abaixo.
#### Exemplo: COBOL TUI → Go CLI/TUI (literal)
```yaml
spec.kind: ansi-byte-stream
spec.normalize:
- trim_trailing_spaces: false
- line_endings: "\n"
spec.lines:
- bytes: "\x1b[96m╔══════════════════════════════════════════════════╗\x1b[0m\n"
- bytes: "\x1b[96m║ \x1b[93m▓▓▓ BANCO ATM ▓▓▓\x1b[96m ║\x1b[0m\n"
- bytes: "\x1b[96m║ \x1b[97m{{header_subtitle}}\x1b[96m ║\x1b[0m\n"
interpolations:
header_subtitle:
type: string
max_width: 16
source: literal "Caixa Eletronico" | literal "Acesso ao Sistema"
- bytes: "\x1b[96m╚══════════════════════════════════════════════════╝\x1b[0m\n"
spec.input_prompts:
- kind: accept-line
prompt_bytes: " \x1b[96m>>\x1b[97m Selecione uma opcao: \x1b[0m"
captures: opcao
valid: ["0", "1", "2", "3", "4", "5"]
```
#### Exemplo: Win32/Delphi VCL → Web SPA (modernizado)
```yaml
spec.kind: component-tree
spec.states: [idle, loading, error, success]
spec.root:
component: PageLayout
variant: form
children:
- component: Header
tokens: [color.brand-primary, typography.h1]
content:
text: "Cadastro de Cliente"
- component: Form
submit_event: cliente.create
children:
- component: FormField
name: nome
label: "Nome completo"
legacy_origin: "TForm1.edtNome"
validation:
required: true
max_length: 80
- component: FormField
name: cpf
label: "CPF"
legacy_origin: "TForm1.mskCPF"
mask: "999.999.999-99"
validation:
required: true
cpf: true
- component: ButtonRow
children:
- component: Button
variant: primary
label: "Salvar"
legacy_origin: "TForm1.btnSalvar"
action: form.submit
- component: Button
variant: ghost
label: "Cancelar"
legacy_origin: "TForm1.btnCancelar"
action: navigate.back
spec.state_messages:
loading: "Salvando..."
error: "{{error_message}}"
success: "Cliente cadastrado com sucesso."
```
#### Exemplo: HTML legado server-rendered → SPA componentizada (modernizado)
```yaml
spec.kind: route-component
spec.route: /clientes/novo
spec.layout: AppLayout
spec.states: [idle, loading, error, success]
spec.component:
component: ClientesNovoPage
legacy_origin: "/admin/cliente_novo.asp"
state:
cliente:
type: Cliente
initial: empty
children:
- component: PageTitle
content: "Novo Cliente"
- component: ClienteForm
props:
onSubmit: clienteService.create
initial: $state.cliente
spec.api_changes:
- legacy: POST /admin/cliente_novo.asp (form-urlencoded)
target: POST /api/clientes (application/json)
deviation: DEV-014
```
#### Exemplo: Android XML → Flutter (modernizado)
```yaml
spec.kind: composable
spec.name: ClienteListScreen
spec.legacy_origin: "app/src/main/res/layout/activity_cliente_list.xml + ClienteListActivity.java"
spec.states: [idle, loading, error, success]
spec.composable: |
Scaffold(
appBar: AppBar(title: Text("Clientes")),
body: Consumer<ClienteListVM>(
builder: (ctx, vm, _) => vm.loading
? CircularProgressIndicator()
: ListView.builder(
itemCount: vm.clientes.length,
itemBuilder: (_, i) => ClienteListTile(cliente: vm.clientes[i]),
),
),
floatingActionButton: FloatingActionButton(
onPressed: () => Navigator.pushNamed(ctx, '/clientes/novo'),
child: Icon(Icons.add),
),
)
spec.viewmodel:
name: ClienteListVM
legacy_origin: "ClienteListActivity.onResume"
methods:
- load(): chama clienteService.listar
```
### Pontos de divergência aceitos
- DEV-XXX: <descrição curta> (ver `screen_deviation_log.md#DEV-XXX`)
### Estados (apenas modo modernizado)
| Estado | Descrição | Conteúdo / mensagem |
|---|---|---|
| Idle | Estado padrão antes de qualquer ação | <conteúdo> |
| Loading | Operação assíncrona em curso | <spinner / skeleton> |
| Error | Falha na operação ou dado inválido | `{{error_message}}` |
| Success | Operação concluída com sucesso | <mensagem confirmação> |
> Em modo literal, esta seção pode ser omitida ou substituída por "preserva os estados do legado" se o legado não tiver disposição explícita de estados.
---
## Tela: <segunda-tela>
(repetir o bloco acima para cada tela)
---
## Apêndice: rastreabilidade ao inventário
| Tela do `target_screens.md` | Origem em `_reversa_sdd/ui/inventory.md` | Origem em `_reversa_sdd/screens/inventory.json` |
|---|---|---|
| <tela 1> | <linha do inventário> | <id do inventário interno> |
| <tela 2> | <linha do inventário> | <id do inventário interno> |
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation). | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK). | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |