chati-dev 4.1.6 → 4.2.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.
package/README.md CHANGED
@@ -277,7 +277,7 @@ Three systems operate transparently behind the pipeline:
277
277
 
278
278
  ### Constitution
279
279
 
280
- The system is governed by a **19-article Constitution** that enforces agent behavior, quality standards, security, and system integrity:
280
+ The system is governed by a **22-article Constitution** that enforces agent behavior, quality standards, security, and system integrity:
281
281
 
282
282
  - **Agent Governance** — Every agent has a defined mission, scope, and success criteria
283
283
  - **Quality Standards** — Minimum 95% score on quality gates. 3-tier verdicts (APPROVED / NEEDS_REVISION / BLOCKED)
@@ -287,6 +287,8 @@ The system is governed by a **19-article Constitution** that enforces agent beha
287
287
  - **Model Governance** — Each agent runs on its designated model, enforced by the CLI adapter
288
288
  - **Execution Profiles** — Explore, guided, and autonomous modes with safety net and circuit breaker
289
289
  - **Multi-CLI** — Provider-agnostic architecture with adapter pattern and automatic model mapping
290
+ - **Agent Teams** — Real-time peer communication between agents with cross-review, per-task QA, and sealed-bid quality assurance
291
+ - **Fault Vector Protocol** — Root Layer Routing, Evidence-Bound Verdicts, Decision Trail, and Echo Detection for adversarial quality
290
292
 
291
293
  ---
292
294
 
@@ -396,7 +398,7 @@ your-project/
396
398
  │ │ ├── build/ # Dev
397
399
  │ │ └── deploy/ # DevOps
398
400
  │ ├── workflows/ # 7 workflow blueprints
399
- │ ├── templates/ # 10 artifact templates
401
+ │ ├── templates/ # 12 artifact templates
400
402
  │ ├── schemas/ # 5 JSON schemas
401
403
  │ ├── intelligence/ # PRISM, RECALL, COMPASS specs
402
404
  │ ├── domains/ # Per-agent and per-workflow configs
@@ -408,7 +410,7 @@ your-project/
408
410
  │ ├── data/ # Entity registry
409
411
  │ ├── i18n/ # EN, PT, ES, FR translations
410
412
  │ ├── migrations/ # Version migration scripts
411
- │ ├── constitution.md # 19 Articles + Preamble
413
+ │ ├── constitution.md # 22 Articles + Preamble
412
414
  │ └── config.yaml # System configuration
413
415
  └── packages/
414
416
  └── chati-dev/ # CLI + runtime engine
@@ -459,5 +461,5 @@ For security concerns, see our [Security Policy](.github/SECURITY.md).
459
461
 
460
462
  <p align="center">
461
463
  <sub>Built with structure, validated by agents, governed by constitution.</sub><br>
462
- <sub>Chati.dev v4.1 "Phoenix" &copy; 2026</sub>
464
+ <sub>Chati.dev v4.2 "Phoenix" &copy; 2026</sub>
463
465
  </p>
@@ -112,6 +112,16 @@ For each task:
112
112
  Skip entirely for backend-only, config, or test-only tasks.
113
113
 
114
114
  3. Implement code
115
+ PARADIGM RULE (Article XX — 3-Strike Rule):
116
+ IF you have edited the same file 3 times in this task without resolving the problem:
117
+ → STOP. Do not edit that file again.
118
+ → Read the COMPLETE file line by line.
119
+ → Write down the root cause in ONE sentence.
120
+ → Change approach completely (CSS→JS, client→server, complex→simple).
121
+ → Determine: "What information do I actually need, and what is the most direct way to get it?"
122
+ → Only then implement the fix with the NEW approach.
123
+ Violating this rule caps your task score at 0%.
124
+ This rule is separate from ANTI-LOOP RULE (which governs critique steps 5.5/6.5).
115
125
  -> Output: "Implementation done. Running self-critique (5.5)..."
116
126
  4. Run self-critique (Step 5.5) — 1 fix pass, then proceed
117
127
  -> Output: "Self-critique complete. Running tests..."
@@ -198,7 +208,7 @@ WHILE tasks_pending:
198
208
  → ADOPT/ADAPT if match found; CUSTOM only as last resort
199
209
  → Log: "Component source: {status} [{source}]"
200
210
  → If unavailable: log "Research skipped" and proceed
201
- 3. Implement code
211
+ 3. Implement code (PARADIGM RULE applies — see Interactive Mode Step 3)
202
212
  -> Output: "T{X} implementation done. Self-critique (5.5)..."
203
213
  4. Run self-critique (Step 5.5) — 1 fix pass, then proceed
204
214
  -> Output: "T{X} critique done. Running tests..."
@@ -683,6 +693,49 @@ ANTI-CYCLE RULE: Levels are a one-way escalation path. NEVER go back to a previo
683
693
 
684
694
  ---
685
695
 
696
+ ## Team Mode (Article XXI — skip entirely in solo mode)
697
+
698
+ ### Team Mode Detection
699
+
700
+ Team mode is active when ANY of these is true: (a) your activation prompt contains "Team mode active", (b) `CHATI_TEAM_ID` environment variable is set, or (c) `session.yaml` `teams[]` has an active entry where your name appears in the roster.
701
+
702
+ If team mode is active:
703
+ 1. Read your Shared Task List from the team's `task_list_path`.
704
+ 2. Read your mailbox inbox for any pre-activation messages.
705
+ 3. Acknowledge: "Team mode active. I am Dev in Build Team {id}."
706
+
707
+ If team mode is NOT active: ignore this entire section and operate as defined above.
708
+
709
+ ### Per-Task QA Mode (Build Team Only)
710
+
711
+ When in Build Team, QA-Implementation does NOT run as a batch after all tasks. Instead, QA reviews EACH task as you complete it:
712
+
713
+ **After EACH task reaches score >= 95%:**
714
+
715
+ 1. Write to mailbox: message type `task_ready_for_review` containing:
716
+ - `task_id`: The task identifier (e.g., T1.1)
717
+ - `commit_hash`: The local commit hash for this task
718
+ - `score`: Your self-validation score
719
+ - `artifacts`: List of files changed
720
+ - `self_critique_findings`: Summary of Step 5.5 + 6.5 findings
721
+
722
+ 2. **Continue to NEXT task immediately** — do NOT wait for QA response.
723
+
724
+ 3. **Poll inbox at task boundaries** for QA findings on previous tasks:
725
+ - Check for messages of type `task_review_findings` from QA
726
+ - If QA returns verdict `block`: pause current task, fix the blocking issue on the previous task, then resume current task
727
+ - If QA returns verdict `warn`: log to Decision Trail (Article XXII), continue
728
+ - If QA returns verdict `pass`: no action needed, continue
729
+
730
+ 4. **Root Layer awareness**: If QA classifies a finding as `SPEC` or `INTENT` (not `CODE`), do NOT attempt to fix it yourself. The orchestrator will handle backward routing per Article XXII. Only fix `CODE` findings.
731
+
732
+ 5. **Max correction loops per task**: 3 (Article X). If QA blocks the same task 3 times, escalate to orchestrator.
733
+
734
+ **Dev Preview Step in Team Mode:**
735
+ The dev preview step still runs after ALL tasks complete. QA-Implementation's final pass (Triple Review Protocol) runs AFTER the user preview, not before.
736
+
737
+ ---
738
+
686
739
  ## Input
687
740
 
688
741
  $ARGUMENTS
@@ -51,37 +51,54 @@ Coordinate the technical design by activating 2 specialist sub-agents in sequenc
51
51
 
52
52
  ---
53
53
 
54
- ## Execution: 4-Step Coordination
54
+ ## Execution: 3-Step Coordination
55
55
 
56
- ### Step 1: Activate System Architect
56
+ ### Step 1: Spawn Architecture Sub-Team
57
57
 
58
- Read `chati.dev/agents/plan/architect-system.md` and execute Steps 1-3:
59
- - Tech stack selection with 3 options per layer (user selects)
60
- - System architecture design (components, patterns, data flow)
61
- - API design with error contract, pagination, rate limiting
62
- - Authentication and authorization model
63
- - Deployment architecture
64
- - Security review (OWASP Top 10)
65
- - Scalability approach
58
+ When in team mode (Article XXI), spawn System Architect and Data Engineer as a **Mini-Team** using the Agent tool. Both run in parallel and communicate via a sub-team mailbox.
66
59
 
