sinapse-ai 1.25.0 → 1.25.2

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 (118) hide show
  1. package/.claude/settings.json +170 -0
  2. package/.codex/catalog.json +1 -1
  3. package/.codex/scripts/sinapse-codex.js +0 -5
  4. package/.codex/scripts/sync-codex-native.js +4 -37
  5. package/.codex/scripts/validate-codex-native.js +13 -23
  6. package/.codex/tasks/onboard-sinapse-codex.md +1 -1
  7. package/.sinapse-ai/data/entity-registry.yaml +44 -18
  8. package/.sinapse-ai/install-manifest.yaml +3 -3
  9. package/CHANGELOG.md +8 -14
  10. package/README.en.md +38 -30
  11. package/README.md +33 -25
  12. package/bin/cli.js +8 -1
  13. package/bin/commands/help.js +3 -2
  14. package/bin/commands/install.js +25 -14
  15. package/bin/commands/status.js +4 -3
  16. package/bin/commands/uninstall.js +216 -51
  17. package/bin/commands/update.js +8 -4
  18. package/bin/lib/global-provider-adapters.js +73 -10
  19. package/bin/lib/provider-parity.js +22 -0
  20. package/bin/postinstall.js +11 -11
  21. package/docs/framework/codex-parity/codex-integration-process.md +6 -7
  22. package/docs/framework/codex-parity/codex-native-runtime-v2.md +8 -8
  23. package/docs/framework/codex-parity/codex-parity-program.md +4 -4
  24. package/docs/framework/codex-parity/codex-total-parity-orchestration-plan.md +1 -1
  25. package/docs/getting-started.md +13 -5
  26. package/docs/guides/codex-config.md +35 -51
  27. package/docs/guides/development-setup.md +1 -2
  28. package/docs/guides/ide-integration.md +28 -29
  29. package/docs/guides/project-status-feature.md +35 -55
  30. package/docs/guides/quality-gates.md +2 -2
  31. package/docs/guides/user-guide.md +21 -10
  32. package/docs/ide-integration.md +2 -2
  33. package/docs/installation/README.md +4 -4
  34. package/docs/installation/faq.md +84 -70
  35. package/docs/installation/linux.md +11 -14
  36. package/docs/installation/macos.md +10 -4
  37. package/docs/installation/troubleshooting.md +11 -5
  38. package/docs/installation/v4-quick-start.md +14 -14
  39. package/docs/installation/windows.md +11 -15
  40. package/docs/pt/contributing.md +1 -1
  41. package/docs/pt/guides/development-setup.md +1 -2
  42. package/docs/pt/guides/project-status-feature.md +35 -55
  43. package/docs/pt/guides/quality-gates.md +2 -2
  44. package/docs/pt/guides/user-guide.md +21 -11
  45. package/docs/pt/ide-integration.md +6 -6
  46. package/docs/pt/installation/README.md +2 -4
  47. package/docs/pt/installation/faq.md +54 -89
  48. package/docs/pt/installation/linux.md +9 -27
  49. package/docs/pt/installation/macos.md +8 -12
  50. package/docs/pt/installation/troubleshooting.md +11 -10
  51. package/docs/pt/installation/v4-quick-start.md +17 -18
  52. package/docs/pt/installation/windows.md +8 -21
  53. package/docs/pt/platforms/claude-code.md +4 -4
  54. package/docs/sinapse-agent-flows/analyst-system.md +1 -1
  55. package/docs/sinapse-agent-flows/architect-system.md +1 -1
  56. package/docs/sinapse-agent-flows/data-engineer-system.md +1 -1
  57. package/docs/sinapse-agent-flows/dev-system.md +1 -1
  58. package/docs/sinapse-agent-flows/pm-system.md +1 -1
  59. package/docs/sinapse-agent-flows/qa-system.md +1 -1
  60. package/docs/sinapse-agent-flows/sm-system.md +1 -1
  61. package/docs/sinapse-agent-flows/snps-orqx-system.md +1 -1
  62. package/docs/sinapse-agent-flows/squad-creator-system.md +2 -2
  63. package/docs/sinapse-agent-flows/ux-design-expert-system.md +1 -1
  64. package/docs/troubleshooting.md +9 -7
  65. package/package.json +21 -16
  66. package/packages/installer/src/config/ide-configs.js +1 -1
  67. package/packages/installer/src/installer/sinapse-ai-installer.js +282 -10
  68. package/packages/installer/src/migrations/legacy-claude-agent-command-hashes.json +36 -0
  69. package/packages/installer/src/migrations/legacy-codex-native-skill-hashes.json +42 -0
  70. package/packages/installer/src/updater/index.js +24 -7
  71. package/packages/installer/src/wizard/ide-config-generator.js +4 -0
  72. package/packages/installer/src/wizard/index.js +6 -2
  73. package/scripts/validate-article-vii.js +305 -20
  74. package/scripts/validate-codex-command-registry.js +101 -0
  75. package/scripts/validate-install-docs.js +87 -3
  76. package/scripts/validate-provider-adapters.js +117 -1
  77. package/squads/claude-code-mastery/agents/skill-craftsman.md +2 -2
  78. package/squads/claude-code-mastery/knowledge-base/skill-creation-patterns.md +1 -1
  79. package/squads/squad-design/agents/ux-designer.md +1 -1
  80. package/.codex/skills/sinapse/SKILL.md +0 -10
  81. package/.codex/skills/sinapse-agent/SKILL.md +0 -22
  82. package/.codex/skills/sinapse-analyst/SKILL.md +0 -29
  83. package/.codex/skills/sinapse-animations/SKILL.md +0 -28
  84. package/.codex/skills/sinapse-architect/SKILL.md +0 -31
  85. package/.codex/skills/sinapse-brand/SKILL.md +0 -28
  86. package/.codex/skills/sinapse-claude/SKILL.md +0 -28
  87. package/.codex/skills/sinapse-cloning/SKILL.md +0 -28
  88. package/.codex/skills/sinapse-commercial/SKILL.md +0 -28
  89. package/.codex/skills/sinapse-content/SKILL.md +0 -28
  90. package/.codex/skills/sinapse-copy/SKILL.md +0 -28
  91. package/.codex/skills/sinapse-council/SKILL.md +0 -28
  92. package/.codex/skills/sinapse-courses/SKILL.md +0 -28
  93. package/.codex/skills/sinapse-cyber/SKILL.md +0 -28
  94. package/.codex/skills/sinapse-data-engineer/SKILL.md +0 -31
  95. package/.codex/skills/sinapse-design/SKILL.md +0 -28
  96. package/.codex/skills/sinapse-dev/SKILL.md +0 -31
  97. package/.codex/skills/sinapse-devops/SKILL.md +0 -31
  98. package/.codex/skills/sinapse-finance/SKILL.md +0 -28
  99. package/.codex/skills/sinapse-growth/SKILL.md +0 -28
  100. package/.codex/skills/sinapse-loop/SKILL.md +0 -35
  101. package/.codex/skills/sinapse-orqx/SKILL.md +0 -44
  102. package/.codex/skills/sinapse-paidmedia/SKILL.md +0 -28
  103. package/.codex/skills/sinapse-pm/SKILL.md +0 -31
  104. package/.codex/skills/sinapse-po/SKILL.md +0 -31
  105. package/.codex/skills/sinapse-product/SKILL.md +0 -28
  106. package/.codex/skills/sinapse-qa/SKILL.md +0 -31
  107. package/.codex/skills/sinapse-research/SKILL.md +0 -28
  108. package/.codex/skills/sinapse-sm/SKILL.md +0 -27
  109. package/.codex/skills/sinapse-spec-driven/SKILL.md +0 -35
  110. package/.codex/skills/sinapse-squad-creator/SKILL.md +0 -31
  111. package/.codex/skills/sinapse-storytelling/SKILL.md +0 -28
  112. package/.codex/skills/sinapse-swarm/SKILL.md +0 -28
  113. package/.codex/skills/sinapse-ux-design-expert/SKILL.md +0 -24
  114. package/.codex/skills/snps/SKILL.md +0 -10
  115. package/.codex/skills/snps-orqx/SKILL.md +0 -10
  116. /package/{.codex → .agents}/skills/react-bits-frontend/SKILL.md +0 -0
  117. /package/{.codex → .agents}/skills/react-bits-frontend/agents/openai.yaml +0 -0
  118. /package/{.codex → .agents}/skills/react-bits-frontend/references/corpus-map.md +0 -0
