create-genia-os 2.1.0 → 2.2.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/README.md +154 -106
- package/bin/index.js +240 -240
- package/package.json +42 -37
- package/template/.claude/CLAUDE.md +215 -215
- package/template/.claude/agent-memory/analyst/MEMORY.md +20 -20
- package/template/.claude/agent-memory/architect/MEMORY.md +20 -20
- package/template/.claude/agent-memory/dev/MEMORY.md +20 -20
- package/template/.claude/agent-memory/devops/MEMORY.md +20 -20
- package/template/.claude/agent-memory/pm/MEMORY.md +20 -20
- package/template/.claude/agent-memory/po/MEMORY.md +20 -20
- package/template/.claude/agent-memory/qa/MEMORY.md +20 -20
- package/template/.claude/agent-memory/reviewer/MEMORY.md +20 -20
- package/template/.claude/agent-memory/sm/MEMORY.md +20 -20
- package/template/.claude/hooks/enforce-git-push-authority.py +70 -70
- package/template/.claude/hooks/metrics-tracker.cjs +65 -0
- package/template/.claude/hooks/precompact-session-digest.cjs +87 -87
- package/template/.claude/hooks/sql-governance.py +65 -65
- package/template/.claude/hooks/synapse-engine.cjs +122 -122
- package/template/.claude/hooks/write-path-validation.py +59 -59
- package/template/.claude/rules/agent-authority.md +39 -39
- package/template/.claude/rules/agent-handoff.md +71 -71
- package/template/.claude/rules/agent-memory.md +61 -61
- package/template/.claude/rules/ids-principles.md +52 -52
- package/template/.claude/rules/mcp-usage.md +49 -49
- package/template/.claude/rules/new-project.md +157 -0
- package/template/.claude/rules/story-lifecycle.md +87 -87
- package/template/.claude/rules/workflow-execution.md +68 -68
- package/template/.claude/settings.json +58 -58
- package/template/.claude/settings.local.json +14 -14
- package/template/.genia/CONSTITUTION.md +129 -129
- package/template/.genia/contexts/api-patterns.md +134 -134
- package/template/.genia/contexts/nextjs-react.md +210 -210
- package/template/.genia/contexts/projeto.md +18 -18
- package/template/.genia/contexts/supabase.md +152 -152
- package/template/.genia/contexts/whatsapp-cloud.md +176 -176
- package/template/.genia/core-config.yaml +192 -192
- package/template/.genia/development/agents/analyst.md +138 -138
- package/template/.genia/development/agents/architect.md +171 -171
- package/template/.genia/development/agents/dev.md +160 -160
- package/template/.genia/development/agents/devops.md +200 -200
- package/template/.genia/development/agents/pm.md +142 -142
- package/template/.genia/development/agents/po.md +165 -165
- package/template/.genia/development/agents/qa.md +183 -183
- package/template/.genia/development/agents/reviewer.md +198 -198
- package/template/.genia/development/agents/sm.md +230 -230
- package/template/.genia/development/checklists/architecture-review.md +189 -189
- package/template/.genia/development/checklists/pre-commit.md +205 -205
- package/template/.genia/development/checklists/pre-deploy.md +230 -230
- package/template/.genia/development/checklists/qa-gate.md +216 -216
- package/template/.genia/development/checklists/story-dod.md +155 -155
- package/template/.genia/development/tasks/code-review.md +197 -197
- package/template/.genia/development/tasks/criar-prd.md +170 -170
- package/template/.genia/development/tasks/criar-spec.md +188 -188
- package/template/.genia/development/tasks/criar-story.md +185 -185
- package/template/.genia/development/tasks/debug-sistematico.md +230 -230
- package/template/.genia/development/tasks/dev-implement.md +199 -199
- package/template/.genia/development/tasks/qa-review.md +224 -224
- package/template/.genia/development/workflows/brownfield.md +178 -178
- package/template/.genia/development/workflows/delivery.md +208 -208
- package/template/.genia/development/workflows/development.md +189 -189
- package/template/.genia/development/workflows/greenfield.md +166 -166
- package/template/.genia/development/workflows/planning.md +167 -167
- package/template/.genia/development/workflows/qa-loop.md +179 -179
- package/template/.genia/development/workflows/spec-pipeline.md +192 -192
- package/template/.genia/development/workflows/story-development-cycle.md +252 -252
- package/template/.genia/guidelines/clean-code.md +98 -98
- package/template/.genia/guidelines/testing.md +176 -176
- package/template/.genia/skills/design/canvas-design.md +109 -109
- package/template/.genia/skills/design/frontend-design.md +140 -140
- package/template/.genia/skills/dev/mcp-builder.md +172 -172
- package/template/.genia/skills/dev/webapp-testing.md +150 -150
- package/template/.genia/skills/documents/docx.md +153 -153
- package/template/.genia/skills/documents/pdf.md +134 -134
- package/template/.genia/skills/documents/pptx.md +118 -118
- package/template/.genia/skills/documents/xlsx.md +140 -140
- package/template/.synapse/agent-analyst +8 -8
- package/template/.synapse/agent-architect +8 -8
- package/template/.synapse/agent-dev +8 -8
- package/template/.synapse/agent-devops +8 -8
- package/template/.synapse/agent-pm +8 -8
- package/template/.synapse/agent-po +7 -7
- package/template/.synapse/agent-qa +8 -8
- package/template/.synapse/agent-reviewer +7 -7
- package/template/.synapse/agent-sm +7 -7
- package/template/.synapse/constitution +7 -7
- package/template/.synapse/context +8 -8
- package/template/.synapse/global +8 -8
- package/template/.synapse/manifest +14 -14
- package/template/README.md +53 -53
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,42 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "create-genia-os",
|
|
3
|
-
"version": "2.
|
|
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.2.0",
|
|
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": {
|
|
33
|
+
"create-genia-os": "bin/index.js"
|
|
34
|
+
},
|
|
35
|
+
"files": [
|
|
36
|
+
"bin/",
|
|
37
|
+
"template/"
|
|
38
|
+
],
|
|
39
|
+
"engines": {
|
|
40
|
+
"node": ">=18.0.0"
|
|
41
|
+
}
|
|
42
|
+
}
|