chati-dev 1.3.3 → 2.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.
- package/README.md +7 -6
- package/framework/agents/build/dev.md +343 -0
- package/framework/agents/clarity/architect.md +113 -0
- package/framework/agents/clarity/brief.md +183 -0
- package/framework/agents/clarity/brownfield-wu.md +182 -0
- package/framework/agents/clarity/detail.md +111 -0
- package/framework/agents/clarity/greenfield-wu.md +154 -0
- package/framework/agents/clarity/phases.md +1 -0
- package/framework/agents/clarity/tasks.md +1 -0
- package/framework/agents/clarity/ux.md +113 -0
- package/framework/agents/deploy/devops.md +1 -0
- package/framework/agents/quality/qa-implementation.md +1 -0
- package/framework/agents/quality/qa-planning.md +1 -0
- package/framework/config.yaml +3 -3
- package/framework/constitution.md +58 -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/context-engine.md +2 -2
- 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 +350 -7
- package/framework/schemas/session.schema.json +15 -0
- 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 +1 -1
- 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 +55 -3
- 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,598 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: devops-deploy-config
|
|
3
|
+
agent: devops
|
|
4
|
+
trigger: devops-ci-setup
|
|
5
|
+
phase: deploy
|
|
6
|
+
requires_input: false
|
|
7
|
+
parallelizable: false
|
|
8
|
+
outputs: [deploy-config]
|
|
9
|
+
handoff_to: devops-monitoring-setup
|
|
10
|
+
autonomous_gate: true
|
|
11
|
+
criteria:
|
|
12
|
+
- Deploy config valid
|
|
13
|
+
- Environment variables set
|
|
14
|
+
---
|
|
15
|
+
# Configure Deployment
|
|
16
|
+
|
|
17
|
+
## Purpose
|
|
18
|
+
Set up deployment configuration for the application to chosen hosting platform (Vercel, Railway, Netlify, Docker, etc.) with proper environment management.
|
|
19
|
+
|
|
20
|
+
## Prerequisites
|
|
21
|
+
- CI/CD pipeline configured
|
|
22
|
+
- Application builds successfully
|
|
23
|
+
- Hosting platform account created
|
|
24
|
+
- Environment variables documented
|
|
25
|
+
- Production-ready code
|
|
26
|
+
|
|
27
|
+
## Steps
|
|
28
|
+
|
|
29
|
+
### 1. Choose Deployment Platform
|
|
30
|
+
Select platform based on project type:
|
|
31
|
+
|
|
32
|
+
**For Static Sites/JAMstack**:
|
|
33
|
+
- Vercel (Next.js, static sites)
|
|
34
|
+
- Netlify (static sites, serverless functions)
|
|
35
|
+
- GitHub Pages (documentation, static sites)
|
|
36
|
+
|
|
37
|
+
**For Full-Stack Apps**:
|
|
38
|
+
- Vercel (Next.js, serverless)
|
|
39
|
+
- Railway (Node.js, databases, Docker)
|
|
40
|
+
- Render (web services, databases)
|
|
41
|
+
- Fly.io (global deployment, Docker)
|
|
42
|
+
|
|
43
|
+
**For Containerized Apps**:
|
|
44
|
+
- Railway (easiest Docker deployment)
|
|
45
|
+
- Fly.io (edge deployment)
|
|
46
|
+
- Digital Ocean App Platform
|
|
47
|
+
- AWS ECS/Fargate
|
|
48
|
+
|
|
49
|
+
**For CLI Tools/Packages**:
|
|
50
|
+
- npm registry
|
|
51
|
+
- GitHub Packages
|
|
52
|
+
- Docker Hub
|
|
53
|
+
|
|
54
|
+
### 2. Install Platform CLI
|
|
55
|
+
Install deployment tool:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
# Vercel
|
|
59
|
+
npm install -g vercel
|
|
60
|
+
|
|
61
|
+
# Railway
|
|
62
|
+
npm install -g @railway/cli
|
|
63
|
+
|
|
64
|
+
# Fly.io
|
|
65
|
+
curl -L https://fly.io/install.sh | sh
|
|
66
|
+
|
|
67
|
+
# Netlify
|
|
68
|
+
npm install -g netlify-cli
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### 3. Configure Project for Platform
|
|
72
|
+
Create platform-specific config:
|
|
73
|
+
|
|
74
|
+
**Vercel** (`vercel.json`):
|
|
75
|
+
```json
|
|
76
|
+
{
|
|
77
|
+
"version": 2,
|
|
78
|
+
"builds": [
|
|
79
|
+
{
|
|
80
|
+
"src": "package.json",
|
|
81
|
+
"use": "@vercel/node"
|
|
82
|
+
}
|
|
83
|
+
],
|
|
84
|
+
"routes": [
|
|
85
|
+
{
|
|
86
|
+
"src": "/(.*)",
|
|
87
|
+
"dest": "/src/index.js"
|
|
88
|
+
}
|
|
89
|
+
],
|
|
90
|
+
"env": {
|
|
91
|
+
"NODE_ENV": "production"
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
**Railway** (`railway.json`):
|
|
97
|
+
```json
|
|
98
|
+
{
|
|
99
|
+
"build": {
|
|
100
|
+
"builder": "NIXPACKS"
|
|
101
|
+
},
|
|
102
|
+
"deploy": {
|
|
103
|
+
"startCommand": "npm start",
|
|
104
|
+
"healthcheckPath": "/health",
|
|
105
|
+
"healthcheckTimeout": 100,
|
|
106
|
+
"restartPolicyType": "ON_FAILURE",
|
|
107
|
+
"restartPolicyMaxRetries": 10
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
**Fly.io** (`fly.toml`):
|
|
113
|
+
```toml
|
|
114
|
+
app = "your-app-name"
|
|
115
|
+
primary_region = "sjc"
|
|
116
|
+
|
|
117
|
+
[build]
|
|
118
|
+
[build.args]
|
|
119
|
+
NODE_VERSION = "22"
|
|
120
|
+
|
|
121
|
+
[env]
|
|
122
|
+
NODE_ENV = "production"
|
|
123
|
+
PORT = "8080"
|
|
124
|
+
|
|
125
|
+
[http_service]
|
|
126
|
+
internal_port = 8080
|
|
127
|
+
force_https = true
|
|
128
|
+
auto_stop_machines = true
|
|
129
|
+
auto_start_machines = true
|
|
130
|
+
min_machines_running = 1
|
|
131
|
+
|
|
132
|
+
[[services]]
|
|
133
|
+
http_checks = []
|
|
134
|
+
internal_port = 8080
|
|
135
|
+
protocol = "tcp"
|
|
136
|
+
script_checks = []
|
|
137
|
+
|
|
138
|
+
[[services.ports]]
|
|
139
|
+
force_https = true
|
|
140
|
+
handlers = ["http"]
|
|
141
|
+
port = 80
|
|
142
|
+
|
|
143
|
+
[[services.ports]]
|
|
144
|
+
handlers = ["tls", "http"]
|
|
145
|
+
port = 443
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
**Dockerfile** (if using containers):
|
|
149
|
+
```dockerfile
|
|
150
|
+
FROM node:22-alpine
|
|
151
|
+
|
|
152
|
+
WORKDIR /app
|
|
153
|
+
|
|
154
|
+
COPY package*.json ./
|
|
155
|
+
RUN npm ci --only=production
|
|
156
|
+
|
|
157
|
+
COPY . .
|
|
158
|
+
RUN npm run build
|
|
159
|
+
|
|
160
|
+
EXPOSE 8080
|
|
161
|
+
|
|
162
|
+
CMD ["npm", "start"]
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### 4. Configure Environment Variables
|
|
166
|
+
Set up environment variable management:
|
|
167
|
+
|
|
168
|
+
**Create `.env.example`**:
|
|
169
|
+
```bash
|
|
170
|
+
# Application
|
|
171
|
+
NODE_ENV=production
|
|
172
|
+
PORT=8080
|
|
173
|
+
LOG_LEVEL=info
|
|
174
|
+
|
|
175
|
+
# Database
|
|
176
|
+
DATABASE_URL=postgresql://user:password@host:port/db
|
|
177
|
+
|
|
178
|
+
# Authentication
|
|
179
|
+
JWT_SECRET=your-secret-here
|
|
180
|
+
JWT_EXPIRATION=7d
|
|
181
|
+
|
|
182
|
+
# External Services
|
|
183
|
+
API_KEY=your-api-key
|
|
184
|
+
WEBHOOK_SECRET=your-webhook-secret
|
|
185
|
+
|
|
186
|
+
# Feature Flags
|
|
187
|
+
ENABLE_CHAT=true
|
|
188
|
+
ENABLE_ANALYTICS=false
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
**Set variables on platform**:
|
|
192
|
+
```bash
|
|
193
|
+
# Vercel
|
|
194
|
+
vercel env add DATABASE_URL production
|
|
195
|
+
vercel env add JWT_SECRET production
|
|
196
|
+
|
|
197
|
+
# Railway
|
|
198
|
+
railway variables set DATABASE_URL="postgresql://..."
|
|
199
|
+
railway variables set JWT_SECRET="..."
|
|
200
|
+
|
|
201
|
+
# Fly.io
|
|
202
|
+
fly secrets set DATABASE_URL="postgresql://..."
|
|
203
|
+
fly secrets set JWT_SECRET="..."
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
### 5. Configure Build Settings
|
|
207
|
+
Define build process:
|
|
208
|
+
|
|
209
|
+
**Update package.json**:
|
|
210
|
+
```json
|
|
211
|
+
{
|
|
212
|
+
"scripts": {
|
|
213
|
+
"build": "tsc && node scripts/post-build.js",
|
|
214
|
+
"start": "node dist/index.js",
|
|
215
|
+
"dev": "tsx watch src/index.ts",
|
|
216
|
+
"deploy": "npm run build && vercel --prod"
|
|
217
|
+
},
|
|
218
|
+
"engines": {
|
|
219
|
+
"node": ">=18.0.0",
|
|
220
|
+
"npm": ">=9.0.0"
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
### 6. Set Up Deployment Workflow
|
|
226
|
+
Create automated deployment:
|
|
227
|
+
|
|
228
|
+
**.github/workflows/deploy.yml**:
|
|
229
|
+
```yaml
|
|
230
|
+
name: Deploy to Production
|
|
231
|
+
|
|
232
|
+
on:
|
|
233
|
+
push:
|
|
234
|
+
branches: [main]
|
|
235
|
+
workflow_dispatch:
|
|
236
|
+
|
|
237
|
+
jobs:
|
|
238
|
+
deploy:
|
|
239
|
+
runs-on: ubuntu-latest
|
|
240
|
+
environment: production
|
|
241
|
+
|
|
242
|
+
steps:
|
|
243
|
+
- uses: actions/checkout@v4
|
|
244
|
+
|
|
245
|
+
- name: Setup Node.js
|
|
246
|
+
uses: actions/setup-node@v4
|
|
247
|
+
with:
|
|
248
|
+
node-version: '22.x'
|
|
249
|
+
cache: 'npm'
|
|
250
|
+
|
|
251
|
+
- name: Install dependencies
|
|
252
|
+
run: npm ci
|
|
253
|
+
|
|
254
|
+
- name: Run tests
|
|
255
|
+
run: npm test
|
|
256
|
+
|
|
257
|
+
- name: Build
|
|
258
|
+
run: npm run build
|
|
259
|
+
|
|
260
|
+
- name: Deploy to Vercel
|
|
261
|
+
uses: amondnet/vercel-action@v25
|
|
262
|
+
with:
|
|
263
|
+
vercel-token: ${{ secrets.VERCEL_TOKEN }}
|
|
264
|
+
vercel-org-id: ${{ secrets.ORG_ID }}
|
|
265
|
+
vercel-project-id: ${{ secrets.PROJECT_ID }}
|
|
266
|
+
vercel-args: '--prod'
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
### 7. Configure Database (if needed)
|
|
270
|
+
Set up production database:
|
|
271
|
+
|
|
272
|
+
**Railway**:
|
|
273
|
+
```bash
|
|
274
|
+
railway add postgresql
|
|
275
|
+
railway variables
|
|
276
|
+
# Note DATABASE_URL automatically set
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
**Fly.io Postgres**:
|
|
280
|
+
```bash
|
|
281
|
+
fly postgres create
|
|
282
|
+
fly postgres attach --app your-app-name
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
Run migrations:
|
|
286
|
+
```bash
|
|
287
|
+
npm run migrate:prod
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
### 8. Configure Domain and SSL
|
|
291
|
+
Set up custom domain:
|
|
292
|
+
|
|
293
|
+
**Vercel**:
|
|
294
|
+
```bash
|
|
295
|
+
vercel domains add yourdomain.com
|
|
296
|
+
# Follow DNS instructions
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
**Railway**:
|
|
300
|
+
- Go to project settings
|
|
301
|
+
- Add custom domain
|
|
302
|
+
- Update DNS records
|
|
303
|
+
- SSL automatically provisioned
|
|
304
|
+
|
|
305
|
+
**Fly.io**:
|
|
306
|
+
```bash
|
|
307
|
+
fly certs create yourdomain.com
|
|
308
|
+
fly certs show yourdomain.com
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
### 9. Set Up Staging Environment
|
|
312
|
+
Create staging deployment:
|
|
313
|
+
|
|
314
|
+
```bash
|
|
315
|
+
# Create staging branch
|
|
316
|
+
git checkout -b staging
|
|
317
|
+
|
|
318
|
+
# Deploy to staging
|
|
319
|
+
vercel --env=staging
|
|
320
|
+
# or
|
|
321
|
+
railway environment create staging
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
Configure separate environment variables for staging.
|
|
325
|
+
|
|
326
|
+
### 10. Create Deployment Scripts
|
|
327
|
+
Add convenience scripts:
|
|
328
|
+
|
|
329
|
+
**scripts/deploy.sh**:
|
|
330
|
+
```bash
|
|
331
|
+
#!/bin/bash
|
|
332
|
+
set -e
|
|
333
|
+
|
|
334
|
+
echo "🚀 Starting deployment..."
|
|
335
|
+
|
|
336
|
+
# Run tests
|
|
337
|
+
echo "Running tests..."
|
|
338
|
+
npm test
|
|
339
|
+
|
|
340
|
+
# Build
|
|
341
|
+
echo "Building application..."
|
|
342
|
+
npm run build
|
|
343
|
+
|
|
344
|
+
# Deploy
|
|
345
|
+
echo "Deploying to production..."
|
|
346
|
+
vercel --prod
|
|
347
|
+
|
|
348
|
+
echo "✅ Deployment complete!"
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
Make executable:
|
|
352
|
+
```bash
|
|
353
|
+
chmod +x scripts/deploy.sh
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
### 11. Configure Health Checks
|
|
357
|
+
Add health endpoint:
|
|
358
|
+
|
|
359
|
+
**src/routes/health.ts**:
|
|
360
|
+
```typescript
|
|
361
|
+
export function healthCheck(req, res) {
|
|
362
|
+
res.status(200).json({
|
|
363
|
+
status: 'healthy',
|
|
364
|
+
timestamp: new Date().toISOString(),
|
|
365
|
+
uptime: process.uptime(),
|
|
366
|
+
environment: process.env.NODE_ENV
|
|
367
|
+
});
|
|
368
|
+
}
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
Configure platform to use health check:
|
|
372
|
+
- Path: `/health`
|
|
373
|
+
- Interval: 30 seconds
|
|
374
|
+
- Timeout: 10 seconds
|
|
375
|
+
- Unhealthy threshold: 3 failures
|
|
376
|
+
|
|
377
|
+
### 12. Test Deployment
|
|
378
|
+
Verify deployment works:
|
|
379
|
+
- Deploy to staging first
|
|
380
|
+
- Run smoke tests
|
|
381
|
+
- Check environment variables
|
|
382
|
+
- Verify database connection
|
|
383
|
+
- Test all critical paths
|
|
384
|
+
- Deploy to production
|
|
385
|
+
- Monitor logs
|
|
386
|
+
|
|
387
|
+
## Decision Points
|
|
388
|
+
|
|
389
|
+
### When to Use Serverless vs Traditional Hosting
|
|
390
|
+
**Choose Serverless** (Vercel, Netlify) when:
|
|
391
|
+
- Traffic is intermittent
|
|
392
|
+
- Want zero devops overhead
|
|
393
|
+
- Primarily static or JAMstack
|
|
394
|
+
- Need global CDN
|
|
395
|
+
- Budget conscious (pay per use)
|
|
396
|
+
|
|
397
|
+
**Choose Traditional** (Railway, Fly.io) when:
|
|
398
|
+
- Need persistent connections (WebSockets)
|
|
399
|
+
- Background jobs required
|
|
400
|
+
- Complex database needs
|
|
401
|
+
- More control needed
|
|
402
|
+
- Predictable costs preferred
|
|
403
|
+
|
|
404
|
+
### When to Use Docker
|
|
405
|
+
Use containers when:
|
|
406
|
+
- Complex dependencies
|
|
407
|
+
- Specific system requirements
|
|
408
|
+
- Need reproducible builds
|
|
409
|
+
- Multi-service architecture
|
|
410
|
+
- Platform agnostic deployment
|
|
411
|
+
|
|
412
|
+
### When to Add CDN
|
|
413
|
+
Add CDN (Cloudflare, Fastly) when:
|
|
414
|
+
- Global user base
|
|
415
|
+
- Static asset heavy
|
|
416
|
+
- Need DDoS protection
|
|
417
|
+
- Performance critical
|
|
418
|
+
- High traffic volumes
|
|
419
|
+
|
|
420
|
+
## Error Handling
|
|
421
|
+
|
|
422
|
+
### Deployment Fails
|
|
423
|
+
If deployment fails:
|
|
424
|
+
1. Check build logs
|
|
425
|
+
2. Verify environment variables set
|
|
426
|
+
3. Test build locally
|
|
427
|
+
4. Check platform status page
|
|
428
|
+
5. Verify permissions and tokens
|
|
429
|
+
|
|
430
|
+
### Environment Variables Not Working
|
|
431
|
+
If env vars not loading:
|
|
432
|
+
1. Verify variable names match
|
|
433
|
+
2. Check platform shows variables set
|
|
434
|
+
3. Restart application
|
|
435
|
+
4. Check for typos
|
|
436
|
+
5. Verify no conflicts with .env files
|
|
437
|
+
|
|
438
|
+
### Database Connection Fails
|
|
439
|
+
If can't connect to database:
|
|
440
|
+
1. Verify DATABASE_URL correct
|
|
441
|
+
2. Check database is running
|
|
442
|
+
3. Verify network access
|
|
443
|
+
4. Check SSL requirements
|
|
444
|
+
5. Test connection locally
|
|
445
|
+
|
|
446
|
+
### SSL Certificate Issues
|
|
447
|
+
If SSL not working:
|
|
448
|
+
1. Verify DNS propagated (24-48hrs)
|
|
449
|
+
2. Check DNS records correct
|
|
450
|
+
3. Force SSL renewal
|
|
451
|
+
4. Check certificate status
|
|
452
|
+
5. Contact platform support
|
|
453
|
+
|
|
454
|
+
## Output Format
|
|
455
|
+
|
|
456
|
+
Create `.chati/artifacts/deploy/deploy-config-report.yaml`:
|
|
457
|
+
|
|
458
|
+
```yaml
|
|
459
|
+
task_id: "deploy"
|
|
460
|
+
agent: devops
|
|
461
|
+
action: deploy-config
|
|
462
|
+
timestamp: "2026-02-13T17:15:00Z"
|
|
463
|
+
duration_minutes: 45
|
|
464
|
+
|
|
465
|
+
deployment_platform: railway
|
|
466
|
+
deployment_url: "https://your-app.up.railway.app"
|
|
467
|
+
custom_domain: "yourdomain.com"
|
|
468
|
+
ssl_enabled: true
|
|
469
|
+
|
|
470
|
+
configuration_files:
|
|
471
|
+
- file: railway.json
|
|
472
|
+
purpose: Railway deployment config
|
|
473
|
+
created: true
|
|
474
|
+
- file: Dockerfile
|
|
475
|
+
purpose: Container definition
|
|
476
|
+
created: true
|
|
477
|
+
- file: .dockerignore
|
|
478
|
+
purpose: Exclude files from container
|
|
479
|
+
created: true
|
|
480
|
+
- file: .env.example
|
|
481
|
+
purpose: Environment variable template
|
|
482
|
+
created: true
|
|
483
|
+
|
|
484
|
+
environment_variables:
|
|
485
|
+
production:
|
|
486
|
+
- name: NODE_ENV
|
|
487
|
+
value: production
|
|
488
|
+
source: platform
|
|
489
|
+
- name: PORT
|
|
490
|
+
value: "8080"
|
|
491
|
+
source: platform
|
|
492
|
+
- name: DATABASE_URL
|
|
493
|
+
value: "***"
|
|
494
|
+
source: platform_secret
|
|
495
|
+
- name: JWT_SECRET
|
|
496
|
+
value: "***"
|
|
497
|
+
source: platform_secret
|
|
498
|
+
- name: LOG_LEVEL
|
|
499
|
+
value: info
|
|
500
|
+
source: platform
|
|
501
|
+
|
|
502
|
+
staging:
|
|
503
|
+
- name: NODE_ENV
|
|
504
|
+
value: staging
|
|
505
|
+
source: platform
|
|
506
|
+
- name: DATABASE_URL
|
|
507
|
+
value: "***"
|
|
508
|
+
source: platform_secret
|
|
509
|
+
|
|
510
|
+
database_config:
|
|
511
|
+
type: postgresql
|
|
512
|
+
provider: railway
|
|
513
|
+
version: "15"
|
|
514
|
+
connection_pooling: true
|
|
515
|
+
ssl_required: true
|
|
516
|
+
migrations_run: true
|
|
517
|
+
|
|
518
|
+
build_config:
|
|
519
|
+
builder: nixpacks
|
|
520
|
+
node_version: "22"
|
|
521
|
+
install_command: npm ci
|
|
522
|
+
build_command: npm run build
|
|
523
|
+
start_command: npm start
|
|
524
|
+
health_check_path: /health
|
|
525
|
+
|
|
526
|
+
deployment_workflow:
|
|
527
|
+
file: .github/workflows/deploy.yml
|
|
528
|
+
trigger: push_to_main
|
|
529
|
+
environments:
|
|
530
|
+
- staging
|
|
531
|
+
- production
|
|
532
|
+
auto_deploy: true
|
|
533
|
+
rollback_enabled: true
|
|
534
|
+
|
|
535
|
+
domain_config:
|
|
536
|
+
custom_domain: yourdomain.com
|
|
537
|
+
dns_configured: true
|
|
538
|
+
ssl_certificate: auto_provisioned
|
|
539
|
+
force_https: true
|
|
540
|
+
www_redirect: true
|
|
541
|
+
|
|
542
|
+
health_checks:
|
|
543
|
+
endpoint: /health
|
|
544
|
+
interval_seconds: 30
|
|
545
|
+
timeout_seconds: 10
|
|
546
|
+
unhealthy_threshold: 3
|
|
547
|
+
healthy_threshold: 2
|
|
548
|
+
|
|
549
|
+
performance_config:
|
|
550
|
+
auto_scaling: true
|
|
551
|
+
min_instances: 1
|
|
552
|
+
max_instances: 5
|
|
553
|
+
cpu_threshold: 80
|
|
554
|
+
memory_threshold: 85
|
|
555
|
+
|
|
556
|
+
test_deployment:
|
|
557
|
+
staging_deploy: success
|
|
558
|
+
staging_url: "https://staging-your-app.up.railway.app"
|
|
559
|
+
smoke_tests_passed: true
|
|
560
|
+
production_deploy: success
|
|
561
|
+
production_url: "https://your-app.up.railway.app"
|
|
562
|
+
|
|
563
|
+
deployment_scripts:
|
|
564
|
+
- name: deploy.sh
|
|
565
|
+
purpose: Manual deployment script
|
|
566
|
+
location: scripts/deploy.sh
|
|
567
|
+
- name: rollback.sh
|
|
568
|
+
purpose: Rollback to previous version
|
|
569
|
+
location: scripts/rollback.sh
|
|
570
|
+
|
|
571
|
+
documentation_updated:
|
|
572
|
+
- file: README.md
|
|
573
|
+
section: Deployment
|
|
574
|
+
- file: docs/DEPLOYMENT.md
|
|
575
|
+
created: true
|
|
576
|
+
- file: .env.example
|
|
577
|
+
created: true
|
|
578
|
+
|
|
579
|
+
known_issues: []
|
|
580
|
+
|
|
581
|
+
next_steps:
|
|
582
|
+
- Set up monitoring and logging
|
|
583
|
+
- Configure alerts
|
|
584
|
+
- Test auto-scaling
|
|
585
|
+
- Document rollback procedure
|
|
586
|
+
```
|
|
587
|
+
|
|
588
|
+
## Success Criteria
|
|
589
|
+
- Deployment configuration created
|
|
590
|
+
- Application deploys successfully
|
|
591
|
+
- Environment variables configured
|
|
592
|
+
- Database connected (if applicable)
|
|
593
|
+
- Health checks working
|
|
594
|
+
- SSL certificate active
|
|
595
|
+
- Custom domain configured
|
|
596
|
+
- Deployment workflow automated
|
|
597
|
+
- Staging environment available
|
|
598
|
+
- Documentation complete
|