Skills-Agent / rules
Cursor rule4 starsChanged 33 days agoMITView on GitHub
Clean up junk files, temporary files, AI-generated artifacts, and caches. Use when the user wants to remove unused files, reduce repo clutter, or update .gitignore. Triggers: clean, remove junk, dọn dẹp, xoá file rác, cache.
- Reads credentials
We split this clean.mdc into the rules it gives an agent
16 rules. About 0 are common, 8 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 10
START: Read .ai-memory.md from project root.
- Very specific: line 11
END: Update .ai-memory.md using Memory Compaction Rules with: what was cleaned, space recovered, ignore rules added, and recurring patterns.
- Very specific: line 17
If cleanup involves build artifacts/CI → read .kiro/skills/agents/agents/devops-engineer.md and apply its knowledge
- Very specific: line 18
If cleanup involves security-sensitive files → read .kiro/skills/agents/agents/security-auditor.md and apply its knowledge
- Distinctive: line 25
If uncertain, ASK before proceeding.
- Distinctive: line 32
Ask for confirmation before deletion.
- Distinctive: line 33
Remove approved files and report space saved.
- Distinctive: line 48
Never delete files in version control (check git status first).
- Very specific: line 49
Never delete configuration files (.env, config.json, etc.) unless explicitly requested.
- Distinctive: line 50
Never delete source code without explicit confirmation.
- Distinctive: line 51
Always show what will be deleted before proceeding.
- Distinctive: line 53
Ask before removing entire directories.
- Very specific: line 54
NEVER delete .ai-memory.md — it is a persistent project memory file.
- Very specific: line 81
After completing, read .kiro/skills/_scripts/checklist.md for cross-cutting quality checks.
- Very specific: line 84
All code snippets and example files referenced or produced by this skill must be UTF-8 encoded.
- Distinctive: line 87
Update .gitignore to prevent future junk accumulation
≈ “Common” is an estimate: at least 1 in 5 of the 6,350 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
--- description: "Clean up junk files, temporary files, AI-generated artifacts, and caches. Use when the user wants to remove unused files, reduce repo clutter, or update .gitignore. Triggers: clean, remove junk, dọn dẹp, xoá file rác, cache." encoding: "UTF-8" agents: [devops-engineer] globs: "" alwaysApply: false --- ## Memory Protocol **START**: Read `.ai-memory.md` from project root. Check for known junk patterns, previous cleanup history, and project-specific ignore rules. **END**: Update `.ai-memory.md` using **Memory Compaction Rules** with: what was cleaned, space recovered, ignore rules added, and recurring patterns. ## Goal Identify and remove unnecessary files generated by AI, build processes, or development tools without affecting the working codebase. ## Agent Routing - If cleanup involves build artifacts/CI → read `.kiro/skills/agents/agents/devops-engineer.md` and apply its knowledge - If cleanup involves security-sensitive files → read `.kiro/skills/agents/agents/security-auditor.md` and apply its knowledge ## Socratic Gate Before cleaning, verify: 1. Is the project under version control? (safety check) 2. Are there uncommitted changes that could be lost? 3. Any specific directories/patterns to preserve? If uncertain, ASK before proceeding. ## Workflow 1. **Read Memory** — Load `.ai-memory.md` for project context and past cleanup history. 2. Scan the project for common junk file patterns. 3. Identify AI-generated files that may be redundant or outdated. 4. Present a clear list of files to be removed with sizes and reasons. 5. Ask for confirmation before deletion. 6. Remove approved files and report space saved. 7. Suggest .gitignore updates if needed. 8. **Update Memory** — Save cleanup results and new patterns to `.ai-memory.md`. ## Common Junk Patterns - Temporary files: `*.tmp`, `*.temp`, `*.bak`, `*.swp`, `*~` - Log files: `*.log`, `*.log.*`, `debug.log`, `error.log` - Cache directories: `.cache/`, `__pycache__/`, `.pytest_cache/`, `.mypy_cache/` - Build artifacts: `dist/`, `build/`, `*.pyc`, `*.pyo`, `*.class`, `*.o` - Node modules: `node_modules/` (if not needed) - IDE files: `.vscode/`, `.idea/` (if not in .gitignore) - OS files: `.DS_Store`, `Thumbs.db`, `desktop.ini` - AI artifacts: Duplicate markdown files, unused generated code, test outputs ## Safety Rules - Never delete files in version control (check git status first). - Never delete configuration files (.env, config.json, etc.) unless explicitly requested. - Never delete source code without explicit confirmation. - Always show what will be deleted before proceeding. - Preserve .gitignore and other dot files unless they're clearly junk. - Ask before removing entire directories. - NEVER delete `.ai-memory.md` — it is a persistent project memory file. ## Output Format ``` Files to clean: 1. [Category] path/to/file (size) - Reason 2. [Category] path/to/file (size) - Reason ... Total space to recover: XX MB Proceed with deletion? (y/n) ``` ## Checklist - [ ] Git status checked for uncommitted changes - [ ] Junk patterns scanned - [ ] File list presented with reasons - [ ] User confirmation received - [ ] Files removed safely - [ ] .gitignore updated if needed - [ ] Memory file updated - [ ] Clean code chuẩn (Standard clean code applied) - [ ] Cập nhật đầy đủ tất cả các file liên quan (All related files fully updated) ## Quality Gate After completing, read `.kiro/skills/_scripts/checklist.md` for cross-cutting quality checks. ## Encoding All code snippets and example files referenced or produced by this skill must be UTF-8 encoded. When applicable, include `encoding: "UTF-8"` in SKILL.md front-matter and ensure saved files use UTF-8 (no BOM). ## Follow-up Actions - Update .gitignore to prevent future junk accumulation - Suggest cleanup scripts for recurring patterns - Recommend build tool configurations to reduce artifacts ## Related Skills - `/status` → read `.kiro/skills/status/SKILL.md` — Check project health after cleanup - `/enhance` → read `.kiro/skills/enhance/SKILL.md` — Improve remaining code quality ## Related Skills - `/status` — Check project state after cleanup - `/enhance` — Improve project structure
Where files are headingNew Cursor rule files have more rules about planning and tracking tasks, and fewer about code style.
Of the Cursor rule files we read, the 3,978 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository96 other files it gives its agents.
- .cursor/rules/agents.mdcCursor rule
- .cursor/rules/brainstorm.mdcCursor rule
- .cursor/rules/create.mdcCursor rule
- .cursor/rules/debug.mdcCursor rule
- .cursor/rules/deploy.mdcCursor rule
- .cursor/rules/enhance.mdcCursor rule
- .cursor/rules/explain.mdcCursor rule
- .cursor/rules/instructions.mdcCursor rule
- .cursor/rules/integrate.mdcCursor rule
- .cursor/rules/motion-ui.mdcCursor rule
- .cursor/rules/orchestrate.mdcCursor rule
- .cursor/rules/plan.mdcCursor rule
- .cursor/rules/preview.mdcCursor rule
- .cursor/rules/status.mdcCursor rule
- .cursor/rules/test.mdcCursor rule
- .cursor/rules/ui-ux-pro-max.mdcCursor rule
- agentsSkill
- brainstormSkill
- cleanSkill
- createSkill
- debugSkill
- deploySkill
- enhanceSkill
- explainSkill
- integrateSkill
- motion-uiSkill
- orchestrateSkill
- planSkill
- previewSkill
- statusSkill
- testSkill
- ui-ux-pro-maxSkill
- agentsSkill
- brainstormSkill
- cleanSkill
- createSkill
- debugSkill
- deploySkill
- enhanceSkill
- explainSkill
- integrateSkill
- motion-uiSkill
- orchestrateSkill
- planSkill
- previewSkill
- statusSkill
- testSkill
- ui-ux-pro-maxSkill
- agentsSkill
- brainstormSkill
- cleanSkill
- createSkill
- debugSkill
- deploySkill
- enhanceSkill
- explainSkill
- integrateSkill
- motion-uiSkill
- orchestrateSkill
- planSkill
- The first 60 shown.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

