plugins/dotnet/skills/clean/SKILL.md
Recursively clean bin/obj folders with optional package cache and artifacts cleanup
npx skillsauth add melodic-software/claude-code-plugins cleanInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Recursively clean build artifacts (bin/obj folders) with options for package cache and artifacts folders.
Parse arguments from $ARGUMENTS:
| Flag | Description | Default |
|------|-------------|---------|
| --all | Clean bin, obj, packages, and artifacts | false |
| --packages | Also clear NuGet packages cache for solution | false |
| --artifacts | Also clean publish/artifacts folders | false |
| --project <path> | Target specific project (fuzzy matching) | All projects |
| --dry-run | Show what would be deleted without deleting | false |
If --project specified:
.csproj fileIf no project specified:
Always clean:
**/bin/ directories**/obj/ directoriesIf --packages or --all:
.packages/ folder if existsdotnet nuget locals http-cache --clear)If --artifacts or --all:
**/publish/ directories**/artifacts/ directories**/.artifacts/ directories (SDK-style artifacts output)Before deletion, calculate total size:
# For each directory found, sum sizes
du -sh <directories>
If --dry-run:
Would delete the following directories:
bin/obj folders:
src/MyApp/bin/ (45 MB)
src/MyApp/obj/ (12 MB)
tests/MyApp.Tests/bin/ (23 MB)
tests/MyApp.Tests/obj/ (8 MB)
Total: 88 MB across 4 directories
Run without --dry-run to delete.
If NOT --dry-run:
Delete directories using platform-appropriate commands:
Remove-Item -Recurse -Force or rm -rf (Git Bash)rm -rfReport results:
Cleaned 4 directories, freed 88 MB
Deleted:
src/MyApp/bin/
src/MyApp/obj/
tests/MyApp.Tests/bin/
tests/MyApp.Tests/obj/
If --packages or --all:
dotnet nuget locals http-cache --clear
dotnet nuget locals temp --clear
Report cache clearing results.
Windows (Git Bash):
find . -type d \( -name "bin" -o -name "obj" \) -exec rm -rf {} + 2>/dev/null || true
Windows (PowerShell) - AVOID:
Do NOT use PowerShell for deletion. Use Git Bash rm -rf instead.
Unix/macOS:
find . -type d \( -name "bin" -o -name "obj" \) -exec rm -rf {} + 2>/dev/null || true
Dry Run:
[DRY RUN] Would clean the following:
bin/obj folders (4 directories, 88 MB):
- src/MyApp/bin/ (45 MB)
- src/MyApp/obj/ (12 MB)
- tests/MyApp.Tests/bin/ (23 MB)
- tests/MyApp.Tests/obj/ (8 MB)
Run without --dry-run to delete.
Actual Clean:
Cleaned .NET build artifacts
Removed: 4 directories
Freed: 88 MB
Directories deleted:
- src/MyApp/bin/
- src/MyApp/obj/
- tests/MyApp.Tests/bin/
- tests/MyApp.Tests/obj/
With Packages:
Cleaned .NET build artifacts and NuGet cache
Build artifacts: 4 directories, 88 MB
NuGet HTTP cache: cleared
NuGet temp cache: cleared
Total freed: ~150 MB
# Clean bin and obj folders
/dotnet:clean
# Preview what would be cleaned
/dotnet:clean --dry-run
# Clean everything including package cache
/dotnet:clean --all
# Clean specific project
/dotnet:clean --project MyApp.Api
# Clean including artifacts folders
/dotnet:clean --artifacts
development
Search Milan Jovanovic's .NET blog for Clean Architecture, DDD, CQRS, EF Core, and ASP.NET Core patterns. Use for finding applicable patterns, code examples, and architecture guidance. Invoke when working with .NET projects that could benefit from proven architectural patterns.
tools
Install and configure Data API Builder (DAB) for production SQL Server MCP access with RBAC
tools
Manage MssqlMcp servers - status, rebuild, and upstream updates
tools
Developer environment setup guides for Windows, macOS, Linux, and WSL. Use when setting up development machines, installing tools, configuring environments, or following platform-specific setup guides. Covers package management, shell/terminal, code editors, AI tooling, containerization, databases, and more.