chati-dev 3.3.2 → 4.0.1

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 (48) hide show
  1. package/README.md +4 -4
  2. package/framework/agents/plan/ux.md +41 -1
  3. package/framework/config.yaml +18 -3
  4. package/framework/constitution.md +18 -10
  5. package/framework/context/governance.md +2 -0
  6. package/framework/context/root.md +1 -1
  7. package/framework/data/entity-registry.yaml +43 -3
  8. package/framework/domains/constitution.yaml +1 -1
  9. package/framework/domains/global.yaml +7 -3
  10. package/framework/domains/workflows/standard-flow.yaml +33 -0
  11. package/framework/i18n/en.yaml +11 -2
  12. package/framework/i18n/es.yaml +11 -2
  13. package/framework/i18n/fr.yaml +11 -2
  14. package/framework/i18n/pt.yaml +11 -2
  15. package/framework/intelligence/context-engine.md +22 -17
  16. package/framework/presets/nextjs.yaml +41 -0
  17. package/framework/presets/node-express.yaml +39 -0
  18. package/framework/presets/react-vite.yaml +37 -0
  19. package/framework/presets/supabase-fullstack.yaml +37 -0
  20. package/framework/templates/brandbook-tmpl.yaml +113 -0
  21. package/framework/templates/component-spec-tmpl.yaml +74 -0
  22. package/framework/templates/design-token-tmpl.yaml +55 -0
  23. package/framework/templates/icon-system-tmpl.yaml +95 -0
  24. package/package.json +1 -1
  25. package/scripts/bundle-framework.js +1 -1
  26. package/scripts/doctor/checks/agents.js +77 -0
  27. package/scripts/doctor/checks/constitution.js +41 -0
  28. package/scripts/doctor/checks/domain-alignment.js +58 -0
  29. package/scripts/doctor/checks/prism-layers.js +84 -0
  30. package/scripts/doctor/checks/registry.js +55 -0
  31. package/scripts/doctor/checks/schemas.js +61 -0
  32. package/scripts/doctor/fixes/reference-fix.js +100 -0
  33. package/scripts/doctor/fixes/registry-fix.js +56 -0
  34. package/scripts/doctor/index.js +212 -0
  35. package/scripts/health-check.js +8 -8
  36. package/src/autonomy/surface-criteria.js +226 -0
  37. package/src/context/bracket-tracker.js +44 -13
  38. package/src/context/domain-loader.js +22 -0
  39. package/src/context/engine.js +18 -7
  40. package/src/context/formatter.js +21 -1
  41. package/src/context/layers/l5-keywords.js +53 -0
  42. package/src/intelligence/context-status.js +20 -9
  43. package/src/intelligence/decision-engine.js +253 -0
  44. package/src/terminal/prompt-builder.js +341 -1
  45. package/src/terminal/run-agent.js +15 -0
  46. package/src/terminal/run-parallel.js +77 -5
  47. package/src/terminal/spawner.js +13 -0
  48. package/src/utils/feature-flags.js +106 -0
package/README.md CHANGED
@@ -266,7 +266,7 @@ Three systems operate transparently behind the pipeline:
266
266
 
267
267
  | System | What it does |
268
268
  |--------|-------------|
269
- | **Context Engine (PRISM)** | Injects the right context at the right time. 5 layers of context (from system-wide rules down to specific task details). Tracks how much context space remains and adapts automatically. |
269
+ | **Context Engine (PRISM)** | Injects the right context at the right time. 6 layers of context (from constitution rules down to keyword-matched domain rules). Uses Progressive Reinforcement: as context degrades, injection budgets INCREASE (1.5% to 5.0% of provider context window). Provider-aware for Claude (200K), Gemini (1M), and Codex (128K). |
270
270
  | **Memory System (RECALL)** | Remembers decisions, gotchas, and lessons across sessions. Organized into 4 sectors: what happened (episodic), what we know (semantic), how we do things (procedural), and what we learned (reflective). |
271
271
  | **Decision Engine (COMPASS)** | Before creating something new, checks if a similar component already exists. Decides whether to reuse, adapt, or create from scratch. Keeps a registry of all project entities. |
272
272
 
@@ -390,8 +390,8 @@ your-project/
390
390
  │ │ ├── quality/ # QA-Planning, QA-Implementation
391
391
  │ │ ├── build/ # Dev
392
392
  │ │ └── deploy/ # DevOps
393
- │ ├── workflows/ # 6 workflow blueprints
394
- │ ├── templates/ # 6 artifact templates
393
+ │ ├── workflows/ # 7 workflow blueprints
394
+ │ ├── templates/ # 10 artifact templates
395
395
  │ ├── schemas/ # 5 JSON schemas
396
396
  │ ├── intelligence/ # PRISM, RECALL, COMPASS specs
397
397
  │ ├── domains/ # Per-agent and per-workflow configs
