@aksp/opencrew 1.9.0 → 1.11.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 (53) hide show
  1. package/CHANGELOG.md +112 -0
  2. package/README.md +98 -6
  3. package/package.json +1 -1
  4. package/src/commands/init.js +4 -5
  5. package/src/commands/update.js +8 -0
  6. package/src/lib/resumo.js +5 -1
  7. package/templates/AGENTS.md +17 -7
  8. package/templates/_opencrew/.opencrew-version +1 -1
  9. package/templates/_opencrew/core/architect.agent.yaml +25 -16
  10. package/templates/_opencrew/core/best-practices/_catalog.yaml +5 -0
  11. package/templates/_opencrew/core/best-practices/documento-oficial.md +144 -0
  12. package/templates/_opencrew/core/formato-da-crew.md +162 -0
  13. package/templates/_opencrew/core/modelos/documento-oficial.md +42 -0
  14. package/templates/_opencrew/core/prompts/build.prompt.md +33 -57
  15. package/templates/_opencrew/core/prompts/design.prompt.md +12 -11
  16. package/templates/_opencrew/core/prompts/discovery.prompt.md +23 -5
  17. package/templates/_opencrew/core/prompts/documento.prompt.md +134 -0
  18. package/templates/_opencrew/core/prompts/entrega.prompt.md +5 -4
  19. package/templates/_opencrew/core/prompts/repair.prompt.md +75 -84
  20. package/templates/_opencrew/core/runner.pipeline.md +9 -12
  21. package/templates/_opencrew/core/scripts/conserto/achados.mjs +158 -0
  22. package/templates/_opencrew/core/scripts/conserto/aplicar.mjs +156 -0
  23. package/templates/_opencrew/core/scripts/conserto/argumentos.mjs +51 -0
  24. package/templates/_opencrew/core/scripts/conserto/crew.mjs +126 -0
  25. package/templates/_opencrew/core/scripts/conserto/edicoes.mjs +133 -0
  26. package/templates/_opencrew/core/scripts/conserto/gravar.mjs +55 -0
  27. package/templates/_opencrew/core/scripts/conserto.mjs +82 -0
  28. package/templates/_opencrew/core/scripts/documento/argumentos.mjs +50 -0
  29. package/templates/_opencrew/core/scripts/documento/corpo.mjs +51 -0
  30. package/templates/_opencrew/core/scripts/documento/estilos.mjs +42 -0
  31. package/templates/_opencrew/core/scripts/documento/gravar.mjs +44 -0
  32. package/templates/_opencrew/core/scripts/documento/linha.mjs +58 -0
  33. package/templates/_opencrew/core/scripts/documento/marcacoes.mjs +55 -0
  34. package/templates/_opencrew/core/scripts/documento/markdown.mjs +92 -0
  35. package/templates/_opencrew/core/scripts/documento/pacote.mjs +82 -0
  36. package/templates/_opencrew/core/scripts/documento/perfil.mjs +70 -0
  37. package/templates/_opencrew/core/scripts/documento/png.mjs +20 -0
  38. package/templates/_opencrew/core/scripts/documento/projeto.mjs +60 -0
  39. package/templates/_opencrew/core/scripts/documento/tabelas.mjs +57 -0
  40. package/templates/_opencrew/core/scripts/documento/timbre.mjs +64 -0
  41. package/templates/_opencrew/core/scripts/documento/xml.mjs +95 -0
  42. package/templates/_opencrew/core/scripts/documento/zip.mjs +86 -0
  43. package/templates/_opencrew/core/scripts/documento.mjs +150 -0
  44. package/templates/_opencrew/core/scripts/entrega/canais.mjs +7 -3
  45. package/templates/_opencrew/core/scripts/entrega/comparar.mjs +2 -2
  46. package/templates/_opencrew/core/scripts/entrega/copia.mjs +1 -1
  47. package/templates/_opencrew/core/scripts/entrega/documentos.mjs +104 -0
  48. package/templates/_opencrew/core/scripts/entrega/gravar.mjs +3 -3
  49. package/templates/_opencrew/core/scripts/entrega/leiame.mjs +3 -2
  50. package/templates/_opencrew/core/scripts/entrega/passos.mjs +12 -2
  51. package/templates/_opencrew/core/scripts/entrega/separar.mjs +3 -0
  52. package/templates/_opencrew/core/scripts/entregar.mjs +12 -5
  53. package/templates/_opencrew/core/scripts/verificar/proibicoes.mjs +30 -5
