← ClaudeAtlas

tsa-refactor-queuelisted

Build a top-N prioritized refactoring queue by intersecting three signals: health grade (which files are F/D), temporal churn (which files change most often), and dead-code density (which files carry the most unreachable symbols). For each candidate the queue surfaces (a) the dimension that dragged the grade down, (b) the target symbol, (c) blast radius from `codegraph_callers`, and (d) a concrete action — `split`, `delete dead`, or `extract`. Motivated by `docs/agent-tooling-gap-report.md` "Next High-Value Work" §5: use `check_project_health` output to open focused refactoring slices for the current F-grade files, starting with low-coverage Language Plugin extractors and `api.py`. Use when: - "Where should I refactor next?" / "Build me a refactor queue" - Post-feature cleanup pass - Engineering planning: "what would 2 weeks of cleanup buy us?" - Re-grading after a sprint: "did the queue shrink?" Replaces: per-file `check_file_health` loops + spreadsheet ranking (~25k tokens) with 3 parallel MCP calls + a det
aimasteracc/tree-sitter-analyzer · ★ 36 · AI & Automation · score 78
Install: claude install-skill aimasteracc/tree-sitter-analyzer
# tsa-refactor-queue — Top-N prioritized refactor slices > Three signals, one ranked list. Health × churn × dead-code → the five files > you'd refactor first if you had a week. Each row carries a target symbol, a > blast radius, and a concrete action. ## When to use - "What should we refactor next?" — daily/weekly engineering triage - Post-feature cleanup pass — find rot that accumulated while shipping - Pre-sprint planning — turn "we should clean up" into 5 concrete tickets - After a CI grade-drop alert from `tsa-health-watch` — re-rank with churn **Don't use** when: - You already know the file (one-file deep dive → `check_file_health` or `tsa-edit-safety`) - The codebase is brand-new (<2 weeks of git history) — churn signal is noise - You want to optimize one hot function — use `tsa-graph` + `refactoring_suggestions` directly - Shallow clone in CI — `git_state=shallow` makes mod_count_30d unreliable ## Procedure ### Step 1 — Single fan-out (parallel, 3 MCP calls) Call these in ONE message: 1. `check_project_health` with `min_grade: "D"` and `max_files: 20` — F/D files + per-file `weakest_dimension` 2. `codegraph_dead_code` with `limit: 200` — symbol-level dead candidates, grouped by file 3. `codegraph_complexity_heatmap` with `top_n: 20` — complexity-weighted file list (covers structural smell) The three responses overlap on file path. Joining on `file_path` gives a 3-signal table per candidate. ### Step 2 — Score and rank (deterministic, no LLM needed) For each