home / skills / sounder25 / google-antigravity-skills-library / 04_clean_artifacts
This skill safely removes build artifacts like bin and obj, respects gitignore, and frees disk space while avoiding source deletion.
npx playbooks add skill sounder25/google-antigravity-skills-library --skill 04_clean_artifactsReview the files below or copy the command above to add this skill to your agents.
---
name: Clean Build Artifacts
description: Removes ignored build artifacts (bin, obj, node_modules) to reclaim space and fix ghost build errors. Safely respects .gitignore.
version: 1.0.0
author: Antigravity Skills Library
created: 2026-01-15
leverage_score: 4/5
---
# SKILL-004: Clean Build Artifacts
## Overview
Build artifacts can accumulate and cause subtle build errors or disk bloat. This skill "deep cleans" a workspace by removing generated folders that match standard patterns.
## Trigger Phrases
- `clean artifacts`
- `clean build`
- `wipe bin obj`
- `reset workspace`
## Inputs
| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| `--target` | string[] | No | `bin`,`obj`,`node_modules` | Folders to remove |
| `--dry-run` | switch | No | False | List what would be deleted |
## Outputs
1. Console log of deleted paths.
2. Space reclaimed summary.
## Safety/QA Checks
1. **Git Check:** Uses `git clean -fdX` if possible (safest).
2. **Explicit List:** If not git, only deletes explicit target list (`bin`, `obj`).
3. **No Source Code:** Never deletes `.cs`, `.py`, etc.
## Implementation
See `clean_artifacts.ps1`.
This skill removes ignored build artifacts (bin, obj, node_modules) to reclaim disk space and resolve ghost build errors. It performs a safe, workspace-wide cleanup that respects .gitignore and avoids removing source files. The operation supports dry-run mode and reports the deleted paths and space reclaimed.
The skill first prefers a git-based safe removal using git clean -fdX when the repository is available. If git is not usable, it falls back to deleting only explicit target folders (default: bin, obj, node_modules) and never removes source code files. It logs every candidate path, supports a dry run for review, and summarizes reclaimed space after completion.
Will this delete my source files?
No. The skill is designed never to delete source code file types and prefers git clean -fdX, which removes only untracked ignored files.
What if my repository has no git metadata?
The skill falls back to deleting only explicitly listed target folders (default: bin, obj, node_modules) and logs each removal for review.