@@ -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,162 @@
1
+ # Crew file format (formato da crew)
2
+
3
+ The single definition of the files that make a crew. The Build phase writes them, the Pipeline
4
+ Runner and the scripts read them, `/opencrew repair` checks them. When another prompt and this
5
+ file disagree, this file wins.
6
+
7
+ ```
8
+ crews/{code}/
9
+ ├── crew.yaml the crew: identity, sources, limits
10
+ ├── crew-party.csv one row per agent (the names shown to the user)
11
+ ├── agents/{agent-id}.agent.md
12
+ ├── pipeline/
13
+ │ ├── pipeline.yaml the order of the steps
14
+ │ ├── steps/step-NN-{name}.md
15
+ │ └── data/ reference material (never an output)
16
+ ├── _memory/ memories.md, runs.md
17
+ └── output/{run_id}/ what each run produces
18
+ ```
19
+
20
+ A folder under `crews/` without a `crew.yaml` is not a crew (the template folders installed with
21
+ the product only carry `discovery.template.yaml`).
22
+
23
+ ## crew.yaml
24
+
25
+ ```yaml
26
+ crew:
27
+ code: "atas-do-conselho" # the folder name
28
+ name: "Atas do Conselho" # shown in lists
29
+ description: "Da pauta à ata pronta para assinar"
30
+ icon: "📄"
31
+ tier: "standard" # express | standard | full
32
+
33
+ pipeline:
34
+ entry: "pipeline/pipeline.yaml"
35
+ steps_dir: "pipeline/steps"
36
+
37
+ skills: # every skill the agents use
38
+ - web_search
39
+ - web_fetch
40
+
41
+ data: # reference material the steps load
42
+ - pipeline/data/domain-framework.md
43
+ - pipeline/data/quality-criteria.md
44
+
45
+ fontes: # files of the user's project the crew must read
46
+ - caminho: Regras/estatuto.md # relative to the project root, never absolute
47
+ para_que: regras que mandam no texto
48
+
49
+ agent_dependencies: # only when an agent can be left out (see below)
50
+ rita-redacao: []
51
+ vito-veredito: [rita-redacao]
52
+
53
+ max_review_cycles: 2 # express 1 · standard 2 · full 3
54
+ ```
55
+
56
+ | Field | Written by | Read by |
57
+ |---|---|---|
58
+ | `crew.code`, `name`, `description`, `icon` | Build, from `design.yaml` | crew lists (Architect) |
59
+ | `crew.tier` | Build, from `design.yaml → crew.tier` | Runner (run header) |
60
+ | `pipeline.entry`, `steps_dir` | Build, always these two values | a reference for people; the Runner reads these two paths directly |
61
+ | `skills` | Build | Runner, Skills Engine |
62
+ | `data` | Build; the template designer appends | Runner |
63
+ | `fontes` (`caminho`, `para_que`) | Build, from `discovery.yaml → project_sources`; `/opencrew repair` | Runner (reads the sources at the start of the run), `conferir-fontes.mjs` |
64
+ | `agent_dependencies` | Build | Runner (Pre-Execution Agent Selection) |
65
+ | `max_review_cycles` | Build | Runner (Review Loops) |
66
+ | `entrega.destino` | `entregar.mjs --lembrar-destino` only | `entregar.mjs` |
67
+
68
+ - **`fontes`** is omitted only when the discovery found no project source.
69
+ - **`agent_dependencies`** is written when at least one agent can be left out of a run without
70
+ breaking another (for example, one writer per channel). Each key is an agent `id`; its value
71
+ lists the agents whose output it reads. When every agent is needed in every run, omit the
72
+ field: the Runner then runs all agents and shows no selection step.
73
+ - **`max_review_cycles`** — the Runner uses the value of the review step when the step declares
74
+ one, then this one, then 3.
75
+ - Old crews carry `name`, `code`, `description` and `tier` loose at the top level, without the
76
+ `crew:` block. Readers accept both; new crews use the block.
77
+
78
+ ## pipeline.yaml
79
+
80
+ ```yaml
81
+ steps:
82
+ - step: 1
83
+ file: "step-01-checkpoint-pauta.md" # relative to pipeline/steps
84
+ - step: 2
85
+ file: "step-02-redigir-ata.md"
86
+ - step: 3
87
+ file: "step-03-revisar.md"
88
+ - step: 4
89
+ file: "step-04-checkpoint-final.md"
90
+ ```
91
+
92
+ The steps run in the order of the list. `step` is the number other steps refer to (`on_reject`);
93
+ without it, the number is the position in the list. Old crews write `file: steps/step-…md`;
94
+ readers accept both. Nothing else is read from this file.
95
+
96
+ ## Step files
97
+
98
+ The frontmatter of `pipeline/steps/step-NN-{name}.md` says how the Runner executes the step.
99
+
100
+ **Creation step**
101
+ ```yaml
102
+ ---
103
+ execution: inline # inline | subagent
104
+ agent: rita-redacao # the agent id (see "Agent id")
105
+ format: documento-oficial # the kind of text this step produces (a best-practices id)
106
+ inputFile: crews/atas-do-conselho/output/pauta.md
107
+ outputFile: crews/atas-do-conselho/output/ata.md
108
+ ---
109
+ ```
110
+
111
+ **Review step** — the one with `on_reject`
112
+ ```yaml
113
+ ---
114
+ execution: inline
115
+ agent: vito-veredito
116
+ inputFile: crews/atas-do-conselho/output/ata.md
117
+ outputFile: crews/atas-do-conselho/output/revisao.md
118
+ on_reject: 2 # the number of the step the pipeline goes back to on a rejection
119
+ ---
120
+ ```
121
+
122
+ **Checkpoint**
123
+ ```yaml
124
+ ---
125
+ type: checkpoint
126
+ agent: rita-redacao # optional: skipped together with that agent
127
+ outputFile: crews/atas-do-conselho/output/pauta.md # optional: the user's answer is saved here
128
+ ---
129
+ ```
130
+
131
+ | Field | Rule |
132
+ |---|---|
133
+ | `execution` | `subagent` runs in the background; `inline` runs in the conversation. A step that publishes or sends is always `inline` |
134
+ | `agent` | the agent id |
135
+ | `format` | every step whose text is checked before the review (from the `on_reject` step up to the review) declares one; without it the checker measures the text as a blog post. A text to print, sign or file is `documento-oficial`. Omit only for research, analysis and the review itself |
136
+ | `inputFile`, `outputFile` | always under `crews/{code}/output/`; never `pipeline/data/` |
137
+ | `model_tier` | `fast` or `powerful`, only on `subagent` steps. Express: `fast`. Standard: `fast` for research and data gathering, `powerful` for the rest. Full: `powerful`. Inline steps do not carry it |
138
+ | `side_effects: irreversible` | every step that publishes, posts or sends outside the project; such steps come after the review and the final approval |
139
+ | `on_reject` | marks the review step; its value is a step number |
140
+ | `max_review_cycles` | optional on the review step, when it must differ from the crew's |
141
+ | `skills_needed` | optional list of skills whose full instructions the step needs from the start |
142
+ | `type: checkpoint` | a pause for the user; no `execution` |
143
+
144
+ Every crew has a review step, followed by a final approval checkpoint. In the Express tier the
145
+ review step is done by the writer agent itself; Standard and Full have a dedicated reviewer agent.
146
+
147
+ ## Agent id
148
+
149
+ One definition: the agent `id` is the file name without `.agent.md`
150
+ (`agents/rita-redacao.agent.md` → `rita-redacao`). The same text goes in the `id` column of
151
+ `crew-party.csv`, in `agent:` of the steps and in `agent_dependencies`. Old agent files carry
152
+ `id: "crews/{code}/agents/{id}"` in the frontmatter; readers use the last segment.
153
+
154
+ ## crew-party.csv
155
+
156
+ ```
157
+ id,displayName,title,icon,path,execution
158
+ rita-redacao,"Rita Redação","Redatora de Atas",📝,./agents/rita-redacao.agent.md,inline
159
+ ```
160
+
161
+ `displayName` is the agent's `name:` (the two-word persona name), never the role. Quote any field
162
+ with a space or a comma.
@@ -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
@@ -70,52 +70,24 @@ Generate these files. Use the Write tool for all file creation — never use Bas
70
70
 
