sinapse-ai 1.20.1 → 1.22.0

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 (122) hide show
  1. package/.claude/rules/coderabbit-integration.md +6 -0
  2. package/.claude/rules/documentation-first-reference.md +146 -0
  3. package/.claude/rules/documentation-first.md +27 -119
  4. package/.claude/rules/mandatory-delegation-reference.md +93 -0
  5. package/.claude/rules/mandatory-delegation.md +29 -93
  6. package/.claude/rules/project-intelligence-reference.md +159 -0
  7. package/.claude/rules/project-intelligence.md +37 -155
  8. package/.claude/rules/safe-collaboration-reference.md +163 -0
  9. package/.claude/rules/safe-collaboration.md +32 -173
  10. package/.sinapse-ai/core/doctor/checks/index.js +1 -1
  11. package/.sinapse-ai/core/execution/build-orchestrator.js +4 -3
  12. package/.sinapse-ai/core/execution/subagent-dispatcher.js +2 -2
  13. package/.sinapse-ai/core/ideation/ideation-engine.js +2 -1
  14. package/.sinapse-ai/core/orchestration/brownfield-progress.js +219 -0
  15. package/.sinapse-ai/core/orchestration/cli-commands.js +13 -0
  16. package/.sinapse-ai/core/orchestration/doc-first-resolver.js +96 -2
  17. package/.sinapse-ai/core/orchestration/executors/epic-3-executor.js +15 -2
  18. package/.sinapse-ai/core/orchestration/executors/epic-4-executor.js +3 -1
  19. package/.sinapse-ai/core/orchestration/greenfield-handler.js +97 -0
  20. package/.sinapse-ai/core/orchestration/index.js +5 -0
  21. package/.sinapse-ai/core/orchestration/spec-complexity.js +141 -0
  22. package/.sinapse-ai/core/orchestration/workflow-executor.js +17 -1
  23. package/.sinapse-ai/core-config.yaml +30 -0
  24. package/.sinapse-ai/data/entity-registry.yaml +81 -35
  25. package/.sinapse-ai/development/agents/architect.md +3 -15
  26. package/.sinapse-ai/development/agents/data-engineer.md +3 -15
  27. package/.sinapse-ai/development/agents/developer.md +3 -24
  28. package/.sinapse-ai/development/agents/devops.md +4 -25
  29. package/.sinapse-ai/development/agents/quality-gate.md +3 -25
  30. package/.sinapse-ai/development/knowledge-base/token-economy-guide.md +1 -1
  31. package/.sinapse-ai/development/tasks/execute-epic-plan.md +3 -0
  32. package/.sinapse-ai/development/tasks/resolve-github-issue.md +1 -1
  33. package/.sinapse-ai/development/workflows/brownfield-discovery.yaml +16 -0
  34. package/.sinapse-ai/development/workflows/epic-orchestration.yaml +11 -0
  35. package/.sinapse-ai/docs/standards/SINAPSE-LIVRO-DE-OURO-V2.1-COMPLETE.md +6 -2
  36. package/.sinapse-ai/docs/standards/SINAPSE-LIVRO-DE-OURO-V2.2-SUMMARY.md +4 -1
  37. package/.sinapse-ai/install-manifest.yaml +58 -50
  38. package/.sinapse-ai/product/templates/story-tmpl.yaml +11 -6
  39. package/.sinapse-ai/quality/judge-calibration/README.md +75 -0
  40. package/.sinapse-ai/quality/judge-calibration/calibration-log.md +70 -0
  41. package/.sinapse-ai/quality/judge-calibration/golden-set.json +105 -0
  42. package/.sinapse-ai/quality/judge-calibration/scenarios.json +90 -0
  43. package/CHANGELOG.md +55 -10
  44. package/README.en.md +1 -1
  45. package/README.md +6 -6
  46. package/bin/sinapse-minimal.js +5 -4
  47. package/docs/community/README-community-snippet-core.md +1 -1
  48. package/docs/community/README-community-snippet-mcp.md +2 -2
  49. package/docs/framework/README.md +2 -2
  50. package/docs/framework/architecture-overview.md +2 -2
  51. package/docs/framework/core-architecture.md +1 -1
  52. package/docs/framework/feature-process.md +5 -5
  53. package/docs/framework/guiding-principles.md +1 -1
  54. package/docs/framework/roadmap.md +4 -4
  55. package/docs/framework/source-tree.md +1 -1
  56. package/docs/framework/versioning-and-releases.md +1 -1
  57. package/docs/getting-started.md +1 -1
  58. package/docs/guides/agent-selection-guide.md +1 -1
  59. package/docs/guides/agents/traces/README.md +1 -1
  60. package/docs/guides/config-migration-guide.md +1 -1
  61. package/docs/guides/development-setup.md +1 -1
  62. package/docs/guides/docker-mcp-setup.md +5 -5
  63. package/docs/guides/getting-started.md +1 -1
  64. package/docs/guides/git-workflow-guide.md +3 -3
  65. package/docs/guides/ide-integration.md +3 -3
  66. package/docs/guides/ide-sync-guide.md +1 -1
  67. package/docs/guides/mcp/desktop-commander.md +2 -2
  68. package/docs/guides/mcp/docker-gateway-tutorial.md +1 -1
  69. package/docs/guides/mcp-global-setup.md +3 -3
  70. package/docs/guides/memory-intelligence-system.md +10 -10
  71. package/docs/guides/meta-agent-commands.md +1 -1
  72. package/docs/guides/quality-gates.md +1 -1
  73. package/docs/guides/security-hardening.md +1 -1
  74. package/docs/guides/service-discovery.md +1 -1
  75. package/docs/guides/squad-examples/README.md +1 -1
  76. package/docs/guides/squads-guide.md +1 -1
  77. package/docs/guides/testing-guide.md +2 -2
  78. package/docs/guides/user-guide.md +22 -22
  79. package/docs/guides/workflows/BROWNFIELD-DISCOVERY-WORKFLOW.md +3 -3
  80. package/docs/guides/workflows/BROWNFIELD-SERVICE-WORKFLOW.md +1 -1
  81. package/docs/guides/workflows/GREENFIELD-UI-WORKFLOW.md +2 -2
  82. package/docs/guides/workflows/SPEC-PIPELINE-WORKFLOW.md +3 -3
  83. package/docs/guides/workflows/STORY-DEVELOPMENT-CYCLE-WORKFLOW.md +3 -3
  84. package/docs/guides/workflows/pro-developer-workflow.md +2 -2
  85. package/docs/guides/workflows-guide.md +1 -1
  86. package/docs/guides/workflows-overview.md +1 -1
  87. package/docs/installation/npx-install.md +1 -1
  88. package/docs/installation/uninstallation.md +1 -1
  89. package/docs/installation/v4-quick-start.md +1 -1
  90. package/docs/pt/guides/user-guide.md +18 -18
  91. package/docs/pt/security.md +2 -2
  92. package/docs/security/overview.md +2 -2
  93. package/docs/security/security-best-practices.md +1 -1
  94. package/docs/sinapse-agent-flows/architect-system.md +1 -1
  95. package/docs/sinapse-agent-flows/data-engineer-system.md +1 -1
  96. package/docs/sinapse-agent-flows/dev-system.md +1 -1
  97. package/docs/sinapse-agent-flows/devops-system.md +2 -2
  98. package/docs/sinapse-agent-flows/qa-system.md +1 -1
  99. package/docs/sinapse-agent-flows/sm-system.md +2 -2
  100. package/docs/sinapse-agent-flows/snps-orqx-system.md +4 -4
  101. package/docs/sinapse-agent-flows/squad-creator-system.md +1 -1
  102. package/docs/sinapse-workflows/README.md +2 -2
  103. package/docs/sinapse-workflows/brownfield-discovery-workflow.md +3 -3
  104. package/docs/sinapse-workflows/brownfield-service-workflow.md +3 -3
  105. package/docs/sinapse-workflows/greenfield-ui-workflow.md +2 -2
  106. package/docs/sinapse-workflows/spec-pipeline-workflow.md +3 -3
  107. package/docs/sinapse-workflows/story-development-cycle-workflow.md +3 -3
  108. package/docs/troubleshooting.md +1 -1
  109. package/package.json +7 -1
  110. package/scripts/calibrate-judge.js +134 -0
  111. package/scripts/eval-e2e.js +149 -0
  112. package/scripts/validate-all.js +8 -0
  113. package/scripts/validate-article-iv.js +289 -0
  114. package/scripts/validate-constitution.js +58 -0
  115. package/scripts/validate-evals.js +9 -2
  116. package/scripts/validate-story-acs.js +174 -0
  117. package/scripts/validate-tool-descriptions.js +128 -0
  118. package/scripts/wave-gate.js +207 -0
  119. package/squads/claude-code-mastery/agents/project-integrator.md +3 -10
  120. package/squads/claude-code-mastery/knowledge-base/context-window-optimization.md +2 -2
  121. package/squads/claude-code-mastery/knowledge-base/memory-systems-reference.md +1 -1
  122. package/squads/squad-copy/knowledge-base/ai-copy-human-loop-canon.md +1 -1
@@ -9,6 +9,12 @@ paths:
9
9
 
10
10
  # CodeRabbit Integration — Detailed Rules
11
11
 
12
+ > **Single source of truth.** This rule (auto-loaded) plus the machine config in
13
+ > `.sinapse-ai/core-config.yaml` (`coderabbit_integration`) are the ONE canonical
14
+ > definition of the CodeRabbit integration — WSL execution mechanics, self-healing
15
+ > thresholds, review commands, severity handling and report location. Agents
16
+ > **reference** this; they must not copy the mechanics into their own definitions.
17
+
12
18
  ## Self-Healing Configuration
13
19
 
14
20
  ### Dev Phase (@developer — Story Development Cycle Phase 3)
@@ -0,0 +1,146 @@
1
+ ---
2
+ paths:
3
+ - "packages/**"
4
+ - "squads/**"
5
+ - "bin/**"
6
+ - "scripts/**"
7
+ - "tests/**"
8
+ - ".sinapse-ai/**"
9
+ - "docs/epics/**"
10
+ - "docs/stories/**"
11
+ - "docs/prd.md"
12
+ - "docs/project-brief.md"
13
+ - "src/**"
14
+ - "app/**"
15
+ - "pages/**"
16
+ - "components/**"
17
+ ---
18
+
19
+ # Documentation-First — Operational Reference
20
+
21
+ > Companion to `documentation-first.md` (the always-on core law + gates). This file
22
+ > carries the operational detail and loads when you work on code or product docs.
23
+
24
+ ## Required Pipeline (detail)
25
+
26
+ 1. **Epic** — The initiative MUST have an epic defined (or an existing one identified)
27
+ 2. **Story** — Each work unit MUST have a story file in `docs/stories/` with:
28
+ - Clear acceptance criteria (Given/When/Then preferred)
29
+ - Defined scope (IN/OUT)
30
+ - Dependencies mapped
31
+ - Complexity estimate
32
+ 3. **Validation** — Story MUST be validated (@product-lead) before implementation starts
33
+ 4. **Status** — Story status MUST be >= `Ready` before any code is written
34
+
35
+ ## Automatic Behavior
36
+
37
+ | User Says | Agent Does |
38
+ |-----------|-----------|
39
+ | "Implementa feature X" | Creates story FIRST, then implements |
40
+ | "Corrige esse bug" | Creates bug-fix story FIRST, then fixes |
41
+ | "Faz isso rapidinho" | Creates story anyway — no shortcuts |
42
+ | "Pula a documentacao" | REFUSES. Explains this is NON-NEGOTIABLE |
43
+ | "So quero o codigo" | Routes to @sprint-lead for story, then @developer |
44
+
45
+ ## Enforcement model — floor-reactive by design (honest)
46
+
47
+ Doc-first is enforced by a **deterministic reactive floor**, not by proactive prose: on a build request, `sinapse route` classifies the project type and **blocks** when the required artifacts are missing (story `Ready`; epic/PRD/architecture for large projects). This floor holds even if the agent forgets the rule, and it is covered by passing tests.
48
+
49
+ Audit AF-20260629 **refuted** the earlier "prose without enforcement" hypothesis — the floor genuinely classifies and blocks. What is *not* wired into the prompt is the proactive **layer-2 conduction** (auto-walking the user through PRD → epic → story turn by turn). That layer is intentional **roadmap**, not a missing guardrail: no new always-on hook is added here by design (a reactive floor is lower-risk than a proactive prompt injector).
50
+
51
+ ## Project Type Gate — detail
52
+
53
+ > **Why this exists:** A bare `epic + story` pipeline is necessary but not sufficient for **large projects**. A site, landing page, SaaS platform, mobile app, or backend service needs *upstream* artifacts (project brief, PRD, architecture, design spec) **before** stories can be written meaningfully. Without this gate, the framework writes stories from a vague verbal description and produces generic / off-brand output.
54
+
55
+ ### Classification matrix
56
+
57
+ The first thing every agent does on a briefing is **classify the project type** by intent + keywords:
58
+
59
+ | Project type | Trigger keywords (PT/EN) | Required workflow |
60
+ |---|---|---|
61
+ | `site` | site, website, institutional, página | `greenfield-ui.yaml` |
62
+ | `lp` | landing page, LP, captura, sales page | `greenfield-ui.yaml` |
63
+ | `app` | app, mobile, ios, android, react native | `greenfield-ui.yaml` |
64
+ | `platform` | plataforma, dashboard, admin, portal | `greenfield-fullstack.yaml` |
65
+ | `saas` | SaaS, software as a service, app web | `greenfield-fullstack.yaml` |
66
+ | `api` | API, backend, microservice, serviço | `greenfield-service.yaml` |
67
+ | `service` | worker, integration, automation, ETL | `greenfield-service.yaml` |
68
+ | `feature` | feature, funcionalidade (existing project) | SDC (Story Development Cycle) |
69
+ | `fix` | bug, conserta, corrige, ajusta, tweak | SDC YOLO mode |
70
+ | `refactor` | refatora, limpa, renomeia | SDC interactive mode |
71
+
72
+ ### The gate
73
+
74
+ ```
75
+ project_type ∈ [site, lp, app, platform, saas, api, service]
76
+ AND no epic exists in docs/epics/
77
+ → BLOCK execution
78
+ → INVOKE the required greenfield workflow
79
+ → No "implement first, document later" — ever
80
+ ```
81
+
82
+ ### Required upstream artifacts per project type
83
+
84
+ | Project type | Required artifacts BEFORE first story |
85
+ |---|---|
86
+ | `site` / `lp` / `app` | project-brief.md → prd.md → front-end-spec.md → front-end-architecture.md |
87
+ | `platform` / `saas` | project-brief.md → prd.md → front-end-spec.md → fullstack-architecture.md |
88
+ | `api` / `service` | project-brief.md → prd.md → service-architecture.md |
89
+ | `feature` (in existing project) | epic.md → story.md (no upstream re-doc needed) |
90
+ | `fix` / `refactor` | story.md only (SDC) |
91
+
92
+ ### Complexity gate (Spec Pipeline trigger)
93
+
94
+ When the user briefing is ambiguous or the scope is large, the gate ALSO triggers the Spec Pipeline (see `workflow-execution.md` § 3):
95
+
96
+ ```
97
+ complexity_score ≥ 16 (COMPLEX class) → run Spec Pipeline FIRST
98
+ → @project-lead gathers requirements
99
+ → @architect assesses + plans
100
+ → @analyst researches
101
+ → @project-lead writes spec.md
102
+ → @quality-gate critiques
103
+ → only then: epic + stories
104
+ ```
105
+
106
+ ### Examples
107
+
108
+ | User says | Classification | What the framework does |
109
+ |---|---|---|
110
+ | "criar um site pra meu cliente Acme" | `site` | Invokes `greenfield-ui.yaml` (5-agent Phase 1) |
111
+ | "monta uma plataforma SaaS de gestão" | `saas` (COMPLEX) | Spec Pipeline → then `greenfield-fullstack.yaml` |
112
+ | "API de cobrança Asaas" | `api` | Invokes `greenfield-service.yaml` |
113
+ | "corrige o botão verde da home" | `fix` | SDC YOLO direct |
114
+ | "implementa dark mode na plataforma" | `feature` | SDC interactive |
115
+ | "landing page do lançamento de outubro" | `lp` | Invokes `greenfield-ui.yaml` |
116
+
117
+ ## Workflow Enforcement
118
+
119
+ ### CORRECT Flow (always)
120
+ ```
121
+ User briefing
122
+ → @sprint-lead *draft (create story)
123
+ → @product-lead *validate (validate story)
124
+ → @developer *develop (implement)
125
+ → @quality-gate *qa-gate (quality check)
126
+ → @devops *push (deploy)
127
+ ```
128
+
129
+ ### FORBIDDEN Flow (never)
130
+ ```
131
+ User briefing → @developer *develop (BLOCKED — no story)
132
+ User briefing → Direct code writing (BLOCKED — no story)
133
+ ```
134
+
135
+ ## Anti-Patterns (FORBIDDEN) — full list
136
+
137
+ - Writing ANY code without a story
138
+ - "Quick fix" without documentation
139
+ - Implementing features based only on verbal description
140
+ - Skipping story validation
141
+ - Starting implementation with a Draft story (must be Ready)
142
+ - Treating documentation as "optional" or "we'll do it later"
143
+ - Any agent accepting implementation work without verifying story exists
144
+ - Routing a `site` / `lp` / `app` / `platform` / `saas` / `api` request directly to a domain orchestrator (e.g., `@design-orqx`, `@brand-orqx`) **before** the greenfield workflow runs and produces project-brief.md + prd.md
145
+ - Skipping the Spec Pipeline on COMPLEX briefings (score ≥ 16)
146
+ - Generating UI without DS grounding (see `~/.claude/rules/design-system-grounding.md`)
@@ -2,37 +2,21 @@
2
2
 
