sinapse-ai 7.7.0 → 7.7.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.
package/.claude/CLAUDE.md CHANGED
@@ -23,6 +23,7 @@ O SINAPSE possui uma **Constitution formal** com princípios inegociáveis e gat
23
23
  | VI | Absolute Imports | SHOULD |
24
24
  | VII | Ecosystem Metrics Accuracy | NON-NEGOTIABLE |
25
25
  | VIII | Mandatory Delegation | NON-NEGOTIABLE |
26
+ | IX | Safe Collaboration | NON-NEGOTIABLE |
26
27
 
27
28
  **Gates automáticos bloqueiam violações.** Consulte a Constitution para detalhes completos.
28
29
 
@@ -0,0 +1,162 @@
1
+ # Safe Collaboration — Git Safety Net (NON-NEGOTIABLE)
2
+
3
+ > **Applies to ALL agents, ALL projects using SINAPSE.**
4
+ > Users are product builders, NOT git experts.
5
+ > Agents MUST handle ALL git complexity automatically and safely.
6
+
7
+ ## Golden Rule
8
+
9
+ **Users focus on WHAT to build. Agents handle HOW to save and share it safely.**
10
+
11
+ Users should NEVER need to:
12
+ - Resolve merge conflicts manually
13
+ - Decide which branch to use
14
+ - Remember to pull before working
15
+ - Worry about overwriting each other's code
16
+ - Understand git rebase, cherry-pick, or force-push
17
+
18
+ ## Automatic Safety Protocol (every session)
19
+
20
+ ### 1. Session Start — Auto-Sync (MANDATORY)
21
+
22
+ Before ANY work begins in a session, the agent MUST:
23
+
24
+ ```
25
+ 1. git fetch origin
26
+ 2. Check if local main is behind origin/main
27
+ 3. If behind → git pull origin main (fast-forward only)
28
+ 4. If diverged → STOP, inform user, resolve safely
29
+ 5. Create work branch if not already on one
30
+ 6. Verify branch protection is active on main
31
+ ```
32
+
33
+ **NEVER start work on `main` directly.** Always create a feature branch.
34
+
35
+ ### 2. Branch Naming — Automatic
36
+
37
+ The agent creates the branch. The user never needs to name it.
38
+
39
+ | Who | Branch Pattern | Example |
40
+ |-----|---------------|---------|
41
+ | Caio's session | `caio/{type}/{short-desc}` | `caio/feat/installer-ux` |
42
+ | Matheus's session | `soier/{type}/{short-desc}` | `soier/fix/agent-config` |
43
+ | Unknown | `dev/{type}/{short-desc}` | `dev/feat/new-feature` |
44
+
45
+ Types: `feat`, `fix`, `refactor`, `docs`, `chore`, `test`
46
+
47
+ **Detection:** Check `git config user.name` or `$USERNAME` or `$USER` to determine who is working.
48
+
49
+ ### 3. Before Every Commit — Safety Checks (MANDATORY)
50
+
51
+ ```
52
+ 1. git status — verify only expected files changed
53
+ 2. git diff --stat — show summary to user
54
+ 3. SECRET SCAN — reject if ANY of these are staged:
55
+ - .env files (except .env.example with placeholders)
56
+ - Files containing API keys, tokens, passwords in plaintext
57
+ - Private keys (RSA, SSH, PGP)
58
+ - Database connection strings with credentials
59
+ - Webhook URLs with embedded tokens
60
+ 4. Commit with conventional message + story reference
61
+ ```
62
+
63
+ **If secrets detected → BLOCK commit, warn user, remove file from staging.**
64
+
65
+ ### 4. Before Push — Conflict Prevention (MANDATORY)
66
+
67
+ ```
68
+ 1. git fetch origin main
69
+ 2. git merge origin/main --no-edit (into feature branch)
70
+ 3. If conflicts → AGENT resolves them (not the user)
71
+ - For simple conflicts (whitespace, imports): auto-resolve
72
+ - For complex conflicts: show both versions, ask user which to keep
73
+ 4. Run tests after merge
74
+ 5. Only then: git push origin {branch}
75
+ ```
76
+
77
+ ### 5. PR Creation — Automatic
78
+
79
+ After push, the agent MUST:
80
+ ```
81
+ 1. gh pr create with clear title and description (uses PR template)
82
+ 2. Auto-assign the OTHER person as reviewer
83
+ 3. Inform the user: "PR criado, {outro} precisa aprovar"
84
+ ```
85
+
86
+ ### 6. After PR Merge — Cleanup
87
+
88
+ ```
89
+ 1. git checkout main
90
+ 2. git pull origin main
91
+ 3. Delete local feature branch
92
+ 4. Inform user: "Branch limpa, pronto para proximo trabalho"
93
+ ```
94
+
95
+ ## Conflict Resolution Rules
96
+
97
+ | Scenario | Agent Action |
98
+ |----------|-------------|
99
+ | Same file, different sections | Auto-merge (git handles) |
100
+ | Same file, same lines | Show diff, ask user which version to keep |
101
+ | Package.json version conflict | Always take higher version |
102
+ | Generated files (lock, build) | Regenerate after merge |
103
+ | Story/doc files | Merge both contents (additive) |
104
+
105
+ **NEVER use `--force` push. Use `--force-with-lease` ONLY as last resort with user confirmation.**
106
+
107
+ ## Communication Protocol
108
+
109
+ When working in parallel, agents MUST inform users about:
110
+
111
+ | Event | Message |
112
+ |-------|---------|
113
+ | Session start | "Atualizando seu projeto... X mudancas novas do {outro}." |
114
+ | Branch created | "Criada area segura para trabalhar: `caio/feat/xxx`" |
115
+ | Pre-push conflict found | "{outro} mudou {file}. Resolvendo automaticamente..." |
116
+ | Secret detected | "BLOQUEADO: encontrei {tipo} em {file}. Removendo antes de salvar." |
117
+ | PR created | "Enviei para revisao. {outro} precisa aprovar no GitHub." |
118
+ | PR merged by other | "{outro} aprovou suas mudancas. Atualizando seu projeto..." |
119
+
120
+ ## Destructive Operations — BLOCKED BY DEFAULT
121
+
122
+ These operations require EXPLICIT user confirmation before execution:
123
+
124
+ | Operation | Risk | Confirmation Required |
125
+ |-----------|------|----------------------|
126
+ | `git push --force` / `--force-with-lease` | Overwrite remote history | YES + explain risk |
127
+ | `git reset --hard` | Destroy local uncommitted work | YES + explain risk |
128
+ | `git branch -D` | Delete branch with unmerged commits | YES + explain risk |
129
+ | `git clean -f` | Delete untracked files permanently | YES + explain risk |
130
+ | Delete remote branch | Affects other collaborators | YES |
131
+
132
+ ## Anti-Patterns (FORBIDDEN)
133
+
134
+ - Letting user work on `main` directly
135
+ - Pushing to `main` without PR (branch protection enforces this)
136
+ - Ignoring `git fetch` at session start
137
+ - Letting conflicts accumulate (merge frequently)
138
+ - Using `git push --force` without explicit user confirmation
139
+ - Assuming the other person isn't working on the same area
140
+ - Committing without checking `git status` first
141
+ - Skipping tests after resolving conflicts
142
+ - Committing files containing secrets or credentials
143
+ - Running destructive git operations without user confirmation
144
+
145
+ ## For Projects Using SINAPSE (not just sinapse-ai repo)
146
+
147
+ These same rules apply to ANY project where SINAPSE agents operate:
148
+ 1. Auto-branch before work
149
+ 2. Auto-sync before starting
150
+ 3. Secret scan before every commit
151
+ 4. Auto-resolve simple conflicts
152
+ 5. Auto-PR with reviewer assignment
153
+ 6. User never touches git directly
154
+
155
+ ## User Cheat Sheet (the ONLY things users do manually)
156
+
157
+ ```
158
+ ! git push origin main ← when agent can't push (hook block)
159
+ ! npm publish ← when publishing to NPM
160
+ ```
161
+
162
+ Everything else: **ask the agent to do it.**
@@ -1,6 +1,6 @@
1
1
  # SINAPSE Constitution
