chati-dev 1.4.0 → 2.0.2
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 +40 -24
- package/framework/agents/build/dev.md +343 -0
- package/framework/agents/clarity/architect.md +112 -0
- package/framework/agents/clarity/brief.md +182 -0
- package/framework/agents/clarity/brownfield-wu.md +181 -0
- package/framework/agents/clarity/detail.md +110 -0
- package/framework/agents/clarity/greenfield-wu.md +153 -0
- package/framework/agents/clarity/ux.md +112 -0
- package/framework/config.yaml +3 -3
- package/framework/constitution.md +31 -1
- package/framework/context/governance.md +37 -0
- package/framework/context/protocols.md +34 -0
- package/framework/context/quality.md +27 -0
- package/framework/context/root.md +24 -0
- package/framework/data/entity-registry.yaml +1 -1
- package/framework/domains/agents/architect.yaml +51 -0
- package/framework/domains/agents/brief.yaml +47 -0
- package/framework/domains/agents/brownfield-wu.yaml +49 -0
- package/framework/domains/agents/detail.yaml +47 -0
- package/framework/domains/agents/dev.yaml +49 -0
- package/framework/domains/agents/devops.yaml +43 -0
- package/framework/domains/agents/greenfield-wu.yaml +47 -0
- package/framework/domains/agents/orchestrator.yaml +49 -0
- package/framework/domains/agents/phases.yaml +47 -0
- package/framework/domains/agents/qa-implementation.yaml +43 -0
- package/framework/domains/agents/qa-planning.yaml +44 -0
- package/framework/domains/agents/tasks.yaml +48 -0
- package/framework/domains/agents/ux.yaml +50 -0
- package/framework/domains/constitution.yaml +77 -0
- package/framework/domains/global.yaml +64 -0
- package/framework/domains/workflows/brownfield-discovery.yaml +16 -0
- package/framework/domains/workflows/brownfield-fullstack.yaml +26 -0
- package/framework/domains/workflows/brownfield-service.yaml +22 -0
- package/framework/domains/workflows/brownfield-ui.yaml +22 -0
- package/framework/domains/workflows/greenfield-fullstack.yaml +26 -0
- package/framework/hooks/constitution-guard.js +101 -0
- package/framework/hooks/mode-governance.js +92 -0
- package/framework/hooks/model-governance.js +76 -0
- package/framework/hooks/prism-engine.js +89 -0
- package/framework/hooks/session-digest.js +60 -0
- package/framework/hooks/settings.json +44 -0
- package/framework/i18n/en.yaml +3 -3
- package/framework/i18n/es.yaml +3 -3
- package/framework/i18n/fr.yaml +3 -3
- package/framework/i18n/pt.yaml +3 -3
- package/framework/intelligence/decision-engine.md +1 -1
- package/framework/migrations/v1.4-to-v2.0.yaml +167 -0
- package/framework/migrations/v2.0-to-v2.0.1.yaml +132 -0
- package/framework/orchestrator/chati.md +284 -6
- package/framework/tasks/architect-api-design.md +63 -0
- package/framework/tasks/architect-consolidate.md +47 -0
- package/framework/tasks/architect-db-design.md +73 -0
- package/framework/tasks/architect-design.md +95 -0
- package/framework/tasks/architect-security-review.md +62 -0
- package/framework/tasks/architect-stack-selection.md +53 -0
- package/framework/tasks/brief-consolidate.md +249 -0
- package/framework/tasks/brief-constraint-identify.md +277 -0
- package/framework/tasks/brief-extract-requirements.md +339 -0
- package/framework/tasks/brief-stakeholder-map.md +176 -0
- package/framework/tasks/brief-validate-completeness.md +121 -0
- package/framework/tasks/brownfield-wu-architecture-map.md +394 -0
- package/framework/tasks/brownfield-wu-deep-discovery.md +312 -0
- package/framework/tasks/brownfield-wu-dependency-scan.md +359 -0
- package/framework/tasks/brownfield-wu-migration-plan.md +483 -0
- package/framework/tasks/brownfield-wu-report.md +325 -0
- package/framework/tasks/brownfield-wu-risk-assess.md +424 -0
- package/framework/tasks/detail-acceptance-criteria.md +372 -0
- package/framework/tasks/detail-consolidate.md +138 -0
- package/framework/tasks/detail-edge-case-analysis.md +300 -0
- package/framework/tasks/detail-expand-prd.md +389 -0
- package/framework/tasks/detail-nfr-extraction.md +223 -0
- package/framework/tasks/dev-code-review.md +404 -0
- package/framework/tasks/dev-consolidate.md +543 -0
- package/framework/tasks/dev-debug.md +322 -0
- package/framework/tasks/dev-implement.md +252 -0
- package/framework/tasks/dev-iterate.md +411 -0
- package/framework/tasks/dev-pr-prepare.md +497 -0
- package/framework/tasks/dev-refactor.md +342 -0
- package/framework/tasks/dev-test-write.md +306 -0
- package/framework/tasks/devops-ci-setup.md +412 -0
- package/framework/tasks/devops-consolidate.md +712 -0
- package/framework/tasks/devops-deploy-config.md +598 -0
- package/framework/tasks/devops-monitoring-setup.md +658 -0
- package/framework/tasks/devops-release-prepare.md +673 -0
- package/framework/tasks/greenfield-wu-analyze-empty.md +169 -0
- package/framework/tasks/greenfield-wu-report.md +266 -0
- package/framework/tasks/greenfield-wu-scaffold-detection.md +203 -0
- package/framework/tasks/greenfield-wu-tech-stack-assess.md +255 -0
- package/framework/tasks/orchestrator-deviation.md +260 -0
- package/framework/tasks/orchestrator-escalate.md +276 -0
- package/framework/tasks/orchestrator-handoff.md +243 -0
- package/framework/tasks/orchestrator-health.md +372 -0
- package/framework/tasks/orchestrator-mode-switch.md +262 -0
- package/framework/tasks/orchestrator-resume.md +189 -0
- package/framework/tasks/orchestrator-route.md +169 -0
- package/framework/tasks/orchestrator-spawn-terminal.md +358 -0
- package/framework/tasks/orchestrator-status.md +260 -0
- package/framework/tasks/orchestrator-suggest-mode.md +372 -0
- package/framework/tasks/phases-breakdown.md +91 -0
- package/framework/tasks/phases-dependency-mapping.md +67 -0
- package/framework/tasks/phases-mvp-scoping.md +94 -0
- package/framework/tasks/qa-impl-consolidate.md +522 -0
- package/framework/tasks/qa-impl-performance-test.md +487 -0
- package/framework/tasks/qa-impl-regression-check.md +413 -0
- package/framework/tasks/qa-impl-sast-scan.md +402 -0
- package/framework/tasks/qa-impl-test-execute.md +344 -0
- package/framework/tasks/qa-impl-verdict.md +339 -0
- package/framework/tasks/qa-planning-consolidate.md +309 -0
- package/framework/tasks/qa-planning-coverage-plan.md +338 -0
- package/framework/tasks/qa-planning-gate-define.md +339 -0
- package/framework/tasks/qa-planning-risk-matrix.md +631 -0
- package/framework/tasks/qa-planning-test-strategy.md +217 -0
- package/framework/tasks/tasks-acceptance-write.md +75 -0
- package/framework/tasks/tasks-consolidate.md +57 -0
- package/framework/tasks/tasks-decompose.md +80 -0
- package/framework/tasks/tasks-estimate.md +66 -0
- package/framework/tasks/ux-a11y-check.md +49 -0
- package/framework/tasks/ux-component-map.md +55 -0
- package/framework/tasks/ux-consolidate.md +46 -0
- package/framework/tasks/ux-user-flow.md +46 -0
- package/framework/tasks/ux-wireframe.md +76 -0
- package/package.json +2 -2
- package/scripts/bundle-framework.js +2 -0
- package/scripts/changelog-generator.js +222 -0
- package/scripts/codebase-mapper.js +728 -0
- package/scripts/commit-message-generator.js +167 -0
- package/scripts/coverage-analyzer.js +260 -0
- package/scripts/dependency-analyzer.js +280 -0
- package/scripts/framework-analyzer.js +308 -0
- package/scripts/generate-constitution-domain.js +253 -0
- package/scripts/health-check.js +481 -0
- package/scripts/ide-sync.js +327 -0
- package/scripts/performance-analyzer.js +325 -0
- package/scripts/plan-tracker.js +278 -0
- package/scripts/populate-entity-registry.js +481 -0
- package/scripts/pr-review.js +317 -0
- package/scripts/rollback-manager.js +310 -0
- package/scripts/stuck-detector.js +343 -0
- package/scripts/test-quality-assessment.js +257 -0
- package/scripts/validate-agents.js +367 -0
- package/scripts/validate-tasks.js +465 -0
- package/src/autonomy/autonomous-gate.js +293 -0
- package/src/autonomy/index.js +51 -0
- package/src/autonomy/mode-manager.js +225 -0
- package/src/autonomy/mode-suggester.js +283 -0
- package/src/autonomy/progress-reporter.js +268 -0
- package/src/autonomy/safety-net.js +320 -0
- package/src/context/bracket-tracker.js +79 -0
- package/src/context/domain-loader.js +107 -0
- package/src/context/engine.js +144 -0
- package/src/context/formatter.js +184 -0
- package/src/context/index.js +4 -0
- package/src/context/layers/l0-constitution.js +28 -0
- package/src/context/layers/l1-global.js +37 -0
- package/src/context/layers/l2-agent.js +39 -0
- package/src/context/layers/l3-workflow.js +42 -0
- package/src/context/layers/l4-task.js +24 -0
- package/src/decision/analyzer.js +167 -0
- package/src/decision/engine.js +270 -0
- package/src/decision/index.js +38 -0
- package/src/decision/registry-healer.js +450 -0
- package/src/decision/registry-updater.js +330 -0
- package/src/gates/circuit-breaker.js +119 -0
- package/src/gates/g1-planning-complete.js +153 -0
- package/src/gates/g2-qa-planning.js +153 -0
- package/src/gates/g3-implementation.js +188 -0
- package/src/gates/g4-qa-implementation.js +207 -0
- package/src/gates/g5-deploy-ready.js +180 -0
- package/src/gates/gate-base.js +144 -0
- package/src/gates/index.js +46 -0
- package/src/installer/brownfield-upgrader.js +249 -0
- package/src/installer/core.js +82 -11
- package/src/installer/file-hasher.js +51 -0
- package/src/installer/manifest.js +117 -0
- package/src/installer/templates.js +17 -15
- package/src/installer/transaction.js +229 -0
- package/src/installer/validator.js +18 -1
- package/src/intelligence/registry-manager.js +2 -2
- package/src/memory/agent-memory.js +255 -0
- package/src/memory/gotchas-injector.js +72 -0
- package/src/memory/gotchas.js +361 -0
- package/src/memory/index.js +35 -0
- package/src/memory/search.js +233 -0
- package/src/memory/session-digest.js +239 -0
- package/src/merger/env-merger.js +112 -0
- package/src/merger/index.js +56 -0
- package/src/merger/replace-merger.js +51 -0
- package/src/merger/yaml-merger.js +127 -0
- package/src/orchestrator/agent-selector.js +285 -0
- package/src/orchestrator/deviation-handler.js +350 -0
- package/src/orchestrator/handoff-engine.js +271 -0
- package/src/orchestrator/index.js +67 -0
- package/src/orchestrator/intent-classifier.js +264 -0
- package/src/orchestrator/pipeline-manager.js +492 -0
- package/src/orchestrator/pipeline-state.js +223 -0
- package/src/orchestrator/session-manager.js +409 -0
- package/src/tasks/executor.js +195 -0
- package/src/tasks/handoff.js +226 -0
- package/src/tasks/index.js +4 -0
- package/src/tasks/loader.js +210 -0
- package/src/tasks/router.js +182 -0
- package/src/terminal/collector.js +216 -0
- package/src/terminal/index.js +30 -0
- package/src/terminal/isolation.js +129 -0
- package/src/terminal/monitor.js +277 -0
- package/src/terminal/spawner.js +269 -0
- package/src/upgrade/checker.js +1 -1
- package/src/wizard/i18n.js +3 -3
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: greenfield-wu-tech-stack-assess
|
|
3
|
+
agent: greenfield-wu
|
|
4
|
+
trigger: greenfield-wu-scaffold-detection
|
|
5
|
+
phase: clarity
|
|
6
|
+
requires_input: true
|
|
7
|
+
parallelizable: false
|
|
8
|
+
outputs: [tech-stack.yaml]
|
|
9
|
+
handoff_to: greenfield-wu-report
|
|
10
|
+
autonomous_gate: true
|
|
11
|
+
criteria:
|
|
12
|
+
- All layers of stack identified (frontend, backend, database, infrastructure)
|
|
13
|
+
- Technology choices justified with reasoning
|
|
14
|
+
- Compatibility matrix verified
|
|
15
|
+
---
|
|
16
|
+
# Assess and Recommend Tech Stack
|
|
17
|
+
|
|
18
|
+
## Purpose
|
|
19
|
+
Evaluate project requirements and recommend a complete technology stack across all layers of the application architecture.
|
|
20
|
+
|
|
21
|
+
## Prerequisites
|
|
22
|
+
- `wu-analysis.yaml` with runtime detection
|
|
23
|
+
- `scaffold-report.yaml` with scaffolding recommendations
|
|
24
|
+
- User requirements or brain dump available
|
|
25
|
+
|
|
26
|
+
## Steps
|
|
27
|
+
|
|
28
|
+
### 1. Extract Requirements Context
|
|
29
|
+
- Load existing requirement information if available
|
|
30
|
+
- Identify key constraints:
|
|
31
|
+
- Performance requirements (latency, throughput)
|
|
32
|
+
- Scale expectations (users, data volume)
|
|
33
|
+
- Team expertise (what they already know)
|
|
34
|
+
- Budget constraints (hosting costs, licensing)
|
|
35
|
+
- Time constraints (MVP timeline)
|
|
36
|
+
- Compliance needs (GDPR, HIPAA, SOC2)
|
|
37
|
+
|
|
38
|
+
### 2. Define Application Layers
|
|
39
|
+
Identify which layers are needed:
|
|
40
|
+
- **Frontend**: Web UI, mobile app, desktop app
|
|
41
|
+
- **Backend**: API server, business logic, authentication
|
|
42
|
+
- **Database**: Primary data store, cache, search engine
|
|
43
|
+
- **File Storage**: Object storage, CDN
|
|
44
|
+
- **Message Queue**: Async processing, event streaming
|
|
45
|
+
- **Infrastructure**: Hosting, containers, orchestration, CI/CD
|
|
46
|
+
- **Monitoring**: Logging, metrics, tracing, alerting
|
|
47
|
+
|
|
48
|
+
### 3. Evaluate Frontend Stack
|
|
49
|
+
If frontend is required, recommend:
|
|
50
|
+
- **Framework**: React, Vue, Angular, Svelte, Solid
|
|
51
|
+
- Consider: team expertise, ecosystem size, performance needs, TypeScript support
|
|
52
|
+
- **UI Library**: Material-UI, Ant Design, Chakra UI, shadcn/ui, Tailwind CSS
|
|
53
|
+
- Consider: design system needs, customization level, bundle size
|
|
54
|
+
- **State Management**: Redux, Zustand, Jotai, TanStack Query, Context API
|
|
55
|
+
- Consider: complexity, server state vs. client state
|
|
56
|
+
- **Routing**: React Router, Next.js routing, TanStack Router
|
|
57
|
+
- **Build Tool**: Vite, webpack, Turbopack, esbuild
|
|
58
|
+
- **Testing**: Vitest, Jest, React Testing Library, Playwright, Cypress
|
|
59
|
+
|
|
60
|
+
### 4. Evaluate Backend Stack
|
|
61
|
+
If backend is required, recommend:
|
|
62
|
+
- **Language/Runtime**: Node.js, Python, Go, Rust, Java
|
|
63
|
+
- Consider: team expertise, performance needs, ecosystem, concurrency model
|
|
64
|
+
- **Framework**: Express, Fastify, NestJS (Node); FastAPI, Django (Python); Gin (Go)
|
|
65
|
+
- Consider: structure needs, built-in features, community
|
|
66
|
+
- **API Style**: REST, GraphQL, gRPC, tRPC
|
|
67
|
+
- Consider: client flexibility needs, type safety, performance
|
|
68
|
+
- **Authentication**: JWT, OAuth2, Passport, Auth0, Clerk, NextAuth
|
|
69
|
+
- **Validation**: Zod, Yup, Joi, Pydantic
|
|
70
|
+
- **ORM/Query Builder**: Prisma, Drizzle, TypeORM, SQLAlchemy, GORM
|
|
71
|
+
|
|
72
|
+
### 5. Evaluate Database Stack
|
|
73
|
+
Recommend database(s) based on data patterns:
|
|
74
|
+
- **Relational (ACID, structured data)**:
|
|
75
|
+
- PostgreSQL (recommended for most cases)
|
|
76
|
+
- MySQL/MariaDB
|
|
77
|
+
- SQLite (development, edge deployments)
|
|
78
|
+
- **Document (flexible schema)**:
|
|
79
|
+
- MongoDB
|
|
80
|
+
- CouchDB
|
|
81
|
+
- **Key-Value (cache, sessions)**:
|
|
82
|
+
- Redis (recommended)
|
|
83
|
+
- Memcached
|
|
84
|
+
- **Search Engine**:
|
|
85
|
+
- Elasticsearch
|
|
86
|
+
- Meilisearch (simpler alternative)
|
|
87
|
+
- Typesense
|
|
88
|
+
- **Time-Series**:
|
|
89
|
+
- TimescaleDB (PostgreSQL extension)
|
|
90
|
+
- InfluxDB
|
|
91
|
+
- **Graph**:
|
|
92
|
+
- Neo4j
|
|
93
|
+
- Amazon Neptune
|
|
94
|
+
|
|
95
|
+
### 6. Evaluate Infrastructure Stack
|
|
96
|
+
Recommend hosting and deployment:
|
|
97
|
+
- **Hosting Platform**:
|
|
98
|
+
- Vercel (frontend, serverless)
|
|
99
|
+
- Netlify (frontend, edge functions)
|
|
100
|
+
- Railway (fullstack, simple)
|
|
101
|
+
- Fly.io (global deployment)
|
|
102
|
+
- AWS/GCP/Azure (enterprise scale)
|
|
103
|
+
- DigitalOcean (balance of simplicity and control)
|
|
104
|
+
- **Containerization**:
|
|
105
|
+
- Docker (development consistency)
|
|
106
|
+
- Docker Compose (local multi-service)
|
|
107
|
+
- **Orchestration** (if scale requires):
|
|
108
|
+
- Kubernetes
|
|
109
|
+
- AWS ECS/Fargate
|
|
110
|
+
- **CI/CD**:
|
|
111
|
+
- GitHub Actions (recommended)
|
|
112
|
+
- GitLab CI
|
|
113
|
+
- CircleCI
|
|
114
|
+
- **CDN**:
|
|
115
|
+
- Cloudflare (recommended for most)
|
|
116
|
+
- AWS CloudFront
|
|
117
|
+
|
|
118
|
+
### 7. Verify Compatibility Matrix
|
|
119
|
+
Check for known compatibility issues:
|
|
120
|
+
- Runtime version support (e.g., Node 22 + specific packages)
|
|
121
|
+
- Framework version conflicts
|
|
122
|
+
- Database driver versions
|
|
123
|
+
- TypeScript version alignment across tools
|
|
124
|
+
- Build tool compatibility with libraries
|
|
125
|
+
|
|
126
|
+
### 8. Calculate Total Cost of Ownership
|
|
127
|
+
Estimate costs across:
|
|
128
|
+
- **Development Time**: Learning curve, productivity
|
|
129
|
+
- **Hosting Costs**: Free tier, startup tier ($0-100/mo), scale tier ($100-1000/mo)
|
|
130
|
+
- **Maintenance Burden**: Update frequency, breaking changes, security patches
|
|
131
|
+
- **Vendor Lock-in**: Migration difficulty if switching later
|
|
132
|
+
|
|
133
|
+
### 9. Justify Each Choice
|
|
134
|
+
For each major technology decision, provide:
|
|
135
|
+
- **Why This**: Specific reasons for choosing this technology
|
|
136
|
+
- **Why Not Alternatives**: What alternatives were considered and why rejected
|
|
137
|
+
- **Risks**: Known issues, limitations, or concerns
|
|
138
|
+
- **Mitigation**: How to address the risks
|
|
139
|
+
|
|
140
|
+
### 10. Create Migration Path
|
|
141
|
+
If user has existing stack, document:
|
|
142
|
+
- What can be kept vs. what should change
|
|
143
|
+
- Migration strategy (big bang vs. incremental)
|
|
144
|
+
- Compatibility bridges needed
|
|
145
|
+
- Estimated migration effort
|
|
146
|
+
|
|
147
|
+
## Decision Points
|
|
148
|
+
- **Team Expertise vs. Best Tool**: Ask user to choose between familiar but suboptimal tech vs. learning curve for better tech
|
|
149
|
+
- **Build vs. Buy**: For authentication, payments, email, etc., ask if user prefers self-hosted or SaaS
|
|
150
|
+
- **Polyglot vs. Monoglot**: If multiple languages would be optimal, ask if team can handle polyglot architecture
|
|
151
|
+
- **SQL vs. NoSQL**: If data model is ambiguous, present trade-offs and ask user preference
|
|
152
|
+
|
|
153
|
+
## Error Handling
|
|
154
|
+
- **Conflicting Requirements**: If performance and simplicity conflict (e.g., need for extreme performance but small team), flag the conflict and ask user to prioritize
|
|
155
|
+
- **Unsupported Combination**: If user requests incompatible technologies (e.g., specific framework version + specific runtime version), explain incompatibility and offer alternatives
|
|
156
|
+
- **Budget Constraints**: If recommended stack exceeds budget, provide tiered alternatives (MVP stack vs. scale stack)
|
|
157
|
+
- **Knowledge Gaps**: If team lacks expertise in recommended tech, flag as risk and suggest training resources or alternative choices
|
|
158
|
+
|
|
159
|
+
## Output Format
|
|
160
|
+
```yaml
|
|
161
|
+
# tech-stack.yaml
|
|
162
|
+
project_type: web_application_fullstack
|
|
163
|
+
layers:
|
|
164
|
+
frontend:
|
|
165
|
+
framework:
|
|
166
|
+
name: React
|
|
167
|
+
version: "18.2.0"
|
|
168
|
+
justification: |
|
|
169
|
+
Largest ecosystem, strong TypeScript support, team familiarity.
|
|
170
|
+
Component model aligns well with design system needs.
|
|
171
|
+
alternatives_considered:
|
|
172
|
+
- name: Vue
|
|
173
|
+
why_not: Smaller ecosystem for complex UI component libraries
|
|
174
|
+
- name: Svelte
|
|
175
|
+
why_not: Team has no experience, would slow initial development
|
|
176
|
+
ui_library:
|
|
177
|
+
name: shadcn/ui
|
|
178
|
+
justification: Unstyled, accessible components that can be customized. Not a dependency, code is owned.
|
|
179
|
+
state_management:
|
|
180
|
+
name: TanStack Query
|
|
181
|
+
justification: Server state management with caching. Reduces need for global state.
|
|
182
|
+
routing:
|
|
183
|
+
name: React Router
|
|
184
|
+
version: "6.x"
|
|
185
|
+
build_tool:
|
|
186
|
+
name: Vite
|
|
187
|
+
justification: Fast HMR, modern ESM-based, excellent DX
|
|
188
|
+
testing:
|
|
189
|
+
unit: Vitest
|
|
190
|
+
integration: React Testing Library
|
|
191
|
+
e2e: Playwright
|
|
192
|
+
backend:
|
|
193
|
+
runtime:
|
|
194
|
+
name: Node.js
|
|
195
|
+
version: "22.x LTS"
|
|
196
|
+
justification: Team expertise, shared TypeScript across stack, large ecosystem
|
|
197
|
+
framework:
|
|
198
|
+
name: Fastify
|
|
199
|
+
justification: Faster than Express, built-in schema validation, TypeScript-first
|
|
200
|
+
api_style: REST
|
|
201
|
+
authentication:
|
|
202
|
+
name: Clerk
|
|
203
|
+
justification: Managed auth service, reduces security burden, good DX
|
|
204
|
+
self_hosted_alternative: Passport + JWT
|
|
205
|
+
validation:
|
|
206
|
+
name: Zod
|
|
207
|
+
justification: TypeScript-first, runtime validation, type inference
|
|
208
|
+
orm:
|
|
209
|
+
name: Prisma
|
|
210
|
+
justification: Type-safe queries, excellent migration tooling, great DX
|
|
211
|
+
database:
|
|
212
|
+
primary:
|
|
213
|
+
name: PostgreSQL
|
|
214
|
+
version: "16"
|
|
215
|
+
justification: ACID compliance, JSON support, full-text search, mature ecosystem
|
|
216
|
+
cache:
|
|
217
|
+
name: Redis
|
|
218
|
+
version: "7"
|
|
219
|
+
justification: Fast in-memory cache, pub/sub for real-time features
|
|
220
|
+
infrastructure:
|
|
221
|
+
hosting:
|
|
222
|
+
frontend: Vercel
|
|
223
|
+
backend: Railway
|
|
224
|
+
justification: |
|
|
225
|
+
Vercel offers excellent Next.js/React DX and global CDN.
|
|
226
|
+
Railway provides simple database + backend hosting with good developer experience.
|
|
227
|
+
ci_cd: GitHub Actions
|
|
228
|
+
cdn: Cloudflare (Vercel's default)
|
|
229
|
+
monitoring:
|
|
230
|
+
logging: Vercel logs + Railway logs
|
|
231
|
+
metrics: Prometheus (future)
|
|
232
|
+
errors: Sentry
|
|
233
|
+
compatibility_matrix:
|
|
234
|
+
node_22:
|
|
235
|
+
fastify: ✓ (v4+)
|
|
236
|
+
prisma: ✓ (v5+)
|
|
237
|
+
zod: ✓
|
|
238
|
+
prisma_5:
|
|
239
|
+
postgres_16: ✓
|
|
240
|
+
typescript_5: ✓
|
|
241
|
+
cost_estimate:
|
|
242
|
+
development: Low (familiar stack, good DX)
|
|
243
|
+
hosting_mvp: $50-100/month (Vercel hobby + Railway starter + Clerk free tier)
|
|
244
|
+
hosting_scale: $500-1000/month (Vercel pro + Railway standard + Clerk growth)
|
|
245
|
+
maintenance: Medium (regular updates needed for Node ecosystem)
|
|
246
|
+
risks:
|
|
247
|
+
- risk: Node.js single-threaded may bottleneck under extreme load
|
|
248
|
+
mitigation: Use clustering, consider microservices for compute-heavy tasks
|
|
249
|
+
- risk: Vercel vendor lock-in for serverless patterns
|
|
250
|
+
mitigation: Keep backend logic framework-agnostic, can migrate to containers
|
|
251
|
+
- risk: Rapid deprecation in JavaScript ecosystem
|
|
252
|
+
mitigation: Choose mature, well-maintained libraries; pin versions carefully
|
|
253
|
+
migration_path: null
|
|
254
|
+
timestamp: 2026-02-13T10:40:00Z
|
|
255
|
+
```
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: orchestrator-deviation
|
|
3
|
+
agent: orchestrator
|
|
4
|
+
trigger: user-input
|
|
5
|
+
phase: all
|
|
6
|
+
requires_input: true
|
|
7
|
+
parallelizable: false
|
|
8
|
+
outputs: [deviation-plan]
|
|
9
|
+
handoff_to: null
|
|
10
|
+
autonomous_gate: false
|
|
11
|
+
criteria:
|
|
12
|
+
- Deviation type correctly identified
|
|
13
|
+
- Impact assessed
|
|
14
|
+
- User confirmation obtained
|
|
15
|
+
- Plan updated
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
# Orchestrator Deviation Task
|
|
19
|
+
|
|
20
|
+
## Purpose
|
|
21
|
+
Handle changes to project scope, priorities, or approach that deviate from the current plan. Evaluate impact, propose alternatives, and re-route the pipeline.
|
|
22
|
+
|
|
23
|
+
## Prerequisites
|
|
24
|
+
- Session state at `.chati/session.yaml`
|
|
25
|
+
- Current plan in artifacts (brief, requirements, phases, etc.)
|
|
26
|
+
- Constitution at `chati.dev/constitution.md`
|
|
27
|
+
- User input describing the change
|
|
28
|
+
|
|
29
|
+
## Steps
|
|
30
|
+
|
|
31
|
+
### 1. Capture Deviation Request
|
|
32
|
+
Parse user input to understand the change:
|
|
33
|
+
- What aspect of the project is changing (scope, tech stack, priorities, timeline)
|
|
34
|
+
- Why the change is needed
|
|
35
|
+
- Urgency level (immediate vs. planned)
|
|
36
|
+
- Scope of impact (isolated vs. systemic)
|
|
37
|
+
|
|
38
|
+
### 2. Classify Deviation Type
|
|
39
|
+
Categorize the deviation:
|
|
40
|
+
- **Scope Change**: Adding/removing features, changing requirements
|
|
41
|
+
- **Priority Change**: Re-ordering tasks, changing phase focus
|
|
42
|
+
- **Technical Change**: Different tech stack, architecture, approach
|
|
43
|
+
- **Rollback**: Undoing previous decisions, reverting to earlier state
|
|
44
|
+
- **Process Change**: Skipping agents, jumping pipeline position
|
|
45
|
+
|
|
46
|
+
### 3. Load Affected Artifacts
|
|
47
|
+
Identify which artifacts are impacted:
|
|
48
|
+
- Brief document (for scope changes)
|
|
49
|
+
- Requirements (for functional changes)
|
|
50
|
+
- Architecture (for technical changes)
|
|
51
|
+
- Phases/Tasks (for priority changes)
|
|
52
|
+
- Quality assessments (for rollbacks)
|
|
53
|
+
|
|
54
|
+
### 4. Assess Impact Scope
|
|
55
|
+
Evaluate the ripple effects:
|
|
56
|
+
- **Localized**: Change affects only current/next agent
|
|
57
|
+
- **Phase-wide**: Change affects current phase (e.g., all of CLARITY)
|
|
58
|
+
- **Mode-wide**: Change affects entire mode (e.g., clarity → build transition)
|
|
59
|
+
- **Global**: Change affects entire project plan
|
|
60
|
+
|
|
61
|
+
### 5. Determine Required Rework
|
|
62
|
+
Identify which agents need to re-execute:
|
|
63
|
+
- Agents whose outputs are now invalid
|
|
64
|
+
- Agents whose inputs have changed
|
|
65
|
+
- Quality gates that need re-validation
|
|
66
|
+
- Handoffs that need updating
|
|
67
|
+
|
|
68
|
+
### 6. Calculate Cost Estimate
|
|
69
|
+
Estimate the deviation cost:
|
|
70
|
+
- Time: Hours or days of rework
|
|
71
|
+
- Complexity: Number of agents affected
|
|
72
|
+
- Risk: Potential quality impact
|
|
73
|
+
- Artifacts: Number of documents to update
|
|
74
|
+
|
|
75
|
+
### 7. Propose Alternatives
|
|
76
|
+
Present options to the user:
|
|
77
|
+
- **Option A**: Full re-planning (restart from affected agent)
|
|
78
|
+
- **Option B**: Incremental update (patch current plan)
|
|
79
|
+
- **Option C**: Fork approach (parallel track for new scope)
|
|
80
|
+
- **Option D**: Defer change (schedule for next iteration)
|
|
81
|
+
|
|
82
|
+
### 8. Get User Confirmation
|
|
83
|
+
Present the analysis and await explicit approval:
|
|
84
|
+
- Show impact summary
|
|
85
|
+
- Display cost estimate
|
|
86
|
+
- List alternatives
|
|
87
|
+
- Require explicit choice
|
|
88
|
+
|
|
89
|
+
### 9. Execute Deviation Plan
|
|
90
|
+
Based on user selection:
|
|
91
|
+
- Update session state with deviation record
|
|
92
|
+
- Mark affected agents as `needs_revalidation`
|
|
93
|
+
- Update artifact files with change tracking
|
|
94
|
+
- Log deviation in decisions log
|
|
95
|
+
|
|
96
|
+
### 10. Re-route Pipeline
|
|
97
|
+
Adjust the pipeline flow:
|
|
98
|
+
- Set new `current_agent` if jumping position
|
|
99
|
+
- Update phase if changing mode
|
|
100
|
+
- Trigger affected agents in sequence
|
|
101
|
+
- Update progress calculations
|
|
102
|
+
|
|
103
|
+
## Decision Points
|
|
104
|
+
|
|
105
|
+
### When Deviation is Minor
|
|
106
|
+
If impact is localized and low-cost:
|
|
107
|
+
1. Suggest incremental update (Option B)
|
|
108
|
+
2. Fast-track approval process
|
|
109
|
+
3. Apply change immediately
|
|
110
|
+
|
|
111
|
+
### When Deviation is Major
|
|
112
|
+
If impact is global or high-cost:
|
|
113
|
+
1. Strongly recommend full re-planning (Option A)
|
|
114
|
+
2. Highlight risks of partial updates
|
|
115
|
+
3. Suggest deferring if possible
|
|
116
|
+
|
|
117
|
+
### When Deviation Conflicts with Mode
|
|
118
|
+
If change would violate mode restrictions (Article XI):
|
|
119
|
+
1. Explain the mode constraint
|
|
120
|
+
2. Offer mode switch as part of deviation
|
|
121
|
+
3. Require explicit override confirmation
|
|
122
|
+
|
|
123
|
+
### When Deviation is Ambiguous
|
|
124
|
+
If user's intent is unclear:
|
|
125
|
+
1. Ask clarifying questions
|
|
126
|
+
2. Present examples of similar changes
|
|
127
|
+
3. Confirm understanding before proceeding
|
|
128
|
+
|
|
129
|
+
## Error Handling
|
|
130
|
+
|
|
131
|
+
### Invalid Deviation Request
|
|
132
|
+
If requested change is not feasible:
|
|
133
|
+
- Explain technical/process constraints
|
|
134
|
+
- Suggest achievable alternatives
|
|
135
|
+
- Offer escalation path
|
|
136
|
+
|
|
137
|
+
### Conflicting Deviations
|
|
138
|
+
If new deviation conflicts with previous ones:
|
|
139
|
+
- Show the conflict clearly
|
|
140
|
+
- Require resolution of old deviation first
|
|
141
|
+
- Offer to consolidate deviations
|
|
142
|
+
|
|
143
|
+
### Session Lock During Deviation
|
|
144
|
+
If another process is modifying session:
|
|
145
|
+
- Wait for lock release (up to 30 seconds)
|
|
146
|
+
- If timeout: Escalate with lock holder info
|
|
147
|
+
- Suggest retry
|
|
148
|
+
|
|
149
|
+
### Artifact Update Failure
|
|
150
|
+
If deviation updates can't be saved:
|
|
151
|
+
- Preserve original artifacts
|
|
152
|
+
- Log deviation in-memory only
|
|
153
|
+
- Escalate with write error details
|
|
154
|
+
|
|
155
|
+
### User Abandons Deviation
|
|
156
|
+
If user cancels mid-process:
|
|
157
|
+
- Rollback any partial changes
|
|
158
|
+
- Restore session to pre-deviation state
|
|
159
|
+
- Log cancellation for audit
|
|
160
|
+
|
|
161
|
+
## Output Format
|
|
162
|
+
|
|
163
|
+
```yaml
|
|
164
|
+
deviation_plan:
|
|
165
|
+
timestamp: "2026-02-13T10:30:00Z"
|
|
166
|
+
initiator: "user"
|
|
167
|
+
type: "scope-change"
|
|
168
|
+
|
|
169
|
+
request:
|
|
170
|
+
description: "Add real-time chat feature for patient-doctor communication"
|
|
171
|
+
reason: "Client feedback from stakeholder review"
|
|
172
|
+
urgency: "medium"
|
|
173
|
+
|
|
174
|
+
impact_assessment:
|
|
175
|
+
scope: "phase-wide" # Affects multiple CLARITY agents
|
|
176
|
+
affected_agents:
|
|
177
|
+
- agent: "detail"
|
|
178
|
+
status: "completed"
|
|
179
|
+
action: "needs_revalidation"
|
|
180
|
+
reason: "Must add chat feature to requirements"
|
|
181
|
+
- agent: "architect"
|
|
182
|
+
status: "not_started"
|
|
183
|
+
action: "update_input"
|
|
184
|
+
reason: "Must design real-time messaging architecture"
|
|
185
|
+
- agent: "ux"
|
|
186
|
+
status: "not_started"
|
|
187
|
+
action: "update_input"
|
|
188
|
+
reason: "Must design chat interface"
|
|
189
|
+
|
|
190
|
+
affected_artifacts:
|
|
191
|
+
- ".chati/artifacts/requirements/functional-requirements.md"
|
|
192
|
+
- ".chati/artifacts/requirements/user-stories.yaml"
|
|
193
|
+
|
|
194
|
+
cost_estimate:
|
|
195
|
+
time_hours: 4
|
|
196
|
+
complexity: "medium"
|
|
197
|
+
risk_level: "low"
|
|
198
|
+
artifacts_to_update: 2
|
|
199
|
+
|
|
200
|
+
alternatives:
|
|
201
|
+
- id: "A"
|
|
202
|
+
approach: "Full re-validation"
|
|
203
|
+
description: "Re-run Detail agent to add chat requirements, then continue"
|
|
204
|
+
effort: "4 hours"
|
|
205
|
+
risk: "low"
|
|
206
|
+
recommended: true
|
|
207
|
+
- id: "B"
|
|
208
|
+
approach: "Manual patch"
|
|
209
|
+
description: "Manually add chat to existing requirements, skip re-validation"
|
|
210
|
+
effort: "1 hour"
|
|
211
|
+
risk: "medium"
|
|
212
|
+
recommended: false
|
|
213
|
+
- id: "C"
|
|
214
|
+
approach: "Defer to Phase 2"
|
|
215
|
+
description: "Complete Phase 1 as-is, add chat in future iteration"
|
|
216
|
+
effort: "0 hours now"
|
|
217
|
+
risk: "low"
|
|
218
|
+
recommended: false
|
|
219
|
+
|
|
220
|
+
user_choice: "A" # Full re-validation
|
|
221
|
+
|
|
222
|
+
execution_plan:
|
|
223
|
+
steps:
|
|
224
|
+
- action: "mark-agent-revalidation"
|
|
225
|
+
agent: "detail"
|
|
226
|
+
status: "needs_revalidation"
|
|
227
|
+
- action: "update-session-phase"
|
|
228
|
+
new_current_agent: "detail"
|
|
229
|
+
- action: "log-decision"
|
|
230
|
+
decision: "Added real-time chat feature per client request"
|
|
231
|
+
- action: "route-to-agent"
|
|
232
|
+
target: "detail"
|
|
233
|
+
context: "Re-validate requirements with chat feature addition"
|
|
234
|
+
|
|
235
|
+
session_updates:
|
|
236
|
+
current_agent: "detail"
|
|
237
|
+
decisions:
|
|
238
|
+
- id: "D-010"
|
|
239
|
+
decision: "Add real-time chat feature"
|
|
240
|
+
rationale: "Client feedback, critical for patient engagement"
|
|
241
|
+
deviation: true
|
|
242
|
+
mode_transitions:
|
|
243
|
+
- type: "deviation"
|
|
244
|
+
timestamp: "2026-02-13T10:30:00Z"
|
|
245
|
+
from_agent: "architect"
|
|
246
|
+
to_agent: "detail"
|
|
247
|
+
reason: "Scope change: add chat feature"
|
|
248
|
+
user_approved: true
|
|
249
|
+
|
|
250
|
+
audit_trail:
|
|
251
|
+
deviation_id: "DEV-001"
|
|
252
|
+
approved_by: "user"
|
|
253
|
+
approved_at: "2026-02-13T10:32:00Z"
|
|
254
|
+
previous_state:
|
|
255
|
+
current_agent: "architect"
|
|
256
|
+
pipeline_progress: 37.5
|
|
257
|
+
new_state:
|
|
258
|
+
current_agent: "detail"
|
|
259
|
+
pipeline_progress: 25.0 # Rolled back
|
|
260
|
+
```
|