Skip to main content

agent-observability

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.

소스 정보

저장소
Tencent/LoopForge
최근 소스 활동
2026년 9월 17일 11:51
감지된 SKILL.md 언어
영어
스타
48
포크
14

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

파일 탐색기
34 개 파일

SKILL.md 표시 중

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`.
GitHub에서 보기