使い方
- インストールコマンドをコピーし、自分の環境へ導入する前にソースを確認します。
- 必要なツール、認証情報、対応環境を原文で確認します。
- 入力と成果物を指定し、出力を資料と照合します。
npx skills add https://github.com/decisionnerd/dev-skills --skill tidy-up開始前の確認
- 導入にはモデル契約、API枠、ファイルへのアクセス許可は含まれません。
- スター数や導入数は活動の指標であり、独立した品質・安全性試験ではありません。
見出し、例、コード、表、リンク、参照画像を含む原文を表示しています。
Tidy Up
Reclaim space and remove leftover local clutter without wrecking active work. Parse the first token as a command when it matches the table; otherwise map clear intent. Default with no useful target is `scan` (inventory + proposed cleanup), not blind delete.
Operating contract
Shared by every DecisionNerd/dev-skills skill. Canonical copy: handbook/concepts/14-operating-contract.md.
- Define done first. Before using tools, write the finish line in one or two lines: acceptance criteria (existing issue AC, BDD scenarios, tests, or contract; otherwise propose them and where they should live) and the evidence that will prove them. Re-check it before reporting done. Never report done on unverified work.
- Requested scope sets the finish line. A question ("is it ready?", "why is it broken?", "what next?") ends with the answer and a
Next:line naming the exact next invoke. An outcome request ("fix", "finish", "land", "#42") continues through the chain (diagnose → fix → test → check-readiness → merge-it) until the outcome or a real blocker. Do not end a turn with "Do you want me to…?" for in-scope, in-repo work. - Stop only for real blockers. Stop and ask only when you cannot continue without the user, or before: deleting data or unmerged work, force-push or history rewrite, changing anything outside this repository (GitHub objects, deployments, live data, production or paid resources, external services), or leaving the requested scope, unless the user's request already named that exact action. Keep the harness's permission prompts for risky commands. Otherwise keep going and put status notes in the same message as the next action.
- Ask well, once. For a genuine question use the harness's structured question tool when it has one (Claude Code:
AskUserQuestion; Codex:request_user_inputwhen the current mode supports it; T3 Code: thequestiontool) with concrete options; otherwise plain text with numbered options. Treat the answer as settled; do not re-open earlier verdicts, plans, or answers unless asked. - Fan out when work is parallel. Use subagents for independent reads (repo survey, evidence gathering, per-option research, per-area audits) and independent verification (a reviewer that did not write the change). Writes stay single-owner per path set and sequential. Brief every child with goal, done-when, constraints, must-not, and return shape; verify each result before consolidating. Use Claude Code's
Workflowtool only when orchestrating many subagents truly needs it; it is expensive. T3 Code: its delegated subagents — with optional worktree isolation for independent verification — cover this without theWorkflowtool. - Pick the model tier per child; defer to routing config. If the harness or user config already routes subagents, follow it and do not pass a model. Otherwise pick a tier per child: mechanical search or inventory → fast/cheap; implementation and evidence gathering → mid; planning, review, adversarial verification → top. Tier names differ per harness (Claude Code:
haiku/sonnet/opusorfable; T3 Code: inherit by default or pick from its live provider/model catalog). Set the choice with the harness's spawnmodelparam or agent frontmattermodel:(per-harness details:skills/agents/references/sub.md). Where the harness cannot choose, children inherit or the harness picks; say which in the status note. - Keep a checklist on long runs. For more than about five steps or work that crosses skills, keep
TASKS.mdat the repo root and tick items as they finish. Do not commit it unless the repo already tracks one. - Close every run with three headings.
Blocked on me(the one genuine question or blocker, else "none");Changed(files, commits, GitHub objects, deploys, else "nothing");Found(evidence, verdict, andNext: <exact invoke>).
Commands
| Command | What it does |
|---|---|
scan / plan / dry-run | Inventory clutter; estimate size; propose deletions (no deletes) |
workspaces / worktrees | Remove dangling / merged / abandoned git worktrees and empty workspace dirs |
artifacts / build | Remove stale build outputs (dist, build, .next, site, coverage, etc.) |
caches | Clear regenerable caches (tool/package caches in-repo; ask before global home caches) |
branches | Prune stale local branches (merged / gone remote); never delete unmerged without approval |
deep | Broader pass: workspaces + artifacts + caches + safe branch prune (still gated) |
all | Same as deep for the current repo (or named path); still inventory → approve → delete |
help / library | List commands |
Aliases: clean / cleanup / prune → map to the narrowest fitting command, or scan if unclear.
Target: repo root (default cwd), monorepo package path, or explicit directory.
Routing
- No argument / vague “tidy up”: run `scan`, then ask one structured multi-select question: which buckets to apply (workspaces / artifacts / caches / branches / deep), showing estimated sizes and risk level for each. Use the harness's structured question tool when available; otherwise plain text with numbered options.
- First word is a command: run it; remainder is path/scope.
- Clear intent (“remove old worktrees”, “clear .next”, “prune merged branches”): map and proceed.
- User already ordered exact deletes (“delete these worktrees”, “rm -rf dist and .next”): execute that scope; list what was removed under
Changed.
Hard safety rules
Follow references/safety.md. Summary:
- Inventory before delete — list paths + sizes + why removable.
- Never delete uncommitted changes, active worktree checkouts still in use,
.env/ secrets, or non-ignored source. - Prefer project-local cleanups; global caches (
~/Library/Caches, npm/pnpm/yarn global store, Docker) only when explicitly asked. - Prefer repo scripts (
npm run clean,make clean,git worktree prune) over ad-hocrm -rf. - No
git clean -fdxunless the user explicitly asks for that exact command after seeing what it would remove. - No force-delete of unmerged branches or worktrees with dirty status without explicit approval.
- After deletes, report what was removed and approximate space reclaimed under
Changed. - Single owner, no fan-out for deletes. Destructive commands run sequentially in the parent; no subagent fan-out for delete steps.
Default flow (scan → apply)
- Detect stack (git, node, python, rust, docker, turbo, etc.) and ignore rules.
- Inventory candidates (see references/targets.md).
- Present a table: path | kind | size | risk | command that would clean it.
- Ask which buckets to apply (or run the named command if already chosen).
- Execute (single-owner; no subagent fan-out for delete steps); re-scan briefly.
- Close with three headings:
Blocked on me(any high-risk item still awaiting approval),Changed(paths removed, approximate space reclaimed),Found(what remains; Next:<next invoke if applicable>).
Command notes
workspaces / worktrees
git worktree list --porcelain; prune withgit worktree prunefor missing dirs.- Remove worktrees whose branch is merged/deleted and working tree is clean — after approval.
- Drop empty leftover dirs from agent/cloud worktrees when safe.
- If a worktree is dirty or has an open PR tip, report and skip unless user forces.
artifacts / build
- Remove ignored build outputs that regenerate:
dist,build,out,site,.next,.nuxt,.output,coverage,*.tsbuildinfo, Storybook static, etc. - Respect monorepos: clean packages in scope only.
- Prefer
git clean -fdX -- <paths>(ignored only) over deleting tracked files.
caches
- In-repo:
.turbo,.cache,.parcel-cache,.vite,__pycache__,.pytest_cache,.mypy_cache,.ruff_cache,.eslintcache, native build caches when ignored. - Package managers: local
node_modules/.cache; ask beforepnpm store prune/ npm cache verify-delete / global Homebrew caches. - Do not delete
node_modulesunless the user asked (deepmay propose it, not auto-run).
branches
- Fetch/prune remotes when network ok:
git fetch --prune. - List merged locals and
goneupstreams; delete only after listing. - Keep: current branch, default branch, branches the user names as keepers.
deep / all
Run scan across all buckets, then apply approved buckets in order: workspaces → artifacts → caches → branches. Stop and ask if any high-risk item appears (Docker system prune, whole node_modules, unmerged branch).
Related skills
- Agent thrash left junk mid-run:
agents slapfirst, thentidy-up - Code structure cleanup (not disk clutter):
refactor-it - Situational awareness before cleaning:
recon
Grounding
This skill’s TTPs are grounded in current engineering baselines (DORA, GitHub Docs, Fowler/Beck, Google SRE & SWE book, OpenTelemetry, OWASP LLM / NIST AI RMF, Diátaxis — see handbook sources.md).
Inventory before delete (safe ops hygiene). Reclaim regenerable clutter and merged branches; never confuse tidy with deleting secrets or unmerged work.
Handbook card: handbook/practices/tidy-up.md.

