Skip to content
Back to skills

Dotnet Diagnostics

ASecurity

Diagnoses .NET process hangs, crashes, memory growth, CPU saturation, thread-pool starvation, and runtime incidents using dotnet-counters, dotnet-trace, dumps, logs, and reproducible evidence. Use for live runtime state; use async-concurrency for code-level design fixes.

  • 7 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 4, 2026
ai-agentsgotestingperformance

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned December 4, 2026

npx -y skills add k4ndev/claude-code-dotnet --skill dotnet-diagnostics --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Dotnet Diagnostics?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Dotnet Diagnostics
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/k4ndev-dotnet-diagnostics/badge)](https://www.skillsdirectory.com/skills/k4ndev-dotnet-diagnostics)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: dotnet-diagnostics
description: Diagnoses .NET process hangs, crashes, memory growth, CPU saturation, thread-pool starvation, and runtime incidents using dotnet-counters, dotnet-trace, dumps, logs, and reproducible evidence. Use for live runtime state; use async-concurrency for code-level design fixes.
---

# .NET Diagnostics

## Purpose
Collect and interpret the least invasive runtime evidence needed to distinguish a .NET process failure mode.

## Scope
`dotnet-counters`, `dotnet-trace`, `dotnet-dump`, EventPipe, runtime logs, process/environment facts, and incident hypothesis testing.

## When to use
- A running .NET process hangs, crashes, consumes excessive CPU/memory, or shows thread-pool starvation/queue growth.
- User asks which diagnostics to collect or how to interpret runtime artifacts.

## Do not use for
- Pure code-level async refactor without runtime evidence: use `async-concurrency`.
- Query/algorithm optimization after bottleneck is known: use `performance-review` / `efcore-patterns`.
- Destructive process/service actions, production restart, or unapproved dump capture.

## Required context
Confirm runtime/OS, process identity and PID, environment/container, symptom timeline, impact, permissions, available disk, data sensitivity, and whether production capture is authorized. Dumps can contain credentials and personal data.

## Workflow
1. Establish impact and preserve timestamps, logs, deployment/runtime version, process uptime, and resource limits.
2. Form hypotheses (CPU-bound, blocked threads, GC/memory, lock contention, dependency wait, crash) and collect baseline counters first.
3. Use `dotnet-counters monitor --process-id <pid>` (or installed SDK equivalent) for short-term CPU/GC/thread-pool/request counters; stop monitoring cleanly after the agreed window.
4. Capture a bounded `dotnet-trace collect --process-id <pid> --duration <duration>` when event timelines are needed; verify output path, size, and sensitive-data handling.
5. Capture `dotnet-dump collect --process-id <pid>` only when authorized and storage/privacy controls are in place; analyze a copy with `dotnet-dump analyze` and use SOS commands such as `dumpheap -stat`, `clrthreads`, or `syncblk` only when supported by the runtime.
6. Correlate artifacts with application logs/traces and incident timestamps; distinguish evidence from hypothesis.
7. Propose the smallest code/configuration fix and a follow-up metric/test; use `async-concurrency` or a domain skill for remediation.

## Decision rules
- Prefer counters before expensive full dumps; select artifact based on hypothesis.
- Never kill/restart a process, change limits, expose a dump, or run expensive production collection without explicit authorization.
- Do not upload dumps to third parties or include secrets in reports. Store restricted artifacts per the incident retention policy and recommend secure deletion only by the owner.
- Tool availability, permissions, runtime matching, container PID namespace, and diagnostic port constraints affect collection; report failures honestly.

## Expected output format
State symptom/time window, hypotheses, exact commands and execution status, artifacts/metrics observed (redacted), interpretation with confidence, next evidence, and safe remediation owner.

## Common mistakes
- Treating high allocation rate as proof of a leak, capturing a dump before checking its size/privacy, using host PID instead of container PID, or claiming causality from one snapshot.

## Edge cases
- A dump may pause the process and may not capture native/container memory fully; verify runtime/OS limitations.
- Thread-pool starvation indicators require workload/context; sync waits and slow downstream I/O can both contribute.
- A container may need diagnostics tooling/port access that is intentionally unavailable in production.

## Examples
See [diagnostics examples](examples.md) for a low-impact first pass and a protected dump workflow.

## Test scenarios
- Positive: “Our ASP.NET process has rising GC heap and latency; give me a safe, staged evidence plan.”
- Negative: “Should a consumer use a bounded channel?” routes to `async-concurrency`.
- Boundary: a production hang combines runtime evidence here with code-level task ownership from `async-concurrency`.

## Related skills
`async-concurrency`, `performance-review`, `logging-observability`, `messaging-patterns`, `testing-quality`.

Files in this skill

  • SKILL.md4.3 KB
  • examples.md1.6 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.