Agent skill

Code Structure Cleanup

by pawel-cell in pawel-cell/micky-podcast-agentic-engineering

Use after an AI-built feature works but the code has duplicated mechanics, repeated API calls, or messy structure.

MITAuto-check passed

Install Code Structure Cleanup

skills CLI
$ npx skills add pawel-cell/micky-podcast-agentic-engineering --skill code-structure-cleanup -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install pawel-cell/micky-podcast-agentic-engineering code-structure-cleanup --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/pawel-cell/micky-podcast-agentic-engineering.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/code-structure-cleanup .claude/skills/code-structure-cleanup && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
code-structure-cleanup
GitHub stars
141
Token cost
~755 tokens
SKILL.md length
271 words
Files
1
Skills in repo
4
Repo updated
First seen
Licence
MIT

At a glance

Use after an AI-built feature works but the code has duplicated mechanics, repeated API calls, or messy structure.

  • Works in 5 steps: Refactoring the whole app. Keep the… → Renaming everything. Naming churn makes… → Mixing cleanup with a new feature.… → …
  • SKILL.md covers Overview, When to Use, What "Service Layer" Means and Cleanup Prompt, plus 3 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Code Structure Cleanup is an agent skill from pawel-cell/micky-podcast-agentic-engineering. Use after an AI-built feature works but the code has duplicated mechanics, repeated API calls, or messy structure. Guides a cleanup pass that extracts reusable service-layer modules without changing behavior.

Its SKILL.md is about 760 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

The repository describes itself as: Micky podcast agentic engineering workflow bundle. The licence is MIT.

Example prompts

  • “/code-structure-cleanup”

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Refactoring the whole app. Keep the scope tied to the feature.
  2. Renaming everything. Naming churn makes PRs hard to review.
  3. Mixing cleanup with a new feature. Cleanup is a separate pass.
  4. Only formatting code. Pretty code can still contain duplicated logic.
  5. Moving domain policy into services. Services should handle mechanics, not business decisions.

What it can do on your machine

Read from SKILL.md and the folder at commit ac337fe. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are markdown).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Code Structure Cleanup loads about 755 tokens when it runs. Until then it costs about 58 tokens; SKILL.md has 271 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~58
When it runs · the whole SKILL.md, loaded when a task matches
~755

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from pawel-cell/micky-podcast-agentic-engineering at commit ac337fe, republished under its MIT licence (© pawel-cell). 271 words, ~755 tokens.

Download SKILL.mdSave it as .claude/skills/code-structure-cleanup/SKILL.md (or your agent's skills folder).
name
code-structure-cleanup
description
Use after an AI-built feature works but the code has duplicated mechanics, repeated API calls, or messy structure. Guides a cleanup pass that extracts reusable service-layer modules without changing behavior.
version
1.0.0
author
David Ondrej / Michael Shimeles interview notes
license
MIT

Code Structure Cleanup After Every Feature

Overview

AI agents often take the easiest path: they create new functions instead of reusing existing ones. A feature can work while still leaving behind duplicated logic, inconsistent validation, repeated API calls, and code that future agents struggle to understand.

Run this cleanup pass after a feature works, not before.

When to Use

  • A feature works locally but the code feels duplicated or messy.
  • The agent created similar helper functions in multiple files.
  • You want future agents to pick up the codebase without confusion.
  • You need a smaller, cleaner PR before review.

Do not use this as permission to redesign the whole app.

What "Service Layer" Means

A service layer is a place for reusable mechanics:

  • sending an email,
  • streaming an AI response,
  • creating a sandbox,
  • validating a webhook,
  • calling an external API,
  • transforming a payload,
  • parsing or normalizing data.

The UI/route/action decides what should happen. The service handles how it happens.

Cleanup Prompt

md
The feature is working. Now do a code-structure cleanup pass.

Goal:
- Find duplicated runtime mechanics, repeated API calls, repeated parsing, repeated validation, or repeated business logic.
- Move repeated mechanics into reusable service-layer functions/modules.
- Keep domain policy in the calling route/action/component.
- Do not change user-facing behavior.
- Keep the diff small.

Process:
1. Inspect the files touched by the feature.
2. Identify repeated logic and name the duplication clearly.
3. Propose the smallest service-layer extraction.
4. Implement it.
5. Run the relevant tests/typechecks.
6. Summarize exactly what got simpler.

Good Outcome

Instead of 4 files each having their own slightly different sendEmail() logic, there is one tested email service that all 4 files call.

Common Pitfalls

  1. Refactoring the whole app. Keep the scope tied to the feature.
  2. Renaming everything. Naming churn makes PRs hard to review.
  3. Mixing cleanup with a new feature. Cleanup is a separate pass.
  4. Only formatting code. Pretty code can still contain duplicated logic.
  5. Moving domain policy into services. Services should handle mechanics, not business decisions.

Verification Checklist

  • User-facing behavior stayed the same.
  • Repeated mechanics were actually reduced.
  • Calling files became simpler.
  • Relevant tests/typechecks ran.
  • Diff stayed focused on the feature area.

© pawel-cell, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/code-structure-cleanup of pawel-cell/micky-podcast-agentic-engineering.

Open the folder on GitHubat commit ac337fe

Compare with similar skills

Code Structure Cleanup next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Code Structure Cleanup compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Code Structure Cleanup this skillpawel-cell/micky-podcast-agentic-engineering141—~755Automated safety check: PassMIT
Cleanupsimstudioai/sim30k—~1.4kAutomated safety check: PassApache-2.0
Cleanuptrycompai/comp2k—~655Automated safety check: PassAGPL-3.0
Cleanupwannabespace/conar1.5k—~2.4kAutomated safety check: PassAGPL-3.0
CleanupLedgerHQ/ledger-live622—~193Automated safety check: PassMIT
Cleanupericboy0224/learn-docker-and-k8s487—~454Automated safety check: PassNone

Similar skills

  • Cleanup

    simstudioai/sim

    Run all code quality skills — effects, memo, callbacks, state, React Query, emcn design review, url-state, comments, and test-audit — analyzing in parallel, then applying fixes sequentially

    30k GitHub stars~1.4k tokensUpdated today
    DevelopmentAuto-check passed
  • Cleanup

    trycompai/comp

    MUST run after writing or modifying code — reviews changed files for verbose patterns, inconsistencies, and readability issues before considering work done

    2k GitHub stars~655 tokensUpdated today
    DevelopmentAuto-check passed
  • Cleanup

    wannabespace/conar

    Review the current branch's diff against its base (tamery, else main), then shrink it — delete code that carries no logic, split files that hold more than one subject, make new code look like the…

    1.5k GitHub stars~2.4k tokensUpdated today
    DatabasesAuto-check passed
  • Cleanup

    LedgerHQ/ledger-live

    Run lint, format, and typecheck on modified files. An agent skill from LedgerHQ/ledger-live.

    622 GitHub stars~193 tokensUpdated today
    DevelopmentAuto-check passed
  • Cleanup

    ericboy0224/learn-docker-and-k8s

    Clean up Docker resources created by the Learn Docker & K8s game.

    487 GitHub stars~454 tokensUpdated 6 mo ago
    DevOps & CloudAuto-check passed
  • Cleanup

    Fergana-Labs/stash

    Find duplicates, dead links and untagged items in a saved library and propose what to do about each.

    335 GitHub stars~602 tokensUpdated today
    Knowledge ManagementAuto-check passed

More from pawel-cell/micky-podcast-agentic-engineering

  • Agentic Engineering Workflow

    pawel-cell/micky-podcast-agentic-engineering

    A skill your agent uses when building software with AI agents and you need a serious end-to-end workflow instead of vibe coding.

    141 GitHub stars~1.2k tokensUpdated 4 mo ago
    Auto-check passed
  • Grep Loop Review Workflow

    pawel-cell/micky-podcast-agentic-engineering

    A skill your agent uses when you have a small PR or feature and want an agent to repeatedly fix review feedback until tests pass and the PR is merge-ready.

    141 GitHub stars~702 tokensUpdated 4 mo ago
    Auto-check passed
  • Source Code Context

    pawel-cell/micky-podcast-agentic-engineering

    A skill your agent uses when an AI coding agent is guessing API names or framework behavior from incomplete docs.

    141 GitHub stars~800 tokensUpdated 4 mo ago
    Auto-check passed

Questions about Code Structure Cleanup

What does Code Structure Cleanup do?

Use after an AI-built feature works but the code has duplicated mechanics, repeated API calls, or messy structure. Code Structure Cleanup is an agent skill from pawel-cell/micky-podcast-agentic-engineering. Use after an AI-built feature works but the code has duplicated mechanics, repeated API calls, or messy structure.

How do I install Code Structure Cleanup in Claude Code?

Run `npx skills add pawel-cell/micky-podcast-agentic-engineering --skill code-structure-cleanup -a claude-code`. Or copy the skill folder (skills/code-structure-cleanup in pawel-cell/micky-podcast-agentic-engineering) into .claude/skills/code-structure-cleanup in your project. Claude Code loads it when a task matches its description.

How do I install Code Structure Cleanup in Codex?

Run `npx skills add pawel-cell/micky-podcast-agentic-engineering --skill code-structure-cleanup -a codex`. Or copy the skill folder (skills/code-structure-cleanup in pawel-cell/micky-podcast-agentic-engineering) into .agents/skills/code-structure-cleanup in your project. Codex loads it when a task matches its description.

Can I use Code Structure Cleanup in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add pawel-cell/micky-podcast-agentic-engineering --skill code-structure-cleanup -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/code-structure-cleanup, .gemini/skills/code-structure-cleanup, .github/skills/code-structure-cleanup and .opencode/skills/code-structure-cleanup in your project.

What does Code Structure Cleanup need to run?

SKILL.md names no scripts, command-line tools or credentials: Code Structure Cleanup is instructions for the agent only.

Does Code Structure Cleanup access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Code Structure Cleanup safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Code Structure Cleanup use?

Code Structure Cleanup is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Code Structure Cleanup use?

About 755 tokens (SKILL.md is roughly 3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Code Structure Cleanup?

Skills that share tags, products or a category with Code Structure Cleanup: Cleanup (simstudioai/sim, 30k stars), Cleanup (trycompai/comp, 2k stars), Cleanup (wannabespace/conar, 1.5k stars) and Cleanup (LedgerHQ/ledger-live, 622 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Code Structure Cleanup?

pawel-cell (a GitHub user) maintains it in pawel-cell/micky-podcast-agentic-engineering, which has 141 GitHub stars. The repository holds 4 skills in this directory. The repository was last updated on May 19, 2026.

Source: pawel-cell/micky-podcast-agentic-engineering on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.