Generated banner for Mcore Linting And Formatting
Generated logo for Mcore Linting And Formatting

Mcore Linting And Formatting

NVIDIAOfficialCreated by Philip PetrakianDistributed by NVIDIA

  • Skill
  • Tool integration
  • Software development
  • Apache-2.0
  • Medium risk

From the author

Linting and formatting for Megatron-LM. Covers running autoformat.sh, tools (ruff, black, isort, pylint, mypy), and code style rules.
— the description by Philip Petrakian

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

This skill provides the necessary commands and style guidelines for maintaining code quality in Megatron-LM. It covers the execution of automated formatting scripts, the management of linting tools, and specific coding standards required for the codebase.

What it does

  • Provides instructions for running the automated formatting script.
  • Lists the specific linting tools used, including ruff, black, isort, pylint, and mypy.
  • Outlines requirements for type hints and docstring formats.
  • Defines naming conventions and line length constraints.
  • Explains how to set up the linting environment using uv.

When to use it

  • Before submitting a pull request to ensure code style consistency.
  • When fixing style violations reported by CI.
  • After modifying imports in Python files.
  • When setting up a local development environment for linting.

Advantages

  • Ensures adherence to project-specific coding standards.
  • Automates the process of code formatting and linting.
  • Provides a centralized reference for style rules and tool usage.

Usage examples

“How do I run the autoformatter for Megatron-LM?”
The agent provides the command to run tools/autoformat.sh in either check-only or fix mode.
“What are the naming conventions for Megatron-LM?”
The agent explains the use of snake_case for functions and variables and PascalCase for classes.

Install

  1. Download the skill as a ZIP:

    https://autogineer.com/agent-skills/nvidia/mcore-linting-and-formatting/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip mcore-linting-and-formatting.zip -d .agents/skills

Documentation by Philip Petrakian

Linting and Formatting


Running the Formatter

Run before opening a PR:

# 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:

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

Setting Up the Linting Group

Inside the container:

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

  • Type hints: required on all public API functions. Use X | None, not Optional[X].

  • Docstrings: Google-style on all public classes and functions.

  • Naming: follow Python conventions — snake_case for functions and variables, PascalCase for classes.

  • Line length: 119 characters (configured in pyproject.toml).

  • No bare except: always catch specific exception types.

Files

skill-card.md

Description: <br>

Linting and formatting for Megatron-LM. Covers running autoformat.sh, tools (ruff, black, isort, pylint, mypy), and code style rules. <br>

This skill is ready for commercial/non-commercial use. <br>

Owner

NVIDIA <br>

License/Terms of Use: <br>

Apache-2.0 <br>

Use Case: <br>

Developers and engineers use this skill to run linting and autoformatting tools on Megatron-LM code, ensuring style compliance before submitting pull requests. <br>

Deployment Geography for Use: <br>

Global <br>

Known Risks and Mitigations: <br>

Risk: Review before execution as proposals could introduce incorrect or misleading guidance into skills. <br> Mitigation: Review and scan skill before deployment. <br>

Reference(s): <br>

Skill Output: <br>

Output Type(s): [Shell commands, Configuration instructions] <br> Output Format: [Markdown with inline bash code blocks] <br> Output Parameters: [1D] <br> Other Properties Related to Output: [None] <br>

Evaluation Tasks: <br>

3-Tier Evaluation from NVSkills-Eval with external profile. Overall verdict: PASS. <br>

Evaluation Metrics Used: <br>

Reported benchmark dimensions: <br>

  • Security: Checks whether skill-assisted execution avoids unsafe behavior such as secret leakage, destructive commands, or unauthorized access. <br>

  • Correctness: Checks whether the agent follows the expected workflow and produces the correct final output. <br>

  • Discoverability: Checks whether the agent loads the skill when relevant and avoids using it when irrelevant. <br>

  • Effectiveness: Checks whether the agent performs measurably better with the skill than without it. <br>

  • Efficiency: Checks whether the agent uses fewer tokens and avoids redundant work. <br>

Skill Version(s): <br>

core_v0.15.0rc7-1652-g1325db3b5 (source: git tag) <br>

Ethical Considerations: <br>

NVIDIA believes Trustworthy AI is a shared responsibility and we have established policies and practices to enable development for a wide array of AI applications. When downloaded or used in accordance with our terms of service, developers should work with their internal team to ensure this skill meets requirements for the relevant industry and use case and addresses unforeseen product misuse. <br>

(For Release on NVIDIA Platforms Only) <br> Please report quality, risk, security vulnerabilities or NVIDIA AI Concerns here. <br>

Requirements and compatibility

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Needs: Needs Python

Security

What our scanner noticed· Medium risk

  • Large base64-encoded blobs

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Created by
Philip Petrakian
Publisher
NVIDIA (Official)
Distributed by
NVIDIA
Source
NVIDIA/skills · skills/mcore-linting-and-formatting · commit fce3cca
Licence
Apache License 2.0 (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE-APACHE)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by Philip Petrakian or NVIDIA.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download mcore-linting-and-formatting.zip