@lume.produtos/intelidente-agent-tools 1.0.0 → 1.0.2

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.
@@ -4,6 +4,7 @@ import { fileURLToPath } from 'node:url';
4
4
  import fs from 'node:fs';
5
5
  import path from 'node:path';
6
6
  import process from 'node:process';
7
+ import os from 'node:os';
7
8
 
8
9
  /*
9
10
  |--------------------------------------------------------------------------
@@ -57,11 +58,9 @@ const targets = targetArg
57
58
  ? targetArg
58
59
  .replace('--targets=', '')
59
60
  .split(/[,\s]+/)
60
- .map(item => item.trim())
61
+ .map(item => item.trim().toLowerCase())
61
62
  .filter(Boolean)
62
63
  : ['claude', 'codex'];
63
-
64
- console.log(targets);
65
64
 
66
65
  /*
67
66
  |--------------------------------------------------------------------------
@@ -96,6 +95,8 @@ if (!name) {
96
95
 
97
96
  const projectPath = process.cwd();
98
97
 
98
+ const userHome = os.homedir();
99
+
99
100
  const __filename = fileURLToPath(import.meta.url);
100
101
  const __dirname = path.dirname(__filename);
101
102
 
@@ -105,6 +106,8 @@ const packagePath = path.resolve(__dirname, '..');
105
106
  |--------------------------------------------------------------------------
106
107
  | Claude
107
108
  |--------------------------------------------------------------------------
109
+ | Claude fica LOCAL no projeto
110
+ |--------------------------------------------------------------------------
108
111
  */
109
112
 
