@maestro-ai/mcp-server 5.3.4 → 5.3.6

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.
@@ -8,3 +8,8 @@ target_path: .github/copilot-instructions.md
8
8
  Este adaptador formata as regras para o GitHub Copilot.
9
9
 
10
10
  O conteúdo de `RULES.md` será inserido automaticamente pelo CLI.
11
+
12
+ **Paths IDE-specific:**
13
+ - Skills: `.agent/skills/`
14
+ - Workflows: `.agent/workflows/`
15
+ - Rules: `.github/copilot-instructions.md`
@@ -8,3 +8,8 @@ target_path: .cursorrules
8
8
  Este adaptador formata as regras para o Cursor IDE.
9
9
 
10
10
  O conteúdo de `RULES.md` será inserido automaticamente pelo CLI.
11
+
12
+ **Paths IDE-specific:**
13
+ - Skills: `.cursor/skills/`
14
+ - Workflows: `.cursor/commands/`
15
+ - Rules: `.cursorrules`
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  trigger: always_on
3
3
  system: maestro
4
- version: 1.0.0
4
+ version: 3.0.0
5
5
  description: Adapter for Gemini/Antigravity IDE
6
6
  target_path: .gemini/GEMINI.md
7
7
  ---
@@ -11,3 +11,8 @@ target_path: .gemini/GEMINI.md
11
11
  Este adaptador adiciona o frontmatter específico para Gemini/Antigravity.
12
12
 
13
13
  O conteúdo de `RULES.md` será inserido automaticamente pelo CLI.
14
+
15
+ **Paths IDE-specific:**
16
+ - Skills: `.agent/skills/`
17
+ - Workflows: `.agent/workflows/`
18
+ - Rules: `.gemini/GEMINI.md`
@@ -8,3 +8,8 @@ target_path: .windsurfrules
8
8
  Este adaptador formata as regras para o Windsurf IDE.
9
9
 
10
10
  O conteúdo de `RULES.md` será inserido automaticamente pelo CLI.
