---
name: pipixia-labs-self-observe
description: "Observe OpenTeamwork Node health with usage, automation status, audit facts, logs, and quick diagnostics."
license: "Apache-2.0"
metadata:
  decimalai-skill-id: "a9b3b349-d9a8-4524-be0a-764514333b76"
  decimalai-version-id: "94ea43a6-c3f7-46f3-be08-b39f0cf5276e"
  decimalai-version: "1"
  decimalai-body-sha256: "cc0c29011b16b1a8a19952a37e51bbeaac4868eb1f3816fad6642372f3b90deb"
  decimalai-name: "pipixia-labs/self-observe"
  decimalai-format: "1"
  decimalai-invocation: "model"
  decimalai-category: "agent-tooling"
  decimalai-source: "https://app.decimal.ai/s/pipixia-labs-self-observe@1/SKILL.md"
---
# Self Observe Skill

Use this skill when the user asks for agent self-inspection, runtime health checks, or diagnostics such as token cost, error logs, and service status.

## What To Check

1. Token usage:
```bash
otw operations usage --json
otw operations usage --provider google --limit 50 --json
otw operations usage --provider openai --limit 50 --json
```

2. Runtime status:
```bash
otw operations status --json
otw operations health --json
otw operations heartbeat status --json
otw operations cron list --json
```

3. Error logs (read-only):
```bash
tail -n 200 ~/.openteamwork/logs/node.err.log
rg -n "ERROR|Error|Traceback|Exception|failed|timeout" ~/.openteamwork/logs/node.err.log ~/.openteamwork/logs/node.out.log
```

4. SQLite quick verification (if `sqlite3` exists):
```bash
sqlite3 ~/.openteamwork/database/token_usage.db "SELECT provider, COUNT(*) AS requests, SUM(total_tokens) AS total_tokens FROM llm_token_usage_events GROUP BY provider ORDER BY total_tokens DESC;"
sqlite3 ~/.openteamwork/database/token_usage.db "SELECT response_at, provider, model, request_tokens, response_tokens, total_tokens FROM llm_token_usage_events ORDER BY response_at_ms DESC LIMIT 20;"
```

## Fast Path

Generate one consolidated report:

```bash
bash openppx/skills/self-observe/scripts/self_status_report.sh
```

## Output Format

When reporting to user, include:

1. Runtime Summary: Node/heartbeat/cron health highlights.
2. Token Summary: total requests/tokens and provider split.
3. Recent Errors: latest error signatures with file and timestamp.
4. Risks: what might break soon (missing usage data, repeated failures, disconnected provider).
5. Next Actions: concrete commands to validate/fix.

## Guardrails

- Keep checks read-only by default.
- Do not delete or truncate logs unless the user explicitly asks.
- If status/log files are missing, report "not found" explicitly instead of guessing.
- Prefer structured output (`--json`) first, then summarize in natural language.
