Official agent skill

Run Pre Commit Checks

by microsoft in microsoft/vscode-python-environments

Run the mandatory pre-commit checks before committing code. An agent skill from microsoft/vscode-python-environments.

OfficialMITAuto-check passedTesting & QA

Install Run Pre Commit Checks

skills CLI
$ npx skills add microsoft/vscode-python-environments --skill run-pre-commit-checks -a claude-code

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

GitHub CLI
$ gh skill install microsoft/vscode-python-environments run-pre-commit-checks --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/microsoft/vscode-python-environments.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.github/skills/run-pre-commit-checks .claude/skills/run-pre-commit-checks && 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
run-pre-commit-checks
GitHub stars
141
Token cost
~898 tokens
SKILL.md length
303 words
Files
1
Skills in repo
9
Repo updated
First seen
Licence
MIT

At a glance

Run the mandatory pre-commit checks before committing code. An agent skill from microsoft/vscode-python-environments.

  • Works in 3 steps: Lint Check (Required) → Type Check (Required) → Unit Tests (Required)
  • Tasks that involve Linting and formatting
  • SKILL.md covers When to Use, Required Checks, Full Pre-Commit Workflow and Common Failures and Fixes, plus 2 more sections
  • Calls npm and git

What it does

Run Pre Commit Checks is an agent skill from microsoft/vscode-python-environments, published by the product's own GitHub organization. Run the mandatory pre-commit checks before committing code. Includes lint, type checking, and unit tests. MUST be run before every commit.

Its SKILL.md is about 900 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Testing & QA, covering Linting and formatting, Unit testing and Type safety. It works with TypeScript and ESLint. The repository describes itself as: VS Code extension for Python environment and package management. The licence is MIT.

When your agent uses it

  • Tasks that involve Linting and formatting
  • Tasks that involve Unit testing
  • Tasks that involve Type safety

Example prompts

  • “/run-pre-commit-checks”

Workflow steps

3 steps, taken from the step headings in SKILL.md.

  1. Lint Check (Required)
  2. Type Check (Required)
  3. Unit Tests (Required)

What it can do on your machine

Read from SKILL.md and the folder at commit 4faeedf. 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:

    • npm
    • git

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

  • Network

    No URLs in SKILL.md. Its commands use npm and git, 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

Run Pre Commit Checks loads about 898 tokens when it runs. Until then it costs about 40 tokens; SKILL.md has 303 words of instructions outside code blocks.

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

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 microsoft/vscode-python-environments at commit 4faeedf, republished under its MIT licence (© microsoft). 303 words, ~898 tokens.

