@maestro-ai/cli 1.1.0 → 1.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.
Files changed (32) hide show
  1. package/README.md +84 -54
  2. package/content/guides/fases-mapeamento.md +35 -0
  3. package/content/guides/multi-ide.md +32 -0
  4. package/content/guides/playbook-orquestrador.md +45 -0
  5. package/content/rules/quality-gates.md +43 -0
  6. package/content/rules/validation-rules.md +97 -0
  7. package/content/templates/estado-template.json +73 -0
  8. package/content/workflows/avancar-fase.md +84 -0
  9. package/content/workflows/brainstorm.md +22 -8
  10. package/content/workflows/continuar-fase.md +64 -0
  11. package/content/workflows/{mcp-debug.md → corrigir-bug.md} +30 -6
  12. package/content/workflows/iniciar-projeto.md +59 -0
  13. package/content/workflows/maestro.md +77 -0
  14. package/content/workflows/{mcp-feature.md → nova-feature.md} +81 -28
  15. package/content/workflows/{mcp-refactor.md → refatorar-codigo.md} +33 -10
  16. package/content/workflows/status-projeto.md +54 -0
  17. package/dist/commands/init.d.ts +2 -2
  18. package/dist/commands/init.js +86 -74
  19. package/dist/index.js +94 -5
  20. package/package.json +10 -4
  21. package/content/workflows/README-MCP.md +0 -363
  22. package/content/workflows/debug.md +0 -103
  23. package/content/workflows/mcp-next.md +0 -388
  24. package/content/workflows/mcp-start.md +0 -304
  25. package/content/workflows/mcp-status.md +0 -400
  26. package/content/workflows/preview.md +0 -81
  27. package/content/workflows/status.md +0 -86
  28. /package/content/workflows/{create.md → create-app.md} +0 -0
  29. /package/content/workflows/{enhance.md → melhorar-feature.md} +0 -0
  30. /package/content/workflows/{test.md → testar.md} +0 -0
  31. /package/content/workflows/{ui-ux-pro-max.md → ux-avancado.md} +0 -0
  32. /package/content/workflows/{mcp-gate.md → validar-gate.md} +0 -0
@@ -0,0 +1,54 @@
1
+ ---
2
+ description: Mostra o status completo do projeto Maestro e recomenda próximas ações
3
+ ---
4
+
5
+ # 📊 Workflow de Status - /status-projeto
6
+
7
+ ## 1. Ler estado
8
+
9
+ ```javascript
10
+ const estado = lerJson('.maestro/estado.json');
11
+ if (!estado) throw new Error('Projeto ainda não inicializado. Execute /iniciar-projeto.');
12
+ const fases = Object.values(estado.fases || {});
13
+ ```
14
+
15
+ ## 2. Calcular métricas
16
+
17
+ - Fases concluídas (`status === 'concluida'`).
18
+ - Progresso percentual: `concluidas / totalFases`.
19
+ - Score médio (ignorar `null`).
20
+ - Bloqueios: fases com `status === 'bloqueado'`.
21
+ - Próxima ação sugerida: se há bloqueio → listar; se fase atual não concluída → `/continuar-fase`; caso contrário → `/avancar-fase`.
22
+
23
+ ## 3. Resposta padrão
24
+
25
+ ```
26
+ 🎯 **Projeto:** {estado.projeto.nome}
27
+ 📈 **Progresso:** {progresso}% ({fasesConcluidas}/{totalFases})
28
+ 🔄 **Fase Atual:** {faseAtual.numero}/{totalFases} - {faseAtual.nome}
29
+ 👤 **Especialista:** {faseAtual.especialista}
30
+ 📊 **Score Médio:** {scoreMedio}
31
+
32
+ ## 📋 Detalhes
33
+ | Fase | Status | Score | Especialista | Últ. Atualização |
34
+ |------|--------|-------|--------------|------------------|
35
+ {linhas}
36
+
37
+ {bloqueios ? `⚠️ Bloqueios detectados:` + lista : ''}
38
+
39
+ 🎯 **Próximas ações sugeridas:**
40
+ - {acao1}
41
+ - {acao2}
42
+ ```
43
+
44
+ ## 4. Recomendações
45
+
46
+ Baseie-se em heurísticas simples:
47
+ - Ritmo lento (`diasFase > media`) → sugerir revisão.
48
+ - Score baixo (< mínimo + 5) → recomendar `/continuar-fase` focando na validação.
49
+ - Próxima fase crítica (ex.: Prototipagem, Arquitetura) → antecipar especialistas/artefatos.
50
+
51
+ ## 5. Complementos
52
+
53
+ - Se o usuário pedir filtros (ex.: "status completo"), incluir lista detalhada dos artefatos por fase.
54
+ - Caso não exista `estado.fases`, instruir execução de `/iniciar-projeto`.
@@ -1,7 +1,7 @@
1
1
  interface InitOptions {
2
2
  force?: boolean;
3
3
  minimal?: boolean;
4
- ide?: 'gemini' | 'cursor' | 'copilot' | 'windsurf' | 'all';
4
+ ide?: 'windsurf' | 'cursor' | 'antigravity';
5
5
  }