package/README.en.md CHANGED
@@ -19,9 +19,9 @@
19
19
 
20
20
  ## What is SINAPSE?
21
21
 
22
- SINAPSE is an open-source meta-framework that organizes **172 AI agents into 17 specialized squads**, operating directly in the terminal via Claude Code or Codex CLI. Each agent has a defined role, each squad masters a discipline, and the entire system is governed by a **Constitution with real enforcement** -- 17 active hooks that block violations at runtime.
22
+ SINAPSE is an open-source meta-framework that organizes **172 AI agents into 17 specialized squads**, operating directly in the terminal via Claude Code or Codex CLI. Each agent has a defined role, each squad masters a discipline, and the entire system is governed by a **Constitution with real enforcement** -- 20 registered Claude Code hooks and 9 Codex lifecycle events through the compatibility bridge.
23
23
 
24
- The core concept is simple: instead of a single AI assistant trying to do everything, SINAPSE structures work into specialized teams. A branding squad handles visual identity. A cybersecurity squad handles compliance and pentesting. A copywriting squad handles persuasion and conversion. Each with its own knowledge base, workflows, and tasks -- totaling **1,200 executable tasks** ready to use.
24
+ The core concept is simple: instead of a single AI assistant trying to do everything, SINAPSE structures work into specialized teams. A branding squad handles visual identity. A cybersecurity squad handles compliance and pentesting. A copywriting squad handles persuasion and conversion. The runtime measures **1,412 task files**: **1,201 squad tasks** and **211 development tasks**. Of those files, **1,348 pointers are resolvable** by real agents.
25
25
 
26
26
  Unlike tools that just chat with AI, SINAPSE enforces discipline. The **Documentation-First** pipeline requires a story to be created and validated before any code is written. Quality gates run automatically before merge. Unauthorized agents are blocked from pushing. All via hooks that intercept operations in real time -- not after the fact.
27
27
 
@@ -33,7 +33,7 @@ Generative AI has a known problem: the more you ask of it, the worse it gets. A
33
33
 
34
34
  SINAPSE solves this the way human teams solve it: **coordinated specialization**. Instead of one tired generalist, you have 172 agents in 17 squads, each with a defined role, its own knowledge base, and executable tasks. An orchestrator routes your request to whoever actually knows how to solve it -- automatically, without you needing to memorize agent names or commands.
