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, debugging missing usage events, and validating AgentLens state.

  • 57 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added October 19, 2026
ai-agentsshelldebugging

Security analysis

A100/100

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

Scanned October 19, 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/badge)](https://www.skillsdirectory.com/skills/tencent-agent-observability)

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, debugging missing usage events, and validating AgentLens state.
---

## 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, offsets, or AgentLens turn state 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/agentlens.py`: AgentLens trace emission and agent or step grouping
- `scripts/core/state.py`: persisted hook state, offsets, and AgentLens sidecar state
- `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.8 KB
  • config/pricing.json3.3 KB
  • references/quickstart.md11.2 KB
  • references/schema-v2.md9.5 KB
  • scripts/__init__.py42 B
  • scripts/build_dashboard_data.py29.8 KB
  • scripts/core/__init__.py222 B
  • scripts/core/agent_identity.py22.1 KB
  • scripts/core/agentlens/__init__.py264 B
  • scripts/core/agentlens/bootstrap.py7.4 KB
  • scripts/core/agentlens/normalize.py12.6 KB
  • scripts/core/agentlens/runtime.py36.9 KB
  • scripts/core/agentlens/tracing.py19.8 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/runtime.py21.5 KB

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.

Comments

Loading comments…

Newsletter

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