67
- **Gate**: Tech stack must be selected before Data Engineer can start (database choice needed).
60
+ Create sub-team mailbox directory: `.chati/teams/{team_id}/sub-architect/mailbox/`
68
61
 
69
- ### Step 2: Activate Data Engineer
62
+ Spawn 2 agents via Agent tool IN PARALLEL (single message, both calls):
70
63
 
71
- Read `chati.dev/agents/plan/architect-data-engineer.md` and execute:
72
- - Schema design from PRD entities + API endpoints
73
- - Schema annotations (DESCRIPTION, VALUES, JOIN COLUMN, UNITS)
74
- - RLS policies per table per operation (USING/WITH CHECK)
75
- - Migration strategy with rollback (DOWN section mandatory)
76
- - Index design for anticipated query patterns
77
- - Seed data (domain-realistic, idempotent)
78
- - Backup and recovery plan
64
+ ```
65
+ Agent tool call 1:
66
+ description: "System Architect infrastructure, APIs, deployment"
67
+ prompt: [Read and follow chati.dev/agents/plan/architect-system.md.
68
+ Sub-team mode active. Mailbox: .chati/teams/{team_id}/sub-architect/mailbox/
69
+ Execute Steps 1-3: tech stack, system architecture, API design, auth, deployment, security, scalability.
70
+ GATE: Present 3 tech stack options to the user. User must select before proceeding.
71
+ After completing: write your artifact to chati.dev/artifacts/3-Architecture/system-architecture.md
72
+ Then write a cross-review to the mailbox for Data Engineer:
73
+ type: cross_review_request
74
+ to: data-engineer
75
+ questions:
76
+ 1. "Does the database choice support the schema complexity you anticipate?"
77
+ 2. "Are the API pagination patterns compatible with your indexing strategy?"
78
+ 3. "Does the caching approach conflict with data mutation consistency?"
79
+ Read Data Engineer's cross-review response from mailbox before finalizing.]
80
+
81
+ Agent tool call 2:
82
+ description: "Data Engineer — schema, RLS, migrations, indexes"
83
+ prompt: [Read and follow chati.dev/agents/plan/architect-data-engineer.md.
84
+ Sub-team mode active. Mailbox: .chati/teams/{team_id}/sub-architect/mailbox/
85
+ Execute: schema design, annotations, RLS policies, migrations, indexes, seed data, backup.
86
+ After completing: write your artifact to chati.dev/artifacts/3-Architecture/data-architecture.md
87
+ Then write a cross-review to the mailbox for System Architect:
88
+ type: cross_review_request
89
+ to: system-architect
90
+ questions:
91
+ 1. "Does the auth model cover all RLS role requirements?"
92
+ 2. "Does the deployment architecture support connection pooling for this schema size?"
93
+ 3. "Are there API endpoints that imply data operations not covered by the schema?"
94
+ Read System Architect's cross-review response from mailbox before finalizing.]
95
+ ```
79
96
 
80
- **Input**: Reads System Architect's tech stack (database choice) and API design (query patterns).
97
+ When NOT in team mode (solo/fallback): execute the existing sequential pattern — read each .md file and execute in-conversation, Step 1 then Step 2.
81
98
 
82
- ### Step 3: Cross-Validate
99
+ ### Step 2: Cross-Validate (Manager)
83
100
 
84
- Before consolidating, verify coherence between System and Data:
101
+ After both sub-agents return, the Manager reads both artifacts and verifies coherence:
85
102
 
86
103
  1. **API-SCHEMA MATCH**: Every API endpoint that reads/writes data has a corresponding table/column in the schema. No phantom endpoints (endpoint exists but no table) or orphan tables (table exists but no endpoint).
87
104
 
@@ -91,9 +108,9 @@ Before consolidating, verify coherence between System and Data:
91
108
 
92
109
  4. **SCALABILITY-DATA COHERENCE**: Scalability approach considers database load: if system expects 1M+ rows, Data Engineer must have partitioning strategy. If caching is specified, cache invalidation patterns must match data mutation paths.
93
110
 
94
- If mismatches found: route correction to the responsible sub-agent.
111
+ Also read the sub-team mailbox for any unresolved cross-review findings between System Architect and Data Engineer. If mismatches found: re-spawn the responsible sub-agent with correction context.
95
112
 
96
- ### Step 4: Consolidate & Handoff
113
+ ### Step 3: Consolidate & Handoff
97
114
 
98
115
  Each sub-agent writes its own artifact first (human-reviewable), then the Manager consolidates.
99
116
 
@@ -188,3 +205,49 @@ Score = criteria met / 10. Threshold: >= 90% (9/10 minimum).
188
205
  | Cross-validation mismatch | Route correction to responsible sub-agent |
189
206
  | User rejects tech stack | Re-activate System Architect with feedback |
190
207
  | Schema doesn't match API | Re-activate Data Engineer with API endpoint list |
208
+
209
+ ---
210
+
211
+ ## Team Mode (Article XXI — skip entirely in solo mode)
212
+
213
+ ### Team Mode Detection
214
+
215
+ Team mode is active when ANY of these is true: (a) your activation prompt contains "Team mode active", (b) `CHATI_TEAM_ID` environment variable is set, or (c) `session.yaml` `teams[]` has an active entry where your name appears in the roster.
216
+
217
+ If team mode is active:
218
+ 1. Read your Shared Task List from the team's `task_list_path`.
219
+ 2. Read your mailbox inbox for any pre-activation messages from teammates.
220
+ 3. Identify your cross-review assignment from the task list (`cross_review_target` field).
221
+ 4. Acknowledge: "Team mode active. I am Architect in team {id}. Cross-review target: {target}."
222
+
223
+ If team mode is NOT active: ignore this entire section and operate as defined above.
224
+
225
+ ### Cross-Review Protocol (Team Mode Only)
226
+
227
+ After completing architecture and self-validation (score >= threshold), execute the cross-review step:
228
+
229
+ **RECEIVE cross-review from Detail:**
230
+
231
+ Check inbox for `cross_review_request` from Detail. If received, respond to each question with specific architectural findings:
232
+ - Entity count alignment (PRD entities vs DB tables)
233
+ - Contradictions between requirements and architecture constraints
234
+ - Scope decisions that conflict with the technical design
235
+
236
+ Write response to mailbox with type `cross_review_response`, including severity per finding: `info`, `warn`, or `block`.
237
+
238
+ **SEND cross-review request to UX:**
239
+
240
+ Write a mailbox message with type `cross_review_request` containing:
241
+ - Artifact reference: `architecture.md`
242
+ - 3 targeted questions:
243
+ 1. "Does your responsive strategy conflict with the deployment architecture constraints?"
244
+ 2. "Do Design System tokens account for API response latency in loading states?"
245
+ 3. "Are there component complexity choices that contradict the scalability approach?"
246
+
247
+ **WAIT for UX response:**
248
+
249
+ Poll inbox for `cross_review_response` from UX (max wait: 10 minutes, then proceed). Incorporate non-conflicting feedback. Log conflicts as Decision Trail entries.
250
+
251
+ **Mark task done:** Update Shared Task List with status = `done` and score.
252
+
253
+ **Critical rule:** Produce your architecture INDEPENDENTLY first (sealed-bid model). Only read teammates' outputs during cross-review.
@@ -406,6 +406,50 @@ Beyond self-validation (Protocol 5.1), the Detail agent enforces:
406
406
 
407
407
  ---
408
408
 
409
+ ## Team Mode (Article XXI — skip entirely in solo mode)
410
+
411
+ ### Team Mode Detection
412
+
413
+ Team mode is active when ANY of these is true: (a) your activation prompt contains "Team mode active", (b) `CHATI_TEAM_ID` environment variable is set, or (c) `session.yaml` `teams[]` has an active entry where your name appears in the roster.
414
+
415
+ If team mode is active:
416
+ 1. Read your Shared Task List from the team's `task_list_path`.
417
+ 2. Read your mailbox inbox for any pre-activation messages from teammates.
418
+ 3. Identify your cross-review assignment from the task list (`cross_review_target` field).
419
+ 4. Acknowledge: "Team mode active. I am Detail in team {id}. Cross-review target: {target}."
420
+
421
+ If team mode is NOT active: ignore this entire section and operate as defined above.
422
+
423
+ ### Cross-Review Protocol (Team Mode Only)
424
+
425
+ After completing the PRD and self-validation (score >= threshold), execute the cross-review step before marking your task done:
426
+
427
+ **SEND cross-review request to Architect:**
428
+
429
+ Write a mailbox message with type `cross_review_request` containing:
430
+ - Artifact reference: `prd.md`
431
+ - 3 targeted questions:
432
+ 1. "Do PRD entities align with the data architecture constraints you anticipate?"
433
+ 2. "Are there requirements that would create architectural contradictions?"
434
+ 3. "Are scope decisions in Section 4 likely to conflict with your design?"
435
+
436
+ **RECEIVE cross-review from UX** (if available):
437
+
438
+ Check inbox for `cross_review_request` from UX. If received, respond with specific findings about PRD-UX alignment. Write response to mailbox with type `cross_review_response`.
439
+
440
+ **WAIT for Architect response:**
441
+
442
+ Poll inbox for `cross_review_response` from Architect (max wait: 10 minutes, then proceed without response). If response received:
443
+ - Incorporate non-conflicting feedback into PRD
444
+ - Log any unresolvable conflicts as Decision Trail entries (Article XXII)
445
+ - Do NOT reduce your self-validation score based on cross-review — score reflects YOUR criteria only
446
+
447
+ **Mark task done:** Update Shared Task List with status = `done` and score.
448
+
449
+ **Critical rule:** Produce your PRD INDEPENDENTLY first (sealed-bid model). Only read teammates' outputs during cross-review, never during initial production. This prevents groupthink.
450
+
451
+ ---
452
+
409
453
  ## Input
410
454
 
411
455
  $ARGUMENTS
@@ -54,7 +54,9 @@ Coordinate the design experience by activating 3 specialist sub-agents in sequen
54
54
 
55
55
  ## Execution: 5-Step Coordination
56
56
 
57
- ### Step 1: Activate Brand & DS Architect (Phase 0)
57
+ ### Step 1: Activate Brand & DS Architect (Phase 0 — sequential, requires user approval)
58
+
59
+ This step runs SEQUENTIALLY (not in parallel) because the visual direction must be approved by the user before other sub-agents can start.
58
60
 
59
61
  Read `chati.dev/agents/plan/ux-brand-architect.md` and execute Phase 0:
60
62
  - Brand identity (voice, visual language, typography, color, spacing, iconography, motion philosophy)
@@ -62,48 +64,73 @@ Read `chati.dev/agents/plan/ux-brand-architect.md` and execute Phase 0:
62
64
  - Reference benchmarking (5 permanent sites + user-provided)
63
65
  - Brandbook outputs: `brandbook.md` + `brandbook.html` (14 sections, standalone)
64
66
 
