petekp/agent-skills/agent-telemetry
Claude Code and agent skill by petekp/agent-skills
- community
Checking that the SKILL.md file is still in the repository.
Make application behavior visible to coding agents by exposing structured logs and telemetry. Use when asked to "add telemetry", "make logs accessible to agents", "add observability", "debug with logs", or when an agent needs to understand runtime behavior but has no way to query logs. Also use when debugging is difficult because there are no structured logs, when agent docs (CLAUDE.md, AGENTS.md) lack instructions for querying application logs, or when setting up logging infrastructure for a new or existing web application.
Install
npx vskill@latest install petekp/agent-skills/agent-telemetrySKILL.md
Agent Telemetry
Make application runtime behavior queryable by coding agents through structured logging and telemetry endpoints.
Core Problem
Coding agents debugging issues often can't answer "what actually happened at runtime?" because:
- Logs don't exist, or are unstructured
console.lognoise - Logs exist but there's no documented way for agents to query them
- Agent docs (CLAUDE.md, AGENTS.md) don't mention how to access telemetry
Workflow
Phase 1: Audit Current State
Determine what telemetry already exists.
1. Check for logging infrastructure:
2. Check for existing telemetry endpoints:
3. Check agent docs for log access instructions:
4. Classify the result:
| Finding | Action | |
|---|---|---|
| No structured logging exists | Go to Phase 2 | |
| Logging exists but no agent access | Go to Phase 3 | |
| Logging + access exists but undocumented | Go to Phase 4 | |
| Everything in place | Validate and suggest improvements |
Phase 2: Add Structured Logging
If no structured logging exists, add it. See references/logging-setup.md for framework-specific patterns.
Principles:
- Use structured JSON logs, not string interpolation
- Include correlation IDs for request tracing
- Log at boundaries: incoming requests, outgoing calls, errors, state transitions
- Use consistent field names:
timestamp,level,message,requestId,userId,duration,error
Where to add logging (priority order):
- Request/response middleware (every request gets logged)
- Error handlers (unhandled errors get captured with context)
- External service calls (DB queries, API calls, queue operations)
- Business logic decision points (state transitions, authorization decisions)
Minimum viable logging — add a request logger middleware that captures:
This single addition makes most debugging possible.
Phase 3: Expose Logs to Agents
Agents need a way to query logs without SSH access or cloud console dashboards. Provide at least one of:
Option A: Log file (simplest) Write structured logs to a known file path agents can read directly.
Option B: Dev log endpoint (recommended for web apps) Add a development-only endpoint that returns recent log entries with filtering.
This endpoint must:
- Only be available in development (
NODE_ENV=developmentor equivalent) - Return JSON array of log entries
- Support filtering by level, path, timerange, requestId
- Limit response size (default 100 entries)
See references/dev-endpoint.md for implementation patterns by framework.
Option C: CLI query tool Wrap log access in a script agents can execute:
Choose based on project context:
| Project Type | Best Option | |
|---|---|---|
| Next.js / Express / Rails with local dev | Option B (dev endpoint) | |
| CLI tool or background worker | Option A (log file) | |
| Docker-based development | Option A (mounted log volume) or Option C | |
| Monorepo with multiple services | Option C (unified query script) |
Phase 4: Document in Agent Docs
This is critical. Without documentation, agents won't know telemetry exists.
Update CLAUDE.md (or equivalent agent doc) with a Debugging section:
View recent errors
[command to view errors]
View logs for a specific endpoint
[command to filter by path]
View logs for a specific request
[command to filter by request ID]
View logs from the last N minutes
[command to filter by time]
{ "timestamp": "ISO-8601", "level": "info|warn|error", "message": "Human-readable description", "requestId": "correlation-id", "method": "GET", "path": "/api/resource", "statusCode": 200, "duration": 45 }
Key rules for the documentation:
- Include copy-pasteable commands (agents execute, not read)
- Show the log schema so agents know what fields to filter on
- List 3-4 common debugging workflows with exact commands
- Mention where log config lives for agents that need to adjust log levels
Phase 5: Validate
Test the full loop:
- Trigger a request — hit an endpoint or run an operation
- Query the logs — use the documented method to find the log entry
- Verify agent usability — can an agent find the relevant log in <3 commands?
- Check error capture — trigger an error and verify it appears with full context
If any step fails, iterate on the logging or documentation.
Anti-Patterns
| Anti-Pattern | Why It's Bad | Do Instead | |
|---|---|---|---|
console.log("here") | No structure, no context, no filtering | Structured JSON with consistent fields | |
| Logs only in cloud dashboard | Agents can't access Datadog/CloudWatch | Local file or dev endpoint | |
| Log everything at debug level | Too noisy, can't find signal | Log at boundaries, use appropriate levels | |
| Logging sensitive data | PII in logs is a liability | Redact tokens, passwords, PII | |
| No request correlation | Can't trace a request across log lines | Add requestId to every log entry | |
| Docs say "check the logs" with no how | Agent doesn't know where or how | Exact commands with examples |
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/agent-telemetry/SKILL.md
Popularity
- Repository stars
- 4
- Repository forks
- 1
- 7-day trend score
- 8
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 19 Apr 2026, 6 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/petekp/agent-skills/agent-telemetry)