본문으로 건너뛰기
cccskills
무료GitHub에 공개

de-sloppify

Two-agent cleanup pattern. Implementer works freely, then a dedicated cleanup agent removes unused imports, console.logs, commented-out code, dead code, and formatting issues. Produces a diff of what was cleaned.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(10)

  • SKILL.md7.5 KB
  • commands/de-sloppify.md1.7 KB
  • hooks/post-execute.cjs782 B
  • hooks/pre-execute.cjs1.6 KB
  • references/research-requirements.md1.4 KB
  • rules/de-sloppify.md2.1 KB
  • schemas/input.schema.json617 B
  • schemas/output.schema.json2.2 KB
  • scripts/main.cjs10.9 KB
  • templates/implementation-template.md2.2 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

De-Sloppify

Overview

De-Sloppify implements a two-agent pattern for code cleanup:

  1. Implementer — works freely, writes code without worrying about polish
  2. Cleanup Agent — runs after implementation, removes all slop without touching logic

This separation prevents "cleanup anxiety" from slowing down implementation while still producing clean final code.

When to Use

Skill({ skill: 'de-sloppify' });

Invoke when:

  • Implementation is complete but the code contains known slop (unused imports, leftover console.logs, commented-out code)
  • Before committing a feature branch
  • After a rapid prototyping session
  • As a post-implementation cleanup gate

Iron Law

CLEANUP AGENT MUST NOT CHANGE BEHAVIOR.
Every removal must be verifiable as dead code, unused import,
or formatting-only. If there is any doubt — LEAVE IT.

What Gets Cleaned

CategoryExamplesSafe to Remove
Unused importsimport foo from 'foo' — never referencedYES
console.log / debugconsole.log('debug here'), console.errorYES
Commented-out code// const old = foo() (code, not docs)YES
Dead codeUnreachable branches, unused variablesYES
Trailing whitespaceSpaces at end of linesYES
Extra blank lines3+ consecutive blank linesYES
TODO with no context// TODO (no ticket, no description)On flag only

What Must NOT Be Cleaned

CategoryWhy
Commented doc blocks/** ... */ JSDoc, /* ... */ section notes
console.error in catchMay be intentional error logging
Disabled test blocks// it.skip(...) — intentional
Feature-flag dead codeMay be awaiting activation
Complex logicEven if it looks unused — leave it

Workflow

Phase 1: Implementer Works Freely

The implementer completes the feature without cleanup overhead. This is normal development.

Phase 2: Cleanup Agent Runs

After implementation, invoke de-sloppify. The cleanup agent runs these checks in order:

Step 1: Snapshot Pre-Cleanup State

Command:

git diff HEAD -- {{target_files}} > C:/dev/projects/agent-studio/.claude/context/tmp/pre-cleanup-snapshot.diff

Expected output: A diff file capturing current state.

Verify: File exists at .claude/context/tmp/pre-cleanup-snapshot.diff.

Step 2: Find Unused Imports

Command (JavaScript/TypeScript):

node C:/dev/projects/agent-studio/.claude/skills/de-sloppify/scripts/main.cjs \
  --action find-unused-imports \
  --files "{{comma_separated_file_paths}}"

Expected output: JSON array of { file, line, import } objects for unused imports.

Verify: Exit code 0 and valid JSON array.

Step 3: Find Console Logs

Command:

node C:/dev/projects/agent-studio/.claude/skills/de-sloppify/scripts/main.cjs \
  --action find-console-logs \
  --files "{{comma_separated_file_paths}}"

Expected output: JSON array of { file, line, statement } objects.

Verify: Exit code 0 and valid JSON array.

Step 4: Find Commented-Out Code

Command:

node C:/dev/projects/agent-studio/.claude/skills/de-sloppify/scripts/main.cjs \
  --action find-commented-code \
  --files "{{comma_separated_file_paths}}"

Expected output: JSON array of candidate commented-out code blocks.

Verify: Exit code 0 and valid JSON array.

Step 5: Apply Cleanup