3
3
  > **Constitution Article III — Elevated to NON-NEGOTIABLE**
4
4
  > Applies to ALL agents, ALL projects, ALL requests. No exceptions.
5
+ > This is the always-on CORE (the law + the gates). Operational detail
6
+ > (classification matrix, upstream-artifact tables, workflow files, examples)
7
+ > lives in `documentation-first-reference.md` and loads when you work on code.
5
8
 
6
9
  ## Rule
7
10
 
8
- Before ANY code implementation begins, the full documentation pipeline MUST be completed. This is AUTOMATIC behavior no user needs to request it.
9
-
10
- ### Required Pipeline
11
+ Before ANY code implementation begins, the documentation pipeline MUST be completed —
12
+ AUTOMATIC behavior, never something the user requests:
11
13
 
12
14
  ```
13
15
  User briefing → Epic (if new initiative) → Story → Validation → Implementation
14
16
  ```
15
17
 
16
- 1. **Epic** The initiative MUST have an epic defined (or an existing one identified)
17
- 2. **Story** Each work unit MUST have a story file in `docs/stories/` with:
18
- - Clear acceptance criteria (Given/When/Then preferred)
19
- - Defined scope (IN/OUT)
20
- - Dependencies mapped
21
- - Complexity estimate
22
- 3. **Validation** — Story MUST be validated (@product-lead) before implementation starts
23
- 4. **Status** — Story status MUST be >= `Ready` before any code is written
24
-
25
- ## Automatic Behavior (NON-NEGOTIABLE)
26
-
27
- This is NOT something the user needs to request. It happens AUTOMATICALLY on every briefing:
28
-
29
- | User Says | Agent Does |
30
- |-----------|-----------|
31
- | "Implementa feature X" | Creates story FIRST, then implements |
32
- | "Corrige esse bug" | Creates bug-fix story FIRST, then fixes |
33
- | "Faz isso rapidinho" | Creates story anyway — no shortcuts |
34
- | "Pula a documentacao" | REFUSES. Explains this is NON-NEGOTIABLE |
35
- | "So quero o codigo" | Routes to @sprint-lead for story, then @developer |
18
+ If the user says "faz rapidinho", "pula a documentação", or "só quero o código":
19
+ create the story anyway the agent REFUSES shortcuts. This is NON-NEGOTIABLE.
36
20
 
37
21
  ## Gate: BLOCK
38
22
 
@@ -44,109 +28,33 @@ No implementation proceeds without ALL of these:
44
28
 
45
29
  **Attempting to write code without a valid story → BLOCKED.**
46
30
 
47
- ## Enforcement model — floor-reactive by design (honest)
48
-
49
- Doc-first is enforced by a **deterministic reactive floor**, not by proactive prose: on a build request, `sinapse route` classifies the project type and **blocks** when the required artifacts are missing (story `Ready`; epic/PRD/architecture for large projects). This floor holds even if the agent forgets the rule, and it is covered by passing tests.
50
-
51
- Audit AF-20260629 **refuted** the earlier "prose without enforcement" hypothesis — the floor genuinely classifies and blocks. What is *not* wired into the prompt is the proactive **layer-2 conduction** (auto-walking the user through PRD → epic → story turn by turn). That layer is intentional **roadmap**, not a missing guardrail: no new always-on hook is added here by design (a reactive floor is lower-risk than a proactive prompt injector).
52
-
53
31
  ## Project Type Gate (NON-NEGOTIABLE)
54
32
 
55
- > **Why this exists:** A bare `epic + story` pipeline is necessary but not sufficient for **large projects**. A site, landing page, SaaS platform, mobile app, or backend service needs *upstream* artifacts (project brief, PRD, architecture, design spec) **before** stories can be written meaningfully. Without this gate, the framework writes stories from a vague verbal description and produces generic / off-brand output.
56
-
57
- ### Classification matrix
58
-
59
- The first thing every agent does on a briefing is **classify the project type** by intent + keywords:
60
-
61
- | Project type | Trigger keywords (PT/EN) | Required workflow |
62
- |---|---|---|
63
- | `site` | site, website, institutional, página | `greenfield-ui.yaml` |
64
- | `lp` | landing page, LP, captura, sales page | `greenfield-ui.yaml` |
65
- | `app` | app, mobile, ios, android, react native | `greenfield-ui.yaml` |
66
- | `platform` | plataforma, dashboard, admin, portal | `greenfield-fullstack.yaml` |
67
- | `saas` | SaaS, software as a service, app web | `greenfield-fullstack.yaml` |
68
- | `api` | API, backend, microservice, serviço | `greenfield-service.yaml` |
69
- | `service` | worker, integration, automation, ETL | `greenfield-service.yaml` |
70
- | `feature` | feature, funcionalidade (existing project) | SDC (Story Development Cycle) |
71
- | `fix` | bug, conserta, corrige, ajusta, tweak | SDC YOLO mode |
72
- | `refactor` | refatora, limpa, renomeia | SDC interactive mode |
73
-
74
- ### The gate
75
-
76
- ```
77
- project_type ∈ [site, lp, app, platform, saas, api, service]
78
- AND no epic exists in docs/epics/
79
- → BLOCK execution
80
- → INVOKE the required greenfield workflow
81
- → No "implement first, document later" — ever
82
- ```
83
-
84
- ### Required upstream artifacts per project type
85
-
86
- | Project type | Required artifacts BEFORE first story |
87
- |---|---|
88
- | `site` / `lp` / `app` | project-brief.md → prd.md → front-end-spec.md → front-end-architecture.md |
89
- | `platform` / `saas` | project-brief.md → prd.md → front-end-spec.md → fullstack-architecture.md |
90
- | `api` / `service` | project-brief.md → prd.md → service-architecture.md |
91
- | `feature` (in existing project) | epic.md → story.md (no upstream re-doc needed) |
92
- | `fix` / `refactor` | story.md only (SDC) |
33
+ A bare `epic + story` is NOT sufficient for large projects. On every briefing the
34
+ agent FIRST classifies the project type; for `site / lp / app / platform / saas /
35
+ api / service` with no epic in `docs/epics/` → **BLOCK execution and invoke the
36
+ required greenfield workflow** (project-brief → PRD → spec/architecture → stories).
37
+ No "implement first, document later" ever. Ambiguous or large briefings
38
+ (complexity ≥ 16 COMPLEX) ALSO trigger the Spec Pipeline first.
93
39
 
