arthai-marketplace

/sre

Run SRE operations.

Synopsis

/sre [command]

Commands: status, health, logs, deploy-check, ci, sleep, wake, debug, rebuild, watch. With no command, defaults to status. health accepts --monitor-mode (report only on failure — used by scheduled checks registered via watch).

When to use it

Quickstart

/sre

What you’ll see: a structured pass/fail table covering every environment from your CLAUDE.md — deployment platform status, health endpoint results, and the latest CI runs.

Examples

/sre                          # full system status — all services, all environments
/sre health                   # quick check — just hit the health endpoints
/sre logs backend             # recent deploy logs for a service, errors summarized
/sre debug "500s on /api"     # systematic diagnosis of a production issue
/sre sleep                    # scale staging down to save costs
/sre rebuild                  # nuclear option for stale build caches

Subcommands

Command What it does (one line)
status Full system status — checks platform services, hits all health endpoints, and reviews recent CI runs for every environment
health Quick health check — hits the health endpoint of every environment listed in CLAUDE.md and reports pass/fail
logs [service] Fetches recent deploy logs for a service, filters for errors, and summarizes issues found
deploy-check End-to-end deployment verification — recent CI runs, latest deploys, health endpoints, and migration state
ci Checks CI/CD pipeline status, pulls failure logs for any failed runs, and suggests fixes
sleep Sleeps the staging environment to save costs and verifies services scaled to zero
wake Wakes the staging environment and waits for health checks to pass
debug [description] Systematic production debugging — confirm, scope, diagnose, find root cause, then apply infra fixes directly or escalate code bugs to /fix
rebuild Clean monorepo rebuild — stops services, nukes build caches, rebuilds packages in dependency order, restarts, and verifies
watch [service] Registers a background health watcher via the Monitor tool — wakes the agent only on a status change; delegates to /monitor deploy when that skill is installed (falls back to a session-scoped scheduled check where Monitor is unavailable)

What it does

  1. Discovers project context — reads CLAUDE.md, the project profile, and the knowledge base; detects your deploy platform, databases, monitoring, and CI from project files if not already calibrated, and recommends anything that’s missing.
  2. Runs the command — most commands spawn an SRE agent with platform-appropriate tools (Railway MCP, Vercel CLI, gh, etc.); rebuild and watch run inline without an agent. Discovery is scoped per command — local-only commands read just the CLAUDE.md tables.
  3. Classifies fixes during debug — infra-only fixes (restart, config, scale) are applied directly and health-verified; if config changed, it asks you to smoke-test — a user-confirmation checkpoint. Code bugs are never patched from /sre — they’re escalated to /fix with all gathered evidence.
  4. Writes back what it learned — incidents, platform patterns, and infra decisions go to the project knowledge base so future runs diagnose faster.
  5. After an infra fix, presents a “What’s next?” menu (monitor, investigate further, project status, done) — a user-confirmation checkpoint.

Agents spawned

Agent Model tier Role
sre sonnet (from model-policy.yml) Executes the command against your platform — status checks, log analysis, debugging, sleep/wake (one agent per invocation; rebuild and watch spawn none — they run inline)

Output & artifacts

Troubleshooting

Problem Fix
Environments are skipped during health checks Their URL in the CLAUDE.md ## Environments table is still a TODO placeholder — fill it in or run /scan
Platform not detected / wrong tools used Run /calibrate/sre reads its project profile instead of re-discovering
/sre debug found the bug but didn’t fix the code By design — code fixes go through /fix, which has the verification pipeline. Accept the escalation it offers
Stale builds or phantom errors persist after restart Use /sre rebuild — it clears turbo/next/tsc caches and rebuilds from scratch