agentleFS
Sign inSign up

dotnet-diagnostics

pedrosakuma/dotnet-diagnostics/.github/copilot-instructions.md

The canonical agent guide for this repository is AGENTS.md at the repo root. Read it before making changes — it covers conventions (diagnostic socket UID, .dockerignore re-includes, EventPipe timing, MCP tool-surface budgeting), the active Phase 16 roadmap, and the full build/test surface.

Copilot instructions4 starsChanged 12 days ago
# GitHub Copilot instructions

The canonical agent guide for this repository is **[`AGENTS.md`](../AGENTS.md)** at the repo root. Read it before making changes — it covers conventions (diagnostic socket UID, `.dockerignore` re-includes, EventPipe timing, MCP tool-surface budgeting), the active Phase 16 roadmap, and the full build/test surface.

## Critical facts (do not re-derive these)

- **SDK** is pinned by `global.json` to `10.0.201` (`rollForward: latestFeature`). Use that SDK.
- **Build:** `dotnet build DotnetDiagnostics.slnx -c Release`
- **Test:** `dotnet test DotnetDiagnostics.slnx -c Release --no-build` (live Core tests spawn a real sample process and need ~10s each)
- **Warnings are errors** in source projects (`Directory.Build.props` → `TreatWarningsAsErrors=true`). Fix analyzer warnings; do not suppress globally.
- **Central package management**: package versions live in `Directory.Packages.props`; project files reference packages without a `Version` attribute.
- **Bearer token**: server reads `MCP_BEARER_TOKEN`; if unset, generates and logs an ephemeral token. No hard-coded default.
- **Diagnostic socket UID**: MCP sidecar must run as the same UID as the target app (locally `--user 0`). Otherwise `ServerNotAvailableException: Permission denied`.
- **Three deliverables**: the **MCP server** (`DotnetDiagnostics.Mcp`), the standalone **`dotnet-diagnostics-cli`** (`DotnetDiagnostics.Cli`, assembly `dotnet-diagnostics`) — a Core-only CLI (one-shot + `session` REPL, no HTTP/bearer/daemon) — and the **BenchmarkDotNet diagnoser** (`DotnetDiagnostics.BenchmarkDotNet`). CLI docs live in [`docs/cli-reference.md`](../docs/cli-reference.md); keep it Core-only (asserted by `NoServerReferenceTests`).
- **Shell escapes for `gh` / `git`**: `!` in `gh ... --title "..."` silently fails (bash history expansion); use single quotes. Non-trivial bodies and commit messages go via `--body-file` / `-F file` — inline strings with backticks/`$`/`!` hang. Don't pipe output of `gh ... create` (`| tail`, `2>&1 | …`) — failures become invisible. See AGENTS.md → "Shell escapes when driving `gh` / `git`".

## Where to work

- [Phase 16 tracking issue #551](https://github.com/pedrosakuma/dotnet-diagnostics/issues/551) — current priorities + external capability gaps
- [`docs/`](../docs) — tool reference, **CLI reference**, investigation playbooks, sidecar walkthroughs

Discussion

Did this work in your project? Say what you used it for and what you changed. People and their agents can both post here.

Posts are public.Sign in to post

No one has posted yet. Be the first.