@@ -454,5 +454,5 @@ For security concerns, see our [Security Policy](.github/SECURITY.md).
454
454
 
455
455
  <p align="center">
456
456
  <sub>Built with structure, validated by agents, governed by constitution.</sub><br>
457
- <sub>Chati.dev &copy; 2026</sub>
457
+ <sub>Chati.dev v4.0 "Pegasus" &copy; 2026</sub>
458
458
  </p>
@@ -43,7 +43,47 @@ Define the user experience: information architecture, user flows, interaction pa
43
43
 
44
44
  ---
45
45
 
46
- ## Execution: 5 Phases
46
+ ## Execution: 6 Phases
47
+
48
+ ### Phase 0: Brand Identity (Brandbook)
49
+ ```
50
+ PREREQUISITE: Brief handoff + Architecture handoff
51
+
52
+ Before defining any design tokens or visual patterns, establish the brand identity:
53
+
54
+ 1. Define Brand Voice
55
+ - Personality traits (3-5 adjectives)
56
+ - Tone spectrum (formal <-> casual positioning)
57
+ - Writing principles and anti-patterns
58
+
59
+ 2. Define Visual Language
60
+ - Mood descriptor and visual metaphor
61
+ - Density and contrast philosophy
62
+ - Texture strategy (flat, layered, glassmorphic, etc.)
63
+
64
+ 3. Typography Rationale
65
+ - Display + body font pairing with WHY
66
+ - Hierarchy strategy
67
+ - Pairing logic explanation
68
+
69
+ 4. Color Philosophy
70
+ - Primary color rationale (emotional, functional)
71
+ - Palette derivation logic
72
+ - Accessibility considerations
73
+
74
+ 5. Spacing Rhythm
75
+ - Base unit selection + rationale
76
+ - Rhythm personality (generous, dense, modular)
77
+
78
+ 6. Iconography Style
79
+ - Style direction (outline, solid, duo-tone)
80
+ - Preferred library alignment with brand personality
81
+
82
+ Output: chati.dev/artifacts/4-UX/brandbook.md
83
+
84
+ RULE: Every subsequent design decision must trace back to the brandbook.
85
+ RULE: Brandbook establishes the WHY — Design System (Phase 4) establishes the WHAT.
86
+ ```
47
87
 
48
88
  ### Phase 1: User Flow Mapping
