AI Agent Hub
Back to skills
Trace Collector icon

Trace Collector

IT Ops & Security Updated 2026.08.30

Paste the following prompt into your AI chat to install this skill:

Please follow https://skillhub.cn/install/skillhub.md to install @user_00e53692/trace-collector.

About this skill

Problem

After a skill runs inside an IDE session, engineers often lack a reviewable execution record: which tool_pair events belonged to the target skill, how much token or credit each step consumed, which outputs were final artifacts, and which retries or failures need investigation. trace-collector turns session messages, IDE logs, output artifacts, and backend upload into an auditable trail.

How It Works

The skill has two independent flows: init skill reports the local skill directory and creates a version; collect trace captures the current session after a target skill has finished. It anchors on the most recent use_skill, load_skill, or skill_loader call and strips earlier history, so starting a new chat is usually unnecessary. It first extracts trace_raw.jsonl, then parses IDE logs for real per-call usage, cache hits, credits, duration, bash bytes, and compression events. The main agent reads trace_compact.json and writes only a step outline plus target_skill_outputs, while the hydrate script restores full args and result excerpts by event index. The run produces trace_steps.json, facts.json, copied outputs under output/, and uploads the whitelisted files to the backend.

Boundaries

It is designed for completed target skill runs, not real-time tracing. If the same skill is invoked multiple times in one session, only the latest run is collected. If no skill invocation is detected, the script keeps the full history and emits warnings for manual review. The API key must be entered manually each time, and upload failures do not degrade; rerun the idempotent upload.

Use Cases

  • After debugging a target skill, segment the latest `use_skill` run, extract the raw trace, and generate a token report.
  • While reviewing LLM cost, parse IDE logs for per-call `input`, `output`, `cache`, `credit`, and `duration`.
  • When registering a skill version, upload the local skill directory, skip ignored folders, and obtain a version number.
  • When validating final artifacts, copy files listed in `target_skill_outputs` into `trace/output` and generate a manifest.

Best For

  • Skill maintenance engineers who need to report a local skill directory as a platform version and verify uploaded files.
  • Algorithm engineers reviewing token cost who need real per-call usage, cache hits, and credits.
  • SREs debugging skill failure chains who need the latest skill run segmented and bash failures identified.
  • Test engineers validating deliverables who need final skill outputs copied and listed in a manifest.