6
- export declare function init(options?: InitOptions): Promise<void>;
6
+ export declare function init(options: InitOptions): Promise<void>;
7
7
  export {};
@@ -6,24 +6,26 @@ import chalk from 'chalk';
6
6
  import ora from 'ora';
7
7
  const __dirname = dirname(fileURLToPath(import.meta.url));
8
8
  const IDE_CONFIGS = {
9
- gemini: {
10
- path: '.gemini/GEMINI.md',
11
- header: '---\ntrigger: always_on\nsystem: maestro\nversion: 1.0.0\n---\n\n'
9
+ windsurf: {
10
+ path: '.windsurfrules',
11
+ header: '',
12
+ workflowsDir: '.windsurf/workflows',
13
+ skillsDir: '.windsurf/skills'
12
14
  },
13
15
  cursor: {
14
16
  path: '.cursorrules',
15
- header: ''
17
+ header: '',
18
+ workflowsDir: '.cursor/commands',
19
+ skillsDir: '.cursor/skills'
16
20
  },
17
- copilot: {
18
- path: '.github/copilot-instructions.md',
19
- header: ''
20
- },
21
- windsurf: {
22
- path: '.windsurfrules',
23
- header: ''
21
+ antigravity: {
22
+ path: '.gemini/GEMINI.md',
23
+ header: '---\ntrigger: always_on\nsystem: maestro\nversion: 1.0.0\n---\n\n',
24
+ workflowsDir: '.agent/workflows',
25
+ skillsDir: '.agent/skills'
24
26
  }
25
27
  };
26
- export async function init(options = {}) {
28
+ export async function init(options) {
27
29
  const cwd = process.cwd();
28
30
  const spinner = ora();
29
31
  console.log(chalk.blue.bold('\n🎯 Maestro - Inicializando projeto\n'));
@@ -43,7 +45,8 @@ export async function init(options = {}) {
43
45
  await fse.writeJSON(join(cwd, '.maestro', 'config.json'), {
44
46
  version: '1.0.0',
45
47
  initialized: new Date().toISOString(),
46
- mcpServer: 'https://maestro.deluna.dev.br/mcp'
48
+ ide: options.ide || 'windsurf',
49
+ mcpFree: true
47
50
  }, { spaces: 2 });
48
51
  spinner.succeed('Estrutura .maestro/ criada');
49
52
  // 2. Copiar content para .maestro/content/ (se não minimal)
@@ -60,27 +63,9 @@ export async function init(options = {}) {
60
63
  }
61
64
  spinner.succeed('Content copiado para .maestro/content/');
62
65
  }
63
- // 3. Copiar skills para .agent/skills/
64
- spinner.start('Copiando skills para .agent/skills/...');
65
- const skillsSrc = join(contentSource, 'skills');
66
- const skillsDest = join(cwd, '.agent', 'skills');
67
- if (await fse.pathExists(skillsSrc)) {
68
- await fse.copy(skillsSrc, skillsDest, { overwrite: options.force });
69
- }
70
- spinner.succeed('Skills copiados para .agent/skills/');
71
- // 4. Copiar workflows para .agent/workflows/
72
- spinner.start('Copiando workflows para .agent/workflows/...');
73
- const workflowsSrc = join(contentSource, 'workflows');
74
- const workflowsDest = join(cwd, '.agent', 'workflows');
75
- if (await fse.pathExists(workflowsSrc)) {
76
- await fse.copy(workflowsSrc, workflowsDest, { overwrite: options.force });
77
- }
78
- spinner.succeed('Workflows copiados para .agent/workflows/');
79
- // 5. Gerar arquivos de regras por IDE
80
- const targetIdes = options.ide === 'all'
81
- ? Object.keys(IDE_CONFIGS)
82
- : [options.ide || 'gemini'];
83
- spinner.start(`Gerando regras para IDE(s): ${targetIdes.join(', ')}...`);
66
+ // 4. Configurar IDE específica
67
+ const ideConfig = IDE_CONFIGS[options.ide];
68
+ spinner.start(`Configurando IDE: ${options.ide}...`);
84
69
  // Ler RULES.md base
85
70
  const rulesPath = join(contentSource, 'rules', 'RULES.md');
86
71
  let rulesContent = '';
@@ -90,17 +75,29 @@ export async function init(options = {}) {
90
75
  else {
91
76
  rulesContent = generateDefaultRules();
92
77
  }
93
- // Gerar arquivo para cada IDE alvo
94
- for (const ide of targetIdes) {
95
- const config = IDE_CONFIGS[ide];
96
- const targetPath = join(cwd, config.path);
97
- await fse.ensureDir(dirname(targetPath));
98
- const content = config.header + rulesContent;
99
- await fse.writeFile(targetPath, content);
78
+ // Criar diretórios específicos da IDE
79
+ await fse.ensureDir(join(cwd, dirname(ideConfig.path)));
80
+ await fse.ensureDir(join(cwd, ideConfig.workflowsDir));
81
+ await fse.ensureDir(join(cwd, ideConfig.skillsDir));
82
+ // Copiar workflows para diretório específico da IDE
83
+ const workflowsSrc = join(contentSource, 'workflows');
84
+ const workflowsDest = join(cwd, ideConfig.workflowsDir);
85
+ if (await fse.pathExists(workflowsSrc)) {
86
+ await fse.copy(workflowsSrc, workflowsDest, { overwrite: options.force });
87
+ }
88
+ // Copiar skills para diretório específico da IDE
89
+ const skillsSrc = join(contentSource, 'skills');
90
+ const skillsDest = join(cwd, ideConfig.skillsDir);
91
+ if (await fse.pathExists(skillsSrc)) {
92
+ await fse.copy(skillsSrc, skillsDest, { overwrite: options.force });
100
93
  }
101
- spinner.succeed(`Regras geradas para: ${targetIdes.join(', ')}`);
94
+ // Gerar arquivo de regras
95
+ const targetPath = join(cwd, ideConfig.path);
96
+ const content = ideConfig.header + rulesContent;
97
+ await fse.writeFile(targetPath, content);
98
+ spinner.succeed(`IDE ${options.ide} configurada com sucesso!`);
102
99
  // Resumo
103
- console.log(chalk.green.bold('\n✅ Maestro inicializado com sucesso!\n'));
100
+ console.log(chalk.green.bold(`\n✅ Maestro inicializado para ${options.ide}\n`));
104
101
  console.log(chalk.dim('Estrutura criada:'));
105
102
  console.log(chalk.dim(' .maestro/'));
106
103
  console.log(chalk.dim(' ├── config.json'));
@@ -112,16 +109,13 @@ export async function init(options = {}) {
112
109
  console.log(chalk.dim(' ├── guides/'));
113
110
  console.log(chalk.dim(' └── prompts/'));
114
111
  }
115
- console.log(chalk.dim(' .agent/'));
116
- console.log(chalk.dim(' ├── skills/'));
117
- console.log(chalk.dim(' └── workflows/'));
118
- for (const ide of targetIdes) {
119
- console.log(chalk.dim(` ${IDE_CONFIGS[ide].path}`));
120
- }
121
- console.log(chalk.blue('\n📋 Próximos passos:'));
122
- console.log(' 1. Configure o MCP na sua IDE:');
123
- console.log(chalk.gray(' "mcpServers": { "maestro": { "serverUrl": "https://maestro.deluna.dev.br/mcp" } }'));
124
- console.log(' 2. Inicie um novo projeto com: @mcp:maestro iniciar_projeto');
112
+ console.log(chalk.dim(` ${ideConfig.workflowsDir}/`));
113
+ console.log(chalk.dim(` ${ideConfig.skillsDir}/`));
114
+ console.log(chalk.dim(` ${ideConfig.path}`));
115
+ console.log(chalk.blue('\n🎯 Próximos passos:'));
116
+ console.log(` 1. Abra sua ${options.ide}`);
117
+ console.log(' 2. Digite: /maestro');
118
+ console.log(' 3. Comece a desenvolver!');
125
119
  console.log('');
126
120
  }
127
121
  catch (error) {
@@ -131,40 +125,58 @@ export async function init(options = {}) {
131
125
  }
132
126
  }
133
127
  function generateDefaultRules() {
134
- return `# MCP Maestro Development Kit - AI Rules
135
-
136
- > Este arquivo define como a IA deve se comportar ao trabalhar com o sistema MCP Maestro.
128
+ return `# Maestro File System - AI Rules
137
129
 
138
- ## Configuração MCP
139
-
140
- \`\`\`json
141
- {
142
- "mcpServers": {
143
- "maestro": {
144
- "serverUrl": "https://maestro.deluna.dev.br/mcp"
145
- }
146
- }
147
- }
148
- \`\`\`
130
+ > Este arquivo define como a IA deve se comportar ao trabalhar com o sistema Maestro File System.
149
131
 
150
132
  ## Como Usar
151
133
 
152
- 1. **Iniciar projeto**: Use \`iniciar_projeto\` para começar
153
- 2. **Avançar fases**: Use \`proximo\` para salvar e avançar
154
- 3. **Ver status**: Use \`status\` para ver onde está
134
+ 1. **Iniciar projeto**: Use \`/iniciar-projeto\` para começar
135
+ 2. **Avançar fases**: Use \`/avancar-fase\` para avançar
136
+ 3. **Ver status**: Use \`/status-projeto\` para ver progresso
137
+ 4. **Continuar**: Use \`/continuar\` para retomar trabalho
155
138
 
156
139
  ## Estrutura Local
157
140
 
158
141
  | Pasta | Conteúdo |
159
142
  |-------|----------|
160
143
  | \`.maestro/estado.json\` | Estado do projeto (fonte da verdade) |
161
- | \`.maestro/SYSTEM.md\` | Contexto atual para IA |
162
144
  | \`.maestro/content/\` | Especialistas, templates, prompts |
163
- | \`.agent/skills/\` | Skills disponíveis |
164
- | \`.agent/workflows/\` | Workflows automatizados |
145
+ | \`.windsurf/workflows/\` | Workflows para Windsurf |
146
+ | \`.windsurf/skills/\` | Skills especializadas |
147
+ | \`.cursor/commands/\` | Commands para Cursor |
148
+ | \`.cursor/skills/\` | Skills especializadas |
149
+ | \`.agent/workflows/\` | Workflows para Antigravity |
150
+ | \`.agent/skills/\` | Skills especializadas |
151
+
152
+ ## Comandos Disponíveis
153
+
154
+ ### Gerenciamento de Projeto
155
+ - \`/maestro\` - Comando universal inteligente
156
+ - \`/iniciar-projeto\` - Iniciar novo projeto
157
+ - \`/avancar-fase\` - Avançar para próxima fase
158
+ - \`/status-projeto\` - Ver status e progresso
159
+ - \`/continuar\` - Continuar fase atual
160
+
161
+ ### Desenvolvimento
162
+ - \`/nova-feature\` - Criar nova funcionalidade
163
+ - \`/corrigir-bug\` - Debugging estruturado
164
+ - \`/refatorar-codigo\` - Refatoração segura
165
+
166
+ ## Especialistas IA
167
+
168
+ - Gestão de Produto
169
+ - Engenharia de Requisitos
170
+ - UX Design
171
+ - Arquitetura de Software
172
+ - E mais 20 especialistas disponíveis
173
+
174
+ ## Orquestração Local
175
+
176
+ Este sistema opera 100% localmente, sem dependência de MCP remoto. A IA detecta automaticamente os arquivos e workflows disponíveis.
165
177
 
166
178
  ## Estado do Projeto
167
179
 
168
- O estado é mantido em \`.maestro/estado.json\` e deve ser passado como \`estado_json\` em todos os tools MCP.
180
+ O estado é mantido em \`.maestro/estado.json\` e serve como fonte da verdade para o progresso do projeto.
169
181
  `;
170
182
  }
package/dist/index.js CHANGED
@@ -2,6 +2,62 @@
2
2
  import { Command } from 'commander';
3
3
  import { init } from './commands/init.js';
4
4
  import { update } from './commands/update.js';
5
+ import chalk from 'chalk';
6
+ import { createInterface } from 'readline';
7
+ const VALID_IDES = ['windsurf', 'cursor', 'antigravity'];
8
+ async function promptForIDE() {
9
+ while (true) {
10
+ console.log(chalk.cyan('\n🎯 Selecione sua IDE de desenvolvimento:\n'));
11
+ VALID_IDES.forEach((ide, index) => {
12
+ console.log(chalk.white(`${index + 1}. ${ide}`));
13
+ });
14
+ console.log(chalk.yellow('\nDigite o número da IDE desejada:'));
15
+ const answer = await new Promise((resolve) => {
16
+ const rl = createInterface({
17
+ input: process.stdin,
18
+ output: process.stdout
19
+ });
20
+ rl.question('', (answer) => {
21
+ rl.close();
22
+ resolve(answer.trim());
23
+ });
24
+ });
25
+ const choice = parseInt(answer);
26
+ if (choice >= 1 && choice <= VALID_IDES.length) {
27
+ return VALID_IDES[choice - 1];
28
+ }
29
+ console.log(chalk.red('❌ Opção inválida. Por favor, digite um número entre 1 e 3.'));
30
+ // Loop continua para perguntar novamente
31
+ }
32
+ }
33
+ async function promptForIDEWithDefault() {
34
+ while (true) {
35
+ console.log(chalk.cyan('\n🎯 Selecione sua IDE de desenvolvimento:\n'));
36
+ VALID_IDES.forEach((ide, index) => {
37
+ console.log(chalk.white(`${index + 1}. ${ide}`));
38
+ });
39
+ console.log(chalk.yellow('\nDigite o número da IDE desejada (ou pressione Enter para Windsurf):'));
40
+ const answer = await new Promise((resolve) => {
41
+ const rl = createInterface({
42
+ input: process.stdin,
43
+ output: process.stdout
44
+ });
45
+ rl.question('', (answer) => {
46
+ rl.close();
47
+ resolve(answer.trim());
48
+ });
49
+ });
50
+ if (answer === '') {
51
+ return 'windsurf'; // Default
52
+ }
53
+ const numChoice = parseInt(answer);
54
+ if (numChoice >= 1 && numChoice <= VALID_IDES.length) {
55
+ return VALID_IDES[numChoice - 1];
56
+ }
57
+ console.log(chalk.red('❌ Opção inválida. Por favor, digite um número entre 1 e 3.'));
58
+ // Loop continua para perguntar novamente
59
+ }
60
+ }
5
61
  const program = new Command();
6
62
  program
7
63
  .name('maestro')
@@ -9,18 +65,51 @@ program
9
65
  .version('1.0.0')
10
66
  .option('-f, --force', 'Sobrescreve arquivos existentes')
11
67
  .option('--minimal', 'Instala apenas workflows e rules')
12
- .option('--ide <ide>', 'IDE alvo: gemini, cursor, copilot, windsurf, all (default: all)', 'all')
68
+ .option('--ide <ide>', `IDE alvo: ${VALID_IDES.join(', ')} (opcional)`)
13
69
  .action(async (options) => {
14
- // Comportamento padrão: executa init quando chamado sem subcomando
15
- await init(options);
70
+ let selectedIDE = options.ide;
71
+ // Se não foi especificada, perguntar ao usuário
72
+ if (!selectedIDE) {
73
+ selectedIDE = await promptForIDEWithDefault();
74
+ }
75
+ else {
76
+ // Validar IDE se foi especificada
77
+ if (!VALID_IDES.includes(selectedIDE)) {
78
+ console.error(`❌ IDE inválida. Use: ${VALID_IDES.join(', ')}`);
79
+ console.log(chalk.cyan('\nOpções válidas:'));
80
+ VALID_IDES.forEach((ide, index) => {
81
+ console.log(chalk.white(` ${index + 1}. ${ide}`));
82
+ });
83
+ process.exit(1);
84
+ }
85
+ }
86
+ await init({ ...options, ide: selectedIDE });
16
87
  });
17
88
  program
18
89
  .command('init')
19
90
  .description('Inicializa Maestro no projeto atual')
20
91
  .option('-f, --force', 'Sobrescreve arquivos existentes')
21
92
  .option('--minimal', 'Instala apenas workflows e rules')
22
- .option('--ide <ide>', 'IDE alvo: gemini, cursor, copilot, windsurf, all (default: all)', 'all')
23
- .action(init);
93
+ .option('--ide <ide>', `IDE alvo: ${VALID_IDES.join(', ')} (opcional)`)
94
+ .action(async (options) => {
95
+ let selectedIDE = options.ide;
96
+ // Se não foi especificada, perguntar ao usuário
97
+ if (!selectedIDE) {
98
+ selectedIDE = await promptForIDE();
99
+ }
100
+ else {
101
+ // Validar IDE se foi especificada
102
+ if (!VALID_IDES.includes(selectedIDE)) {
103
+ console.error(`❌ IDE inválida. Use: ${VALID_IDES.join(', ')}`);
104
+ console.log(chalk.cyan('\nOpções válidas:'));
105
+ VALID_IDES.forEach((ide, index) => {
106
+ console.log(chalk.white(` ${index + 1}. ${ide}`));
107
+ });
108
+ process.exit(1);
109
+ }
110
+ }
111
+ init({ ...options, ide: selectedIDE });
112
+ });
24
113
  program
25
114
  .command('update')
26
115
  .description('Atualiza content para a última versão')
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@maestro-ai/cli",
3
- "version": "1.1.0",
4
- "description": "CLI para inicializar projetos com Maestro - Desenvolvimento assistido por IA",
3
+ "version": "1.2.0",
4
+ "description": "CLI para inicializar projetos Maestro File System - Orquestrador chat-first com workflows inteligentes",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "bin": {
@@ -40,8 +40,14 @@
40
40
  "maestro",
41
41
  "ai",
42
42
  "development",
43
- "mcp",
44
- "cli"
43
+ "file-system",
44
+ "chat-first",
45
+ "workflows",
46
+ "orchestrator",
47
+ "cli",
48
+ "windsurf",
49
+ "cursor",
50
+ "antigravity"
45
51
  ],
46
52
  "author": "Matheus Luna",
47
53
  "license": "MIT"