Skip to content
Agentmart
Submit a tool

code-cleanup

Applies generic code cleanup (comments, unused code, empty dirs, linters, config, duplicates) for any language (Dart, Bash, Python, Java, Kotlin, Swift…

Skill by wildbitca

IndexedApache-2.0★ 1
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/wildbitca-code-cleanup

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Applies generic code cleanup (comments, unused code, empty dirs, linters, config, duplicates) for any language (Dart, Bash, Python, Java, Kotlin, Swift, TS/JS, etc.) and, for Flutter/Dart, a combined quality check. Use when the user asks to clean up code, remove dead code, empty dirs, reduce technical debt, or run a full project quality check.

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/code-cleanup

What's inside

Skill name
code-cleanup
Description
Applies generic code cleanup (comments, unused code, empty dirs, linters, config, duplicates) for any language (Dart, Bash, Python, Java, Kotlin, Swift, TS/JS, etc.) and, for Flutter/Dart, a combined quality check. Use when the user asks to clean up code, remove dead code, empty dirs, reduce technical debt, or run a full project quality check.
License
Apache-2.0
Instructions
214 lines in SKILL.md · view on GitHub

Files (2)

  • SKILL.md
  • TOOLING-MATRIX.md · references/

SKILL.md (first lines)

# Code Cleanup (Any Language)

## Steps

1. **Comments:** Remove non-needed extra comments in all code files. Keep only: docblocks (API/docs), legal headers, complex-algorithm explanations, and config-explaining comments. See **Comment cleanup by language** below.
2. **Unused:** Remove unused imports, types, functions, variables, parameters, and files. Use the project's analyzer per language (see **By language** below).
3. **Empty directories:** Find empty dirs (including nested empty dirs). Remove them from the filesystem and from Git tracking (`git rm -r --cached <dir>` if tracked, then remove dir; or remove dir and `git add` the deletion). Re-check after file removals.
4. **Linters:** Fix all reported analyzer/linter issues; aim for zero before done.
5. **Config:** Remove unused env vars, `AppConfig`/`ApiConstants` (or equivalents), and unused entries in `wrangler.toml`, `config.toml`, etc.
6. **Duplicates:** Merge duplicated logic into shared utils or helpers.
7. **Final check:** Run the project's analyzer (or equivalent) again; confirm no empty dirs left.

## Prohibited: Code Formatting

**PROHIBITED:** Do NOT format code. This skill focuses on cleanup and quality checks, not formatting.

- **PROHIBITED:** Running `dart format`, `flutter format`, or any code formatter.
- **PROHIBITED:** Changing code style, indentation, spacing, or line breaks.
- **PROHIBITED:** Reorganizing imports beyond removing unused ones.
- **PROHIBITED:** Changing brace style, line length, or other formatting conventions.

**Allowed:** Only remove unused imports (not reorganize them), fix analyzer errors that require code changes (not style changes), and apply the quality checks listed below.

---

## Empty Directories

- **Check:** After removing unused files, find directories that are empty (including nested: e.g. `a/b/c` then `a/b` then `a` if all become empty).
- **Remove from filesystem:** Delete empty dirs (e.g. `rmdir` or `find ... -type d -empty -delete`; on Windows use equivalent).
- **Remove from Git:** If the dir was tracked (e.g. had a `.gitkeep` or was previously committed), stop tracking and remove: `git rm -r --cached <path>` then remove the dir; or remove the dir and stage the deletion with `git add -A` / `git add <path>`. Untracked empty dirs are not in Git; deleting
  them is enough.
- **Re-check:** After any file or dir removal, run the empty-dir check again until no empty dirs remain.

---

## Comment Cleanup (All Code Files)

Remove **non-needed** comments in every codebase. Apply to Dart, Bash, Python, Java, Kotlin, Swift, TypeScript/JavaScript, and other code files.

**Remove:**

- Redundant or obvious comments (e.g. `// increment i`, `# set variable`).
- Commented-out code blocks (dead code); delete the code instead of leaving it commented.
- Stale TODOs that are done or obsolete; leave only actionable TODOs.
- Noise comments (e.g. `// -----`, `# ====`, decorative separators with no info).
- Per-line comments that restate the next line.

**Keep:**

- **Docblocks / API docs:** `///`, `/** */`, `""" """`, `#` module/function doc, JSDoc, KDoc, etc.
- **Legal/copyright headers:** License, copyright, author at top of file.
- **Complex-algorithm comments:** Non-obvious logic, workarounds, references to specs/tickets.
- **Config-explaining comments:** Why a constant or env value is set (e.g. in config files).

| Language          | Docblock / keep style | Single-line | Block comment |
|-------------------|-----------------------|-------------|---------------|
| **Dart**          | `///`, `/** */`       | `//`        | `/* */`       |
| **Bash**          | `#` at block start    | `#`         | N/A           |
| **Python**        | `""" """`, `''' '''`  | `#`         | N/A           |
| **Java**          | `/** */` Javadoc      | `//`        | `/* */`       |
| **Kotlin**        | `/** */` KDoc, `///`  | `//`        | `/* */`       |
| **Swift**         | `///`, `/** */`       | `//`        | `/* */`       |
| **TS/JavaScript** | `/** */` JSDoc        | `//`        | `/* */`       |

When in doubt: if the comment does not document the public API, explain non-obvious logic, or provide legal/config context, remove it.

---

## By Language (Analysis, Formatting, Security)

Use the **strongest available tooling** per language. Fix all issues before done.

See [references/TOOLING-MATRIX.md](references/TOOLING-MATRIX.md) for the full tooling matrix with install commands and CI snippets.

| Language          | Static Analysis                                                    | Formatting               | Security / SAST                                              | Dep Audit                             |
|-------------------|--------------------------------------------------------------------|--------------------------|--------------------------------------------------------------|---------------------------------------|
| **Dart/Flutter**  | `flutter analyze --fatal-infos` + **DCM** (`dcm analyze`)          | `dart format . -l 80`    | SonarQube, Trivy (`pubspec.lock`), Flutter Security Analyser | `dart pub outdated`, Trivy SCA        |
| **TypeScript/JS** | `tsc --noEmit` + **ESLint v9** (strict, type-checked) or **Biome** | **Biome** or Prettier    | **Semgrep** (`auto`), `eslint-plugin-security`               | `npm audit --audit-level=high`, Trivy |
| **Angular**       | `ng lint` (**angular-eslint**)                                     | Biome or Prettier        | Semgrep, SonarQube                                           | `npm audit`, Trivy                    |
| **Bash**          | **ShellCheck**                                                     | `shfmt`                  | ShellCheck SC2* rules                                        | N/A                                   |
| **Python**        | **Ruff** + **Pyright**                                             | **Ruff** format or Black | **Bandit**, Semgrep                                          | `pip-audit`, Trivy                    |
| **Java**          | Build + **SpotBugs** + **ErrorProne**                              | google-java-format       | SpotBugs Find Security Bugs, Semgrep                         | OWASP Dep-Check                       |
| **Kotlin**        | **Detekt** + **ktlint**                                            | ktlint `--format`        | Detekt security ruleset, Semgrep                             | Gradle audit                          |
| **Swift**         | Xcode + **SwiftLint**                                              | **SwiftFormat**          | SwiftLint security rules                                     | `swift package audit`                 |
| **Dockerfile**    | **Hadolint**                                                       | N/A                      | **Trivy** image scan, **Dockle** CIS                         | Trivy                                 |
| **SQL**           | **sqlfluff**                                                       | sqlfluff fix             | Semgrep SQL-injection rules                                  | N/A                                   |

### Cross-Language (Apply to All Projects)

| Tool         | Purpose                       | Command                                       |
|--------------|-------------------------------|-----------------------------------------------|
| **Gitleaks** | Secret detection (150+ types) | `gitleaks detect --source . --verbose`        |
| **Trivy**    | CVE + misconfig + secrets     | `trivy fs . --scanners vuln,misconfig,secret` |
| **Semgrep**  | Pattern SAST (30+ langs)      | `semgrep scan --config auto .`                |

---

# Flutter/Dart: Combined Quality Check

When cleaning up or validating a **Flutter/Dart** project, after the base cleanup steps, run this combined check. Each item delegates to the corresponding skill for full rules; here we list the main verifiable points.

## 1. Code Quality — Apply: `flutter-code-quality`

- Run `flutter analyze`; fix all errors, warnings, and info. Treat warnings as errors.
- Remove unused imports (do NOT reorganize or format them); replace deprecated APIs.
- Check `pubspec.yaml`: null-safe, up-to-date, aligned with SDK and state solution (e.g. Riverpod).
- Re-run `flutter analyze` to confirm zero issues.
- **PROHIBITED:** Running `dart format` or `flutter format` — this skill does NOT format code.

## 2. Dart Standards — Apply: `flutter-dart-standards`

- No `dynamic`; explicit types where not obvious.
- Custom widgets/models: `@immutable`, `final`, `copyWith` for state.
- Naming: PascalCase (classes), camelCase (functions/vars), snake_case (files/dirs).
- Use `const` constructors where possible; composition over deep inheritance.

## 3. Clean Architecture — Apply: `flutter-clean-architecture`

- Feature-based layout: `lib/features/<name>/`; no global `models/` or `widgets/` mixing features.

From wildbitca/ai-resources, Apache-2.0.

More from wildbitca/ai-resources

Signals

Stars
1
Forks
0
Open issues
1
Last commit (this folder)
Apr 2, 2026 (7 months ago)
Last release
Oct 24, 2026 (5 days ago)

From GitHub (fetched Oct 24, 2026).

Details

License
Apache-2.0
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from wildbitca

Cite this page

code-cleanup skill. Agent Mart. https://agentmart.dev/skills/wildbitca-code-cleanup (last updated 2026-10-24)