# Cs0618 Hunter

> Detects and fixes CS0618 obsolete API warnings in .NET builds. The compiler is the authoritative source for what your project actually triggers — it catches transitive obsoletions, overload-resolution surprises, and project-local [Obsolete] attributes that static inspection cannot see. Pair with dotnet-inspect@0.7.8+ for the static / pre-build view.

- **Type:** Skill
- **Install:** `agentstack add skill-joslat-maf-doctor-cs0618-hunter`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [joslat](https://agentstack.voostack.com/s/joslat)
- **Installs:** 0
- **Category:** [Developer Tools](https://agentstack.voostack.com/c/developer-tools)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [joslat](https://github.com/joslat)
- **Source:** https://github.com/joslat/maf-doctor/tree/main/.github/skills/cs0618-hunter

## Install

```sh
agentstack add skill-joslat-maf-doctor-cs0618-hunter
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# cs0618-hunter — compiler ground-truth for obsolete API usage

> **⚡ Prefer the MCP tool.** The `maf-autopilot` MCP server exposes **`MafRunCs0618Hunt(projectPath)`** — it shells `dotnet build`, parses every CS0618 / CS0246 diagnostic, joins each one to its canonical fix in the obsolete-API registry, and returns a structured report. The procedural walkthrough below is preserved for when you need to run the steps manually (offline, debugging the tool itself, etc.).

## Why the compiler stays authoritative

`dotnet-inspect@0.7.8+` now surfaces `[Obsolete]` in member listings (PR [#318](https://github.com/richlander/dotnet-inspect/pull/318) closes issue [#316](https://github.com/richlander/dotnet-inspect/issues/316)). That's an excellent pre-build static check, but **three classes of obsoletion remain compiler-only**:

1. **Transitive obsoletions** — the API your code calls isn't obsolete, but it forwards to one that is.
2. **Overload-resolution surprises** — a more-specific overload was added in a minor release and your literal types now bind to it.
3. **Project-local `[Obsolete]`** — types your team marked obsolete in this solution. Static inspection of NuGet packages can't see those.

For all three, `dotnet build | Select-String "warning CS0618"` is the only authoritative answer.

## Manual fallback workflow

When `MafRunCs0618Hunt` is unavailable:

```powershell
# Step 1: get the baseline
dotnet build 2>&1 | Select-String "warning CS0618"

# Step 2: for each warning, look up the canonical fix in the registry
# (the LLM should call MafRegistryLookup with the matching entry ID,
#  or open .github/skills/maf-obsolete-api-registry/registry.yaml)

# Step 3: apply the fix; re-run the build; confirm the warning is gone

# Step 4: move on to the next warning. Never batch.

# Step 5: declare done only when:
dotnet build 2>&1 | Select-String "warning CS0618" | Measure-Object | Select-Object -ExpandProperty Count
# returns 0.
```

## Quick reference

| Command                                        | Purpose                              |
|------------------------------------------------|--------------------------------------|
| `MafRunCs0618Hunt(projectPath)` (MCP)          | Full automated CS0618/CS0246 hunt    |
| `MafApiSafety(apiName)` (MCP)                  | Is a single API safe? (registry only)|
| `MafRegistryLookup(entryId)` (MCP)             | Full fix details for entry ID        |
| `dotnet build 2>&1 \| Select-String "CS0618"` | Manual baseline scan                  |

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [joslat](https://github.com/joslat)
- **Source:** [joslat/maf-doctor](https://github.com/joslat/maf-doctor)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-joslat-maf-doctor-cs0618-hunter
- Seller: https://agentstack.voostack.com/s/joslat
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