2
2
 
3
- > **Version:** 2.0.0 | **Ratified:** 2025-01-30 | **Last Amended:** 2026-03-30
3
+ > **Version:** 2.1.0 | **Ratified:** 2025-01-30 | **Last Amended:** 2026-04-02
4
4
 
5
5
  Este documento define os princípios fundamentais e inegociáveis do SINAPSE. Todos os agentes, tasks, e workflows DEVEM respeitar estes princípios. Violações são bloqueadas automaticamente via gates.
6
6
 
@@ -207,6 +207,38 @@ Orquestradores (sinapse-orqx e todos os *-orqx) NUNCA executam trabalho de domí
207
207
 
208
208
  ---
209
209
 
210
+ ### IX. Safe Collaboration (NON-NEGOTIABLE)
211
+
212
+ Usuários são product builders, não especialistas em git. Agentes DEVEM gerenciar toda a complexidade de versionamento e colaboração automaticamente, garantindo que nenhum trabalho seja perdido ou sobrescrito.
213
+
214
+ **Regras:**
215
+ - MUST: Agentes DEVEM executar `git fetch` + sync no início de TODA sessão antes de qualquer trabalho
216
+ - MUST: TODO trabalho DEVE acontecer em feature branch — NUNCA diretamente em `main`
217
+ - MUST: Agentes DEVEM criar branches automaticamente com padrão `{user}/{type}/{desc}`
218
+ - MUST: Agentes DEVEM escanear por secrets (tokens, senhas, chaves) antes de CADA commit — BLOQUEAR se encontrado
219
+ - MUST: Antes de push, agentes DEVEM fazer merge de `origin/main` na branch e resolver conflitos
220
+ - MUST: Agentes DEVEM criar PRs automaticamente com reviewer assignment após push
221
+ - MUST: Operações destrutivas (`--force`, `reset --hard`, `branch -D`) requerem confirmação EXPLÍCITA do usuário
222
+ - MUST NOT: Nenhum agente pode fazer push direto para `main` (branch protection + hook)
223
+ - MUST NOT: Nenhum agente pode usar `git push --force` sem confirmação explícita do usuário
224
+ - MUST NOT: Nenhum agente pode commitar arquivos contendo credentials em plaintext
225
+
226
+ **Comunicação com o usuário:**
227
+ - Usar linguagem simples, sem jargão git
228
+ - "Salvei seu trabalho" em vez de "commitei no HEAD"
229
+ - "Enviei para revisão" em vez de "pushei e criei PR"
230
+ - "Atualizei seu projeto" em vez de "fiz fetch + merge de origin/main"
231
+
232
+ **Aplicação:**
233
+ - Aplica-se a TODOS os projetos onde agentes SINAPSE operam
234
+ - Template reutilizável: `.sinapse-ai/infrastructure/templates/safe-collab/`
235
+
236
+ **Gate:** Hook `enforce-git-push-authority.sh` + branch protection no GitHub
237
+
238
+ **Rule file:** `.claude/rules/safe-collaboration.md`
239
+
240
+ ---
241
+
210
242
  ## Governance
211
243
 
212
244
  ### Amendment Process
@@ -28,6 +28,7 @@ const KEY_ARTICLES = [
28
28
  'Absolute Imports',
29
29
  'Ecosystem Metrics Accuracy',
30
30
  'Mandatory Delegation',
31
+ 'Safe Collaboration',
31
32
  ];
32
33
 
33
34
  /**
@@ -27,6 +27,7 @@ const EXPECTED_ARTICLES = [
27
27
  { number: 'VI', title: 'Absolute Imports', severity: 'SHOULD' },
28
28
  { number: 'VII', title: 'Ecosystem Metrics Accuracy', severity: 'NON-NEGOTIABLE' },
29
29
  { number: 'VIII', title: 'Mandatory Delegation', severity: 'NON-NEGOTIABLE' },
30
+ { number: 'IX', title: 'Safe Collaboration', severity: 'NON-NEGOTIABLE' },
30
31
  ];
31
32
 
32
33
  /**
@@ -1,6 +1,6 @@
1
1
  metadata:
2
2
  version: 1.0.0
3
- lastUpdated: '2026-03-30T18:05:54.956Z'
3
+ lastUpdated: '2026-04-02T01:18:15.936Z'
4
4
  entityCount: 740
5
5
  checksumAlgorithm: sha256
6
6
  resolutionRate: 100
@@ -6441,13 +6441,7 @@ entities:
6441
6441
  - development
6442
6442
  - code
6443
6443
  usedBy: []
6444
- dependencies:
6445
- - architect
6446
- - analyst
6447
- - data-engineer
6448
- - ux-design-expert
6449
- - devops
6450
- - sinapse-orqx
6444
+ dependencies: []
6451
6445
  externalDeps: []
6452
6446
  plannedDeps: []
6453
6447
  lifecycle: experimental
@@ -6455,8 +6449,8 @@ entities:
6455
6449
  score: 0.5
6456
6450
  constraints: []
6457
6451
  extensionPoints: []
6458
- checksum: sha256:ffdaf95cccaba6355368ca2e3ba2d2675e2661c52a91adaeb5cc265dca894f5a
6459
- lastVerified: '2026-03-30T18:05:54.953Z'
6452
+ checksum: sha256:e82e8b6cc5c64791ba3a70ca728a920ce522d56e9a60dd0bb4ee76b9a150adf9
6453
+ lastVerified: '2026-04-02T01:18:15.934Z'
6460
6454
  codex-rules:
6461
6455
  path: .sinapse-ai/product/templates/ide-rules/codex-rules.md
6462
6456
  layer: L2
@@ -10504,8 +10498,8 @@ entities:
10504
10498
  score: 0.4
10505
10499
  constraints: []
10506
10500
  extensionPoints: []
10507
- checksum: sha256:55cd12c67c7dfbd35dc25db20b35b94fa4e8e5104488dacf6fc4834be73eb767
10508
- lastVerified: '2026-03-30T18:05:54.952Z'
10501
+ checksum: sha256:63f4aa67ac27b337d017c7b642b1e3554bd02554fa69e29b14ebb8922827b4b9
10502
+ lastVerified: '2026-04-02T01:18:15.934Z'
10509
10503
  core-config:
10510
10504
  path: .sinapse-ai/core/doctor/checks/core-config.js
10511
10505
  layer: L1
@@ -12609,7 +12603,6 @@ entities:
12609
12603
  - brownfield-risk-report-tmpl
12610
12604
  - design-story-tmpl
12611
12605
  - story-tmpl
12612
- - claude-rules
12613
12606
  - codex-rules
12614
12607
  - entity-registry
12615
12608
  - brownfield-discovery
@@ -12669,7 +12662,6 @@ entities:
12669
12662
  - verify-subtask
12670
12663
  - design-story-tmpl
12671
12664
  - story-tmpl
12672
- - claude-rules
12673
12665
  - codex-rules
12674
12666
  - brownfield-compatibility-checklist
12675
12667
  - brownfield-discovery
@@ -12728,7 +12720,6 @@ entities:
12728
12720
  - brownfield-create-epic
12729
12721
  - validate-next-story
12730
12722
  - story-tmpl
12731
- - claude-rules
12732
12723
  - codex-rules
12733
12724
  - brownfield-discovery
12734
12725
  dependencies:
@@ -12877,7 +12868,6 @@ entities:
12877
12868
  - update-sinapse
12878
12869
  - validate-next-story
12879
12870
  - story-tmpl
12880
- - claude-rules
12881
12871
  - codex-rules
12882
12872
  - memory-audit-checklist
12883
12873
  - greenfield-fullstack
@@ -13061,7 +13051,6 @@ entities:
13061
13051
  - run-workflow-engine
13062
13052
  - run-workflow
13063
13053
  - sync-registry-intel
13064
- - claude-rules
13065
13054
  - codex-rules
13066
13055
  dependencies: []
13067
13056
  externalDeps: []
@@ -13155,7 +13144,6 @@ entities:
13155
13144
  - validate-next-story
13156
13145
  - design-story-tmpl
13157
13146
  - story-tmpl
13158
- - claude-rules
13159
13147
  - codex-rules
13160
13148
  - brownfield-discovery
13161
13149
  - brownfield-ui
@@ -551,3 +551,9 @@
551
551
  {"timestamp":"2026-03-30T18:05:54.953Z","action":"change","path":".sinapse-ai/development/tasks/dev-develop-story.md","trigger":"watcher"}
552
552
  {"timestamp":"2026-03-30T18:05:54.953Z","action":"change","path":".sinapse-ai/development/tasks/health-check.yaml","trigger":"watcher"}
553
553
  {"timestamp":"2026-03-30T18:05:54.953Z","action":"change","path":".sinapse-ai/product/templates/ide-rules/claude-rules.md","trigger":"watcher"}
554
+ {"timestamp":"2026-04-02T01:14:38.759Z","action":"change","path":".sinapse-ai/core/doctor/checks/constitution-consistency.js","trigger":"watcher"}
555
+ {"timestamp":"2026-04-02T01:14:38.761Z","action":"change","path":".sinapse-ai/core/health-check/checks/project/constitution-consistency.js","trigger":"watcher"}
556
+ {"timestamp":"2026-04-02T01:14:38.762Z","action":"change","path":".sinapse-ai/product/templates/ide-rules/claude-rules.md","trigger":"watcher"}
557
+ {"timestamp":"2026-04-02T01:18:15.933Z","action":"change","path":".sinapse-ai/core/doctor/checks/constitution-consistency.js","trigger":"watcher"}
558
+ {"timestamp":"2026-04-02T01:18:15.934Z","action":"change","path":".sinapse-ai/core/health-check/checks/project/constitution-consistency.js","trigger":"watcher"}
559
+ {"timestamp":"2026-04-02T01:18:15.934Z","action":"change","path":".sinapse-ai/product/templates/ide-rules/claude-rules.md","trigger":"watcher"}
@@ -0,0 +1,16 @@
1
+ # Code Owners — {{PROJECT_NAME}}
2
+ # All PRs require approval from an owner before merge.
3
+
4
+ # Default: all files require owner review
5
+ * @{{OWNER_GITHUB}} @{{COLLAB_GITHUB}}
6
+
7
+ # Critical paths (framework, config, CI/CD)
8
+ .sinapse-ai/ @{{OWNER_GITHUB}}
9
+ .claude/ @{{OWNER_GITHUB}}
10
+ .github/ @{{OWNER_GITHUB}}
11
+ package.json @{{OWNER_GITHUB}}
12
+
13
+ # Security-sensitive
14
+ .env* @{{OWNER_GITHUB}}
15
+ *.config.js @{{OWNER_GITHUB}}
16
+ *.config.ts @{{OWNER_GITHUB}}
@@ -0,0 +1,39 @@
1
+ # Safe Collaboration Template
2
+
3
+ Template reutilizavel para configurar colaboracao segura em qualquer projeto.
4
+
5
+ ## Uso
6
+
7
+ Copie os arquivos deste diretorio para o projeto alvo:
8
+
9
+ ```bash
10
+ # 1. Regra para agentes Claude Code
11
+ cp safe-collaboration-rule.md <projeto>/.claude/rules/safe-collaboration.md
12
+
13
+ # 2. Guia para a equipe
14
+ cp parallel-workflow-guide.md <projeto>/docs/guides/parallel-workflow.md
15
+
16
+ # 3. CODEOWNERS (ajuste os usernames)
17
+ cp CODEOWNERS.template <projeto>/.github/CODEOWNERS
18
+
19
+ # 4. PR template simplificado
20
+ cp pull_request_template.md <projeto>/.github/PULL_REQUEST_TEMPLATE.md
21
+ ```
22
+
23
+ ## Configuracao no GitHub
24
+
25
+ Apos copiar os arquivos, configure no repositorio:
26
+
27
+ 1. Settings > Rules > Rulesets > New ruleset
28
+ - Target: `main`
29
+ - Block direct pushes
30
+ - Require 1 PR approval
31
+ - Block force pushes
32
+ - Block branch deletion
33
+ - Dismiss stale reviews
34
+
35
+ 2. Settings > Collaborators
36
+ - Adicionar membros com permissao `Write` (nunca Admin)
37
+
38
+ 3. Settings > General
39
+ - Marcar "Automatically delete head branches"
@@ -0,0 +1,55 @@
1
+ # Trabalhando em Paralelo — Guia para a Equipe
2
+
3
+ ## TL;DR
4
+
5
+ Voces focam no codigo. O Claude Code cuida do git.
6
+
7
+ ## Glossario
8
+
9
+ | Termo | Significado |
10
+ |-------|-------------|
11
+ | **main** | Versao oficial do projeto. Ninguem mexe direto. |
12
+ | **branch** | Copia temporaria onde voce trabalha com seguranca. |
13
+ | **PR** | Pedido para o outro revisar suas mudancas. |
14
+ | **merge** | Juntar mudancas no main apos aprovacao. |
15
+ | **conflito** | Dois mexeram no mesmo trecho. O agente resolve. |
16
+
17
+ ## Fluxo
18
+
19
+ ```
20
+ Voce pede → Agente cria area segura → Trabalha → Agente salva
21
+ → Envia para revisao → Outro aprova → Vai pro main
22
+ ```
23
+
24
+ ## O que voce FAZ
25
+
26
+ 1. Abrir o Claude Code
27
+ 2. Pedir o que quer fazer
28
+ 3. Revisar o que mudou
29
+ 4. Aprovar mudancas do outro no GitHub
30
+
31
+ ## Regras
32
+
33
+ 1. **Dividam areas** — combinem quem mexe onde
34
+ 2. **Mudancas pequenas** — enviem todo dia, nao acumulem
35
+ 3. **Atualizem no inicio** — diga "sincroniza e cria branch para [tarefa]"
36
+ 4. **Nunca trabalhem no main** — sempre em branch
37
+ 5. **Avisem antes de mexer na area do outro**
38
+
39
+ ## Se algo der errado
40
+
41
+ | Problema | Solucao |
42
+ |----------|---------|
43
+ | Codigo sumiu | Nada some. Peca ao agente recuperar. |
44
+ | Conflito | Agente resolve. Mostra as versoes. |
45
+ | Push rejeitado | Agente atualiza e tenta de novo. |
46
+ | PR com problema | Agente corrige e reenvia. |
47
+
48
+ ## Aprovando PRs
49
+
50
+ 1. GitHub > Pull requests
51
+ 2. Clique na PR
52
+ 3. Review changes > Approve > Submit
53
+ 4. Squash and merge
54
+
55
+ Branch e apagada automaticamente.
@@ -0,0 +1,11 @@
1
+ ## O que mudou?
2
+ <!-- Descreva brevemente o que essa PR faz -->
3
+
4
+ ## Por que?
5
+ <!-- Link para issue/story ou explique o motivo -->
6
+
7
+ ## Checklist
8
+ - [ ] Testei localmente
9
+ - [ ] Sem erros ou warnings novos
10
+ - [ ] Nao modifiquei arquivos em .sinapse-ai/ ou .claude/ (a menos que fosse necessario)
11
+ - [ ] Nao tem senhas, tokens ou chaves no codigo
@@ -0,0 +1,82 @@
1
+ # Safe Collaboration — Git Safety Net (NON-NEGOTIABLE)
2
+
3
+ > **Applies to ALL agents in this project.**
4
+ > Users are product builders, NOT git experts.
5
+ > Agents MUST handle ALL git complexity automatically and safely.
6
+
7
+ ## Golden Rule
8
+
9
+ **Users focus on WHAT to build. Agents handle HOW to save and share it safely.**
10
+
11
+ Users should NEVER need to:
12
+ - Resolve merge conflicts manually
13
+ - Decide which branch to use
14
+ - Remember to pull before working
15
+ - Worry about overwriting each other's code
16
+
17
+ ## Session Start — Auto-Sync (MANDATORY)
18
+
19
+ Before ANY work begins, the agent MUST:
20
+ 1. `git fetch origin`
21
+ 2. Check if local main is behind origin/main
22
+ 3. If behind: `git pull origin main` (fast-forward only)
23
+ 4. If diverged: STOP, inform user, resolve safely
24
+ 5. Create work branch if not already on one
25
+ 6. NEVER start work on `main` directly
26
+
27
+ ## Branch Naming — Automatic
28
+
29
+ | Who | Pattern | Example |
30
+ |-----|---------|---------|
31
+ | {{USER_1}} | `{{user1}}/{type}/{desc}` | `{{user1}}/feat/new-feature` |
32
+ | {{USER_2}} | `{{user2}}/{type}/{desc}` | `{{user2}}/fix/bug-fix` |
33
+
34
+ Types: `feat`, `fix`, `refactor`, `docs`, `chore`, `test`
35
+
36
+ ## Before Every Commit — Safety Checks
37
+
38
+ 1. `git status` — verify only expected files changed
39
+ 2. `git diff --stat` — show summary to user
40
+ 3. SECRET SCAN — reject .env, API keys, tokens, passwords, private keys
41
+ 4. Commit with conventional message
42
+
43
+ ## Before Push — Conflict Prevention
44
+
45
+ 1. `git fetch origin main`
46
+ 2. `git merge origin/main --no-edit` (into feature branch)
47
+ 3. If conflicts: agent resolves (simple: auto, complex: ask user)
48
+ 4. Run tests after merge
49
+ 5. Only then: push
50
+
51
+ ## PR Creation — Automatic
52
+
53
+ 1. `gh pr create` with clear title/description
54
+ 2. Auto-assign other team member as reviewer
55
+ 3. Inform user in simple language
56
+
57
+ ## Conflict Resolution
58
+
59
+ | Scenario | Action |
60
+ |----------|--------|
61
+ | Same file, different sections | Auto-merge |
62
+ | Same file, same lines | Show both, ask user |
63
+ | package.json version | Take higher version |
64
+ | Generated files | Regenerate |
65
+ | Docs | Merge both (additive) |
66
+
67
+ ## Destructive Operations — BLOCKED
68
+
69
+ These require EXPLICIT user confirmation:
70
+ - `git push --force` / `--force-with-lease`
71
+ - `git reset --hard`
72
+ - `git branch -D`
73
+ - `git clean -f`
74
+
75
+ ## Anti-Patterns (FORBIDDEN)
76
+
77
+ - Working on `main` directly
78
+ - Pushing without PR
79
+ - Skipping `git fetch` at session start
80
+ - Using `--force` without confirmation
81
+ - Committing secrets
82
+ - Skipping tests after conflict resolution
@@ -7,10 +7,10 @@
7
7
  # - SHA256 hashes for change detection
8
8
  # - File types for categorization
9
9
  #
10
- version: 7.7.0
11
- generated_at: "2026-04-01T14:18:00.782Z"
10
+ version: 7.7.2
11
+ generated_at: "2026-04-02T01:18:27.515Z"
12
12
  generator: scripts/generate-install-manifest.js
13
- file_count: 1107
13
+ file_count: 1112
14
14
  files:
15
15
  - path: cli/commands/config/index.js
16
16
  hash: sha256:66f111eceef0f60fa0a8904add783b615d55b01d5fe36408623c3dd828e702f6
@@ -313,9 +313,9 @@ files:
313
313
  type: core
314
314
  size: 1724
315
315
  - path: core/doctor/checks/constitution-consistency.js
316
- hash: sha256:659489ab7c353f4b69473e72b046e43ada1342acdc017398cb6a0b60ffb0ef5b
316
+ hash: sha256:7d61a71fcc8eeaf139a9bea634dff99154441808e8411f4290ae5a34fa919951
317
317
  type: core
318
- size: 3083
318
+ size: 3107
319
319
  - path: core/doctor/checks/core-config.js
320
320
  hash: sha256:5424528eefbc2f19213b30d00dcd96128acefdbb289c25712be844f0fbddb963
321
321
  type: core
@@ -581,9 +581,9 @@ files:
581
581
  type: core
582
582
  size: 4733
583
583
  - path: core/health-check/checks/project/constitution-consistency.js
584
- hash: sha256:55cd12c67c7dfbd35dc25db20b35b94fa4e8e5104488dacf6fc4834be73eb767
584
+ hash: sha256:63f4aa67ac27b337d017c7b642b1e3554bd02554fa69e29b14ebb8922827b4b9
585
585
  type: core
586
- size: 5883
586
+ size: 5960
587
587
  - path: core/health-check/checks/project/dependencies.js
588
588
  hash: sha256:a8f4d9fcadf5dc3274d8ed0605af6f25d6554b1a9b0d3e66c63d8ea4569c95b9
589
589
  type: core
@@ -1237,9 +1237,9 @@ files:
1237
1237
  type: data
1238
1238
  size: 9586
1239
1239
  - path: data/entity-registry.yaml
1240
- hash: sha256:0ef926d7947a2e9a9b95e20a7309f9910b0ba2004bf18c9472d71bdc2b5fa9c9
1240
+ hash: sha256:0a28211d3375c09475cbcbe0753a0add546e8243d0853a99e998fd9fe642dcac
1241
1241
  type: data
1242
- size: 512364
1242
+ size: 512100
1243
1243
  - path: data/learned-patterns.yaml
1244
1244
  hash: sha256:24ac0b160615583a0ff783d3da8af80b7f94191575d6db2054ec8e10a3f945dc
1245
1245
  type: data
@@ -3508,6 +3508,26 @@ files:
3508
3508
  hash: sha256:4c9b70cacde88097d53f9d4d6e2319f65cabf6a076047195cdcf949d9e949512
3509
3509
  type: template
3510
3510
  size: 5567
3511
+ - path: infrastructure/templates/safe-collab/CODEOWNERS.template
3512
+ hash: sha256:988d5f6e373df03913d84c11cc42af42917f702920059ef296b2b236be7387e8
3513
+ type: template
3514
+ size: 476
3515
+ - path: infrastructure/templates/safe-collab/parallel-workflow-guide.md
3516
+ hash: sha256:773473b226fe19eb5f6b9769f28c3388fba6f0700ca4c2bd80af9891f34dc433
3517
+ type: template
3518
+ size: 1485
3519
+ - path: infrastructure/templates/safe-collab/pull_request_template.md
3520
+ hash: sha256:1f07f6cb99640c15e11c685debd2dd66dc46ec4dce6a80ba3f1efdc3fb2e5bd7
3521
+ type: template
3522
+ size: 338
3523
+ - path: infrastructure/templates/safe-collab/README.md
3524
+ hash: sha256:7738672d855290ba8f039bf1b136650db75a948e57fc307136837cd121c4df42
3525
+ type: template
3526
+ size: 1024
3527
+ - path: infrastructure/templates/safe-collab/safe-collaboration-rule.md
3528
+ hash: sha256:e68e7df44bcb54d1f9ae1d3b121027819b8a0a2ba7e6a20e0fd181c86301af5e
3529
+ type: template
3530
+ size: 2449
3511
3531
  - path: infrastructure/templates/sinapse-sync.yaml.template
3512
3532
  hash: sha256:36ada7873fcbd5bab225b528c7be39035a12fc156135cc82c73d75782d7c53a2
3513
3533
  type: template
@@ -3929,9 +3949,9 @@ files:
3929
3949
  type: template
3930
3950
  size: 3691
3931
3951
  - path: product/templates/ide-rules/claude-rules.md
3932
- hash: sha256:ffdaf95cccaba6355368ca2e3ba2d2675e2661c52a91adaeb5cc265dca894f5a
3952
+ hash: sha256:e82e8b6cc5c64791ba3a70ca728a920ce522d56e9a60dd0bb4ee76b9a150adf9
3933
3953
  type: template
3934
- size: 13296
3954
+ size: 13341
3935
3955
  - path: product/templates/ide-rules/codex-rules.md
3936
3956
  hash: sha256:601ffec5e24ff5e247c25e4d61728167503722acc817a1b30fbd695182bed1bc
3937
3957
  type: template
@@ -27,6 +27,7 @@ O SINAPSE possui uma **Constitution formal** com princípios inegociáveis e gat
27
27
  | VI | Absolute Imports | SHOULD |
28
28
  | VII | Ecosystem Metrics Accuracy | NON-NEGOTIABLE |
29
29
  | VIII | Mandatory Delegation | NON-NEGOTIABLE |
30
+ | IX | Safe Collaboration | NON-NEGOTIABLE |
30
31
 
31
32
  **Gates automáticos bloqueiam violações.** Consulte a Constitution para detalhes completos.
32
33
  <!-- SINAPSE-MANAGED-END: constitution -->
@@ -39,7 +39,7 @@ cd my-first-project
39
39
  - Claude Code: `/agent-name`
40
40
  - Gemini CLI: `/sinapse-menu` then `/sinapse-<agent>`
41
41
  - Codex CLI: `/skills` then `sinapse-<agent-id>`
42
- - Cursor/Copilot/AntiGravity: follow constraints in `docs/ide-integration.md`
42
+ - Cursor/Copilot: follow constraints in `docs/ide-integration.md`
43
43
 
44
44
  ### Step 3: Validate first value
45
45
 
@@ -179,7 +179,7 @@ Summary:
179
179
  | Codex CLI | Limited | `/skills` then `sinapse-<agent-id>` |
180
180
  | Cursor | Limited | `@agent` + synced rules |
181
181
  | GitHub Copilot | Limited | chat modes + repo instructions |
182
- | AntiGravity | Limited | workflow-driven activation |
182
+
183
183
 
184
184
  - **Works**: fully recommended for new users.
185
185
  - **Limited**: usable with documented workarounds.
@@ -0,0 +1,104 @@
1
+ # Trabalhando em Paralelo — Guia para Caio e Matheus
2
+
3
+ ## TL;DR
4
+
5
+ Voces focam no codigo. O Claude Code cuida do git.
6
+
7
+ ## Glossario rapido
8
+
9
+ | Termo | O que significa |
10
+ |-------|----------------|
11
+ | **main** | A versao "oficial" do projeto. Ninguem mexe direto nela. |
12
+ | **branch** | Uma copia temporaria onde voce trabalha sem afetar o main. |
13
+ | **PR (Pull Request)** | Um pedido para o outro revisar e aprovar suas mudancas. |
14
+ | **merge** | Juntar suas mudancas de volta no main apos aprovacao. |
15
+ | **conflito** | Quando dois mexeram no mesmo trecho. O agente resolve. |
16
+
17
+ ## Como funciona
18
+
19
+ ```
20
+ Voce pede algo → Agente cria area segura → Voce trabalha → Agente salva
21
+ → Agente envia para revisao → Outro aprova → Mudancas vao pro main
22
+ ```
23
+
24
+ ## O que voce FAZ
25
+
26
+ 1. **Abrir o Claude Code** no projeto
27
+ 2. **Pedir o que quer fazer** ("otimiza tal agent", "melhora o installer", etc)
28
+ 3. **Revisar o que o agente fez** (ele mostra o que mudou)
29
+ 4. **Aprovar mudancas do outro** no GitHub quando pedir
30
+
31
+ ## O que voce NAO precisa fazer
32
+
33
+ - Criar branches (o agente cria)
34
+ - Resolver conflitos (o agente resolve)
35
+ - Lembrar de atualizar o projeto (o agente faz no inicio)
36
+ - Escrever mensagens de commit (o agente escreve)
37
+ - Saber comandos git (o agente sabe)
38
+
39
+ ## Regra #1: Dividam as areas
40
+
41
+ Para evitar que os dois mexam no mesmo arquivo ao mesmo tempo:
42
+
43
+ | Area | Responsavel |
44
+ |------|-------------|
45
+ | Installer, CLI, hooks | Caio |
46
+ | Squads, agents, tasks | Matheus |
47
+ | Docs, stories | Quem estiver trabalhando naquela feature |
48
+ | Tests | Quem escreveu o codigo |
49
+
50
+ Se precisar mexer na area do outro: **avisem antes no WhatsApp/Discord**.
51
+
52
+ ## Regra #2: Mudancas pequenas e frequentes
53
+
54
+ - Uma PR por feature ou correcao
55
+ - Nao acumule 3 dias de trabalho — envie todo dia
56
+ - Mudanca pequena = revisao rapida = menos chance de conflito
57
+
58
+ ## Regra #3: Atualizar no inicio do dia
59
+
60
+ Ao abrir o Claude Code, diga:
61
+
62
+ > "sincroniza e cria branch para [o que vou fazer]"
63
+
64
+ O agente atualiza tudo e cria uma area segura para trabalhar.
65
+
66
+ ## NUNCA faca isso
67
+
68
+ - **Nunca trabalhe direto no main** — o GitHub bloqueia, mas se por algum motivo conseguir, PARE e avise
69
+ - **Nunca delete branches do outro** — so delete as suas
70
+ - **Nunca faca push sem antes pedir ao agente** — ele verifica conflitos antes
71
+
72
+ ## Se algo der errado
73
+
74
+ | Problema | O que fazer |
75
+ |----------|-------------|
76
+ | "Meu codigo sumiu!" | Calma. Nada some no git. Peca ao agente: "recupera minhas mudancas" |
77
+ | "Deu conflito" | Peca ao agente: "resolve o conflito". Ele mostra as duas versoes e pergunta qual manter. |
78
+ | "Nao consigo enviar" | O main mudou. Peca ao agente: "atualiza minha branch e tenta de novo" |
79
+ | "A PR ta com problema" | Peca ao agente: "corrige a PR". Ele atualiza e reenvia. |
80
+ | "Fiz algo errado no main" | Peca ao agente: "desfaz a ultima mudanca no main". Ele sabe como reverter com seguranca. |
81
+
82
+ ## Aprovando mudancas do outro (unica coisa manual)
83
+
84
+ 1. Abra o GitHub do projeto na aba **Pull requests**
85
+ 2. Clique na PR do outro
86
+ 3. Leia o resumo do que mudou
87
+ 4. Clique **Review changes**
88
+ 5. Selecione **Approve**
89
+ 6. Clique **Submit review**
90
+ 7. Clique **Squash and merge** (junta tudo em uma mudanca limpa)
91
+
92
+ Pronto. A branch temporaria e apagada automaticamente.
93
+
94
+ ## Dica: como pedir coisas ao agente
95
+
96
+ Em vez de comandos tecnicos, fale normalmente:
97
+
98
+ | Voce diz | O agente entende |
99
+ |----------|------------------|
100
+ | "salva meu trabalho" | git add + commit |
101
+ | "envia pro Soier revisar" | push + criar PR |
102
+ | "atualiza meu projeto" | git fetch + pull + merge |
103
+ | "o que o Caio mudou?" | git log + diff |
104
+ | "desfaz isso" | git revert (seguro) |
@@ -115,7 +115,7 @@ IDE-specific rule files generated during project setup. Referenced in service-re
115
115
 
116
116
  | # | File | Consuming Task(s) | Consuming Agent(s) | Workflow(s) | Orphan? |
117
117
  |---|------|--------------------|---------------------|-------------|---------|
118
- | 1 | `antigravity-rules.md` | -- (service-registry, workers.csv) | -- | -- | **WEAK** |
118
+
119
119
  | 2 | `claude-rules.md` | -- (service-registry, workers.csv) | -- | -- | **WEAK** |
120
120
  | 4 | `copilot-rules.md` | -- (service-registry, workers.csv) | -- | -- | **WEAK** |
121
121
  | 5 | `cursor-rules.md` | -- (service-registry, workers.csv) | -- | -- | **WEAK** |
@@ -126,7 +126,6 @@ These scripts exist in the scripts/ directory but are NOT part of the module's p
126
126
  | 4 | `scripts/ide-sync/redirect-generator.js` | IDE Sync | Creates redirect files for deprecated agents | `fs-extra` | ide-sync/index.js | No |
127
127
  | 5 | `scripts/ide-sync/transformers/claude-code.js` | IDE Sync | Transforms agent definitions for Claude Code | -- | ide-sync/index.js, tests | No |
128
128
  | 6 | `scripts/ide-sync/transformers/cursor.js` | IDE Sync | Transforms agent definitions for Cursor IDE | -- | ide-sync/index.js, tests | No |
129
- | 8 | `scripts/ide-sync/transformers/antigravity.js` | IDE Sync | Transforms agent definitions for Antigravity | -- | ide-sync/index.js, tests | No |
130
129
 
131
130
  ### 1.4 Documentation Integrity Sub-module (7 files)
132
131
 
@@ -13,19 +13,19 @@ Guia para integrar o SINAPSE com IDEs e plataformas de desenvolvimento com IA su
13
13
 
14
14
  ## IDEs Suportadas
15
15
 
16
- O SINAPSE suporta 6 plataformas de desenvolvimento com IA. Escolha a que melhor se adapta ao seu fluxo de trabalho.
16
+ O SINAPSE suporta 5 plataformas de desenvolvimento com IA. Escolha a que melhor se adapta ao seu fluxo de trabalho.
17
17
 
18
18
  ### Tabela de Comparação Rápida
19
19
 
20
- | Funcionalidade | Claude Code | Codex CLI | Cursor | Copilot | AntiGravity | Gemini CLI |
21
- | ---------------------- | :---------: | :-------: | :----: | :-----: | :---------: | :--------: |
22
- | **Ativação de Agente** | /command | /skills | @mention | chat modes | workflow-based | prompt mention |
23
- | **Suporte MCP** | Native | Native | Config | Config | Provider-specific | Native |
24
- | **Tarefas de Subagente** | Yes | Yes | No | No | Yes | No |
25
- | **Auto-sync** | Yes | Yes | Yes | Yes | Yes | Yes |
26
- | **Sistema de Hooks** | Yes | Limited | No | No | No | Yes |
27
- | **Skills/Commands** | Native | Native | No | No | No | Native |
28
- | **Recomendação** | Best | Best | Best | Good | Good | Good |
20
+ | Funcionalidade | Claude Code | Codex CLI | Cursor | Copilot | Gemini CLI |
21
+ | ---------------------- | :---------: | :-------: | :----: | :-----: | :--------: |
22
+ | **Ativação de Agente** | /command | /skills | @mention | chat modes | prompt mention |
23
+ | **Suporte MCP** | Native | Native | Config | Config | Native |
24
+ | **Tarefas de Subagente** | Yes | Yes | No | No | No |
25
+ | **Auto-sync** | Yes | Yes | Yes | Yes | Yes |
26
+ | **Sistema de Hooks** | Yes | Limited | No | No | Yes |
27
+ | **Skills/Commands** | Native | Native | No | No | Native |
28
+ | **Recomendação** | Best | Best | Best | Good | Good |
29
29
 
30
30
  ### Paridade de Hooks e Impacto Funcional
31
31
 
@@ -36,17 +36,17 @@ O SINAPSE suporta 6 plataformas de desenvolvimento com IA. Escolha a que melhor
36
36
  | Codex CLI | Limitada/parcial | Menor automação de ciclo de sessão e menor enforcement pre/post-tool | `AGENTS.md` + `/skills` + MCP + scripts de sync/validação |
37
37
  | Cursor | Sem hooks de ciclo equivalentes | Sem interceptação nativa pre/post-tool e trilha automática mais fraca | Regras sincronizadas + MCP + disciplina de workflow |
38
38
  | GitHub Copilot | Sem hooks de ciclo equivalentes | Mesmo impacto do Cursor, com maior dependência de fluxo manual | Instruções de repo, chat modes e MCP no VS Code |
39
- | AntiGravity | Baseado em workflow (não em hooks) | Sem paridade de ciclo de vida ao estilo Claude | Geração de workflows + sync de agentes |
39
+
40
40
 
41
41
  ### Consequências Práticas por Capacidade
42
42
 
43
43
  - Automação `SessionStart/SessionEnd`:
44
44
  - Forte em Claude/Gemini.
45
- - Parcial ou manual em Codex/Cursor/Copilot/AntiGravity.
45
+ - Parcial ou manual em Codex/Cursor/Copilot.
46
46
  - Guardrails `BeforeTool/AfterTool`:
47
47
  - Mais robustos em Claude/Gemini.
48
48
  - Limitados no Codex.
49
- - Predominantemente processuais em Cursor/Copilot/AntiGravity.
49
+ - Predominantemente processuais em Cursor/Copilot.
50
50
  - Riqueza de auditoria e telemetria automáticas:
51
51
  - Maior onde há hooks de ciclo de vida.
52
52
  - Menor onde a integração é majoritariamente por regras/instruções.
@@ -209,31 +209,6 @@ cat .github/copilot-instructions.md
209
209
 
210
210
  ---
211
211
 
212
- ### AntiGravity
213
-
214
- **Nível de Recomendação:** Bom (integração com Google)
215
-
216
- ```yaml
217
- config_file: .antigravity/rules.md
218
- config_json: .antigravity/antigravity.json
219
- agent_folder: .agent/workflows
220
- activation: workflow-based
221
- format: cursor-style
222
- mcp_support: native (Google)
223
- special_features:
224
- - Google Cloud integration
225
- - Workflow system
226
- - Native Firebase tools
227
- ```
228
-
229
- **Configuração:**
230
-
231
- 1. SINAPSE cria o diretório `.antigravity/`
232
- 2. Configure credenciais do Google Cloud
233
- 3. Agentes sincronizados como workflows
234
-
235
- ---
236
-
237
212
  ### Gemini CLI
238
213
 
239
214
  **Nível de Recomendação:** Bom
@@ -268,8 +243,7 @@ O SINAPSE mantém uma única fonte de verdade para definições de agentes e as
268
243
  │ │ │
269
244
  │ ┌───────────┼───────────┐ │
270
245
  │ ▼ ▼ ▼ │
271
- │ .claude/ .codex/ .cursor/
272
- │ .antigravity/ .gemini/ │
246
+ │ .claude/ .codex/ .cursor/ .gemini/
273
247
  └─────────────────────────────────────────────────────┘
274
248
  ```
275
249
 
@@ -284,8 +258,6 @@ npm run sync:ide:cursor
284
258
  npm run sync:ide:codex
285
259
  npm run sync:ide:gemini
286
260
  npm run sync:ide:github-copilot
287
- npm run sync:ide:antigravity
288
-
289
261
  # Dry run (visualizar mudanças)
290
262
  npm run sync:ide -- --dry-run
291
263
 
@@ -378,9 +350,7 @@ Você usa Claude/Anthropic API?
378
350
  └── Não --> Quer uma IDE dedicada com IA?
379
351
  ├── Sim --> Qual modelo você prefere?
380
352
  │ ├── Claude/GPT --> Cursor (IDE com IA mais popular)
381
- └── Não --> Usa Google Cloud?
382
- ├── Sim --> AntiGravity (integração com Google)
383
- └── Não --> Gemini CLI (Especializados)
353
+ └── Não --> Gemini CLI (Google AI models)
384
354
  ```
385
355
 
386
356
  ---
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sinapse-ai",
3
- "version": "7.7.0",
3
+ "version": "7.7.2",
4
4
  "description": "SINAPSE AI: Framework de orquestracao de IA — 18 squads, 175 agentes especializados",
5
5
  "bin": {
6
6
  "sinapse": "bin/sinapse.js",
@@ -58,7 +58,7 @@ function generateCoreConfig(options = {}) {
58
58
  gemini: selectedIDEs.includes('gemini'),
59
59
  cursor: selectedIDEs.includes('cursor'),
60
60
  'github-copilot': selectedIDEs.includes('github-copilot'),
61
- antigravity: selectedIDEs.includes('antigravity'),
61
+
62
62
  zed: selectedIDEs.includes('zed'),
63
63
  'claude-desktop': selectedIDEs.includes('claude-desktop'),
64
64
  'claude-code': selectedIDEs.includes('claude-code'),
@@ -230,9 +230,6 @@ async function copyAgentFiles(projectRoot, agentFolder, ideConfig = null) {
230
230
  !file.startsWith('test-'), // Exclude test agents
231
231
  );
232
232
 
233
- // Check if this is AntiGravity - needs workflow files instead of direct copy
234
- const isAntiGravity = ideConfig && ideConfig.specialConfig && ideConfig.specialConfig.type === 'antigravity';
235
-
236
233
  for (const file of agentFiles) {
237
234
  const sourcePath = path.join(sourceDir, file);
238
235
  const agentName = file.replace('.md', '');
@@ -240,20 +237,7 @@ async function copyAgentFiles(projectRoot, agentFolder, ideConfig = null) {
240
237
  // Only copy if source is a file (not directory)
241
238
  const stat = await fs.stat(sourcePath);
242
239
  if (stat.isFile()) {
243
- if (isAntiGravity) {
244
- // For AntiGravity: create workflow activation files
245
- const workflowContent = generateAntiGravityWorkflow(agentName);
246
- const targetPath = path.join(targetDir, file);
247
- await fs.writeFile(targetPath, workflowContent, 'utf8');
248
- copiedFiles.push(targetPath);
249
-
250
- // Also copy the actual agent to .antigravity/agents
251
- const agentsDir = path.join(projectRoot, ideConfig.specialConfig.agentsFolder);
252
- await fs.ensureDir(agentsDir);
253
- const agentTargetPath = path.join(agentsDir, file);
254
- await fs.copy(sourcePath, agentTargetPath);
255
- copiedFiles.push(agentTargetPath);
256
- } else if (ideConfig && ideConfig.agentFolder && ideConfig.agentFolder.includes('.github')) {
240
+ if (ideConfig && ideConfig.agentFolder && ideConfig.agentFolder.includes('.github')) {
257
241
  // GitHub Copilot: apply transformer for .agent.md format with YAML frontmatter
258
242
  try {
259
243
  const agentParser = require('../../../../.sinapse-ai/infrastructure/scripts/ide-sync/agent-parser');
@@ -317,77 +301,6 @@ async function copyClaudeRulesFolder(projectRoot) {
317
301
  return copiedFiles;
318
302
  }
319
303
 
320
- /**
321
- * Generate AntiGravity workflow activation file content
322
- * @param {string} agentName - Name of the agent (e.g., 'dev', 'architect')
323
- * @returns {string} Workflow file content
324
- */
325
- function generateAntiGravityWorkflow(agentName) {
326
- // Capitalize first letter for display
327
- const displayName = agentName.charAt(0).toUpperCase() + agentName.slice(1);
328
-
329
- return `---
330
- description: Ativa o agente ${displayName}
331
- ---
332
-
333
- # Ativação do Agente ${displayName}
334
-
335
- **INSTRUÇÕES CRÍTICAS PARA O ANTIGRAVITY:**
336
-
337
- 1. Leia COMPLETAMENTE o arquivo \`.antigravity/agents/${agentName}.md\`
338
- 2. Siga EXATAMENTE as \`activation-instructions\` definidas no bloco YAML do agente
339
- 3. Adote a persona conforme definido no agente
340
- 4. Execute a saudação conforme \`greeting_levels\` definido no agente
341
- 5. **MANTENHA esta persona até receber o comando \`*exit\`**
342
- 6. Responda aos comandos com prefixo \`*\` conforme definido no agente
343
- 7. Siga as regras globais do projeto em \`.antigravity/rules.md\`
344
-
345
- **Comandos disponíveis:** Use \`*help\` para ver todos os comandos do agente.
346
- `;
347
- }
348
-
349
- /**
350
- * Create AntiGravity configuration JSON file
351
- * @param {string} projectRoot - Project root directory
352
- * @param {Object} ideConfig - AntiGravity IDE config
353
- * @returns {Promise<string>} Path to created file
354
- */
355
- async function createAntiGravityConfigJson(projectRoot, ideConfig) {
356
- const configPath = path.join(projectRoot, ideConfig.specialConfig.configJsonPath);
357
- const projectName = path.basename(projectRoot);
358
-
359
- const config = {
360
- version: '1.0',
361
- project: projectName,
362
- workspace: projectRoot.replace(/\\/g, '/'),
363
- agents: {
364
- enabled: true,
365
- directory: ideConfig.specialConfig.agentsFolder,
366
- default: 'sinapse-orqx',
367
- },
368
- rules: {
369
- enabled: true,
370
- file: ideConfig.configFile,
371
- },
372
- features: {
373
- storyDrivenDevelopment: true,
374
- agentActivation: true,
375
- workflowAutomation: true,
376
- },
377
- paths: {
378
- stories: 'docs/stories',
379
- prd: 'docs/prd',
380
- architecture: 'docs/architecture',
381
- tasks: '.sinapse-ai/tasks',
382
- workflows: '.sinapse-ai/workflows',
383
- },
384
- };
385
-
386
- await fs.ensureDir(path.dirname(configPath));
387
- await fs.writeFile(configPath, JSON.stringify(config, null, 4), 'utf8');
388
-
389
- return configPath;
390
- }
391
304
 
