register-screen
Skill0 starsChanged 6 months agoMITView on GitHub
Registra uma nova tela no Screen Registry do frontend (frontend/src/shared/shell/screens.registry.ts). Valida o formato do code (MOD-ENT-NNN), unicidade e profundidade do menuPath, e injeta a entrada ScreenDefinition no manifesto. Argumentos: code title path menuPath icon (ver argument-hint).
In this repository27 other files it gives its agents.
- frontend/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- frontend/CLAUDE.mdCLAUDE.md
- add-entity-to-auditSkill
- auditSkill
- babysit-prsSkill
- batchSkill
- daily-summarySkill
- factory-metricsSkill
- feature-frontSkill
- featureSkill
- init-projectSkill
- migrateSkill
- planSkill
- review-archSkill
- review-frontSkill
- review-prSkill
- setup-architectureSkill
- setup-designSkill
- setup-infraSkill
- shipSkill
- tasksSkill
- watch-ciSkill
- write-jobSkill
- write-migrationSkill
- write-reportSkill
- write-testSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 104
Use a ferramenta Edit para inserir uma nova entrada ScreenDefinition no array screens de frontend/src/shared/shell/screens.registry.ts, …
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Voce deve registrar uma nova tela no Screen Registry declarativo do frontend
do projeto financas-lab. O registry e a fonte de verdade do menu hierarquico e
do Command Palette (ADR-014, fase UI-1; docs/frontend-master-spec.md secao 4.1
e 4.3).
Execute todos os passos em ordem. Pare e reporte ao operador se qualquer validacao falhar -- nao adivinhe valores.
Contrato real do registry
Arquivo alvo: frontend/src/shared/shell/screens.registry.ts.
A skill manipula o array screens: ScreenDefinition[] exportado nesse arquivo.
O tipo ScreenDefinition (definido no proprio arquivo) e:
interface ScreenDefinition {
code: string // MOD-ENT-NNN
title: string
path: string
menuPath: string[] // hierarquia, max 3 niveis
icon: string // nome do icone lucide-react
permissions: string[] // vazio nesta fase (RBAC fora do escopo)
}O arquivo tambem exporta as constantes SCREEN_CODE_REGEX e MAX_MENU_DEPTH
e os helpers getAllScreens(), findScreenByCode(code) e
findScreenByPath(path). Esta skill usa o regex e o limite de profundidade
abaixo, que devem coincidir com essas constantes.
Definicoes dos argumentos
$ARGUMENTS traz, em ordem: code, title, path, menuPath, icon.
O menuPath e informado como segmentos separados por > (ex:
Cadastros > Financeiro > Contas) e deve ser convertido para um array de
strings.
Se algum argumento estiver ausente: escreva o erro abaixo e termine.
ERRO: /register-screen requer 5 argumentos.
Uso:
/register-screen <code> <title> <path> "<menuPath com ' > '>" <icon>
Exemplo:
/register-screen FIN-INV-001 Investimentos /investimentos "Cadastros > Financeiro > Investimentos" walletPasso 0 -- Validacoes (ADR-011)
Validacao 1 -- formato do code:
Verifique que code casa com o regex ^[A-Z]{3}-[A-Z]{3}-\d{3}$ (formato
MOD-ENT-NNN da spec secao 4.3 / constante SCREEN_CODE_REGEX). Se nao casar:
escreva ERRO: code invalido. Formato esperado MOD-ENT-NNN (ex: FIN-CTA-001).
e termine. Code invalido e bloqueador.
Validacao 2 -- unicidade do code:
Leia frontend/src/shared/shell/screens.registry.ts com a ferramenta Read.
Verifique se ja existe alguma entrada no array screens com o mesmo code.
Se existir: escreva
ERRO (BLOQUEADOR): code <code> ja registrado no screens.registry.ts. Escolha outro sequencial.
e termine. Code duplicado e bloqueador -- a skill para e nao injeta nada.
Validacao 3 -- profundidade do menuPath:
Converta menuPath para array. Se o array tiver mais de MAX_MENU_DEPTH (3)
segmentos: escreva
ERRO: menuPath tem N niveis; o maximo permitido e 3 (spec secao 4.1).
e termine.
Se o array tiver 0 segmentos: escreva
ERRO: menuPath nao pode ser vazio -- a tela precisa de ao menos um grupo/folha.
e termine.
Validacao 4 -- path unico (aviso):
Verifique se ja existe entrada com o mesmo path. Se existir, isso nao e
bloqueador, mas avise: AVISO: ja existe uma tela com path <path>. e pergunte
ao operador se deseja continuar.
Passo 1 -- Validar o icone
O campo icon deve ser um nome valido de icone do lucide-react, na
convencao kebab-case usada pelo registry (ex: credit-card, bar-chart-3,
alert-triangle). Verifique que o icone existe no mapa
frontend/src/shared/shell/icon-map.ts:
- Se o nome ja estiver em
iconMap: ok, prossiga. - Se NAO estiver: o icone novo precisa ser adicionado ao
iconMapantes que o menu consiga renderiza-lo. Oriente o operador a adicionar o import do icone lucide-react correspondente e a entrada noiconMap, OU escolha um icone ja mapeado. Nao injete a tela com um icone fora do mapa sem registrar isso no relatorio final como pendencia.
Passo 2 -- Injetar a entrada no registry
Use a ferramenta Edit para inserir uma nova entrada ScreenDefinition no array
screens de frontend/src/shared/shell/screens.registry.ts, ANTES do
fechamento ] do array. Preserve a ordem das entradas existentes (a nova vai
ao final do array) e a formatacao (indentacao de 2 espacos, mesma estrutura das
entradas existentes, virgula final).
Formato da entrada a inserir:
{
code: '<code>',
title: '<title>',
path: '<path>',
menuPath: [<segmentos como strings entre aspas, separados por virgula>],
icon: '<icon>',
permissions: [],
},permissions e sempre [] nesta fase -- RBAC esta fora do escopo (ADR-014
decisao 9).
Passo 3 -- Verificacao pos-injecao
- Releia o arquivo e confirme que a nova entrada esta presente, bem formada e que o array continua sintaticamente valido (virgulas, colchetes).
Confirme que o TypeScript continua compilando:
cd frontend && npx tsc --noEmit --project tsconfig.jsonSe houver erro de TypeScript causado pela entrada nova: corrija a entrada. Erros pre-existentes em outros arquivos: ignore.
Passo 4 -- Relatorio final
Produza o relatorio:
/register-screen concluido.
Tela registrada no screens.registry.ts:
code: <code>
title: <title>
path: <path>
menuPath: <menuPath unido por ' / '>
icon: <icon>
Proximos passos:
1. Garantir que a rota <path> existe em frontend/src/app/(dashboard)/
2. Se o icone for novo, conferir que foi adicionado ao icon-map.ts
3. npm run build (verificar sem erros)Se algum passo falhou, NAO emita o relatorio de sucesso -- reporte o erro encontrado e o estado do registry.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

