agentleFS
elfrostelfrost/ai-patchlab/.agents/skills/monitor-setup/SKILL.md

monitor-setup

Skill1 starsChanged 30 days agoMITView on GitHub

Configure health checks, alerting patterns, and uptime tracking adapted to the project's stack. Use after kickoff or before deployment to add operational hooks.

  • Reads credentials

The file

We split this skill into the rules it gives an agent

11 rules. About 0 are common, 5 are distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Read CLAUDE.md / AGENTS.md for stack type

    line 9
  2. Very specific:

    Check if Discord webhook alerting is configured (env var, examples/discord_alert_pattern.py)

    line 11
  3. Distinctive:

    Check if logging is structured for monitoring

    line 12
  4. Very specific:

    Default scope: all ($ARGUMENTS can narrow to health, alerts, or uptime).

    line 14
  5. Very specific:

    Create or update an endpoint at /health:

    line 17
  6. Very specific:

    Add src/utils/health.py with helpers (get_uptime, check_db, check_apis).

    line 21
  7. Very specific:

    Add src/utils/alerts.py with the helper functions.

    line 29
  8. Very specific:

    Run ruff check and black on new files

    line 35
  9. Distinctive:

    If an API endpoint was created, show the user a curl test command

    line 36
  10. Distinctive:

    Update CLAUDE.md / AGENTS.md with a Monitoring section

    line 37
  11. Distinctive:

    Update README with the health-check URL

    line 38

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Monitor Setup

Phase 1: Assess current state

  1. Read CLAUDE.md / AGENTS.md for stack type
  2. Grep for existing /health or healthcheck endpoints
  3. Check if Discord webhook alerting is configured (env var, examples/discord_alert_pattern.py)
  4. Check if logging is structured for monitoring

Default scope: all ($ARGUMENTS can narrow to health, alerts, or uptime).

Phase 2: Health check endpoint (if stack = api or ai-agent)

Create or update an endpoint at /health:

  • status: "healthy", version, uptime
  • Sub-checks: database connectivity, external API reachability

Add src/utils/health.py with helpers (get_uptime, check_db, check_apis). Add a health-check pattern to examples/.

Phase 3: Alert patterns

Build on examples/discord_alert_pattern.py:

  • Levels: INFO / WARNING / ERROR / CRITICAL
  • Channels: Discord webhook (primary), loguru file, stdout
  • Deduplication: don't spam the same error

Add src/utils/alerts.py with the helper functions.

Phase 4: Uptime (data stack)

Track process start time in memory. Optionally log uptime milestones (1h, 6h, 24h, 7d). On long-running processes, add graceful shutdown logging.

Phase 5: Validate + document

  1. Run ruff check and black on new files
  2. If an API endpoint was created, show the user a curl test command
  3. Update CLAUDE.md / AGENTS.md with a Monitoring section
  4. Update README with the health-check URL
  5. Commit: feat: add monitoring setup (<components>)

Rules

  • Adapt to the project stack — do not add API endpoints to a data-only project
  • Discord webhook URL comes from .env (never hardcode)
  • Health checks must be FAST (< 500ms total)
  • Alert deduplication is critical — never spam a webhook
  • Monitoring code should never crash the main application

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.