392
305
  /**
393
306
  * Generate IDE configuration files
@@ -514,14 +427,7 @@ async function generateIDEConfigs(selectedIDEs, wizardState, options = {}) {
514
427
  createdFiles.push(...agentFiles);
515
428
  createdFolders.push(path.join(projectRoot, ide.agentFolder));
516
429
 
517
- // For AntiGravity, also create the antigravity.json config file
518
- if (ide.specialConfig && ide.specialConfig.type === 'antigravity') {
519
- const configJsonPath = await createAntiGravityConfigJson(projectRoot, ide);
520
- createdFiles.push(configJsonPath);
521
- spinner.succeed(`Created AntiGravity config and ${agentFiles.length} workflow files`);
522
- } else {
523
- spinner.succeed(`Copied ${agentFiles.length} agent files to ${ide.agentFolder}`);
524
- }
430
+ spinner.succeed(`Copied ${agentFiles.length} agent files to ${ide.agentFolder}`);
525
431
  }
526
432
 
527
433
  // For Claude Code, also copy .claude/rules folder, hooks, and settings
@@ -676,11 +582,17 @@ async function copyClaudeHooksFolder(projectRoot) {
676
582
 
677
583
  await fs.ensureDir(targetDir);
678
584
 
679
- // Only copy JS hooks that work standalone (no Python/shell deps)
585
+ // Copy CJS hooks that work standalone (no Python/shell deps)
680
586
  const HOOKS_TO_COPY = [
681
587
  'synapse-engine.cjs',
682
588
  'code-intel-pretool.cjs',
683
589
  'precompact-session-digest.cjs',
590
+ // v7.6.0 Constitutional enforcement hooks
591
+ 'enforce-architecture-first.cjs',
592
+ 'enforce-delegation.cjs',
593
+ 'enforce-story-gate.cjs',
594
+ 'secret-scanning.cjs',
595
+ 'write-path-validation.cjs',
684
596
  'README.md',
685
597
  ];
686
598
 
@@ -728,6 +640,32 @@ const HOOK_EVENT_MAP = {
728
640
  matcher: null,
729
641
  timeout: 10,
730
642
  },
643
+ // v7.6.0 Constitutional enforcement hooks
644
+ 'enforce-architecture-first.cjs': {
645
+ event: 'PreToolUse',
646
+ matcher: 'Write|Edit',
647
+ timeout: 5,
648
+ },
649
+ 'enforce-story-gate.cjs': {
650
+ event: 'PreToolUse',
651
+ matcher: 'Write|Edit',
652
+ timeout: 5,
653
+ },
654
+ 'write-path-validation.cjs': {
655
+ event: 'PreToolUse',
656
+ matcher: 'Write|Edit',
657
+ timeout: 5,
658
+ },
659
+ 'enforce-delegation.cjs': {
660
+ event: 'PreToolUse',
661
+ matcher: 'Write|Edit|Bash',
662
+ timeout: 5,
663
+ },
664
+ 'secret-scanning.cjs': {
665
+ event: 'PreToolUse',
666
+ matcher: 'Write|Edit',
667
+ timeout: 5,
668
+ },
731
669
  };
732
670
 
733
671
  /** Default event config for unmapped hooks (backwards compatible). */
