chati-dev 1.3.2 → 1.4.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 ADDED
@@ -0,0 +1,331 @@
1
+ <div align="center">
2
+ <br>
3
+ <img src="packages/chati-dev/assets/logo.svg" alt="chati.dev" width="380">
4
+ <br><br>
5
+ <strong>AI-Powered Multi-Agent Orchestration System</strong><br>
6
+ <em>13 agents. 16 articles. 6 IDEs. 4 languages. Structured vibe coding.</em>
7
+ </div>
8
+
9
+ <p align="center">
10
+ <a href="https://www.npmjs.com/package/chati-dev"><img src="https://img.shields.io/npm/v/chati-dev?color=blue&label=npm" alt="npm"></a>
11
+ <a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT"></a>
12
+ <a href="https://nodejs.org/"><img src="https://img.shields.io/badge/node-%3E%3D18.0.0-brightgreen.svg" alt="Node.js"></a>
13
+ <a href="#architecture"><img src="https://img.shields.io/badge/agents-13-purple.svg" alt="Agents"></a>
14
+ <a href="#supported-ides"><img src="https://img.shields.io/badge/IDEs-6-orange.svg" alt="IDEs"></a>
15
+ <a href="#internationalization"><img src="https://img.shields.io/badge/i18n-EN%20%7C%20PT%20%7C%20ES%20%7C%20FR-informational.svg" alt="i18n"></a>
16
+ <a href="CONTRIBUTING.md"><img src="https://img.shields.io/badge/contributions-welcome-brightgreen.svg" alt="Contributions Welcome"></a>
17
+ </p>
18
+
19
+ ---
20
+
21
+ A structured, agent-driven orchestration system that coordinates **13 specialized AI agents** across the full software development lifecycle — from requirements gathering to deployment. Every decision is traceable, every artifact is validated, every session persists.
22
+
23
+ ## Why chati.dev?
24
+
25
+ ### The Problem
26
+
27
+ AI-assisted development today suffers from three critical issues:
28
+
29
+ 1. **Context Loss** — AI forgets decisions across sessions, leading to inconsistent implementations
30
+ 2. **Planning Gaps** — Jumping straight to code without structured requirements leads to rework
31
+ 3. **System Leakage** — Users accidentally "fall out" of agent systems into generic AI mode
32
+
33
+ ### The Solution
34
+
35
+ chati.dev introduces **Agent-Driven Development**: a pipeline of 13 specialized agents where each agent owns a specific phase, produces validated artifacts, and hands off context to the next agent. An Intelligence Layer ensures context is never lost, knowledge persists across sessions, and the user never accidentally leaves the system.
36
+
37
+ ```
38
+ CLARITY (planning) → Quality Gate → BUILD → Quality Gate → DEPLOY
39
+ 8 agents QA-Planning Dev QA-Impl DevOps
40
+ ```
41
+
42
+ ### Key Innovations
43
+
44
+ | Innovation | Description |
45
+ |------------|-------------|
46
+ | **Structured Agent Pipeline** | 13 agents with defined missions, validated outputs, and handoff protocols |
47
+ | **Self-Validating Agents** | Binary pass/fail criteria per agent. Quality gates at planning and implementation |
48
+ | **Context Engine** | 4 context brackets (FRESH → CRITICAL) with 5 injection layers. Autonomous recovery |
49
+ | **Memory Layer** | 4 cognitive sectors. Persistent knowledge across sessions with attention scoring |
50
+ | **Framework Registry** | Entity catalog with decision engine (REUSE/ADAPT/CREATE) for brownfield analysis |
51
+ | **Session Lock** | Once activated, user stays in system until explicit exit. Zero accidental leakage |
52
+ | **IDE-Agnostic** | Works with 6 IDEs through a thin router pattern |
53
+
54
+ ---
55
+
56
+ ## Quick Start
57
+
58
+ ### Install
59
+
60
+ ```bash
61
+ npx chati-dev init
62
+ ```
63
+
64
+ The wizard guides you through language, project type, IDE selection, and MCP configuration.
65
+
66
+ ### Activate
67
+
68
+ ```
69
+ /chati
70
+ ```
71
+
72
+ The orchestrator loads your session, detects where you left off, and routes you to the right agent. You stay inside the system until you explicitly exit.
73
+
74
+ ### Monitor
75
+
76
+ ```bash
77
+ npx chati-dev status # One-time snapshot
78
+ npx chati-dev status --watch # Auto-refresh every 5s
79
+ ```
80
+
81
+ ### Exit & Resume
82
+
83
+ ```
84
+ /chati exit # Save session and exit
85
+ /chati # Resume exactly where you left off
86
+ ```
87
+
88
+ ---
89
+
90
+ ## Architecture
91
+
92
+ ### 13 Agents, 4 Categories
93
+
94
+ | Category | Agents | Purpose |
95
+ |----------|--------|---------|
96
+ | **CLARITY** | Greenfield WU, Brownfield WU, Brief, Detail (PRD), Architect, UX, Phases, Tasks | Planning & Requirements |
97
+ | **Quality** | QA-Planning, QA-Implementation | Validation & Gates |
98
+ | **BUILD** | Dev | Implementation |
99
+ | **DEPLOY** | DevOps | Shipping |
100
+
101
+ ### Pipeline Flow
102
+
103
+ ```
104
+ User Request
105
+
106
+
107
+ ┌─────────────────────────────────────────────────┐
108
+ │ ORCHESTRATOR (/chati) │
109
+ │ Routes to correct agent, manages session │
110
+ │ Session Lock: user stays in system │
111
+ └─────────────────────────────────────────────────┘
112
+
113
+
114
+ ┌─────────────────── CLARITY ─────────────────────┐
115
+ │ │
116
+ │ WU → Brief → Detail(PRD) → Architect → UX │
117
+ │ → Phases → Tasks │
118
+ │ │
119
+ └──────────────────────────────────────────────────┘
120
+
121
+
122
+ ┌─────────────────── QUALITY ─────────────────────┐
123
+ │ QA-Planning (traceability validation, ≥95%) │
124
+ └──────────────────────────────────────────────────┘
125
+
126
+
127
+ ┌─────────────────── BUILD ───────────────────────┐
128
+ │ Dev (implementation + self-validation) │
129
+ └──────────────────────────────────────────────────┘
130
+
131
+
132
+ ┌─────────────────── QUALITY ─────────────────────┐
133
+ │ QA-Implementation (tests + SAST + code review) │
134
+ └──────────────────────────────────────────────────┘
135
+
136
+
137
+ ┌─────────────────── DEPLOY ──────────────────────┐
138
+ │ DevOps (git + deploy + docs) │
139
+ └──────────────────────────────────────────────────┘
140
+ ```
141
+
142
+ ### Intelligence Layer (V7.1)
143
+
144
+ The Intelligence Layer operates transparently behind the pipeline:
145
+
146
+ | System | What it does |
147
+ |--------|-------------|
148
+ | **Context Engine** | Detects context depletion across 4 brackets. Reduces injection layers as context fills. Autonomous recovery via Smart Continuation or Session Spawn. |
149
+ | **Memory Layer** | Captures decisions, patterns, and lessons learned. Persists across sessions. 4 cognitive sectors (Episodic, Semantic, Procedural, Reflective). Attention scoring with natural decay. |
150
+ | **Framework Registry** | Catalogs all 48 system artifacts. Decision engine for brownfield analysis: REUSE existing artifacts, ADAPT with modifications, or CREATE new. |
151
+ | **Session Lock** | Locks the session on `/chati` activation. All messages routed through orchestrator. Exit only via `/chati exit`. Prevents accidental context leakage. |
152
+
153
+ ### Universal Protocols
154
+
155
+ Every agent follows 8 universal protocols:
156
+
157
+ | Protocol | Purpose |
158
+ |----------|---------|
159
+ | 5.1 Dynamic Self-Validation | Binary pass/fail criteria per agent |
160
+ | 5.2 Loop Until Done | Iterate until quality threshold met |
161
+ | 5.3 Guided Options | Always present 1, 2, 3 choices |
162
+ | 5.4 Persistence | Session state survives restarts |
163
+ | 5.5 Two-Layer Handoff | Structured context transfer between agents |
164
+ | 5.6 Language Protocol | Interaction in user lang, artifacts in English |
165
+ | 5.7 Deviation Protocol | Handle scope changes mid-pipeline |
166
+ | 5.8 Interaction Model | Agent-driven with power user escape hatch |
167
+
168
+ ### Constitution
169
+
170
+ The system is governed by a **16-article Constitution** that enforces agent behavior, quality standards, security, and system integrity. Key articles:
171
+
172
+ | Article | Governance |
173
+ |---------|-----------|
174
+ | I-IV | Agent governance, quality standards, memory & context, security |
175
+ | V-VII | Communication protocol, design system, English-only documentation |
176
+ | VIII-X | Two-layer handoff, agent-driven interaction, dynamic self-validation |
177
+ | XI | Mode governance (clarity/build/deploy) with autonomous transitions |
178
+ | XII-XIV | Context bracket governance, memory governance, framework registry |
179
+ | XV | Session lock governance — mandatory lock, explicit exit only |
180
+ | XVI | Model governance — opus/sonnet/haiku per agent, no downgrade rule |
181
+
182
+ ---
183
+
184
+ ## Supported IDEs
185
+
186
+ | IDE | Router Pattern |
187
+ |-----|---------------|
188
+ | **Claude Code** | `.claude/commands/chati.md` → orchestrator |
189
+ | **VS Code** | `.vscode/chati.md` → orchestrator |
190
+ | **AntiGravity** | Platform agent config → orchestrator |
191
+ | **Cursor** | `.cursor/rules/chati.md` → orchestrator |
192
+ | **Gemini CLI** | `.gemini/agents/chati.md` → orchestrator |
193
+ | **GitHub Copilot** | `.github/copilot/chati.md` → orchestrator |
194
+
195
+ ---
196
+
197
+ ## CLI Commands
198
+
199
+ | Command | Description |
200
+ |---------|-------------|
201
+ | `npx chati-dev init` | Initialize new project with wizard |
202
+ | `npx chati-dev install` | Install into existing project |
203
+ | `npx chati-dev status` | Show project dashboard |
204
+ | `npx chati-dev status --watch` | Auto-refresh dashboard every 5s |
205
+ | `npx chati-dev check-update` | Check for system updates |
206
+ | `npx chati-dev upgrade` | Upgrade to latest version |
207
+ | `npx chati-dev upgrade --version X.Y.Z` | Upgrade to specific version |
208
+ | `npx chati-dev memory stats` | Show memory statistics (total, by agent/sector/tier) |
209
+ | `npx chati-dev memory list` | List memories (--agent, --sector, --tier filters) |
210
+ | `npx chati-dev memory search <query>` | Search memories by tags or content |
211
+ | `npx chati-dev memory clean` | Clean expired/session memories (--dry-run) |
212
+ | `npx chati-dev context` | Show context bracket advisory |
213
+ | `npx chati-dev registry stats` | Show entity registry statistics |
214
+ | `npx chati-dev registry check` | Validate entity registry against filesystem |
215
+ | `npx chati-dev health` | Comprehensive system health check (5 checks) |
216
+ | `npx chati-dev changelog` | View changelog |
217
+ | `npx chati-dev --reconfigure` | Reconfigure installation |
218
+
219
+ ### Orchestrator Commands (inside active session)
220
+
221
+ | Command | Description |
222
+ |---------|-------------|
223
+ | `/chati` | Start or resume session |
224
+ | `/chati status` | Show pipeline status |
225
+ | `/chati help` | Show available commands |
226
+ | `/chati resume` | Resume from continuation file |
227
+ | `/chati exit` | Save session and exit |
228
+
229
+ ---
230
+
231
+ ## Project Structure
232
+
233
+ ```
234
+ your-project/
235
+ ├── .chati/
236
+ │ ├── session.yaml # Session state (auto-managed)
237
+ │ ├── memories/ # Memory Layer storage (gitignored)
238
+ │ └── continuation/ # Context recovery files
239
+ ├── .claude/
240
+ │ └── commands/
241
+ │ └── chati.md # Thin router → orchestrator
242
+ ├── CLAUDE.md # IDE entry point (auto-updated)
243
+ ├── chati.dev/
244
+ │ ├── orchestrator/ # Main orchestrator
245
+ │ ├── agents/ # 13 agent definitions
246
+ │ │ ├── clarity/ # 8 planning agents
247
+ │ │ ├── quality/ # 2 quality gate agents
248
+ │ │ ├── build/ # Dev agent
249
+ │ │ └── deploy/ # DevOps agent
250
+ │ ├── workflows/ # 5 workflow blueprints
251
+ │ ├── templates/ # 5 artifact templates
252
+ │ ├── schemas/ # JSON schemas for validation
253
+ │ ├── intelligence/ # Context Engine, Memory Layer, Decision Engine
254
+ │ ├── frameworks/ # Decision heuristics, quality dims
255
+ │ ├── quality-gates/ # Planning & implementation gates
256
+ │ ├── patterns/ # Elicitation patterns
257
+ │ ├── data/ # Entity registry
258
+ │ ├── i18n/ # EN, PT, ES, FR translations
259
+ │ ├── migrations/ # Version migration scripts
260
+ │ ├── constitution.md # 16 Articles + Preamble
261
+ │ └── config.yaml # System configuration
262
+ ├── chati.dev/artifacts/ # Generated during pipeline
263
+ │ ├── 0-WU/
264
+ │ ├── 1-Brief/
265
+ │ ├── 2-PRD/
266
+ │ ├── 3-Architecture/
267
+ │ ├── 4-UX/
268
+ │ ├── 5-Phases/
269
+ │ ├── 6-Tasks/
270
+ │ ├── 7-QA-Planning/
271
+ │ ├── 8-Validation/
272
+ │ └── handoffs/
273
+ └── packages/
274
+ └── chati-dev/ # CLI installer (npx chati-dev)
275
+ ```
276
+
277
+ ---
278
+
279
+ ## Internationalization
280
+
281
+ The installer and agent interactions support 4 languages:
282
+
283
+ | Language | Code | Status |
284
+ |----------|------|--------|
285
+ | **English** | `en` | Default |
286
+ | **Portugues** | `pt` | Full support |
287
+ | **Espanol** | `es` | Full support |
288
+ | **Francais** | `fr` | Full support |
289
+
290
+ Artifacts are always generated in English for portability and team collaboration.
291
+
292
+ ---
293
+
294
+ ## Upgrade System
295
+
296
+ ```bash
297
+ npx chati-dev check-update # Check for updates
298
+ npx chati-dev upgrade # Upgrade to latest
299
+ npx chati-dev upgrade --version 1.2.1 # Specific version
300
+ ```
301
+
302
+ Upgrades include automatic backup, migrations, validation, and config merging. Rollback on failure.
303
+
304
+ ---
305
+
306
+ ## Prerequisites
307
+
308
+ - **Node.js** >= 18.0.0
309
+ - **npm** >= 9.0.0
310
+ - A supported IDE with AI assistant capabilities
311
+
312
+ ---
313
+
314
+ ## Contributing
315
+
316
+ We welcome contributions from agents, templates, workflows, intelligence data, translations, and CLI improvements. Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
317
+
318
+ ## Security
319
+
320
+ For security concerns, please see our [Security Policy](SECURITY.md).
321
+
322
+ ## License
323
+
324
+ This project is licensed under the MIT License — see [LICENSE](LICENSE) for details.
325
+
326
+ ---
327
+
328
+ <p align="center">
329
+ <sub>Built with structure, validated by agents, governed by constitution.</sub><br>
330
+ <sub>chati.dev &copy; 2026</sub>
331
+ </p>
@@ -13,6 +13,7 @@ You are the **Architect Agent**, responsible for defining HOW the system will be
13
13
  - **Duration**: 45-90 min
14
14
  - **Ratio**: 50% Human / 50% AI
15
15
  - **Absorbs**: Data Engineer (data modeling, DB audit, schema design, RLS policies)
16
+ - **Model**: opus | no downgrade (architecture decisions require deep reasoning)
16
17
 
17
18
  ## Required MCPs
18
19
  - context7 (library documentation search)
@@ -12,6 +12,7 @@ You are the **Brief Agent**, responsible for extracting and structuring the core
12
12
  - **Question Answered**: WHAT is the problem?
13
13
  - **Duration**: 30-60 min
14
14
  - **Ratio**: 90% Human / 10% AI
15
+ - **Model**: sonnet | upgrade: opus if enterprise or 10+ integrations
15
16
 
16
17
  ## Required MCPs
17
18
  - None
@@ -12,6 +12,7 @@ You are the **Brownfield WU Agent**, responsible for comprehensive discovery of
12
12
  - **Question Answered**: HOW does it work today? (both code and operations)
13
13
  - **Duration**: 1-4h depending on codebase size
14
14
  - **Ratio**: 40% Human / 60% AI
15
+ - **Model**: opus | no downgrade (codebase analysis requires deep reasoning)
15
16
 
16
17
  ## Required MCPs
17
18
  - git (read-only)
@@ -13,6 +13,7 @@ You are the **Detail Agent**, responsible for transforming the Brief into a form
13
13
  - **Duration**: 45-90 min