110
113
  if (targets.includes('claude')) {
@@ -141,7 +144,7 @@ if (targets.includes('claude')) {
141
144
  fs.copyFileSync(claudeSource, claudeTarget);
142
145
 
143
146
  console.log(
144
- `✓ Claude command instalado: ${name}`
147
+ `✓ Claude command instalado: ${claudeTarget}`
145
148
  );
146
149
  }
147
150
 
@@ -149,6 +152,8 @@ if (targets.includes('claude')) {
149
152
  |--------------------------------------------------------------------------
150
153
  | Codex
151
154
  |--------------------------------------------------------------------------
155
+ | Codex fica GLOBAL no usuário
156
+ |--------------------------------------------------------------------------
152
157
  */
153
158
 
154
159
  if (targets.includes('codex')) {
@@ -163,7 +168,7 @@ if (targets.includes('codex')) {
163
168
  );
164
169
 
165
170
  const codexTarget = path.join(
166
- projectPath,
171
+ userHome,
167
172
  '.codex',
168
173
  'skills',
169
174
  name
@@ -181,7 +186,7 @@ if (targets.includes('codex')) {
181
186
  copyDir(codexSource, codexTarget);
182
187
 
183
188
  console.log(
184
- `✓ Codex skill instalada: ${name}`
189
+ `✓ Codex skill instalada: ${codexTarget}`
185
190
  );
186
191
  }
187
192
 
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@lume.produtos/intelidente-agent-tools",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Installer for Intelidente Claude commands and Codex skills",
5
5
  "type": "module",
6
6
  "bin": {
7
- "intelidente-agent-tools": "bin/intelidente-agent-tools.js"
8
- },
7
+ "intelidente-agent-tools": "bin/intelidente-agent-tools.js"
8
+ },
9
9
  "files": [
10
10
  "bin",
11
11
  "templates"
12
12
  ],
13
13
  "license": "MIT"
14
- }
14
+ }
@@ -1,3 +1,150 @@
1
- # Command Criar Testes
1
+ ---
2
+ description: Cria testes a partir das planilhas padrao em docs/testing/criar e move os roteiros concluidos para docs/testing/executado.
3
+ allowed-tools: Read, Write, Edit, MultiEdit, Bash, Glob, Grep, LS, TodoWrite
4
+ ---
2
5
 
3
- Esse é um comando de teste.
6
+ Voce e o agente `criar-testes` deste repositorio. Sua tarefa e transformar as planilhas padrao pendentes em `docs/testing/criar` em testes automatizados reais no projeto indicado pela propria planilha.
7
+
8
+ ## Entrada
9
+
10
+ - Leia todos os arquivos em `docs/testing/criar`.
11
+ - Ignore arquivos temporarios ou de lock, especialmente arquivos iniciados por `~$`.
12
+ - O formato principal aceito e `.xlsx`.
13
+ - A planilha precisa seguir o padrao com as colunas:
14
+ - `Projeto`
15
+ - `Teste`
16
+ - `Acao`
17
+ - `Descricao`
18
+ - `Como Fazer`
19
+ - Se um arquivo nao seguir esse padrao, ignore o arquivo e informe no resumo final que ele foi ignorado por estar fora do formato esperado.
20
+ - Se a pasta estiver vazia, responda apenas que nao existem roteiros pendentes.
21
+
22
+ ## Como trabalhar
23
+
24
+ 1. Abra a planilha e leia as linhas validas.
25
+ 2. Agrupe as linhas por `Projeto` e por `Teste`.
26
+ 3. Use a coluna `Projeto` para decidir onde procurar/criar os testes. Exemplos:
27
+ - `agenda` normalmente fica em `e2e/agenda`.
28
+ - `data-import` deve ser tratado como outro projeto, procurando arquivos e comandos relacionados a `data-import`.
29
+ - Para qualquer outro valor, procure no repo por testes, scripts e pastas que combinem com o nome do projeto.
30
+ 4. A pasta do projeto dentro de `e2e` e obrigatoria: crie `e2e/<projeto>` quando ela ainda nao existir, usando o valor normalizado da coluna `Projeto` em kebab-case/minusculo. Exemplos: `agenda` -> `e2e/agenda`; `data import` -> `e2e/data-import`.
31
+ 5. Nao crie specs diretamente em `e2e/` quando a planilha tiver `Projeto`; coloque os arquivos do roteiro dentro de `e2e/<projeto>`.
32
+ 6. Dentro de cada grupo de `Teste`, siga as linhas na ordem da planilha. Cada linha representa uma acao do roteiro.
33
+ 7. Use `Acao` como identificador tecnico do passo.
34
+ 8. Use `Descricao` para entender o objetivo esperado.
35
+ 9. Use `Como Fazer` como instrucao operacional principal para criar o passo no teste.
36
+ 10. Entenda o roteiro de teste inteiro antes de editar codigo.
37
+ 11. Procure testes existentes relacionados ao projeto informado na coluna `Projeto`.
38
+ 12. Antes de criar qualquer passo, verifique se a `Acao` da linha ja existe nos testes do projeto ou se o comportamento ja foi coberto por um passo criado anteriormente no mesmo processamento.
39
+ 13. Considere a acao existente quando encontrar o identificador tecnico da coluna `Acao`, o mesmo comportamento descrito em `Descricao`/`Como Fazer`, ou logs claros que comprovem a cobertura do passo.
40
+ 14. Se a acao ja existir ou ja tiver sido criada, nao duplique o codigo; apenas reaproveite o fluxo existente e informe isso no resumo final.
41
+ 15. Reutilize helpers, fixtures, seletores e padroes ja usados no projeto.
42
+ 16. Crie ou atualize os testes necessarios para cobrir apenas os passos ainda nao atendidos do roteiro.
43
+ 17. Registre os passos importantes em `console.log` usando prefixo claro derivado do projeto, por exemplo `[AGENDA]` ou `[DATA-IMPORT]`.
44
+ 18. Use seletores Playwright resilientes: `getByRole`, labels, placeholders e texto visivel quando possivel.
45
+ 19. Evite depender de cores exatas ou posicoes fragiles, salvo quando for inevitavel.
46
+ 20. Quando houver dados variaveis, salve nomes, datas e horarios em variaveis e logue o valor usado.
47
+ 21. Nao remova fluxos existentes sem necessidade. Acrescente o novo comportamento no ponto correto do teste.
48
+ 22. Se um passo do roteiro estiver ambiguo, faca a melhor inferencia a partir dos testes existentes e registre a decisao no resumo final.
49
+
50
+ ## Validacao
51
+
52
+ - Rode o teste afetado quando for viavel.
53
+ - Os testes devem ler credenciais por `process.env.E2E_USER` e `process.env.E2E_PASSWORD`.
54
+ - O login de teste deve ficar no arquivo `.env.test` dentro do app/projeto correspondente, por exemplo `apps/agenda/.env.test`.
55
+ - Antes de rodar E2E, verifique se `E2E_USER` e `E2E_PASSWORD` existem no `.env.test` do projeto. Se o projeto ainda nao tiver `.env.test` ou se as variaveis estiverem ausentes, avise o usuario e nao invente credenciais.
56
+ - Para agenda, o `playwright.config.ts` ja carrega automaticamente `apps/agenda/.env.test` antes dos testes.
57
+ - Se as variaveis nao existirem, oriente o usuario a configurar o arquivo do app, por exemplo:
58
+ - `apps/<projeto>/.env.test`, com `E2E_USER=<usuario>` e `E2E_PASSWORD=<senha>`.
59
+ - Nunca grave senha real em comandos Markdown ou logs.
60
+ - Descubra o comando correto pelo projeto informado na coluna `Projeto`, consultando `package.json`, `playwright.config.ts`, scripts do monorepo e testes existentes.
61
+ - Exemplos:
62
+
63
+ Agenda:
64
+
65
+ ```powershell
66
+ pnpm test:e2e --project=agenda e2e/agenda/selecao-profissional.spec.ts
67
+ ```
68
+
69
+ Projeto generico Playwright, quando houver project correspondente:
70
+
71
+ ```powershell
72
+ pnpm test:e2e --project=<projeto>
73
+ ```
74
+
75
+ - Nao assuma que todo roteiro pertence a agenda.
76
+ - Nao use `e2e/agenda` se a coluna `Projeto` indicar outro projeto.
77
+
78
+ - Se a validacao falhar por instabilidade externa, login, ambiente ou backend, explique isso no resumo e deixe claro ate onde o teste executou.
79
+ - Corrija falhas do teste que forem causadas pela implementacao criada.
80
+
81
+ ## Resultado JSON e Blob Storage
82
+
83
+ - O projeto usa o reporter `e2e/blob-log-reporter.ts`, configurado em `playwright.config.ts`.
84
+ - Todo processamento que rodar Playwright deve gerar um JSON local em `test-results/blob-logs`.
85
+ - O nome do arquivo deve seguir o padrao do reporter:
86
+ - `<projeto>-e2e-<startedAt ISO sem ":" e ".">-<status>.json`, quando houver um unico projeto.
87
+ - `multi-project-e2e-<startedAt ISO sem ":" e ".">-<status>.json`, quando houver mais de um projeto.
88
+ - Exemplos: `agenda-e2e-2026-05-15T14-37-39-743Z-passed.json`, `data-import-e2e-2026-05-15T14-37-39-743Z-failed.json`.
89
+ - O JSON deve ter este formato:
90
+
91
+ ```json
92
+ {
93
+ "status": "passed",
94
+ "startedAt": "2026-05-15T14:37:39.743Z",
95
+ "finishedAt": "2026-05-15T14:38:12.120Z",
96
+ "durationMs": 32377,
97
+ "tests": [
98
+ {
99
+ "title": "Agenda - login > login completo + redirect para a tela da agenda",
100
+ "project": "agenda",
101
+ "file": "e2e/agenda/login.spec.ts",
102
+ "line": 9,
103
+ "status": "passed",
104
+ "durationMs": 12000,
105
+ "retry": 0,
106
+ "stdout": ["[AGENDA] Agenda autenticada validada."],
107
+ "stderr": [],
108
+ "errors": []
109
+ }
110
+ ]
111
+ }
112
+ ```
113
+
114
+ - Para enviar o JSON ao Blob Storage, configure `E2E_BLOB_LOG_UPLOAD_URL` no `.env.test` do projeto, preferencialmente como template com `{fileName}`:
115
+
116
+ ```env
117
+ E2E_BLOB_LOG_UPLOAD_URL=https://<account>.blob.core.windows.net/<container>/e2e/{fileName}?<sas>
118
+ ```
119
+
120
+ - Tambem e aceito um URL de container/pasta com SAS sem `{fileName}`; nesse caso o reporter acrescenta o nome do arquivo antes da query string.
121
+ - Nao exponha SAS/token real no resumo final. Informe apenas se a variavel estava configurada e se o upload foi executado, ignorado ou falhou.
122
+
123
+ ## Finalizacao
124
+
125
+ Depois que os testes forem criados e validados tanto quanto possivel, a movimentacao dos roteiros concluidos e obrigatoria. Nao finalize a resposta sem executar esta etapa ou explicar claramente por que ela nao pode ser executada.
126
+
127
+ 1. Mova cada arquivo de planilha concluido de `docs/testing/criar` para `docs/testing/executado`.
128
+ 2. Nao mova arquivos temporarios iniciados por `~$`.
129
+ 3. Nao mova arquivos ignorados por estarem fora do padrao esperado; mantenha-os em `docs/testing/criar`.
130
+ 4. Se ja existir arquivo com o mesmo nome em `executado`, preserve ambos usando um sufixo com data/hora.
131
+ 5. Execute a movimentacao com comando real no filesystem. Em PowerShell, use `Move-Item -LiteralPath <arquivo> -Destination <destino>`.
132
+ 6. Depois de mover, liste `docs/testing/criar` e `docs/testing/executado` para confirmar que:
133
+ - os arquivos concluidos sairam de `criar`;
134
+ - os arquivos concluidos aparecem em `executado`;
135
+ - os arquivos temporarios `~$*` continuam ignorados.
136
+ 7. No resumo final, informe:
137
+ - arquivos de planilha processados;
138
+ - arquivos ignorados por formato invalido;
139
+ - arquivos movidos para `docs/testing/executado`;
140
+ - arquivos que permaneceram em `docs/testing/criar` e o motivo;
141
+ - projetos encontrados na coluna `Projeto`;
142
+ - acoes novas, acoes reaproveitadas e acoes ignoradas por ja existirem;
143
+ - arquivos de teste alterados/criados;
144
+ - comando de validacao executado;
145
+ - resultado da validacao;
146
+ - qualquer passo que ficou pendente ou inferido.
147
+
148
+ ## Regra importante
149
+
150
+ So mova um roteiro para `docs/testing/executado` quando ele tiver sido realmente tratado. Se encontrar um bloqueio que impeca criar os testes, mantenha o arquivo em `docs/testing/criar` e explique o motivo.
@@ -0,0 +1,128 @@
1
+ ---
2
+ name: criar-testes
3
+ description: Use when Codex needs to create or update automated E2E tests from spreadsheet test scripts in docs/testing/criar, especially for Intelidente microfrontends. Reads .xlsx files with Projeto, Teste, Acao, Descricao, and Como Fazer columns; creates or reuses Playwright tests; validates when viable; and moves completed spreadsheets to docs/testing/executado.
4
+ ---
5
+
6
+ # Criar Testes
7
+
8
+ Use this skill to process pending spreadsheet-based test scripts and turn them into real automated tests.
9
+
10
+ ## Expected Repository Shape
11
+
12
+ - Pending scripts live in `docs/testing/criar`.
13
+ - Completed scripts must be moved to `docs/testing/executado`.
14
+ - Ignore temporary Excel lock files such as `~$*.xlsx`.
15
+ - The primary accepted format is `.xlsx`.
16
+ - The expected columns are:
17
+ - `Projeto`
18
+ - `Teste`
19
+ - `Acao`
20
+ - `Descricao`
21
+ - `Como Fazer`
22
+
23
+ ## Workflow
24
+
25
+ 1. List `docs/testing/criar`.
26
+ 2. If there are no non-temporary files, report that there are no pending scripts.
27
+ 3. Read each valid spreadsheet.
28
+ 4. Ignore files outside the expected format and report them in the final summary.
29
+ 5. Group rows by `Projeto` and then by `Teste`.
30
+ 6. Use `Projeto` to find the correct E2E area:
31
+ - `agenda` usually maps to `e2e/agenda`.
32
+ - Other projects must be discovered from repo folders, Playwright projects, scripts, and existing tests.
33
+ 7. Create the project folder under `e2e` when it does not exist. The folder is mandatory and must be based on the normalized `Projeto` value, for example `agenda` -> `e2e/agenda` and `data import` -> `e2e/data-import`.
34
+ 8. Do not create project specs directly under `e2e/` when the spreadsheet has a `Projeto` value; place them under `e2e/<projeto>`.
35
+ 9. Read existing tests before editing.
36
+ 10. For each row, treat `Acao` as the technical step identifier, `Descricao` as the expected intent, and `Como Fazer` as the operational instruction.
37
+ 11. Before creating code, verify whether the action already exists or whether the same behavior is already covered.
38
+ 12. Consider an action existing when the identifier, behavior, or clear logs already cover it.
39
+ 13. Do not duplicate existing actions. Reuse the existing flow and report reused actions.
40
+ 14. Create or update only the tests needed for uncovered actions.
41
+ 15. Reuse local helpers, fixtures, selectors, and Playwright patterns.
42
+ 16. Prefer resilient Playwright selectors such as `getByRole`, labels, placeholders, visible text, and stable DOM attributes.
43
+ 17. Add meaningful `console.log` entries with a project prefix such as `[AGENDA]`.
44
+ 18. Keep variable data such as names, dates, and times in variables and log the chosen values.
45
+ 19. Do not remove unrelated flows.
46
+
47
+ ## Validation
48
+
49
+ - Run the affected test when viable.
50
+ - E2E tests must read credentials from `process.env.E2E_USER` and `process.env.E2E_PASSWORD`.
51
+ - Test login credentials must live in the app/project `.env.test` file, for example `apps/agenda/.env.test`.
52
+ - Before running E2E, check whether the project `.env.test` exists and contains `E2E_USER` and `E2E_PASSWORD`.
53
+ - If the file or variables are missing, tell the user to configure `apps/<projeto>/.env.test` with `E2E_USER=<user>` and `E2E_PASSWORD=<password>`; do not invent credentials.
54
+ - For agenda, `playwright.config.ts` automatically loads `apps/agenda/.env.test` before agenda tests run.
55
+ - Never write real passwords into Markdown commands or logs.
56
+ - Discover the correct command from `package.json`, `playwright.config.ts`, workspace scripts, and existing test conventions.
57
+ - Do not assume every script belongs to `agenda`.
58
+ - If validation fails because of login, backend, environment, or instability, explain how far execution got.
59
+ - Fix failures caused by the newly created implementation.
60
+
61
+ ## JSON Result and Blob Storage
62
+
63
+ - Use the existing reporter `e2e/blob-log-reporter.ts`, configured in `playwright.config.ts`, for Playwright result JSON.
64
+ - Every Playwright validation should write a JSON file under `test-results/blob-logs`.
65
+ - The file name must follow the reporter pattern:
66
+ - `<projeto>-e2e-<startedAt ISO without ":" or ".">-<status>.json` for a single project.
67
+ - `multi-project-e2e-<startedAt ISO without ":" or ".">-<status>.json` for multiple projects.
68
+ - Examples: `agenda-e2e-2026-05-15T14-37-39-743Z-passed.json`, `data-import-e2e-2026-05-15T14-37-39-743Z-failed.json`.
69
+ - The JSON payload must have this shape:
70
+
71
+ ```json
72
+ {
73
+ "status": "passed",
74
+ "startedAt": "2026-05-15T14:37:39.743Z",
75
+ "finishedAt": "2026-05-15T14:38:12.120Z",
76
+ "durationMs": 32377,
77
+ "tests": [
78
+ {
79
+ "title": "Agenda - login > login completo + redirect para a tela da agenda",
80
+ "project": "agenda",
81
+ "file": "e2e/agenda/login.spec.ts",
82
+ "line": 9,
83
+ "status": "passed",
84
+ "durationMs": 12000,
85
+ "retry": 0,
86
+ "stdout": ["[AGENDA] Agenda autenticada validada."],
87
+ "stderr": [],
88
+ "errors": []
89
+ }
90
+ ]
91
+ }
92
+ ```
93
+
94
+ - To upload the JSON to Blob Storage, configure `E2E_BLOB_LOG_UPLOAD_URL` in the project `.env.test`, preferably with a `{fileName}` placeholder:
95
+
96
+ ```env
97
+ E2E_BLOB_LOG_UPLOAD_URL=https://<account>.blob.core.windows.net/<container>/e2e/{fileName}?<sas>
98
+ ```
99
+
100
+ - A container/folder SAS URL without `{fileName}` is also accepted; the reporter appends the generated file name before the query string.
101
+ - Never expose the real SAS/token in the final summary. Report only whether the variable was configured and whether upload was executed, skipped, or failed.
102
+
103
+ ## Required Finalization
104
+
105
+ After a spreadsheet has been genuinely treated, moving it is mandatory:
106
+
107
+ 1. Move each completed spreadsheet from `docs/testing/criar` to `docs/testing/executado`.
108
+ 2. Do not move temporary `~$*` files.
109
+ 3. Do not move invalid or blocked files.
110
+ 4. If the destination filename already exists, preserve both files by adding a date/time suffix to the moved file.
111
+ 5. Execute the move with a real filesystem command, for example PowerShell `Move-Item -LiteralPath <file> -Destination <destination>`.
112
+ 6. After moving, list both folders to confirm completed files left `criar` and appeared in `executado`.
113
+
114
+ Do not send the final answer until the move step has been executed or a concrete blocker has been reported.
115
+
116
+ ## Final Summary
117
+
118
+ Include:
119
+
120
+ - spreadsheets processed;
121
+ - spreadsheets ignored because of invalid format;
122
+ - spreadsheets moved to `docs/testing/executado`;
123
+ - spreadsheets left in `docs/testing/criar` and why;
124
+ - projects found in the `Projeto` column;
125
+ - new actions, reused actions, and actions skipped because they already existed;
126
+ - test files created or changed;
127
+ - validation command and result;
128
+ - any inferred or pending steps.
@@ -0,0 +1,3 @@
1
+ display_name: Criar Testes
2
+ short_description: Cria testes E2E a partir de planilhas pendentes.
3
+ default_prompt: Use esta skill para ler roteiros em docs/testing/criar, criar ou reaproveitar testes E2E e mover roteiros concluidos para docs/testing/executado.