@@ -46,38 +46,6 @@ const {
46
46
  isLLMRoutingInstalled,
47
47
  } = require('../../../../.sinapse-ai/infrastructure/scripts/llm-routing/install-llm-routing');
48
48
 
49
- // DISABLED: Legacy installation block superseded by squads flow (OSR-8)
50
- // /**
51
- // * Generate AntiGravity workflow content for squad agents
52
- // * @param {string} agentName - Agent name (e.g., 'data-collector')
53
- // * @param {string} packName - Starter squad name (e.g., 'etl')
54
- // * @returns {string} Workflow file content
55
- // */
56
- // function generateExpansionPackWorkflow(agentName, packName) {
57
- // const displayName = agentName.split('-').map(w => w.charAt(0).toUpperCase() + w.slice(1)).join(' ');
58
- //
59
- // return `---
60
- // description: Ativa o agente ${displayName} (${packName})
61
- // ---
62
- //
63
- // # Ativação do Agente ${displayName}
64
- //
65
- // **Squad:** ${packName}
66
- //
67
- // **INSTRUÇÕES CRÍTICAS PARA O ANTIGRAVITY:**
68
- //
69
- // 1. Leia COMPLETAMENTE o arquivo \`.antigravity/agents/${packName}/${agentName}.md\`
70
- // 2. Siga EXATAMENTE as \`activation-instructions\` definidas no bloco YAML do agente
71
- // 3. Adote a persona conforme definido no agente
72
- // 4. Execute a saudação conforme \`greeting_levels\` definido no agente
73
- // 5. **MANTENHA esta persona até receber o comando \`*exit\`**
74
- // 6. Responda aos comandos com prefixo \`*\` conforme definido no agente
75
- // 7. Siga as regras globais do projeto em \`.antigravity/rules.md\`
76
- //
77
- // **Comandos disponíveis:** Use \`*help\` para ver todos os comandos do agente.
78
- // `;
79
- // }
80
-
81
49
  /**
82
50
  * Check for existing user_profile in core-config.yaml (Story 10.2 - Idempotency)
83
51
  * Returns the existing profile if found, null otherwise