Package
One command cleans the project for distribution: remove caches, secrets, and artifacts.
Pipeline
Dry-run → Confirm → Execute → Verify
⚠️ Activate .venv before running scripts.
- Windows:
.\.venv\Scripts\Activate.ps1
- macOS/Linux:
source .venv/bin/activate
Step 1: Dry Run
Show what will be removed without deleting anything:
python .github/skills/package/scripts/clean.py
Review the output with the user. The script lists:
- 📁 Directories to remove (with sizes)
- 📄 Files to remove (with sizes)
- 🔐 Config values to sanitize (API keys → placeholders)
Step 2: Confirm with User
Before executing, summarize what will be deleted and ask the user to confirm. Offer options:
--keep-data — preserve data/ and logs/ (useful if user wants to keep ingested documents)
--no-sanitize — skip API key replacement in config/settings.yaml
Step 3: Execute
# Full clean (removes everything including data)
python .github/skills/package/scripts/clean.py --execute
# Keep data and logs
python .github/skills/package/scripts/clean.py --execute --keep-data
# Skip secret sanitization
python .github/skills/package/scripts/clean.py --execute --no-sanitize
Step 4: Verify
After cleanup, verify the workspace is clean:
# Check no __pycache__ remains
python -c "import pathlib; found=list(pathlib.Path('.').rglob('__pycache__')); print(f'{len(found)} __pycache__ dirs remaining') if found else print('Clean')"
# Check no .venv remains
python -c "import pathlib; print('.venv still exists') if pathlib.Path('.venv').exists() else print('Clean')"
# Check settings.yaml has no real API keys
python -c "
import re, pathlib
text = pathlib.Path('config/settings.yaml').read_text()
keys = re.findall(r'api_key:\s*\"([^\"]+)\"', text)
real = [k for k in keys if k not in ('YOUR_API_KEY_HERE', '')]
print(f'{len(real)} real API key(s) found') if real else print('API keys sanitized')
"
Report results to user.
What Gets Removed
| Category |
Patterns |
| Python caches |
__pycache__/, *.pyc, *.pyo, .pytest_cache/, .mypy_cache/, .ruff_cache/ |
| Virtual envs |
.venv/, venv/, env/ |
| Build artifacts |
build/, dist/, *.egg-info/, .eggs/, wheels/ |
| IDE files |
.idea/, .vscode/, *.swp, *.swo |
| Coverage |
htmlcov/, .coverage, coverage.xml, .tox/, .nox/ |
| Data & logs |
data/, logs/, cache/ (skip with --keep-data) |
| Secrets |
.env, .env.local, secrets.yaml, test_credentials.yaml |
| Stale artifacts |
nonexistent_traces.jsonl/ |
| Config backups |
settings.yaml.bak, settings.yaml.qa_backup |
| Test artifacts |
.claude/skills/test-skill/, test_data/chroma/ |
| Skill caches |
.github/skills/auto-coder/.spec_hash, .claude/skills/auto-coder/.spec_hash |
What Gets Sanitized (not removed)
config/settings.yaml: api_key → "YOUR_API_KEY_HERE", azure_endpoint → placeholder
1---2name: package3description: Clean and package the project for distribution. Removes __pycache__, .venv, build artifacts, data caches, logs, IDE files, coverage reports, and sanitizes API keys in config. Produces a minimal, ready-to-share codebase. Use when user says 'package', 'clean project', 'clean up', '打包', '清理项目', '清理缓存', 'prepare for distribution', 'remove caches', or wants to deliver a clean copy of the code.4---56# Package78One command cleans the project for distribution: remove caches, secrets, and artifacts.910---1112## Pipeline1314```15Dry-run → Confirm → Execute → Verify16```1718> **⚠️ Activate `.venv` before running scripts.**19> - **Windows**: `.\.venv\Scripts\Activate.ps1`20> - **macOS/Linux**: `source .venv/bin/activate`2122---2324## Step 1: Dry Run2526Show what will be removed without deleting anything:2728```powershell29python .github/skills/package/scripts/clean.py30```3132Review the output with the user. The script lists:33- 📁 Directories to remove (with sizes)34- 📄 Files to remove (with sizes)35- 🔐 Config values to sanitize (API keys → placeholders)3637## Step 2: Confirm with User3839Before executing, summarize what will be deleted and ask the user to confirm. Offer options:40- `--keep-data` — preserve `data/` and `logs/` (useful if user wants to keep ingested documents)41- `--no-sanitize` — skip API key replacement in `config/settings.yaml`4243## Step 3: Execute4445```powershell46# Full clean (removes everything including data)47python .github/skills/package/scripts/clean.py --execute4849# Keep data and logs50python .github/skills/package/scripts/clean.py --execute --keep-data5152# Skip secret sanitization53python .github/skills/package/scripts/clean.py --execute --no-sanitize54```5556## Step 4: Verify5758After cleanup, verify the workspace is clean:5960```powershell61# Check no __pycache__ remains62python -c "import pathlib; found=list(pathlib.Path('.').rglob('__pycache__')); print(f'{len(found)} __pycache__ dirs remaining') if found else print('Clean')"6364# Check no .venv remains65python -c "import pathlib; print('.venv still exists') if pathlib.Path('.venv').exists() else print('Clean')"6667# Check settings.yaml has no real API keys68python -c "69import re, pathlib70text = pathlib.Path('config/settings.yaml').read_text()71keys = re.findall(r'api_key:\s*\"([^\"]+)\"', text)72real = [k for k in keys if k not in ('YOUR_API_KEY_HERE', '')]73print(f'{len(real)} real API key(s) found') if real else print('API keys sanitized')74"75```7677Report results to user.7879---8081## What Gets Removed8283| Category | Patterns |84|----------|----------|85| Python caches | `__pycache__/`, `*.pyc`, `*.pyo`, `.pytest_cache/`, `.mypy_cache/`, `.ruff_cache/` |86| Virtual envs | `.venv/`, `venv/`, `env/` |87| Build artifacts | `build/`, `dist/`, `*.egg-info/`, `.eggs/`, `wheels/` |88| IDE files | `.idea/`, `.vscode/`, `*.swp`, `*.swo` |89| Coverage | `htmlcov/`, `.coverage`, `coverage.xml`, `.tox/`, `.nox/` |90| Data & logs | `data/`, `logs/`, `cache/` (skip with `--keep-data`) |91| Secrets | `.env`, `.env.local`, `secrets.yaml`, `test_credentials.yaml` |92| Stale artifacts | `nonexistent_traces.jsonl/` |93| Config backups | `settings.yaml.bak`, `settings.yaml.qa_backup` |94| Test artifacts | `.claude/skills/test-skill/`, `test_data/chroma/` |95| Skill caches | `.github/skills/auto-coder/.spec_hash`, `.claude/skills/auto-coder/.spec_hash` |9697## What Gets Sanitized (not removed)9899- `config/settings.yaml`: `api_key` → `"YOUR_API_KEY_HERE"`, `azure_endpoint` → placeholder