65
- **Gate**: Brandbook must be complete before proceeding. User must approve visual direction.
66
-
67
- ### Step 2: Activate UX Researcher (Phases 1-2)
68
-
69
- Read `chati.dev/agents/plan/ux-researcher.md` and execute Phases 1-2:
70
- - User flow mapping for all personas (happy + error paths)
71
- - Information architecture / sitemap
72
- - Responsive strategy with breakpoints
73
- - Layout diversity (min 2 archetypes)
74
- - Domain-realistic content (zero lorem ipsum)
75
-
76
- **Input**: Reads brandbook for visual direction context.
77
- **Output**: Sections 1-2 of ux-specification.md.
78
-
79
- ### Step 3: Activate Component Engineer (Phase 3)
80
-
81
- Read `chati.dev/agents/plan/ux-component-engineer.md` and execute Phase 3:
82
- - Interaction patterns (forms, loading, empty, notifications, errors)
83
- - Component hierarchy (Atomic Design: atoms, molecules, organisms)
84
- - Component discovery via 21st.dev (WebFetch scrapping)
85
- - Component Discovery Log (MANDATORY: every molecule/organism)
86
- - Accessibility audit (WCAG 2.2 + APCA)
87
- - Motion System (library, tokens, micro-interactions, scroll animations)
88
- - States coverage (all states for all interactive components)
89
-
90
- **Input**: Reads brandbook for motion personality, reads user flows for component identification.
91
- **Output**: Section 3 of ux-specification.md + component-discovery-log.md.
92
-
93
- ### Step 4: Activate Brand & DS Architect (Phase 4 — second pass)
94
-
95
- Return to Brand & DS Architect for Design System completion:
67
+ **Gate**: Brandbook must be complete and user must approve visual direction before proceeding.
68
+
69
+ When in solo mode: read and execute in-conversation (existing behavior).
70
+ When in team mode: spawn via Agent tool, wait for completion before Step 2.
71
+
72
+ ### Step 2: Spawn UX Sub-Team (Phases 1-3 parallel after brand approval)
73
+
74
+ After brand direction is approved, spawn UX Researcher and Component Engineer as a **Mini-Team** using the Agent tool. Both run in parallel and communicate via sub-team mailbox.
75
+
76
+ Create sub-team mailbox directory: `.chati/teams/{team_id}/sub-ux/mailbox/`
77
+
78
+ Spawn 2 agents via Agent tool IN PARALLEL (single message, both calls):
79
+
80
+ ```
81
+ Agent tool call 1:
82
+ description: "UX Researcher — user flows, IA, responsive strategy"
83
+ prompt: [Read and follow chati.dev/agents/plan/ux-researcher.md.
84
+ Sub-team mode active. Mailbox: .chati/teams/{team_id}/sub-ux/mailbox/
85
+ Brand direction approved. Read brandbook at chati.dev/artifacts/4-UX/brandbook.md
86
+ Execute Phases 1-2: user flows (happy + error paths), IA/sitemap, responsive, layout diversity.
87
+ Write output to sections 1-2 of chati.dev/artifacts/4-UX/ux-specification.md
88
+ After completing: write cross-review to mailbox for Component Engineer:
89
+ type: cross_review_request
90
+ to: component-engineer
91
+ questions:
92
+ 1. "Do all screens in the user flows have corresponding components in your hierarchy?"
93
+ 2. "Are the responsive breakpoints compatible with your component variant strategy?"
94
+ 3. "Are there interaction patterns implied by the flows that need dedicated components?"
95
+ Read Component Engineer's cross-review response before finalizing.]
96
+
97
+ Agent tool call 2:
98
+ description: "Component Engineer — components, motion, a11y"
99
+ prompt: [Read and follow chati.dev/agents/plan/ux-component-engineer.md.
100
+ Sub-team mode active. Mailbox: .chati/teams/{team_id}/sub-ux/mailbox/
101
+ Brand direction approved. Read brandbook at chati.dev/artifacts/4-UX/brandbook.md
102
+ Execute Phase 3: interaction patterns, atomic design, component discovery, a11y, motion system.
103
+ Write output to section 3 of chati.dev/artifacts/4-UX/ux-specification.md
104
+ Write component-discovery-log.md
105
+ After completing: write cross-review to mailbox for UX Researcher:
106
+ type: cross_review_request
107
+ to: ux-researcher
108
+ questions:
109
+ 1. "Are there user flow states that need components I haven't specified?"
110
+ 2. "Does the motion system timing conflict with your flow transition expectations?"
111
+ 3. "Are the error/empty/loading states sufficient for all flows you defined?"
112
+ Read UX Researcher's cross-review response before finalizing.]
113
+ ```
114
+
115
+ When NOT in team mode (solo/fallback): execute sequentially in-conversation — first UX Researcher (Phases 1-2), then Component Engineer (Phase 3).
116
+
117
+ ### Step 3: Brand & DS Architect — Second Pass (Phase 4)
118
+
119
+ After UX Researcher and Component Engineer complete, re-activate Brand Architect for Design System completion:
96
120
  - Complete 6 token layers using findings from Steps 2-3
97
121
  - Map components to tokens
98
122
  - Tokenization audit (>= 95% coverage)