71
71
  ### Files to generate:
72
72
 
73
- 1. **`crews/{code}/crew.yaml`** — Crew definition with pipeline
74
- - Include a `skills:` section listing all skills:
75
- ```yaml
76
- skills:
77
- - web_search
78
- - web_fetch
79
- # Add any skills from design.yaml:
80
- # - apify
81
- # - canva
82
- ```
83
- - Include a `data:` section listing all reference materials:
84
- ```yaml
85
- data:
86
- - pipeline/data/research-brief.md
87
- - pipeline/data/domain-framework.md
88
- - pipeline/data/quality-criteria.md
89
- - pipeline/data/output-examples.md
90
- - pipeline/data/anti-patterns.md
91
- - pipeline/data/tone-of-voice.md # for content crews
92
- ```
93
- - Include a `fontes:` section with the project sources from `discovery.yaml →
94
- project_sources` (omit it only if that list is empty). The Pipeline Runner reads them at the
95
- start of every run and checks they still exist:
96
- ```yaml
97
- fontes:
98
- - caminho: Memoria/01_Decisoes.md # relative to the project root
99
- para_que: decisões de público e posicionamento
100
- ```
73
+ **Read `_opencrew/core/formato-da-crew.md` before writing any file.** It is the single definition
74
+ of `crew.yaml`, `pipeline.yaml`, the step frontmatter and the agent id, with a complete example of
75
+ each. Write every file in that format; what follows here only adds what is specific to the Build.
76
+
77
+ 1. **`crews/{code}/crew.yaml`** — the crew: the `crew:` block (`code`, `name`, `description`,
78
+ `icon` and `tier`, all from `design.yaml`), `pipeline:`, `skills:`, `data:`, `fontes:`,
79
+ `agent_dependencies:` (only when the format file says so) and `max_review_cycles:`.
80
+ - `skills:` lists every skill from `design.yaml`; `data:` lists every reference material you
81
+ wrote in `pipeline/data/`.
82
+ - `fontes:` carries the project sources from `discovery.yaml → project_sources` (`path` →
83
+ `caminho`, `purpose` → `para_que`); omit it only if that list is empty. The Pipeline Runner
84
+ reads them at the start of every run and checks they still exist.
101
85
  - **Paths to the user's project files** — in `crew.yaml`, step files and tasks — are always
