clean
Recursively clean bin/obj folders with optional package cache and artifacts cleanup
What this skill does
# /dotnet:clean
Recursively clean build artifacts (bin/obj folders) with options for package cache and artifacts folders.
## Arguments
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 |
## Workflow
### Step 1: Locate Target
If `--project` specified:
1. Use Glob to find matching `.csproj` file
2. Scope cleaning to that project's directory only
If no project specified:
1. Find solution file in current/parent directories
2. Clean all projects in solution directory tree
### Step 2: Find Directories to Clean
Always clean:
- `**/bin/` directories
- `**/obj/` directories
If `--packages` or `--all`:
- Local `.packages/` folder if exists
- NuGet HTTP cache for this solution (use `dotnet nuget locals http-cache --clear`)
If `--artifacts` or `--all`:
- `**/publish/` directories
- `**/artifacts/` directories
- `**/.artifacts/` directories (SDK-style artifacts output)
### Step 3: Calculate Size
Before deletion, calculate total size:
```bash
# For each directory found, sum sizes
du -sh <directories>
```
### Step 4: Execute or Report
If `--dry-run`:
```text
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`:
1. Delete directories using platform-appropriate commands:
- Windows: `Remove-Item -Recurse -Force` or `rm -rf` (Git Bash)
- Unix: `rm -rf`
2. Report results:
```text
Cleaned 4 directories, freed 88 MB
Deleted:
src/MyApp/bin/
src/MyApp/obj/
tests/MyApp.Tests/bin/
tests/MyApp.Tests/obj/
```
### Step 5: Clear NuGet Cache (if requested)
If `--packages` or `--all`:
```bash
dotnet nuget locals http-cache --clear
dotnet nuget locals temp --clear
```
Report cache clearing results.
## Platform Considerations
**Windows (Git Bash):**
```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:**
```bash
find . -type d \( -name "bin" -o -name "obj" \) -exec rm -rf {} + 2>/dev/null || true
```
## Output Format
**Dry Run:**
```text
[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:**
```text
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:**
```text
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
```
## Examples
```bash
# 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
```
## Safety
- Always shows what will be deleted before proceeding (unless --dry-run)
- Does not delete source files
- Does not delete git-tracked files
- Skips directories that fail to delete (reports them)
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.