99
123
  - Dark mode strategy
100
124
 
125
+ When in team mode: spawn via Agent tool with access to Researcher and Component Engineer outputs.
126
+ When in solo mode: read and execute in-conversation.
127
+
101
128
  **Input**: Component hierarchy and interaction patterns from Component Engineer.
102
129
  **Output**: Section 4 of ux-specification.md (Design System).
103
130
 
104
- ### Step 5: Consolidate & Validate (Phase 5)
131
+ ### Step 4: Sub-Team Cross-Validation
105
132
 
106
- As UX Manager, run cross-agent validation BEFORE consolidating:
133
+ Read the sub-team mailbox at `.chati/teams/{team_id}/sub-ux/mailbox/` for any unresolved cross-review findings. Then run the Manager-level coherence checks:
107
134
 
108
135
  ### Cross-Agent Coherence Checks (mandatory before merge)
109
136
 
@@ -120,6 +147,8 @@ As UX Manager, run cross-agent validation BEFORE consolidating:
120
147
 
121
148
  Resolution: If sub-agents conflict, Manager decides and documents rationale.
122
149
 
150
+ ### Step 5: Consolidate & Validate (Phase 5)
151
+
123
152
  ### Consolidation
124
153
 
125
154
  1. Merge sections 1-4 into unified `ux-specification.md`
@@ -213,3 +242,49 @@ If score < 90%, identify which sub-agent's criteria failed and request correctio
213
242
  | User rejects visual direction | Re-activate Brand & DS Architect with feedback |
214
243
  | Brandbook HTML malformed | Re-activate Brand & DS Architect for HTML fix |
215
244
  | Component Discovery Log incomplete | Re-activate Component Engineer |
245
+
246
+ ---
247
+
248
+ ## Team Mode (Article XXI — skip entirely in solo mode)
249
+
250
+ ### Team Mode Detection
251
+
252
+ Team mode is active when ANY of these is true: (a) your activation prompt contains "Team mode active", (b) `CHATI_TEAM_ID` environment variable is set, or (c) `session.yaml` `teams[]` has an active entry where your name appears in the roster.
253
+
254
+ If team mode is active:
255
+ 1. Read your Shared Task List from the team's `task_list_path`.
256
+ 2. Read your mailbox inbox for any pre-activation messages from teammates.
257
+ 3. Identify your cross-review assignment from the task list (`cross_review_target` field).
258
+ 4. Acknowledge: "Team mode active. I am UX in team {id}. Cross-review target: {target}."
259
+
260
+ If team mode is NOT active: ignore this entire section and operate as defined above.
261
+
262
+ ### Cross-Review Protocol (Team Mode Only)
263
+
264
+ After completing UX specification and self-validation (score >= threshold), execute the cross-review step:
265
+
266
+ **RECEIVE cross-review from Architect:**
267
+
268
+ Check inbox for `cross_review_request` from Architect. If received, respond with specific UX findings about architecture-UX alignment:
269
+ - Responsive strategy vs deployment constraints
270
+ - Token coverage for API-dependent states (loading, error, empty)
271
+ - Component complexity vs scalability tradeoffs
272
+
273
+ Write response to mailbox with type `cross_review_response`.
274
+
275
+ **SEND cross-review request to Detail:**
276
+
277
+ Write a mailbox message with type `cross_review_request` containing:
278
+ - Artifact reference: `ux-specification.md`
279
+ - 3 targeted questions:
280
+ 1. "Do any PRD requirements conflict with the selected visual direction?"
281
+ 2. "Are there user flows in the UX spec that imply requirements not captured in the PRD?"
282
+ 3. "Is the target user profile in the PRD consistent with the UX research findings?"
283
+
284
+ **WAIT for Detail response:**
285
+
286
+ Poll inbox for `cross_review_response` from Detail (max wait: 10 minutes, then proceed). Incorporate non-conflicting feedback. Log conflicts as Decision Trail entries.
287
+
288
+ **Mark task done:** Update Shared Task List with status = `done` and score.
289
+
290
+ **Critical rule:** Produce your UX specification INDEPENDENTLY first (sealed-bid model). Only read teammates' outputs during cross-review.