Skip to content

feat(skills): add int-uptime-kuma skill (Uptime Kuma monitoring)#111

Open
mt-alarcon wants to merge 2 commits into
evolution-foundation:mainfrom
mt-alarcon:feat/int-uptime-kuma-skill
Open

feat(skills): add int-uptime-kuma skill (Uptime Kuma monitoring)#111
mt-alarcon wants to merge 2 commits into
evolution-foundation:mainfrom
mt-alarcon:feat/int-uptime-kuma-skill

Conversation

@mt-alarcon

Copy link
Copy Markdown

What

New integration skill int-uptime-kuma to monitor and manage an Uptime Kuma instance from the workspace.

Why

Uptime Kuma is a common self-hosted monitoring choice, but it has no stable REST API (it's Socket.io-based) and the official uptime-kuma-api lib only supports up to 1.23.2 — leaving 2.x users without a clean programmatic path. This skill fills that gap with an in-house client validated on 2.2.1.

Design

  • Read path (status/get): Prometheus /metrics with Basic Auth — stateless, stdlib-only, runs on any python3.
  • Write path (add/edit/pause/resume/delete): Socket.io over WebSocket via python-socketio. Real login is verified and aborts on failure (no silent {ok:true} fallback); every write requires a server ack {ok:true} or exits non-zero.
  • Mutation-safety (mirrors the repo's existing conventions): dry-run by default, --execute to apply, --source for the audit trail, snapshot_before on edit/delete, blast-radius gates (delete requires --confirm "<exact name>"; pause warns it blinds monitoring), --max-writes.
  • smoke: exit-0 + JSON {overall, steps[], duration_ms}, including a write_auth step that exercises the write-path login (so an auth break surfaces in health checks).
  • 2.x compat: injects conditions: [] (NOT NULL in 2.x) and accepted_statuscodes as a list.

Tests

107 tests, network fully blocked in the suite (no live calls). Covers the Prometheus parser, smoke (incl. write_auth), dry-run-default for all 5 writes, the ack barrier for all 5 writes, the delete 2-factor gate, snapshots, and --max-writes. Regressions are non-tautological (neutralizing the ack check makes them fail).

Notes

  • Adds python-socketio[client]>=5.11 to dependencies (required by the write path).
  • Instance URL and credentials are read from env only (UPTIME_KUMA_*) — nothing hardcoded.

🤖 Generated with Claude Code

New integration skill to monitor and manage an Uptime Kuma instance.

- Read path (status/get): Prometheus /metrics with Basic Auth — stateless,
  stdlib-only, works on any python3.
- Write path (add/edit/pause/resume/delete): Socket.io over WebSocket via
  python-socketio. Real login is verified and aborts on failure (no silent
  fallback). Every write requires a server ack {ok:true} or exits non-zero.
- Mutation-safety (int-blue style): dry-run by default, --execute to apply,
  --source for the audit trail, snapshot_before on edit/delete, blast-radius
  gates (delete requires --confirm "<exact name>"; pause warns), --max-writes.
- smoke command: exit-0 + JSON {overall, steps[], duration_ms}, including a
  write_auth step that exercises the write-path login.
- Compatible with Uptime Kuma 2.x (validated on 2.2.1). The official
  uptime-kuma-api lib only supports up to 1.23.2, hence the in-house client.
- 107 tests, network fully blocked in tests. Instance/credentials via env only.

Adds python-socketio[client] to dependencies (write path).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @mt-alarcon, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

Elevate the skill to a robust standard:

- login() now fails with an actionable diagnosis (_login_hint): it tells
  apart rejected credentials (stale/incorrect username/password) from a
  2FA-enabled account (TOTP required), instead of echoing the raw ack.
  The raw server response is always appended. This closes the gap where
  an auth failure surfaced as an opaque, silent {} from a write.
- SKILL.md documents the actionable login contract (stale vs 2FA).
- Tests: +5 (TestLoginHint) covering both failure modes, raw-payload
  preservation, and that the raised error carries the hint. 112 passing.

Verified against Uptime Kuma 2.2.1 (read via Prometheus /metrics, write
via python-socketio). No new lint-http-type violations.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@mt-alarcon

Copy link
Copy Markdown
Author

Update: hardened the write-path login. login() now fails with an actionable diagnosis that distinguishes rejected credentials (stale/incorrect user/password) from a 2FA-enabled account (TOTP required), instead of surfacing an opaque silent {} from a write. Raw server ack is always appended. SKILL.md documents the contract; +5 tests (112 passing). Verified against Uptime Kuma 2.2.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant