Megatron-Core Linting & Formatting
Standardize Megatron-LM Python checks and formatting before code review.
The skill only directs local linting and formatting tools; no malware, credential handling, or exfiltration is evident. It uses uv sync --locked, and the repository CI shows constrained permissions. Deductions apply because fix mode modifies files without explicit user confirmation, backup/rollback guidance, data-flow disclosure, execution isolation, or clear recovery boundaries.
The commands, tool list, and check/fix paths are broadly consistent, and the benchmark reports passing static validation. Deductions apply because autoformat.sh, pyproject.toml, and the relevant CI configuration are not included in the target skill evidence; abnormal inputs, missing tools, version incompatibility, and diagnostic failure handling are unspecified. Under static calibration, the score remains at or below 10.
The audience, Megatron-LM context, trigger phrases, and main tools are reasonably clear, covering pre-PR checks and common lint issues. Deductions apply because non-fit cases, prerequisites, platform differences, and Chinese-language guidance are not stated. The container and uv assumptions limit environment fit, although the core function does not depend on overseas online services.
Front matter supplies the name, description, author, and Apache-2.0 license; the skill card adds use case, output, version, owner, and references, while command examples support progressive use. Deductions apply for missing metadata.tags, Instructions, Examples, and Purpose sections noted by the report, plus limited FAQ/known-limitations coverage, no substantive changelog, and no clear maintenance/update path. Repository license metadata is NOASSERTION.
The skill gives directly reusable commands and style rules for the core Megatron-LM linting and formatting task, likely reducing manual lookup. Deductions apply because no actual outputs, remediation workflow, or result verification are shown, and users must still validate script and tool configuration. The benchmark provides no usable Tier 3 results, so static calibration limits the score to 7 or below.
Commands, tool declarations, and benchmark static findings are reviewable, and the skill card provides a version and reference documentation. Deductions apply because the benchmark explicitly lacks Tier 3 task details, signals, and rollup, evals.json is empty, and no committed CI/test evidence covers this skill's key paths. Evidence is therefore limited to static material and remains at or below 5.
- Fix mode directly changes source files; confirm the working-tree scope and create a recoverable version-control checkpoint before execution.
- The guidance depends on tools/autoformat.sh, pyproject.toml, locked dependencies, and the container environment, so it may not run outside the corresponding Megatron-LM repository.
- Tier 3 evaluation is unavailable; the reported PASS should not be interpreted as completed end-to-end validation.
- Chinese-language guidance, systematic troubleshooting, and a tool-version compatibility matrix are not provided.
What does this skill do, and when should you use it?
This skill provides linting and formatting guidance for Megatron-LM, within NVIDIA’s Megatron-Core skill collection. It explains how to run autoformat.sh in check or fix mode and how to use black, isort, pylint, ruff, and mypy. It also defines project style rules for public APIs, docstrings, naming, line length, and exception handling. It is a good fit for PR preparation and style-violation fixes, although the source does not document a platform matrix or standalone test suite.
Runs tools/autoformat.sh in check-only or fix mode; directs users to run uv run isort on edited Python files; installs the linting dependency group inside a container with uv sync --locked --only-group linting; and states rules for public API type hints, Google-style docstrings, Python naming, a 119-character line limit, and specific exception handling.
- A Megatron-LM contributor wants to validate formatting and linting before opening a PR.
- A developer needs to address pre-commit fails, ruff errors, isort issues, mypy errors, or other style violations.
- A contributor has edited Python imports and needs to reorder them according to project conventions.
- A team needs the same linting tools used by autoformat.sh and the CI linting job inside a container.
What are this skill's strengths and limitations?
- Covers black, isort, pylint, ruff, and mypy, matching the tools named for autoformat.sh and CI linting.
- Provides copyable commands for checking, fixing, import ordering, and dependency setup.
- States concrete rules for public API typing, docstrings, naming, line length, and exception handling.
- The collection README documents CLI installation targets including Codex, Claude Code, and Cursor.
- Focused on Megatron-LM Python style and linting rather than general code quality or testing.
- The SKILL.md does not specify tool versions, operating-system support, or the full configuration files.
- No standalone test suite, sample failure output, or verification results are provided.
- Fix mode can modify files, so users should review their working-tree changes.
How do you install this skill?
Install the individual skill with the default skills CLI:
npx skills add nvidia/skills --skill mcore-linting-and-formatting --yes
Alternatively, run npx skills add nvidia/skills interactively and select the skill. The README does not specify a manual-copy destination for this individual skill.
How do you use this skill?
Trigger it with a relevant request such as: “pre-commit fails; help me run and fix Megatron-LM formatting checks.”
Check mode:
BASE_REF=main CHECK_ONLY=true SKIP_DOCS=false bash tools/autoformat.sh
Fix mode:
BASE_REF=main CHECK_ONLY=false bash tools/autoformat.sh
After editing Python imports:
uv run isort <file1>.py <file2>.py
Install the linting group inside the container:
uv sync --locked --only-group linting