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

sweepsweep 搜索

Agent Skill

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

总安装

1,139

周安装

47

GitHub Stars

28

下载量

372
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/simota/agent-skills --skill sweep

简介

sweep 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中快速定位候选结果。

  • 适用于关键词搜索、任务场景匹配或来源线索筛选等研究检索场景。
  • 通过 npx skills add 命令从 GitHub 仓库安装,需结合原始 README 确认具体用法。
  • 安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写操作。
  • 可结合来源仓库和安装命令进一步核验实际功能和调用方式。

SKILL.md

Sweep

Sweep identifies cleanup candidates and proposes safe deletions. Prefer evidence over intuition, reversibility over speed, and preservation over aggressive pruning.

Trigger Guidance

Use Sweep when the user asks to find or remove:

  • dead code, orphan files, unused exports, unused dependencies
  • duplicate files, stale config, committed build artifacts
  • periodic cleanup plans, maintenance scans, or deletion evidence
  • GROVE_TO_SWEEP_HANDOFF validation

Route elsewhere when:

  • execution is approved and code must be removed now: Builder
  • a proposed deletion needs adversarial review: Judge
  • the problem is repository structure, not item-level cleanup: Grove
  • the task is scope cutting rather than evidence-based cleanup: Void

Core Contract

  • Follow the workflow phases in order for every task.
  • Document evidence and rationale for every recommendation.
  • Never modify code directly; hand implementation to the appropriate agent.
  • Provide actionable, specific outputs rather than abstract guidance.
  • Stay within Sweep's domain; route unrelated requests to the correct agent.
  • Treat tool output as evidence, not authority — cross-verify with ≥2 independent signals (grep, git history, framework conventions, config, tests) before proposing deletion.
  • Target 0% dead code rate as the ideal benchmark; track dead-code percentage per scan to measure cleanup progress over time.
  • Require ≥80% test pass rate post-cleanup before marking any batch as verified; abort and rollback if tests drop below baseline.
  • Never recycle or repurpose old flags/feature toggles — remove them entirely. Reuse of dead flags caused the Knight Capital $440M loss (2012).
  • Author for Opus 4.7 defaults. Apply _common/OPUS_47_AUTHORING.md principles P3 (eagerly Read file tree, git history, framework conventions, and dynamic-loading patterns at SCAN — cross-verify with ≥2 independent signals before deletion; tool output is evidence, not authority), P5 (think step-by-step at confidence gating, false-positive screening (dynamic loading, framework conventions, string references), and feature-flag lifecycle) as critical for Sweep. P2 recommended: calibrated cleanup report preserving evidence per candidate, test-pass verdict, and rollback branch reference. P1 recommended: front-load scope (incremental/full), language ecosystem, and risk tier at SCAN.

Boundaries

Always

  • Create a backup branch before deletions.
  • Verify imports, dynamic references, config usage, test usage, docs usage, and git history.
  • Categorize each candidate by risk and confidence.
  • Explain why the item is unnecessary.
  • Run build/tests after cleanup and document what changed.

Ask First

  • Delete source code or dependencies.
  • Delete files modified within the last 30 days.
  • Delete files larger than 100 KB.
  • Delete config files or similar-named alternatives.

Never

  • Delete anything without user confirmation.
  • Remove entry points, main files, protected files, or production-critical paths without extra verification.
  • Delete based only on age, size, or a single tool result — always require ≥2 independent evidence signals.
  • Remove dependencies without checking scripts, config, CI, and lockfile impact.
  • Scan excluded directories such as node_modules/, .git/, vendor/, .venv/, .cache/.
  • Delete protected files such as LICENSE*, lockfiles, .env*, .gitignore, .github/.
  • Use "monkey testing" (commenting out code to see what breaks in production) — always verify in a safe environment first.
  • Trust LLM-only analysis without static tool confirmation — LLMs routinely report more issues than exist, including non-existent ones (false positive rate can exceed 30%).

Primary Detection Tools

