Agent Skills › Tencent/LoopForge › agent-observability

agent-observability

GitHub

用于配置 CodeBuddy 钩子以收集本地遥测数据,包括工具延迟、Token 用量和会话成本。适用于接入基于钩子的监控及调试缺失的使用事件。

local/.cursor/skills/agent-observability/SKILL.md Tencent/LoopForge

Trigger Scenarios

需要添加或维护 CodeBuddy 钩子可观测性 调试缺失的使用事件或指标

Install

npx skills add Tencent/LoopForge --skill agent-observability -g -y
More Options

Non-standard path

npx skills add https://github.com/Tencent/LoopForge/tree/main/local/.cursor/skills/agent-observability -g -y

Use without installing

npx skills use Tencent/LoopForge@agent-observability

指定 Agent (Claude Code)

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

安装 repo 全部 skill

npx skills add Tencent/LoopForge --all -g -y

预览 repo 内 skill

npx skills add Tencent/LoopForge --list

SKILL.md

Frontmatter
{
    "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.

Version History

  • dd56585 Current 2026-11-16 13:49

Same Skill Collection

local/.claude/skills/agent-observability/SKILL.md
local/.claude/skills/brainstorming/SKILL.md
local/.claude/skills/knowledge-distillation/SKILL.md
local/.claude/skills/tech-design/SKILL.md
local/.claude/skills/writing-plans/SKILL.md
local/.codebuddy/skills/agent-observability/SKILL.md
local/.codebuddy/skills/brainstorming/SKILL.md
local/.codebuddy/skills/knowledge-distillation/SKILL.md
local/.codebuddy/skills/tech-design/SKILL.md
local/.codebuddy/skills/writing-plans/SKILL.md
local/.codex/skills/devflow-codex/SKILL.md
local/.codex/skills/knowledge-distillation/SKILL.md
local/.codex/skills/superpowers/brainstorming/SKILL.md
local/.cursor/skills/brainstorming/SKILL.md
local/.cursor/skills/knowledge-distillation/SKILL.md
local/.cursor/skills/tech-design/SKILL.md
local/.cursor/skills/writing-plans/SKILL.md
local/skills/devflow-clarify-requirements/SKILL.md
local/skills/devflow/SKILL.md
skills/report-workflow-usage/SKILL.md

Metadata

Files
0
Version
dd56585
Hash
7a28075a
Indexed
2026-11-16 13:49

Home - Wiki
Copyright © 2011-2026 iteam. Current version is 2.156.0. UTC+08:00, 2026-11-16 14:14
浙ICP备14020137号-1