create-genia-os 2.1.0 → 2.1.1
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/README.md +102 -54
- package/bin/index.js +240 -240
- package/package.json +40 -37
package/README.md
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
# create-genia-os
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
<p align="center">
|
|
4
|
+
<a href="https://www.npmjs.com/package/create-genia-os"><img src="https://img.shields.io/npm/v/create-genia-os.svg?style=flat-square" /></a>
|
|
5
|
+
<img src="https://img.shields.io/badge/Claude%20Code-Compatible-blue?style=flat-square" />
|
|
6
|
+
<img src="https://img.shields.io/badge/Agentes-9%20%2B%20Squads-purple?style=flat-square" />
|
|
7
|
+
<img src="https://img.shields.io/node/v/create-genia-os.svg?style=flat-square" />
|
|
8
|
+
<img src="https://img.shields.io/npm/l/create-genia-os.svg?style=flat-square" />
|
|
9
|
+
</p>
|
|
6
10
|
|
|
7
|
-
> **
|
|
8
|
-
>
|
|
11
|
+
> **Transforma o Claude Code em um time completo de especialistas.**
|
|
12
|
+
> 9 agentes de desenvolvimento + Squads de negócio, Synapse Engine, governança automática e documentação profissional — tudo em 30 segundos.
|
|
9
13
|
|
|
10
14
|
---
|
|
11
15
|
|
|
@@ -13,87 +17,131 @@
|
|
|
13
17
|
|
|
14
18
|
```bash
|
|
15
19
|
npx create-genia-os meu-projeto
|
|
20
|
+
cd meu-projeto
|
|
21
|
+
code .
|
|
16
22
|
```
|
|
17
23
|
|
|
18
|
-
O wizard interativo
|
|
24
|
+
O wizard interativo configura nome do projeto, equipe, GitHub, idioma e stack. Em seguida, chame seu primeiro agente:
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
@analyst quero criar [seu projeto em uma frase]
|
|
28
|
+
```
|
|
19
29
|
|
|
20
30
|
---
|
|
21
31
|
|
|
22
32
|
## O que você recebe
|
|
23
33
|
|
|
24
|
-
|
|
25
|
-
- **Synapse Engine** — hook que injeta contexto correto em *cada* prompt automaticamente
|
|
26
|
-
- **5 hooks de governança** — enforcement automático de boas práticas (push bloqueado sem @devops, DDL SQL bloqueado, paths validados)
|
|
27
|
-
- **8 workflows** — do greenfield ao hotfix, com handoffs documentados
|
|
28
|
-
- **7 tasks reutilizáveis** — criar PRD, SPEC, story, implementar, QA, debug, code review
|
|
29
|
-
- **5 contextos** de integração — Kommo CRM, Supabase, WhatsApp Cloud, Next.js, API patterns
|
|
30
|
-
- **8 skills** especializadas — PDF, Excel, Word, PowerPoint, Frontend Design, Canvas, MCP Builder, Webapp Testing
|
|
31
|
-
- **Memória persistente** por agente — cada agente acumula conhecimento do projeto ao longo do tempo
|
|
32
|
-
|
|
33
|
-
---
|
|
34
|
+
### Sistema 1 — 9 Agentes de Desenvolvimento
|
|
34
35
|
|
|
35
|
-
|
|
36
|
+
Um time completo com papéis, personas e autoridades únicas. Cada agente sabe exatamente o que pode e o que não pode fazer.
|
|
36
37
|
|
|
37
|
-
|
|
|
38
|
-
|
|
39
|
-
| `@analyst` | Cypher | Analista de Negócios | Briefing, requisitos |
|
|
40
|
-
| `@pm` | Morpheus | Product Manager | PRD, épicos,
|
|
38
|
+
| Agente | Persona | Papel | Autoridade exclusiva |
|
|
39
|
+
|--------|---------|-------|---------------------|
|
|
40
|
+
| `@analyst` | Cypher | Analista de Negócios | Briefing, requisitos, pesquisa |
|
|
41
|
+
| `@pm` | Morpheus | Product Manager | PRD, épicos, roadmap |
|
|
41
42
|
| `@architect` | Trinity | Arquiteta de Sistemas | Arquitetura, **veto técnico** |
|
|
42
43
|
| `@po` | Oracle | Product Owner | **Aprovação de stories** |
|
|
43
|
-
| `@sm` | Mouse | Scrum Master | **Criação de stories** |
|
|
44
|
-
| `@dev` | Neo | Desenvolvedor Full Stack | Implementação |
|
|
44
|
+
| `@sm` | Mouse | Scrum Master | **Criação exclusiva de stories** |
|
|
45
|
+
| `@dev` | Neo | Desenvolvedor Full Stack | Implementação (sem push) |
|
|
45
46
|
| `@qa` | Smith | QA Engineer | Veredictos de qualidade |
|
|
46
47
|
| `@reviewer` | Switch | Code Reviewer | Aprovação de código |
|
|
47
48
|
| `@devops` | Tank | DevOps Engineer | **git push, PR, releases** |
|
|
48
49
|
|
|
49
|
-
|
|
50
|
+
### Sistema 2 — Squads Xquads (negócio e estratégia)
|
|
51
|
+
|
|
52
|
+
Consultores de alto nível disponíveis a qualquer momento. Recomendam — o SQUAD executa.
|
|
53
|
+
|
|
54
|
+
| Squad | Agentes |
|
|
55
|
+
|-------|---------|
|
|
56
|
+
| Advisory Board | `@ray-dalio`, `@charlie-munger`, `@naval-ravikant` |
|
|
57
|
+
| Copy Squad | `@dan-kennedy`, `@david-ogilvy`, `@gary-halbert` |
|
|
58
|
+
| Hormozi Squad | `@hormozi-offer` |
|
|
59
|
+
| Brand Squad | `@brand-chief`, `@marty-neumeier` |
|
|
60
|
+
| C-Level Squad | `@cmo-architect`, `@cto-architect` |
|
|
61
|
+
| Data Squad | `@avinash-kaushik`, `@sean-ellis` |
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
@dan-kennedy escreva o pitch de vendas
|
|
65
|
+
@ray-dalio analise os riscos desta estratégia
|
|
66
|
+
@hormozi-offer monte a estrutura de oferta do plano Enterprise
|
|
67
|
+
```
|
|
50
68
|
|
|
51
69
|
---
|
|
52
70
|
|
|
53
|
-
## Como funciona
|
|
71
|
+
## Como funciona — o Synapse Engine
|
|
72
|
+
|
|
73
|
+
A cada prompt que você digita, um hook JavaScript (`synapse-engine.cjs`) roda em **menos de 100ms** e injeta o contexto certo automaticamente:
|
|
54
74
|
|
|
55
75
|
```
|
|
56
76
|
Você digita: "@dev implemente o login"
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
77
|
+
│
|
|
78
|
+
▼
|
|
79
|
+
Synapse Engine detecta "@dev"
|
|
80
|
+
│
|
|
81
|
+
▼
|
|
82
|
+
L0 — Constituição (SEMPRE)
|
|
83
|
+
L1 — Global + Contexto do projeto (SEMPRE)
|
|
84
|
+
L2 — Regras específicas do @dev (detectado)
|
|
85
|
+
│
|
|
86
|
+
▼
|
|
87
|
+
Claude recebe prompt + contexto completo
|
|
88
|
+
e responde como Neo, com as regras certas
|
|
69
89
|
```
|
|
70
90
|
|
|
71
|
-
|
|
91
|
+
Para agentes Xquads, o engine injeta também:
|
|
92
|
+
- Quem é você (`.business/OWNER.md`)
|
|
93
|
+
- Prioridades atuais (`.business/PRIORIDADES.md`)
|
|
94
|
+
- Contexto da empresa
|
|
95
|
+
- Memória do agente (`.claude/agent-memory/squads/`)
|
|
72
96
|
|
|
73
97
|
---
|
|
74
98
|
|
|
75
|
-
##
|
|
99
|
+
## Governança automática — 5 hooks
|
|
76
100
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
-
|
|
80
|
-
- **
|
|
81
|
-
- **
|
|
101
|
+
| Hook | Quando ativa | O que faz |
|
|
102
|
+
|------|-------------|-----------|
|
|
103
|
+
| `synapse-engine.cjs` | Todo prompt | Injeta contexto em camadas |
|
|
104
|
+
| `enforce-git-push-authority.py` | Antes de Bash | **Bloqueia** push fora do @devops |
|
|
105
|
+
| `sql-governance.py` | Antes de Bash | **Bloqueia** DDL perigoso |
|
|
106
|
+
| `write-path-validation.py` | Antes de Write | Valida paths de arquivo |
|
|
107
|
+
| `precompact-session-digest.cjs` | Antes de compactar | Salva memória da sessão |
|
|
82
108
|
|
|
83
109
|
---
|
|
84
110
|
|
|
85
|
-
##
|
|
111
|
+
## Documentação profissional criada automaticamente
|
|
86
112
|
|
|
87
|
-
|
|
88
|
-
# 1. Abra o projeto no VS Code com Claude Code
|
|
89
|
-
cd meu-projeto && code .
|
|
90
|
-
|
|
91
|
-
# 2. Inicie um projeto do zero
|
|
92
|
-
"@analyst quero criar [descreva seu projeto]"
|
|
113
|
+
Todo projeto novo inclui:
|
|
93
114
|
|
|
94
|
-
# 3. Ou pule direto para uma story
|
|
95
|
-
"@sm crie a primeira story do projeto"
|
|
96
115
|
```
|
|
116
|
+
docs/
|
|
117
|
+
├── produto/ PRD.md · ROADMAP.md · CHANGELOG.md
|
|
118
|
+
├── tecnico/ ARQUITETURA.md · STACK.md · SETUP.md · API.md · DEPLOY.md · adr/
|
|
119
|
+
├── comercial/ PITCH.md · PROPOSTA.md · ONBOARDING.md · CASOS-DE-USO.md
|
|
120
|
+
├── stories/ criadas pelo @sm (Mouse)
|
|
121
|
+
└── handover/ atualizado pelo @devops (Tank) a cada sessão
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
## A Constituição — regras que não se negociam
|
|
127
|
+
|
|
128
|
+
| Artigo | Regra |
|
|
129
|
+
|--------|-------|
|
|
130
|
+
| I — CLI First | Claude Code é fonte de verdade |
|
|
131
|
+
| II — Autoridade | @devops = único com push; @sm = único cria stories |
|
|
132
|
+
| III — Story-Driven | Zero código sem story aprovada pelo @po |
|
|
133
|
+
| IV — Sem Invenção | Apenas features dos requisitos explícitos |
|
|
134
|
+
| V — Qualidade | Lint + testes + build devem passar |
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
## Requisitos
|
|
139
|
+
|
|
140
|
+
- **Node.js** ≥ 18.0.0
|
|
141
|
+
- **Claude Code** (CLI da Anthropic)
|
|
142
|
+
- **VS Code** (recomendado)
|
|
143
|
+
- **Python 3.8+** (para hooks de governança)
|
|
144
|
+
- **Git**
|
|
97
145
|
|
|
98
146
|
---
|
|
99
147
|
|
|
@@ -103,4 +151,4 @@ cd meu-projeto && code .
|
|
|
103
151
|
|
|
104
152
|
---
|
|
105
153
|
|
|
106
|
-
*GEN.IA OS
|
|
154
|
+
*GEN.IA OS v2.1 · Criado por **Elidy Izidio** · Founder, GEN.IA SQUAD · 2026*
|
package/bin/index.js
CHANGED
|
@@ -1,240 +1,240 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* create-genia-os — CLI de setup do GEN.IA OS
|
|
6
|
-
* Uso: npx create-genia-os [nome-do-projeto]
|
|
7
|
-
* Sem dependências externas — Node.js puro.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
const readline = require('readline');
|
|
11
|
-
const fs = require('fs');
|
|
12
|
-
const path = require('path');
|
|
13
|
-
|
|
14
|
-
// ─── Cores no terminal ───────────────────────────────────────────────────────
|
|
15
|
-
const c = {
|
|
16
|
-
reset: '\x1b[0m',
|
|
17
|
-
bold: '\x1b[1m',
|
|
18
|
-
cyan: '\x1b[36m',
|
|
19
|
-
green: '\x1b[32m',
|
|
20
|
-
yellow: '\x1b[33m',
|
|
21
|
-
red: '\x1b[31m',
|
|
22
|
-
gray: '\x1b[90m',
|
|
23
|
-
magenta: '\x1b[35m',
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
function log(msg) { console.log(msg); }
|
|
27
|
-
function info(msg) { console.log(`${c.cyan}${msg}${c.reset}`); }
|
|
28
|
-
function ok(msg) { console.log(`${c.green}✓ ${msg}${c.reset}`); }
|
|
29
|
-
function warn(msg) { console.log(`${c.yellow}⚠ ${msg}${c.reset}`); }
|
|
30
|
-
function err(msg) { console.error(`${c.red}✗ ${msg}${c.reset}`); }
|
|
31
|
-
function bold(msg) { return `${c.bold}${msg}${c.reset}`; }
|
|
32
|
-
|
|
33
|
-
// ─── Banner ──────────────────────────────────────────────────────────────────
|
|
34
|
-
function banner() {
|
|
35
|
-
log('');
|
|
36
|
-
log(`${c.cyan}${c.bold}╔═══════════════════════════════════════════╗${c.reset}`);
|
|
37
|
-
log(`${c.cyan}${c.bold}║ GEN.IA OS — Setup Wizard v1.1 ║${c.reset}`);
|
|
38
|
-
log(`${c.cyan}${c.bold}║ Sistema operacional de dev com IA ║${c.reset}`);
|
|
39
|
-
log(`${c.cyan}${c.bold}╚═══════════════════════════════════════════╝${c.reset}`);
|
|
40
|
-
log('');
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
// ─── Helpers de prompt ───────────────────────────────────────────────────────
|
|
44
|
-
function prompt(rl, question, defaultVal) {
|
|
45
|
-
const hint = defaultVal ? ` ${c.gray}(${defaultVal})${c.reset}` : '';
|
|
46
|
-
return new Promise((resolve) => {
|
|
47
|
-
rl.question(`${c.cyan}?${c.reset} ${question}${hint}: `, (answer) => {
|
|
48
|
-
resolve(answer.trim() || defaultVal || '');
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
function promptChoice(rl, question, choices, defaultIdx = 0) {
|
|
54
|
-
log(`${c.cyan}?${c.reset} ${question}`);
|
|
55
|
-
choices.forEach((ch, i) => {
|
|
56
|
-
const marker = i === defaultIdx ? `${c.green}›${c.reset}` : ' ';
|
|
57
|
-
log(` ${marker} ${i + 1}. ${ch}`);
|
|
58
|
-
});
|
|
59
|
-
return new Promise((resolve) => {
|
|
60
|
-
rl.question(` ${c.gray}Escolha (1-${choices.length})${c.reset} [${defaultIdx + 1}]: `, (answer) => {
|
|
61
|
-
const idx = parseInt(answer.trim(), 10) - 1;
|
|
62
|
-
resolve((idx >= 0 && idx < choices.length) ? idx : defaultIdx);
|
|
63
|
-
});
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
// ─── Template substitution ───────────────────────────────────────────────────
|
|
68
|
-
function applyVars(content, vars) {
|
|
69
|
-
let result = content;
|
|
70
|
-
for (const [key, value] of Object.entries(vars)) {
|
|
71
|
-
result = result.split(`{{${key}}}`).join(value);
|
|
72
|
-
}
|
|
73
|
-
return result;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
// ─── Copiar template recursivamente ─────────────────────────────────────────
|
|
77
|
-
function copyTemplate(srcDir, destDir, vars) {
|
|
78
|
-
if (!fs.existsSync(srcDir)) return;
|
|
79
|
-
fs.mkdirSync(destDir, { recursive: true });
|
|
80
|
-
|
|
81
|
-
for (const entry of fs.readdirSync(srcDir, { withFileTypes: true })) {
|
|
82
|
-
const srcPath = path.join(srcDir, entry.name);
|
|
83
|
-
const destPath = path.join(destDir, entry.name);
|
|
84
|
-
|
|
85
|
-
if (entry.isDirectory()) {
|
|
86
|
-
copyTemplate(srcPath, destPath, vars);
|
|
87
|
-
} else {
|
|
88
|
-
const raw = fs.readFileSync(srcPath, 'utf8');
|
|
89
|
-
const processed = applyVars(raw, vars);
|
|
90
|
-
fs.writeFileSync(destPath, processed, 'utf8');
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
// ─── Main ────────────────────────────────────────────────────────────────────
|
|
96
|
-
async function main() {
|
|
97
|
-
banner();
|
|
98
|
-
|
|
99
|
-
const projectArg = process.argv[2];
|
|
100
|
-
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
101
|
-
|
|
102
|
-
log(`${c.gray}Responda as perguntas abaixo para configurar seu GEN.IA OS.${c.reset}`);
|
|
103
|
-
log(`${c.gray}Pressione Enter para aceitar o valor padrão entre parênteses.${c.reset}`);
|
|
104
|
-
log('');
|
|
105
|
-
|
|
106
|
-
// ── Perguntas ──
|
|
107
|
-
const projectName = await prompt(rl, 'Nome do projeto', projectArg || 'meu-projeto');
|
|
108
|
-
const teamName = await prompt(rl, 'Nome da equipe/empresa', 'Minha Equipe');
|
|
109
|
-
const creatorName = await prompt(rl, 'Seu nome', 'Desenvolvedor');
|
|
110
|
-
const githubUser = await prompt(rl, 'GitHub username', 'usuario');
|
|
111
|
-
const githubRepo = await prompt(rl, 'Nome do repositório GitHub', projectName);
|
|
112
|
-
|
|
113
|
-
log('');
|
|
114
|
-
const langIdx = await promptChoice(rl, 'Idioma principal do projeto', ['Português do Brasil (PT-BR)', 'English (EN)'], 0);
|
|
115
|
-
const language = langIdx === 0 ? 'PT-BR' : 'EN';
|
|
116
|
-
|
|
117
|
-
log('');
|
|
118
|
-
const stackIdx = await promptChoice(rl, 'Stack principal', [
|
|
119
|
-
'Next.js / React',
|
|
120
|
-
'Python / FastAPI',
|
|
121
|
-
'Node.js / Express',
|
|
122
|
-
'Flutter / Dart',
|
|
123
|
-
'Outra (configurar depois)',
|
|
124
|
-
], 0);
|
|
125
|
-
const stacks = ['Next.js/React', 'Python/FastAPI', 'Node.js/Express', 'Flutter/Dart', 'Personalizada'];
|
|
126
|
-
const stack = stacks[stackIdx];
|
|
127
|
-
|
|
128
|
-
log('');
|
|
129
|
-
const initGit = await prompt(rl, 'Inicializar repositório git? (s/n)', 's');
|
|
130
|
-
|
|
131
|
-
rl.close();
|
|
132
|
-
|
|
133
|
-
// ── Validações ──
|
|
134
|
-
const targetDir = path.resolve(process.cwd(), projectName);
|
|
135
|
-
if (fs.existsSync(targetDir)) {
|
|
136
|
-
err(`Pasta '${projectName}' já existe. Escolha outro nome ou remova a pasta.`);
|
|
137
|
-
process.exit(1);
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
const today = new Date().toISOString().split('T')[0];
|
|
141
|
-
|
|
142
|
-
const vars = {
|
|
143
|
-
PROJECT_NAME: projectName,
|
|
144
|
-
TEAM_NAME: teamName,
|
|
145
|
-
CREATOR_NAME: creatorName,
|
|
146
|
-
GITHUB_USER: githubUser,
|
|
147
|
-
GITHUB_REPO: githubRepo,
|
|
148
|
-
LANGUAGE: language,
|
|
149
|
-
STACK: stack,
|
|
150
|
-
SETUP_DATE: today,
|
|
151
|
-
VERSION: '1.0.0',
|
|
152
|
-
};
|
|
153
|
-
|
|
154
|
-
// ── Copiar template ──
|
|
155
|
-
log('');
|
|
156
|
-
info('Criando estrutura do GEN.IA OS...');
|
|
157
|
-
|
|
158
|
-
const templateDir = path.join(__dirname, '..', 'template');
|
|
159
|
-
copyTemplate(templateDir, targetDir, vars);
|
|
160
|
-
ok(`Projeto criado em ./${projectName}/`);
|
|
161
|
-
|
|
162
|
-
// ── Criar docs/ estrutura profissional obrigatória ──
|
|
163
|
-
const docsDirs = [
|
|
164
|
-
['docs', 'stories'],
|
|
165
|
-
['docs', 'handover'],
|
|
166
|
-
['docs', 'produto'],
|
|
167
|
-
['docs', 'tecnico', 'adr'],
|
|
168
|
-
['docs', 'comercial'],
|
|
169
|
-
];
|
|
170
|
-
for (const parts of docsDirs) {
|
|
171
|
-
fs.mkdirSync(path.join(targetDir, ...parts), { recursive: true });
|
|
172
|
-
fs.writeFileSync(path.join(targetDir, ...parts, '.gitkeep'), '');
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
// ── Criar squads/ estrutura ──
|
|
176
|
-
const squadsDirs = [
|
|
177
|
-
['squads', 'advisory-board'],
|
|
178
|
-
['squads', 'copy-squad'],
|
|
179
|
-
['squads', 'hormozi-squad'],
|
|
180
|
-
['squads', 'brand-squad'],
|
|
181
|
-
['squads', 'clevel-squad'],
|
|
182
|
-
['squads', 'data-squad'],
|
|
183
|
-
];
|
|
184
|
-
for (const parts of squadsDirs) {
|
|
185
|
-
fs.mkdirSync(path.join(targetDir, ...parts), { recursive: true });
|
|
186
|
-
fs.writeFileSync(path.join(targetDir, ...parts, '.gitkeep'), '');
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
// ── Criar .genia/session/ ──
|
|
190
|
-
fs.mkdirSync(path.join(targetDir, '.genia', 'session'), { recursive: true });
|
|
191
|
-
fs.mkdirSync(path.join(targetDir, '.genia', 'session-digests'), { recursive: true });
|
|
192
|
-
fs.writeFileSync(path.join(targetDir, '.genia', 'session', '.gitkeep'), '');
|
|
193
|
-
fs.writeFileSync(path.join(targetDir, '.genia', 'session-digests', '.gitkeep'), '');
|
|
194
|
-
ok('Estrutura docs/ profissional e squads/ criados');
|
|
195
|
-
|
|
196
|
-
// ── Criar .claude/agent-memory/squads/ ──
|
|
197
|
-
fs.mkdirSync(path.join(targetDir, '.claude', 'agent-memory', 'squads'), { recursive: true });
|
|
198
|
-
fs.writeFileSync(path.join(targetDir, '.claude', 'agent-memory', 'squads', '.gitkeep'), '');
|
|
199
|
-
ok('Diretórios de memória e sessão criados');
|
|
200
|
-
|
|
201
|
-
// ── Git init ──
|
|
202
|
-
if (initGit.toLowerCase() !== 'n') {
|
|
203
|
-
try {
|
|
204
|
-
const { execSync } = require('child_process');
|
|
205
|
-
execSync('git init', { cwd: targetDir, stdio: 'ignore' });
|
|
206
|
-
execSync('git add .', { cwd: targetDir, stdio: 'ignore' });
|
|
207
|
-
execSync(`git commit -m "chore: GEN.IA OS v1.1 — setup inicial\n\nCo-Authored-By: GEN.IA OS <genia@bedata.com.br>"`, {
|
|
208
|
-
cwd: targetDir, stdio: 'ignore',
|
|
209
|
-
});
|
|
210
|
-
ok('Repositório git inicializado com commit inicial');
|
|
211
|
-
} catch {
|
|
212
|
-
warn('Git init falhou. Inicialize manualmente: git init && git add . && git commit');
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
// ── Sucesso ──
|
|
217
|
-
log('');
|
|
218
|
-
log(`${c.green}${c.bold}╔═══════════════════════════════════════════╗${c.reset}`);
|
|
219
|
-
log(`${c.green}${c.bold}║ GEN.IA OS pronto para uso! 🚀 ║${c.reset}`);
|
|
220
|
-
log(`${c.green}${c.bold}╚═══════════════════════════════════════════╝${c.reset}`);
|
|
221
|
-
log('');
|
|
222
|
-
log(bold('Próximos passos:'));
|
|
223
|
-
log('');
|
|
224
|
-
log(` ${c.cyan}1.${c.reset} Abra o projeto no VS Code com Claude Code:`);
|
|
225
|
-
log(` ${c.gray}cd ${projectName} && code .${c.reset}`);
|
|
226
|
-
log('');
|
|
227
|
-
log(` ${c.cyan}2.${c.reset} Inicie uma conversa e chame um agente:`);
|
|
228
|
-
log(` ${c.gray}"@sm crie a primeira story do projeto"${c.reset}`);
|
|
229
|
-
log('');
|
|
230
|
-
log(` ${c.cyan}3.${c.reset} Leia a documentação:`);
|
|
231
|
-
log(` ${c.gray}README.md${c.reset}`);
|
|
232
|
-
log('');
|
|
233
|
-
log(`${c.gray}Documentação: https://github.com/elidyizzy/GENIA-SQUAD-OS${c.reset}`);
|
|
234
|
-
log('');
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
main().catch((e) => {
|
|
238
|
-
console.error(e);
|
|
239
|
-
process.exit(1);
|
|
240
|
-
});
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* create-genia-os — CLI de setup do GEN.IA OS
|
|
6
|
+
* Uso: npx create-genia-os [nome-do-projeto]
|
|
7
|
+
* Sem dependências externas — Node.js puro.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
const readline = require('readline');
|
|
11
|
+
const fs = require('fs');
|
|
12
|
+
const path = require('path');
|
|
13
|
+
|
|
14
|
+
// ─── Cores no terminal ───────────────────────────────────────────────────────
|
|
15
|
+
const c = {
|
|
16
|
+
reset: '\x1b[0m',
|
|
17
|
+
bold: '\x1b[1m',
|
|
18
|
+
cyan: '\x1b[36m',
|
|
19
|
+
green: '\x1b[32m',
|
|
20
|
+
yellow: '\x1b[33m',
|
|
21
|
+
red: '\x1b[31m',
|
|
22
|
+
gray: '\x1b[90m',
|
|
23
|
+
magenta: '\x1b[35m',
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
function log(msg) { console.log(msg); }
|
|
27
|
+
function info(msg) { console.log(`${c.cyan}${msg}${c.reset}`); }
|
|
28
|
+
function ok(msg) { console.log(`${c.green}✓ ${msg}${c.reset}`); }
|
|
29
|
+
function warn(msg) { console.log(`${c.yellow}⚠ ${msg}${c.reset}`); }
|
|
30
|
+
function err(msg) { console.error(`${c.red}✗ ${msg}${c.reset}`); }
|
|
31
|
+
function bold(msg) { return `${c.bold}${msg}${c.reset}`; }
|
|
32
|
+
|
|
33
|
+
// ─── Banner ──────────────────────────────────────────────────────────────────
|
|
34
|
+
function banner() {
|
|
35
|
+
log('');
|
|
36
|
+
log(`${c.cyan}${c.bold}╔═══════════════════════════════════════════╗${c.reset}`);
|
|
37
|
+
log(`${c.cyan}${c.bold}║ GEN.IA OS — Setup Wizard v1.1 ║${c.reset}`);
|
|
38
|
+
log(`${c.cyan}${c.bold}║ Sistema operacional de dev com IA ║${c.reset}`);
|
|
39
|
+
log(`${c.cyan}${c.bold}╚═══════════════════════════════════════════╝${c.reset}`);
|
|
40
|
+
log('');
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// ─── Helpers de prompt ───────────────────────────────────────────────────────
|
|
44
|
+
function prompt(rl, question, defaultVal) {
|
|
45
|
+
const hint = defaultVal ? ` ${c.gray}(${defaultVal})${c.reset}` : '';
|
|
46
|
+
return new Promise((resolve) => {
|
|
47
|
+
rl.question(`${c.cyan}?${c.reset} ${question}${hint}: `, (answer) => {
|
|
48
|
+
resolve(answer.trim() || defaultVal || '');
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function promptChoice(rl, question, choices, defaultIdx = 0) {
|
|
54
|
+
log(`${c.cyan}?${c.reset} ${question}`);
|
|
55
|
+
choices.forEach((ch, i) => {
|
|
56
|
+
const marker = i === defaultIdx ? `${c.green}›${c.reset}` : ' ';
|
|
57
|
+
log(` ${marker} ${i + 1}. ${ch}`);
|
|
58
|
+
});
|
|
59
|
+
return new Promise((resolve) => {
|
|
60
|
+
rl.question(` ${c.gray}Escolha (1-${choices.length})${c.reset} [${defaultIdx + 1}]: `, (answer) => {
|
|
61
|
+
const idx = parseInt(answer.trim(), 10) - 1;
|
|
62
|
+
resolve((idx >= 0 && idx < choices.length) ? idx : defaultIdx);
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// ─── Template substitution ───────────────────────────────────────────────────
|
|
68
|
+
function applyVars(content, vars) {
|
|
69
|
+
let result = content;
|
|
70
|
+
for (const [key, value] of Object.entries(vars)) {
|
|
71
|
+
result = result.split(`{{${key}}}`).join(value);
|
|
72
|
+
}
|
|
73
|
+
return result;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// ─── Copiar template recursivamente ─────────────────────────────────────────
|
|
77
|
+
function copyTemplate(srcDir, destDir, vars) {
|
|
78
|
+
if (!fs.existsSync(srcDir)) return;
|
|
79
|
+
fs.mkdirSync(destDir, { recursive: true });
|
|
80
|
+
|
|
81
|
+
for (const entry of fs.readdirSync(srcDir, { withFileTypes: true })) {
|
|
82
|
+
const srcPath = path.join(srcDir, entry.name);
|
|
83
|
+
const destPath = path.join(destDir, entry.name);
|
|
84
|
+
|
|
85
|
+
if (entry.isDirectory()) {
|
|
86
|
+
copyTemplate(srcPath, destPath, vars);
|
|
87
|
+
} else {
|
|
88
|
+
const raw = fs.readFileSync(srcPath, 'utf8');
|
|
89
|
+
const processed = applyVars(raw, vars);
|
|
90
|
+
fs.writeFileSync(destPath, processed, 'utf8');
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// ─── Main ────────────────────────────────────────────────────────────────────
|
|
96
|
+
async function main() {
|
|
97
|
+
banner();
|
|
98
|
+
|
|
99
|
+
const projectArg = process.argv[2];
|
|
100
|
+
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
101
|
+
|
|
102
|
+
log(`${c.gray}Responda as perguntas abaixo para configurar seu GEN.IA OS.${c.reset}`);
|
|
103
|
+
log(`${c.gray}Pressione Enter para aceitar o valor padrão entre parênteses.${c.reset}`);
|
|
104
|
+
log('');
|
|
105
|
+
|
|
106
|
+
// ── Perguntas ──
|
|
107
|
+
const projectName = await prompt(rl, 'Nome do projeto', projectArg || 'meu-projeto');
|
|
108
|
+
const teamName = await prompt(rl, 'Nome da equipe/empresa', 'Minha Equipe');
|
|
109
|
+
const creatorName = await prompt(rl, 'Seu nome', 'Desenvolvedor');
|
|
110
|
+
const githubUser = await prompt(rl, 'GitHub username', 'usuario');
|
|
111
|
+
const githubRepo = await prompt(rl, 'Nome do repositório GitHub', projectName);
|
|
112
|
+
|
|
113
|
+
log('');
|
|
114
|
+
const langIdx = await promptChoice(rl, 'Idioma principal do projeto', ['Português do Brasil (PT-BR)', 'English (EN)'], 0);
|
|
115
|
+
const language = langIdx === 0 ? 'PT-BR' : 'EN';
|
|
116
|
+
|
|
117
|
+
log('');
|
|
118
|
+
const stackIdx = await promptChoice(rl, 'Stack principal', [
|
|
119
|
+
'Next.js / React',
|
|
120
|
+
'Python / FastAPI',
|
|
121
|
+
'Node.js / Express',
|
|
122
|
+
'Flutter / Dart',
|
|
123
|
+
'Outra (configurar depois)',
|
|
124
|
+
], 0);
|
|
125
|
+
const stacks = ['Next.js/React', 'Python/FastAPI', 'Node.js/Express', 'Flutter/Dart', 'Personalizada'];
|
|
126
|
+
const stack = stacks[stackIdx];
|
|
127
|
+
|
|
128
|
+
log('');
|
|
129
|
+
const initGit = await prompt(rl, 'Inicializar repositório git? (s/n)', 's');
|
|
130
|
+
|
|
131
|
+
rl.close();
|
|
132
|
+
|
|
133
|
+
// ── Validações ──
|
|
134
|
+
const targetDir = path.resolve(process.cwd(), projectName);
|
|
135
|
+
if (fs.existsSync(targetDir)) {
|
|
136
|
+
err(`Pasta '${projectName}' já existe. Escolha outro nome ou remova a pasta.`);
|
|
137
|
+
process.exit(1);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
const today = new Date().toISOString().split('T')[0];
|
|
141
|
+
|
|
142
|
+
const vars = {
|
|
143
|
+
PROJECT_NAME: projectName,
|
|
144
|
+
TEAM_NAME: teamName,
|
|
145
|
+
CREATOR_NAME: creatorName,
|
|
146
|
+
GITHUB_USER: githubUser,
|
|
147
|
+
GITHUB_REPO: githubRepo,
|
|
148
|
+
LANGUAGE: language,
|
|
149
|
+
STACK: stack,
|
|
150
|
+
SETUP_DATE: today,
|
|
151
|
+
VERSION: '1.0.0',
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
// ── Copiar template ──
|
|
155
|
+
log('');
|
|
156
|
+
info('Criando estrutura do GEN.IA OS...');
|
|
157
|
+
|
|
158
|
+
const templateDir = path.join(__dirname, '..', 'template');
|
|
159
|
+
copyTemplate(templateDir, targetDir, vars);
|
|
160
|
+
ok(`Projeto criado em ./${projectName}/`);
|
|
161
|
+
|
|
162
|
+
// ── Criar docs/ estrutura profissional obrigatória ──
|
|
163
|
+
const docsDirs = [
|
|
164
|
+
['docs', 'stories'],
|
|
165
|
+
['docs', 'handover'],
|
|
166
|
+
['docs', 'produto'],
|
|
167
|
+
['docs', 'tecnico', 'adr'],
|
|
168
|
+
['docs', 'comercial'],
|
|
169
|
+
];
|
|
170
|
+
for (const parts of docsDirs) {
|
|
171
|
+
fs.mkdirSync(path.join(targetDir, ...parts), { recursive: true });
|
|
172
|
+
fs.writeFileSync(path.join(targetDir, ...parts, '.gitkeep'), '');
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
// ── Criar squads/ estrutura ──
|
|
176
|
+
const squadsDirs = [
|
|
177
|
+
['squads', 'advisory-board'],
|
|
178
|
+
['squads', 'copy-squad'],
|
|
179
|
+
['squads', 'hormozi-squad'],
|
|
180
|
+
['squads', 'brand-squad'],
|
|
181
|
+
['squads', 'clevel-squad'],
|
|
182
|
+
['squads', 'data-squad'],
|
|
183
|
+
];
|
|
184
|
+
for (const parts of squadsDirs) {
|
|
185
|
+
fs.mkdirSync(path.join(targetDir, ...parts), { recursive: true });
|
|
186
|
+
fs.writeFileSync(path.join(targetDir, ...parts, '.gitkeep'), '');
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
// ── Criar .genia/session/ ──
|
|
190
|
+
fs.mkdirSync(path.join(targetDir, '.genia', 'session'), { recursive: true });
|
|
191
|
+
fs.mkdirSync(path.join(targetDir, '.genia', 'session-digests'), { recursive: true });
|
|
192
|
+
fs.writeFileSync(path.join(targetDir, '.genia', 'session', '.gitkeep'), '');
|
|
193
|
+
fs.writeFileSync(path.join(targetDir, '.genia', 'session-digests', '.gitkeep'), '');
|
|
194
|
+
ok('Estrutura docs/ profissional e squads/ criados');
|
|
195
|
+
|
|
196
|
+
// ── Criar .claude/agent-memory/squads/ ──
|
|
197
|
+
fs.mkdirSync(path.join(targetDir, '.claude', 'agent-memory', 'squads'), { recursive: true });
|
|
198
|
+
fs.writeFileSync(path.join(targetDir, '.claude', 'agent-memory', 'squads', '.gitkeep'), '');
|
|
199
|
+
ok('Diretórios de memória e sessão criados');
|
|
200
|
+
|
|
201
|
+
// ── Git init ──
|
|
202
|
+
if (initGit.toLowerCase() !== 'n') {
|
|
203
|
+
try {
|
|
204
|
+
const { execSync } = require('child_process');
|
|
205
|
+
execSync('git init', { cwd: targetDir, stdio: 'ignore' });
|
|
206
|
+
execSync('git add .', { cwd: targetDir, stdio: 'ignore' });
|
|
207
|
+
execSync(`git commit -m "chore: GEN.IA OS v1.1 — setup inicial\n\nCo-Authored-By: GEN.IA OS <genia@bedata.com.br>"`, {
|
|
208
|
+
cwd: targetDir, stdio: 'ignore',
|
|
209
|
+
});
|
|
210
|
+
ok('Repositório git inicializado com commit inicial');
|
|
211
|
+
} catch {
|
|
212
|
+
warn('Git init falhou. Inicialize manualmente: git init && git add . && git commit');
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
// ── Sucesso ──
|
|
217
|
+
log('');
|
|
218
|
+
log(`${c.green}${c.bold}╔═══════════════════════════════════════════╗${c.reset}`);
|
|
219
|
+
log(`${c.green}${c.bold}║ GEN.IA OS pronto para uso! 🚀 ║${c.reset}`);
|
|
220
|
+
log(`${c.green}${c.bold}╚═══════════════════════════════════════════╝${c.reset}`);
|
|
221
|
+
log('');
|
|
222
|
+
log(bold('Próximos passos:'));
|
|
223
|
+
log('');
|
|
224
|
+
log(` ${c.cyan}1.${c.reset} Abra o projeto no VS Code com Claude Code:`);
|
|
225
|
+
log(` ${c.gray}cd ${projectName} && code .${c.reset}`);
|
|
226
|
+
log('');
|
|
227
|
+
log(` ${c.cyan}2.${c.reset} Inicie uma conversa e chame um agente:`);
|
|
228
|
+
log(` ${c.gray}"@sm crie a primeira story do projeto"${c.reset}`);
|
|
229
|
+
log('');
|
|
230
|
+
log(` ${c.cyan}3.${c.reset} Leia a documentação:`);
|
|
231
|
+
log(` ${c.gray}README.md${c.reset}`);
|
|
232
|
+
log('');
|
|
233
|
+
log(`${c.gray}Documentação: https://github.com/elidyizzy/GENIA-SQUAD-OS${c.reset}`);
|
|
234
|
+
log('');
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
main().catch((e) => {
|
|
238
|
+
console.error(e);
|
|
239
|
+
process.exit(1);
|
|
240
|
+
});
|
package/package.json
CHANGED
|
@@ -1,37 +1,40 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "create-genia-os",
|
|
3
|
-
"version": "2.1.
|
|
4
|
-
"description": "GEN.IA OS —
|
|
5
|
-
"keywords": [
|
|
6
|
-
"claude-code",
|
|
7
|
-
"ai",
|
|
8
|
-
"artificial-intelligence",
|
|
9
|
-
"desenvolvimento",
|
|
10
|
-
"agentes",
|
|
11
|
-
"squads",
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"
|
|
36
|
-
|
|
37
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "create-genia-os",
|
|
3
|
+
"version": "2.1.1",
|
|
4
|
+
"description": "GEN.IA OS — Transforma o Claude Code em um time completo de especialistas. 9 agentes de desenvolvimento + Squads Xquads de negócio, Synapse Engine, governança automática e docs profissional obrigatório.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"claude-code",
|
|
7
|
+
"ai",
|
|
8
|
+
"artificial-intelligence",
|
|
9
|
+
"desenvolvimento",
|
|
10
|
+
"agentes",
|
|
11
|
+
"squads",
|
|
12
|
+
"xquads",
|
|
13
|
+
"genia",
|
|
14
|
+
"claude",
|
|
15
|
+
"anthropic",
|
|
16
|
+
"developer-tools",
|
|
17
|
+
"synapse-engine",
|
|
18
|
+
"governance",
|
|
19
|
+
"pt-br"
|
|
20
|
+
],
|
|
21
|
+
"author": "Elidy Izidio <elidyizidio@gmail.com>",
|
|
22
|
+
"license": "MIT",
|
|
23
|
+
"homepage": "https://github.com/elidyizzy/GENIA-SQUAD-OS#readme",
|
|
24
|
+
"bugs": {
|
|
25
|
+
"url": "https://github.com/elidyizzy/GENIA-SQUAD-OS/issues"
|
|
26
|
+
},
|
|
27
|
+
"repository": {
|
|
28
|
+
"type": "git",
|
|
29
|
+
"url": "git+https://github.com/elidyizzy/GENIA-SQUAD-OS.git",
|
|
30
|
+
"directory": "packages/create-genia-os"
|
|
31
|
+
},
|
|
32
|
+
"bin": "./bin/index.js",
|
|
33
|
+
"files": [
|
|
34
|
+
"bin/",
|
|
35
|
+
"template/"
|
|
36
|
+
],
|
|
37
|
+
"engines": {
|
|
38
|
+
"node": ">=18.0.0"
|
|
39
|
+
}
|
|
40
|
+
}
|