102
- written as a caminho relativo à raiz do projeto (relative to the project root), between
103
- backticks, e.g. `` `Ativos/Identidade Visual/logo.png` ``. NEVER write absolute paths
86
+ written as a caminho relativo à raiz do projeto (relative to the project root); in the
87
+ prose of step files and tasks, between backticks, e.g. `` `Ativos/Identidade Visual/logo.png` ``. NEVER write absolute paths
104
88
  (`C:/…`, `J:/…`, `/Users/…`): they break as soon as the user moves or syncs the folder.
105
- - Include an `agent_dependencies:` section (OPTIONAL — enables runtime
106
- Pre-Execution Agent Selection):
107
- ```yaml
108
- agent_dependencies: # OPTIONAL — enables Pre-Execution Agent Selection at runtime
109
- copywriter: [researcher] # copywriter consumes researcher's output
110
- designer: [copywriter] # designer consumes copywriter's output
111
- reviewer: [copywriter] # reviewer consumes copywriter's output
112
- ```
113
- - `agent_dependencies` is OPTIONAL. ALWAYS emit it for crews that should show the
114
- runtime agent-selection step — even as an empty map `agent_dependencies: {}` (the
115
- selection step triggers on field presence, so an empty map enables selection with
116
- no dependency warnings). Derive entries from the pipeline step order: for each
117
- agent step, list the agent(s) whose output it reads via `inputFile`. Omit the field
118
- entirely to keep the legacy behavior (run all agents, no selection step).
89
+ - `agent_dependencies:` — derive the entries from the step order: for each agent step, list
90
+ the agent(s) whose output it reads via `inputFile`.
119
91
 
120
92
  2. **`crews/{code}/crew-party.csv`** — Agent manifest
121
93
  - The header row MUST be EXACTLY these columns, in this order:
@@ -134,7 +106,7 @@ Generate these files. Use the Write tool for all file creation — never use Bas
134
106
  render the agent's name in "🤖 {name} is working…" announcements, and the Escritório
135
107
  (the optional live view) shows the same column. If `displayName` is missing, empty, or set
136
108
  to the role/title instead of the persona name, the crew renders with functions but no names.
137
- - `id` = the `path` basename with `./agents/` and `.agent.md` stripped
109
+ - `id` = the agent id: the agent file name without `.agent.md`
138
110
  (e.g. `./agents/researcher.agent.md` → `researcher`).
139
111
  - `title` = the agent's `title:` frontmatter (the role/function label). This is a
140
112
  SEPARATE column from `displayName` — never merge or swap them.
@@ -145,7 +117,8 @@ Generate these files. Use the Write tool for all file creation — never use Bas
145
117
  - For ALL agents that include `tasks:` in their frontmatter, ALSO generate the task files:
146
118
  `crews/{code}/agents/{agent-id}/tasks/{task}.md` — one per entry in the `tasks:` list
147
119
 
148
- 4. **`crews/{code}/pipeline/pipeline.yaml`** — Pipeline entry point
120
+ 4. **`crews/{code}/pipeline/pipeline.yaml`** — the order of the steps: one `step` + `file` entry
121
+ per step file, as in the format file
149
122
 
150
123
  5. **Step files** — `crews/{code}/pipeline/steps/step-NN-{name}.md` — one per pipeline step
151
124
 
@@ -185,7 +158,7 @@ Every agent file MUST contain ALL of the following sections. Target 120-200 line
185
158
 
186
159
  ```markdown
187
160
  ---
188
- id: "crews/{code}/agents/{agent}"
161
+ id: "{agent-id}" # the file name without `.agent.md`
189
162
  name: "{Agent Name}"
190
163
  title: "{Agent Title}"
191
164
  icon: "{emoji}"
@@ -392,10 +365,10 @@ Every step file begins with YAML frontmatter followed by the markdown body. The
392
365
  ```yaml
393
366
  ---
394
367
  execution: subagent # subagent = runs in background via Task tool; inline = runs in the main conversation
395
- agent: {agent-id} # the agent's id (matches the id field in their .agent.md frontmatter)
396
- format: {format-id} # OPTIONAL — e.g., "instagram-feed". Pipeline Runner auto-injects from _opencrew/core/best-practices/
397
- # Use for content creation steps where platform-specific rules should guide the agent
398
- # Omit for non-content steps (research, analysis, review without platform context)
368
+ agent: {agent-id} # the agent id: the agent file name without `.agent.md`
369
+ format: {format-id} # e.g., "instagram-feed". Pipeline Runner auto-injects from _opencrew/core/best-practices/
370
+ # REQUIRED on every step whose text the checker measures (from the `on_reject` step up to the review)
371
+ # Omit for non-content steps (research, analysis, the review itself)
399
372
  inputFile: crews/{code}/output/{filename}.{ext} # path to input file from previous step — MUST use output/ prefix
400
373
  outputFile: crews/{code}/output/{filename}.{ext} # path where this step saves its output — MUST use output/ prefix
401
374
  # NEVER use pipeline/data/ for outputFile — that folder is for static
@@ -410,8 +383,9 @@ side_effects: irreversible # REQUIRED for any step that publishes, posts, sends
410
383
  # distributes outside the project (it cannot be undone). The Pipeline
411
384
  # Runner never retries these automatically, and Gate 2c places them last.
412
385
  # Omit for every other step.
413
- max_review_cycles: {N} # ONLY for the review step: write it next to its `on_reject`.
414
- # By crew tier (`crew.tier` in design.yaml): Express 1, Standard 2, Full 3.
386
+ on_reject: {N} # ONLY for the review step: the number of the step the pipeline goes back to
387
+ # (the first writing step). `max_review_cycles` goes in `crew.yaml`, by crew
388
+ # tier (`crew.tier` in design.yaml): Express 1, Standard 2, Full 3.
415
389
  ---
416
390
  ```
417
391
 
@@ -428,7 +402,8 @@ agent: {agent-id} # OPTIONAL — ties this checkpoint to an agent; if that age
428
402
  ---
429
403
  ```
430
404
 
