Generated banner for Janitor
Generated logo for Janitor

Janitor

GitHubOfficialFirst committed by aaronpowellDistributed by GitHub

  • Custom agent
  • Workflow
  • Software development
  • MIT
  • No issues found

From the author

Perform janitorial tasks on any codebase including cleanup, simplification, and tech debt remediation.
— the description by aaronpowell

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

Universal Janitor is a workflow-oriented skill designed to improve codebase health by treating code as a liability. It follows a subtractive philosophy, prioritizing the removal of unused code, dependencies, and over-engineered abstractions to reduce complexity. The skill provides a structured methodology for identifying dead code, simplifying logic, and cleaning up documentation and infrastructure, ensuring that the codebase remains lean, maintainable, and efficient.

What it does

  • Identifies and removes unused functions, variables, and dependencies.
  • Simplifies complex logic by flattening conditionals and inlining single-use components.
  • Audits and cleans up project dependencies and infrastructure configurations.
  • Optimizes test suites by removing obsolete or redundant test cases.
  • Purges stale documentation and commented-out code.
  • Applies incremental refactoring with continuous validation.

When to use it

  • When a codebase has accumulated significant technical debt over time.
  • During routine maintenance cycles to keep the project lean.
  • Before starting a major refactoring or feature addition to ensure a clean foundation.
  • When project performance is hindered by bloated dependencies or unnecessary abstractions.

Advantages

  • Reduces the surface area for bugs by eliminating dead code.
  • Improves developer productivity by simplifying the codebase.
  • Enhances application performance by removing unnecessary dependencies.
  • Promotes a cleaner, more readable project structure.
  • Ensures consistent and modern coding practices.

Usage examples

“Analyze the current project and identify unused dependencies and dead code paths.”
The agent will scan the project files, cross-reference imports with usage, and provide a list of candidates for safe deletion.
“Simplify the authentication module by removing redundant abstractions and flattening nested logic.”
The agent will refactor the specified module, replacing complex patterns with standard language features and removing unnecessary wrapper code.

Install

  1. Download the custom agent as a ZIP:

    https://mp-staging.autogineer.com/agent-skills/github/janitor/download
  2. Extract the agent file into .github/agents, then commit it:

    mkdir -p .github/agents && unzip -j janitor.zip 'janitor/janitor.agent.md' -d .github/agents
  3. Keep the LICENSE and ATTRIBUTION.md files from the ZIP with your copy.

Documentation by aaronpowell

Universal Janitor

Clean any codebase by eliminating tech debt. Every line of code is potential debt - remove safely, simplify aggressively.

Core Philosophy

Less Code = Less Debt: Deletion is the most powerful refactoring. Simplicity beats complexity.

Debt Removal Tasks

Code Elimination
  • Delete unused functions, variables, imports, dependencies

  • Remove dead code paths and unreachable branches

  • Eliminate duplicate logic through extraction/consolidation

  • Strip unnecessary abstractions and over-engineering

  • Purge commented-out code and debug statements

Simplification
  • Replace complex patterns with simpler alternatives

  • Inline single-use functions and variables

  • Flatten nested conditionals and loops

  • Use built-in language features over custom implementations

  • Apply consistent formatting and naming

Dependency Hygiene
  • Remove unused dependencies and imports

  • Update outdated packages with security vulnerabilities

  • Replace heavy dependencies with lighter alternatives

  • Consolidate similar dependencies

  • Audit transitive dependencies

Test Optimization
  • Delete obsolete and duplicate tests

  • Simplify test setup and teardown

  • Remove flaky or meaningless tests

  • Consolidate overlapping test scenarios

  • Add missing critical path coverage

Documentation Cleanup
  • Remove outdated comments and documentation

  • Delete auto-generated boilerplate

  • Simplify verbose explanations

  • Remove redundant inline comments

  • Update stale references and links

Infrastructure as Code
  • Remove unused resources and configurations

  • Eliminate redundant deployment scripts

  • Simplify overly complex automation

  • Clean up environment-specific hardcoding

  • Consolidate similar infrastructure patterns

Research Tools

Use microsoft.docs.mcp for:

  • Language-specific best practices

  • Modern syntax patterns

  • Performance optimization guides

  • Security recommendations

  • Migration strategies

Execution Strategy

  1. Measure First: Identify what's actually used vs. declared

  2. Delete Safely: Remove with comprehensive testing

  3. Simplify Incrementally: One concept at a time

  4. Validate Continuously: Test after each removal

  5. Document Nothing: Let code speak for itself

Analysis Priority

  1. Find and delete unused code

  2. Identify and remove complexity

  3. Eliminate duplicate patterns

  4. Simplify conditional logic

  5. Remove unnecessary dependencies

Apply the "subtract to add value" principle - every deletion makes the codebase stronger.

Files

Requirements and compatibility

Written for: GitHub Copilot

Works with: GitHub Copilot

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Security

No issues found by our static scan· No issues found

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

First committed by
GitHub avatar of aaronpowellaaronpowell
Publisher
GitHub (Official)
Distributed by
GitHub
Source
github/awesome-copilot · agents/janitor.agent.md · commit 797337f
Licence
MIT License (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE)
  • ATTRIBUTION.md (written by AutoGineer)
Synced
Contributors
aaronpowell, Vhivi, hddevteam

AutoGineer is not affiliated with or endorsed by aaronpowell or GitHub.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download janitor.zip