For each finding that is safe to remove, use Edit to remove the line(s). Apply changes conservatively — when in doubt, leave it.

Step 6: Format and Lint

Command:

cd C:/dev/projects/agent-studio && pnpm lint:fix && pnpm format

Expected output: 0 errors, 0 warnings from lint; no changes from format.

Verify: Both commands exit 0 with no output indicating issues.

Step 7: Generate Cleanup Diff

Command:

git diff -- {{target_files}}

Expected output: A diff showing only removals (lines starting with -). No additions should appear unless they are indentation fixes.

Verify: Review the diff — confirm every removed line was dead code or formatting. If any functional line was removed, revert with git checkout -- <file>.

Step 8: Report

Produce a cleanup summary:

De-Sloppify Report
==================
Files processed: N
Unused imports removed: N
Console.logs removed: N
Commented-out code blocks removed: N
Dead code blocks removed: N
Formatting fixes applied: N

Diff: git diff HEAD -- <files>

Anti-Patterns

  • Never remove a console.error inside a catch block without confirming it is debug-only
  • Never remove commented code that contains a ticket reference or TODO explanation
  • Never run cleanup on uncommitted work from the implementer — take a snapshot first
  • Never combine cleanup and logic changes in the same commit
  • Never use regex to find "unused" code — use the CLI scanner or lint output only

Enforcement Hooks

Input validated against schemas/input.schema.json before execution. Output contract defined in schemas/output.schema.json.

Pre-execution hook (hooks/pre-execute.cjs) validates:

  • action is a known enum value
  • files is a non-empty array of paths

Post-execution hook (hooks/post-execute.cjs) emits observability event to .claude/context/runtime/tool-events.jsonl.

Assigned Agents

  • developer — runs cleanup after implementation
  • code-simplifier — incorporates de-sloppify as a cleanup step
  • code-reviewer — recommends de-sloppify when reviewing slop-heavy PRs
  • qa — verifies cleanup did not alter behavior

Memory Protocol

Before starting: Read .claude/context/memory/learnings.md for cleanup patterns specific to this codebase.

After completing: Append summary to .claude/context/memory/learnings.md:

**de-sloppify** — [date] Cleaned N files. Removed: M unused imports, K console.logs, J commented blocks.

ASSUME INTERRUPTION: Your context may reset. If it's not in memory, it didn't happen.

Related Skills

  • code-simplifier — structural refactoring (de-sloppify is style-only)
  • finishing-a-development-branch — includes de-sloppify as a phase
  • codebase-cleaner — broader cleanup including file-level slop

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Ensure accessibility in UI components including semantic HTML, ARIA attributes, keyboard navigation, and WCAG 2.2 AA compliance.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

oimiragieo/agent-studio422026년 7월 14일 업데이트

Use when you want to improve response quality through meta-cognitive reasoning. Applies 15+ reasoning methods to reconsider and refine initial outputs.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

oimiragieo/agent-studio422026년 7월 14일 업데이트

N-round opposing-stance debates for trade-off analysis. Assigns pro/con roles to agents, runs structured debate rounds with quality scoring, and produces a moderator synthesis with confidence-rated recommendation. Generalizable to architecture, technology, security, and design decisions.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

oimiragieo/agent-studio422026년 7월 14일 업데이트

Force adversarial code review stance that eliminates confirmation bias — reviewer must find issues or re-analyze

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

oimiragieo/agent-studio422026년 7월 14일 업데이트

Creates specialized AI agents on-demand when no existing agent matches a request. Use when the Router cannot find a suitable agent for a task. Enables self-evolution by generating persistent agents.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

oimiragieo/agent-studio422026년 7월 14일 업데이트

LLM-as-judge evaluation framework with 5-dimension rubric (accuracy, groundedness, coherence, completeness, helpfulness) for scoring AI-generated content quality with weighted composite scores and evidence citations

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

oimiragieo/agent-studio422026년 7월 14일 업데이트

oimiragieo의 스킬 모두 보기

이 스킬의 문제 신고