garbage-collector
The garbage-collector skill scans specified local directories like Downloads and Trash against a rule set to identify cleanup targets, generates a preview report showing proposed actions, and executes only user-approved deletions or moves with full logging for potential undo. Use it when users request computer cleanup, duplicate file removal, or safe deletion of outdated items.
git clone --depth 1 https://github.com/Prompthon-IO/agent-systems-handbook /tmp/garbage-collector && cp -r /tmp/garbage-collector/skills/garbage-collector ~/.claude/skills/garbage-collectorSKILL.md
# Garbage Collector For a student-facing explanation of why this package exists and how the end-to-end workflow fits into the handbook, read `README.md` first. This file is the invocation contract for Codex. ## Overview Use this skill to propose and execute safe local cleanup tasks. The skill is preview-first: scan the requested paths, show cleanup suggestions, wait for explicit user approval, then run only the approved cleanup actions. The initial rule store is `references/cleanup-rules.csv`. Keep rules readable by people and agents; a later implementation can migrate them into SQLite if the workflow needs richer history or per-user state. ## Safety Rules - Never delete, move, or overwrite files during the preview step. - Never scan `/`, system folders, external drives, or cloud-sync folders unless the user names them explicitly. - Treat "scan my computer" as `~/Downloads` and `~/.Trash` first, plus any user-approved extra paths. - Require explicit approval before cleanup. If the cleanup includes permanent deletion from Trash, require a separate destructive confirmation. - Prefer reversible actions. Duplicate Downloads cleanup should move duplicate files into a quarantine folder inside the OS Trash, not permanently delete them. - Log every applied action and keep enough information to support undo where possible. ## Default Workflow 1. Read `references/cleanup-rules.csv`. 2. Ask for or infer a safe scan target. Default to `~/Downloads` and `~/.Trash` when the user says "my computer" without more detail. 3. Run a preview scan with `scripts/garbage_collector.py scan`. 4. Summarize the generated Markdown report for the user. 5. If the user approves, run `scripts/garbage_collector.py apply` against the generated plan file. 6. Report applied actions, skipped actions, and the undo log path. ## Commands Resolve `scripts/garbage_collector.py` relative to this skill directory. When running from an installed Codex copy, that is usually `~/.codex/skills/garbage-collector/scripts/garbage_collector.py`. Preview the default targets: ```bash python3 scripts/garbage_collector.py scan ``` Preview a specific folder: ```bash python3 scripts/garbage_collector.py scan --target "$HOME/Downloads" ``` Apply a generated plan after user approval: ```bash python3 scripts/garbage_collector.py apply --plan /path/to/plan.json --confirm CLEANUP ``` Apply a plan that includes permanent Trash deletion only after explicit destructive confirmation: ```bash python3 scripts/garbage_collector.py apply \ --plan /path/to/plan.json \ --confirm CLEANUP \ --allow-permanent-delete ``` Undo reversible move actions from an action log: ```bash python3 scripts/garbage_collector.py undo --log /path/to/actions.json ``` ## Initial Rules The first two rule families are: - `trash-can`: suggest permanent cleanup for files already in the OS Trash, with an age threshold. - `duplicate-downloads`: find duplicate files in Downloads by size and SHA-256 hash, keep one copy, and move extra copies to a quarantine folder in Trash only after approval. Add new rules by extending `references/cleanup-rules.csv`. Keep `rule_id`, `scope`, `default_action`, and `rule_text` clear enough for another Codex run to understand without hidden context. ## Outputs The helper writes local runtime artifacts under: ```text ~/.codex/state/garbage-collector/ reports/ plans/ logs/ ``` Do not commit runtime reports, plans, or logs unless the user explicitly asks for sample artifacts. ## Response Pattern When reporting results to the user, include: - scan targets - number of suggestions - estimated reclaimable size - high-risk actions, if any - report path - plan path - what confirmation is needed before cleanup
用 connector-first、最少 token 的方式审阅 Gmail 客户支持线程。适用于 Codex 需要通过 Codex Gmail connector 读取 Gmail、把清洗后的消息导入本地 SQLite 问题队列、先执行确定性的清洗和分类、只把模型调用保留给 JSON-only 的消息理解和草稿字段生成,并支持 dashboard 审阅、客户审批与排队回复处理的时候。
审阅客户来信,以本地政策或 FAQ 文档为依据起草安全的投诉和咨询回复。
Compare two structured agent-run artifacts to estimate cache efficiency, explain likely cache breaks, and produce a local benchmark report. Use when a user wants to understand whether a prompt layout, tool manifest, or history shape is helping or hurting prompt-cache reuse.
Persistent daily news monitoring backed by local SQLite and Markdown reports. Use when a user asks Codex to track named publications, fetch the last N hours of news, summarize recent articles by topic, deduplicate articles across runs, or maintain a personal newsroom that survives across sessions.
Preview-first local file organizer. Scan a user-named folder, classify files into category subfolders using readable rules, write a preview Markdown report and JSON plan, execute confirmed moves with persistent SQLite state, and reverse moves with undo. Use when a user asks Codex to organize Downloads, sort a messy folder into Invoices/Receipts/School/Images/Software/PDFs subfolders, propose a folder structure before moving anything, or undo a previous organization run.
Capture local or explicitly provided web knowledge sources into cited Markdown notes. Use when a user asks Codex to watch a research folder, register local folders for later scans, summarize new or modified local Markdown/TXT/PDF/DOCX files, capture a provided URL, maintain SQLite state for personal knowledge capture, or generate searchable source-grounded daily notes.
Persistent product price tracking for natural-language product requests. Use when a user asks to watch, track, monitor, compare, or report prices for a product, especially with a target price or threshold such as "Watch MacBook Pro M3 14-inch and tell me if it drops below $1200." Supports source discovery, Playwright/browser product checks, SQLite history, threshold comparison, and Markdown price reports.
Plan and inspect prompt-cache behavior for long-running Claude agent loops. Use when a user wants to split stable tool, system, and history context into cacheable layers, compare captured cache metadata, estimate cost impact from supplied pricing inputs, or keep durable memory outside the cached prefix.