Download SKILL.mdSave it as .claude/skills/run-pre-commit-checks/SKILL.md (or your agent's skills folder).
name
run-pre-commit-checks
description
Run the mandatory pre-commit checks before committing code. Includes lint, type checking, and unit tests. MUST be run before every commit.
argument-hint
--fix to auto-fix lint issues

Run Pre-Commit Checks

This skill defines the mandatory checks that must pass before any commit.

When to Use

  • ALWAYS before committing code changes
  • After fixing reviewer or Copilot review comments
  • Before pushing changes
  • When the maintainer agent requests pre-commit validation

Required Checks

All three checks must pass before committing:

1. Lint Check (Required)
powershell
npm run lint

What it checks:

  • ESLint rules defined in eslint.config.mjs
  • TypeScript-specific linting rules
  • Import ordering and unused imports
  • Code style consistency

To auto-fix issues:

powershell
npm run lint -- --fix
2. Type Check (Required)
powershell
npm run compile-tests

What it checks:

  • TypeScript type errors
  • Missing imports
  • Type mismatches
  • Strict null checks

Output location: out/ directory (not used for production)

3. Unit Tests (Required)
powershell
npm run unittest

What it checks:

  • All unit tests in src/test/ pass
  • Tests run with Mocha framework
  • Uses configuration from build/.mocha.unittests.json

Full Pre-Commit Workflow

powershell
# Run all checks in sequence
npm run lint
npm run compile-tests
npm run unittest

# If all pass, commit
git add -A
git commit -m "feat: your change description (Fixes #N)"

Common Failures and Fixes

ESLint Errors
ErrorFix
@typescript-eslint/no-unused-varsRemove unused variable or prefix with _
import/orderRun npm run lint -- --fix
@typescript-eslint/no-explicit-anyAdd proper type annotation
no-consoleUse traceLog/traceVerbose instead of console.log
Type Errors
ErrorFix
TS2339: Property does not existCheck property name or add type guard
TS2345: Argument type not assignableCheck function parameter types
TS2322: Type not assignableAdd type assertion or fix type mismatch
TS18048: possibly undefinedAdd null check or use optional chaining
Test Failures
  1. Read the test failure message carefully
  2. Check if you changed behavior that tests depend on
  3. Update tests if behavior change is intentional
  4. Fix code if behavior change is unintentional

Integration with Review Process

The maintainer agent workflow requires:

Code Change → Reviewer Agent → Pre-Commit Checks → Commit
                    ↓
              Fix Issues → Re-run Reviewer → Pre-Commit Checks

Never skip pre-commit checks. They catch:

  • Type errors that would break the extension
  • Style inconsistencies
  • Regressions in existing functionality

Automation Note

These checks should also be run:

  • By CI on every PR (automated)
  • After addressing review comments (manual trigger)
  • Before merging (automated by CI)

The hooks system can automate running lint after file edits (see .github/hooks/).

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

Files

Just SKILL.md in .github/skills/run-pre-commit-checks of microsoft/vscode-python-environments.

Open the folder on GitHubat commit 4faeedf

Compare with similar skills

Run Pre Commit Checks 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.

Run Pre Commit Checks compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Run Pre Commit Checks this skillmicrosoft/vscode-python-environments141—~898Automated safety check: PassMIT
Implementing Lint Rulesflint-fyi/flint311—~857Automated safety check: PassMIT
Eslint Vitest Rule Testerantfu-collective/eslint-vitest-rule-tester142—~1.3kAutomated safety check: PassMIT
Typescriptalinaqi/maggy707—~1.3kAutomated safety check: PassMIT
Npx CLIjwynia/agent-skills165—~2.4kAutomated safety check: PassNone
Typescript Rulessoftspark/ai-toolkit179—~2.7kAutomated safety check: NotesApache-2.0

Similar skills

  • Implements ESLint-style lint rules with proper AST handling, targeted reporting, and comprehensive unit tests.

    311 GitHub stars~857 tokensUpdated today
    DevelopmentAuto-check passed
  • Eslint Vitest Rule Tester

    antfu-collective/eslint-vitest-rule-tester

    Help users test ESLint rules with Vitest, supporting snapshot testing and custom assertions

    142 GitHub stars~1.3k tokensUpdated 27 days ago
    Testing & QAAuto-check passed
  • Typescript

    alinaqi/maggy

    TypeScript strict mode with eslint and jest. An agent skill from alinaqi/maggy.

    707 GitHub stars~1.3k tokensUpdated 13 days ago
    Testing & QAAuto-check passed
  • Npx CLI

    jwynia/agent-skills

    Build and publish npx-executable CLI tools using Bun as the primary toolchain with npm-compatible output.

    165 GitHub stars~2.4k tokensUpdated 7 mo ago
    DevelopmentAuto-check passed
  • Typescript Rules

    softspark/ai-toolkit

    TypeScript/JavaScript coding rules: style, patterns, security, testing.

    179 GitHub stars~2.7k tokensUpdated today
    Testing & QAAuto-check: notes
  • Typescript Tooling

    HoangNguyen0403/agent-skills-standard

    Development tools, linting, and build config for TypeScript.

    570 GitHub stars~688 tokensUpdated today
    DevelopmentAuto-check passed

More from microsoft/vscode-python-environments

All 9 skills in this repo
  • Cross Platform Paths

    microsoft/vscode-python-environments

    Official

    Critical patterns for cross-platform path handling in this VS Code extension.

    141 GitHub stars~1.5k tokensUpdated today
    Auto-check passed
  • Python Manager Discovery

    microsoft/vscode-python-environments

    Official

    Environment manager-specific discovery patterns and known issues.

    141 GitHub stars~2.7k tokensUpdated today
    Auto-check passed
  • Run E2E Tests

    microsoft/vscode-python-environments

    Official

    Run E2E tests to verify complete user workflows like environment discovery, creation, and selection.

    141 GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Run Integration Tests

    microsoft/vscode-python-environments

    Official

    Run integration tests to verify that extension components work together correctly.

    141 GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Run Smoke Tests

    microsoft/vscode-python-environments

    Official

    Run smoke tests to verify extension functionality in a real VS Code environment.

    141 GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Debug Failing Test

    microsoft/vscode-python-environments

    Official

    Debug a failing test using an iterative logging approach, then clean up and document the learning.

    141 GitHub stars~780 tokensUpdated today
    Auto-check passed

Questions about Run Pre Commit Checks

What does Run Pre Commit Checks do?

Run the mandatory pre-commit checks before committing code. An agent skill from microsoft/vscode-python-environments. Run Pre Commit Checks is an agent skill from microsoft/vscode-python-environments, published by the product's own GitHub organization. Run the mandatory pre-commit checks before committing code.

When should I use Run Pre Commit Checks?

Run Pre Commit Checks fits situations like: tasks that involve Linting and formatting; tasks that involve Unit testing; tasks that involve Type safety.

How do I install Run Pre Commit Checks in Claude Code?

Run `npx skills add microsoft/vscode-python-environments --skill run-pre-commit-checks -a claude-code`. Or copy the skill folder (.github/skills/run-pre-commit-checks in microsoft/vscode-python-environments) into .claude/skills/run-pre-commit-checks in your project. Claude Code loads it when a task matches its description.

How do I install Run Pre Commit Checks in Codex?

Run `npx skills add microsoft/vscode-python-environments --skill run-pre-commit-checks -a codex`. Or copy the skill folder (.github/skills/run-pre-commit-checks in microsoft/vscode-python-environments) into .agents/skills/run-pre-commit-checks in your project. Codex loads it when a task matches its description.

Can I use Run Pre Commit Checks 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 microsoft/vscode-python-environments --skill run-pre-commit-checks -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/run-pre-commit-checks, .gemini/skills/run-pre-commit-checks, .github/skills/run-pre-commit-checks and .opencode/skills/run-pre-commit-checks in your project.

What does Run Pre Commit Checks need to run?

Going by SKILL.md and its folder, Run Pre Commit Checks needs the command-line tools its instructions call (npm and git).

Does Run Pre Commit Checks access the network?

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

Is Run Pre Commit Checks 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 Run Pre Commit Checks use?

Run Pre Commit Checks is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Run Pre Commit Checks use?

About 898 tokens (SKILL.md is roughly 3.6k 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 Run Pre Commit Checks?

Skills that share tags, products or a category with Run Pre Commit Checks: Implementing Lint Rules (flint-fyi/flint, 311 stars), Eslint Vitest Rule Tester (antfu-collective/eslint-vitest-rule-tester, 142 stars), Typescript (alinaqi/maggy, 707 stars) and Npx CLI (jwynia/agent-skills, 165 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Run Pre Commit Checks?

microsoft (a GitHub organization, an official publisher) maintains it in microsoft/vscode-python-environments, which has 141 GitHub stars. The repository holds 9 skills in this directory. The repository was last updated on October 7, 2026.

Source: microsoft/vscode-python-environments on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.