create-genia-os 2.1.1 → 2.3.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 (89) hide show
  1. package/README.md +117 -11
  2. package/bin/index.js +92 -0
  3. package/package.json +4 -2
  4. package/template/.claude/CLAUDE.md +215 -215
  5. package/template/.claude/agent-memory/analyst/MEMORY.md +20 -20
  6. package/template/.claude/agent-memory/architect/MEMORY.md +20 -20
  7. package/template/.claude/agent-memory/dev/MEMORY.md +20 -20
  8. package/template/.claude/agent-memory/devops/MEMORY.md +20 -20
  9. package/template/.claude/agent-memory/pm/MEMORY.md +20 -20
  10. package/template/.claude/agent-memory/po/MEMORY.md +20 -20
  11. package/template/.claude/agent-memory/qa/MEMORY.md +20 -20
  12. package/template/.claude/agent-memory/reviewer/MEMORY.md +20 -20
  13. package/template/.claude/agent-memory/sm/MEMORY.md +20 -20
  14. package/template/.claude/hooks/enforce-git-push-authority.py +70 -70
  15. package/template/.claude/hooks/metrics-tracker.cjs +65 -0
  16. package/template/.claude/hooks/precompact-session-digest.cjs +87 -87
  17. package/template/.claude/hooks/sql-governance.py +65 -65
  18. package/template/.claude/hooks/synapse-engine.cjs +122 -122
  19. package/template/.claude/hooks/write-path-validation.py +59 -59
  20. package/template/.claude/rules/agent-authority.md +39 -39
  21. package/template/.claude/rules/agent-handoff.md +71 -71
  22. package/template/.claude/rules/agent-memory.md +61 -61
  23. package/template/.claude/rules/ids-principles.md +52 -52
  24. package/template/.claude/rules/mcp-usage.md +49 -49
  25. package/template/.claude/rules/new-project.md +157 -0
  26. package/template/.claude/rules/story-lifecycle.md +87 -87
  27. package/template/.claude/rules/workflow-execution.md +68 -68
  28. package/template/.claude/settings.json +58 -58
  29. package/template/.claude/settings.local.json +14 -14
  30. package/template/.genia/CONSTITUTION.md +129 -129
  31. package/template/.genia/contexts/api-patterns.md +134 -134
  32. package/template/.genia/contexts/nextjs-react.md +210 -210
  33. package/template/.genia/contexts/projeto.md +18 -18
  34. package/template/.genia/contexts/supabase.md +152 -152
  35. package/template/.genia/contexts/whatsapp-cloud.md +176 -176
  36. package/template/.genia/core-config.yaml +192 -192
  37. package/template/.genia/development/agents/analyst.md +138 -138
  38. package/template/.genia/development/agents/architect.md +171 -171
  39. package/template/.genia/development/agents/dev.md +160 -160
  40. package/template/.genia/development/agents/devops.md +200 -200
  41. package/template/.genia/development/agents/pm.md +142 -142
  42. package/template/.genia/development/agents/po.md +165 -165
  43. package/template/.genia/development/agents/qa.md +183 -183
  44. package/template/.genia/development/agents/reviewer.md +198 -198
  45. package/template/.genia/development/agents/sm.md +230 -230
  46. package/template/.genia/development/checklists/architecture-review.md +189 -189
  47. package/template/.genia/development/checklists/pre-commit.md +205 -205
  48. package/template/.genia/development/checklists/pre-deploy.md +230 -230
  49. package/template/.genia/development/checklists/qa-gate.md +216 -216
  50. package/template/.genia/development/checklists/story-dod.md +155 -155
  51. package/template/.genia/development/tasks/code-review.md +197 -197
  52. package/template/.genia/development/tasks/criar-prd.md +170 -170
  53. package/template/.genia/development/tasks/criar-spec.md +188 -188
  54. package/template/.genia/development/tasks/criar-story.md +185 -185
  55. package/template/.genia/development/tasks/debug-sistematico.md +230 -230
  56. package/template/.genia/development/tasks/dev-implement.md +199 -199
  57. package/template/.genia/development/tasks/qa-review.md +224 -224
  58. package/template/.genia/development/workflows/brownfield.md +178 -178
  59. package/template/.genia/development/workflows/delivery.md +208 -208
  60. package/template/.genia/development/workflows/development.md +189 -189
  61. package/template/.genia/development/workflows/greenfield.md +166 -166
  62. package/template/.genia/development/workflows/planning.md +167 -167
  63. package/template/.genia/development/workflows/qa-loop.md +179 -179
  64. package/template/.genia/development/workflows/spec-pipeline.md +192 -192
  65. package/template/.genia/development/workflows/story-development-cycle.md +252 -252
  66. package/template/.genia/guidelines/clean-code.md +98 -98
  67. package/template/.genia/guidelines/testing.md +176 -176
  68. package/template/.genia/skills/design/canvas-design.md +109 -109
  69. package/template/.genia/skills/design/frontend-design.md +140 -140
  70. package/template/.genia/skills/dev/mcp-builder.md +172 -172
  71. package/template/.genia/skills/dev/webapp-testing.md +150 -150
  72. package/template/.genia/skills/documents/docx.md +153 -153
  73. package/template/.genia/skills/documents/pdf.md +134 -134
  74. package/template/.genia/skills/documents/pptx.md +118 -118
  75. package/template/.genia/skills/documents/xlsx.md +140 -140
  76. package/template/.synapse/agent-analyst +8 -8
  77. package/template/.synapse/agent-architect +8 -8
  78. package/template/.synapse/agent-dev +8 -8
  79. package/template/.synapse/agent-devops +8 -8
  80. package/template/.synapse/agent-pm +8 -8
  81. package/template/.synapse/agent-po +7 -7
  82. package/template/.synapse/agent-qa +8 -8
  83. package/template/.synapse/agent-reviewer +7 -7
  84. package/template/.synapse/agent-sm +7 -7
  85. package/template/.synapse/constitution +7 -7
  86. package/template/.synapse/context +8 -8
  87. package/template/.synapse/global +8 -8
  88. package/template/.synapse/manifest +14 -14
  89. package/template/README.md +53 -53
@@ -1,122 +1,122 @@
1
- #!/usr/bin/env node
2
- /**
3
- * GEN.IA OS — Synapse Engine v1.0
4
- * Trigger: UserPromptSubmit
5
- *
6
- * Pipeline de 3 camadas de injeção de contexto em cada prompt:
7
- * L0: Constituição (sempre ativa, não-negociável)
8
- * L1: Global + Contexto (sempre ativa)
9
- * L2: Agente específico (quando @agente detectado no prompt)
10
- *
11
- * Timeout: 100ms — NUNCA bloqueia o usuário
12
- * Inspirado no AIOS Synapse Engine (MIT License, SynkraAI)
13
- * Adaptado e reescrito para GEN.IA OS — {{TEAM_NAME}} — {{CREATOR_NAME}}
14
- */
15
-
16
- 'use strict';
17
-
18
- const fs = require('fs');
19
- const path = require('path');
20
- const readline = require('readline');
21
-
22
- const TIMEOUT_MS = 100;
23
- const SYNAPSE_DIR = '.synapse';
24
-
25
- // Mapeamento de @agente → domínio synapse
26
- const AGENT_DOMAINS = {
27
- '@analyst': 'agent-analyst',
28
- '@pm': 'agent-pm',
29
- '@architect': 'agent-architect',
30
- '@dev': 'agent-dev',
31
- '@devops': 'agent-devops',
32
- '@qa': 'agent-qa',
33
- '@reviewer': 'agent-reviewer',
34
- '@po': 'agent-po',
35
- '@sm': 'agent-sm',
36
- };
37
-
38
- function readDomain(cwd, domainName) {
39
- try {
40
- const domainPath = path.join(cwd, SYNAPSE_DIR, domainName);
41
- if (fs.existsSync(domainPath)) {
42
- return fs.readFileSync(domainPath, 'utf8').trim();
43
- }
44
- } catch (_) {
45
- // Falha silenciosa — Synapse nunca quebra o fluxo
46
- }
47
- return null;
48
- }
49
-
50
- function detectActiveAgent(prompt) {
51
- if (!prompt) return null;
52
- const lower = prompt.toLowerCase();
53
- for (const [mention, domain] of Object.entries(AGENT_DOMAINS)) {
54
- if (lower.includes(mention)) {
55
- return domain;
56
- }
57
- }
58
- return null;
59
- }
60
-
61
- async function run() {
62
- let inputData = '';
63
- try {
64
- const rl = readline.createInterface({ input: process.stdin, terminal: false });
65
- for await (const line of rl) {
66
- inputData += line + '\n';
67
- }
68
- } catch (_) {
69
- return '';
70
- }
71
-
72
- let data = {};
73
- try {
74
- data = JSON.parse(inputData);
75
- } catch (_) {
76
- return '';
77
- }
78
-
79
- const cwd = data.cwd || process.cwd();
80
- const prompt = data.prompt || '';
81
- const layers = [];
82
-
83
- // L0 — Constituição (sempre)
84
- const constitution = readDomain(cwd, 'constitution');
85
- if (constitution) layers.push(constitution);
86
-
87
- // L1 — Global (sempre)
88
- const global = readDomain(cwd, 'global');
89
- if (global) layers.push(global);
90
-
91
- // L1 — Contexto (sempre)
92
- const context = readDomain(cwd, 'context');
93
- if (context) layers.push(context);
94
-
95
- // L2 — Agente específico (se detectado)
96
- const agentDomain = detectActiveAgent(prompt);
97
- if (agentDomain) {
98
- const agentRules = readDomain(cwd, agentDomain);
99
- if (agentRules) layers.push(agentRules);
100
- }
101
-
102
- if (layers.length === 0) return '';
103
-
104
- return `<synapse-rules>\n${layers.join('\n\n')}\n</synapse-rules>`;
105
- }
106
-
107
- async function main() {
108
- // Timer de segurança — garante timeout de 100ms
109
- const timeoutPromise = new Promise((resolve) =>
110
- setTimeout(() => resolve(''), TIMEOUT_MS)
111
- );
112
-
113
- const result = await Promise.race([run(), timeoutPromise]);
114
-
115
- process.stdout.write(JSON.stringify({ hookSpecificOutput: result || '' }));
116
- process.exit(0);
117
- }
118
-
119
- main().catch(() => {
120
- process.stdout.write(JSON.stringify({ hookSpecificOutput: '' }));
121
- process.exit(0);
122
- });
1
+ #!/usr/bin/env node
2
+ /**
3
+ * GEN.IA OS — Synapse Engine v1.0
4
+ * Trigger: UserPromptSubmit
5
+ *
6
+ * Pipeline de 3 camadas de injeção de contexto em cada prompt:
7
+ * L0: Constituição (sempre ativa, não-negociável)
8
+ * L1: Global + Contexto (sempre ativa)
9
+ * L2: Agente específico (quando @agente detectado no prompt)
10
+ *
11
+ * Timeout: 100ms — NUNCA bloqueia o usuário
12
+ * Inspirado no AIOS Synapse Engine (MIT License, SynkraAI)
13
+ * Adaptado e reescrito para GEN.IA OS — {{TEAM_NAME}} — {{CREATOR_NAME}}
14
+ */
15
+
16
+ 'use strict';
17
+
18
+ const fs = require('fs');
19
+ const path = require('path');
20
+ const readline = require('readline');
21
+
22
+ const TIMEOUT_MS = 100;
23
+ const SYNAPSE_DIR = '.synapse';
24
+
25
+ // Mapeamento de @agente → domínio synapse
26
+ const AGENT_DOMAINS = {
27
+ '@analyst': 'agent-analyst',
28
+ '@pm': 'agent-pm',
29
+ '@architect': 'agent-architect',
30
+ '@dev': 'agent-dev',
31
+ '@devops': 'agent-devops',
32
+ '@qa': 'agent-qa',
33
+ '@reviewer': 'agent-reviewer',
34
+ '@po': 'agent-po',
35
+ '@sm': 'agent-sm',
36
+ };
37
+
38
+ function readDomain(cwd, domainName) {
39
+ try {
40
+ const domainPath = path.join(cwd, SYNAPSE_DIR, domainName);
41
+ if (fs.existsSync(domainPath)) {
42
+ return fs.readFileSync(domainPath, 'utf8').trim();
43
+ }
44
+ } catch (_) {
45
+ // Falha silenciosa — Synapse nunca quebra o fluxo
46
+ }
47
+ return null;
48
+ }
49
+
50
+ function detectActiveAgent(prompt) {
51
+ if (!prompt) return null;
52
+ const lower = prompt.toLowerCase();
53
+ for (const [mention, domain] of Object.entries(AGENT_DOMAINS)) {
54
+ if (lower.includes(mention)) {
55
+ return domain;
56
+ }
57
+ }
58
+ return null;
59
+ }
60
+
61
+ async function run() {
62
+ let inputData = '';
63
+ try {
64
+ const rl = readline.createInterface({ input: process.stdin, terminal: false });
65
+ for await (const line of rl) {
66
+ inputData += line + '\n';
67
+ }
68
+ } catch (_) {
69
+ return '';
70
+ }
71
+
72
+ let data = {};
73
+ try {
74
+ data = JSON.parse(inputData);
75
+ } catch (_) {
76
+ return '';
77
+ }
78
+
79
+ const cwd = data.cwd || process.cwd();
80
+ const prompt = data.prompt || '';
81
+ const layers = [];
82
+
83
+ // L0 — Constituição (sempre)
84
+ const constitution = readDomain(cwd, 'constitution');
85
+ if (constitution) layers.push(constitution);
86
+
87
+ // L1 — Global (sempre)
88
+ const global = readDomain(cwd, 'global');
89
+ if (global) layers.push(global);
90
+
91
+ // L1 — Contexto (sempre)
92
+ const context = readDomain(cwd, 'context');
93
+ if (context) layers.push(context);
94
+
95
+ // L2 — Agente específico (se detectado)
96
+ const agentDomain = detectActiveAgent(prompt);
97
+ if (agentDomain) {
98
+ const agentRules = readDomain(cwd, agentDomain);
99
+ if (agentRules) layers.push(agentRules);
100
+ }
101
+
102
+ if (layers.length === 0) return '';
103
+
104
+ return `<synapse-rules>\n${layers.join('\n\n')}\n</synapse-rules>`;
105
+ }
106
+
107
+ async function main() {
108
+ // Timer de segurança — garante timeout de 100ms
109
+ const timeoutPromise = new Promise((resolve) =>
110
+ setTimeout(() => resolve(''), TIMEOUT_MS)
111
+ );
112
+
113
+ const result = await Promise.race([run(), timeoutPromise]);
114
+
115
+ process.stdout.write(JSON.stringify({ hookSpecificOutput: result || '' }));
116
+ process.exit(0);
117
+ }
118
+
119
+ main().catch(() => {
120
+ process.stdout.write(JSON.stringify({ hookSpecificOutput: '' }));
121
+ process.exit(0);
122
+ });
@@ -1,59 +1,59 @@
1
- #!/usr/bin/env python3
2
- """
3
- GEN.IA OS — Hook: write-path-validation
4
- Trigger: PreToolUse (Write)
5
- Ação: Avisa quando documentos são criados fora do path padrão.
6
- """
7
- import json
8
- import sys
9
- import re
10
- import os
11
-
12
-
13
- # Padrões de arquivo → path recomendado
14
- DOC_RULES = {
15
- r"^PRD\.md$": "docs/[projeto]/PRD.md",
16
- r"^SPEC-TECNICO\.md$": "docs/[projeto]/SPEC-TECNICO.md",
17
- r"^COMERCIAL\.md$": "docs/[projeto]/COMERCIAL.md",
18
- r"^BRIEFING\.md$": "docs/[projeto]/BRIEFING.md",
19
- r"^STORY-\d+.*\.md$": "docs/stories/STORY-NNN-slug.md",
20
- r"^ADR-\d+.*\.md$": "docs/[projeto]/adrs/ADR-NNN-titulo.md",
21
- }
22
-
23
-
24
- def main():
25
- try:
26
- raw = sys.stdin.read()
27
- data = json.loads(raw)
28
- except Exception:
29
- sys.exit(0)
30
-
31
- tool = data.get("tool_name", "")
32
- if tool != "Write":
33
- sys.exit(0)
34
-
35
- file_path = data.get("tool_input", {}).get("file_path", "")
36
- if not file_path:
37
- sys.exit(0)
38
-
39
- # Normalizar separadores
40
- normalized = file_path.replace("\\", "/")
41
- filename = os.path.basename(normalized)
42
-
43
- for pattern, correct_path in DOC_RULES.items():
44
- if re.match(pattern, filename, re.IGNORECASE):
45
- # Verificar se está no path correto
46
- if "docs/" not in normalized:
47
- print(
48
- f"[GEN.IA OS] ⚠️ Documento '{filename}' fora do path padrão.\n"
49
- f"[GEN.IA OS] Path recomendado: {correct_path}\n"
50
- f"[GEN.IA OS] Criando assim mesmo — ajuste se necessário.",
51
- file=sys.stderr,
52
- )
53
- break
54
-
55
- sys.exit(0) # Apenas avisa, não bloqueia
56
-
57
-
58
- if __name__ == "__main__":
59
- main()
1
+ #!/usr/bin/env python3
2
+ """
3
+ GEN.IA OS — Hook: write-path-validation
4
+ Trigger: PreToolUse (Write)
5
+ Ação: Avisa quando documentos são criados fora do path padrão.
6
+ """
7
+ import json
8
+ import sys
9
+ import re
10
+ import os
11
+
12
+
13
+ # Padrões de arquivo → path recomendado
14
+ DOC_RULES = {
15
+ r"^PRD\.md$": "docs/[projeto]/PRD.md",
16
+ r"^SPEC-TECNICO\.md$": "docs/[projeto]/SPEC-TECNICO.md",
17
+ r"^COMERCIAL\.md$": "docs/[projeto]/COMERCIAL.md",
18
+ r"^BRIEFING\.md$": "docs/[projeto]/BRIEFING.md",
19
+ r"^STORY-\d+.*\.md$": "docs/stories/STORY-NNN-slug.md",
20
+ r"^ADR-\d+.*\.md$": "docs/[projeto]/adrs/ADR-NNN-titulo.md",
21
+ }
22
+
23
+
24
+ def main():
25
+ try:
26
+ raw = sys.stdin.read()
27
+ data = json.loads(raw)
28
+ except Exception:
29
+ sys.exit(0)
30
+
31
+ tool = data.get("tool_name", "")
32
+ if tool != "Write":
33
+ sys.exit(0)
34
+
35
+ file_path = data.get("tool_input", {}).get("file_path", "")
36
+ if not file_path:
37
+ sys.exit(0)
38
+
39
+ # Normalizar separadores
40
+ normalized = file_path.replace("\\", "/")
41
+ filename = os.path.basename(normalized)
42
+
43
+ for pattern, correct_path in DOC_RULES.items():
44
+ if re.match(pattern, filename, re.IGNORECASE):
45
+ # Verificar se está no path correto
46
+ if "docs/" not in normalized:
47
+ print(
48
+ f"[GEN.IA OS] ⚠️ Documento '{filename}' fora do path padrão.\n"
49
+ f"[GEN.IA OS] Path recomendado: {correct_path}\n"
50
+ f"[GEN.IA OS] Criando assim mesmo — ajuste se necessário.",
51
+ file=sys.stderr,
52
+ )
53
+ break
54
+
55
+ sys.exit(0) # Apenas avisa, não bloqueia
56
+
57
+
58
+ if __name__ == "__main__":
59
+ main()
@@ -1,39 +1,39 @@
1
- # Autoridade dos Agentes — GEN.IA OS
2
-
3
- ## Matriz de Delegação
4
-
5
- | Agente | Nome | Autoridade Exclusiva | Git Permitido | Git Bloqueado |
6
- |--------|------|---------------------|---------------|---------------|
7
- | @analyst | Ana | Briefing, requisitos, pesquisa | status, log, diff | push, commit, merge |
8
- | @pm | Marina | PRD, escopo, priorização, épicos | status, log, diff | push, commit, merge |
9
- | @architect | Arqui | Arquitetura, stack, VETO técnico | status, log, diff | push, commit, merge |
10
- | @dev | Dev | Implementação de código | checkout, add, commit | **PUSH (BLOQUEADO)** |
11
- | @devops | Gate | **git push, PR, release, MCP** | TUDO | nada |
12
- | @qa | Quinn | Veredictos de qualidade, testes | status, log, diff, stash | push, commit |
13
- | @reviewer | Rev | Code review, aprovação | status, log, diff | push, commit |
14
- | @po | Pax | Validação de stories, backlog | status, log, diff | push, commit, merge |
15
- | @sm | Sami | **Criação de stories**, sprint | status, log, diff | push, commit, merge |
16
-
17
- ## Regras Invioláveis (Artigo II da Constituição)
18
-
19
- 1. **@dev NUNCA faz push** — sempre delegar para @devops após commit
20
- 2. **@sm é o ÚNICO que cria stories** — nenhum outro agente cria STORY-*.md
21
- 3. **@architect tem veto técnico irrevogável** — qualquer decisão arquitetural
22
- 4. **@po é o ÚNICO que aprova stories** para ir para desenvolvimento
23
- 5. **@devops gerencia MCP** — nenhum outro agente adiciona/remove servidores MCP
24
-
25
- ## Protocolo de Escalação
26
-
27
- Quando uma tarefa está fora do seu escopo:
28
- 1. **PARAR** imediatamente
29
- 2. **Anunciar** o agente correto: "Esta tarefa pertence a @[agente]"
30
- 3. **Fazer handoff** usando o protocolo de `.claude/rules/agent-handoff.md`
31
- 4. **NÃO executar** tarefas fora da sua autoridade
32
-
33
- ## Exemplos de Escalação Obrigatória
34
-
35
- - @dev termina implementação → delega push para **@devops**
36
- - @dev tem dúvida arquitetural → consulta **@architect**
37
- - @pm precisa de requisitos → solicita para **@analyst**
38
- - @dev precisa de story → solicita para **@sm**
39
- - @sm criou story → entrega para **@po** validar
1
+ # Autoridade dos Agentes — GEN.IA OS
2
+
3
+ ## Matriz de Delegação
4
+
5
+ | Agente | Nome | Autoridade Exclusiva | Git Permitido | Git Bloqueado |
6
+ |--------|------|---------------------|---------------|---------------|
7
+ | @analyst | Ana | Briefing, requisitos, pesquisa | status, log, diff | push, commit, merge |
8
+ | @pm | Marina | PRD, escopo, priorização, épicos | status, log, diff | push, commit, merge |
9
+ | @architect | Arqui | Arquitetura, stack, VETO técnico | status, log, diff | push, commit, merge |
10
+ | @dev | Dev | Implementação de código | checkout, add, commit | **PUSH (BLOQUEADO)** |
11
+ | @devops | Gate | **git push, PR, release, MCP** | TUDO | nada |
12
+ | @qa | Quinn | Veredictos de qualidade, testes | status, log, diff, stash | push, commit |
13
+ | @reviewer | Rev | Code review, aprovação | status, log, diff | push, commit |
14
+ | @po | Pax | Validação de stories, backlog | status, log, diff | push, commit, merge |
15
+ | @sm | Sami | **Criação de stories**, sprint | status, log, diff | push, commit, merge |
16
+
17
+ ## Regras Invioláveis (Artigo II da Constituição)
18
+
19
+ 1. **@dev NUNCA faz push** — sempre delegar para @devops após commit
20
+ 2. **@sm é o ÚNICO que cria stories** — nenhum outro agente cria STORY-*.md
21
+ 3. **@architect tem veto técnico irrevogável** — qualquer decisão arquitetural
22
+ 4. **@po é o ÚNICO que aprova stories** para ir para desenvolvimento
23
+ 5. **@devops gerencia MCP** — nenhum outro agente adiciona/remove servidores MCP
24
+
25
+ ## Protocolo de Escalação
26
+
27
+ Quando uma tarefa está fora do seu escopo:
28
+ 1. **PARAR** imediatamente
29
+ 2. **Anunciar** o agente correto: "Esta tarefa pertence a @[agente]"
30
+ 3. **Fazer handoff** usando o protocolo de `.claude/rules/agent-handoff.md`
31
+ 4. **NÃO executar** tarefas fora da sua autoridade
32
+
33
+ ## Exemplos de Escalação Obrigatória
34
+
35
+ - @dev termina implementação → delega push para **@devops**
36
+ - @dev tem dúvida arquitetural → consulta **@architect**
37
+ - @pm precisa de requisitos → solicita para **@analyst**
38
+ - @dev precisa de story → solicita para **@sm**
39
+ - @sm criou story → entrega para **@po** validar
@@ -1,71 +1,71 @@
1
- # Protocolo de Handoff — GEN.IA OS
2
-
3
- ## Quando Fazer Handoff
4
-
5
- Handoff é obrigatório quando:
6
- - Tarefa requer autoridade de outro agente (Artigo II)
7
- - Fase do workflow mudou
8
- - Blocker identificado fora do escopo atual
9
- - Trabalho está completo e próxima etapa é de outro agente
10
-
11
- ## Formato de Handoff (≤ 400 tokens)
12
-
13
- ```
14
- [@agente-atual → @próximo-agente]
15
-
16
- 📋 Contexto: [O que foi feito em 2-3 frases]
17
-
18
- 📌 Decisões tomadas:
19
- - [decisão 1]
20
- - [decisão 2]
21
-
22
- 📁 Arquivos criados/modificados:
23
- - [path/arquivo.md]
24
-
25
- ⚠️ Pendências:
26
- - [o que precisa ser feito]
27
-
28
- 🔗 Story atual: STORY-NNN (se aplicável)
29
- ```
30
-
31
- ## Regra de Token Budget
32
-
33
- - Handoff DEVE ser ≤ 400 tokens
34
- - Após 2+ trocas de agente, comprimir histórico ao essencial
35
- - Não repassar contexto completo — apenas decisões e pendências
36
-
37
- ## Compressão de Contexto
38
-
39
- Quando o contexto estiver saturado (muitas trocas de agente):
40
-
41
- 1. Criar `.genia/session/context-summary.md` com:
42
- - Decisões arquiteturais tomadas
43
- - Stories em andamento e seus estados
44
- - Blockers conhecidos
45
- - Stack tecnológica confirmada
46
-
47
- 2. Referenciar o arquivo no próximo handoff:
48
- ```
49
- [Contexto comprimido em .genia/session/context-summary.md]
50
- ```
51
-
52
- ## Exemplos de Handoff
53
-
54
- **@dev → @devops (após implementação):**
55
- ```
56
- [@dev → @devops]
57
- 📋 Implementei STORY-003 (autenticação JWT). Commits feitos localmente.
58
- 📌 Decisões: Usei jose library, tokens expiram em 1h, refresh em 7d.
59
- 📁 Modificados: src/auth/jwt.ts, src/middleware/auth.ts, tests/auth.test.ts
60
- ⚠️ Pendências: Push da branch feat/STORY-003-jwt-auth e criar PR para main.
61
- 🔗 Story atual: STORY-003 (status: InReview)
62
- ```
63
-
64
- **@analyst → @pm (após briefing):**
65
- ```
66
- [@analyst → @pm]
67
- 📋 Coletei requisitos completos do sistema de orçamentos BrasilUp.
68
- 📌 Decisões: App web (não mobile), integração com Kommo CRM, 3 usuários simultâneos.
69
- 📁 Criados: docs/brasilup/BRIEFING.md
70
- ⚠️ Pendências: Criar PRD com base no briefing. Atenção ao requisito de relatórios PDF.
71
- ```
1
+ # Protocolo de Handoff — GEN.IA OS
2
+
3
+ ## Quando Fazer Handoff
4
+
5
+ Handoff é obrigatório quando:
6
+ - Tarefa requer autoridade de outro agente (Artigo II)
7
+ - Fase do workflow mudou
8
+ - Blocker identificado fora do escopo atual
9
+ - Trabalho está completo e próxima etapa é de outro agente
10
+
11
+ ## Formato de Handoff (≤ 400 tokens)
12
+
13
+ ```
14
+ [@agente-atual → @próximo-agente]
15
+
16
+ 📋 Contexto: [O que foi feito em 2-3 frases]
17
+
18
+ 📌 Decisões tomadas:
19
+ - [decisão 1]
20
+ - [decisão 2]
21
+
22
+ 📁 Arquivos criados/modificados:
23
+ - [path/arquivo.md]
24
+
25
+ ⚠️ Pendências:
26
+ - [o que precisa ser feito]
27
+
28
+ 🔗 Story atual: STORY-NNN (se aplicável)
29
+ ```
30
+
31
+ ## Regra de Token Budget
32
+
33
+ - Handoff DEVE ser ≤ 400 tokens
34
+ - Após 2+ trocas de agente, comprimir histórico ao essencial
35
+ - Não repassar contexto completo — apenas decisões e pendências
36
+
37
+ ## Compressão de Contexto
38
+
39
+ Quando o contexto estiver saturado (muitas trocas de agente):
40
+
41
+ 1. Criar `.genia/session/context-summary.md` com:
42
+ - Decisões arquiteturais tomadas
43
+ - Stories em andamento e seus estados
44
+ - Blockers conhecidos
45
+ - Stack tecnológica confirmada
46
+
47
+ 2. Referenciar o arquivo no próximo handoff:
48
+ ```
49
+ [Contexto comprimido em .genia/session/context-summary.md]
50
+ ```
51
+
52
+ ## Exemplos de Handoff
53
+
54
+ **@dev → @devops (após implementação):**
55
+ ```
56
+ [@dev → @devops]
57
+ 📋 Implementei STORY-003 (autenticação JWT). Commits feitos localmente.
58
+ 📌 Decisões: Usei jose library, tokens expiram em 1h, refresh em 7d.
59
+ 📁 Modificados: src/auth/jwt.ts, src/middleware/auth.ts, tests/auth.test.ts
60
+ ⚠️ Pendências: Push da branch feat/STORY-003-jwt-auth e criar PR para main.
61
+ 🔗 Story atual: STORY-003 (status: InReview)
62
+ ```
63
+
64
+ **@analyst → @pm (após briefing):**
65
+ ```
66
+ [@analyst → @pm]
67
+ 📋 Coletei requisitos completos do sistema de orçamentos BrasilUp.
68
+ 📌 Decisões: App web (não mobile), integração com Kommo CRM, 3 usuários simultâneos.
69
+ 📁 Criados: docs/brasilup/BRIEFING.md
70
+ ⚠️ Pendências: Criar PRD com base no briefing. Atenção ao requisito de relatórios PDF.
71
+ ```