Token导航 LogoToken导航TokenDH.com
研究检索external-servicegithub未标认证来源可访问许可证需确认审计通过

de-sloppify去马虎

Agent Skill

de-sloppify 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

523

周安装

22

GitHub Stars

315

下载量

183
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:de-sloppify(去马虎)
来源仓库:https://github.com/codewithmukesh/dotnet-claude-kit
仓库路径:skills/de-sloppify
安装命令:
npx skills add https://github.com/codewithmukesh/dotnet-claude-kit --skill de-sloppify
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/codewithmukesh/dotnet-claude-kit --skill de-sloppify

简介

.NET代码清理流水线工具,按安全顺序执行格式化、死码移除等操作。

  • 严格遵循dotnet build/test验证循环,每步变更后必须通过编译测试。
  • 优先处理格式化问题再清理死代码,避免批量修改引发合并冲突。
  • 移除前需验证反射、DI约定等隐式引用,防止误删关键业务逻辑。
  • de-sloppify 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

De-Sloppify

Core Principles

  1. Systematic over random — Follow the cleanup pipeline in order. Formatting first (because it touches every file), dead code last (because earlier steps might reveal it). Random cleanup misses things and creates merge conflicts.
  2. Verify after each step — Run dotnet build and dotnet test after every step. A cleanup that breaks something is worse than the mess it was fixing. Never batch multiple cleanup types into one untested change.
  3. Safe removals only — Before removing any code flagged as "dead," verify it isn't used via reflection, DI conventions, or serialization. find_references shows compile-time usage; grep for string-based references that Roslyn cannot track.
  4. One concern at a time — Don't mix formatting fixes with logic changes. Don't combine dead code removal with new feature work. Separate concerns make code review possible and reverts safe.
  5. Commit between phases — Each cleanup step gets its own commit. If Step 4 (dead code removal) breaks something, revert just that commit without losing the formatting and analyzer fixes from Steps 1-3.

Patterns

7-Step Cleanup Pipeline

Execute in order. Verify (build + test) after each step. Commit each step separately.

Step 1: Format All Code

dotnet format

Why first: Formatting touches many files. Getting it out of the way prevents merge conflicts with subsequent steps. After this step, every file has consistent style.

Verify: dotnet format --verify-no-changes should report no changes. Commit: chore: apply dotnet format

Step 2: Remove Unused Usings

dotnet format analyzers --diagnostics IDE0005

Why second: Unused usings are noise. Removing them makes subsequent analysis cleaner and reduces false positives in code review.

Verify: dotnet build should show no new errors. Run dotnet test if usings removal is extensive. Commit: chore: remove unused using statements

Step 3: Fix Analyzer Warnings

MCP: get_diagnostics(scope: "solution", severityFilter: "warning")

Triage warnings by category:

  • Nullability warnings (CS8600-CS8604) — Add null checks or use the null-forgiving operator with a comment explaining why null is impossible.
  • Unused variables (CS0219) — Remove them.
  • Obsolete API usage (CS0618) — Migrate to the recommended replacement.
  • IDE suggestions (IDE0xxx) — Apply if they improve readability.

Fix in priority order: compiler warnings first, then analyzer suggestions. Verify: dotnet build with zero new warnings. dotnet test passes. Commit: chore: fix analyzer warnings

Step 4: Remove Dead Code

MCP: find_dead_code(scope: "solution", kind: "all")

For each result, perform a safety check before removing:

SAFETY CHECK BEFORE REMOVAL:
1. find_references(symbolName: "DeadType") — confirm zero compile-time references
2. Grep for string-based usage:
   - "nameof(DeadType)" — sometimes used in attributes or logging
   - Reflection: Type.GetType("DeadType"), Activator.CreateInstance
   - DI registration: services.AddScoped(typeof(IHandler<>), typeof(DeadType))
   - Serialization: [JsonDerivedType(typeof(DeadType))]
3. Check if it's a public API consumed by external packages
4. Check if it's referenced in configuration files (appsettings.json, etc.)

ONLY remove if all checks come back clean.

Verify: dotnet build and dotnet test pass. Commit: chore: remove dead code

Step 5: Resolve TODOs

# Find all TODOs in the codebase
grep -rn "TODO\|HACK\|FIXME\|XXX" --include="*.cs"

For each TODO, decide:

  • Fix it now — If it's small and self-contained, resolve it in this cleanup pass.
  • Create an issue — If it requires significant work, create a GitHub issue and update the TODO with the issue number: // TODO(#142): Implement retry logic
  • Remove it — If it's stale (the work was already done or is no longer relevant), delete the comment.

Verify: dotnet build and dotnet test pass. Commit: chore: resolve TODO comments

Step 6: Seal Non-Inherited Classes

MCP: find_dead_code(scope: "solution", kind: "type") — for a list of types
MCP: get_type_hierarchy(typeName: "EachClass") — check for derived types

Add sealed to every class that:

  • Has no derived types (confirmed via get_type_hierarchy)
  • Is not a base class by design (no virtual or abstract members)
  • Is not used as an open generic in DI registration
  • Is not a test fixture base class

Why seal: Sealed classes enable compiler optimizations (devirtualization), communicate design intent ("this class is not meant to be extended"), and prevent accidental inheritance.

// BEFORE
public class OrderValidator : AbstractValidator<CreateOrderCommand>
{
    public OrderValidator()
    {
        RuleFor(x => x.CustomerId).NotEmpty();
    }
}

// AFTER — sealed, because nothing inherits from it
public sealed class OrderValidator : AbstractValidator<CreateOrderCommand>
{
    public OrderValidator()
    {
        RuleFor(x => x.CustomerId).NotEmpty();
    }
}