35
35
 
36
- The differential isn't just the quantity of agents. It's **real governance**: 17 active hooks intercept operations at runtime, a Constitution with 11 articles governs the framework, and 7 of those articles are NON-NEGOTIABLE -- violations are blocked before execution, not detected afterwards. **Speed with rigor, without choosing between the two.**
36
+ The differential isn't just the quantity of agents. It's **real governance**: 20 Claude Code hook registrations and 9 Codex lifecycle events intercept operations at runtime, a Constitution with 11 articles governs the framework, and 7 of those articles are NON-NEGOTIABLE -- violations are blocked before execution, not detected afterwards. **Speed with rigor, without choosing between the two.**
37
37
 
38
38
  ---
39
39
 
@@ -55,9 +55,18 @@ npx sinapse-ai doctor
55
55
 
56
56
  ### 3. Activate your first agent
57
57
 
58
+ Claude Code:
59
+
60
+ ```text
61
+ @developer
62
+ *help
58
63
  ```
59
- @developer # Activate the development agent
60
- *help # List available commands
64
+
65
+ Codex:
66
+
67
+ ```text
68
+ $snps
69
+ $sinapse-agent developer
61
70
  ```
62
71
 
63
72
  Done. You have 17 squads operating in your terminal.
@@ -174,7 +183,7 @@ Deny rules in `.claude/settings.json` enforce this deterministically. **Framewor
174
183
 
175
184
  ### Constitution
176
185
 
177
- SINAPSE is governed by a formal Constitution with 11 articles and 17 enforcement hooks:
186
+ SINAPSE is governed by a formal Constitution with 11 articles and provider-specific enforcement surfaces: 20 Claude Code hook registrations and 9 Codex lifecycle events.
178
187
 
179
188
  | Article | Principle | Severity |
180
189
  |---------|-----------|----------|
@@ -213,7 +222,7 @@ SINAPSE includes 12 core agents covering the complete development cycle:
213
222
  | `devops` | **Pipeline** | CI/CD, git push (exclusive), releases |
214
223
  | `squad-creator` | **Loom** | New squad creation |
215
224
 
216
- Activate any agent with `@agent-name` and use `*help` to see its commands.
225
+ In Claude Code, activate an agent with `@agent-name` and use `*help` to see its commands. In Codex, start with `$snps` for routing or use `$sinapse-agent agent-id` for direct activation.
217
226
 
218
227
  ### Development Workflow
219
228
 
@@ -263,15 +272,19 @@ Each squad is an autonomous team with its own orchestrator, specialist agents, k
263
272
  | **squad-growth** | Analytics, CRO, SEO, growth hacking | 7 |
264
273
  | **squad-finance** | Budget, pricing, profitability analysis | 8 |
265
274
 
266
- **Total: 17 squads, 172 specialized agents, 1,201 tasks**
275
+ **Total: 17 squads, 172 specialized agents, and 1,412 task files** (**1,201 squad tasks + 211 development tasks; 1,348 resolvable pointers**)
267
276
 
268
- Activate any squad via its orchestrator:
277
+ Activate any squad via its orchestrator using the provider-native syntax:
269
278
 
270
- ```
279
+ ```text
280
+ # Claude Code
271
281
  @brand-orqx # Brand squad
272
282
  @copy-orqx # Copy squad
273
- @cyber-orqx # Cybersecurity squad
274
- @research-orqx # Research squad
283
+
284
+ # Codex
285
+ $sinapse-agent brand-orqx
286
+ $sinapse-agent copy-orqx
287
+ $snps # Route through the primary orchestrator
275
288
  ```
276
289
 
277
290
  The orchestrator receives your request and automatically delegates to the right specialist within the squad.
@@ -285,27 +298,22 @@ SINAPSE supports two IDEs with deep integrations:
285
298
  | IDE | Activation | Highlights |
286
299
  |-----|------------|------------|
287
300
  | **Claude Code** | `@agent-name` | Hooks, contextual rules, deny/allow, Chrome Brain |
288
- | **Codex CLI** | `/skills` or `$skill-name` | Native skills, multi-model, `codex exec` for CI/CD |
301
+ | **Codex CLI** | `$snps` or `$sinapse-agent agent-id` | Native skills, multi-model, `codex exec` for CI/CD |
289
302
 
290
303
  Both IDEs have access to all 17 squads, 172 agents, workflows, and knowledge bases. The installer detects and configures automatically.
291
304
 
292
305
  ### Parity Table
293
306
 
294
- | Feature | Claude Code | Codex CLI |
295
- |---------|:-----------:|:---------:|
296
- | Agent activation (@agent) | Full | Full |
297
- | Constitutional hooks (20) | Full | Partial (5) |
298
- | Story-driven development | Full | Full |
299
- | Quality gates | Full | Full |
300
- | Delegation enforcement | Full | Partial |
301
- | Secret scanning | Full | Manual |
302
- | CodeRabbit integration | Full | N/A |
303
- | Skills system | Full | Commands |
304
- | MCP servers | Full | N/A |
305
- | Terminal Bus | Full | N/A |
306
-
307
- **Claude Code** for the most integrated and automated experience.
308
- **Codex CLI** for model flexibility and CI/CD automation.
307
+ | Measured surface | Claude Code | Codex CLI |
308
+ |------------------|:-----------:|:---------:|
309
+ | Native agents | 172 | 172 |
310
+ | Direct activation | `@agent-name` | `$sinapse-agent agent-id` |
311
+ | Primary routing | `@sinapse-orqx` | `$snps` |
312
+ | Installed skills | 36 | 37 |
313
+ | Registered hooks | 20 native registrations | 9 lifecycle events through the bridge |
314
+ | Validation source | `npm run validate:providers` | `npm run validate:codex-native` |
315
+
316
+ Both providers resolve the same agents, tasks, workflows, and knowledge bases. Their activation and hook surfaces are different native adapters validated independently by the parity gate.
309
317
 
310
318
  ---
311
319
 
@@ -335,7 +343,7 @@ If you identify with the first group, you're in the right place.
335
343
 
336
344
  ### Constitutional Enforcement
337
345
 
338
- SINAPSE doesn't just document rules -- it enforces them with **17 active hooks**:
346
+ SINAPSE doesn't just document rules -- Claude Code uses **20 registered hooks**, while Codex exposes **9 lifecycle events** through the compatibility bridge:
339
347
 
340
348
  - `enforce-git-push-authority.sh` -- blocks push by unauthorized agents
341
349
  - `enforce-story-gate.cjs` -- blocks code without a validated story
@@ -400,7 +408,7 @@ npx sinapse-ai doctor --dry-run # Show what `--fix` would do without applying
400
408
  npx sinapse-ai chrome-brain install # Install browser automation
401
409
  ```
