janitor

Survey repositories and apply isolated code cleanup fixes via git worktree pull requests.

8|1|Updated Feb 13, 2026
One-click install
npx skills add https://github.com/Heavy-Chain-Engineering/etc --skill janitor-heavy-chain-engineering
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: janitor
Source: https://github.com/Heavy-Chain-Engineering/etc/tree/main/skills/janitor
Command: npx skills add https://github.com/Heavy-Chain-Engineering/etc --skill janitor-heavy-chain-engineering

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

The Skill automates safe codebase cleanup by surveying the repository, selecting small, deterministic fixes, applying them in an isolated git worktree, verifying gates, and opening a pull request — never touching the operator's working tree.

Core Features & Use Cases

  • Survey the repository to identify low-risk cleanup opportunities (lint/format, dead-code, whitespace-eof-imports).
  • Apply fixes in a throwaway worktree off main to preserve the operator's primary branch.
  • Open a pull request with a transparent audit trail and boundary-check results, enabling manual review and merge by a human.

Quick Start

Invoke /janitor to start an interactive survey, or run /janitor --autonomous for a zero-prompts automated cleanup.

Frequently Asked Questions about janitor

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate code cleanup without affecting my current working branch?

Automated code cleanup applies isolated fixes in a throwaway git worktree off main, ensuring your primary working tree remains untouched. It surveys the repository, applies verifiable changes, and opens a pull request for manual review.

What is the safest way to automate lint formatting and dead code removal?

Safe codebase cleanup identifies low-risk maintenance tasks like lint-format, dead-code, and whitespace-eof-imports, then applies them in an isolated git worktree with strict boundary checks and fail-closed behavior before opening a pull request.

Can I run automated repository cleanup without manual prompts?

Yes, you can run automated repository cleanup in a zero-prompts mode by invoking the autonomous flag. This executes the full survey-to-pull-request pipeline without operator interaction while maintaining fail-closed safety gates.

How does a git worktree keep my repository safe during automated maintenance?

A git worktree creates a separate isolated working directory off the main branch, applying cleanup changes there without modifying your primary checkout. This isolation prevents uncommitted work from being affected by automated maintenance scripts.

What are the limitations of automated pull request cleanup for maintenance?

Automated cleanup operates under a strict batch limit and only handles v1 categories: lint-format, dead-code, and whitespace-eof-imports. It requires predefined boundary standards and fail-closes on any errors encountered during the pipeline.

Do I need to define trust rules before automating repository cleanup?

Yes, automated code cleanup requires predefined trust rules and boundary standards to verify selected fixes. These rules ensure the pipeline only applies small, deterministic changes that pass verification gates before opening a pull request.