plugins/lint-fix/skills/lint-fix/SKILL.md
Check and fix lint issues for changed Python files. Supports single commit, commit range, and unstaged/staged working tree changes. Use when the user wants to verify or fix lint compliance.
npx skillsauth add primatrix/skills lint-fixInstall 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.
Target: $ARGUMENTS
If $ARGUMENTS is help (case-insensitive), output the following usage guide exactly as-is and stop:
/lint-fix - Check and fix lint issues for changed Python files.
Usage:
/lint-fix <commit> Check files changed in a single commit
/lint-fix <from>..<to> Check files changed across a commit range
/lint-fix unstaged Check unstaged working tree changes
/lint-fix staged Check staged (added but not committed) changes
/lint-fix help Show this help message
Examples:
/lint-fix HEAD Lint files changed in the latest commit
/lint-fix abc1234 Lint files changed in commit abc1234
/lint-fix main..HEAD Lint all files changed since branching from main
/lint-fix HEAD~5..HEAD Lint files changed in the last 5 commits
/lint-fix unstaged Lint files you've modified but not yet git-added
/lint-fix staged Lint files you've git-added but not yet committed
Linters (run in order): isort -> ruff -> black -> codespell
Parse $ARGUMENTS to determine which mode to use:
| Argument | Mode | Command to get changed .py files |
|---|---|---|
| unstaged | Unstaged working tree changes | git diff --name-only -- '*.py' |
| staged | Staged (added but not committed) | git diff --cached --name-only -- '*.py' |
| Contains .. (e.g. main..HEAD, HEAD~5..HEAD) | Commit range | git diff --name-only <from>..<to> -- '*.py' |
| Anything else (e.g. HEAD, abc1234) | Single commit | git diff --name-only <commit>^..<commit> -- '*.py' (fall back to git diff-tree --no-commit-id --name-only -r <commit> -- '*.py' for initial commits) |
After getting the file list, filter out any files that no longer exist on disk (deleted files).
If no Python files are found, report that and stop.
Run each linter on the changed files. The project's .pre-commit-config.yaml defines the canonical tool versions and flags. Use these defaults if no project config is found:
Check:
isort --check-only --diff --profile=black <files>
Fix if needed:
isort --profile=black <files>
ruff check --output-format=github --fix <files>
Check:
black --check <files>
Fix if needed:
black <files>
codespell <files>
If a linter is not installed, skip it and note the skip in the report.
Summarize:
If fixes were applied, show the diff summary and stage with git add <files> so the user can review before committing.
development
Use when analyzing TPU pretraining HBM occupancy from a profile directory — locates the static HBM peak (the same number TensorBoard's Memory Viewer shows), enumerates every buffer alive at the peak schedule moment with size / HLO instruction / opcode / op_name, and rolls the alive set up by opcode and op_name. Reads compile-time `*.hlo_proto.pb` (BufferAssignmentProto) as the primary source; runtime `*.xplane.pb` allocator events are a secondary, often-truncated signal.
testing
Use when analyzing TPU pretraining compute efficiency from xplane.pb — produces source-line-aggregated HLO duration tables, layer-scoped breakdowns, non-compute (padding/cast/copy) audits, and v7x roofline shortfall vs theoretical peak. Reads schema documented by profile-anatomy.
tools
--- name: comm-analysis description: Use when analyzing communication on a TPU pretraining profile — extracts every comm primitive (async + sync, TC + SparseCore), attributes axes via HLO replica_groups, computes per-row NCCL bus BW vs per-axis peak ICI BW (peak_link × k_torus_dims × directions_per_dim; TPUv7x: 200 GB/s bidir per link on a 3D torus; util% requires `--mesh-spec` with topology), and reports per-step compute/comm overlap. Builds on profile-anatomy. --- # Communication Analysis **
documentation
Use when reading TPU pretraining profiles (xplane.pb, trace.json.gz) — describes the on-disk layout, the XSpace/XPlane/XLine/XEvent/XStat hierarchy, and provides reference scripts that future tpu-perf skills can read as schema documentation.