402
410
 
403
- All commands are safe to re-run. To list active agents after installing, open Claude Code or Codex CLI and type `@` to autocomplete.
411
+ All commands are safe to re-run. After installing, use `@agent-name` in Claude Code or `$snps` / `$sinapse-agent agent-id` in Codex.
404
412
 
405
413
  ---
406
414
 
package/README.md CHANGED
@@ -23,7 +23,7 @@
23
23
 
24
24
  SINAPSE é um meta-framework open source que organiza **172 agentes de IA em 17 squads especializados**, operando direto no terminal via Claude Code ou Codex CLI. Cada agente tem um papel definido, cada squad domina uma disciplina, e o sistema inteiro é governado por uma **Constitution com enforcement real** — 20 hooks registrados que bloqueiam violações em tempo de execução.
25
25
 
26
- O conceito central é simples: em vez de um único assistente de IA tentando fazer tudo, o SINAPSE estrutura o trabalho em equipes especializadas. Um squad de branding cuida da identidade visual. Um squad de cybersecurity cuida de compliance e pentest. Um squad de copywriting cuida de persuasão e conversão. Cada um com sua própria knowledge base, workflows e tasks totalizando **1.201 tasks executáveis** prontas para uso, distribuídas pelos 17 squads.
26
+ O conceito central é simples: em vez de um único assistente de IA tentando fazer tudo, o SINAPSE estrutura o trabalho em equipes especializadas. Um squad de branding cuida da identidade visual. Um squad de cybersecurity cuida de compliance e pentest. Um squad de copywriting cuida de persuasão e conversão. Cada um com sua própria knowledge base, workflows e tasks. O runtime mede **1.412 task files**: **1.201 squad tasks** nos 17 squads e **211 development tasks**. Desses arquivos, **1.348 são resolvíveis** pelos ponteiros reais dos agentes.
27
27
 
28
28
  Diferente de ferramentas que apenas conversam com IA, o SINAPSE impõe disciplina. O pipeline **Documentation-First** exige que uma story seja criada e validada antes de qualquer linha de código. Quality gates rodam automaticamente antes de merge. Agentes não autorizados são bloqueados de fazer push. Tudo isso via hooks que interceptam operações em tempo real — não depois.
29
29
 
@@ -63,9 +63,18 @@ Se algo estiver fora do lugar, `doctor --fix` corrige automaticamente.
63
63
 
64
64
  ### 3. Ative seu primeiro agente
65
65
 
66
+ Claude Code:
67
+
68
+ ```text
69
+ @developer
70
+ *help
66
71
  ```
67
- @developer # Ativa o agente de desenvolvimento
68
- *help # Lista comandos disponíveis
72
+
73
+ Codex:
74
+
75
+ ```text
76
+ $snps
77
+ $sinapse-agent developer
69
78
  ```
70
79
 
71
80
  Pronto. Você tem 17 squads operando no seu terminal.
@@ -235,7 +244,7 @@ O SINAPSE inclui 12 agentes core que cobrem o ciclo completo de desenvolvimento:
235
244
  | `devops` | **Pipeline** | CI/CD, git push (exclusivo), releases |
236
245
  | `squad-creator` | **Loom** | Criação de novos squads |
237
246
 
238
- Ative qualquer agente com `@agent-name` e use `*help` para ver seus comandos.
247
+ No Claude Code, ative um agente com `@agent-name` e use `*help` para ver seus comandos. No Codex, comece com `$snps` para roteamento ou use `$sinapse-agent agent-id` para ativação direta.
239
248
 
240
249
  ### Workflow de Desenvolvimento
241
250
 
@@ -285,15 +294,19 @@ Cada squad é uma equipe autônoma com orquestrador, agentes especialistas, know
285
294
  | **squad-growth** | Analytics, CRO, SEO, growth hacking | 7 |
286
295
  | **squad-finance** | Budget, pricing, profitability analysis | 8 |
