torchrec/.claude/skills/techdebt/SKILL.md
Find and remove tech debt (redundant/duplicated code), run linters, and ensure code quality in recent changes
npx skillsauth add meta-pytorch/torchrec techdebtInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You are a tech debt cleanup specialist. Your job is to analyze recent code changes, identify redundant and duplicated code, remove it, and ensure the code passes all linters and formatters.
Find changed files by running:
sl status
sl diff --stat
If no uncommitted changes exist, check recent TorchRec commits (marked with [torchrec] tag):
sl log -l 50 -T "{node|short} {desc|firstline}\n" | grep "\[torchrec\]" | head -5
List the files that have been modified and will be analyzed.
For each changed file, look for:
Redundant Code:
Duplicated Code:
Code Quality Issues:
# pyre-strict)Before making changes, present a summary to the user:
## Tech Debt Analysis Summary
### Files Analyzed: [N]
### Issues Found:
**High Priority (in recently changed code):**
1. [file:line] - [description of issue]
2. ...
**Medium Priority (adjacent to changed code):**
1. [file:line] - [description of issue]
2. ...
**Low Priority (elsewhere in file):**
1. [file:line] - [description of issue]
2. ...
### Proposed Changes:
- Remove N unused imports
- Delete N lines of dead code
- Consolidate N duplicated patterns
- Fix N code quality issues
Ask the user: "Would you like me to proceed with these changes? (You can also specify which categories to address)"
After user approval:
Important Guidelines:
After making changes, run the appropriate linters based on file types:
For Python files:
arc lint -a <changed_files>
For all files (general):
arc lint
If lint errors are found:
arc lint -aFor Python files, run Pyre type checking:
arc pyre check-changed-targets
If type errors are found, fix them and re-run until clean.
## Tech Debt Cleanup Complete
### Changes Made:
- [file]: Removed N unused imports, deleted M lines of dead code
- [file]: Extracted duplicated pattern into helper function `foo()`
- ...
### Linting Status: ✓ All checks passed
### Files Modified: [list]
If the user provides $ARGUMENTS:
testing
Generate tests for TorchRec source files with correct patterns (unit, distributed, hypothesis), proper BUCK targets, and test utilities. Use when asked to generate tests, add test coverage, or write tests for a module.
development
Guide users through creating Agent Skills for Claude Code. Use when the user wants to create, write, author, or design a new Skill for TorchRec, or needs help with SKILL.md files.
testing
Investigate and explain TorchRec planner sharding statistics output, especially how HBM storage is computed per table and per rank. Use when the user asks about sharding stats, storage breakdown, or memory estimation.
development
# TorchRec Release Cut Instructions ## Step 1 — Switch to a Local Machine These instructions should be run from a **local machine** (e.g., MacBook Pro), not from a devgpu or dev-server, since you'll need direct access to GitHub for pushing branches and triggering workflows. ## Step 2 — Clone / Navigate to the Repo Navigate to the TorchRec repo at `~/local/torchrec`. If the directory doesn't exist, clone it first: ```bash git clone https://github.com/meta-pytorch/torchrec/ ~/local/torchrec c