Official agent skill

Megatron-LM Linting and Formatting

by NVIDIA in NVIDIA/Megatron-LM

Runs the Megatron-LM autoformat script and its linting tools before a pull request, and keeps Python imports in order with isort.

OfficialApache-2.0Auto-check passedDevelopment

Install Megatron-LM Linting and Formatting

skills CLI
$ npx skills add NVIDIA/Megatron-LM --skill mcore-linting-and-formatting -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install NVIDIA/Megatron-LM mcore-linting-and-formatting --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/NVIDIA/Megatron-LM.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/mcore-linting-and-formatting .claude/skills/mcore-linting-and-formatting && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
mcore-linting-and-formatting
GitHub stars
18k
Token cost
~316 tokens
SKILL.md length
66 words
Files
5
Skills in repo
14
Repo updated
First seen
Licence
Apache-2.0

At a glance

Runs the Megatron-LM autoformat script and its linting tools before a pull request, and keeps Python imports in order with isort.

  • Preparing a Megatron-LM pull request
  • SKILL.md covers Running the Formatter, Import Ordering, Setting Up the Linting Group and Code Style Rules
  • Calls uv and bash
  • Checking formatting without changing files before CI runs

What it does

Before opening a PR, the agent runs `tools/autoformat.sh` with environment variables such as `BASE_REF=main`, `CHECK_ONLY=true` and `SKIP_DOCS=false` for a check that applies no changes. The script invokes `black`, `isort`, `pylint`, `ruff` and `mypy`. After editing imports in any Python file, the agent runs `uv run isort` on those files before committing.

To prepare the tools inside the container, `uv sync --locked --only-group linting` installs `ruff`, `black`, `isort` and `pylint`, the same ones used by the autoformat script and by the linting job in CI. Code style rules are not repeated in the skill, which refers to the project's `style-guide.md`. The folder also holds evaluation files and a skill card.

When your agent uses it

  • Preparing a Megatron-LM pull request
  • Checking formatting without changing files before CI runs
  • Fixing import order after editing Python files

Example prompts

  • “Run the Megatron-LM formatter in check-only mode against main before I open a PR.”
  • “I changed imports in two files, so sort them the way the repo expects.”
  • “Set up the linting dependencies inside the container.”

Requirements

  • A Megatron-LM checkout with `tools/autoformat.sh`
  • uv
  • The project's linting dependency group

What it can do on your machine

Read from SKILL.md and the folder at commit eb50202. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • uv
    • bash

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use uv, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Megatron-LM Linting and Formatting loads about 316 tokens when it runs. Until then it costs about 86 tokens; SKILL.md has 66 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~86
When it runs · the whole SKILL.md, loaded when a task matches
~316

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from NVIDIA/Megatron-LM at commit eb50202, republished under its Apache-2.0 licence (© NVIDIA). 66 words, ~316 tokens.

Download SKILL.mdSave it as .claude/skills/mcore-linting-and-formatting/SKILL.md (or your agent's skills folder). This skill also uses 4 other files; get the full folder from GitHub.
name
mcore-linting-and-formatting
description
Linting and formatting for Megatron-LM. Covers running autoformat.sh, tools (ruff, black, isort, pylint, mypy), and code style rules. Use when running linting or autoformat; fixing style violations before a PR; 'pre-commit fails', 'ruff error', 'isort', 'mypy', 'style violation', 'how do I format', 'autoformat.sh'.
license
Apache-2.0
metadata.author
Oliver Koenig <okoenig@nvidia.com>

Linting and Formatting


Running the Formatter

Run before opening a PR:

bash
# Check mode (no changes applied)
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

Tools invoked: black, isort, pylint, ruff, mypy.


Import Ordering

After editing imports in any Python files, always run uv run isort on those files before committing:

bash
uv run isort <file1>.py <file2>.py

Setting Up the Linting Group

Inside the container:

bash
uv sync --locked --only-group linting

This installs ruff, black, isort, pylint — the same tools used by tools/autoformat.sh and CI's linting job.


Code Style Rules

Follow style-guide.md.

© NVIDIA, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 4 other files in skills/mcore-linting-and-formatting of NVIDIA/Megatron-LM.

  • SKILL.md
  • BENCHMARK.md
  • evals/evals.json
  • skill-card.md
  • skill.oms.sig

Open the folder on GitHubat commit eb50202

Compare with similar skills

Megatron-LM Linting and Formatting next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Megatron-LM Linting and Formatting compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Megatron-LM Linting and Formatting this skillNVIDIA/Megatron-LM18k—~316Automated safety check: PassApache-2.0
Align Recipe pyproject.tomlgoogle/adk-recipes10k—~4.6kAutomated safety check: PassApache-2.0
Cb Code QualityBlkLeg/CircuitBreaker201—~1.9kAutomated safety check: PassMIT
Code Qualitynotque/vexjoy-agent439—~1.5kAutomated safety check: NotesMIT
ONNX Runtime Lintmicrosoft/onnxruntime22k—~392Automated safety check: PassMIT
Vibe Python Style Guidemistralai/mistral-vibe5.1k—~1.2kAutomated safety check: PassApache-2.0

Similar skills

  • Align Recipe pyproject.toml

    google/adk-recipes

    Official

    Brings a Python recipe's pyproject.toml in line with the repo's CI rules, either as a read-only dry run or by rewriting the file while keeping comments.

    10k GitHub stars~4.6k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Cb Code Quality

    BlkLeg/CircuitBreaker

    Circuit Breaker code conventions and the quality gates that actually block a push — ruff, mypy, eslint, the pytest coverage ratchet, and the make verify tiers.

    201 GitHub stars~1.9k tokensUpdated 4 days ago
    DevelopmentAuto-check passed
  • Code Quality

    notque/vexjoy-agent

    Code quality: cleanup, linting, formatting, quality gates. An agent skill from notque/vexjoy-agent.

    439 GitHub stars~1.5k tokensUpdated 7 days ago
    DevelopmentAuto-check: notes
  • ONNX Runtime Lint

    microsoft/onnxruntime

    Official

    Lints and formats C++ and Python code in the ONNX Runtime repository with lintrunner, clang-format and ruff, preferring a pass over only the changed files.

    22k GitHub stars~392 tokensUpdated today
    DevelopmentAuto-check passed
  • Vibe Python Style Guide

    mistralai/mistral-vibe

    Official

    Python conventions for the Mistral Vibe codebase covering style, strict typing, imports, Pydantic patterns, logging, error handling and file I/O.

    5.1k GitHub stars~1.2k tokensUpdated 2 days ago
    DevelopmentAuto-check passed
  • 使用Plankton进行编写时代码质量强制执行——通过钩子在每次文件编辑时自动格式化、代码检查和Claude驱动的修复。

    276k GitHub starsUsed in 2 repos~1.3k tokens
    DevelopmentAuto-check passed

More from NVIDIA/Megatron-LM

All 14 skills in this repo
  • Official

    Walks an agent through working inside the Megatron-LM CI container and changing dependencies with uv, so lock files resolve the same locally and in CI.

    18k GitHub stars~2.6k tokensUpdated today
    Auto-check passed
  • Megatron-LM Base Image Bump

    NVIDIA/Megatron-LM

    Official

    Moves Megatron-LM CI to a newer NVIDIA PyTorch base image, updating both the GitHub and GitLab pins together and handling the CI follow-up.

    18k GitHub stars~2.8k tokensUpdated today
    Auto-check passed
  • Megatron-LM CI/CD Guide

    NVIDIA/Megatron-LM

    Official

    Explains Megatron-LM's CI pipeline, PR scope labels, triggering the internal GitLab CI with a dry run first, and investigating CI failures.

    18k GitHub stars~1.8k tokensUpdated today
    Auto-check passed
  • Official

    Investigates a failing GitHub Actions run or job for Megatron-LM, finds the root cause plus the PR and test author involved, and files a structured bug issue.

    18k GitHub stars~1.6k tokensUpdated today
    Auto-check passed
  • Official

    Guides moving Megatron Core GPTModel checkpoints, configs, training commands and launch scripts to HybridModel, following the repository's migration document.

    18k GitHub stars~1.6k tokensUpdated today
    Auto-check passed
  • Official

    Creates one-node GitHub merge-request variants of existing two-node GB200 functional tests in Megatron-LM, adjusting parallelism settings to fit four GPUs.

    18k GitHub stars~1.3k tokensUpdated today
    Auto-check passed

Categories

Questions about Megatron-LM Linting and Formatting

What does Megatron-LM Linting and Formatting do?

Runs the Megatron-LM autoformat script and its linting tools before a pull request, and keeps Python imports in order with isort. sh` with environment variables such as `BASE_REF=main`, `CHECK_ONLY=true` and `SKIP_DOCS=false` for a check that applies no changes. The script invokes `black`, `isort`, `pylint`, `ruff` and `mypy`.

When should I use Megatron-LM Linting and Formatting?

Megatron-LM Linting and Formatting fits situations like: preparing a Megatron-LM pull request; checking formatting without changing files before CI runs; fixing import order after editing Python files.

How do I install Megatron-LM Linting and Formatting in Claude Code?

Run `npx skills add NVIDIA/Megatron-LM --skill mcore-linting-and-formatting -a claude-code`. Or copy the skill folder (skills/mcore-linting-and-formatting in NVIDIA/Megatron-LM) into .claude/skills/mcore-linting-and-formatting in your project. Claude Code loads it when a task matches its description.

How do I install Megatron-LM Linting and Formatting in Codex?

Run `npx skills add NVIDIA/Megatron-LM --skill mcore-linting-and-formatting -a codex`. Or copy the skill folder (skills/mcore-linting-and-formatting in NVIDIA/Megatron-LM) into .agents/skills/mcore-linting-and-formatting in your project. Codex loads it when a task matches its description.

Can I use Megatron-LM Linting and Formatting in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add NVIDIA/Megatron-LM --skill mcore-linting-and-formatting -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/mcore-linting-and-formatting, .gemini/skills/mcore-linting-and-formatting, .github/skills/mcore-linting-and-formatting and .opencode/skills/mcore-linting-and-formatting in your project.

What does Megatron-LM Linting and Formatting need to run?

Going by SKILL.md and its folder, Megatron-LM Linting and Formatting needs the command-line tools its instructions call (uv and bash). Our summary lists: A Megatron-LM checkout with `tools/autoformat.sh`; uv; The project's linting dependency group.

Does Megatron-LM Linting and Formatting access the network?

SKILL.md contains no URLs. Its commands use uv, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Megatron-LM Linting and Formatting safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Megatron-LM Linting and Formatting use?

Megatron-LM Linting and Formatting is published under the Apache-2.0 licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Megatron-LM Linting and Formatting use?

About 316 tokens (SKILL.md is roughly 1.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Megatron-LM Linting and Formatting?

Skills that share tags, products or a category with Megatron-LM Linting and Formatting: Align Recipe pyproject.toml (google/adk-recipes, 10k stars), Cb Code Quality (BlkLeg/CircuitBreaker, 201 stars), Code Quality (notque/vexjoy-agent, 439 stars) and ONNX Runtime Lint (microsoft/onnxruntime, 22k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Megatron-LM Linting and Formatting?

NVIDIA (a GitHub organization, an official publisher) maintains it in NVIDIA/Megatron-LM, which has 18,094 GitHub stars. The repository holds 14 skills in this directory. The repository was last updated on October 9, 2026.

Source: NVIDIA/Megatron-LM on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.