agentleFS
enaptenapt/SwarmLLM/.claude/skills/sweep/SKILL.md

sweep

Skill82 starsChanged 30 days agoApache-2.0View on GitHub

Deploy parallel agents to scan the SwarmLLM codebase for dead code, duplication, inconsistencies and stale references, then fix the obvious ones

21 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use incident, adr and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • JkudjoSkill

    incident

    Production incident response — structured triage, hypothesis tree, safe remediation, incident record

    Also in 3 projects that use this

  • asterkinSkill

    adr

    Create Architecture Decision Records (ADRs) following project standards. Guides template usage, process, and best practices for documenting architecturally significant decisions.

    Also in 4 projects that use this

  • anombyte93Skill

    discover

    Phase 1 of the prd-taskmaster pipeline: brainstorm-driven discovery. Delegates to superpowers:brainstorming in Interactive Mode (one adaptive question at a time), or self-brainstorms in Autonomous Mode when no user is present. Intercepts before the brainstorming chain hands off to writing-plans — this skill owns the exit. Extracts constraints, calibrates scale (Solo / Team / Enterprise), and advances the pipeline to GENERATE.

    Also in 3 projects that use this

  • GitHubSkill

    refactor

    Surgical code refactoring to improve maintainability without changing behavior. Covers extracting functions, renaming variables, breaking down god functions, improving type safety, eliminating code smells, and applying design patterns. Less drastic than repo-rebuilder; use for gradual improvements.

    Also in 5 projects that use this

  • MicrosoftSkill

    diagnose

    Use to systematically diagnose why scenarios fail — identifies root causes by analyzing agent traces, codebase, and behavioral patterns

    Also in 4 projects that use this

  • nicolasestremSkill

    brainstorm

    Structured idea generation and solution exploration with systematic analysis.

    Also in 4 projects that use this

The file

Files
SKILL.md

Codebase Sweep

Four parallel sonnet feature-dev:code-reviewer agents, one category each. They only READ, so no worktree isolation (every subagent already starts with a fresh context; a worktree only isolates files).

Prior findings — by grep, never pasted

.claude/sweep-log.jsonl holds every finding ever made (~470 KB, 1.5k lines). Never paste it into a prompt — that is ~110K tokens per agent. Tell each agent: before reporting a finding, search .claude/sweep-log.jsonl for the file or symbol with the Grep tool; drop it if a fixed or wontfix entry covers it. (The reviewer agents have Grep, Glob and Read, but no Bash.)

Rotation

YOU compute each agent's file list and paste it into its prompt — the agents cannot run find. Offset = (line count of the sweep log ÷ 10) mod file count; agents 1 and 3 take find src/ -name '*.rs' | sort from that offset, agents 2 and 4 find frontend/js/ -name '*.js' | sort, wrapping around.

Docs drift — run it yourself first (seconds, no agent)

python3 examples/docs_drift.py --memory checks mechanically what agents read past: every backticked name a doc cites still exists, a module::path::item is defined under that path, each DIAGNOSTICS DIAG row's level and fields match its tracing call, every file.md § "Heading" resolves. It is a report — read each line (proposals and other projects' names are legitimately absent), fix the real ones, log the rest wontfix. Agent 4 then spends its budget on prose and numbers, not names.

Agents (launch all four in one message, model: sonnet, effort: high)

  1. Dead code + stale references — pub items with no external caller, unreachable arms, comments naming removed code, #[allow(dead_code)] hiding a real warning.
  2. Duplication — near-identical blocks (>5 lines), one transformation done in several places, duplicate fetches or DOM patterns in the frontend.
  3. Consistency — an error type chosen at a call site, unbounded collections, unvalidated API input, magic numbers, unstructured tracing calls.
  4. Frontend + i18n + docs — English bypassing I18n.t(), dead CSS/JS, doc comments or docs/ text that no longer match the code.

Each finding: file, line, what is wrong, confidence ≥ 80%. Not test-only code, not an item listed in docs/ARCHITECTURE.md § "Deferred Items", and "0 new issues" is a valid result — never manufacture one.

After the agents return

  1. Deduplicate, then verify every finding yourself before acting — see "Verify before deleting" below.
  2. Fix what is obvious and low-risk immediately, committing as you go. For the rest, research (diagnosis rule 0) and decide — you manage this project; raise with the user only what needs their hands.
  3. Append one line per addressed finding to .claude/sweep-log.jsonl: {"file":"…","line":N,"kind":"…","summary":"…","status":"fixed|wontfix|deferred","date":"YYYY-MM-DD"}

Verify before deleting

Sweep agents report dead code / orphaned keys with confidence ≥80%, but their grep may miss call sites in adjacent directories (R120 caught Agent 4 missing 6 enc.* callers in init.js, core/utils.js, chat.js). Before deleting anything an agent flagged:

grep -rn "thing_name" frontend/js/ frontend/index.html frontend/css/   # full frontend
grep -rn "thing_name\b" src/ tests/ crates/                            # word-boundary; catches re-exports

Cheap to verify; expensive to mis-restore. If callers exist, log as wontfix in .claude/sweep-log.jsonl to prevent re-report.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.