Установка
SKILL.md
tidy
- IS: a fix-in-place cleanup pass. Four concurrent review agents read the current diff, the orchestrator merges their findings, edits the working tree, and proves the build is still green.
git statusshows more changes after than before. - IS NOT: a findings report (use
pr-reviewer: read-only, severity-tiered, never edits a file), a bug hunt, an architecture refactor, or a license to touch files outside the diff.
Contents
- Workflow checklist
- Phase 1: Scope and baseline
- Phase 2: Fan out four review agents
- Phase 3: Merge findings and apply fixes
- Phase 4: Verify and report
- Gotchas
- Related skills
Workflow checklist
Copy this to track progress:
Tidy progress:
- [ ] Phase 1: Scope the diff, load instruction files, capture lint/type-check/test baseline
- [ ] Phase 2: Launch all four agents in one message (read-only, fixed return format)
- [ ] Phase 3: Merge findings, resolve conflicts, apply fixes in precedence order
- [ ] Phase 4: Re-run checks, revert out-of-diff churn, report with command evidence
Phase 1: Scope and baseline
- Run
git diff(plusgit diff --stagedwhen changes are staged) to capture the diff. No git changes: review the files you edited earlier in this session or the files the user named. - Read
CLAUDE.md/AGENTS.mdin the project root and in any nested package or MFE directory whose code is in the diff. Conventions there (design system, styling tokens, data-fetching patterns, naming) override this skill's defaults when they conflict; extract the rules that cover the changed paths. - Run the project's lint, type-check, and test commands (read
package.jsonscripts;yarn lint,yarn type-check,yarn testare typical) and record pre-existing failures. Without this baseline you cannot tell a regression you introduced from a failure that was already there.
Phase 2: Fan out four review agents
Launch all four agents concurrently in a single message using the Agent tool. Each agent prompt must include:
- The full diff from Phase 1
- The in-scope instruction-file rules
- A read-only constraint: the agent returns findings and never edits files. Every edit happens in Phase 3 through the orchestrator, so two agents can never rewrite the same hunk.
- The return format: one finding per bullet as
file:line, issue, proposed fix; or an explicit "no findings" statement when the diff is clean
Agent 1: Reuse
- Search for existing utilities and helpers that could replace newly written code. Look for similar patterns elsewhere in the codebase; common locations are utility directories, shared modules, and files adjacent to the changed ones.
- Flag any new function that duplicates existing functionality. Name the existing function to use instead.
- Flag any inline logic that could use an existing in-repo utility: hand-rolled string manipulation, manual path handling, custom environment checks, ad-hoc type guards, and similar patterns are common candidates.
- Flag hand-rolled implementations of stdlib functionality. Name the stdlib function to use instead.
- Flag code or dependencies doing what the platform already does:
<input type="date">over a picker lib, CSS over JS,Intlover a formatting lib, a DB constraint over app-level checks. - Flag any new dependency added in this diff for something the stdlib, the platform, or an already-installed dependency covers.
Agent 2: Quality
- Redundant state: state that duplicates existing state, cached values that could be derived, observers/effects that could be direct calls
- Parameter sprawl: adding new parameters to a function instead of generalizing or restructuring existing ones
- Copy-paste with slight variation: near-duplicate code blocks that should be unified with a shared abstraction
- Leaky abstractions: exposing internal details that should be encapsulated, or breaking existing abstraction boundaries
- Stringly-typed code: raw strings where constants, string unions, or branded types already exist in the codebase
- Unnecessary JSX nesting: wrapper Boxes/elements that add no layout value; check whether inner component props (flexShrink, alignItems, etc.) already provide the needed behavior
- Unnecessary comments: comments explaining WHAT the code does (well-named identifiers already do that), narrating the change, or referencing the task/caller get deleted; keep only non-obvious WHY (hidden constraints, subtle invariants, workarounds)
- Unused imports and dead code: imports not referenced in the file; commented-out JSX/logic; stray
console.log,debugger, andalertstatements. Move TODO comments to the summary with a note on what they're blocking rather than deleting them silently anytypes: replace with the actual type, orunknownwhere the type is genuinely unknown. Never widen just to silence an error- React hook dependency arrays:
useEffect,useCallback,useMemodeps must be exhaustive. Flag any newly added// eslint-disable-next-line react-hooks/exhaustive-deps - Over-memoisation: remove
useCallback/useMemothat adds no value: wrapping asetStateupdater (the updater form is already stable), memoising with Apollo query objects as deps (busts on every refetch), or computing a value used only in the same component. KeepuseCallbackonly when the reference is passed to a child that would otherwise re-render, anduseMemoonly when the computation is demonstrably expensive - List keys: stable, unique keys on rendered lists. Never
indexunless the list is static and non-reorderable - Hooks called conditionally: hooks must never be called after an early return or inside a branch
useEffectfor derived state: compute values directly from existing state/props instead- Pattern compliance with
CLAUDE.md/AGENTS.md: imports from deprecated component packages, old styling tokens, long relative paths where path aliases exist, queries/mutations not following the established custom-hook pattern, naming inconsistent with surrounding files - Magic numbers/strings: extract to a named constant if used more than once or the value has no obvious meaning
- Unrequested compatibility: old/new dual paths, legacy aliases, or deprecated re-exports added in this diff when nothing depends on the old path. Delete it unless a real consumer is named
- Speculative flexibility: interfaces with one implementation, factories for one product, config for a value that never changes, layers with one caller, or parameters nothing passes, added in this diff. Inline or delete until a second consumer exists
Agent 3: Efficiency
- Unnecessary work: redundant computations, repeated file reads, duplicate network/API calls, N+1 patterns
- Missed concurrency: independent operations run sequentially when they could run in parallel
- Hot-path bloat: new blocking work added to startup or per-request/per-render hot paths
- Recurring no-op updates: state/store updates inside polling loops, intervals, or event handlers that fire unconditionally need a change-detection guard so downstream consumers aren't notified when nothing changed. Also: if a wrapper function takes an updater/reducer callback, verify it honors same-reference returns (or whatever the "no change" signal is); otherwise callers' early-return no-ops are silently defeated
- Unnecessary existence checks: pre-checking file/resource existence before operating (TOCTOU anti-pattern); operate directly and handle the error
- Memory: unbounded data structures, missing cleanup, event listener leaks
- Overly broad operations: reading entire files when only a portion is needed, loading all items when filtering for one
Agent 4: Test discipline
The bar for every finding: a test earns its place only if it can fail for a reason someone would act on. Each proposed test must name, in one sentence, the failure it prevents; a proposal without that sentence is not a finding. Tests earn their place by proving behaviour that regresses independently of the edit: filtering, derivation, validation, permissions, region/runtime gating, data transformation, generation contracts, a class-wide invariant. A changed config row, flag default, route entry, label, or copy string earns no test; the owning diff and the behaviour that surfaced the issue verify it. Never flag a new component or hook merely for lacking a co-located test file.
- Bug fix without a repro test: the diff fixes a bug but no test fails on the pre-fix code. The one missing-test finding that is always flagged. The repro belongs at the seam that failed (route, API, browser flow, integration point); a unit test on a helper invented during the fix is not regression coverage unless that helper owns the failing behaviour.
- Stale assertions: existing tests covering changed code that no longer reflect the updated behaviour
- Missing tests that clear the bar: new branching logic, a contract others depend on, or a refactor-surviving invariant in the diff with no test. State the failure each proposed test prevents
- Useless tests added in this diff, flagged for deletion: render-only tests (presence checks with no interaction or branch), mock-echo assertions (asserting a mock was called or returned its mocked value), change-detector snapshots, framework re-tests, happy-path triplication of the same branch, diff-mirror tests (the assertion repeats a literal copied from the diff: a config row, flag default, route entry, label, or copy string; a second ledger, not behaviour coverage), export-for-testability tests (a helper extracted or exported solely so a test can name it), fake-integration tests (an in-memory emulator of behaviour that lives in the real system: schema, validators, indexes, permissions; it cannot catch the bug class it claims to cover). Name the pattern each matches. A config-adjacent test stays only if it proves a rule across a class of cases; one whose name contains a single item id and whose assertion repeats the value just changed goes.
Phase 3: Merge findings and apply fixes
Wait for all four agents to finish, then merge before editing anything:
- Dedupe: collapse findings that point at the same lines or share one root cause into a single fix.
- Drop false positives: if a finding is wrong or not worth the churn, skip it and record the reason for the summary. Do not argue with the finding or apply it halfway.
- Order by precedence: reuse swaps and deletions first (Agent 1 plus dead-code findings), then quality rewrites (Agent 2), then efficiency (Agent 3), then test-assertion updates last so they target the final shape of the code. Polishing a block another finding deletes is wasted work.
- Resolve conflicts: when two findings propose incompatible rewrites of the same lines, prefer the one that deletes more code. If neither clearly wins, apply neither and present both options in the summary instead of guessing.
Apply each fix directly, re-reading the target region first; earlier fixes shift line numbers.
Scope rules:
- Only edit files inside the diff. Reading an adjacent file to understand a pattern is fine; rewriting it is not.
- No new abstractions, no architecture refactors, no fixes to pre-existing issues outside the diff.
- Tests are never silently written: proposed missing tests are surfaced in the summary with the one-sentence failure each prevents, for the user to decide on. Useless tests added in this diff (Agent 4, category 4) get deleted like any other quality fix. Stale assertions in existing tests covering changed code do get fixed.
Phase 4: Verify and report
- Re-run the exact lint, type-check, and test commands from Phase 1. Any failure not in the baseline was introduced by your fixes; resolve it before finishing. Leave pre-existing failures alone and list them in the summary.
- If a lint/format autofix reformatted files outside the diff,
git restore <path>each one. Rungit statusand confirm only in-diff files changed before finishing. - Report: what was fixed per agent category, skipped findings with reasons, surfaced test gaps, and the final lint/type-check/test status quoted from command output against the Phase 1 baseline. If the code was already clean, say so explicitly. "Looks good" without command output is not a valid exit.
Gotchas
- Launching agents sequentially: four serial agent runs roughly quadruple wall-clock time. All four launch in one message.
- A formatter autofix (
yarn lint --fixor equivalent) reformatting unrelated files: the diff fills with churn the reviewer must wade through.git restoreevery out-of-diff path before finishing. - Widening a type to
anyto silence an error a fix introduced: that hides the breakage instead of resolving it. Find the real type. - Fixing pre-existing failures because they are "right there": scope creep turns a cleanup pass into an unreviewable mixed change. Surface them in the summary instead.
- Agent 4 padding the summary with test proposals: coverage looks like rigor, so review agents over-propose tests. Every proposal without a named failure it prevents gets dropped in the Phase 3 false-positive pass.
Related skills
pr-reviewer: read-only, severity-tiered findings report that also hunts bugs; it never edits files. Both skills cover reuse, quality, and efficiency; the difference is report-only vs fix-in-place. Route there when the user wants to see findings before deciding what to fix.pr-creator: creates the PR after tidy finishes and the build is green.
Вставить в README
Ссылка на карточку для вашего README — без картинок и счётчиков.
[DarkPlay: tidy](https://darkplay.ru/ai/skills/mblode-agent-skills-tidy)
Из того же репозитория
Похожие скиллы и другие разделы каталога
Самые востребованные скиллов раздела по установкам и звёздам.
find-skillsvercel-labs · Помогает находить и устанавливать навыки агентов по запросам вроде «как сделать X»…
grill-memattpocock · Настойчивое интервью для доработки плана или дизайна.
hyperframesheygen-com · Обязательная точка входа для любых задач по видео, анимации и motion-графике в…
hyperframes-cliheygen-com · Цикл разработки HyperFrames CLI: init, add, render, preview, publish и другие команды.
agent-browservercel-labs · CLI для автоматизации браузера для ИИ-агентов: навигация по страницам, заполнение форм…
media-useheygen-com · Agent Media OS: единый навык для медиа в HyperFrames — BGM, SFX, изображения, голос, LUT.
hyperframes-registryheygen-com · Установка и подключение блоков реестра в композиции HyperFrames через add и catalog.
grill-with-docsmattpocock · Настойчивое интервью для доработки плана или дизайна, попутно создающее документацию (ADR…
improve-codebase-architecturemattpocock · Поиск в кодовой базе возможностей для углубления, визуальный HTML-отчёт о них и детальный…
tddmattpocock · Разработка через тестирование (TDD): red-green-refactor и интеграционные тесты.Соседние разделы каталога: возможно, нужный инструмент живёт там.
bibtidyanthropics · Навык Claude Code для проверки содержимого записей BibTeX по Google Scholar и CrossRef.
flexcomputeanthropics · Плагины Flexcompute: Tidy3D и PhotonForge с сервером tidy3d-mcp для симуляций.
tidyanthropics · tidy — интерактивный TDD-воркфлоу по подходу Tidy First Кента Бека: план из мелких задач…
tidycoderanthropics · Режим уборщика для Claude Code: удаляет регенерируемые артефакты (node_modules, .next…
obsidian-organizeragents365-ai · Наведение порядка в хранилище Obsidian: раскладка заметок по папкам.
io.github.dan-fetch-studio/tidyportsdan-fetch-studio · Просмотр и остановка dev-серверов, оставленных кодинг-агентами, и свободные порты без…
io.github.imkath/gmail-tidy-mcpimkath · Управление аккаунтами Gmail: письма, вложения, метки, фильтры, черновики. Без отправки и…
io.github.strontian/tidyvidstrontian · Убирает фоновый шум и эхо из видео и добавляет субтитры (SRT/VTT или вшитые в MP4).Лучшие ИИ-инструменты для автоматизации и ассистентов
Подборка ИИ-ассистентов для автоматизации рутины и ускорения рабочих процессов. Сервисы, которые берут на себя переписку, анализ данных, ведение базы знаний и подготовку продаж, эк
Give Me Public
AITunnelAitunnel
STIVAStiva
Wikibot (Викибот)Wikibot
mymeet.aiMymeet
InsighterInsighter
TGHuntTghunt
LegiscanLegiscan
RouterAIRouterai
Wikibot 1.0 (Викибот)WikibotЛучшие ИИ-инструменты для программирования
Подборка нейросетей и ИИ-ассистентов для разработки и автоматизации кода. Сервисы, которые ускоряют написание, ревью и отладку, экономят часы рутины и снижают порог входа в сложные
GenAPIGenapi
Notepad++ AINotepad-plus-plus
Creatium MaxCremax
Emacs AIGnu
KiteKite
Amazon Q DeveloperAmazonЛучшие ИИ-инструменты для генерации видео
Подборка нейросетей для генерации и монтажа видео. Инструменты, которые превращают текст в готовые ролики, экономят часы на съемках и постпродакшне. Подходит для SMM-специалистов,
VEED.IOVeed
MootionMootion
Sora (OpenAI)OpenAI
viralpulse.appViralpulse
Viral Maker AIViral-maker