@ekkos/cli 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. package/dist/cache/LocalSessionStore.d.ts +129 -0
  2. package/dist/cache/LocalSessionStore.js +688 -0
  3. package/dist/cache/capture.d.ts +26 -0
  4. package/dist/cache/capture.js +461 -0
  5. package/dist/cache/index.d.ts +7 -0
  6. package/dist/cache/index.js +23 -0
  7. package/dist/cache/types.d.ts +147 -0
  8. package/dist/cache/types.js +40 -0
  9. package/dist/commands/init.d.ts +9 -0
  10. package/dist/commands/init.js +478 -0
  11. package/dist/commands/run.d.ts +12 -0
  12. package/dist/commands/run.js +829 -0
  13. package/dist/commands/setup.d.ts +6 -0
  14. package/dist/commands/setup.js +658 -0
  15. package/dist/commands/status.d.ts +1 -0
  16. package/dist/commands/status.js +109 -0
  17. package/dist/commands/test.d.ts +1 -0
  18. package/dist/commands/test.js +157 -0
  19. package/dist/deploy/agents.d.ts +15 -0
  20. package/dist/deploy/agents.js +72 -0
  21. package/dist/deploy/hooks.d.ts +16 -0
  22. package/dist/deploy/hooks.js +121 -0
  23. package/dist/deploy/index.d.ts +7 -0
  24. package/dist/deploy/index.js +24 -0
  25. package/dist/deploy/instructions.d.ts +12 -0
  26. package/dist/deploy/instructions.js +36 -0
  27. package/dist/deploy/mcp.d.ts +19 -0
  28. package/dist/deploy/mcp.js +109 -0
  29. package/dist/deploy/plugins.d.ts +19 -0
  30. package/dist/deploy/plugins.js +62 -0
  31. package/dist/deploy/settings.d.ts +8 -0
  32. package/dist/deploy/settings.js +84 -0
  33. package/dist/deploy/skills.d.ts +19 -0
  34. package/dist/deploy/skills.js +60 -0
  35. package/dist/index.d.ts +2 -0
  36. package/dist/index.js +71 -0
  37. package/dist/restore/RestoreOrchestrator.d.ts +48 -0
  38. package/dist/restore/RestoreOrchestrator.js +481 -0
  39. package/dist/restore/index.d.ts +4 -0
  40. package/dist/restore/index.js +20 -0
  41. package/dist/utils/platform.d.ts +29 -0
  42. package/dist/utils/platform.js +65 -0
  43. package/dist/utils/session-words.json +119 -0
  44. package/dist/utils/state.d.ts +57 -0
  45. package/dist/utils/state.js +186 -0
  46. package/dist/utils/templates.d.ts +24 -0
  47. package/dist/utils/templates.js +118 -0
  48. package/package.json +48 -0
  49. package/templates/CLAUDE.md +287 -0
  50. package/templates/README.md +378 -0
  51. package/templates/agents/README.md +182 -0
  52. package/templates/agents/code-reviewer.md +166 -0
  53. package/templates/agents/debug-detective.md +169 -0
  54. package/templates/agents/ekkOS_Vercel.md +99 -0
  55. package/templates/agents/extension-manager.md +229 -0
  56. package/templates/agents/git-companion.md +185 -0
  57. package/templates/agents/github-test-agent.md +321 -0
  58. package/templates/agents/railway-manager.md +179 -0
  59. package/templates/claude-plugins/PHASE2_COMPLETION.md +346 -0
  60. package/templates/claude-plugins/PLUGIN_PROPOSALS.md +1776 -0
  61. package/templates/claude-plugins/README.md +587 -0
  62. package/templates/claude-plugins/agents/code-reviewer.json +14 -0
  63. package/templates/claude-plugins/agents/debug-detective.json +15 -0
  64. package/templates/claude-plugins/agents/git-companion.json +14 -0
  65. package/templates/claude-plugins/blog-manager/.claude-plugin/plugin.json +8 -0
  66. package/templates/claude-plugins/blog-manager/commands/blog.md +691 -0
  67. package/templates/claude-plugins/golden-loop-monitor/.claude-plugin/plugin.json +8 -0
  68. package/templates/claude-plugins/golden-loop-monitor/commands/loop-status.md +434 -0
  69. package/templates/claude-plugins/learning-tracker/.claude-plugin/plugin.json +8 -0
  70. package/templates/claude-plugins/learning-tracker/commands/my-patterns.md +282 -0
  71. package/templates/claude-plugins/memory-lens/.claude-plugin/plugin.json +8 -0
  72. package/templates/claude-plugins/memory-lens/commands/memory-search.md +181 -0
  73. package/templates/claude-plugins/pattern-coach/.claude-plugin/plugin.json +8 -0
  74. package/templates/claude-plugins/pattern-coach/commands/forge.md +365 -0
  75. package/templates/claude-plugins/project-schema-validator/.claude-plugin/plugin.json +8 -0
  76. package/templates/claude-plugins/project-schema-validator/commands/validate-schema.md +582 -0
  77. package/templates/claude-plugins-admin/AGENT_TEAM_PROPOSALS.md +819 -0
  78. package/templates/claude-plugins-admin/README.md +446 -0
  79. package/templates/claude-plugins-admin/autonomous-admin-agent/.claude-plugin/plugin.json +8 -0
  80. package/templates/claude-plugins-admin/autonomous-admin-agent/commands/agent.md +595 -0
  81. package/templates/claude-plugins-admin/backend-agent/.claude-plugin/plugin.json +8 -0
  82. package/templates/claude-plugins-admin/backend-agent/commands/backend.md +798 -0
  83. package/templates/claude-plugins-admin/deploy-guardian/.claude-plugin/plugin.json +8 -0
  84. package/templates/claude-plugins-admin/deploy-guardian/commands/deploy.md +554 -0
  85. package/templates/claude-plugins-admin/frontend-agent/.claude-plugin/plugin.json +8 -0
  86. package/templates/claude-plugins-admin/frontend-agent/commands/frontend.md +881 -0
  87. package/templates/claude-plugins-admin/mcp-server-manager/.claude-plugin/plugin.json +8 -0
  88. package/templates/claude-plugins-admin/mcp-server-manager/commands/mcp.md +85 -0
  89. package/templates/claude-plugins-admin/memory-system-monitor/.claude-plugin/plugin.json +8 -0
  90. package/templates/claude-plugins-admin/memory-system-monitor/commands/memory-health.md +569 -0
  91. package/templates/claude-plugins-admin/qa-agent/.claude-plugin/plugin.json +8 -0
  92. package/templates/claude-plugins-admin/qa-agent/commands/qa.md +863 -0
  93. package/templates/claude-plugins-admin/tech-lead-agent/.claude-plugin/plugin.json +8 -0
  94. package/templates/claude-plugins-admin/tech-lead-agent/commands/lead.md +732 -0
  95. package/templates/commands/continue.md +47 -0
  96. package/templates/cursor-hooks/after-agent-response.sh +117 -0
  97. package/templates/cursor-hooks/before-submit-prompt.sh +419 -0
  98. package/templates/cursor-hooks/hooks.json +20 -0
  99. package/templates/cursor-hooks/lib/contract.sh +320 -0
  100. package/templates/cursor-hooks/stop.sh +75 -0
  101. package/templates/cursor-rules/ekkos-memory.md +187 -0
  102. package/templates/hooks/assistant-response.sh +96 -0
  103. package/templates/hooks/hooks.json +28 -0
  104. package/templates/hooks/lib/contract.sh +320 -0
  105. package/templates/hooks/lib/state.sh +158 -0
  106. package/templates/hooks/session-start.ps1 +41 -0
  107. package/templates/hooks/session-start.sh +318 -0
  108. package/templates/hooks/stop.ps1 +16 -0
  109. package/templates/hooks/stop.sh +989 -0
  110. package/templates/hooks/user-prompt-submit.ps1 +174 -0
  111. package/templates/hooks/user-prompt-submit.sh +587 -0
  112. package/templates/hooks-node/lib/state.js +187 -0
  113. package/templates/hooks-node/stop.js +416 -0
  114. package/templates/hooks-node/user-prompt-submit.js +337 -0
  115. package/templates/plan-template.md +306 -0
  116. package/templates/rules/00-hooks-contract.mdc +89 -0
  117. package/templates/rules/30-ekkos-core.mdc +188 -0
  118. package/templates/rules/31-ekkos-messages.mdc +78 -0
  119. package/templates/skills/continue/SKILL.md +169 -0
  120. package/templates/skills/ekkOS_Deep_Recall/Skill.md +282 -0
  121. package/templates/skills/ekkOS_Learn/Skill.md +265 -0
  122. package/templates/skills/ekkOS_Memory_First/Skill.md +206 -0
  123. package/templates/skills/ekkOS_Plan_Assist/Skill.md +302 -0
  124. package/templates/skills/ekkOS_Preferences/Skill.md +247 -0
  125. package/templates/skills/ekkOS_Reflect/Skill.md +257 -0
  126. package/templates/skills/ekkOS_Safety/Skill.md +265 -0
  127. package/templates/skills/ekkOS_Schema/Skill.md +251 -0
  128. package/templates/skills/ekkOS_Summary/Skill.md +257 -0
  129. package/templates/skills/ekkOS_Vault/Skill.md +287 -0
  130. package/templates/skills/permissions/Skill.md +322 -0
  131. package/templates/spec-template.md +159 -0
  132. package/templates/windsurf-hooks/before-submit-prompt.sh +238 -0
  133. package/templates/windsurf-hooks/hooks.json +10 -0
  134. package/templates/windsurf-hooks/lib/contract.sh +320 -0
  135. package/templates/windsurf-rules/ekkos-memory.md +129 -0