11
+
12
+ **Paths IDE-specific:**
13
+ - Skills: `.windsurf/skills/`
14
+ - Workflows: `.windsurf/workflows/`
15
+ - Rules: `.windsurfrules`
@@ -0,0 +1,67 @@
1
+ /**
2
+ * Unified Validation Service (v6.1)
3
+ *
4
+ * Consolidates 4 parallel validation systems into a single pipeline:
5
+ * - template-validator.ts (template-based validation)
6
+ * - intelligent-validator.ts (semantic validation)
7
+ * - quality-scorer.ts (quality metrics)
8
+ * - specialist-phase-handler.ts inline (section-check validation)
9
+ *
10
+ * This service provides a single entry point for validating any deliverable,
11
+ * regardless of the phase or type.
12
+ *
13
+ * @since v6.1.0 — Opportunity #1 from Analysis
14
+ */
15
+ import type { TierGate, Fase } from "../types/index.js";
16
+ import { type TemplateStructure } from "./template-parser.js";
17
+ export interface UnifiedValidationResult {
18
+ /** Whether the deliverable passes the gate */
19
+ valid: boolean;
20
+ /** Overall score (0-100) */
21
+ score: number;
22
+ /** Maturity level (1-5) */
23
+ maturityLevel: 1 | 2 | 3 | 4 | 5;
24
+ /** Whether the deliverable can advance to next phase */
25
+ canAdvance: boolean;
26
+ /** Detailed breakdown by category */
27
+ breakdown: {
28
+ structure: number;
29
+ content: number;
30
+ quality: number;
31
+ completeness: number;
32
+ };
33
+ /** Items that passed */
34
+ passed: string[];
35
+ /** Items that failed (blockers) */
36
+ failed: string[];
37
+ /** Warnings (non-blocking) */
38
+ warnings: string[];
39
+ /** Actionable suggestions */
40
+ suggestions: string[];
41
+ /** Which validation method was used */
42
+ method: 'template' | 'section-check' | 'hybrid';
43
+ }
44
+ export interface UnifiedValidationOptions {
45
+ /** Content to validate */
46
+ content: string;
47
+ /** Phase being validated */
48
+ fase?: Fase;
49
+ /** Gate tier level */
50
+ tier?: TierGate;
51
+ /** Path to content directory (for template resolution) */
52
+ contentDir?: string;
53
+ /** Skill name for template lookup */
54
+ skillName?: string;
55
+ /** Optional pre-parsed template */
56
+ template?: TemplateStructure;
57
+ }
58
+ /**
59
+ * Validates deliverable content using the best available method.
60
+ *
61
+ * Resolution order:
62
+ * 1. If template is provided or can be resolved → template-based validation
63
+ * 2. Fallback → section-check validation (PRD-specific)
64
+ * 3. Always → quality scoring overlay
65
+ */
66
+ export declare function validateDeliverable(opts: UnifiedValidationOptions): UnifiedValidationResult;
67
+ //# sourceMappingURL=unified-validator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unified-validator.d.ts","sourceRoot":"","sources":["../../src/gates/unified-validator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,EAAiB,KAAK,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAO7E,MAAM,WAAW,uBAAuB;IACpC,8CAA8C;IAC9C,KAAK,EAAE,OAAO,CAAC;IACf,4BAA4B;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,2BAA2B;IAC3B,aAAa,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACjC,wDAAwD;IACxD,UAAU,EAAE,OAAO,CAAC;IACpB,qCAAqC;IACrC,SAAS,EAAE;QACP,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;QAChB,YAAY,EAAE,MAAM,CAAC;KACxB,CAAC;IACF,wBAAwB;IACxB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,mCAAmC;IACnC,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,8BAA8B;IAC9B,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,6BAA6B;IAC7B,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,uCAAuC;IACvC,MAAM,EAAE,UAAU,GAAG,eAAe,GAAG,QAAQ,CAAC;CACnD;AAED,MAAM,WAAW,wBAAwB;IACrC,0BAA0B;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,4BAA4B;IAC5B,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,sBAAsB;IACtB,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,0DAA0D;IAC1D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,qCAAqC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mCAAmC;IACnC,QAAQ,CAAC,EAAE,iBAAiB,CAAC;CAChC;AAID;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,wBAAwB,GAAG,uBAAuB,CAiC3F"}
@@ -0,0 +1,234 @@
1
+ /**
2
+ * Unified Validation Service (v6.1)
3
+ *
4
+ * Consolidates 4 parallel validation systems into a single pipeline:
5
+ * - template-validator.ts (template-based validation)
6
+ * - intelligent-validator.ts (semantic validation)
7
+ * - quality-scorer.ts (quality metrics)
8
+ * - specialist-phase-handler.ts inline (section-check validation)
9
+ *
10
+ * This service provides a single entry point for validating any deliverable,
11
+ * regardless of the phase or type.
12
+ *
13
+ * @since v6.1.0 — Opportunity #1 from Analysis
14
+ */
15
+ import { validarContraTemplate } from "./template-validator.js";
16
+ import { parseTemplate } from "./template-parser.js";
17
+ import { calcularQualidade } from "./quality-scorer.js";
18
+ import { existsSync } from "fs";
19
+ import { join } from "path";
20
+ // === MAIN VALIDATION FUNCTION ===
21
+ /**
22
+ * Validates deliverable content using the best available method.
23
+ *
24
+ * Resolution order:
25
+ * 1. If template is provided or can be resolved → template-based validation
26
+ * 2. Fallback → section-check validation (PRD-specific)
27
+ * 3. Always → quality scoring overlay
28
+ */
29
+ export function validateDeliverable(opts) {
30
+ const { content, tier = 'base' } = opts;
31
+ // Normalize content first
32
+ const normalizedContent = normalizeContent(content);
33
+ // Try template-based validation first
34
+ let templateResult = null;
35
+ let template = opts.template || null;
36
+ if (!template && opts.contentDir && opts.skillName) {
37
+ template = tryResolveTemplate(opts.contentDir, opts.skillName);
38
+ }
39
+ if (template) {
40
+ templateResult = validarContraTemplate(normalizedContent, template, tier);
41
+ }
42
+ // Calculate quality metrics
43
+ let qualityMetrics = null;
44
+ if (template) {
45
+ try {
46
+ qualityMetrics = calcularQualidade(normalizedContent, template, tier);
47
+ }
48
+ catch { /* ignore quality scoring errors */ }
49
+ }
50
+ // Build unified result
51
+ if (templateResult) {
52
+ return buildFromTemplateResult(templateResult, qualityMetrics);
53
+ }
54
+ // Fallback: section-check (for PRD and similar)
55
+ return buildFromSectionCheck(normalizedContent, tier, qualityMetrics);
56
+ }
57
+ // === HELPERS ===
58
+ function normalizeContent(content) {
59
+ let normalized = content;
60
+ // Fix JSON-escaped newlines
61
+ const realNewlines = (normalized.match(/\n/g) || []).length;
62
+ const literalNewlines = (normalized.match(/\\n/g) || []).length;
63
+ if (literalNewlines > realNewlines * 2) {
64
+ normalized = normalized.replace(/\\n/g, '\n');
65
+ }
66
+ normalized = normalized.replace(/\r\n/g, '\n');
67
+ normalized = normalized.replace(/\\"/g, '"');
68
+ normalized = normalized.replace(/\\\\n/g, '\n');
69
+ return normalized.trim();
70
+ }
71
+ function tryResolveTemplate(contentDir, skillName) {
72
+ const possiblePaths = [
73
+ join(contentDir, 'skills', skillName, 'resources', 'templates'),
74
+ join(contentDir, 'skills', skillName, 'templates'),
75
+ ];
76
+ for (const basePath of possiblePaths) {
77
+ if (!existsSync(basePath))
78
+ continue;
79
+ // Look for template files
80
+ const templateFiles = ['PRD.md', 'template.md', 'entregavel.md'];
81
+ for (const file of templateFiles) {
82
+ const fullPath = join(basePath, file);
83
+ if (existsSync(fullPath)) {
84
+ const parsed = parseTemplate(fullPath);
85
+ if (parsed)
86
+ return parsed;
87
+ }
88
+ }
89
+ }
90
+ return null;
91
+ }
92
+ function buildFromTemplateResult(result, quality) {
93
+ const qualityScore = quality?.overall ?? 50;
94
+ // Combine template score with quality score (70/30 weight)
95
+ const combinedScore = Math.round(result.score * 0.7 + qualityScore * 0.3);
96
+ return {
97
+ valid: result.valido,
98
+ score: combinedScore,
99
+ maturityLevel: scoreToMaturity(combinedScore),
100
+ canAdvance: result.valido || combinedScore >= 70,
101
+ breakdown: {
102
+ structure: result.scoreDetalhado?.estrutura ?? 0,
103
+ content: result.scoreDetalhado?.conteudo ?? 0,
104
+ quality: qualityScore,
105
+ completeness: result.scoreDetalhado?.checkboxes ?? 0,
106
+ },
107
+ passed: result.secoesEncontradas?.map(s => `✅ ${s}`) ?? [],
108
+ failed: result.secoesFaltando?.map(s => `❌ ${s}`) ?? [],
109
+ warnings: result.placeholdersNaoSubstituidos?.map(p => `⚠️ Placeholder: ${p}`) ?? [],
110
+ suggestions: result.sugestoes ?? [],
111
+ method: 'template',
112
+ };
113
+ }
114
+ /**
115
+ * Section-check validation (fallback for PRD and similar documents).
116
+ * Uses the same logic as specialist-phase-handler.ts but exposed as a reusable function.
117
+ */
118
+ function buildFromSectionCheck(content, tier, quality) {
119
+ const sections = splitBySections(content);
120
+ const checks = getSectionChecks();
121
+ const passed = [];
122
+ const failed = [];
123
+ const warnings = [];
124
+ let structureScore = 0;
125
+ let maxStructure = 0;
126
+ for (const check of checks) {
127
+ maxStructure += check.weight;
128
+ const section = sections.find(s => check.heading.test(s.heading));
129
+ const found = !!section;
130
+ const contentLength = section ? section.content.length : 0;
131
+ const hasContent = found && contentLength >= check.minContentLength;
132
+ if (found && hasContent) {
133
+ structureScore += check.weight;
134
+ passed.push(`✅ ${check.label}: Completo (${contentLength} chars)`);
135
+ }
136
+ else if (found) {
137
+ structureScore += Math.floor(check.weight * 0.5);
138
+ warnings.push(`⚠️ ${check.label}: Conteúdo insuficiente (${contentLength}/${check.minContentLength} chars)`);
139
+ }
140
+ else {
141
+ failed.push(`❌ ${check.label}: Seção não encontrada`);
142
+ }
143
+ }
144
+ // Bonus for word count
145
+ const wordCount = content.split(/\s+/).length;
146
+ let bonus = 0;
147
+ if (wordCount > 500)
148
+ bonus += 10;
149
+ if (wordCount > 1000)
150
+ bonus += 5;
151
+ const rawScore = Math.min(Math.round((structureScore / maxStructure) * 85) + bonus, 100);
152
+ const qualityScore = quality?.overall ?? 50;
153
+ const finalScore = Math.round(rawScore * 0.7 + qualityScore * 0.3);
154
+ return {
155
+ valid: finalScore >= 70,
156
+ score: finalScore,
157
+ maturityLevel: scoreToMaturity(finalScore),
158
+ canAdvance: finalScore >= 70,
159
+ breakdown: {
160
+ structure: Math.round((structureScore / maxStructure) * 100),
161
+ content: Math.round(Math.min(wordCount / 5, 100)),
162
+ quality: qualityScore,
163
+ completeness: Math.round((passed.length / checks.length) * 100),
164
+ },
165
+ passed,
166
+ failed,
167
+ warnings,
168
+ suggestions: generateSuggestions(failed, warnings, wordCount),
169
+ method: 'section-check',
170
+ };
171
+ }
172
+ function scoreToMaturity(score) {
173
+ if (score >= 90)
174
+ return 5;
175
+ if (score >= 75)
176
+ return 4;
177
+ if (score >= 60)
178
+ return 3;
179
+ if (score >= 40)
180
+ return 2;
181
+ return 1;
182
+ }
183
+ function getSectionChecks() {
184
+ return [
185
+ { heading: /^\d*\.?\d*\s*(sum[aá]rio|summary|executiv)/i, minContentLength: 100, weight: 10, label: 'Sumário Executivo' },
186
+ { heading: /^\d*\.?\d*\s*(problema|problem|oportunidade|dor)/i, minContentLength: 150, weight: 15, label: 'Problema e Oportunidade' },
187
+ { heading: /^\d*\.?\d*\s*(persona|jobs?\s*to\s*be|p[uú]blico|usu[aá]rio)/i, minContentLength: 100, weight: 15, label: 'Personas e Público-alvo' },
188
+ { heading: /^\d*\.?\d*\s*(mvp|funcionalidade|feature|solu[cç][aã]o)/i, minContentLength: 100, weight: 15, label: 'MVP e Funcionalidades' },
189
+ { heading: /^\d*\.?\d*\s*(m[eé]trica|kpi|north\s*star|sucesso|indicador)/i, minContentLength: 50, weight: 10, label: 'Métricas de Sucesso' },
190
+ { heading: /^\d*\.?\d*\s*(risco|mitiga[cç])/i, minContentLength: 80, weight: 10, label: 'Riscos e Mitigações' },
191
+ { heading: /^\d*\.?\d*\s*(timeline|cronograma|marco|prazo|roadmap)/i, minContentLength: 50, weight: 5, label: 'Timeline e Marcos' },
192
+ { heading: /^\d*\.?\d*\s*(vis[aã]o|estrat[eé]gia|go.to.market|escopo)/i, minContentLength: 50, weight: 5, label: 'Visão e Estratégia' },
193
+ ];
194
+ }
195
+ function splitBySections(content) {
196
+ const lines = content.split('\n');
197
+ const sections = [];
198
+ let currentHeading = '';
199
+ let currentContent = [];
200
+ for (const line of lines) {
201
+ const headingMatch = line.match(/^(#{1,6})\s+(.+)$/);
202
+ if (headingMatch) {
203
+ if (currentHeading) {
204
+ sections.push({ heading: currentHeading, content: currentContent.join('\n').trim() });
205
+ }
206
+ currentHeading = headingMatch[2].trim();
207
+ currentContent = [];
208
+ }
209
+ else {
210
+ currentContent.push(line);
211
+ }
212
+ }
213
+ if (currentHeading) {
214
+ sections.push({ heading: currentHeading, content: currentContent.join('\n').trim() });
215
+ }
216
+ return sections;
217
+ }
218
+ function generateSuggestions(failed, warnings, wordCount) {
219
+ const suggestions = [];
220
+ if (failed.length > 0) {
221
+ suggestions.push(`Adicione as ${failed.length} seção(ões) faltante(s) ao documento`);
222
+ }
223
+ if (warnings.length > 0) {
224
+ suggestions.push(`Expanda o conteúdo de ${warnings.length} seção(ões) com conteúdo insuficiente`);
225
+ }
226
+ if (wordCount < 200) {
227
+ suggestions.push(`Documento muito curto (${wordCount} palavras). Mínimo recomendado: 500`);
228
+ }
229
+ if (wordCount < 500) {
230
+ suggestions.push('Adicione mais detalhes para atingir bônus de completude (+10 pontos)');
231
+ }
232
+ return suggestions;
233
+ }
234
+ //# sourceMappingURL=unified-validator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unified-validator.js","sourceRoot":"","sources":["../../src/gates/unified-validator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,EAAE,qBAAqB,EAAyB,MAAM,yBAAyB,CAAC;AACvF,OAAO,EAAE,aAAa,EAA0B,MAAM,sBAAsB,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAuB,MAAM,qBAAqB,CAAC;AAC7E,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AA+C5B,mCAAmC;AAEnC;;;;;;;GAOG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAA8B;IA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,sCAAsC,CAAC,CAAC;IACzF,CAAC;IACD,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACtB,WAAW,CAAC,IAAI,CAAC,yBAAyB,QAAQ,CAAC,MAAM,uCAAuC,CAAC,CAAC;IACtG,CAAC;IACD,IAAI,SAAS,GAAG,GAAG,EAAE,CAAC;QAClB,WAAW,CAAC,IAAI,CAAC,0BAA0B,SAAS,qCAAqC,CAAC,CAAC;IAC/F,CAAC;IACD,IAAI,SAAS,GAAG,GAAG,EAAE,CAAC;QAClB,WAAW,CAAC,IAAI,CAAC,sEAAsE,CAAC,CAAC;IAC7F,CAAC;IAED,OAAO,WAAW,CAAC;AACvB,CAAC"}
@@ -1,14 +1,17 @@
1
1
  /**
2
- * Specialist Phase Handler (v6.0)
2
+ * Specialist Phase Handler (v6.1)
3
3
  *
4
4
  * Handler central do novo fluxo de onboarding unificado.
5
5
  * Gerencia o ciclo: specialist_active → collecting → generating → validating → approved
6
6
  *
7
- * Resolve:
8
- * - P5: Especialista nunca ativado de verdade
9
- * - P10: IA chama tool errada
10
- * - P11: next_action sem parâmetros necessários
11
- * - P14: Recovery paths claros em caso de erro
7
+ * v6.1 Fixes:
8
+ * - FIX: PRD validation score (was always 15/100 due to regex/escape bug)
9
+ * - FIX: prazo_mvp alias mapping
10
+ * - FIX: Infinite retry loop (max 3 attempts)
11
+ * - FIX: File-based PRD validation (eliminates JSON escape issues)
12
+ * - FIX: Reduced template repetition in context
13
+ * - FIX: Standardized output with AI instruction markers
14
+ * - FIX: Resource loading instructions in output
12
15
  */
13
16
  import type { ToolResult, EstadoProjeto } from "../types/index.js";
14
17
  interface SpecialistPhaseArgs {
@@ -1 +1 @@
1
- {"version":3,"file":"specialist-phase-handler.d.ts","sourceRoot":"","sources":["../../src/handlers/specialist-phase-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAQnE,UAAU,mBAAmB;IACzB,MAAM,EAAE,aAAa,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AA2BD;;;GAGG;AACH,wBAAsB,qBAAqB,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC,UAAU,CAAC,CAyC1F"}
1
+ {"version":3,"file":"specialist-phase-handler.d.ts","sourceRoot":"","sources":["../../src/handlers/specialist-phase-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AA2DnE,UAAU,mBAAmB;IACzB,MAAM,EAAE,aAAa,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AA2BD;;;GAGG;AACH,wBAAsB,qBAAqB,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC,UAAU,CAAC,CA4C1F"}