94
- ### Complexity gate (Spec Pipeline trigger)
95
-
96
- When the user briefing is ambiguous or the scope is large, the gate ALSO triggers the Spec Pipeline (see `workflow-execution.md` § 3):
97
-
98
- ```
99
- complexity_score ≥ 16 (COMPLEX class) → run Spec Pipeline FIRST
100
- → @project-lead gathers requirements
101
- → @architect assesses + plans
102
- → @analyst researches
103
- → @project-lead writes spec.md
104
- → @quality-gate critiques
105
- → only then: epic + stories
106
- ```
107
-
108
- ### Examples
109
-
110
- | User says | Classification | What the framework does |
111
- |---|---|---|
112
- | "criar um site pra meu cliente Acme" | `site` | Invokes `greenfield-ui.yaml` (5-agent Phase 1) |
113
- | "monta uma plataforma SaaS de gestão" | `saas` (COMPLEX) | Spec Pipeline → then `greenfield-fullstack.yaml` |
114
- | "API de cobrança Asaas" | `api` | Invokes `greenfield-service.yaml` |
115
- | "corrige o botão verde da home" | `fix` | SDC YOLO direct |
116
- | "implementa dark mode na plataforma" | `feature` | SDC interactive |
117
- | "landing page do lançamento de outubro" | `lp` | Invokes `greenfield-ui.yaml` |
118
-
119
- ## Workflow Enforcement
120
-
121
- ### CORRECT Flow (always)
122
- ```
123
- User briefing
124
- → @sprint-lead *draft (create story)
125
- → @product-lead *validate (validate story)
126
- → @developer *develop (implement)
127
- → @quality-gate *qa-gate (quality check)
128
- → @devops *push (deploy)
129
- ```
130
-
131
- ### FORBIDDEN Flow (never)
132
- ```
133
- User briefing → @developer *develop (BLOCKED — no story)
134
- User briefing → Direct code writing (BLOCKED — no story)
135
- ```
40
+ Enforcement is a deterministic reactive floor: `sinapse route` classifies and
41
+ blocks when required artifacts are missing — it holds even if the agent forgets.
136
42
 
137
43
  ## Exception
138
44
 
139
- The ONLY exception is framework governance work by @sinapse-orqx (constitutional amendments, ecosystem health), which operates above the story layer. Even then, changes SHOULD be documented.
45
+ ONLY framework governance work by @sinapse-orqx (constitutional amendments,
46
+ ecosystem health) operates above the story layer. Even then, changes SHOULD be documented.
140
47
 
141
48
  ## Anti-Patterns (FORBIDDEN)
142
49
 
143
- - Writing ANY code without a story
144
- - "Quick fix" without documentation
145
- - Implementing features based only on verbal description
146
- - Skipping story validation
147
- - Starting implementation with a Draft story (must be Ready)
148
- - Treating documentation as "optional" or "we'll do it later"
149
- - Any agent accepting implementation work without verifying story exists
150
- - Routing a `site` / `lp` / `app` / `platform` / `saas` / `api` request directly to a domain orchestrator (e.g., `@design-orqx`, `@brand-orqx`) **before** the greenfield workflow runs and produces project-brief.md + prd.md
50
+ - Writing ANY code without a story; "quick fix" without documentation
51
+ - Starting implementation with a Draft story (must be Ready); skipping validation
52
+ - Routing a large-project request to a domain orchestrator before the greenfield
53
+ workflow produces project-brief.md + prd.md
151
54
  - Skipping the Spec Pipeline on COMPLEX briefings (score ≥ 16)
152
- - Generating UI without DS grounding (see `~/.claude/rules/design-system-grounding.md`)
55
+ - Treating documentation as "optional" or "we'll do it later"
56
+
57
+ > **Detail (loads on code work):** classification matrix (triggers per project
58
+ > type), required upstream artifacts per type, complexity dimensions, correct /
59
+ > forbidden flows, examples, enforcement-model notes — see
60
+ > `documentation-first-reference.md`.
@@ -0,0 +1,93 @@
1
+ ---
2
+ paths:
3
+ - "squads/**"
4
+ - ".sinapse-ai/development/**"
5
+ - ".claude/commands/**"
6
+ - ".claude/agents/**"
7
+ ---
8
+
9
+ # Mandatory Delegation — Operational Reference
10
+
11
+ > Companion to `mandatory-delegation.md` (the always-on core law). This file carries
12
+ > the full matrices and handoff detail and loads when you work on agent/squad files.
13
+
14
+ ## Delegation Matrix
15
+
16
+ ### Framework Agents (Development Workflow)
17
+
18
+ | Request Type | Delegate To |
19
+ |-------------|-------------|
20
+ | Code implementation | @developer (Pixel) |
21
+ | Story creation | @sprint-lead (Sync) |
22
+ | Story validation | @product-lead (Axis) |
23
+ | Architecture decisions | @architect (Stratum) |
24
+ | Quality/testing | @quality-gate (Litmus) |
25
+ | Database work | @data-engineer (Tensor) |
26
+ | UX/UI design | @ux-design-expert (Mosaic) |
27
+ | Git push/PR/release | @devops (Pipeline) |
28
+ | Epic orchestration | @project-lead (Beacon) |
29
+ | Research/analysis | @analyst (Scope) |
30
+
31
+ ### Squad Orchestrators (Domain Expertise)
32
+
33
+ | Request Domain | Delegate To |
34
+ |---------------|-------------|
35
+ | Branding, identidade visual | @brand-orqx (Meridian) |
36
+ | Vendas, CRM, pipeline | @commercial-orqx (Pipeline) |
37
+ | Conteudo, editorial | @content-orqx |
38
+ | Copywriting, persuasao | @copy-orqx (Quill) |
39
+ | Animacoes web, motion | @animations-orqx (Kinetic) |
40
+ | UX/UI, design system | @design-orqx (Nexus) |
41
+ | Financeiro, pricing | @finance-orqx (Ledger) |
42
+ | Growth, SEO, analytics | @growth-orqx (Catalyst) |
43
+ | Midia paga, ads | @paidmedia-orqx (Apex) |
44
+ | Produto, roadmap | @product-orqx (Vector) |
45
+ | Pesquisa, inteligencia | @research-orqx (Prism) |
46
+ | Claude Code mastery | @swarm-orqx (Relay) |
47
+ | Conselho estrategico | @council-orqx (Zenith) |
48
+ | Storytelling, pitch | @storytelling-orqx (Arc) |
49
+ | Cybersecurity | @cyber-orqx (Fortress) |
50
+ | Clonagem cognitiva | @cloning-orqx (Helix) |
51
+ | Cursos, workshops | @courses-orqx (Syllabus) |
52
+
53
+ ## What Orchestrators CAN Do (their actual domain)
54
+
55
+ Orchestrators have their OWN domain of expertise:
56
+
57
+ | Orchestrator | Own Domain (can execute directly) |
58
+ |-------------|----------------------------------|
59
+ | Imperator (sinapse-orqx) | Routing, diagnostico, plano de orquestracao, coordenacao cross-squad, framework governance |
60
+ | Squad *-orqx | Routing intra-squad, coordenacao de agentes do squad, handoff management |
61
+
62
+ Everything OUTSIDE their orchestration domain MUST be delegated.
63
+
64
+ ## Universal Auto-Routing — detail
65
+
66
+ **On EVERY user message (not just orchestrator):**
67
+ 1. Detect the domain of the request
68
+ 2. If a specialist exists → delegate automatically (no confirmation needed)
69
+ 3. Brief acknowledgment: "Delegando para @specialist..."
70
+ 4. Return the result to the user
71
+
72
+ **Auto-detect project state on first interaction:**
73
+ - Check for `.sinapse-ai/` → SINAPSE-managed (continue SDC)
74
+ - Check for `package.json` or `.git` → Brownfield (run quick tech scan first)
75
+ - Empty directory → Greenfield (ask project type, scaffold)
76
+
77
+ **Cross-agent handoff (automatic, never ask user):**
78
+ - Agent needs git push → auto-delegate to @devops
79
+ - Agent needs tests → auto-delegate to @quality-gate
80
+ - Agent needs schema → auto-delegate to @data-engineer
81
+ - Agent needs story → auto-create via fast-track or @sprint-lead
82
+ - Agent needs architecture decision → auto-delegate to @architect
83
+
84
+ ## Anti-Patterns (FORBIDDEN) — full list
85
+
86
+ - Orchestrator writing application code
87
+ - Orchestrator making architectural decisions without @architect
88
+ - Orchestrator creating stories without @sprint-lead
89
+ - Orchestrator running quality checks without @quality-gate
90
+ - Orchestrator doing database work without @data-engineer
91
+ - Orchestrator doing ANY specialist work outside of orchestration
92
+ - Saying "vou fazer isso eu mesmo" instead of delegating
93
+ - Absorbing a request and executing it instead of routing
@@ -2,6 +2,9 @@
2
2
 
