agentleFS
mo-cmykmo-cmyk/mazarbul/.claude/skills/inspect-runtime/SKILL.md

inspect-runtime

Skill2 starsChanged 34 days agoApache-2.0View on GitHub

Triage a runtime issue in Mazarbul end-to-end. USE WHEN user reports an error, asks "why is X slow/failing", "investigate this incident", or pastes a panic trace. Walks logs -> traces -> pprof -> storage. NOT FOR code-quality issues (use /verify, /simplify) or version-mismatch checks (use /inspect-deploy).

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 3 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When something is broken, you don't yet know which layer.

    line 15
  2. Distinctive:

    When OTEL is wired (M2 work), traces go to the configured collector.

    line 34
  3. Distinctive:

    If a code path is slow:

    line 38
  4. Very specific:

    If the symptom looks like data corruption or stale data, drop down to /inspect-db.

    line 58
  5. Very specific:

    pprof endpoint: must be enabled via --debug-addr.

    line 73

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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

Runtime triage

When something is broken, you don't yet know which layer. This skill walks the canonical layers in order so you don't skip a step.

Triage tree (run top to bottom; stop when you have a root cause)

1. Logs

Mazarbul uses zap structured logging to stderr by default:

./bin/maz mcp serve 2>&1 | tail -100 | jq -r 'select(.level == "error") | .msg + "\t" + .error'

Watch for:

  • Repeated error messages (a single bug, many invocations).
  • Errors mentioning the kernel writer or scope enforcement (invariant violations).
  • "context canceled" patterns (timeout cascades).

2. Traces (OpenTelemetry, when configured)

When OTEL is wired (M2 work), traces go to the configured collector. Stub for now.

3. Profile

If a code path is slow:

# Start the daemon with the pprof endpoint exposed
./bin/maz mcp serve --debug-addr=localhost:6060 &

# Capture
mise run pprof:cpu      # 30s flame graph
mise run pprof:mem      # heap profile

For a memory leak suspicion:

go tool pprof -http=:8080 http://localhost:6060/debug/pprof/heap
# Compare two captures 60 seconds apart.

4. Storage

If the symptom looks like data corruption or stale data, drop down to /inspect-db.

Decision table

SymptomFirst checkIf clean, then
MCP tool returns wrong shapeLogs at error levelTool schema vs handler code
Recall is slowProfile (mise run pprof:cpu)Vector and FTS index counts
Daemon crashesLogs around the crashRun with -race to catch data races
Event log growing fastSource-connector countsConnector config (over-eager poll?)
Plugin won't loadDaemon stderr at startupPlugin manifest validation

Common gotchas

  • Logs are JSON, not text, pipe through jq for usable output.
  • pprof endpoint must be enabled via --debug-addr; not on by default in prod-mode.
  • Race detector has runtime overhead; only run with -race when diagnosing concurrency bugs.

What this skill is NOT

  • A replacement for actual telemetry. When OTEL is wired, traces give you more than logs alone.
  • Storage-layer inspection, that's /inspect-db.

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.