@aksp/opencrew 1.11.0 → 1.13.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.
- package/CHANGELOG.md +66 -3
- package/README.md +7 -3
- package/package.json +1 -1
- package/templates/AGENTS.md +10 -8
- package/templates/_opencrew/.opencrew-version +1 -1
- package/templates/_opencrew/core/best-practices/_catalog.yaml +5 -0
- package/templates/_opencrew/core/best-practices/texto-livre.md +23 -0
- package/templates/_opencrew/core/formato-da-crew.md +2 -1
- package/templates/_opencrew/core/prompts/build.prompt.md +3 -3
- package/templates/_opencrew/core/prompts/design.prompt.md +5 -5
- package/templates/_opencrew/core/prompts/discovery.prompt.md +8 -6
- package/templates/_opencrew/core/prompts/documento.prompt.md +9 -5
- package/templates/_opencrew/core/prompts/entrega.prompt.md +7 -2
- package/templates/_opencrew/core/prompts/repair.prompt.md +1 -1
- package/templates/_opencrew/core/runner/contrato-de-saida.md +33 -0
- package/templates/_opencrew/core/runner/escritorio.md +37 -0
- package/templates/_opencrew/core/runner/fim-da-execucao.md +110 -0
- package/templates/_opencrew/core/runner/fontes-pendentes.md +21 -0
- package/templates/_opencrew/core/runner/memoria.md +55 -0
- package/templates/_opencrew/core/runner/selecao-de-agentes.md +79 -0
- package/templates/_opencrew/core/runner/tarefas-do-agente.md +34 -0
- package/templates/_opencrew/core/runner.pipeline.md +45 -373
- package/templates/_opencrew/core/scripts/caminho/argumentos.mjs +3 -1
- package/templates/_opencrew/core/scripts/caminho/nucleo.mjs +16 -0
- package/templates/_opencrew/core/scripts/caminho.mjs +11 -8
- package/templates/_opencrew/core/scripts/conferir-fontes/relatorio.mjs +4 -2
- package/templates/_opencrew/core/scripts/conferir-fontes.mjs +22 -16
- package/templates/_opencrew/core/scripts/conserto/achados.mjs +1 -1
- package/templates/_opencrew/core/scripts/documento/markdown.mjs +2 -1
- package/templates/_opencrew/core/scripts/documento/pacote.mjs +1 -0
- package/templates/_opencrew/core/scripts/documento/perfil.mjs +14 -0
- package/templates/_opencrew/core/scripts/entrega/pendencias.mjs +4 -1
- package/templates/_opencrew/core/scripts/entrega/separar.mjs +2 -1
- package/templates/_opencrew/core/scripts/verificar/documento.mjs +20 -0
- package/templates/_opencrew/core/scripts/verificar/medicao.mjs +2 -1
- package/templates/_opencrew/core/scripts/verificar.mjs +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,21 +3,84 @@
|
|
|
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.13.0] — 2026-10-07
|
|
7
|
+
|
|
8
|
+
Fase U5, fatia 2: "Runner dividido" (`specs/fase-u5b-runner-dividido.md`). Chega a quem já usa
|
|
9
|
+
com um `npx @aksp/opencrew@latest update`. Nenhuma regra mudou de texto: mudou de lugar.
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
- **O executor de pipeline ficou menor.** O `runner.pipeline.md`, lido no começo de toda execução,
|
|
13
|
+
foi de 872 para 543 linhas. Sete blocos que só valem em alguma condição passaram para arquivos
|
|
14
|
+
próprios em `_opencrew/core/runner/`, lidos só quando é o caso: seleção de agentes, migração do
|
|
15
|
+
formato da memória, Escritório, tarefas do agente, contrato de saída, fontes pendentes e o fim
|
|
16
|
+
da execução (memória, histórico, reflexão e menu final). No lugar de cada um ficou um trecho
|
|
17
|
+
curto que diz quando ler o arquivo. Numa execução comum a IA lê 654 linhas em vez de 872, e as
|
|
18
|
+
regras do fim da execução são lidas no fim, quando valem.
|
|
19
|
+
- O painel (Escritório) só custa leitura para quem o ligou.
|
|
20
|
+
|
|
21
|
+
### Removed
|
|
22
|
+
- O resumo "Step Execution Order", que repetia a ordem dos passos já descrita logo acima dele.
|
|
23
|
+
## [1.12.0] — 2026-10-07
|
|
24
|
+
|
|
25
|
+
Fase U5, fatia 1: "Polimento do uso" (`specs/fase-u5a-polimento-do-uso.md`). A U5 é a fase de
|
|
26
|
+
fechamento do projeto, em quatro fatias (`specs/fase-u5-roteiro.md`). Chega a quem já usa com um
|
|
27
|
+
`npx @aksp/opencrew@latest update`.
|
|
28
|
+
|
|
29
|
+
Ainda não nesta versão: o runner dividido (1.13.0), o histórico confiável e o "retomar" (1.14.0)
|
|
30
|
+
e o pedido avulso à crew (1.15.0).
|
|
31
|
+
|
|
32
|
+
### Added
|
|
33
|
+
- **Formato `texto-livre`** (o 24º guia): para o texto que não é post nem documento para
|
|
34
|
+
imprimir ou assinar — proposta, minuta que vira HTML ou PDF, plano, relatório interno. Não tem
|
|
35
|
+
limite de tamanho, não gera Word, e a entrega leva o arquivo inteiro para `outros/`. O
|
|
36
|
+
`/opencrew repair` passa a propô-lo para esse tipo de passo.
|
|
37
|
+
- **O que o Word não vai converter aparece antes do revisor.** No passo com
|
|
38
|
+
`format: documento-oficial`, o verificador avisa de imagem, de marcação `:::` desconhecida e
|
|
39
|
+
de bloco de assinaturas sem fim. São alertas: quem decide é o revisor.
|
|
40
|
+
- Aviso de conversão quando uma linha de tabela tem mais células que o cabeçalho.
|
|
41
|
+
|
|
42
|
+
### Changed
|
|
43
|
+
- **O nome da execução (`run_id`) vem do script**, com a data e a hora do computador
|
|
44
|
+
(`caminho.mjs <crew> pasta`, sem `--run`). Antes a IA montava a hora por conta própria.
|
|
45
|
+
- **Conferência de fontes:** o resumo concorda em número ("1 fonte", "1 alerta"); quando há
|
|
46
|
+
caminho com sugestão, o relatório diz como corrigir; com `--corrigir`, cada arquivo alterado
|
|
47
|
+
aparece com o nome da cópia que ficou, e o relatório sai uma vez só.
|
|
48
|
+
- Depois de um conserto por veto, o runner confere o arquivo de novo.
|
|
49
|
+
- O runner não cita mais ferramenta de uma IDE só ("Task tool", `.claude/settings.local.json`).
|
|
50
|
+
- **Perfil de documento oficial:** chave escrita quase certa (`Logotipo:`, `rodapé:`, com
|
|
51
|
+
espaço antes) agora é erro que diz a grafia certa; antes a linha era ignorada em silêncio.
|
|
52
|
+
- O onboarding grava o `company.md` com seis cabeçalhos fixos e tira a marca
|
|
53
|
+
`NOT CONFIGURED` dos dois arquivos.
|
|
54
|
+
- A linha "Não medido" some para formato que não declara limite (`documento-oficial`,
|
|
55
|
+
`texto-livre`).
|
|
56
|
+
- Na entrega sem canal de rede, "O que não foi conferido" não cita imagens nem redes.
|
|
57
|
+
- Prompts de criação: dez contradições que a execução real da 1.11.0 achou ganharam uma frase
|
|
58
|
+
cada (a pergunta de tier com modelo, `extends:` × "do zero", dependências de agente lidas
|
|
59
|
+
também do "Context Loading", skills nativas fora da conferência, exemplo de saída com 15
|
|
60
|
+
linhas, a pergunta 1 quando o comando já traz a descrição, entre outras).
|
|
61
|
+
|
|
62
|
+
### Fixed
|
|
63
|
+
- **Uma frase errada da 1.11.0.** O `/opencrew repair`, o README e este arquivo diziam que texto
|
|
64
|
+
sem formato "é medido como post de blog". Isso só acontece quando o arquivo tem `title:` no
|
|
65
|
+
frontmatter. O que acontece sempre, sem o formato: o redator não recebe o guia do tipo de
|
|
66
|
+
texto, e o verificador procura no arquivo peças de rede (legenda, post). A frase foi trocada
|
|
67
|
+
em todos os lugares.
|
|
68
|
+
|
|
6
69
|
## [1.11.0] — 2026-10-07
|
|
7
70
|
|
|
8
71
|
Fase U4, fatia 1: "Conserto de crews e caminho de criação" (`specs/fase-u4a-conserto-de-crews.md`).
|
|
9
72
|
Chega a quem já usa com um `npx @aksp/opencrew@latest update`; as suas crews só mudam quando você
|
|
10
73
|
pede o conserto e diz sim a cada ponto.
|
|
11
74
|
|
|
12
|
-
Ainda não nesta versão: histórico confiável e pedido avulso à
|
|
13
|
-
|
|
75
|
+
Ainda não nesta versão: histórico confiável, retomar uma execução interrompida e pedido avulso à
|
|
76
|
+
crew (`/opencrew pedir`), que ficaram para a fase U5 (`specs/fase-u5-roteiro.md`). O conserto não reordena passos: crew
|
|
14
77
|
sem revisão, sem aprovação final ou que publica antes da revisão é apontada e resolvida com
|
|
15
78
|
`/opencrew edit`.
|
|
16
79
|
|
|
17
80
|
### Added
|
|
18
81
|
- **`/opencrew repair <crew>` conserta crews antigas.** Ele lê a crew e mostra, em português, o
|
|
19
82
|
que falta para as melhorias das versões seguintes valerem nela: passo sem o formato do texto
|
|
20
|
-
(o
|
|
83
|
+
(o redator ficava sem o guia do tipo de texto), crew sem os arquivos do projeto que deve ler,
|
|
21
84
|
proibição sem trecho entre aspas (que o verificador não consegue barrar), nomes dos agentes,
|
|
22
85
|
passo que publica sem a marca. Conserta um ponto por vez, com o seu sim; cada arquivo alterado
|
|
23
86
|
ganha uma cópia `.bak`. Quem grava é um script (`_opencrew/core/scripts/conserto.mjs`), não a
|
package/README.md
CHANGED
|
@@ -181,11 +181,12 @@ meu-projeto/
|
|
|
181
181
|
├── _opencrew/
|
|
182
182
|
│ ├── core/
|
|
183
183
|
│ │ ├── system.md ← 🧠 sistema completo do OpenCrew
|
|
184
|
-
│ │ ├── runner.pipeline.md ← executor de pipeline
|
|
184
|
+
│ │ ├── runner.pipeline.md ← executor de pipeline (o que toda execução usa)
|
|
185
|
+
│ │ ├── runner/ ← 7 partes do executor, lidas só quando é o caso (painel, fim da execução…)
|
|
185
186
|
│ │ ├── skills.engine.md ← gerenciador de skills
|
|
186
187
|
│ │ ├── architect.agent.yaml ← definição do Arquiteto
|
|
187
188
|
│ │ ├── formato-da-crew.md ← o formato dos arquivos de uma crew (crew.yaml, pipeline.yaml, passos)
|
|
188
|
-
│ │ ├── best-practices/ ←
|
|
189
|
+
│ │ ├── best-practices/ ← 24 guias de melhores práticas + _catalog.yaml
|
|
189
190
|
│ │ ├── scripts/ ← verificador, conferência de fontes, caminhos, entrega, documento Word, conserto de crews e os scripts do Escritório
|
|
190
191
|
│ │ ├── modelos/ ← modelo do perfil de documento oficial (papel timbrado)
|
|
191
192
|
│ │ ├── escritorio/ ← página do Escritório ao vivo (abre com /opencrew dashboard)
|
|
@@ -439,12 +440,15 @@ o que você fez:
|
|
|
439
440
|
um bloco completo no fim. O bloco começa por um comentário que diz que ele é do OpenCrew: as
|
|
440
441
|
suas linhas ficam fora dele.
|
|
441
442
|
- **E as crews que você já tinha?** O `update` não mexe nelas. Para levar a elas o que veio
|
|
442
|
-
depois — o formato de cada texto (sem ele o
|
|
443
|
+
depois — o formato de cada texto (sem ele o redator não recebe o guia do tipo de texto), os
|
|
443
444
|
arquivos do projeto que a crew deve ler, as proibições que o verificador consegue barrar —,
|
|
444
445
|
peça na sua IDE `/opencrew repair <nome>`. Ele mostra o que falta, pergunta antes de cada
|
|
445
446
|
mudança e deixa uma cópia `.bak` do arquivo que alterou. O que não dá para consertar assim
|
|
446
447
|
(crew sem passo de revisão, publicação antes da revisão) ele aponta e manda para
|
|
447
448
|
`/opencrew edit`.
|
|
449
|
+
- **Texto que não é post nem documento para assinar?** Proposta, minuta que outro passo diagrama,
|
|
450
|
+
plano: o passo recebe o formato `texto-livre`. Não há limite de tamanho, nada vira Word, e a
|
|
451
|
+
entrega guarda o arquivo como está, em `outros/`.
|
|
448
452
|
- **A instalação anterior parou no meio?** O `update` não altera nada e pede para você rodar
|
|
449
453
|
`npx @aksp/opencrew init`, que conclui a instalação sem apagar o que já existe.
|
|
450
454
|
- **Apagou um modelo de crew ou um skill do catálogo?** Ele volta no `update`, e a saída diz o
|
package/package.json
CHANGED
package/templates/AGENTS.md
CHANGED
|
@@ -12,7 +12,8 @@ On activation, perform these steps IN ORDER:
|
|
|
12
12
|
3. Check if company.md is empty or contains only the template — if so, trigger ONBOARDING
|
|
13
13
|
(except for `/opencrew documento` and the request to deliver a run that already ended: neither
|
|
14
14
|
uses the company context)
|
|
15
|
-
4. Otherwise
|
|
15
|
+
4. Otherwise: when the message carried a command or a request, route it (Command Routing);
|
|
16
|
+
display the MAIN MENU only when it carried none
|
|
16
17
|
|
|
17
18
|
## Onboarding Flow (first time only)
|
|
18
19
|
|
|
@@ -25,8 +26,12 @@ If `company.md` is empty or contains `<!-- NOT CONFIGURED -->`:
|
|
|
25
26
|
description/sector, target audience, products/services, tone of voice,
|
|
26
27
|
social media profiles
|
|
27
28
|
4. Present findings in a clean summary, ask the user to confirm or correct,
|
|
28
|
-
save the profile to `_opencrew/_memory/company.md`
|
|
29
|
-
|
|
29
|
+
save the profile to `_opencrew/_memory/company.md` under these fixed headings, in this order:
|
|
30
|
+
`## Nome`, `## O que faz`, `## Público`, `## Produtos e serviços`, `## Tom de voz`,
|
|
31
|
+
`## Site e redes` (under it, the site goes on its own line, `- Site: https://…`). Then remove the line
|
|
32
|
+
`<!-- NOT CONFIGURED -->` from `company.md` and from `preferences.md`
|
|
33
|
+
5. When the message that started this carried a command or a request, route it now (Command
|
|
34
|
+
Routing); show the main menu only when it carried none
|
|
30
35
|
|
|
31
36
|
## Main Menu
|
|
32
37
|
|
|
@@ -92,11 +97,8 @@ When running a crew:
|
|
|
92
97
|
from `_opencrew/_memory/preferences.md` (used to check the Dashboard toggle)
|
|
93
98
|
5. Load crew memory from `crews/{name}/_memory/memories.md`
|
|
94
99
|
6. Read the pipeline runner instructions from `_opencrew/core/runner.pipeline.md`
|
|
95
|
-
7. **Pre-Execution Agent Selection** — only when `crew.yaml`
|
|
96
|
-
`agent_dependencies
|
|
97
|
-
present the agents as a numbered multi-select (IDE-neutral), let the user
|
|
98
|
-
confirm/adjust, warn about broken dependencies, and build the filtered step
|
|
99
|
-
list. Crews without the field skip this and run all agents.
|
|
100
|
+
7. **Pre-Execution Agent Selection** — the runner says when it applies (only when `crew.yaml`
|
|
101
|
+
declares `agent_dependencies:`) and which of its parts to read
|
|
100
102
|
8. Execute the pipeline step by step following the runner instructions
|
|
101
103
|
|
|
102
104
|
## Dashboard (Optional)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
1.
|
|
1
|
+
1.13.0
|
|
@@ -119,3 +119,8 @@ catalog:
|
|
|
119
119
|
name: "Documento oficial (Word)"
|
|
120
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
121
|
file: documento-oficial.md
|
|
122
|
+
|
|
123
|
+
- id: texto-livre
|
|
124
|
+
name: "Texto livre"
|
|
125
|
+
whenToUse: "Creating agents that write a text with no channel and no Word file: commercial proposal, draft that becomes HTML or PDF, work plan, internal report."
|
|
126
|
+
file: texto-livre.md
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "Texto livre"
|
|
3
|
+
content_type: "plain-text"
|
|
4
|
+
description: "Text with no channel and no Word file: a proposal, a draft that becomes HTML or PDF, a plan, an internal report"
|
|
5
|
+
whenToUse: |
|
|
6
|
+
Creating agents that write a text that is not a post for a network and is not a document to print or sign: commercial proposal, draft (minuta) that another step turns into HTML or PDF, work plan, internal report, briefing.
|
|
7
|
+
version: "1.0.0"
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Compact Rules
|
|
11
|
+
|
|
12
|
+
1. Write the full, final text: no outline, no notes to the reader, no "insert here".
|
|
13
|
+
2. No YAML frontmatter and no labels such as `=== TITLE ===`: everything in the file is the text itself.
|
|
14
|
+
3. Use `#`, `##` and `###` for the sections, simple tables for figures, `- ` for lists.
|
|
15
|
+
4. Missing real data is marked `[PREENCHER: o que falta]`; never invent a name, a date, a price or a number.
|
|
16
|
+
5. Copy figures exactly from the file they come from; when a total is shown, the parts add up to it.
|
|
17
|
+
6. Follow the structure the step asks for (its "Output Format"): this guide adds no structure of its own.
|
|
18
|
+
|
|
19
|
+
## What this format does not do
|
|
20
|
+
|
|
21
|
+
There is no size limit here and nothing is converted: the delivery keeps the file as it is, in
|
|
22
|
+
`outros/`. For a text to print, sign or file, use `documento-oficial`; for a post, an e-mail or a
|
|
23
|
+
message, use the format of that channel.
|
|
@@ -9,6 +9,7 @@ crews/{code}/
|
|
|
9
9
|
├── crew.yaml the crew: identity, sources, limits
|
|
10
10
|
├── crew-party.csv one row per agent (the names shown to the user)
|
|
11
11
|
├── agents/{agent-id}.agent.md
|
|
12
|
+
├── agents/{agent-id}/tasks/ the task files of an agent that declares `tasks:` (optional)
|
|
12
13
|
├── pipeline/
|
|
13
14
|
│ ├── pipeline.yaml the order of the steps
|
|
14
15
|
│ ├── steps/step-NN-{name}.md
|
|
@@ -132,7 +133,7 @@ outputFile: crews/atas-do-conselho/output/pauta.md # optional: the user's answ
|
|
|
132
133
|
|---|---|
|
|
133
134
|
| `execution` | `subagent` runs in the background; `inline` runs in the conversation. A step that publishes or sends is always `inline` |
|
|
134
135
|
| `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
|
|
136
|
+
| `format` | every step whose text is checked before the review (from the `on_reject` step up to the review) declares one; without it the writer does not get the guide of that kind of text and the checker looks in the file for pieces of a network (caption, post, blog title). A text to print, sign or file is `documento-oficial`; a text with no channel and no Word file (a proposal, a draft that becomes HTML or PDF, a plan) is `texto-livre`. Omit only for research, analysis and the review itself |
|
|
136
137
|
| `inputFile`, `outputFile` | always under `crews/{code}/output/`; never `pipeline/data/` |
|
|
137
138
|
| `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
139
|
| `side_effects: irreversible` | every step that publishes, posts or sends outside the project; such steps come after the review and the final approval |
|
|
@@ -87,7 +87,7 @@ each. Write every file in that format; what follows here only adds what is speci
|
|
|
87
87
|
prose of step files and tasks, between backticks, e.g. `` `Ativos/Identidade Visual/logo.png` ``. NEVER write absolute paths
|
|
88
88
|
(`C:/…`, `J:/…`, `/Users/…`): they break as soon as the user moves or syncs the folder.
|
|
89
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
|
|
90
|
+
the agent(s) whose output it reads, via `inputFile` or in its "Context Loading" list.
|
|
91
91
|
|
|
92
92
|
2. **`crews/{code}/crew-party.csv`** — Agent manifest
|
|
93
93
|
- The header row MUST be EXACTLY these columns, in this order:
|
|
@@ -450,7 +450,7 @@ that the agent knows exactly what to produce.]
|
|
|
450
450
|
|
|
451
451
|
[A COMPLETE, realistic example of what this step should produce.
|
|
452
452
|
This is not a template — it's a fully realized output with realistic content.
|
|
453
|
-
Must be
|
|
453
|
+
Must be 15+ lines and demonstrate the expected quality, depth, and formatting.
|
|
454
454
|
The agent uses this as a reference for what "good" looks like.]
|
|
455
455
|
|
|
456
456
|
## Veto Conditions
|
|
@@ -607,7 +607,7 @@ Additional programmatic checks — read the filesystem to verify:
|
|
|
607
607
|
- [ ] Every `agent_dependencies` key and value references a real agent `id` from crew-party.csv
|
|
608
608
|
- [ ] All task files referenced in agent frontmatter exist
|
|
609
609
|
- [ ] All step files referenced in `pipeline.yaml` exist
|
|
610
|
-
- [ ] Skills listed in `crew.yaml` are installed in `skills/`
|
|
610
|
+
- [ ] Skills listed in `crew.yaml` are installed in `skills/` (the native ones, `web_search` and `web_fetch`, need no folder)
|
|
611
611
|
- [ ] Best-practices files referenced by `format:` fields in steps exist in `_opencrew/core/best-practices/`
|
|
612
612
|
|
|
613
613
|
---
|
|
@@ -81,7 +81,7 @@ Compile all research into a structured research brief document. This will feed P
|
|
|
81
81
|
|
|
82
82
|
After research completes, determine the crew's tier:
|
|
83
83
|
|
|
84
|
-
1. If a template was used (
|
|
84
|
+
1. If a template was used (`discovery.yaml` has the `template:` field, which the Discovery writes only in that case) → use the `tier` recorded there.
|
|
85
85
|
2. Otherwise, read the default tier from `_opencrew/_memory/preferences.md` → `Default Tier` field.
|
|
86
86
|
3. If neither is set, default to `standard`.
|
|
87
87
|
|
|
@@ -182,7 +182,7 @@ From the crew's purpose and domains (in `discovery.yaml`), identify what human r
|
|
|
182
182
|
| Domain / Need | Possible Roles |
|
|
183
183
|
|---|---|
|
|
184
184
|
| Research, fact-finding, market analysis | 🔎 Pesquisador — finds trends, maps keywords, does market research |
|
|
185
|
-
| Writing, copy, content creation | ✍️ Redator — writes strategic text based on research, including captions and hooks |
|
|
185
|
+
| Writing, copy, content creation, documents | ✍️ Redator — writes strategic text based on research, including captions and hooks; in a document crew, writes the minutes, the letter, the contract or the proposal |
|
|
186
186
|
| Strategy, positioning, planning | 🧠 Estrategista — defines angles, editorial calendar, competitive positioning |
|
|
187
187
|
| Visual design, image creation | 🎨 Designer — creates visual content aligned with brand identity |
|
|
188
188
|
| Quality review, accuracy check | 🔍 Revisor — validates quality, tone, accuracy against criteria |
|
|
@@ -244,7 +244,7 @@ For each approved role, consult this mapping to determine which skills and best-
|
|
|
244
244
|
| Role | Typical Skills | Typical Best-Practices |
|
|
245
245
|
|------|---------------|----------------------|
|
|
246
246
|
| Pesquisador (Researcher) | `web_search`, `web_fetch` (native) | `researching.md` |
|
|
247
|
-
| Redator (Writer/Copywriter) | `web_search` (native, for fact-checking) | `copywriting.md` + platform-specific format file |
|
|
247
|
+
| Redator (Writer/Copywriter) | `web_search` (native, for fact-checking) | `copywriting.md` + platform-specific format file; for a text to print, sign or file: `documento-oficial.md`; for a text with no channel and no Word file (proposal, draft that becomes HTML or PDF, plan): `texto-livre.md` |
|
|
248
248
|
| Estrategista (Strategist) | `web_search` (native) | `strategist.md` |
|
|
249
249
|
| Designer (Visual Designer) | `image-creator`, `image-ai-generator`, `canva` | `image-design.md` |
|
|
250
250
|
| Revisor (Reviewer) | None required | `review.md` |
|
|
@@ -342,7 +342,7 @@ Based on discovery answers + company context + research findings + extracted art
|
|
|
342
342
|
|
|
343
343
|
Before designing any agent from scratch, check the shared registry at `_opencrew/agents/`:
|
|
344
344
|
|
|
345
|
-
1. List
|
|
345
|
+
1. List the files of `_opencrew/agents/` (with your folder-listing tool, no command) — each `.agent.md` file is a reusable base agent
|
|
346
346
|
2. For each role approved in Phase D, check if a matching base agent exists:
|
|
347
347
|
- Pesquisador → `_opencrew/agents/researcher.agent.md`
|
|
348
348
|
- Redator → `_opencrew/agents/copywriter.agent.md`
|
|
@@ -380,7 +380,7 @@ Guidelines:
|
|
|
380
380
|
|
|
381
381
|
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
|
+
- Use `extends:` when the Shared Agent Registry Check found a base agent that fits; design from scratch only the agents with no base, informed by the relevant best-practices files read in Phase A
|
|
384
384
|
- Each agent has exactly one clear responsibility
|
|
385
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
|
|
@@ -7,7 +7,7 @@ You are a strategic systems thinker and patient crew architect. You help users a
|
|
|
7
7
|
## Communication Style
|
|
8
8
|
|
|
9
9
|
- One question at a time — never present two questions in the same message
|
|
10
|
-
- Use numbered lists whenever options are available
|
|
10
|
+
- Use numbered lists whenever options are available (the user knows what to do: never add "reply with a number")
|
|
11
11
|
- Adapt follow-up questions based on what the user says, not a fixed script
|
|
12
12
|
- Confirm understanding before moving to the next topic
|
|
13
13
|
- Maximum 8 questions total across the entire discovery flow
|
|
@@ -70,7 +70,7 @@ If exactly 1 template exists, still offer option 1 ("Começar do zero") as a sec
|
|
|
70
70
|
Ask:
|
|
71
71
|
> "What do you want this crew to do? Describe the end result you want."
|
|
72
72
|
|
|
73
|
-
This is always the first question. Accept any answer — a sentence, a paragraph, bullet points. Do NOT assume any domain. Do NOT suggest options at this stage.
|
|
73
|
+
This is always the first question — except when the command already carried the description (`/opencrew create <description>`): then do not ask it again; repeat the description in one sentence and ask only "É isso? Quer acrescentar alguma coisa?". Accept any answer — a sentence, a paragraph, bullet points. Do NOT assume any domain. Do NOT suggest options at this stage.
|
|
74
74
|
|
|
75
75
|
---
|
|
76
76
|
|
|
@@ -95,7 +95,7 @@ Save the detected domain as `domain`.
|
|
|
95
95
|
|
|
96
96
|
### Step 3 — Context Exploration (adaptive, ONE question at a time)
|
|
97
97
|
|
|
98
|
-
Based on the detected domain, ask the most relevant contextual question first. Wait for the answer before asking the next one. Ask at most
|
|
98
|
+
Based on the detected domain, ask the most relevant contextual question first. Wait for the answer before asking the next one. Ask at most 3 questions in this step, not counting the project sources question below, which is always asked.
|
|
99
99
|
|
|
100
100
|
**If domain = `content`:**
|
|
101
101
|
1. Who is this content for? (multiple choice: current customers / potential leads / general audience / other)
|
|
@@ -105,7 +105,7 @@ Based on the detected domain, ask the most relevant contextual question first. W
|
|
|
105
105
|
**If domain = `document`:**
|
|
106
106
|
1. Which documents should the crew produce? (open-ended: ata, ofício, contrato, proposta…)
|
|
107
107
|
2. Who signs each document, and who receives it? (open-ended)
|
|
108
|
-
3.
|
|
108
|
+
3. Must the text become a Word file, to print, sign or file? (yes / no — "no" is the proposal or the draft that is read in the chat and laid out by hand later: nothing is converted. Only on a "yes", ask in the same message whether the organization has letterhead — logo, header lines, footer; the letterhead itself is set up later, the first time a Word document is generated)
|
|
109
109
|
|
|
110
110
|
The project sources question below matters most here: ask which files of the project rule the text (bylaws, previous minutes, price table, contract template).
|
|
111
111
|
|
|
@@ -206,7 +206,7 @@ Set `investigation.enabled: false` and continue.
|
|
|
206
206
|
|
|
207
207
|
### Step 6 — Target Formats (content crews ONLY)
|
|
208
208
|
|
|
209
|
-
If domain = `document`, do not ask: save `target_formats: ["documento-oficial"]
|
|
209
|
+
If domain = `document`, do not ask: save `target_formats: ["documento-oficial"]` when the text must become a Word file (question 3 of Step 3), or `["texto-livre"]` when it must not. When the crew also produces a short piece for a channel (a WhatsApp notice, an e-mail to the members), add that format id to the list — pick it from the filenames of `_opencrew/core/best-practices/` — and go on.
|
|
210
210
|
Skip this step entirely for the other non-content domains.
|
|
211
211
|
|
|
212
212
|
If domain = `content`, ask:
|
|
@@ -268,6 +268,7 @@ project_sources: # relative to the project root; becomes `fo
|
|
|
268
268
|
purpose: "{what the crew uses it for}"
|
|
269
269
|
purpose: "{user's description from Step 1}"
|
|
270
270
|
domain: "{document | content | research | automation | analysis | mixed}"
|
|
271
|
+
template: "{template folder name}" # ONLY when a template was chosen in Step 0; omit the line otherwise
|
|
271
272
|
# When a template was used (Step 0), these fields are populated from discovery.template.yaml:
|
|
272
273
|
domains: [] # list of domain tags from template (e.g., [content-marketing, seo])
|
|
273
274
|
tier: "standard" # from template or preferences Default Tier
|
|
@@ -289,7 +290,8 @@ context:
|
|
|
289
290
|
documents: "{answer from Step 3}"
|
|
290
291
|
signer: "{who signs}"
|
|
291
292
|
recipients: "{who receives}"
|
|
292
|
-
|
|
293
|
+
word_file: "{yes | no}"
|
|
294
|
+
letterhead: "{yes | no | not sure — only when word_file is yes}"
|
|
293
295
|
# For content crews:
|
|
294
296
|
audience: "{answer from Step 3}"
|
|
295
297
|
platforms: "{answer from Step 3}"
|
|
@@ -37,10 +37,12 @@ Este projeto ainda não tem papel timbrado configurado. Quer configurar agora (l
|
|
|
37
37
|
1. Run, from the project root: `node _opencrew/core/scripts/documento.mjs --criar-perfil`
|
|
38
38
|
Its last line is `PERFIL:CRIADO` (the file was created from the model) or `PERFIL:JA-EXISTE`
|
|
39
39
|
(it was already there and was not touched).
|
|
40
|
-
2. Ask the user
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
2. Ask the user three questions, one at a time, with these words (the logo is a PNG file of up
|
|
41
|
+
to 2 MB inside the project, given by its path from the root):
|
|
42
|
+
- "Qual é o arquivo do logotipo? (PNG, dentro do projeto. Pode responder 'sem logotipo'.)"
|
|
43
|
+
- "Quais são as linhas do cabeçalho? Até três: nome da entidade, CNPJ ou registro, endereço."
|
|
44
|
+
- "Quer um texto no rodapé, além de 'Página X de Y'?"
|
|
45
|
+
Any of them may stay empty: what is empty does not appear in the document.
|
|
44
46
|
3. Fill the file `_opencrew/_memory/documento-oficial.md` with the answers: write only the value
|
|
45
47
|
after the colon of `logotipo`, `cabecalho_1`, `cabecalho_2`, `cabecalho_3` and `rodape`, each
|
|
46
48
|
exactly as the user gave it. Leave every other line as it is (comments, margins, font).
|
|
@@ -103,7 +105,9 @@ one message in PT-BR and stops, with nothing written). Show the message to the u
|
|
|
103
105
|
|
|
104
106
|
- **The message points to something in the command you wrote** (an option, a path, more than one
|
|
105
107
|
file): fix the command and run it once more.
|
|
106
|
-
- **
|
|
108
|
+
- **"Não encontrei {arquivo}." or "Só converto texto…"**: the file is not there, or it is not a
|
|
109
|
+
`.md` or `.txt`. Show the message and go back to the question of Step 1.
|
|
110
|
+
- **The message starts with "Perfil, linha {n}:"** (an unknown or misspelled key, a value out of range, a logo
|
|
107
111
|
that is missing, is not a PNG or is over 2 MB): the document is not generated with a wrong
|
|
108
112
|
letterhead. Show the message, ask the user for the right value of that line, write it in the
|
|
109
113
|
profile and run again. Do not switch to `--sem-perfil` by yourself.
|
|
@@ -69,7 +69,8 @@ without the `ENTREGA:` line. Do not rewrite it and do not add files it does not
|
|
|
69
69
|
the report of the check made at delivery time (it is not part of the delivery).
|
|
70
70
|
|
|
71
71
|
- `ENTREGA:OK` → go on with the run (Step 5 first, when it applies). When the summary has a line
|
|
72
|
-
|
|
72
|
+
that starts with "Sem papel timbrado:", the Word documents came out with no letterhead: say so
|
|
73
|
+
and offer to set it up (`/opencrew documento`); after the profile exists, deliver again.
|
|
73
74
|
- `ENTREGA:COM_RESSALVA` → everything that was missing is a ressalva the user accepted: the
|
|
74
75
|
`LEIA-ME.md` opens with it and the channel is "Pronto, com ressalva"; go on as with `ENTREGA:OK`.
|
|
75
76
|
- `ENTREGA:INCOMPLETA` → a channel is not ready, the destination was refused or a file could not be
|
|
@@ -103,7 +104,11 @@ the report of the check made at delivery time (it is not part of the delivery).
|
|
|
103
104
|
"Não consegui gravar …"): show the message as it came and ask for another folder (Step 5, with
|
|
104
105
|
the new answer) or for a new attempt, which is the same command again. A file of the list that
|
|
105
106
|
does not exist: ask for it, or take it out of the list.
|
|
106
|
-
- **A Word document that was not generated** (the line
|
|
107
|
+
- **A Word document that was not generated** (the line "Não consegui gerar o Word de
|
|
108
|
+
{arquivo}: …"): show the message as it came; this is never accepted with option 2. When the
|
|
109
|
+
reason starts with "Perfil, linha {n}:", the letterhead profile has a wrong line: ask the user
|
|
110
|
+
for the right value, write it in `_opencrew/_memory/documento-oficial.md` and run the same
|
|
111
|
+
command again.
|
|
107
112
|
The first call never has `--aceitar-pendencias`. Outside option 2 it goes only when the user
|
|
108
113
|
already chose "Aceitar assim mesmo" in the review loop of this run and what is missing is only
|
|
109
114
|
what was accepted there: then run the command again with it, without asking.
|
|
@@ -52,7 +52,7 @@ codes between brackets, the `--aplicar` lines or the `CONSERTO:` status line.
|
|
|
52
52
|
|---|---|---|
|
|
53
53
|
| `nome-de-agente` | The agent has no two-word persona name. Propose one by the Agent Naming Convention of `_opencrew/core/prompts/design.prompt.md` (two words with the same initial, a different initial for each agent of the crew), keeping the first name the agent already has, and ask: "O agente {id} está sem nome de pessoa. Proponho {Nome Sobrenome}. Posso gravar?" | `--aplicar "nome:{id}={Nome Sobrenome}"`; the names reach the list of the crew with `manifesto`, below — when `manifesto` is not among the findings, run it right after this one |
|
|
54
54
|
| `manifesto` | "O arquivo de nomes da crew está incompleto; por isso aparece a função no lugar do nome. Posso refazer a partir dos arquivos dos agentes?" | `--aplicar "manifesto"` |
|
|
55
|
-
| `formato` | Read each listed step and propose one format per step, among the files of `_opencrew/core/best-practices/` (and `_opencrew/best-practices.local/`). A text to print, sign or file — ata, ofício, contrato,
|
|
55
|
+
| `formato` | Read each listed step and propose one format per step, among the files of `_opencrew/core/best-practices/` (and `_opencrew/best-practices.local/`). A text that must become a Word file to print, sign or file — ata, ofício, contrato, parecer — gets `documento-oficial`; a text with no channel that does not become a Word file (a plan, an internal report, a proposal or a draft that becomes HTML or PDF) gets `texto-livre`. When you cannot tell which of the two it is (a proposta, a minuta), ask first: "O texto do passo {n} precisa virar um arquivo Word para imprimir ou assinar?" — sim: `documento-oficial`; não: `texto-livre`. When the user refuses your proposal and says what the text is, propose once more with the right format. Then: "Estes passos não dizem que tipo de texto produzem; sem isso, o redator não recebe o guia do tipo de texto e o verificador procura no arquivo peças de rede. Minha proposta: {passo → formato}. Posso gravar assim?" | one `--aplicar "formato:{passo}={formato}"` per step |
|
|
56
56
|
| `fontes` | "Esta crew não registra os arquivos do projeto que ela deve ler antes de escrever. Quais arquivos ou pastas ela precisa conhecer? (Pode responder 'nenhum'.)" Confirm that each one exists (search the project when only a name was given) and ask what the crew uses it for | one `--aplicar "fonte:{caminho}={para que}"` per file or folder, the path relative to the project root |
|
|
57
57
|
| `proibicao` | For each listed item: "Esta proibição não tem um trecho entre aspas, então o verificador não consegue barrar: «{item}». Qual trecho exato devo barrar? Se for uma regra de conteúdo, e não uma palavra ou expressão, responda 'revisão humana': ela fica para o revisor." The excerpt must be words of the item itself | `--aplicar "proibicao:{n}={trecho}"` or `--aplicar "proibicao:{n}=revisao-humana"` |
|
|
58
58
|
| `irreversivel` | For each listed step: "O passo {n} é feito por um agente que tem uma ferramenta de publicar ou enviar ({skill}). Este passo publica ou envia alguma coisa para fora do projeto? Se sim, marco o passo para que ele nunca seja repetido sozinho." | `--aplicar "irreversivel:{n}"` only for a yes |
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Output Contract Validation
|
|
2
|
+
|
|
3
|
+
> Part of the Pipeline Runner (`_opencrew/core/runner.pipeline.md`). Read it only when the step's frontmatter declares an `output_contract:` field.
|
|
4
|
+
|
|
5
|
+
If the step's frontmatter declares an `output_contract:` field, apply structured validation
|
|
6
|
+
in the same call as the basic file existence check (Post-Step Output Validation):
|
|
7
|
+
|
|
8
|
+
1. **Required sections check**: If `output_contract.required_sections` is defined, add
|
|
9
|
+
`--secoes {min_sections}` to the same `conferir` command: the file needs at least that many
|
|
10
|
+
lines starting with `## `.
|
|
11
|
+
|
|
12
|
+
2. **TL;DR check**: If the output contract requires a TL;DR section, add `--tldr` to the same
|
|
13
|
+
`conferir` command.
|
|
14
|
+
|
|
15
|
+
3. **If a check fails** (the last line is `CAMINHO:REPROVADO {motivo}`, with a motivo other than
|
|
16
|
+
`arquivo ausente ou vazio`; the script reports the first one):
|
|
17
|
+
- Present to user: "⚠️ Output from {Agent Name} is incomplete: {motivo}"
|
|
18
|
+
- Options as numbered list:
|
|
19
|
+
1. Accept anyway and continue
|
|
20
|
+
2. Retry step (re-execute the agent)
|
|
21
|
+
3. Abort pipeline
|
|
22
|
+
|
|
23
|
+
4. **If no `output_contract` is defined**, skip this validation entirely (backward compatible).
|
|
24
|
+
|
|
25
|
+
Example `output_contract` in step frontmatter:
|
|
26
|
+
```yaml
|
|
27
|
+
output_contract:
|
|
28
|
+
required_sections:
|
|
29
|
+
- "Fontes Pesquisadas"
|
|
30
|
+
- "Principais Descobertas"
|
|
31
|
+
- "TL;DR"
|
|
32
|
+
min_sections: 3
|
|
33
|
+
```
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Escritório (optional live view)
|
|
2
|
+
|
|
3
|
+
> Part of the Pipeline Runner (`_opencrew/core/runner.pipeline.md`). Read it only when `preferences.md` has `Dashboard: enabled`.
|
|
4
|
+
|
|
5
|
+
A local page that shows the crew at work, off by default. Follow this part only when the
|
|
6
|
+
already-loaded `preferences.md` has `Dashboard: enabled` (written `- **Dashboard:** enabled` or
|
|
7
|
+
plain `Dashboard: enabled`, any letter case); otherwise run none of these commands. When it is on,
|
|
8
|
+
run, from the project root, the one-line command of each moment:
|
|
9
|
+
|
|
10
|
+
| Moment | Command |
|
|
11
|
+
|---|---|
|
|
12
|
+
| Start of the run (Initialization, step 6) | `node _opencrew/core/scripts/estado.mjs "{name}" iniciar --passos {N}` |
|
|
13
|
+
| Right after `iniciar`, once per deselected agent | `node _opencrew/core/scripts/estado.mjs "{name}" pular --agente {id}` |
|
|
14
|
+
| Before each step, each time it starts | `node _opencrew/core/scripts/estado.mjs "{name}" passo --n {K} --agente {id} --rotulo "{rótulo}" --mensagem "{frase}"` |
|
|
15
|
+
| Before asking the question of a checkpoint (instead of `passo`) | `node _opencrew/core/scripts/estado.mjs "{name}" checkpoint --n {K} --agente {id} --rotulo "{rótulo}"` |
|
|
16
|
+
| End of the run (After Pipeline Completion) | `node _opencrew/core/scripts/estado.mjs "{name}" concluir` |
|
|
17
|
+
| Run aborted after `iniciar`, by the user or by an error | `node _opencrew/core/scripts/estado.mjs "{name}" falhar --motivo "{motivo}"` |
|
|
18
|
+
|
|
19
|
+
- **One at a time** — Run these commands one at a time, waiting for the `ESTADO:` line of each
|
|
20
|
+
before the next — never in parallel or in the background (each one reads and rewrites the same file).
|
|
21
|
+
- **Values** — `{name}`: the crew code. `{N}`: how many steps will run, checkpoints included (a
|
|
22
|
+
deselected agent's steps do not count). `{K}`: the step's position among them, from 1. `{id}`: the agent's `id` column in
|
|
23
|
+
`crew-party.csv`; a step or checkpoint with no `agent:` goes without `--agente`
|
|
24
|
+
(the table shows the full form). `{rótulo}`: the step's name, in
|
|
25
|
+
a few words. `--mensagem` goes only when the agent changed since the last `passo` (so never on the first
|
|
26
|
+
one): one sentence on what the previous agent delivered — never look at the next step. `{motivo}`: why the run stopped.
|
|
27
|
+
- **Text on the command line** — `--rotulo`, `--mensagem` and `--motivo` go between double quotes,
|
|
28
|
+
on one line, starting with a letter or a digit, with only letters (accents included), digits,
|
|
29
|
+
spaces and `. , : ; - ( ) / ?`. Drop every other sign (quotes of any kind, `$`, backtick, `\`,
|
|
30
|
+
`%`, `!`, emoji). If no text is left, omit the option. Write them in the user's language.
|
|
31
|
+
- **After `iniciar`**, when it answers `ESTADO:OK`, show the user once:
|
|
32
|
+
`Escritório ligado. Se a página não estiver aberta, rode em outro terminal: node _opencrew/core/scripts/escritorio.mjs`
|
|
33
|
+
- **The Escritório never stops the run.** A command that fails, does not run or answers
|
|
34
|
+
`ESTADO:IGNORADO`: go on, do not repeat that event, ask nothing, and tell the user once per run,
|
|
35
|
+
in one line: `O escritório não foi atualizado nesta execução; o trabalho segue normalmente.` With
|
|
36
|
+
the reason "escritório desligado", say nothing and stop calling the script for the rest of this run.
|
|
37
|
+
- The script is the only writer: never read, write or describe `crews/{name}/state.json` yourself.
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# End of the run
|
|
2
|
+
|
|
3
|
+
> Part of the Pipeline Runner (`_opencrew/core/runner.pipeline.md`). Read it when the pipeline has completed. It continues the list of "After Pipeline Completion" in the runner: items 2 and 3 below are the items 2 and 3 of that list; follow them in order.
|
|
4
|
+
|
|
5
|
+
2. **Update crew memory** — write to BOTH files:
|
|
6
|
+
|
|
7
|
+
### 2a. Update `memories.md` (living preferences)
|
|
8
|
+
|
|
9
|
+
Read `crews/{name}/_memory/memories.md` in full. Then identify candidates from this run: **only explicit user feedback** — approvals with comments, rejections with reasons, direct requests ("prefiro X", "não quero Y"). Never infer preferences.
|
|
10
|
+
|
|
11
|
+
For each candidate:
|
|
12
|
+
- If an equivalent memory already exists and is compatible → skip (no duplicate)
|
|
13
|
+
- If an equivalent memory exists but contradicts the new item → replace with the newer version
|
|
14
|
+
- If no equivalent exists → add to the correct semantic section:
|
|
15
|
+
- Writing style choices → `## Estilo de Escrita`
|
|
16
|
+
- Visual/design preferences → `## Design Visual`
|
|
17
|
+
- Content structure choices → `## Estrutura de Conteúdo`
|
|
18
|
+
- Explicit rejections or prohibitions → `## Proibições Explícitas`, in the canonical form
|
|
19
|
+
(`- Nunca usar "termo"` or `- Nunca usar "termo" → usar "outro"`)
|
|
20
|
+
- Crew-specific technical patterns → `## Técnico (específico do crew)`
|
|
21
|
+
|
|
22
|
+
**Never write to `memories.md`:**
|
|
23
|
+
- Runner inferences ("usuário parece preferir X")
|
|
24
|
+
- Run scores, review grades, output file paths, topics from past runs
|
|
25
|
+
|
|
26
|
+
**Technical routing:** For any technical learning (bugs, workarounds, API behavior):
|
|
27
|
+
- If it affects any crew (Playwright bugs, OS rendering quirks, API limits) → write to `_opencrew/best-practices.local/{format}.md` instead of `memories.md` (copy the core file there first if the local one does not exist yet — the core folder is replaced by every `update`; the local one is never touched)
|
|
28
|
+
- If it is specific to this crew's output type or toolchain → add to `## Técnico (específico do crew)` following the dedup rules above
|
|
29
|
+
|
|
30
|
+
After applying all candidates, write the updated `memories.md`.
|
|
31
|
+
|
|
32
|
+
If no candidates are found (the run had no explicit user feedback), skip writing `memories.md` entirely — do not write an unmodified copy. Always proceed to step 2b regardless.
|
|
33
|
+
|
|
34
|
+
### 2b. Prepend to `runs.md` (reverse-chronological log — newest run first)
|
|
35
|
+
|
|
36
|
+
If `crews/{name}/_memory/runs.md` does not exist, create it first with:
|
|
37
|
+
```markdown
|
|
38
|
+
# Run History: {crew-name}
|
|
39
|
+
|
|
40
|
+
| Data | Run ID | Tema | Output | Score | Resultado |
|
|
41
|
+
|------|--------|------|--------|-------|-----------|
|
|
42
|
+
```
|
|
43
|
+
Then proceed to prepend the new row.
|
|
44
|
+
|
|
45
|
+
Read `crews/{name}/_memory/runs.md`. Prepend one new row to the table (immediately after the header row), with:
|
|
46
|
+
- `Data`: the date of this run (the first 10 characters of the `run_id`)
|
|
47
|
+
- `Run ID`: the `run_id` for this execution
|
|
48
|
+
- `Tema`: the topic or user request from this run (1 sentence max)
|
|
49
|
+
- `Output`: brief description of what was generated (e.g., "Carrossel 9 slides", "Thread 7 posts")
|
|
50
|
+
- `Score`: `{approved}/{total}` agent outputs approved without corrections (e.g., `4/5`)
|
|
51
|
+
- `Resultado`: one of — `Aprovado` / `Rejeitado` / `Publicado` / `Abortado`
|
|
52
|
+
|
|
53
|
+
No other data.
|
|
54
|
+
|
|
55
|
+
The `Score` column tracks how many agent outputs were approved by the user without corrections in this run. Count only explicit checkpoint approvals (not "skip" or "continue"). Format: `{approved}/{total checkpoints}` (e.g., `4/5` means 4 of 5 agent outputs were approved as-is).
|
|
56
|
+
|
|
57
|
+
### 2c. Post-Run Reflection (pattern detection)
|
|
58
|
+
|
|
59
|
+
After updating `memories.md` and `runs.md`, run a reflection pass. This is a lightweight analysis — not a full agent execution, just pattern matching on the run's feedback and past memory.
|
|
60
|
+
|
|
61
|
+
1. **Collect this run's corrections**: From checkpoint responses, gather every user rejection or correction. A correction is:
|
|
62
|
+
- A rejected output with a reason ("tom muito informal", "cor não combina", "fonte sem data")
|
|
63
|
+
- A modification request during checkpoint ("muda o título para X", "usa azul em vez de verde")
|
|
64
|
+
|
|
65
|
+
2. **Look for recurrence**: Compare each correction against past runs recorded in `memories.md`:
|
|
66
|
+
- Search `memories.md` for similar patterns (same category, same agent, same type of correction)
|
|
67
|
+
- Count: how many past runs have a correction matching this pattern?
|
|
68
|
+
- A "match" means the same agent + same type of error (e.g., "redator + tom informal", "designer + cores saturadas")
|
|
69
|
+
|
|
70
|
+
3. **Promote to Regra de Ouro**: If the SAME pattern appears in **3 or more runs** (including this one):
|
|
71
|
+
a. Add a new entry under `## Regras de Ouro` in `memories.md`:
|
|
72
|
+
```markdown
|
|
73
|
+
## Regras de Ouro (promovidas após 3+ ocorrências)
|
|
74
|
+
|
|
75
|
+
- **{Agent role}**: SEMPRE {correct behavior}. {Why — grounded in user feedback}.
|
|
76
|
+
(Runs: #{run1}, #{run2}, #{run3})
|
|
77
|
+
```
|
|
78
|
+
Example:
|
|
79
|
+
```markdown
|
|
80
|
+
- **Redator**: SEMPRE verificar se o CTA contém link rastreável antes de finalizar.
|
|
81
|
+
(Runs: #2026-08-01-143022, #2026-08-05-091530, #2026-08-10-160845)
|
|
82
|
+
```
|
|
83
|
+
b. Remove the individual entries from their original sections (`## Estilo de Escrita`, `## Design Visual`, etc.) — the Regra de Ouro replaces them.
|
|
84
|
+
c. Display to the user:
|
|
85
|
+
```
|
|
86
|
+
💡 Regra de Ouro detectada:
|
|
87
|
+
"{correct behavior}" aconteceu 3 vezes.
|
|
88
|
+
Vou aplicar automaticamente a partir de agora.
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
4. **Mark improvement**: If a previously recurring error did NOT happen this run:
|
|
92
|
+
- Add a `✅` marker to the Regra de Ouro entry: `✅ **Redator**: SEMPRE ...`
|
|
93
|
+
- This tracks that the crew is improving — the rule is working.
|
|
94
|
+
|
|
95
|
+
5. **Bail out early**: If this run had zero corrections (all checkpoints approved), skip the entire reflection — nothing to learn.
|
|
96
|
+
|
|
97
|
+
6. **Reflection budget**: Maximum 30 seconds of analysis. If the crew has a long history (>20 past runs), sample the most recent 10 runs for pattern matching. This is a quick scan, not an exhaustive audit.
|
|
98
|
+
|
|
99
|
+
3. Present completion summary:
|
|
100
|
+
```
|
|
101
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
102
|
+
✅ Pipeline complete!
|
|
103
|
+
📁 Delivery: crews/{name}/output/{run_id}/entrega/ — start with LEIA-ME.md
|
|
104
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
105
|
+
|
|
106
|
+
What would you like to do?
|
|
107
|
+
● Run again (new topic)
|
|
108
|
+
○ Edit this content
|
|
109
|
+
○ Back to menu
|
|
110
|
+
```
|