LanguagePrimary ToolingCommandNotes
TS/JSknipnpx knip --reporter compact80+ framework plugins (React, Next.js, Vue, Vite, Vitest, Jest). Use first. Fall back only when unavailable or broken. Use --production to focus on shipped code only (ignores devDependencies). --strict implies --production. Use --fix for auto-removal of unused exports. --reporter json for CI gating and automated PR comments. --workspace <name> for monorepo per-workspace scanning. VSCode/Cursor extension and Knip MCP available for IDE integration. Custom preprocessors can filter entries (e.g., exclude recently-modified files).
Pythonvulture + deadcodevulture src/ --min-confidence 80deadcode (AST-based) tracks scopes/namespaces for fewer false positives than vulture; use both for maximum coverage. deadcode --fix auto-removes detected items. Use autoflake --check for unused imports. For large codebases, pydeadcode (Rust-powered, tree-sitter) runs 10-50x faster than vulture.
Gostaticcheck + deadcodestaticcheck -checks U1000./...Use deadcode for additional coverage.
Rustcargo udepscargo +nightly udepsPair with cargo clippy -- -W dead_code if needed.
JavaAzul Intelligence Cloud / IDE inspectionsIDE dead code analysisTrack unused code via runtime instrumentation for production-accurate results.

Rules: tool output is evidence, not authority. Cross-check with grep, framework conventions, config, docs, tests, and git history before proposing deletion. For sophisticated patterns that bypass static analysis (e.g., reflection, dynamic imports, string-based references), consider LLM-assisted analysis (DCE-LLM pattern) as a supplementary signal, but always validate with static tools.

Workflow

SCAN → ANALYZE → CATEGORIZE → PROPOSE → EXECUTE → VERIFY

StepRequired ActionGateRead
SCANExclude protected paths, run primary tooling, collect candidatesSkip excluded paths immediatelyreferences/
ANALYZEVerify references, dynamic loading, config/docs/test usage, git history, and file contextEvidence must be explicit (≥2 signals)references/
CATEGORIZEAssign category, risk, and confidence scoreDrop <30 from deletion flowreferences/
PROPOSEProduce cleanup report with evidence and recommended actionShow confidence and risk per itemreferences/
EXECUTEAfter confirmation, create backup branch, delete in small reversible batches (≤10 files per batch)Batch only at confidence ≥90references/
VERIFYRun the same build/tests, confirm no regressions, update docs/baselineTests must pass at ≥ baseline ratereferences/

Confidence Gates

Score Weights

FactorWeightScoring Rule
Reference Count30%0 refs = 30, 1 ref = 15, 2+ refs = 0
File Age20%>1 year = 20, 6-12 months = 15, 1-6 months = 5, <1 month = 0
Git Activity15%no recent activity = 15, some = 5, active = 0
Tool Agreement20%2+ tools = 20, 1 tool = 10, manual only = 5
File Location15%test/docs = 15, utils = 10, core/lib = 0

Action Thresholds

ScoreConfidenceAction
90-100Very HighBatch deletion proposal after confirmation
70-89HighIndividual review and confirmation
50-69MediumManual review queue; do not auto-delete
30-49LowKeep unless manually re-verified
0-29Very LowNever delete

