@aksp/opencrew 1.9.0 → 1.10.0

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.
Files changed (36) hide show
  1. package/CHANGELOG.md +58 -0
  2. package/README.md +88 -4
  3. package/package.json +1 -1
  4. package/templates/AGENTS.md +10 -2
  5. package/templates/_opencrew/.opencrew-version +1 -1
  6. package/templates/_opencrew/core/best-practices/_catalog.yaml +5 -0
  7. package/templates/_opencrew/core/best-practices/documento-oficial.md +144 -0
  8. package/templates/_opencrew/core/modelos/documento-oficial.md +42 -0
  9. package/templates/_opencrew/core/prompts/design.prompt.md +1 -0
  10. package/templates/_opencrew/core/prompts/documento.prompt.md +134 -0
  11. package/templates/_opencrew/core/prompts/entrega.prompt.md +5 -4
  12. package/templates/_opencrew/core/scripts/documento/argumentos.mjs +50 -0
  13. package/templates/_opencrew/core/scripts/documento/corpo.mjs +51 -0
  14. package/templates/_opencrew/core/scripts/documento/estilos.mjs +42 -0
  15. package/templates/_opencrew/core/scripts/documento/gravar.mjs +44 -0
  16. package/templates/_opencrew/core/scripts/documento/linha.mjs +58 -0
  17. package/templates/_opencrew/core/scripts/documento/marcacoes.mjs +55 -0
  18. package/templates/_opencrew/core/scripts/documento/markdown.mjs +92 -0
  19. package/templates/_opencrew/core/scripts/documento/pacote.mjs +82 -0
  20. package/templates/_opencrew/core/scripts/documento/perfil.mjs +70 -0
  21. package/templates/_opencrew/core/scripts/documento/png.mjs +20 -0
  22. package/templates/_opencrew/core/scripts/documento/projeto.mjs +60 -0
  23. package/templates/_opencrew/core/scripts/documento/tabelas.mjs +57 -0
  24. package/templates/_opencrew/core/scripts/documento/timbre.mjs +64 -0
  25. package/templates/_opencrew/core/scripts/documento/xml.mjs +95 -0
  26. package/templates/_opencrew/core/scripts/documento/zip.mjs +86 -0
  27. package/templates/_opencrew/core/scripts/documento.mjs +150 -0
  28. package/templates/_opencrew/core/scripts/entrega/canais.mjs +7 -3
  29. package/templates/_opencrew/core/scripts/entrega/comparar.mjs +2 -2
  30. package/templates/_opencrew/core/scripts/entrega/copia.mjs +1 -1
  31. package/templates/_opencrew/core/scripts/entrega/documentos.mjs +104 -0
  32. package/templates/_opencrew/core/scripts/entrega/gravar.mjs +3 -3
  33. package/templates/_opencrew/core/scripts/entrega/leiame.mjs +3 -2
  34. package/templates/_opencrew/core/scripts/entrega/passos.mjs +12 -2
  35. package/templates/_opencrew/core/scripts/entrega/separar.mjs +3 -0
  36. package/templates/_opencrew/core/scripts/entregar.mjs +12 -5
package/CHANGELOG.md CHANGED
@@ -3,6 +3,64 @@
3
3
  All notable changes to opencrew are documented here.
4
4
  The format is based on [Keep a Changelog](https://keepachangelog.com/).
5
5
 
6
+ ## [1.10.0] — 2026-10-07
7
+
8
+ Fase U3b "Documento Word, com perfil de documento oficial" (`specs/fase-u3b-documento-word.md`).
9
+ Chega a quem já usa com um `npx @aksp/opencrew@latest update`; o papel timbrado é criado só quando
10
+ você pede.
11
+
12
+ Ainda não nesta versão: imagem no corpo do texto, link clicável, sumário, nota de rodapé e
13
+ numeração automática; logotipo em JPEG ou SVG; ler ou regravar um modelo `.dotx`; mais de um
14
+ perfil por projeto na entrega; PDF direto (o Word salva como PDF). O resultado foi conferido no
15
+ Word; no LibreOffice e no Google Docs, não.
16
+
17
+ ### Added
18
+ - **Documento Word.** O texto em markdown (`.md` ou `.txt`) vira um arquivo do Word (`.docx`) com
19
+ as mesmas palavras e os mesmos números, na mesma ordem. No chat: `/opencrew documento <arquivo>`
20
+ (ou "Documento Word" no menu). No terminal:
21
+ `node _opencrew/core/scripts/documento.mjs "<arquivo.md>"`. O Word sai ao lado do texto, com o
22
+ mesmo nome; `--saida` escolhe outra pasta ou outro nome. Antes, quem precisava de um documento
23
+ oficial mantinha um script à parte, com o texto dentro do código.
24
+ - **Papel timbrado (perfil de documento oficial).** Um arquivo de texto do projeto,
25
+ `_opencrew/_memory/documento-oficial.md`, guarda o logotipo (PNG), três linhas de cabeçalho, o
26
+ rodapé com "Página X de Y", as margens, a fonte e o tamanho da letra. Na primeira vez a IA
27
+ pergunta se você quer configurar e preenche o arquivo com as suas respostas; `--criar-perfil`
28
+ cria o arquivo a partir do modelo. O `update` não toca nele, e nenhum comando o sobrescreve.
29
+ - **Três marcações para documento.** `::: titulo` e `::: subtitulo` (centralizados),
30
+ `::: quebra-de-pagina` (o anexo começa em página nova) e `::: assinaturas` … `:::` (as linhas
31
+ de assinatura, duas por linha, com o nome e o cargo). Títulos `#`, `##` e `###`, tabelas, listas,
32
+ negrito e itálico saem como estilos do Word.
33
+ - **O texto oficial não muda.** Número de item escrito por você ("1.", "6.1.", "a)", "§ 1º") vai
34
+ como texto: nada é renumerado, reordenado nem corrigido.
35
+ - **Na entrega, a pasta `documentos/`.** O passo com `format: documento-oficial` sai como
36
+ `entrega/documentos/<nome>.docx`, com o papel timbrado do projeto, e o LEIA-ME ganha a seção
37
+ "Documentos", com o que conferir no Word. Sem papel timbrado configurado, a entrega avisa e
38
+ diz como criar. A cópia para a pasta do projeto leva `documentos/`
39
+ junto.
40
+ - **Guia `documento-oficial`** (o 23º guia de melhores práticas): ensina o redator a escrever um
41
+ texto que vira documento — um parágrafo por linha, número escrito à mão, anexo depois da quebra
42
+ de página, assinaturas no fim. Crews novas recebem esse formato no passo cujo resultado é um
43
+ documento para imprimir, assinar ou protocolar.
44
+ - **Avisos de conversão.** O relatório diz o que ficou como texto (imagem, marcação `:::`
45
+ desconhecida, bloco de assinaturas sem o `:::` final) e quantos caracteres inválidos foram
46
+ removidos. Aviso não impede o documento.
47
+
48
+ ### Changed
49
+ - **Um Word que já existe não é trocado em silêncio.** Se há um `.docx` diferente no destino, nada
50
+ é gravado e a IA pergunta antes de substituir (`--substituir`). Igual, byte a byte: nada a fazer.
51
+ - **Perfil com erro não gera documento.** Chave desconhecida, valor fora da faixa, logotipo que
52
+ não existe, não é PNG ou passa de 2 MB: a mensagem diz a linha, e nada é gravado.
53
+ - O menu "Mais opções" ganha "Documento Word".
54
+
55
+ ### Internal
56
+ - `documento.mjs` e os módulos de `scripts/documento/` (sem dependência, sem `node:zlib`, até 200
57
+ linhas cada): zip sem compressão, com CRC-32 próprio e data fixa — o mesmo texto, com o mesmo
58
+ perfil, dá o mesmo arquivo, byte a byte. `modelos/documento-oficial.md` é o modelo do perfil;
59
+ `prompts/documento.prompt.md`, o prompt da rota. O `src/` não mudou; o runner não cresceu (874
60
+ linhas).
61
+ - `AGENTS.md`: a regra 15 cita o `documento.mjs`; a regra 7 diz que abrir o `.docx` no Word não é
62
+ conferido pela porta.
63
+
6
64
  ## [1.9.0] — 2026-10-07
7
65
 
8
66
  Fase U3a, fatia 2 "Entrega no projeto" (`specs/fase-u3a2-entrega-no-projeto.md`). Chega a quem já
package/README.md CHANGED
@@ -36,6 +36,9 @@ dentro da sua IDE.**
36
36
  colar, as imagens e um `LEIA-ME.md` com o passo a passo. O que não está pronto fica marcado.
37
37
  - 📁 **Entrega no seu projeto** — a crew pergunta uma vez onde guardar e copia a entrega para uma
38
38
  pasta do seu projeto, uma subpasta por execução, sem sobrescrever nada.
39
+ - 📄 **Documento Word em papel timbrado** — ata, ofício, declaração: o texto em markdown vira um
40
+ arquivo do Word com as mesmas palavras, o seu logotipo no cabeçalho, "Página X de Y" no rodapé
41
+ e as linhas de assinatura. Um comando: `/opencrew documento <arquivo>`.
39
42
  - 🎛️ **Seleção inteligente de agentes** — o sistema analisa seu pedido e
40
43
  sugere quais agentes são necessários para aquela tarefa. Você confirma ou
41
44
  ajusta com um clique. Agentes pulados não gastam tokens naquele run.
@@ -181,10 +184,11 @@ meu-projeto/
181
184
  │ │ ├── runner.pipeline.md ← executor de pipeline
182
185
  │ │ ├── skills.engine.md ← gerenciador de skills
183
186
  │ │ ├── architect.agent.yaml ← definição do Arquiteto
184
- │ │ ├── best-practices/ ← 22 guias de melhores práticas + _catalog.yaml
185
- │ │ ├── scripts/ ← verificador, conferência de fontes, caminhos, entrega e os scripts do Escritório
187
+ │ │ ├── best-practices/ ← 23 guias de melhores práticas + _catalog.yaml
188
+ │ │ ├── scripts/ ← verificador, conferência de fontes, caminhos, entrega, documento Word e os scripts do Escritório
189
+ │ │ ├── modelos/ ← modelo do perfil de documento oficial (papel timbrado)
186
190
  │ │ ├── escritorio/ ← página do Escritório ao vivo (abre com /opencrew dashboard)
187
- │ │ └── prompts/ ← 14 prompts de fase (discovery, design, build, entrega, etc.)
191
+ │ │ └── prompts/ ← 15 prompts de fase (discovery, design, build, entrega, documento, etc.)
188
192
  │ ├── agents/ ← 5 agentes base compartilhados
189
193
  │ │ ├── researcher.agent.md
190
194
  │ │ ├── copywriter.agent.md
@@ -193,7 +197,8 @@ meu-projeto/
193
197
  │ │ └── strategist.agent.md
194
198
  │ ├── _memory/
195
199
  │ │ ├── company.md ← perfil da sua empresa (onboarding)
196
- │ │ └── preferences.md ← idioma, tier padrão, Escritório ligado ou desligado
200
+ │ │ ├── preferences.md ← idioma, tier padrão, Escritório ligado ou desligado
201
+ │ │ └── documento-oficial.md ← seu papel timbrado (só existe depois que você pede; veja "Documento Word")
197
202
  │ └── .opencrew-version
198
203
  │
199
204
  ├── crews/ ← suas crews vivem aqui
@@ -231,6 +236,7 @@ entrega/
231
236
  ├── whatsapp/ ← mensagem.txt
232
237
  ├── twitter/ ← tweet.txt (na thread: tweet-1.txt, tweet-2.txt…)
233
238
  ├── youtube/ ← o roteiro
239
+ ├── documentos/ ← o Word (.docx) de cada texto de formato documento-oficial
234
240
  ├── outros/ ← arquivo sem canal (proposta, minuta, relatório), como está
235
241
  └── editaveis/ ← o HTML dos slides, para quem quiser ajustar
236
242
  ```
@@ -286,6 +292,83 @@ são sempre em português.
286
292
 
287
293
  ---
288
294
 
295
+ ## Documento Word
296
+
297
+ Ata, ofício, declaração, contrato: quando o resultado é um documento para imprimir, assinar ou
298
+ protocolar, o OpenCrew transforma o texto em markdown num arquivo do Word (`.docx`) com **as
299
+ mesmas palavras e os mesmos números, na mesma ordem**. Você escreve (ou a crew escreve) o texto;
300
+ um comando gera o documento.
301
+
302
+ **Como gerar:** no chat da sua IDE, digite `/opencrew documento Atas/ata.md` — ou escolha
303
+ "Documento Word" em "Mais opções" do menu. O Word sai ao lado do texto, com o mesmo nome
304
+ (`Atas/ata.docx`), e a IA mostra o relatório: onde gravou, qual papel timbrado usou e os avisos.
305
+ Também funciona direto no terminal, na pasta do projeto:
306
+
307
+ ```bash
308
+ node _opencrew/core/scripts/documento.mjs "Atas/ata.md"
309
+ node _opencrew/core/scripts/documento.mjs "Atas/ata.md" --saida "Documentos/Prontos"
310
+ node _opencrew/core/scripts/documento.mjs --criar-perfil # cria o arquivo do papel timbrado
311
+ ```
312
+
313
+ **Papel timbrado.** Na primeira vez, a IA pergunta se você quer configurar o papel timbrado do
314
+ projeto. Com o "sim", ela cria o perfil de documento oficial em
315
+ `_opencrew/_memory/documento-oficial.md`, pergunta o logotipo, as linhas do cabeçalho e o rodapé
316
+ e preenche o arquivo. É um arquivo de texto, seu, que o `update` nunca toca. Nele ficam:
317
+
318
+ - o logotipo (um PNG de até 2 MB, dentro do projeto) e a largura dele;
319
+ - três linhas de cabeçalho (nome da organização, registro, site e contato);
320
+ - o texto do rodapé e o "Página X de Y";
321
+ - as margens, a fonte e o tamanho da letra.
322
+
323
+ Com o "não", o documento sai sem timbre, com as margens padrão e "Página X de Y" no rodapé. É um
324
+ perfil por projeto; mudar o perfil não muda os documentos já gerados.
325
+
326
+ **Como escrever o texto.** Markdown comum, um parágrafo por linha, com três marcações a mais:
327
+
328
+ ```
329
+ ::: titulo ATA DA REUNIÃO DA DIRETORIA
330
+ ::: subtitulo Realizada em 5 de maio de 2026
331
+
332
+ # I. Abertura
333
+ Aos 5 dias do mês de maio de 2026, reuniu-se a diretoria.
334
+
335
+ ::: assinaturas
336
+ Ana Lima | Presidente
337
+ Rui Sá | Secretário
338
+ :::
339
+
340
+ ::: quebra-de-pagina
341
+ ::: titulo ANEXO I — CALENDÁRIO
342
+ ```
343
+
344
+ - `::: titulo` e `::: subtitulo` saem centralizados; `#`, `##` e `###` viram os títulos das
345
+ seções; tabela vira tabela; `- item` vira lista com marcador.
346
+ - `::: quebra-de-pagina` começa uma página nova (para o anexo); `::: assinaturas`, uma linha
347
+ `Nome | Cargo` por pessoa e `:::` para fechar montam as linhas de assinatura.
348
+ - **Os números são os seus.** "1.", "6.1.", "a)" e "§ 1º" vão como texto, do jeito que você
349
+ escreveu: nada é renumerado, reordenado nem corrigido.
350
+ - **Nada é trocado sem você saber.** Se já existe um Word diferente com esse nome (você pode tê-lo
351
+ editado), nada é gravado: a IA pergunta antes de substituir.
352
+ - **Avisos de conversão.** O relatório diz o que não coube no documento e ficou como texto: imagem,
353
+ marcação `:::` desconhecida, bloco de assinaturas sem o `:::` final. Perfil com erro (chave
354
+ desconhecida, logotipo que não existe) não gera documento: a mensagem diz a linha.
355
+ - **O Word é uma cópia do texto.** O que você mudar no Word não volta para o texto: altere o texto
356
+ e gere de novo. Para ter um PDF, abra o documento no Word e use Salvar como PDF.
357
+
358
+ **Dentro de uma crew.** O passo cujo resultado é um documento usa `format: documento-oficial` (o
359
+ guia que ensina o redator a escrever assim). Na entrega, esse texto vira
360
+ `entrega/documentos/<nome>.docx`, com o papel timbrado do projeto, e o LEIA-ME diz o que conferir.
361
+ Crews novas já nascem assim; numa crew antiga, acrescente `format: documento-oficial` ao passo.
362
+
363
+ **O que não faz.** Não põe imagem no corpo do texto, link clicável, sumário, nota de rodapé nem
364
+ numeração automática; o logotipo é só PNG; tamanhos e cores dos títulos são fixos; não lê nem
365
+ regrava um modelo `.dotx`. Os testes conferem a estrutura do arquivo; como ele fica na página,
366
+ você confere no Word. No LibreOffice e no Google Docs o resultado não foi conferido.
367
+
368
+ Quem já usa o OpenCrew recebe o documento Word com um `npx @aksp/opencrew@latest update`.
369
+
370
+ ---
371
+
289
372
  ## Escritório ao vivo
290
373
 
291
374
  Quer ver a equipe trabalhando? O **Escritório** é uma página em pixel-art, aberta no navegador,
@@ -413,6 +496,7 @@ npx @aksp/opencrew update --check
413
496
  | `/opencrew settings` | Altera preferências (idioma, tier, Escritório) |
414
497
  | `/opencrew dashboard` | Liga e abre o Escritório ao vivo (a equipe trabalhando, no navegador) |
415
498
  | `/opencrew dashboard off` | Desliga o Escritório |
499
+ | `/opencrew documento <arquivo>` | Transforma um texto (`.md` ou `.txt`) em documento Word, com o papel timbrado do projeto |
416
500
  | `/opencrew show-company` | Mostra o perfil da empresa |
417
501
  | `/opencrew edit-company` | Reconfigura o perfil da empresa |
418
502
  | `/opencrew help` | Mostra a lista de comandos |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aksp/opencrew",
3
- "version": "1.9.0",
3
+ "version": "1.10.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -10,6 +10,7 @@ On activation, perform these steps IN ORDER:
10
10
  1. Read the company context file: `{project-root}/_opencrew/_memory/company.md`
11
11
  2. Read the preferences file: `{project-root}/_opencrew/_memory/preferences.md`
12
12
  3. Check if company.md is empty or contains only the template — if so, trigger ONBOARDING
13
+ (except for `/opencrew documento` and the `
13
14
  4. Otherwise, display the MAIN MENU
14
15
 
15
16
  ## Onboarding Flow (first time only)
@@ -36,7 +37,10 @@ numbered list and ask the user to reply with a number.
36
37
  **Primary menu:** Create a new crew · Run an existing crew · My crews ·
37
38
  More options
38
39
 
39
- **More options:** Skills · Company profile · Settings & Help
40
+ **More options:** Skills · Documento Word · Company profile · Settings & Help
41
+
42
+ "Documento Word" turns a text file of the project into a Word document: load
43
+ `_opencrew/core/prompts/documento.prompt.md`, which asks for the file.
40
44
 
41
45
  ## Command Routing
42
46
 
@@ -60,6 +64,7 @@ Route input to the matching action:
60
64
  | `/opencrew settings` | Show/edit preferences.md |
61
65
  | `/opencrew dashboard` | Turn on and open the Escritório (live view) — see "Dashboard (Optional)" |
62
66
  | `/opencrew dashboard off` | Turn the Escritório off — see "Dashboard (Optional)" |
67
+ | `/opencrew documento <arquivo>` | Load `_opencrew/core/prompts/documento.prompt.md` → turn that text file (`.md` or `.txt`) into a Word document (`.docx`) |
63
68
  | `/opencrew reset` | Confirm and reset all configuration |
64
69
  | Request to deliver a run that already ended ("monte a entrega da execução …") | Load `_opencrew/core/prompts/entrega.prompt.md` → build the `entrega/` folder of that run |
65
70
  | Request to change where the delivery is copied ("muda a pasta de entrega", "não quero mais cópia", "volta a copiar") | Load `_opencrew/core/prompts/entrega.prompt.md` → "Changing the folder later" |
@@ -124,10 +129,13 @@ and touch nothing else: stop no process, delete no file.
124
129
  see `_opencrew/core/runner.pipeline.md`
125
130
  - Exception: the delivery folder (`entrega/`) — its folder names, file names and the `LEIA-ME.md`
126
131
  are written by a script in fixed PT-BR, whatever the user's language
132
+ - Exception: the report of the Word document script (`documento.mjs`) and the "Página X de Y" of
133
+ the footer it writes are fixed PT-BR too
127
134
 
128
135
  ## Critical Rules
129
136
 
130
- - NEVER skip the onboarding if company.md is not configured
137
+ - NEVER skip the onboarding if company.md is not configured (the Word document route is the only
138
+ exception: it does not use the company context)
131
139
  - ALWAYS load company context before running any crew
132
140
  - ALWAYS present checkpoints to the user — never skip them
133
141
  - ALWAYS save outputs to the crew's output directory
@@ -1 +1 @@
1
- 1.9.0
1
+ 1.10.0
@@ -114,3 +114,8 @@ catalog:
114
114
  name: "WhatsApp Broadcast"
115
115
  whenToUse: "Creating agents that produce WhatsApp broadcast messages or conversational marketing content."
116
116
  file: whatsapp-broadcast.md
117
+
118
+ - id: documento-oficial
119
+ name: "Documento oficial (Word)"
120
+ whenToUse: "Creating agents that produce a document to print, sign or file (minutes, official letter, statement, contract, formal report) that becomes a Word file."
121
+ file: documento-oficial.md
@@ -0,0 +1,144 @@
1
+ ---
2
+ name: "Documento oficial"
3
+ platform: "documento"
4
+ content_type: "official-document"
5
+ description: "Text that becomes a Word document to print, sign or file: minutes, official letters, statements, contracts and reports, written so the conversion keeps every word"
6
+ whenToUse: |
7
+ Creating agents that produce a document to print, sign or file — minutes (ata), official letter (ofício), statement, contract, formal report — which the project turns into a Word file (.docx).
8
+ version: "1.0.0"
9
+ ---
10
+
11
+ ## Compact Rules
12
+
13
+ 1. One paragraph per line. Never break a paragraph in the middle: each line of the file becomes one paragraph of the document, and lines that follow each other are not joined.
14
+ 2. Start with `::: titulo` and, when there is one, `::: subtitulo`, as the first lines of the text (one line each).
15
+ 3. Use `#`, `##` and `###` for the sections, and no deeper level.
16
+ 4. Write every number by hand — "I.", "1.", "6.1.", "a)", "§ 1º" — in sections and in items. Nothing is numbered automatically: the number you write is the official text.
17
+ 5. Use a simple table (header line, separator line, rows) for figures and lists of names. No merged cells, no table inside a table.
18
+ 6. Put `::: quebra-de-pagina` alone on a line before each annex (anexo), so the annex starts on a new page.
19
+ 7. Put the `::: assinaturas` block at the end of the document (and at the end of an annex that is signed): one line `Nome | Cargo` per person, closed by a line with only `:::`.
20
+ 8. No image, no HTML, no labels such as `=== … ===`, no notes section and no comments to the reader: everything in the file goes to the document.
21
+ 9. Write the full, final text. Missing real data is marked `[PREENCHER: o que falta]`; never invent a name, a date, a number or a registration.
22
+ 10. Use bold (`**texto**`) and italic (`*texto*`) sparingly; a list of plain items uses `- `.
23
+
24
+ ## What the conversion does
25
+
26
+ The project turns this text into a Word file with one script, with the same words and the same
27
+ numbers, in the same order. Knowing what it does tells you how to write:
28
+
29
+ | You write | The document gets |
30
+ |---|---|
31
+ | `::: titulo Texto` · `::: subtitulo Texto` | A centered title · a centered subtitle, in italic. Valid anywhere, as many times as needed (an annex has its own) |
32
+ | `# Texto` · `## Texto` · `### Texto` | Section headings of level 1 (shown in capitals), 2 and 3 |
33
+ | A line of text | One justified paragraph |
34
+ | A line that starts with a number or a letter of item (`1.`, `a)`) | A common paragraph, with the number as you wrote it; two spaces at the start of the line indent it |
35
+ | `- item` | A bulleted item (two spaces before it: second level) |
36
+ | A table | A table with equal columns and the first line in bold |
37
+ | `---` alone on a line | A horizontal line |
38
+ | `::: quebra-de-pagina` | The next block starts on a new page |
39
+ | `::: assinaturas` … `:::` | Signature lines, two per row, with the name above the role |
40
+ | `[texto](https://endereco)` | `texto (https://endereco)`, as plain text |
41
+
42
+ The header with the logo, the footer with "Página X de Y", the margins and the font come from
43
+ the profile of the project, not from the text: never write a header, a footer or a page number.
44
+
45
+ ## The three markings
46
+
47
+ A marking is a line that starts with `:::` in the first column.
48
+
49
+ - **Title and subtitle** — `::: titulo ATA DA REUNIÃO` and `::: subtitulo Realizada em 5 de maio de 2026`. One line each. They are not sections: the sections are the `#` lines.
50
+ - **Page break** — `::: quebra-de-pagina`, alone on the line, with nothing after it.
51
+ - **Signatures** — open with `::: assinaturas`, write one person per line as `Nome | Cargo` (the role is optional) and close with `:::`. Inside the block nothing else is read: bold and italic signs would be printed as typed. The order you write is the order on the page, left to right and top to bottom.
52
+
53
+ Any other word after `:::` is not a marking: the line goes to the document as text, and the
54
+ conversion warns about it. A signature block without the closing `:::` also stays as text.
55
+
56
+ ## What does not go in the text
57
+
58
+ - **Images** (`![…](…)`) — the document carries no image in the body; the line would stay as text. The logo belongs to the profile of the project.
59
+ - **HTML** (`<br>`, `<center>`, `<table>`) and HTML comments — they would be printed as they are.
60
+ - **Labels and service blocks** (`=== TÍTULO ===`, `NOTES:`, checklists for the writer) — they are not removed.
61
+ - **A notes section** ("Notas", "Observações do redator", "Fontes consultadas" that are not part of the document) — say it to the user in the conversation, not in the file.
62
+ - **Frontmatter is the only exception**: a `---` block of `chave: valor` lines at the very top stays out of the document.
63
+
64
+ ## Structure of a document
65
+
66
+ 1. **Title and subtitle** — what the document is; when and where, in the subtitle.
67
+ 2. **Opening** — who, when, where, under which rule or call.
68
+ 3. **Body in numbered sections** — one subject per section, in the order of the agenda or of the request. Decisions are written as decisions ("Aprovado por unanimidade."), with the numbers that support them.
69
+ 4. **Closing** — what happens next, and who wrote the document.
70
+ 5. **Signatures** — everyone who signs, with the role.
71
+ 6. **Annexes** — each one after a page break, with its own title.
72
+
73
+ ## Output Example
74
+
75
+ ```markdown
76
+ ::: titulo ATA DA REUNIÃO DA DIRETORIA
77
+ ::: subtitulo Realizada em 5 de maio de 2026, na sede da Associação Exemplo de Moradores
78
+
79
+ # I. Abertura
80
+ Aos 5 dias do mês de maio de 2026, às 19h, reuniu-se a diretoria da Associação Exemplo de Moradores, na Rua das Acácias, 100, com a presença dos três diretores.
81
+ A presidente, Ana Lima, abriu a reunião e convidou Rui Sá para secretariar os trabalhos.
82
+
83
+ # II. Ordem do dia
84
+ A presidente leu a ordem do dia:
85
+ 1. Reforma do salão de festas;
86
+ 2. Calendário de eventos do segundo semestre.
87
+
88
+ # III. Reforma do salão de festas
89
+ ## 3.1. Orçamentos recebidos
90
+ A tesoureira, Bia Reis, apresentou os três orçamentos recebidos:
91
+
92
+ | Empresa | Prazo | Valor |
93
+ |---|---|---|
94
+ | Construtora Exemplo | 30 dias | R$ 18.400,00 |
95
+ | Reformas Modelo | 45 dias | R$ 16.900,00 |
96
+ | Obras Amostra | 25 dias | R$ 21.000,00 |
97
+
98
+ ## 3.2. Deliberação
99
+ Por unanimidade, a diretoria aprovou o orçamento da **Reformas Modelo**, com as seguintes condições:
100
+ - pagamento em três parcelas iguais;
101
+ - início da obra depois da festa junina.
102
+
103
+ # IV. Calendário de eventos
104
+ Ficou aprovado o calendário do segundo semestre, que segue no Anexo I.
105
+
106
+ # V. Encerramento
107
+ Nada mais havendo a tratar, a presidente encerrou a reunião às 20h15. Eu, Rui Sá, secretário, lavrei esta ata, que vai assinada por todos.
108
+
109
+ ::: assinaturas
110
+ Ana Lima | Presidente
111
+ Rui Sá | Secretário
112
+ Bia Reis | Tesoureira
113
+ :::
114
+
115
+ ::: quebra-de-pagina
116
+ ::: titulo ANEXO I — CALENDÁRIO DE EVENTOS
117
+ ::: subtitulo Segundo semestre de 2026
118
+
119
+ | Data | Evento | Responsável |
120
+ |---|---|---|
121
+ | 12 de julho | Festa julina | Bia Reis |
122
+ | 20 de setembro | Mutirão de limpeza | Rui Sá |
123
+ | 6 de dezembro | Confraternização | Ana Lima |
124
+ ```
125
+
126
+ ## Anti-Patterns
127
+
128
+ - A paragraph broken into several lines "to fit the screen": it becomes several paragraphs.
129
+ - `1.` typed for every item, counting on automatic numbering: the document shows exactly what is typed.
130
+ - The title of the document as `# Título`: it becomes a section heading, not the centered title.
131
+ - A signature drawn with underscores (`______`): use the `::: assinaturas` block.
132
+ - "Página 1 de 3", the name of the organization or the date of printing written in the text: the header and the footer come from the profile.
133
+ - A closing note such as "Posso ajustar o que precisar": it would be printed in the document.
134
+
135
+ ## Quality Criteria
136
+
137
+ - [ ] Each paragraph is on one line; no line is a continuation of the previous one
138
+ - [ ] `::: titulo` is the first line of the text (after the frontmatter, if there is one)
139
+ - [ ] Every section and item number is written by hand, in sequence, with no gap
140
+ - [ ] Every table has a header line and a separator line, and the same number of columns in each row
141
+ - [ ] Each annex comes after `::: quebra-de-pagina` and has its own `::: titulo`
142
+ - [ ] The `::: assinaturas` block is closed by `:::` and lists everyone who signs
143
+ - [ ] No image, HTML, label, notes section or message to the reader
144
+ - [ ] No invented data: what is missing is `[PREENCHER: …]`
@@ -0,0 +1,42 @@
1
+ # Perfil de documento oficial
2
+
3
+ Este arquivo guarda o papel timbrado do projeto: o logotipo, o cabeçalho, o rodapé, as margens e
4
+ a letra dos documentos Word. Preencha depois dos dois-pontos; o que ficar vazio não aparece no
5
+ documento. Só as linhas `chave: valor` são lidas: o resto é comentário.
6
+
7
+ Para gerar um documento: node _opencrew/core/scripts/documento.mjs "caminho/do/texto.md"
8
+
9
+ ## Cabeçalho
10
+
11
+ # Logotipo: arquivo PNG de até 2 MB, com o caminho a partir da pasta do projeto (exemplo: Ativos/Marca/logo.png).
12
+ logotipo:
13
+ # Largura do logotipo no papel, em centímetros (de 1 a 6); a altura acompanha a proporção da imagem.
14
+ logotipo_largura_cm: 2,5
15
+ # Primeira linha do cabeçalho, em negrito: o nome da organização (exemplo: ASSOCIAÇÃO EXEMPLO DE MORADORES).
16
+ cabecalho_1:
17
+ # Segunda linha do cabeçalho (exemplo: CNPJ 00.000.000/0001-00 · Fundada em 1990).
18
+ cabecalho_2:
19
+ # Terceira linha do cabeçalho, em cinza (exemplo: www.exemplo.org · contato@exemplo.org).
20
+ cabecalho_3:
21
+
22
+ ## Rodapé
23
+
24
+ # Texto do rodapé, à esquerda, em todas as páginas (exemplo: Associação Exemplo de Moradores — documento oficial).
25
+ rodape:
26
+ # "Página X de Y" à direita do rodapé: sim ou nao.
27
+ numero_pagina: sim
28
+
29
+ ## Página e letra
30
+
31
+ # Margem esquerda, em centímetros (de 1 a 6).
32
+ margem_esquerda_cm: 3,0
33
+ # Margem direita, em centímetros (de 1 a 6).
34
+ margem_direita_cm: 2,0
35
+ # Margem superior, em centímetros (de 1 a 6).
36
+ margem_superior_cm: 2,5
37
+ # Margem inferior, em centímetros (de 1 a 6).
38
+ margem_inferior_cm: 2,5
39
+ # Fonte do texto: o nome como aparece no Word (até 40 letras, dígitos e espaços).
40
+ fonte: Arial
41
+ # Tamanho da letra do texto, em pontos (de 8 a 14; aceita meio ponto, como 10,5).
42
+ tamanho_corpo_pt: 11
@@ -444,6 +444,7 @@ The name should make someone smile — it's a pun tying a common name to the pro
444
444
  - Always include reviewer agent before final output
445
445
  - Add checkpoints at every user decision point
446
446
  - Include `on_reject` loops from reviewer back to writer
447
+ - A step whose result is a document to print, sign or file (minutes, official letter, statement, contract, formal report) gets `format: documento-oficial`, in any kind of crew: the writer follows that guide, and the text becomes a Word document in the delivery of the run (or with `/opencrew documento <arquivo>`)
447
448
 
448
449
  ### Research Focus Checkpoint (MANDATORY for crews with a researcher)
449
450
 
@@ -0,0 +1,134 @@
1
+ # Documento Word — A Text File Turned into a `.docx`
2
+
3
+ One script turns a text file of the project (markdown, `.md` or `.txt`) into a Word document with
4
+ the same words and the same numbers, in the same order. When the project has a profile
5
+ (`_opencrew/_memory/documento-oficial.md`: logo, header, footer, margins and font), the document
6
+ comes out on letterhead. Your part is to find out which file, ask about the letterhead when the
7
+ project has none, run the script and show its report.
8
+
9
+ You do NOT write the `.docx` yourself, and you never change the user's text to make it convert:
10
+ the script reads the file as it is. The writing rules of a text that becomes a document (title,
11
+ sections, page break, signatures) are in `_opencrew/core/best-practices/documento-oficial.md`.
12
+
13
+ ## Step 1: Which file
14
+
15
+ `/opencrew documento <arquivo>` names the file. With no file (the command alone, or the menu
16
+ option "Documento Word"), ask and wait:
17
+
18
+ ```
19
+ Qual arquivo de texto (.md ou .txt) você quer em Word? Diga o caminho a partir da pasta do projeto (por exemplo, `Atas/ata-de-marco.md`).
20
+ ```
21
+
22
+ - `{arquivo}` is a path inside the project, written from its root. One file per command: for
23
+ several files, run Steps 3 to 5 once for each.
24
+ - Never guess the file, and never pick one "that looks like it": with a name that matches more
25
+ than one file, list them and ask.
26
+
27
+ ## Step 2: The letterhead, when the project has none
28
+
29
+ Check, with the read tool (no command), whether `_opencrew/_memory/documento-oficial.md` exists.
30
+ If it does, go to Step 3: nothing is asked. If it does not, ask and wait:
31
+
32
+ ```
33
+ Este projeto ainda não tem papel timbrado configurado. Quer configurar agora (logotipo, cabeçalho e rodapé)? (sim / não)
34
+ ```
35
+
36
+ - **"Sim"** —
37
+ 1. Run, from the project root: `node _opencrew/core/scripts/documento.mjs --criar-perfil`
38
+ Its last line is `PERFIL:CRIADO` (the file was created from the model) or `PERFIL:JA-EXISTE`
39
+ (it was already there and was not touched).
40
+ 2. Ask the user for: the logo (a PNG file of up to 2 MB that is inside the project, with its
41
+ path from the root — or none), the three lines of the header (the name of the organization;
42
+ a second line; a third line, such as site and e-mail) and the text of the footer. Any of them
43
+ may stay empty: what is empty does not appear in the document.
44
+ 3. Fill the file `_opencrew/_memory/documento-oficial.md` with the answers: write only the value
45
+ after the colon of `logotipo`, `cabecalho_1`, `cabecalho_2`, `cabecalho_3` and `rodape`, each
46
+ exactly as the user gave it. Leave every other line as it is (comments, margins, font).
47
+ Never invent a value (a registration number, an address, a slogan), and never copy a logo
48
+ into the project by yourself: if the file is outside the project, ask the user to put it in.
49
+ - **"Não"** — go on without the profile: the document comes out with no letterhead, with the
50
+ standard margins and "Página X de Y" in the footer. Do not ask again in this conversation.
51
+
52
+ After this step the profile belongs to the user. Change it only when the user asks, and only the
53
+ line asked for.
54
+
55
+ ## Step 3: Run the script
56
+
57
+ From the project root, one line, the path between double quotes:
58
+
59
+ `node _opencrew/core/scripts/documento.mjs "{arquivo}"`
60
+
61
+ - **`{arquivo}` was typed by the user and goes into a command** — the safe-name rule (nome seguro)
62
+ of `_opencrew/core/runner.pipeline.md` applies: between double quotes and only if it is made of
63
+ letters (accents included), digits, space and `. _ - / \ : ( )`. With any other character do NOT
64
+ run the command; say
65
+ `⚠️ O nome `{arquivo}` tem um caractere que não posso usar em comandos ({caractere}). Use só letras, números, espaço, ponto, hífen, sublinhado e parênteses.`
66
+ and ask for the file again. The same rule holds for every path below.
67
+ - The Word goes next to the text, with the same name (`Atas/ata.md` → `Atas/ata.docx`). Only when
68
+ the user asks for another place, the command ends with `--saida "{pasta ou arquivo.docx}"`
69
+ (inside the project; a folder is created if it is missing).
70
+ - Only when the user asks for a document with no letterhead this time, add `--sem-perfil`; only
71
+ when the user names another profile file, add `--perfil "{arquivo do perfil}"`.
72
+
73
+ The output of the script is the report: where the document was written, which profile was used,
74
+ the conversion warnings ("Avisos:") and two tips — "Para ter um PDF: abra o documento no Word e
75
+ use Arquivo → Salvar como → PDF." and "O Word é uma cópia do texto. O que você mudar nele não
76
+ volta sozinho: altere o texto e gere de novo.". Show it to the user as it came, without the
77
+ `DOCUMENTO:OK` line. It is fixed PT-BR, whatever the user's language: do not rewrite it.
78
+
79
+ - `DOCUMENTO:OK` → done. A warning does not change that: it says what stayed as plain text (an
80
+ image, an unknown `:::` line, a signature block with no closing `:::`) or what was removed (an
81
+ invalid character). Offer to fix the text and generate again; change the text only on a "sim".
82
+ - "{arquivo} já existe e está igual. Nada a fazer." is also `DOCUMENTO:OK`: nothing was written.
83
+
84
+ ## Step 4: A Word that is already there
85
+
86
+ When the output is the line "Já existe {arquivo}, diferente do que eu ia gravar. Para trocar, rode
87
+ de novo com --substituir.", nothing was written: there is a different `.docx` at the destination,
88
+ and the user may have edited it in Word. Ask before replacing it, and wait:
89
+
90
+ ```
91
+ Já existe {arquivo}, diferente do que eu ia gravar. Posso substituir? O que foi mudado direto no Word se perde. (sim / não)
92
+ ```
93
+
94
+ - "Sim" → the same command again, ending with `--substituir`.
95
+ - "Não" → nothing is replaced. Offer another name or folder (`--saida`, Step 3).
96
+
97
+ The first call never has `--substituir`, and a "sim" is worth for that file and that call only.
98
+
99
+ ## Step 5: When the command fails
100
+
101
+ The command failed when there is no Node, an error, or no `DOCUMENTO:` line at the end (it prints
102
+ one message in PT-BR and stops, with nothing written). Show the message to the user as it came.
103
+
104
+ - **The message points to something in the command you wrote** (an option, a path, more than one
105
+ file): fix the command and run it once more.
106
+ - **The message starts with "Perfil, linha {n}:"** (an unknown key, a value out of range, a logo
107
+ that is missing, is not a PNG or is over 2 MB): the document is not generated with a wrong
108
+ letterhead. Show the message, ask the user for the right value of that line, write it in the
109
+ profile and run again. Do not switch to `--sem-perfil` by yourself.
110
+ - **"Não consegui gravar {arquivo}. …"**: the file is open in Word or the folder is syncing. Ask
111
+ the user to close it and run the same command again.
112
+ - **Anything else**, or the command did not run at all:
113
+
114
+ ```
115
+ ⚠️ A conversão para Word não rodou: {motivo}. O texto continua em {arquivo}.
116
+ ```
117
+
118
+ `{motivo}` is the message the script printed (without its final period), or what kept it from
119
+ running. Stop there.
120
+
121
+ Never generate the document by any other means: no other script, no library, no Word or office
122
+ automation, no HTML or RTF saved with another extension. A document made another way would not
123
+ have the same guarantees (the same words, the letterhead of the profile), and the user would not
124
+ know.
125
+
126
+ ## Rules
127
+
128
+ - **DO** show the report of the script as it came.
129
+ - **DO** ask before `--substituir`, every time.
130
+ - **DO NOT** generate the `.docx` by any other means, even when the script fails.
131
+ - **DO NOT** edit the user's text to remove a warning without a "sim".
132
+ - **DO NOT** write in `_opencrew/_memory/documento-oficial.md` anything the user did not give you.
133
+ - **DO NOT** promise how the document looks in Word: you did not open it. The user checks the
134
+ header, the pages, the tables and the signatures in Word.
@@ -45,8 +45,8 @@ sozinha. Antes de postar à mão, confira se já saiu."
45
45
  `_opencrew/best-practices.local/{format}.md` when that file declares `platform:`, otherwise in
46
46
  `_opencrew/core/best-practices/{format}.md`. For a step with no `format:`, the one of the skill
47
47
  (`instagram-publisher` → `instagram`). With neither, do not pass the option.
48
- - `{canal}` is the folder name: `instagram`, `linkedin`, `blog`, `email`, `whatsapp`, `twitter` or
49
- `youtube`. Only a channel that has an item in the list (an item whose format has that
48
+ - `{canal}` is the folder name: `instagram`, `linkedin`, `blog`, `email`, `whatsapp`, `twitter`,
49
+ `youtube` or `documentos` (the folder of `platform: "documento"`). Only a channel that has an item in the list (an item whose format has that
50
50
  `platform:`) — for any other the script stops with `Canal não encontrado nesta entrega: {canal}.`
51
51
 
52
52
  ## Step 3: Run the script
@@ -68,7 +68,8 @@ without the `ENTREGA:` line. Do not rewrite it and do not add files it does not
68
68
  `entrega/` folder, the script also writes `crews/{name}/output/{run_id}/verificacao-entrega.md`,
69
69
  the report of the check made at delivery time (it is not part of the delivery).
70
70
 
71
- - `ENTREGA:OK` → go on with the run (Step 5 first, when it applies).
71
+ - `ENTREGA:OK` → go on with the run (Step 5 first, when it applies). When the summary has a line
72
+ `
72
73
  - `ENTREGA:COM_RESSALVA` → everything that was missing is a ressalva the user accepted: the
73
74
  `LEIA-ME.md` opens with it and the channel is "Pronto, com ressalva"; go on as with `ENTREGA:OK`.
74
75
  - `ENTREGA:INCOMPLETA` → a channel is not ready, the destination was refused or a file could not be
@@ -102,7 +103,7 @@ the report of the check made at delivery time (it is not part of the delivery).
102
103
  "Não consegui gravar …"): show the message as it came and ask for another folder (Step 5, with
103
104
  the new answer) or for a new attempt, which is the same command again. A file of the list that
104
105
  does not exist: ask for it, or take it out of the list.
105
-
106
+ - **A Word document that was not generated** (the line `
106
107
  The first call never has `--aceitar-pendencias`. Outside option 2 it goes only when the user
107
108
  already chose "Aceitar assim mesmo" in the review loop of this run and what is missing is only
108
109
  what was accepted there: then run the command again with it, without asking.