Agent Skills › Tencent/LoopForge › agent-observability

agent-observability

GitHub

为 CodeBuddy 项目配置 Hook 可观测性,收集工具延迟、Token 用量及会话成本指标。通过合并配置模板、运行会话并检查指标日志,支持调试遥测数据缺失问题,确保非阻塞式监控。

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

触发场景

需要本地化监控工具调用延迟或 Token 消耗 调试多智能体会话中的遥测数据缺失或不准确

安装

npx skills add Tencent/LoopForge --skill agent-observability -g -y
更多选项

非标准路径

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

不安装直接使用

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.

版本历史

  • dd56585 当前 2026-11-16 13:49

同 Skill 集合

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/agent-observability/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

元信息

文件数
0
版本
9abc8f3
Hash
7a28075a
收录时间
2026-11-16 13:49

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.156.0. UTC+08:00, 2026-11-17 02:56
浙ICP备14020137号-1