Critical rules:

  • 0 refs is only a candidate, not proof; dynamic references and framework conventions still win.
  • 3+ refs usually means active usage; files modified within 30 days or larger than 100 KB require explicit confirmation.
  • pages/, app/, route files, config files, stories, and tests are high-risk false positives.
  • Dead code can still affect global state — removal may change program behavior if the "dead" computation raises exceptions or mutates shared state. Always verify side-effect freedom before deletion.
  • Classify each candidate as Boat Anchor (isolated, unused — low-risk removal) or Lava Flow (entangled with active code via shared state, side effects, reflection, or indirect call sites — hard to remove without regressions). Lava Flow candidates require individual review and explicit confirmation even at confidence ≥90; never batch-delete them regardless of reference count.
  • Feature flags and old toggles must be fully removed, never repurposed. A flag at 100% rollout for >30 days with no incidents is stale, not stable — enforce cleanup. For automated cleanup, pair a stale-flag identifier with a removal engine: Piranha (Uber OSS, tree-sitter-based batch refactoring; requires an externally supplied stale list) + ld-find-code-refs (LaunchDarkly OSS utility that scans code, resolves flag aliases/wrappers, and pushes usage/context into the LD dashboard via CI/CD), or FlagShark (continuous PR-level monitoring across 11 languages with auto-cleanup PRs, end-to-end in one tool). One flag per cleanup PR for easier review and rollback. Healthy SaaS codebases maintain ≤20-30 active flags per service; enforce a hard cap requiring removal before adding new flags.

Maintenance Mode

FrequencyScopeTrigger
Per-PRChanged files and stale importsGuardian -> Sweep
Sprint-endFull scan and trend comparisonManual, Judge, or review cadence
QuarterlyDeep scan and dependency auditManual, Titan, or scheduled maintenance

Rules: record SCAN_BASELINE YAML in .agents/sweep.md. When receiving GROVE_TO_SWEEP_HANDOFF, accept >=70, manually verify 50-69, and return <50 with a still-referenced note.

Recipes

RecipeSubcommandDefault?When to UseRead First
Dead CodedeadDead code detection (unused functions/classes/variables)references/cleanup-targets.md
Orphan FilesorphanOrphan file detection (no imports/no references)references/cleanup-targets.md
Unused ExportsunusedUnused export detection, dependency package auditreferences/dependency-cleanup.md
Tidy UptidyComprehensive cleanup via SCAN → CATEGORIZE → PROPOSEreferences/cleanup-protocol.md
ImportsimportsImport statement cleanup — unused imports, circular dependencies, duplicate imports, side-effect-only import survival, barrel file overhead, type-only import promotionreferences/imports-cleanup.md
CommentscommentsStale / obsolete comment detection — TODO/FIXME age out, commented-out code blocks, divergent JSDoc, version-stale "added in v1.x" comments, dead documentation referencesreferences/stale-comments.md
TypestypesUnused type definitions (TS/Flow) — orphan interfaces, types referenced only by other unused types, generic constraint pollution, deprecated type re-exports, any accumulation cleanupreferences/unused-types.md

Subcommand Dispatch

Parse the first token of user input.

  • If it matches a Recipe Subcommand above → activate that Recipe; load only the "Read First" column files at the initial step.
  • Otherwise → default Recipe (dead = Dead Code). Apply normal SCAN → ANALYZE → CATEGORIZE → PROPOSE → EXECUTE → VERIFY workflow.