14
14
  - **Ratio**: 70% Human / 30% AI
15
15
  - **Absorbs**: PM (PRD creation, product strategy), Analyst (market research, competitive analysis)
16
+ - **Model**: opus | no downgrade (PRD traceability requires deep reasoning)
16
17
 
17
18
  ## Required MCPs
18
19
  - None
@@ -12,6 +12,7 @@ You are the **Greenfield WU Agent**, responsible for understanding HOW the user
12
12
  - **Question Answered**: HOW does it work today?
13
13
  - **Duration**: 15-30 min
14
14
  - **Ratio**: 70% Human / 30% AI
15
+ - **Model**: haiku | upgrade: sonnet if multi-stack or enterprise
15
16
 
16
17
  ## Required MCPs
17
18
  - None
@@ -13,6 +13,7 @@ You are the **Phases Agent**, responsible for breaking the PRD into development
13
13
  - **Duration**: 20-40 min
14
14
  - **Ratio**: 60% Human / 40% AI
15
15
  - **Absorbs**: SM (sprint planning, prioritization, wave sequencing)
16
+ - **Model**: sonnet | upgrade: opus if 20+ requirements or complex dependencies
16
17
 
17
18
  ## Required MCPs
18
19
  - None
@@ -13,6 +13,7 @@ You are the **Tasks Agent**, responsible for breaking phases into atomic, execut
13
13
  - **Duration**: 30-60 min