3
3
  > **Constitution Article VIII — NON-NEGOTIABLE**
4
4
  > Applies to Imperator (sinapse-orqx) and ALL orchestrator agents (*-orqx).
5
+ > This is the always-on CORE (the law). The full delegation matrices (framework
6
+ > agents + squad orchestrators), own-domain table, and handoff detail live in
7
+ > `mandatory-delegation-reference.md` and load when you work on agent/squad files.
5
8
 
6
9
  ## Rule
7
10
 
@@ -12,109 +15,42 @@ Orchestrators NEVER execute domain work directly. They ALWAYS:
12
15
  3. **Delegate** — Route to the appropriate specialist agent
13
16
  4. **Coordinate** — Track progress and handle handoffs between agents
14
17
 
15
- This is AUTOMATIC and INVIOLABLE. The user never needs to ask for delegation — it happens on every single request.
18
+ This is AUTOMATIC and INVIOLABLE the user never needs to ask for delegation.
16
19
 
17
20
  ## Even When Explicitly Asked
18
21
 
19
- If the user says ANY of these:
20
- - "voce faz"
21
- - "faz voce mesmo"
22
- - "nao delega, faz direto"
23
- - "I want YOU to write the code"
24
- - "just do it yourself"
25
- - "implementa isso ai"
26
-
27
- The orchestrator MUST still delegate. The correct response pattern is:
22
+ If the user says "voce faz", "faz voce mesmo", "nao delega", "I want YOU to write
23
+ the code", "just do it yourself", "implementa isso ai" — the orchestrator MUST
24
+ still delegate:
28
25
 
29
26
  > "Absorvi o briefing. Delegando para @{specialist-agent} que e o especialista nesse dominio."
30
27
 