@@ -0,0 +1,8 @@
1
+ {
2
+ "name": "ekkos-admin-deploy-guardian",
3
+ "description": "ADMIN ONLY: Deployment safety for ekkOS infrastructure. Manages Vercel projects and Railway services with pre-flight checks.",
4
+ "author": {
5
+ "name": "ekkOS Internal",
6
+ "email": "dev@ekkos.dev"
7
+ }
8
+ }
@@ -0,0 +1,554 @@
1
+ # Deploy Guardian
2
+
3
+ **ADMIN ONLY** - Deployment safety and management for ekkOS infrastructure.
4
+
5
+ ## Overview
6
+
7
+ Deploy Guardian helps the ekkOS team safely deploy to Vercel (13 projects) and Railway (PM2 workers) with pre-flight checks and conflict detection.
8
+
9
+ ## ekkOS Infrastructure Layout
10
+
11
+ ### Vercel Projects (13 Total)
12
+
13
+ | App Directory | Vercel Project | Domain | Purpose |
14
+ |---------------|----------------|---------|---------|
15
+ | `apps/memory` | `memory` | api.ekkos.dev | MCP server (CRITICAL) |
16
+ | `apps/web` | `platform` | platform.ekkos.dev | Main dashboard |
17
+ | `apps/labs` | `labs` | www.ekkoslabs.com | Research site |
18
+ | `apps/docs` | `docs` | docs.ekkos.dev | Documentation |
19
+ | `apps/ekkosca` | `ekkosca` | ekkos.ca | Company site |
20
+ | `apps/marketing` | `marketing` | ekkos.dev | Landing page |
21
+ | `extensions/ekkos-connect` | `ekkos-connect` | ekkos-connect.vercel.app | Extension API |
22
+ | `apps/admin` | `admin` | admin.ekkos.ca | Admin dashboard |
23
+ | `apps/blog` | `blog` | blog.ekkos.dev | Blog |
24
+ | `packages/ekkos-sdk` | `sdk` | sdk-ekkos.vercel.app | SDK docs |
25
+ | - | `echo-web` | echo-web-echoapp-ca.vercel.app | Legacy |
26
+ | - | `comingsoon` | ekkos.dev | Legacy redirect |
27
+ | - | `applepitch` | applepitch.vercel.app | Legacy |
28
+
29
+ ### Railway Services (PM2 Workers)
30
+
31
+ | Service | Purpose | Cron |
32
+ |---------|---------|------|
33
+ | `services/monitor` | Memory metrics | Continuous |
34
+ | `workers/brain-decay` | Pattern cleanup | `0 1 * * *` |
35
+ | `workers/judge-queue` | Episode judging | `0 2 * * *` |
36
+
37
+ ### ⚠️ CRITICAL RULE
38
+
39
+ **NEVER deploy `apps/memory` to Railway!**
40
+ - It's a Vercel project (API server)
41
+ - Railway is ONLY for PM2 workers
42
+ - This mistake breaks the MCP server
43
+
44
+ ## Commands
45
+
46
+ ### `/deploy check`
47
+
48
+ Pre-flight check before deployment.
49
+
50
+ ```bash
51
+ # Check specific project
52
+ /deploy check apps/memory
53
+
54
+ # Check all Vercel projects
55
+ /deploy check --all-vercel
56
+
57
+ # Check Railway services
58
+ /deploy check --railway
59
+ ```
60
+
61
+ **What it checks:**
62
+ - ✅ Target is correct (Vercel vs Railway)
63
+ - ✅ No conflicting deployments in progress
64
+ - ✅ Environment variables are set
65
+ - ✅ Tests passing (if applicable)
66
+ - ✅ No active incidents
67
+ - ✅ Deployment time is safe (not Friday evening)
68
+ - ✅ User directives don't prohibit deploy
69
+ - ✅ Recent git commits look safe
70
+
71
+ **Example Output:**
72
+ ```
73
+ 🛡️ Deploy Guardian: Pre-Flight Check
74
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
75
+
76
+ Project: apps/memory → Vercel (api.ekkos.dev)
77
+ Target: Production
78
+
79
+ ───────────────────────────────────────────────────────────────────
80
+ ✅ Pre-Flight Checks
81
+
82
+ ✅ Correct target (Vercel, not Railway)
83
+ ✅ No conflicting deployments
84
+ ✅ Environment variables configured
85
+ ✅ Recent commits look safe (3 commits since last deploy)
86
+ ✅ No active incidents
87
+ ✅ Safe deployment time (Monday 2 PM)
88
+
89
+ ───────────────────────────────────────────────────────────────────
90
+ 📋 Recent Changes (Since Last Deploy)
91
+
92
+ 1. fix: Handle null user in auth middleware (safe)
93
+ 2. feat: Add rate limiting to search endpoint (safe)
94
+ 3. chore: Update dependencies (safe)
95
+
96
+ Impact: Low risk
97
+
98
+ ───────────────────────────────────────────────────────────────────
99
+ 🎯 Deployment Command
100
+
101
+ Ready to deploy? Run:
102
+
103
+ cd /Volumes/MacMiniPort/DEV/EKKOS/apps/memory
104
+ vercel deploy --prod
105
+
106
+ Or use: /deploy execute apps/memory
107
+
108
+ ───────────────────────────────────────────────────────────────────
109
+ ✅ SAFE TO PROCEED
110
+
111
+ All checks passed. Deploy when ready.
112
+ ```
113
+
114
+ **Example - Issues Detected:**
115
+ ```
116
+ 🛡️ Deploy Guardian: Pre-Flight Check
117
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
118
+
119
+ Project: apps/memory → Vercel (api.ekkos.dev)
120
+ Target: Production
121
+
122
+ ───────────────────────────────────────────────────────────────────
123
+ 🚨 ISSUES DETECTED
124
+
125
+ ❌ Wrong target!
126
+ You're trying to deploy apps/memory to Railway
127
+ → apps/memory is a Vercel project (MCP server)
128
+ → Railway is ONLY for PM2 workers
129
+ → This will break the MCP server!
130
+
131
+ Correct command:
132
+ cd apps/memory && vercel deploy --prod
133
+
134
+ ❌ Tests failing
135
+ • test/api/search.test.ts - FAILED
136
+ • test/auth/middleware.test.ts - FAILED
137
+
138
+ Fix tests before deploying!
139
+
140
+ ⚠️ Dangerous deployment time
141
+ Current: Friday, 6:45 PM
142
+ Risk: Weekend incident with no team available
143
+
144
+ User directive: "Never deploy to production on Friday after 3 PM"
145
+
146
+ Recommendation: Wait until Monday
147
+
148
+ ───────────────────────────────────────────────────────────────────
149
+ 🔧 Required Actions
150
+
151
+ [ ] 1. Change deploy target to Vercel (NOT Railway)
152
+ [ ] 2. Fix 2 failing tests
153
+ [ ] 3. Wait until Monday for safer deploy time
154
+
155
+ ───────────────────────────────────────────────────────────────────
156
+ 🚨 DO NOT PROCEED
157
+
158
+ Fix issues above before deploying.
159
+ ```
160
+
161
+ ### `/deploy execute`
162
+
163
+ Execute deployment with safety confirmation.
164
+
165
+ ```bash
166
+ # Deploy specific project
167
+ /deploy execute apps/memory
168
+
169
+ # Deploy with reason
170
+ /deploy execute apps/memory --reason "Critical security fix"
171
+
172
+ # Emergency deploy (skip checks)
173
+ /deploy execute apps/memory --emergency "API down"
174
+ ```
175
+
176
+ **What it does:**
177
+ 1. Runs pre-flight check
178
+ 2. Shows deployment plan
179
+ 3. Asks for confirmation
180
+ 4. Executes deployment
181
+ 5. Monitors deployment status
182
+ 6. Reports success/failure
183
+
184
+ **Example:**
185
+ ```bash
186
+ /deploy execute apps/memory
187
+
188
+ 🛡️ Deploy Guardian: Deployment Plan
189
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
190
+
191
+ Project: apps/memory
192
+ Target: Vercel Production (api.ekkos.dev)
193
+ Impact: CRITICAL (MCP server)
194
+
195
+ Changes:
196
+ • 3 commits since last deploy
197
+ • Low risk changes
198
+ • No breaking changes detected
199
+
200
+ Proceed? (yes/no/abort)
201
+ > yes
202
+
203
+ 🚀 Deploying...
204
+
205
+ [████████░░░░░░░░░░░░] 40% - Building...
206
+ [████████████████░░░░] 80% - Deploying...
207
+ [████████████████████] 100% - Complete!
208
+
209
+ ✅ Deployment Successful!
210
+
211
+ URL: https://api.ekkos.dev
212
+ Deployment ID: dpl_abc123xyz
213
+ Time: 45 seconds
214
+
215
+ 🧪 Running smoke tests...
216
+
217
+ ✅ Health check passed
218
+ ✅ MCP tools responding
219
+ ✅ Authentication working
220
+
221
+ ───────────────────────────────────────────────────────────────────
222
+ 📊 Post-Deploy Actions
223
+
224
+ • Monitor for 30 minutes: /deploy monitor apps/memory
225
+ • Rollback if needed: /deploy rollback apps/memory
226
+ • View logs: /deploy logs apps/memory
227
+ ```
228
+
229
+ ### `/deploy list`
230
+
231
+ List all projects and their deployment status.
232
+
233
+ ```bash
234
+ # List all projects
235
+ /deploy list
236
+
237
+ # List only Vercel
238
+ /deploy list --vercel
239
+
240
+ # List only Railway
241
+ /deploy list --railway
242
+
243
+ # Show recent deployments
244
+ /deploy list --recent
245
+ ```
246
+
247
+ **Example Output:**
248
+ ```
249
+ 🛡️ Deploy Guardian: Infrastructure Status
250
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
251
+
252
+ Vercel Projects (13):
253
+
254
+ 🔴 CRITICAL
255
+ • apps/memory (api.ekkos.dev)
256
+ Status: ✅ Healthy
257
+ Last Deploy: 2 hours ago
258
+ Version: v2.45.1
259
+
260
+ 🟡 HIGH PRIORITY
261
+ • apps/web (platform.ekkos.dev)
262
+ Status: ✅ Healthy
263
+ Last Deploy: 1 day ago
264
+ Version: v1.89.2
265
+
266
+ • apps/labs (www.ekkoslabs.com)
267
+ Status: ✅ Healthy
268
+ Last Deploy: 3 days ago
269
+ Version: v0.12.5
270
+
271
+ 🟢 STANDARD
272
+ • apps/docs (docs.ekkos.dev)
273
+ Status: ✅ Healthy
274
+ Last Deploy: 1 week ago
275
+
276
+ • apps/ekkosca (ekkos.ca)
277
+ Status: ✅ Healthy
278
+ Last Deploy: 2 weeks ago
279
+
280
+ • apps/marketing (ekkos.dev)
281
+ Status: ✅ Healthy
282
+ Last Deploy: 1 week ago
283
+
284
+ • extensions/ekkos-connect (ekkos-connect.vercel.app)
285
+ Status: ✅ Healthy
286
+ Last Deploy: 3 days ago
287
+
288
+ • apps/admin (admin.ekkos.ca)
289
+ Status: ⚠️ Warning (1 error in logs)
290
+ Last Deploy: 5 days ago
291
+
292
+ • apps/blog (blog.ekkos.dev)
293
+ Status: ✅ Healthy
294
+ Last Deploy: 2 weeks ago
295
+
296
+ • packages/ekkos-sdk (sdk-ekkos.vercel.app)
297
+ Status: ✅ Healthy
298
+ Last Deploy: 1 month ago
299
+
300
+ [+3 legacy projects...]
301
+
302
+ ───────────────────────────────────────────────────────────────────
303
+ Railway Services (3):
304
+
305
+ • services/monitor
306
+ Status: ✅ Running
307
+ Uptime: 15 days
308
+ Memory: 234 MB / 512 MB
309
+
310
+ • workers/brain-decay
311
+ Status: ✅ Running
312
+ Last Run: 1 hour ago (success)
313
+ Next Run: Tomorrow 1 AM
314
+
315
+ • workers/judge-queue
316
+ Status: ⚠️ Stalled
317
+ Last Run: 6 hours ago (failed)
318
+ Error: Database connection timeout
319
+
320
+ ───────────────────────────────────────────────────────────────────
321
+ ⚠️ Action Items
322
+
323
+ 1. Check apps/admin logs: /deploy logs apps/admin
324
+ 2. Investigate judge-queue failure: /deploy logs workers/judge-queue --railway
325
+ 3. Consider deploying if you have pending changes
326
+ ```
327
+
328
+ ### `/deploy logs`
329
+
330
+ View deployment logs and errors.
331
+
332
+ ```bash
333
+ # View logs for project
334
+ /deploy logs apps/memory
335
+
336
+ # View recent errors
337
+ /deploy logs apps/memory --errors
338
+
339
+ # View Railway worker logs
340
+ /deploy logs workers/judge-queue --railway
341
+
342
+ # Tail logs in real-time
343
+ /deploy logs apps/memory --follow
344
+ ```
345
+
346
+ ### `/deploy rollback`
347
+
348
+ Rollback to previous deployment.
349
+
350
+ ```bash
351
+ # Rollback specific project
352
+ /deploy rollback apps/memory
353
+
354
+ # Rollback to specific version
355
+ /deploy rollback apps/memory --to v2.45.0
356
+
357
+ # Emergency rollback (skip confirmations)
358
+ /deploy rollback apps/memory --emergency
359
+ ```
360
+
361
+ **Example:**
362
+ ```bash
363
+ /deploy rollback apps/memory
364
+
365
+ 🛡️ Deploy Guardian: Rollback Confirmation
366
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
367
+
368
+ Project: apps/memory (api.ekkos.dev)
369
+
370
+ Current: v2.45.1 (deployed 10 minutes ago)
371
+
372
+ Previous: v2.45.0 (deployed 2 hours ago)
373
+
374
+ Reason for rollback:
375
+ > API returning 500 errors
376
+
377
+ Confirm rollback? (yes/no)
378
+ > yes
379
+
380
+ 🔄 Rolling back...
381
+
382
+ ✅ Rollback complete!
383
+
384
+ Previous deployment (v2.45.0) is now live.
385
+ Deployment ID: dpl_prev_xyz
386
+
387
+ Monitor: /deploy monitor apps/memory
388
+ ```
389
+
390
+ ### `/deploy monitor`
391
+
392
+ Monitor deployment health in real-time.
393
+
394
+ ```bash
395
+ # Monitor specific project
396
+ /deploy monitor apps/memory
397
+
398
+ # Monitor for specific duration
399
+ /deploy monitor apps/memory --duration 30m
400
+
401
+ # Monitor with alerts
402
+ /deploy monitor apps/memory --alert-on-error
403
+ ```
404
+
405
+ ## MCP Tools Used
406
+
407
+ - `ekkOS_Conflict` - Check for deployment conflicts with user directives
408
+ - `ekkOS_Search` - Find past deployment incidents
409
+ - `ekkOS_Recall` - Recent infrastructure changes
410
+ - `ekkOS_Directive` - Deployment safety rules
411
+ - `ekkOS_Summary` - Recent MCP activity
412
+ - `Bash` - Execute deployment commands
413
+
414
+ ## Safety Rules
415
+
416
+ ### Automatic Checks
417
+
418
+ 1. **Target Validation**
419
+ - ❌ NEVER deploy apps/memory to Railway
420
+ - ✅ Vercel for all apps/*
421
+ - ✅ Railway for workers/* and services/*
422
+
423
+ 2. **Time-Based**
424
+ - ⚠️ Warn if Friday after 3 PM
425
+ - ⚠️ Warn if outside business hours
426
+ - ✅ Best time: Monday-Thursday, 10 AM - 3 PM
427
+
428
+ 3. **Dependency Checks**
429
+ - ✅ Tests passing (if applicable)
430
+ - ✅ No active incidents
431
+ - ✅ Dependencies up to date
432
+ - ✅ No conflicting deployments
433
+
434
+ 4. **Impact Assessment**
435
+ - 🔴 CRITICAL: apps/memory (MCP server)
436
+ - 🟡 HIGH: apps/web, apps/labs
437
+ - 🟢 STANDARD: Everything else
438
+
439
+ ### Manual Overrides
440
+
441
+ Emergency deployments can skip checks:
442
+ ```bash
443
+ /deploy execute apps/memory --emergency "API down, critical fix"
444
+ ```
445
+
446
+ **Use emergency mode ONLY for:**
447
+ - Production outages
448
+ - Security vulnerabilities
449
+ - Data loss prevention
450
+
451
+ ## Common Workflows
452
+
453
+ ### Deploy MCP Server (apps/memory)
454
+ ```bash
455
+ # 1. Pre-flight check
456
+ /deploy check apps/memory
457
+
458
+ # 2. Review changes
459
+ git log --oneline -5
460
+
461
+ # 3. Deploy
462
+ /deploy execute apps/memory
463
+
464
+ # 4. Monitor
465
+ /deploy monitor apps/memory --duration 30m
466
+ ```
467
+
468
+ ### Deploy All Vercel Projects
469
+ ```bash
470
+ # Check all projects
471
+ /deploy check --all-vercel
472
+
473
+ # Deploy each one
474
+ /deploy execute apps/memory
475
+ /deploy execute apps/web
476
+ /deploy execute apps/labs
477
+ # ... etc
478
+ ```
479
+
480
+ ### Update Railway Worker
481
+ ```bash
482
+ # Railway services deploy via git push
483
+ git push railway main
484
+
485
+ # Then monitor
486
+ /deploy logs workers/judge-queue --railway --follow
487
+ ```
488
+
489
+ ### Emergency Rollback
490
+ ```bash
491
+ # If deployment breaks production
492
+ /deploy rollback apps/memory --emergency
493
+
494
+ # Monitor after rollback
495
+ /deploy monitor apps/memory
496
+ ```
497
+
498
+ ## Integration with User Directives
499
+
500
+ Deploy Guardian respects ekkOS directives:
501
+
502
+ - **NEVER**: "Never deploy to production on Friday after 3 PM"
503
+ - **MUST**: "Must run tests before deploying"
504
+ - **PREFER**: "Prefer deploying during business hours"
505
+ - **AVOID**: "Avoid deploying multiple projects simultaneously"
506
+
507
+ Create deployment rules:
508
+ ```bash
509
+ # Via ekkOS MCP
510
+ ekkOS_Directive({
511
+ type: "NEVER",
512
+ rule: "deploy apps/memory to Railway",
513
+ reason: "Railway is for workers only, Vercel is for apps"
514
+ })
515
+ ```
516
+
517
+ ## Troubleshooting
518
+
519
+ ### "Wrong target" Error
520
+
521
+ **Problem:** Trying to deploy apps/* to Railway
522
+ **Fix:** Use Vercel instead
523
+ ```bash
524
+ cd apps/memory && vercel deploy --prod
525
+ ```
526
+
527
+ ### Deployment Stalled
528
+
529
+ **Problem:** Deployment stuck at building
530
+ **Fix:**
531
+ 1. Check Vercel dashboard
532
+ 2. View build logs: /deploy logs apps/memory
533
+ 3. Cancel and retry: vercel deploy --prod --force
534
+
535
+ ### Tests Failing
536
+
537
+ **Problem:** Pre-flight check fails on tests
538
+ **Fix:**
539
+ 1. Run tests locally: npm test
540
+ 2. Fix failing tests
541
+ 3. Commit fixes
542
+ 4. Try deploy again
543
+
544
+ ### Environment Variables Missing
545
+
546
+ **Problem:** "Environment variable not set"
547
+ **Fix:**
548
+ 1. Check .env.local
549
+ 2. Set via Vercel dashboard
550
+ 3. Or: vercel env add VARIABLE_NAME
551
+
552
+ ---
553
+
554
+ **Deploy safely. Monitor closely. Rollback quickly.** 🛡️
@@ -0,0 +1,8 @@
1
+ {
2
+ "name": "ekkos-admin-frontend",
3
+ "description": "ADMIN ONLY: AI Frontend Developer specialized in React, Next.js, TypeScript, and Tailwind CSS. Builds UI components, pages, and handles state management.",
4
+ "author": {
5
+ "name": "ekkOS Internal",
6
+ "email": "dev@ekkos.dev"
7
+ }
8
+ }