Skip sealing:

  • Classes with virtual members designed for override
  • Classes used as IClassFixture<T> in tests (xUnit requires non-sealed)
  • Base classes in a hierarchy (Entity<T>, AggregateRoot, etc.)

Verify: dotnet build and dotnet test pass. Commit: chore: seal non-inherited classes

Step 7: Propagate CancellationToken

MCP: detect_antipatterns(severity: "warning") — filter for "missing CancellationToken"

Trace the async call chain from entry points (endpoints, handlers) through services to data access (DbContext, HttpClient). Ensure CancellationToken flows through every layer.

// BEFORE — CancellationToken stops at the endpoint
app.MapGet("/orders/{id}", async (Guid id, AppDbContext db) =>
{
    var order = await db.Orders.FindAsync(id);
    return order is not null ? Results.Ok(order) : Results.NotFound();
});

// AFTER — CancellationToken propagated to EF Core
app.MapGet("/orders/{id}", async (Guid id, AppDbContext db, CancellationToken ct) =>
{
    var order = await db.Orders.FindAsync([id], ct);
    return order is not null ? Results.Ok(order) : Results.NotFound();
});

Common propagation points:

  • Minimal API endpoints: add CancellationToken ct parameter (auto-bound by ASP.NET Core)
  • Mediator/MediatR handlers: already provided in Handle(TRequest, CancellationToken)
  • EF Core: SaveChangesAsync(ct), ToListAsync(ct), FindAsync([key], ct)
  • HttpClient: GetAsync(url, ct), PostAsync(url, content, ct)

Verify: dotnet build and dotnet test pass. Commit: chore: propagate CancellationToken through async chains

Cleanup Summary Report

After completing all steps, produce a summary:

## De-Sloppify Report

| Step | Changes | Files Affected |
|------|---------|----------------|
| 1. Format | Applied consistent formatting | 23 files |
| 2. Usings | Removed 47 unused usings | 18 files |
| 3. Analyzers | Fixed 12 warnings (8 nullability, 3 unused vars, 1 obsolete) | 9 files |
| 4. Dead Code | Removed 3 unused types, 5 unused methods | 6 files |
| 5. TODOs | Fixed 2, created issues for 3, removed 1 stale | 5 files |
| 6. Sealed | Sealed 14 classes | 14 files |
| 7. CancellationToken | Added propagation to 8 async chains | 11 files |

**Total: 7 commits, 86 files improved**

Anti-patterns

Mixing Cleanup with Feature Work

# BAD — one commit with formatting + new feature + dead code removal
git commit -m "Add order validation and clean up code"
# Impossible to review, impossible to revert the cleanup without losing the feature

# GOOD — separate commits, separate concerns
git commit -m "chore: apply dotnet format"
git commit -m "chore: remove dead code"
git commit -m "feat: add order validation"

Removing Code Without Checking Reflection

# BAD — find_dead_code says it's unused, so delete it
MCP: find_dead_code → "PaymentProcessor has 0 references"
*Deletes PaymentProcessor*
# Runtime crash: DI container can't resolve IPaymentProcessor
# It was registered via: services.AddScoped(typeof(IPaymentProcessor), typeof(PaymentProcessor))

# GOOD — safety check before removal
MCP: find_dead_code → "PaymentProcessor has 0 references"
MCP: find_references(symbolName: "PaymentProcessor") → 0 compile-time refs
Grep: "PaymentProcessor" in *.cs, *.json → Found in DI registration
*Keep PaymentProcessor — it's used via DI convention*

Sealing Classes That Tests Mock

# BAD — sealing a class that tests inherit from
public sealed class OrderService { ... }
// Test project: class MockOrderService : OrderService { ... } — COMPILE ERROR

# GOOD — check for test doubles before sealing
MCP: get_type_hierarchy(typeName: "OrderService") → no derived types in production
Grep: "OrderService" in test projects → no inheritance, only usage via interface
*Safe to seal — tests use IOrderService, not OrderService directly*

Batch-Committing All Cleanup

# BAD — one giant commit with all 7 steps
git add -A && git commit -m "chore: cleanup everything"
# If sealing a class broke a test, you have to revert ALL cleanup to fix it

# GOOD — commit per step with verification between
Step 1 → verify → commit
Step 2 → verify → commit
...
# If Step 6 (sealed) breaks something, revert only that commit

Running Cleanup Without Tests

# BAD — "it's just formatting and dead code, what could go wrong?"
dotnet format → commit (no test run)
Remove dead code → commit (no test run)
# Dead code was actually used by a test helper via reflection — tests broken

# GOOD — verify after every step
dotnet format → dotnet test → commit
Remove dead code → dotnet test → commit

Decision Guide

ScenarioSteps to RunNotes
Full cleanup passAll 7Dedicate a session to cleanup only
Quick tidy before PR1, 2, 6Format, usings, format check
After large feature merge1, 2, 3, 4Clean up accumulated mess
Quarterly maintenanceAll 7Schedule regular cleanup sprints
New team member onboarding1, 2, 3Get the codebase to a clean baseline
Before performance work4, 6Remove dead code, seal classes for devirtualization
After dependency upgrade2, 3Fix new analyzer warnings from updated packages
Pre-release hardeningAll 7Full cleanup before a release
CI warning threshold exceeded3Focus on analyzer warnings only
Tech debt sprint4, 5Dead code and TODO resolution

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

37.32%
按下载量换算68

Claude

30.99%
按下载量换算57

Cursor

19.83%
按下载量换算36

Gemini CLI

8.72%
按下载量换算16

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

external-service

该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills