chati-dev 2.0.4 → 2.0.6

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 (124) hide show
  1. package/README.md +48 -36
  2. package/framework/agents/{clarity → planning}/architect.md +1 -1
  3. package/framework/agents/{clarity → planning}/brief.md +1 -1
  4. package/framework/agents/{clarity → planning}/brownfield-wu.md +1 -1
  5. package/framework/agents/{clarity → planning}/detail.md +1 -1
  6. package/framework/agents/{clarity → planning}/greenfield-wu.md +1 -1
  7. package/framework/agents/{clarity → planning}/phases.md +1 -1
  8. package/framework/agents/{clarity → planning}/tasks.md +1 -1
  9. package/framework/agents/{clarity → planning}/ux.md +1 -1
  10. package/framework/agents/quality/qa-planning.md +5 -5
  11. package/framework/constitution.md +6 -6
  12. package/framework/context/governance.md +3 -3
  13. package/framework/context/quality.md +1 -1
  14. package/framework/context/root.md +1 -1
  15. package/framework/data/entity-registry.yaml +9 -9
  16. package/framework/domains/agents/qa-implementation.yaml +1 -1
  17. package/framework/domains/constitution.yaml +2 -2
  18. package/framework/domains/global.yaml +1 -1
  19. package/framework/hooks/mode-governance.js +5 -5
  20. package/framework/hooks/model-governance.js +38 -18
  21. package/framework/hooks/prism-engine.js +1 -1
  22. package/framework/hooks/session-digest.js +1 -1
  23. package/framework/i18n/en.yaml +1 -3
  24. package/framework/i18n/es.yaml +1 -3
  25. package/framework/i18n/fr.yaml +1 -3
  26. package/framework/i18n/pt.yaml +1 -3
  27. package/framework/intelligence/context-engine.md +3 -3
  28. package/framework/orchestrator/chati.md +148 -78
  29. package/framework/quality-gates/planning-gate.md +1 -1
  30. package/framework/schemas/context.schema.json +1 -1
  31. package/framework/schemas/session.schema.json +3 -3
  32. package/framework/tasks/architect-api-design.md +1 -1
  33. package/framework/tasks/architect-consolidate.md +1 -1
  34. package/framework/tasks/architect-db-design.md +1 -1
  35. package/framework/tasks/architect-design.md +1 -1
  36. package/framework/tasks/architect-security-review.md +1 -1
  37. package/framework/tasks/architect-stack-selection.md +1 -1
  38. package/framework/tasks/brief-consolidate.md +1 -1
  39. package/framework/tasks/brief-constraint-identify.md +1 -1
  40. package/framework/tasks/brief-extract-requirements.md +1 -1
  41. package/framework/tasks/brief-stakeholder-map.md +1 -1
  42. package/framework/tasks/brief-validate-completeness.md +1 -1
  43. package/framework/tasks/brownfield-wu-architecture-map.md +1 -1
  44. package/framework/tasks/brownfield-wu-deep-discovery.md +1 -1
  45. package/framework/tasks/brownfield-wu-dependency-scan.md +1 -1
  46. package/framework/tasks/brownfield-wu-migration-plan.md +1 -1
  47. package/framework/tasks/brownfield-wu-report.md +1 -1
  48. package/framework/tasks/brownfield-wu-risk-assess.md +1 -1
  49. package/framework/tasks/detail-acceptance-criteria.md +1 -1
  50. package/framework/tasks/detail-consolidate.md +1 -1
  51. package/framework/tasks/detail-edge-case-analysis.md +1 -1
  52. package/framework/tasks/detail-expand-prd.md +1 -1
  53. package/framework/tasks/detail-nfr-extraction.md +1 -1
  54. package/framework/tasks/greenfield-wu-analyze-empty.md +1 -1
  55. package/framework/tasks/greenfield-wu-report.md +1 -1
  56. package/framework/tasks/greenfield-wu-scaffold-detection.md +1 -1
  57. package/framework/tasks/greenfield-wu-tech-stack-assess.md +1 -1
  58. package/framework/tasks/orchestrator-deviation.md +3 -3
  59. package/framework/tasks/orchestrator-escalate.md +2 -2
  60. package/framework/tasks/orchestrator-handoff.md +6 -6
  61. package/framework/tasks/orchestrator-health.md +1 -1
  62. package/framework/tasks/orchestrator-mode-switch.md +20 -20
  63. package/framework/tasks/orchestrator-resume.md +6 -6
  64. package/framework/tasks/orchestrator-route.md +7 -7
  65. package/framework/tasks/orchestrator-status.md +8 -8
  66. package/framework/tasks/orchestrator-suggest-mode.md +13 -13
  67. package/framework/tasks/phases-breakdown.md +1 -1
  68. package/framework/tasks/phases-dependency-mapping.md +1 -1
  69. package/framework/tasks/phases-mvp-scoping.md +1 -1
  70. package/framework/tasks/qa-impl-regression-check.md +2 -2
  71. package/framework/tasks/qa-planning-consolidate.md +3 -3
  72. package/framework/tasks/qa-planning-coverage-plan.md +1 -1
  73. package/framework/tasks/qa-planning-gate-define.md +7 -7
  74. package/framework/tasks/qa-planning-risk-matrix.md +1 -1
  75. package/framework/tasks/qa-planning-test-strategy.md +1 -1
  76. package/framework/tasks/tasks-acceptance-write.md +1 -1
  77. package/framework/tasks/tasks-consolidate.md +1 -1
  78. package/framework/tasks/tasks-decompose.md +1 -1
  79. package/framework/tasks/tasks-estimate.md +1 -1
  80. package/framework/tasks/ux-a11y-check.md +1 -1
  81. package/framework/tasks/ux-component-map.md +1 -1
  82. package/framework/tasks/ux-consolidate.md +1 -1
  83. package/framework/tasks/ux-user-flow.md +1 -1
  84. package/framework/tasks/ux-wireframe.md +1 -1
  85. package/framework/workflows/brownfield-discovery.yaml +7 -7
  86. package/framework/workflows/brownfield-fullstack.yaml +9 -9
  87. package/framework/workflows/brownfield-service.yaml +5 -5
  88. package/framework/workflows/brownfield-ui.yaml +5 -5
  89. package/framework/workflows/greenfield-fullstack.yaml +9 -9
  90. package/package.json +2 -2
  91. package/scripts/bundle-framework.js +1 -1
  92. package/scripts/health-check.js +8 -8
  93. package/scripts/populate-entity-registry.js +1 -1
  94. package/scripts/validate-agents.js +1 -1
  95. package/scripts/validate-tasks.js +1 -1
  96. package/src/autonomy/autonomous-gate.js +1 -1
  97. package/src/autonomy/progress-reporter.js +9 -9
  98. package/src/config/mcp-configs.js +16 -85
  99. package/src/context/engine.js +2 -2
  100. package/src/context/layers/l1-global.js +3 -3
  101. package/src/dashboard/layout.js +7 -7
  102. package/src/dashboard/renderer.js +2 -2
  103. package/src/gates/g1-planning-complete.js +9 -9
  104. package/src/installer/core.js +11 -11
  105. package/src/installer/templates.js +1 -1
  106. package/src/installer/validator.js +8 -8
  107. package/src/intelligence/registry-manager.js +4 -4
  108. package/src/memory/session-digest.js +1 -1
  109. package/src/orchestrator/agent-selector.js +10 -10
  110. package/src/orchestrator/intent-classifier.js +4 -4
  111. package/src/orchestrator/pipeline-manager.js +3 -3
  112. package/src/orchestrator/pipeline-state.js +1 -1
  113. package/src/orchestrator/session-manager.js +3 -3
  114. package/src/tasks/executor.js +1 -1
  115. package/src/tasks/loader.js +1 -1
  116. package/src/terminal/handoff-parser.js +127 -0
  117. package/src/terminal/index.js +9 -0
  118. package/src/terminal/prompt-builder.js +313 -0
  119. package/src/terminal/run-agent.js +248 -0
  120. package/src/terminal/run-parallel.js +238 -0
  121. package/src/terminal/spawner.js +29 -18
  122. package/src/wizard/i18n.js +1 -3
  123. package/src/wizard/index.js +10 -15
  124. package/src/wizard/questions.js +7 -70
package/README.md CHANGED
@@ -3,15 +3,13 @@
3
3
  <img src="packages/chati-dev/assets/logo.svg" alt="Chati.dev" width="380">
4
4
  <br><br>
5
5
  <strong>AI-Powered Multi-Agent Orchestration System</strong><br>
6
- <em>13 agents. 17 articles. 6 IDEs. 4 languages. 849 tests. Structured vibe coding.</em>
6
+ <em>Structured vibe coding for Full Stack Development.</em>
7
7
  </div>
8
8
 
9
9
  <p align="center">
10
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
11
  <a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT"></a>
12
12
  <a href="https://nodejs.org/"><img src="https://img.shields.io/badge/node-%3E%3D20.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
13
  <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
14
  <a href=".github/CONTRIBUTING.md"><img src="https://img.shields.io/badge/contributions-welcome-brightgreen.svg" alt="Contributions Welcome"></a>
17
15
  </p>
@@ -35,7 +33,7 @@ AI-assisted development today suffers from three critical issues:
35
33
  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
34
 
37
35
  ```
38
- CLARITY (planning) → Quality Gate → BUILD → Quality Gate → DEPLOY
36
+ PLANNING (planning) → Quality Gate → BUILD → Quality Gate → DEPLOY
39
37
  8 agents QA-Planning Dev QA-Impl DevOps
40
38
  ```
41
39
 
@@ -51,7 +49,7 @@ CLARITY (planning) → Quality Gate → BUILD → Quality Gate → DEPLO
51
49
  | **Session Lock** | Once activated, user stays in system until explicit exit. Zero accidental leakage |
52
50
  | **Hooks System** | 5 Claude Code hooks — constitution guard, mode governance, model governance, context injection, session digest |
53
51
  | **Execution Modes** | Autonomous and human-in-the-loop modes with safety net (5 triggers) and circuit breaker |
54
- | **Multi-Terminal** | Parallel agent execution with write-scope isolation (Detail + Architect + UX simultaneously) |
52
+ | **Multi-Terminal** | Autonomous agents spawn in separate `claude -p` terminals with dedicated models. Parallel groups (Detail + Architect + UX) with write-scope isolation |
55
53
  | **IDE-Agnostic** | Works with 6 IDEs through a thin router pattern |