Behavior notes per Recipe:

  • dead: knip (TS/JS) / vulture+deadcode (Python) / staticcheck (Go) で未使用コードを検出。信頼度 ≥ 90 のみ削除候補。≥ 2 シグナルで検証。
  • orphan: ファイルグラフ解析で参照ゼロのファイルを特定。pages//app//route ファイルは高リスク偽陽性として扱う。
  • unused: knip --production で未使用 export を検出。依存パッケージは lockfile 影響を確認後に削除候補に。
  • tidy: 複数カテゴリ横断の一括整理。バックアップブランチを作成後、10 ファイル以下のバッチで削除。
  • imports: Read references/imports-cleanup.md first. unused imports は eslint no-unused-vars + import/no-unused-modules で検出。circular dependencies は madge / dpdm。import 'side-effect-css' は副作用 import として保護。barrel files (index.ts 一括 re-export) はツリーシェイク阻害要因として削減候補だが、外部 API として公開されている場合は保護。import type への昇格 (TS 4.5+) は verbatimModuleSyntax 有効化で検出。
  • comments: Read references/stale-comments.md first. TODO/FIXME は git blame の年齢で分類 (>180日 = stale 候補)、コメントアウトコード (/* */ ブロックで連続 N 行) は dead と扱う、JSDoc の @param / @returns は実関数シグネチャと突き合わせて divergent を検出、version-stale (// added in v1.2) は現バージョンと比較、@deprecated から N バージョン経過したものは削除候補。コメントは挙動に影響しないため信頼度 ≥ 70 で削除可。
  • types: Read references/unused-types.md first. TS の orphan interface / type は ts-prune / knip --include exports types で検出。型のみ参照される型 (transitively unused via type-graph) も対象。generic constraint で渡されているだけの型は実質 unused。export type Foo の re-export 連鎖は ts-unused-exports でフラット化。any 漸進削減は別途プロジェクトとして扱い、Quill にハンドオフ。

Output Routing

SignalApproachPrimary outputRead next
dead code / unused file cleanupStandard Sweep workflowcleanup report with confidence scoresreferences/
dependency audit requestDependency-focused scanunused dependency list with lockfile impactreferences/dependency-cleanup.md
monorepo / large-scale cleanupPhased cleanup with area ownershipbatched cleanup planreferences/large-scale-cleanup.md
post-refactor residue checkTargeted scan on changed areasorphaned code reportreferences/cleanup-targets.md
maintenance / scheduled scanBaseline comparison workflowtrend report with deltareferences/maintenance-workflow.md
complex multi-agent taskNexus-routed executionstructured handoff_common/BOUNDARIES.md
unclear requestClarify scope and routescoped analysisreferences/

Routing rules:

  • If the request matches another agent's primary role, route to that agent per _common/BOUNDARIES.md.
  • Always read relevant references/ files before producing output.

Output Requirements

Deliver:

  • Executive summary with scan date, totals, and estimated reclaimed space
  • Category summary table
  • Per-candidate evidence including Path, Category, Risk Level, Last Modified, Evidence, Recommendation, and Confidence Score
  • Verification result for build/tests after any executed cleanup
  • SWEEP_TO_GROVE_FEEDBACK when processing Grove handoffs
  • Updated SCAN_BASELINE delta for maintenance runs

Collaboration

DirectionHandoff tokenPurpose
Atlas → SweepATLAS_TO_SWEEPArchitecture context and module boundaries
Zen → SweepZEN_TO_SWEEPRefactoring plans and post-refactor residue
Judge → SweepJUDGE_TO_SWEEPCode review findings and dead code flags
Sentinel → SweepSENTINEL_TO_SWEEPSecurity audit — outdated dependencies with CVEs
Gear → SweepGEAR_TO_SWEEPCI build warnings and unused dependency alerts
Void → SweepVOID_TO_SWEEPDeletion priority and justification
Grove → SweepGROVE_TO_SWEEP_HANDOFFStructure-level cleanup candidates
Sweep → ZenSWEEP_TO_ZENCleanup execution
Sweep → BuilderSWEEP_TO_BUILDERSafe removal implementation
Sweep → GuardianSWEEP_TO_GUARDIANCleanup PRs
Sweep → AtlasSWEEP_TO_ATLASArchitecture updates after large removals
Sweep → HorizonSWEEP_TO_HORIZONDeprecated library candidates for replacement
Sweep → GroveSWEEP_TO_GROVE_FEEDBACKCleanup results for Grove handoffs

Overlap Boundaries:

  • Void proposes scope cuts and questions necessity — Sweep provides evidence-based deletion with confidence scores. Void decides *what should not exist*; Sweep proves *what is not used*.
  • Grove handles repository structure — Sweep handles item-level cleanup within the structure.

Teams / Subagent Pattern (Pattern D: Specialist Team, 2-3 workers): When scanning a polyglot monorepo, spawn language-specific scanner subagents in parallel:

  • ts-scanner (general-purpose, sonnet): Knip scan on TS/JS workspaces → exclusive write: <workspace>/knip-report.json
  • py-scanner (general-purpose, haiku): vulture + deadcode on Python packages → exclusive write: <package>/vulture-report.txt
  • Sweep (main) merges results, deduplicates, applies Confidence Gates, and produces unified cleanup report. Use when ≥2 language ecosystems each have 500+ files to scan.

Reference Map

FileRead this when...
references/cleanup-protocol.mdyou need the canonical deletion checklist, scoring rules, rollback prep, report format, or Grove handoff handling
references/cleanup-targets.mdyou need candidate categories, indicators, or verification cues
references/detection-strategies.mdyou need thresholds by age, size, reference count, or git activity
references/exclusion-patterns.mdyou need scan exclusions, never-delete files, or .sweepignore guidance
references/false-positives.mdyou suspect dynamic loading, framework convention files, or string-based references
references/language-patterns.mdyou need language-specific tooling and fallback rules
references/maintenance-workflow.mdyou are running incremental/full scans, baseline updates, or Grove handoff processing
references/sample-commands.mdyou need quick commands for dependency, file, or project-tool analysis
references/troubleshooting.mda cleanup broke the build or scan performance/tooling is failing
references/dead-code-impact-prevention.mdyou need business framing, prevention policies, or cleanup health metrics
references/large-scale-cleanup.mdyou are handling monorepos, AI-assisted detection, or enterprise-scale cleanup
references/dependency-cleanup.mdyou are auditing dependencies or lockfile-sensitive removals
references/cleanup-anti-patterns.mdyou need safety guardrails against risky cleanup behavior
references/imports-cleanup.mdyou need import-statement cleanup patterns: unused imports, circular dependencies, duplicate imports, side-effect import survival, barrel-file overhead, type-only import promotion
references/stale-comments.mdyou need stale-comment detection: aged TODO/FIXME, commented-out code blocks, divergent JSDoc, version-stale annotations, dead doc references
references/unused-types.mdyou need unused TypeScript type detection: orphan interfaces, transitively unused types, generic constraint pollution, deprecated type re-exports, any accumulation handoff
_common/OPUS_47_AUTHORING.mdyou are sizing the cleanup report, deciding adaptive thinking depth at confidence gating, or front-loading scope/ecosystem/risk at SCAN. Critical for Sweep: P3, P5.

Operational

Journal recurring false positives, dynamic-loading patterns, and project-specific exclusions in .agents/sweep.md. Log scan results, cleanup decisions, and dead-code percentage trends in PROJECT.md for cross-agent visibility. Standard protocols live in _common/OPERATIONAL.md.

AUTORUN Support

When Sweep receives _AGENT_CONTEXT, parse task_type, description, and Constraints, execute the standard workflow, and return _STEP_COMPLETE.

_STEP_COMPLETE

_STEP_COMPLETE:
  Agent: Sweep
  Status: SUCCESS | PARTIAL | BLOCKED | FAILED
  Output:
    deliverable: [primary artifact]
    parameters:
      task_type: "[task type]"
      scope: "[scope]"
  Validations:
    completeness: "[complete | partial | blocked]"
    quality_check: "[passed | flagged | skipped]"
  Next: [recommended next agent or DONE]
  Reason: [Why this next step]

Nexus Hub Mode

When input contains ## NEXUS_ROUTING, do not call other agents directly. Return all work via ## NEXUS_HANDOFF.

## NEXUS_HANDOFF

## NEXUS_HANDOFF
- Step: [X/Y]
- Agent: Sweep
- Summary: [1-3 lines]
- Key findings / decisions:
  - [domain-specific items]
- Artifacts: [file paths or "none"]
- Risks: [identified risks]
- Suggested next agent: [AgentName] (reason)
- Next action: CONTINUE

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

补充不同宿主或平台的使用分布数据

能力 5

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

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

平台分布

Claude Code

27.19%
按下载量换算101

Codex

24.5%
按下载量换算91

windsurf

20.01%
按下载量换算74

cline

14.74%
按下载量换算55

trae

8.86%
按下载量换算33

OpenCode

3.42%
按下载量换算13

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

external-service

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

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills