agentleFS
89jobrien89jobrien/godmode/skills/observability-as-infrastructure/SKILL.md

godmode:observability-as-infrastructure

Skill1 starsChanged 57 days agoMITView on GitHub

Structured tracing for all godmode helpers and subagents. Every script invocation, branching decision, and agent lifecycle transition is recorded as a JSONL event. Use when diagnosing session failures, auditing agent convergence, or reviewing cross-session continuity.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    All events share a common envelope:

    line 20
  2. Very specific:

    All helpers source skills/_lib/trace.nu:

    line 49
  3. Very specific:

    Call trace-start before any work.

    line 93
  4. Very specific:

    Call trace-error on non-zero exit before calling exit.

    line 95
  5. Very specific:

    Call trace-end on success.

    line 96
  6. Very specific:

    Never delete .ctx/godmode/traces/trace.jsonl — archive it instead.

    line 104

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

Observability as Infrastructure

The trace file is the infrastructure. No external monitoring needed — every helper and agent emits structured events to .ctx/godmode/traces/trace.jsonl, the same append-only file used by the core CLI's start_traced/complete_traced.

Event Schema

All events share a common envelope:

FieldTypeDescription
eventstringEvent kind (see below)
session_idstring<git-short-sha>-<epoch-ms> — stable for the lifetime of one Claude session
tsstringISO-8601 timestamp

Event kinds

EventEmitted byKey fields
skill.startevery helperskill, helper, args, trace_id
skill.completeevery helpertrace_id, duration_ms
skill.errorevery helpertrace_id, exit_code, stderr_tail
decisionbranching helpersskill, helper, kind, value
agent.startparallel-agentsagent_id, slot, crate
agent.completeparallel-agentsagent_id, slot, commits
agent.blockedparallel-agentsagent_id, slot, reason

Session identity

Session state lives at .ctx/godmode/session.json. It is created on the first trace write and reused for all subsequent events. session_id = git short SHA

  • epoch ms. session-summary.nu uses this to correlate work across sessions.

Shared library

All helpers source skills/_lib/trace.nu:

use ($"(repo-root)/skills/_lib/trace.nu") *

def main [...] {
    let tid = (trace-start "skill-name" "helper.nu" ...$args)
    # ... do work, capture results via | complete ...
    if $result.exit_code != 0 {
        trace-error $tid $result.exit_code $result.stderr
        exit $result.exit_code
    }
    trace-end $tid
}

Branching decisions:

trace-decision "ci-fix" "fetch-failure.nu" "ci_class" "test_failure"
trace-decision "tackle-issues" "integrate-branches.nu" "skip_reason" "BLOCKED.md found for #7"

Agent lifecycle (called by the orchestrator, not the subagent):

trace-agent-start    $agent_id $slot $crate
trace-agent-complete $agent_id $slot $commits
trace-agent-blocked  $agent_id $slot $reason

Query helpers

HelperPurpose
trace-tail.nuLast N events; --session <id> to scope
trace-failures.nuAll skill.error and agent.blocked events
trace-stats.nuDuration histogram, agent convergence, decision log
session-summary.nuCross-session triage: errors, blocked agents, unresolved work

Instrumentation contract

Every helper must:

  1. Call trace-start before any work; capture the returned trace_id.
  2. Wrap every run-external call with | complete and check exit_code.
  3. Call trace-error on non-zero exit before calling exit.
  4. Call trace-end on success.
  5. Emit trace-decision at every branching point that affects outcome.

Trace writes are non-fatal — a failed append must never abort the helper. Wrap in try { ... } if the .ctx/ directory may not exist.

Guardrails

  • Never delete .ctx/godmode/traces/trace.jsonl — archive it instead.
  • session_id is read-only after creation. Never mutate .ctx/godmode/session.json.
  • Trace writes must not block the main workflow — keep event payloads small.
  • stderr_tail is capped at 10 lines to avoid bloating the trace file.

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.