56
54
 
57
55
  ---
@@ -64,7 +62,7 @@ CLARITY (planning) → Quality Gate → BUILD → Quality Gate → DEPLO
64
62
  npx chati-dev init
65
63
  ```
66
64
 
67
- The wizard guides you through language, project type, IDE selection, and MCP configuration.
65
+ The wizard guides you through language and project type, then auto-configures Claude Code with the required MCPs.
68
66
 
69
67
  ### Activate
70
68
 
@@ -96,7 +94,7 @@ npx chati-dev status --watch # Auto-refresh every 5s
96
94
 
97
95
  | Category | Agents | Purpose |
98
96
  |----------|--------|---------|
99
- | **CLARITY** | Greenfield WU, Brownfield WU, Brief, Detail (PRD), Architect, UX, Phases, Tasks | Planning & Requirements |
97
+ | **PLANNING** | Greenfield WU, Brownfield WU, Brief, Detail (PRD), Architect, UX, Phases, Tasks | Planning & Requirements |
100
98
  | **Quality** | QA-Planning, QA-Implementation | Validation & Gates |
101
99
  | **BUILD** | Dev | Implementation |
102
100
  | **DEPLOY** | DevOps | Shipping |
@@ -108,40 +106,53 @@ User Request
108
106
 
109
107
 
110
108
  ┌─────────────────────────────────────────────────┐
111
- │ ORCHESTRATOR (/chati)
112
- │ Routes to correct agent, manages session
113
- │ Session Lock: user stays in system
109
+ │ ORCHESTRATOR (/chati) — Main Terminal
110
+ │ Routes to correct agent, manages session
111
+ │ Session Lock: user stays in system
114
112
  └─────────────────────────────────────────────────┘
115
113
 
116
-
117
- ┌─────────────────── CLARITY ─────────────────────┐
118
-
119
- │ WU → Brief → Detail(PRD) → Architect → UX
120
- → Phases → Tasks │
121
- │ │
122
- └──────────────────────────────────────────────────┘
114
+ ├── In-conversation ──┐
115
+ │ ▼
116
+ ┌─── PLANNING (interactive) ───┐
117
+ WU → Brief
118
+ └─────────────────────────────┘
123
119
 
124
-
125
- ┌─────────────────── QUALITY ─────────────────────┐
126
- QA-Planning (traceability validation, ≥95%) │
127
- └──────────────────────────────────────────────────┘
120
+ ├── Spawns terminals ──────────────────────────┐
121
+ │ ▼
122
+ ┌─── PLANNING (autonomous) ─── Parallel ───┐
123
+ │ │ Detail (opus) ──┐ │
124
+ │ │ Architect (opus)├── run simultaneously │
125
+ │ │ UX (sonnet) ────┘ │
126
+ │ │ → Phases → Tasks │
127
+ │ └──────────────────────────────────────────┘
128
128
 
129
-
130
- ┌─────────────────── BUILD ───────────────────────┐
131
- Dev (implementation + self-validation) │
132
- └──────────────────────────────────────────────────┘
129
+ ├── Spawns terminal ──┐
130
+ │ ▼
131
+ ┌─── QUALITY ─────────────────────────────┐
132
+ │ │ QA-Planning (opus) — ≥95% threshold │
133
+ │ └──────────────────────────────────────────┘
133
134
 
134
-
135
- ┌─────────────────── QUALITY ─────────────────────┐
136
- QA-Implementation (tests + SAST + code review) │
137
- └──────────────────────────────────────────────────┘
135
+ ├── Spawns terminal(s) ┐
136
+ │ ▼
137
+ ┌─── BUILD ───────────────────────────────┐
138
+ │ │ Dev (opus) — parallel for independent │
139
+ │ └──────────────────────────────────────────┘
138
140
 
139
-
140
- ┌─────────────────── DEPLOY ──────────────────────┐
141
- DevOps (git + deploy + docs) │
142
- └──────────────────────────────────────────────────┘
141
+ ├── Spawns terminal ──┐
142
+ │ ▼
143
+ ┌─── QUALITY ─────────────────────────────┐
144
+ │ │ QA-Implementation (opus) — tests + SAST │
145
+ │ └──────────────────────────────────────────┘
146
+
147
+ └── Spawns terminal ──┐
148
+
149
+ ┌─── DEPLOY ──────────────────────────────┐
150
+ │ DevOps (sonnet) — git + deploy + docs │
151
+ └──────────────────────────────────────────┘
143
152
  ```
144
153
 
154
+ Each spawned terminal runs as a separate `claude -p --model <model>` process with its own context window, write-scope isolation, and structured handoff output.
155
+
145
156
  ### Intelligence Layer
146
157
 
147
158
  The Intelligence Layer operates transparently behind the pipeline:
@@ -177,7 +188,7 @@ The system is governed by a **17-article Constitution** that enforces agent beha
177
188
  | I-IV | Agent governance, quality standards, memory & context, security |
178
189
  | V-VII | Communication protocol, design system, English-only documentation |
179
190
  | VIII-X | Two-layer handoff, agent-driven interaction, dynamic self-validation |
180
- | XI | Mode governance (clarity/build/deploy) with autonomous transitions |
191
+ | XI | Mode governance (planning/build/deploy) with autonomous transitions |
181
192
  | XII-XIV | Context bracket governance, memory governance, framework registry |
182
193
  | XV | Session lock governance — mandatory lock, explicit exit only |
183
194
  | XVI | Model governance — opus/sonnet/haiku per agent, no downgrade rule |
@@ -255,7 +266,7 @@ your-project/
255
266
  ├── chati.dev/
256
267
  │ ├── orchestrator/ # Main orchestrator
257
268
  │ ├── agents/ # 13 agent definitions
258
- │ │ ├── clarity/ # 8 planning agents
269
+ │ │ ├── planning/ # 8 planning agents
259
270
  │ │ ├── quality/ # 2 quality gate agents
260
271
  │ │ ├── build/ # Dev agent
261
272
  │ │ └── deploy/ # DevOps agent
@@ -287,7 +298,8 @@ your-project/
287
298
  │ ├── 8-Validation/
288
299
  │ └── handoffs/
289
300
  └── packages/
290
- └── chati-dev/ # CLI installer (npx chati-dev)
301
+ └── chati-dev/ # CLI + runtime engine (npx chati-dev)
302
+ └── src/terminal/ # Multi-terminal spawner, monitor, collector
291
303
  ```
292
304
 
293
305
  ---
@@ -8,7 +8,7 @@ You are the **Architect Agent**, responsible for defining HOW the system will be
8
8
 
9
9
  - **Role**: Technical Design & Data Architecture Specialist
10
10
  - **Pipeline Position**: 4th (greenfield, after Detail) or 3rd (brownfield, after Brief)
11
- - **Category**: CLARITY
11
+ - **Category**: PLANNING
12
12
  - **Question Answered**: HOW will we build it?
13
13
  - **Duration**: 45-90 min
14
14
  - **Ratio**: 50% Human / 50% AI
@@ -8,7 +8,7 @@ You are the **Brief Agent**, responsible for extracting and structuring the core
8
8
 
9
9
  - **Role**: Problem Extraction Specialist
10
10
  - **Pipeline Position**: 2nd agent (after WU)
11
- - **Category**: CLARITY
11
+ - **Category**: PLANNING
12
12
  - **Question Answered**: WHAT is the problem?
13
13
  - **Duration**: 30-60 min
14
14
  - **Ratio**: 90% Human / 10% AI
@@ -8,7 +8,7 @@ You are the **Brownfield WU Agent**, responsible for comprehensive discovery of
8
8
 
9
9
  - **Role**: Technical + Operational Discovery Agent
10
10
  - **Pipeline Position**: 1st agent (brownfield projects)
11
- - **Category**: CLARITY
11
+ - **Category**: PLANNING
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
@@ -8,7 +8,7 @@ You are the **Detail Agent**, responsible for transforming the Brief into a form
8
8
 
9
9
  - **Role**: Product Specification & Requirements Analyst
10
10
  - **Pipeline Position**: 3rd (greenfield) or 4th (brownfield, after Architect)
11
- - **Category**: CLARITY
11
+ - **Category**: PLANNING
12
12
  - **Question Answered**: WHAT will we build?
13
13
  - **Duration**: 45-90 min
14
14
  - **Ratio**: 70% Human / 30% AI
@@ -8,7 +8,7 @@ You are the **Greenfield WU Agent**, responsible for understanding HOW the user
8
8
 
9
9
  - **Role**: Operational Discovery Agent
10
10
  - **Pipeline Position**: 1st agent (greenfield projects)
11
- - **Category**: CLARITY
11
+ - **Category**: PLANNING
12
12
  - **Question Answered**: HOW does it work today?
13
13
  - **Duration**: 15-30 min
14
14
  - **Ratio**: 70% Human / 30% AI
@@ -8,7 +8,7 @@ You are the **Phases Agent**, responsible for breaking the PRD into development
8
8
 
9
9
  - **Role**: Roadmap & Execution Planning Specialist
10
10
  - **Pipeline Position**: 6th (after UX)
11
- - **Category**: CLARITY
11
+ - **Category**: PLANNING
12
12
  - **Question Answered**: WHEN will we build it?
13
13
  - **Duration**: 20-40 min
14
14
  - **Ratio**: 60% Human / 40% AI
@@ -8,7 +8,7 @@ You are the **Tasks Agent**, responsible for breaking phases into atomic, execut
8
8
 
9
9
  - **Role**: Work Breakdown & Task Definition Specialist
10
10
  - **Pipeline Position**: 7th (after Phases)
11
- - **Category**: CLARITY
11
+ - **Category**: PLANNING
12
12
  - **Question Answered**: WHO does WHAT specifically?
13
13
  - **Duration**: 30-60 min
14
14
  - **Ratio**: 50% Human / 50% AI
@@ -8,7 +8,7 @@ You are the **UX Agent**, responsible for defining HOW the product will look and
8
8
 
9
9
  - **Role**: User Experience & Design System Specialist
10
10
  - **Pipeline Position**: 5th (after Architect in both flows)
11
- - **Category**: CLARITY
11
+ - **Category**: PLANNING
12
12
  - **Question Answered**: HOW will it look/feel?
13
13
  - **Duration**: 30-60 min
14
14
  - **Ratio**: 60% Human / 40% AI
@@ -1,6 +1,6 @@
1
1
  # QA-Planning Agent — Traceability Validation
2
2
 
3
- You are the **QA-Planning Agent**, the quality gate between CLARITY (planning) and BUILD (implementation). You validate traceability across all planning artifacts and the rigor of each agent's self-defined criteria. Nothing proceeds to BUILD without your approval.
3
+ You are the **QA-Planning Agent**, the quality gate between PLANNING (planning) and BUILD (implementation). You validate traceability across all planning artifacts and the rigor of each agent's self-defined criteria. Nothing proceeds to BUILD without your approval.
4
4
 
5
5
  ---
6
6
 
@@ -31,7 +31,7 @@ Validate that every Brief problem traces through to a testable task, no requirem
31
31
 
32
32
  ## On Activation
33
33
 
34
- 1. Read ALL CLARITY artifacts:
34
+ 1. Read ALL PLANNING artifacts:
35
35
  - `chati.dev/artifacts/0-WU/` (wu report)
36
36
  - `chati.dev/artifacts/1-Brief/brief-report.md`
37
37
  - `chati.dev/artifacts/2-PRD/prd.md`
@@ -48,7 +48,7 @@ Validate that every Brief problem traces through to a testable task, no requirem
48
48
 
49
49
  ### Step 1: Collect All Artifacts
50
50
  ```
51
- Read every CLARITY artifact and extract:
51
+ Read every PLANNING artifact and extract:
52
52
  - Brief problems list
53
53
  - PRD requirements list (FR-XXX, NFR-XXX)
54
54
  - Architecture components
@@ -109,7 +109,7 @@ Scan ALL artifacts for: [TODO], [TBD], [PLACEHOLDER], [FIXME], {TBD}
109
109
  ### Step 3: Validate Criteria Quality (Checks & Balances)
110
110
 
111
111
  ```
112
- For each agent that completed CLARITY:
112
+ For each agent that completed PLANNING:
113
113
  1. Read their self-validation criteria from handoff
114
114
  2. Assess criteria rigor:
115
115
  - Are criteria BINARY (pass/fail)? Not subjective?
@@ -229,7 +229,7 @@ agents:
229
229
  criteria_count: {total checks performed}
230
230
  completed_at: "{timestamp}"
231
231
  project:
232
- state: build # Transition from clarity to build
232
+ state: build # Transition from planning to build
233
233
  current_agent: dev
234
234
  ```
235
235
 
@@ -6,7 +6,7 @@ Chati.dev is a planning-first AI-assisted orchestration system that coordinates
6
6
 
7
7
  ### 4 Core Principles
8
8
 
9
- 1. **Clarity Before Code**: Never write code without understanding the problem, the users, and the constraints. The CLARITY phase exists because assumptions are the root cause of failed projects.
9
+ 1. **Planning Before Code**: Never write code without understanding the problem, the users, and the constraints. The PLANNING phase exists because assumptions are the root cause of failed projects.
10
10
 
11
11
  2. **Short Iterations**: Deliver value in small, verifiable increments. Every agent validates its own output before passing forward. Every quality gate catches issues early.
12
12
 
@@ -242,17 +242,17 @@ The pipeline operates in three execution modes that control agent permissions. M
242
242
 
243
243
  | Mode | States | Read Scope | Write Scope |
244
244
  |------|--------|------------|-------------|
245
- | **clarity** | clarity | Entire project (codebase + chati.dev/) | `chati.dev/` and `.chati/` only |
245
+ | **planning** | planning | Entire project (codebase + chati.dev/) | `chati.dev/` and `.chati/` only |
246
246
  | **build** | build, validate | Entire project | Entire project |
247
247
  | **deploy** | deploy | Entire project | Entire project + infra/CI operations |
248
248
 
249
249
  ### Enforcement Rules
250
250
 
251
- 1. In `clarity` mode, agents MAY read any file in the project (essential for brownfield-wu)
252
- 2. In `clarity` mode, agents MUST NOT write/edit files outside `chati.dev/` and `.chati/`
251
+ 1. In `planning` mode, agents MAY read any file in the project (essential for brownfield-wu)
252
+ 2. In `planning` mode, agents MUST NOT write/edit files outside `chati.dev/` and `.chati/`
253
253
  3. Transition to `build` requires QA-Planning score >= 95% (Article II)
254
254
  4. Transition to `deploy` requires QA-Implementation APPROVED
255
- 5. Backward transition from `build` to `clarity` is permitted when QA-Implementation classifies an issue as `spec` or `architecture` (not `code`)
255
+ 5. Backward transition from `build` to `planning` is permitted when QA-Implementation classifies an issue as `spec` or `architecture` (not `code`)
256
256
  6. Mode overrides require explicit user confirmation and are logged in session.yaml
257
257
 
258
258
  **Enforcement: BLOCK** — Write operations outside permitted scope are rejected.
@@ -383,7 +383,7 @@ The system SHALL support two execution modes that govern the degree of human inv
383
383
  2. Mode suggestion is computed from project context (risk score). The mode-suggester evaluates: project type, task complexity, risk domains, project history, and recent gotchas. A risk score > 50 suggests human-in-the-loop.
384
384
 
385
385
  3. Quality gate thresholds are conservative by default:
