Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
drewdrewthis avatar

Sweep

  • 1 installs
  • 2 repo stars
  • Updated April 22, 2026
  • drewdrewthis/claude-skills

After a fix or feature, search the codebase for the same pattern or anti-pattern elsewhere and report must-fix, review, and clean occurrences.

About

Searches a repo for similar patterns after a fix to catch the same bug in other places and prevent whack-a-mole. A developer uses it after implementing a fix or to audit for a known pattern.

  • Derives the pattern from the recent diff with 'auto'
  • Classifies occurrences as must-fix, review, or false positive

Sweep by the numbers

  • 1 all-time installs (skills.sh)
  • Ranked #984 of 1,352 Code Review & Quality skills by installs in the Skillselion catalog
  • Data as of Jul 14, 2026 (Skillselion catalog sync)
npx skills add https://github.com/drewdrewthis/claude-skills --skill sweep

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs1
repo stars2
Last updatedApril 22, 2026
Repositorydrewdrewthis/claude-skills

What it does

After a fix or feature, search the codebase for the same pattern or anti-pattern elsewhere and report must-fix, review, and clean occurrences.

Files

SKILL.mdMarkdownGitHub ↗

Sweep

After fixing a bug or implementing a feature, search the codebase for similar patterns elsewhere. Prevents whack-a-mole fixes.

Input

$ARGUMENTS — either:

  • A description of the pattern to search for (e.g., "unchecked null returns from getUserById")
  • auto — derive the pattern from the most recent commit or PR diff

Step 0: Track Progress

Before starting, create a task for each step below using TaskCreate. Chain sequential steps with addBlockedBy. As you work, update each task's status to in_progress when starting it and completed when done.

Step 1: Identify the pattern

If auto: read the recent diff (git diff HEAD~1 or gh pr diff) and identify:

  • The anti-pattern that was fixed (for bug fixes)
  • The new pattern that was introduced (for features)
  • The contract that changed (for refactors)

State the pattern clearly in one sentence before searching.

Step 2: Search

Use targeted grep/glob to find similar occurrences. Be specific — don't grep for generic terms. Search for:

  • Same function calls with same risky usage
  • Same structural pattern (e.g., missing error handling on a specific API)
  • Same anti-pattern in related modules

Limit scope to the current repo unless told otherwise.

Step 3: Classify findings

For each occurrence found:

ClassificationAction
Same bug — identical anti-pattern, will cause same issueFlag as must-fix
Similar risk — same pattern but different context, may or may not be a problemFlag for review
False positive — pattern matches but context makes it safeSkip

Step 4: Report

Output a sweep report:

## Sweep: [pattern description]

**Source:** [commit/PR that triggered the sweep]

### Must-fix (N)
| File | Line | Description |
|------|------|-------------|
| path/to/file.ts | 42 | Same unchecked return |

### Review (N)
| File | Line | Description |
|------|------|-------------|
| path/to/other.ts | 88 | Similar pattern, different context |

### Clean
N files checked, no additional occurrences.

Step 5: Persist

To prevent duplicate sweeps on the same pattern, append a summary to the PR description or post as a PR comment:

### Sweep: [pattern]
Checked N files. Found M must-fix, K review. [Details above / in comments]

This lets /review and /pr-review see that a sweep was already done and skip re-sweeping the same pattern.

Final Check

Run TaskList. If any task is not completed, go back and finish it now.

Composability

  • /orchestrate calls /sweep between implement and review
  • /pr-review checks if a sweep was done (look for "### Sweep:" in PR description/comments). If not, run one.
  • /review can invoke /sweep if it finds a concerning pattern during code review

Related skills

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.