287
296
 
288
- **Total: 17 squads, 172 agentes especializados, 1.201 tasks**
297
+ **Total: 17 squads, 172 agentes especializados e 1.412 task files** (**1.201 squad tasks + 211 development tasks; 1.348 ponteiros resolvíveis**)
289
298
 
290
- Cada squad é ativado via seu orquestrador:
299
+ Cada squad é ativado via seu orquestrador, com a sintaxe nativa do provedor:
291
300
 
292
- ```
301
+ ```text
302
+ # Claude Code
293
303
  @brand-orqx # Squad de brand
294
304
  @copy-orqx # Squad de copy
295
- @cyber-orqx # Squad de cybersecurity
296
- @research-orqx # Squad de research
305
+
306
+ # Codex
307
+ $sinapse-agent brand-orqx
308
+ $sinapse-agent copy-orqx
309
+ $snps # Roteamento pelo orquestrador principal
297
310
  ```
298
311
 
299
312
  O orquestrador recebe seu pedido e delega automaticamente ao especialista correto dentro do squad.
@@ -306,28 +319,23 @@ O SINAPSE suporta duas IDEs com integrações profundas:
306
319
 
307
320
  | IDE | Ativação | Destaques |
308
321
  |-----|----------|-----------|
309
- | **Claude Code** | `@agent-name` ou `/skill-name` | Subagentes e skills nativos, hooks e rules contextuais |
322
+ | **Claude Code** | `@agent-name` | Subagentes e skills nativos, hooks e rules contextuais |
310
323
  | **Codex CLI** | `$snps` ou `$sinapse-agent agent-id` | Agentes TOML, skills nativas e `codex exec` para CI/CD |
311
324
 
312
325
  Ambas as IDEs têm acesso a todos os 17 squads, 172 agentes, workflows e knowledge bases. O installer detecta e configura automaticamente.
313
326
 
314
327
  ### Tabela de Paridade
315
328
 
316
- | Funcionalidade | Claude Code | Codex CLI |
317
- |---------------|:-----------:|:---------:|
318
- | Ativação dos 172 agentes | `@agent-name` | `$sinapse-agent agent-id` |
319
- | Hooks constitucionais (20) | Completo | Parcial (5) |
320
- | Story-driven development | Completo | Completo |
321
- | Quality gates | Completo | Completo |
322
- | Enforcement de delegação | Completo | Parcial |
323
- | Secret scanning | Completo | Manual |
324
- | Integração CodeRabbit | Completo | N/A |
325
- | Sistema de skills | Completo | Comandos |
326
- | MCP servers | Completo | N/A |
327
- | Terminal Bus | Completo | N/A |
328
-
329
- **Claude Code** para a experiência mais integrada e automatizada.
330
- **Codex CLI** para flexibilidade de modelo e automação CI/CD.
329
+ | Superfície medida | Claude Code | Codex CLI |
330
+ |-------------------|:-----------:|:---------:|
331
+ | Agentes nativos | 172 | 172 |
332
+ | Ativação direta | `@agent-name` | `$sinapse-agent agent-id` |
333
+ | Roteamento principal | `@sinapse-orqx` | `$snps` |
334
+ | Skills instaladas | 36 | 37 |
335
+ | Hooks registrados | 20 registros nativos | 9 eventos de lifecycle via bridge |
336
+ | Fonte de validação | `npm run validate:providers` | `npm run validate:codex-native` |
337
+
338
+ Os dois providers resolvem os mesmos agents, tasks, workflows e knowledge bases. As superfícies de ativação e hooks são adapters nativos diferentes e são validadas separadamente pelo gate de paridade.
331
339
 
332
340
  ---
333
341
 
package/bin/cli.js CHANGED
@@ -96,6 +96,10 @@ if (require.main === module) {
96
96
 
97
97
  function runRouter() {
98
98
  const args = process.argv.slice(2);
99
+ if (args[0] === 'install' && (args.includes('--help') || args.includes('-h'))) {
100
+ cmdHelp();
101
+ return;
102
+ }
99
103
  // Story 10.46 — empty invocation on a fresh machine routes to a first-run
100
104
  // hint instead of the bare help screen, so new users discover `install`.
101
105
  let command = args[0];
@@ -105,9 +109,12 @@ function runRouter() {
105
109
  const isLocal = args.includes('--local');
106
110
  const isForce = args.includes('--force');
107
111
  const isReconfigure = args.includes('--reconfigure');
112
+ const isGlobalOnly = args.includes('--global-only');
113
+ const llmFlag = args.find((arg) => arg.startsWith('--llm='));
114
+ const requestedLlm = llmFlag ? llmFlag.slice('--llm='.length) : null;
108
115
 
109
116
  switch (command) {
110
- case 'install': isLocal ? cmdInstallLocal() : cmdInstallGlobal({ force: isForce, reconfigure: isReconfigure }).catch(e => { const { formatErrorMessage } = require('./utils/install-errors'); logger.error(formatErrorMessage(e)); logger.error(`Tente: ${CYAN}npx sinapse-ai doctor${NC}`); process.exit(1); }); break;
117
+ case 'install': isLocal ? cmdInstallLocal() : cmdInstallGlobal({ force: isForce, reconfigure: isReconfigure, globalOnly: isGlobalOnly, llm: requestedLlm }).catch(e => { const { formatErrorMessage } = require('./utils/install-errors'); logger.error(formatErrorMessage(e)); logger.error(`Tente: ${CYAN}npx sinapse-ai doctor${NC}`); process.exit(1); }); break;
111
118
  case 'update': isLocal ? cmdUpdateLocal() : cmdUpdateGlobal().catch(e => { logger.error(`${RED}Erro ao atualizar:${NC} ${e.message}`); logger.error(`Tente: ${CYAN}npx sinapse-ai doctor${NC}`); process.exit(1); }); break;
112
119
  case 'uninstall': {
113
120
  const isYes = args.includes('--yes') || args.includes('-y');
@@ -13,6 +13,7 @@ function cmdHelp() {
13
13
  logger.always(` ${CYAN}npx sinapse-ai install${NC} Instala SINAPSE (idempotente — re-runs são upserts)`);
14
14
  logger.always(` ${CYAN}npx sinapse-ai install --force${NC} Reinstala do zero, mesmo se já instalado`);
15
15
  logger.always(` ${CYAN}npx sinapse-ai install --reconfigure${NC} Re-pergunta idioma/LLM sem apagar instalação`);
16
+ logger.always(` ${CYAN}npx sinapse-ai install --llm=both --global-only${NC} Instala Claude + Codex sem alterar o projeto atual`);
16
17
  logger.always(` ${CYAN}npx sinapse-ai update${NC} Atualiza SINAPSE para a última versão`);
17
18
  logger.always(` ${CYAN}npx sinapse-ai uninstall${NC} Remove SINAPSE globalmente (pede confirmação)`);
18
19
  logger.always(` ${CYAN}npx sinapse-ai uninstall --yes${NC} Remove SINAPSE globalmente (sem prompt — exigido em CI)`);
@@ -36,8 +37,8 @@ function cmdHelp() {
36
37
  logger.always(` ${CYAN}sinapse --continue${NC} Continua última sessão`);
37
38
  logger.always('');
38
39
  logger.always(`${BOLD}Agents:${NC}\n`);
39
- logger.always(` Invocação canônica: ${CYAN}/SINAPSE:agents:{agent-id}${NC}`);
40
- logger.always(` Exemplo: ${CYAN}/SINAPSE:agents:brand-orqx${NC}`);
40
+ logger.always(` Invocação canônica: ${CYAN}$sinapse-agent <agent-id>${NC}`);
41
+ logger.always(` Exemplo: ${CYAN}$sinapse-agent brand-orqx${NC}`);
41
42
  logger.always(` Master orchestrator: ${CYAN}@sinapse-orqx${NC} (alias: ${DIM}@snps-orqx${NC})`);
42
43
  logger.always('');
43
44
  logger.always(`${BOLD}Ajuda extra:${NC}\n`);
@@ -49,6 +49,7 @@ const {
49
49
  regenerateAgentCommands,
50
50
  } = require('../lib/command-generator');
51
51
  const { deliverGlobalProviderAdapters, getGlobalCommandStagingDir } = require('../lib/global-provider-adapters');
52
+ const { assertProviderAdapterParity } = require('../lib/provider-parity');
52
53
  // Follow-up #13 — wire the transactional backup/rollback engine into the
53
54
  // installer so an in-place UPGRADE (upsert) that fails mid-flight is restored
54
55
  // to its previous state instead of leaving ~/.sinapse half-updated.
@@ -64,6 +65,11 @@ async function cmdInstallGlobal(opts = {}) {
64
65
  // Story 10.20 — Upsert detection
65
66
  const force = Boolean(opts.force);
66
67
  const reconfigure = Boolean(opts.reconfigure);
68
+ const globalOnly = Boolean(opts.globalOnly);
69
+ const requestedLlm = opts.llm || null;
70
+ if (requestedLlm && !['claude-code', 'codex', 'both'].includes(requestedLlm)) {
71
+ throw new Error(`Invalid --llm value: ${requestedLlm}. Use claude-code, codex, or both.`);
72
+ }
67
73
  const existing = force ? { upsert: false } : detectExistingInstall();
68
74
  const isUpsert = existing.upsert;
69
75
 
@@ -126,7 +132,9 @@ async function cmdInstallGlobal(opts = {}) {
126
132
  // Story 10.35: --reconfigure forces prompt even in upsert mode
127
133
  let llmChoice;
128
134
  let llmWasReused = false;
129
- if (isUpsert && !reconfigure && existing.llm) {
135
+ if (requestedLlm) {
136
+ llmChoice = requestedLlm;
137
+ } else if (isUpsert && !reconfigure && existing.llm) {
130
138
  llmChoice = existing.llm;
131
139
  llmWasReused = true;
132
140
  const ideLabel = Array.isArray(llmChoice) ? llmChoice.join(', ') : String(llmChoice);
@@ -222,7 +230,7 @@ async function cmdInstallGlobal(opts = {}) {
222
230
  // project-wizard WARN must NOT revert an otherwise-good global install.
223
231
  const tx = createInstallTransaction();
224
232
  const txPaths = buildTransactionPaths(llmChoice);
225
- const { writtenAgents, totalAgents, totalDelta, squadsRefreshed, squadsAdded, meta } =
233
+ const { activeAgentCount, totalDelta, squadsRefreshed, squadsAdded, meta } =
226
234
  await runFatalPhasesTransactional({
227
235
  tx,
228
236
  isUpsert,
@@ -269,7 +277,10 @@ async function cmdInstallGlobal(opts = {}) {
269
277
 
270
278
  // Phase 8: Install project-local files (.sinapse-ai/, .claude/, .env)
271
279
  logger.always(`\n${CYAN}Phase 8:${NC} Installing project files in current directory`);
272
- try {
280
+ const skipProjectInstall = globalOnly || path.resolve(process.cwd()) === path.resolve(ROOT);
281
+ if (skipProjectInstall) {
282
+ logger.always(` ${YELLOW}SKIP${NC} Project files (${globalOnly ? '--global-only' : 'source checkout detected'})`);
283
+ } else try {
273
284
  const wizardPath = path.join(ROOT, 'packages', 'installer', 'src', 'wizard', 'index.js');
274
285
  if (fs.existsSync(wizardPath)) {
275
286
  const { runWizard: executeWizard } = require(wizardPath);
@@ -348,7 +359,7 @@ async function cmdInstallGlobal(opts = {}) {
348
359
  logger.always(`${YELLOW}══════════════════════════════════════════════════════════════${NC}`);
349
360
  }
350
361
  logger.always('');
351
- logger.always(` ${BOLD}${squads.length} squads${NC} | ${BOLD}${totalAgents} agents${NC} | ${BOLD}${writtenAgents.size} command files${NC}`);
362
+ logger.always(` ${BOLD}${squads.length} squads${NC} | ${BOLD}${activeAgentCount} agents${NC} | ${BOLD}${activeAgentCount} native adapters${NC}`);
352
363
  logger.always(` ${startCmd}`);
353
364
  logger.always('');
354
365
  logger.always(` ${BOLD}Try an agent:${NC}`);
@@ -402,6 +413,9 @@ function buildTransactionPaths(llmChoice) {
402
413
  CLAUDE_COMMANDS_DIR, // Phase 2 — generated /SINAPSE:agents:* command files
403
414
  ];
404
415
  if (llmChoice === 'claude-code' || llmChoice === 'both') dirs.push(path.join(HOME, '.claude', 'agents'));
416
+ // A Claude-only provider switch removes stale Codex aliases during the fatal
417
+ // phases, so that cleanup must be covered by the same upgrade rollback.
418
+ if (llmChoice === 'claude-code') dirs.push(path.join(HOME, '.agents', 'skills'));
405
419
  if (llmChoice === 'codex' || llmChoice === 'both') {
406
420
  dirs.push(path.join(HOME, '.codex', 'agents'));
407
421
  dirs.push(path.join(HOME, '.agents', 'skills'));
@@ -478,7 +492,7 @@ async function runFatalPhasesTransactional({ tx, isUpsert, paths, runPhases, onR
478
492
  * @param {string} ctx.llmChoice
479
493
  * @param {Object} ctx.existing - detectExistingInstall() result
480
494
  * @param {Object} ctx.logger
481
- * @returns {{ writtenAgents: Set, totalAgents: number, totalDelta: Object, squadsRefreshed: number, squadsAdded: number, meta: Object }}
495
+ * @returns {{ writtenAgents: Set, activeAgentCount: number, totalDelta: Object, squadsRefreshed: number, squadsAdded: number, meta: Object }}
482
496
  */
483
497
  function installFatalPhases({ squads, squadsDir, isUpsert, llmChoice, existing, logger }) {
484
498
  // Phase 1: Copy squads to ~/.sinapse/
@@ -486,7 +500,6 @@ function installFatalPhases({ squads, squadsDir, isUpsert, llmChoice, existing,
486
500
  fs.mkdirSync(SINAPSE_HOME, { recursive: true });
487
501
 
488
502
  const squadsSrcBase = fs.existsSync(squadsDir) ? squadsDir : ROOT;
489
- let totalAgents = 0;
490
503
  const totalDelta = { added: 0, updated: 0, unchanged: 0, removed: 0 };
491
504
  let squadsRefreshed = 0;
492
505
  let squadsAdded = 0;
@@ -507,7 +520,6 @@ function installFatalPhases({ squads, squadsDir, isUpsert, llmChoice, existing,
507
520
  copyDirSync(src, dest);
508
521
  logger.always(` ${GREEN}OK${NC} ${squad.name} (${squad.agents} agents)`);
509
522
  }
510
- totalAgents += squad.agents;
511
523
  }
512
524
 
513
525
  // Copy sinapse/ orqx squad
@@ -525,7 +537,6 @@ function installFatalPhases({ squads, squadsDir, isUpsert, llmChoice, existing,
525
537
  copyDirSync(sinapseMasterSrc, sinapseMasterDest);
526
538
  }
527
539
  const masterAgents = getAgentFiles(sinapseMasterDest).length;
528
- totalAgents += masterAgents;
529
540
  logger.always(` ${GREEN}OK${NC} sinapse (master, ${masterAgents} agents)`);
530
541
  }
531
542
 
@@ -543,14 +554,13 @@ function installFatalPhases({ squads, squadsDir, isUpsert, llmChoice, existing,
543
554
  copyDirSync(coreDevelopmentSrc, coreDevelopmentDest);
544
555
  }
545
556
  const coreAgents = getAgentFiles(coreDevelopmentDest).length;
546
- totalAgents += coreAgents;
547
557
  logger.always(` ${GREEN}OK${NC} core development (${coreAgents} agents)`);
548
558
  }
549
559
 
550
560
  // Phase 2: Generate agent commands (shared with `update` via command-generator).
551
561
  logger.always(`\n${CYAN}Phase 2:${NC} Generating agent commands`);
552
562
  const commandStagingDir = getGlobalCommandStagingDir({ llmChoice, sinapseHome: SINAPSE_HOME, claudeCommandsDir: CLAUDE_COMMANDS_DIR });
553
- const { writtenAgents } = regenerateAgentCommands({
563
+ const { writtenAgents, totalAgents } = regenerateAgentCommands({
554
564
  sinapseHome: SINAPSE_HOME,
555
565
  commandsDir: commandStagingDir,
556
566
  squads,
@@ -561,6 +571,7 @@ function installFatalPhases({ squads, squadsDir, isUpsert, llmChoice, existing,
561
571
 
562
572
  // Phase 2b: Install global agents based on LLM choice
563
573
  const globalAdapters = deliverGlobalProviderAdapters({ llmChoice, home: HOME, commandsDir: commandStagingDir });
574
+ const activeAgentCount = assertProviderAdapterParity(llmChoice, globalAdapters, totalAgents);
564
575
  const installedAgentFilenames = new Set([...globalAdapters.claude, ...globalAdapters.codex]);
565
576
  const installedIdes = [];
566
577
  if (globalAdapters.claude.length) installedIdes.push('claude-code');
@@ -571,7 +582,7 @@ function installFatalPhases({ squads, squadsDir, isUpsert, llmChoice, existing,
571
582
  // Audit 1 P0 (UN-1) — record manifest so uninstall can remove every file
572
583
  // we wrote (not just `*-orqx.md`). Idempotent: re-install overwrites.
573
584
  reconcileInstalledAgents(HOME, installedAgentFilenames);
574
- if (llmChoice === 'claude-code') removeManagedGlobalSkills(HOME);
585
+ if (llmChoice === 'claude-code') removeManagedGlobalSkills(HOME, { providers: ['codex'] });
575
586
  recordInstalledAgents(installedAgentFilenames, installedIdes);
576
587
 
577
588
  // Phase 3: Generate squad-awareness.md
@@ -595,8 +606,8 @@ function installFatalPhases({ squads, squadsDir, isUpsert, llmChoice, existing,
595
606
  ? existing.prevMeta.installedAt
596
607
  : nowIso,
597
608
  squads: squads.length,
598
- agents: totalAgents,
599
- commands: writtenAgents.size,
609
+ agents: activeAgentCount,
610
+ commands: activeAgentCount,
600
611
  llm: llmChoice,
601
612
  platform: process.platform,
602
613
  };
@@ -605,7 +616,7 @@ function installFatalPhases({ squads, squadsDir, isUpsert, llmChoice, existing,
605
616
  }
606
617
  atomicWriteFileSync(path.join(SINAPSE_HOME, 'metadata.json'), JSON.stringify(meta, null, 2));
607
618
 
608
- return { writtenAgents, totalAgents, totalDelta, squadsRefreshed, squadsAdded, meta };
619
+ return { writtenAgents, activeAgentCount, totalDelta, squadsRefreshed, squadsAdded, meta };
609
620
  }
610
621
 
611
622
  function generateSquadAwareness(sinapseDir, squads) {
@@ -5,9 +5,9 @@ const fs = require('fs');
5
5
  const path = require('path');
6
6
  const { getLogger } = require('../../.sinapse-ai/core/logger');
7
7
  const {
8
+ HOME,
8
9
  ROOT,
9
10
  SINAPSE_HOME,
10
- CLAUDE_COMMANDS_DIR,
11
11
  BIN_DIR,
12
12
  CYAN,
13
13
  GREEN,
@@ -18,12 +18,13 @@ const {
18
18
  } = require('../lib/constants');
19
19
  const { header } = require('../lib/header');
20
20
  const { getSquads } = require('../lib/squads');
21
+ const { hasManagedInstalledAgents } = require('./uninstall');
21
22
 
22
23
  function verifyInstall() {
23
24
  const logger = getLogger();
24
25
  const checks = [
25
26
  [fs.existsSync(SINAPSE_HOME), `${getSquads(SINAPSE_HOME).length} squads in ~/.sinapse/`],
26
- [fs.existsSync(CLAUDE_COMMANDS_DIR), 'Commands in ~/.claude/commands/SINAPSE/agents/'],
27
+ [hasManagedInstalledAgents(HOME), 'Native provider agents installed'],
27
28
  [fs.existsSync(path.join(BIN_DIR, 'sinapse')), 'Launcher at ~/bin/sinapse'],
28
29
  [fs.existsSync(path.join(SINAPSE_HOME, '.claude', 'rules', 'squad-awareness.md')), 'squad-awareness.md'],
29
30
  ];
@@ -52,7 +53,7 @@ function cmdList() {
52
53
 
53
54
  logger.always('');
54
55
  logger.always(` ${BOLD}Total: ${GREEN}${totalAgents} agents${NC} | ${YELLOW}${totalTasks} tasks${NC}`);
55
- logger.always(` ${BOLD}Invoke: ${CYAN}/SINAPSE:agents:{agent-id}${NC}`);
56
+ logger.always(` ${BOLD}Invoke: ${CYAN}$sinapse-agent <agent-id>${NC}`);
56
57
  logger.always('');
57
58
  }
58
59