386
- - **qa-planning**: 95% minimum (gates clarity-to-build transition)
386
+ - **qa-planning**: 95% minimum (gates planning-to-build transition)
387
387
  - **qa-implementation**: 90% minimum (gates build-to-deploy transition)
388
388
  - **All other agents**: 90% minimum
389
389
  - Scores below threshold trigger escalation regardless of execution mode.
@@ -3,9 +3,9 @@
3
3
  Extracted from `chati.dev/constitution.md` (17 Articles). Read the full constitution for complete rules.
4
4
 
5
5
  ## Mode Governance (Article XI)
6
- - **3 modes**: clarity (read all, write chati.dev/ only), build (full access), deploy (full + infra)
7
- - **Autonomous transitions**: clarity->build (QA-Planning >= 95%), build->validate (dev done), validate->deploy (QA-Impl approved)
8
- - **Backward transitions**: build/validate->clarity when QA finds spec/architecture issues
6
+ - **3 modes**: planning (read all, write chati.dev/ only), build (full access), deploy (full + infra)
7
+ - **Autonomous transitions**: planning->build (QA-Planning >= 95%), build->validate (dev done), validate->deploy (QA-Impl approved)
8
+ - **Backward transitions**: build/validate->planning when QA finds spec/architecture issues
9
9
 
10
10
  ## Context Bracket (Article XII)
11
11
  - 4 brackets: FRESH, MODERATE, DEPLETED, CRITICAL
@@ -10,7 +10,7 @@
10
10
  Scores within 5 points below threshold trigger REVIEW (human confirmation required even in autonomous mode).
11
11
 
12
12
  ## 5 Pipeline Gates
13
- 1. **Planning Complete** — All CLARITY agents finished
13
+ 1. **Planning Complete** — All PLANNING agents finished
14
14
  2. **QA Planning** — QA-Planning agent validates plan coherence (95% threshold)
15
15
  3. **Implementation** — Dev agent completes all tasks
16
16
  4. **QA Implementation** — Tests pass, SAST clean, coverage adequate (90% threshold)
@@ -15,7 +15,7 @@
15
15
 
16
16
  ## Pipeline
17
17
  ```
18
- CLARITY: WU -> Brief -> Detail -> Architect -> UX -> Phases -> Tasks -> QA-Planning
18
+ PLANNING: WU -> Brief -> Detail -> Architect -> UX -> Phases -> Tasks -> QA-Planning
19
19
  BUILD: Dev -> QA-Implementation
20
20
  DEPLOY: DevOps
21
21
  ```
@@ -19,7 +19,7 @@ entities:
19
19
  adaptability: 0.2
20
20
 
21
21
  greenfield-wu:
22
- path: chati.dev/agents/clarity/greenfield-wu.md
22
+ path: chati.dev/agents/planning/greenfield-wu.md
23
23
  type: agent
24
24
  purpose: "Analyze greenfield project context, constraints, and technology landscape"
25
25
  keywords: [greenfield, analysis, context, technology, constraints]
@@ -27,7 +27,7 @@ entities:
27
27
  adaptability: 0.5
28
28
 
29
29
  brownfield-wu:
30
- path: chati.dev/agents/clarity/brownfield-wu.md
30
+ path: chati.dev/agents/planning/brownfield-wu.md
31
31
  type: agent
32
32
  purpose: "Deep discovery of existing codebase — architecture, patterns, debt, dependencies"
33
33
  keywords: [brownfield, discovery, codebase, architecture, debt]
@@ -35,7 +35,7 @@ entities:
35
35
  adaptability: 0.5
36
36
 
37
37
  brief:
38
- path: chati.dev/agents/clarity/brief.md
38
+ path: chati.dev/agents/planning/brief.md
39
39
  type: agent
40
40
  purpose: "Extract and structure user requirements through 5 elicitation phases"
41
41
  keywords: [requirements, elicitation, brief, functional, non-functional]
@@ -43,7 +43,7 @@ entities:
43
43
  adaptability: 0.4
44
44
 
45
45
  detail:
46
- path: chati.dev/agents/clarity/detail.md
46
+ path: chati.dev/agents/planning/detail.md
47
47
  type: agent
48
48
  purpose: "Transform Brief into formal PRD with complete specifications"
49
49
  keywords: [prd, specification, detail, formal, requirements]
@@ -51,7 +51,7 @@ entities:
51
51
  adaptability: 0.4
52
52
 
53
53
  architect:
54
- path: chati.dev/agents/clarity/architect.md
54
+ path: chati.dev/agents/planning/architect.md
55
55
  type: agent
56
56
  purpose: "Design technical architecture, make technology decisions, define system boundaries"
57
57
  keywords: [architecture, technology, design, patterns, boundaries]
@@ -59,7 +59,7 @@ entities:
59
59
  adaptability: 0.3
60
60
 
61
61
  ux:
62
- path: chati.dev/agents/clarity/ux.md
62
+ path: chati.dev/agents/planning/ux.md
63
63
  type: agent
64
64
  purpose: "Design user experience, interaction flows, and interface structure"
65
65
  keywords: [ux, design, interaction, flows, interface, wireframes]
@@ -67,7 +67,7 @@ entities:
67
67
  adaptability: 0.5
68
68
 
69
69
  phases:
70
- path: chati.dev/agents/clarity/phases.md
70
+ path: chati.dev/agents/planning/phases.md
71
71
  type: agent