49
89
  ```
@@ -1,8 +1,8 @@
1
1
  # chati.dev Configuration
2
- version: "3.3.2"
2
+ version: "4.0.1"
3
3
  installed_at: "2026-02-07T10:00:00Z"
4
- updated_at: "2026-03-03T00:00:00Z"
5
- installer_version: "3.3.2"
4
+ updated_at: "2026-03-18T00:00:00Z"
5
+ installer_version: "4.0.1"
6
6
  project_type: greenfield
7
7
  language: en
8
8
  ides: [claude-code]
@@ -28,6 +28,21 @@ providers:
28
28
  # provider: gemini
29
29
  # model: pro
30
30
 
31
+ # Feature flags — toggle new capabilities (v4.0 Pegasus)
32
+ features:
33
+ hybrid_budget: true
34
+ anti_dash: true
35
+ rate_limiter_integration: true
36
+ l5_keywords: true
37
+ prompt_size_guard: true
38
+ ids_decision_engine: true
39
+ surface_criteria: true
40
+ parallel_fallback: true
41
+ tool_mesh: true
42
+ tech_presets: true
43
+ doctor_autofix: true
44
+ brandbook: true
45
+
31
46
  # Telemetry — opt-in anonymous usage tracking
32
47
  telemetry:
33
48
  enabled: true
@@ -32,13 +32,13 @@ Chati.dev is a planning-first AI-assisted orchestration system that coordinates
32
32
 
33
33
  ### Exclusion List
34
34
 
35
- The following items from source projects are explicitly excluded from Chati.dev:
36
- - CI/CD pipelines, release scripts, publish scripts from source projects
35
+ The following items are explicitly out of scope for Chati.dev:
36
+ - CI/CD pipelines, release scripts, publish scripts (contributor tooling)
37
37
  - Husky/lint-staged configs (contributor tooling)
38
38
  - npm package configs (.npmignore, .npmrc)
39
39
  - Dashboard web UI (separate product)
40
40
  - Monitor Server (separate product)
41
- - Source project installer packages
41
+ - Standalone installer packages (CLI handles installation)
42
42
  - execution-n8n skill (removed — code-only focus)
43
43
  - Generic tasks redundant with agent self-validation protocols
44
44
  - Duplicate checklists already covered by agent self-validation
@@ -115,6 +115,12 @@ Every agent in Chati.dev:
115
115
  4. Error messages are constructive: what failed, why, and how to fix
116
116
  5. Status updates are concise and actionable
117
117
  6. Technical jargon is adapted to detected user level (vibecoder vs power user)
118
+ 7. Generated content MUST NOT contain AI-detectable writing patterns:
119
+ - No em dashes. Use commas, semicolons, colons, or periods instead
120
+ - Avoid formulaic phrases: "Delve into", "Dive into", "It's important to note that"
121
+ - Avoid stacking transitions: "Furthermore", "Moreover", "Additionally" in sequence
122
+ - Avoid over-hedging: "It could potentially perhaps maybe..."
123
+ - Write naturally. If a sentence reads like AI wrote it, rewrite it
118
124
 
119
125
  **Enforcement: GUIDE** — Violations trigger guidance, not blocking.
120
126
 
@@ -270,7 +276,8 @@ The pipeline operates in three execution modes that control agent permissions. M
270
276
  1. The orchestrator SHALL calculate the context bracket (FRESH, MODERATE, DEPLETED, CRITICAL) before every agent interaction.
271
277
 
272
278
  2. Context injection layers SHALL be reduced according to bracket level:
273
- - FRESH/MODERATE: All 5 layers (L0-L4)
279
+ - FRESH: All 6 layers (L0-L5)
280
+ - MODERATE: L0 + L1 + L2 + L3 + L5 (skip L4 task detail)
274
281
  - DEPLETED: L0 (Constitution) + L1 (Mode) + L2 (Agent) only
275
282
  - CRITICAL: L0 (Constitution) + L1 (Mode) only
276
283
 
@@ -280,11 +287,12 @@ The pipeline operates in three execution modes that control agent permissions. M
280
287
 
281
288
  4. The Constitution (L0) and Mode governance (L1) are NON-NEGOTIABLE and SHALL be injected in ALL brackets, including CRITICAL.
282
289
 
283
- 5. Token budgets per bracket:
284
- - FRESH: 2500 tokens maximum
285
- - MODERATE: 2000 tokens maximum
286
- - DEPLETED: 1500 tokens maximum
287
- - CRITICAL: 800 tokens maximum
290
+ 5. Token budgets per bracket (Progressive Reinforcement Model — as context degrades, reinforcement increases):
291
+ - Budgets are expressed as a percentage of the provider's context window
292
+ - FRESH: 1.5% of context window (Claude: 3000, Gemini: 15000, Codex: 1920)
293
+ - MODERATE: 2.5% of context window (Claude: 5000, Gemini: 25000, Codex: 3200)
294
+ - DEPLETED: 4.0% of context window (Claude: 8000, Gemini: 40000, Codex: 5120)
295
+ - CRITICAL: 5.0% of context window (Claude: 10000, Gemini: 50000, Codex: 6400)
288
296
 
289
297
  6. Autonomous spawn capability varies by IDE:
290
298
  - Full autonomy: Claude Code, AntiGravity, Gemini CLI
@@ -472,5 +480,5 @@ When multiple CLI providers are enabled, the system SHALL coordinate agent execu
472
480
 
473
481
  ---
474
482
 
475
- *Chati.dev Constitution v3.3.0 — 19 Articles + Preamble*
483
+ *Chati.dev Constitution v4.0.0 — 19 Articles + Preamble*
476
484
  *All agents are bound by this Constitution. Violations are enforced per article.*
@@ -10,6 +10,8 @@ Extracted from `chati.dev/constitution.md` (19 Articles). Read the full constitu
10
10
  ## Context Bracket (Article XII)
11
11
  - 4 brackets: FRESH, MODERATE, DEPLETED, CRITICAL
12
12
  - CRITICAL = Constitution + Global layers only (no agent/task context)
13
+ - Progressive Reinforcement: budget INCREASES as context degrades (1.5% → 2.5% → 4.0% → 5.0% of provider context window)
14
+ - Provider-aware: budgets scale proportionally to context window size (Claude 200K, Gemini 1M, Codex 128K)
13
15
  - Handoff before bracket drops below 15%
14
16
 
15
17
  ## Memory (Article XIII)
@@ -1,7 +1,7 @@
1
1
  # Chati.dev System Context
2
2
 
3
3
  ## Framework
4
- - **Version**: 3.3.0
4
+ - **Version**: 4.0.0
5
5
  - **Agents**: 13 (12 specialized + orchestrator)
6
6
  - **Constitution**: 19 Articles + Preamble
7
7
  - **Quality**: 5 pipeline gates + 3-tier verdicts (APPROVED / NEEDS_REVISION / BLOCKED)
@@ -3,9 +3,9 @@
3
3
  # and by the Health Check for system integrity validation.
4
4
 
5
5
  metadata:
6
- version: "1.0.0"
7
- last_updated: "2026-02-12T00:00:00Z"
8
- entity_count: 50
6
+ version: "4.0.0"
7
+ last_updated: "2026-03-17T00:00:00Z"
8
+ entity_count: 55
9
9
  checksum_algorithm: sha256
10
10
 
11
11
  entities:
@@ -163,6 +163,38 @@ entities:
163
163
  dependencies: [brief]
164
164
  adaptability: 0.6
165
165
 
166
+ brandbook:
167
+ path: chati.dev/templates/brandbook-tmpl.yaml
168
+ type: template
169
+ purpose: "Brand identity foundation — voice, visual language, typography, color philosophy"
170
+ keywords: [brand, identity, voice, visual, typography, color]
171
+ dependencies: [ux]
172
+ adaptability: 0.8
173
+
174
+ design-tokens:
175
+ path: chati.dev/templates/design-token-tmpl.yaml
176
+ type: template
177
+ purpose: "Structured design token system — primitive, semantic, component, utility layers"
178
+ keywords: [design, tokens, colors, spacing, typography, components]
179
+ dependencies: [brandbook]
180
+ adaptability: 0.7
181
+
182
+ component-spec:
183
+ path: chati.dev/templates/component-spec-tmpl.yaml
184
+ type: template
185
+ purpose: "UI component specification — variants, states, anatomy, accessibility"
186
+ keywords: [component, specification, ui, variants, states, accessibility]
187
+ dependencies: [design-tokens]
188
+ adaptability: 0.7
189
+
190
+ icon-system:
191
+ path: chati.dev/templates/icon-system-tmpl.yaml
192
+ type: template
193
+ purpose: "Icon library selection, sizing scale, usage guidelines, and inventory"
194
+ keywords: [icons, library, sizing, accessibility, inventory]
195
+ dependencies: [brandbook]
196
+ adaptability: 0.8
197
+
166
198
  workflows:
167
199
  greenfield-fullstack:
168
200
  path: chati.dev/workflows/greenfield-fullstack.yaml
@@ -212,6 +244,14 @@ entities:
212
244
  dependencies: [orchestrator, brief, dev, qa-implementation, devops]
213
245
  adaptability: 0.4
214
246
 
247
+ standard-flow:
248
+ path: chati.dev/workflows/standard-flow.yaml
249
+ type: workflow
250
+ purpose: "Balanced pipeline for moderate tasks: features, integrations, brownfield enhancements. Uses 8 agents."
251
+ keywords: [standard, balanced, feature, integration, enhancement, moderate]
252
+ dependencies: [orchestrator, brief, detail, architect, tasks, qa-planning, dev, qa-implementation, devops]
253
+ adaptability: 0.4
254
+
215
255
  schemas:
216
256
  session:
217
257
  path: chati.dev/schemas/session.schema.json
@@ -29,7 +29,7 @@ rules:
29
29
  priority: critical
30
30
 
31
31
  - id: art-v
32
- text: "Communication follows structured protocol: guided options (1,2,3), clear formatting."
32
+ text: "Communication follows structured protocol: guided options (1,2,3), clear formatting. No em dashes or AI-detectable writing patterns."
33
33
  priority: normal
34
34
 
35
35
  - id: art-vi
@@ -18,6 +18,10 @@ rules:
18
18
  text: "Interact with user in their preferred language. Artifacts stay in English."
19
19
  priority: normal
20
20
 
21
+ - id: anti-dash
22
+ text: "Never use em dashes in generated content. Avoid AI-detectable writing patterns (formulaic transitions, over-hedging, stacking connectors)."
23
+ priority: high
24
+
21
25
  # Execution Profile Rules (v3.0.0)
22
26
  execution-profiles:
23
27
  - explore-readonly: "In explore profile, all write/edit tool calls are blocked."
@@ -75,10 +79,10 @@ modes:
75
79
 
76
80
  brackets:
77
81
  FRESH:
78
- behavior: "Full context injection. All layers active. Include detailed rules and examples."
82
+ behavior: "Moderate context injection. All layers active but model is warming up. Budget lower than MODERATE."
79
83
  MODERATE:
80
- behavior: "Standard injection. Skip task detail layer (L4). Summarize long rules."
84
+ behavior: "Peak context injection. Maximum token budget. Model has context and needs maximum reinforcement."
81
85
  DEPLETED:
82
- behavior: "Minimal injection. Only L0+L1+L2. Use rule IDs instead of full text."
86
+ behavior: "Reduced injection. Only L0+L1+L2. Use rule IDs instead of full text."
83
87
  CRITICAL:
84
88
  behavior: "Emergency. L0+L1 only. Trigger handoff advisory. Preserve essential state."
@@ -0,0 +1,33 @@
1
+ # Standard Flow Workflow Domain — PRISM L3
2
+ # Balanced pipeline for moderate tasks (features, integrations, brownfield enhancements)
3
+ # Uses 8 agents — between Quick Flow (4) and Full Flow (12)
4
+
5
+ steps:
6
+ - brief
7
+ - detail
8
+ - architect
9
+ - tasks
10
+ - qa-planning
11
+ - dev
12
+ - qa-implementation
13
+ - devops
14
+
15
+ rules:
16
+ - id: sf-scope
17
+ text: "Standard Flow targets 2-5 requirements. Escalate to full pipeline if scope exceeds this range."
18
+ priority: critical
19
+ - id: sf-quality
20
+ text: "Both QA gates (planning and implementation) are mandatory. Score >= 95% required at each gate."
21
+ priority: critical
22
+ - id: sf-no-ux-skip
23
+ text: "UX agent is excluded. If design-heavy requirements surface, escalate to full pipeline."
24
+ priority: high
25
+ - id: sf-no-phases
26
+ text: "Phases agent is excluded. Tasks agent handles scope decomposition directly from PRD + Architecture."
27
+ priority: high
28
+ - id: sf-escalation-up
29
+ text: "If architect discovers multi-service complexity or QA finds UX gaps, offer escalation to full pipeline."
30
+ priority: high
31
+ - id: sf-escalation-down
32
+ text: "If detail finds only 1 simple requirement and architect confirms no changes needed, suggest quick flow."
33
+ priority: medium
@@ -29,8 +29,8 @@ installer:
29
29
  created_overlays: "Created provider overlay directories"
30
30
  will_install: "Will install:"
31
31
  agents_count: "13 agent definitions (DISCOVER, PLAN, BUILD, DEPLOY phases)"
32
- workflows_count: "6 workflow blueprints"
33
- templates_count: "6 templates (PRD, Brownfield PRD, Architecture, Task, QA Gate, Quick Brief)"
32
+ workflows_count: "7 workflow blueprints"
33
+ templates_count: "10 templates (PRD, Brownfield PRD, Architecture, Task, QA Gate, Quick Brief, Brandbook, Design Tokens, Component Spec, Icon System)"
34
34
  constitution: "Constitution (19 Articles + Preamble)"
35
35
  session_mgmt: "Session management system"
36
36
  quality_gates: "Quality gates (3-tier verdicts)"
@@ -85,6 +85,15 @@ status:
85
85
  backlog_items: "Backlog Items"
86
86
  high_priority: "high priority"
87
87
 
88
+ features:
89
+ brandbook_step: "Phase 0: Establishing brand identity (Brandbook)"
90
+ tech_preset_loaded: "Tech preset loaded: {preset}"
91
+ tech_preset_detected: "Detected tech stack: {stack}"
92
+ doctor_running: "Running Doctor diagnostics..."
93
+ doctor_healthy: "Doctor: All checks passed"
94
+ doctor_degraded: "Doctor: Issues found (see report)"
95
+ doctor_fix_applied: "Doctor: Applied {count} auto-fix(es)"
96
+
88
97
  errors:
89
98
  session_corrupted: "Session file appears corrupted. Attempting recovery..."
90
99
  handoff_missing: "Handoff not found. Using session.yaml + CLAUDE.md as fallback."
@@ -29,8 +29,8 @@ installer:
29
29
  created_overlays: "Creados directorios de overlay de proveedores"
30
30
  will_install: "Se instalara:"
31
31
  agents_count: "13 definiciones de agentes (fases DISCOVER, PLAN, BUILD, DEPLOY)"
32
- workflows_count: "6 blueprints de workflow"
33
- templates_count: "6 templates (PRD, PRD Brownfield, Arquitectura, Task, QA Gate, Quick Brief)"
32
+ workflows_count: "7 blueprints de workflow"
33
+ templates_count: "10 templates (PRD, PRD Brownfield, Arquitectura, Task, QA Gate, Quick Brief, Brandbook, Design Tokens, Component Spec, Icon System)"
34
34
  constitution: "Constitucion (19 Articulos + Preambulo)"
35
35
  session_mgmt: "Sistema de gestion de sesion"
36
36
  quality_gates: "Quality gates (veredictos en 3 niveles)"
@@ -85,6 +85,15 @@ status:
85
85
  backlog_items: "Items del Backlog"
86
86
  high_priority: "alta prioridad"
87
87
 
88
+ features:
89
+ brandbook_step: "Fase 0: Estableciendo identidad de marca (Brandbook)"
90
+ tech_preset_loaded: "Tech preset cargado: {preset}"
91
+ tech_preset_detected: "Stack tecnologico detectado: {stack}"
92
+ doctor_running: "Ejecutando diagnosticos del Doctor..."
93
+ doctor_healthy: "Doctor: Todos los checks pasaron"
94
+ doctor_degraded: "Doctor: Problemas encontrados (ver reporte)"
95
+ doctor_fix_applied: "Doctor: Aplicado(s) {count} auto-fix(es)"
96
+
88
97
  errors:
89
98
  session_corrupted: "Archivo de sesion parece corrupto. Intentando recuperacion..."
90
99
  handoff_missing: "Handoff no encontrado. Usando session.yaml + CLAUDE.md como respaldo."
@@ -29,8 +29,8 @@ installer:
29
29
  created_overlays: "Crees les repertoires d'overlay des fournisseurs"
30
30
  will_install: "Sera installe:"
31
31
  agents_count: "13 definitions d'agents (phases DISCOVER, PLAN, BUILD, DEPLOY)"
32
- workflows_count: "6 blueprints de workflow"
33
- templates_count: "6 templates (PRD, PRD Brownfield, Architecture, Task, QA Gate, Quick Brief)"
32
+ workflows_count: "7 blueprints de workflow"
33
+ templates_count: "10 templates (PRD, PRD Brownfield, Architecture, Task, QA Gate, Quick Brief, Brandbook, Design Tokens, Component Spec, Icon System)"
34
34
  constitution: "Constitution (19 Articles + Preambule)"
35
35
  session_mgmt: "Systeme de gestion de session"
36
36
  quality_gates: "Quality gates (verdicts en 3 niveaux)"
@@ -85,6 +85,15 @@ status:
85
85
  backlog_items: "Elements du Backlog"
86
86
  high_priority: "haute priorite"
87
87
 
88
+ features:
89
+ brandbook_step: "Phase 0: Etablissement de l'identite de marque (Brandbook)"
90
+ tech_preset_loaded: "Tech preset charge: {preset}"
91
+ tech_preset_detected: "Stack technologique detecte: {stack}"
92
+ doctor_running: "Execution des diagnostics du Doctor..."
93
+ doctor_healthy: "Doctor: Tous les checks ont reussi"
94
+ doctor_degraded: "Doctor: Problemes trouves (voir rapport)"
95
+ doctor_fix_applied: "Doctor: Applique(s) {count} auto-fix(es)"
96
+
88
97
  errors:
89
98
  session_corrupted: "Le fichier de session semble corrompu. Tentative de recuperation..."
90
99
  handoff_missing: "Passation non trouvee. Utilisation de session.yaml + CLAUDE.md comme repli."
@@ -29,8 +29,8 @@ installer:
29
29
  created_overlays: "Criados diretorios de overlay de provedores"
30
30
  will_install: "Sera instalado:"
31
31
  agents_count: "13 definicoes de agentes (fases DISCOVER, PLAN, BUILD, DEPLOY)"
32
- workflows_count: "6 blueprints de workflow"
33
- templates_count: "6 templates (PRD, PRD Brownfield, Arquitetura, Task, QA Gate, Quick Brief)"
32
+ workflows_count: "7 blueprints de workflow"
33
+ templates_count: "10 templates (PRD, PRD Brownfield, Arquitetura, Task, QA Gate, Quick Brief, Brandbook, Design Tokens, Component Spec, Icon System)"
34
34
  constitution: "Constituicao (19 Artigos + Preambulo)"
35
35
  session_mgmt: "Sistema de gerenciamento de sessao"
36
36
  quality_gates: "Quality gates (veredictos em 3 niveis)"
@@ -85,6 +85,15 @@ status:
85
85
  backlog_items: "Itens do Backlog"
86
86
  high_priority: "alta prioridade"
87
87
 
88
+ features:
89
+ brandbook_step: "Fase 0: Estabelecendo identidade de marca (Brandbook)"
90
+ tech_preset_loaded: "Tech preset carregado: {preset}"
91
+ tech_preset_detected: "Stack tecnologico detectado: {stack}"
92
+ doctor_running: "Executando diagnosticos do Doctor..."
93
+ doctor_healthy: "Doctor: Todos os checks passaram"
94
+ doctor_degraded: "Doctor: Problemas encontrados (veja relatorio)"
95
+ doctor_fix_applied: "Doctor: Aplicado(s) {count} auto-fix(es)"
96
+
88
97
  errors:
89
98
  session_corrupted: "Arquivo de sessao parece corrompido. Tentando recuperacao..."
90
99
  handoff_missing: "Handoff nao encontrado. Usando session.yaml + CLAUDE.md como fallback."
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Purpose
4
4
 
5
- The Context Engine monitors context window usage and adapts what information is injected into each agent's prompt. As the context fills, fewer layers are injected to preserve quality for critical operations.
5
+ The Context Engine monitors context window usage and adapts what information is injected into each agent's prompt. As the context fills, fewer layers are injected to maintain focus, while per-layer reinforcement INCREASES to compensate for the model forgetting initial instructions (Progressive Reinforcement Model).
6
6
 
7
7
  ---
8
8
 
@@ -12,16 +12,16 @@ Four brackets define behavior based on remaining context:
12
12
 
13
13
  | Bracket | Context Remaining | Behavior |
14
14
  |---------|-------------------|----------|
15
- | **FRESH** | 60-100% | All protocols active. Minimal injection — context is plentiful. |
16
- | **MODERATE** | 40-60% | Normal protocols. Summarize long outputs. Standard memory retrieval. |
17
- | **DEPLETED** | 25-40% | Reinforce Constitution + Agent scope. Skip optional patterns. Recover context via memory. |
18
- | **CRITICAL** | <25% | Constitution + Agent scope only. Trigger handoff to new session. Full memory dump for continuity. |
15
+ | **FRESH** | 60-100% | All 6 layers active. Minimal reinforcement (1.5%) — context is plentiful. No memory injection. |
16
+ | **MODERATE** | 40-60% | 5 layers (skip L4). Growing reinforcement (2.5%) model starting to forget. Metadata memory. |
17
+ | **DEPLETED** | 25-40% | 3 layers (L0-L2). Heavy reinforcement (4.0%) significant context loss. Chunk memory recovery. |
18
+ | **CRITICAL** | <25% | 2 layers (L0-L1). Maximum reinforcement (5.0%) last interactions before handoff. Full memory dump. |
19
19
 
20
20
  ---
21
21
 
22
22
  ## Layered Context Injection
23
23
 
24
- The orchestrator injects context through 5 hierarchical layers:
24
+ The orchestrator injects context through 6 hierarchical layers:
25
25
 
26
26
  | Layer | Name | Source | When Active |
27
27
  |-------|------|--------|-------------|
@@ -30,15 +30,18 @@ The orchestrator injects context through 5 hierarchical layers:
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 |
32
32
  | **L4** | Task Context | Active artifact + previous agent's handoff | When task is active |
33
+ | **L5** | Keywords | `chati.dev/domains/keywords/` — dynamic rules from user prompt | FRESH + MODERATE only |
33
34
 
34
35
  ### Layer Activation by Bracket
35
36
 
36
- | Bracket | Active Layers | Approx. Token Budget |
37
- |---------|--------------|---------------------|
38
- | FRESH | L0, L1, L2, L3, L4 | ~2500 tokens |
39
- | MODERATE | L0, L1, L2, L3, L4 | ~2000 tokens |
40
- | DEPLETED | L0, L1, L2 | ~1500 tokens |
41
- | CRITICAL | L0, L1 | ~800 tokens |
37
+ | Bracket | Active Layers | Budget Ratio | Claude (200K) | Gemini (1M) | Codex (128K) |
38
+ |---------|--------------|-------------|---------------|-------------|--------------|
39
+ | FRESH | L0, L1, L2, L3, L4, L5 | 1.5% | 3,000 | 15,000 | 1,920 |
40
+ | MODERATE | L0, L1, L2, L3, L5 | 2.5% | 5,000 | 25,000 | 3,200 |
41
+ | DEPLETED | L0, L1, L2 | 4.0% | 8,000 | 40,000 | 5,120 |
42
+ | CRITICAL | L0, L1 | 5.0% | 10,000 | 50,000 | 6,400 |
43
+
44
+ Budgets are proportional to the provider's context window. As context degrades, fewer layers are active (focus) but each active layer receives MORE reinforcement tokens (strength).
42
45
 
43
46
  ---
44
47
 
@@ -145,12 +148,14 @@ If Smart Continuation is insufficient, the orchestrator spawns a new session:
145
148
 
146
149
  ## Integration with Memory Layer
147
150
 
151
+ Memory injection follows the same progressive reinforcement principle: as context degrades, memory becomes MORE important.
152
+
148
153
  | Bracket | Memory Level | Behavior |
149
154
  |---------|-------------|----------|
150
- | FRESH | None | Context is sufficient — no memory injection |
151
- | MODERATE | L1 Metadata | Light reminder of relevant memories (~50 tokens) |
152
- | DEPLETED | L2 Chunks | Context recovery via memory summaries (~200 tokens) |
153
- | CRITICAL | L3 Full | Full memory dump for session handoff (~1000+ tokens) |
155
+ | FRESH | none | Context is sufficient — no memory injection needed |
156
+ | MODERATE | metadata | Light reminder of relevant memories (~50 tokens) |
157
+ | DEPLETED | chunks | Context recovery via memory summaries (~200 tokens) |
158
+ | CRITICAL | full | Full memory dump for session handoff (~1000+ tokens) |
154
159
 
155
160
  ---
156
161
 
@@ -160,7 +165,7 @@ If Smart Continuation is insufficient, the orchestrator spawns a new session:
160
165
 
161
166
  ---
162
167
 
163
- *Context Engine v1.0 — Chati.dev Intelligence Layer*
168
+ *Context Engine v2.0 — Chati.dev Intelligence Layer (Progressive Reinforcement Model)*
164
169
 
165
170
  ---
166
171
 
@@ -0,0 +1,41 @@
1
+ # Tech Preset: Next.js
2
+ # Auto-loaded by Architect agent when Next.js stack is detected
3
+
4
+ stack: nextjs
5
+ displayName: "Next.js"
6
+
7
+ detection:
8
+ - next.config.js
9
+ - next.config.mjs
10
+ - next.config.ts
11
+
12
+ conventions:
13
+ routing: "App Router preferred (app/ directory)"
14
+ components: "Server Components by default, 'use client' for interactivity"
15
+ data_fetching: "Server-side fetch in page/layout, React Query for client"
16
+ styling: "Tailwind CSS or CSS Modules (no global CSS imports in components)"
17
+ api: "Route Handlers in app/api/ (not pages/api/)"
18
+
19
+ structure:
20
+ - "app/ — Routes, layouts, and pages"
21
+ - "app/api/ — Route Handlers (REST endpoints)"
22
+ - "components/ — Reusable UI components"
23
+ - "lib/ — Utility functions and shared logic"
24
+ - "public/ — Static assets"
25
+
26
+ rules:
27
+ - id: nextjs-ssr
28
+ text: "Prefer Server Components. Only add 'use client' when interactivity is needed."
29
+ priority: high
30
+ - id: nextjs-api
31
+ text: "Use Route Handlers (app/api/) for API endpoints. Not pages/api/."
32
+ priority: high
33
+ - id: nextjs-layout
34
+ text: "Use layout.tsx for shared UI. Avoid prop drilling through layouts."
35
+ priority: normal
36
+ - id: nextjs-metadata
37
+ text: "Export metadata from page.tsx for SEO. Use generateMetadata for dynamic pages."
38
+ priority: normal
39
+ - id: nextjs-loading
40
+ text: "Use loading.tsx and error.tsx for streaming and error boundaries."
41
+ priority: normal
@@ -0,0 +1,39 @@
1
+ # Tech Preset: Node.js + Express
2
+ # Auto-loaded by Architect agent when Express stack is detected
3
+
4
+ stack: node-express
5
+ displayName: "Node.js + Express"
6
+
7
+ detection:
8
+ - "package.json containing express"
9
+
10
+ conventions:
11
+ routing: "Express Router with modular route files"
12
+ middleware: "Error-handling middleware at the end of the chain"
13
+ validation: "Zod or Joi for request validation"
14
+ auth: "JWT or session-based, middleware pattern"
15
+ errors: "Centralized error handler with error classes"
16
+
17
+ structure:
18
+ - "src/ — Application source code"
19
+ - "src/routes/ — Express route definitions"
20
+ - "src/controllers/ — Request handlers"
21
+ - "src/middleware/ — Custom middleware"
22
+ - "src/services/ — Business logic"
23
+ - "src/models/ — Data models (ORM or raw queries)"
24
+ - "src/utils/ — Utility functions"
25
+ - "src/config/ — Configuration and environment"
26
+
27
+ rules:
28
+ - id: express-error-handler
29
+ text: "Always use a centralized error-handling middleware. Never swallow errors silently."
30
+ priority: critical
31
+ - id: express-validation
32
+ text: "Validate all request input (body, params, query) before processing."
33
+ priority: high
34
+ - id: express-async
35
+ text: "Wrap async route handlers to catch rejected promises (express-async-errors or manual try/catch)."
36
+ priority: high
37
+ - id: express-env
38
+ text: "Use environment variables for all configuration. Never hardcode secrets."
39
+ priority: critical
@@ -0,0 +1,37 @@
1
+ # Tech Preset: React + Vite
2
+ # Auto-loaded by Architect agent when React+Vite stack is detected
3
+
4
+ stack: react-vite
5
+ displayName: "React + Vite"
6
+
7
+ detection:
8
+ - vite.config.js
9
+ - vite.config.ts
10
+ - vite.config.mjs
11
+
12
+ conventions:
13
+ routing: "React Router v6+ with createBrowserRouter"
14
+ components: "Functional components with hooks"
15
+ state: "React Context for simple state, Zustand/Jotai for complex"
16
+ styling: "Tailwind CSS or CSS Modules"
17
+ build: "Vite with ESBuild for dev, Rollup for production"
18
+
19
+ structure:
20
+ - "src/ — Application source code"
21
+ - "src/components/ — Reusable UI components"
22
+ - "src/pages/ — Route-level components"
23
+ - "src/hooks/ — Custom React hooks"
24
+ - "src/lib/ — Utility functions"
25
+ - "src/assets/ — Static assets (images, fonts)"
26
+ - "public/ — Public static files"
27
+
28
+ rules:
29
+ - id: vite-env
30
+ text: "Use import.meta.env for environment variables. Prefix with VITE_ for client exposure."
31
+ priority: high
32
+ - id: vite-lazy
33
+ text: "Use React.lazy() and Suspense for route-level code splitting."
34
+ priority: normal
35
+ - id: vite-alias
36
+ text: "Configure path aliases in vite.config.ts (e.g., @ for src/)."
37
+ priority: normal