deep-clean
Skill0 starsChanged 3 days agoMITView on GitHub
Deep structural cleanup and simplification: remove dead code, merge duplicate files, run a 4-lens sweep, and audit maintainability over a named path. Use for pre-merge or post-refactor work across Python, Rust, and TypeScript. Also triggered by /simplify.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- gnekt/My-Brain-Is-Full-Crewtheir own version, first seen Oct 8, 2026
- opencue/cuecardstheir own version, first seen Aug 17, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- gnekt/My-Brain-Is-Full-Crew★ 3.9ksame name
- opencue/cuecards★ 6same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository75 other files it gives its agents.
- AGENTS.mdAGENTS.md
- skills/skill-authoring/tools/AGENTS.mdAGENTS.md
- aes-docsSkill
- aes-fixSkill
- aes-layerSkill
- aes-migrationSkill
- android-emulator-linux-gpsSkill
- computer-useSkill
- flatpak-chromium-automationSkill
- qwen-webSkill
- grok-buildSkill
- hermes-agentSkill
- omnirouteSkill
- orcaSkill
- account-managerSkill
- brave-setupSkill
- password-managerSkill
- codegraphSkill
- dogfoodSkill
- reviewSkill
- systematic-debuggingSkill
- blender-arwakySkill
- comfyuiSkill
- llm-writingSkill
- vision-arwakySkill
- playwright-toolingSkill
- setup-ci-quality-gatesSkill
- statuslineSkill
- systemd-headless-serviceSkill
- xdg-spec-complianceSkill
- figcraft-builderSkill
- figcraft-iconsSkill
- figcraft-motionSkill
- figcraft-prototyperSkill
- figcraft-reviewSkill
- figcraftSkill
- figcraft-svgSkill
- figcraft-typographySkill
- github-authSkill
- issue-makerSkill
- issue-workerSkill
- mergifySkill
- pr-babysitSkill
- releasingSkill
- repo-managerSkill
- ascii-artSkill
- ascii-videoSkill
- gif-searchSkill
- media-acquisitionSkill
- docxSkill
- emailSkill
- google-workspaceSkill
- notionSkill
- pdfSkill
- pptxSkill
- xlsxSkill
- competitor-news-monitorSkill
- product-price-monitorSkill
- weekly-review-planningSkill
- arxivSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 62
Read only the winning lane's references.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill 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
deep-clean
Runs a 7-step pipeline over a named path: path audit capture → per-language dead-code cleanup → per-language file consolidation → 4-lens sweep → reviewer prompts + structural audit → apply per tier → verification gates → report. Language variants are picked per step (1a/1b/1c, 2a/2b/2c) by the target language. This file is the lane identification step only; the working method lives in references/hermes/ and references/grok/.
Global Rules
The lane is determined from a physical signal, not by self-identification. Each agent's launcher stamps a fixed attribution env var into every command it runs; the model cannot set these.
if [[ -n "${HERMES_AGENT:-}" ]]; then echo HERMES
elif [[ -n "${GROK_AGENT:-}" ]]; then echo GROK
else echo UNSET; fiHERMES→ Hermes lane. Readreferences/hermes/. Stop.GROK→ Grok lane. Readreferences/grok/. Stop.UNSET→ stop and report. Do not guess the lane.
Marker provenance:
- Hermes re-exports
AI_AGENT=hermes-agentandHERMES_AGENT=trueon every command. - Grok Build runs with
GROK_AGENT=1.
Read only the winning lane's references. Do not read the other lane's.
Pitfalls and Lessons
- Relocate, don't delete, shared templates consumed by linters. When stripping an embedded feature, check whether any removed files are also read by other linters or tests (e.g. doc templates under the removed dir that feed AES601-AES610 doc-shape checks). Relocate them to a non-feature path and update every path reference in build scripts, tests, and dispatchers — deleting them breaks linters that still expect them.
- Feature-stripping cascades. Removing an embedded feature breaks every caller of its modules, constants, traits, and CLI variants. Fix all callers, not just the obvious ones —
cargo buildandcargo clippy -D warningswill surface the rest. Don't declare done until the binary compiles and the full test suite passes. - Grok Build can hit max turns on large refactors. Verify progress in the worktree directory (
git status --short,git log --oneline -3,git diff <base>..HEAD), not the TUI stream — an empty stream doesn't mean idle. Send a focused follow-up brief listing only the remaining files, and drive rounds with a shrinking grep count of the feature's key symbols (constant names, fn names, CLI variants — not the generic word) until it hits 0. Never re-send the full original brief each round — the agent re-reads from scratch and burns the turn budget. The full recipe lives in thegrok-buildskill ("Multi-round large refactor recipe"). - When relocating a directory, search the whole tree for path strings, not just code. Doc-comment prose, generated-file headers (build-script-emitted
// Source: <path>lines), test helper path joins, and stale references to deleted files (e.g. a doc comment citing a SKILL.md removed in the same cleanup) all carry the old path and survive a code-only sweep. Grep the old path string across*.rs,*.md, and*.sh(excludingtarget/) after moving files, and rewrite every hit —cargo testpasses even with stale doc comments, so the gate will not catch them. - lint-arwaky verification gates (Rust workspace):
CARGO_INCREMENTAL=0 cargo fmt --all -- --check,CARGO_INCREMENTAL=0 cargo clippy --all-targets -- -D warnings,CARGO_INCREMENTAL=0 cargo build --bin lint-arwaky-cli,CARGO_INCREMENTAL=0 cargo nextest run --workspace --lib --tests -j 2. Run all four before declaring a deep-clean done.
Routing
Hermes lane (Steps 0–3)
| Step | Reference | Purpose |
| 0 | references/hermes/step-0-plan-and-spawn.md | Detect language from <path>; plan the brief (mode, acceptance criteria); create the Orca worktree with --agent grok; drop /deep-clean <path> |
| 1 | references/hermes/step-1-wait-grok.md | Wait for Grok to finish the pipeline; read its step 7 report and commit |
| 2 | references/hermes/step-2-verify-and-ship.md | Re-run the language's verification gates on the clean committed tree; surface bugs + RISKY items; push/PR if asked |
| 3 | references/hermes/step-3-final-report.md | Final report to the user (cleanup counts, bugs, RISKY items, commit/PR, worktree teardown) |
Grok lane (Steps 0–7, run by Grok Build)
| Step | Reference | Purpose |
| Step 0: path audit capture | references/grok/step-0-scope.md | Path validation, audit scope, headless vs --dry-run mode gate. |
| Step 1: dead code (language variants) | step-1a-dead-code-python.md, step-1b-dead-code-rust.md, step-1c-dead-code-typescript.md | Phase 1 per-language dead-code detection, workflow, exceptions. |
| Step 2: consolidation (language variants) | step-2a-consolidate-python.md, step-2b-consolidate-rust.md, step-2c-consolidate-typescript.md | Phase 2 per-language consolidation workflow, verification, commit, checklists. |
| Step 3: 4-lens sweep | references/grok/step-3-lens-sweep.md | Execution model, the four lenses, evidence standard, finding format, sweep pitfalls. |
| Step 4: reviewer prompts | references/grok/step-4-reviewer-prompts.md | Full prompt text for each of the four reviewer lenses. |
| Step 4: audit standards | references/grok/step-4-audit-standards.md | Non-negotiable audit standards, primary audit questions, what to flag aggressively, preferred remedies, approval bar; tone and output prioritization live in references/grok/step-4-review-tone.md. |
| Step 5: apply per tier | references/grok/step-5-apply-per-tier.md | Strict tier order, per-file test gates, dry-run presentation, house-style folding. |
| Step 6: verification gates | references/grok/step-6-verification-gates.md | Gate order, per-language exact commands, verification checklist, common mistakes, bugs-found section rules. |
| Step 7: report | references/grok/step-7-report-format.md | Final report section shape and worked example. |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
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.