72
72
  purpose: "Decompose PRD into development phases with MVP-first strategy"
73
73
  keywords: [phases, decomposition, mvp, planning, milestones]
@@ -75,7 +75,7 @@ entities:
75
75
  adaptability: 0.4
76
76
 
77
77
  tasks:
78
- path: chati.dev/agents/clarity/tasks.md
78
+ path: chati.dev/agents/planning/tasks.md
79
79
  type: agent
80
80
  purpose: "Create executable tasks with acceptance criteria from phase definitions"
81
81
  keywords: [tasks, acceptance-criteria, executable, given-when-then]
@@ -85,7 +85,7 @@ entities:
85
85
  qa-planning:
86
86
  path: chati.dev/agents/quality/qa-planning.md
87
87
  type: agent
88
- purpose: "Validate traceability and consistency across all clarity artifacts"
88
+ purpose: "Validate traceability and consistency across all planning artifacts"
89
89
  keywords: [qa, traceability, consistency, validation, quality-gate]
90
90
  dependencies: [qa-gate-template, planning-gate, session-schema]
91
91
  adaptability: 0.3
@@ -39,5 +39,5 @@ rules:
39
39
  priority: high
40
40
 
41
41
  - id: qai-backward
42
- text: "If spec/architecture issues found, trigger backward transition to clarity mode."
42
+ text: "If spec/architecture issues found, trigger backward transition to planning mode."
43
43
  priority: high
@@ -5,7 +5,7 @@ summary: >
5
5
  Constitution governance: self-validation required (loop until quality >= 95%),
6
6
  guided options (1,2,3 format), persistent session state, two-layer handoff,
7
7
  language protocol (interaction=user lang, artifacts=English),
8
- deviation protocol, mode governance (clarity/build/deploy),
8
+ deviation protocol, mode governance (planning/build/deploy),
9
9
  context brackets, memory governance, registry governance,
10
10
  session lock, model governance.
11
11
 
@@ -53,7 +53,7 @@ rules:
53
53
  priority: high
54
54
 
55
55
  - id: art-xi
56
- text: "Mode governance: clarity (read all, write chati.dev/), build (full), deploy (full + infra)."
56
+ text: "Mode governance: planning (read all, write chati.dev/), build (full), deploy (full + infra)."
57
57
  priority: critical
58
58
 
59
59
  - id: art-xii
@@ -19,7 +19,7 @@ rules:
19
19
  priority: normal
20
20
 
21
21
  modes:
22
- clarity:
22
+ planning:
23
23
  writeScope: "chati.dev/"
24
24
  allowedActions:
25
25
  - read_any_file
@@ -3,7 +3,7 @@
3
3
  * Mode Governance Hook — PreToolUse (Write/Edit)
4
4
  *
5
5
  * BLOCKS write operations outside the scope of the current mode:
6
- * - clarity mode: can only write to chati.dev/ and .chati/
6
+ * - planning mode: can only write to chati.dev/ and .chati/
7
7
  * - build mode: can write anywhere
8
8
  * - deploy mode: can write anywhere + infra
9
9
  *
@@ -14,9 +14,9 @@ import { existsSync, readFileSync } from 'fs';
14
14
  import { join, relative, isAbsolute } from 'path';
15
15
 
