/agent-kit:clean-codefrom Mission Kit
Removes AI-generated code slop: redundant comments, excessive try/catch, any casts, deep nesting, and em dashes. Use after AI sessions or before code review.
Ships in Mission Kit. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Obvious comments, excessive defense, any to silence the type checker, deep nesting - patterns that read like machine code.
Diff or specific file: this skill. Large refactoring: cleancode-refactor subagent.
git diff against base (e.g., main)Repeat the obvious instead of explaining the why.
// BAD - slop
const total = items.length; // Get the total number of items
return total; // Return the total
// GOOD - no comment needed, code is self-explanatory
const total = items.length;
return total;
Try/catch or null check in internal path where caller already guarantees valid data.
// BAD - slop (internal helper, caller always passes valid data)
function formatName(user: User): string {
try {
if (!user) throw new Error('User is required');
if (!user.name) throw new Error('Name is required');
return user.name.trim();
} catch (error) {
console.error('Error formatting name:', error);
throw error;
}
}
// GOOD
function formatName(user: User): string {
return user.name.trim();
}
any to escape typingCast just to silence the checker instead of modeling the correct type.
// BAD - slop
const result = (response as any).data;
// GOOD - use the actual type
const result = (response as ApiResponse).data;
Stacked if/else or try/catch; prefer early return or guard clauses.
// BAD - slop
function process(input: string | null) {
if (input) {
if (input.length > 0) {
if (isValid(input)) {
return transform(input);
}
}
}
return null;
}
// GOOD - early returns
function process(input: string | null) {
if (!input || input.length === 0 || !isValid(input)) return null;
return transform(input);
}
Names, imports, error handling or formatting different from the rest of the file.
The em dash "—" is one of the strongest marks of AI-generated text. In comments, commit messages, docs, README, HANDOFF and memory, it's slop: replace with hyphen, colon, comma, parentheses or period.
BAD (AI slop, with em dash)
feat: new cache — reduces latency and simplifies flow
the CLI parses — then validates — then saves
GOOD
feat: new cache reduces latency and simplifies flow
the CLI parses, validates and saves
the CLI parses; then validates; then saves
Rule: completely eliminate "—" from commits, text and docs. Only use when mandatory for a concrete reason (e.g., literally quoting external text, data or an API that already contains the character). In these cases, preserve the original.
Note: this applies to the repository and to chat. It's textual slop, not just code; see rules agent-output-hygiene, docs-professional-standard and ux-tone.
any replaced with appropriate type or removedagent-output-hygiene)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
code-quality, ai-generated-code, code-review, refactoring, cleanup
npx claudepluginhub agent-kit-startup/agent-kit --plugin agent-kit20 skills in this plugin
/agent-kit-onboardProgressive repository onboarding with essential checks and domain-skills scaffold. Invoke via /agent-kit-onboard; do not auto-load./backlog-addEnqueue a plan to backlog without activating it. Includes Broad Intake review, product-context reasoning, and conflict triage. Invoke via /backlog-add; do not auto-load./agent-kit-onboardProgressive repository onboarding with essential checks and domain-skills scaffold. Invoke via /agent-kit-onboard; do not auto-load./backlog-addEnqueue a plan to backlog without activating it. Includes Broad Intake review, product-context reasoning, and conflict triage. Invoke via /backlog-add; do not auto-load./clean-codeRemove AI code slop (redundant comments, noisy try/catch, any casts, deep nesting), alias code-deslop. Use after AI sessions or before review./dashboard-broadcast/dashboard-broadcast notes and troubleshooting table (port allocation, log path, detach lessons, common failure symptoms). Invoke via the command's own link; do not auto-load.Other plugins' skills for the same job