원클릭으로
violation-sweep
Scans source and .claude/ files for anti-pattern violations, applies the top mechanical fixes, and reports pre/post counts.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Scans source and .claude/ files for anti-pattern violations, applies the top mechanical fixes, and reports pre/post counts.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Batch-verify and delete dead code: rg-confirm zero callers for N symbols, delete files, run the build once, stage results.
Run benchmarks and check regressions, add benchmark gating to CI, or audit GitHub Actions workflows. Determines mode from user intent.
Batch-apply findings from the most recent --local review. One confirmation, one test run.
Orchestrated code review of git diff using parallel agents. Standard mode (diff-scoped) or full mode (adds Roslyn semantic analysis). Produces severity-grouped plan.
Unified code review: --local (diff review), --pr (adversarial PR review), --apply (batch fixes from last review).
Audit .NET solution health across 13 dimensions: dependency graph, solution sync, CPM compliance, package health, framework consistency, IVT & encapsulation, build config, analyzer config, NuGet config, suppression hygiene, output type & AOT, public API surface, and lock files & pruning. Works with any .NET solution (.slnx or .sln). Parses all config files once, spawns 3 parallel agents, and produces a severity-grouped report with a Mermaid dependency graph. Triggers on: solution audit, audit solution, project graph, dependency audit, solution health, audit projects, check solution.
| name | violation-sweep |
| description | Scans source and .claude/ files for anti-pattern violations, applies the top mechanical fixes, and reports pre/post counts. |
| when_to_use | violation sweep, sweep violations, fix violations, clean violations, sweep all violations, fix anti-patterns, sweep skills. |
| allowed-tools | Bash, Read, Edit |
| argument-hint | [--dry] [--claude] |
Scan for anti-pattern violations, apply mechanical fixes, and report counts.
scripts/violation-scan.sh --json # source (src/) only
scripts/violation-scan.sh --claude --json # also scan .claude/skills + .claude/agents
Pass --claude when the skill was invoked with --claude. Parse the JSON:
violations — overall countby_pattern — object keyed by pattern name; each has {count, reason, files}Sort pattern entries by count descending. If violations == 0: emit
"No violations found." and stop — skip Steps 2–4.
For the top 3 patterns by count, apply the fix described in each pattern's
reason field. These are mechanical, one-line substitutions:
| Pattern | Fix |
|---|---|
datetime-now | Inject TimeProvider via DI; use timeProvider.GetUtcNow() |
new-httpclient | Inject IHttpClientFactory; use factory.CreateClient() |
async-void | Change return type to async Task (except event handlers) |
sync-over-async | await the task instead of .Result / .GetAwaiter().GetResult() |
For each file in the pattern's files list: Read it, apply the fix with Edit.
If --dry was passed: report the files and intended fix per pattern, then
stop — skip Steps 3 and 4.
Re-run the same scan command from Step 1 and capture the post-fix total.
Present the changed files before staging:
scripts/diff.sh --json
After the user confirms, stage:
scripts/internal/stage.sh --include-new
Emit a summary table:
Violation Sweep
Pre-fix total: N violations
Post-fix total: N violations (or: N/A — dry run)
Categories fixed: pattern-name (N→M), pattern-name (N→M), ...
Deferred: pattern-name (needs human review), ...
async void, intentional
DateTime.Now in tests, etc. Surface these in the "Deferred" row.--dry skips writes and staging — scan + preview only