oxe-cc 1.4.1 → 1.5.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.
Files changed (63) hide show
  1. package/.cursor/commands/oxe-dashboard.md +2 -2
  2. package/.cursor/commands/oxe-execute.md +2 -2
  3. package/.cursor/commands/oxe-plan.md +2 -2
  4. package/.cursor/commands/oxe-verify-audit.md +46 -0
  5. package/.cursor/commands/oxe-workflow-authoring.md +47 -0
  6. package/.github/prompts/oxe-compact.prompt.md +1 -1
  7. package/.github/prompts/oxe-dashboard.prompt.md +2 -2
  8. package/.github/prompts/oxe-execute.prompt.md +2 -2
  9. package/.github/prompts/oxe-plan-agent.prompt.md +1 -0
  10. package/.github/prompts/oxe-plan.prompt.md +2 -2
  11. package/.github/prompts/oxe-verify-audit.prompt.md +46 -0
  12. package/.github/prompts/oxe-workflow-authoring.prompt.md +47 -0
  13. package/.github/workflows/ci.yml +1 -0
  14. package/.github/workflows/release.yml +1 -0
  15. package/AGENTS.md +3 -1
  16. package/CHANGELOG.md +50 -0
  17. package/QUICKSTART.md +99 -0
  18. package/README.md +20 -11
  19. package/bin/lib/oxe-context-engine.cjs +9 -4
  20. package/bin/lib/oxe-dashboard.cjs +119 -53
  21. package/bin/lib/oxe-install-resolve.cjs +10 -0
  22. package/bin/lib/oxe-operational.cjs +34 -28
  23. package/bin/lib/oxe-project-health.cjs +407 -118
  24. package/bin/lib/oxe-rationality.cjs +385 -0
  25. package/bin/lib/oxe-release.cjs +423 -0
  26. package/bin/oxe-cc.js +446 -325
  27. package/commands/oxe/dashboard.md +2 -2
  28. package/commands/oxe/execute.md +2 -2
  29. package/commands/oxe/plan.md +2 -2
  30. package/commands/oxe/verify-audit.md +50 -0
  31. package/commands/oxe/workflow-authoring.md +50 -0
  32. package/docs/INCIDENT-PLAYBOOK.md +181 -0
  33. package/docs/RELEASE-READINESS.md +46 -0
  34. package/docs/ROLES.md +129 -0
  35. package/docs/RUNTIME-SMOKE-MATRIX.md +128 -0
  36. package/docs/TEAM-ADOPTION.md +153 -0
  37. package/docs/WALKTHROUGH.md +241 -0
  38. package/lib/runtime/scheduler/multi-agent-coordinator.d.ts +28 -0
  39. package/lib/runtime/scheduler/multi-agent-coordinator.js +152 -26
  40. package/lib/sdk/README.md +2 -0
  41. package/lib/sdk/index.cjs +32 -14
  42. package/lib/sdk/index.d.ts +138 -40
  43. package/oxe/templates/CONFIG.md +1 -1
  44. package/oxe/templates/EXECUTION-RUNTIME.template.md +1 -1
  45. package/oxe/templates/FIXTURE-PACK.template.json +34 -0
  46. package/oxe/templates/FIXTURE-PACK.template.md +21 -0
  47. package/oxe/templates/IMPLEMENTATION-PACK.template.json +52 -0
  48. package/oxe/templates/IMPLEMENTATION-PACK.template.md +36 -0
  49. package/oxe/templates/PLAN.template.md +46 -37
  50. package/oxe/templates/REFERENCE-ANCHORS.template.md +24 -0
  51. package/oxe/templates/config.template.json +2 -1
  52. package/oxe/workflows/execute.md +36 -20
  53. package/oxe/workflows/next.md +1 -1
  54. package/oxe/workflows/plan.md +80 -22
  55. package/oxe/workflows/references/flow-robustness-contract.md +3 -3
  56. package/oxe/workflows/references/workflow-runtime-contracts.json +127 -95
  57. package/oxe/workflows/verify.md +4 -4
  58. package/package.json +28 -20
  59. package/packages/runtime/package.json +1 -1
  60. package/packages/runtime/src/scheduler/multi-agent-coordinator.ts +357 -193
  61. package/vscode-extension/oxe-agents-1.5.0.vsix +0 -0
  62. package/vscode-extension/oxe-agents-1.5.1.vsix +0 -0
  63. package/vscode-extension/package.json +1 -1
package/bin/oxe-cc.js CHANGED
@@ -24,6 +24,7 @@ const oxeAzure = require(path.join(__dirname, 'lib', 'oxe-azure.cjs'));
24
24
  const oxePlugins = require(path.join(__dirname, 'lib', 'oxe-plugins.cjs'));
25
25
  const oxeContext = require(path.join(__dirname, 'lib', 'oxe-context-engine.cjs'));
26
26
  const oxeRuntimeSemantics = require(path.join(__dirname, 'lib', 'oxe-runtime-semantics.cjs'));
27
+ const oxeRelease = require(path.join(__dirname, 'lib', 'oxe-release.cjs'));
27
28
 
28
29
  /** Merge markers for ~/.copilot/copilot-instructions.md (bloco OXE). */
29
30
  const OXE_INST_BEGIN = '<!-- oxe-cc:install-begin -->';
@@ -247,35 +248,35 @@ function buildInstallSummary(opts, fullLayout) {
247
248
  /**
248
249
  * @param {UninstallOpts} u
249
250
  */
250
- function buildUninstallFooter(u) {
251
- const bullets = [];
252
- const p = u.dryRun ? '[simulação] ' : '';
253
- const rm = u.dryRun ? 'Seriam removidos' : 'Removidos';
254
- const granularAgents = [
255
- u.agentOpenCode ? 'OpenCode' : null,
256
- u.agentGemini ? 'Gemini' : null,
257
- u.agentCodex ? 'Codex' : null,
258
- u.agentWindsurf ? 'Windsurf' : null,
259
- u.agentAntigravity ? 'Antigravity' : null,
260
- ].filter(Boolean);
261
- if (u.cursor) bullets.push(`${p}${rm} artefatos OXE em ~/.cursor (comandos e regras).`);
262
- if (u.copilot) {
263
- bullets.push(`${p}${rm} prompt files OXE em .github/prompts/ e o bloco OXE em .github/copilot-instructions.md.`);
264
- }
251
+ function buildUninstallFooter(u) {
252
+ const bullets = [];
253
+ const p = u.dryRun ? '[simulação] ' : '';
254
+ const rm = u.dryRun ? 'Seriam removidos' : 'Removidos';
255
+ const granularAgents = [
256
+ u.agentOpenCode ? 'OpenCode' : null,
257
+ u.agentGemini ? 'Gemini' : null,
258
+ u.agentCodex ? 'Codex' : null,
259
+ u.agentWindsurf ? 'Windsurf' : null,
260
+ u.agentAntigravity ? 'Antigravity' : null,
261
+ ].filter(Boolean);
262
+ if (u.cursor) bullets.push(`${p}${rm} artefatos OXE em ~/.cursor (comandos e regras).`);
263
+ if (u.copilot) {
264
+ bullets.push(`${p}${rm} prompt files OXE em .github/prompts/ e o bloco OXE em .github/copilot-instructions.md.`);
265
+ }
265
266
  if (u.copilotLegacyClean) {
266
267
  bullets.push(`${p}${rm} apenas o legado global do Copilot VS Code em ~/.copilot/ (prompts oxe-* e bloco OXE global).`);
267
268
  }
268
- if (u.copilotCli) {
269
- bullets.push(`${p}${rm} comandos oxe/oxe-* em ~/.claude/commands e ~/.copilot/commands.`);
270
- bullets.push(`${p}${rm} skills OXE (marcadas oxe-cc) em ~/.copilot/skills/oxe*/.`);
271
- }
272
- if (u.allAgents) {
273
- bullets.push(
274
- `${p}${rm} extensões multi-agente marcadas oxe-cc (OpenCode, Gemini TOML, Windsurf workflows, Codex prompts/skills, Antigravity), se existirem.`
275
- );
276
- } else if (granularAgents.length) {
277
- bullets.push(`${p}${rm} apenas as integrações selecionadas: ${granularAgents.join(', ')}.`);
278
- }
269
+ if (u.copilotCli) {
270
+ bullets.push(`${p}${rm} comandos oxe/oxe-* em ~/.claude/commands e ~/.copilot/commands.`);
271
+ bullets.push(`${p}${rm} skills OXE (marcadas oxe-cc) em ~/.copilot/skills/oxe*/.`);
272
+ }
273
+ if (u.allAgents) {
274
+ bullets.push(
275
+ `${p}${rm} extensões multi-agente marcadas oxe-cc (OpenCode, Gemini TOML, Windsurf workflows, Codex prompts/skills, Antigravity), se existirem.`
276
+ );
277
+ } else if (granularAgents.length) {
278
+ bullets.push(`${p}${rm} apenas as integrações selecionadas: ${granularAgents.join(', ')}.`);
279
+ }
279
280
  if (u.ideLocal) {
280
281
  bullets.push(
281
282
  `${p}${rm} integrações OXE no repositório (.cursor, .github, .claude, .copilot, .opencode, … conforme flags).`
@@ -296,29 +297,29 @@ function buildUninstallFooter(u) {
296
297
  return { bullets, nextSteps, dryRun: u.dryRun };
297
298
  }
298
299
 
299
- /** @typedef {{ help: boolean, version: boolean, cursor: boolean, copilot: boolean, copilotCli: boolean, allAgents: boolean, agentOpenCode: boolean, agentGemini: boolean, agentCodex: boolean, agentWindsurf: boolean, agentAntigravity: boolean, vscode: boolean, commands: boolean, agents: boolean, force: boolean, dryRun: boolean, dir: string, all: boolean, noInitOxe: boolean, oxeOnly: boolean, globalCli: boolean, noGlobalCli: boolean, installAssetsGlobal: boolean, explicitScope: boolean, integrationsUnset: boolean, ideLocal: boolean, explicitIdeScope: boolean, explicitConfigDir: string | null, parseError: boolean, unknownFlag: string, conflictFlags: string, ignoreInstallConfig: boolean }} InstallOpts */
300
-
301
- /** @param {InstallOpts} o */
302
- function anyGranularAgent(o) {
303
- return !!(o.agentOpenCode || o.agentGemini || o.agentCodex || o.agentWindsurf || o.agentAntigravity);
304
- }
305
-
306
- /** @param {UninstallOpts} o */
307
- function anyGranularUninstallAgent(o) {
308
- return !!(o.agentOpenCode || o.agentGemini || o.agentCodex || o.agentWindsurf || o.agentAntigravity);
309
- }
310
-
311
- /** @param {UninstallOpts} u */
312
- function buildAgentCleanupTargets(u) {
313
- if (u.allAgents || !anyGranularUninstallAgent(u)) return null;
314
- return {
315
- opencode: Boolean(u.agentOpenCode),
316
- gemini: Boolean(u.agentGemini),
317
- windsurf: Boolean(u.agentWindsurf),
318
- codex: Boolean(u.agentCodex),
319
- antigravity: Boolean(u.agentAntigravity),
320
- };
321
- }
300
+ /** @typedef {{ help: boolean, version: boolean, cursor: boolean, copilot: boolean, copilotCli: boolean, allAgents: boolean, agentOpenCode: boolean, agentGemini: boolean, agentCodex: boolean, agentWindsurf: boolean, agentAntigravity: boolean, vscode: boolean, commands: boolean, agents: boolean, force: boolean, dryRun: boolean, dir: string, all: boolean, noInitOxe: boolean, oxeOnly: boolean, globalCli: boolean, noGlobalCli: boolean, installAssetsGlobal: boolean, explicitScope: boolean, integrationsUnset: boolean, ideLocal: boolean, explicitIdeScope: boolean, explicitConfigDir: string | null, parseError: boolean, unknownFlag: string, conflictFlags: string, ignoreInstallConfig: boolean, releaseDoctor: boolean, writeManifest: boolean }} InstallOpts */
301
+
302
+ /** @param {InstallOpts} o */
303
+ function anyGranularAgent(o) {
304
+ return !!(o.agentOpenCode || o.agentGemini || o.agentCodex || o.agentWindsurf || o.agentAntigravity);
305
+ }
306
+
307
+ /** @param {UninstallOpts} o */
308
+ function anyGranularUninstallAgent(o) {
309
+ return !!(o.agentOpenCode || o.agentGemini || o.agentCodex || o.agentWindsurf || o.agentAntigravity);
310
+ }
311
+
312
+ /** @param {UninstallOpts} u */
313
+ function buildAgentCleanupTargets(u) {
314
+ if (u.allAgents || !anyGranularUninstallAgent(u)) return null;
315
+ return {
316
+ opencode: Boolean(u.agentOpenCode),
317
+ gemini: Boolean(u.agentGemini),
318
+ windsurf: Boolean(u.agentWindsurf),
319
+ codex: Boolean(u.agentCodex),
320
+ antigravity: Boolean(u.agentAntigravity),
321
+ };
322
+ }
322
323
 
323
324
  /** @param {InstallOpts} o */
324
325
  function anyIdeIntegration(o) {
@@ -364,6 +365,8 @@ function parseInstallArgs(argv) {
364
365
  unknownFlag: '',
365
366
  conflictFlags: '',
366
367
  ignoreInstallConfig: false,
368
+ releaseDoctor: false,
369
+ writeManifest: false,
367
370
  /** Saída JSON em `status` (CI / agentes). */
368
371
  jsonOutput: false,
369
372
  /** Lembretes agregados scan/compact em `status`. */
@@ -415,6 +418,8 @@ function parseInstallArgs(argv) {
415
418
  } else if (a === '--json') out.jsonOutput = true;
416
419
  else if (a === '--hints') out.statusHints = true;
417
420
  else if (a === '--full') out.statusFull = true;
421
+ else if (a === '--release') out.releaseDoctor = true;
422
+ else if (a === '--write-manifest') out.writeManifest = true;
418
423
  else if (!a.startsWith('-')) out.restPositional.push(a);
419
424
  else {
420
425
  out.parseError = true;
@@ -457,6 +462,14 @@ function parseInstallArgs(argv) {
457
462
  out.agentWindsurf = true;
458
463
  out.agentAntigravity = true;
459
464
  }
465
+ if (!out.conflictFlags && out.oxeOnly) {
466
+ const IDE_FLAGS = ['--cursor', '--copilot', '--copilot-vscode', '--copilot-cli', '--all-agents',
467
+ '--opencode', '--gemini', '--codex', '--windsurf', '--antigravity', '--vscode'];
468
+ const conflicting = IDE_FLAGS.filter((f) => argv.includes(f));
469
+ if (conflicting.length > 0) {
470
+ out.conflictFlags = `--oxe-only não combina com flags de IDE (${conflicting.join(', ')})`;
471
+ }
472
+ }
460
473
  if (out.oxeOnly) {
461
474
  out.cursor = false;
462
475
  out.copilot = false;
@@ -777,7 +790,11 @@ function writeCopilotVsCodeManifest(opts, info) {
777
790
  const promptFiles = fs.existsSync(promptsDir)
778
791
  ? fs
779
792
  .readdirSync(promptsDir, { withFileTypes: true })
780
- .filter((entry) => entry.isFile() && /^oxe-.*\.prompt\.md$/i.test(entry.name))
793
+ .filter(
794
+ (entry) =>
795
+ entry.isFile() &&
796
+ (entry.name === 'oxe.prompt.md' || /^oxe-.*\.prompt\.md$/i.test(entry.name))
797
+ )
781
798
  .map((entry) => entry.name)
782
799
  .sort()
783
800
  : [];
@@ -1038,6 +1055,27 @@ async function promptInstallScope(opts) {
1038
1055
  }
1039
1056
  }
1040
1057
 
1058
+ /**
1059
+ * Grava a escolha resolvida de ide_scope de volta em .oxe/config.json para que
1060
+ * futuras reinstalações/updates não precisem perguntar novamente.
1061
+ * @param {InstallOpts} opts
1062
+ */
1063
+ function persistIdeScope(opts) {
1064
+ if (opts.dryRun || opts.oxeOnly) return;
1065
+ const configPath = path.join(opts.dir, '.oxe', 'config.json');
1066
+ if (!fs.existsSync(configPath)) return;
1067
+ try {
1068
+ const cfg = JSON.parse(fs.readFileSync(configPath, 'utf8'));
1069
+ const scope = opts.ideLocal ? 'local' : 'global';
1070
+ if (!cfg.install || typeof cfg.install !== 'object') cfg.install = {};
1071
+ if (cfg.install.ide_scope === scope) return;
1072
+ cfg.install.ide_scope = scope;
1073
+ fs.writeFileSync(configPath, JSON.stringify(cfg, null, 2) + '\n', 'utf8');
1074
+ } catch {
1075
+ /* silêncio — não bloquear instalação por falha ao persistir config */
1076
+ }
1077
+ }
1078
+
1041
1079
  /** @param {InstallOpts} opts */
1042
1080
  async function resolveInteractiveInstall(opts) {
1043
1081
  if (!opts.ignoreInstallConfig) {
@@ -1280,7 +1318,13 @@ function bootstrapOxe(target, opts) {
1280
1318
 
1281
1319
  if (fs.existsSync(configSrc)) {
1282
1320
  if (!fs.existsSync(configDest) || opts.force) {
1283
- copyFile(configSrc, configDest, { dryRun: false });
1321
+ try {
1322
+ const cfgRaw = JSON.parse(fs.readFileSync(configSrc, 'utf8'));
1323
+ delete cfgRaw._comment;
1324
+ fs.writeFileSync(configDest, JSON.stringify(cfgRaw, null, 2) + '\n', 'utf8');
1325
+ } catch {
1326
+ copyFile(configSrc, configDest, { dryRun: false });
1327
+ }
1284
1328
  console.log(`${green}init${reset} ${configDest}`);
1285
1329
  } else {
1286
1330
  console.log(`${dim}omitido${reset} ${configDest} (já existe — use --force para substituir)`);
@@ -1483,15 +1527,20 @@ function printOxeHealthDiagnostics(target, c, diagOpts = {}) {
1483
1527
  if (r.eventsSummary) {
1484
1528
  console.log(` ${c ? dim : ''}Tracing:${c ? reset : ''} ${r.eventsSummary.total} evento(s)`);
1485
1529
  }
1486
- if (r.planSelfEvaluation && r.planSelfEvaluation.hasSection) {
1487
- const best = r.planSelfEvaluation.bestPlan || '—';
1488
- const conf =
1489
- typeof r.planSelfEvaluation.confidence === 'number' ? `${r.planSelfEvaluation.confidence}%` : '—';
1490
- console.log(` ${c ? dim : ''}Plano (autoavaliação):${c ? reset : ''} melhor=${best} | confiança=${conf}`);
1491
- }
1492
- if (r.contextQuality) {
1493
- console.log(
1494
- ` ${c ? dim : ''}Contexto:${c ? reset : ''} score=${r.contextQuality.primaryScore != null ? r.contextQuality.primaryScore : ''} | workflow=${r.contextQuality.primaryWorkflow || ''} | status=${r.contextQuality.primaryStatus || ''}`
1530
+ if (r.planSelfEvaluation && r.planSelfEvaluation.hasSection) {
1531
+ const best = r.planSelfEvaluation.bestPlan || '—';
1532
+ const conf =
1533
+ typeof r.planSelfEvaluation.confidence === 'number' ? `${r.planSelfEvaluation.confidence}%` : '—';
1534
+ console.log(` ${c ? dim : ''}Plano (autoavaliação):${c ? reset : ''} melhor=${best} | confiança=${conf}`);
1535
+ }
1536
+ if (typeof r.executionRationalityReady === 'boolean') {
1537
+ console.log(
1538
+ ` ${c ? dim : ''}Prontidão racional:${c ? reset : ''} implementation=${r.implementationPackReady ? 'ok' : 'pendente'} | anchors=${r.referenceAnchorsReady ? 'ok' : 'pendente'} | fixtures=${r.fixturePackReady ? 'ok' : 'pendente'}`
1539
+ );
1540
+ }
1541
+ if (r.contextQuality) {
1542
+ console.log(
1543
+ ` ${c ? dim : ''}Contexto:${c ? reset : ''} score=${r.contextQuality.primaryScore != null ? r.contextQuality.primaryScore : '—'} | workflow=${r.contextQuality.primaryWorkflow || '—'} | status=${r.contextQuality.primaryStatus || '—'}`
1495
1544
  );
1496
1545
  }
1497
1546
  if (r.semanticsDrift) {
@@ -1652,17 +1701,24 @@ function runStatusFull(target) {
1652
1701
  console.log(` ${coverageCell(codebaseExists, 'codebase scan')} ${coverageCell(specExists, 'SPEC.md')} ${coverageCell(planExists, 'PLAN.md')} ${coverageCell(verifyExists, 'VERIFY.md')} ${coverageCell(lessonsExists, 'LESSONS.md')}`);
1653
1702
 
1654
1703
  // Readiness gate
1655
- const ready = specExists && planExists && !report.planWarn.length && !report.runtimeWarn.length;
1704
+ const ready = specExists
1705
+ && planExists
1706
+ && report.executionRationalityReady
1707
+ && !report.planWarn.length
1708
+ && !report.runtimeWarn.length;
1656
1709
  const gateColor = ready ? green : yellow;
1657
1710
  console.log(`\n ${c ? yellow : ''}Readiness gate${c ? reset : ''}`);
1658
1711
  console.log(` ${c ? gateColor : ''}${ready ? '✓ Pronto para executar' : '✗ Não pronto para executar'}${c ? reset : ''}`);
1659
1712
  if (!specExists) console.log(` ${c ? dim : ''} • SPEC.md ausente — rode /oxe-spec${c ? reset : ''}`);
1660
1713
  if (!planExists) console.log(` ${c ? dim : ''} • PLAN.md ausente — rode /oxe-plan${c ? reset : ''}`);
1661
- if (report.planWarn.length) {
1662
- for (const w of report.planWarn) {
1663
- console.log(` ${c ? yellow : ''} • ${w}${c ? reset : ''}`);
1664
- }
1665
- }
1714
+ if (report.planWarn.length) {
1715
+ for (const w of report.planWarn) {
1716
+ console.log(` ${c ? yellow : ''} • ${w}${c ? reset : ''}`);
1717
+ }
1718
+ }
1719
+ if (planExists) {
1720
+ console.log(` ${c ? dim : ''} • Artefatos racionais:${c ? reset : ''} implementation=${report.implementationPackReady ? 'ok' : 'pendente'} · anchors=${report.referenceAnchorsReady ? 'ok' : 'pendente'} · fixtures=${report.fixturePackReady ? 'ok' : 'pendente'}`);
1721
+ }
1666
1722
 
1667
1723
  // Active run summary
1668
1724
  if (report.activeRun) {
@@ -1748,18 +1804,24 @@ function runStatusFull(target) {
1748
1804
  }
1749
1805
 
1750
1806
  // Plan self-evaluation
1751
- if (report.planSelfEvaluation) {
1752
- const pse = report.planSelfEvaluation;
1753
- console.log(`\n ${c ? yellow : ''}Autoavaliação do plano${c ? reset : ''}`);
1754
- if (pse.best_plan_current != null) {
1755
- const bestColor = pse.best_plan_current ? green : red;
1756
- console.log(` ${c ? dim : ''}Melhor plano atual:${c ? reset : ''} ${c ? bestColor : ''}${pse.best_plan_current ? 'sim' : 'não'}${c ? reset : ''}`);
1757
- }
1758
- if (pse.confidence != null) {
1759
- const confColor = Number(pse.confidence) >= 70 ? green : Number(pse.confidence) >= 50 ? yellow : red;
1760
- console.log(` ${c ? dim : ''}Confiança:${c ? reset : ''} ${c ? confColor : ''}${pse.confidence}%${c ? reset : ''}`);
1761
- }
1762
- }
1807
+ if (report.planSelfEvaluation) {
1808
+ const pse = report.planSelfEvaluation;
1809
+ const threshold = report.planConfidenceThreshold || 90;
1810
+ console.log(`\n ${c ? yellow : ''}Autoavaliação do plano${c ? reset : ''}`);
1811
+ if (pse.best_plan_current != null) {
1812
+ const bestColor = pse.best_plan_current ? green : red;
1813
+ console.log(` ${c ? dim : ''}Melhor plano atual:${c ? reset : ''} ${c ? bestColor : ''}${pse.best_plan_current ? 'sim' : 'não'}${c ? reset : ''}`);
1814
+ }
1815
+ if (pse.confidence != null) {
1816
+ const confColor = report.planConfidenceExecutable
1817
+ ? green
1818
+ : Number(pse.confidence) >= Math.max(80, threshold - 10)
1819
+ ? yellow
1820
+ : red;
1821
+ console.log(` ${c ? dim : ''}Confiança:${c ? reset : ''} ${c ? confColor : ''}${pse.confidence}%${c ? reset : ''}`);
1822
+ console.log(` ${c ? dim : ''}Gate executável:${c ? reset : ''} > ${threshold}%${pse.executable ? ' (atingido)' : ' (ainda não atingido)'}`);
1823
+ }
1824
+ }
1763
1825
 
1764
1826
  console.log(`\n ${c ? dim : ''}Próximo passo:${c ? reset : ''} ${c ? cyan : ''}${report.next && report.next.cursorCmd ? report.next.cursorCmd : '—'}${c ? reset : ''}`);
1765
1827
  console.log(` ${c ? dim : ''}Motivo:${c ? reset : ''} ${report.next && report.next.reason ? report.next.reason : '—'}`);
@@ -1791,10 +1853,18 @@ function runStatus(target, opts = {}) {
1791
1853
  activeSession: report.activeSession,
1792
1854
  scanDate: report.scanDate,
1793
1855
  staleScan: report.stale,
1794
- compactDate: report.compactDate,
1795
- staleCompact: report.staleCompact,
1796
- planSelfEvaluation: report.planSelfEvaluation,
1797
- planReviewStatus: report.planReviewStatus,
1856
+ compactDate: report.compactDate,
1857
+ staleCompact: report.staleCompact,
1858
+ planSelfEvaluation: report.planSelfEvaluation,
1859
+ planConfidenceThreshold: report.planConfidenceThreshold,
1860
+ planConfidenceExecutable: report.planConfidenceExecutable,
1861
+ implementationPackReady: report.implementationPackReady,
1862
+ referenceAnchorsReady: report.referenceAnchorsReady,
1863
+ fixturePackReady: report.fixturePackReady,
1864
+ executionRationalityReady: report.executionRationalityReady,
1865
+ criticalExecutionGaps: report.criticalExecutionGaps,
1866
+ executionRationality: report.executionRationality,
1867
+ planReviewStatus: report.planReviewStatus,
1798
1868
  activeRun: report.activeRun,
1799
1869
  eventsSummary: report.eventsSummary,
1800
1870
  runtimeMode: report.runtimeMode,
@@ -1926,7 +1996,46 @@ function runStatus(target, opts = {}) {
1926
1996
  }
1927
1997
 
1928
1998
  /** @param {string} target */
1929
- function runDoctor(target) {
1999
+ function runDoctor(target, options = {}) {
2000
+ if (options.release) {
2001
+ if (!options.json) printSection('OXE ▸ doctor --release');
2002
+ const c = useAnsiColors();
2003
+ const result = oxeRelease.checkReleaseConsistency(target, {
2004
+ packageRoot: PKG_ROOT,
2005
+ writeManifest: Boolean(options.writeManifest),
2006
+ });
2007
+ if (options.json) {
2008
+ console.log(
2009
+ JSON.stringify(
2010
+ {
2011
+ status: result.ok ? 'ok' : 'blocked',
2012
+ blockers: result.blockers,
2013
+ warnings: result.warnings,
2014
+ manifestPath: result.manifestPath,
2015
+ manifest: result.manifest,
2016
+ },
2017
+ null,
2018
+ 2
2019
+ )
2020
+ );
2021
+ } else {
2022
+ console.log(` ${c ? green : ''}Projeto:${c ? reset : ''} ${c ? cyan : ''}${target}${c ? reset : ''}`);
2023
+ console.log(` ${c ? green : ''}Versão alvo:${c ? reset : ''} ${result.manifest.versions.rootPackage.version || '—'}`);
2024
+ console.log(` ${c ? green : ''}Manifest:${c ? reset : ''} ${result.manifestPath}`);
2025
+ if (result.ok) {
2026
+ console.log(` ${c ? green : ''}✓${c ? reset : ''} release readiness OK`);
2027
+ } else {
2028
+ console.log(` ${c ? red : ''}✗${c ? reset : ''} release readiness bloqueada`);
2029
+ for (const blocker of result.blockers) {
2030
+ console.log(` - ${blocker}`);
2031
+ }
2032
+ }
2033
+ for (const warning of result.warnings) {
2034
+ console.log(` ${c ? yellow : ''}!${c ? reset : ''} ${warning}`);
2035
+ }
2036
+ }
2037
+ process.exit(result.ok ? 0 : 1);
2038
+ }
1930
2039
  printSection('OXE ▸ doctor');
1931
2040
  const v = process.versions.node;
1932
2041
  const major = parseInt(v.split('.')[0], 10);
@@ -2147,6 +2256,12 @@ function installGlobalCliPackage() {
2147
2256
  shell: true,
2148
2257
  env: process.env,
2149
2258
  });
2259
+ if (r.error) {
2260
+ console.log(
2261
+ `\n ${c ? yellow : ''}⚠${c ? reset : ''} npm install -g falhou (${r.error.message}). Tente manualmente: ${c ? cyan : ''}npm install -g ${spec}${c ? reset : ''}\n`
2262
+ );
2263
+ return false;
2264
+ }
2150
2265
  if (r.status === 0) {
2151
2266
  console.log(
2152
2267
  `\n ${c ? green : ''}✓${c ? reset : ''} ${c ? cyan : ''}oxe-cc${c ? reset : ''} disponível globalmente (execute ${c ? cyan : ''}oxe-cc --help${c ? reset : ''} em qualquer pasta).\n`
@@ -2328,34 +2443,39 @@ function usage() {
2328
2443
  console.log(`
2329
2444
  ${cyan}oxe-cc${reset} — instala workflows OXE (núcleo .oxe/ + integrações: Cursor, Copilot, Claude, OpenCode, Gemini, Codex, Windsurf, Antigravity, …)
2330
2445
 
2331
- ${green}Uso:${reset}
2332
- npx oxe-cc@latest [opções] [pasta-do-projeto]
2333
- npx oxe-cc@latest install [opções] [pasta-do-projeto] ${dim}(equivalente à instalação predefinida)${reset}
2334
- npx oxe-cc@latest --dir /caminho/do/projeto
2335
- npx oxe-cc doctor [opções] [pasta-do-projeto]
2336
- npx oxe-cc status [opções] [pasta-do-projeto]
2337
- npx oxe-cc init-oxe [opções] [pasta-do-projeto]
2338
- npx oxe-cc context <build|inspect> [opções] [pasta-do-projeto]
2339
- npx oxe-cc dashboard [opções] [pasta-do-projeto]
2340
- npx oxe-cc runtime <status|start|pause|resume|replay|compile|verify|project|ci|promote|recover|gates> [opções] [pasta-do-projeto]
2341
- npx oxe-cc azure <status|doctor|auth|sync|find|servicebus|eventgrid|sql|operations> [opções] [pasta-do-projeto]
2342
- npx oxe-cc capabilities <list|install|remove|update> [opções] [id]
2343
- npx oxe-cc uninstall [opções] [pasta-do-projeto]
2344
- npx oxe-cc update [opções] [argumentos extras…]
2345
-
2346
- ${green}uninstall${reset} (remove OXE da pasta do usuário + pastas de workflows no repo)
2347
- --cursor / --copilot / --copilot-cli só essa integração (omissão = todas)
2348
- --copilot-vscode alias explícito de --copilot
2349
- --copilot-legacy-clean limpa o legado antigo do Copilot VS Code em ~/.copilot/
2350
- --all-agents também remove ficheiros multi-plataforma (com --copilot-cli implícito)
2351
- --opencode / --gemini / --codex / --windsurf / --antigravity
2352
- removeesse agente multi-runtime
2353
- --ide-local remove integrações IDE neste repositório (.cursor, .github, .claude, .copilot, …)
2354
- --ide-only não apagar .oxe/workflows, oxe/, etc. no projeto
2355
- --global-cli, -g também executa npm uninstall -g oxe-cc
2356
- --config-dir <caminho> com exatamente uma flag IDE acima (não combina com --ide-local, --copilot nem agentes granulares)
2357
- --dry-run
2358
- --dir <pasta> raiz do projeto (padrão: diretório atual)
2446
+ ${green}Uso:${reset}
2447
+ npx oxe-cc@latest [opções] [pasta-do-projeto]
2448
+ npx oxe-cc@latest install [opções] [pasta-do-projeto] ${dim}(equivalente à instalação predefinida)${reset}
2449
+ npx oxe-cc@latest --dir /caminho/do/projeto
2450
+ npx oxe-cc doctor [--release] [--write-manifest] [opções] [pasta-do-projeto]
2451
+ npx oxe-cc status [opções] [pasta-do-projeto]
2452
+ npx oxe-cc init-oxe [opções] [pasta-do-projeto]
2453
+ npx oxe-cc context <build|inspect> [opções] [pasta-do-projeto]
2454
+ npx oxe-cc dashboard [opções] [pasta-do-projeto]
2455
+ npx oxe-cc runtime <status|start|pause|resume|replay|compile|verify|project|ci|promote|recover|gates|agents> [opções] [pasta-do-projeto]
2456
+ npx oxe-cc azure <status|doctor|auth|sync|find|servicebus|eventgrid|sql|operations> [opções] [pasta-do-projeto]
2457
+ npx oxe-cc capabilities <list|install|remove|update> [opções] [id]
2458
+ npx oxe-cc uninstall [opções] [pasta-do-projeto]
2459
+ npx oxe-cc update [opções] [argumentos extras…]
2460
+
2461
+ ${green}doctor${reset}
2462
+ --release valida release readiness: versões, changelog, wrappers, runtime build e relatórios obrigatórios
2463
+ --write-manifest persiste .oxe/release/release-manifest.json durante doctor --release
2464
+ --json saída estruturada para CI
2465
+
2466
+ ${green}uninstall${reset} (remove OXE da pasta do usuário + pastas de workflows no repo)
2467
+ --cursor / --copilot / --copilot-cli essa integração (omissão = todas)
2468
+ --copilot-vscode alias explícito de --copilot
2469
+ --copilot-legacy-clean limpa o legado antigo do Copilot VS Code em ~/.copilot/
2470
+ --all-agents também remove ficheiros multi-plataforma (com --copilot-cli implícito)
2471
+ --opencode / --gemini / --codex / --windsurf / --antigravity
2472
+ remove só esse agente multi-runtime
2473
+ --ide-local remove integrações IDE neste repositório (.cursor, .github, .claude, .copilot, …)
2474
+ --ide-only não apagar .oxe/workflows, oxe/, etc. no projeto
2475
+ --global-cli, -g também executa npm uninstall -g oxe-cc
2476
+ --config-dir <caminho> com exatamente uma flag IDE acima (não combina com --ide-local, --copilot nem agentes granulares)
2477
+ --dry-run
2478
+ --dir <pasta> raiz do projeto (padrão: diretório atual)
2359
2479
 
2360
2480
  ${green}update${reset} (executa npx oxe-cc@latest --force na pasta do projeto)
2361
2481
  --check só consulta npm: compara versão em execução com latest (saída 0=ok, 1=há mais nova, 2=erro; incompatível com --dry-run)
@@ -2748,11 +2868,11 @@ function runInstall(opts) {
2748
2868
  addTracked(copilotPromptsDirPath(opts), (n) => n.startsWith('oxe-'));
2749
2869
  trackFile(copilotWorkspaceManifestPath(opts));
2750
2870
  }
2751
- trackFile(runtimeSemanticsManifestPath(opts));
2752
- if (opts.copilotCli || opts.allAgents) {
2753
- addTracked(path.join(installClaudeBase(opts), 'commands'), (n) => oxeAgentInstall.isOxeCommandMarkdownName(n));
2754
- addTracked(path.join(cpCliHome, 'commands'), (n) => oxeAgentInstall.isOxeCommandMarkdownName(n));
2755
- const skRoot = path.join(cpCliHome, 'skills');
2871
+ trackFile(runtimeSemanticsManifestPath(opts));
2872
+ if (opts.copilotCli || opts.allAgents) {
2873
+ addTracked(path.join(installClaudeBase(opts), 'commands'), (n) => oxeAgentInstall.isOxeCommandMarkdownName(n));
2874
+ addTracked(path.join(cpCliHome, 'commands'), (n) => oxeAgentInstall.isOxeCommandMarkdownName(n));
2875
+ const skRoot = path.join(cpCliHome, 'skills');
2756
2876
  if (fs.existsSync(skRoot)) {
2757
2877
  for (const sub of fs.readdirSync(skRoot, { withFileTypes: true })) {
2758
2878
  if (!sub.isDirectory() || !/^oxe($|-)/.test(sub.name)) continue;
@@ -2767,11 +2887,11 @@ function runInstall(opts) {
2767
2887
  }
2768
2888
  }
2769
2889
  }
2770
- if (opts.agentOpenCode || opts.allAgents) {
2771
- for (const d of agentPaths.opencodeCommandDirs) {
2772
- addTracked(d, (n) => oxeAgentInstall.isOxeCommandMarkdownName(n));
2773
- }
2774
- }
2890
+ if (opts.agentOpenCode || opts.allAgents) {
2891
+ for (const d of agentPaths.opencodeCommandDirs) {
2892
+ addTracked(d, (n) => oxeAgentInstall.isOxeCommandMarkdownName(n));
2893
+ }
2894
+ }
2775
2895
  if (opts.agentGemini || opts.allAgents) {
2776
2896
  const gCmd = agentPaths.geminiCommandsBase;
2777
2897
  trackFile(path.join(gCmd, 'oxe.toml'));
@@ -2785,12 +2905,12 @@ function runInstall(opts) {
2785
2905
  if (opts.agentWindsurf || opts.allAgents) {
2786
2906
  addTracked(agentPaths.windsurfWorkflowsDir, (n) => n === 'oxe.md' || (n.startsWith('oxe-') && n.endsWith('.md')));
2787
2907
  }
2788
- if (opts.agentCodex || opts.allAgents) {
2789
- const cxPrompts = agentPaths.codexPromptsDir;
2790
- if (fs.existsSync(cxPrompts)) {
2791
- addTracked(cxPrompts, (n) => oxeAgentInstall.isOxeCommandMarkdownName(n));
2792
- }
2793
- }
2908
+ if (opts.agentCodex || opts.allAgents) {
2909
+ const cxPrompts = agentPaths.codexPromptsDir;
2910
+ if (fs.existsSync(cxPrompts)) {
2911
+ addTracked(cxPrompts, (n) => oxeAgentInstall.isOxeCommandMarkdownName(n));
2912
+ }
2913
+ }
2794
2914
  if (opts.agentAntigravity || opts.allAgents) {
2795
2915
  const root = agentPaths.antigravitySkillsRoot;
2796
2916
  if (fs.existsSync(root)) {
@@ -2833,26 +2953,26 @@ function runInstall(opts) {
2833
2953
  console.log(` ${c ? green : ''}✓${c ? reset : ''} Instalação concluída com sucesso.\n`);
2834
2954
  }
2835
2955
 
2836
- /** @typedef {{ help: boolean, dryRun: boolean, cursor: boolean, copilot: boolean, copilotCli: boolean, allAgents: boolean, agentOpenCode: boolean, agentGemini: boolean, agentCodex: boolean, agentWindsurf: boolean, agentAntigravity: boolean, globalCli: boolean, ideLocal: boolean, ideExplicit: boolean, noProject: boolean, copilotLegacyClean: boolean, dir: string, explicitConfigDir: string | null, parseError: boolean, unknownFlag: string, conflictFlags: string }} UninstallOpts */
2956
+ /** @typedef {{ help: boolean, dryRun: boolean, cursor: boolean, copilot: boolean, copilotCli: boolean, allAgents: boolean, agentOpenCode: boolean, agentGemini: boolean, agentCodex: boolean, agentWindsurf: boolean, agentAntigravity: boolean, globalCli: boolean, ideLocal: boolean, ideExplicit: boolean, noProject: boolean, copilotLegacyClean: boolean, dir: string, explicitConfigDir: string | null, parseError: boolean, unknownFlag: string, conflictFlags: string }} UninstallOpts */
2837
2957
 
2838
2958
  /**
2839
2959
  * @param {UninstallOpts} u
2840
2960
  * @param {string[]} removedPaths
2841
2961
  */
2842
- function uninstallLocalIdeFromProject(u, removedPaths) {
2843
- const proj = path.resolve(u.dir);
2844
- const track = (p) => {
2845
- if (removedPaths.indexOf(p) === -1) removedPaths.push(p);
2846
- };
2847
-
2848
- if (u.cursor) {
2849
- const cmdDir = path.join(proj, '.cursor', 'commands');
2850
- if (fs.existsSync(cmdDir)) {
2851
- for (const name of fs.readdirSync(cmdDir)) {
2852
- if (oxeAgentInstall.isOxeCommandMarkdownName(name)) {
2853
- const p = path.join(cmdDir, name);
2854
- unlinkQuiet(p, u);
2855
- track(p);
2962
+ function uninstallLocalIdeFromProject(u, removedPaths) {
2963
+ const proj = path.resolve(u.dir);
2964
+ const track = (p) => {
2965
+ if (removedPaths.indexOf(p) === -1) removedPaths.push(p);
2966
+ };
2967
+
2968
+ if (u.cursor) {
2969
+ const cmdDir = path.join(proj, '.cursor', 'commands');
2970
+ if (fs.existsSync(cmdDir)) {
2971
+ for (const name of fs.readdirSync(cmdDir)) {
2972
+ if (oxeAgentInstall.isOxeCommandMarkdownName(name)) {
2973
+ const p = path.join(cmdDir, name);
2974
+ unlinkQuiet(p, u);
2975
+ track(p);
2856
2976
  }
2857
2977
  }
2858
2978
  }
@@ -2875,7 +2995,7 @@ function uninstallLocalIdeFromProject(u, removedPaths) {
2875
2995
  const pr = path.join(proj, '.github', 'prompts');
2876
2996
  if (fs.existsSync(pr)) {
2877
2997
  for (const name of fs.readdirSync(pr)) {
2878
- if (/^oxe-.*\.prompt\.md$/i.test(name)) {
2998
+ if (name === 'oxe.prompt.md' || /^oxe-.*\.prompt\.md$/i.test(name)) {
2879
2999
  const p = path.join(pr, name);
2880
3000
  unlinkQuiet(p, u);
2881
3001
  track(p);
@@ -2887,15 +3007,15 @@ function uninstallLocalIdeFromProject(u, removedPaths) {
2887
3007
  track(manifest);
2888
3008
  }
2889
3009
 
2890
- if (u.copilotCli || u.allAgents) {
2891
- for (const base of [path.join(proj, '.claude'), path.join(proj, '.copilot')]) {
2892
- const cmdDir = path.join(base, 'commands');
2893
- if (!fs.existsSync(cmdDir)) continue;
2894
- for (const name of fs.readdirSync(cmdDir)) {
2895
- if (oxeAgentInstall.isOxeCommandMarkdownName(name)) {
2896
- const p = path.join(cmdDir, name);
2897
- unlinkQuiet(p, u);
2898
- track(p);
3010
+ if (u.copilotCli || u.allAgents) {
3011
+ for (const base of [path.join(proj, '.claude'), path.join(proj, '.copilot')]) {
3012
+ const cmdDir = path.join(base, 'commands');
3013
+ if (!fs.existsSync(cmdDir)) continue;
3014
+ for (const name of fs.readdirSync(cmdDir)) {
3015
+ if (oxeAgentInstall.isOxeCommandMarkdownName(name)) {
3016
+ const p = path.join(cmdDir, name);
3017
+ unlinkQuiet(p, u);
3018
+ track(p);
2899
3019
  }
2900
3020
  }
2901
3021
  }
@@ -2923,25 +3043,25 @@ function uninstallLocalIdeFromProject(u, removedPaths) {
2923
3043
  }
2924
3044
  }
2925
3045
 
2926
- if (u.allAgents || anyGranularUninstallAgent(u)) {
2927
- const localPaths = oxeAgentInstall.buildAgentInstallPaths(false, proj);
2928
- const cleanupTargets = buildAgentCleanupTargets(u);
2929
- if (!u.dryRun) {
2930
- oxeAgentInstall.cleanupMarkedUnifiedArtifacts({ dryRun: u.dryRun, targets: cleanupTargets }, localPaths);
2931
- } else {
2932
- const label = cleanupTargets
2933
- ? Object.keys(cleanupTargets).filter((key) => cleanupTargets[key]).join(', ')
2934
- : 'OpenCode, Gemini, Windsurf, Codex, Antigravity';
2935
- console.log(`${dim}agents${reset} (dry-run) limparia marcadores oxe-cc em pastas locais do projeto (${label})`);
2936
- }
2937
- }
2938
-
2939
- if (u.cursor || u.copilot || u.copilotCli || u.allAgents || anyGranularUninstallAgent(u)) {
2940
- const runtimeManifest = path.join(proj, '.oxe', 'install', 'runtime-semantics.json');
2941
- unlinkQuiet(runtimeManifest, u);
2942
- track(runtimeManifest);
2943
- }
2944
- }
3046
+ if (u.allAgents || anyGranularUninstallAgent(u)) {
3047
+ const localPaths = oxeAgentInstall.buildAgentInstallPaths(false, proj);
3048
+ const cleanupTargets = buildAgentCleanupTargets(u);
3049
+ if (!u.dryRun) {
3050
+ oxeAgentInstall.cleanupMarkedUnifiedArtifacts({ dryRun: u.dryRun, targets: cleanupTargets }, localPaths);
3051
+ } else {
3052
+ const label = cleanupTargets
3053
+ ? Object.keys(cleanupTargets).filter((key) => cleanupTargets[key]).join(', ')
3054
+ : 'OpenCode, Gemini, Windsurf, Codex, Antigravity';
3055
+ console.log(`${dim}agents${reset} (dry-run) limparia marcadores oxe-cc em pastas locais do projeto (${label})`);
3056
+ }
3057
+ }
3058
+
3059
+ if (u.cursor || u.copilot || u.copilotCli || u.allAgents || anyGranularUninstallAgent(u)) {
3060
+ const runtimeManifest = path.join(proj, '.oxe', 'install', 'runtime-semantics.json');
3061
+ unlinkQuiet(runtimeManifest, u);
3062
+ track(runtimeManifest);
3063
+ }
3064
+ }
2945
3065
 
2946
3066
  /**
2947
3067
  * @param {string[]} argv
@@ -2949,21 +3069,21 @@ function uninstallLocalIdeFromProject(u, removedPaths) {
2949
3069
  */
2950
3070
  function parseUninstallArgs(argv) {
2951
3071
  /** @type {UninstallOpts} */
2952
- const out = {
2953
- help: false,
2954
- dryRun: false,
2955
- cursor: false,
2956
- copilot: false,
2957
- copilotCli: false,
2958
- allAgents: false,
2959
- agentOpenCode: false,
2960
- agentGemini: false,
2961
- agentCodex: false,
2962
- agentWindsurf: false,
2963
- agentAntigravity: false,
2964
- globalCli: false,
2965
- ideLocal: false,
2966
- ideExplicit: false,
3072
+ const out = {
3073
+ help: false,
3074
+ dryRun: false,
3075
+ cursor: false,
3076
+ copilot: false,
3077
+ copilotCli: false,
3078
+ allAgents: false,
3079
+ agentOpenCode: false,
3080
+ agentGemini: false,
3081
+ agentCodex: false,
3082
+ agentWindsurf: false,
3083
+ agentAntigravity: false,
3084
+ globalCli: false,
3085
+ ideLocal: false,
3086
+ ideExplicit: false,
2967
3087
  noProject: false,
2968
3088
  copilotLegacyClean: false,
2969
3089
  dir: process.cwd(),
@@ -2985,35 +3105,35 @@ function parseUninstallArgs(argv) {
2985
3105
  } else if (a === '--copilot' || a === '--copilot-vscode') {
2986
3106
  out.copilot = true;
2987
3107
  out.ideExplicit = true;
2988
- } else if (a === '--copilot-cli') {
2989
- out.copilotCli = true;
2990
- out.ideExplicit = true;
2991
- } else if (a === '--opencode') {
2992
- out.agentOpenCode = true;
2993
- out.ideExplicit = true;
2994
- } else if (a === '--gemini') {
2995
- out.agentGemini = true;
2996
- out.ideExplicit = true;
2997
- } else if (a === '--codex') {
2998
- out.agentCodex = true;
2999
- out.ideExplicit = true;
3000
- } else if (a === '--windsurf') {
3001
- out.agentWindsurf = true;
3002
- out.ideExplicit = true;
3003
- } else if (a === '--antigravity') {
3004
- out.agentAntigravity = true;
3005
- out.ideExplicit = true;
3006
- } else if (a === '--copilot-legacy-clean') {
3007
- out.copilotLegacyClean = true;
3008
- } else if (a === '--all-agents') {
3009
- out.allAgents = true;
3010
- out.copilotCli = true;
3011
- out.agentOpenCode = true;
3012
- out.agentGemini = true;
3013
- out.agentCodex = true;
3014
- out.agentWindsurf = true;
3015
- out.agentAntigravity = true;
3016
- out.ideExplicit = true;
3108
+ } else if (a === '--copilot-cli') {
3109
+ out.copilotCli = true;
3110
+ out.ideExplicit = true;
3111
+ } else if (a === '--opencode') {
3112
+ out.agentOpenCode = true;
3113
+ out.ideExplicit = true;
3114
+ } else if (a === '--gemini') {
3115
+ out.agentGemini = true;
3116
+ out.ideExplicit = true;
3117
+ } else if (a === '--codex') {
3118
+ out.agentCodex = true;
3119
+ out.ideExplicit = true;
3120
+ } else if (a === '--windsurf') {
3121
+ out.agentWindsurf = true;
3122
+ out.ideExplicit = true;
3123
+ } else if (a === '--antigravity') {
3124
+ out.agentAntigravity = true;
3125
+ out.ideExplicit = true;
3126
+ } else if (a === '--copilot-legacy-clean') {
3127
+ out.copilotLegacyClean = true;
3128
+ } else if (a === '--all-agents') {
3129
+ out.allAgents = true;
3130
+ out.copilotCli = true;
3131
+ out.agentOpenCode = true;
3132
+ out.agentGemini = true;
3133
+ out.agentCodex = true;
3134
+ out.agentWindsurf = true;
3135
+ out.agentAntigravity = true;
3136
+ out.ideExplicit = true;
3017
3137
  } else if (a === '--global-cli' || a === '-g') {
3018
3138
  out.globalCli = true;
3019
3139
  } else if (a === '--ide-local') out.ideLocal = true;
@@ -3027,24 +3147,24 @@ function parseUninstallArgs(argv) {
3027
3147
  }
3028
3148
  }
3029
3149
  if (rest.length) out.dir = rest[0];
3030
- if (!out.ideExplicit && !out.copilotLegacyClean) {
3031
- out.cursor = true;
3032
- out.copilot = true;
3033
- out.copilotCli = true;
3034
- out.allAgents = true;
3035
- } else if (out.copilotLegacyClean && !out.ideExplicit && !out.noProject) {
3036
- out.noProject = true;
3037
- }
3038
- if (!out.conflictFlags && out.explicitConfigDir) {
3039
- if (out.ideLocal) {
3040
- out.conflictFlags = '--config-dir não combina com --ide-local';
3041
- } else if (out.allAgents) {
3042
- out.conflictFlags = '--config-dir não combina com --all-agents';
3043
- } else if (anyGranularUninstallAgent(out)) {
3044
- out.conflictFlags = '--config-dir só é suportado com exatamente um entre --cursor, --copilot e --copilot-cli';
3045
- } else if (out.copilot && !out.cursor && !out.copilotCli) {
3046
- out.conflictFlags =
3047
- '--config-dir não combina com --copilot porque o GitHub Copilot no VS Code usa .github/ no workspace';
3150
+ if (!out.ideExplicit && !out.copilotLegacyClean) {
3151
+ out.cursor = true;
3152
+ out.copilot = true;
3153
+ out.copilotCli = true;
3154
+ out.allAgents = true;
3155
+ } else if (out.copilotLegacyClean && !out.ideExplicit && !out.noProject) {
3156
+ out.noProject = true;
3157
+ }
3158
+ if (!out.conflictFlags && out.explicitConfigDir) {
3159
+ if (out.ideLocal) {
3160
+ out.conflictFlags = '--config-dir não combina com --ide-local';
3161
+ } else if (out.allAgents) {
3162
+ out.conflictFlags = '--config-dir não combina com --all-agents';
3163
+ } else if (anyGranularUninstallAgent(out)) {
3164
+ out.conflictFlags = '--config-dir só é suportado com exatamente um entre --cursor, --copilot e --copilot-cli';
3165
+ } else if (out.copilot && !out.cursor && !out.copilotCli) {
3166
+ out.conflictFlags =
3167
+ '--config-dir não combina com --copilot porque o GitHub Copilot no VS Code usa .github/ no workspace';
3048
3168
  } else {
3049
3169
  const n = [out.cursor, out.copilot, out.copilotCli].filter(Boolean).length;
3050
3170
  if (n !== 1) {
@@ -3088,7 +3208,7 @@ function cleanupLegacyCopilotVsCode(ideOpts, opts, removedPaths) {
3088
3208
  const pr = copilotLegacyPromptDir(ideOpts);
3089
3209
  if (!fs.existsSync(pr)) return;
3090
3210
  for (const name of fs.readdirSync(pr)) {
3091
- if (!/^oxe-.*\.prompt\.md$/i.test(name)) continue;
3211
+ if (name !== 'oxe.prompt.md' && !/^oxe-.*\.prompt\.md$/i.test(name)) continue;
3092
3212
  const promptPath = path.join(pr, name);
3093
3213
  unlinkQuiet(promptPath, opts);
3094
3214
  removedPaths.push(promptPath);
@@ -3133,15 +3253,15 @@ function runUninstall(u) {
3133
3253
  help: false,
3134
3254
  version: false,
3135
3255
  cursor: u.cursor,
3136
- copilot: u.copilot,
3137
- copilotCli: u.copilotCli,
3138
- allAgents: u.allAgents,
3139
- agentOpenCode: u.agentOpenCode,
3140
- agentGemini: u.agentGemini,
3141
- agentCodex: u.agentCodex,
3142
- agentWindsurf: u.agentWindsurf,
3143
- agentAntigravity: u.agentAntigravity,
3144
- vscode: false,
3256
+ copilot: u.copilot,
3257
+ copilotCli: u.copilotCli,
3258
+ allAgents: u.allAgents,
3259
+ agentOpenCode: u.agentOpenCode,
3260
+ agentGemini: u.agentGemini,
3261
+ agentCodex: u.agentCodex,
3262
+ agentWindsurf: u.agentWindsurf,
3263
+ agentAntigravity: u.agentAntigravity,
3264
+ vscode: false,
3145
3265
  commands: false,
3146
3266
  agents: false,
3147
3267
  force: true,
@@ -3175,16 +3295,16 @@ function runUninstall(u) {
3175
3295
 
3176
3296
  const removedPaths = [];
3177
3297
 
3178
- if (u.cursor) {
3298
+ if (u.cursor) {
3179
3299
  const base = cursorUserDir(ideOpts);
3180
3300
  const cmdDir = path.join(base, 'commands');
3181
3301
  const ruleDir = path.join(base, 'rules');
3182
3302
  if (fs.existsSync(cmdDir)) {
3183
- for (const name of fs.readdirSync(cmdDir)) {
3184
- if (oxeAgentInstall.isOxeCommandMarkdownName(name)) {
3185
- const p = path.join(cmdDir, name);
3186
- unlinkQuiet(p, u);
3187
- removedPaths.push(p);
3303
+ for (const name of fs.readdirSync(cmdDir)) {
3304
+ if (oxeAgentInstall.isOxeCommandMarkdownName(name)) {
3305
+ const p = path.join(cmdDir, name);
3306
+ unlinkQuiet(p, u);
3307
+ removedPaths.push(p);
3188
3308
  }
3189
3309
  }
3190
3310
  }
@@ -3206,7 +3326,7 @@ function runUninstall(u) {
3206
3326
  const pr = path.join(u.dir, '.github', 'prompts');
3207
3327
  if (fs.existsSync(pr)) {
3208
3328
  for (const name of fs.readdirSync(pr)) {
3209
- if (/^oxe-.*\.prompt\.md$/i.test(name)) {
3329
+ if (name === 'oxe.prompt.md' || /^oxe-.*\.prompt\.md$/i.test(name)) {
3210
3330
  const p = path.join(pr, name);
3211
3331
  unlinkQuiet(p, u);
3212
3332
  removedPaths.push(p);
@@ -3222,15 +3342,15 @@ function runUninstall(u) {
3222
3342
  cleanupLegacyCopilotVsCode(ideOpts, u, removedPaths);
3223
3343
  }
3224
3344
 
3225
- if (u.copilotCli) {
3226
- for (const base of [claudeUserDir(ideOpts), copilotUserDir(ideOpts)]) {
3227
- const cmdDir = path.join(base, 'commands');
3228
- if (!fs.existsSync(cmdDir)) continue;
3229
- for (const name of fs.readdirSync(cmdDir)) {
3230
- if (oxeAgentInstall.isOxeCommandMarkdownName(name)) {
3231
- const p = path.join(cmdDir, name);
3232
- unlinkQuiet(p, u);
3233
- removedPaths.push(p);
3345
+ if (u.copilotCli) {
3346
+ for (const base of [claudeUserDir(ideOpts), copilotUserDir(ideOpts)]) {
3347
+ const cmdDir = path.join(base, 'commands');
3348
+ if (!fs.existsSync(cmdDir)) continue;
3349
+ for (const name of fs.readdirSync(cmdDir)) {
3350
+ if (oxeAgentInstall.isOxeCommandMarkdownName(name)) {
3351
+ const p = path.join(cmdDir, name);
3352
+ unlinkQuiet(p, u);
3353
+ removedPaths.push(p);
3234
3354
  }
3235
3355
  }
3236
3356
  }
@@ -3256,68 +3376,68 @@ function runUninstall(u) {
3256
3376
  removedPaths.push(skillFile);
3257
3377
  }
3258
3378
  }
3259
- }
3260
-
3261
- if (u.allAgents || anyGranularUninstallAgent(u)) {
3262
- const cleanupTargets = buildAgentCleanupTargets(u);
3263
- if (u.dryRun) {
3264
- const label = cleanupTargets
3265
- ? Object.keys(cleanupTargets).filter((key) => cleanupTargets[key]).join(', ')
3266
- : 'OpenCode, Gemini, Windsurf, Codex, Antigravity';
3267
- console.log(`${dim}agents${reset} (dry-run) limparia ${label || 'OpenCode, Gemini, Windsurf, Codex, Antigravity'} (marcadores oxe-cc)`);
3268
- } else {
3269
- oxeAgentInstall.cleanupMarkedUnifiedArtifacts({ dryRun: u.dryRun, targets: cleanupTargets });
3270
- }
3271
- const globalAgentPaths = oxeAgentInstall.buildAgentInstallPaths(true, u.dir);
3272
- const shouldTrack = (name) => !cleanupTargets || cleanupTargets[name] !== false;
3273
- const pushRemoved = (filePath) => {
3274
- if (removedPaths.indexOf(filePath) === -1) removedPaths.push(filePath);
3275
- };
3276
- if (shouldTrack('opencode')) {
3277
- for (const dir of globalAgentPaths.opencodeCommandDirs) {
3278
- if (!fs.existsSync(dir)) continue;
3279
- for (const name of fs.readdirSync(dir)) {
3280
- if (!oxeAgentInstall.isOxeCommandMarkdownName(name)) continue;
3281
- pushRemoved(path.join(dir, name));
3282
- }
3283
- }
3284
- }
3285
- if (shouldTrack('gemini')) {
3286
- pushRemoved(path.join(globalAgentPaths.geminiCommandsBase, 'oxe.toml'));
3287
- const geminiSub = path.join(globalAgentPaths.geminiCommandsBase, 'oxe');
3288
- if (fs.existsSync(geminiSub)) {
3289
- for (const name of fs.readdirSync(geminiSub)) {
3290
- if (name.endsWith('.toml')) pushRemoved(path.join(geminiSub, name));
3291
- }
3292
- }
3293
- }
3294
- if (shouldTrack('windsurf') && fs.existsSync(globalAgentPaths.windsurfWorkflowsDir)) {
3295
- for (const name of fs.readdirSync(globalAgentPaths.windsurfWorkflowsDir)) {
3296
- if (!oxeAgentInstall.isOxeCommandMarkdownName(name)) continue;
3297
- pushRemoved(path.join(globalAgentPaths.windsurfWorkflowsDir, name));
3298
- }
3299
- }
3300
- if (shouldTrack('codex')) {
3301
- if (fs.existsSync(globalAgentPaths.codexPromptsDir)) {
3302
- for (const name of fs.readdirSync(globalAgentPaths.codexPromptsDir)) {
3303
- if (!oxeAgentInstall.isOxeCommandMarkdownName(name)) continue;
3304
- pushRemoved(path.join(globalAgentPaths.codexPromptsDir, name));
3305
- }
3306
- }
3307
- if (fs.existsSync(globalAgentPaths.codexAgentsSkillsRoot)) {
3308
- for (const entry of fs.readdirSync(globalAgentPaths.codexAgentsSkillsRoot, { withFileTypes: true })) {
3309
- if (!entry.isDirectory() || !/^oxe($|-)/.test(entry.name)) continue;
3310
- pushRemoved(path.join(globalAgentPaths.codexAgentsSkillsRoot, entry.name, 'SKILL.md'));
3311
- }
3312
- }
3313
- }
3314
- if (shouldTrack('antigravity') && fs.existsSync(globalAgentPaths.antigravitySkillsRoot)) {
3315
- for (const entry of fs.readdirSync(globalAgentPaths.antigravitySkillsRoot, { withFileTypes: true })) {
3316
- if (!entry.isDirectory() || !/^oxe($|-)/.test(entry.name)) continue;
3317
- pushRemoved(path.join(globalAgentPaths.antigravitySkillsRoot, entry.name, 'SKILL.md'));
3318
- }
3319
- }
3320
- }
3379
+ }
3380
+
3381
+ if (u.allAgents || anyGranularUninstallAgent(u)) {
3382
+ const cleanupTargets = buildAgentCleanupTargets(u);
3383
+ if (u.dryRun) {
3384
+ const label = cleanupTargets
3385
+ ? Object.keys(cleanupTargets).filter((key) => cleanupTargets[key]).join(', ')
3386
+ : 'OpenCode, Gemini, Windsurf, Codex, Antigravity';
3387
+ console.log(`${dim}agents${reset} (dry-run) limparia ${label || 'OpenCode, Gemini, Windsurf, Codex, Antigravity'} (marcadores oxe-cc)`);
3388
+ } else {
3389
+ oxeAgentInstall.cleanupMarkedUnifiedArtifacts({ dryRun: u.dryRun, targets: cleanupTargets });
3390
+ }
3391
+ const globalAgentPaths = oxeAgentInstall.buildAgentInstallPaths(true, u.dir);
3392
+ const shouldTrack = (name) => !cleanupTargets || cleanupTargets[name] !== false;
3393
+ const pushRemoved = (filePath) => {
3394
+ if (removedPaths.indexOf(filePath) === -1) removedPaths.push(filePath);
3395
+ };
3396
+ if (shouldTrack('opencode')) {
3397
+ for (const dir of globalAgentPaths.opencodeCommandDirs) {
3398
+ if (!fs.existsSync(dir)) continue;
3399
+ for (const name of fs.readdirSync(dir)) {
3400
+ if (!oxeAgentInstall.isOxeCommandMarkdownName(name)) continue;
3401
+ pushRemoved(path.join(dir, name));
3402
+ }
3403
+ }
3404
+ }
3405
+ if (shouldTrack('gemini')) {
3406
+ pushRemoved(path.join(globalAgentPaths.geminiCommandsBase, 'oxe.toml'));
3407
+ const geminiSub = path.join(globalAgentPaths.geminiCommandsBase, 'oxe');
3408
+ if (fs.existsSync(geminiSub)) {
3409
+ for (const name of fs.readdirSync(geminiSub)) {
3410
+ if (name.endsWith('.toml')) pushRemoved(path.join(geminiSub, name));
3411
+ }
3412
+ }
3413
+ }
3414
+ if (shouldTrack('windsurf') && fs.existsSync(globalAgentPaths.windsurfWorkflowsDir)) {
3415
+ for (const name of fs.readdirSync(globalAgentPaths.windsurfWorkflowsDir)) {
3416
+ if (!oxeAgentInstall.isOxeCommandMarkdownName(name)) continue;
3417
+ pushRemoved(path.join(globalAgentPaths.windsurfWorkflowsDir, name));
3418
+ }
3419
+ }
3420
+ if (shouldTrack('codex')) {
3421
+ if (fs.existsSync(globalAgentPaths.codexPromptsDir)) {
3422
+ for (const name of fs.readdirSync(globalAgentPaths.codexPromptsDir)) {
3423
+ if (!oxeAgentInstall.isOxeCommandMarkdownName(name)) continue;
3424
+ pushRemoved(path.join(globalAgentPaths.codexPromptsDir, name));
3425
+ }
3426
+ }
3427
+ if (fs.existsSync(globalAgentPaths.codexAgentsSkillsRoot)) {
3428
+ for (const entry of fs.readdirSync(globalAgentPaths.codexAgentsSkillsRoot, { withFileTypes: true })) {
3429
+ if (!entry.isDirectory() || !/^oxe($|-)/.test(entry.name)) continue;
3430
+ pushRemoved(path.join(globalAgentPaths.codexAgentsSkillsRoot, entry.name, 'SKILL.md'));
3431
+ }
3432
+ }
3433
+ }
3434
+ if (shouldTrack('antigravity') && fs.existsSync(globalAgentPaths.antigravitySkillsRoot)) {
3435
+ for (const entry of fs.readdirSync(globalAgentPaths.antigravitySkillsRoot, { withFileTypes: true })) {
3436
+ if (!entry.isDirectory() || !/^oxe($|-)/.test(entry.name)) continue;
3437
+ pushRemoved(path.join(globalAgentPaths.antigravitySkillsRoot, entry.name, 'SKILL.md'));
3438
+ }
3439
+ }
3440
+ }
3321
3441
 
3322
3442
  if (u.ideLocal) {
3323
3443
  uninstallLocalIdeFromProject(u, removedPaths);
@@ -3350,7 +3470,7 @@ function runUninstall(u) {
3350
3470
  }
3351
3471
  }
3352
3472
 
3353
- if (!u.dryRun && (u.cursor || u.copilot || u.copilotCli || u.copilotLegacyClean || anyGranularUninstallAgent(u))) {
3473
+ if (!u.dryRun && (u.cursor || u.copilot || u.copilotCli || u.copilotLegacyClean || anyGranularUninstallAgent(u))) {
3354
3474
  const prev = oxeManifest.loadFileManifest(home);
3355
3475
  const next = { ...prev };
3356
3476
  for (const p of removedPaths) delete next[p];
@@ -3557,7 +3677,7 @@ function runUpdate(u) {
3557
3677
  const r = spawnSync('npx', args, {
3558
3678
  cwd: u.dir,
3559
3679
  stdio: 'inherit',
3560
- env: { ...process.env },
3680
+ env: { ...process.env, OXE_NO_PROMPT: '1' },
3561
3681
  shell: process.platform === 'win32',
3562
3682
  });
3563
3683
  if (r.error) {
@@ -5271,7 +5391,7 @@ async function main() {
5271
5391
  process.exit(0);
5272
5392
  }
5273
5393
 
5274
- if (!(command === 'status' && opts.jsonOutput)) {
5394
+ if (!((command === 'status' && opts.jsonOutput) || (command === 'doctor' && opts.jsonOutput))) {
5275
5395
  printBanner();
5276
5396
  }
5277
5397
 
@@ -5281,7 +5401,7 @@ async function main() {
5281
5401
  console.error(`${yellow}Diretório não encontrado: ${target}${reset}`);
5282
5402
  process.exit(1);
5283
5403
  }
5284
- runDoctor(target);
5404
+ runDoctor(target, { release: opts.releaseDoctor, json: opts.jsonOutput, writeManifest: opts.writeManifest });
5285
5405
  return;
5286
5406
  }
5287
5407
 
@@ -5324,6 +5444,7 @@ async function main() {
5324
5444
  }
5325
5445
 
5326
5446
  await resolveInteractiveInstall(opts);
5447
+ persistIdeScope(opts);
5327
5448
  runInstall(opts);
5328
5449
  await maybePromptGlobalCli(opts);
5329
5450
  }