Skip to content
Back to skills

Agent Observability

ASecurity

Add or maintain CodeBuddy hook observability for projects that need local metrics for tool latency, transcript token usage, session cost, and multi-agent trace attribution. Use when wiring hook-based telemetry, and debugging missing usage events.

  • 128 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 11, 2026
ai-agentsshelldebugging

Security analysis

A100/100

Pro scans all 19 files and shows the line behind each finding

Scanned November 11, 2026

npx -y skills add Tencent/LoopForge --skill agent-observability --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Agent Observability?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Agent Observability
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tencent-agent-observability-loopforge/badge)](https://www.skillsdirectory.com/skills/tencent-agent-observability-loopforge)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: agent-observability
description: Add or maintain CodeBuddy hook observability for projects that need local metrics for tool latency, transcript token usage, session cost, and multi-agent trace attribution. Use when wiring hook-based telemetry, and debugging missing usage events.
---

## Workflow

1. Merge `templates/settings-hook.json` into the user or project `settings.json`.
2. Keep hook entries command-only and keep timeouts around 5 to 10 seconds.
3. Run a normal CodeBuddy session and inspect `logs/metrics.ndjson`.
4. Inspect `logs/.state.json` when usage replay or offsets look wrong.
5. Keep the runtime generic and verify output from `metrics.ndjson` and `.state.json`.

## Read Next

- Read `references/quickstart.md` for setup and smoke-test steps.
- Read `references/schema-v2.md` when you need field definitions or sidecar state shape.
## Key Files

- `scripts/main.py`: hook entrypoint for `session-start`, `user-prompt-submit`, `pre`, `post`, and `stop`
- `scripts/run_hook.sh`: stable shell wrapper for CodeBuddy hook commands
- `scripts/core/collector.py`: transcript parsing, pre/post pairing, and session usage recording
- `scripts/core/state.py`: persisted hook state, offsets, and pending tool events
- `scripts/core/devflow.py`: optional devflow-awareness — detects a `multi-agents-devflow-*` team, reads `workflow-state.json`, and emits `stage_transition` events. No-ops entirely on non-devflow projects.
- `templates/settings-hook.json`: hook wiring template

## Output Contract

- Always emit `event`, `sid`, and `ts`.
- Emit `tool` for per-call latency and `usage` for transcript-derived token and cost events.
- Emit `stop` for end-of-session flush.
- Never block the main hook flow; hook exits must stay `0`.

Files in this skill

  • SKILL.md1.7 KB
  • config/pricing.json3.3 KB
  • references/quickstart.md11.2 KB
  • references/schema-v2.md9 KB
  • scripts/__init__.py42 B
  • scripts/build_dashboard_data.py29.7 KB
  • scripts/core/__init__.py197 B
  • scripts/core/agent_identity.py22.1 KB
  • scripts/core/cls_sink.py14.9 KB
  • scripts/core/cls_uploader.mjs2.5 KB
  • scripts/core/collector.py37.4 KB
  • scripts/core/devflow.py11.1 KB
  • scripts/core/emitter.py19.5 KB
  • scripts/core/envfile.py1.3 KB
  • scripts/core/runtime.py18 KB
  • scripts/core/scanner.py18.1 KB
  • scripts/core/state.py18.7 KB
  • scripts/dashboard/index.html61.5 KB
  • scripts/main.py551 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.