16
16
  const MODE_SCOPES = {
17
- clarity: {
17
+ planning: {
18
18
  allowed: ['chati.dev/', '.chati/', 'chati.dev/artifacts/'],
19
- description: 'Clarity mode: write only to chati.dev/ and .chati/',
19
+ description: 'Planning mode: write only to chati.dev/ and .chati/',
20
20
  },
21
21
  build: {
22
22
  allowed: ['*'],
@@ -30,11 +30,11 @@ const MODE_SCOPES = {
30
30
 
31
31
  function getCurrentMode(projectDir) {
32
32
  const sessionPath = join(projectDir, '.chati', 'session.yaml');
33
- if (!existsSync(sessionPath)) return 'clarity'; // Default to most restrictive
33
+ if (!existsSync(sessionPath)) return 'planning'; // Default to most restrictive
34
34
 
35
35
  const raw = readFileSync(sessionPath, 'utf-8');
36
36
  const match = raw.match(/^\s*mode:\s*(.+)$/m);
37
- return match ? match[1].trim().replace(/^["']|["']$/g, '') : 'clarity';
37
+ return match ? match[1].trim().replace(/^["']|["']$/g, '') : 'planning';
38
38
  }
39
39
 
40
40
  function isPathAllowed(filePath, projectDir, mode) {
@@ -5,37 +5,57 @@
5
5
  * Validates that the model being used matches the agent's assignment.
6
6
  * Constitution Article XVI enforcement.
7
7
  *
8
- * Model assignments (from agent definitions):
9
- * - orchestrator: opus
10
- * - brief, detail, phases, tasks: sonnet
11
- * - architect, dev: sonnet | upgrade: opus if complex
12
- * - ux: sonnet
13
- * - qa-planning, qa-implementation: sonnet
14
- * - devops: sonnet
15
- * - greenfield-wu, brownfield-wu: sonnet
8
+ * Model assignments (from orchestrator spec — Model Map):
9
+ * - orchestrator: sonnet | upgrade: opus if complex routing
10
+ * - greenfield-wu: haiku | upgrade: sonnet if multi-stack
11
+ * - brownfield-wu: opus | no downgrade
12
+ * - brief: sonnet | upgrade: opus if 10+ integrations
13
+ * - detail: opus | no downgrade
14
+ * - architect: opus | no downgrade
15
+ * - ux: sonnet | upgrade: opus if design system from scratch
16
+ * - phases: sonnet | upgrade: opus if 20+ requirements
17
+ * - tasks: sonnet | upgrade: opus if 50+ tasks
18
+ * - qa-planning: opus | no downgrade
19
+ * - qa-implementation: opus | no downgrade
20
+ * - dev: opus | no downgrade
21
+ * - devops: sonnet | upgrade: opus if multi-env
16
22
  *
17
- * This hook is advisory — it warns but does not block.
23
+ * This hook is advisory in IDE mode — it warns but does not block.
18
24
  */
19
25
 
20
26
  import { existsSync, readFileSync } from 'fs';
21
27
  import { join } from 'path';
22
28
 
23
29
  const AGENT_MODELS = {
24
- orchestrator: 'opus',
25
- 'greenfield-wu': 'sonnet',
26
- 'brownfield-wu': 'sonnet',
30
+ orchestrator: 'sonnet',
31
+ 'greenfield-wu': 'haiku',
32
+ 'brownfield-wu': 'opus',
27
33
  brief: 'sonnet',
28
- detail: 'sonnet',
29
- architect: 'sonnet',
34
+ detail: 'opus',
35
+ architect: 'opus',
30
36
  ux: 'sonnet',
31
37
  phases: 'sonnet',
32
38
  tasks: 'sonnet',
33
- 'qa-planning': 'sonnet',
34
- 'qa-implementation': 'sonnet',
35
- dev: 'sonnet',
39
+ 'qa-planning': 'opus',
40
+ 'qa-implementation': 'opus',
41
+ dev: 'opus',
36
42
  devops: 'sonnet',
37
43
  };
38
44
 
45
+ /**
46
+ * Upgrade conditions per agent. When context matches, the model
47
+ * should be upgraded to the specified target.
48
+ */
49
+ const UPGRADE_CONDITIONS = {
50
+ orchestrator: { to: 'opus', condition: 'complex routing or deviation handling' },
51
+ 'greenfield-wu': { to: 'sonnet', condition: 'multi-stack or enterprise' },
52
+ brief: { to: 'opus', condition: '10+ integrations' },
53
+ ux: { to: 'opus', condition: 'design system from scratch' },
54
+ phases: { to: 'opus', condition: '20+ requirements' },
55
+ tasks: { to: 'opus', condition: '50+ tasks' },
56
+ devops: { to: 'opus', condition: 'multi-environment or IaC' },
57
+ };
58
+
39
59
  function getCurrentAgent(projectDir) {
40
60
  const sessionPath = join(projectDir, '.chati', 'session.yaml');
41
61
  if (!existsSync(sessionPath)) return null;
@@ -71,6 +91,6 @@ async function main() {
71
91
  }
72
92
  }
73
93
 
74
- export { AGENT_MODELS, getCurrentAgent };
94
+ export { AGENT_MODELS, UPGRADE_CONDITIONS, getCurrentAgent };
75
95
 
76
96
  main();
@@ -27,7 +27,7 @@ function readSessionState(projectDir) {
27
27
  };
28
28
 
29
29
  return {
30
- mode: extract('mode') || 'clarity',
30
+ mode: extract('mode') || 'planning',
31
31
  currentAgent: extract('current_agent') || null,
32
32
  workflow: extract('workflow') || null,
33
33
  pipelinePosition: extract('pipeline_position') || null,
@@ -21,7 +21,7 @@ function extractDigest(projectDir) {
21
21
 
22
22
  return {
23
23
  timestamp: new Date().toISOString(),
24
- mode: extract('mode') || 'clarity',
24
+ mode: extract('mode') || 'planning',
25
25
  currentAgent: extract('current_agent') || 'none',
26
26
  pipelinePosition: extract('pipeline_position') || 'unknown',
27
27
  workflow: extract('workflow') || 'unknown',
@@ -10,15 +10,13 @@ installer:
10
10
  brownfield: "Brownfield (existing project integration)"
11
11
  detected_brownfield: "Detected package.json and src/ in current directory"
12
12
  suggestion_brownfield: "Suggestion: Brownfield"
13
- select_ides: "Select IDE(s) for Chati.dev configuration:"
14
- select_mcps: "Select MCPs to install (project-level):"
15
13
  confirmation_title: "Installation Summary"
16
14
  project_label: "Project"
17
15
  language_label: "Language"
18
16
  ides_label: "IDEs"
19
17
  mcps_label: "MCPs"
20
18
  will_install: "Will install:"
21
- agents_count: "13 agent definitions (CLARITY, BUILD, DEPLOY phases)"
19
+ agents_count: "13 agent definitions (PLANNING, BUILD, DEPLOY phases)"
22
20
  workflows_count: "5 workflow blueprints"
23
21
  templates_count: "5 templates (PRD, Brownfield PRD, Architecture, Task, QA Gate)"
24
22
  constitution: "Constitution (17 Articles + Preamble)"