sinapse-ai 9.5.0 → 10.0.0-rc.10
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 +1 -0
- package/.claude/hooks/enforce-nsn-guard.cjs +127 -0
- package/.claude/rules/hook-governance.md +1 -0
- package/.claude/rules/mcp-usage.md +11 -5
- package/.claude/rules/nsn-mode.md +23 -0
- package/.codex/agents/analyst.md +8 -0
- package/.codex/agents/architect.md +8 -0
- package/.codex/agents/data-engineer.md +9 -0
- package/.codex/agents/developer.md +8 -0
- package/.codex/agents/devops.md +8 -0
- package/.codex/agents/product-lead.md +8 -0
- package/.codex/agents/project-lead.md +8 -0
- package/.codex/agents/quality-gate.md +8 -0
- package/.codex/agents/sprint-lead.md +8 -0
- package/.codex/agents/ux-design-expert.md +17 -8
- package/.sinapse-ai/constitution.md +31 -0
- package/.sinapse-ai/core/doctor/formatters/text.js +9 -0
- package/.sinapse-ai/core/doctor/index.js +74 -1
- package/.sinapse-ai/core/ids/registry-updater.js +7 -2
- package/.sinapse-ai/data/entity-registry.yaml +768 -768
- package/.sinapse-ai/development/agents/analyst.md +8 -0
- package/.sinapse-ai/development/agents/architect.md +8 -0
- package/.sinapse-ai/development/agents/data-engineer.md +8 -0
- package/.sinapse-ai/development/agents/developer.md +8 -0
- package/.sinapse-ai/development/agents/devops.md +8 -0
- package/.sinapse-ai/development/agents/product-lead.md +8 -0
- package/.sinapse-ai/development/agents/project-lead.md +8 -0
- package/.sinapse-ai/development/agents/quality-gate.md +8 -0
- package/.sinapse-ai/development/agents/sprint-lead.md +8 -0
- package/.sinapse-ai/development/agents/ux-design-expert.md +17 -8
- package/.sinapse-ai/development/templates/agent-tools-kit.md +32 -0
- package/.sinapse-ai/install-manifest.yaml +34 -30
- package/.sinapse-ai/lib/build.json +1 -0
- package/bin/cli.js +186 -5
- package/bin/modules/chrome-brain-installer.js +24 -5
- package/bin/postinstall.js +60 -9
- package/docs/installation/npx-cache.md +87 -0
- package/docs/installation/troubleshooting.md +2 -0
- package/docs/installation/uninstallation.md +2 -0
- package/docs/pt/architecture/agent-responsibility-matrix.md +4 -4
- package/docs/pt/architecture/dual-register-pattern.md +89 -0
- package/docs/pt/architecture/introduction.md +4 -4
- package/docs/pt/architecture/sub-orqx-pattern.md +103 -0
- package/docs/pt/architecture/utility-integration-guide.md +2 -2
- package/docs/pt/getting-started.md +1 -1
- package/docs/pt/troubleshooting.md +0 -34
- package/docs/security/dependabot-triage.md +75 -0
- package/package.json +1 -1
- package/packages/installer/src/wizard/feedback.js +8 -8
- package/packages/installer/src/wizard/index.js +2 -69
- package/packages/installer/tests/unit/doctor/doctor-orchestrator.test.js +57 -1
- package/packages/sinapse-install/src/capabilities/chrome-brain.js +20 -2
- package/scripts/validate-no-external-refs.js +36 -1
- package/squads/claude-code-mastery/agents/skill-craftsman.md +20 -65
- package/squads/claude-code-mastery/agents/swarm-orqx.md +8 -0
- package/squads/claude-code-mastery/knowledge-base/claude-code-internals-reference.md +7 -8
- package/squads/squad-animations/agents/animations-orqx.md +8 -0
- package/squads/squad-artdir/agents/artdir-orqx.md +8 -0
- package/squads/squad-brand/agents/brand-orqx.md +8 -0
- package/squads/squad-claude/agents/claude-orqx.md +8 -0
- package/squads/squad-claude/agents/swarm-orqx.md +8 -0
- package/squads/squad-claude/agents/tools-orqx.md +8 -0
- package/squads/squad-claude/knowledge-base/skill-creation-patterns.md +20 -22
- package/squads/squad-claude/squad.yaml +1 -1
- package/squads/squad-cloning/agents/cloning-orqx.md +8 -0
- package/squads/squad-commercial/agents/commercial-orqx.md +8 -0
- package/squads/squad-content/agents/content-orqx.md +8 -0
- package/squads/squad-copy/agents/copy-orqx.md +8 -0
- package/squads/squad-council/agents/council-orqx.md +8 -0
- package/squads/squad-courses/agents/courses-orqx.md +8 -0
- package/squads/squad-cybersecurity/agents/cyber-orqx.md +8 -0
- package/squads/squad-design/agents/design-orqx.md +8 -0
- package/squads/squad-finance/agents/finance-orqx.md +8 -0
- package/squads/squad-growth/agents/growth-orqx.md +8 -0
- package/squads/squad-paidmedia/agents/paidmedia-orqx.md +8 -0
- package/squads/squad-product/agents/product-orqx.md +8 -0
- package/squads/squad-research/agents/research-orqx.md +8 -0
- package/squads/squad-storytelling/agents/storytelling-orqx.md +8 -0
package/.claude/CLAUDE.md
CHANGED
|
@@ -16,6 +16,7 @@ Full doc: `.sinapse-ai/constitution.md`. Gates auto-block violations.
|
|
|
16
16
|
| VIII | Mandatory Delegation | NON-NEGOTIABLE |
|
|
17
17
|
| IX | Safe Collaboration | NON-NEGOTIABLE |
|
|
18
18
|
| X | Security & Data Protection | NON-NEGOTIABLE |
|
|
19
|
+
| XI | Conservative Default | MUST |
|
|
19
20
|
|
|
20
21
|
## CLI First
|
|
21
22
|
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Hook: Enforce NSN Mode (Never Say Never) Guard
|
|
6
|
+
*
|
|
7
|
+
* RULE (.claude/rules/nsn-mode.md): Agents must NOT tell the user to
|
|
8
|
+
* manually perform a step that the agent itself could automate via
|
|
9
|
+
* Chrome Brain, MCP, or a direct CLI call. Writing such instructions
|
|
10
|
+
* into docs, stories, or code comments propagates the anti-pattern.
|
|
11
|
+
*
|
|
12
|
+
* Scope: matches `Write` and `Edit` PreToolUse on `.md`, `.mdx`, `.txt`
|
|
13
|
+
* files. Scans the content being written for known NSN violation
|
|
14
|
+
* phrases. Emits a WARN on stderr (exit 0) so the agent can see the
|
|
15
|
+
* feedback but is not hard-blocked — false positives would be more
|
|
16
|
+
* damaging than the leak.
|
|
17
|
+
*
|
|
18
|
+
* Protocol (Claude Code PreToolUse):
|
|
19
|
+
* exit 0 → allow (with optional stderr warning)
|
|
20
|
+
* exit 2 → block (reserved for a future strict mode)
|
|
21
|
+
*
|
|
22
|
+
* Fail-open: any parsing error → exit 0 (allow). Reason: a broken
|
|
23
|
+
* guard should never block legitimate writes.
|
|
24
|
+
*
|
|
25
|
+
* @module enforce-nsn-guard
|
|
26
|
+
* @story 10.44 (Fix 3 from pre-GA blockers)
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
const readStdin = () => new Promise((resolve) => {
|
|
30
|
+
let data = '';
|
|
31
|
+
process.stdin.setEncoding('utf8');
|
|
32
|
+
process.stdin.on('data', (c) => { data += c; });
|
|
33
|
+
process.stdin.on('end', () => resolve(data));
|
|
34
|
+
// Fail-open on timeout — don't hang Claude Code
|
|
35
|
+
setTimeout(() => resolve(data), 4500);
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
const TARGET_TOOLS = new Set(['Write', 'Edit']);
|
|
39
|
+
const TARGET_EXTENSIONS = ['.md', '.mdx', '.txt'];
|
|
40
|
+
|
|
41
|
+
// NSN violation phrases — ordered from high-confidence to lower.
|
|
42
|
+
// Written as regexes (case-insensitive) so common morphological
|
|
43
|
+
// variants are caught without adding dozens of entries.
|
|
44
|
+
const NSN_PATTERNS = [
|
|
45
|
+
{
|
|
46
|
+
id: 'open-dashboard-manually',
|
|
47
|
+
regex: /(abra|abre|you should open|please open)\s+(o\s+)?dashboard.*manual/i,
|
|
48
|
+
hint: 'Agents should offer Chrome Brain before telling users to open a dashboard by hand.',
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
id: 'follow-steps-manually',
|
|
52
|
+
regex: /(siga|follow)\s+esses\s+passos\s+manualmente/i,
|
|
53
|
+
hint: 'Replace manual step-lists with an automated Chrome Brain / MCP call.',
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
id: 'cannot-access-interface',
|
|
57
|
+
regex: /(infelizmente\s+)?n[ãa]o\s+consigo\s+acessar\s+a\s+interface/i,
|
|
58
|
+
hint: 'NSN Mode: try Chrome Brain, dev-browser, or claude-in-chrome before claiming you cannot access UI.',
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
id: 'you-need-to-click',
|
|
62
|
+
regex: /(voc[êe]\s+precisa\s+(abrir|clicar))|(you\s+need\s+to\s+click)/i,
|
|
63
|
+
hint: 'Agents should drive UI clicks via Chrome Brain, not instruct the user.',
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
id: 'i-cant-do-this',
|
|
67
|
+
regex: /\b(i\s+can'?t\s+do\s+this|n[ãa]o\s+consigo\s+fazer\s+isso)\b/i,
|
|
68
|
+
hint: 'NSN Mode forbids "I can\'t" without having tried 3+ alternatives first.',
|
|
69
|
+
},
|
|
70
|
+
];
|
|
71
|
+
|
|
72
|
+
async function main() {
|
|
73
|
+
try {
|
|
74
|
+
const raw = await readStdin();
|
|
75
|
+
if (!raw) { process.exit(0); }
|
|
76
|
+
|
|
77
|
+
let payload;
|
|
78
|
+
try { payload = JSON.parse(raw); } catch { process.exit(0); }
|
|
79
|
+
|
|
80
|
+
const toolName = payload.tool_name || payload.toolName;
|
|
81
|
+
if (!TARGET_TOOLS.has(toolName)) { process.exit(0); }
|
|
82
|
+
|
|
83
|
+
const input = payload.tool_input || payload.toolInput || {};
|
|
84
|
+
const filePath = input.file_path || input.filePath || '';
|
|
85
|
+
if (!filePath) { process.exit(0); }
|
|
86
|
+
|
|
87
|
+
const ext = filePath.slice(filePath.lastIndexOf('.')).toLowerCase();
|
|
88
|
+
if (!TARGET_EXTENSIONS.includes(ext)) { process.exit(0); }
|
|
89
|
+
|
|
90
|
+
// Extract the text about to land in the file
|
|
91
|
+
const content = input.content
|
|
92
|
+
|| input.new_string
|
|
93
|
+
|| input.newString
|
|
94
|
+
|| '';
|
|
95
|
+
if (!content || typeof content !== 'string') { process.exit(0); }
|
|
96
|
+
|
|
97
|
+
const hits = [];
|
|
98
|
+
for (const pattern of NSN_PATTERNS) {
|
|
99
|
+
if (pattern.regex.test(content)) {
|
|
100
|
+
hits.push(pattern);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
if (hits.length === 0) { process.exit(0); }
|
|
105
|
+
|
|
106
|
+
// WARN mode — print hints to stderr so the agent sees them, exit 0.
|
|
107
|
+
const lines = [
|
|
108
|
+
'',
|
|
109
|
+
'[NSN-Guard] Detected NSN Mode anti-patterns in content being written to',
|
|
110
|
+
` ${filePath}`,
|
|
111
|
+
'',
|
|
112
|
+
];
|
|
113
|
+
for (const h of hits) {
|
|
114
|
+
lines.push(` - ${h.id}: ${h.hint}`);
|
|
115
|
+
}
|
|
116
|
+
lines.push('');
|
|
117
|
+
lines.push('Reference: .claude/rules/nsn-mode.md');
|
|
118
|
+
lines.push('');
|
|
119
|
+
process.stderr.write(lines.join('\n'));
|
|
120
|
+
process.exit(0);
|
|
121
|
+
} catch {
|
|
122
|
+
// Fail-open
|
|
123
|
+
process.exit(0);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
main();
|
|
@@ -24,6 +24,7 @@ paths:
|
|
|
24
24
|
| `enforce-architecture-first.cjs` | Art. III — Docs before protected code | BLOCK (exit 2) |
|
|
25
25
|
| `write-path-validation.cjs` | Convention — Warn wrong doc paths | WARN (exit 0) |
|
|
26
26
|
| `enforce-story-gate.cjs` | Art. III — Story required for code | BLOCK (exit 2) |
|
|
27
|
+
| `enforce-nsn-guard.cjs` | NSN Mode — Warn on "open dashboard / follow steps manually" anti-patterns in .md/.mdx/.txt | WARN (exit 0) |
|
|
27
28
|
| `slug-validation.py` | Convention — Validate naming | WARN (exit 0) |
|
|
28
29
|
| `mind-clone-governance.py` | Cloning — DNA required | BLOCK (exit 2) |
|
|
29
30
|
| `enforce-delegation.cjs` | Art. VIII — Orchestrators can't execute | BLOCK (exit 2) |
|
|
@@ -24,15 +24,21 @@ Other agents (Dev, Architect, etc.) are MCP **consumers**, not administrators. I
|
|
|
24
24
|
|
|
25
25
|
## MCP Configuration Architecture
|
|
26
26
|
|
|
27
|
-
SINAPSE
|
|
27
|
+
SINAPSE supports two MCP deployment paths. The right choice depends on the user's environment; neither is required for the core framework to work.
|
|
28
|
+
|
|
29
|
+
### Direct in Claude Code (local ~/.claude.json)
|
|
30
|
+
|
|
31
|
+
The default path — MCPs run as local processes declared in `~/.claude.json`. Typical entries on a SINAPSE install:
|
|
28
32
|
|
|
29
|
-
### Direct in Claude Code (global ~/.claude.json)
|
|
30
33
|
| MCP | Purpose |
|
|
31
34
|
|-----|---------|
|
|
32
|
-
| **
|
|
33
|
-
| **
|
|
35
|
+
| **chrome-devtools** | Chrome CDP (installed by Chrome Brain, Phase 7 of `npx sinapse-ai install`) |
|
|
36
|
+
| **dev-browser** | Playwright-backed browser (installed by Chrome Brain) |
|
|
37
|
+
| **terminal-bus** | Cross-terminal messaging (user-installed, optional) |
|
|
38
|
+
|
|
39
|
+
### Docker MCP Toolkit (optional acceleration layer, via docker-gateway)
|
|
34
40
|
|
|
35
|
-
|
|
41
|
+
An opt-in deployment that runs EXA, Context7, and Apify inside Docker for isolation. Requires Docker Desktop + the MCP Toolkit extension. **Not installed by `npx sinapse-ai install` and not required** — use only if the acceleration layer is wanted.
|
|
36
42
|
|
|
37
43
|
| MCP | Purpose |
|
|
38
44
|
|-----|---------|
|
|
@@ -34,6 +34,28 @@ When ANY agent encounters a barrier (technical limitation, permission denied, to
|
|
|
34
34
|
|
|
35
35
|
6. **Escalate** — After 5 cycles, report to user with detailed log of what was tried
|
|
36
36
|
|
|
37
|
+
## Browser / UI Protocol (MANDATORY)
|
|
38
|
+
|
|
39
|
+
Se a tarefa requer interação com browser ou UI (clicks, forms, dashboard config, navegação, screenshots, upload, download, preencher campos):
|
|
40
|
+
|
|
41
|
+
1. **NUNCA** mande usuário fazer manualmente sem antes oferecer Chrome Brain
|
|
42
|
+
2. **Formato obrigatório de oferta**:
|
|
43
|
+
|
|
44
|
+
> "Posso fazer isso via Chrome Brain (browser automation — automático) ou você prefere fazer manualmente?"
|
|
45
|
+
|
|
46
|
+
3. **Default**: se usuário não responder explicitamente "manualmente", assuma Chrome Brain e execute
|
|
47
|
+
4. **Exceção**: tarefas destrutivas em produção → sempre confirmar antes de executar, independente de browser
|
|
48
|
+
|
|
49
|
+
**Anti-pattern proibido:**
|
|
50
|
+
- "Você precisa abrir o dashboard e clicar em X"
|
|
51
|
+
- "Siga esses passos manualmente: 1... 2... 3..."
|
|
52
|
+
- "Infelizmente não consigo acessar a interface, então você precisa..."
|
|
53
|
+
|
|
54
|
+
**Padrão correto:**
|
|
55
|
+
- "Abre Chrome Brain ou quer fazer você?"
|
|
56
|
+
- "Vou executar via Chrome Brain agora."
|
|
57
|
+
- "Essa config no dashboard Supabase — Chrome Brain ou manual?"
|
|
58
|
+
|
|
37
59
|
## Anti-Patterns (FORBIDDEN)
|
|
38
60
|
|
|
39
61
|
- Saying "I can't do this" without trying alternatives
|
|
@@ -41,6 +63,7 @@ When ANY agent encounters a barrier (technical limitation, permission denied, to
|
|
|
41
63
|
- Assuming something is impossible without researching
|
|
42
64
|
- Asking the user to do something the agent can automate
|
|
43
65
|
- Giving up without documenting what was tried
|
|
66
|
+
- Asking user to do manual UI work without first offering Chrome Brain (see Browser Protocol above)
|
|
44
67
|
|
|
45
68
|
## Exceptions
|
|
46
69
|
|
package/.codex/agents/analyst.md
CHANGED
|
@@ -359,5 +359,13 @@ Type `*help` to see all commands, or `*yolo` to skip confirmations.
|
|
|
359
359
|
- **@product-lead (Axis)** - May request market insights
|
|
360
360
|
|
|
361
361
|
---
|
|
362
|
+
|
|
363
|
+
## Tools Available
|
|
364
|
+
|
|
365
|
+
See `.sinapse-ai/development/templates/agent-tools-kit.md` for complete toolkit.
|
|
366
|
+
|
|
367
|
+
**Key reminder (NSN Mode):** Before telling user to do manual UI work, offer Chrome Brain first:
|
|
368
|
+
|
|
369
|
+
> "Posso fazer via Chrome Brain ou prefere fazer manualmente?"
|
|
362
370
|
---
|
|
363
371
|
*SINAPSE Agent - Synced from .sinapse-ai/development/agents/analyst.md*
|
|
@@ -548,5 +548,13 @@ Type `*help` to see all commands, or `*yolo` to skip confirmations.
|
|
|
548
548
|
- **@project-lead (Beacon)** - Receives requirements from
|
|
549
549
|
|
|
550
550
|
---
|
|
551
|
+
|
|
552
|
+
## Tools Available
|
|
553
|
+
|
|
554
|
+
See `.sinapse-ai/development/templates/agent-tools-kit.md` for complete toolkit.
|
|
555
|
+
|
|
556
|
+
**Key reminder (NSN Mode):** Before telling user to do manual UI work, offer Chrome Brain first:
|
|
557
|
+
|
|
558
|
+
> "Posso fazer via Chrome Brain ou prefere fazer manualmente?"
|
|
551
559
|
---
|
|
552
560
|
*SINAPSE Agent - Synced from .sinapse-ai/development/agents/architect.md*
|
|
@@ -529,5 +529,14 @@ Type `*help` to see all commands.
|
|
|
529
529
|
- **@architect (Stratum)** - Provides system architecture
|
|
530
530
|
|
|
531
531
|
---
|
|
532
|
+
|
|
533
|
+
|
|
534
|
+
## Tools Available
|
|
535
|
+
|
|
536
|
+
See `.sinapse-ai/development/templates/agent-tools-kit.md` for complete toolkit.
|
|
537
|
+
|
|
538
|
+
**Key reminder (NSN Mode):** Before telling user to do manual UI work, offer Chrome Brain first:
|
|
539
|
+
|
|
540
|
+
> "Posso fazer via Chrome Brain ou prefere fazer manualmente?"
|
|
532
541
|
---
|
|
533
542
|
*SINAPSE Agent - Synced from .sinapse-ai/development/agents/data-engineer.md*
|
|
@@ -653,5 +653,13 @@ Type `*help` to see all commands, or `*explain` to learn more.
|
|
|
653
653
|
- **@github-devops (Pipeline)** - Pushes my commits
|
|
654
654
|
|
|
655
655
|
---
|
|
656
|
+
|
|
657
|
+
## Tools Available
|
|
658
|
+
|
|
659
|
+
See `.sinapse-ai/development/templates/agent-tools-kit.md` for complete toolkit.
|
|
660
|
+
|
|
661
|
+
**Key reminder (NSN Mode):** Before telling user to do manual UI work, offer Chrome Brain first:
|
|
662
|
+
|
|
663
|
+
> "Posso fazer via Chrome Brain ou prefere fazer manualmente?"
|
|
656
664
|
---
|
|
657
665
|
*SINAPSE Agent - Synced from .sinapse-ai/development/agents/developer.md*
|
package/.codex/agents/devops.md
CHANGED
|
@@ -656,5 +656,13 @@ Type `*help` to see all commands.
|
|
|
656
656
|
- **@sprint-lead (Sync)** - Coordinates sprint push workflow
|
|
657
657
|
|
|
658
658
|
---
|
|
659
|
+
|
|
660
|
+
## Tools Available
|
|
661
|
+
|
|
662
|
+
See `.sinapse-ai/development/templates/agent-tools-kit.md` for complete toolkit.
|
|
663
|
+
|
|
664
|
+
**Key reminder (NSN Mode):** Before telling user to do manual UI work, offer Chrome Brain first:
|
|
665
|
+
|
|
666
|
+
> "Posso fazer via Chrome Brain ou prefere fazer manualmente?"
|
|
659
667
|
---
|
|
660
668
|
*SINAPSE Agent - Synced from .sinapse-ai/development/agents/devops.md*
|
|
@@ -358,5 +358,13 @@ Type `*help` to see all commands.
|
|
|
358
358
|
- **@quality-gate (Litmus)** - Validates quality gates in stories
|
|
359
359
|
|
|
360
360
|
---
|
|
361
|
+
|
|
362
|
+
## Tools Available
|
|
363
|
+
|
|
364
|
+
See `.sinapse-ai/development/templates/agent-tools-kit.md` for complete toolkit.
|
|
365
|
+
|
|
366
|
+
**Key reminder (NSN Mode):** Before telling user to do manual UI work, offer Chrome Brain first:
|
|
367
|
+
|
|
368
|
+
> "Posso fazer via Chrome Brain ou prefere fazer manualmente?"
|
|
361
369
|
---
|
|
362
370
|
*SINAPSE Agent - Synced from .sinapse-ai/development/agents/product-lead.md*
|
|
@@ -401,5 +401,13 @@ Type `*help` to see all commands, or `*yolo` to skip confirmations.
|
|
|
401
401
|
- **@architect (Stratum)** - Collaborates on technical decisions
|
|
402
402
|
|
|
403
403
|
---
|
|
404
|
+
|
|
405
|
+
## Tools Available
|
|
406
|
+
|
|
407
|
+
See `.sinapse-ai/development/templates/agent-tools-kit.md` for complete toolkit.
|
|
408
|
+
|
|
409
|
+
**Key reminder (NSN Mode):** Before telling user to do manual UI work, offer Chrome Brain first:
|
|
410
|
+
|
|
411
|
+
> "Posso fazer via Chrome Brain ou prefere fazer manualmente?"
|
|
404
412
|
---
|
|
405
413
|
*SINAPSE Agent - Synced from .sinapse-ai/development/agents/project-lead.md*
|
|
@@ -534,5 +534,13 @@ Type `*help` to see all commands.
|
|
|
534
534
|
- **CodeRabbit** - Automated pre-review
|
|
535
535
|
|
|
536
536
|
---
|
|
537
|
+
|
|
538
|
+
## Tools Available
|
|
539
|
+
|
|
540
|
+
See `.sinapse-ai/development/templates/agent-tools-kit.md` for complete toolkit.
|
|
541
|
+
|
|
542
|
+
**Key reminder (NSN Mode):** Before telling user to do manual UI work, offer Chrome Brain first:
|
|
543
|
+
|
|
544
|
+
> "Posso fazer via Chrome Brain ou prefere fazer manualmente?"
|
|
537
545
|
---
|
|
538
546
|
*SINAPSE Agent - Synced from .sinapse-ai/development/agents/quality-gate.md*
|
|
@@ -311,5 +311,13 @@ Type `*help` to see all commands.
|
|
|
311
311
|
- **@github-devops (Pipeline)** - Handles push operations
|
|
312
312
|
|
|
313
313
|
---
|
|
314
|
+
|
|
315
|
+
## Tools Available
|
|
316
|
+
|
|
317
|
+
See `.sinapse-ai/development/templates/agent-tools-kit.md` for complete toolkit.
|
|
318
|
+
|
|
319
|
+
**Key reminder (NSN Mode):** Before telling user to do manual UI work, offer Chrome Brain first:
|
|
320
|
+
|
|
321
|
+
> "Posso fazer via Chrome Brain ou prefere fazer manualmente?"
|
|
314
322
|
---
|
|
315
323
|
*SINAPSE Agent - Synced from .sinapse-ai/development/agents/sprint-lead.md*
|
|
@@ -20,7 +20,7 @@ REQUEST-RESOLUTION:
|
|
|
20
20
|
|
|
21
21
|
activation-instructions:
|
|
22
22
|
- STEP 1: Read THIS ENTIRE FILE - it contains your complete persona definition
|
|
23
|
-
- STEP 2: Adopt the hybrid persona (
|
|
23
|
+
- STEP 2: Adopt the hybrid persona (Mosaic + Brad Frost)
|
|
24
24
|
|
|
25
25
|
- STEP 3: |
|
|
26
26
|
Display greeting using native context (zero JS execution):
|
|
@@ -64,7 +64,7 @@ agent:
|
|
|
64
64
|
customization: |
|
|
65
65
|
HYBRID PHILOSOPHY - "USER NEEDS + DATA-DRIVEN SYSTEMS":
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
MOSAIC'S UX PRINCIPLES (Phase 1 - Research & Design):
|
|
68
68
|
- USER-CENTRIC: Every design decision serves real user needs
|
|
69
69
|
- EMPATHETIC DISCOVERY: Deep user research drives all decisions
|
|
70
70
|
- ITERATIVE SIMPLICITY: Start simple, refine based on feedback
|
|
@@ -89,9 +89,10 @@ agent:
|
|
|
89
89
|
- Pages: Specific instances
|
|
90
90
|
|
|
91
91
|
PERSONALITY ADAPTATION BY PHASE:
|
|
92
|
-
- Phase 1 (UX Research): More
|
|
92
|
+
- Phase 1 (UX Research): More Mosaic - empathetic, exploratory, user-focused
|
|
93
93
|
- Phases 2-3 (Audit/Tokens): More Brad - metric-driven, direct, data-focused
|
|
94
94
|
- Phases 4-5 (Build/Quality): Balanced - user needs + system thinking
|
|
95
|
+
(legacy persona heritage retained as nomenclature only; no external endorsement)
|
|
95
96
|
|
|
96
97
|
COMMAND-TO-TASK MAPPING (TOKEN OPTIMIZATION):
|
|
97
98
|
Use DIRECT Read() with exact paths. NO Search/Grep.
|
|
@@ -158,20 +159,20 @@ persona:
|
|
|
158
159
|
role: UX/UI Designer & Design System Architect
|
|
159
160
|
style: Empathetic yet data-driven, creative yet systematic, user-obsessed yet metric-focused
|
|
160
161
|
identity: |
|
|
161
|
-
I'm your complete design partner, combining
|
|
162
|
+
I'm your complete design partner, combining Mosaic's user empathy with Brad's systems thinking.
|
|
162
163
|
I understand users deeply AND build scalable design systems.
|
|
163
164
|
My foundation is Atomic Design methodology (atoms → molecules → organisms → templates → pages).
|
|
164
165
|
focus: Complete workflow - user research through component implementation
|
|
165
166
|
|
|
166
167
|
core_principles:
|
|
167
|
-
- USER NEEDS FIRST: Every design decision serves real user needs (
|
|
168
|
+
- USER NEEDS FIRST: Every design decision serves real user needs (Mosaic)
|
|
168
169
|
- METRICS MATTER: Back decisions with data - usage, ROI, accessibility (Brad)
|
|
169
170
|
- BUILD SYSTEMS: Design tokens and components, not one-off pages (Brad)
|
|
170
|
-
- ITERATE & IMPROVE: Start simple, refine based on feedback (
|
|
171
|
+
- ITERATE & IMPROVE: Start simple, refine based on feedback (Mosaic)
|
|
171
172
|
- ACCESSIBLE BY DEFAULT: WCAG AA minimum, inclusive design (Both)
|
|
172
173
|
- ATOMIC DESIGN: Structure everything as reusable components (Brad)
|
|
173
174
|
- VISUAL EVIDENCE: Show the chaos, prove the value (Brad)
|
|
174
|
-
- DELIGHT IN DETAILS: Micro-interactions matter (
|
|
175
|
+
- DELIGHT IN DETAILS: Micro-interactions matter (Mosaic)
|
|
175
176
|
|
|
176
177
|
# All commands require * prefix when used (e.g., *help)
|
|
177
178
|
# Commands organized by 5 phases for clarity
|
|
@@ -395,7 +396,7 @@ status:
|
|
|
395
396
|
development_phase: 'Production Ready v1.0.0'
|
|
396
397
|
maturity_level: 2
|
|
397
398
|
note: |
|
|
398
|
-
Unified UX-Design Expert combining
|
|
399
|
+
Unified UX-Design Expert combining Mosaic (UX) + Brad Frost (Design Systems).
|
|
399
400
|
Complete workflow coverage: research → design → audit → tokens → build → quality.
|
|
400
401
|
19 commands in 5 phases. 22 tasks, 9 templates, 4 checklists, 7 data files.
|
|
401
402
|
Atomic Design as central methodology.
|
|
@@ -519,5 +520,13 @@ Type `*help` to see commands by phase, or `*status` to see workflow state.
|
|
|
519
520
|
- **@developer (Pixel)** - Implements components
|
|
520
521
|
|
|
521
522
|
---
|
|
523
|
+
|
|
524
|
+
## Tools Available
|
|
525
|
+
|
|
526
|
+
See `.sinapse-ai/development/templates/agent-tools-kit.md` for complete toolkit.
|
|
527
|
+
|
|
528
|
+
**Key reminder (NSN Mode):** Before telling user to do manual UI work, offer Chrome Brain first:
|
|
529
|
+
|
|
530
|
+
> "Posso fazer via Chrome Brain ou prefere fazer manualmente?"
|
|
522
531
|
---
|
|
523
532
|
*SINAPSE Agent - Synced from .sinapse-ai/development/agents/ux-design-expert.md*
|
|
@@ -305,6 +305,37 @@ Todo projeto que manipula dados de usuarios DEVE seguir praticas de seguranca ri
|
|
|
305
305
|
|
|
306
306
|
---
|
|
307
307
|
|
|
308
|
+
### XI. Conservative Default (MUST)
|
|
309
|
+
|
|
310
|
+
Em qualquer auditoria, refactor, fusão ou cleanup: quando houver dúvida sobre remover uma capability, agent, squad ou entidade, **MANTER por default**.
|
|
311
|
+
|
|
312
|
+
**Rationale:** Custo de remover errado (perda de diferencial, quebra silenciosa) >> custo de manter (código latente, inofensivo).
|
|
313
|
+
|
|
314
|
+
**Precedente histórico (2026-04-18):**
|
|
315
|
+
Auditoria pré-GA 1.0.0 identificou "duplicação" entre `squad-claude` e `claude-code-mastery`. Análise sequencial gerou 3 false positives:
|
|
316
|
+
1. Proposta inicial teria deletado 6500 linhas de capability operacional.
|
|
317
|
+
2. Redirecionamento teria deletado arquivo inteiro do mastery.
|
|
318
|
+
3. Proposta cirúrgica teria quebrado allow-list + tests + decisão arquitetural da Story 10.23.
|
|
319
|
+
|
|
320
|
+
Resultado: nada foi fundido. Dual register preservado. Article XI formalizado pra prevenir dano em auditorias futuras.
|
|
321
|
+
|
|
322
|
+
**Aplica em:** agent rename, curadoria squads, consolidação orqx, cleanup tasks/tools, qualquer "limpeza pra simplificar".
|
|
323
|
+
|
|
324
|
+
**Regras:**
|
|
325
|
+
- MUST: Em dúvida sobre remoção → MANTER. Documentar a dúvida, não executar a remoção.
|
|
326
|
+
- MUST: Remoções exigem justificativa explícita + validação cross-agent (arquiteto + dono do domínio).
|
|
327
|
+
- MUST: Audit trails (git log, stories) são fonte de verdade — consultar antes de propor remoção.
|
|
328
|
+
- MUST NOT: Agrupar remoções heterogêneas em "cleanup sweeps" — cada remoção é sua própria decisão.
|
|
329
|
+
- MUST NOT: Usar "aparente duplicação" como justificativa suficiente — investigar se é dual register intencional.
|
|
330
|
+
|
|
331
|
+
**Gate:** QA review em auditorias DEVE verificar que remoções propostas passaram pelo check Article XI antes de aprovar.
|
|
332
|
+
|
|
333
|
+
**Violação:** falha de qualidade constitucional (ver Article V).
|
|
334
|
+
|
|
335
|
+
**Rule file:** `docs/pt/architecture/sub-orqx-pattern.md`, `docs/pt/architecture/dual-register-pattern.md` (precedentes documentados).
|
|
336
|
+
|
|
337
|
+
---
|
|
338
|
+
|
|
308
339
|
## Governance
|
|
309
340
|
|
|
310
341
|
### Amendment Process
|
|
@@ -21,6 +21,15 @@ function formatText(output, options = {}) {
|
|
|
21
21
|
lines.push(`SINAPSE Doctor v${output.version} — Environment Health Check`);
|
|
22
22
|
lines.push('');
|
|
23
23
|
|
|
24
|
+
// Story 10.42 — friendly NOT_INSTALLED path takes precedence over the
|
|
25
|
+
// check loop. A fresh user sees three short lines instead of 11 FAILs.
|
|
26
|
+
if (output.notInstalled) {
|
|
27
|
+
lines.push(' SINAPSE is not installed in this project.');
|
|
28
|
+
lines.push('');
|
|
29
|
+
lines.push(` Run: ${output.installCommand}`);
|
|
30
|
+
return lines.join('\n');
|
|
31
|
+
}
|
|
32
|
+
|
|
24
33
|
for (const result of output.checks) {
|
|
25
34
|
const prefix = STATUS_PREFIX[result.status] || '[????]';
|
|
26
35
|
lines.push(` ${prefix} ${result.check}: ${result.message}`);
|
|
@@ -20,6 +20,8 @@
|
|
|
20
20
|
* @story INS-4.1, A.3
|
|
21
21
|
*/
|
|
22
22
|
|
|
23
|
+
const fs = require('fs');
|
|
24
|
+
const os = require('os');
|
|
23
25
|
const path = require('path');
|
|
24
26
|
const { loadChecks } = require('./checks');
|
|
25
27
|
const { formatText } = require('./formatters/text');
|
|
@@ -28,6 +30,47 @@ const { applyFixes } = require('./fix-handler');
|
|
|
28
30
|
|
|
29
31
|
const DOCTOR_VERSION = '2.1.0';
|
|
30
32
|
|
|
33
|
+
/**
|
|
34
|
+
* Detect whether SINAPSE has any installation footprint for this user.
|
|
35
|
+
*
|
|
36
|
+
* Returns `{ installed: false }` when ALL of the following are absent:
|
|
37
|
+
* - `<projectRoot>/.sinapse-ai/`
|
|
38
|
+
* - `~/.sinapse/`
|
|
39
|
+
* - `~/.claude/commands/SINAPSE/`
|
|
40
|
+
*
|
|
41
|
+
* If ANY marker is present we short-circuit to `installed: true` and let
|
|
42
|
+
* the full check suite run — partial installs still need diagnosis.
|
|
43
|
+
*
|
|
44
|
+
* Story 10.42: avoid the "11 FAIL wall of text" on the very first run in
|
|
45
|
+
* a directory where a new user has just opened the terminal and typed
|
|
46
|
+
* `sinapse doctor` before ever running the installer.
|
|
47
|
+
*
|
|
48
|
+
* @param {Object} context - runDoctorChecks context
|
|
49
|
+
* @returns {{ installed: boolean, marker?: string }}
|
|
50
|
+
*/
|
|
51
|
+
function detectInstallState(context) {
|
|
52
|
+
// Allow the caller (tests, CI harnesses) to override the home directory
|
|
53
|
+
// without mutating process env. Falls back to os.homedir() for real runs.
|
|
54
|
+
const home = (context && context.options && context.options.homeDir)
|
|
55
|
+
|| process.env.SINAPSE_DOCTOR_HOME
|
|
56
|
+
|| os.homedir();
|
|
57
|
+
const markers = [
|
|
58
|
+
{ label: 'project', path: path.join(context.projectRoot, '.sinapse-ai') },
|
|
59
|
+
{ label: 'global-sinapse', path: path.join(home, '.sinapse') },
|
|
60
|
+
{ label: 'claude-commands', path: path.join(home, '.claude', 'commands', 'SINAPSE') },
|
|
61
|
+
];
|
|
62
|
+
for (const m of markers) {
|
|
63
|
+
try {
|
|
64
|
+
if (fs.existsSync(m.path)) {
|
|
65
|
+
return { installed: true, marker: m.label };
|
|
66
|
+
}
|
|
67
|
+
} catch {
|
|
68
|
+
// permission error on one marker — keep checking others
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return { installed: false };
|
|
72
|
+
}
|
|
73
|
+
|
|
31
74
|
const VALID_ON_ERROR = new Set(['fail', 'warn', 'skip']);
|
|
32
75
|
|
|
33
76
|
/**
|
|
@@ -86,15 +129,40 @@ async function runDoctorChecks(options = {}) {
|
|
|
86
129
|
quiet = false,
|
|
87
130
|
deep = false,
|
|
88
131
|
projectRoot = process.cwd(),
|
|
132
|
+
homeDir,
|
|
89
133
|
} = options;
|
|
90
134
|
|
|
91
135
|
try {
|
|
92
136
|
const context = {
|
|
93
137
|
projectRoot,
|
|
94
138
|
frameworkRoot: path.resolve(__dirname, '..', '..', '..'),
|
|
95
|
-
options: { fix, json, dryRun, quiet, deep },
|
|
139
|
+
options: { fix, json, dryRun, quiet, deep, homeDir },
|
|
96
140
|
};
|
|
97
141
|
|
|
142
|
+
// Story 10.42 — Short-circuit when SINAPSE has never been installed.
|
|
143
|
+
// A fresh user running `sinapse doctor` in an empty dir should see a
|
|
144
|
+
// single friendly line, not 11 FAILs. We still want the full check
|
|
145
|
+
// suite to run when ANY install marker exists (so partial installs
|
|
146
|
+
// are diagnosable).
|
|
147
|
+
const installState = detectInstallState(context);
|
|
148
|
+
if (!installState.installed) {
|
|
149
|
+
const summary = { pass: 0, warn: 0, fail: 0, info: 0 };
|
|
150
|
+
const output = {
|
|
151
|
+
version: DOCTOR_VERSION,
|
|
152
|
+
timestamp: new Date().toISOString(),
|
|
153
|
+
summary,
|
|
154
|
+
checks: [],
|
|
155
|
+
fixResults: null,
|
|
156
|
+
internalError: null,
|
|
157
|
+
notInstalled: true,
|
|
158
|
+
installCommand: 'npx sinapse-ai install',
|
|
159
|
+
};
|
|
160
|
+
return {
|
|
161
|
+
formatted: json ? formatJson(output) : formatText(output, { quiet }),
|
|
162
|
+
data: output,
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
|
|
98
166
|
// Load and run all checks (deep checks only with --deep flag)
|
|
99
167
|
const checks = loadChecks({ deep });
|
|
100
168
|
const results = [];
|
|
@@ -184,6 +252,11 @@ function resolveExitCode(result) {
|
|
|
184
252
|
if (result.data.internalError) {
|
|
185
253
|
return 3;
|
|
186
254
|
}
|
|
255
|
+
// Story 10.42 — distinct exit code for "SINAPSE never installed".
|
|
256
|
+
// Scripts that today branch on 0/1/2/3 are unaffected; 4 is new.
|
|
257
|
+
if (result.data.notInstalled) {
|
|
258
|
+
return 4;
|
|
259
|
+
}
|
|
187
260
|
const summary = result.data.summary || {};
|
|
188
261
|
if ((summary.fail || 0) > 0) {
|
|
189
262
|
return 2;
|
|
@@ -381,15 +381,20 @@ class RegistryUpdater {
|
|
|
381
381
|
|
|
382
382
|
const newChecksum = computeChecksum(absPath);
|
|
383
383
|
|
|
384
|
+
// Only update timestamps + return mutated=true when the entity actually
|
|
385
|
+
// changed. Touching lastVerified on every commit (even no-op modifies)
|
|
386
|
+
// caused chronic git churn — the file would always show modified, forcing
|
|
387
|
+
// users to either commit noise or stash repeatedly. (Story: timestamp churn fix.)
|
|
384
388
|
if (newChecksum !== existing.checksum) {
|
|
385
389
|
existing.checksum = newChecksum;
|
|
386
390
|
existing.purpose = extractPurpose(content, absPath);
|
|
387
391
|
existing.keywords = extractKeywords(absPath, content);
|
|
388
392
|
existing.dependencies = detectDependencies(content, entityId);
|
|
393
|
+
existing.lastVerified = new Date().toISOString();
|
|
394
|
+
return true;
|
|
389
395
|
}
|
|
390
396
|
|
|
391
|
-
|
|
392
|
-
return true;
|
|
397
|
+
return false;
|
|
393
398
|
}
|
|
394
399
|
|
|
395
400
|
_handleFileDelete(registry, absPath) {
|