AgentSkillsCN

cleanup-skill

为安全清理生成的工件、测试输出以及仓库中的临时文件提供指导与规则。

SKILL.md
--- frontmatter
name: cleanup-skill
description: Guidance and rules for safely cleaning up generated artifacts, test outputs, and temporary files from the repository.

Cleanup Skill

This skill documents the recommended process and rules for cleaning generated artifacts in the repository. Use this skill when performing repository housekeeping, CI cleanup, or when preparing a smaller distribution.

Rules

  • Always preserve canonical documentation and files under docs/ unless the file is explicitly a generated report (marked generated: or located in docs/reports/ with clear origin).
  • Do NOT delete files related to active or protected stories (e.g., files with US-AI-010 in the path or name) unless the owner confirms.
  • Generated test_*.txt files and benchmark outputs can be deleted; they are considered ephemeral and reproducible by running tests or scripts.
  • If unsure, move files to docs/archives/cleanup-<YYYYMMDD>/ instead of permanent deletion.
  • Before deleting, run a quick grep to ensure no tests or docs reference the file as a required artifact.

Steps

  1. Identify candidates: git ls-files --others --exclude-standard and rg "^test_.*\.txt$" -g '!docs/**'.
  2. Verify references: rg "<filename>" -S to find references in repo.
  3. Archive or delete:
    • Archive: move files to docs/archives/cleanup-<YYYYMMDD>/.
    • Delete: git rm <file> and commit with doc prefix: doc - remove generated test artifacts.
  4. Update docs/cleanup_prompt.md or skill metadata with the cleanup run summary.

Automation

  • Automation may run a cleanup job that removes files matching test_*.txt except those under docs/ and docs/species_audit/.
  • CI jobs should not delete artifacts used for official reports unless the artifact is regenerated by the workflow itself.

Example commit message

doc - cleanup: remove ephemeral test artifacts (test_*.txt)