431
- For **research focus checkpoints** (where the user's response is saved to a file), use extended frontmatter with `outputFile`:
405
+ For a **checkpoint whose answer the next step needs** (the research focus, the chosen angle, the
406
+ request to be worked on), use extended frontmatter with `outputFile`:
432
407
  ```yaml
433
408
  ---
434
409
  type: checkpoint
@@ -437,7 +412,7 @@ agent: {agent-id} # OPTIONAL — same semantics as above
437
412
  ---
438
413
  ```
439
414
  The Pipeline Runner writes the user's response to this file before proceeding.
440
- The next step (researcher) reads it as `inputFile: crews/{code}/output/research-focus.md`.
415
+ The next step reads it as `inputFile: crews/{code}/output/research-focus.md`.
441
416
  Using `output/` ensures the path transformation applies and the file lands in the run_id folder.
442
417
 
443
418
  Every pipeline step file MUST contain ALL of the following sections. Target 60-120 lines per step.
@@ -593,7 +568,7 @@ For EACH agent step in the pipeline that produces visuals, renders images, or pu
593
568
  If ANY check fails:
594
569
  1. Insert a new `type: checkpoint` step immediately before the offending agent step
595
570
  2. Renumber all subsequent steps (e.g. step-05 becomes step-06, etc.)
596
- 3. Add the new step to the `checkpoints:` list in pipeline.yaml
571
+ 3. Add the new step to `pipeline.yaml`
597
572
  4. Generate a step file for the new checkpoint that asks the user to review and approve the preceding agent's output before the visual/publish step runs
598
573
  5. Re-validate Gate 2b. Max 2 fix attempts — after that, present to user for manual decision.
599
574
 
@@ -602,7 +577,8 @@ If ANY check fails:
602
577
  For EACH step that publishes, posts, sends email or distributes outside the project:
603
578
  - [ ] Its frontmatter declares `side_effects: irreversible` and `execution: inline`
604
579
  - [ ] It comes AFTER the Review step (the reviewer has already approved the final content)
605
- - [ ] The IMMEDIATELY preceding step is a `type: checkpoint` (Final Approval) that itself comes after the Review
580
+ - [ ] The IMMEDIATELY preceding step is a `type: checkpoint` (Final Approval) that itself comes
581
+ after the Review, or another irreversible step (two in a row share the same Final Approval)
606
582
  - [ ] Only other irreversible steps follow it (nothing is created, rendered or reviewed after publishing)
607
583
 
608
584
  If ANY check fails:
@@ -107,10 +107,10 @@ Present the three tiers with concrete trade-offs:
107
107
  | Aspect | ⚡ Express | 🎯 Standard | 🔬 Full |
108
108
  |--------|-----------|-------------|---------|
109
109
  | Agent count | 2-3 | 3-5 | 5-7 |
110
- | Reviewer | Writer self-reviews | 1 dedicated reviewer | Reviewer + cross-review |
110
+ | Reviewer | The writer does the review step (no reviewer agent) | 1 dedicated reviewer | Reviewer + cross-review |
111
111
  | Sherlock | Never | Only if user provided URLs | Always (social + web + trends) |
112
112
  | Checkpoints | Final approval only | Research focus + content approval + final | All checkpoints + angle selection |
113
- | model_tier per step | All `fast` | Mix (research=fast, create=powerful) | All `powerful` |
113
+ | model_tier (subagent steps only) | `fast` | Mix (research=fast, create=powerful) | `powerful` |
114
114
  | Cross-review | None | None | Reviewer + second reviewer cross-check |
115
115
  | On-reject loops | 1 max | 2 max | 3 max |
116
116
 
@@ -219,7 +219,7 @@ Para {crew purpose}, sugiro este time:
219
219
  - Simple crews (1 format, 1 platform): 2-3 roles
220
220
  - Medium crews (content + review): 3-4 roles
221
221
  - Complex crews (multi-platform, multi-format): 4-6 roles
222
- - **Every crew needs a reviewer** — mandatory quality gate
222
+ - **Every crew needs a review step** — mandatory quality gate (Express: done by the writer; Standard and Full: by a reviewer role)
223
223
  - **Allow editing** — after presenting roles, ask:
224
224
  > "Quer adicionar, remover ou modificar algum papel? Ou o time está bom?"
225
225
 
@@ -229,7 +229,7 @@ Never suggest fewer than 2 roles. The minimum viable crew has:
229
229
  - One creator/executor (the person who produces the output)
230
230
  - One reviewer (the person who checks quality before delivery)
231
231
 
232
- For very simple tasks, these two roles can be the same person with a self-review step — but the user must explicitly approve this simplification.
232
+ In the Express tier these two roles are the same agent: the writer also does the review step. The step still exists (with `on_reject`), so the automatic checker runs before it.
233
233
 
234
234
  ---
235
235
 
@@ -365,7 +365,7 @@ execution: inline
365
365
  skills: []
366
366
  ---
367
367
  ```
368
- The Build phase copies the base agent from `_opencrew/agents/copywriter.agent.md` and the local file only needs to specify what's DIFFERENT — a different tone, specific output examples for this crew, or additional anti-patterns. The runner merges: base first, local overrides on top.
368
+ The Build phase copies the base agent from `_opencrew/agents/copywriter.agent.md` and the local file only needs to specify what's DIFFERENT — a different tone, specific output examples for this crew, or additional anti-patterns. The Build phase does the merge (base first, local overrides on top) and writes a complete file; the Pipeline Runner never merges.
369
369
 
370
370
  ### Design Philosophy
371
371
 
@@ -382,7 +382,7 @@ Design the crew with appropriate agents:
382
382
  - Follow the deep `.agent.md` format with full sections: Persona (Role, Identity, Communication Style), Principles, Operational Framework, Voice Guidance, Output Examples, Anti-Patterns, Quality Criteria, Integration
383
383
  - Design each agent from scratch, informed by the relevant best-practices files read in Phase A
384
384
  - Each agent has exactly one clear responsibility
385
- - Every crew needs a reviewer agent for quality control
385
+ - Every crew needs a review step for quality control (a reviewer agent in Standard and Full)
386
386
  - YAGNI — never create agents that aren't strictly necessary
387
387
 
388
388
  ### Agent Naming Convention (MANDATORY — never skip)
@@ -428,8 +428,7 @@ The name should make someone smile — it's a pun tying a common name to the pro
428
428
 
429
429
  ### Agent Composition Rules
430
430
 
431
- - One clear responsibility per agent; reviewer agent mandatory; YAGNI strictly applied
432
- - Research/data steps → `execution: subagent`; creative/writing steps → `execution: inline`
431
+ - One clear responsibility per agent; review step mandatory (reviewer agent in Standard and Full); YAGNI strictly applied
433
432
  - Content crews must include `pipeline/data/tone-of-voice.md` and instruct the writer to ask tone before producing
434
433
  - Every agent uses `.agent.md` format with all sections: Persona, Principles, Operational Framework, Voice Guidance, Output Examples, Anti-Patterns, Quality Criteria, Integration
435
434
 
@@ -441,9 +440,10 @@ The name should make someone smile — it's a pun tying a common name to the pro
441
440
 
442
441
  - **Research/data-gathering steps** → `execution: subagent` (runs in background via Task tool)
443
442
  - **Creative/writing steps** → `execution: inline` (runs in the main conversation)
444
- - Always include reviewer agent before final output
445
443
  - Add checkpoints at every user decision point
446
- - Include `on_reject` loops from reviewer back to writer
444
+ - The files the Build phase will write follow `_opencrew/core/formato-da-crew.md` (fields of `crew.yaml`, of `pipeline.yaml` and of each step): design nothing that format cannot hold
445
+ - Always include a review step before final output (see the tier table for who does it), with `on_reject`: the number of the first writing step
446
+ - 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
447
 
448
448
  ### Research Focus Checkpoint (MANDATORY for crews with a researcher)
449
449
 
@@ -602,6 +602,7 @@ crew:
602
602
  code: "{code}"
603
603
  name: "{Crew Name}"
604
604
  description: "{one-line description}"
605
+ icon: "{emoji}"
605
606
  tier: "express" | "standard" | "full"
606
607
 
607
608
  agents:
@@ -655,7 +656,7 @@ pipeline:
655
656
  - step: 2
656
657
  name: "checkpoint-name"
657
658
  type: "checkpoint"
658
- output_file: "{path}" # optional, for research focus checkpoints
659
+ output_file: "{path}" # optional, when the next step needs the user's answer
659
660
 
660
661
  investigation: # only if investigation ran
661
662
  enriched: true