14
14
  - **Ratio**: 50% Human / 50% AI
15
15
  - **Absorbs**: SM (structured task creation, Given-When-Then criteria)
16
+ - **Model**: sonnet | upgrade: opus if 50+ tasks or complex acceptance criteria
16
17
 
17
18
  ## Required MCPs
18
19
  - None
@@ -13,6 +13,7 @@ You are the **UX Agent**, responsible for defining HOW the product will look and
13
13
  - **Duration**: 30-60 min
14
14
  - **Ratio**: 60% Human / 40% AI
15
15
  - **Absorbs**: Design System init + audit (embedded workflow)
16
+ - **Model**: sonnet | upgrade: opus if design system creation from scratch
16
17
 
17
18
  ## Required MCPs
18
19
  - None
@@ -12,6 +12,7 @@ You are the **DevOps Agent**, responsible for shipping the project: Git operatio
12
12
  - **Question Answered**: SHIP it
13
13
  - **Duration**: 15-30 min
14
14
  - **Ratio**: 30% Human / 70% AI
15
+ - **Model**: sonnet | upgrade: opus if multi-environment or infrastructure-as-code
15
16
  - **Absorbs**: Docs-gen (auto documentation generation)
16
17
 
17
18
  ## Required MCPs
@@ -12,6 +12,7 @@ You are the **QA-Implementation Agent**, the quality gate between BUILD and DEPL
12
12
  - **Question Answered**: DOES it work correctly?
13
13
  - **Duration**: 15-45 min (mostly automated)
14
14
  - **Ratio**: 90% AI / 10% Human
15
+ - **Model**: opus | no downgrade (code review and SAST require deep reasoning)
15
16
  - **Absorbs**: Tests + SAST + CodeRabbit code review
16
17
 
17
18
  ## Required MCPs
@@ -12,6 +12,7 @@ You are the **QA-Planning Agent**, the quality gate between CLARITY (planning) a
12
12
  - **Question Answered**: IS everything traceable and rigorous?
13
13
  - **Duration**: 15-30 min (automated validation)
14
14
  - **Ratio**: 95% AI / 5% Human
15
+ - **Model**: opus | no downgrade (cross-artifact validation requires deep reasoning)
15
16
  - **Absorbs**: Manager (cross-artifact validation), PO (quality gate validation, coherence checks)
16
17
 
17
18
  ## Required MCPs
@@ -345,5 +345,32 @@ Once the orchestrator is activated via `/chati`, a session lock engages. All age
345
345
 
346
346
  ---
347
347
 
348
- *chati.dev Constitution v1.3.2 15 Articles + Preamble*
348
+ ## Article XVI: Model Governance
349
+
350
+ The orchestrator SHALL select the optimal AI model for each agent to balance quality and cost efficiency.
351
+
352
+ 1. Every agent definition MUST include a `Model` field in its Identity section specifying default model and upgrade conditions.
353
+
354
+ 2. Three model tiers are recognized:
355
+ - **opus**: Deep reasoning, complex analysis, code generation. Use for agents that make critical decisions or produce complex artifacts.
356
+ - **sonnet**: Structured tasks, guided workflows, template-based output. Use for agents with clear inputs and predictable output formats.
357
+ - **haiku**: Simple detection, classification, status checks. Use for agents with minimal reasoning requirements.
358
+
359
+ 3. The orchestrator SHALL read the agent's `Model` field before activation and communicate the recommended model to the user.
360
+
361
+ 4. Agents marked `no downgrade` MUST NOT run on a model below their default. Quality degradation in these agents compromises downstream artifacts.
362
+
363
+ 5. Upgrade conditions (e.g., "upgrade: opus if enterprise") are evaluated by the orchestrator based on session context: project type, codebase size, number of integrations, and complexity signals from previous agents.
364
+
365
+ 6. In IDE environments (Claude Code, Cursor, VS Code), the orchestrator SHALL display a model recommendation message before activating each agent. The user decides whether to switch.
366
+
367
+ 7. In programmatic environments (Agent SDK, API), the model selection SHALL be automatic — no user intervention required.
368
+
369
+ 8. Model selections are logged in session.yaml under `model_selections[]` for cost tracking and optimization.
370
+
371
+ **Enforcement: GUIDE** — Model recommendations are advisory in IDE mode; automatic in SDK mode.
372
+
373
+ ---
374
+
375
+ *chati.dev Constitution v1.4.0 — 16 Articles + Preamble*
349
376
  *All agents are bound by this Constitution. Violations are enforced per article.*
@@ -241,7 +241,7 @@ entities:
241
241
  constitution:
242
242
  path: chati.dev/constitution.md
243
243
  type: governance
244
- purpose: "15 Articles + Preamble governing all agent behavior"
244
+ purpose: "16 Articles + Preamble governing all agent behavior"
245
245
  keywords: [constitution, governance, rules, articles, enforcement]
246
246
  dependencies: []
247
247
  adaptability: 0.1
@@ -21,7 +21,7 @@ installer:
21
21
  agents_count: "13 agent definitions (CLARITY, BUILD, DEPLOY phases)"
22
22
  workflows_count: "5 workflow blueprints"
23
23
  templates_count: "5 templates (PRD, Brownfield PRD, Architecture, Task, QA Gate)"
24
- constitution: "Constitution (15 Articles + Preamble)"
24
+ constitution: "Constitution (16 Articles + Preamble)"
25
25
  session_mgmt: "Session management system"
26
26
  quality_gates: "Quality gates (4-tier validation)"
27
27
  proceed: "Proceed with installation?"
@@ -29,7 +29,7 @@ installer:
29
29
  created_chati: "Created .chati/ session directory"
30
30
  created_framework: "Created chati.dev/ system directory (agents, templates, workflows)"
31
31
  created_commands: "Created .claude/commands/ (thin router)"
32
- installed_constitution: "Installed Constitution (Articles I-XV)"
32
+ installed_constitution: "Installed Constitution (Articles I-XVI)"
33
33
  created_session: "Created session.yaml schema"
34
34
  created_claude_md: "Created CLAUDE.md"
35
35
  configured_mcps: "Configured MCPs:"
@@ -37,7 +37,7 @@ installer:
37
37
  agents_valid: "All 13 agents implement 8 protocols"
38
38
  handoff_ok: "Handoff protocol: OK"
39
39
  validation_ok: "Self-validation criteria: OK"
40
- constitution_ok: "Constitution: 15 articles verified"
40
+ constitution_ok: "Constitution: 16 articles verified"
41
41
  created_memories: "Created .chati/memories/ (Memory Layer)"
42
42
  installed_intelligence: "Installed Intelligence Layer (Context Engine, Memory, Registry)"
43
43
  intelligence_valid: "Intelligence: 6 spec files verified"
@@ -21,7 +21,7 @@ installer:
21
21
  agents_count: "13 definiciones de agentes (fases CLARITY, BUILD, DEPLOY)"
22
22
  workflows_count: "5 blueprints de workflow"
23
23
  templates_count: "5 templates (PRD, PRD Brownfield, Arquitectura, Task, QA Gate)"
24
- constitution: "Constitucion (15 Articulos + Preambulo)"
24
+ constitution: "Constitucion (16 Articulos + Preambulo)"
25
25
  session_mgmt: "Sistema de gestion de sesion"
26
26
  quality_gates: "Quality gates (validacion en 4 capas)"
27
27
  proceed: "Proceder con la instalacion?"
@@ -29,7 +29,7 @@ installer:
29
29
  created_chati: "Creado directorio de sesion .chati/"
30
30
  created_framework: "Creado directorio del sistema chati.dev/ (agentes, templates, workflows)"
31
31
  created_commands: "Creado .claude/commands/ (enrutador)"
