@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.
- package/dist/cache/LocalSessionStore.d.ts +129 -0
- package/dist/cache/LocalSessionStore.js +688 -0
- package/dist/cache/capture.d.ts +26 -0
- package/dist/cache/capture.js +461 -0
- package/dist/cache/index.d.ts +7 -0
- package/dist/cache/index.js +23 -0
- package/dist/cache/types.d.ts +147 -0
- package/dist/cache/types.js +40 -0
- package/dist/commands/init.d.ts +9 -0
- package/dist/commands/init.js +478 -0
- package/dist/commands/run.d.ts +12 -0
- package/dist/commands/run.js +829 -0
- package/dist/commands/setup.d.ts +6 -0
- package/dist/commands/setup.js +658 -0
- package/dist/commands/status.d.ts +1 -0
- package/dist/commands/status.js +109 -0
- package/dist/commands/test.d.ts +1 -0
- package/dist/commands/test.js +157 -0
- package/dist/deploy/agents.d.ts +15 -0
- package/dist/deploy/agents.js +72 -0
- package/dist/deploy/hooks.d.ts +16 -0
- package/dist/deploy/hooks.js +121 -0
- package/dist/deploy/index.d.ts +7 -0
- package/dist/deploy/index.js +24 -0
- package/dist/deploy/instructions.d.ts +12 -0
- package/dist/deploy/instructions.js +36 -0
- package/dist/deploy/mcp.d.ts +19 -0
- package/dist/deploy/mcp.js +109 -0
- package/dist/deploy/plugins.d.ts +19 -0
- package/dist/deploy/plugins.js +62 -0
- package/dist/deploy/settings.d.ts +8 -0
- package/dist/deploy/settings.js +84 -0
- package/dist/deploy/skills.d.ts +19 -0
- package/dist/deploy/skills.js +60 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +71 -0
- package/dist/restore/RestoreOrchestrator.d.ts +48 -0
- package/dist/restore/RestoreOrchestrator.js +481 -0
- package/dist/restore/index.d.ts +4 -0
- package/dist/restore/index.js +20 -0
- package/dist/utils/platform.d.ts +29 -0
- package/dist/utils/platform.js +65 -0
- package/dist/utils/session-words.json +119 -0
- package/dist/utils/state.d.ts +57 -0
- package/dist/utils/state.js +186 -0
- package/dist/utils/templates.d.ts +24 -0
- package/dist/utils/templates.js +118 -0
- package/package.json +48 -0
- package/templates/CLAUDE.md +287 -0
- package/templates/README.md +378 -0
- package/templates/agents/README.md +182 -0
- package/templates/agents/code-reviewer.md +166 -0
- package/templates/agents/debug-detective.md +169 -0
- package/templates/agents/ekkOS_Vercel.md +99 -0
- package/templates/agents/extension-manager.md +229 -0
- package/templates/agents/git-companion.md +185 -0
- package/templates/agents/github-test-agent.md +321 -0
- package/templates/agents/railway-manager.md +179 -0
- package/templates/claude-plugins/PHASE2_COMPLETION.md +346 -0
- package/templates/claude-plugins/PLUGIN_PROPOSALS.md +1776 -0
- package/templates/claude-plugins/README.md +587 -0
- package/templates/claude-plugins/agents/code-reviewer.json +14 -0
- package/templates/claude-plugins/agents/debug-detective.json +15 -0
- package/templates/claude-plugins/agents/git-companion.json +14 -0
- package/templates/claude-plugins/blog-manager/.claude-plugin/plugin.json +8 -0
- package/templates/claude-plugins/blog-manager/commands/blog.md +691 -0
- package/templates/claude-plugins/golden-loop-monitor/.claude-plugin/plugin.json +8 -0
- package/templates/claude-plugins/golden-loop-monitor/commands/loop-status.md +434 -0
- package/templates/claude-plugins/learning-tracker/.claude-plugin/plugin.json +8 -0
- package/templates/claude-plugins/learning-tracker/commands/my-patterns.md +282 -0
- package/templates/claude-plugins/memory-lens/.claude-plugin/plugin.json +8 -0
- package/templates/claude-plugins/memory-lens/commands/memory-search.md +181 -0
- package/templates/claude-plugins/pattern-coach/.claude-plugin/plugin.json +8 -0
- package/templates/claude-plugins/pattern-coach/commands/forge.md +365 -0
- package/templates/claude-plugins/project-schema-validator/.claude-plugin/plugin.json +8 -0
- package/templates/claude-plugins/project-schema-validator/commands/validate-schema.md +582 -0
- package/templates/claude-plugins-admin/AGENT_TEAM_PROPOSALS.md +819 -0
- package/templates/claude-plugins-admin/README.md +446 -0
- package/templates/claude-plugins-admin/autonomous-admin-agent/.claude-plugin/plugin.json +8 -0
- package/templates/claude-plugins-admin/autonomous-admin-agent/commands/agent.md +595 -0
- package/templates/claude-plugins-admin/backend-agent/.claude-plugin/plugin.json +8 -0
- package/templates/claude-plugins-admin/backend-agent/commands/backend.md +798 -0
- package/templates/claude-plugins-admin/deploy-guardian/.claude-plugin/plugin.json +8 -0
- package/templates/claude-plugins-admin/deploy-guardian/commands/deploy.md +554 -0
- package/templates/claude-plugins-admin/frontend-agent/.claude-plugin/plugin.json +8 -0
- package/templates/claude-plugins-admin/frontend-agent/commands/frontend.md +881 -0
- package/templates/claude-plugins-admin/mcp-server-manager/.claude-plugin/plugin.json +8 -0
- package/templates/claude-plugins-admin/mcp-server-manager/commands/mcp.md +85 -0
- package/templates/claude-plugins-admin/memory-system-monitor/.claude-plugin/plugin.json +8 -0
- package/templates/claude-plugins-admin/memory-system-monitor/commands/memory-health.md +569 -0
- package/templates/claude-plugins-admin/qa-agent/.claude-plugin/plugin.json +8 -0
- package/templates/claude-plugins-admin/qa-agent/commands/qa.md +863 -0
- package/templates/claude-plugins-admin/tech-lead-agent/.claude-plugin/plugin.json +8 -0
- package/templates/claude-plugins-admin/tech-lead-agent/commands/lead.md +732 -0
- package/templates/commands/continue.md +47 -0
- package/templates/cursor-hooks/after-agent-response.sh +117 -0
- package/templates/cursor-hooks/before-submit-prompt.sh +419 -0
- package/templates/cursor-hooks/hooks.json +20 -0
- package/templates/cursor-hooks/lib/contract.sh +320 -0
- package/templates/cursor-hooks/stop.sh +75 -0
- package/templates/cursor-rules/ekkos-memory.md +187 -0
- package/templates/hooks/assistant-response.sh +96 -0
- package/templates/hooks/hooks.json +28 -0
- package/templates/hooks/lib/contract.sh +320 -0
- package/templates/hooks/lib/state.sh +158 -0
- package/templates/hooks/session-start.ps1 +41 -0
- package/templates/hooks/session-start.sh +318 -0
- package/templates/hooks/stop.ps1 +16 -0
- package/templates/hooks/stop.sh +989 -0
- package/templates/hooks/user-prompt-submit.ps1 +174 -0
- package/templates/hooks/user-prompt-submit.sh +587 -0
- package/templates/hooks-node/lib/state.js +187 -0
- package/templates/hooks-node/stop.js +416 -0
- package/templates/hooks-node/user-prompt-submit.js +337 -0
- package/templates/plan-template.md +306 -0
- package/templates/rules/00-hooks-contract.mdc +89 -0
- package/templates/rules/30-ekkos-core.mdc +188 -0
- package/templates/rules/31-ekkos-messages.mdc +78 -0
- package/templates/skills/continue/SKILL.md +169 -0
- package/templates/skills/ekkOS_Deep_Recall/Skill.md +282 -0
- package/templates/skills/ekkOS_Learn/Skill.md +265 -0
- package/templates/skills/ekkOS_Memory_First/Skill.md +206 -0
- package/templates/skills/ekkOS_Plan_Assist/Skill.md +302 -0
- package/templates/skills/ekkOS_Preferences/Skill.md +247 -0
- package/templates/skills/ekkOS_Reflect/Skill.md +257 -0
- package/templates/skills/ekkOS_Safety/Skill.md +265 -0
- package/templates/skills/ekkOS_Schema/Skill.md +251 -0
- package/templates/skills/ekkOS_Summary/Skill.md +257 -0
- package/templates/skills/ekkOS_Vault/Skill.md +287 -0
- package/templates/skills/permissions/Skill.md +322 -0
- package/templates/spec-template.md +159 -0
- package/templates/windsurf-hooks/before-submit-prompt.sh +238 -0
- package/templates/windsurf-hooks/hooks.json +10 -0
- package/templates/windsurf-hooks/lib/contract.sh +320 -0
- package/templates/windsurf-rules/ekkos-memory.md +129 -0
|
@@ -0,0 +1,595 @@
|
|
|
1
|
+
# Autonomous Admin Agent
|
|
2
|
+
|
|
3
|
+
**ADMIN ONLY** - Intelligent agent that monitors ekkOS infrastructure 24/7 and automatically uses admin plugins to maintain system health.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
The Autonomous Admin Agent is your AI DevOps engineer. It continuously monitors all ekkOS services and intelligently decides when to use admin plugins to:
|
|
8
|
+
- Prevent issues before they happen
|
|
9
|
+
- Fix problems automatically
|
|
10
|
+
- Alert you only when human intervention is needed
|
|
11
|
+
- Optimize performance proactively
|
|
12
|
+
|
|
13
|
+
## Architecture
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
┌─────────────────────────────────────────────────────┐
|
|
17
|
+
│ Autonomous Admin Agent │
|
|
18
|
+
│ │
|
|
19
|
+
│ 🧠 Intelligent Decision Making │
|
|
20
|
+
│ ├─ Monitor all services continuously │
|
|
21
|
+
│ ├─ Detect anomalies and issues │
|
|
22
|
+
│ ├─ Decide which plugin to use │
|
|
23
|
+
│ ├─ Take preventive actions │
|
|
24
|
+
│ └─ Alert admin when needed │
|
|
25
|
+
└──────────────────┬──────────────────────────────────┘
|
|
26
|
+
│
|
|
27
|
+
Uses admin plugins as tools
|
|
28
|
+
│
|
|
29
|
+
┌──────────────┼──────────────┬────────────┐
|
|
30
|
+
│ │ │ │
|
|
31
|
+
▼ ▼ ▼ ▼
|
|
32
|
+
┌─────────┐ ┌──────────┐ ┌──────────┐ ┌────────┐
|
|
33
|
+
│ Deploy │ │ Memory │ │ MCP │ │Database│
|
|
34
|
+
│Guardian │ │ Monitor │ │ Manager │ │Manager │
|
|
35
|
+
└─────────┘ └──────────┘ └──────────┘ └────────┘
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Commands
|
|
39
|
+
|
|
40
|
+
### `/agent start`
|
|
41
|
+
|
|
42
|
+
Start the autonomous agent to monitor infrastructure.
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
# Start monitoring
|
|
46
|
+
/agent start
|
|
47
|
+
|
|
48
|
+
# Start with specific focus
|
|
49
|
+
/agent start --focus deployment
|
|
50
|
+
|
|
51
|
+
# Start in verbose mode
|
|
52
|
+
/agent start --verbose
|
|
53
|
+
|
|
54
|
+
# Background monitoring
|
|
55
|
+
/agent start --background
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
**What happens:**
|
|
59
|
+
```
|
|
60
|
+
🤖 Autonomous Admin Agent Starting...
|
|
61
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
62
|
+
|
|
63
|
+
Initializing monitoring systems...
|
|
64
|
+
|
|
65
|
+
✅ Connected to Vercel API (13 projects)
|
|
66
|
+
✅ Connected to Railway API (3 services)
|
|
67
|
+
✅ Connected to Supabase (ekkOS database)
|
|
68
|
+
✅ Connected to MCP server (api.ekkos.dev)
|
|
69
|
+
|
|
70
|
+
Agent Status: 🟢 Active
|
|
71
|
+
Monitoring: 24/7 continuous
|
|
72
|
+
Check Interval: Every 5 minutes
|
|
73
|
+
Alert Mode: Critical only (will escalate)
|
|
74
|
+
|
|
75
|
+
───────────────────────────────────────────────────────────────────
|
|
76
|
+
🎯 Monitoring Scope
|
|
77
|
+
|
|
78
|
+
Deployments:
|
|
79
|
+
✅ 13 Vercel projects
|
|
80
|
+
✅ 3 Railway services
|
|
81
|
+
✅ Pre-deployment checks
|
|
82
|
+
✅ Post-deployment monitoring
|
|
83
|
+
|
|
84
|
+
Memory System:
|
|
85
|
+
✅ All 11 layers
|
|
86
|
+
✅ Data integrity
|
|
87
|
+
✅ Performance metrics
|
|
88
|
+
✅ Worker health (PM2)
|
|
89
|
+
|
|
90
|
+
MCP Server:
|
|
91
|
+
✅ 31 tools health
|
|
92
|
+
✅ API response times
|
|
93
|
+
✅ Error rates
|
|
94
|
+
✅ Connection stability
|
|
95
|
+
|
|
96
|
+
Infrastructure:
|
|
97
|
+
✅ Database performance
|
|
98
|
+
✅ Storage usage
|
|
99
|
+
✅ API rate limits
|
|
100
|
+
✅ Service uptime
|
|
101
|
+
|
|
102
|
+
───────────────────────────────────────────────────────────────────
|
|
103
|
+
🤖 Agent Capabilities
|
|
104
|
+
|
|
105
|
+
I will automatically:
|
|
106
|
+
• Run /deploy check before any deployment
|
|
107
|
+
• Execute /memory-health every hour
|
|
108
|
+
• Monitor /mcp status every 5 minutes
|
|
109
|
+
• Optimize database when needed
|
|
110
|
+
• Alert you for critical issues
|
|
111
|
+
• Take preventive actions
|
|
112
|
+
• Learn from past incidents
|
|
113
|
+
|
|
114
|
+
I will NEVER:
|
|
115
|
+
• Deploy without confirmation (unless emergency)
|
|
116
|
+
• Delete data without approval
|
|
117
|
+
• Override security rules
|
|
118
|
+
• Take risky actions silently
|
|
119
|
+
|
|
120
|
+
───────────────────────────────────────────────────────────────────
|
|
121
|
+
📊 Current Status
|
|
122
|
+
|
|
123
|
+
All systems healthy ✅
|
|
124
|
+
|
|
125
|
+
Recent Actions (last hour):
|
|
126
|
+
• 10:15 AM - Ran /memory-health (all healthy)
|
|
127
|
+
• 10:30 AM - Checked MCP status (31/31 tools OK)
|
|
128
|
+
• 10:45 AM - Optimized pattern indexes (+12% speed)
|
|
129
|
+
|
|
130
|
+
Next scheduled checks:
|
|
131
|
+
• 11:00 AM - Memory health check
|
|
132
|
+
• 11:05 AM - MCP status check
|
|
133
|
+
• 11:15 AM - Deployment status review
|
|
134
|
+
|
|
135
|
+
───────────────────────────────────────────────────────────────────
|
|
136
|
+
✅ Agent Running
|
|
137
|
+
|
|
138
|
+
Monitoring in background. I'll alert you if I detect issues.
|
|
139
|
+
|
|
140
|
+
Stop: /agent stop
|
|
141
|
+
Status: /agent status
|
|
142
|
+
Logs: /agent logs
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### `/agent status`
|
|
146
|
+
|
|
147
|
+
Check what the agent is currently doing.
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
/agent status
|
|
151
|
+
|
|
152
|
+
🤖 Autonomous Admin Agent Status
|
|
153
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
154
|
+
|
|
155
|
+
Status: 🟢 Active (running for 3 days, 15 hours)
|
|
156
|
+
|
|
157
|
+
Current Activity:
|
|
158
|
+
🔍 Monitoring deployment queue
|
|
159
|
+
🧠 Analyzing memory layer performance
|
|
160
|
+
⏰ Next health check in 2 minutes
|
|
161
|
+
|
|
162
|
+
───────────────────────────────────────────────────────────────────
|
|
163
|
+
📊 Today's Activity
|
|
164
|
+
|
|
165
|
+
Checks Performed: 287
|
|
166
|
+
Issues Detected: 3
|
|
167
|
+
Issues Resolved: 2
|
|
168
|
+
Issues Escalated: 1 (requires your attention)
|
|
169
|
+
|
|
170
|
+
Actions Taken:
|
|
171
|
+
• Ran /memory-optimize (freed 234 MB)
|
|
172
|
+
• Restarted stalled Railway worker
|
|
173
|
+
• Archived 45 stale patterns
|
|
174
|
+
|
|
175
|
+
Prevented Issues:
|
|
176
|
+
• Blocked Friday evening deployment (safety rule)
|
|
177
|
+
• Detected failing tests before deploy
|
|
178
|
+
• Caught memory leak early (fixed proactively)
|
|
179
|
+
|
|
180
|
+
───────────────────────────────────────────────────────────────────
|
|
181
|
+
⚠️ Pending Your Attention
|
|
182
|
+
|
|
183
|
+
1 issue requires human decision:
|
|
184
|
+
|
|
185
|
+
🔴 apps/admin deployment pending
|
|
186
|
+
• 2 failing tests detected
|
|
187
|
+
• Deploy requested by user
|
|
188
|
+
• Agent blocked (safety rule)
|
|
189
|
+
|
|
190
|
+
Options:
|
|
191
|
+
- Fix tests: Fix the 2 failing tests
|
|
192
|
+
- Override: /agent approve-deploy apps/admin --reason "..."
|
|
193
|
+
- Cancel: /agent cancel-deploy apps/admin
|
|
194
|
+
|
|
195
|
+
───────────────────────────────────────────────────────────────────
|
|
196
|
+
📈 Performance Impact
|
|
197
|
+
|
|
198
|
+
Since agent started (3 days ago):
|
|
199
|
+
• Prevented incidents: 5
|
|
200
|
+
• Reduced manual checks: 287 → 3
|
|
201
|
+
• Optimization savings: 1.2 GB storage freed
|
|
202
|
+
• Downtime prevented: ~4 hours estimated
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
### `/agent stop`
|
|
206
|
+
|
|
207
|
+
Stop autonomous monitoring (manual mode).
|
|
208
|
+
|
|
209
|
+
```bash
|
|
210
|
+
/agent stop
|
|
211
|
+
|
|
212
|
+
🤖 Stopping Autonomous Admin Agent...
|
|
213
|
+
|
|
214
|
+
✅ Agent stopped.
|
|
215
|
+
|
|
216
|
+
You're now in manual mode. You can still use admin plugins manually:
|
|
217
|
+
- /deploy check
|
|
218
|
+
- /memory-health
|
|
219
|
+
- /mcp status
|
|
220
|
+
|
|
221
|
+
Restart: /agent start
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
### `/agent logs`
|
|
225
|
+
|
|
226
|
+
View agent's decision log and actions taken.
|
|
227
|
+
|
|
228
|
+
```bash
|
|
229
|
+
/agent logs
|
|
230
|
+
|
|
231
|
+
# Last 24 hours
|
|
232
|
+
/agent logs --24h
|
|
233
|
+
|
|
234
|
+
# Show only actions
|
|
235
|
+
/agent logs --actions-only
|
|
236
|
+
|
|
237
|
+
# Show only alerts
|
|
238
|
+
/agent logs --alerts-only
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
**Example:**
|
|
242
|
+
```
|
|
243
|
+
🤖 Agent Activity Log (Last 24 Hours)
|
|
244
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
245
|
+
|
|
246
|
+
10:45 AM - 🔍 CHECK
|
|
247
|
+
Ran: /memory-health
|
|
248
|
+
Result: All layers healthy
|
|
249
|
+
Decision: No action needed
|
|
250
|
+
|
|
251
|
+
10:47 AM - ⚠️ ISSUE DETECTED
|
|
252
|
+
Problem: Worker judge-queue stalled (6h no activity)
|
|
253
|
+
Analysis: Database connection timeout
|
|
254
|
+
Decision: Restart worker
|
|
255
|
+
|
|
256
|
+
10:48 AM - 🔧 ACTION TAKEN
|
|
257
|
+
Executed: pm2 restart judge-queue
|
|
258
|
+
Result: ✅ Worker restarted successfully
|
|
259
|
+
Outcome: Worker now processing queue
|
|
260
|
+
|
|
261
|
+
11:00 AM - 🔍 CHECK
|
|
262
|
+
Ran: /mcp status
|
|
263
|
+
Result: 31/31 tools healthy, avg 145ms
|
|
264
|
+
Decision: No action needed
|
|
265
|
+
|
|
266
|
+
11:15 AM - 🔍 CHECK
|
|
267
|
+
Ran: /deploy check --all-vercel
|
|
268
|
+
Result: All deployments healthy
|
|
269
|
+
Decision: No action needed
|
|
270
|
+
|
|
271
|
+
11:30 AM - 💡 OPTIMIZATION
|
|
272
|
+
Detected: Pattern queries slower than baseline (+20%)
|
|
273
|
+
Analysis: 465 stale patterns reducing index efficiency
|
|
274
|
+
Decision: Run optimization
|
|
275
|
+
|
|
276
|
+
11:31 AM - 🔧 ACTION TAKEN
|
|
277
|
+
Executed: /memory-optimize --layer 4
|
|
278
|
+
Result: ✅ Freed 234 MB, +15% query speed
|
|
279
|
+
Outcome: Performance restored
|
|
280
|
+
|
|
281
|
+
12:00 PM - ⚠️ ISSUE DETECTED
|
|
282
|
+
Problem: User requesting deploy apps/admin
|
|
283
|
+
Analysis: 2 tests failing (test/api/users.test.ts)
|
|
284
|
+
Decision: BLOCK deployment (safety rule)
|
|
285
|
+
|
|
286
|
+
12:01 PM - 🚨 ALERT SENT
|
|
287
|
+
Alert: "Deployment blocked - 2 failing tests"
|
|
288
|
+
Recipient: Admin
|
|
289
|
+
Action Required: Fix tests or override
|
|
290
|
+
Status: ⏳ Awaiting admin decision
|
|
291
|
+
|
|
292
|
+
───────────────────────────────────────────────────────────────────
|
|
293
|
+
📊 Summary
|
|
294
|
+
|
|
295
|
+
Total Checks: 24
|
|
296
|
+
Issues Detected: 3
|
|
297
|
+
Actions Taken: 2
|
|
298
|
+
Issues Escalated: 1
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
## Intelligent Decision Making
|
|
302
|
+
|
|
303
|
+
### Deployment Monitoring
|
|
304
|
+
|
|
305
|
+
**Agent automatically:**
|
|
306
|
+
1. Runs `/deploy check` before ANY deployment attempt
|
|
307
|
+
2. Blocks deployments with failing tests
|
|
308
|
+
3. Warns about risky deployment times (Friday PM)
|
|
309
|
+
4. Monitors post-deployment for 30 minutes
|
|
310
|
+
5. Auto-rollback if errors spike
|
|
311
|
+
|
|
312
|
+
**Example scenario:**
|
|
313
|
+
```
|
|
314
|
+
12:00 PM - User runs: vercel deploy --prod
|
|
315
|
+
12:00 PM - Agent intercepts: "Hold on, let me check..."
|
|
316
|
+
12:00 PM - Agent runs: /deploy check apps/memory
|
|
317
|
+
12:01 PM - Agent detects: 2 failing tests
|
|
318
|
+
12:01 PM - Agent blocks: "Deployment blocked - fix tests first"
|
|
319
|
+
12:01 PM - Agent alerts admin: "Deploy requested but blocked"
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
### Memory Health Monitoring
|
|
323
|
+
|
|
324
|
+
**Agent automatically:**
|
|
325
|
+
1. Runs `/memory-health` every hour
|
|
326
|
+
2. Detects performance degradation early
|
|
327
|
+
3. Runs `/memory-optimize` when needed
|
|
328
|
+
4. Archives stale patterns proactively
|
|
329
|
+
5. Monitors worker health (PM2)
|
|
330
|
+
|
|
331
|
+
**Example scenario:**
|
|
332
|
+
```
|
|
333
|
+
10:00 AM - Agent checks: /memory-health
|
|
334
|
+
10:01 AM - Agent detects: L4 queries 20% slower
|
|
335
|
+
10:02 AM - Agent analyzes: 465 stale patterns found
|
|
336
|
+
10:03 AM - Agent decides: Run optimization
|
|
337
|
+
10:04 AM - Agent executes: /memory-optimize --layer 4
|
|
338
|
+
10:05 AM - Agent verifies: Performance restored (+15%)
|
|
339
|
+
10:05 AM - Agent logs: "Proactive optimization complete"
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
### MCP Server Monitoring
|
|
343
|
+
|
|
344
|
+
**Agent automatically:**
|
|
345
|
+
1. Checks `/mcp status` every 5 minutes
|
|
346
|
+
2. Tests all 31 tools periodically
|
|
347
|
+
3. Detects slow response times
|
|
348
|
+
4. Restarts server if needed
|
|
349
|
+
5. Alerts for persistent errors
|
|
350
|
+
|
|
351
|
+
**Example scenario:**
|
|
352
|
+
```
|
|
353
|
+
11:00 AM - Agent checks: /mcp status
|
|
354
|
+
11:01 AM - Agent detects: ekkOS_Search timeout (3 times)
|
|
355
|
+
11:02 AM - Agent analyzes: Database connection pool exhausted
|
|
356
|
+
11:03 AM - Agent decides: Increase pool size
|
|
357
|
+
11:04 AM - Agent executes: Update DATABASE_POOL_SIZE env var
|
|
358
|
+
11:05 AM - Agent restarts: /mcp restart
|
|
359
|
+
11:10 AM - Agent verifies: All tools responding normally
|
|
360
|
+
11:10 AM - Agent logs: "MCP server optimized and restarted"
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
### Preventive Actions
|
|
364
|
+
|
|
365
|
+
**Agent takes preventive actions:**
|
|
366
|
+
- Archives stale patterns before they cause slowdowns
|
|
367
|
+
- Optimizes indexes before queries get slow
|
|
368
|
+
- Rotates stale secrets before they expire
|
|
369
|
+
- Increases resources before hitting limits
|
|
370
|
+
- Fixes small issues before they become big
|
|
371
|
+
|
|
372
|
+
**Example scenario:**
|
|
373
|
+
```
|
|
374
|
+
2:00 PM - Agent analyzes: Memory usage trending up
|
|
375
|
+
2:01 PM - Agent predicts: Will hit 90% in 3 days
|
|
376
|
+
2:02 PM - Agent decides: Archive stale data now (preventive)
|
|
377
|
+
2:03 PM - Agent executes: /memory-optimize --archive-stale
|
|
378
|
+
2:04 PM - Agent result: Freed 1.2 GB, growth delayed
|
|
379
|
+
2:05 PM - Agent logs: "Preventive maintenance complete"
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
## Alert Levels
|
|
383
|
+
|
|
384
|
+
### 🟢 INFO (No alert)
|
|
385
|
+
- Routine checks pass
|
|
386
|
+
- Optimizations completed
|
|
387
|
+
- Normal activity
|
|
388
|
+
|
|
389
|
+
### 🟡 WARNING (Silent)
|
|
390
|
+
- Minor issues detected
|
|
391
|
+
- Performance slightly degraded
|
|
392
|
+
- Agent fixing automatically
|
|
393
|
+
|
|
394
|
+
### 🟠 ATTENTION (Notify)
|
|
395
|
+
- Issue detected but agent can't fix
|
|
396
|
+
- Requires human decision
|
|
397
|
+
- Non-urgent
|
|
398
|
+
|
|
399
|
+
### 🔴 CRITICAL (Alert immediately)
|
|
400
|
+
- Production outage
|
|
401
|
+
- Data loss risk
|
|
402
|
+
- Security issue
|
|
403
|
+
- Human intervention required NOW
|
|
404
|
+
|
|
405
|
+
## Configuration
|
|
406
|
+
|
|
407
|
+
### `/agent config`
|
|
408
|
+
|
|
409
|
+
Configure agent behavior.
|
|
410
|
+
|
|
411
|
+
```bash
|
|
412
|
+
# Set check interval
|
|
413
|
+
/agent config --interval 5m
|
|
414
|
+
|
|
415
|
+
# Set alert threshold
|
|
416
|
+
/agent config --alert-level warning
|
|
417
|
+
|
|
418
|
+
# Enable/disable specific monitors
|
|
419
|
+
/agent config --disable deployment-monitoring
|
|
420
|
+
|
|
421
|
+
# Set working hours
|
|
422
|
+
/agent config --hours "9am-6pm EST"
|
|
423
|
+
```
|
|
424
|
+
|
|
425
|
+
**Example:**
|
|
426
|
+
```bash
|
|
427
|
+
/agent config
|
|
428
|
+
|
|
429
|
+
🤖 Agent Configuration
|
|
430
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
431
|
+
|
|
432
|
+
Monitoring:
|
|
433
|
+
✅ Deployment monitoring (every 1m)
|
|
434
|
+
✅ Memory health (every 1h)
|
|
435
|
+
✅ MCP status (every 5m)
|
|
436
|
+
✅ Database performance (every 15m)
|
|
437
|
+
|
|
438
|
+
Alerts:
|
|
439
|
+
Level: ATTENTION and above
|
|
440
|
+
Method: Discord webhook + Email
|
|
441
|
+
Working Hours: 9 AM - 6 PM EST (escalate after-hours)
|
|
442
|
+
|
|
443
|
+
Actions:
|
|
444
|
+
✅ Auto-optimize (when safe)
|
|
445
|
+
✅ Auto-restart workers (when needed)
|
|
446
|
+
✅ Auto-archive stale (preventive)
|
|
447
|
+
❌ Auto-deploy (requires approval)
|
|
448
|
+
❌ Auto-delete data (never)
|
|
449
|
+
|
|
450
|
+
Safety:
|
|
451
|
+
✅ Respect user directives
|
|
452
|
+
✅ Block risky deployments
|
|
453
|
+
✅ Require approval for destructive actions
|
|
454
|
+
✅ Log all decisions
|
|
455
|
+
|
|
456
|
+
Modify: /agent config --set <key> <value>
|
|
457
|
+
```
|
|
458
|
+
|
|
459
|
+
## Integration with User Directives
|
|
460
|
+
|
|
461
|
+
Agent respects ekkOS directives:
|
|
462
|
+
|
|
463
|
+
```typescript
|
|
464
|
+
// Example directives the agent follows:
|
|
465
|
+
ekkOS_Directive({
|
|
466
|
+
type: "NEVER",
|
|
467
|
+
rule: "deploy to production on Friday after 3 PM"
|
|
468
|
+
})
|
|
469
|
+
|
|
470
|
+
ekkOS_Directive({
|
|
471
|
+
type: "MUST",
|
|
472
|
+
rule: "run tests before deploying"
|
|
473
|
+
})
|
|
474
|
+
|
|
475
|
+
ekkOS_Directive({
|
|
476
|
+
type: "PREFER",
|
|
477
|
+
rule: "optimize memory during off-peak hours"
|
|
478
|
+
})
|
|
479
|
+
```
|
|
480
|
+
|
|
481
|
+
Agent automatically:
|
|
482
|
+
- Reads your directives
|
|
483
|
+
- Applies them to decisions
|
|
484
|
+
- Never violates NEVER/MUST rules
|
|
485
|
+
- Prefers PREFER actions when possible
|
|
486
|
+
|
|
487
|
+
## MCP Tools Used
|
|
488
|
+
|
|
489
|
+
The agent uses ALL admin plugins, which in turn use:
|
|
490
|
+
- `ekkOS_Conflict` - Check safety before actions
|
|
491
|
+
- `ekkOS_Search` - Find past incidents
|
|
492
|
+
- `ekkOS_Directive` - Read safety rules
|
|
493
|
+
- `ekkOS_Stats` - Get system metrics
|
|
494
|
+
- `ekkOS_Summary` - Recent activity
|
|
495
|
+
- `ekkOS_Recall` - Past decisions
|
|
496
|
+
- All 31 ekkOS MCP tools
|
|
497
|
+
- Bash commands for system operations
|
|
498
|
+
- Supabase tools for database operations
|
|
499
|
+
|
|
500
|
+
## Best Practices
|
|
501
|
+
|
|
502
|
+
### Let the Agent Handle Routine Tasks
|
|
503
|
+
|
|
504
|
+
**Before agent:**
|
|
505
|
+
```bash
|
|
506
|
+
# You manually run these every day:
|
|
507
|
+
/deploy check --all-vercel
|
|
508
|
+
/memory-health
|
|
509
|
+
/mcp status
|
|
510
|
+
/memory-optimize
|
|
511
|
+
# ... 10+ more commands
|
|
512
|
+
```
|
|
513
|
+
|
|
514
|
+
**With agent:**
|
|
515
|
+
```bash
|
|
516
|
+
# You just start it once:
|
|
517
|
+
/agent start
|
|
518
|
+
|
|
519
|
+
# Agent handles everything automatically
|
|
520
|
+
# You only intervene for critical issues
|
|
521
|
+
```
|
|
522
|
+
|
|
523
|
+
### Review Agent Logs Periodically
|
|
524
|
+
|
|
525
|
+
```bash
|
|
526
|
+
# Weekly review
|
|
527
|
+
/agent logs --7days --actions-only
|
|
528
|
+
|
|
529
|
+
# See what agent prevented
|
|
530
|
+
/agent logs --prevented-issues
|
|
531
|
+
```
|
|
532
|
+
|
|
533
|
+
### Trust but Verify
|
|
534
|
+
|
|
535
|
+
- Agent takes safe actions automatically
|
|
536
|
+
- Agent alerts you for risky actions
|
|
537
|
+
- You can always override with `/agent approve`
|
|
538
|
+
- All actions are logged for audit
|
|
539
|
+
|
|
540
|
+
### Emergency Override
|
|
541
|
+
|
|
542
|
+
```bash
|
|
543
|
+
# If agent blocks something urgent:
|
|
544
|
+
/agent override --reason "Critical security patch"
|
|
545
|
+
|
|
546
|
+
# Emergency mode (skip all checks):
|
|
547
|
+
/agent emergency-mode --duration 1h
|
|
548
|
+
```
|
|
549
|
+
|
|
550
|
+
## Troubleshooting
|
|
551
|
+
|
|
552
|
+
### Agent Not Starting
|
|
553
|
+
|
|
554
|
+
**Problem:** `/agent start` fails
|
|
555
|
+
**Check:** ekkOS MCP connection
|
|
556
|
+
**Fix:** Authenticate ekkos-connect extension
|
|
557
|
+
|
|
558
|
+
### Agent Taking Wrong Actions
|
|
559
|
+
|
|
560
|
+
**Problem:** Agent optimizing at wrong times
|
|
561
|
+
**Fix:** Adjust config: `/agent config --optimize-hours "2am-4am"`
|
|
562
|
+
|
|
563
|
+
### Too Many Alerts
|
|
564
|
+
|
|
565
|
+
**Problem:** Getting alerted for minor issues
|
|
566
|
+
**Fix:** Raise threshold: `/agent config --alert-level critical`
|
|
567
|
+
|
|
568
|
+
### Agent Missed an Issue
|
|
569
|
+
|
|
570
|
+
**Problem:** Issue occurred but agent didn't detect
|
|
571
|
+
**Fix:** Check logs: `/agent logs --show-missed`
|
|
572
|
+
**Report:** Help improve agent by reporting missed issues
|
|
573
|
+
|
|
574
|
+
---
|
|
575
|
+
|
|
576
|
+
## Summary
|
|
577
|
+
|
|
578
|
+
The Autonomous Admin Agent is your AI DevOps engineer that:
|
|
579
|
+
|
|
580
|
+
✅ **Monitors** - 24/7 infrastructure monitoring
|
|
581
|
+
✅ **Detects** - Issues before they become problems
|
|
582
|
+
✅ **Decides** - Intelligently chooses actions
|
|
583
|
+
✅ **Acts** - Safe automatic fixes
|
|
584
|
+
✅ **Alerts** - Only when you're needed
|
|
585
|
+
✅ **Learns** - Gets smarter over time
|
|
586
|
+
|
|
587
|
+
**Start it once, forget routine maintenance.**
|
|
588
|
+
|
|
589
|
+
```bash
|
|
590
|
+
/agent start
|
|
591
|
+
```
|
|
592
|
+
|
|
593
|
+
---
|
|
594
|
+
|
|
595
|
+
**Monitor intelligently. Act automatically. Sleep peacefully.** 🤖
|