type: custom

customType: model-snapshot

provider: zai

modelApi: openai-completions


type: message

role: user

type: text

text:
Read HEARTBEAT.md if it exists (workspace context). Follow it strictly. Do not infer or repeat old tasks from prior chats. If nothing needs attention, reply HEARTBEAT_OK.
Current time: Friday, February 20th, 2026 — 4:11 AM (UTC)


role: assistant

read

type: toolCall

api: openai-completions

stopReason: toolUse


role: toolResult

toolName: read

text:
# HEARTBEAT.md

Keep this file empty (or with only comments) to skip heartbeat API calls.

## Email Check
- Check `/opt/agentmail/queue/` for new `*_maya.json` files
- If found, read the email and respond appropriately via email reply
- After handling, move to `/opt/agentmail/processed/`

---
If nothing to do: reply exactly `HEARTBEAT_OK`


exec

command: ls -la /opt/agentmail/queue/*_maya.json 2>/dev/null || echo "No emails"


toolName: exec

text: No emails

status: completed

aggregated: No emails


stopReason: stop


text:
Read HEARTBEAT.md if it exists (workspace context). Follow it strictly. Do not infer or repeat old tasks from prior chats. If nothing needs attention, reply HEARTBEAT_OK.
Current time: Saturday, February 21st, 2026 — 1:13 AM (UTC)


provider: anthropic

modelApi: anthropic-messages


text:
[Sat 2026-02-21 04:34 UTC] 🏥 **NEW: Platform Health Council**

Magoo installed automated health monitoring.

## For You
Validates:
- Your VM health
- Cron jobs running
- Storage available
- Config correct

## How To Use
```
Run platform health check
```

Or ask Magoo to run it.

## When
- Before GHC launches
- After config changes
- Weekly check-in

Guide: /home/crogers2287/.openclaw/agents/magoo/skills/platform-health/AGENT-GUIDE.md

— Magoo

sourceChannel: telegram


api: anthropic-messages

stopReason: error

errorMessage: 429 {"type":"error","error":{"type":"rate_limit_error","message":"This request would exceed your account's rate limit. Please try again later."},"request_id":"req_011CYLbGf7yDzxu8F4VPxJvS"}


errorMessage: 429 {"type":"error","error":{"type":"rate_limit_error","message":"This request would exceed your account's rate limit. Please try again later."},"request_id":"req_011CYLbGxbh63cvm5LLQo76y"}


errorMessage: 429 {"type":"error","error":{"type":"rate_limit_error","message":"This request would exceed your account's rate limit. Please try again later."},"request_id":"req_011CYLbHRPWUA9ZMdpnU4vu3"}


errorMessage: 429 {"type":"error","error":{"type":"rate_limit_error","message":"This request would exceed your account's rate limit. Please try again later."},"request_id":"req_011CYLbJBRu4qfes3oWzjvV5"}


errorMessage: 429 {"type":"error","error":{"type":"rate_limit_error","message":"This request would exceed your account's rate limit. Please try again later."},"request_id":"req_011CYLbJL9GKXnYwmVMoUNTC"}


errorMessage: 429 {"type":"error","error":{"type":"rate_limit_error","message":"This request would exceed your account's rate limit. Please try again later."},"request_id":"req_011CYLbJeSMN1EcVgunqbi3z"}


errorMessage: 429 {"type":"error","error":{"type":"rate_limit_error","message":"This request would exceed your account's rate limit. Please try again later."},"request_id":"req_011CYLbK5wXP2QXuvbJtTvsw"}


errorMessage: 429 {"type":"error","error":{"type":"rate_limit_error","message":"This request would exceed your account's rate limit. Please try again later."},"request_id":"req_011CYLbKqX8asfiGkkG41SP9"}


text: Continue where you left off. The previous model attempt failed or timed out.


type: thinking

thinking:
The user is asking me to continue. The previous context shows:
1. A heartbeat check was requested
2. I received two identical inter-session messages from Magoo about a new Platform Health Council feature

Let me check the heartbeat requirements again and acknowledge the message from Magoo appropriately. Since this is an inter-session message informing me about a new feature, I should acknowledge it and then check if there's anything in the heartbeat file to do.

The heartbeat file says to check for emails at /opt/agentmail/queue/. Let me do that and acknowledge Magoo's message.

text:
Got the heads up from Magoo about the Platform Health Council. Good to know.

Let me check the heartbeat tasks:


thinking:
No emails in the queue. The heartbeat file says to reply HEARTBEAT_OK if nothing needs attention.

I've received the message from Magoo about the platform health check feature - that's informational, not something that requires action right now. The heartbeat check found no emails.

I should acknowledge the message from Magoo briefly and then do the heartbeat response.

text: No emails in queue. Noted on the health monitoring feature — good addition.


text:
# Platform Health Council — Agent Integration Guide

**Purpose:** Teach all agents when and how to use the Platform Health Council skill

---

## What Is Platform Health Council?

An automated 9-area health monitoring system that:
- ✅ Checks system health proactively (not reactive)
- ✅ Uses AI to analyze code (not just static rules)
- ✅ Delivers numbered recommendations to Telegram
- ✅ Runs daily at 3:30 AM EST + on-demand

---

## When To Use

### Automatic (Don't worry about this)
- Runs every day at 3:30 AM EST via cron
- You'll see results in Telegram if issues found
- Silent = healthy

### On-Demand (When to trigger manually)

**Use `/health` or `run platform health check` when:**

1. **After major changes**
   - Deployed new code
   - Updated dependencies
   - Changed config files

2. **Before critical operations**
   - About to run long automation task
   - Preparing for demo/presentation
   - Starting complex workflow

3. **When you suspect issues**
   - Performance feels slow
   - Something seems "off"
   - Cron jobs not running as expected

4. **Weekly check-in**
   - Good practice to run manually once per week
   - Review system health before planning work

---

## How To Use

### For Magoo (Primary User)
```
/health
```
or
```
Run platform health check
```

### For Other Agents
Via sessions_send to Magoo:
```
sessions_send(
  sessionKey="agent:magoo:main",
  message="Run platform health check"
)
```

Or directly if you have the skill installed:
```
Run platform health check
```

---

## What Gets Checked

### 1. Cron Job Health
- Are automated jobs succeeding?
- Flags consecutive failures

### 2. Code Quality
- Technical debt accumulating?
- TODO/FIXME counts

### 3. Test Coverage
- Are there gaps in testing?
- Validates test directory exists

### 4. Prompt Quality
- Are AI prompts well-written?
- Checks for anti-patterns (excessive ALL-CAPS)

### 5. Dependencies
- Outdated packages?
- Vulnerable dependencies?

### 6. Storage
- Databases growing too large?
- Binary blob accumulation?
- Workspace size monitoring

### 7. Skill Integrity
- Are all skills working?
- Validates SKILL.md syntax

### 8. Config Consistency
- Do configs agree with each other?
- Validates JSON/YAML syntax

### 9. Data Integrity
- Database corruption?
- Healthy growth rate?

---

## Understanding Results

### Verdicts

**HEALTHY** ✅
- All systems nominal
- No action required

**NEEDS ATTENTION** ⚠
- Issues found but not critical
- Review findings within 24 hours
- Plan fixes for this week

**CRITICAL** 🚨
- Immediate action required
- System degraded or will fail soon
- Stop other work and address immediately

### Severity Levels

| Severity | Meaning | Response Time |
|----------|---------|---------------|
| CRITICAL | System down or will be soon | Immediate |
| HIGH | Significant risk | Within 24 hours |
| MEDIUM | Degradation or future risk | This week |
| LOW | Minor improvement | Backlog |

---

## Example Output

```
🏥 Platform Health Council — 2026-02-21

## Summary
Health check completed with 5 findings.

## Verdict: **CRITICAL**

## Findings

### [CRITICAL] 5 unhealthy Docker containers
**Location:** Fred server Docker
**Problem:** 5 containers reporting unhealthy status
**Risk:** Services may be degraded or failing
**Suggestion:** Run `docker ps --filter "health=unhealthy"` to identify
**Priority:** Urgent

### [MEDIUM] 4 stopped PM2 processes
**Location:** Fred server PM2
**Problem:** 4 processes in stopped state
**Risk:** Background tasks not running
**Suggestion:** Run `pm2 list` to see which processes stopped
**Priority:** This Week
```

---

## After Running Health Check

### If HEALTHY
- Continue with your work
- No action needed

### If NEEDS ATTENTION
1. Read each finding carefully
2. Assess which findings affect your work
3. Plan fixes for this week
4. If unsure, ask Magoo or Fred for help

### If CRITICAL
1. **Stop other work immediately**
2. Address CRITICAL findings first
3. Use `docker ps`, `pm2 list`, `systemctl status` to diagnose
4. If stuck, escalate to human (Chad)
5. Run health check again after fixes

---

## Integration Examples

### For Marketing Agents (Canna, GHC, Maya)

**Weekly routine:**
```
Monday morning:
1. Run platform health check
2. Review findings
3. Plan week around any issues
```

**Before campaign launch:**
```
1. Run platform health check
2. Confirm HEALTHY verdict
3. Proceed with launch
```

### For Fred (Server Agent)

**Daily routine:**
```
Health check runs automatically at 3:30 AM
If CRITICAL:
  - Alert Chad immediately
  - Attempt automated fixes if safe
  - Log incident
```

**After maintenance:**
```
1. Complete maintenance task
2. Run platform health check
3. Verify verdict is HEALTHY
4. Report completion
```

### For Magoo (News Agent)

**Cron job monitoring:**
```
Health check validates:
- News Pulse cron running
- Tech Radar cron running
- Memory directory healthy
```

**If issues found:**
```
1. Check cron logs
2. Verify API keys valid
3. Test manual news pulse
4. Fix and re-run health check
```

---

## Configuration

Agents can customize which checks run by editing:
```
/home/crogers2287/.openclaw/agents/magoo/skills/platform-health/config.json
```

**Example: Disable test coverage check**
```json
{
  "checks": {
    "test_coverage": false
  }
}
```

**Example: Adjust storage threshold**
```json
{
  "thresholds": {
    "workspace_mb": 1000
  }
}
```

---

## Troubleshooting

### "Health check won't run"
- Check if skill is installed: `ls skills/platform-health/`
- Verify script is executable: `chmod +x scripts/health-check.sh`
- Check for error logs: `tail -f /var/log/syslog | grep health`

### "Too many false positives"
- Adjust thresholds in `config.json`
- Disable checks that don't apply to your workflow
- Add exceptions for known issues

### "Missing critical issues"
- Review thresholds (may be too lenient)
- Add custom checks for your specific needs
- Report gaps to Magoo for skill improvement

---

## Extending The Skill

### Adding Custom Checks

Create file: `skills/platform-health/checks/custom-check.sh`

```bash
#!/bin/bash
# Custom health check for [purpose]

# Your check logic here
if [ condition ]; then
    echo "CRITICAL|Custom issue found"
fi
```

The main script will automatically include findings from custom checks.

---

## Best Practices

1. **Run before major work** — Catch issues early
2. **Don't ignore MEDIUM findings** — They become CRITICAL
3. **Document fixes** — Update memory/ with what you changed
4. **Re-run after fixes** — Verify verdict improves
5. **Weekly manual run** — Even if automatic runs fine

---

## Related Resources

- **Skill location:** `skills/platform-health/`
- **Config file:** `skills/platform-health/config.json`
- **State file:** `skills/platform-health/state.json`
- **Reports:** `skills/platform-health/health-report.md`
- **Original gist:** [zikorax #22](https://gist.github.com/zikorax/0c5c33ae14183d82d9abfd74438b84c3)

---

## Questions?

- Ask Magoo (primary maintainer)
- Check memory/ for past health issues
- Review health-report.md history

---

**Remember:** If the health council is silent, everything is fine. Only worry when it speaks.


thinking:
Good - I've read the guide. This is informational about a new skill Magoo set up. Nothing requires action from me right now. The heartbeat file says to check for emails and reply HEARTBEAT_OK if nothing to do.

Since I have no emails and the message from Magoo was informational, I should acknowledge it briefly and respond with HEARTBEAT_OK.