32
- installed_constitution: "Instalada Constitucion (Articulos I-XV)"
32
+ installed_constitution: "Instalada Constitucion (Articulos I-XVI)"
33
33
  created_session: "Creado schema session.yaml"
34
34
  created_claude_md: "Creado CLAUDE.md"
35
35
  configured_mcps: "MCPs configurados:"
@@ -37,7 +37,7 @@ installer:
37
37
  agents_valid: "Los 13 agentes implementan 8 protocolos"
38
38
  handoff_ok: "Protocolo de handoff: OK"
39
39
  validation_ok: "Criterios de auto-validacion: OK"
40
- constitution_ok: "Constitucion: 15 articulos verificados"
40
+ constitution_ok: "Constitucion: 16 articulos verificados"
41
41
  created_memories: "Creado .chati/memories/ (Memory Layer)"
42
42
  installed_intelligence: "Instalada Intelligence Layer (Context Engine, Memory, Registry)"
43
43
  intelligence_valid: "Intelligence: 6 archivos de spec verificados"
@@ -21,7 +21,7 @@ installer:
21
21
  agents_count: "13 definitions d'agents (phases CLARITY, BUILD, DEPLOY)"
22
22
  workflows_count: "5 blueprints de workflow"
23
23
  templates_count: "5 templates (PRD, PRD Brownfield, Architecture, Task, QA Gate)"
24
- constitution: "Constitution (15 Articles + Preambule)"
24
+ constitution: "Constitution (16 Articles + Preambule)"
25
25
  session_mgmt: "Systeme de gestion de session"
26
26
  quality_gates: "Quality gates (validation en 4 couches)"
27
27
  proceed: "Proceder a l'installation?"
@@ -29,7 +29,7 @@ installer:
29
29
  created_chati: "Cree le repertoire de session .chati/"
30
30
  created_framework: "Cree le repertoire du systeme chati.dev/ (agents, templates, workflows)"
31
31
  created_commands: "Cree .claude/commands/ (routeur)"
32
- installed_constitution: "Installee la Constitution (Articles I-XV)"
32
+ installed_constitution: "Installee la Constitution (Articles I-XVI)"
33
33
  created_session: "Cree le schema session.yaml"
34
34
  created_claude_md: "Cree CLAUDE.md"
35
35
  configured_mcps: "MCPs configures:"
@@ -37,7 +37,7 @@ installer:
37
37
  agents_valid: "Les 13 agents implementent 8 protocoles"
38
38
  handoff_ok: "Protocole de passation: OK"
39
39
  validation_ok: "Criteres d'auto-validation: OK"
40
- constitution_ok: "Constitution: 15 articles verifies"
40
+ constitution_ok: "Constitution: 16 articles verifies"
41
41
  created_memories: "Cree .chati/memories/ (Memory Layer)"
42
42
  installed_intelligence: "Installee Intelligence Layer (Context Engine, Memory, Registry)"
43
43
  intelligence_valid: "Intelligence: 6 fichiers de spec verifies"
@@ -21,7 +21,7 @@ installer:
21
21
  agents_count: "13 definicoes de agentes (fases CLARITY, BUILD, DEPLOY)"
22
22
  workflows_count: "5 blueprints de workflow"
23
23
  templates_count: "5 templates (PRD, PRD Brownfield, Arquitetura, Task, QA Gate)"
24
- constitution: "Constituicao (15 Artigos + Preambulo)"
24
+ constitution: "Constituicao (16 Artigos + Preambulo)"
25
25
  session_mgmt: "Sistema de gerenciamento de sessao"
26
26
  quality_gates: "Quality gates (validacao em 4 camadas)"
27
27
  proceed: "Prosseguir com a instalacao?"
@@ -29,7 +29,7 @@ installer:
29
29
  created_chati: "Criado diretorio de sessao .chati/"
30
30
  created_framework: "Criado diretorio do sistema chati.dev/ (agentes, templates, workflows)"
31
31
  created_commands: "Criado .claude/commands/ (roteador)"
32
- installed_constitution: "Instalada Constituicao (Artigos I-XV)"
32
+ installed_constitution: "Instalada Constituicao (Artigos I-XVI)"
33
33
  created_session: "Criado schema session.yaml"
34
34
  created_claude_md: "Criado CLAUDE.md"
35
35
  configured_mcps: "MCPs configurados:"
@@ -37,7 +37,7 @@ installer:
37
37
  agents_valid: "Todos os 13 agentes implementam 8 protocolos"
38
38
  handoff_ok: "Protocolo de handoff: OK"
39
39
  validation_ok: "Criterios de auto-validacao: OK"
40
- constitution_ok: "Constituicao: 15 artigos verificados"
40
+ constitution_ok: "Constituicao: 16 artigos verificados"
41
41
  created_memories: "Criado .chati/memories/ (Memory Layer)"
42
42
  installed_intelligence: "Instalada Intelligence Layer (Context Engine, Memory, Registry)"
43
43
  intelligence_valid: "Intelligence: 6 arquivos de spec verificados"
@@ -25,7 +25,7 @@ The orchestrator injects context through 5 hierarchical layers:
25
25
 
26
26
  | Layer | Name | Source | When Active |
27
27
  |-------|------|--------|-------------|
28
- | **L0** | Constitution | `chati.dev/constitution.md` (Articles I-XV) | ALWAYS (non-negotiable) |
28
+ | **L0** | Constitution | `chati.dev/constitution.md` (Articles I-XVI) | ALWAYS (non-negotiable) |
29
29
  | **L1** | Mode + Global | `config.yaml` + mode governance (clarity/build/deploy) | ALWAYS |
30
30
  | **L2** | Agent Scope | `chati.dev/agents/{agent}/` — mission, inputs, outputs, criteria | When agent is active |
31
31
  | **L3** | Pipeline State | `.chati/session.yaml` — pipeline position, scores, backlog | When session is active |
@@ -49,7 +49,7 @@ The orchestrator produces a structured XML block injected into agent prompts:
49
49
  ```xml
50
50
  <chati-context bracket="MODERATE">
51
51
  <constitution>
52
- Articles I-XV governing agent behavior.
52
+ Articles I-XVI governing agent behavior.
53
53
  Key: Self-validation required. Loop until quality threshold.
54
54
  Guided options (1,2,3). Persistent session state.
55
55
  Two-layer handoff. Language protocol. Deviation protocol.
@@ -96,7 +96,7 @@ npx chati-dev health
96
96
  Checks:
97
97
  1. All registered entities exist on disk
98
98
  2. Schema files are valid JSON
99
- 3. Constitution has >= 15 articles
99
+ 3. Constitution has >= 16 articles
100
100
  4. Agents contain required protocol references
101
101
  5. Entity count matches actual file count
102
102
  6. Checksums match (if calculated)
@@ -10,6 +10,7 @@ You are the **chati.dev Orchestrator**, the single entry point for the chati.dev
10
10
  - **Role**: Orchestrator & Router
11
11
  - **Position**: Entry point (always first contact)
12
12
  - **Scope**: System-wide routing, session management, deviation handling, backlog
13
+ - **Model**: sonnet | upgrade: opus if complex routing or deviation handling
13
14
 
14
15
  ---
15
16
 
@@ -169,7 +170,71 @@ When an agent completes (score >= 95%):
169
170
  - Dev + QA-Implementation = build
170
171
  - Final validation = validate
171
172
  - DevOps = deploy
172
- 7. Read next agent's command file -> Activate
173
+ 7. Read next agent's command file -> Extract Model field from Identity section
174
+ 8. Evaluate upgrade conditions against session context
175
+ 9. Display model recommendation (see Model Selection Protocol below)
176
+ 10. Activate agent
177
+ ```
178
+
179
+ ---
180
+
181
+ ## Model Selection Protocol
182
+
183
+ Before activating any agent, the orchestrator reads the agent's `Model` field and recommends the optimal model.
184
+
185
+ ### Model Map (Quick Reference)
186
+
187
+ | Agent | Default | Upgrade Condition |
188
+ |-------|---------|-------------------|
189
+ | greenfield-wu | haiku | sonnet if multi-stack or enterprise |
190
+ | brownfield-wu | opus | no downgrade |
191
+ | brief | sonnet | opus if enterprise or 10+ integrations |
192
+ | detail | opus | no downgrade |
193
+ | architect | opus | no downgrade |
194
+ | ux | sonnet | opus if design system from scratch |
195
+ | phases | sonnet | opus if 20+ requirements |
196
+ | tasks | sonnet | opus if 50+ tasks |
197
+ | qa-planning | opus | no downgrade |
198
+ | dev | opus | no downgrade |
199
+ | qa-implementation | opus | no downgrade |
200
+ | devops | sonnet | opus if multi-environment or IaC |
201
+
202
+ ### Evaluation Logic
203
+
204
+ ```
205
+ 1. Read agent's Model field from its .md file
206
+ 2. Extract default model and upgrade condition
207
+ 3. If upgrade condition exists:
208
+ a. Check session context (project.type, codebase_size, integrations_count, requirements_count)
209
+ b. Check previous agent signals (handoff complexity, discovered tech debt)
210
+ c. If condition matches -> recommend upgraded model
211
+ d. If condition does not match -> use default model
212
+ 4. If "no downgrade" -> always use the specified model
213
+ ```
214
+
215
+ ### Recommendation Message (IDE Mode)
216
+
217
+ When the recommended model differs from the current model, display:
218
+
219
+ ```
220
+ 💡 Model recommendation for {agent_name}: {recommended_model}
221
+ Reason: {justification}
222
+ Current: {current_model}
223
+
224
+ To switch: /model {recommended_model}
225
+ Or continue with current model.
226
+ ```
227
+
228
+ ### Session Logging
229
+
230
+ ```yaml
231
+ # Appended to session.yaml on each agent activation
232
+ model_selections:
233
+ - agent: brief
234
+ recommended: sonnet
235
+ actual: opus # What the user actually used
236
+ reason: "default"
237
+ timestamp: "2026-..."
173
238
  ```
174
239
 
175
240
  ---
@@ -99,6 +99,21 @@
99
99
  }
100
100
  }
101
101
  },
102
+ "model_selections": {
103
+ "type": "array",
104
+ "description": "Model selection log for cost tracking (Article XVI)",
105
+ "items": {
106
+ "type": "object",
107
+ "required": ["agent", "recommended", "timestamp"],
108
+ "properties": {
109
+ "agent": { "type": "string", "description": "Agent name" },
110
+ "recommended": { "enum": ["opus", "sonnet", "haiku"], "description": "Recommended model" },
111
+ "actual": { "enum": ["opus", "sonnet", "haiku"], "description": "Model actually used" },
112
+ "reason": { "type": "string", "description": "Why this model was selected (default, upgrade condition, no downgrade)" },
113
+ "timestamp": { "type": "string", "format": "date-time" }
114
+ }
115
+ }
116
+ },
102
117
  "mode_transitions": {
103
118
  "type": "array",
104
119
  "description": "Audit trail of all mode transitions",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chati-dev",
3
- "version": "1.3.2",
3
+ "version": "1.4.0",
4
4
  "description": "AI-Powered Multi-Agent Orchestration System — 13 agents, 6 IDEs, 4 languages",
5
5
  "type": "module",
6
6
  "bin": {
@@ -8,6 +8,12 @@
8
8
  "chati-dev": "bin/chati.js"
9
9
  },
10
10
  "main": "src/wizard/index.js",
11
+ "exports": {
12
+ ".": "./src/wizard/index.js",
13
+ "./installer": "./src/installer/core.js",
14
+ "./dashboard": "./src/dashboard/renderer.js",
15
+ "./upgrade": "./src/upgrade/checker.js"
16
+ },
11
17
  "files": [
12
18
  "bin/",
13
19
  "src/",
@@ -48,10 +54,7 @@
48
54
  },
49
55
  "dependencies": {
50
56
  "@clack/prompts": "^0.7.0",
51
- "blessed": "^0.1.81",
52
57
  "chalk": "^5.3.0",
53
- "cli-progress": "^3.12.0",
54
- "fs-extra": "^11.2.0",
55
58
  "js-yaml": "^4.1.0",
56
59
  "ora": "^8.0.1",
57
60
  "semver": "^7.6.0"
@@ -55,4 +55,13 @@ for (const file of rootFiles) {
55
55
  }
56
56
 
57
57
  console.log('Framework bundled to:', DEST);
58
+
59
+ // Copy README from monorepo root so npm displays it
60
+ const readmeSrc = join(MONOREPO_ROOT, 'README.md');
61
+ const readmeDest = join(PACKAGE_ROOT, 'README.md');
62
+ if (existsSync(readmeSrc)) {
63
+ cpSync(readmeSrc, readmeDest);
64
+ console.log('README.md copied to package.');
65
+ }
66
+
58
67
  console.log('Done.');
@@ -59,7 +59,7 @@ export async function validateInstallation(targetDir) {
59
59
  if (existsSync(constitutionPath)) {
60
60
  const content = readFileSync(constitutionPath, 'utf-8');
61
61
  const articleCount = (content.match(/^## Article/gm) || []).length;
62
- results.constitution.pass = articleCount >= 15;
62
+ results.constitution.pass = articleCount >= 16;
63
63
  results.constitution.details.push({ articleCount });
64
64
  }
65
65
  results.total += 1;
@@ -131,8 +131,8 @@ export function runHealthCheck(targetDir) {
131
131
  if (existsSync(constitutionPath)) {
132
132
  const content = readFileSync(constitutionPath, 'utf-8');
133
133
  const articleCount = (content.match(/^## Article/gm) || []).length;
134
- checks.constitution.pass = articleCount >= 15;
135
- checks.constitution.details = `${articleCount}/15 articles`;
134
+ checks.constitution.pass = articleCount >= 16;
135
+ checks.constitution.details = `${articleCount}/16 articles`;
136
136
  } else {
137
137
  checks.constitution.details = 'Not found';
138
138
  }
@@ -26,7 +26,7 @@ const FALLBACK_EN = {
26
26
  agents_count: '13 agent definitions (CLARITY, BUILD, DEPLOY phases)',
27
27
  workflows_count: '5 workflow blueprints',
28
28
  templates_count: '5 templates (PRD, Brownfield PRD, Architecture, Task, QA Gate)',
29
- constitution: 'Constitution (15 Articles + Preamble)',
29
+ constitution: 'Constitution (16 Articles + Preamble)',
30
30
  session_mgmt: 'Session management system',
31
31
  quality_gates: 'Quality gates (4-tier validation)',
32
32
  proceed: 'Proceed with installation?',
@@ -34,7 +34,7 @@ const FALLBACK_EN = {
34
34
  created_chati: 'Created .chati/ session directory',
35
35
  created_framework: 'Created chati.dev/ system directory (agents, templates, workflows)',
36
36
  created_commands: 'Created .claude/commands/ (thin router)',
37
- installed_constitution: 'Installed Constitution (Articles I-XV)',
37
+ installed_constitution: 'Installed Constitution (Articles I-XVI)',
38
38
  created_session: 'Created session.yaml schema',
39
39
  created_claude_md: 'Created CLAUDE.md',
40
40
  configured_mcps: 'Configured MCPs:',
@@ -42,7 +42,7 @@ const FALLBACK_EN = {
42
42
  agents_valid: 'All 13 agents implement 8 protocols',
43
43
  handoff_ok: 'Handoff protocol: OK',
44
44
  validation_ok: 'Self-validation criteria: OK',
45
- constitution_ok: 'Constitution: 15 articles verified',
45
+ constitution_ok: 'Constitution: 16 articles verified',
46
46
  created_memories: 'Created .chati/memories/ (Memory Layer)',
47
47
  installed_intelligence: 'Installed Intelligence Layer (Context Engine, Memory, Registry)',
48
48
  intelligence_valid: 'Intelligence: 6 spec files verified',