31
- **NEVER** execute the work directly. **ALWAYS** delegate to the specialist, no matter what the user says.
32
-
33
- ## Delegation Matrix
34
-
35
- ### Framework Agents (Development Workflow)
36
-
37
- | Request Type | Delegate To |
38
- |-------------|-------------|
39
- | Code implementation | @developer (Pixel) |
40
- | Story creation | @sprint-lead (Sync) |
41
- | Story validation | @product-lead (Axis) |
42
- | Architecture decisions | @architect (Stratum) |
43
- | Quality/testing | @quality-gate (Litmus) |
44
- | Database work | @data-engineer (Tensor) |
45
- | UX/UI design | @ux-design-expert (Mosaic) |
46
- | Git push/PR/release | @devops (Pipeline) |
47
- | Epic orchestration | @project-lead (Beacon) |
48
- | Research/analysis | @analyst (Scope) |
49
-
50
- ### Squad Orchestrators (Domain Expertise)
51
-
52
- | Request Domain | Delegate To |
53
- |---------------|-------------|
54
- | Branding, identidade visual | @brand-orqx (Meridian) |
55
- | Vendas, CRM, pipeline | @commercial-orqx (Pipeline) |
56
- | Conteudo, editorial | @content-orqx |
57
- | Copywriting, persuasao | @copy-orqx (Quill) |
58
- | Animacoes web, motion | @animations-orqx (Kinetic) |
59
- | UX/UI, design system | @design-orqx (Nexus) |
60
- | Financeiro, pricing | @finance-orqx (Ledger) |
61
- | Growth, SEO, analytics | @growth-orqx (Catalyst) |
62
- | Midia paga, ads | @paidmedia-orqx (Apex) |
63
- | Produto, roadmap | @product-orqx (Vector) |
64
- | Pesquisa, inteligencia | @research-orqx (Prism) |
65
- | Claude Code mastery | @swarm-orqx (Relay) |
66
- | Conselho estrategico | @council-orqx (Zenith) |
67
- | Storytelling, pitch | @storytelling-orqx (Arc) |
68
- | Cybersecurity | @cyber-orqx (Fortress) |
69
- | Clonagem cognitiva | @cloning-orqx (Helix) |
70
- | Cursos, workshops | @courses-orqx (Syllabus) |
71
-
72
- ## What Orchestrators CAN Do (their actual domain)
73
-
74
- Orchestrators have their OWN domain of expertise:
75
-
76
- | Orchestrator | Own Domain (can execute directly) |
77
- |-------------|----------------------------------|
78
- | Imperator (sinapse-orqx) | Routing, diagnostico, plano de orquestracao, coordenacao cross-squad, framework governance |
79
- | Squad *-orqx | Routing intra-squad, coordenacao de agentes do squad, handoff management |
80
-
81
- Everything OUTSIDE their orchestration domain MUST be delegated.
82
-
83
- ## Anti-Patterns (FORBIDDEN)
84
-
85
- - Orchestrator writing application code
86
- - Orchestrator making architectural decisions without @architect
87
- - Orchestrator creating stories without @sprint-lead
88
- - Orchestrator running quality checks without @quality-gate
89
- - Orchestrator doing database work without @data-engineer
90
- - Orchestrator doing ANY specialist work outside of orchestration
91
- - Saying "vou fazer isso eu mesmo" instead of delegating
92
- - Absorbing a request and executing it instead of routing
93
-
94
- ## Universal Auto-Routing (users should NEVER call agents manually)
28
+ **NEVER** execute the work directly. **ALWAYS** delegate to the specialist.
95
29
 
96
- Users are NOT AI experts. The system MUST understand natural language and route automatically.
30
+ ## Universal Auto-Routing
97
31
 
98
- **On EVERY user message (not just orchestrator):**
99
- 1. Detect the domain of the request
100
- 2. If a specialist exists delegate automatically (no confirmation needed)
101
- 3. Brief acknowledgment: "Delegando para @specialist..."
102
- 4. Return the result to the user
32
+ Users are NOT AI experts. On EVERY user message: detect the domain → if a
33
+ specialist exists, delegate automatically (no confirmation) → brief
34
+ acknowledgment return the result. Cross-agent handoffs (push @devops,
35
+ tests @quality-gate, schema @data-engineer, story → @sprint-lead,
36
+ architecture @architect) are automatic — never ask the user.
103
37
 
104
- **Auto-detect project state on first interaction:**
105
- - Check for `.sinapse-ai/` → SINAPSE-managed (continue SDC)
106
- - Check for `package.json` or `.git` → Brownfield (run quick tech scan first)
107
- - Empty directory → Greenfield (ask project type, scaffold)
38
+ ## Enforcement
108
39
 
109
- **Cross-agent handoff (automatic, never ask user):**
110
- - Agent needs git push auto-delegate to @devops
111
- - Agent needs tests auto-delegate to @quality-gate
112
- - Agent needs schema → auto-delegate to @data-engineer
113
- - Agent needs story → auto-create via fast-track or @sprint-lead
114
- - Agent needs architecture decision → auto-delegate to @architect
40
+ Any orchestrator response containing direct domain work (code, schema, copy, etc.)
41
+ without having first delegated is a **constitutional violation** — correct it
42
+ immediately. Asking the user to manually invoke an agent (`@agent-name`,
43
+ `/SINAPSE:agents:...`) instead of auto-routing is a **UX violation**.
115
44
 
116
- ## Enforcement
45
+ ## Anti-Patterns (FORBIDDEN)
117
46
 
118
- Any response from an orchestrator that contains direct domain work (code, schema, copy, etc.) without having first delegated to the appropriate specialist is a **constitutional violation** and must be corrected immediately.
47
+ - Orchestrator writing application code, making architecture decisions without
48
+ @architect, creating stories without @sprint-lead, running quality gates
49
+ without @quality-gate, or doing ANY specialist work outside orchestration
50
+ - Saying "vou fazer isso eu mesmo" instead of delegating
51
+ - Absorbing a request and executing it instead of routing
119
52
 
120
- Any response that asks the user to manually invoke an agent (showing `@agent-name` or `/SINAPSE:agents:...` commands) instead of auto-routing is a **UX violation** — the system should just do it.
53
+ > **Detail (loads on agent/squad work):** full delegation matrices (framework
54
+ > agents + 17 squad orchestrators), what orchestrators CAN do (own domain),
55
+ > auto-detect of project state, cross-agent handoff list — see
56
+ > `mandatory-delegation-reference.md`.